Files
tar1090/html/libs/ol-custom019.js
Matthias Wirth dfa20b6121 update openlayers
2022-07-22 20:41:48 +02:00

5 lines
679 KiB
JavaScript
Raw Blame History

This file contains invisible Unicode characters
This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports):"function"==typeof define&&define.amd?define(["exports"],e):e((t="undefined"!=typeof globalThis?globalThis:t||self).ol={})}(this,(function(t){"use strict";var e=0,r=1,n=2,i=3,o=4;function a(){return function(){throw new Error("Unimplemented abstract method.")}()}var s=0;function l(t){return t.ol_uid||(t.ol_uid=String(++s))}function u(t,e,r){return void 0===r&&(r=[0,0]),r[0]=t[0]+2*e,r[1]=t[1]+2*e,r}function h(t){return t[0]>0&&t[1]>0}function c(t,e,r){return void 0===r&&(r=[0,0]),r[0]=t[0]*e+.5|0,r[1]=t[1]*e+.5|0,r}function p(t,e){return Array.isArray(t)?t:(void 0===e?e=[t,t]:(e[0]=t,e[1]=t),e)}var f,d=function(){function t(t){this.opacity_=t.opacity,this.rotateWithView_=t.rotateWithView,this.rotation_=t.rotation,this.scale_=t.scale,this.scaleArray_=p(t.scale),this.displacement_=t.displacement,this.declutterMode_=t.declutterMode}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(),declutterMode:this.getDeclutterMode()})},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.getDeclutterMode=function(){return this.declutterMode_},t.prototype.getAnchor=function(){return a()},t.prototype.getImage=function(t){return a()},t.prototype.getHitDetectionImage=function(){return a()},t.prototype.getPixelRatio=function(t){return 1},t.prototype.getImageState=function(){return a()},t.prototype.getImageSize=function(){return a()},t.prototype.getOrigin=function(){return a()},t.prototype.getSize=function(){return a()},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_=p(t)},t.prototype.listenImageChange=function(t){a()},t.prototype.load=function(){a()},t.prototype.unlistenImageChange=function(t){a()},t}(),g=d,y=(f=function(t,e){return f=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])},f(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}f(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}),v=function(t){function e(e){var r=this,n="Assertion failed. See https://openlayers.org/en/"+("v"+"6.15.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 y(e,t),e}(Error);function _(t,e){if(!t)throw new v(e)}function m(t,e,r){return Math.min(Math.max(t,e),r)}var x="cosh"in Math?Math.cosh:function(t){var e=Math.exp(t);return(e+1/e)/2},w="log2"in Math?Math.log2:function(t){return Math.log(t)*Math.LOG2E};function b(t,e,r,n,i,o){var a=i-r,s=o-n;if(0!==a||0!==s){var l=((t-r)*a+(e-n)*s)/(a*a+s*s);l>1?(r=i,n=o):l>0&&(r+=a*l,n+=s*l)}return S(t,e,r,n)}function S(t,e,r,n){var i=r-t,o=n-e;return i*i+o*o}function C(t){return 180*t/Math.PI}function E(t){return t*Math.PI/180}function T(t,e){var r=t%e;return r*e<0?r+e:r}function P(t,e,r){return t+r*(e-t)}function R(t,e){var r=Math.pow(10,e);return Math.round(t*r)/r}function O(t,e){return Math.round(R(t,e))}function F(t,e){return Math.floor(R(t,e))}function M(t,e){return Math.ceil(R(t,e))}var I=/^#([a-f0-9]{3}|[a-f0-9]{4}(?:[a-f0-9]{2}){0,2})$/i,L=/^([a-z]*)$|^hsla?\(.*\)$/i;function A(t){return"string"==typeof t?t:z(t)}function k(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""}var D=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;L.exec(t)&&(t=k(t));if(I.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(")?G(o=t.slice(5,-1).split(",").map(Number)):0==t.indexOf("rgb(")?((o=t.slice(4,-1).split(",").map(Number)).push(1),G(o)):_(!1,14);return o}(r),t[r]=n,++e}return n}}();function j(t){return Array.isArray(t)?t:D(t)}function G(t){return t[0]=m(t[0]+.5|0,0,255),t[1]=m(t[1]+.5|0,0,255),t[2]=m(t[2]+.5|0,0,255),t[3]=m(t[3],0,1),t}function z(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)+")"}function N(t){return Array.isArray(t)?z(t):t}var U="undefined"!=typeof navigator&&void 0!==navigator.userAgent?navigator.userAgent.toLowerCase():"",B=-1!==U.indexOf("firefox"),V=-1!==U.indexOf("safari")&&-1==U.indexOf("chrom")&&!!(U.indexOf("version/15.4")>=0||U.match(/cpu (os|iphone os) 15_4 like mac os x/)),X=-1!==U.indexOf("webkit")&&-1==U.indexOf("edge"),W=-1!==U.indexOf("macintosh"),q="undefined"!=typeof devicePixelRatio?devicePixelRatio:1,Y="undefined"!=typeof WorkerGlobalScope&&"undefined"!=typeof OffscreenCanvas&&self instanceof WorkerGlobalScope,K="undefined"!=typeof Image&&Image.prototype.decode,Z=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}();function H(t,e,r,n){var i;return i=r&&r.length?r.shift():Y?new OffscreenCanvas(t||300,e||300):document.createElement("canvas"),t&&(i.width=t),e&&(i.height=e),i.getContext("2d",n)}function J(t){var e=t.canvas;e.width=1,e.height=1,t.clearRect(0,0,1,1)}function Q(t){var e=t.offsetWidth,r=getComputedStyle(t);return e+=parseInt(r.marginLeft,10)+parseInt(r.marginRight,10)}function $(t){var e=t.offsetHeight,r=getComputedStyle(t);return e+=parseInt(r.marginTop,10)+parseInt(r.marginBottom,10)}function tt(t,e){var r=e.parentNode;r&&r.replaceChild(t,e)}function et(t){return t&&t.parentNode?t.parentNode.removeChild(t):null}function rt(t){for(;t.lastChild;)t.removeChild(t.lastChild)}var nt=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}(),it="propertychange",ot=function(){function t(){this.disposed=!1}return t.prototype.dispose=function(){this.disposed||(this.disposed=!0,this.disposeInternal())},t.prototype.disposeInternal=function(){},t}();function at(t,e){return t>e?1:t<e?-1:0}function st(t,e){return t.indexOf(e)>=0}function lt(t,e,r){var n=t.length;if(t[0]<=e)return 0;if(e<=t[n-1])return n-1;var i=void 0;if(r>0){for(i=1;i<n;++i)if(t[i]<e)return i-1}else if(r<0){for(i=1;i<n;++i)if(t[i]<=e)return i}else for(i=1;i<n;++i){if(t[i]==e)return i;if(t[i]<e)return"function"==typeof r?r(e,t[i-1],t[i])>0?i-1:i:t[i-1]-e<e-t[i]?i-1:i}return n-1}function ut(t,e,r){for(;e<r;){var n=t[e];t[e]=t[r],t[r]=n,++e,--r}}function ht(t,e){for(var r=Array.isArray(e)?e:[e],n=r.length,i=0;i<n;i++)t[t.length]=r[i]}function ct(t,e){var r=t.length;if(r!==e.length)return!1;for(var n=0;n<r;n++)if(t[n]!==e[n])return!1;return!0}function pt(){return!0}function ft(){return!1}function dt(){}var gt="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;n<i;++n){var o=arguments[n];if(null!=o)for(var a in o)o.hasOwnProperty(a)&&(r[a]=o[a])}return r};function yt(t){for(var e in t)delete t[e]}var vt="function"==typeof Object.values?Object.values:function(t){var e=[];for(var r in t)e.push(t[r]);return e};function _t(t){var e;for(e in t)return!1;return!e}var mt=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)}}(),xt=function(t){function e(e){var r=t.call(this)||this;return r.eventTarget_=e,r.pendingRemovals_=null,r.dispatching_=null,r.listeners_=null,r}return mt(e,t),e.prototype.addEventListener=function(t,e){if(t&&e){var r=this.listeners_||(this.listeners_={}),n=r[t]||(r[t]=[]);-1===n.indexOf(e)&&n.push(e)}},e.prototype.dispatchEvent=function(t){var e="string"==typeof t,r=e?t:t.type,n=this.listeners_&&this.listeners_[r];if(n){var i=e?new nt(t):t;i.target||(i.target=this.eventTarget_||this);var o,a=this.dispatching_||(this.dispatching_={}),s=this.pendingRemovals_||(this.pendingRemovals_={});r in a||(a[r]=0,s[r]=0),++a[r];for(var l=0,u=n.length;l<u;++l)if(!1===(o="handleEvent"in n[l]?n[l].handleEvent(i):n[l].call(this,i))||i.propagationStopped){o=!1;break}if(0==--a[r]){var h=s[r];for(delete s[r];h--;)this.removeEventListener(r,dt);delete a[r]}return o}},e.prototype.disposeInternal=function(){this.listeners_&&yt(this.listeners_)},e.prototype.getListeners=function(t){return this.listeners_&&this.listeners_[t]||void 0},e.prototype.hasListener=function(t){return!!this.listeners_&&(t?t in this.listeners_:Object.keys(this.listeners_).length>0)},e.prototype.removeEventListener=function(t,e){var r=this.listeners_&&this.listeners_[t];if(r){var n=r.indexOf(e);-1!==n&&(this.pendingRemovals_&&t in this.pendingRemovals_?(r[n]=dt,++this.pendingRemovals_[t]):(r.splice(n,1),0===r.length&&delete this.listeners_[t]))}},e}(ot),wt="change",bt="error",St="contextmenu",Ct="click",Et="dblclick",Tt="dragenter",Pt="dragover",Rt="drop",Ot="keydown",Ft="keypress",Mt="load",It="resize",Lt="touchmove",At="wheel";function kt(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 Dt(t,e,r,n){return kt(t,e,r,n,!0)}function jt(t){t&&t.target&&(t.target.removeEventListener(t.type,t.listener),yt(t))}var Gt=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)}}(),zt=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 Gt(e,t),e.prototype.changed=function(){++this.revision_,this.dispatchEvent(wt)},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<r;++i)n[i]=kt(this,t[i],e);return n}return kt(this,t,e)},e.prototype.onceInternal=function(t,e){var r;if(Array.isArray(t)){var n=t.length;r=new Array(n);for(var i=0;i<n;++i)r[i]=Dt(this,t[i],e)}else r=Dt(this,t,e);return e.ol_key=r,r},e.prototype.unInternal=function(t,e){var r=e.ol_key;if(r)Nt(r);else if(Array.isArray(t))for(var n=0,i=t.length;n<i;++n)this.removeEventListener(t[n],e);else this.removeEventListener(t,e)},e}(xt);function Nt(t){if(Array.isArray(t))for(var e=0,r=t.length;e<r;++e)jt(t[e]);else jt(t)}zt.prototype.on,zt.prototype.once,zt.prototype.un;var Ut=zt,Bt=Object.freeze({__proto__:null,unByKey:Nt,default:Ut}),Vt=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)}}(),Xt=function(t){function e(e,r,n){var i=t.call(this,e)||this;return i.key=r,i.oldValue=n,i}return Vt(e,t),e}(nt),Wt=function(t){function e(e){var r=t.call(this)||this;return r.on,r.once,r.un,l(r),r.values_=null,void 0!==e&&r.setProperties(e),r}return Vt(e,t),e.prototype.get=function(t){var e;return this.values_&&this.values_.hasOwnProperty(t)&&(e=this.values_[t]),e},e.prototype.getKeys=function(){return this.values_&&Object.keys(this.values_)||[]},e.prototype.getProperties=function(){return this.values_&&gt({},this.values_)||{}},e.prototype.hasProperties=function(){return!!this.values_},e.prototype.notify=function(t,e){var r;r="change:".concat(t),this.hasListener(r)&&this.dispatchEvent(new Xt(r,t,e)),r=it,this.hasListener(r)&&this.dispatchEvent(new Xt(r,t,e))},e.prototype.addChangeListener=function(t,e){this.addEventListener("change:".concat(t),e)},e.prototype.removeChangeListener=function(t,e){this.removeEventListener("change:".concat(t),e)},e.prototype.set=function(t,e,r){var n=this.values_||(this.values_={});if(r)n[t]=e;else{var i=n[t];n[t]=e,i!==e&&this.notify(t,i)}},e.prototype.setProperties=function(t,e){for(var r in t)this.set(r,t[r],e)},e.prototype.applyProperties=function(t){t.values_&&gt(this.values_||(this.values_={}),t.values_)},e.prototype.unset=function(t,e){if(this.values_&&t in this.values_){var r=this.values_[t];delete this.values_[t],_t(this.values_)&&(this.values_=null),e||this.notify(t,r)}},e}(Ut),qt=Wt,Yt="ol-hidden",Kt="ol-unselectable",Zt="ol-control",Ht="ol-collapsed",Jt=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"),Qt=["style","variant","weight","size","lineHeight","family"],$t=function(t){var e=t.match(Jt);if(!e)return null;for(var r={lineHeight:"normal",size:"1.2em",style:"normal",weight:"normal",variant:"normal"},n=0,i=Qt.length;n<i;++n){var o=e[n+1];void 0!==o&&(r[Qt[n]]=o)}return r.families=r.family.split(/,\s?/),r},te="10px sans-serif",ee="#000",re="round",ne=[],ie="round",oe="#000",ae="center",se="middle",le=[0,0,0,0],ue=new qt;(new xt).setSize=function(){console.warn("labelCache is deprecated.")};var he,ce,pe=null,fe={},de=function(){var t,e,r="32px ",n=["monospace","serif"],i=n.length,o="wmytzilWMYTZIL@#/&?$%10";function a(t,a,s){for(var l=!0,u=0;u<i;++u){var h=n[u];if(e=ve(t+" "+a+" "+r+h,o),s!=h){var c=ve(t+" "+a+" "+r+s+","+h,o);l=l&&c!=e}}return!!l}function s(){for(var e=!0,r=ue.getKeys(),n=0,i=r.length;n<i;++n){var o=r[n];ue.get(o)<100&&(a.apply(this,o.split("\n"))?(yt(fe),pe=null,he=void 0,ue.set(o,100)):(ue.set(o,ue.get(o)+1,!0),e=!1))}e&&(clearInterval(t),t=void 0)}return function(e){var r=$t(e);if(r)for(var n=r.families,i=0,o=n.length;i<o;++i){var l=n[i],u=r.style+"\n"+r.weight+"\n"+l;void 0===ue.get(u)&&(ue.set(u,100,!0),a(r.style,r.weight,l)||(ue.set(u,0,!0),void 0===t&&(t=setInterval(s,32))))}}}(),ge=function(t){var e=fe[t];if(null==e){if(Y){var r=$t(t),n=ye(t,"Žg");e=(isNaN(Number(r.lineHeight))?1.2:Number(r.lineHeight))*(n.actualBoundingBoxAscent+n.actualBoundingBoxDescent)}else ce||((ce=document.createElement("div")).innerHTML="M",ce.style.minHeight="0",ce.style.maxHeight="none",ce.style.height="auto",ce.style.padding="0",ce.style.border="none",ce.style.position="absolute",ce.style.display="block",ce.style.left="-99999px"),ce.style.font=t,document.body.appendChild(ce),e=ce.offsetHeight,document.body.removeChild(ce);fe[t]=e}return e};function ye(t,e){return pe||(pe=H(1,1)),t!=he&&(pe.font=t,he=pe.font),pe.measureText(e)}function ve(t,e){return ye(t,e).width}function _e(t,e,r){if(e in r)return r[e];var n=e.split("\n").reduce((function(e,r){return Math.max(e,ve(t,r))}),0);return r[e]=n,n}function me(t,e,r,n,i,o,a,s,l,u,h){t.save(),1!==r&&(t.globalAlpha*=r),e&&t.setTransform.apply(t,e),n.contextInstructions?(t.translate(l,u),t.scale(h[0],h[1]),function(t,e){for(var r=t.contextInstructions,n=0,i=r.length;n<i;n+=2)Array.isArray(r[n+1])?e[r[n]].apply(e,r[n+1]):e[r[n]]=r[n+1]}(n,t)):h[0]<0||h[1]<0?(t.translate(l,u),t.scale(h[0],h[1]),t.drawImage(n,i,o,a,s,0,0,a,s)):t.drawImage(n,i,o,a,s,l,u,a*h[0],s*h[1]),t.restore()}var xe=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)}}(),we=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],declutterMode:e.declutterMode})||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 xe(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(),declutterMode:this.getDeclutterMode()});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.setFill=function(t){this.fill_=t,this.render()},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=H(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 n},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.setStroke=function(t){this.stroke_=t,this.render()},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(n<i){var o=n;n=i,i=o}var a=void 0===this.radius2_?this.points_:2*this.points_,s=2*Math.PI/a,l=i*Math.sin(s),u=n-Math.sqrt(i*i-l*l),h=Math.sqrt(l*l+u*u),c=h/l;if("miter"===t&&c<=r)return c*e;var p=e/2/c,f=e/2*(u/h),d=Math.sqrt((n+p)*(n+p)+f*f)-n;if(void 0===this.radius2_||"bevel"===t)return 2*d;var g=n*Math.sin(s),y=i-Math.sqrt(n*n-g*g),v=Math.sqrt(g*g+y*y)/g;if(v<=r){var _=v*e/2-i-n;return 2*Math.max(d,_)}return 2*d},e.prototype.createRenderOptions=function(){var t,e=ie,r=0,n=null,i=0,o=0;this.stroke_&&(null===(t=this.stroke_.getColor())&&(t=oe),t=N(t),void 0===(o=this.stroke_.getWidth())&&(o=1),n=this.stroke_.getLineDash(),i=this.stroke_.getLineDashOffset(),void 0===(e=this.stroke_.getLineJoin())&&(e=ie),void 0===(r=this.stroke_.getMiterLimit())&&(r=10));var a=this.calculateLineJoinSize_(e,o,r),s=Math.max(this.radius_,this.radius2_||0);return{strokeStyle:t,strokeWidth:o,size:Math.ceil(2*s+a),lineDash:n,lineDashOffset:i,lineJoin:e,miterLimit:r}},e.prototype.render=function(){this.renderOptions_=this.createRenderOptions();var t=this.renderOptions_.size;this.canvas_={},this.size_=[t,t]},e.prototype.draw_=function(t,e,r){if(e.scale(r,r),e.translate(t.size/2,t.size/2),this.createPath_(e),this.fill_){var n=this.fill_.getColor();null===n&&(n=ee),e.fillStyle=N(n),e.fill()}this.stroke_&&(e.strokeStyle=t.strokeStyle,e.lineWidth=t.strokeWidth,e.setLineDash&&t.lineDash&&(e.setLineDash(t.lineDash),e.lineDashOffset=t.lineDashOffset),e.lineJoin=t.lineJoin,e.miterLimit=t.miterLimit,e.stroke())},e.prototype.createHitDetectionCanvas_=function(t){if(this.fill_){var e=this.fill_.getColor(),r=0;if("string"==typeof e&&(e=j(e)),null===e?r=1:Array.isArray(e)&&(r=4===e.length?e[3]:1),0===r){var n=H(t.size,t.size);this.hitDetectionCanvas_=n.canvas,this.drawHitDetectionCanvas_(t,n)}}this.hitDetectionCanvas_||(this.hitDetectionCanvas_=this.getImage(1))},e.prototype.createPath_=function(t){var e=this.points_,r=this.radius_;if(e===1/0)t.arc(0,0,r,0,2*Math.PI);else{var n=void 0===this.radius2_?r:this.radius2_;void 0!==this.radius2_&&(e*=2);for(var i=this.angle_-Math.PI/2,o=2*Math.PI/e,a=0;a<e;a++){var s=i+a*o,l=a%2==0?r:n;t.lineTo(l*Math.cos(s),l*Math.sin(s))}t.closePath()}},e.prototype.drawHitDetectionCanvas_=function(t,e){e.translate(t.size/2,t.size/2),this.createPath_(e),e.fillStyle=ee,e.fill(),this.stroke_&&(e.strokeStyle=t.strokeStyle,e.lineWidth=t.strokeWidth,t.lineDash&&(e.setLineDash(t.lineDash),e.lineDashOffset=t.lineDashOffset),e.lineJoin=t.lineJoin,e.miterLimit=t.miterLimit,e.stroke())},e}(g),be=we,Se=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(e){var r=e||{};return t.call(this,{points:1/0,fill:r.fill,radius:r.radius,stroke:r.stroke,scale:void 0!==r.scale?r.scale:1,rotation:void 0!==r.rotation?r.rotation:0,rotateWithView:void 0!==r.rotateWithView&&r.rotateWithView,displacement:void 0!==r.displacement?r.displacement:[0,0],declutterMode:r.declutterMode})||this}return Se(e,t),e.prototype.clone=function(){var t=this.getScale(),r=new e({fill:this.getFill()?this.getFill().clone():void 0,stroke:this.getStroke()?this.getStroke().clone():void 0,radius:this.getRadius(),scale:Array.isArray(t)?t.slice():t,rotation:this.getRotation(),rotateWithView:this.getRotateWithView(),displacement:this.getDisplacement().slice(),declutterMode:this.getDeclutterMode()});return r.setOpacity(this.getOpacity()),r},e.prototype.setRadius=function(t){this.radius_=t,this.render()},e}(be),Ee=Ce,Te=function(){function t(t){var e=t||{};this.color_=void 0!==e.color?e.color:null}return t.prototype.clone=function(){var e=this.getColor();return new t({color:Array.isArray(e)?e.slice():e||void 0})},t.prototype.getColor=function(){return this.color_},t.prototype.setColor=function(t){this.color_=t},t}(),Pe=Te,Re="fraction",Oe="pixels",Fe="bottom-left",Me="bottom-right",Ie="top-left",Le="top-right",Ae=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=ke(t,e,r);return n in this.cache_?this.cache_[n]:null},t.prototype.set=function(t,e,r,n){var i=ke(t,e,r);this.cache_[i]=n,++this.cacheSize_},t.prototype.setSize=function(t){this.maxCacheSize_=t,this.expire()},t}();function ke(t,e,r){return e+":"+t+":"+(r?A(r):"null")}var De=new Ae,je=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)}}(),Ge=function(t){function e(e,r,n,i){var o=t.call(this)||this;return o.extent=e,o.pixelRatio_=n,o.resolution=r,o.state=i,o}return je(e,t),e.prototype.changed=function(){this.dispatchEvent(wt)},e.prototype.getExtent=function(){return this.extent},e.prototype.getImage=function(){return a()},e.prototype.getPixelRatio=function(){return this.pixelRatio_},e.prototype.getResolution=function(){return this.resolution},e.prototype.getState=function(){return this.state},e.prototype.load=function(){a()},e}(xt),ze=0,Ne=1,Ue=2,Be=4,Ve=8,Xe=16;function We(t){for(var e=$e(),r=0,n=t.length;r<n;++r)ar(e,t[r]);return e}function qe(t,e,r){return r?(r[0]=t[0]-e,r[1]=t[1]-e,r[2]=t[2]+e,r[3]=t[3]+e,r):[t[0]-e,t[1]-e,t[2]+e,t[3]+e]}function Ye(t,e){return e?(e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e):t.slice()}function Ke(t,e,r){var n,i;return(n=e<t[0]?t[0]-e:t[2]<e?e-t[2]:0)*n+(i=r<t[1]?t[1]-r:t[3]<r?r-t[3]:0)*i}function Ze(t,e){return Je(t,e[0],e[1])}function He(t,e){return t[0]<=e[0]&&e[2]<=t[2]&&t[1]<=e[1]&&e[3]<=t[3]}function Je(t,e,r){return t[0]<=e&&e<=t[2]&&t[1]<=r&&r<=t[3]}function Qe(t,e){var r=t[0],n=t[1],i=t[2],o=t[3],a=e[0],s=e[1],l=ze;return a<r?l|=Xe:a>i&&(l|=Be),s<n?l|=Ve:s>o&&(l|=Ue),l===ze&&(l=Ne),l}function $e(){return[1/0,1/0,-1/0,-1/0]}function tr(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 er(t){return tr(1/0,1/0,-1/0,-1/0,t)}function rr(t,e){var r=t[0],n=t[1];return tr(r,n,r,n,e)}function nr(t,e,r,n,i){return sr(er(i),t,e,r,n)}function ir(t,e){return t[0]==e[0]&&t[2]==e[2]&&t[1]==e[1]&&t[3]==e[3]}function or(t,e){return e[0]<t[0]&&(t[0]=e[0]),e[2]>t[2]&&(t[2]=e[2]),e[1]<t[1]&&(t[1]=e[1]),e[3]>t[3]&&(t[3]=e[3]),t}function ar(t,e){e[0]<t[0]&&(t[0]=e[0]),e[0]>t[2]&&(t[2]=e[0]),e[1]<t[1]&&(t[1]=e[1]),e[1]>t[3]&&(t[3]=e[1])}function sr(t,e,r,n,i){for(;r<n;r+=i)lr(t,e[r],e[r+1]);return t}function lr(t,e,r){t[0]=Math.min(t[0],e),t[1]=Math.min(t[1],r),t[2]=Math.max(t[2],e),t[3]=Math.max(t[3],r)}function ur(t,e){var r;return(r=e(cr(t)))||(r=e(pr(t)))||(r=e(xr(t)))?r:(r=e(mr(t)))||!1}function hr(t){var e=0;return Sr(t)||(e=wr(t)*vr(t)),e}function cr(t){return[t[0],t[1]]}function pr(t){return[t[2],t[1]]}function fr(t){return[(t[0]+t[2])/2,(t[1]+t[3])/2]}function dr(t,e){var r;return"bottom-left"===e?r=cr(t):"bottom-right"===e?r=pr(t):"top-left"===e?r=mr(t):"top-right"===e?r=xr(t):_(!1,13),r}function gr(t,e,r,n,i){var o=yr(t,e,r,n),a=o[0],s=o[1],l=o[2],u=o[3],h=o[4],c=o[5],p=o[6],f=o[7];return tr(Math.min(a,l,h,p),Math.min(s,u,c,f),Math.max(a,l,h,p),Math.max(s,u,c,f),i)}function yr(t,e,r,n){var i=e*n[0]/2,o=e*n[1]/2,a=Math.cos(r),s=Math.sin(r),l=i*a,u=i*s,h=o*a,c=o*s,p=t[0],f=t[1];return[p-l+c,f-u-h,p-l-c,f-u+h,p+l-c,f+u+h,p+l+c,f+u-h,p-l+c,f-u-h]}function vr(t){return t[3]-t[1]}function _r(t,e,r){var n=r||[1/0,1/0,-1/0,-1/0];return br(t,e)?(t[0]>e[0]?n[0]=t[0]:n[0]=e[0],t[1]>e[1]?n[1]=t[1]:n[1]=e[1],t[2]<e[2]?n[2]=t[2]:n[2]=e[2],t[3]<e[3]?n[3]=t[3]:n[3]=e[3]):er(n),n}function mr(t){return[t[0],t[3]]}function xr(t){return[t[2],t[3]]}function wr(t){return t[2]-t[0]}function br(t,e){return t[0]<=e[2]&&t[2]>=e[0]&&t[1]<=e[3]&&t[3]>=e[1]}function Sr(t){return t[2]<t[0]||t[3]<t[1]}function Cr(t,e,r,n){var i=[];if(n>1)for(var o=t[2]-t[0],a=t[3]-t[1],s=0;s<n;++s)i.push(t[0]+o*s/n,t[1],t[2],t[1]+a*s/n,t[2]-o*s/n,t[3],t[0],t[3]-a*s/n);else i=[t[0],t[1],t[2],t[1],t[2],t[3],t[0],t[3]];e(i,i,2);for(var l=[],u=[],h=(s=0,i.length);s<h;s+=2)l.push(i[s]),u.push(i[s+1]);return function(t,e,r){return tr(Math.min.apply(null,t),Math.min.apply(null,e),Math.max.apply(null,t),Math.max.apply(null,e),r)}(l,u,r)}function Er(t,e){var r=e.getExtent(),n=fr(t);if(e.canWrapX()&&(n[0]<r[0]||n[0]>=r[2])){var i=wr(r),o=Math.floor((n[0]-r[0])/i)*i;t[0]-=o,t[2]-=o}return t}var Tr=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 Pr(t,e,r){var n=t,i=!0,o=!1,a=!1,s=[Dt(n,Mt,(function(){a=!0,o||e()}))];return n.src&&K?(o=!0,n.decode().then((function(){i&&e()})).catch((function(t){i&&(a?e():r())}))):s.push(Dt(n,bt,r)),function(){i=!1,s.forEach(jt)}}var Rr=function(t){function o(r,n,i,o,a,s){var l=t.call(this,r,n,i,e)||this;return l.src_=o,l.image_=new Image,null!==a&&(l.image_.crossOrigin=a),l.unlisten_=null,l.state=e,l.imageLoadFunction_=s,l}return Tr(o,t),o.prototype.getImage=function(){return this.image_},o.prototype.handleImageError_=function(){this.state=i,this.unlistenImage_(),this.changed()},o.prototype.handleImageLoad_=function(){void 0===this.resolution&&(this.resolution=vr(this.extent)/this.image_.height),this.state=n,this.unlistenImage_(),this.changed()},o.prototype.load=function(){this.state!=e&&this.state!=i||(this.state=r,this.changed(),this.imageLoadFunction_(this,this.src_),this.unlisten_=Pr(this.image_,this.handleImageLoad_.bind(this),this.handleImageError_.bind(this)))},o.prototype.setImage=function(t){this.image_=t,this.resolution=vr(this.extent)/this.image_.height},o.prototype.unlistenImage_=function(){this.unlisten_&&(this.unlisten_(),this.unlisten_=null)},o}(Ge),Or=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)}}(),Fr=null,Mr=function(t){function o(e,r,n,i,o,a){var s=t.call(this)||this;return s.hitDetectionImage_=null,s.image_=e||new Image,null!==i&&(s.image_.crossOrigin=i),s.canvas_={},s.color_=a,s.unlisten_=null,s.imageState_=o,s.size_=n,s.src_=r,s.tainted_,s}return Or(o,t),o.prototype.isTainted_=function(){if(void 0===this.tainted_&&this.imageState_===n){Fr||(Fr=H(1,1)),Fr.drawImage(this.image_,0,0);try{Fr.getImageData(0,0,1,1),this.tainted_=!1}catch(t){Fr=null,this.tainted_=!0}}return!0===this.tainted_},o.prototype.dispatchChangeEvent_=function(){this.dispatchEvent(wt)},o.prototype.handleImageError_=function(){this.imageState_=i,this.unlistenImage_(),this.dispatchChangeEvent_()},o.prototype.handleImageLoad_=function(){this.imageState_=n,this.size_?(this.image_.width=this.size_[0],this.image_.height=this.size_[1]):this.size_=[this.image_.width,this.image_.height],this.unlistenImage_(),this.dispatchChangeEvent_()},o.prototype.getImage=function(t){return this.replaceColor_(t),this.canvas_[t]?this.canvas_[t]:this.image_},o.prototype.getPixelRatio=function(t){return this.replaceColor_(t),this.canvas_[t]?t:1},o.prototype.getImageState=function(){return this.imageState_},o.prototype.getHitDetectionImage=function(){if(!this.hitDetectionImage_)if(this.isTainted_()){var t=this.size_[0],e=this.size_[1],r=H(t,e);r.fillRect(0,0,t,e),this.hitDetectionImage_=r.canvas}else this.hitDetectionImage_=this.image_;return this.hitDetectionImage_},o.prototype.getSize=function(){return this.size_},o.prototype.getSrc=function(){return this.src_},o.prototype.load=function(){if(this.imageState_==e){this.imageState_=r;try{this.image_.src=this.src_}catch(t){this.handleImageError_()}this.unlisten_=Pr(this.image_,this.handleImageLoad_.bind(this),this.handleImageError_.bind(this))}},o.prototype.replaceColor_=function(t){if(this.color_&&!this.canvas_[t]&&this.imageState_===n){var e=document.createElement("canvas");this.canvas_[t]=e,e.width=Math.ceil(this.image_.width*t),e.height=Math.ceil(this.image_.height*t);var r=e.getContext("2d");if(r.scale(t,t),r.drawImage(this.image_,0,0),r.globalCompositeOperation="multiply","multiply"===r.globalCompositeOperation||this.isTainted_())r.fillStyle=A(this.color_),r.fillRect(0,0,e.width/t,e.height/t),r.globalCompositeOperation="destination-in",r.drawImage(this.image_,0,0);else{for(var i=r.getImageData(0,0,e.width,e.height),o=i.data,a=this.color_[0]/255,s=this.color_[1]/255,l=this.color_[2]/255,u=this.color_[3],h=0,c=o.length;h<c;h+=4)o[h]*=a,o[h+1]*=s,o[h+2]*=l,o[h+3]*=u;r.putImageData(i,0,0)}}},o.prototype.unlistenImage_=function(){this.unlisten_&&(this.unlisten_(),this.unlisten_=null)},o}(xt);var Ir=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)}}(),Lr=function(t){function r(r){var i=this,o=r||{},a=void 0!==o.opacity?o.opacity:1,s=void 0!==o.rotation?o.rotation:0,u=void 0!==o.scale?o.scale:1,h=void 0!==o.rotateWithView&&o.rotateWithView;(i=t.call(this,{opacity:a,rotation:s,scale:u,displacement:void 0!==o.displacement?o.displacement:[0,0],rotateWithView:h,declutterMode:o.declutterMode})||this).anchor_=void 0!==o.anchor?o.anchor:[.5,.5],i.normalizedAnchor_=null,i.anchorOrigin_=void 0!==o.anchorOrigin?o.anchorOrigin:Ie,i.anchorXUnits_=void 0!==o.anchorXUnits?o.anchorXUnits:Re,i.anchorYUnits_=void 0!==o.anchorYUnits?o.anchorYUnits:Re,i.crossOrigin_=void 0!==o.crossOrigin?o.crossOrigin:null;var c=void 0!==o.img?o.img:null;i.imgSize_=o.imgSize;var p=o.src;_(!(void 0!==p&&c),4),_(!c||c&&i.imgSize_,5),void 0!==p&&0!==p.length||!c||(p=c.src||l(c)),_(void 0!==p&&p.length>0,6);var f=void 0!==o.src?e:n;return i.color_=void 0!==o.color?j(o.color):null,i.iconImage_=function(t,e,r,n,i,o){var a=De.get(e,n,o);return a||(a=new Mr(t,e,r,n,i,o),De.set(e,n,o,a)),a}(c,p,void 0!==i.imgSize_?i.imgSize_:null,i.crossOrigin_,f,i.color_),i.offset_=void 0!==o.offset?o.offset:[0,0],i.offsetOrigin_=void 0!==o.offsetOrigin?o.offsetOrigin:Ie,i.origin_=null,i.size_=void 0!==o.size?o.size:null,i}return Ir(r,t),r.prototype.clone=function(){var t=this.getScale();return new r({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(),displacement:this.getDisplacement().slice(),declutterMode:this.getDeclutterMode()})},r.prototype.getAnchor=function(){var t=this.normalizedAnchor_;if(!t){t=this.anchor_;var e=this.getSize();if(this.anchorXUnits_==Re||this.anchorYUnits_==Re){if(!e)return null;t=this.anchor_.slice(),this.anchorXUnits_==Re&&(t[0]*=e[0]),this.anchorYUnits_==Re&&(t[1]*=e[1])}if(this.anchorOrigin_!=Ie){if(!e)return null;t===this.anchor_&&(t=this.anchor_.slice()),this.anchorOrigin_!=Le&&this.anchorOrigin_!=Me||(t[0]=-t[0]+e[0]),this.anchorOrigin_!=Fe&&this.anchorOrigin_!=Me||(t[1]=-t[1]+e[1])}this.normalizedAnchor_=t}var r=this.getDisplacement();return[t[0]-r[0],t[1]+r[1]]},r.prototype.setAnchor=function(t){this.anchor_=t,this.normalizedAnchor_=null},r.prototype.getColor=function(){return this.color_},r.prototype.getImage=function(t){return this.iconImage_.getImage(t)},r.prototype.getPixelRatio=function(t){return this.iconImage_.getPixelRatio(t)},r.prototype.getImageSize=function(){return this.iconImage_.getSize()},r.prototype.getImageState=function(){return this.iconImage_.getImageState()},r.prototype.getHitDetectionImage=function(){return this.iconImage_.getHitDetectionImage()},r.prototype.getOrigin=function(){if(this.origin_)return this.origin_;var t=this.offset_;if(this.offsetOrigin_!=Ie){var e=this.getSize(),r=this.iconImage_.getSize();if(!e||!r)return null;t=t.slice(),this.offsetOrigin_!=Le&&this.offsetOrigin_!=Me||(t[0]=r[0]-e[0]-t[0]),this.offsetOrigin_!=Fe&&this.offsetOrigin_!=Me||(t[1]=r[1]-e[1]-t[1])}return this.origin_=t,this.origin_},r.prototype.getSrc=function(){return this.iconImage_.getSrc()},r.prototype.getSize=function(){return this.size_?this.size_:this.iconImage_.getSize()},r.prototype.listenImageChange=function(t){this.iconImage_.addEventListener(wt,t)},r.prototype.load=function(){this.iconImage_.load()},r.prototype.unlistenImageChange=function(t){this.iconImage_.removeEventListener(wt,t)},r}(g),Ar=Lr,kr=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)}}(),Dr=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 kr(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_&&(jt(this.geometryChangeKey_),this.geometryChangeKey_=null);var t=this.getGeometry();t&&(this.geometryChangeKey_=kt(t,wt,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:(_("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}(qt);var jr=Dr,Gr="XY",zr="XYZ",Nr="XYM",Ur="XYZM",Br={RADIANS:"radians",DEGREES:"degrees",FEET:"ft",METERS:"m",PIXELS:"pixels",TILE_PIXELS:"tile-pixels",USFEET:"us-ft"},Vr={};Vr[Br.RADIANS]=6370997/(2*Math.PI),Vr[Br.DEGREES]=2*Math.PI*6370997/360,Vr[Br.FEET]=.3048,Vr[Br.METERS]=1,Vr[Br.USFEET]=1200/3937;var Xr,Wr=Br,qr=new Array(6);function Yr(t){return Zr(t,1,0,0,1,0,0)}function Kr(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],h=e[2],c=e[3],p=e[4],f=e[5];return t[0]=r*l+i*u,t[1]=n*l+o*u,t[2]=r*h+i*c,t[3]=n*h+o*c,t[4]=r*p+i*f+a,t[5]=n*p+o*f+s,t}function Zr(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 Hr(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 Jr(t,e){var r=Math.cos(e),n=Math.sin(e);return Kr(t,Zr(qr,r,n,-n,r,0,0))}function Qr(t,e,r){return Kr(t,Zr(qr,e,0,0,r,0,0))}function $r(t,e,r){return Kr(t,Zr(qr,1,0,0,1,e,r))}function tn(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 en(t,e){var r,n=(r=e)[0]*r[3]-r[1]*r[2];_(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}function rn(t){var e="matrix("+t.join(", ")+")";if(Y)return e;var r=Xr||(Xr=document.createElement("div"));return r.style.transform=e,r.style.transform}var nn=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_||Vr[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}(),on=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)}}(),an=6378137,sn=Math.PI*an,ln=[-sn,-sn,sn,sn],un=[-180,-85,180,85],hn=an*Math.log(Math.tan(Math.PI/2)),cn=function(t){function e(e){return t.call(this,{code:e,units:Wr.METERS,extent:ln,global:!0,worldExtent:un,getPointResolution:function(t,e){return t/x(e[1]/an)}})||this}return on(e,t),e}(nn),pn=[new cn("EPSG:3857"),new cn("EPSG:102100"),new cn("EPSG:102113"),new cn("EPSG:900913"),new cn("http://www.opengis.net/def/crs/EPSG/0/3857"),new cn("http://www.opengis.net/gml/srs/epsg.xml#3857")];function fn(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<n;a+=i){o[a]=sn*t[a]/180;var s=an*Math.log(Math.tan(Math.PI*(+t[a+1]+90)/360));s>hn?s=hn:s<-hn&&(s=-hn),o[a+1]=s}return o}function dn(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<n;a+=i)o[a]=180*t[a]/sn,o[a+1]=360*Math.atan(Math.exp(t[a+1]/an))/Math.PI-90;return o}var gn=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)}}(),yn=[-180,-90,180,90],vn=6378137*Math.PI/180,_n=function(t){function e(e,r){return t.call(this,{code:e,units:Wr.DEGREES,extent:yn,axisOrientation:r,global:!0,metersPerUnit:vn,worldExtent:yn})||this}return gn(e,t),e}(nn),mn=[new _n("CRS:84"),new _n("EPSG:4326","neu"),new _n("urn:ogc:def:crs:OGC:1.3:CRS84"),new _n("urn:ogc:def:crs:OGC:2:84"),new _n("http://www.opengis.net/def/crs/OGC/1.3/CRS84"),new _n("http://www.opengis.net/gml/srs/epsg.xml#4326","neu"),new _n("http://www.opengis.net/def/crs/EPSG/0/4326","neu")],xn={};var wn={};function bn(t,e,r){var n=t.getCode(),i=e.getCode();n in wn||(wn[n]={}),wn[n][i]=r}function Sn(t,e){for(var r=(""+t).split("."),n=(""+e).split("."),i=0;i<Math.max(r.length,n.length);i++){var o=parseInt(r[i]||"0",10),a=parseInt(n[i]||"0",10);if(o>a)return 1;if(a>o)return-1}return 0}function Cn(t,e){var r=e.getRadius(),n=e.getCenter(),i=n[0],o=n[1],a=t[0]-i,s=t[1]-o;0===a&&0===s&&(a=1);var l=Math.sqrt(a*a+s*s);return[i+r*a/l,o+r*s/l]}function En(t,e){var r,n,i=t[0],o=t[1],a=e[0],s=e[1],l=a[0],u=a[1],h=s[0],c=s[1],p=h-l,f=c-u,d=0===p&&0===f?0:(p*(i-l)+f*(o-u))/(p*p+f*f||0);return d<=0?(r=l,n=u):d>=1?(r=h,n=c):(r=l+d*p,n=u+d*f),[r,n]}function Tn(t,e){for(var r=!0,n=t.length-1;n>=0;--n)if(t[n]!=e[n]){r=!1;break}return r}function Pn(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 Rn(t,e){var r=t[0]-e[0],n=t[1]-e[1];return r*r+n*n}function On(t,e){return Math.sqrt(Rn(t,e))}function Fn(t,e){return Rn(t,En(t,e))}function Mn(t,e){if(e.canWrapX()){var r=wr(e.getExtent()),n=function(t,e,r){var n=e.getExtent(),i=0;if(e.canWrapX()&&(t[0]<n[0]||t[0]>n[2])){var o=r||wr(n);i=Math.floor((t[0]-n[0])/o)}return i}(t,e,r);n&&(t[0]-=n*r)}return t}var In=6371008.8;function Ln(t,e,r){var n=r||In,i=E(t[1]),o=E(e[1]),a=(o-i)/2,s=E(e[0]-t[0])/2,l=Math.sin(a)*Math.sin(a)+Math.sin(s)*Math.sin(s)*Math.cos(i)*Math.cos(o);return 2*n*Math.atan2(Math.sqrt(l),Math.sqrt(1-l))}function An(t,e){for(var r=0,n=0,i=t.length;n<i-1;++n)r+=Ln(t[n],t[n+1],e);return r}function kn(t,e){for(var r=0,n=t.length,i=t[n-1][0],o=t[n-1][1],a=0;a<n;a++){var s=t[a][0],l=t[a][1];r+=E(s-i)*(2+Math.sin(E(o))+Math.sin(E(l))),i=s,o=l}return r*e*e/2}var Dn=Object.freeze({__proto__:null,DEFAULT_RADIUS:In,getDistance:Ln,getLength:function t(e,r){var n=r||{},i=n.radius||In,o=n.projection||"EPSG:3857",a=e.getType();"GeometryCollection"!==a&&(e=e.clone().transform(o,"EPSG:4326"));var s,l,u,h,c,p,f=0;switch(a){case"Point":case"MultiPoint":break;case"LineString":case"LinearRing":f=An(s=e.getCoordinates(),i);break;case"MultiLineString":case"Polygon":for(u=0,h=(s=e.getCoordinates()).length;u<h;++u)f+=An(s[u],i);break;case"MultiPolygon":for(u=0,h=(s=e.getCoordinates()).length;u<h;++u)for(c=0,p=(l=s[u]).length;c<p;++c)f+=An(l[c],i);break;case"GeometryCollection":var d=e.getGeometries();for(u=0,h=d.length;u<h;++u)f+=t(d[u],r);break;default:throw new Error("Unsupported geometry type: "+a)}return f},getArea:function t(e,r){var n=r||{},i=n.radius||In,o=n.projection||"EPSG:3857",a=e.getType();"GeometryCollection"!==a&&(e=e.clone().transform(o,"EPSG:4326"));var s,l,u,h,c,p,f=0;switch(a){case"Point":case"MultiPoint":case"LineString":case"MultiLineString":case"LinearRing":break;case"Polygon":for(s=e.getCoordinates(),f=Math.abs(kn(s[0],i)),u=1,h=s.length;u<h;++u)f-=Math.abs(kn(s[u],i));break;case"MultiPolygon":for(u=0,h=(s=e.getCoordinates()).length;u<h;++u)for(l=s[u],f+=Math.abs(kn(l[0],i)),c=1,p=l.length;c<p;++c)f-=Math.abs(kn(l[c],i));break;case"GeometryCollection":var d=e.getGeometries();for(u=0,h=d.length;u<h;++u)f+=t(d[u],r);break;default:throw new Error("Unsupported geometry type: "+a)}return f},offset:function(t,e,r,n){var i=n||In,o=E(t[1]),a=E(t[0]),s=e/i,l=Math.asin(Math.sin(o)*Math.cos(s)+Math.cos(o)*Math.sin(s)*Math.cos(r));return[C(a+Math.atan2(Math.sin(r)*Math.sin(s)*Math.cos(o),Math.cos(s)-Math.sin(o)*Math.sin(l))),C(l)]}}),jn=!0;function Gn(t){jn=!(void 0===t||t)}function zn(t,e,r){var n;if(void 0!==e){for(var i=0,o=t.length;i<o;++i)e[i]=t[i];n=e}else n=t.slice();return n}function Nn(t,e,r){if(void 0!==e&&t!==e){for(var n=0,i=t.length;n<i;++n)e[n]=t[n];t=e}return t}function Un(t){!function(t,e){xn[t]=e}(t.getCode(),t),bn(t,t,zn)}function Bn(t){return"string"==typeof t?xn[e=t]||xn[e.replace(/urn:(x-)?ogc:def:crs:EPSG:(.*:)?(\w+)$/,"EPSG:$3")]||null:t||null;var e}function Vn(t,e,r,n){var i,o=(t=Bn(t)).getPointResolutionFunc();if(o){if(i=o(e,r),n&&n!==t.getUnits())(s=t.getMetersPerUnit())&&(i=i*s/Vr[n])}else{var a=t.getUnits();if(a==Wr.DEGREES&&!n||n==Wr.DEGREES)i=e;else{var s,l=Kn(t,Bn("EPSG:4326"));if(l===Nn&&a!==Wr.DEGREES)i=e*t.getMetersPerUnit();else{var u=[r[0]-e/2,r[1],r[0]+e/2,r[1],r[0],r[1]-e/2,r[0],r[1]+e/2];i=(Ln((u=l(u,u,2)).slice(0,2),u.slice(2,4))+Ln(u.slice(4,6),u.slice(6,8)))/2}void 0!==(s=n?Vr[n]:t.getMetersPerUnit())&&(i/=s)}}return i}function Xn(t){!function(t){t.forEach(Un)}(t),t.forEach((function(e){t.forEach((function(t){e!==t&&bn(e,t,zn)}))}))}function Wn(t,e){return t?"string"==typeof t?Bn(t):t:Bn(e)}function qn(t,e){return Gn(),Hn(t,"EPSG:4326",void 0!==e?e:"EPSG:3857")}function Yn(t,e){if(t===e)return!0;var r=t.getUnits()===e.getUnits();return(t.getCode()===e.getCode()||Kn(t,e)===zn)&&r}function Kn(t,e){var r=function(t,e){var r;return t in wn&&e in wn[t]&&(r=wn[t][e]),r}(t.getCode(),e.getCode());return r||(r=Nn),r}function Zn(t,e){return Kn(Bn(t),Bn(e))}function Hn(t,e,r){return Zn(e,r)(t,void 0,t.length)}var Jn,Qn,$n;function ti(t,e){return t}function ei(t,e){return jn&&!Tn(t,[0,0])&&t[0]>=-180&&t[0]<=180&&t[1]>=-90&&t[1]<=90&&(jn=!1,console.warn("Call useGeographic() from ol/proj once to work with [longitude, latitude] coordinates.")),t}function ri(t,e){return t}function ni(t,e){return t}function ii(t,e,r,n,i,o){for(var a=o||[],s=0,l=e;l<r;l+=n){var u=t[l],h=t[l+1];a[s++]=i[0]*u+i[2]*h+i[4],a[s++]=i[1]*u+i[3]*h+i[5]}return o&&a.length!=s&&(a.length=s),a}function oi(t,e,r,n,i,o,a){for(var s=a||[],l=Math.cos(i),u=Math.sin(i),h=o[0],c=o[1],p=0,f=e;f<r;f+=n){var d=t[f]-h,g=t[f+1]-c;s[p++]=h+d*l-g*u,s[p++]=c+d*u+g*l;for(var y=f+2;y<f+n;++y)s[p++]=t[y]}return a&&s.length!=p&&(s.length=p),s}function ai(t,e,r,n,i,o,a){for(var s=a||[],l=0,u=e;u<r;u+=n){s[l++]=t[u]+i,s[l++]=t[u+1]+o;for(var h=u+2;h<u+n;++h)s[l++]=t[h]}return a&&s.length!=l&&(s.length=l),s}Xn(pn),Xn(mn),Jn=pn,Qn=fn,$n=dn,mn.forEach((function(t){Jn.forEach((function(e){bn(t,e,Qn),bn(e,t,$n)}))}));var si=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)}}(),li=[1,0,0,1,0,0],ui=function(t){function e(){var e,r,n,i,o,a=t.call(this)||this;return a.extent_=[1/0,1/0,-1/0,-1/0],a.extentRevision_=-1,a.simplifiedGeometryMaxMinSquaredTolerance=0,a.simplifiedGeometryRevision=0,a.simplifyTransformedInternal=(e=function(t,e,r){if(!r)return this.getSimplifiedGeometry(e);var n=this.clone();return n.applyTransform(r),n.getSimplifiedGeometry(e)},o=!1,function(){var t=Array.prototype.slice.call(arguments);return o&&this===i&&ct(t,n)||(o=!0,i=this,n=t,r=e.apply(this,arguments)),r}),a}return si(e,t),e.prototype.simplifyTransformed=function(t,e){return this.simplifyTransformedInternal(this.getRevision(),t,e)},e.prototype.clone=function(){return a()},e.prototype.closestPointXY=function(t,e,r,n){return a()},e.prototype.containsXY=function(t,e){var r=this.getClosestPoint([t,e]);return r[0]===t&&r[1]===e},e.prototype.getClosestPoint=function(t,e){var r=e||[NaN,NaN];return this.closestPointXY(t[0],t[1],r,1/0),r},e.prototype.intersectsCoordinate=function(t){return this.containsXY(t[0],t[1])},e.prototype.computeExtent=function(t){return a()},e.prototype.getExtent=function(t){if(this.extentRevision_!=this.getRevision()){var e=this.computeExtent(this.extent_);(isNaN(e[0])||isNaN(e[1]))&&er(e),this.extentRevision_=this.getRevision()}return function(t,e){return e?(e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e):t}(this.extent_,t)},e.prototype.rotate=function(t,e){a()},e.prototype.scale=function(t,e,r){a()},e.prototype.simplify=function(t){return this.getSimplifiedGeometry(t*t)},e.prototype.getSimplifiedGeometry=function(t){return a()},e.prototype.getType=function(){return a()},e.prototype.applyTransform=function(t){a()},e.prototype.intersectsExtent=function(t){return a()},e.prototype.translate=function(t,e){a()},e.prototype.transform=function(t,e){var r=Bn(t),n=r.getUnits()==Wr.TILE_PIXELS?function(t,n,i){var o=r.getExtent(),a=r.getWorldExtent(),s=vr(a)/vr(o);return tn(li,a[0],a[3],s,-s,0,0,0),ii(t,0,t.length,i,li,n),Zn(r,e)(t,n,i)}:Zn(r,e);return this.applyTransform(n),this},e}(qt),hi=ui,ci=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)}}(),pi=function(t){function e(){var e=t.call(this)||this;return e.layout=Gr,e.stride=2,e.flatCoordinates=null,e}return ci(e,t),e.prototype.computeExtent=function(t){return nr(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,t)},e.prototype.getCoordinates=function(){return a()},e.prototype.getFirstCoordinate=function(){return this.flatCoordinates.slice(0,this.stride)},e.prototype.getFlatCoordinates=function(){return this.flatCoordinates},e.prototype.getLastCoordinate=function(){return this.flatCoordinates.slice(this.flatCoordinates.length-this.stride)},e.prototype.getLayout=function(){return this.layout},e.prototype.getSimplifiedGeometry=function(t){if(this.simplifiedGeometryRevision!==this.getRevision()&&(this.simplifiedGeometryMaxMinSquaredTolerance=0,this.simplifiedGeometryRevision=this.getRevision()),t<0||0!==this.simplifiedGeometryMaxMinSquaredTolerance&&t<=this.simplifiedGeometryMaxMinSquaredTolerance)return this;var e=this.getSimplifiedGeometryInternal(t);return e.getFlatCoordinates().length<this.flatCoordinates.length?e:(this.simplifiedGeometryMaxMinSquaredTolerance=t,this)},e.prototype.getSimplifiedGeometryInternal=function(t){return this},e.prototype.getStride=function(){return this.stride},e.prototype.setFlatCoordinates=function(t,e){this.stride=fi(t),this.layout=t,this.flatCoordinates=e},e.prototype.setCoordinates=function(t,e){a()},e.prototype.setLayout=function(t,e,r){var n;if(t)n=fi(t);else{for(var i=0;i<r;++i){if(0===e.length)return this.layout=Gr,void(this.stride=2);e=e[0]}t=function(t){var e;2==t?e=Gr:3==t?e=zr:4==t&&(e=Ur);return e}(n=e.length)}this.layout=t,this.stride=n},e.prototype.applyTransform=function(t){this.flatCoordinates&&(t(this.flatCoordinates,this.flatCoordinates,this.stride),this.changed())},e.prototype.rotate=function(t,e){var r=this.getFlatCoordinates();if(r){var n=this.getStride();oi(r,0,r.length,n,t,e,r),this.changed()}},e.prototype.scale=function(t,e,r){var n=e;void 0===n&&(n=t);var i=r;i||(i=fr(this.getExtent()));var o=this.getFlatCoordinates();if(o){var a=this.getStride();!function(t,e,r,n,i,o,a,s){for(var l=s||[],u=a[0],h=a[1],c=0,p=e;p<r;p+=n){var f=t[p]-u,d=t[p+1]-h;l[c++]=u+i*f,l[c++]=h+o*d;for(var g=p+2;g<p+n;++g)l[c++]=t[g]}s&&l.length!=c&&(l.length=c)}(o,0,o.length,a,t,n,i,o),this.changed()}},e.prototype.translate=function(t,e){var r=this.getFlatCoordinates();if(r){var n=this.getStride();ai(r,0,r.length,n,t,e,r),this.changed()}},e}(hi);function fi(t){var e;return t==Gr?e=2:t==zr||t==Nr?e=3:t==Ur&&(e=4),e}function di(t,e,r,n){for(var i=0,o=r.length;i<o;++i)t[e++]=r[i];return e}function gi(t,e,r,n){for(var i=0,o=r.length;i<o;++i)for(var a=r[i],s=0;s<n;++s)t[e++]=a[s];return e}function yi(t,e,r,n,i){for(var o=i||[],a=0,s=0,l=r.length;s<l;++s){var u=gi(t,e,r[s],n);o[a++]=u,e=u}return o.length=a,o}var vi=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)}}(),_i=function(t){function e(e,r,n){var i=t.call(this)||this;if(void 0!==n&&void 0===r)i.setFlatCoordinates(n,e);else{var o=r||0;i.setCenterAndRadius(e,o,n)}return i}return vi(e,t),e.prototype.clone=function(){var t=new e(this.flatCoordinates.slice(),void 0,this.layout);return t.applyProperties(this),t},e.prototype.closestPointXY=function(t,e,r,n){var i=this.flatCoordinates,o=t-i[0],a=e-i[1],s=o*o+a*a;if(s<n){if(0===s)for(var l=0;l<this.stride;++l)r[l]=i[l];else{var u=this.getRadius()/Math.sqrt(s);r[0]=i[0]+u*o,r[1]=i[1]+u*a;for(l=2;l<this.stride;++l)r[l]=i[l]}return r.length=this.stride,s}return n},e.prototype.containsXY=function(t,e){var r=this.flatCoordinates,n=t-r[0],i=e-r[1];return n*n+i*i<=this.getRadiusSquared_()},e.prototype.getCenter=function(){return this.flatCoordinates.slice(0,this.stride)},e.prototype.computeExtent=function(t){var e=this.flatCoordinates,r=e[this.stride]-e[0];return tr(e[0]-r,e[1]-r,e[0]+r,e[1]+r,t)},e.prototype.getRadius=function(){return Math.sqrt(this.getRadiusSquared_())},e.prototype.getRadiusSquared_=function(){var t=this.flatCoordinates[this.stride]-this.flatCoordinates[0],e=this.flatCoordinates[this.stride+1]-this.flatCoordinates[1];return t*t+e*e},e.prototype.getType=function(){return"Circle"},e.prototype.intersectsExtent=function(t){if(br(t,this.getExtent())){var e=this.getCenter();return t[0]<=e[0]&&t[2]>=e[0]||(t[1]<=e[1]&&t[3]>=e[1]||ur(t,this.intersectsCoordinate.bind(this)))}return!1},e.prototype.setCenter=function(t){var e=this.stride,r=this.flatCoordinates[e]-this.flatCoordinates[0],n=t.slice();n[e]=n[0]+r;for(var i=1;i<e;++i)n[e+i]=t[i];this.setFlatCoordinates(this.layout,n),this.changed()},e.prototype.setCenterAndRadius=function(t,e,r){this.setLayout(r,t,0),this.flatCoordinates||(this.flatCoordinates=[]);var n=this.flatCoordinates,i=di(n,0,t,this.stride);n[i++]=n[0]+e;for(var o=1,a=this.stride;o<a;++o)n[i++]=n[o];n.length=i,this.changed()},e.prototype.getCoordinates=function(){return null},e.prototype.setCoordinates=function(t,e){},e.prototype.setRadius=function(t){this.flatCoordinates[this.stride]=this.flatCoordinates[0]+t,this.changed()},e.prototype.rotate=function(t,e){var r=this.getCenter(),n=this.getStride();this.setCenter(oi(r,0,r.length,n,t,e,r)),this.changed()},e.prototype.translate=function(t,e){var r=this.getCenter(),n=this.getStride();this.setCenter(ai(r,0,r.length,n,t,e,r)),this.changed()},e}(pi);_i.prototype.transform;var mi=_i,xi=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)}}(),wi=function(t){function e(e){var r=t.call(this)||this;return r.geometries_=e||null,r.changeEventsKeys_=[],r.listenGeometriesChange_(),r}return xi(e,t),e.prototype.unlistenGeometriesChange_=function(){this.changeEventsKeys_.forEach(jt),this.changeEventsKeys_.length=0},e.prototype.listenGeometriesChange_=function(){if(this.geometries_)for(var t=0,e=this.geometries_.length;t<e;++t)this.changeEventsKeys_.push(kt(this.geometries_[t],wt,this.changed,this))},e.prototype.clone=function(){var t=new e(null);return t.setGeometries(this.geometries_),t.applyProperties(this),t},e.prototype.closestPointXY=function(t,e,r,n){if(n<Ke(this.getExtent(),t,e))return n;for(var i=this.geometries_,o=0,a=i.length;o<a;++o)n=i[o].closestPointXY(t,e,r,n);return n},e.prototype.containsXY=function(t,e){for(var r=this.geometries_,n=0,i=r.length;n<i;++n)if(r[n].containsXY(t,e))return!0;return!1},e.prototype.computeExtent=function(t){er(t);for(var e=this.geometries_,r=0,n=e.length;r<n;++r)or(t,e[r].getExtent());return t},e.prototype.getGeometries=function(){return bi(this.geometries_)},e.prototype.getGeometriesArray=function(){return this.geometries_},e.prototype.getGeometriesArrayRecursive=function(){for(var t=[],e=this.geometries_,r=0,n=e.length;r<n;++r)e[r].getType()===this.getType()?t=t.concat(e[r].getGeometriesArrayRecursive()):t.push(e[r]);return t},e.prototype.getSimplifiedGeometry=function(t){if(this.simplifiedGeometryRevision!==this.getRevision()&&(this.simplifiedGeometryMaxMinSquaredTolerance=0,this.simplifiedGeometryRevision=this.getRevision()),t<0||0!==this.simplifiedGeometryMaxMinSquaredTolerance&&t<this.simplifiedGeometryMaxMinSquaredTolerance)return this;for(var r=[],n=this.geometries_,i=!1,o=0,a=n.length;o<a;++o){var s=n[o],l=s.getSimplifiedGeometry(t);r.push(l),l!==s&&(i=!0)}if(i){var u=new e(null);return u.setGeometriesArray(r),u}return this.simplifiedGeometryMaxMinSquaredTolerance=t,this},e.prototype.getType=function(){return"GeometryCollection"},e.prototype.intersectsExtent=function(t){for(var e=this.geometries_,r=0,n=e.length;r<n;++r)if(e[r].intersectsExtent(t))return!0;return!1},e.prototype.isEmpty=function(){return 0===this.geometries_.length},e.prototype.rotate=function(t,e){for(var r=this.geometries_,n=0,i=r.length;n<i;++n)r[n].rotate(t,e);this.changed()},e.prototype.scale=function(t,e,r){var n=r;n||(n=fr(this.getExtent()));for(var i=this.geometries_,o=0,a=i.length;o<a;++o)i[o].scale(t,e,n);this.changed()},e.prototype.setGeometries=function(t){this.setGeometriesArray(bi(t))},e.prototype.setGeometriesArray=function(t){this.unlistenGeometriesChange_(),this.geometries_=t,this.listenGeometriesChange_(),this.changed()},e.prototype.applyTransform=function(t){for(var e=this.geometries_,r=0,n=e.length;r<n;++r)e[r].applyTransform(t);this.changed()},e.prototype.translate=function(t,e){for(var r=this.geometries_,n=0,i=r.length;n<i;++n)r[n].translate(t,e);this.changed()},e.prototype.disposeInternal=function(){this.unlistenGeometriesChange_(),t.prototype.disposeInternal.call(this)},e}(hi);function bi(t){for(var e=[],r=0,n=t.length;r<n;++r)e.push(t[r].clone());return e}var Si=wi;function Ci(t,e,r,n,i,o,a){var s,l=t[e],u=t[e+1],h=t[r]-l,c=t[r+1]-u;if(0===h&&0===c)s=e;else{var p=((i-l)*h+(o-u)*c)/(h*h+c*c);if(p>1)s=r;else{if(p>0){for(var f=0;f<n;++f)a[f]=P(t[e+f],t[r+f],p);return void(a.length=n)}s=e}}for(f=0;f<n;++f)a[f]=t[s+f];a.length=n}function Ei(t,e,r,n,i){var o=t[e],a=t[e+1];for(e+=n;e<r;e+=n){var s=t[e],l=t[e+1],u=S(o,a,s,l);u>i&&(i=u),o=s,a=l}return i}function Ti(t,e,r,n,i){for(var o=0,a=r.length;o<a;++o){var s=r[o];i=Ei(t,e,s,n,i),e=s}return i}function Pi(t,e,r,n,i,o,a,s,l,u,h){if(e==r)return u;var c,p;if(0===i){if((p=S(a,s,t[e],t[e+1]))<u){for(c=0;c<n;++c)l[c]=t[e+c];return l.length=n,p}return u}for(var f=h||[NaN,NaN],d=e+n;d<r;)if(Ci(t,d-n,d,n,a,s,f),(p=S(a,s,f[0],f[1]))<u){for(u=p,c=0;c<n;++c)l[c]=f[c];l.length=n,d+=n}else d+=n*Math.max((Math.sqrt(p)-Math.sqrt(u))/i|0,1);if(o&&(Ci(t,r-n,e,n,a,s,f),(p=S(a,s,f[0],f[1]))<u)){for(u=p,c=0;c<n;++c)l[c]=f[c];l.length=n}return u}function Ri(t,e,r,n,i,o,a,s,l,u,h){for(var c=h||[NaN,NaN],p=0,f=r.length;p<f;++p){var d=r[p];u=Pi(t,e,d,n,i,o,a,s,l,u,c),e=d}return u}function Oi(t,e,r,n,i,o,a){var s=(r-e)/n;if(s<3){for(;e<r;e+=n)o[a++]=t[e],o[a++]=t[e+1];return a}var l=new Array(s);l[0]=1,l[s-1]=1;for(var u=[e,r-n],h=0;u.length>0;){for(var c=u.pop(),p=u.pop(),f=0,d=t[p],g=t[p+1],y=t[c],v=t[c+1],_=p+n;_<c;_+=n){var m=b(t[_],t[_+1],d,g,y,v);m>f&&(h=_,f=m)}f>i&&(l[(h-e)/n]=1,p+n<h&&u.push(p,h),h+n<c&&u.push(h,c))}for(_=0;_<s;++_)l[_]&&(o[a++]=t[e+_*n],o[a++]=t[e+_*n+1]);return a}function Fi(t,e){return e*Math.round(t/e)}function Mi(t,e,r,n,i,o,a){if(e==r)return a;var s,l,u=Fi(t[e],i),h=Fi(t[e+1],i);e+=n,o[a++]=u,o[a++]=h;do{if(s=Fi(t[e],i),l=Fi(t[e+1],i),(e+=n)==r)return o[a++]=s,o[a++]=l,a}while(s==u&&l==h);for(;e<r;){var c=Fi(t[e],i),p=Fi(t[e+1],i);if(e+=n,c!=s||p!=l){var f=s-u,d=l-h,g=c-u,y=p-h;f*y==d*g&&(f<0&&g<f||f==g||f>0&&g>f)&&(d<0&&y<d||d==y||d>0&&y>d)?(s=c,l=p):(o[a++]=s,o[a++]=l,u=s,h=l,s=c,l=p)}}return o[a++]=s,o[a++]=l,a}function Ii(t,e,r,n,i,o,a,s){for(var l=0,u=r.length;l<u;++l){var h=r[l];a=Mi(t,e,h,n,i,o,a),s.push(a),e=h}return a}function Li(t,e,r,n,i){for(var o=void 0!==i?i:[],a=0,s=e;s<r;s+=n)o[a++]=t.slice(s,s+n);return o.length=a,o}function Ai(t,e,r,n,i){for(var o=void 0!==i?i:[],a=0,s=0,l=r.length;s<l;++s){var u=r[s];o[a++]=Li(t,e,u,n,o[a]),e=u}return o.length=a,o}function ki(t,e,r,n,i){for(var o=void 0!==i?i:[],a=0,s=0,l=r.length;s<l;++s){var u=r[s];o[a++]=Ai(t,e,u,n,o[a]),e=u[u.length-1]}return o.length=a,o}function Di(t,e,r,n){for(var i=0,o=t[r-n],a=t[r-n+1];e<r;e+=n){var s=t[e],l=t[e+1];i+=a*s-o*l,o=s,a=l}return i/2}function ji(t,e,r,n){for(var i=0,o=0,a=r.length;o<a;++o){var s=r[o];i+=Di(t,e,s,n),e=s}return i}var Gi=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)}}(),zi=function(t){function e(e,r){var n=t.call(this)||this;return n.maxDelta_=-1,n.maxDeltaRevision_=-1,void 0===r||Array.isArray(e[0])?n.setCoordinates(e,r):n.setFlatCoordinates(r,e),n}return Gi(e,t),e.prototype.clone=function(){return new e(this.flatCoordinates.slice(),this.layout)},e.prototype.closestPointXY=function(t,e,r,n){return n<Ke(this.getExtent(),t,e)?n:(this.maxDeltaRevision_!=this.getRevision()&&(this.maxDelta_=Math.sqrt(Ei(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,0)),this.maxDeltaRevision_=this.getRevision()),Pi(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,this.maxDelta_,!0,t,e,r,n))},e.prototype.getArea=function(){return Di(this.flatCoordinates,0,this.flatCoordinates.length,this.stride)},e.prototype.getCoordinates=function(){return Li(this.flatCoordinates,0,this.flatCoordinates.length,this.stride)},e.prototype.getSimplifiedGeometryInternal=function(t){var r=[];return r.length=Oi(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,t,r,0),new e(r,Gr)},e.prototype.getType=function(){return"LinearRing"},e.prototype.intersectsExtent=function(t){return!1},e.prototype.setCoordinates=function(t,e){this.setLayout(e,t,1),this.flatCoordinates||(this.flatCoordinates=[]),this.flatCoordinates.length=gi(this.flatCoordinates,0,t,this.stride),this.changed()},e}(pi),Ni=zi;function Ui(t,e,r,n,i){var o;for(e+=n;e<r;e+=n)if(o=i(t.slice(e-n,e),t.slice(e,e+n)))return o;return!1}function Bi(t,e,r,n,i,o,a){var s,l,u=(r-e)/n;if(1===u)s=e;else if(2===u)s=e,l=i;else if(0!==u){for(var h=t[e],c=t[e+1],p=0,f=[0],d=e+n;d<r;d+=n){var g=t[d],y=t[d+1];p+=Math.sqrt((g-h)*(g-h)+(y-c)*(y-c)),f.push(p),h=g,c=y}var v=i*p,_=function(t,e,r){for(var n,i,o=r||at,a=0,s=t.length,l=!1;a<s;)(i=+o(t[n=a+(s-a>>1)],e))<0?a=n+1:(s=n,l=!i);return l?a:~a}(f,v);_<0?(l=(v-f[-_-2])/(f[-_-1]-f[-_-2]),s=e+(-_-2)*n):s=e+_*n}var m=a>1?a:2,x=o||new Array(m);for(d=0;d<m;++d)x[d]=void 0===s?NaN:void 0===l?t[s+d]:P(t[s+d],t[s+n+d],l);return x}function Vi(t,e,r,n,i,o){if(r==e)return null;var a;if(i<t[e+n-1])return o?((a=t.slice(e,e+n))[n-1]=i,a):null;if(t[r-1]<i)return o?((a=t.slice(r-n,r))[n-1]=i,a):null;if(i==t[e+n-1])return t.slice(e,e+n);for(var s=e/n,l=r/n;s<l;){var u=s+l>>1;i<t[(u+1)*n-1]?l=u:s=u+1}var h=t[s*n-1];if(i==h)return t.slice((s-1)*n,(s-1)*n+n);var c=(i-h)/(t[(s+1)*n-1]-h);a=[];for(var p=0;p<n-1;++p)a.push(P(t[(s-1)*n+p],t[s*n+p],c));return a.push(i),a}function Xi(t,e,r,n,i){return!ur(i,(function(i){return!Wi(t,e,r,n,i[0],i[1])}))}function Wi(t,e,r,n,i,o){for(var a=0,s=t[r-n],l=t[r-n+1];e<r;e+=n){var u=t[e],h=t[e+1];l<=o?h>o&&(u-s)*(o-l)-(i-s)*(h-l)>0&&a++:h<=o&&(u-s)*(o-l)-(i-s)*(h-l)<0&&a--,s=u,l=h}return 0!==a}function qi(t,e,r,n,i,o){if(0===r.length)return!1;if(!Wi(t,e,r[0],n,i,o))return!1;for(var a=1,s=r.length;a<s;++a)if(Wi(t,r[a-1],r[a],n,i,o))return!1;return!0}function Yi(t,e,r,n,i){var o=sr([1/0,1/0,-1/0,-1/0],t,e,r,n);return!!br(i,o)&&(!!He(i,o)||(o[0]>=i[0]&&o[2]<=i[2]||(o[1]>=i[1]&&o[3]<=i[3]||Ui(t,e,r,n,(function(t,e){return function(t,e,r){var n=!1,i=Qe(t,e),o=Qe(t,r);if(i===Ne||o===Ne)n=!0;else{var a=t[0],s=t[1],l=t[2],u=t[3],h=e[0],c=e[1],p=r[0],f=r[1],d=(f-c)/(p-h),g=void 0,y=void 0;o&Ue&&!(i&Ue)&&(n=(g=p-(f-u)/d)>=a&&g<=l),n||!(o&Be)||i&Be||(n=(y=f-(p-l)*d)>=s&&y<=u),n||!(o&Ve)||i&Ve||(n=(g=p-(f-s)/d)>=a&&g<=l),n||!(o&Xe)||i&Xe||(n=(y=f-(p-a)*d)>=s&&y<=u)}return n}(i,t,e)})))))}function Ki(t,e,r,n,i){return!!Yi(t,e,r,n,i)||(!!Wi(t,e,r,n,i[0],i[1])||(!!Wi(t,e,r,n,i[0],i[3])||(!!Wi(t,e,r,n,i[2],i[1])||!!Wi(t,e,r,n,i[2],i[3]))))}function Zi(t,e,r,n,i){if(!Ki(t,e,r[0],n,i))return!1;if(1===r.length)return!0;for(var o=1,a=r.length;o<a;++o)if(Xi(t,r[o-1],r[o],n,i)&&!Yi(t,r[o-1],r[o],n,i))return!1;return!0}function Hi(t,e,r,n){for(var i=t[e],o=t[e+1],a=0,s=e+n;s<r;s+=n){var l=t[s],u=t[s+1];a+=Math.sqrt((l-i)*(l-i)+(u-o)*(u-o)),i=l,o=u}return a}var Ji=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)}}(),Qi=function(t){function e(e,r){var n=t.call(this)||this;return n.flatMidpoint_=null,n.flatMidpointRevision_=-1,n.maxDelta_=-1,n.maxDeltaRevision_=-1,void 0===r||Array.isArray(e[0])?n.setCoordinates(e,r):n.setFlatCoordinates(r,e),n}return Ji(e,t),e.prototype.appendCoordinate=function(t){this.flatCoordinates?ht(this.flatCoordinates,t):this.flatCoordinates=t.slice(),this.changed()},e.prototype.clone=function(){var t=new e(this.flatCoordinates.slice(),this.layout);return t.applyProperties(this),t},e.prototype.closestPointXY=function(t,e,r,n){return n<Ke(this.getExtent(),t,e)?n:(this.maxDeltaRevision_!=this.getRevision()&&(this.maxDelta_=Math.sqrt(Ei(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,0)),this.maxDeltaRevision_=this.getRevision()),Pi(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,this.maxDelta_,!1,t,e,r,n))},e.prototype.forEachSegment=function(t){return Ui(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,t)},e.prototype.getCoordinateAtM=function(t,e){if(this.layout!=Nr&&this.layout!=Ur)return null;var r=void 0!==e&&e;return Vi(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,t,r)},e.prototype.getCoordinates=function(){return Li(this.flatCoordinates,0,this.flatCoordinates.length,this.stride)},e.prototype.getCoordinateAt=function(t,e){return Bi(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,t,e,this.stride)},e.prototype.getLength=function(){return Hi(this.flatCoordinates,0,this.flatCoordinates.length,this.stride)},e.prototype.getFlatMidpoint=function(){return this.flatMidpointRevision_!=this.getRevision()&&(this.flatMidpoint_=this.getCoordinateAt(.5,this.flatMidpoint_),this.flatMidpointRevision_=this.getRevision()),this.flatMidpoint_},e.prototype.getSimplifiedGeometryInternal=function(t){var r=[];return r.length=Oi(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,t,r,0),new e(r,Gr)},e.prototype.getType=function(){return"LineString"},e.prototype.intersectsExtent=function(t){return Yi(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,t)},e.prototype.setCoordinates=function(t,e){this.setLayout(e,t,1),this.flatCoordinates||(this.flatCoordinates=[]),this.flatCoordinates.length=gi(this.flatCoordinates,0,t,this.stride),this.changed()},e}(pi),$i=Qi,to=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)}}(),eo=function(t){function e(e,r,n){var i=t.call(this)||this;if(i.ends_=[],i.maxDelta_=-1,i.maxDeltaRevision_=-1,Array.isArray(e[0]))i.setCoordinates(e,r);else if(void 0!==r&&n)i.setFlatCoordinates(r,e),i.ends_=n;else{for(var o=i.getLayout(),a=e,s=[],l=[],u=0,h=a.length;u<h;++u){var c=a[u];0===u&&(o=c.getLayout()),ht(s,c.getFlatCoordinates()),l.push(s.length)}i.setFlatCoordinates(o,s),i.ends_=l}return i}return to(e,t),e.prototype.appendLineString=function(t){this.flatCoordinates?ht(this.flatCoordinates,t.getFlatCoordinates().slice()):this.flatCoordinates=t.getFlatCoordinates().slice(),this.ends_.push(this.flatCoordinates.length),this.changed()},e.prototype.clone=function(){var t=new e(this.flatCoordinates.slice(),this.layout,this.ends_.slice());return t.applyProperties(this),t},e.prototype.closestPointXY=function(t,e,r,n){return n<Ke(this.getExtent(),t,e)?n:(this.maxDeltaRevision_!=this.getRevision()&&(this.maxDelta_=Math.sqrt(Ti(this.flatCoordinates,0,this.ends_,this.stride,0)),this.maxDeltaRevision_=this.getRevision()),Ri(this.flatCoordinates,0,this.ends_,this.stride,this.maxDelta_,!1,t,e,r,n))},e.prototype.getCoordinateAtM=function(t,e,r){if(this.layout!=Nr&&this.layout!=Ur||0===this.flatCoordinates.length)return null;var n=void 0!==e&&e,i=void 0!==r&&r;return function(t,e,r,n,i,o,a){if(a)return Vi(t,e,r[r.length-1],n,i,o);var s;if(i<t[n-1])return o?((s=t.slice(0,n))[n-1]=i,s):null;if(t[t.length-1]<i)return o?((s=t.slice(t.length-n))[n-1]=i,s):null;for(var l=0,u=r.length;l<u;++l){var h=r[l];if(e!=h){if(i<t[e+n-1])return null;if(i<=t[h-1])return Vi(t,e,h,n,i,!1);e=h}}return null}(this.flatCoordinates,0,this.ends_,this.stride,t,n,i)},e.prototype.getCoordinates=function(){return Ai(this.flatCoordinates,0,this.ends_,this.stride)},e.prototype.getEnds=function(){return this.ends_},e.prototype.getLineString=function(t){return t<0||this.ends_.length<=t?null:new $i(this.flatCoordinates.slice(0===t?0:this.ends_[t-1],this.ends_[t]),this.layout)},e.prototype.getLineStrings=function(){for(var t=this.flatCoordinates,e=this.ends_,r=this.layout,n=[],i=0,o=0,a=e.length;o<a;++o){var s=e[o],l=new $i(t.slice(i,s),r);n.push(l),i=s}return n},e.prototype.getFlatMidpoints=function(){for(var t=[],e=this.flatCoordinates,r=0,n=this.ends_,i=this.stride,o=0,a=n.length;o<a;++o){var s=n[o];ht(t,Bi(e,r,s,i,.5)),r=s}return t},e.prototype.getSimplifiedGeometryInternal=function(t){var r=[],n=[];return r.length=function(t,e,r,n,i,o,a,s){for(var l=0,u=r.length;l<u;++l){var h=r[l];a=Oi(t,e,h,n,i,o,a),s.push(a),e=h}return a}(this.flatCoordinates,0,this.ends_,this.stride,t,r,0,n),new e(r,Gr,n)},e.prototype.getType=function(){return"MultiLineString"},e.prototype.intersectsExtent=function(t){return function(t,e,r,n,i){for(var o=0,a=r.length;o<a;++o){if(Yi(t,e,r[o],n,i))return!0;e=r[o]}return!1}(this.flatCoordinates,0,this.ends_,this.stride,t)},e.prototype.setCoordinates=function(t,e){this.setLayout(e,t,2),this.flatCoordinates||(this.flatCoordinates=[]);var r=yi(this.flatCoordinates,0,t,this.stride,this.ends_);this.flatCoordinates.length=0===r.length?0:r[r.length-1],this.changed()},e}(pi),ro=eo,no=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)}}(),io=function(t){function e(e,r){var n=t.call(this)||this;return n.setCoordinates(e,r),n}return no(e,t),e.prototype.clone=function(){var t=new e(this.flatCoordinates.slice(),this.layout);return t.applyProperties(this),t},e.prototype.closestPointXY=function(t,e,r,n){var i=this.flatCoordinates,o=S(t,e,i[0],i[1]);if(o<n){for(var a=this.stride,s=0;s<a;++s)r[s]=i[s];return r.length=a,o}return n},e.prototype.getCoordinates=function(){return this.flatCoordinates?this.flatCoordinates.slice():[]},e.prototype.computeExtent=function(t){return rr(this.flatCoordinates,t)},e.prototype.getType=function(){return"Point"},e.prototype.intersectsExtent=function(t){return Je(t,this.flatCoordinates[0],this.flatCoordinates[1])},e.prototype.setCoordinates=function(t,e){this.setLayout(e,t,0),this.flatCoordinates||(this.flatCoordinates=[]),this.flatCoordinates.length=di(this.flatCoordinates,0,t,this.stride),this.changed()},e}(pi),oo=io,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)}}(),so=function(t){function e(e,r){var n=t.call(this)||this;return r&&!Array.isArray(e[0])?n.setFlatCoordinates(r,e):n.setCoordinates(e,r),n}return ao(e,t),e.prototype.appendPoint=function(t){this.flatCoordinates?ht(this.flatCoordinates,t.getFlatCoordinates()):this.flatCoordinates=t.getFlatCoordinates().slice(),this.changed()},e.prototype.clone=function(){var t=new e(this.flatCoordinates.slice(),this.layout);return t.applyProperties(this),t},e.prototype.closestPointXY=function(t,e,r,n){if(n<Ke(this.getExtent(),t,e))return n;for(var i=this.flatCoordinates,o=this.stride,a=0,s=i.length;a<s;a+=o){var l=S(t,e,i[a],i[a+1]);if(l<n){n=l;for(var u=0;u<o;++u)r[u]=i[a+u];r.length=o}}return n},e.prototype.getCoordinates=function(){return Li(this.flatCoordinates,0,this.flatCoordinates.length,this.stride)},e.prototype.getPoint=function(t){var e=this.flatCoordinates?this.flatCoordinates.length/this.stride:0;return t<0||e<=t?null:new oo(this.flatCoordinates.slice(t*this.stride,(t+1)*this.stride),this.layout)},e.prototype.getPoints=function(){for(var t=this.flatCoordinates,e=this.layout,r=this.stride,n=[],i=0,o=t.length;i<o;i+=r){var a=new oo(t.slice(i,i+r),e);n.push(a)}return n},e.prototype.getType=function(){return"MultiPoint"},e.prototype.intersectsExtent=function(t){for(var e=this.flatCoordinates,r=this.stride,n=0,i=e.length;n<i;n+=r){if(Je(t,e[n],e[n+1]))return!0}return!1},e.prototype.setCoordinates=function(t,e){this.setLayout(e,t,1),this.flatCoordinates||(this.flatCoordinates=[]),this.flatCoordinates.length=gi(this.flatCoordinates,0,t,this.stride),this.changed()},e}(pi),lo=so;function uo(t,e,r,n,i,o,a){for(var s,l,u,h,c,p,f,d=i[o+1],g=[],y=0,v=r.length;y<v;++y){var _=r[y];for(h=t[_-n],p=t[_-n+1],s=e;s<_;s+=n)c=t[s],f=t[s+1],(d<=p&&f<=d||p<=d&&d<=f)&&(u=(d-p)/(f-p)*(c-h)+h,g.push(u)),h=c,p=f}var m=NaN,x=-1/0;for(g.sort(at),h=g[0],s=1,l=g.length;s<l;++s){c=g[s];var w=Math.abs(c-h);w>x&&qi(t,e,r,n,u=(h+c)/2,d)&&(m=u,x=w),h=c}return isNaN(m)&&(m=i[o]),a?(a.push(m,d,x),a):[m,d,x]}function ho(t,e,r,n,i){for(var o=[],a=0,s=r.length;a<s;++a){var l=r[a];o=uo(t,e,l,n,i,2*a,o),e=l[l.length-1]}return o}function co(t,e,r,n){for(;e<r-n;){for(var i=0;i<n;++i){var o=t[e+i];t[e+i]=t[r-n+i],t[r-n+i]=o}e+=n,r-=n}}function po(t,e,r,n){for(var i=0,o=t[r-n],a=t[r-n+1];e<r;e+=n){var s=t[e],l=t[e+1];i+=(s-o)*(l+a),o=s,a=l}return 0===i?void 0:i>0}function fo(t,e,r,n,i){for(var o=void 0!==i&&i,a=0,s=r.length;a<s;++a){var l=r[a],u=po(t,e,l,n);if(0===a){if(o&&u||!o&&!u)return!1}else if(o&&!u||!o&&u)return!1;e=l}return!0}function go(t,e,r,n,i){for(var o=void 0!==i&&i,a=0,s=r.length;a<s;++a){var l=r[a],u=po(t,e,l,n);(0===a?o&&u||!o&&!u:o&&!u||!o&&u)&&co(t,e,l,n),e=l}return e}function yo(t,e,r,n,i){for(var o=0,a=r.length;o<a;++o)e=go(t,e,r[o],n,i);return e}var vo=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)}}(),_o=function(t){function e(e,r,n){var i=t.call(this)||this;return i.ends_=[],i.flatInteriorPointRevision_=-1,i.flatInteriorPoint_=null,i.maxDelta_=-1,i.maxDeltaRevision_=-1,i.orientedRevision_=-1,i.orientedFlatCoordinates_=null,void 0!==r&&n?(i.setFlatCoordinates(r,e),i.ends_=n):i.setCoordinates(e,r),i}return vo(e,t),e.prototype.appendLinearRing=function(t){this.flatCoordinates?ht(this.flatCoordinates,t.getFlatCoordinates()):this.flatCoordinates=t.getFlatCoordinates().slice(),this.ends_.push(this.flatCoordinates.length),this.changed()},e.prototype.clone=function(){var t=new e(this.flatCoordinates.slice(),this.layout,this.ends_.slice());return t.applyProperties(this),t},e.prototype.closestPointXY=function(t,e,r,n){return n<Ke(this.getExtent(),t,e)?n:(this.maxDeltaRevision_!=this.getRevision()&&(this.maxDelta_=Math.sqrt(Ti(this.flatCoordinates,0,this.ends_,this.stride,0)),this.maxDeltaRevision_=this.getRevision()),Ri(this.flatCoordinates,0,this.ends_,this.stride,this.maxDelta_,!0,t,e,r,n))},e.prototype.containsXY=function(t,e){return qi(this.getOrientedFlatCoordinates(),0,this.ends_,this.stride,t,e)},e.prototype.getArea=function(){return ji(this.getOrientedFlatCoordinates(),0,this.ends_,this.stride)},e.prototype.getCoordinates=function(t){var e;return void 0!==t?go(e=this.getOrientedFlatCoordinates().slice(),0,this.ends_,this.stride,t):e=this.flatCoordinates,Ai(e,0,this.ends_,this.stride)},e.prototype.getEnds=function(){return this.ends_},e.prototype.getFlatInteriorPoint=function(){if(this.flatInteriorPointRevision_!=this.getRevision()){var t=fr(this.getExtent());this.flatInteriorPoint_=uo(this.getOrientedFlatCoordinates(),0,this.ends_,this.stride,t,0),this.flatInteriorPointRevision_=this.getRevision()}return this.flatInteriorPoint_},e.prototype.getInteriorPoint=function(){return new oo(this.getFlatInteriorPoint(),Nr)},e.prototype.getLinearRingCount=function(){return this.ends_.length},e.prototype.getLinearRing=function(t){return t<0||this.ends_.length<=t?null:new Ni(this.flatCoordinates.slice(0===t?0:this.ends_[t-1],this.ends_[t]),this.layout)},e.prototype.getLinearRings=function(){for(var t=this.layout,e=this.flatCoordinates,r=this.ends_,n=[],i=0,o=0,a=r.length;o<a;++o){var s=r[o],l=new Ni(e.slice(i,s),t);n.push(l),i=s}return n},e.prototype.getOrientedFlatCoordinates=function(){if(this.orientedRevision_!=this.getRevision()){var t=this.flatCoordinates;fo(t,0,this.ends_,this.stride)?this.orientedFlatCoordinates_=t:(this.orientedFlatCoordinates_=t.slice(),this.orientedFlatCoordinates_.length=go(this.orientedFlatCoordinates_,0,this.ends_,this.stride)),this.orientedRevision_=this.getRevision()}return this.orientedFlatCoordinates_},e.prototype.getSimplifiedGeometryInternal=function(t){var r=[],n=[];return r.length=Ii(this.flatCoordinates,0,this.ends_,this.stride,Math.sqrt(t),r,0,n),new e(r,Gr,n)},e.prototype.getType=function(){return"Polygon"},e.prototype.intersectsExtent=function(t){return Zi(this.getOrientedFlatCoordinates(),0,this.ends_,this.stride,t)},e.prototype.setCoordinates=function(t,e){this.setLayout(e,t,2),this.flatCoordinates||(this.flatCoordinates=[]);var r=yi(this.flatCoordinates,0,t,this.stride,this.ends_);this.flatCoordinates.length=0===r.length?0:r[r.length-1],this.changed()},e}(pi),mo=_o;function xo(t){var e=t[0],r=t[1],n=t[2],i=t[3],o=[e,r,e,i,n,i,n,r,e,r];return new _o(o,Gr,[o.length])}function wo(t,e,r){for(var n=e||32,i=t.getStride(),o=t.getLayout(),a=t.getCenter(),s=i*(n+1),l=new Array(s),u=0;u<s;u+=i){l[u]=0,l[u+1]=0;for(var h=2;h<i;h++)l[u+h]=a[h]}var c=[l.length],p=new _o(l,o,c);return function(t,e,r,n){for(var i=t.getFlatCoordinates(),o=t.getStride(),a=i.length/o-1,s=n||0,l=0;l<=a;++l){var u=l*o,h=s+2*T(l,a)*Math.PI/a;i[u]=e[0]+r*Math.cos(h),i[u+1]=e[1]+r*Math.sin(h)}t.changed()}(p,a,t.getRadius(),r),p}function bo(t,e,r,n){for(var i=[],o=[1/0,1/0,-1/0,-1/0],a=0,s=r.length;a<s;++a){var l=r[a];o=nr(t,e,l[0],n),i.push((o[0]+o[2])/2,(o[1]+o[3])/2),e=l[l.length-1]}return i}var So=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)}}(),Co=function(t){function e(e,r,n){var i=t.call(this)||this;if(i.endss_=[],i.flatInteriorPointsRevision_=-1,i.flatInteriorPoints_=null,i.maxDelta_=-1,i.maxDeltaRevision_=-1,i.orientedRevision_=-1,i.orientedFlatCoordinates_=null,!n&&!Array.isArray(e[0])){for(var o=i.getLayout(),a=e,s=[],l=[],u=0,h=a.length;u<h;++u){var c=a[u];0===u&&(o=c.getLayout());for(var p=s.length,f=c.getEnds(),d=0,g=f.length;d<g;++d)f[d]+=p;ht(s,c.getFlatCoordinates()),l.push(f)}r=o,e=s,n=l}return void 0!==r&&n?(i.setFlatCoordinates(r,e),i.endss_=n):i.setCoordinates(e,r),i}return So(e,t),e.prototype.appendPolygon=function(t){var e;if(this.flatCoordinates){var r=this.flatCoordinates.length;ht(this.flatCoordinates,t.getFlatCoordinates());for(var n=0,i=(e=t.getEnds().slice()).length;n<i;++n)e[n]+=r}else this.flatCoordinates=t.getFlatCoordinates().slice(),e=t.getEnds().slice(),this.endss_.push();this.endss_.push(e),this.changed()},e.prototype.clone=function(){for(var t=this.endss_.length,r=new Array(t),n=0;n<t;++n)r[n]=this.endss_[n].slice();var i=new e(this.flatCoordinates.slice(),this.layout,r);return i.applyProperties(this),i},e.prototype.closestPointXY=function(t,e,r,n){return n<Ke(this.getExtent(),t,e)?n:(this.maxDeltaRevision_!=this.getRevision()&&(this.maxDelta_=Math.sqrt(function(t,e,r,n,i){for(var o=0,a=r.length;o<a;++o){var s=r[o];i=Ti(t,e,s,n,i),e=s[s.length-1]}return i}(this.flatCoordinates,0,this.endss_,this.stride,0)),this.maxDeltaRevision_=this.getRevision()),function(t,e,r,n,i,o,a,s,l,u,h){for(var c=h||[NaN,NaN],p=0,f=r.length;p<f;++p){var d=r[p];u=Ri(t,e,d,n,i,o,a,s,l,u,c),e=d[d.length-1]}return u}(this.getOrientedFlatCoordinates(),0,this.endss_,this.stride,this.maxDelta_,!0,t,e,r,n))},e.prototype.containsXY=function(t,e){return function(t,e,r,n,i,o){if(0===r.length)return!1;for(var a=0,s=r.length;a<s;++a){var l=r[a];if(qi(t,e,l,n,i,o))return!0;e=l[l.length-1]}return!1}(this.getOrientedFlatCoordinates(),0,this.endss_,this.stride,t,e)},e.prototype.getArea=function(){return function(t,e,r,n){for(var i=0,o=0,a=r.length;o<a;++o){var s=r[o];i+=ji(t,e,s,n),e=s[s.length-1]}return i}(this.getOrientedFlatCoordinates(),0,this.endss_,this.stride)},e.prototype.getCoordinates=function(t){var e;return void 0!==t?yo(e=this.getOrientedFlatCoordinates().slice(),0,this.endss_,this.stride,t):e=this.flatCoordinates,ki(e,0,this.endss_,this.stride)},e.prototype.getEndss=function(){return this.endss_},e.prototype.getFlatInteriorPoints=function(){if(this.flatInteriorPointsRevision_!=this.getRevision()){var t=bo(this.flatCoordinates,0,this.endss_,this.stride);this.flatInteriorPoints_=ho(this.getOrientedFlatCoordinates(),0,this.endss_,this.stride,t),this.flatInteriorPointsRevision_=this.getRevision()}return this.flatInteriorPoints_},e.prototype.getInteriorPoints=function(){return new lo(this.getFlatInteriorPoints().slice(),Nr)},e.prototype.getOrientedFlatCoordinates=function(){if(this.orientedRevision_!=this.getRevision()){var t=this.flatCoordinates;!function(t,e,r,n,i){for(var o=0,a=r.length;o<a;++o){var s=r[o];if(!fo(t,e,s,n,i))return!1;s.length&&(e=s[s.length-1])}return!0}(t,0,this.endss_,this.stride)?(this.orientedFlatCoordinates_=t.slice(),this.orientedFlatCoordinates_.length=yo(this.orientedFlatCoordinates_,0,this.endss_,this.stride)):this.orientedFlatCoordinates_=t,this.orientedRevision_=this.getRevision()}return this.orientedFlatCoordinates_},e.prototype.getSimplifiedGeometryInternal=function(t){var r=[],n=[];return r.length=function(t,e,r,n,i,o,a,s){for(var l=0,u=r.length;l<u;++l){var h=r[l],c=[];a=Ii(t,e,h,n,i,o,a,c),s.push(c),e=h[h.length-1]}return a}(this.flatCoordinates,0,this.endss_,this.stride,Math.sqrt(t),r,0,n),new e(r,Gr,n)},e.prototype.getPolygon=function(t){if(t<0||this.endss_.length<=t)return null;var e;if(0===t)e=0;else{var r=this.endss_[t-1];e=r[r.length-1]}var n=this.endss_[t].slice(),i=n[n.length-1];if(0!==e)for(var o=0,a=n.length;o<a;++o)n[o]-=e;return new mo(this.flatCoordinates.slice(e,i),this.layout,n)},e.prototype.getPolygons=function(){for(var t=this.layout,e=this.flatCoordinates,r=this.endss_,n=[],i=0,o=0,a=r.length;o<a;++o){var s=r[o].slice(),l=s[s.length-1];if(0!==i)for(var u=0,h=s.length;u<h;++u)s[u]-=i;var c=new mo(e.slice(i,l),t,s);n.push(c),i=l}return n},e.prototype.getType=function(){return"MultiPolygon"},e.prototype.intersectsExtent=function(t){return function(t,e,r,n,i){for(var o=0,a=r.length;o<a;++o){var s=r[o];if(Zi(t,e,s,n,i))return!0;e=s[s.length-1]}return!1}(this.getOrientedFlatCoordinates(),0,this.endss_,this.stride,t)},e.prototype.setCoordinates=function(t,e){this.setLayout(e,t,3),this.flatCoordinates||(this.flatCoordinates=[]);var r=function(t,e,r,n,i){for(var o=i||[],a=0,s=0,l=r.length;s<l;++s){var u=yi(t,e,r[s],n,o[a]);o[a++]=u,e=u[u.length-1]}return o.length=a,o}(this.flatCoordinates,0,t,this.stride,this.endss_);if(0===r.length)this.flatCoordinates.length=0;else{var n=r[r.length-1];this.flatCoordinates.length=0===n.length?0:n[n.length-1]}this.changed()},e}(pi),Eo=Co,To=[1,0,0,1,0,0],Po=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_="Point"===this.type_?rr(this.flatCoordinates_):nr(this.flatCoordinates_,0,this.flatCoordinates_.length,2)),this.extent_},t.prototype.getFlatInteriorPoint=function(){if(!this.flatInteriorPoints_){var t=fr(this.getExtent());this.flatInteriorPoints_=uo(this.flatCoordinates_,0,this.ends_,2,t,0)}return this.flatInteriorPoints_},t.prototype.getFlatInteriorPoints=function(){if(!this.flatInteriorPoints_){var t=bo(this.flatCoordinates_,0,this.ends_,2);this.flatInteriorPoints_=ho(this.flatCoordinates_,0,this.ends_,2,t)}return this.flatInteriorPoints_},t.prototype.getFlatMidpoint=function(){return this.flatMidpoints_||(this.flatMidpoints_=Bi(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,i=r.length;n<i;++n){var o=r[n],a=Bi(t,e,o,2,.5);ht(this.flatMidpoints_,a),e=o}}return this.flatMidpoints_},t.prototype.getId=function(){return this.id_},t.prototype.getOrientedFlatCoordinates=function(){return this.flatCoordinates_},t.prototype.getGeometry=function(){return this},t.prototype.getSimplifiedGeometry=function(t){return this},t.prototype.simplifyTransformed=function(t,e){return this},t.prototype.getProperties=function(){return this.properties_},t.prototype.getStride=function(){return 2},t.prototype.getStyleFunction=function(){return this.styleFunction},t.prototype.getType=function(){return this.type_},t.prototype.transform=function(t){var e=(t=Bn(t)).getExtent(),r=t.getWorldExtent();if(e&&r){var n=vr(r)/vr(e);tn(To,r[0],r[3],n,-n,0,0,0),ii(this.flatCoordinates_,0,this.flatCoordinates_.length,2,To,this.flatCoordinates_)}},t.prototype.getEnds=function(){return this.ends_},t}();Po.prototype.getEndss=Po.prototype.getEnds,Po.prototype.getFlatCoordinates=Po.prototype.getOrientedFlatCoordinates;var Ro=Po,Oo=function(){function t(t){var e=t||{};this.color_=void 0!==e.color?e.color:null,this.lineCap_=e.lineCap,this.lineDash_=void 0!==e.lineDash?e.lineDash:null,this.lineDashOffset_=e.lineDashOffset,this.lineJoin_=e.lineJoin,this.miterLimit_=e.miterLimit,this.width_=e.width}return t.prototype.clone=function(){var e=this.getColor();return new t({color:Array.isArray(e)?e.slice():e||void 0,lineCap:this.getLineCap(),lineDash:this.getLineDash()?this.getLineDash().slice():void 0,lineDashOffset:this.getLineDashOffset(),lineJoin:this.getLineJoin(),miterLimit:this.getMiterLimit(),width:this.getWidth()})},t.prototype.getColor=function(){return this.color_},t.prototype.getLineCap=function(){return this.lineCap_},t.prototype.getLineDash=function(){return this.lineDash_},t.prototype.getLineDashOffset=function(){return this.lineDashOffset_},t.prototype.getLineJoin=function(){return this.lineJoin_},t.prototype.getMiterLimit=function(){return this.miterLimit_},t.prototype.getWidth=function(){return this.width_},t.prototype.setColor=function(t){this.color_=t},t.prototype.setLineCap=function(t){this.lineCap_=t},t.prototype.setLineDash=function(t){this.lineDash_=t},t.prototype.setLineDashOffset=function(t){this.lineDashOffset_=t},t.prototype.setLineJoin=function(t){this.lineJoin_=t},t.prototype.setMiterLimit=function(t){this.miterLimit_=t},t.prototype.setWidth=function(t){this.width_=t},t}(),Fo=Oo,Mo=function(){function t(t){var e=t||{};this.geometry_=null,this.geometryFunction_=ko,void 0!==e.geometry&&this.setGeometry(e.geometry),this.fill_=void 0!==e.fill?e.fill:null,this.image_=void 0!==e.image?e.image:null,this.renderer_=void 0!==e.renderer?e.renderer:null,this.hitDetectionRenderer_=void 0!==e.hitDetectionRenderer?e.hitDetectionRenderer:null,this.stroke_=void 0!==e.stroke?e.stroke:null,this.text_=void 0!==e.text?e.text:null,this.zIndex_=e.zIndex}return t.prototype.clone=function(){var e=this.getGeometry();return e&&"object"==typeof e&&(e=e.clone()),new t({geometry:e,fill:this.getFill()?this.getFill().clone():void 0,image:this.getImage()?this.getImage().clone():void 0,renderer:this.getRenderer(),stroke:this.getStroke()?this.getStroke().clone():void 0,text:this.getText()?this.getText().clone():void 0,zIndex:this.getZIndex()})},t.prototype.getRenderer=function(){return this.renderer_},t.prototype.setRenderer=function(t){this.renderer_=t},t.prototype.setHitDetectionRenderer=function(t){this.hitDetectionRenderer_=t},t.prototype.getHitDetectionRenderer=function(){return this.hitDetectionRenderer_},t.prototype.getGeometry=function(){return this.geometry_},t.prototype.getGeometryFunction=function(){return this.geometryFunction_},t.prototype.getFill=function(){return this.fill_},t.prototype.setFill=function(t){this.fill_=t},t.prototype.getImage=function(){return this.image_},t.prototype.setImage=function(t){this.image_=t},t.prototype.getStroke=function(){return this.stroke_},t.prototype.setStroke=function(t){this.stroke_=t},t.prototype.getText=function(){return this.text_},t.prototype.setText=function(t){this.text_=t},t.prototype.getZIndex=function(){return this.zIndex_},t.prototype.setGeometry=function(t){"function"==typeof t?this.geometryFunction_=t:"string"==typeof t?this.geometryFunction_=function(e){return e.get(t)}:t?void 0!==t&&(this.geometryFunction_=function(){return t}):this.geometryFunction_=ko,this.geometry_=t},t.prototype.setZIndex=function(t){this.zIndex_=t},t}();var Io=null;function Lo(t,e){if(!Io){var r=new Pe({color:"rgba(255,255,255,0.4)"}),n=new Fo({color:"#3399CC",width:1.25});Io=[new Mo({image:new Ee({fill:r,stroke:n,radius:5}),fill:r,stroke:n})]}return Io}function Ao(){var t={},e=[255,255,255,1],r=[0,153,255,1];return t.Polygon=[new Mo({fill:new Pe({color:[255,255,255,.5]})})],t.MultiPolygon=t.Polygon,t.LineString=[new Mo({stroke:new Fo({color:e,width:5})}),new Mo({stroke:new Fo({color:r,width:3})})],t.MultiLineString=t.LineString,t.Circle=t.Polygon.concat(t.LineString),t.Point=[new Mo({image:new Ee({radius:6,fill:new Pe({color:r}),stroke:new Fo({color:e,width:1.5})}),zIndex:1/0})],t.MultiPoint=t.Point,t.GeometryCollection=t.Polygon.concat(t.LineString,t.Point),t}function ko(t){return t.getGeometry()}var Do=Mo,jo="point",Go="line",zo=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_=p(void 0!==e.scale?e.scale:1),this.text_=e.text,this.textAlign_=e.textAlign,this.justify_=e.justify,this.textBaseline_=e.textBaseline,this.fill_=void 0!==e.fill?e.fill:new Pe({color:"#333"}),this.maxAngle_=void 0!==e.maxAngle?e.maxAngle:Math.PI/4,this.placement_=void 0!==e.placement?e.placement:jo,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(),justify:this.getJustify(),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.getJustify=function(){return this.justify_},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_=p(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.setJustify=function(t){this.justify_=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}(),No=zo,Uo=function(){function t(){this.dataProjection=void 0,this.defaultFeatureProjection=void 0,this.supportedMediaTypes=null}return t.prototype.getReadOptions=function(t,e){var r;if(e){var n=e.dataProjection?Bn(e.dataProjection):this.readProjection(t);e.extent&&n&&n.getUnits()===Wr.TILE_PIXELS&&(n=Bn(n)).setWorldExtent(e.extent),r={dataProjection:n,featureProjection:e.featureProjection}}return this.adaptOptions(r)},t.prototype.adaptOptions=function(t){return gt({dataProjection:this.dataProjection,featureProjection:this.defaultFeatureProjection},t)},t.prototype.getType=function(){return a()},t.prototype.readFeature=function(t,e){return a()},t.prototype.readFeatures=function(t,e){return a()},t.prototype.readGeometry=function(t,e){return a()},t.prototype.readProjection=function(t){return a()},t.prototype.writeFeature=function(t,e){return a()},t.prototype.writeFeatures=function(t,e){return a()},t.prototype.writeGeometry=function(t,e){return a()},t}();function Bo(t,e,r){var n,i=r?Bn(r.featureProjection):null,o=r?Bn(r.dataProjection):null;if(n=i&&o&&!Yn(i,o)?(e?t.clone():t).transform(e?i:o,e?o:i):t,e&&r&&void 0!==r.decimals){var a=Math.pow(10,r.decimals);n===t&&(n=t.clone()),n.applyTransform((function(t){for(var e=0,r=t.length;e<r;++e)t[e]=Math.round(t[e]*a)/a;return t}))}return n}var Vo=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)}}(),Xo=function(t){function e(){return t.call(this)||this}return Vo(e,t),e.prototype.getType=function(){return"json"},e.prototype.readFeature=function(t,e){return this.readFeatureFromObject(Wo(t),this.getReadOptions(t,e))},e.prototype.readFeatures=function(t,e){return this.readFeaturesFromObject(Wo(t),this.getReadOptions(t,e))},e.prototype.readFeatureFromObject=function(t,e){return a()},e.prototype.readFeaturesFromObject=function(t,e){return a()},e.prototype.readGeometry=function(t,e){return this.readGeometryFromObject(Wo(t),this.getReadOptions(t,e))},e.prototype.readGeometryFromObject=function(t,e){return a()},e.prototype.readProjection=function(t){return this.readProjectionFromObject(Wo(t))},e.prototype.readProjectionFromObject=function(t){return a()},e.prototype.writeFeature=function(t,e){return JSON.stringify(this.writeFeatureObject(t,e))},e.prototype.writeFeatureObject=function(t,e){return a()},e.prototype.writeFeatures=function(t,e){return JSON.stringify(this.writeFeaturesObject(t,e))},e.prototype.writeFeaturesObject=function(t,e){return a()},e.prototype.writeGeometry=function(t,e){return JSON.stringify(this.writeGeometryObject(t,e))},e.prototype.writeGeometryObject=function(t,e){return a()},e}(Uo);function Wo(t){if("string"==typeof t){var e=JSON.parse(t);return e||null}return null!==t?t:null}var qo=Xo,Yo=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 Ko(t,e){if(!t)return null;var r;switch(t.type){case"Point":r=function(t){return new oo(t.coordinates)}(t);break;case"LineString":r=function(t){return new $i(t.coordinates)}(t);break;case"Polygon":r=function(t){return new mo(t.coordinates)}(t);break;case"MultiPoint":r=function(t){return new lo(t.coordinates)}(t);break;case"MultiLineString":r=function(t){return new ro(t.coordinates)}(t);break;case"MultiPolygon":r=function(t){return new Eo(t.coordinates)}(t);break;case"GeometryCollection":r=function(t,e){var r=t.geometries.map((function(t){return Ko(t,e)}));return new Si(r)}(t);break;default:throw new Error("Unsupported GeoJSON type: "+t.type)}return Bo(r,!1,e)}function Zo(t,e){var r,n=(t=Bo(t,!0,e)).getType();switch(n){case"Point":r=function(t,e){return{type:"Point",coordinates:t.getCoordinates()}}(t);break;case"LineString":r=function(t,e){return{type:"LineString",coordinates:t.getCoordinates()}}(t);break;case"Polygon":r=function(t,e){var r;e&&(r=e.rightHanded);return{type:"Polygon",coordinates:t.getCoordinates(r)}}(t,e);break;case"MultiPoint":r=function(t,e){return{type:"MultiPoint",coordinates:t.getCoordinates()}}(t);break;case"MultiLineString":r=function(t,e){return{type:"MultiLineString",coordinates:t.getCoordinates()}}(t);break;case"MultiPolygon":r=function(t,e){var r;e&&(r=e.rightHanded);return{type:"MultiPolygon",coordinates:t.getCoordinates(r)}}(t,e);break;case"GeometryCollection":r=function(t,e){return{type:"GeometryCollection",geometries:t.getGeometriesArray().map((function(t){var r=gt({},e);return delete r.featureProjection,Zo(t,r)}))}}(t,e);break;case"Circle":r={type:"GeometryCollection",geometries:[]};break;default:throw new Error("Unsupported geometry type: "+n)}return r}var Ho=function(t){function e(e){var r=this,n=e||{};return(r=t.call(this)||this).dataProjection=Bn(n.dataProjection?n.dataProjection:"EPSG:4326"),n.featureProjection&&(r.defaultFeatureProjection=Bn(n.featureProjection)),r.geometryName_=n.geometryName,r.extractGeometryName_=n.extractGeometryName,r.supportedMediaTypes=["application/geo+json","application/vnd.geo+json"],r}return Yo(e,t),e.prototype.readFeatureFromObject=function(t,e){var r=null,n=Ko((r="Feature"===t.type?t:{type:"Feature",geometry:t,properties:null}).geometry,e),i=new jr;return this.geometryName_?i.setGeometryName(this.geometryName_):this.extractGeometryName_&&"geometry_name"in r!==void 0&&i.setGeometryName(r.geometry_name),i.setGeometry(n),"id"in r&&i.setId(r.id),r.properties&&i.setProperties(r.properties,!0),i},e.prototype.readFeaturesFromObject=function(t,e){var r=null;if("FeatureCollection"===t.type){r=[];for(var n=t.features,i=0,o=n.length;i<o;++i)r.push(this.readFeatureFromObject(n[i],e))}else r=[this.readFeatureFromObject(t,e)];return r},e.prototype.readGeometryFromObject=function(t,e){return Ko(t,e)},e.prototype.readProjectionFromObject=function(t){var e,r=t.crs;return r?"name"==r.type?e=Bn(r.properties.name):"EPSG"===r.type?e=Bn("EPSG:"+r.properties.code):_(!1,36):e=this.dataProjection,e},e.prototype.writeFeatureObject=function(t,e){e=this.adaptOptions(e);var r={type:"Feature",geometry:null,properties:null},n=t.getId();if(void 0!==n&&(r.id=n),!t.hasProperties())return r;var i=t.getProperties(),o=t.getGeometry();return o&&(r.geometry=Zo(o,e),delete i[t.getGeometryName()]),_t(i)||(r.properties=i),r},e.prototype.writeFeaturesObject=function(t,e){e=this.adaptOptions(e);for(var r=[],n=0,i=t.length;n<i;++n)r.push(this.writeFeatureObject(t[n],e));return{type:"FeatureCollection",features:r}},e.prototype.writeGeometryObject=function(t,e){return Zo(t,this.adaptOptions(e))},e}(qo);"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self&&self;function Jo(t){if(t.__esModule)return t;var e=Object.defineProperty({},"__esModule",{value:!0});return Object.keys(t).forEach((function(r){var n=Object.getOwnPropertyDescriptor(t,r);Object.defineProperty(e,r,n.get?n:{enumerable:!0,get:function(){return t[r]}})})),e}var Qo={
/*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh <https://feross.org/opensource> */
read:function(t,e,r,n,i){var o,a,s=8*i-n-1,l=(1<<s)-1,u=l>>1,h=-7,c=r?i-1:0,p=r?-1:1,f=t[e+c];for(c+=p,o=f&(1<<-h)-1,f>>=-h,h+=s;h>0;o=256*o+t[e+c],c+=p,h-=8);for(a=o&(1<<-h)-1,o>>=-h,h+=n;h>0;a=256*a+t[e+c],c+=p,h-=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,h=(1<<u)-1,c=h>>1,p=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,f=n?0:o-1,d=n?1:-1,g=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=h):(a=Math.floor(Math.log(e)/Math.LN2),e*(l=Math.pow(2,-a))<1&&(a--,l*=2),(e+=a+c>=1?p/l:p*Math.pow(2,1-c))*l>=2&&(a++,l/=2),a+c>=h?(s=0,a=h):a+c>=1?(s=(e*l-1)*Math.pow(2,i),a+=c):(s=e*Math.pow(2,c-1)*Math.pow(2,i),a=0));i>=8;t[r+f]=255&s,f+=d,s/=256,i-=8);for(a=a<<i|s,u+=i;u>0;t[r+f]=255&a,f+=d,a/=256,u-=8);t[r+f-d]|=128*g}},$o=ea,ta=Qo;function ea(t){this.buf=ArrayBuffer.isView&&ArrayBuffer.isView(t)?t:new Uint8Array(t||0),this.pos=0,this.type=0,this.length=this.buf.length}ea.Varint=0,ea.Fixed64=1,ea.Bytes=2,ea.Fixed32=5;var ra=4294967296,na=1/ra,ia="undefined"==typeof TextDecoder?null:new TextDecoder("utf8");function oa(t){return t.type===ea.Bytes?t.readVarint()+t.pos:t.pos+1}function aa(t,e,r){return r?4294967296*e+(t>>>0):4294967296*(e>>>0)+(t>>>0)}function sa(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 la(t,e){for(var r=0;r<t.length;r++)e.writeVarint(t[r])}function ua(t,e){for(var r=0;r<t.length;r++)e.writeSVarint(t[r])}function ha(t,e){for(var r=0;r<t.length;r++)e.writeFloat(t[r])}function ca(t,e){for(var r=0;r<t.length;r++)e.writeDouble(t[r])}function pa(t,e){for(var r=0;r<t.length;r++)e.writeBoolean(t[r])}function fa(t,e){for(var r=0;r<t.length;r++)e.writeFixed32(t[r])}function da(t,e){for(var r=0;r<t.length;r++)e.writeSFixed32(t[r])}function ga(t,e){for(var r=0;r<t.length;r++)e.writeFixed64(t[r])}function ya(t,e){for(var r=0;r<t.length;r++)e.writeSFixed64(t[r])}function va(t,e){return(t[e]|t[e+1]<<8|t[e+2]<<16)+16777216*t[e+3]}function _a(t,e,r){t[r]=e,t[r+1]=e>>>8,t[r+2]=e>>>16,t[r+3]=e>>>24}function ma(t,e){return(t[e]|t[e+1]<<8|t[e+2]<<16)+(t[e+3]<<24)}ea.prototype={destroy:function(){this.buf=null},readFields:function(t,e,r){for(r=r||this.length;this.pos<r;){var n=this.readVarint(),i=n>>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=va(this.buf,this.pos);return this.pos+=4,t},readSFixed32:function(){var t=ma(this.buf,this.pos);return this.pos+=4,t},readFixed64:function(){var t=va(this.buf,this.pos)+va(this.buf,this.pos+4)*ra;return this.pos+=8,t},readSFixed64:function(){var t=va(this.buf,this.pos)+ma(this.buf,this.pos+4)*ra;return this.pos+=8,t},readFloat:function(){var t=ta.read(this.buf,this.pos,!0,23,4);return this.pos+=4,t},readDouble:function(){var t=ta.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 aa(t,n,e);if(i=o[r.pos++],n|=(127&i)<<3,i<128)return aa(t,n,e);if(i=o[r.pos++],n|=(127&i)<<10,i<128)return aa(t,n,e);if(i=o[r.pos++],n|=(127&i)<<17,i<128)return aa(t,n,e);if(i=o[r.pos++],n|=(127&i)<<24,i<128)return aa(t,n,e);if(i=o[r.pos++],n|=(1&i)<<31,i<128)return aa(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&&ia?function(t,e,r){return ia.decode(t.subarray(e,r))}(this.buf,e,t):function(t,e,r){var n="",i=e;for(;i<r;){var o,a,s,l=t[i],u=null,h=l>239?4:l>223?3:l>191?2:1;if(i+h>r)break;1===h?l<128&&(u=l):2===h?128==(192&(o=t[i+1]))&&(u=(31&l)<<6|63&o)<=127&&(u=null):3===h?(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===h&&(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,h=1):u>65535&&(u-=65536,n+=String.fromCharCode(u>>>10&1023|55296),u=56320|1023&u),n+=String.fromCharCode(u),i+=h}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!==ea.Bytes)return t.push(this.readVarint(e));var r=oa(this);for(t=t||[];this.pos<r;)t.push(this.readVarint(e));return t},readPackedSVarint:function(t){if(this.type!==ea.Bytes)return t.push(this.readSVarint());var e=oa(this);for(t=t||[];this.pos<e;)t.push(this.readSVarint());return t},readPackedBoolean:function(t){if(this.type!==ea.Bytes)return t.push(this.readBoolean());var e=oa(this);for(t=t||[];this.pos<e;)t.push(this.readBoolean());return t},readPackedFloat:function(t){if(this.type!==ea.Bytes)return t.push(this.readFloat());var e=oa(this);for(t=t||[];this.pos<e;)t.push(this.readFloat());return t},readPackedDouble:function(t){if(this.type!==ea.Bytes)return t.push(this.readDouble());var e=oa(this);for(t=t||[];this.pos<e;)t.push(this.readDouble());return t},readPackedFixed32:function(t){if(this.type!==ea.Bytes)return t.push(this.readFixed32());var e=oa(this);for(t=t||[];this.pos<e;)t.push(this.readFixed32());return t},readPackedSFixed32:function(t){if(this.type!==ea.Bytes)return t.push(this.readSFixed32());var e=oa(this);for(t=t||[];this.pos<e;)t.push(this.readSFixed32());return t},readPackedFixed64:function(t){if(this.type!==ea.Bytes)return t.push(this.readFixed64());var e=oa(this);for(t=t||[];this.pos<e;)t.push(this.readFixed64());return t},readPackedSFixed64:function(t){if(this.type!==ea.Bytes)return t.push(this.readSFixed64());var e=oa(this);for(t=t||[];this.pos<e;)t.push(this.readSFixed64());return t},skip:function(t){var e=7&t;if(e===ea.Varint)for(;this.buf[this.pos++]>127;);else if(e===ea.Bytes)this.pos=this.readVarint()+this.pos;else if(e===ea.Fixed32)this.pos+=4;else{if(e!==ea.Fixed64)throw new Error("Unimplemented type: "+e);this.pos+=8}},writeTag:function(t,e){this.writeVarint(t<<3|e)},realloc:function(t){for(var e=this.length||16;e<this.pos+t;)e*=2;if(e!==this.length){var r=new Uint8Array(e);r.set(this.buf),this.buf=r,this.length=e}},finish:function(){return this.length=this.pos,this.pos=0,this.buf.subarray(0,this.length)},writeFixed32:function(t){this.realloc(4),_a(this.buf,t,this.pos),this.pos+=4},writeSFixed32:function(t){this.realloc(4),_a(this.buf,t,this.pos),this.pos+=4},writeFixed64:function(t){this.realloc(8),_a(this.buf,-1&t,this.pos),_a(this.buf,Math.floor(t*na),this.pos+4),this.pos+=8},writeSFixed64:function(t){this.realloc(8),_a(this.buf,-1&t,this.pos),_a(this.buf,Math.floor(t*na),this.pos+4),this.pos+=8},writeVarint:function(t){(t=+t||0)>268435455||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;o<e.length;o++){if((n=e.charCodeAt(o))>55295&&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&&sa(e,r,this),this.pos=e-1,this.writeVarint(r),this.pos+=r},writeFloat:function(t){this.realloc(4),ta.write(this.buf,t,this.pos,!0,23,4),this.pos+=4},writeDouble:function(t){this.realloc(8),ta.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<e;r++)this.buf[this.pos++]=t[r]},writeRawMessage:function(t,e){this.pos++;var r=this.pos;t(e,this);var n=this.pos-r;n>=128&&sa(r,n,this),this.pos=r-1,this.writeVarint(n),this.pos+=n},writeMessage:function(t,e,r){this.writeTag(t,ea.Bytes),this.writeRawMessage(e,r)},writePackedVarint:function(t,e){e.length&&this.writeMessage(t,la,e)},writePackedSVarint:function(t,e){e.length&&this.writeMessage(t,ua,e)},writePackedBoolean:function(t,e){e.length&&this.writeMessage(t,pa,e)},writePackedFloat:function(t,e){e.length&&this.writeMessage(t,ha,e)},writePackedDouble:function(t,e){e.length&&this.writeMessage(t,ca,e)},writePackedFixed32:function(t,e){e.length&&this.writeMessage(t,fa,e)},writePackedSFixed32:function(t,e){e.length&&this.writeMessage(t,da,e)},writePackedFixed64:function(t,e){e.length&&this.writeMessage(t,ga,e)},writePackedSFixed64:function(t,e){e.length&&this.writeMessage(t,ya,e)},writeBytesField:function(t,e){this.writeTag(t,ea.Bytes),this.writeBytes(e)},writeFixed32Field:function(t,e){this.writeTag(t,ea.Fixed32),this.writeFixed32(e)},writeSFixed32Field:function(t,e){this.writeTag(t,ea.Fixed32),this.writeSFixed32(e)},writeFixed64Field:function(t,e){this.writeTag(t,ea.Fixed64),this.writeFixed64(e)},writeSFixed64Field:function(t,e){this.writeTag(t,ea.Fixed64),this.writeSFixed64(e)},writeVarintField:function(t,e){this.writeTag(t,ea.Varint),this.writeVarint(e)},writeSVarintField:function(t,e){this.writeTag(t,ea.Varint),this.writeSVarint(e)},writeStringField:function(t,e){this.writeTag(t,ea.Bytes),this.writeString(e)},writeFloatField:function(t,e){this.writeTag(t,ea.Fixed32),this.writeFloat(e)},writeDoubleField:function(t,e){this.writeTag(t,ea.Fixed64),this.writeDouble(e)},writeBooleanField:function(t,e){this.writeVarintField(t,Boolean(e))}};var 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)}}(),wa=function(t){function e(e){var r=t.call(this)||this,n=e||{};return r.dataProjection=new nn({code:"",units:Wr.TILE_PIXELS}),r.featureClass_=n.featureClass?n.featureClass:Ro,r.geometryName_=n.geometryName,r.layerName_=n.layerName?n.layerName:"layer",r.layers_=n.layers?n.layers:null,r.idProperty_=n.idProperty,r.supportedMediaTypes=["application/vnd.mapbox-vector-tile","application/x-protobuf"],r}return xa(e,t),e.prototype.readRawGeometry_=function(t,e,r,n){t.pos=e.geometry;for(var i=t.readVarint()+t.pos,o=1,a=0,s=0,l=0,u=0,h=0;t.pos<i;){if(!a){var c=t.readVarint();o=7&c,a=c>>3}a--,1===o||2===o?(s+=t.readSVarint(),l+=t.readSVarint(),1===o&&u>h&&(n.push(u),h=u),r.push(s,l),u+=2):7===o?u>h&&(r.push(r[h],r[h+1]),u+=2):_(!1,59)}u>h&&(n.push(u),h=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?"Point":"MultiPoint":2===t?r=1===e?"LineString":"MultiLineString":3===t&&(r="Polygon");return r}(i,l.length);if(this.featureClass_===Ro)(n=new this.featureClass_(u,s,l,a,o)).transform(r.dataProjection);else{var h=void 0;if("Polygon"==u){var c=function(t,e){for(var r=[],n=0,i=0,o=0,a=e.length;o<a;++o){var s=e[o];if(po(t,n,s,2)){if(0===r.length)continue;r[r.length-1].push(e[i])}else r.push(e.slice(i,o+1));i=o+1,n=s}return r}(s,l);h=c.length>1?new Eo(s,Gr,c):new mo(s,Gr,l)}else h="Point"===u?new oo(s,Gr):"LineString"===u?new $i(s,Gr):"MultiPoint"===u?new lo(s,Gr):"MultiLineString"===u?new ro(s,Gr,l):null;n=new(0,this.featureClass_),this.geometryName_&&n.setGeometryName(this.geometryName_);var p=Bo(h,!1,r);n.setGeometry(p),void 0!==o&&n.setId(o),n.setProperties(a,!0)}return n},e.prototype.getType=function(){return"arraybuffer"},e.prototype.readFeatures=function(t,e){var r=this.layers_,n=this.adaptOptions(e),i=Bn(n.dataProjection);i.setWorldExtent(n.extent),n.dataProjection=i;var o=new $o(t),a=o.readFields(ba,{}),s=[];for(var l in a)if(!r||-1!=r.indexOf(l)){var u=a[l],h=u?[0,0,u.extent,u.extent]:null;i.setExtent(h);for(var c=0,p=u.length;c<p;++c){var f=Ea(o,u,c),d=this.createFeature_(o,f,n);null!==d&&s.push(d)}}return s},e.prototype.readProjection=function(t){return this.dataProjection},e.prototype.setLayers=function(t){this.layers_=t},e}(Uo);function ba(t,e,r){if(3===t){var n={keys:[],values:[],features:[]},i=r.readVarint()+r.pos;r.readFields(Sa,n,i),n.length=n.features.length,n.length&&(e[n.name]=n)}}function Sa(t,e,r){if(15===t)e.version=r.readVarint();else if(1===t)e.name=r.readString();else if(5===t)e.extent=r.readVarint();else if(2===t)e.features.push(r.pos);else if(3===t)e.keys.push(r.readString());else if(4===t){for(var n=null,i=r.readVarint()+r.pos;r.pos<i;)n=1===(t=r.readVarint()>>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 Ca(t,e,r){if(1==t)e.id=r.readVarint();else if(2==t)for(var n=r.readVarint()+r.pos;r.pos<n;){var i=e.layer.keys[r.readVarint()],o=e.layer.values[r.readVarint()];e.properties[i]=o}else 3==t?e.type=r.readVarint():4==t&&(e.geometry=r.pos)}function Ea(t,e,r){t.pos=e.features[r];var n=t.readVarint()+t.pos,i={layer:e,type:0,properties:{}};return t.readFields(Ca,i,n),i}var Ta=wa,Pa="opacity",Ra="visible",Oa="extent",Fa="zIndex",Ma="maxResolution",Ia="minResolution",La="maxZoom",Aa="minZoom",ka="source",Da="map",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)}}(),Ga=function(t){function e(e){var r=t.call(this)||this;r.on,r.once,r.un,r.background_=e.background;var n=gt({},e);return"object"==typeof e.properties&&(delete n.properties,gt(n,e.properties)),n[Pa]=void 0!==e.opacity?e.opacity:1,_("number"==typeof n[Pa],64),n[Ra]=void 0===e.visible||e.visible,n[Fa]=e.zIndex,n[Ma]=void 0!==e.maxResolution?e.maxResolution:1/0,n[Ia]=void 0!==e.minResolution?e.minResolution:0,n[Aa]=void 0!==e.minZoom?e.minZoom:-1/0,n[La]=void 0!==e.maxZoom?e.maxZoom:1/0,r.className_=void 0!==n.className?n.className:"ol-layer",delete n.className,r.setProperties(n),r.state_=null,r}return ja(e,t),e.prototype.getBackground=function(){return this.background_},e.prototype.getClassName=function(){return this.className_},e.prototype.getLayerState=function(t){var e=this.state_||{layer:this,managed:void 0===t||t},r=this.getZIndex();return e.opacity=m(Math.round(100*this.getOpacity())/100,0,1),e.visible=this.getVisible(),e.extent=this.getExtent(),e.zIndex=void 0!==r||e.managed?r:1/0,e.maxResolution=this.getMaxResolution(),e.minResolution=Math.max(this.getMinResolution(),0),e.minZoom=this.getMinZoom(),e.maxZoom=this.getMaxZoom(),this.state_=e,e},e.prototype.getLayersArray=function(t){return a()},e.prototype.getLayerStatesArray=function(t){return a()},e.prototype.getExtent=function(){return this.get(Oa)},e.prototype.getMaxResolution=function(){return this.get(Ma)},e.prototype.getMinResolution=function(){return this.get(Ia)},e.prototype.getMinZoom=function(){return this.get(Aa)},e.prototype.getMaxZoom=function(){return this.get(La)},e.prototype.getOpacity=function(){return this.get(Pa)},e.prototype.getSourceState=function(){return a()},e.prototype.getVisible=function(){return this.get(Ra)},e.prototype.getZIndex=function(){return this.get(Fa)},e.prototype.setBackground=function(t){this.background_=t,this.changed()},e.prototype.setExtent=function(t){this.set(Oa,t)},e.prototype.setMaxResolution=function(t){this.set(Ma,t)},e.prototype.setMinResolution=function(t){this.set(Ia,t)},e.prototype.setMaxZoom=function(t){this.set(La,t)},e.prototype.setMinZoom=function(t){this.set(Aa,t)},e.prototype.setOpacity=function(t){_("number"==typeof t,64),this.set(Pa,t)},e.prototype.setVisible=function(t){this.set(Ra,t)},e.prototype.setZIndex=function(t){this.set(Fa,t)},e.prototype.disposeInternal=function(){this.state_&&(this.state_.layer=null,this.state_=null),t.prototype.disposeInternal.call(this)},e}(qt),za="prerender",Na="postrender",Ua="precompose",Ba="postcompose",Va="rendercomplete",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)}}(),Wa=function(t){function e(e){var r=this,n=gt({},e);delete n.source,(r=t.call(this,n)||this).on,r.once,r.un,r.mapPrecomposeKey_=null,r.mapRenderKey_=null,r.sourceChangeKey_=null,r.renderer_=null,r.rendered=!1,e.render&&(r.render=e.render),e.map&&r.setMap(e.map),r.addChangeListener(ka,r.handleSourcePropertyChange_);var i=e.source?e.source:null;return r.setSource(i),r}return Xa(e,t),e.prototype.getLayersArray=function(t){var e=t||[];return e.push(this),e},e.prototype.getLayerStatesArray=function(t){var e=t||[];return e.push(this.getLayerState()),e},e.prototype.getSource=function(){return this.get(ka)||null},e.prototype.getRenderSource=function(){return this.getSource()},e.prototype.getSourceState=function(){var t=this.getSource();return t?t.getState():"undefined"},e.prototype.handleSourceChange_=function(){this.changed()},e.prototype.handleSourcePropertyChange_=function(){this.sourceChangeKey_&&(jt(this.sourceChangeKey_),this.sourceChangeKey_=null);var t=this.getSource();t&&(this.sourceChangeKey_=kt(t,wt,this.handleSourceChange_,this)),this.changed()},e.prototype.getFeatures=function(t){return this.renderer_?this.renderer_.getFeatures(t):new Promise((function(t){return t([])}))},e.prototype.getData=function(t){return this.renderer_&&this.rendered?this.renderer_.getData(t):null},e.prototype.render=function(t,e){var r=this.getRenderer();if(r.prepareFrame(t))return this.rendered=!0,r.renderFrame(t,e)},e.prototype.unrender=function(){this.rendered=!1},e.prototype.setMapInternal=function(t){t||this.unrender(),this.set(Da,t)},e.prototype.getMapInternal=function(){return this.get(Da)},e.prototype.setMap=function(t){this.mapPrecomposeKey_&&(jt(this.mapPrecomposeKey_),this.mapPrecomposeKey_=null),t||this.changed(),this.mapRenderKey_&&(jt(this.mapRenderKey_),this.mapRenderKey_=null),t&&(this.mapPrecomposeKey_=kt(t,Ua,(function(t){var e=t.frameState.layerStatesArray,r=this.getLayerState(!1);_(!e.some((function(t){return t.layer===r.layer})),67),e.push(r)}),this),this.mapRenderKey_=kt(this,wt,t.render,t),this.changed())},e.prototype.setSource=function(t){this.set(ka,t)},e.prototype.getRenderer=function(){return this.renderer_||(this.renderer_=this.createRenderer()),this.renderer_},e.prototype.hasRenderer=function(){return!!this.renderer_},e.prototype.createRenderer=function(){return null},e.prototype.disposeInternal=function(){this.renderer_&&(this.renderer_.dispose(),delete this.renderer_),this.setSource(null),t.prototype.disposeInternal.call(this)},e}(Ga);function qa(t,e){if(!t.visible)return!1;var r=e.resolution;if(r<t.minResolution||r>=t.maxResolution)return!1;var n=e.zoom;return n>t.minZoom&&n<=t.maxZoom}var Ya=Wa,Ka=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=function(t){function e(e){var r=t.call(this)||this;return r.map_=e,r}return Ka(e,t),e.prototype.dispatchRenderEvent=function(t,e){a()},e.prototype.calculateMatrices2D=function(t){var e=t.viewState,r=t.coordinateToPixelTransform,n=t.pixelToCoordinateTransform;tn(r,t.size[0]/2,t.size[1]/2,1/e.resolution,-1/e.resolution,-e.rotation,-e.center[0],-e.center[1]),en(n,r)},e.prototype.forEachFeatureAtCoordinate=function(t,e,r,n,i,o,a,s){var l,u=e.viewState;function h(t,e,r,n){return i.call(o,e,t?r:null,n)}var c=u.projection,p=Mn(t.slice(),c),f=[[0,0]];if(c.canWrapX()&&n){var d=wr(c.getExtent());f.push([-d,0],[d,0])}for(var g=e.layerStatesArray,y=g.length,v=[],_=[],m=0;m<f.length;m++)for(var x=y-1;x>=0;--x){var w=g[x],b=w.layer;if(b.hasRenderer()&&qa(w,u)&&a.call(s,b)){var S=b.getRenderer(),C=b.getSource();if(S&&C){var E=C.getWrapX()?p:t,T=h.bind(null,w.managed);_[0]=E[0]+f[m][0],_[1]=E[1]+f[m][1],l=S.forEachFeatureAtCoordinate(_,e,r,T,v)}if(l)return l}}if(0!==v.length){var P=1/v.length;return v.forEach((function(t,e){return t.distanceSq+=e*P})),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 a()},e.prototype.hasFeatureAtCoordinate=function(t,e,r,n,i,o){return void 0!==this.forEachFeatureAtCoordinate(t,e,r,n,pt,this,i,o)},e.prototype.getMap=function(){return this.map_},e.prototype.renderFrame=function(t){a()},e.prototype.scheduleExpireIconCache=function(t){De.canExpireCache()&&t.postRenderFunctions.push(Ha)},e}(ot);function Ha(t,e){De.expire()}var Ja=Za,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)}}(),$a=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 Qa(e,t),e}(nt),ts=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)}}(),es=function(t){function e(e){var r=t.call(this,e)||this;r.fontChangeListenerKey_=kt(ue,it,e.redrawText.bind(e)),r.element_=document.createElement("div");var n=r.element_.style;n.position="absolute",n.width="100%",n.height="100%",n.zIndex="0",r.element_.className="ol-unselectable ol-layers";var i=e.getViewport();return i.insertBefore(r.element_,i.firstChild||null),r.children_=[],r.renderedVisible_=!0,r}return ts(e,t),e.prototype.dispatchRenderEvent=function(t,e){var r=this.getMap();if(r.hasListener(t)){var n=new $a(t,void 0,e);r.dispatchEvent(n)}},e.prototype.disposeInternal=function(){jt(this.fontChangeListenerKey_),this.element_.parentNode.removeChild(this.element_),t.prototype.disposeInternal.call(this)},e.prototype.renderFrame=function(t){if(t){this.calculateMatrices2D(t),this.dispatchRenderEvent(Ua,t);var e=t.layerStatesArray.sort((function(t,e){return t.zIndex-e.zIndex})),r=t.viewState;this.children_.length=0;for(var n=[],i=null,o=0,a=e.length;o<a;++o){var s=e[o];t.layerIndex=o;var l=s.layer,u=l.getSourceState();if(!qa(s,r)||"ready"!=u&&"undefined"!=u)l.unrender();else{var h=l.render(t,i);h&&(h!==i&&(this.children_.push(h),i=h),"getDeclutter"in l&&n.push(l))}}for(o=n.length-1;o>=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(Ba,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()&&qa(l,o)&&i(u)){var h=u.getRenderer().getDataAtPixel(t,e,r);if(h){var c=n(u,h);if(c)return c}}}},e}(Ja),rs=es,ns="add",is="remove",os=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)}}(),as="length",ss=function(t){function e(e,r,n){var i=t.call(this,e)||this;return i.element=r,i.index=n,i}return os(e,t),e}(nt),ls=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;o<a;++o)n.assertUnique_(n.array_[o],o);return n.updateLength_(),n}return os(e,t),e.prototype.clear=function(){for(;this.getLength()>0;)this.pop()},e.prototype.extend=function(t){for(var e=0,r=t.length;e<r;++e)this.push(t[e]);return this},e.prototype.forEach=function(t){for(var e=this.array_,r=0,n=e.length;r<n;++r)t(e[r],r,e)},e.prototype.getArray=function(){return this.array_},e.prototype.item=function(t){return this.array_[t]},e.prototype.getLength=function(){return this.get(as)},e.prototype.insertAt=function(t,e){this.unique_&&this.assertUnique_(e),this.array_.splice(t,0,e),this.updateLength_(),this.dispatchEvent(new ss(ns,e,t))},e.prototype.pop=function(){return this.removeAt(this.getLength()-1)},e.prototype.push=function(t){this.unique_&&this.assertUnique_(t);var e=this.getLength();return this.insertAt(e,t),this.getLength()},e.prototype.remove=function(t){for(var e=this.array_,r=0,n=e.length;r<n;++r)if(e[r]===t)return this.removeAt(r)},e.prototype.removeAt=function(t){var e=this.array_[t];return this.array_.splice(t,1),this.updateLength_(),this.dispatchEvent(new ss(is,e,t)),e},e.prototype.setAt=function(t,e){var r=this.getLength();if(t<r){this.unique_&&this.assertUnique_(e,t);var n=this.array_[t];this.array_[t]=e,this.dispatchEvent(new ss(is,n,t)),this.dispatchEvent(new ss(ns,e,t))}else{for(var i=r;i<t;++i)this.insertAt(i,void 0);this.insertAt(t,e)}},e.prototype.updateLength_=function(){this.set(as,this.array_.length)},e.prototype.assertUnique_=function(t,e){for(var r=0,n=this.array_.length;r<n;++r)if(this.array_[r]===t&&r!==e)throw new v(58)},e}(qt),us=ls,hs=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)}}(),cs=function(t){function e(e,r){var n=t.call(this,e)||this;return n.layer=r,n}return hs(e,t),e}(nt),ps="layers",fs=function(t){function e(e){var r=this,n=e||{},i=gt({},n);delete i.layers;var o=n.layers;return(r=t.call(this,i)||this).on,r.once,r.un,r.layersListenerKeys_=[],r.listenerKeys_={},r.addChangeListener(ps,r.handleLayersChanged_),o?Array.isArray(o)?o=new us(o.slice(),{unique:!0}):_("function"==typeof o.getArray,43):o=new us(void 0,{unique:!0}),r.setLayers(o),r}return hs(e,t),e.prototype.handleLayerChange_=function(){this.changed()},e.prototype.handleLayersChanged_=function(){this.layersListenerKeys_.forEach(jt),this.layersListenerKeys_.length=0;var t=this.getLayers();for(var e in this.layersListenerKeys_.push(kt(t,ns,this.handleLayersAdd_,this),kt(t,is,this.handleLayersRemove_,this)),this.listenerKeys_)this.listenerKeys_[e].forEach(jt);yt(this.listenerKeys_);for(var r=t.getArray(),n=0,i=r.length;n<i;n++){var o=r[n];this.registerLayerListeners_(o),this.dispatchEvent(new cs("addlayer",o))}this.changed()},e.prototype.registerLayerListeners_=function(t){var r=[kt(t,it,this.handleLayerChange_,this),kt(t,wt,this.handleLayerChange_,this)];t instanceof e&&r.push(kt(t,"addlayer",this.handleLayerGroupAdd_,this),kt(t,"removelayer",this.handleLayerGroupRemove_,this)),this.listenerKeys_[l(t)]=r},e.prototype.handleLayerGroupAdd_=function(t){this.dispatchEvent(new cs("addlayer",t.layer))},e.prototype.handleLayerGroupRemove_=function(t){this.dispatchEvent(new cs("removelayer",t.layer))},e.prototype.handleLayersAdd_=function(t){var e=t.element;this.registerLayerListeners_(e),this.dispatchEvent(new cs("addlayer",e)),this.changed()},e.prototype.handleLayersRemove_=function(t){var e=t.element,r=l(e);this.listenerKeys_[r].forEach(jt),delete this.listenerKeys_[r],this.dispatchEvent(new cs("removelayer",e)),this.changed()},e.prototype.getLayers=function(){return this.get(ps)},e.prototype.setLayers=function(t){var e=this.getLayers();if(e)for(var r=e.getArray(),n=0,i=r.length;n<i;++n)this.dispatchEvent(new cs("removelayer",r[n]));this.set(ps,t)},e.prototype.getLayersArray=function(t){var e=void 0!==t?t:[];return this.getLayers().forEach((function(t){t.getLayersArray(e)})),e},e.prototype.getLayerStatesArray=function(t){var e=void 0!==t?t:[],r=e.length;this.getLayers().forEach((function(t){t.getLayerStatesArray(e)}));var n=this.getLayerState(),i=n.zIndex;t||void 0!==n.zIndex||(i=0);for(var o=r,a=e.length;o<a;o++){var s=e[o];s.opacity*=n.opacity,s.visible=s.visible&&n.visible,s.maxResolution=Math.min(s.maxResolution,n.maxResolution),s.minResolution=Math.max(s.minResolution,n.minResolution),s.minZoom=Math.max(s.minZoom,n.minZoom),s.maxZoom=Math.min(s.maxZoom,n.maxZoom),void 0!==n.extent&&(void 0!==s.extent?s.extent=_r(s.extent,n.extent):s.extent=n.extent),void 0===s.zIndex&&(s.zIndex=i)}return e},e.prototype.getSourceState=function(){return"ready"},e}(Ga),ds=Object.freeze({__proto__:null,GroupEvent:cs,default:fs}),gs=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,r,n){var i=t.call(this,e)||this;return i.map=r,i.frameState=void 0!==n?n:null,i}return gs(e,t),e}(nt),vs=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)}}(),_s=function(t){function e(e,r,n,i,o,a){var s=t.call(this,e,r,o)||this;return s.originalEvent=n,s.pixel_=null,s.coordinate_=null,s.dragging=void 0!==i&&i,s.activePointers=a,s}return vs(e,t),Object.defineProperty(e.prototype,"pixel",{get:function(){return this.pixel_||(this.pixel_=this.map.getEventPixel(this.originalEvent)),this.pixel_},set:function(t){this.pixel_=t},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"coordinate",{get:function(){return this.coordinate_||(this.coordinate_=this.map.getCoordinateFromPixel(this.pixel)),this.coordinate_},set:function(t){this.coordinate_=t},enumerable:!1,configurable:!0}),e.prototype.preventDefault=function(){t.prototype.preventDefault.call(this),"preventDefault"in this.originalEvent&&this.originalEvent.preventDefault()},e.prototype.stopPropagation=function(){t.prototype.stopPropagation.call(this),"stopPropagation"in this.originalEvent&&this.originalEvent.stopPropagation()},e}(ys),ms={SINGLECLICK:"singleclick",CLICK:Ct,DBLCLICK:Et,POINTERDRAG:"pointerdrag",POINTERMOVE:"pointermove",POINTERDOWN:"pointerdown",POINTERUP:"pointerup",POINTEROVER:"pointerover",POINTEROUT:"pointerout",POINTERENTER:"pointerenter",POINTERLEAVE:"pointerleave",POINTERCANCEL:"pointercancel"},xs="pointermove",ws="pointerdown",bs=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)}}(),Ss=function(t){function e(e,r){var n=t.call(this,e)||this;n.map_=e,n.clickTimeoutId_,n.emulateClicks_=!1,n.dragging_=!1,n.dragListenerKeys_=[],n.moveTolerance_=void 0===r?1:r,n.down_=null;var i=n.map_.getViewport();return n.activePointers_=[],n.trackedTouches_={},n.element_=i,n.pointerdownListenerKey_=kt(i,ws,n.handlePointerDown_,n),n.originalPointerMoveEvent_,n.relayedListenerKey_=kt(i,xs,n.relayMoveEvent_,n),n.boundHandleTouchMove_=n.handleTouchMove_.bind(n),n.element_.addEventListener(Lt,n.boundHandleTouchMove_,!!Z&&{passive:!1}),n}return bs(e,t),e.prototype.emulateClick_=function(t){var e=new _s(ms.CLICK,this.map_,t);this.dispatchEvent(e),void 0!==this.clickTimeoutId_?(clearTimeout(this.clickTimeoutId_),this.clickTimeoutId_=void 0,e=new _s(ms.DBLCLICK,this.map_,t),this.dispatchEvent(e)):this.clickTimeoutId_=setTimeout(function(){this.clickTimeoutId_=void 0;var e=new _s(ms.SINGLECLICK,this.map_,t);this.dispatchEvent(e)}.bind(this),250)},e.prototype.updateActivePointers_=function(t){var e=t,r=e.pointerId;if(e.type==ms.POINTERUP||e.type==ms.POINTERCANCEL){for(var n in delete this.trackedTouches_[r],this.trackedTouches_)if(this.trackedTouches_[n].target!==e.target){delete this.trackedTouches_[n];break}}else e.type!=ms.POINTERDOWN&&e.type!=ms.POINTERMOVE||(this.trackedTouches_[r]=e);this.activePointers_=vt(this.trackedTouches_)},e.prototype.handlePointerUp_=function(t){this.updateActivePointers_(t);var e=new _s(ms.POINTERUP,this.map_,t,void 0,void 0,this.activePointers_);this.dispatchEvent(e),this.emulateClicks_&&!e.defaultPrevented&&!this.dragging_&&this.isMouseActionButton_(t)&&this.emulateClick_(this.down_),0===this.activePointers_.length&&(this.dragListenerKeys_.forEach(jt),this.dragListenerKeys_.length=0,this.dragging_=!1,this.down_=null)},e.prototype.isMouseActionButton_=function(t){return 0===t.button},e.prototype.handlePointerDown_=function(t){this.emulateClicks_=0===this.activePointers_.length,this.updateActivePointers_(t);var e=new _s(ms.POINTERDOWN,this.map_,t,void 0,void 0,this.activePointers_);for(var r in this.dispatchEvent(e),this.down_={},t){var n=t[r];this.down_[r]="function"==typeof n?dt:n}if(0===this.dragListenerKeys_.length){var i=this.map_.getOwnerDocument();this.dragListenerKeys_.push(kt(i,ms.POINTERMOVE,this.handlePointerMove_,this),kt(i,ms.POINTERUP,this.handlePointerUp_,this),kt(this.element_,ms.POINTERCANCEL,this.handlePointerUp_,this)),this.element_.getRootNode&&this.element_.getRootNode()!==i&&this.dragListenerKeys_.push(kt(this.element_.getRootNode(),ms.POINTERUP,this.handlePointerUp_,this))}},e.prototype.handlePointerMove_=function(t){if(this.isMoving_(t)){this.updateActivePointers_(t),this.dragging_=!0;var e=new _s(ms.POINTERDRAG,this.map_,t,this.dragging_,void 0,this.activePointers_);this.dispatchEvent(e)}},e.prototype.relayMoveEvent_=function(t){this.originalPointerMoveEvent_=t;var e=!(!this.down_||!this.isMoving_(t));this.dispatchEvent(new _s(ms.POINTERMOVE,this.map_,t,e))},e.prototype.handleTouchMove_=function(t){var e=this.originalPointerMoveEvent_;e&&!e.defaultPrevented||"boolean"==typeof t.cancelable&&!0!==t.cancelable||t.preventDefault()},e.prototype.isMoving_=function(t){return this.dragging_||Math.abs(t.clientX-this.down_.clientX)>this.moveTolerance_||Math.abs(t.clientY-this.down_.clientY)>this.moveTolerance_},e.prototype.disposeInternal=function(){this.relayedListenerKey_&&(jt(this.relayedListenerKey_),this.relayedListenerKey_=null),this.element_.removeEventListener(Lt,this.boundHandleTouchMove_),this.pointerdownListenerKey_&&(jt(this.pointerdownListenerKey_),this.pointerdownListenerKey_=null),this.dragListenerKeys_.forEach(jt),this.dragListenerKeys_.length=0,this.element_=null,t.prototype.disposeInternal.call(this)},e}(xt),Cs="postrender",Es="movestart",Ts="moveend",Ps="loadstart",Rs="loadend",Os="layergroup",Fs="size",Ms="target",Is="view",Ls=1/0,As=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,yt(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){_(!(this.keyFunction_(t)in this.queuedElements_),31);var e=this.priorityFunction_(t);return e!=Ls&&(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<n>>1;){var s=this.getLeftChildIndex_(t),l=this.getRightChildIndex_(t),u=l<n&&r[l]<r[s]?l:s;e[t]=e[u],r[t]=r[u],t=u}e[t]=i,r[t]=o,this.siftDown_(a,t)},t.prototype.siftDown_=function(t,e){for(var r=this.elements_,n=this.priorities_,i=r[e],o=n[e];e>t;){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;e<s;++e)(r=n(t=i[e]))==Ls?delete this.queuedElements_[this.keyFunction_(t)]:(o[a]=r,i[a++]=t);i.length=a,o.length=a,this.heapify_()},t}(),ks=0,Ds=1,js=2,Gs=3,zs=4,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)}}(),Us=function(t){function e(e,r){var n=t.call(this,(function(t){return e.apply(null,t)}),(function(t){return t[0].getKey()}))||this;return n.boundHandleTileChange_=n.handleTileChange.bind(n),n.tileChangeCallback_=r,n.tilesLoading_=0,n.tilesLoadingKeys_={},n}return Ns(e,t),e.prototype.enqueue=function(e){var r=t.prototype.enqueue.call(this,e);r&&e[0].addEventListener(wt,this.boundHandleTileChange_);return r},e.prototype.getTilesLoading=function(){return this.tilesLoading_},e.prototype.handleTileChange=function(t){var e=t.target,r=e.getState();if(r===js||r===Gs||r===zs){e.removeEventListener(wt,this.boundHandleTileChange_);var n=e.getKey();n in this.tilesLoadingKeys_&&(delete this.tilesLoadingKeys_[n],--this.tilesLoading_),this.tileChangeCallback_()}},e.prototype.loadMoreTiles=function(t,e){for(var r,n,i=0;this.tilesLoading_<t&&i<e&&this.getCount()>0;)n=(r=this.dequeue()[0]).getKey(),r.getState()!==ks||n in this.tilesLoadingKeys_||(this.tilesLoadingKeys_[n]=!0,++this.tilesLoading_,++i,r.load())},e}(As);var Bs=0,Vs=1,Xs={CENTER:"center",RESOLUTION:"resolution",ROTATION:"rotation"},Ws=256;function qs(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,h=s?s[0]:0,c=s?s[1]:0,p=t[0]+l/2+h,f=t[2]-l/2+h,d=t[1]+u/2+c,g=t[3]-u/2+c;p>f&&(f=p=(f+p)/2),d>g&&(g=d=(g+d)/2);var y=m(n[0],p,f),v=m(n[1],d,g);if(a&&r&&i){var _=30*i;y+=-_*Math.log(1+Math.max(0,p-n[0])/_)+_*Math.log(1+Math.max(0,n[0]-f)/_),v+=-_*Math.log(1+Math.max(0,d-n[1])/_)+_*Math.log(1+Math.max(0,n[1]-g)/_)}return[y,v]}}}function Ys(t){return t}function Ks(t,e,r,n){var i=wr(e)/r[0],o=vr(e)/r[1];return n?Math.min(t,Math.max(i,o)):Math.min(t,Math.min(i,o))}function Zs(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),m(n,r/2,2*e)}function Hs(t,e,r,n,i){return function(o,a,s,l){if(void 0!==o){var u=n?Ks(t,n,s,i):t;return(void 0===r||r)&&l?Zs(o,u,e):m(o,e,u)}}}function Js(t){return void 0!==t?0:void 0}function Qs(t){return void 0!==t?t:void 0}function $s(t){return Math.pow(t,3)}function tl(t){return 1-$s(1-t)}function el(t){return 3*t*t-2*t*t*t}function rl(t){return t}var nl=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)}}(),il=function(t){function e(e){var r=t.call(this)||this;r.on,r.once,r.un;var n=gt({},e);return r.hints_=[0,0],r.animations_=[],r.updateAnimationKey_,r.projection_=Wn(n.projection,"EPSG:3857"),r.viewportSize_=[100,100],r.targetCenter_=null,r.targetResolution_,r.targetRotation_,r.nextCenter_=null,r.nextResolution_,r.nextRotation_,r.cancelAnchor_=void 0,n.projection&&Gn(),n.center&&(n.center=ei(n.center,r.projection_)),n.extent&&(n.extent=ni(n.extent,r.projection_)),r.applyOptions_(n),r}return nl(e,t),e.prototype.applyOptions_=function(t){var e=gt({},t);for(var r in Xs)delete e[r];this.setProperties(e,!0);var n=function(t){var e,r,n,i=28,o=2,a=void 0!==t.minZoom?t.minZoom:0,s=void 0!==t.maxZoom?t.maxZoom:i,l=void 0!==t.zoomFactor?t.zoomFactor:o,u=void 0!==t.multiWorld&&t.multiWorld,h=void 0===t.smoothResolutionConstraint||t.smoothResolutionConstraint,c=void 0!==t.showFullExtent&&t.showFullExtent,p=Wn(t.projection,"EPSG:3857"),f=p.getExtent(),d=t.constrainOnlyCenter,g=t.extent;u||g||!p.isGlobal()||(d=!1,g=f);if(void 0!==t.resolutions){var y=t.resolutions;r=y[a],n=void 0!==y[s]?y[s]:y[y.length-1],e=t.constrainResolution?function(t,e,r,n){return function(i,o,a,s){if(void 0!==i){var l=t[0],u=t[t.length-1],h=r?Ks(l,r,a,n):l;if(s)return void 0===e||e?Zs(i,h,u):m(i,u,h);var c=Math.min(h,i),p=Math.floor(lt(t,c,o));return t[p]>h&&p<t.length-1?t[p+1]:t[p]}}}(y,h,!d&&g,c):Hs(r,n,h,!d&&g,c)}else{var v=(f?Math.max(wr(f),vr(f)):360*Vr[Wr.DEGREES]/p.getMetersPerUnit())/Ws/Math.pow(o,0),_=v/Math.pow(o,i-0);void 0!==(r=t.maxResolution)?a=0:r=v/Math.pow(l,a),void 0===(n=t.minResolution)&&(n=void 0!==t.maxZoom?void 0!==t.maxResolution?r/Math.pow(l,s):v/Math.pow(l,s):_),s=a+Math.floor(Math.log(r/n)/Math.log(l)),n=r/Math.pow(l,s-a),e=t.constrainResolution?function(t,e,r,n,i,o){return function(a,s,l,u){if(void 0!==a){var h=i?Ks(e,i,l,o):e,c=void 0!==r?r:0;if(u)return void 0===n||n?Zs(a,h,c):m(a,c,h);var p=Math.ceil(Math.log(e/h)/Math.log(t)-1e-9),f=-s*(.5-1e-9)+.5,d=Math.min(h,a),g=Math.floor(Math.log(e/d)/Math.log(t)+f),y=Math.max(p,g);return m(e/Math.pow(t,y),c,h)}}}(l,r,n,h,!d&&g,c):Hs(r,n,h,!d&&g,c)}return{constraint:e,maxResolution:r,minResolution:n,minZoom:a,zoomFactor:l}}(t);this.maxResolution_=n.maxResolution,this.minResolution_=n.minResolution,this.zoomFactor_=n.zoomFactor,this.resolutions_=t.resolutions,this.padding_=t.padding,this.minZoom_=n.minZoom;var i=function(t){if(void 0!==t.extent){var e=void 0===t.smoothExtentConstraint||t.smoothExtentConstraint;return qs(t.extent,t.constrainOnlyCenter,e)}var r=Wn(t.projection,"EPSG:3857");if(!0!==t.multiWorld&&r.isGlobal()){var n=r.getExtent().slice();return n[0]=-1/0,n[2]=1/0,qs(n,!1,!1)}return Ys}(t),o=n.constraint,a=function(t){if(void 0===t.enableRotation||t.enableRotation){var e=t.constrainRotation;return void 0===e||!0===e?(o=i||E(5),function(t,e){return e?t:void 0!==t?Math.abs(t)<=o?0:t:void 0}):!1===e?Qs:"number"==typeof e?(r=e,n=2*Math.PI/r,function(t,e){return e?t:void 0!==t?t=Math.floor(t/n+.5)*n:void 0}):Qs}return Js;var r,n;var i,o}(t);this.constraints_={center:i,resolution:o,rotation:a},this.setRotation(void 0!==t.rotation?t.rotation:0),this.setCenterInternal(void 0!==t.center?t.center:null),void 0!==t.resolution?this.setResolution(t.resolution):void 0!==t.zoom&&this.setZoom(t.zoom)},Object.defineProperty(e.prototype,"padding",{get:function(){return this.padding_},set:function(t){var e=this.padding_;this.padding_=t;var r=this.getCenter();if(r){var n=t||[0,0,0,0];e=e||[0,0,0,0];var i=this.getResolution(),o=i/2*(n[3]-e[3]+e[1]-n[1]),a=i/2*(n[0]-e[0]+e[2]-n[2]);this.setCenterInternal([r[0]+o,r[1]-a])}},enumerable:!1,configurable:!0}),e.prototype.getUpdatedOptions_=function(t){var e=this.getProperties();return void 0!==e.resolution?e.resolution=this.getResolution():e.zoom=this.getZoom(),e.center=this.getCenterInternal(),e.rotation=this.getRotation(),gt({},e,t)},e.prototype.animate=function(t){this.isDef()&&!this.getAnimating()&&this.resolveConstraints(0);for(var e=new Array(arguments.length),r=0;r<e.length;++r){var n=arguments[r];n.center&&((n=gt({},n)).center=ei(n.center,this.getProjection())),n.anchor&&((n=gt({},n)).anchor=ei(n.anchor,this.getProjection())),e[r]=n}this.animateInternal.apply(this,e)},e.prototype.animateInternal=function(t){var e,r=arguments.length;r>1&&"function"==typeof arguments[r-1]&&(e=arguments[r-1],--r);for(var n=0;n<r&&!this.isDef();++n){var i=arguments[n];i.center&&this.setCenterInternal(i.center),void 0!==i.zoom?this.setZoom(i.zoom):i.resolution&&this.setResolution(i.resolution),void 0!==i.rotation&&this.setRotation(i.rotation)}if(n!==r){for(var o=Date.now(),a=this.targetCenter_.slice(),s=this.targetResolution_,l=this.targetRotation_,u=[];n<r;++n){var h=arguments[n],c={start:o,complete:!1,anchor:h.anchor,duration:void 0!==h.duration?h.duration:1e3,easing:h.easing||el,callback:e};if(h.center&&(c.sourceCenter=a,c.targetCenter=h.center.slice(),a=c.targetCenter),void 0!==h.zoom?(c.sourceResolution=s,c.targetResolution=this.getResolutionForZoom(h.zoom),s=c.targetResolution):h.resolution&&(c.sourceResolution=s,c.targetResolution=h.resolution,s=c.targetResolution),void 0!==h.rotation){c.sourceRotation=l;var p=T(h.rotation-l+Math.PI,2*Math.PI)-Math.PI;c.targetRotation=l+p,l=c.targetRotation}al(c)?c.complete=!0:o+=c.duration,u.push(c)}this.animations_.push(u),this.setHint(Bs,1),this.updateAnimations_()}else e&&ol(e,!0)},e.prototype.getAnimating=function(){return this.hints_[Bs]>0},e.prototype.getInteracting=function(){return this.hints_[Vs]>0},e.prototype.cancelAnimations=function(){var t;this.setHint(Bs,-this.hints_[Bs]);for(var e=0,r=this.animations_.length;e<r;++e){var n=this.animations_[e];if(n[0].callback&&ol(n[0].callback,!1),!t)for(var i=0,o=n.length;i<o;++i){var a=n[i];if(!a.complete){t=a.anchor;break}}}this.animations_.length=0,this.cancelAnchor_=t,this.nextCenter_=null,this.nextResolution_=NaN,this.nextRotation_=NaN},e.prototype.updateAnimations_=function(){if(void 0!==this.updateAnimationKey_&&(cancelAnimationFrame(this.updateAnimationKey_),this.updateAnimationKey_=void 0),this.getAnimating()){for(var t=Date.now(),e=!1,r=this.animations_.length-1;r>=0;--r){for(var n=this.animations_[r],i=!0,o=0,a=n.length;o<a;++o){var s=n[o];if(!s.complete){var l=t-s.start,u=s.duration>0?l/s.duration:1;u>=1?(s.complete=!0,u=1):i=!1;var h=s.easing(u);if(s.sourceCenter){var c=s.sourceCenter[0],p=s.sourceCenter[1],f=s.targetCenter[0],d=s.targetCenter[1];this.nextCenter_=s.targetCenter;var g=c+h*(f-c),y=p+h*(d-p);this.targetCenter_=[g,y]}if(s.sourceResolution&&s.targetResolution){var v=1===h?s.targetResolution:s.sourceResolution+h*(s.targetResolution-s.sourceResolution);if(s.anchor){var _=this.getViewportSize_(this.getRotation()),m=this.constraints_.resolution(v,0,_,!0);this.targetCenter_=this.calculateCenterZoom(m,s.anchor)}this.nextResolution_=s.targetResolution,this.targetResolution_=v,this.applyTargetState_(!0)}if(void 0!==s.sourceRotation&&void 0!==s.targetRotation){var x=1===h?T(s.targetRotation+Math.PI,2*Math.PI)-Math.PI:s.sourceRotation+h*(s.targetRotation-s.sourceRotation);if(s.anchor){var w=this.constraints_.rotation(x,!0);this.targetCenter_=this.calculateCenterRotate(w,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(Bs,-1),this.nextCenter_=null,this.nextResolution_=NaN,this.nextRotation_=NaN;var b=n[0].callback;b&&ol(b,!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&&(Pn(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?ti(t,this.getProjection()):t},e.prototype.getCenterInternal=function(){return this.get(Xs.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 ri(this.calculateExtentInternal(t),this.getProjection())},e.prototype.calculateExtentInternal=function(t){var e=t||this.getViewportSizeMinusPadding_(),r=this.getCenterInternal();_(r,1);var n=this.getResolution();_(void 0!==n,2);var i=this.getRotation();return _(void 0!==i,3),gr(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(Xs.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=wr(t)/r[0],i=vr(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(Xs.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=sl(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,r,n=this.minZoom_||0;if(this.resolutions_){var i=lt(this.resolutions_,t,1);n=i,e=this.resolutions_[i],r=i==this.resolutions_.length-1?2:e/this.resolutions_[i+1]}else e=this.maxResolution_,r=this.zoomFactor_;return n+Math.log(e/t)/Math.log(r)},e.prototype.getResolutionForZoom=function(t){if(this.resolutions_){if(this.resolutions_.length<=1)return 0;var e=m(Math.floor(t),0,this.resolutions_.length-2),r=this.resolutions_[e]/this.resolutions_[e+1];return this.resolutions_[e]/Math.pow(r,m(t-e,0,1))}return this.maxResolution_/Math.pow(this.zoomFactor_,t-this.minZoom_)},e.prototype.fit=function(t,e){var r;if(_(Array.isArray(t)||"function"==typeof t.getSimplifiedGeometry,24),Array.isArray(t))_(!Sr(t),25),r=xo(n=ni(t,this.getProjection()));else if("Circle"===t.getType()){var n;(r=xo(n=ni(t.getExtent(),this.getProjection()))).rotate(this.getRotation(),fr(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,h=0,c=i.length;h<c;h+=o){var p=i[h]*r-i[h+1]*n,f=i[h]*n+i[h+1]*r;a=Math.min(a,p),s=Math.min(s,f),l=Math.max(l,p),u=Math.max(u,f)}return[a,s,l,u]},e.prototype.fitInternal=function(t,e){var r=e||{},n=r.size;n||(n=this.getViewportSizeMinusPadding_());var i,o=void 0!==r.padding?r.padding:[0,0,0,0],a=void 0!==r.nearest&&r.nearest;i=void 0!==r.minResolution?r.minResolution:void 0!==r.maxZoom?this.getResolutionForZoom(r.maxZoom):0;var s=this.rotatedExtentForGeometry(t),l=this.getResolutionForExtentInternal(s,[n[0]-o[1]-o[3],n[1]-o[0]-o[2]]);l=isNaN(l)?i:Math.max(l,i),l=this.getConstrainedResolution(l,a?0:1);var u=this.getRotation(),h=Math.sin(u),c=Math.cos(u),p=fr(s);p[0]+=(o[1]-o[3])/2*l,p[1]+=(o[0]-o[2])/2*l;var f=p[0]*c-p[1]*h,d=p[1]*c+p[0]*h,g=this.getConstrainedCenter([f,d],l),y=r.callback?r.callback:dt;void 0!==r.duration?this.animateInternal({resolution:l,center:g,duration:r.duration,easing:r.easing},y):(this.targetResolution_=l,this.targetCenter_=g,this.applyTargetState_(!1,!0),ol(y,!0))},e.prototype.centerOn=function(t,e,r){this.centerOnInternal(ei(t,this.getProjection()),e,r)},e.prototype.centerOnInternal=function(t,e,r){this.setCenterInternal(sl(t,e,r,this.getResolution(),this.getRotation()))},e.prototype.calculateCenterShift=function(t,e,r,n){var i,o=this.padding_;if(o&&t){var a=this.getViewportSizeMinusPadding_(-r),s=sl(t,n,[a[0]/2+o[3],a[1]/2+o[0]],e,r);i=[t[0]-s[0],t[1]-s[1]]}return i},e.prototype.isDef=function(){return!!this.getCenterInternal()&&void 0!==this.getResolution()},e.prototype.adjustCenter=function(t){var e=ti(this.targetCenter_,this.getProjection());this.setCenter([e[0]+t[0],e[1]+t[1]])},e.prototype.adjustCenterInternal=function(t){var e=this.targetCenter_;this.setCenterInternal([e[0]+t[0],e[1]+t[1]])},e.prototype.adjustResolution=function(t,e){var r=e&&ei(e,this.getProjection());this.adjustResolutionInternal(t,r)},e.prototype.adjustResolutionInternal=function(t,e){var r=this.getAnimating()||this.getInteracting(),n=this.getViewportSize_(this.getRotation()),i=this.constraints_.resolution(this.targetResolution_*t,0,n,r);e&&(this.targetCenter_=this.calculateCenterZoom(i,e)),this.targetResolution_*=t,this.applyTargetState_()},e.prototype.adjustZoom=function(t,e){this.adjustResolution(Math.pow(this.zoomFactor_,-t),e)},e.prototype.adjustRotation=function(t,e){e&&(e=ei(e,this.getProjection())),this.adjustRotationInternal(t,e)},e.prototype.adjustRotationInternal=function(t,e){var r=this.getAnimating()||this.getInteracting(),n=this.constraints_.rotation(this.targetRotation_+t,r);e&&(this.targetCenter_=this.calculateCenterRotate(n,e)),this.targetRotation_+=t,this.applyTargetState_()},e.prototype.setCenter=function(t){this.setCenterInternal(t?ei(t,this.getProjection()):t)},e.prototype.setCenterInternal=function(t){this.targetCenter_=t,this.applyTargetState_()},e.prototype.setHint=function(t,e){return this.hints_[t]+=e,this.changed(),this.hints_[t]},e.prototype.setResolution=function(t){this.targetResolution_=t,this.applyTargetState_()},e.prototype.setRotation=function(t){this.targetRotation_=t,this.applyTargetState_()},e.prototype.setZoom=function(t){this.setResolution(this.getResolutionForZoom(t))},e.prototype.applyTargetState_=function(t,e){var r=this.getAnimating()||this.getInteracting()||e,n=this.constraints_.rotation(this.targetRotation_,r),i=this.getViewportSize_(n),o=this.constraints_.resolution(this.targetResolution_,0,i,r),a=this.constraints_.center(this.targetCenter_,o,i,r,this.calculateCenterShift(this.targetCenter_,o,n,i));this.get(Xs.ROTATION)!==n&&this.set(Xs.ROTATION,n),this.get(Xs.RESOLUTION)!==o&&(this.set(Xs.RESOLUTION,o),this.set("zoom",this.getZoom(),!0)),a&&this.get(Xs.CENTER)&&Tn(this.get(Xs.CENTER),a)||this.set(Xs.CENTER,a),this.getAnimating()&&!t&&this.cancelAnimations(),this.cancelAnchor_=void 0},e.prototype.resolveConstraints=function(t,e,r){var n=void 0!==t?t:200,i=e||0,o=this.constraints_.rotation(this.targetRotation_),a=this.getViewportSize_(o),s=this.constraints_.resolution(this.targetResolution_,i,a),l=this.constraints_.center(this.targetCenter_,s,a,!1,this.calculateCenterShift(this.targetCenter_,s,o,a));if(0===n&&!this.cancelAnchor_)return this.targetResolution_=s,this.targetRotation_=o,this.targetCenter_=l,void this.applyTargetState_();var u=r||(0===n?this.cancelAnchor_:void 0);this.cancelAnchor_=void 0,this.getResolution()===s&&this.getRotation()===o&&this.getCenterInternal()&&Tn(this.getCenterInternal(),l)||(this.getAnimating()&&this.cancelAnimations(),this.animateInternal({rotation:o,center:l,resolution:s,duration:n,easing:tl,anchor:u}))},e.prototype.beginInteraction=function(){this.resolveConstraints(0),this.setHint(Vs,1)},e.prototype.endInteraction=function(t,e,r){var n=r&&ei(r,this.getProjection());this.endInteractionInternal(t,e,n)},e.prototype.endInteractionInternal=function(t,e,r){this.setHint(Vs,-1),this.resolveConstraints(t,e,r)},e.prototype.getConstrainedCenter=function(t,e){var r=this.getViewportSize_(this.getRotation());return this.constraints_.center(t,e||this.getResolution(),r)},e.prototype.getConstrainedZoom=function(t,e){var r=this.getResolutionForZoom(t);return this.getZoomForResolution(this.getConstrainedResolution(r,e))},e.prototype.getConstrainedResolution=function(t,e){var r=e||0,n=this.getViewportSize_(this.getRotation());return this.constraints_.resolution(t,r,n)},e}(qt);function ol(t,e){setTimeout((function(){t(e)}),0)}function al(t){return!(t.sourceCenter&&t.targetCenter&&!Tn(t.sourceCenter,t.targetCenter))&&(t.sourceResolution===t.targetResolution&&t.sourceRotation===t.targetRotation)}function sl(t,e,r,n,i){var o=Math.cos(-i),a=Math.sin(-i),s=t[0]*o-t[1]*a,l=t[1]*o+t[0]*a;return[(s+=(e[0]/2-r[0])*n)*o-(l+=(r[1]-e[1]/2)*n)*(a=-a),l*o+s*a]}var ll=il,ul=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 hl(t){t instanceof Ya?t.setMapInternal(null):t instanceof fs&&t.getLayers().forEach(hl)}function cl(t,e){if(t instanceof Ya)t.setMapInternal(e);else if(t instanceof fs)for(var r=t.getLayers().getArray(),n=0,i=r.length;n<i;++n)cl(r[n],e)}var pl=function(t){function e(e){var r=t.call(this)||this;r.on,r.once,r.un;var n=function(t){var e=null;void 0!==t.keyboardEventTarget&&(e="string"==typeof t.keyboardEventTarget?document.getElementById(t.keyboardEventTarget):t.keyboardEventTarget);var r,n,i,o={},a=t.layers&&"function"==typeof t.layers.getLayers?t.layers:new fs({layers:t.layers});o[Os]=a,o[Ms]=t.target,o[Is]=t.view instanceof ll?t.view:new ll,void 0!==t.controls&&(Array.isArray(t.controls)?r=new us(t.controls.slice()):(_("function"==typeof t.controls.getArray,47),r=t.controls));void 0!==t.interactions&&(Array.isArray(t.interactions)?n=new us(t.interactions.slice()):(_("function"==typeof t.interactions.getArray,48),n=t.interactions));void 0!==t.overlays?Array.isArray(t.overlays)?i=new us(t.overlays.slice()):(_("function"==typeof t.overlays.getArray,49),i=t.overlays):i=new us;return{controls:r,interactions:n,keyboardEventTarget:e,overlays:i,values:o}}(e);r.renderComplete_,r.loaded_=!0,r.boundHandleBrowserEvent_=r.handleBrowserEvent.bind(r),r.maxTilesLoading_=void 0!==e.maxTilesLoading?e.maxTilesLoading:16,r.pixelRatio_=void 0!==e.pixelRatio?e.pixelRatio:q,r.postRenderTimeoutHandle_,r.animationDelayKey_,r.animationDelay_=function(){this.animationDelayKey_=void 0,this.renderFrame_(Date.now())}.bind(r),r.coordinateToPixelTransform_=[1,0,0,1,0,0],r.pixelToCoordinateTransform_=[1,0,0,1,0,0],r.frameIndex_=0,r.frameState_=null,r.previousExtent_=null,r.viewPropertyListenerKey_=null,r.viewChangeListenerKey_=null,r.layerGroupPropertyListenerKeys_=null,r.viewport_=document.createElement("div"),r.viewport_.className="ol-viewport"+("ontouchstart"in window?" ol-touch":""),r.viewport_.style.position="relative",r.viewport_.style.overflow="hidden",r.viewport_.style.width="100%",r.viewport_.style.height="100%",r.overlayContainer_=document.createElement("div"),r.overlayContainer_.style.position="absolute",r.overlayContainer_.style.zIndex="0",r.overlayContainer_.style.width="100%",r.overlayContainer_.style.height="100%",r.overlayContainer_.style.pointerEvents="none",r.overlayContainer_.className="ol-overlaycontainer",r.viewport_.appendChild(r.overlayContainer_),r.overlayContainerStopEvent_=document.createElement("div"),r.overlayContainerStopEvent_.style.position="absolute",r.overlayContainerStopEvent_.style.zIndex="0",r.overlayContainerStopEvent_.style.width="100%",r.overlayContainerStopEvent_.style.height="100%",r.overlayContainerStopEvent_.style.pointerEvents="none",r.overlayContainerStopEvent_.className="ol-overlaycontainer-stopevent",r.viewport_.appendChild(r.overlayContainerStopEvent_),r.mapBrowserEventHandler_=null,r.moveTolerance_=e.moveTolerance,r.keyboardEventTarget_=n.keyboardEventTarget,r.targetChangeHandlerKeys_=null,r.controls=n.controls||new us,r.interactions=n.interactions||new us,r.overlays_=n.overlays,r.overlayIdIndex_={},r.renderer_=null,r.postRenderFunctions_=[],r.tileQueue_=new Us(r.getTilePriority.bind(r),r.handleTileChange_.bind(r)),r.addChangeListener(Os,r.handleLayerGroupChanged_),r.addChangeListener(Is,r.handleViewChanged_),r.addChangeListener(Fs,r.handleSizeChanged_),r.addChangeListener(Ms,r.handleTargetChanged_),r.setProperties(n.values);var i=r;return!e.view||e.view instanceof ll||e.view.then((function(t){i.setView(new ll(t))})),r.controls.addEventListener(ns,function(t){t.element.setMap(this)}.bind(r)),r.controls.addEventListener(is,function(t){t.element.setMap(null)}.bind(r)),r.interactions.addEventListener(ns,function(t){t.element.setMap(this)}.bind(r)),r.interactions.addEventListener(is,function(t){t.element.setMap(null)}.bind(r)),r.overlays_.addEventListener(ns,function(t){this.addOverlayInternal_(t.element)}.bind(r)),r.overlays_.addEventListener(is,function(t){var e=t.element.getId();void 0!==e&&delete this.overlayIdIndex_[e.toString()],t.element.setMap(null)}.bind(r)),r.controls.forEach(function(t){t.setMap(this)}.bind(r)),r.interactions.forEach(function(t){t.setMap(this)}.bind(r)),r.overlays_.forEach(r.addOverlayInternal_.bind(r)),r}return ul(e,t),e.prototype.createRenderer=function(){throw new Error("Use a map type that has a createRenderer method")},e.prototype.addControl=function(t){this.getControls().push(t)},e.prototype.addInteraction=function(t){this.getInteractions().push(t)},e.prototype.addLayer=function(t){this.getLayerGroup().getLayers().push(t)},e.prototype.handleLayerAdd_=function(t){cl(t.layer,this)},e.prototype.addOverlay=function(t){this.getOverlays().push(t)},e.prototype.addOverlayInternal_=function(t){var e=t.getId();void 0!==e&&(this.overlayIdIndex_[e.toString()]=t),t.setMap(this)},e.prototype.disposeInternal=function(){this.controls.clear(),this.interactions.clear(),this.overlays_.clear(),this.setTarget(null),t.prototype.disposeInternal.call(this)},e.prototype.forEachFeatureAtPixel=function(t,e,r){if(this.frameState_&&this.renderer_){var n=this.getCoordinateFromPixelInternal(t),i=void 0!==(r=void 0!==r?r:{}).hitTolerance?r.hitTolerance:0,o=void 0!==r.layerFilter?r.layerFilter:pt,a=!1!==r.checkWrapped;return this.renderer_.forEachFeatureAtCoordinate(n,this.frameState_,i,a,e,null,o,null)}},e.prototype.getFeaturesAtPixel=function(t,e){var r=[];return this.forEachFeatureAtPixel(t,(function(t){r.push(t)}),e),r},e.prototype.getAllLayers=function(){var t=[];return function e(r){r.forEach((function(r){r instanceof fs?e(r.getLayers()):t.push(r)}))}(this.getLayers()),t},e.prototype.forEachLayerAtPixel=function(t,e,r){if(this.frameState_&&this.renderer_){var n=r||{},i=void 0!==n.hitTolerance?n.hitTolerance:0,o=n.layerFilter||pt;return this.renderer_.forEachLayerAtPixel(t,this.frameState_,i,e,o)}},e.prototype.hasFeatureAtPixel=function(t,e){if(!this.frameState_||!this.renderer_)return!1;var r=this.getCoordinateFromPixelInternal(t),n=void 0!==(e=void 0!==e?e:{}).layerFilter?e.layerFilter:pt,i=void 0!==e.hitTolerance?e.hitTolerance:0,o=!1!==e.checkWrapped;return this.renderer_.hasFeatureAtCoordinate(r,this.frameState_,i,o,n,null)},e.prototype.getEventCoordinate=function(t){return this.getCoordinateFromPixel(this.getEventPixel(t))},e.prototype.getEventCoordinateInternal=function(t){return this.getCoordinateFromPixelInternal(this.getEventPixel(t))},e.prototype.getEventPixel=function(t){var e=this.viewport_.getBoundingClientRect(),r="changedTouches"in t?t.changedTouches[0]:t;return[r.clientX-e.left,r.clientY-e.top]},e.prototype.getTarget=function(){return this.get(Ms)},e.prototype.getTargetElement=function(){var t=this.getTarget();return void 0!==t?"string"==typeof t?document.getElementById(t):t:null},e.prototype.getCoordinateFromPixel=function(t){return ti(this.getCoordinateFromPixelInternal(t),this.getView().getProjection())},e.prototype.getCoordinateFromPixelInternal=function(t){var e=this.frameState_;return e?Hr(e.pixelToCoordinateTransform,t.slice()):null},e.prototype.getControls=function(){return this.controls},e.prototype.getOverlays=function(){return this.overlays_},e.prototype.getOverlayById=function(t){var e=this.overlayIdIndex_[t.toString()];return void 0!==e?e:null},e.prototype.getInteractions=function(){return this.interactions},e.prototype.getLayerGroup=function(){return this.get(Os)},e.prototype.setLayers=function(t){var e=this.getLayerGroup();if(t instanceof us)e.setLayers(t);else{var r=e.getLayers();r.clear(),r.extend(t)}},e.prototype.getLayers=function(){return this.getLayerGroup().getLayers()},e.prototype.getLoadingOrNotReady=function(){for(var t=this.getLayerGroup().getLayerStatesArray(),e=0,r=t.length;e<r;++e){var n=t[e];if(n.visible){var i=n.layer.getRenderer();if(i&&!i.ready)return!0;var o=n.layer.getSource();if(o&&o.loading)return!0}}return!1},e.prototype.getPixelFromCoordinate=function(t){var e=ei(t,this.getView().getProjection());return this.getPixelFromCoordinateInternal(e)},e.prototype.getPixelFromCoordinateInternal=function(t){var e=this.frameState_;return e?Hr(e.coordinateToPixelTransform,t.slice(0,2)):null},e.prototype.getRenderer=function(){return this.renderer_},e.prototype.getSize=function(){return this.get(Fs)},e.prototype.getView=function(){return this.get(Is)},e.prototype.getViewport=function(){return this.viewport_},e.prototype.getOverlayContainer=function(){return this.overlayContainer_},e.prototype.getOverlayContainerStopEvent=function(){return this.overlayContainerStopEvent_},e.prototype.getOwnerDocument=function(){var t=this.getTargetElement();return t?t.ownerDocument:document},e.prototype.getTilePriority=function(t,e,r,n){return function(t,e,r,n,i){if(!t||!(r in t.wantedTiles))return Ls;if(!t.wantedTiles[r][e.getKey()])return Ls;var o=t.viewState.center,a=n[0]-o[0],s=n[1]-o[1];return 65536*Math.log(i)+Math.sqrt(a*a+s*s)/i}(this.frameState_,t,e,r,n)},e.prototype.handleBrowserEvent=function(t,e){var r=e||t.type,n=new _s(r,this,t);this.handleMapBrowserEvent(n)},e.prototype.handleMapBrowserEvent=function(t){if(this.frameState_){var e=t.originalEvent,r=e.type;if(r===ws||r===At||r===Ot){var n=this.getOwnerDocument(),i=this.viewport_.getRootNode?this.viewport_.getRootNode():n,o=e.target;if(this.overlayContainerStopEvent_.contains(o)||!(i===n?n.documentElement:i).contains(o))return}if(t.frameState=this.frameState_,!1!==this.dispatchEvent(t))for(var a=this.getInteractions().getArray().slice(),s=a.length-1;s>=0;s--){var l=a[s];if(l.getMap()===this&&l.getActive()&&this.getTargetElement())if(!l.handleEvent(t)||t.propagationStopped)break}}},e.prototype.handlePostRender=function(){var t=this.frameState_,e=this.tileQueue_;if(!e.isEmpty()){var r=this.maxTilesLoading_,n=r;if(t){var i=t.viewHints;if(i[Bs]||i[Vs]){var o=Date.now()-t.time>8;r=o?0:8,n=o?0:2}}e.getTilesLoading()<r&&(e.reprioritize(),e.loadMoreTiles(r,n))}t&&this.renderer_&&!t.animate&&(!0===this.renderComplete_?(this.hasListener(Va)&&this.renderer_.dispatchRenderEvent(Va,t),!1===this.loaded_&&(this.loaded_=!0,this.dispatchEvent(new ys(Rs,this,t)))):!0===this.loaded_&&(this.loaded_=!1,this.dispatchEvent(new ys(Ps,this,t))));for(var a=this.postRenderFunctions_,s=0,l=a.length;s<l;++s)a[s](this,t);a.length=0},e.prototype.handleSizeChanged_=function(){this.getView()&&!this.getView().getAnimating()&&this.getView().resolveConstraints(0),this.render()},e.prototype.handleTargetChanged_=function(){if(this.mapBrowserEventHandler_){for(var t=0,e=this.targetChangeHandlerKeys_.length;t<e;++t)jt(this.targetChangeHandlerKeys_[t]);this.targetChangeHandlerKeys_=null,this.viewport_.removeEventListener(St,this.boundHandleBrowserEvent_),this.viewport_.removeEventListener(At,this.boundHandleBrowserEvent_),this.mapBrowserEventHandler_.dispose(),this.mapBrowserEventHandler_=null,et(this.viewport_)}var r=this.getTargetElement();if(r){for(var n in r.appendChild(this.viewport_),this.renderer_||(this.renderer_=this.createRenderer()),this.mapBrowserEventHandler_=new Ss(this,this.moveTolerance_),ms)this.mapBrowserEventHandler_.addEventListener(ms[n],this.handleMapBrowserEvent.bind(this));this.viewport_.addEventListener(St,this.boundHandleBrowserEvent_,!1),this.viewport_.addEventListener(At,this.boundHandleBrowserEvent_,!!Z&&{passive:!1});var i=this.getOwnerDocument().defaultView,o=this.keyboardEventTarget_?this.keyboardEventTarget_:r;this.targetChangeHandlerKeys_=[kt(o,Ot,this.handleBrowserEvent,this),kt(o,Ft,this.handleBrowserEvent,this),kt(i,It,this.updateSize,this)]}else this.renderer_&&(clearTimeout(this.postRenderTimeoutHandle_),this.postRenderTimeoutHandle_=void 0,this.postRenderFunctions_.length=0,this.renderer_.dispose(),this.renderer_=null),this.animationDelayKey_&&(cancelAnimationFrame(this.animationDelayKey_),this.animationDelayKey_=void 0);this.updateSize()},e.prototype.handleTileChange_=function(){this.render()},e.prototype.handleViewPropertyChanged_=function(){this.render()},e.prototype.handleViewChanged_=function(){this.viewPropertyListenerKey_&&(jt(this.viewPropertyListenerKey_),this.viewPropertyListenerKey_=null),this.viewChangeListenerKey_&&(jt(this.viewChangeListenerKey_),this.viewChangeListenerKey_=null);var t=this.getView();t&&(this.updateViewportSize_(),this.viewPropertyListenerKey_=kt(t,it,this.handleViewPropertyChanged_,this),this.viewChangeListenerKey_=kt(t,wt,this.handleViewPropertyChanged_,this),t.resolveConstraints(0)),this.render()},e.prototype.handleLayerGroupChanged_=function(){this.layerGroupPropertyListenerKeys_&&(this.layerGroupPropertyListenerKeys_.forEach(jt),this.layerGroupPropertyListenerKeys_=null);var t=this.getLayerGroup();t&&(this.handleLayerAdd_(new cs("addlayer",t)),this.layerGroupPropertyListenerKeys_=[kt(t,it,this.render,this),kt(t,wt,this.render,this),kt(t,"addlayer",this.handleLayerAdd_,this),kt(t,"removelayer",this.handleLayerRemove_,this)]),this.render()},e.prototype.isRendered=function(){return!!this.frameState_},e.prototype.renderSync=function(){this.animationDelayKey_&&cancelAnimationFrame(this.animationDelayKey_),this.animationDelay_()},e.prototype.redrawText=function(){for(var t=this.getLayerGroup().getLayerStatesArray(),e=0,r=t.length;e<r;++e){var n=t[e].layer;n.hasRenderer()&&n.getRenderer().handleFontsChanged()}},e.prototype.render=function(){this.renderer_&&void 0===this.animationDelayKey_&&(this.animationDelayKey_=requestAnimationFrame(this.animationDelay_))},e.prototype.removeControl=function(t){return this.getControls().remove(t)},e.prototype.removeInteraction=function(t){return this.getInteractions().remove(t)},e.prototype.removeLayer=function(t){return this.getLayerGroup().getLayers().remove(t)},e.prototype.handleLayerRemove_=function(t){hl(t.layer)},e.prototype.removeOverlay=function(t){return this.getOverlays().remove(t)},e.prototype.renderFrame_=function(t){var e=this,r=this.getSize(),n=this.getView(),i=this.frameState_,o=null;if(void 0!==r&&h(r)&&n&&n.isDef()){var a=n.getHints(this.frameState_?this.frameState_.viewHints:void 0),s=n.getState();if(o={animate:!1,coordinateToPixelTransform:this.coordinateToPixelTransform_,declutterTree:null,extent:gr(s.center,s.resolution,s.rotation,r),index:this.frameIndex_++,layerIndex:0,layerStatesArray:this.getLayerGroup().getLayerStatesArray(),pixelRatio:this.pixelRatio_,pixelToCoordinateTransform:this.pixelToCoordinateTransform_,postRenderFunctions:[],size:r,tileQueue:this.tileQueue_,time:t,usedTiles:{},viewState:s,viewHints:a,wantedTiles:{},mapId:l(this),renderTargets:{}},s.nextCenter&&s.nextResolution){var u=isNaN(s.nextRotation)?s.rotation:s.nextRotation;o.nextExtent=gr(s.nextCenter,s.nextResolution,u,r)}}if(this.frameState_=o,this.renderer_.renderFrame(o),o){if(o.animate&&this.render(),Array.prototype.push.apply(this.postRenderFunctions_,o.postRenderFunctions),i)(!this.previousExtent_||!Sr(this.previousExtent_)&&!ir(o.extent,this.previousExtent_))&&(this.dispatchEvent(new ys(Es,this,i)),this.previousExtent_=er(this.previousExtent_));this.previousExtent_&&!o.viewHints[Bs]&&!o.viewHints[Vs]&&!ir(o.extent,this.previousExtent_)&&(this.dispatchEvent(new ys(Ts,this,o)),Ye(o.extent,this.previousExtent_))}this.dispatchEvent(new ys(Cs,this,o)),this.renderComplete_=this.hasListener(Ps)||this.hasListener(Rs)||this.hasListener(Va)?!this.tileQueue_.getTilesLoading()&&!this.tileQueue_.getCount()&&!this.getLoadingOrNotReady():void 0,this.postRenderTimeoutHandle_||(this.postRenderTimeoutHandle_=setTimeout((function(){e.postRenderTimeoutHandle_=void 0,e.handlePostRender()}),0))},e.prototype.setLayerGroup=function(t){var e=this.getLayerGroup();e&&this.handleLayerRemove_(new cs("removelayer",e)),this.set(Os,t)},e.prototype.setSize=function(t){this.set(Fs,t)},e.prototype.setTarget=function(t){this.set(Ms,t)},e.prototype.setView=function(t){if(!t||t instanceof ll)this.set(Is,t);else{this.set(Is,new ll);var e=this;t.then((function(t){e.setView(new ll(t))}))}},e.prototype.updateSize=function(){var t=this.getTargetElement(),e=void 0;if(t){var r=getComputedStyle(t),n=t.offsetWidth-parseFloat(r.borderLeftWidth)-parseFloat(r.paddingLeft)-parseFloat(r.paddingRight)-parseFloat(r.borderRightWidth),i=t.offsetHeight-parseFloat(r.borderTopWidth)-parseFloat(r.paddingTop)-parseFloat(r.paddingBottom)-parseFloat(r.borderBottomWidth);isNaN(n)||isNaN(i)||!h(e=[n,i])&&(t.offsetWidth||t.offsetHeight||t.getClientRects().length)&&console.warn("No map visible because the map container's width or height are 0.")}this.setSize(e),this.updateViewportSize_()},e.prototype.updateViewportSize_=function(){var t=this.getView();if(t){var e=void 0,r=getComputedStyle(this.viewport_);r.width&&r.height&&(e=[parseInt(r.width,10),parseInt(r.height,10)]),t.setViewportSize(e)}},e}(qt);var fl=pl,dl=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)}}(),gl=function(t){function e(e){var r=t.call(this)||this,n=e.element;return!n||e.target||n.style.pointerEvents||(n.style.pointerEvents="auto"),r.element=n||null,r.target_=null,r.map_=null,r.listenerKeys=[],e.render&&(r.render=e.render),e.target&&r.setTarget(e.target),r}return dl(e,t),e.prototype.disposeInternal=function(){et(this.element),t.prototype.disposeInternal.call(this)},e.prototype.getMap=function(){return this.map_},e.prototype.setMap=function(t){this.map_&&et(this.element);for(var e=0,r=this.listenerKeys.length;e<r;++e)jt(this.listenerKeys[e]);(this.listenerKeys.length=0,this.map_=t,t)&&((this.target_?this.target_:t.getOverlayContainerStopEvent()).appendChild(this.element),this.render!==dt&&this.listenerKeys.push(kt(t,Cs,this.render,this)),t.render())},e.prototype.render=function(t){},e.prototype.setTarget=function(t){this.target_="string"==typeof t?document.getElementById(t):t},e}(qt),yl=Object.freeze({__proto__:null,default:gl}),vl=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)}}(),_l=function(t){function e(e){var r=this,n=e||{};(r=t.call(this,{element:document.createElement("div"),render:n.render,target:n.target})||this).ulElement_=document.createElement("ul"),r.collapsed_=void 0===n.collapsed||n.collapsed,r.userCollapsed_=r.collapsed_,r.overrideCollapsible_=void 0!==n.collapsible,r.collapsible_=void 0===n.collapsible||n.collapsible,r.collapsible_||(r.collapsed_=!1);var i=void 0!==n.className?n.className:"ol-attribution",o=void 0!==n.tipLabel?n.tipLabel:"Attributions",a=void 0!==n.expandClassName?n.expandClassName:i+"-expand",s=void 0!==n.collapseLabel?n.collapseLabel:"",l=void 0!==n.collapseClassName?n.collapseClassName:i+"-collapse";"string"==typeof s?(r.collapseLabel_=document.createElement("span"),r.collapseLabel_.textContent=s,r.collapseLabel_.className=l):r.collapseLabel_=s;var u=void 0!==n.label?n.label:"i";"string"==typeof u?(r.label_=document.createElement("span"),r.label_.textContent=u,r.label_.className=a):r.label_=u;var h=r.collapsible_&&!r.collapsed_?r.collapseLabel_:r.label_;r.toggleButton_=document.createElement("button"),r.toggleButton_.setAttribute("type","button"),r.toggleButton_.setAttribute("aria-expanded",String(!r.collapsed_)),r.toggleButton_.title=o,r.toggleButton_.appendChild(h),r.toggleButton_.addEventListener(Ct,r.handleClick_.bind(r),!1);var c=i+" "+"ol-unselectable "+Zt+(r.collapsed_&&r.collapsible_?" ol-collapsed":"")+(r.collapsible_?"":" ol-uncollapsible"),p=r.element;return p.className=c,p.appendChild(r.toggleButton_),p.appendChild(r.ulElement_),r.renderedAttributions_=[],r.renderedVisible_=!0,r}return vl(e,t),e.prototype.collectSourceAttributions_=function(t){for(var e={},r=[],n=!0,i=t.layerStatesArray,o=0,a=i.length;o<a;++o){var s=i[o];if(qa(s,t.viewState)){var l=s.layer.getSource();if(l){var u=l.getAttributions();if(u){var h=u(t);if(h)if(n=n&&!1!==l.getAttributionsCollapsible(),Array.isArray(h))for(var c=0,p=h.length;c<p;++c)h[c]in e||(r.push(h[c]),e[h[c]]=!0);else h in e||(r.push(h),e[h]=!0)}}}}return this.overrideCollapsible_||this.setCollapsible(n),r},e.prototype.updateElement_=function(t){if(t){var e=this.collectSourceAttributions_(t),r=e.length>0;if(this.renderedVisible_!=r&&(this.element.style.display=r?"":"none",this.renderedVisible_=r),!ct(e,this.renderedAttributions_)){rt(this.ulElement_);for(var n=0,i=e.length;n<i;++n){var o=document.createElement("li");o.innerHTML=e[n],this.ulElement_.appendChild(o)}this.renderedAttributions_=e}}else this.renderedVisible_&&(this.element.style.display="none",this.renderedVisible_=!1)},e.prototype.handleClick_=function(t){t.preventDefault(),this.handleToggle_(),this.userCollapsed_=this.collapsed_},e.prototype.handleToggle_=function(){this.element.classList.toggle(Ht),this.collapsed_?tt(this.collapseLabel_,this.label_):tt(this.label_,this.collapseLabel_),this.collapsed_=!this.collapsed_,this.toggleButton_.setAttribute("aria-expanded",String(!this.collapsed_))},e.prototype.getCollapsible=function(){return this.collapsible_},e.prototype.setCollapsible=function(t){this.collapsible_!==t&&(this.collapsible_=t,this.element.classList.toggle("ol-uncollapsible"),this.userCollapsed_&&this.handleToggle_())},e.prototype.setCollapsed=function(t){this.userCollapsed_=t,this.collapsible_&&this.collapsed_!==t&&this.handleToggle_()},e.prototype.getCollapsed=function(){return this.collapsed_},e.prototype.render=function(t){this.updateElement_(t.frameState)},e}(gl),ml=_l,xl=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){var r=this,n=e||{};r=t.call(this,{element:document.createElement("div"),render:n.render,target:n.target})||this;var i=void 0!==n.className?n.className:"ol-rotate",o=void 0!==n.label?n.label:"⇧",a=void 0!==n.compassClassName?n.compassClassName:"ol-compass";r.label_=null,"string"==typeof o?(r.label_=document.createElement("span"),r.label_.className=a,r.label_.textContent=o):(r.label_=o,r.label_.classList.add(a));var s=n.tipLabel?n.tipLabel:"Reset rotation",l=document.createElement("button");l.className=i+"-reset",l.setAttribute("type","button"),l.title=s,l.appendChild(r.label_),l.addEventListener(Ct,r.handleClick_.bind(r),!1);var u=i+" "+"ol-unselectable "+Zt,h=r.element;return h.className=u,h.appendChild(l),r.callResetNorth_=n.resetNorth?n.resetNorth:void 0,r.duration_=void 0!==n.duration?n.duration:250,r.autoHide_=void 0===n.autoHide||n.autoHide,r.rotation_=void 0,r.autoHide_&&r.element.classList.add(Yt),r}return xl(e,t),e.prototype.handleClick_=function(t){t.preventDefault(),void 0!==this.callResetNorth_?this.callResetNorth_():this.resetNorth_()},e.prototype.resetNorth_=function(){var t=this.getMap().getView();if(t){var e=t.getRotation();void 0!==e&&(this.duration_>0&&e%(2*Math.PI)!=0?t.animate({rotation:0,duration:this.duration_,easing:tl}):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(Yt);i||0!==r?i&&0!==r&&this.element.classList.remove(Yt):this.element.classList.add(Yt)}this.label_.style.transform=n}this.rotation_=r}},e}(gl),bl=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)}}(),Cl=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:"",h=void 0!==n.zoomInTipLabel?n.zoomInTipLabel:"Zoom in",c=void 0!==n.zoomOutTipLabel?n.zoomOutTipLabel:"Zoom out",p=document.createElement("button");p.className=a,p.setAttribute("type","button"),p.title=h,p.appendChild("string"==typeof l?document.createTextNode(l):l),p.addEventListener(Ct,r.handleClick_.bind(r,o),!1);var f=document.createElement("button");f.className=s,f.setAttribute("type","button"),f.title=c,f.appendChild("string"==typeof u?document.createTextNode(u):u),f.addEventListener(Ct,r.handleClick_.bind(r,-o),!1);var d=i+" "+"ol-unselectable "+Zt,g=r.element;return g.className=d,g.appendChild(p),g.appendChild(f),r.duration_=void 0!==n.duration?n.duration:250,r}return Sl(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:tl})):e.setZoom(n)}}},e}(gl),El=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="element",Pl="map",Rl="offset",Ol="position",Fl="positioning",Ml=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(Tl,r.handleElementChanged),r.addChangeListener(Pl,r.handleMapChanged),r.addChangeListener(Rl,r.handleOffsetChanged),r.addChangeListener(Ol,r.handlePositionChanged),r.addChangeListener(Fl,r.handlePositioningChanged),void 0!==e.element&&r.setElement(e.element),r.setOffset(void 0!==e.offset?e.offset:[0,0]),r.setPositioning(e.positioning||"top-left"),void 0!==e.position&&r.setPosition(e.position),r}return El(e,t),e.prototype.getElement=function(){return this.get(Tl)},e.prototype.getId=function(){return this.id},e.prototype.getMap=function(){return this.get(Pl)||null},e.prototype.getOffset=function(){return this.get(Rl)},e.prototype.getPosition=function(){return this.get(Ol)},e.prototype.getPositioning=function(){return this.get(Fl)},e.prototype.handleElementChanged=function(){rt(this.element);var t=this.getElement();t&&this.element.appendChild(t)},e.prototype.handleMapChanged=function(){this.mapPostrenderListenerKey&&(et(this.element),jt(this.mapPostrenderListenerKey),this.mapPostrenderListenerKey=null);var t=this.getMap();if(t){this.mapPostrenderListenerKey=kt(t,Cs,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(Tl,t)},e.prototype.setMap=function(t){this.set(Pl,t)},e.prototype.setOffset=function(t){this.set(Rl,t)},e.prototype.setPosition=function(t){this.set(Ol,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(Ol)){var r=this.getRect(e.getTargetElement(),e.getSize()),n=this.getElement(),i=this.getRect(n,[Q(n),$(n)]),o=t||{},a=void 0===o.margin?20:o.margin;if(!He(r,i)){var s=i[0]-r[0],l=r[2]-i[2],u=i[1]-r[1],h=r[3]-i[3],c=[0,0];if(s<0?c[0]=s-a:l<0&&(c[0]=Math.abs(l)+a),u<0?c[1]=u-a:h<0&&(c[1]=Math.abs(h)+a),0!==c[0]||0!==c[1]){var p=e.getView().getCenterInternal(),f=e.getPixelFromCoordinateInternal(p);if(!f)return;var d=[f[0]+c[0],f[1]+c[1]],g=o.animation||{};e.getView().animateInternal({center:e.getCoordinateFromPixelInternal(d),duration:g.duration,easing:g.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(Fl,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%";"bottom-right"==i||"center-right"==i||"top-right"==i?s="-100%":"bottom-center"!=i&&"center-center"!=i&&"top-center"!=i||(s="-50%"),"bottom-left"==i||"bottom-center"==i||"bottom-right"==i?l="-100%":"center-left"!=i&&"center-center"!=i&&"center-right"!=i||(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}(qt),Il=Ml,Ll=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)}}(),Al="units",kl="degrees",Dl="imperial",jl="nautical",Gl="metric",zl="us",Nl=[1,2,5],Ul=25.4/.28,Bl=function(t){function e(e){var r=this,n=e||{},i=void 0!==n.className?n.className:n.bar?"ol-scale-bar":"ol-scale-line";return(r=t.call(this,{element:document.createElement("div"),render:n.render,target:n.target})||this).on,r.once,r.un,r.innerElement_=document.createElement("div"),r.innerElement_.className=i+"-inner",r.element.className=i+" "+Kt,r.element.appendChild(r.innerElement_),r.viewState_=null,r.minWidth_=void 0!==n.minWidth?n.minWidth:64,r.maxWidth_=n.maxWidth,r.renderedVisible_=!1,r.renderedWidth_=void 0,r.renderedHTML_="",r.addChangeListener(Al,r.handleUnitsChanged_),r.setUnits(n.units||Gl),r.scaleBar_=n.bar||!1,r.scaleBarSteps_=n.steps||4,r.scaleBarText_=n.text||!1,r.dpi_=n.dpi||void 0,r}return Ll(e,t),e.prototype.getUnits=function(){return this.get(Al)},e.prototype.handleUnitsChanged_=function(){this.updateElement_()},e.prototype.setUnits=function(t){this.set(Al,t)},e.prototype.setDpi=function(t){this.dpi_=t},e.prototype.updateElement_=function(){var t=this.viewState_;if(t){var e=t.center,r=t.projection,n=this.getUnits(),i=n==kl?Wr.DEGREES:Wr.METERS,o=Vn(r,t.resolution,e,i),a=this.minWidth_*(this.dpi_||Ul)/Ul,s=void 0!==this.maxWidth_?this.maxWidth_*(this.dpi_||Ul)/Ul:void 0,l=a*o,u="";if(n==kl){var h=Vr[Wr.DEGREES];(l*=h)<h/60?(u="″",o*=3600):l<h?(u="",o*=60):u="°"}else n==Dl?l<.9144?(u="in",o/=.0254):l<1609.344?(u="ft",o/=.3048):(u="mi",o/=1609.344):n==jl?(o/=1852,u="NM"):n==Gl?l<.001?(u="μm",o*=1e6):l<1?(u="mm",o*=1e3):l<1e3?u="m":(u="km",o/=1e3):n==zl?l<.9144?(u="in",o*=39.37):l<1609.344?(u="ft",o/=.30480061):(u="mi",o/=1609.3472):_(!1,33);for(var c,p,f,d,g,y,v,m=3*Math.floor(Math.log(a*o)/Math.log(10));;){f=Math.floor(m/3);var x=Math.pow(10,f);if(c=Nl[(m%3+3)%3]*x,p=Math.round(c/o),isNaN(p))return this.element.style.display="none",void(this.renderedVisible_=!1);if(void 0!==s&&p>=s){c=d,p=g,f=y;break}if(p>=a)break;d=c,g=p,y=f,++m}v=this.scaleBar_?this.createScaleBar(p,c,u):c.toFixed(f<0?-f:0)+" "+u,this.renderedHTML_!=v&&(this.innerElement_.innerHTML=v,this.renderedHTML_=v),this.renderedWidth_!=p&&(this.innerElement_.style.width=p+"px",this.renderedWidth_=p),this.renderedVisible_||(this.element.style.display="",this.renderedVisible_=!0)}else this.renderedVisible_&&(this.element.style.display="none",this.renderedVisible_=!1)},e.prototype.createScaleBar=function(t,e,r){for(var n="1 : "+Math.round(this.getScaleForResolution()).toLocaleString(),i=[],o=t/this.scaleBarSteps_,a="ol-scale-singlebar-odd",s=0;s<this.scaleBarSteps_;s++)0===s&&i.push(this.createMarker("absolute",s)),i.push('<div><div class="ol-scale-singlebar '+a+'" style="width: '+o+'px;"></div>'+this.createMarker("relative",s)+(s%2==0||2===this.scaleBarSteps_?this.createStepText(s,t,!1,e,r):"")+"</div>"),s===this.scaleBarSteps_-1&&i.push(this.createStepText(s+1,t,!0,e,r)),a="ol-scale-singlebar-odd"===a?"ol-scale-singlebar-even":"ol-scale-singlebar-odd";return'<div style="display: flex;">'+(this.scaleBarText_?'<div class="ol-scale-text" style="width: '+t+'px;">'+n+"</div>":"")+i.join("")+"</div>"},e.prototype.createMarker=function(t,e){return'<div class="ol-scale-step-marker" style="position: '+t+";top: "+("absolute"===t?3:-10)+'px;"></div>'},e.prototype.createStepText=function(t,e,r,n,i){var o=(0===t?0:Math.round(n/this.scaleBarSteps_*t*100)/100)+(0===t?"":" "+i);return'<div class="ol-scale-step-text" style="margin-left: '+(0===t?-3:e/this.scaleBarSteps_*-1)+"px;text-align: "+(0===t?"left":"center")+"; min-width: "+(0===t?0:e/this.scaleBarSteps_*2)+"px;left: "+(r?e+"px":"unset")+';">'+o+"</div>"},e.prototype.getScaleForResolution=function(){var t=Vn(this.viewState_.projection,this.viewState_.resolution,this.viewState_.center,Wr.METERS),e=this.dpi_||Ul;return parseFloat(t.toString())*(1e3/25.4)*e},e.prototype.render=function(t){var e=t.frameState;this.viewState_=e?e.viewState:null,this.updateElement_()},e}(gl),Vl=Bl;var Xl="active",Wl=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 ql(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:tl})}}var Yl=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 Wl(e,t),e.prototype.getActive=function(){return this.get(Xl)},e.prototype.getMap=function(){return this.map_},e.prototype.handleEvent=function(t){return!0},e.prototype.setActive=function(t){this.set(Xl,t)},e.prototype.setMap=function(t){this.map_=t},e}(qt),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)}}(),Zl=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 Kl(e,t),e.prototype.handleEvent=function(t){var e=!1;if(t.type==ms.DBLCLICK){var r=t.originalEvent,n=t.map,i=t.coordinate,o=r.shiftKey?-this.delta_:this.delta_;ql(n.getView(),o,i,this.duration_),r.preventDefault(),e=!0}return!e},e}(Yl),Hl=Zl,Jl=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 Ql(t){for(var e=t.length,r=0,n=0,i=0;i<e;i++)r+=t[i].clientX,n+=t[i].clientY;return[r/e,n/e]}var $l=function(t){function e(e){var r=this,n=e||{};return r=t.call(this,n)||this,n.handleDownEvent&&(r.handleDownEvent=n.handleDownEvent),n.handleDragEvent&&(r.handleDragEvent=n.handleDragEvent),n.handleMoveEvent&&(r.handleMoveEvent=n.handleMoveEvent),n.handleUpEvent&&(r.handleUpEvent=n.handleUpEvent),n.stopDown&&(r.stopDown=n.stopDown),r.handlingDownUpSequence=!1,r.targetPointers=[],r}return Jl(e,t),e.prototype.getPointerCount=function(){return this.targetPointers.length},e.prototype.handleDownEvent=function(t){return!1},e.prototype.handleDragEvent=function(t){},e.prototype.handleEvent=function(t){if(!t.originalEvent)return!0;var e=!1;if(this.updateTrackedPointers_(t),this.handlingDownUpSequence){if(t.type==ms.POINTERDRAG)this.handleDragEvent(t),t.originalEvent.preventDefault();else if(t.type==ms.POINTERUP){var r=this.handleUpEvent(t);this.handlingDownUpSequence=r&&this.targetPointers.length>0}}else if(t.type==ms.POINTERDOWN){var n=this.handleDownEvent(t);this.handlingDownUpSequence=n,e=this.stopDown(n)}else t.type==ms.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){t.activePointers&&(this.targetPointers=t.activePointers)},e}(Yl);function tu(t){var e=arguments;return function(t){for(var r=!0,n=0,i=e.length;n<i&&(r=r&&e[n](t));++n);return r}}var eu=function(t){var e=t.originalEvent;return e.altKey&&!(e.metaKey||e.ctrlKey)&&e.shiftKey},ru=function(t){return!t.map.getTargetElement().hasAttribute("tabindex")||function(t){var e=t.map.getTargetElement(),r=t.map.getOwnerDocument().activeElement;return e.contains(r)}(t)},nu=pt,iu=function(t){var e=t.originalEvent;return 0==e.button&&!(X&&W&&e.ctrlKey)},ou=ft,au=function(t){return t.type==ms.SINGLECLICK},su=function(t){var e=t.originalEvent;return!e.altKey&&!(e.metaKey||e.ctrlKey)&&!e.shiftKey},lu=function(t){var e=t.originalEvent;return!e.altKey&&!(e.metaKey||e.ctrlKey)&&e.shiftKey},uu=function(t){var e=t.originalEvent,r=e.target.tagName;return"INPUT"!==r&&"SELECT"!==r&&"TEXTAREA"!==r&&!e.target.isContentEditable},hu=function(t){var e=t.originalEvent;return _(void 0!==e,56),"mouse"==e.pointerType},cu=function(t){var e=t.originalEvent;return _(void 0!==e,56),e.isPrimary&&0===e.button},pu=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)}}(),fu=function(t){function e(e){var r=t.call(this,{stopDown:ft})||this,n=e||{};r.kinetic_=n.kinetic,r.lastCentroid=null,r.lastPointersCount_,r.panning_=!1;var i=n.condition?n.condition:tu(su,cu);return r.condition_=n.onFocusOnly?tu(ru,i):i,r.noKinetic_=!1,r}return pu(e,t),e.prototype.handleDragEvent=function(t){this.panning_||(this.panning_=!0,this.getMap().getView().beginInteraction());var e=this.targetPointers,r=Ql(e);if(e.length==this.lastPointersCount_){if(this.kinetic_&&this.kinetic_.update(r[0],r[1]),this.lastCentroid){var n=[this.lastCentroid[0]-r[0],r[1]-this.lastCentroid[1]],i=t.map.getView();!function(t,e){t[0]*=e,t[1]*=e}(n,i.getResolution()),Pn(n,i.getRotation()),i.adjustCenterInternal(n)}}else this.kinetic_&&this.kinetic_.begin();this.lastCentroid=r,this.lastPointersCount_=e.length,t.originalEvent.preventDefault()},e.prototype.handleUpEvent=function(t){var e=t.map,r=e.getView();if(0===this.targetPointers.length){if(!this.noKinetic_&&this.kinetic_&&this.kinetic_.end()){var n=this.kinetic_.getDistance(),i=this.kinetic_.getAngle(),o=r.getCenterInternal(),a=e.getPixelFromCoordinateInternal(o),s=e.getCoordinateFromPixelInternal([a[0]-n*Math.cos(i),a[1]-n*Math.sin(i)]);r.animateInternal({center:r.getConstrainedCenter(s),duration:500,easing:tl})}return this.panning_&&(this.panning_=!1,r.endInteraction()),!1}return this.kinetic_&&this.kinetic_.begin(),this.lastCentroid=null,!0},e.prototype.handleDownEvent=function(t){if(this.targetPointers.length>0&&this.condition_(t)){var e=t.map.getView();return this.lastCentroid=null,e.getAnimating()&&e.cancelAnimations(),this.kinetic_&&this.kinetic_.begin(),this.noKinetic_=this.targetPointers.length>1,!0}return!1},e}($l),du=fu,gu=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)}}(),yu=function(t){function e(e){var r=this,n=e||{};return(r=t.call(this,{stopDown:ft})||this).condition_=n.condition?n.condition:eu,r.lastAngle_=void 0,r.duration_=void 0!==n.duration?n.duration:250,r}return gu(e,t),e.prototype.handleDragEvent=function(t){if(hu(t)){var e=t.map,r=e.getView();if(r.getConstraints().rotation!==Js){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!hu(t)||(t.map.getView().endInteraction(this.duration_),!1)},e.prototype.handleDownEvent=function(t){return!!hu(t)&&(!(!iu(t)||!this.condition_(t))&&(t.map.getView().beginInteraction(),this.lastAngle_=void 0,!0))},e}($l),vu=yu,_u=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)}}(),mu=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 _u(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 mo([r])},e.prototype.getGeometry=function(){return this.geometry_},e}(ot),xu=mu,wu=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)}}(),bu="boxstart",Su="boxdrag",Cu="boxend",Eu="boxcancel",Tu=function(t){function e(e,r,n){var i=t.call(this,e)||this;return i.coordinate=r,i.mapBrowserEvent=n,i}return wu(e,t),e}(nt),Pu=function(t){function e(e){var r=t.call(this)||this;r.on,r.once,r.un;var n=e||{};return r.box_=new xu(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:iu,r.boxEndCondition_=n.boxEndCondition?n.boxEndCondition:r.defaultBoxEndCondition,r}return wu(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 Tu(Su,t.coordinate,t))},e.prototype.handleUpEvent=function(t){this.box_.setMap(null);var e=this.boxEndCondition_(t,this.startPixel_,t.pixel);return e&&this.onBoxEnd(t),this.dispatchEvent(new Tu(e?Cu:Eu,t.coordinate,t)),!1},e.prototype.handleDownEvent=function(t){return!!this.condition_(t)&&(this.startPixel_=t.pixel,this.box_.setMap(t.map),this.box_.setPixels(this.startPixel_,this.startPixel_),this.dispatchEvent(new Tu(bu,t.coordinate,t)),!0)},e.prototype.onBoxEnd=function(t){},e}($l),Ru=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)}}(),Ou=function(t){function e(e){var r=this,n=e||{},i=n.condition?n.condition:lu;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 Ru(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:tl})},e}(Pu),Fu=37,Mu=38,Iu=39,Lu=40,Au=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)}}(),ku=function(t){function e(e){var r=t.call(this)||this,n=e||{};return r.defaultCondition_=function(t){return su(t)&&uu(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 Au(e,t),e.prototype.handleEvent=function(t){var e=!1;if(t.type==Ot){var r=t.originalEvent,n=r.keyCode;if(this.condition_(t)&&(n==Lu||n==Fu||n==Iu||n==Mu)){var i=t.map.getView(),o=i.getResolution()*this.pixelDelta_,a=0,s=0;n==Lu?s=-o:n==Fu?a=-o:n==Iu?a=o:s=o;var l=[a,s];Pn(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:rl,center:t.getConstrainedCenter(i)})}}(i,l,this.duration_),r.preventDefault(),e=!0}}return!e},e}(Yl),Du=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)}}(),ju=function(t){function e(e){var r=t.call(this)||this,n=e||{};return r.condition_=n.condition?n.condition:uu,r.delta_=n.delta?n.delta:1,r.duration_=void 0!==n.duration?n.duration:100,r}return Du(e,t),e.prototype.handleEvent=function(t){var e=!1;if(t.type==Ot||t.type==Ft){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_;ql(i.getView(),o,void 0,this.duration_),r.preventDefault(),e=!0}}return!e},e}(Yl),Gu=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]<t)return!1;for(var r=e-3;r>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}(),zu=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)}}(),Nu="trackpad",Uu="wheel",Bu=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:nu;return r.condition_=n.onFocusOnly?tu(ru,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 zu(e,t),e.prototype.endInteraction_=function(){this.trackpadTimeoutId_=void 0;var t=this.getMap();t&&t.getView().endInteraction(void 0,this.lastDelta_?this.lastDelta_>0?1:-1:0,this.lastAnchor_)},e.prototype.handleEvent=function(t){if(!this.condition_(t))return!0;if(t.type!==At)return!0;var e,r=t.map,n=t.originalEvent;if(n.preventDefault(),this.useAnchor_&&(this.lastAnchor_=t.coordinate),t.type==At&&(e=n.deltaY,B&&n.deltaMode===WheelEvent.DOM_DELTA_PIXEL&&(e/=q),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?Nu:Uu);var o=r.getView();if(this.mode_===Nu&&!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=-m(this.totalDelta_,-this.maxDelta_*this.deltaPerZoom_,this.maxDelta_*this.deltaPerZoom_)/this.deltaPerZoom_;(e.getConstrainResolution()||this.constrainResolution_)&&(r=r?r>0?1:-1:0),ql(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}(Yl),Vu=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)}}(),Xu=function(t){function e(e){var r=this,n=e||{},i=n;return i.stopDown||(i.stopDown=ft),(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 Vu(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!==Js){var l=a.getViewport().getBoundingClientRect(),u=Ql(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}($l),Wu=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)}}(),qu=function(t){function e(e){var r=this,n=e||{},i=n;return i.stopDown||(i.stopDown=ft),(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 Wu(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(),h=Ql(this.targetPointers);h[0]-=u.left,h[1]-=u.top,this.anchor_=s.getCoordinateFromPixelInternal(h),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}($l),Yu=qu,Ku=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)}}(),Zu="addfeatures",Hu=function(t){function e(e,r,n,i){var o=t.call(this,e)||this;return o.features=n,o.file=r,o.projection=i,o}return Ku(e,t),e}(nt),Ju=function(t){function e(e){var r=this,n=e||{};(r=t.call(this,{handleEvent:pt})||this).on,r.once,r.un,r.readAsBuffer_=!1,r.formats_=[];for(var i=n.formatConstructors?n.formatConstructors:[],o=0,a=i.length;o<a;++o){var s=i[o];"function"==typeof s&&(s=new s),r.formats_.push(s),r.readAsBuffer_=r.readAsBuffer_||"arraybuffer"===s.getType()}return r.projection_=n.projection?Bn(n.projection):null,r.dropListenKeys_=null,r.source_=n.source||null,r.target=n.target?n.target:null,r}return Ku(e,t),e.prototype.handleResult_=function(t,e){var r,n=e.target.result,i=this.getMap(),o=this.projection_;o||(o=i.getView().getProjection());for(var a=this.formats_,s=0,l=a.length;s<l;++s){var u=a[s],h=n;this.readAsBuffer_&&"arraybuffer"!==u.getType()&&(void 0===r&&(r=(new TextDecoder).decode(n)),h=r);var c=this.tryReadFeatures_(u,h,{featureProjection:o});if(c&&c.length>0){this.source_&&(this.source_.clear(),this.source_.addFeatures(c)),this.dispatchEvent(new Hu(Zu,t,c,o));break}}},e.prototype.registerListeners_=function(){var t=this.getMap();if(t){var e=this.target?this.target:t.getViewport();this.dropListenKeys_=[kt(e,Rt,this.handleDrop,this),kt(e,Tt,this.handleStop,this),kt(e,Pt,this.handleStop,this),kt(e,Rt,this.handleStop,this)]}},e.prototype.setActive=function(e){!this.getActive()&&e&&this.registerListeners_(),this.getActive()&&!e&&this.unregisterListeners_(),t.prototype.setActive.call(this,e)},e.prototype.setMap=function(e){this.unregisterListeners_(),t.prototype.setMap.call(this,e),this.getActive()&&this.registerListeners_()},e.prototype.tryReadFeatures_=function(t,e,r){try{return t.readFeatures(e,r)}catch(t){return null}},e.prototype.unregisterListeners_=function(){this.dropListenKeys_&&(this.dropListenKeys_.forEach(jt),this.dropListenKeys_=null)},e.prototype.handleDrop=function(t){for(var e=t.dataTransfer.files,r=0,n=e.length;r<n;++r){var i=e.item(r),o=new FileReader;o.addEventListener(Mt,this.handleResult_.bind(this,i)),this.readAsBuffer_?o.readAsArrayBuffer(i):o.readAsText(i)}},e.prototype.handleStop=function(t){t.stopPropagation(),t.preventDefault(),t.dataTransfer.dropEffect="copy"},e}(Yl),Qu=Ju,$u=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)}}(),th=function(t){function e(e){var r=this,n=e||{};return(r=t.call(this,n)||this).condition_=n.condition?n.condition:lu,r.lastAngle_=void 0,r.lastMagnitude_=void 0,r.lastScaleDelta_=0,r.duration_=void 0!==n.duration?n.duration:400,r}return $u(e,t),e.prototype.handleDragEvent=function(t){if(hu(t)){var e=t.map,r=e.getSize(),n=t.pixel,i=n[0]-r[0]/2,o=r[1]/2-n[1],a=Math.atan2(o,i),s=Math.sqrt(i*i+o*o),l=e.getView();if(void 0!==this.lastAngle_){var u=this.lastAngle_-a;l.adjustRotationInternal(u)}this.lastAngle_=a,void 0!==this.lastMagnitude_&&l.adjustResolutionInternal(this.lastMagnitude_/s),void 0!==this.lastMagnitude_&&(this.lastScaleDelta_=this.lastMagnitude_/s),this.lastMagnitude_=s}},e.prototype.handleUpEvent=function(t){if(!hu(t))return!0;var e=t.map.getView(),r=this.lastScaleDelta_>1?1:-1;return e.endInteraction(this.duration_,r),this.lastScaleDelta_=0,!1},e.prototype.handleDownEvent=function(t){return!!hu(t)&&(!!this.condition_(t)&&(t.map.getView().beginInteraction(),this.lastAngle_=void 0,this.lastMagnitude_=void 0,!0))},e}($l),eh=th;function rh(t,e,r,n,i){nh(t,e,r||0,n||t.length-1,i||oh)}function nh(t,e,r,n,i){for(;n>r;){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);nh(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 h=t[e],c=r,p=n;for(ih(t,r,e),i(t[n],h)>0&&ih(t,r,n);c<p;){for(ih(t,c,p),c++,p--;i(t[c],h)<0;)c++;for(;i(t[p],h)>0;)p--}0===i(t[r],h)?ih(t,r,p):ih(t,++p,n),p<=e&&(r=p+1),e<=p&&(n=p-1)}}function ih(t,e,r){var n=t[e];t[e]=t[r],t[r]=n}function oh(t,e){return t<e?-1:t>e?1:0}class ah{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(!vh(t,e))return r;const n=this.toBBox,i=[];for(;e;){for(let o=0;o<e.children.length;o++){const a=e.children[o],s=e.leaf?n(a):a;vh(t,s)&&(e.leaf?r.push(a):yh(t,s)?this._all(a,r):i.push(a))}e=i.pop()}return r}collides(t){let e=this.data;if(!vh(t,e))return!1;const r=[];for(;e;){for(let n=0;n<e.children.length;n++){const i=e.children[n],o=e.leaf?this.toBBox(i):i;if(vh(t,o)){if(e.leaf||yh(t,o))return!0;r.push(i)}}e=r.pop()}return!1}load(t){if(!t||!t.length)return this;if(t.length<this._minEntries){for(let e=0;e<t.length;e++)this.insert(t[e]);return this}let e=this._build(t.slice(),0,t.length-1,0);if(this.data.children.length)if(this.data.height===e.height)this._splitRoot(this.data,e);else{if(this.data.height<e.height){const t=this.data;this.data=e,e=t}this._insert(e,this.data.height-e.height-1,!0)}else this.data=e;return this}insert(t){return t&&this._insert(t,this.data.height-1),this}clear(){return this.data=_h([]),this}remove(t,e){if(!t)return this;let r=this.data;const n=this.toBBox(t),i=[],o=[];let a,s,l;for(;r||i.length;){if(r||(r=i.pop(),s=i[i.length-1],a=o.pop(),l=!0),r.leaf){const n=sh(t,r.children,e);if(-1!==n)return r.children.splice(n,1),i.push(r),this._condense(i),this}l||r.leaf||!yh(r,n)?s?(a++,r=s.children[a],l=!1):r=null:(i.push(r),o.push(a),a=0,s=r,r=r.children[0])}return this}toBBox(t){return t}compareMinX(t,e){return t.minX-e.minX}compareMinY(t,e){return t.minY-e.minY}toJSON(){return this.data}fromJSON(t){return this.data=t,this}_all(t,e){const r=[];for(;t;)t.leaf?e.push(...t.children):r.push(...t.children),t=r.pop();return e}_build(t,e,r,n){const i=r-e+1;let o,a=this._maxEntries;if(i<=a)return o=_h(t.slice(e,r+1)),lh(o,this.toBBox),o;n||(n=Math.ceil(Math.log(i)/Math.log(a)),a=Math.ceil(i/Math.pow(a,n-1))),o=_h([]),o.leaf=!1,o.height=n;const s=Math.ceil(i/a),l=s*Math.ceil(Math.sqrt(a));mh(t,e,r,l,this.compareMinX);for(let i=e;i<=r;i+=l){const e=Math.min(i+l-1,r);mh(t,i,e,s,this.compareMinY);for(let r=i;r<=e;r+=s){const i=Math.min(r+s-1,e);o.children.push(this._build(t,r,i,n-1))}}return lh(o,this.toBBox),o}_chooseSubtree(t,e,r,n){for(;n.push(e),!e.leaf&&n.length-1!==r;){let r,n=1/0,a=1/0;for(let s=0;s<e.children.length;s++){const l=e.children[s],u=fh(l),h=(i=t,o=l,(Math.max(o.maxX,i.maxX)-Math.min(o.minX,i.minX))*(Math.max(o.maxY,i.maxY)-Math.min(o.minY,i.minY))-u);h<a?(a=h,n=u<n?u:n,r=l):h===a&&u<n&&(n=u,r=l)}e=r||e.children[0]}var i,o;return e}_insert(t,e,r){const n=r?t:this.toBBox(t),i=[],o=this._chooseSubtree(n,this.data,e,i);for(o.children.push(t),hh(o,n);e>=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=_h(r.children.splice(o,r.children.length-o));a.height=r.height,a.leaf=r.leaf,lh(r,this.toBBox),lh(a,this.toBBox),e?t[e-1].children.push(a):this._splitRoot(r,a)}_splitRoot(t,e){this.data=_h([t,e]),this.data.height=t.height+1,this.data.leaf=!1,lh(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=uh(t,0,a,this.toBBox),s=uh(t,a,r,this.toBBox),l=gh(e,s),u=fh(e)+fh(s);l<i?(i=l,n=a,o=u<o?u:o):l===i&&u<o&&(o=u,n=a)}return n||r-e}_chooseSplitAxis(t,e,r){const n=t.leaf?this.compareMinX:ch,i=t.leaf?this.compareMinY:ph;this._allDistMargin(t,e,r,n)<this._allDistMargin(t,e,r,i)&&t.children.sort(n)}_allDistMargin(t,e,r,n){t.children.sort(n);const i=this.toBBox,o=uh(t,0,e,i),a=uh(t,r-e,r,i);let s=dh(o)+dh(a);for(let n=e;n<r-e;n++){const e=t.children[n];hh(o,t.leaf?i(e):e),s+=dh(o)}for(let n=r-e-1;n>=e;n--){const e=t.children[n];hh(a,t.leaf?i(e):e),s+=dh(a)}return s}_adjustParentBBoxes(t,e,r){for(let n=r;n>=0;n--)hh(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():lh(t[r],this.toBBox)}}function sh(t,e,r){if(!r)return e.indexOf(t);for(let n=0;n<e.length;n++)if(r(t,e[n]))return n;return-1}function lh(t,e){uh(t,0,t.children.length,e,t)}function uh(t,e,r,n,i){i||(i=_h(null)),i.minX=1/0,i.minY=1/0,i.maxX=-1/0,i.maxY=-1/0;for(let o=e;o<r;o++){const e=t.children[o];hh(i,t.leaf?n(e):e)}return i}function hh(t,e){return t.minX=Math.min(t.minX,e.minX),t.minY=Math.min(t.minY,e.minY),t.maxX=Math.max(t.maxX,e.maxX),t.maxY=Math.max(t.maxY,e.maxY),t}function ch(t,e){return t.minX-e.minX}function ph(t,e){return t.minY-e.minY}function fh(t){return(t.maxX-t.minX)*(t.maxY-t.minY)}function dh(t){return t.maxX-t.minX+(t.maxY-t.minY)}function gh(t,e){const r=Math.max(t.minX,e.minX),n=Math.max(t.minY,e.minY),i=Math.min(t.maxX,e.maxX),o=Math.min(t.maxY,e.maxY);return Math.max(0,i-r)*Math.max(0,o-n)}function yh(t,e){return t.minX<=e.minX&&t.minY<=e.minY&&e.maxX<=t.maxX&&e.maxY<=t.maxY}function vh(t,e){return e.minX<=t.maxX&&e.minY<=t.maxY&&e.maxX>=t.minX&&e.maxY>=t.minY}function _h(t){return{children:t,height:1,leaf:!0,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}}function mh(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;rh(t,a,e,r,i),o.push(e,a,a,r)}}var xh=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)}}(),wh="renderOrder",bh=function(t){function e(e){var r=this,n=e||{},i=gt({},n);return delete i.style,delete i.renderBuffer,delete i.updateWhileAnimating,delete i.updateWhileInteracting,(r=t.call(this,i)||this).declutter_=void 0!==n.declutter&&n.declutter,r.renderBuffer_=void 0!==n.renderBuffer?n.renderBuffer:100,r.style_=null,r.styleFunction_=void 0,r.setStyle(n.style),r.updateWhileAnimating_=void 0!==n.updateWhileAnimating&&n.updateWhileAnimating,r.updateWhileInteracting_=void 0!==n.updateWhileInteracting&&n.updateWhileInteracting,r}return xh(e,t),e.prototype.getDeclutter=function(){return this.declutter_},e.prototype.getFeatures=function(e){return t.prototype.getFeatures.call(this,e)},e.prototype.getRenderBuffer=function(){return this.renderBuffer_},e.prototype.getRenderOrder=function(){return this.get(wh)},e.prototype.getStyle=function(){return this.style_},e.prototype.getStyleFunction=function(){return this.styleFunction_},e.prototype.getUpdateWhileAnimating=function(){return this.updateWhileAnimating_},e.prototype.getUpdateWhileInteracting=function(){return this.updateWhileInteracting_},e.prototype.renderDeclutter=function(t){t.declutterTree||(t.declutterTree=new ah(9)),this.getRenderer().renderDeclutter(t)},e.prototype.setRenderOrder=function(t){this.set(wh,t)},e.prototype.setStyle=function(t){this.style_=void 0!==t?t:Lo,this.styleFunction_=null===t?void 0:function(t){var e;if("function"==typeof t)e=t;else{var r;Array.isArray(t)?r=t:(_("function"==typeof t.getZIndex,41),r=[t]),e=function(){return r}}return e}(this.style_),this.changed()},e}(Ya),Sh={BEGIN_GEOMETRY:0,BEGIN_PATH:1,CIRCLE:2,CLOSE_PATH:3,CUSTOM:4,DRAW_CHARS:5,DRAW_IMAGE:6,END_GEOMETRY:7,FILL:8,MOVE_TO_LINE_TO:9,SET_FILL_STYLE:10,SET_STROKE_STYLE:11,STROKE:12},Ch=[Sh.FILL],Eh=[Sh.STROKE],Th=[Sh.BEGIN_PATH],Ph=[Sh.CLOSE_PATH],Rh=Sh,Oh=function(){function t(){}return t.prototype.drawCustom=function(t,e,r,n){},t.prototype.drawGeometry=function(t){},t.prototype.setStyle=function(t){},t.prototype.drawCircle=function(t,e){},t.prototype.drawFeature=function(t,e){},t.prototype.drawGeometryCollection=function(t,e){},t.prototype.drawLineString=function(t,e){},t.prototype.drawMultiLineString=function(t,e){},t.prototype.drawMultiPoint=function(t,e){},t.prototype.drawMultiPolygon=function(t,e){},t.prototype.drawPoint=function(t,e){},t.prototype.drawPolygon=function(t,e){},t.prototype.drawText=function(t,e){},t.prototype.setFillStrokeStyle=function(t,e){},t.prototype.setImageStyle=function(t,e){},t.prototype.setTextStyle=function(t,e){},t}(),Fh=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(e,r,n,i){var o=t.call(this)||this;return o.tolerance=e,o.maxExtent=r,o.pixelRatio=i,o.maxLineWidth=0,o.resolution=n,o.beginGeometryInstruction1_=null,o.beginGeometryInstruction2_=null,o.bufferedMaxExtent_=null,o.instructions=[],o.coordinates=[],o.tmpCoordinate_=[],o.hitDetectionInstructions=[],o.state={},o}return Fh(e,t),e.prototype.applyPixelRatio=function(t){var e=this.pixelRatio;return 1==e?t:t.map((function(t){return t*e}))},e.prototype.appendFlatPointCoordinates=function(t,e){for(var r=this.getBufferedMaxExtent(),n=this.tmpCoordinate_,i=this.coordinates,o=i.length,a=0,s=t.length;a<s;a+=e)n[0]=t[a],n[1]=t[a+1],Ze(r,n)&&(i[o++]=n[0],i[o++]=n[1]);return o},e.prototype.appendFlatLineCoordinates=function(t,e,r,n,i,o){var a=this.coordinates,s=a.length,l=this.getBufferedMaxExtent();o&&(e+=n);var u,h,c,p=t[e],f=t[e+1],d=this.tmpCoordinate_,g=!0;for(u=e+n;u<r;u+=n)d[0]=t[u],d[1]=t[u+1],(c=Qe(l,d))!==h?(g&&(a[s++]=p,a[s++]=f,g=!1),a[s++]=d[0],a[s++]=d[1]):c===Ne?(a[s++]=d[0],a[s++]=d[1],g=!1):g=!0,p=d[0],f=d[1],h=c;return(i&&g||u===e+n)&&(a[s++]=p,a[s++]=f),s},e.prototype.drawCustomCoordinates_=function(t,e,r,n,i){for(var o=0,a=r.length;o<a;++o){var s=r[o],l=this.appendFlatLineCoordinates(t,e,s,n,!1,!1);i.push(l),e=s}return e},e.prototype.drawCustom=function(t,e,r,n){this.beginGeometry(t,e);var i,o,a,s,l,u=t.getType(),h=t.getStride(),c=this.coordinates.length;switch(u){case"MultiPolygon":i=t.getOrientedFlatCoordinates(),s=[];var p=t.getEndss();l=0;for(var f=0,d=p.length;f<d;++f){var g=[];l=this.drawCustomCoordinates_(i,l,p[f],h,g),s.push(g)}this.instructions.push([Rh.CUSTOM,c,s,t,r,ki]),this.hitDetectionInstructions.push([Rh.CUSTOM,c,s,t,n||r,ki]);break;case"Polygon":case"MultiLineString":a=[],i="Polygon"==u?t.getOrientedFlatCoordinates():t.getFlatCoordinates(),l=this.drawCustomCoordinates_(i,0,t.getEnds(),h,a),this.instructions.push([Rh.CUSTOM,c,a,t,r,Ai]),this.hitDetectionInstructions.push([Rh.CUSTOM,c,a,t,n||r,Ai]);break;case"LineString":case"Circle":i=t.getFlatCoordinates(),o=this.appendFlatLineCoordinates(i,0,i.length,h,!1,!1),this.instructions.push([Rh.CUSTOM,c,o,t,r,Li]),this.hitDetectionInstructions.push([Rh.CUSTOM,c,o,t,n||r,Li]);break;case"MultiPoint":i=t.getFlatCoordinates(),(o=this.appendFlatPointCoordinates(i,h))>c&&(this.instructions.push([Rh.CUSTOM,c,o,t,r,Li]),this.hitDetectionInstructions.push([Rh.CUSTOM,c,o,t,n||r,Li]));break;case"Point":i=t.getFlatCoordinates(),this.coordinates.push(i[0],i[1]),o=this.coordinates.length,this.instructions.push([Rh.CUSTOM,c,o,t,r]),this.hitDetectionInstructions.push([Rh.CUSTOM,c,o,t,n||r])}this.endGeometry(e)},e.prototype.beginGeometry=function(t,e){this.beginGeometryInstruction1_=[Rh.BEGIN_GEOMETRY,e,0,t],this.instructions.push(this.beginGeometryInstruction1_),this.beginGeometryInstruction2_=[Rh.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,n,i=e.length,o=-1;for(t=0;t<i;++t)(n=(r=e[t])[0])==Rh.END_GEOMETRY?o=t:n==Rh.BEGIN_GEOMETRY&&(r[2]=t,ut(this.hitDetectionInstructions,o,t),o=-1)},e.prototype.setFillStrokeStyle=function(t,e){var r=this.state;if(t){var n=t.getColor();r.fillStyle=N(n||ee)}else r.fillStyle=void 0;if(e){var i=e.getColor();r.strokeStyle=N(i||oe);var o=e.getLineCap();r.lineCap=void 0!==o?o:re;var a=e.getLineDash();r.lineDash=a?a.slice():ne;var s=e.getLineDashOffset();r.lineDashOffset=s||0;var l=e.getLineJoin();r.lineJoin=void 0!==l?l:ie;var u=e.getWidth();r.lineWidth=void 0!==u?u:1;var h=e.getMiterLimit();r.miterLimit=void 0!==h?h:10,r.lineWidth>this.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=[Rh.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[Rh.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,o=t.lineDashOffset,a=t.lineJoin,s=t.lineWidth,l=t.miterLimit;(t.currentStrokeStyle!=r||t.currentLineCap!=n||i!=t.currentLineDash&&!ct(t.currentLineDash,i)||t.currentLineDashOffset!=o||t.currentLineJoin!=a||t.currentLineWidth!=s||t.currentMiterLimit!=l)&&(void 0!==r&&e.call(this,t),t.currentStrokeStyle=r,t.currentLineCap=n,t.currentLineDash=i,t.currentLineDashOffset=o,t.currentLineJoin=a,t.currentLineWidth=s,t.currentMiterLimit=l)},e.prototype.endGeometry=function(t){this.beginGeometryInstruction1_[2]=this.instructions.length,this.beginGeometryInstruction1_=null,this.beginGeometryInstruction2_[2]=this.hitDetectionInstructions.length,this.beginGeometryInstruction2_=null;var e=[Rh.END_GEOMETRY,t];this.instructions.push(e),this.hitDetectionInstructions.push(e)},e.prototype.getBufferedMaxExtent=function(){if(!this.bufferedMaxExtent_&&(this.bufferedMaxExtent_=Ye(this.maxExtent),this.maxLineWidth>0)){var t=this.resolution*(this.maxLineWidth+1)/2;qe(this.bufferedMaxExtent_,t,this.bufferedMaxExtent_)}return this.bufferedMaxExtent_},e}(Oh),Ih=Mh,Lh=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)}}(),Ah=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.declutterMode_=void 0,o.declutterImageWithText_=void 0,o}return Lh(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([Rh.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.imagePixelRatio_,this.originY_*this.imagePixelRatio_,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.declutterMode_,this.declutterImageWithText_]),this.hitDetectionInstructions.push([Rh.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.declutterMode_,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([Rh.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.imagePixelRatio_,this.originY_*this.imagePixelRatio_,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.declutterMode_,this.declutterImageWithText_]),this.hitDetectionInstructions.push([Rh.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.declutterMode_,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.getOrigin();this.imagePixelRatio_=t.getPixelRatio(this.pixelRatio),this.anchorX_=r[0],this.anchorY_=r[1],this.hitDetectionImage_=t.getHitDetectionImage(),this.image_=t.getImage(this.pixelRatio),this.height_=n[1],this.opacity_=t.getOpacity(),this.originX_=i[0],this.originY_=i[1],this.rotateWithView_=t.getRotateWithView(),this.rotation_=t.getRotation(),this.scale_=t.getScaleArray(),this.width_=n[0],this.declutterMode_=t.getDeclutterMode(),this.declutterImageWithText_=e},e}(Ih),kh=Ah,Dh=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)}}(),jh=function(t){function e(e,r,n,i){return t.call(this,e,r,n,i)||this}return Dh(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=[Rh.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([Rh.SET_STROKE_STYLE,r.strokeStyle,r.lineWidth,r.lineCap,r.lineJoin,r.miterLimit,ne,0],Th);var o=t.getFlatCoordinates(),a=t.getStride();this.drawFlatCoordinates_(o,0,o.length,a),this.hitDetectionInstructions.push(Eh),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([Rh.SET_STROKE_STYLE,r.strokeStyle,r.lineWidth,r.lineCap,r.lineJoin,r.miterLimit,r.lineDash,r.lineDashOffset],Th);for(var o=t.getEnds(),a=t.getFlatCoordinates(),s=t.getStride(),l=0,u=0,h=o.length;u<h;++u)l=this.drawFlatCoordinates_(a,l,o[u],s);this.hitDetectionInstructions.push(Eh),this.endGeometry(e)}},e.prototype.finish=function(){var e=this.state;return null!=e.lastStroke&&e.lastStroke!=this.coordinates.length&&this.instructions.push(Eh),this.reverseHitDetectionInstructions(),this.state=null,t.prototype.finish.call(this)},e.prototype.applyStroke=function(e){null!=e.lastStroke&&e.lastStroke!=this.coordinates.length&&(this.instructions.push(Eh),e.lastStroke=this.coordinates.length),e.lastStroke=0,t.prototype.applyStroke.call(this,e),this.instructions.push(Th)},e}(Ih),Gh=jh,zh=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)}}(),Nh=function(t){function e(e,r,n,i){return t.call(this,e,r,n,i)||this}return zh(e,t),e.prototype.drawFlatCoordinatess_=function(t,e,r,n){var i=this.state,o=void 0!==i.fillStyle,a=void 0!==i.strokeStyle,s=r.length;this.instructions.push(Th),this.hitDetectionInstructions.push(Th);for(var l=0;l<s;++l){var u=r[l],h=this.coordinates.length,c=this.appendFlatLineCoordinates(t,e,u,n,!0,!a),p=[Rh.MOVE_TO_LINE_TO,h,c];this.instructions.push(p),this.hitDetectionInstructions.push(p),a&&(this.instructions.push(Ph),this.hitDetectionInstructions.push(Ph)),e=u}return o&&(this.instructions.push(Ch),this.hitDetectionInstructions.push(Ch)),a&&(this.instructions.push(Eh),this.hitDetectionInstructions.push(Eh)),e},e.prototype.drawCircle=function(t,e){var r=this.state,n=r.fillStyle,i=r.strokeStyle;if(void 0!==n||void 0!==i){this.setFillStrokeStyles_(),this.beginGeometry(t,e),void 0!==r.fillStyle&&this.hitDetectionInstructions.push([Rh.SET_FILL_STYLE,ee]),void 0!==r.strokeStyle&&this.hitDetectionInstructions.push([Rh.SET_STROKE_STYLE,r.strokeStyle,r.lineWidth,r.lineCap,r.lineJoin,r.miterLimit,r.lineDash,r.lineDashOffset]);var o=t.getFlatCoordinates(),a=t.getStride(),s=this.coordinates.length;this.appendFlatLineCoordinates(o,0,o.length,a,!1,!1);var l=[Rh.CIRCLE,s];this.instructions.push(Th,l),this.hitDetectionInstructions.push(Th,l),void 0!==r.fillStyle&&(this.instructions.push(Ch),this.hitDetectionInstructions.push(Ch)),void 0!==r.strokeStyle&&(this.instructions.push(Eh),this.hitDetectionInstructions.push(Eh)),this.endGeometry(e)}},e.prototype.drawPolygon=function(t,e){var r=this.state,n=r.fillStyle,i=r.strokeStyle;if(void 0!==n||void 0!==i){this.setFillStrokeStyles_(),this.beginGeometry(t,e),void 0!==r.fillStyle&&this.hitDetectionInstructions.push([Rh.SET_FILL_STYLE,ee]),void 0!==r.strokeStyle&&this.hitDetectionInstructions.push([Rh.SET_STROKE_STYLE,r.strokeStyle,r.lineWidth,r.lineCap,r.lineJoin,r.miterLimit,r.lineDash,r.lineDashOffset]);var o=t.getEnds(),a=t.getOrientedFlatCoordinates(),s=t.getStride();this.drawFlatCoordinatess_(a,0,o,s),this.endGeometry(e)}},e.prototype.drawMultiPolygon=function(t,e){var r=this.state,n=r.fillStyle,i=r.strokeStyle;if(void 0!==n||void 0!==i){this.setFillStrokeStyles_(),this.beginGeometry(t,e),void 0!==r.fillStyle&&this.hitDetectionInstructions.push([Rh.SET_FILL_STYLE,ee]),void 0!==r.strokeStyle&&this.hitDetectionInstructions.push([Rh.SET_STROKE_STYLE,r.strokeStyle,r.lineWidth,r.lineCap,r.lineJoin,r.miterLimit,r.lineDash,r.lineDashOffset]);for(var o=t.getEndss(),a=t.getOrientedFlatCoordinates(),s=t.getStride(),l=0,u=0,h=o.length;u<h;++u)l=this.drawFlatCoordinatess_(a,l,o[u],s);this.endGeometry(e)}},e.prototype.finish=function(){this.reverseHitDetectionInstructions(),this.state=null;var e=this.tolerance;if(0!==e)for(var r=this.coordinates,n=0,i=r.length;n<i;++n)r[n]=Fi(r[n],e);return t.prototype.finish.call(this)},e.prototype.setFillStrokeStyles_=function(){var t=this.state;void 0!==t.fillStyle&&this.updateFillStyle(t,this.createFill),void 0!==t.strokeStyle&&this.updateStrokeStyle(t,this.applyStroke)},e}(Ih),Uh=Nh;function Bh(t,e,r,n,i){var o,a,s,l,u,h,c,p,f,d=r,g=r,y=0,v=0,_=r;for(o=r;o<n;o+=i){var m=e[o],x=e[o+1];void 0!==l&&(p=m-l,f=x-u,s=Math.sqrt(p*p+f*f),void 0!==h&&(v+=a,Math.acos((h*p+c*f)/(a*s))>t&&(v>y&&(y=v,d=_,g=o),v=0,_=o-i)),a=s,h=p,c=f),l=m,u=x}return(v+=s)>y?[_,o]:[d,g]}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)}}(),Xh={left:0,end:0,center:.5,right:1,start:1,top:0,middle:.5,hanging:.2,alphabetic:.8,ideographic:.8,bottom:1},Wh=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 Vh(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!==Go||"LineString"!=s&&"MultiLineString"!=s&&"Polygon"!=s&&"MultiPolygon"!=s){var h=i.overflow?null:[];switch(s){case"Point":case"MultiPoint":l=t.getFlatCoordinates();break;case"LineString":l=t.getFlatMidpoint();break;case"Circle":l=t.getCenter();break;case"MultiLineString":l=t.getFlatMidpoints(),u=2;break;case"Polygon":l=t.getFlatInteriorPoint(),i.overflow||h.push(l[2]/this.resolution),u=3;break;case"MultiPolygon":var c=t.getFlatInteriorPoints();l=[];for(b=0,S=c.length;b<S;b+=3)i.overflow||h.push(c[b+2]/this.resolution),l.push(c[b],c[b+1]);if(0===l.length)return;u=2}if((F=this.appendFlatPointCoordinates(l,u))===a)return;if(h&&(F-a)/2!=l.length/u){var p=a/2;h=h.filter((function(t,e){var r=o[2*(p+e)]===l[e*u]&&o[2*(p+e)+1]===l[e*u+1];return r||--p,r}))}this.saveTextStates_(),(i.backgroundFill||i.backgroundStroke)&&(this.setFillStrokeStyle(i.backgroundFill,i.backgroundStroke),i.backgroundFill&&(this.updateFillStyle(this.state,this.createFill),this.hitDetectionInstructions.push(this.createFill(this.state))),i.backgroundStroke&&(this.updateStrokeStyle(this.state,this.applyStroke),this.hitDetectionInstructions.push(this.createStroke(this.state)))),this.beginGeometry(t,e);var f=i.padding;if(f!=le&&(i.scale[0]<0||i.scale[1]<0)){var d=i.padding[0],g=i.padding[1],y=i.padding[2],v=i.padding[3];i.scale[0]<0&&(g=-g,v=-v),i.scale[1]<0&&(d=-d,y=-y),f=[d,g,y,v]}var _=this.pixelRatio;this.instructions.push([Rh.DRAW_IMAGE,a,F,null,NaN,NaN,NaN,1,0,0,this.textRotateWithView_,this.textRotation_,[1,1],NaN,void 0,this.declutterImageWithText_,f==le?le:f.map((function(t){return t*_})),!!i.backgroundFill,!!i.backgroundStroke,this.text_,this.textKey_,this.strokeKey_,this.fillKey_,this.textOffsetX_,this.textOffsetY_,h]);var m=1/_;this.hitDetectionInstructions.push([Rh.DRAW_IMAGE,a,F,null,NaN,NaN,NaN,1,0,0,this.textRotateWithView_,this.textRotation_,[m,m],NaN,void 0,this.declutterImageWithText_,f,!!i.backgroundFill,!!i.backgroundStroke,this.text_,this.textKey_,this.strokeKey_,this.fillKey_,this.textOffsetX_,this.textOffsetY_,h]),this.endGeometry(e)}else{if(!br(this.getBufferedMaxExtent(),t.getExtent()))return;var x=void 0;if(l=t.getFlatCoordinates(),"LineString"==s)x=[l.length];else if("MultiLineString"==s)x=t.getEnds();else if("Polygon"==s)x=t.getEnds().slice(0,1);else if("MultiPolygon"==s){var w=t.getEndss();x=[];for(var b=0,S=w.length;b<S;++b)x.push(w[b][0])}this.beginGeometry(t,e);for(var C=i.textAlign,E=0,T=void 0,P=0,R=x.length;P<R;++P){if(null==C){var O=Bh(i.maxAngle,l,E,x[P],u);E=O[0],T=O[1]}else T=x[P];for(var b=E;b<T;b+=u)o.push(l[b],l[b+1]);var F=o.length;E=x[P],this.drawChars_(a,F),a=F}this.endGeometry(e)}}},e.prototype.saveTextStates_=function(){var t=this.textStrokeState_,e=this.textState_,r=this.textFillState_,n=this.strokeKey_;t&&(n in this.strokeStates||(this.strokeStates[n]={strokeStyle:t.strokeStyle,lineCap:t.lineCap,lineDashOffset:t.lineDashOffset,lineWidth:t.lineWidth,lineJoin:t.lineJoin,miterLimit:t.miterLimit,lineDash:t.lineDash}));var i=this.textKey_;i in this.textStates||(this.textStates[i]={font:e.font,textAlign:e.textAlign||ae,justify:e.justify,textBaseline:e.textBaseline||se,scale:e.scale});var o=this.fillKey_;r&&(o in this.fillStates||(this.fillStates[o]={fillStyle:r.fillStyle}))},e.prototype.drawChars_=function(t,e){var r=this.textStrokeState_,n=this.textState_,i=this.strokeKey_,o=this.textKey_,a=this.fillKey_;this.saveTextStates_();var s=this.pixelRatio,l=Xh[n.textBaseline],u=this.textOffsetY_*s,h=this.text_,c=r?r.lineWidth*Math.abs(n.scale[0])/2:0;this.instructions.push([Rh.DRAW_CHARS,t,e,l,n.overflow,a,n.maxAngle,s,u,i,c*s,h,o,1]),this.hitDetectionInstructions.push([Rh.DRAW_CHARS,t,e,l,n.overflow,a,n.maxAngle,1,u,i,c,h,o,1/s])},e.prototype.setTextStyle=function(t,e){var r,n,i;if(t){var o=t.getFill();o?((n=this.textFillState_)||(n={},this.textFillState_=n),n.fillStyle=N(o.getColor()||ee)):(n=null,this.textFillState_=n);var a=t.getStroke();if(a){(i=this.textStrokeState_)||(i={},this.textStrokeState_=i);var s=a.getLineDash(),u=a.getLineDashOffset(),h=a.getWidth(),c=a.getMiterLimit();i.lineCap=a.getLineCap()||re,i.lineDash=s?s.slice():ne,i.lineDashOffset=void 0===u?0:u,i.lineJoin=a.getLineJoin()||ie,i.lineWidth=void 0===h?1:h,i.miterLimit=void 0===c?10:c,i.strokeStyle=N(a.getColor()||oe)}else i=null,this.textStrokeState_=i;r=this.textState_;var p=t.getFont()||te;de(p);var f=t.getScaleArray();r.overflow=t.getOverflow(),r.font=p,r.maxAngle=t.getMaxAngle(),r.placement=t.getPlacement(),r.textAlign=t.getTextAlign(),r.justify=t.getJustify(),r.textBaseline=t.getTextBaseline()||se,r.backgroundFill=t.getBackgroundFill(),r.backgroundStroke=t.getBackgroundStroke(),r.padding=t.getPadding()||le,r.scale=void 0===f?[1,1]:f;var d=t.getOffsetX(),g=t.getOffsetY(),y=t.getRotateWithView(),v=t.getRotation();this.text_=t.getText()||"",this.textOffsetX_=void 0===d?0:d,this.textOffsetY_=void 0===g?0:g,this.textRotateWithView_=void 0!==y&&y,this.textRotation_=void 0===v?0:v,this.strokeKey_=i?("string"==typeof i.strokeStyle?i.strokeStyle:l(i.strokeStyle))+i.lineCap+i.lineDashOffset+"|"+i.lineWidth+i.lineJoin+i.miterLimit+"["+i.lineDash.join()+"]":"",this.textKey_=r.font+r.scale+(r.textAlign||"?")+(r.justify||"?")+(r.textBaseline||"?"),this.fillKey_=n?"string"==typeof n.fillStyle?n.fillStyle:"|"+l(n.fillStyle):""}else this.text_="";this.declutterImageWithText_=e},e}(Ih),qh={Circle:Uh,Default:Ih,Image:kh,LineString:Gh,Polygon:Uh,Text:Wh},Yh=function(){function t(t,e,r,n){this.tolerance_=t,this.maxExtent_=e,this.pixelRatio_=n,this.resolution_=r,this.buildersByZIndex_={}}return t.prototype.finish=function(){var t={};for(var e in this.buildersByZIndex_){t[e]=t[e]||{};var r=this.buildersByZIndex_[e];for(var n in r){var i=r[n].finish();t[e][n]=i}}return t},t.prototype.getBuilder=function(t,e){var r=void 0!==t?t.toString():"0",n=this.buildersByZIndex_[r];void 0===n&&(n={},this.buildersByZIndex_[r]=n);var i=n[e];void 0===i&&(i=new(0,qh[e])(this.tolerance_,this.maxExtent_,this.resolution_,this.pixelRatio_),n[e]=i);return i},t}(),Kh=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 r(e){var r=t.call(this)||this;return r.ready=!0,r.boundHandleImageChange_=r.handleImageChange_.bind(r),r.layer_=e,r.declutterExecutorGroup=null,r}return Kh(r,t),r.prototype.getFeatures=function(t){return a()},r.prototype.getData=function(t){return null},r.prototype.prepareFrame=function(t){return a()},r.prototype.renderFrame=function(t,e){return a()},r.prototype.loadedTileCallback=function(t,e,r){t[e]||(t[e]={}),t[e][r.tileCoord.toString()]=r},r.prototype.createLoadedTileFinder=function(t,e,r){return function(n,i){var o=this.loadedTileCallback.bind(this,r,n);return t.forEachLoadedTile(e,n,i,o)}.bind(this)},r.prototype.forEachFeatureAtCoordinate=function(t,e,r,n,i){},r.prototype.getDataAtPixel=function(t,e,r){return null},r.prototype.getLayer=function(){return this.layer_},r.prototype.handleFontsChanged=function(){},r.prototype.handleImageChange_=function(t){t.target.getState()===n&&this.renderIfReadyAndVisible()},r.prototype.loadImage=function(t){var r=t.getState();return r!=n&&r!=i&&t.addEventListener(wt,this.boundHandleImageChange_),r==e&&(t.load(),r=t.getState()),r==n},r.prototype.renderIfReadyAndVisible=function(){var t=this.getLayer();t&&t.getVisible()&&"ready"===t.getSourceState()&&t.changed()},r.prototype.disposeInternal=function(){delete this.layer_,t.prototype.disposeInternal.call(this)},r}(Ut),Hh=Zh,Jh=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=[],$h=null;var tc=function(t){function e(e){var r=t.call(this,e)||this;return r.container=null,r.renderedResolution,r.tempTransform=[1,0,0,1,0,0],r.pixelTransform=[1,0,0,1,0,0],r.inversePixelTransform=[1,0,0,1,0,0],r.context=null,r.containerReused=!1,r.pixelContext_=null,r.frameState=null,r}return Jh(e,t),e.prototype.getImageData=function(t,e,r){var n,i;$h||((n=document.createElement("canvas")).width=1,n.height=1,$h=n.getContext("2d")),$h.clearRect(0,0,1,1);try{$h.drawImage(t,e,r,1,1,0,0,1,1),i=$h.getImageData(0,0,1,1).data}catch(t){return $h=null,null}return i},e.prototype.getBackground=function(t){var e=this.getLayer().getBackground();return"function"==typeof e&&(e=e(t.viewState.resolution)),e||void 0},e.prototype.useContainer=function(t,e,r){var n,i,o=this.getLayer().getClassName();t&&t.className===o&&(!r||t&&t.style.backgroundColor&&ct(j(t.style.backgroundColor),j(r)))&&((s=t.firstElementChild)instanceof HTMLCanvasElement&&(i=s.getContext("2d")));if(i&&i.canvas.style.transform===e?(this.container=t,this.context=i,this.containerReused=!0):this.containerReused&&(this.container=null,this.context=null,this.containerReused=!1),!this.container){(n=document.createElement("div")).className=o;var a=n.style;a.position="absolute",a.width="100%",a.height="100%";var s=(i=H()).canvas;n.appendChild(s),(a=s.style).position="absolute",a.left="0",a.transformOrigin="top left",this.container=n,this.context=i}this.containerReused||!r||this.container.style.backgroundColor||(this.container.style.backgroundColor=r)},e.prototype.clipUnrotated=function(t,e,r){var n=mr(r),i=xr(r),o=pr(r),a=cr(r);Hr(e.coordinateToPixelTransform,n),Hr(e.coordinateToPixelTransform,i),Hr(e.coordinateToPixelTransform,o),Hr(e.coordinateToPixelTransform,a);var s=this.inversePixelTransform;Hr(s,n),Hr(s,i),Hr(s,o),Hr(s,a),t.save(),t.beginPath(),t.moveTo(Math.round(n[0]),Math.round(n[1])),t.lineTo(Math.round(i[0]),Math.round(i[1])),t.lineTo(Math.round(o[0]),Math.round(o[1])),t.lineTo(Math.round(a[0]),Math.round(a[1])),t.clip()},e.prototype.dispatchRenderEvent_=function(t,e,r){var n=this.getLayer();if(n.hasListener(t)){var i=new $a(t,this.inversePixelTransform,r,e);n.dispatchEvent(i)}},e.prototype.preRender=function(t,e){this.frameState=e,this.dispatchRenderEvent_(za,t,e)},e.prototype.postRender=function(t,e){this.dispatchRenderEvent_(Na,t,e)},e.prototype.getRenderTransform=function(t,e,r,n,i,o,a){var s=i/2,l=o/2,u=n/e,h=-u,c=-t[0]+a,p=-t[1];return tn(this.tempTransform,s,l,u,h,-r,c,p)},e.prototype.getDataAtPixel=function(t,e,r){var n=Hr(this.inversePixelTransform,t.slice()),i=this.context,o=this.getLayer().getExtent();if(o&&!Ze(o,Hr(e.pixelToCoordinateTransform,t.slice())))return null;var a,s=Math.round(n[0]),l=Math.round(n[1]),u=this.pixelContext_;if(!u){var h=document.createElement("canvas");h.width=1,h.height=1,u=h.getContext("2d"),this.pixelContext_=u}u.clearRect(0,0,1,1);try{u.drawImage(i.canvas,s,l,1,1,0,0,1,1),a=u.getImageData(0,0,1,1).data}catch(t){return"SecurityError"===t.name?(this.pixelContext_=null,new Uint8Array):a}return 0===a[3]?null:a},e.prototype.disposeInternal=function(){delete this.frameState,t.prototype.disposeInternal.call(this)},e}(Hh),ec=tc;function rc(t,e,r,n,i,o,a,s,l,u,h,c){var p=t[e],f=t[e+1],d=0,g=0,y=0,v=0;function _(){d=p,g=f,p=t[e+=n],f=t[e+1],v+=y,y=Math.sqrt((p-d)*(p-d)+(f-g)*(f-g))}do{_()}while(e<r-n&&v+y<o);for(var m=0===y?0:(o-v)/y,x=P(d,p,m),w=P(g,f,m),b=e-n,S=v,C=o+s*l(u,i,h);e<r-n&&v+y<C;)_();var E,T=P(d,p,m=0===y?0:(C-v)/y),R=P(g,f,m);if(c){var O=[x,w,T,R];oi(O,0,4,2,c,O,O),E=O[0]>O[2]}else E=x>T;var F,M=Math.PI,I=[],L=b+n===e;if(y=0,v=S,p=t[e=b],f=t[e+1],L){_(),F=Math.atan2(f-g,p-d),E&&(F+=F>0?-M:M);var A=(T+x)/2,k=(R+w)/2;return I[0]=[A,k,(C-o)/2,F,i],I}for(var D=0,j=(i=i.replace(/\n/g," ")).length;D<j;){_();var G=Math.atan2(f-g,p-d);if(E&&(G+=G>0?-M:M),void 0!==F){var z=G-F;if(z+=z>M?-2*M:z<-M?2*M:0,Math.abs(z)>a)return null}F=G;for(var N=D,U=0;D<j;++D){var B=s*l(u,i[E?j-D-1:D],h);if(e+n<r&&v+y<o+U+B/2)break;U+=B}if(D!==N){var V=E?i.substring(j-N,j-D):i.substring(N,D);A=P(d,p,m=0===y?0:(o+U/2-v)/y),k=P(g,f,m);I.push([A,k,U/2,G,V]),o+=U}}return I}var nc=[1/0,1/0,-1/0,-1/0],ic=[],oc=[],ac=[],sc=[];function lc(t){return t[3].declutterBox}var uc=new RegExp("["+String.fromCharCode(1425)+"-"+String.fromCharCode(2303)+String.fromCharCode(64285)+"-"+String.fromCharCode(65023)+String.fromCharCode(65136)+"-"+String.fromCharCode(65276)+String.fromCharCode(67584)+"-"+String.fromCharCode(69631)+String.fromCharCode(124928)+"-"+String.fromCharCode(126975)+"]");function hc(t,e){return"start"!==e&&"end"!==e||uc.test(t)||(e="start"===e?"left":"right"),Xh[e]}function cc(t,e,r){return r>0&&t.push("\n",""),t.push(e,""),t}var pc=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],h=Array.isArray(t),c=s.justify?Xh[s.justify]:hc(Array.isArray(t)?t[0]:t,s.textAlign||ae),p=n&&o.lineWidth?o.lineWidth:0,f=h?t:t.split("\n").reduce(cc,[]),d=function(t,e){for(var r=[],n=[],i=[],o=0,a=0,s=0,l=0,u=0,h=e.length;u<=h;u+=2){var c=e[u];if("\n"!==c&&u!==h){var p=e[u+1]||t.font,f=ve(p,c);r.push(f),a+=f;var d=ge(p);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),g=d.width,y=d.height,v=d.widths,_=d.heights,m=d.lineWidths,x=g+p,w=[],b=(x+2)*u[0],S=(y+p)*u[1],C={width:b<0?Math.floor(b):Math.ceil(b),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",p),w.push("lineCap",o.lineCap),w.push("lineJoin",o.lineJoin),w.push("miterLimit",o.miterLimit),(Y?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,T=.5-c,P=c*x+T*p,R=[],O=[],F=0,M=0,I=0,L=0,A=0,k=f.length;A<k;A+=2){var D=f[A];if("\n"!==D){var j=f[A+1]||s.font;j!==E&&(n&&R.push("font",j),r&&O.push("font",j),E=j),F=Math.max(F,_[I]);var G=[D,P+T*v[I]+c*(v[I]-m[L]),.5*(p+F)+M];P+=v[I],n&&R.push("strokeText",G),r&&O.push("fillText",G),++I}else M+=F,F=0,P=c*x+T*p,++L}return Array.prototype.push.apply(w,R),Array.prototype.push.apply(w,O),this.labels_[i]=C,C},t.prototype.replayTextBackground_=function(t,e,r,n,i,o,a){t.beginPath(),t.moveTo.apply(t,e),t.lineTo.apply(t,r),t.lineTo.apply(t,n),t.lineTo.apply(t,i),t.lineTo.apply(t,e),o&&(this.alignFill_=o[2],this.fill_(t)),a&&(this.setStrokeStyle_(t,a),t.stroke())},t.prototype.calculateImageOrLabelDimensions_=function(t,e,r,n,i,o,a,s,l,u,h,c,p,f,d,g){var y,v=r-(a*=c[0]),_=n-(s*=c[1]),m=i+l>t?t-l:i,x=o+u>e?e-u:o,w=f[3]+m*c[0]+f[1],b=f[0]+x*c[1]+f[2],S=v-f[3],C=_-f[0];return(d||0!==h)&&(ic[0]=S,sc[0]=S,ic[1]=C,oc[1]=C,oc[0]=S+w,ac[0]=oc[0],ac[1]=C+b,sc[1]=ac[1]),0!==h?(Hr(y=tn([1,0,0,1,0,0],r,n,1,1,h,-r,-n),ic),Hr(y,oc),Hr(y,ac),Hr(y,sc),tr(Math.min(ic[0],oc[0],ac[0],sc[0]),Math.min(ic[1],oc[1],ac[1],sc[1]),Math.max(ic[0],oc[0],ac[0],sc[0]),Math.max(ic[1],oc[1],ac[1],sc[1]),nc)):tr(Math.min(S,S+w),Math.min(C,C+b),Math.max(S,S+w),Math.max(C,C+b),nc),p&&(v=Math.round(v),_=Math.round(_)),{drawImageX:v,drawImageY:_,drawImageW:m,drawImageH:x,originX:l,originY:u,declutterBox:{minX:nc[0],minY:nc[1],maxX:nc[2],maxY:nc[3],value:g},canvasTransform:y,scale:c}},t.prototype.replayImageOrLabel_=function(t,e,r,n,i,o,a){var s=!(!o&&!a),l=n.declutterBox,u=t.canvas,h=a?a[2]*n.scale[0]/2:0;return l.minX-h<=u.width/e&&l.maxX+h>=0&&l.minY-h<=u.height/e&&l.maxY+h>=0&&(s&&this.replayTextBackground_(t,ic,oc,ac,sc,o,a),me(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=Hr(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=hc(Array.isArray(t)?t[0]:t,i.textAlign||ae),u=Xh[i.textBaseline||se],h=a&&a.lineWidth?a.lineWidth:0;return{label:o,anchorX:l*(o.width/s-2*i.scale[0])+2*(.5-l)*h,anchorY:u*o.height/s+2*(.5-u)*h}},t.prototype.execute_=function(t,e,r,n,i,o,a,s){var l,u,h;this.pixelCoordinates_&&ct(r,this.renderedTransform_)?l=this.pixelCoordinates_:(this.pixelCoordinates_||(this.pixelCoordinates_=[]),l=ii(this.coordinates,0,this.coordinates.length,2,r,this.pixelCoordinates_),u=this.renderedTransform_,h=r,u[0]=h[0],u[1]=h[1],u[2]=h[2],u[3]=h[3],u[4]=h[4],u[5]=h[5]);for(var c,p,f,d,g,y,v,_,m,x,w,b,S,C,E,T,P=0,R=n.length,O=0,F=0,M=0,I=null,L=null,A=this.coordinateCache_,k=this.viewRotation_,D=Math.round(1e12*Math.atan2(-r[1],r[0]))/1e12,j={context:t,pixelRatio:this.pixelRatio,resolution:this.resolution,rotation:k},G=this.instructions!=n||this.overlaps?0:200;P<R;){var z=n[P];switch(z[0]){case Rh.BEGIN_GEOMETRY:S=z[1],T=z[3],S.getGeometry()?void 0===a||br(a,T.getExtent())?++P:P=z[2]+1:P=z[2];break;case Rh.BEGIN_PATH:F>G&&(this.fill_(t),F=0),M>G&&(t.stroke(),M=0),F||M||(t.beginPath(),d=NaN,g=NaN),++P;break;case Rh.CIRCLE:var N=l[O=z[1]],U=l[O+1],B=l[O+2]-N,V=l[O+3]-U,X=Math.sqrt(B*B+V*V);t.moveTo(N+X,U),t.arc(N,U,X,0,2*Math.PI,!0),++P;break;case Rh.CLOSE_PATH:t.closePath(),++P;break;case Rh.CUSTOM:O=z[1],c=z[2];var W=z[3],q=z[4],Y=6==z.length?z[5]:void 0;j.geometry=W,j.feature=S,P in A||(A[P]=[]);var K=A[P];Y?Y(l,O,c,2,K):(K[0]=l[O],K[1]=l[O+1],K.length=2),q(K,j),++P;break;case Rh.DRAW_IMAGE:O=z[1],c=z[2],_=z[3],p=z[4],f=z[5];var Z=z[6],H=z[7],J=z[8],Q=z[9],$=z[10],tt=z[11],et=z[12],rt=z[13],nt=z[14],it=z[15];if(!_&&z.length>=20){m=z[19],x=z[20],w=z[21],b=z[22];var ot=this.drawLabelWithPointPlacement_(m,x,w,b);_=ot.label,z[3]=_;var at=z[23];p=(ot.anchorX-at)*this.pixelRatio,z[4]=p;var st=z[24];f=(ot.anchorY-st)*this.pixelRatio,z[5]=f,Z=_.height,z[6]=Z,rt=_.width,z[13]=rt}var lt=void 0;z.length>25&&(lt=z[25]);var ut=void 0,ht=void 0,pt=void 0;z.length>17?(ut=z[16],ht=z[17],pt=z[18]):(ut=le,ht=!1,pt=!1),$&&D?tt+=k:$||D||(tt-=k);for(var ft=0;O<c;O+=2)if(!(lt&&lt[ft++]<rt/this.pixelRatio)){var dt=[t,e,_,Ut=this.calculateImageOrLabelDimensions_(_.width,_.height,l[O],l[O+1],rt,Z,p,f,J,Q,tt,et,i,ut,ht||pt,S),H,ht?I:null,pt?L:null];if(s){if("none"===nt)continue;if("obstacle"===nt){s.insert(Ut.declutterBox);continue}var gt=void 0,yt=void 0;if(it){var vt=c-O;if(!it[vt]){it[vt]=dt;continue}if(gt=it[vt],delete it[vt],yt=lc(gt),s.collides(yt))continue}if(s.collides(Ut.declutterBox))continue;gt&&(s.insert(yt),this.replayImageOrLabel_.apply(this,gt)),s.insert(Ut.declutterBox)}this.replayImageOrLabel_.apply(this,dt)}++P;break;case Rh.DRAW_CHARS:var _t=z[1],mt=z[2],xt=z[3],wt=z[4];b=z[5];var bt=z[6],St=z[7],Ct=z[8];w=z[9];var Et=z[10];m=z[11],x=z[12];var Tt=[z[13],z[13]],Pt=this.textStates[x],Rt=Pt.font,Ot=[Pt.scale[0]*St,Pt.scale[1]*St],Ft=void 0;Rt in this.widths_?Ft=this.widths_[Rt]:(Ft={},this.widths_[Rt]=Ft);var Mt=Hi(l,_t,mt,2),It=Math.abs(Ot[0])*_e(Rt,m,Ft);if(wt||It<=Mt){var Lt=this.textStates[x].textAlign,At=rc(l,_t,mt,2,m,(Mt-It)*Xh[Lt],bt,Math.abs(Ot[0]),_e,Rt,Ft,D?0:this.viewRotation_);t:if(At){var kt=[],Dt=void 0,jt=void 0,Gt=void 0,zt=void 0,Nt=void 0;if(w)for(Dt=0,jt=At.length;Dt<jt;++Dt){Gt=(Nt=At[Dt])[4],zt=this.createLabel(Gt,x,"",w),p=Nt[2]+(Ot[0]<0?-Et:Et),f=xt*zt.height+2*(.5-xt)*Et*Ot[1]/Ot[0]-Ct;var Ut=this.calculateImageOrLabelDimensions_(zt.width,zt.height,Nt[0],Nt[1],zt.width,zt.height,p,f,0,0,Nt[3],Tt,!1,le,!1,S);if(s&&s.collides(Ut.declutterBox))break t;kt.push([t,e,zt,Ut,1,null,null])}if(b)for(Dt=0,jt=At.length;Dt<jt;++Dt){Gt=(Nt=At[Dt])[4],zt=this.createLabel(Gt,x,b,""),p=Nt[2],f=xt*zt.height-Ct;Ut=this.calculateImageOrLabelDimensions_(zt.width,zt.height,Nt[0],Nt[1],zt.width,zt.height,p,f,0,0,Nt[3],Tt,!1,le,!1,S);if(s&&s.collides(Ut.declutterBox))break t;kt.push([t,e,zt,Ut,1,null,null])}s&&s.load(kt.map(lc));for(var Bt=0,Vt=kt.length;Bt<Vt;++Bt)this.replayImageOrLabel_.apply(this,kt[Bt])}}++P;break;case Rh.END_GEOMETRY:if(void 0!==o){var Xt=o(S=z[1],T);if(Xt)return Xt}++P;break;case Rh.FILL:G?F++:this.fill_(t),++P;break;case Rh.MOVE_TO_LINE_TO:for(O=z[1],c=z[2],C=l[O],v=(E=l[O+1])+.5|0,(y=C+.5|0)===d&&v===g||(t.moveTo(C,E),d=y,g=v),O+=2;O<c;O+=2)y=(C=l[O])+.5|0,v=(E=l[O+1])+.5|0,O!=c-2&&y===d&&v===g||(t.lineTo(C,E),d=y,g=v);++P;break;case Rh.SET_FILL_STYLE:I=z,this.alignFill_=z[2],F&&(this.fill_(t),F=0,M&&(t.stroke(),M=0)),t.fillStyle=z[1],++P;break;case Rh.SET_STROKE_STYLE:L=z,M&&(t.stroke(),M=0),this.setStrokeStyle_(t,z),++P;break;case Rh.STROKE:G?M++:t.stroke(),++P;break;default:++P}}F&&this.fill_(t),M&&t.stroke()},t.prototype.execute=function(t,e,r,n,i,o){this.viewRotation_=n,this.execute_(t,e,r,this.instructions,i,void 0,void 0,o)},t.prototype.executeHitDetection=function(t,e,r,n,i){return this.viewRotation_=r,this.execute_(t,1,e,this.hitDetectionInstructions,!0,n,i)},t}(),fc=pc,dc=["Polygon","Circle","LineString","Image","Text","Default"],gc=function(){function t(t,e,r,n,i,o){this.maxExtent_=t,this.overlaps_=n,this.pixelRatio_=r,this.resolution_=e,this.renderBuffer_=o,this.executorsByZIndex_={},this.hitDetectionContext_=null,this.hitDetectionTransform_=[1,0,0,1,0,0],this.createExecutors_(i)}return t.prototype.clip=function(t,e){var r=this.getClipCoords(e);t.beginPath(),t.moveTo(r[0],r[1]),t.lineTo(r[2],r[3]),t.lineTo(r[4],r[5]),t.lineTo(r[6],r[7]),t.clip()},t.prototype.createExecutors_=function(t){for(var e in t){var r=this.executorsByZIndex_[e];void 0===r&&(r={},this.executorsByZIndex_[e]=r);var n=t[e];for(var i in n){var o=n[i];r[i]=new fc(this.resolution_,this.pixelRatio_,this.overlaps_,o)}}},t.prototype.hasExecutors=function(t){for(var e in this.executorsByZIndex_)for(var r=this.executorsByZIndex_[e],n=0,i=t.length;n<i;++n)if(t[n]in r)return!0;return!1},t.prototype.forEachFeatureAtCoordinate=function(t,e,r,n,i,o){var a=2*(n=Math.round(n))+1,s=tn(this.hitDetectionTransform_,n+.5,n+.5,1/e,-1/e,-r,-t[0],-t[1]),l=!this.hitDetectionContext_;l&&(this.hitDetectionContext_=H(a,a));var u,h=this.hitDetectionContext_;h.canvas.width!==a||h.canvas.height!==a?(h.canvas.width=a,h.canvas.height=a):l||h.clearRect(0,0,a,a),void 0!==this.renderBuffer_&&(ar(u=[1/0,1/0,-1/0,-1/0],t),qe(u,e*(this.renderBuffer_+n),u));var c,p=function(t){if(void 0!==yc[t])return yc[t];for(var e=2*t+1,r=t*t,n=new Array(r+1),i=0;i<=t;++i)for(var o=0;o<=t;++o){var a=i*i+o*o;if(a>r)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);i<u;++i)n[i]&&l.push.apply(l,n[i]);return yc[t]=l,l}(n);function f(t,e){for(var r=h.getImageData(0,0,a,a).data,s=0,l=p.length;s<l;s++)if(r[p[s]]>0){if(!o||"Image"!==c&&"Text"!==c||-1!==o.indexOf(t)){var u=(p[s]-3)/4,f=n-u%a,d=n-(u/a|0),g=i(t,e,f*f+d*d);if(g)return g}h.clearRect(0,0,a,a);break}}var d,g,y,v,_,m=Object.keys(this.executorsByZIndex_).map(Number);for(m.sort(at),d=m.length-1;d>=0;--d){var x=m[d].toString();for(y=this.executorsByZIndex_[x],g=dc.length-1;g>=0;--g)if(void 0!==(v=y[c=dc[g]])&&(_=v.executeHitDetection(h,s,r,f,u)))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 ii(a,0,8,2,t,a),a},t.prototype.isEmpty=function(){return _t(this.executorsByZIndex_)},t.prototype.execute=function(t,e,r,n,i,o,a){var s=Object.keys(this.executorsByZIndex_).map(Number);s.sort(at),this.maxExtent_&&(t.save(),this.clip(t,r));var l,u,h,c,p,f,d=o||dc;for(a&&s.reverse(),l=0,u=s.length;l<u;++l){var g=s[l].toString();for(p=this.executorsByZIndex_[g],h=0,c=d.length;h<c;++h){void 0!==(f=p[d[h]])&&f.execute(t,e,r,n,i,a)}}this.maxExtent_&&t.restore()},t}(),yc={};var vc=gc,_c=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)}}(),mc=function(t){function e(e,r,n,i,o,a,s){var l=t.call(this)||this;return l.context_=e,l.pixelRatio_=r,l.extent_=n,l.transform_=i,l.viewRotation_=o,l.squaredTolerance_=a,l.userTransform_=s,l.contextFillState_=null,l.contextStrokeState_=null,l.contextTextState_=null,l.fillState_=null,l.strokeState_=null,l.image_=null,l.imageAnchorX_=0,l.imageAnchorY_=0,l.imageHeight_=0,l.imageOpacity_=0,l.imageOriginX_=0,l.imageOriginY_=0,l.imageRotateWithView_=!1,l.imageRotation_=0,l.imageScale_=[0,0],l.imageWidth_=0,l.text_="",l.textOffsetX_=0,l.textOffsetY_=0,l.textRotateWithView_=!1,l.textRotation_=0,l.textScale_=[0,0],l.textFillState_=null,l.textStrokeState_=null,l.textState_=null,l.pixelCoordinates_=[],l.tmpLocalTransform_=[1,0,0,1,0,0],l}return _c(e,t),e.prototype.drawImages_=function(t,e,r,n){if(this.image_){var i=ii(t,e,r,n,this.transform_,this.pixelCoordinates_),o=this.context_,a=this.tmpLocalTransform_,s=o.globalAlpha;1!=this.imageOpacity_&&(o.globalAlpha=s*this.imageOpacity_);var l=this.imageRotation_;this.imageRotateWithView_&&(l+=this.viewRotation_);for(var u=0,h=i.length;u<h;u+=2){var c=i[u]-this.imageAnchorX_,p=i[u+1]-this.imageAnchorY_;if(0!==l||1!=this.imageScale_[0]||1!=this.imageScale_[1]){var f=c+this.imageAnchorX_,d=p+this.imageAnchorY_;tn(a,f,d,1,1,l,-f,-d),o.setTransform.apply(o,a),o.translate(f,d),o.scale(this.imageScale_[0],this.imageScale_[1]),o.drawImage(this.image_,this.imageOriginX_,this.imageOriginY_,this.imageWidth_,this.imageHeight_,-this.imageAnchorX_,-this.imageAnchorY_,this.imageWidth_,this.imageHeight_),o.setTransform(1,0,0,1,0,0)}else o.drawImage(this.image_,this.imageOriginX_,this.imageOriginY_,this.imageWidth_,this.imageHeight_,c,p,this.imageWidth_,this.imageHeight_)}1!=this.imageOpacity_&&(o.globalAlpha=s)}},e.prototype.drawText_=function(t,e,r,n){if(this.textState_&&""!==this.text_){this.textFillState_&&this.setContextFillState_(this.textFillState_),this.textStrokeState_&&this.setContextStrokeState_(this.textStrokeState_),this.setContextTextState_(this.textState_);var i=ii(t,e,r,n,this.transform_,this.pixelCoordinates_),o=this.context_,a=this.textRotation_;for(this.textRotateWithView_&&(a+=this.viewRotation_);e<r;e+=n){var s=i[e]+this.textOffsetX_,l=i[e+1]+this.textOffsetY_;if(0!==a||1!=this.textScale_[0]||1!=this.textScale_[1]){var u=tn(this.tmpLocalTransform_,s,l,1,1,a,-s,-l);o.setTransform.apply(o,u),o.translate(s,l),o.scale(this.textScale_[0],this.textScale_[1]),this.textStrokeState_&&o.strokeText(this.text_,0,0),this.textFillState_&&o.fillText(this.text_,0,0),o.setTransform(1,0,0,1,0,0)}else this.textStrokeState_&&o.strokeText(this.text_,s,l),this.textFillState_&&o.fillText(this.text_,s,l)}}},e.prototype.moveToLineTo_=function(t,e,r,n,i){var o=this.context_,a=ii(t,e,r,n,this.transform_,this.pixelCoordinates_);o.moveTo(a[0],a[1]);var s=a.length;i&&(s-=2);for(var l=2;l<s;l+=2)o.lineTo(a[l],a[l+1]);return i&&o.closePath(),r},e.prototype.drawRings_=function(t,e,r,n){for(var i=0,o=r.length;i<o;++i)e=this.moveToLineTo_(t,e,r[i],n,!0);return e},e.prototype.drawCircle=function(t){if(br(this.extent_,t.getExtent())){if(this.fillState_||this.strokeState_){this.fillState_&&this.setContextFillState_(this.fillState_),this.strokeState_&&this.setContextStrokeState_(this.strokeState_);var e=function(t,e,r){var n=t.getFlatCoordinates();if(n){var i=t.getStride();return ii(n,0,n.length,i,e,r)}return null}(t,this.transform_,this.pixelCoordinates_),r=e[2]-e[0],n=e[3]-e[1],i=Math.sqrt(r*r+n*n),o=this.context_;o.beginPath(),o.arc(e[0],e[1],i,0,2*Math.PI),this.fillState_&&o.fill(),this.strokeState_&&o.stroke()}""!==this.text_&&this.drawText_(t.getCenter(),0,2,2)}},e.prototype.setStyle=function(t){this.setFillStrokeStyle(t.getFill(),t.getStroke()),this.setImageStyle(t.getImage()),this.setTextStyle(t.getText())},e.prototype.setTransform=function(t){this.transform_=t},e.prototype.drawGeometry=function(t){switch(t.getType()){case"Point":this.drawPoint(t);break;case"LineString":this.drawLineString(t);break;case"Polygon":this.drawPolygon(t);break;case"MultiPoint":this.drawMultiPoint(t);break;case"MultiLineString":this.drawMultiLineString(t);break;case"MultiPolygon":this.drawMultiPolygon(t);break;case"GeometryCollection":this.drawGeometryCollection(t);break;case"Circle":this.drawCircle(t)}},e.prototype.drawFeature=function(t,e){var r=e.getGeometryFunction()(t);r&&br(this.extent_,r.getExtent())&&(this.setStyle(e),this.drawGeometry(r))},e.prototype.drawGeometryCollection=function(t){for(var e=t.getGeometriesArray(),r=0,n=e.length;r<n;++r)this.drawGeometry(e[r])},e.prototype.drawPoint=function(t){this.squaredTolerance_&&(t=t.simplifyTransformed(this.squaredTolerance_,this.userTransform_));var e=t.getFlatCoordinates(),r=t.getStride();this.image_&&this.drawImages_(e,0,e.length,r),""!==this.text_&&this.drawText_(e,0,e.length,r)},e.prototype.drawMultiPoint=function(t){this.squaredTolerance_&&(t=t.simplifyTransformed(this.squaredTolerance_,this.userTransform_));var e=t.getFlatCoordinates(),r=t.getStride();this.image_&&this.drawImages_(e,0,e.length,r),""!==this.text_&&this.drawText_(e,0,e.length,r)},e.prototype.drawLineString=function(t){if(this.squaredTolerance_&&(t=t.simplifyTransformed(this.squaredTolerance_,this.userTransform_)),br(this.extent_,t.getExtent())){if(this.strokeState_){this.setContextStrokeState_(this.strokeState_);var e=this.context_,r=t.getFlatCoordinates();e.beginPath(),this.moveToLineTo_(r,0,r.length,t.getStride(),!1),e.stroke()}if(""!==this.text_){var n=t.getFlatMidpoint();this.drawText_(n,0,2,2)}}},e.prototype.drawMultiLineString=function(t){this.squaredTolerance_&&(t=t.simplifyTransformed(this.squaredTolerance_,this.userTransform_));var e=t.getExtent();if(br(this.extent_,e)){if(this.strokeState_){this.setContextStrokeState_(this.strokeState_);var r=this.context_,n=t.getFlatCoordinates(),i=0,o=t.getEnds(),a=t.getStride();r.beginPath();for(var s=0,l=o.length;s<l;++s)i=this.moveToLineTo_(n,i,o[s],a,!1);r.stroke()}if(""!==this.text_){var u=t.getFlatMidpoints();this.drawText_(u,0,u.length,2)}}},e.prototype.drawPolygon=function(t){if(this.squaredTolerance_&&(t=t.simplifyTransformed(this.squaredTolerance_,this.userTransform_)),br(this.extent_,t.getExtent())){if(this.strokeState_||this.fillState_){this.fillState_&&this.setContextFillState_(this.fillState_),this.strokeState_&&this.setContextStrokeState_(this.strokeState_);var e=this.context_;e.beginPath(),this.drawRings_(t.getOrientedFlatCoordinates(),0,t.getEnds(),t.getStride()),this.fillState_&&e.fill(),this.strokeState_&&e.stroke()}if(""!==this.text_){var r=t.getFlatInteriorPoint();this.drawText_(r,0,2,2)}}},e.prototype.drawMultiPolygon=function(t){if(this.squaredTolerance_&&(t=t.simplifyTransformed(this.squaredTolerance_,this.userTransform_)),br(this.extent_,t.getExtent())){if(this.strokeState_||this.fillState_){this.fillState_&&this.setContextFillState_(this.fillState_),this.strokeState_&&this.setContextStrokeState_(this.strokeState_);var e=this.context_,r=t.getOrientedFlatCoordinates(),n=0,i=t.getEndss(),o=t.getStride();e.beginPath();for(var a=0,s=i.length;a<s;++a){var l=i[a];n=this.drawRings_(r,n,l,o)}this.fillState_&&e.fill(),this.strokeState_&&e.stroke()}if(""!==this.text_){var u=t.getFlatInteriorPoints();this.drawText_(u,0,u.length,2)}}},e.prototype.setContextFillState_=function(t){var e=this.context_,r=this.contextFillState_;r?r.fillStyle!=t.fillStyle&&(r.fillStyle=t.fillStyle,e.fillStyle=t.fillStyle):(e.fillStyle=t.fillStyle,this.contextFillState_={fillStyle:t.fillStyle})},e.prototype.setContextStrokeState_=function(t){var e=this.context_,r=this.contextStrokeState_;r?(r.lineCap!=t.lineCap&&(r.lineCap=t.lineCap,e.lineCap=t.lineCap),e.setLineDash&&(ct(r.lineDash,t.lineDash)||e.setLineDash(r.lineDash=t.lineDash),r.lineDashOffset!=t.lineDashOffset&&(r.lineDashOffset=t.lineDashOffset,e.lineDashOffset=t.lineDashOffset)),r.lineJoin!=t.lineJoin&&(r.lineJoin=t.lineJoin,e.lineJoin=t.lineJoin),r.lineWidth!=t.lineWidth&&(r.lineWidth=t.lineWidth,e.lineWidth=t.lineWidth),r.miterLimit!=t.miterLimit&&(r.miterLimit=t.miterLimit,e.miterLimit=t.miterLimit),r.strokeStyle!=t.strokeStyle&&(r.strokeStyle=t.strokeStyle,e.strokeStyle=t.strokeStyle)):(e.lineCap=t.lineCap,e.setLineDash&&(e.setLineDash(t.lineDash),e.lineDashOffset=t.lineDashOffset),e.lineJoin=t.lineJoin,e.lineWidth=t.lineWidth,e.miterLimit=t.miterLimit,e.strokeStyle=t.strokeStyle,this.contextStrokeState_={lineCap:t.lineCap,lineDash:t.lineDash,lineDashOffset:t.lineDashOffset,lineJoin:t.lineJoin,lineWidth:t.lineWidth,miterLimit:t.miterLimit,strokeStyle:t.strokeStyle})},e.prototype.setContextTextState_=function(t){var e=this.context_,r=this.contextTextState_,n=t.textAlign?t.textAlign:ae;r?(r.font!=t.font&&(r.font=t.font,e.font=t.font),r.textAlign!=n&&(r.textAlign=n,e.textAlign=n),r.textBaseline!=t.textBaseline&&(r.textBaseline=t.textBaseline,e.textBaseline=t.textBaseline)):(e.font=t.font,e.textAlign=n,e.textBaseline=t.textBaseline,this.contextTextState_={font:t.font,textAlign:n,textBaseline:t.textBaseline})},e.prototype.setFillStrokeStyle=function(t,e){var r=this;if(t){var n=t.getColor();this.fillState_={fillStyle:N(n||ee)}}else this.fillState_=null;if(e){var i=e.getColor(),o=e.getLineCap(),a=e.getLineDash(),s=e.getLineDashOffset(),l=e.getLineJoin(),u=e.getWidth(),h=e.getMiterLimit(),c=a||ne;this.strokeState_={lineCap:void 0!==o?o:re,lineDash:1===this.pixelRatio_?c:c.map((function(t){return t*r.pixelRatio_})),lineDashOffset:(s||0)*this.pixelRatio_,lineJoin:void 0!==l?l:ie,lineWidth:(void 0!==u?u:1)*this.pixelRatio_,miterLimit:void 0!==h?h:10,strokeStyle:N(i||oe)}}else this.strokeState_=null},e.prototype.setImageStyle=function(t){var e;if(t&&(e=t.getSize())){var r=t.getAnchor(),n=t.getOrigin();this.image_=t.getImage(this.pixelRatio_),this.imageAnchorX_=r[0]*this.pixelRatio_,this.imageAnchorY_=r[1]*this.pixelRatio_,this.imageHeight_=e[1]*this.pixelRatio_,this.imageOpacity_=t.getOpacity(),this.imageOriginX_=n[0],this.imageOriginY_=n[1],this.imageRotateWithView_=t.getRotateWithView(),this.imageRotation_=t.getRotation(),this.imageScale_=t.getScaleArray(),this.imageWidth_=e[0]*this.pixelRatio_}else this.image_=null},e.prototype.setTextStyle=function(t){if(t){var e=t.getFill();if(e){var r=e.getColor();this.textFillState_={fillStyle:N(r||ee)}}else this.textFillState_=null;var n=t.getStroke();if(n){var i=n.getColor(),o=n.getLineCap(),a=n.getLineDash(),s=n.getLineDashOffset(),l=n.getLineJoin(),u=n.getWidth(),h=n.getMiterLimit();this.textStrokeState_={lineCap:void 0!==o?o:re,lineDash:a||ne,lineDashOffset:s||0,lineJoin:void 0!==l?l:ie,lineWidth:void 0!==u?u:1,miterLimit:void 0!==h?h:10,strokeStyle:N(i||oe)}}else this.textStrokeState_=null;var c=t.getFont(),p=t.getOffsetX(),f=t.getOffsetY(),d=t.getRotateWithView(),g=t.getRotation(),y=t.getScaleArray(),v=t.getText(),_=t.getTextAlign(),m=t.getTextBaseline();this.textState_={font:void 0!==c?c:te,textAlign:void 0!==_?_:ae,textBaseline:void 0!==m?m:se},this.text_=void 0!==v?Array.isArray(v)?v.reduce((function(t,e,r){return t+(r%2?" ":e)}),""):v:"",this.textOffsetX_=void 0!==p?this.pixelRatio_*p:0,this.textOffsetY_=void 0!==f?this.pixelRatio_*f:0,this.textRotateWithView_=void 0!==d&&d,this.textRotation_=void 0!==g?g:0,this.textScale_=[this.pixelRatio_*y[0],this.pixelRatio_*y[1]]}else this.text_=""},e}(Oh),xc=mc,wc=.5;function bc(t,e,r,n,i,o,a){var s=H(t[0]*wc,t[1]*wc);s.imageSmoothingEnabled=!1;for(var l=s.canvas,u=new xc(s,wc,i,null,a),h=r.length,c=Math.floor(16777215/h),p={},f=1;f<=h;++f){var d=r[f-1],g=d.getStyleFunction()||n;if(n){var y=g(d,o);if(y){Array.isArray(y)||(y=[y]);for(var v="#"+("000000"+(f*c).toString(16)).slice(-6),_=0,m=y.length;_<m;++_){var x=y[_],w=x.getGeometryFunction()(d);if(w&&br(i,w.getExtent())){var b=x.clone(),S=b.getFill();S&&S.setColor(v);var C=b.getStroke();C&&(C.setColor(v),C.setLineDash(null)),b.setText(void 0);var E=x.getImage();if(E&&0!==E.getOpacity()){var T=E.getImageSize();if(!T)continue;var P=H(T[0],T[1],void 0,{alpha:!1}),R=P.canvas;P.fillStyle=v,P.fillRect(0,0,R.width,R.height),b.setImage(new Ar({img:R,imgSize:T,anchor:E.getAnchor(),anchorXUnits:Oe,anchorYUnits:Oe,offset:E.getOrigin(),opacity:1,size:E.getSize(),scale:E.getScale(),rotation:E.getRotation(),rotateWithView:E.getRotateWithView()}))}var O=b.getZIndex()||0;(I=p[O])||(I={},p[O]=I,I.Polygon=[],I.Circle=[],I.LineString=[],I.Point=[]),I[w.getType().replace("Multi","")].push(w,b)}}}}}for(var F=Object.keys(p).map(Number).sort(at),M=(f=0,F.length);f<M;++f){var I=p[F[f]];for(var L in I){var A=I[L];for(_=0,m=A.length;_<m;_+=2){u.setStyle(A[_+1]);for(var k=0,D=e.length;k<D;++k)u.setTransform(e[k]),u.drawGeometry(A[_])}}}return s.getImageData(0,0,l.width,l.height)}function Sc(t,e,r){var n=[];if(r){var i=Math.floor(Math.round(t[0])*wc),o=Math.floor(Math.round(t[1])*wc),a=4*(m(i,0,r.width-1)+m(o,0,r.height-1)*r.width),s=r.data[a],l=r.data[a+1],u=r.data[a+2]+256*(l+256*s),h=Math.floor(16777215/e.length);u&&u%h==0&&n.push(e[u/h-1])}return n}var Cc={Point:function(t,e,r,i,o){var a,s=r.getImage(),l=r.getText();if(s){if(s.getImageState()!=n)return;var u=t;if(o){var h=s.getDeclutterMode();if("none"!==h)if(u=o,"obstacle"===h){var c=t.getBuilder(r.getZIndex(),"Image");c.setImageStyle(s,a),c.drawPoint(e,i)}else l&&l.getText()&&(a={})}var p=u.getBuilder(r.getZIndex(),"Image");p.setImageStyle(s,a),p.drawPoint(e,i)}if(l&&l.getText()){var f=t;o&&(f=o);var d=f.getBuilder(r.getZIndex(),"Text");d.setTextStyle(l,a),d.drawText(e,i)}},LineString:function(t,e,r,n,i){var o=r.getStroke();if(o){var a=t.getBuilder(r.getZIndex(),"LineString");a.setFillStrokeStyle(null,o),a.drawLineString(e,n)}var s=r.getText();if(s&&s.getText()){var l=(i||t).getBuilder(r.getZIndex(),"Text");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(),"Polygon");s.setFillStrokeStyle(o,a),s.drawPolygon(e,n)}var l=r.getText();if(l&&l.getText()){var u=(i||t).getBuilder(r.getZIndex(),"Text");u.setTextStyle(l),u.drawText(e,n)}},MultiPoint:function(t,e,r,i,o){var a,s=r.getImage(),l=r.getText();if(s){if(s.getImageState()!=n)return;var u=t;if(o){var h=s.getDeclutterMode();if("none"!==h)if(u=o,"obstacle"===h){var c=t.getBuilder(r.getZIndex(),"Image");c.setImageStyle(s,a),c.drawMultiPoint(e,i)}else l&&l.getText()&&(a={})}var p=u.getBuilder(r.getZIndex(),"Image");p.setImageStyle(s,a),p.drawMultiPoint(e,i)}if(l&&l.getText()){var f=t;o&&(f=o);var d=f.getBuilder(r.getZIndex(),"Text");d.setTextStyle(l,a),d.drawText(e,i)}},MultiLineString:function(t,e,r,n,i){var o=r.getStroke();if(o){var a=t.getBuilder(r.getZIndex(),"LineString");a.setFillStrokeStyle(null,o),a.drawMultiLineString(e,n)}var s=r.getText();if(s&&s.getText()){var l=(i||t).getBuilder(r.getZIndex(),"Text");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(),"Polygon");s.setFillStrokeStyle(o,a),s.drawMultiPolygon(e,n)}var l=r.getText();if(l&&l.getText()){var u=(i||t).getBuilder(r.getZIndex(),"Text");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<a;++o){(0,Cc[s[o].getType()])(t,s[o],r,n,i)}},Circle:function(t,e,r,n,i){var o=r.getFill(),a=r.getStroke();if(o||a){var s=t.getBuilder(r.getZIndex(),"Circle");s.setFillStrokeStyle(o,a),s.drawCircle(e,n)}var l=r.getText();if(l&&l.getText()){var u=(i||t).getBuilder(r.getZIndex(),"Text");u.setTextStyle(l),u.drawText(e,n)}}};function Ec(t,e){return parseInt(l(t),10)-parseInt(l(e),10)}function Tc(t,e){var r=Pc(t,e);return r*r}function Pc(t,e){return.5*t/e}function Rc(t,r,o,a,s,l,u){var h=!1,c=o.getImage();if(c){var p=c.getImageState();p==n||p==i?c.unlistenImageChange(s):(p==e&&c.load(),c.listenImageChange(s),h=!0)}return function(t,e,r,n,i,o){var a=r.getGeometryFunction()(e);if(!a)return;var s=a.simplifyTransformed(n,i);if(r.getRenderer())Oc(t,s,r,e);else{(0,Cc[s.getType()])(t,s,r,e,o)}}(t,r,o,a,l,u),h}function Oc(t,e,r,n){if("GeometryCollection"!=e.getType())t.getBuilder(r.getZIndex(),"Default").drawCustom(e,n,r.getRenderer(),r.getHitDetectionRenderer());else for(var i=e.getGeometries(),o=0,a=i.length;o<a;++o)Oc(t,i[o],r,n)}var Fc=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)}}(),Mc=function(t){function e(e){var r=t.call(this,e)||this;return r.boundHandleStyleImageChange_=r.handleStyleImageChange_.bind(r),r.animatingOrInteracting_,r.hitDetectionImageData_=null,r.renderedFeatures_=null,r.renderedRevision_=-1,r.renderedResolution_=NaN,r.renderedExtent_=[1/0,1/0,-1/0,-1/0],r.wrappedRenderedExtent_=[1/0,1/0,-1/0,-1/0],r.renderedRotation_,r.renderedCenter_=null,r.renderedProjection_=null,r.renderedRenderOrder_=null,r.replayGroup_=null,r.replayGroupChanged=!0,r.declutterExecutorGroup=null,r.clipping=!0,r.compositionContext_=null,r.opacity_=1,r}return Fc(e,t),e.prototype.renderWorlds=function(t,e,r){var n=e.extent,i=e.viewState,o=i.center,a=i.resolution,s=i.projection,l=i.rotation,u=s.getExtent(),h=this.getLayer().getSource(),c=e.pixelRatio,p=e.viewHints,f=!(p[Bs]||p[Vs]),d=this.compositionContext_,g=Math.round(e.size[0]*c),y=Math.round(e.size[1]*c),v=h.getWrapX()&&s.canWrapX(),_=v?wr(u):null,m=v?Math.ceil((n[2]-u[2])/_)+1:1,x=v?Math.floor((n[0]-u[0])/_):0;do{var w=this.getRenderTransform(o,a,l,c,g,y,x*_);t.execute(d,1,w,l,f,void 0,r)}while(++x<m)},e.prototype.setupCompositionContext_=function(){if(1!==this.opacity_){var t=H(this.context.canvas.width,this.context.canvas.height,Qh);this.compositionContext_=t}else this.compositionContext_=this.context},e.prototype.releaseCompositionContext_=function(){if(1!==this.opacity_){var t=this.context.globalAlpha;this.context.globalAlpha=this.opacity_,this.context.drawImage(this.compositionContext_.canvas,0,0),this.context.globalAlpha=t,J(this.compositionContext_),Qh.push(this.compositionContext_.canvas),this.compositionContext_=null}},e.prototype.renderDeclutter=function(t){this.declutterExecutorGroup&&(this.setupCompositionContext_(),this.renderWorlds(this.declutterExecutorGroup,t,t.declutterTree),this.releaseCompositionContext_())},e.prototype.renderFrame=function(t,e){var r=t.pixelRatio,n=t.layerStatesArray[t.layerIndex];!function(t,e,r){Zr(t,e,0,0,r,0,0)}(this.pixelTransform,1/r,1/r),en(this.inversePixelTransform,this.pixelTransform);var i=rn(this.pixelTransform);this.useContainer(e,i,this.getBackground(t));var o=this.context,a=o.canvas,s=this.replayGroup_,l=this.declutterExecutorGroup;if((!s||s.isEmpty())&&(!l||l.isEmpty()))return null;var u=Math.round(t.size[0]*r),h=Math.round(t.size[1]*r);a.width!=u||a.height!=h?(a.width=u,a.height=h,a.style.transform!==i&&(a.style.transform=i)):this.containerReused||o.clearRect(0,0,u,h),this.preRender(o,t);var c=t.viewState;c.projection,this.opacity_=n.opacity,this.setupCompositionContext_();var p=!1,f=!0;if(n.extent&&this.clipping){var d=ni(n.extent);(p=(f=br(d,t.extent))&&!He(d,t.extent))&&this.clipUnrotated(this.compositionContext_,t,d)}return f&&this.renderWorlds(s,t),p&&this.compositionContext_.restore(),this.releaseCompositionContext_(),this.postRender(o,t),this.renderedRotation_!==c.rotation&&(this.renderedRotation_=c.rotation,this.hitDetectionImageData_=null),this.container},e.prototype.getFeatures=function(t){return new Promise(function(e){if(!this.hitDetectionImageData_&&!this.animatingOrInteracting_){var r=[this.context.canvas.width,this.context.canvas.height];Hr(this.pixelTransform,r);var n=this.renderedCenter_,i=this.renderedResolution_,o=this.renderedRotation_,a=this.renderedProjection_,s=this.wrappedRenderedExtent_,l=this.getLayer(),u=[],h=r[0]*wc,c=r[1]*wc;u.push(this.getRenderTransform(n,i,o,wc,h,c,0).slice());var p=l.getSource(),f=a.getExtent();if(p.getWrapX()&&a.canWrapX()&&!He(f,s)){for(var d=s[0],g=wr(f),y=0,v=void 0;d<f[0];)v=g*--y,u.push(this.getRenderTransform(n,i,o,wc,h,c,v).slice()),d+=g;for(y=0,d=s[2];d>f[2];)v=g*++y,u.push(this.getRenderTransform(n,i,o,wc,h,c,v).slice()),d-=g}this.hitDetectionImageData_=bc(r,u,this.renderedFeatures_,l.getStyleFunction(),s,i,o)}e(Sc(t,this.renderedFeatures_,this.hitDetectionImageData_))}.bind(this))},e.prototype.forEachFeatureAtCoordinate=function(t,e,r,n,i){var o=this;if(this.replayGroup_){var a,s=e.viewState.resolution,u=e.viewState.rotation,h=this.getLayer(),c={},p=function(t,e,r){var o=l(t),a=c[o];if(a){if(!0!==a&&r<a.distanceSq){if(0===r)return c[o]=!0,i.splice(i.lastIndexOf(a),1),n(t,h,e);a.geometry=e,a.distanceSq=r}}else{if(0===r)return c[o]=!0,n(t,h,e);i.push(c[o]={feature:t,layer:h,geometry:e,distanceSq:r,callback:n})}},f=[this.replayGroup_];return this.declutterExecutorGroup&&f.push(this.declutterExecutorGroup),f.some((function(n){return a=n.forEachFeatureAtCoordinate(t,s,u,r,p,n===o.declutterExecutorGroup&&e.declutterTree?e.declutterTree.all().map((function(t){return t.value})):null)})),a}},e.prototype.handleFontsChanged=function(){var t=this.getLayer();t.getVisible()&&this.replayGroup_&&t.changed()},e.prototype.handleStyleImageChange_=function(t){this.renderIfReadyAndVisible()},e.prototype.prepareFrame=function(t){var e=this.getLayer(),r=e.getSource();if(!r)return!1;var n=t.viewHints[Bs],i=t.viewHints[Vs],o=e.getUpdateWhileAnimating(),a=e.getUpdateWhileInteracting();if(this.ready&&!o&&n||!a&&i)return this.animatingOrInteracting_=!0,!0;this.animatingOrInteracting_=!1;var s=t.extent,l=t.viewState,u=l.projection,h=l.resolution,c=t.pixelRatio,p=e.getRevision(),f=e.getRenderBuffer(),d=e.getRenderOrder();void 0===d&&(d=Ec);var g=l.center.slice(),y=qe(s,f*h),v=y.slice(),_=[y.slice()],m=u.getExtent();if(r.getWrapX()&&u.canWrapX()&&!He(m,t.extent)){var x=wr(m),w=Math.max(wr(y)/2,x);y[0]=m[0]-w,y[2]=m[2]+w,Mn(g,u);var b=Er(_[0],u);b[0]<m[0]&&b[2]<m[2]?_.push([b[0]+x,b[1],b[2]+x,b[3]]):b[0]>m[0]&&b[2]>m[2]&&_.push([b[0]-x,b[1],b[2]-x,b[3]])}if(this.ready&&this.renderedResolution_==h&&this.renderedRevision_==p&&this.renderedRenderOrder_==d&&He(this.wrappedRenderedExtent_,y))return ct(this.renderedExtent_,v)||(this.hitDetectionImageData_=null,this.renderedExtent_=v),this.renderedCenter_=g,this.replayGroupChanged=!1,!0;this.replayGroup_=null;var S,C=new Yh(Pc(h,c),y,h,c);this.getLayer().getDeclutter()&&(S=new Yh(Pc(h,c),y,h,c));for(var E=0,T=_.length;E<T;++E)r.loadFeatures(_[E],h,u);var P=Tc(h,c),R=!0,O=function(t){var r,n=t.getStyleFunction()||e.getStyleFunction();if(n&&(r=n(t,h)),r){var i=this.renderFeature(t,P,r,C,undefined,S);R=R&&!i}}.bind(this),F=ri(y),M=r.getFeaturesInExtent(F);d&&M.sort(d);for(E=0,T=M.length;E<T;++E)O(M[E]);this.renderedFeatures_=M,this.ready=R;var I=C.finish(),L=new vc(y,h,c,r.getOverlaps(),I,e.getRenderBuffer());return S&&(this.declutterExecutorGroup=new vc(y,h,c,r.getOverlaps(),S.finish(),e.getRenderBuffer())),this.renderedResolution_=h,this.renderedRevision_=p,this.renderedRenderOrder_=d,this.renderedExtent_=v,this.wrappedRenderedExtent_=y,this.renderedCenter_=g,this.renderedProjection_=u,this.replayGroup_=L,this.hitDetectionImageData_=null,this.replayGroupChanged=!0,!0},e.prototype.renderFeature=function(t,e,r,n,i,o){if(!r)return!1;var a=!1;if(Array.isArray(r))for(var s=0,l=r.length;s<l;++s)a=Rc(n,t,r[s],e,this.boundHandleStyleImageChange_,i,o)||a;else a=Rc(n,t,r,e,this.boundHandleStyleImageChange_,i,o);return a},e}(ec),Ic=Mc,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)}}(),Ac=function(t){function e(e){return t.call(this,e)||this}return Lc(e,t),e.prototype.createRenderer=function(){return new Ic(this)},e}(bh),kc=function(){function t(t){this.rbush_=new ah(t),this.items_={}}return t.prototype.insert=function(t,e){var r={minX:t[0],minY:t[1],maxX:t[2],maxY:t[3],value:e};this.rbush_.insert(r),this.items_[l(e)]=r},t.prototype.load=function(t,e){for(var r=new Array(e.length),n=0,i=e.length;n<i;n++){var o=t[n],a=e[n],s={minX:o[0],minY:o[1],maxX:o[2],maxY:o[3],value:a};r[n]=s,this.items_[l(a)]=s}this.rbush_.load(r)},t.prototype.remove=function(t){var e=l(t),r=this.items_[e];return delete this.items_[e],null!==this.rbush_.remove(r)},t.prototype.update=function(t,e){var r=this.items_[l(e)];ir([r.minX,r.minY,r.maxX,r.maxY],t)||(this.remove(e),this.insert(t,e))},t.prototype.getAll=function(){return this.rbush_.all().map((function(t){return t.value}))},t.prototype.getInExtent=function(t){var e={minX:t[0],minY:t[1],maxX:t[2],maxY:t[3]};return this.rbush_.search(e).map((function(t){return t.value}))},t.prototype.forEach=function(t){return this.forEach_(this.getAll(),t)},t.prototype.forEachInExtent=function(t,e){return this.forEach_(this.getInExtent(t),e)},t.prototype.forEach_=function(t,e){for(var r,n=0,i=t.length;n<i;n++)if(r=e(t[n]))return r;return r},t.prototype.isEmpty=function(){return _t(this.items_)},t.prototype.clear=function(){this.rbush_.clear(),this.items_={}},t.prototype.getExtent=function(t){var e=this.rbush_.toJSON();return tr(e.minX,e.minY,e.maxX,e.maxY,t)},t.prototype.concat=function(t){for(var e in this.rbush_.load(t.rbush_.all()),t.items_)this.items_[e]=t.items_[e]},t}(),Dc=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 jc(t){return t?Array.isArray(t)?function(e){return t}:"function"==typeof t?t:function(e){return[t]}:null}var Gc=function(t){function e(e){var r=t.call(this)||this;r.projection=Bn(e.projection),r.attributions_=jc(e.attributions),r.attributionsCollapsible_=void 0===e.attributionsCollapsible||e.attributionsCollapsible,r.loading=!1,r.state_=void 0!==e.state?e.state:"ready",r.wrapX_=void 0!==e.wrapX&&e.wrapX,r.interpolate_=!!e.interpolate,r.viewResolver=null,r.viewRejector=null;var n=r;return r.viewPromise_=new Promise((function(t,e){n.viewResolver=t,n.viewRejector=e})),r}return Dc(e,t),e.prototype.getAttributions=function(){return this.attributions_},e.prototype.getAttributionsCollapsible=function(){return this.attributionsCollapsible_},e.prototype.getProjection=function(){return this.projection},e.prototype.getResolutions=function(){return a()},e.prototype.getView=function(){return this.viewPromise_},e.prototype.getState=function(){return this.state_},e.prototype.getWrapX=function(){return this.wrapX_},e.prototype.getInterpolate=function(){return this.interpolate_},e.prototype.refresh=function(){this.changed()},e.prototype.setAttributions=function(t){this.attributions_=jc(t),this.changed()},e.prototype.setState=function(t){this.state_=t,this.changed()},e}(qt),zc="addfeature",Nc="changefeature",Uc="clear",Bc="removefeature",Vc="featuresloadstart",Xc="featuresloadend",Wc="featuresloaderror";function qc(t,e){return[[-1/0,-1/0,1/0,1/0]]}function Yc(t,e,r,n,i,o,a){var s=new XMLHttpRequest;s.open("GET","function"==typeof t?t(r,n,i):t,!0),"arraybuffer"==e.getType()&&(s.responseType="arraybuffer"),s.withCredentials=false,s.onload=function(t){if(!s.status||s.status>=200&&s.status<300){var n=e.getType(),l=void 0;"json"==n||"text"==n?l=s.responseText:"xml"==n?(l=s.responseXML)||(l=(new DOMParser).parseFromString(s.responseText,"application/xml")):"arraybuffer"==n&&(l=s.response),l?o(e.readFeatures(l,{extent:r,featureProjection:i}),e.readProjection(l)):a()}else a()},s.onerror=a,s.send()}function Kc(t,e){return function(r,n,i,o,a){var s=this;Yc(t,e,r,n,i,(function(t,e){s.addFeatures(t),void 0!==o&&o(t)}),a||dt)}}var Zc=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)}}(),Hc=function(t){function e(e,r,n){var i=t.call(this,e)||this;return i.feature=r,i.features=n,i}return Zc(e,t),e}(nt),Jc=function(t){function e(e){var r=this,n=e||{};(r=t.call(this,{attributions:n.attributions,interpolate:!0,projection:void 0,state:"ready",wrapX:void 0===n.wrapX||n.wrapX})||this).on,r.once,r.un,r.loader_=dt,r.format_=n.format,r.overlaps_=void 0===n.overlaps||n.overlaps,r.url_=n.url,void 0!==n.loader?r.loader_=n.loader:void 0!==r.url_&&(_(r.format_,7),r.loader_=Kc(r.url_,r.format_)),r.strategy_=void 0!==n.strategy?n.strategy:qc;var i,o,a=void 0===n.useSpatialIndex||n.useSpatialIndex;return r.featuresRtree_=a?new kc:null,r.loadedExtentsRtree_=new kc,r.loadingExtentsCount_=0,r.nullGeometryFeatures_={},r.idIndex_={},r.uidIndex_={},r.featureChangeKeys_={},r.featuresCollection_=null,Array.isArray(n.features)?o=n.features:n.features&&(o=(i=n.features).getArray()),a||void 0!==i||(i=new us(o)),void 0!==o&&r.addFeaturesInternal(o),void 0!==i&&r.bindFeaturesCollection_(i),r}return Zc(e,t),e.prototype.addFeature=function(t){this.addFeatureInternal(t),this.changed()},e.prototype.addFeatureInternal=function(t){var e=l(t);if(this.addToIndex_(e,t)){this.setupChangeEvents_(e,t);var r=t.getGeometry();if(r){var n=r.getExtent();this.featuresRtree_&&this.featuresRtree_.insert(n,t)}else this.nullGeometryFeatures_[e]=t;this.dispatchEvent(new Hc(zc,t))}else this.featuresCollection_&&this.featuresCollection_.remove(t)},e.prototype.setupChangeEvents_=function(t,e){this.featureChangeKeys_[t]=[kt(e,wt,this.handleFeatureChange_,this),kt(e,it,this.handleFeatureChange_,this)]},e.prototype.addToIndex_=function(t,e){var r=!0,n=e.getId();return void 0!==n&&(n.toString()in this.idIndex_?r=!1:this.idIndex_[n.toString()]=e),r&&(_(!(t in this.uidIndex_),30),this.uidIndex_[t]=e),r},e.prototype.addFeatures=function(t){this.addFeaturesInternal(t),this.changed()},e.prototype.addFeaturesInternal=function(t){for(var e=[],r=[],n=[],i=0,o=t.length;i<o;i++){var a=l(u=t[i]);this.addToIndex_(a,u)&&r.push(u)}i=0;for(var s=r.length;i<s;i++){var u;a=l(u=r[i]);this.setupChangeEvents_(a,u);var h=u.getGeometry();if(h){var c=h.getExtent();e.push(c),n.push(u)}else this.nullGeometryFeatures_[a]=u}if(this.featuresRtree_&&this.featuresRtree_.load(e,n),this.hasListener(zc)){i=0;for(var p=r.length;i<p;i++)this.dispatchEvent(new Hc(zc,r[i]))}},e.prototype.bindFeaturesCollection_=function(t){var e=!1;this.addEventListener(zc,(function(r){e||(e=!0,t.push(r.feature),e=!1)})),this.addEventListener(Bc,(function(r){e||(e=!0,t.remove(r.feature),e=!1)})),t.addEventListener(ns,function(t){e||(e=!0,this.addFeature(t.element),e=!1)}.bind(this)),t.addEventListener(is,function(t){e||(e=!0,this.removeFeature(t.element),e=!1)}.bind(this)),this.featuresCollection_=t},e.prototype.clear=function(t){if(t){for(var e in this.featureChangeKeys_){this.featureChangeKeys_[e].forEach(jt)}this.featuresCollection_||(this.featureChangeKeys_={},this.idIndex_={},this.uidIndex_={})}else if(this.featuresRtree_){var r=function(t){this.removeFeatureInternal(t)}.bind(this);for(var n in this.featuresRtree_.forEach(r),this.nullGeometryFeatures_)this.removeFeatureInternal(this.nullGeometryFeatures_[n])}this.featuresCollection_&&this.featuresCollection_.clear(),this.featuresRtree_&&this.featuresRtree_.clear(),this.nullGeometryFeatures_={};var i=new Hc(Uc);this.dispatchEvent(i),this.changed()},e.prototype.forEachFeature=function(t){if(this.featuresRtree_)return this.featuresRtree_.forEach(t);this.featuresCollection_&&this.featuresCollection_.forEach(t)},e.prototype.forEachFeatureAtCoordinateDirect=function(t,e){var r=[t[0],t[1],t[0],t[1]];return this.forEachFeatureInExtent(r,(function(r){return r.getGeometry().intersectsCoordinate(t)?e(r):void 0}))},e.prototype.forEachFeatureInExtent=function(t,e){if(this.featuresRtree_)return this.featuresRtree_.forEachInExtent(t,e);this.featuresCollection_&&this.featuresCollection_.forEach(e)},e.prototype.forEachFeatureIntersectingExtent=function(t,e){return this.forEachFeatureInExtent(t,(function(r){if(r.getGeometry().intersectsExtent(t)){var n=e(r);if(n)return n}}))},e.prototype.getFeaturesCollection=function(){return this.featuresCollection_},e.prototype.getFeatures=function(){var t;return this.featuresCollection_?t=this.featuresCollection_.getArray().slice(0):this.featuresRtree_&&(t=this.featuresRtree_.getAll(),_t(this.nullGeometryFeatures_)||ht(t,vt(this.nullGeometryFeatures_))),t},e.prototype.getFeaturesAtCoordinate=function(t){var e=[];return this.forEachFeatureAtCoordinateDirect(t,(function(t){e.push(t)})),e},e.prototype.getFeaturesInExtent=function(t,e){var r=this;if(this.featuresRtree_){if(!(e&&e.canWrapX()&&this.getWrapX()))return this.featuresRtree_.getInExtent(t);var n=function(t,e){if(e.canWrapX()){var r=e.getExtent();if(!isFinite(t[0])||!isFinite(t[2]))return[[r[0],t[1],r[2],t[3]]];Er(t,e);var n=wr(r);if(wr(t)>n)return[[r[0],t[1],r[2],t[3]]];if(t[0]<r[0])return[[t[0]+n,t[1],r[2],t[3]],[r[0],t[1],t[2],t[3]]];if(t[2]>r[2])return[[t[0],t[1],r[2],t[3]],[r[0],t[1],t[2]-n,t[3]]]}return[t]}(t,e);return[].concat.apply([],n.map((function(t){return r.featuresRtree_.getInExtent(t)})))}return this.featuresCollection_?this.featuresCollection_.getArray().slice(0):[]},e.prototype.getClosestFeatureToCoordinate=function(t,e){var r=t[0],n=t[1],i=null,o=[NaN,NaN],a=1/0,s=[-1/0,-1/0,1/0,1/0],l=e||pt;return this.featuresRtree_.forEachInExtent(s,(function(t){if(l(t)){var e=t.getGeometry(),u=a;if((a=e.closestPointXY(r,n,o,a))<u){i=t;var h=Math.sqrt(a);s[0]=r-h,s[1]=n-h,s[2]=r+h,s[3]=n+h}}})),i},e.prototype.getExtent=function(t){return this.featuresRtree_.getExtent(t)},e.prototype.getFeatureById=function(t){var e=this.idIndex_[t.toString()];return void 0!==e?e:null},e.prototype.getFeatureByUid=function(t){var e=this.uidIndex_[t];return void 0!==e?e:null},e.prototype.getFormat=function(){return this.format_},e.prototype.getOverlaps=function(){return this.overlaps_},e.prototype.getUrl=function(){return this.url_},e.prototype.handleFeatureChange_=function(t){var e=t.target,r=l(e),n=e.getGeometry();if(n){var i=n.getExtent();r in this.nullGeometryFeatures_?(delete this.nullGeometryFeatures_[r],this.featuresRtree_&&this.featuresRtree_.insert(i,e)):this.featuresRtree_&&this.featuresRtree_.update(i,e)}else r in this.nullGeometryFeatures_||(this.featuresRtree_&&this.featuresRtree_.remove(e),this.nullGeometryFeatures_[r]=e);var o=e.getId();if(void 0!==o){var a=o.toString();this.idIndex_[a]!==e&&(this.removeFromIdIndex_(e),this.idIndex_[a]=e)}else this.removeFromIdIndex_(e),this.uidIndex_[r]=e;this.changed(),this.dispatchEvent(new Hc(Nc,e))},e.prototype.hasFeature=function(t){var e=t.getId();return void 0!==e?e in this.idIndex_:l(t)in this.uidIndex_},e.prototype.isEmpty=function(){return this.featuresRtree_?this.featuresRtree_.isEmpty()&&_t(this.nullGeometryFeatures_):!this.featuresCollection_||0===this.featuresCollection_.getLength()},e.prototype.loadFeatures=function(t,e,r){for(var n=this.loadedExtentsRtree_,i=this.strategy_(t,e,r),o=function(t,o){var s=i[t];n.forEachInExtent(s,(function(t){return He(t.extent,s)}))||(++a.loadingExtentsCount_,a.dispatchEvent(new Hc(Vc)),a.loader_.call(a,s,e,r,function(t){--this.loadingExtentsCount_,this.dispatchEvent(new Hc(Xc,void 0,t))}.bind(a),function(){--this.loadingExtentsCount_,this.dispatchEvent(new Hc(Wc))}.bind(a)),n.insert(s,{extent:s.slice()}))},a=this,s=0,l=i.length;s<l;++s)o(s);this.loading=!(this.loader_.length<4)&&this.loadingExtentsCount_>0},e.prototype.refresh=function(){this.clear(!0),this.loadedExtentsRtree_.clear(),t.prototype.refresh.call(this)},e.prototype.removeLoadedExtent=function(t){var e,r=this.loadedExtentsRtree_;r.forEachInExtent(t,(function(r){if(ir(r.extent,t))return e=r,!0})),e&&r.remove(e)},e.prototype.removeFeature=function(t){if(t){var e=l(t);e in this.nullGeometryFeatures_?delete this.nullGeometryFeatures_[e]:this.featuresRtree_&&this.featuresRtree_.remove(t),this.removeFeatureInternal(t)&&this.changed()}},e.prototype.removeFeatureInternal=function(t){var e=l(t),r=this.featureChangeKeys_[e];if(r){r.forEach(jt),delete this.featureChangeKeys_[e];var n=t.getId();return void 0!==n&&delete this.idIndex_[n.toString()],delete this.uidIndex_[e],this.dispatchEvent(new Hc(Bc,t)),t}},e.prototype.removeFromIdIndex_=function(t){var e=!1;for(var r in this.idIndex_)if(this.idIndex_[r]===t){delete this.idIndex_[r],e=!0;break}return e},e.prototype.setLoader=function(t){this.loader_=t},e.prototype.setUrl=function(t){_(this.format_,7),this.url_=t,this.setLoader(Kc(t,this.format_))},e}(Gc),Qc=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)}}(),$c="Point",tp="LineString",ep="Polygon",rp="Circle",np="drawstart",ip="drawend",op="drawabort",ap=function(t){function e(e,r){var n=t.call(this,e)||this;return n.feature=r,n}return Qc(e,t),e}(nt),sp=function(t){function e(e){var r=this,n=e;n.stopDown||(n.stopDown=ft),(r=t.call(this,n)||this).on,r.once,r.un,r.shouldHandle_=!1,r.downPx_=null,r.downTimeout_,r.lastDragTime_,r.pointerType_,r.freehand_=!1,r.source_=e.source?e.source:null,r.features_=e.features?e.features:null,r.snapTolerance_=e.snapTolerance?e.snapTolerance:12,r.type_=e.type,r.mode_=function(t){switch(t){case"Point":case"MultiPoint":return $c;case"LineString":case"MultiLineString":return tp;case"Polygon":case"MultiPolygon":return ep;case"Circle":return rp;default:throw new Error("Invalid type: "+t)}}(r.type_),r.stopClick_=!!e.stopClick,r.minPoints_=e.minPoints?e.minPoints:r.mode_===ep?3:2,r.maxPoints_=r.mode_===rp?2:e.maxPoints?e.maxPoints:1/0,r.finishCondition_=e.finishCondition?e.finishCondition:pt,r.geometryLayout_=e.geometryLayout?e.geometryLayout:Gr;var i,o=e.geometryFunction;if(!o){var a,s=r.mode_;if(s===rp)o=function(t,e,r){var n=e||new mi([NaN,NaN]),i=ei(t[0]),o=Rn(i,ei(t[t.length-1]));return n.setCenterAndRadius(i,Math.sqrt(o),this.geometryLayout_),n};else s===$c?a=oo:s===tp?a=$i:s===ep&&(a=mo),o=function(t,e,r){return e?s===ep?t[0].length?e.setCoordinates([t[0].concat([t[0][0]])],this.geometryLayout_):e.setCoordinates([],this.geometryLayout_):e.setCoordinates(t,this.geometryLayout_):e=new a(t,this.geometryLayout_),e}}return r.geometryFunction_=o,r.dragVertexDelay_=void 0!==e.dragVertexDelay?e.dragVertexDelay:500,r.finishCoordinate_=null,r.sketchFeature_=null,r.sketchPoint_=null,r.sketchCoords_=null,r.sketchLine_=null,r.sketchLineCoords_=null,r.squaredClickTolerance_=e.clickTolerance?e.clickTolerance*e.clickTolerance:36,r.overlay_=new Ac({source:new Jc({useSpatialIndex:!1,wrapX:!!e.wrapX&&e.wrapX}),style:e.style?e.style:(i=Ao(),function(t,e){return i[t.getGeometry().getType()]}),updateWhileInteracting:!0}),r.geometryName_=e.geometryName,r.condition_=e.condition?e.condition:su,r.freehandCondition_,e.freehand?r.freehandCondition_=nu:r.freehandCondition_=e.freehandCondition?e.freehandCondition:lu,r.addChangeListener(Xl,r.updateState_),r}return Qc(e,t),e.prototype.setMap=function(e){t.prototype.setMap.call(this,e),this.updateState_()},e.prototype.getOverlay=function(){return this.overlay_},e.prototype.handleEvent=function(e){e.originalEvent.type===St&&e.originalEvent.preventDefault(),this.freehand_=this.mode_!==$c&&this.freehandCondition_(e);var r=e.type===ms.POINTERMOVE,n=!0;!this.freehand_&&this.lastDragTime_&&e.type===ms.POINTERDRAG&&(Date.now()-this.lastDragTime_>=this.dragVertexDelay_?(this.downPx_=e.pixel,this.shouldHandle_=!this.freehand_,r=!0):this.lastDragTime_=void 0,this.shouldHandle_&&void 0!==this.downTimeout_&&(clearTimeout(this.downTimeout_),this.downTimeout_=void 0));return this.freehand_&&e.type===ms.POINTERDRAG&&null!==this.sketchFeature_?(this.addToDrawing_(e.coordinate),n=!1):this.freehand_&&e.type===ms.POINTERDOWN?n=!1:r&&this.getPointerCount()<2?(n=e.type===ms.POINTERMOVE)&&this.freehand_?(this.handlePointerMove_(e),this.shouldHandle_&&e.originalEvent.preventDefault()):("mouse"===e.originalEvent.pointerType||e.type===ms.POINTERDRAG&&void 0===this.downTimeout_)&&this.handlePointerMove_(e):e.type===ms.DBLCLICK&&(n=!1),t.prototype.handleEvent.call(this,e)&&n},e.prototype.handleDownEvent=function(t){return this.shouldHandle_=!this.freehand_,this.freehand_?(this.downPx_=t.pixel,this.finishCoordinate_||this.startDrawing_(t.coordinate),!0):this.condition_(t)?(this.lastDragTime_=Date.now(),this.downTimeout_=setTimeout(function(){this.handlePointerMove_(new _s(ms.POINTERMOVE,t.map,t.originalEvent,!1,t.frameState))}.bind(this),this.dragVertexDelay_),this.downPx_=t.pixel,!0):(this.lastDragTime_=void 0,!1)},e.prototype.handleUpEvent=function(t){var e=!0;if(0===this.getPointerCount())if(this.downTimeout_&&(clearTimeout(this.downTimeout_),this.downTimeout_=void 0),this.handlePointerMove_(t),this.shouldHandle_){var r=!this.finishCoordinate_;r&&this.startDrawing_(t.coordinate),!r&&this.freehand_?this.finishDrawing():this.freehand_||r&&this.mode_!==$c||(this.atFinish_(t.pixel)?this.finishCondition_(t)&&this.finishDrawing():this.addToDrawing_(t.coordinate)),e=!1}else this.freehand_&&this.abortDrawing();return!e&&this.stopClick_&&t.preventDefault(),e},e.prototype.handlePointerMove_=function(t){if(this.pointerType_=t.originalEvent.pointerType,this.downPx_&&(!this.freehand_&&this.shouldHandle_||this.freehand_&&!this.shouldHandle_)){var e=this.downPx_,r=t.pixel,n=e[0]-r[0],i=e[1]-r[1],o=n*n+i*i;if(this.shouldHandle_=this.freehand_?o>this.squaredClickTolerance_:o<=this.squaredClickTolerance_,!this.shouldHandle_)return}this.finishCoordinate_?this.modifyDrawing_(t.coordinate):this.createOrUpdateSketchPoint_(t.coordinate.slice())},e.prototype.atFinish_=function(t){var e=!1;if(this.sketchFeature_){var r=!1,n=[this.finishCoordinate_],i=this.mode_;if(i===$c)e=!0;else if(i===rp)e=2===this.sketchCoords_.length;else if(i===tp)r=this.sketchCoords_.length>this.minPoints_;else if(i===ep){var o=this.sketchCoords_;r=o[0].length>this.minPoints_,n=[o[0][0],o[0][o[0].length-2]]}if(r)for(var a=this.getMap(),s=0,l=n.length;s<l;s++){var u=n[s],h=a.getPixelFromCoordinate(u),c=t[0]-h[0],p=t[1]-h[1],f=this.freehand_?1:this.snapTolerance_;if(e=Math.sqrt(c*c+p*p)<=f){this.finishCoordinate_=u;break}}}return e},e.prototype.createOrUpdateSketchPoint_=function(t){this.sketchPoint_?this.sketchPoint_.getGeometry().setCoordinates(t):(this.sketchPoint_=new jr(new oo(t)),this.updateSketchFeatures_())},e.prototype.createOrUpdateCustomSketchLine_=function(t){this.sketchLine_||(this.sketchLine_=new jr);var e=t.getLinearRing(0),r=this.sketchLine_.getGeometry();r?(r.setFlatCoordinates(e.getLayout(),e.getFlatCoordinates()),r.changed()):(r=new $i(e.getFlatCoordinates(),e.getLayout()),this.sketchLine_.setGeometry(r))},e.prototype.startDrawing_=function(t){for(var e=this.getMap().getView().getProjection(),r=fi(this.geometryLayout_);t.length<r;)t.push(0);this.finishCoordinate_=t,this.mode_===$c?this.sketchCoords_=t.slice():this.mode_===ep?(this.sketchCoords_=[[t.slice(),t.slice()]],this.sketchLineCoords_=this.sketchCoords_[0]):this.sketchCoords_=[t.slice(),t.slice()],this.sketchLineCoords_&&(this.sketchLine_=new jr(new $i(this.sketchLineCoords_)));var n=this.geometryFunction_(this.sketchCoords_,void 0,e);this.sketchFeature_=new jr,this.geometryName_&&this.sketchFeature_.setGeometryName(this.geometryName_),this.sketchFeature_.setGeometry(n),this.updateSketchFeatures_(),this.dispatchEvent(new ap(np,this.sketchFeature_))},e.prototype.modifyDrawing_=function(t){for(var e,r,n=this.getMap(),i=this.sketchFeature_.getGeometry(),o=n.getView().getProjection(),a=fi(this.geometryLayout_);t.length<a;)t.push(0);(this.mode_===$c?r=this.sketchCoords_:this.mode_===ep?(r=(e=this.sketchCoords_[0])[e.length-1],this.atFinish_(n.getPixelFromCoordinate(t))&&(t=this.finishCoordinate_.slice())):r=(e=this.sketchCoords_)[e.length-1],r[0]=t[0],r[1]=t[1],this.geometryFunction_(this.sketchCoords_,i,o),this.sketchPoint_)&&this.sketchPoint_.getGeometry().setCoordinates(t);if("Polygon"===i.getType()&&this.mode_!==ep)this.createOrUpdateCustomSketchLine_(i);else if(this.sketchLineCoords_){this.sketchLine_.getGeometry().setCoordinates(this.sketchLineCoords_)}this.updateSketchFeatures_()},e.prototype.addToDrawing_=function(t){var e,r,n=this.sketchFeature_.getGeometry(),i=this.getMap().getView().getProjection(),o=this.mode_;o===tp||o===rp?(this.finishCoordinate_=t.slice(),(r=this.sketchCoords_).length>=this.maxPoints_&&(this.freehand_?r.pop():e=!0),r.push(t.slice()),this.geometryFunction_(r,n,i)):o===ep&&((r=this.sketchCoords_[0]).length>=this.maxPoints_&&(this.freehand_?r.pop():e=!0),r.push(t.slice()),e&&(this.finishCoordinate_=r[0]),this.geometryFunction_(this.sketchCoords_,n,i)),this.createOrUpdateSketchPoint_(t.slice()),this.updateSketchFeatures_(),e&&this.finishDrawing()},e.prototype.removeLastPoint=function(){if(this.sketchFeature_){var t,e=this.sketchFeature_.getGeometry(),r=this.getMap().getView().getProjection(),n=this.mode_;if(n===tp||n===rp){if((t=this.sketchCoords_).splice(-2,1),t.length>=2){this.finishCoordinate_=t[t.length-2].slice();var i=this.finishCoordinate_.slice();t[t.length-1]=i,this.createOrUpdateSketchPoint_(i)}this.geometryFunction_(t,e,r),"Polygon"===e.getType()&&this.sketchLine_&&this.createOrUpdateCustomSketchLine_(e)}else if(n===ep){(t=this.sketchCoords_[0]).splice(-2,1);var o=this.sketchLine_.getGeometry();if(t.length>=2){i=t[t.length-2].slice();t[t.length-1]=i,this.createOrUpdateSketchPoint_(i)}o.setCoordinates(t),this.geometryFunction_(this.sketchCoords_,e,r)}1===t.length&&this.abortDrawing(),this.updateSketchFeatures_()}},e.prototype.finishDrawing=function(){var t=this.abortDrawing_();if(t){var e=this.sketchCoords_,r=t.getGeometry(),n=this.getMap().getView().getProjection();this.mode_===tp?(e.pop(),this.geometryFunction_(e,r,n)):this.mode_===ep&&(e[0].pop(),this.geometryFunction_(e,r,n),e=r.getCoordinates()),"MultiPoint"===this.type_?t.setGeometry(new lo([e])):"MultiLineString"===this.type_?t.setGeometry(new ro([e])):"MultiPolygon"===this.type_&&t.setGeometry(new Eo([e])),this.dispatchEvent(new ap(ip,t)),this.features_&&this.features_.push(t),this.source_&&this.source_.addFeature(t)}},e.prototype.abortDrawing_=function(){this.finishCoordinate_=null;var t=this.sketchFeature_;return this.sketchFeature_=null,this.sketchPoint_=null,this.sketchLine_=null,this.overlay_.getSource().clear(!0),t},e.prototype.abortDrawing=function(){var t=this.abortDrawing_();t&&this.dispatchEvent(new ap(op,t))},e.prototype.appendCoordinates=function(t){var e,r=this.mode_,n=!this.sketchFeature_;if(n&&this.startDrawing_(t[0]),r===tp||r===rp)e=this.sketchCoords_;else{if(r!==ep)return;e=this.sketchCoords_&&this.sketchCoords_.length?this.sketchCoords_[0]:[]}n&&e.shift(),e.pop();for(var i=0;i<t.length;i++)this.addToDrawing_(t[i]);var o=t[t.length-1];this.addToDrawing_(o),this.modifyDrawing_(o)},e.prototype.extend=function(t){var e=t.getGeometry();this.sketchFeature_=t,this.sketchCoords_=e.getCoordinates();var r=this.sketchCoords_[this.sketchCoords_.length-1];this.finishCoordinate_=r.slice(),this.sketchCoords_.push(r.slice()),this.sketchPoint_=new jr(new oo(r)),this.updateSketchFeatures_(),this.dispatchEvent(new ap(np,this.sketchFeature_))},e.prototype.updateSketchFeatures_=function(){var t=[];this.sketchFeature_&&t.push(this.sketchFeature_),this.sketchLine_&&t.push(this.sketchLine_),this.sketchPoint_&&t.push(this.sketchPoint_);var e=this.overlay_.getSource();e.clear(!0),e.addFeatures(t)},e.prototype.updateState_=function(){var t=this.getMap(),e=this.getActive();t&&e||this.abortDrawing(),this.overlay_.setMap(e?t:null)},e}($l);var lp=sp,up=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)}}(),hp="extentchanged",cp=function(t){function e(e){var r=t.call(this,hp)||this;return r.extent=e,r}return up(e,t),e}(nt);function pp(){var t=Ao();return function(e,r){return t.Polygon}}function fp(){var t=Ao();return function(e,r){return t.Point}}function dp(t){return function(e){return We([t,e])}}function gp(t,e){return t[0]==e[0]?function(r){return We([t,[r[0],e[1]]])}:t[1]==e[1]?function(r){return We([t,[e[0],r[1]]])}:null}var yp=function(t){function e(e){var r=this,n=e||{};return(r=t.call(this,n)||this).on,r.once,r.un,r.condition_=n.condition?n.condition:nu,r.extent_=null,r.pointerHandler_=null,r.pixelTolerance_=void 0!==n.pixelTolerance?n.pixelTolerance:10,r.snappedToVertex_=!1,r.extentFeature_=null,r.vertexFeature_=null,e||(e={}),r.extentOverlay_=new Ac({source:new Jc({useSpatialIndex:!1,wrapX:!!e.wrapX}),style:e.boxStyle?e.boxStyle:pp(),updateWhileAnimating:!0,updateWhileInteracting:!0}),r.vertexOverlay_=new Ac({source:new Jc({useSpatialIndex:!1,wrapX:!!e.wrapX}),style:e.pointerStyle?e.pointerStyle:fp(),updateWhileAnimating:!0,updateWhileInteracting:!0}),e.extent&&r.setExtent(e.extent),r}return up(e,t),e.prototype.snapToVertex_=function(t,e){var r=e.getCoordinateFromPixelInternal(t),n=this.getExtentInternal();if(n){var i=function(t){return[[[t[0],t[1]],[t[0],t[3]]],[[t[0],t[3]],[t[2],t[3]]],[[t[2],t[3]],[t[2],t[1]]],[[t[2],t[1]],[t[0],t[1]]]]}(n);i.sort((function(t,e){return Fn(r,t)-Fn(r,e)}));var o=i[0],a=En(r,o),s=e.getPixelFromCoordinateInternal(a);if(On(t,s)<=this.pixelTolerance_){var l=e.getPixelFromCoordinateInternal(o[0]),u=e.getPixelFromCoordinateInternal(o[1]),h=Rn(s,l),c=Rn(s,u),p=Math.sqrt(Math.min(h,c));return this.snappedToVertex_=p<=this.pixelTolerance_,this.snappedToVertex_&&(a=h>c?o[1]:o[0]),a}}return null},e.prototype.handlePointerMove_=function(t){var e=t.pixel,r=t.map,n=this.snapToVertex_(e,r);n||(n=r.getCoordinateFromPixelInternal(e)),this.createOrUpdatePointerFeature_(n)},e.prototype.createOrUpdateExtentFeature_=function(t){var e=this.extentFeature_;return e?t?e.setGeometry(xo(t)):e.setGeometry(void 0):(e=new jr(t?xo(t):{}),this.extentFeature_=e,this.extentOverlay_.getSource().addFeature(e)),e},e.prototype.createOrUpdatePointerFeature_=function(t){var e=this.vertexFeature_;e?e.getGeometry().setCoordinates(t):(e=new jr(new oo(t)),this.vertexFeature_=e,this.vertexOverlay_.getSource().addFeature(e));return e},e.prototype.handleEvent=function(e){return!e.originalEvent||!this.condition_(e)||(e.type!=ms.POINTERMOVE||this.handlingDownUpSequence||this.handlePointerMove_(e),t.prototype.handleEvent.call(this,e),!1)},e.prototype.handleDownEvent=function(t){var e=t.pixel,r=t.map,n=this.getExtentInternal(),i=this.snapToVertex_(e,r),o=function(t){var e=null,r=null;return t[0]==n[0]?e=n[2]:t[0]==n[2]&&(e=n[0]),t[1]==n[1]?r=n[3]:t[1]==n[3]&&(r=n[1]),null!==e&&null!==r?[e,r]:null};if(i&&n){var a=i[0]==n[0]||i[0]==n[2]?i[0]:null,s=i[1]==n[1]||i[1]==n[3]?i[1]:null;null!==a&&null!==s?this.pointerHandler_=dp(o(i)):null!==a?this.pointerHandler_=gp(o([a,n[1]]),o([a,n[3]])):null!==s&&(this.pointerHandler_=gp(o([n[0],s]),o([n[2],s])))}else i=r.getCoordinateFromPixelInternal(e),this.setExtent([i[0],i[1],i[0],i[1]]),this.pointerHandler_=dp(i);return!0},e.prototype.handleDragEvent=function(t){if(this.pointerHandler_){var e=t.coordinate;this.setExtent(this.pointerHandler_(e)),this.createOrUpdatePointerFeature_(e)}},e.prototype.handleUpEvent=function(t){this.pointerHandler_=null;var e=this.getExtentInternal();return e&&0!==hr(e)||this.setExtent(null),!1},e.prototype.setMap=function(e){this.extentOverlay_.setMap(e),this.vertexOverlay_.setMap(e),t.prototype.setMap.call(this,e)},e.prototype.getExtent=function(){return ri(this.getExtentInternal(),this.getMap().getView().getProjection())},e.prototype.getExtentInternal=function(){return this.extent_},e.prototype.setExtent=function(t){this.extent_=t||null,this.createOrUpdateExtentFeature_(t),this.dispatchEvent(new cp(this.extent_))},e}($l),vp=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)}}(),_p=[0,0,0,0],mp=[],xp="modifystart",wp="modifyend",bp=function(t){function e(e,r,n){var i=t.call(this,e)||this;return i.features=r,i.mapBrowserEvent=n,i}return vp(e,t),e}(nt),Sp=function(t){function e(e){var r,n=t.call(this,e)||this;if(n.on,n.once,n.un,n.boundHandleFeatureChange_=n.handleFeatureChange_.bind(n),n.condition_=e.condition?e.condition:cu,n.defaultDeleteCondition_=function(t){return function(t){var e=t.originalEvent;return e.altKey&&!(e.metaKey||e.ctrlKey)&&!e.shiftKey}(t)&&au(t)},n.deleteCondition_=e.deleteCondition?e.deleteCondition:n.defaultDeleteCondition_,n.insertVertexCondition_=e.insertVertexCondition?e.insertVertexCondition:nu,n.vertexFeature_=null,n.vertexSegments_=null,n.lastPixel_=[0,0],n.ignoreNextSingleClick_=!1,n.featuresBeingModified_=null,n.rBush_=new kc,n.pixelTolerance_=void 0!==e.pixelTolerance?e.pixelTolerance:10,n.snappedToVertex_=!1,n.changingFeature_=!1,n.dragSegments_=[],n.overlay_=new Ac({source:new Jc({useSpatialIndex:!1,wrapX:!!e.wrapX}),style:e.style?e.style:Pp(),updateWhileAnimating:!0,updateWhileInteracting:!0}),n.SEGMENT_WRITERS_={Point:n.writePointGeometry_.bind(n),LineString:n.writeLineStringGeometry_.bind(n),LinearRing:n.writeLineStringGeometry_.bind(n),Polygon:n.writePolygonGeometry_.bind(n),MultiPoint:n.writeMultiPointGeometry_.bind(n),MultiLineString:n.writeMultiLineStringGeometry_.bind(n),MultiPolygon:n.writeMultiPolygonGeometry_.bind(n),Circle:n.writeCircleGeometry_.bind(n),GeometryCollection:n.writeGeometryCollectionGeometry_.bind(n)},n.source_=null,n.hitDetection_=null,e.features?r=e.features:e.source&&(n.source_=e.source,r=new us(n.source_.getFeatures()),n.source_.addEventListener(zc,n.handleSourceAdd_.bind(n)),n.source_.addEventListener(Bc,n.handleSourceRemove_.bind(n))),!r)throw new Error("The modify interaction requires features, a source or a layer");return e.hitDetection&&(n.hitDetection_=e.hitDetection),n.features_=r,n.features_.forEach(n.addFeature_.bind(n)),n.features_.addEventListener(ns,n.handleFeatureAdd_.bind(n)),n.features_.addEventListener(is,n.handleFeatureRemove_.bind(n)),n.lastPointerEvent_=null,n.delta_=[0,0],n.snapToPointer_=void 0===e.snapToPointer?!n.hitDetection_:e.snapToPointer,n}return vp(e,t),e.prototype.addFeature_=function(t){var e=t.getGeometry();if(e){var r=this.SEGMENT_WRITERS_[e.getType()];r&&r(t,e)}var n=this.getMap();n&&n.isRendered()&&this.getActive()&&this.handlePointerAtPixel_(this.lastPixel_,n),t.addEventListener(wt,this.boundHandleFeatureChange_)},e.prototype.willModifyFeatures_=function(t,e){if(!this.featuresBeingModified_){this.featuresBeingModified_=new us;for(var r=this.featuresBeingModified_.getArray(),n=0,i=e.length;n<i;++n)for(var o=e[n],a=0,s=o.length;a<s;++a){var l=o[a].feature;l&&-1===r.indexOf(l)&&this.featuresBeingModified_.push(l)}0===this.featuresBeingModified_.getLength()?this.featuresBeingModified_=null:this.dispatchEvent(new bp(xp,this.featuresBeingModified_,t))}},e.prototype.removeFeature_=function(t){this.removeFeatureSegmentData_(t),this.vertexFeature_&&0===this.features_.getLength()&&(this.overlay_.getSource().removeFeature(this.vertexFeature_),this.vertexFeature_=null),t.removeEventListener(wt,this.boundHandleFeatureChange_)},e.prototype.removeFeatureSegmentData_=function(t){var e=this.rBush_,r=[];e.forEach((function(e){t===e.feature&&r.push(e)}));for(var n=r.length-1;n>=0;--n){for(var i=r[n],o=this.dragSegments_.length-1;o>=0;--o)this.dragSegments_[o][0]===i&&this.dragSegments_.splice(o,1);e.remove(i)}},e.prototype.setActive=function(e){this.vertexFeature_&&!e&&(this.overlay_.getSource().removeFeature(this.vertexFeature_),this.vertexFeature_=null),t.prototype.setActive.call(this,e)},e.prototype.setMap=function(e){this.overlay_.setMap(e),t.prototype.setMap.call(this,e)},e.prototype.getOverlay=function(){return this.overlay_},e.prototype.handleSourceAdd_=function(t){t.feature&&this.features_.push(t.feature)},e.prototype.handleSourceRemove_=function(t){t.feature&&this.features_.remove(t.feature)},e.prototype.handleFeatureAdd_=function(t){this.addFeature_(t.element)},e.prototype.handleFeatureChange_=function(t){if(!this.changingFeature_){var e=t.target;this.removeFeature_(e),this.addFeature_(e)}},e.prototype.handleFeatureRemove_=function(t){var e=t.element;this.removeFeature_(e)},e.prototype.writePointGeometry_=function(t,e){var r=e.getCoordinates(),n={feature:t,geometry:e,segment:[r,r]};this.rBush_.insert(e.getExtent(),n)},e.prototype.writeMultiPointGeometry_=function(t,e){for(var r=e.getCoordinates(),n=0,i=r.length;n<i;++n){var o=r[n],a={feature:t,geometry:e,depth:[n],index:n,segment:[o,o]};this.rBush_.insert(e.getExtent(),a)}},e.prototype.writeLineStringGeometry_=function(t,e){for(var r=e.getCoordinates(),n=0,i=r.length-1;n<i;++n){var o=r.slice(n,n+2),a={feature:t,geometry:e,index:n,segment:o};this.rBush_.insert(We(o),a)}},e.prototype.writeMultiLineStringGeometry_=function(t,e){for(var r=e.getCoordinates(),n=0,i=r.length;n<i;++n)for(var o=r[n],a=0,s=o.length-1;a<s;++a){var l=o.slice(a,a+2),u={feature:t,geometry:e,depth:[n],index:a,segment:l};this.rBush_.insert(We(l),u)}},e.prototype.writePolygonGeometry_=function(t,e){for(var r=e.getCoordinates(),n=0,i=r.length;n<i;++n)for(var o=r[n],a=0,s=o.length-1;a<s;++a){var l=o.slice(a,a+2),u={feature:t,geometry:e,depth:[n],index:a,segment:l};this.rBush_.insert(We(l),u)}},e.prototype.writeMultiPolygonGeometry_=function(t,e){for(var r=e.getCoordinates(),n=0,i=r.length;n<i;++n)for(var o=r[n],a=0,s=o.length;a<s;++a)for(var l=o[a],u=0,h=l.length-1;u<h;++u){var c=l.slice(u,u+2),p={feature:t,geometry:e,depth:[a,n],index:u,segment:c};this.rBush_.insert(We(c),p)}},e.prototype.writeCircleGeometry_=function(t,e){var r=e.getCenter(),n={feature:t,geometry:e,index:0,segment:[r,r]},i={feature:t,geometry:e,index:1,segment:[r,r]},o=[n,i];n.featureSegments=o,i.featureSegments=o,this.rBush_.insert(rr(r),n);var a=e;this.rBush_.insert(a.getExtent(),i)},e.prototype.writeGeometryCollectionGeometry_=function(t,e){for(var r=e.getGeometriesArray(),n=0;n<r.length;++n){var i=r[n];(0,this.SEGMENT_WRITERS_[i.getType()])(t,i)}},e.prototype.createOrUpdateVertexFeature_=function(t,e,r){var n=this.vertexFeature_;n?n.getGeometry().setCoordinates(t):(n=new jr(new oo(t)),this.vertexFeature_=n,this.overlay_.getSource().addFeature(n));return n.set("features",e),n.set("geometries",r),n},e.prototype.handleEvent=function(e){return!e.originalEvent||(this.lastPointerEvent_=e,e.map.getView().getInteracting()||e.type!=ms.POINTERMOVE||this.handlingDownUpSequence||this.handlePointerMove_(e),this.vertexFeature_&&this.deleteCondition_(e)&&(r=!(e.type!=ms.SINGLECLICK||!this.ignoreNextSingleClick_)||this.removePoint()),e.type==ms.SINGLECLICK&&(this.ignoreNextSingleClick_=!1),t.prototype.handleEvent.call(this,e)&&!r);var r},e.prototype.handleDragEvent=function(t){this.ignoreNextSingleClick_=!1,this.willModifyFeatures_(t,this.dragSegments_);for(var e=[t.coordinate[0]+this.delta_[0],t.coordinate[1]+this.delta_[1]],r=[],n=[],i=0,o=this.dragSegments_.length;i<o;++i){var a=this.dragSegments_[i],s=a[0],l=s.feature;-1===r.indexOf(l)&&r.push(l);var u=s.geometry;-1===n.indexOf(u)&&n.push(u);for(var h=s.depth,c=void 0,p=s.segment,f=a[1];e.length<u.getStride();)e.push(p[f][e.length]);switch(u.getType()){case"Point":c=e,p[0]=e,p[1]=e;break;case"MultiPoint":(c=u.getCoordinates())[s.index]=e,p[0]=e,p[1]=e;break;case"LineString":(c=u.getCoordinates())[s.index+f]=e,p[f]=e;break;case"MultiLineString":case"Polygon":(c=u.getCoordinates())[h[0]][s.index+f]=e,p[f]=e;break;case"MultiPolygon":(c=u.getCoordinates())[h[1]][h[0]][s.index+f]=e,p[f]=e;break;case"Circle":if(p[0]=e,p[1]=e,0===s.index)this.changingFeature_=!0,u.setCenter(e),this.changingFeature_=!1;else{this.changingFeature_=!0;t.map.getView().getProjection();var d=On(ei(u.getCenter()),ei(e));u.setRadius(d),this.changingFeature_=!1}}c&&this.setGeometryCoordinates_(u,c)}this.createOrUpdateVertexFeature_(e,r,n)},e.prototype.handleDownEvent=function(t){if(!this.condition_(t))return!1;var e=t.coordinate;this.handlePointerAtPixel_(t.pixel,t.map,e),this.dragSegments_.length=0,this.featuresBeingModified_=null;var r=this.vertexFeature_;if(r){var n=t.map.getView().getProjection(),i=[],o=r.getGeometry().getCoordinates(),a=We([o]),s=this.rBush_.getInExtent(a),u={};s.sort(Cp);for(var h=0,c=s.length;h<c;++h){var p=s[h],f=p.segment,d=l(p.geometry),g=p.depth;if(g&&(d+="-"+g.join("-")),u[d]||(u[d]=new Array(2)),"Circle"!==p.geometry.getType()||1!==p.index)if(!Tn(f[0],o)||u[d][0])if(!Tn(f[1],o)||u[d][1])l(f)in this.vertexSegments_&&!u[d][0]&&!u[d][1]&&this.insertVertexCondition_(t)&&i.push(p);else{if(u[d][0]&&0===u[d][0].index){var y=p.geometry.getCoordinates();switch(p.geometry.getType()){case"LineString":case"MultiLineString":continue;case"MultiPolygon":y=y[g[1]];case"Polygon":if(p.index!==y[g[0]].length-2)continue}}this.dragSegments_.push([p,1]),u[d][1]=p}else this.dragSegments_.push([p,0]),u[d][0]=p;else Tn(Tp(e,p,n),o)&&!u[d][0]&&(this.dragSegments_.push([p,0]),u[d][0]=p)}i.length&&this.willModifyFeatures_(t,[i]);for(var v=i.length-1;v>=0;--v)this.insertVertex_(i[v],o)}return!!this.vertexFeature_},e.prototype.handleUpEvent=function(t){for(var e=this.dragSegments_.length-1;e>=0;--e){var r=this.dragSegments_[e][0],n=r.geometry;if("Circle"===n.getType()){var i=n.getCenter(),o=r.featureSegments[0],a=r.featureSegments[1];o.segment[0]=i,o.segment[1]=i,a.segment[0]=i,a.segment[1]=i,this.rBush_.update(rr(i),o);var s=n;this.rBush_.update(s.getExtent(),a)}else this.rBush_.update(We(r.segment),r)}return this.featuresBeingModified_&&(this.dispatchEvent(new bp(wp,this.featuresBeingModified_,t)),this.featuresBeingModified_=null),!1},e.prototype.handlePointerMove_=function(t){this.lastPixel_=t.pixel,this.handlePointerAtPixel_(t.pixel,t.map,t.coordinate)},e.prototype.handlePointerAtPixel_=function(t,e,r){var n,i,o=this,a=r||e.getCoordinateFromPixel(t),s=e.getView().getProjection();if(this.hitDetection_){var u="object"==typeof this.hitDetection_?function(t){return t===o.hitDetection_}:void 0;e.forEachFeatureAtPixel(t,(function(t,e,r){if("Point"===(r=r||t.getGeometry()).getType()&&st(o.features_.getArray(),t)){i=r;var a=r.getFlatCoordinates().slice(0,2);n=[{feature:t,geometry:r,segment:[a,a]}]}return!0}),{layerFilter:u})}if(!n){var h=ri(qe(ni(rr(a,_p)),e.getView().getResolution()*this.pixelTolerance_,_p));n=this.rBush_.getInExtent(h)}if(n&&n.length>0){var c=n.sort((function(t,e){return Ep(a,t,s)-Ep(a,e,s)}))[0],p=c.segment,f=Tp(a,c,s),d=e.getPixelFromCoordinate(f),g=On(t,d);if(i||g<=this.pixelTolerance_){var y={};if(y[l(p)]=!0,this.snapToPointer_||(this.delta_[0]=f[0]-a[0],this.delta_[1]=f[1]-a[1]),"Circle"===c.geometry.getType()&&1===c.index)this.snappedToVertex_=!0,this.createOrUpdateVertexFeature_(f,[c.feature],[c.geometry]);else{var v=e.getPixelFromCoordinate(p[0]),_=e.getPixelFromCoordinate(p[1]),m=Rn(d,v),x=Rn(d,_);g=Math.sqrt(Math.min(m,x)),this.snappedToVertex_=g<=this.pixelTolerance_,this.snappedToVertex_&&(f=m>x?p[1]:p[0]),this.createOrUpdateVertexFeature_(f,[c.feature],[c.geometry]);var w={};w[l(c.geometry)]=!0;for(var b=1,S=n.length;b<S;++b){var C=n[b].segment;if(!(Tn(p[0],C[0])&&Tn(p[1],C[1])||Tn(p[0],C[1])&&Tn(p[1],C[0])))break;var E=l(n[b].geometry);E in w||(w[E]=!0,y[l(C)]=!0)}}return void(this.vertexSegments_=y)}}this.vertexFeature_&&(this.overlay_.getSource().removeFeature(this.vertexFeature_),this.vertexFeature_=null)},e.prototype.insertVertex_=function(t,e){for(var r,n=t.segment,i=t.feature,o=t.geometry,a=t.depth,s=t.index;e.length<o.getStride();)e.push(0);switch(o.getType()){case"MultiLineString":case"Polygon":(r=o.getCoordinates())[a[0]].splice(s+1,0,e);break;case"MultiPolygon":(r=o.getCoordinates())[a[1]][a[0]].splice(s+1,0,e);break;case"LineString":(r=o.getCoordinates()).splice(s+1,0,e);break;default:return}this.setGeometryCoordinates_(o,r);var l=this.rBush_;l.remove(t),this.updateSegmentIndices_(o,s,a,1);var u={segment:[n[0],e],feature:i,geometry:o,depth:a,index:s};l.insert(We(u.segment),u),this.dragSegments_.push([u,1]);var h={segment:[e,n[1]],feature:i,geometry:o,depth:a,index:s+1};l.insert(We(h.segment),h),this.dragSegments_.push([h,0]),this.ignoreNextSingleClick_=!0},e.prototype.removePoint=function(){if(this.lastPointerEvent_&&this.lastPointerEvent_.type!=ms.POINTERDRAG){var t=this.lastPointerEvent_;this.willModifyFeatures_(t,this.dragSegments_);var e=this.removeVertex_();return this.featuresBeingModified_&&this.dispatchEvent(new bp(wp,this.featuresBeingModified_,t)),this.featuresBeingModified_=null,e}return!1},e.prototype.removeVertex_=function(){var t,e,r,n,i,o,a,s,u,h,c,p=this.dragSegments_,f={},d=!1;for(i=p.length-1;i>=0;--i)c=l((h=(r=p[i])[0]).feature),h.depth&&(c+="-"+h.depth.join("-")),c in f||(f[c]={}),0===r[1]?(f[c].right=h,f[c].index=h.index):1==r[1]&&(f[c].left=h,f[c].index=h.index+1);for(c in f){switch(u=f[c].right,a=f[c].left,(s=(o=f[c].index)-1)<0&&(s=0),t=e=(n=(h=void 0!==a?a:u).geometry).getCoordinates(),d=!1,n.getType()){case"MultiLineString":e[h.depth[0]].length>2&&(e[h.depth[0]].splice(o,1),d=!0);break;case"LineString":e.length>2&&(e.splice(o,1),d=!0);break;case"MultiPolygon":t=t[h.depth[1]];case"Polygon":(t=t[h.depth[0]]).length>4&&(o==t.length-1&&(o=0),t.splice(o,1),d=!0,0===o&&(t.pop(),t.push(t[0]),s=t.length-1))}if(d){this.setGeometryCoordinates_(n,e);var g=[];if(void 0!==a&&(this.rBush_.remove(a),g.push(a.segment[0])),void 0!==u&&(this.rBush_.remove(u),g.push(u.segment[1])),void 0!==a&&void 0!==u){var y={depth:h.depth,feature:h.feature,geometry:h.geometry,index:s,segment:g};this.rBush_.insert(We(y.segment),y)}this.updateSegmentIndices_(n,o,h.depth,-1),this.vertexFeature_&&(this.overlay_.getSource().removeFeature(this.vertexFeature_),this.vertexFeature_=null),p.length=0}}return d},e.prototype.setGeometryCoordinates_=function(t,e){this.changingFeature_=!0,t.setCoordinates(e),this.changingFeature_=!1},e.prototype.updateSegmentIndices_=function(t,e,r,n){this.rBush_.forEachInExtent(t.getExtent(),(function(i){i.geometry===t&&(void 0===r||void 0===i.depth||ct(i.depth,r))&&i.index>e&&(i.index+=n)}))},e}($l);function Cp(t,e){return t.index-e.index}function Ep(t,e,r){var n=e.geometry;if("Circle"===n.getType()){var i=n;if(1===e.index){null;var o=Rn(i.getCenter(),ei(t)),a=Math.sqrt(o)-i.getRadius();return a*a}}var s=ei(t);return mp[0]=ei(e.segment[0]),mp[1]=ei(e.segment[1]),Fn(s,mp)}function Tp(t,e,r){var n=e.geometry;if("Circle"===n.getType()&&1===e.index){var i=n;return ti(i.getClosestPoint(ei(t)))}var o=ei(t);return mp[0]=ei(e.segment[0]),mp[1]=ei(e.segment[1]),ti(En(o,mp))}function Pp(){var t=Ao();return function(e,r){return t.Point}}var Rp=Sp,Op=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)}}(),Fp="select",Mp=function(t){function e(e,r,n,i){var o=t.call(this,e)||this;return o.selected=r,o.deselected=n,o.mapBrowserEvent=i,o}return Op(e,t),e}(nt),Ip={},Lp=function(t){function e(e){var r=t.call(this)||this;r.on,r.once,r.un;var n,i,o=e||{};if(r.boundAddFeature_=r.addFeature_.bind(r),r.boundRemoveFeature_=r.removeFeature_.bind(r),r.condition_=o.condition?o.condition:au,r.addCondition_=o.addCondition?o.addCondition:ou,r.removeCondition_=o.removeCondition?o.removeCondition:ou,r.toggleCondition_=o.toggleCondition?o.toggleCondition:lu,r.multi_=!!o.multi&&o.multi,r.filter_=o.filter?o.filter:pt,r.hitTolerance_=o.hitTolerance?o.hitTolerance:0,r.style_=void 0!==o.style?o.style:(ht((n=Ao()).Polygon,n.LineString),ht(n.GeometryCollection,n.LineString),function(t){return t.getGeometry()?n[t.getGeometry().getType()]:null}),r.features_=o.features||new us,o.layers)if("function"==typeof o.layers)i=o.layers;else{var a=o.layers;i=function(t){return st(a,t)}}else i=pt;return r.layerFilter_=i,r.featureLayerAssociation_={},r}return Op(e,t),e.prototype.addFeatureLayerAssociation_=function(t,e){this.featureLayerAssociation_[l(t)]=e},e.prototype.getFeatures=function(){return this.features_},e.prototype.getHitTolerance=function(){return this.hitTolerance_},e.prototype.getLayer=function(t){return this.featureLayerAssociation_[l(t)]},e.prototype.setHitTolerance=function(t){this.hitTolerance_=t},e.prototype.setMap=function(e){this.getMap()&&this.style_&&this.features_.forEach(this.restorePreviousStyle_.bind(this)),t.prototype.setMap.call(this,e),e?(this.features_.addEventListener(ns,this.boundAddFeature_),this.features_.addEventListener(is,this.boundRemoveFeature_),this.style_&&this.features_.forEach(this.applySelectedStyle_.bind(this))):(this.features_.removeEventListener(ns,this.boundAddFeature_),this.features_.removeEventListener(is,this.boundRemoveFeature_))},e.prototype.addFeature_=function(t){var e=t.element;if(this.style_&&this.applySelectedStyle_(e),!this.getLayer(e)){var r=this.getMap().getAllLayers().find((function(t){if(t instanceof Ac&&t.getSource()&&t.getSource().hasFeature(e))return t}));r&&this.addFeatureLayerAssociation_(e,r)}},e.prototype.removeFeature_=function(t){var e=t.element;this.style_&&this.restorePreviousStyle_(e)},e.prototype.getStyle=function(){return this.style_},e.prototype.applySelectedStyle_=function(t){var e=l(t);e in Ip||(Ip[e]=t.getStyle()),t.setStyle(this.style_)},e.prototype.restorePreviousStyle_=function(t){for(var r=this.getMap().getInteractions().getArray(),n=r.length-1;n>=0;--n){var i=r[n];if(i!==this&&i instanceof e&&i.getStyle()&&-1!==i.getFeatures().getArray().lastIndexOf(t))return void t.setStyle(i.getStyle())}var o=l(t);t.setStyle(Ip[o]),delete Ip[o]},e.prototype.removeFeatureLayerAssociation_=function(t){delete this.featureLayerAssociation_[l(t)]},e.prototype.handleEvent=function(t){if(!this.condition_(t))return!0;var e=this.addCondition_(t),r=this.removeCondition_(t),n=this.toggleCondition_(t),i=!e&&!r&&!n,o=t.map,a=this.getFeatures(),s=[],l=[];if(i){yt(this.featureLayerAssociation_),o.forEachFeatureAtPixel(t.pixel,function(t,e){if(this.filter_(t,e))return this.addFeatureLayerAssociation_(t,e),l.push(t),!this.multi_}.bind(this),{layerFilter:this.layerFilter_,hitTolerance:this.hitTolerance_});for(var u=a.getLength()-1;u>=0;--u){var h=a.item(u),c=l.indexOf(h);c>-1?l.splice(c,1):(a.remove(h),s.push(h))}0!==l.length&&a.extend(l)}else{o.forEachFeatureAtPixel(t.pixel,function(t,i){if(this.filter_(t,i))return!e&&!n||st(a.getArray(),t)?(r||n)&&st(a.getArray(),t)&&(s.push(t),this.removeFeatureLayerAssociation_(t)):(this.addFeatureLayerAssociation_(t,i),l.push(t)),!this.multi_}.bind(this),{layerFilter:this.layerFilter_,hitTolerance:this.hitTolerance_});for(var p=s.length-1;p>=0;--p)a.remove(s[p]);a.extend(l)}return(l.length>0||s.length>0)&&this.dispatchEvent(new Mp(Fp,l,s,t)),!0},e}(Yl);var Ap=Lp,kp=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 Dp(t){return t.feature?t.feature:t.element?t.element:void 0}var jp=[],Gp=function(t){function e(e){var r=this,n=e||{},i=n;return i.handleDownEvent||(i.handleDownEvent=pt),i.stopDown||(i.stopDown=ft),(r=t.call(this,i)||this).source_=n.source?n.source:null,r.vertex_=void 0===n.vertex||n.vertex,r.edge_=void 0===n.edge||n.edge,r.features_=n.features?n.features:null,r.featuresListenerKeys_=[],r.featureChangeListenerKeys_={},r.indexedFeaturesExtents_={},r.pendingFeatures_={},r.pixelTolerance_=void 0!==n.pixelTolerance?n.pixelTolerance:10,r.rBush_=new kc,r.GEOMETRY_SEGMENTERS_={Point:r.segmentPointGeometry_.bind(r),LineString:r.segmentLineStringGeometry_.bind(r),LinearRing:r.segmentLineStringGeometry_.bind(r),Polygon:r.segmentPolygonGeometry_.bind(r),MultiPoint:r.segmentMultiPointGeometry_.bind(r),MultiLineString:r.segmentMultiLineStringGeometry_.bind(r),MultiPolygon:r.segmentMultiPolygonGeometry_.bind(r),GeometryCollection:r.segmentGeometryCollectionGeometry_.bind(r),Circle:r.segmentCircleGeometry_.bind(r)},r}return kp(e,t),e.prototype.addFeature=function(t,e){var r=void 0===e||e,n=l(t),i=t.getGeometry();if(i){var o=this.GEOMETRY_SEGMENTERS_[i.getType()];if(o){this.indexedFeaturesExtents_[n]=i.getExtent([1/0,1/0,-1/0,-1/0]);var a=[];if(o(a,i),1===a.length)this.rBush_.insert(We(a[0]),{feature:t,segment:a[0]});else if(a.length>1){var s=a.map((function(t){return We(t)})),u=a.map((function(e){return{feature:t,segment:e}}));this.rBush_.load(s,u)}}}r&&(this.featureChangeListenerKeys_[n]=kt(t,wt,this.handleFeatureChange_,this))},e.prototype.forEachFeatureAdd_=function(t){this.addFeature(t)},e.prototype.forEachFeatureRemove_=function(t){this.removeFeature(t)},e.prototype.getFeatures_=function(){var t;return this.features_?t=this.features_:this.source_&&(t=this.source_.getFeatures()),t},e.prototype.handleEvent=function(e){var r=this.snapTo(e.pixel,e.coordinate,e.map);return r&&(e.coordinate=r.vertex.slice(0,2),e.pixel=r.vertexPixel),t.prototype.handleEvent.call(this,e)},e.prototype.handleFeatureAdd_=function(t){var e=Dp(t);this.addFeature(e)},e.prototype.handleFeatureRemove_=function(t){var e=Dp(t);this.removeFeature(e)},e.prototype.handleFeatureChange_=function(t){var e=t.target;if(this.handlingDownUpSequence){var r=l(e);r in this.pendingFeatures_||(this.pendingFeatures_[r]=e)}else this.updateFeature_(e)},e.prototype.handleUpEvent=function(t){var e=vt(this.pendingFeatures_);return e.length&&(e.forEach(this.updateFeature_.bind(this)),this.pendingFeatures_={}),!1},e.prototype.removeFeature=function(t,e){var r=void 0===e||e,n=l(t),i=this.indexedFeaturesExtents_[n];if(i){var o=this.rBush_,a=[];o.forEachInExtent(i,(function(e){t===e.feature&&a.push(e)}));for(var s=a.length-1;s>=0;--s)o.remove(a[s])}r&&(jt(this.featureChangeListenerKeys_[n]),delete this.featureChangeListenerKeys_[n])},e.prototype.setMap=function(e){var r=this.getMap(),n=this.featuresListenerKeys_,i=this.getFeatures_();r&&(n.forEach(jt),n.length=0,i.forEach(this.forEachFeatureRemove_.bind(this))),t.prototype.setMap.call(this,e),e&&(this.features_?n.push(kt(this.features_,ns,this.handleFeatureAdd_,this),kt(this.features_,is,this.handleFeatureRemove_,this)):this.source_&&n.push(kt(this.source_,zc,this.handleFeatureAdd_,this),kt(this.source_,Bc,this.handleFeatureRemove_,this)),i.forEach(this.forEachFeatureAdd_.bind(this)))},e.prototype.snapTo=function(t,e,r){var n=We([r.getCoordinateFromPixel([t[0]-this.pixelTolerance_,t[1]+this.pixelTolerance_]),r.getCoordinateFromPixel([t[0]+this.pixelTolerance_,t[1]-this.pixelTolerance_])]),i=this.rBush_.getInExtent(n),o=i.length;if(0===o)return null;r.getView().getProjection();var a,s=ei(e),l=1/0,u=this.pixelTolerance_*this.pixelTolerance_,h=function(){if(a){var e=r.getPixelFromCoordinate(a);if(Rn(t,e)<=u)return{vertex:a,vertexPixel:[Math.round(e[0]),Math.round(e[1])]}}return null};if(this.vertex_){for(var c=0;c<o;++c){"Circle"!==(p=i[c]).feature.getGeometry().getType()&&p.segment.forEach((function(t){var e=ei(t),r=Rn(s,e);r<l&&(a=t,l=r)}))}if(m=h())return m}if(this.edge_){for(c=0;c<o;++c){var p,f=null;if("Circle"===(p=i[c]).feature.getGeometry().getType()){var d=p.feature.getGeometry();null,f=ti(Cn(s,d))}else{var g=p.segment,y=g[0],v=g[1];v&&(jp[0]=ei(y),jp[1]=ei(v),f=En(s,jp))}if(f){var _=Rn(s,f);_<l&&(a=f,l=_)}}var m;if(m=h())return m}return null},e.prototype.updateFeature_=function(t){this.removeFeature(t,!1),this.addFeature(t,!1)},e.prototype.segmentCircleGeometry_=function(t,e){this.getMap().getView().getProjection();for(var r=wo(e).getCoordinates()[0],n=0,i=r.length-1;n<i;++n)t.push(r.slice(n,n+2))},e.prototype.segmentGeometryCollectionGeometry_=function(t,e){for(var r=e.getGeometriesArray(),n=0;n<r.length;++n){var i=this.GEOMETRY_SEGMENTERS_[r[n].getType()];i&&i(t,r[n])}},e.prototype.segmentLineStringGeometry_=function(t,e){for(var r=e.getCoordinates(),n=0,i=r.length-1;n<i;++n)t.push(r.slice(n,n+2))},e.prototype.segmentMultiLineStringGeometry_=function(t,e){for(var r=e.getCoordinates(),n=0,i=r.length;n<i;++n)for(var o=r[n],a=0,s=o.length-1;a<s;++a)t.push(o.slice(a,a+2))},e.prototype.segmentMultiPointGeometry_=function(t,e){e.getCoordinates().forEach((function(e){t.push([e])}))},e.prototype.segmentMultiPolygonGeometry_=function(t,e){for(var r=e.getCoordinates(),n=0,i=r.length;n<i;++n)for(var o=r[n],a=0,s=o.length;a<s;++a)for(var l=o[a],u=0,h=l.length-1;u<h;++u)t.push(l.slice(u,u+2))},e.prototype.segmentPointGeometry_=function(t,e){t.push([e.getCoordinates()])},e.prototype.segmentPolygonGeometry_=function(t,e){for(var r=e.getCoordinates(),n=0,i=r.length;n<i;++n)for(var o=r[n],a=0,s=o.length-1;a<s;++a)t.push(o.slice(a,a+2))},e}($l),zp=Gp,Np=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="translatestart",Bp="translating",Vp="translateend",Xp=function(t){function e(e,r,n,i,o){var a=t.call(this,e)||this;return a.features=r,a.coordinate=n,a.startCoordinate=i,a.mapBrowserEvent=o,a}return Np(e,t),e}(nt),Wp=function(t){function e(e){var r,n=this,i=e||{};if((n=t.call(this,i)||this).on,n.once,n.un,n.lastCoordinate_=null,n.startCoordinate_=null,n.features_=void 0!==i.features?i.features:null,i.layers&&!n.features_)if("function"==typeof i.layers)r=i.layers;else{var o=i.layers;r=function(t){return st(o,t)}}else r=pt;return n.layerFilter_=r,n.filter_=i.filter&&!n.features_?i.filter:pt,n.hitTolerance_=i.hitTolerance?i.hitTolerance:0,n.condition_=i.condition?i.condition:nu,n.lastFeature_=null,n.addChangeListener(Xl,n.handleActiveChanged_),n}return Np(e,t),e.prototype.handleDownEvent=function(t){if(!t.originalEvent||!this.condition_(t))return!1;if(this.lastFeature_=this.featuresAtPixel_(t.pixel,t.map),!this.lastCoordinate_&&this.lastFeature_){this.startCoordinate_=t.coordinate,this.lastCoordinate_=t.coordinate,this.handleMoveEvent(t);var e=this.features_||new us([this.lastFeature_]);return this.dispatchEvent(new Xp(Up,e,t.coordinate,this.startCoordinate_,t)),!0}return!1},e.prototype.handleUpEvent=function(t){if(this.lastCoordinate_){this.lastCoordinate_=null,this.handleMoveEvent(t);var e=this.features_||new us([this.lastFeature_]);return this.dispatchEvent(new Xp(Vp,e,t.coordinate,this.startCoordinate_,t)),this.startCoordinate_=null,!0}return!1},e.prototype.handleDragEvent=function(t){if(this.lastCoordinate_){var e=t.coordinate,r=e[0]-this.lastCoordinate_[0],n=e[1]-this.lastCoordinate_[1],i=this.features_||new us([this.lastFeature_]);i.forEach((function(t){var e=t.getGeometry();e.translate(r,n),t.setGeometry(e)})),this.lastCoordinate_=e,this.dispatchEvent(new Xp(Bp,i,e,this.startCoordinate_,t))}},e.prototype.handleMoveEvent=function(t){var e=t.map.getViewport();this.featuresAtPixel_(t.pixel,t.map)?(e.classList.remove(this.lastCoordinate_?"ol-grab":"ol-grabbing"),e.classList.add(this.lastCoordinate_?"ol-grabbing":"ol-grab")):e.classList.remove("ol-grab","ol-grabbing")},e.prototype.featuresAtPixel_=function(t,e){return e.forEachFeatureAtPixel(t,function(t,e){if(this.filter_(t,e)&&(!this.features_||st(this.features_.getArray(),t)))return t}.bind(this),{layerFilter:this.layerFilter_,hitTolerance:this.hitTolerance_})},e.prototype.getHitTolerance=function(){return this.hitTolerance_},e.prototype.setHitTolerance=function(t){this.hitTolerance_=t},e.prototype.setMap=function(e){var r=this.getMap();t.prototype.setMap.call(this,e),this.updateState_(r)},e.prototype.handleActiveChanged_=function(){this.updateState_(null)},e.prototype.updateState_=function(t){var e=this.getMap(),r=this.getActive();e&&r||(e=e||t)&&e.getViewport().classList.remove("ol-grab","ol-grabbing")},e}($l),qp=Wp;function Yp(t){var e=t||{},r=new us,n=new Gu(-.005,.05,100);return(void 0===e.altShiftDragRotate||e.altShiftDragRotate)&&r.push(new vu),(void 0===e.doubleClickZoom||e.doubleClickZoom)&&r.push(new Hl({delta:e.zoomDelta,duration:e.zoomDuration})),(void 0===e.dragPan||e.dragPan)&&r.push(new du({onFocusOnly:e.onFocusOnly,kinetic:n})),(void 0===e.pinchRotate||e.pinchRotate)&&r.push(new Xu),(void 0===e.pinchZoom||e.pinchZoom)&&r.push(new Yu({duration:e.zoomDuration})),(void 0===e.keyboard||e.keyboard)&&(r.push(new ku),r.push(new ju({delta:e.zoomDelta,duration:e.zoomDuration}))),(void 0===e.mouseWheelZoom||e.mouseWheelZoom)&&r.push(new Bu({onFocusOnly:e.onFocusOnly,duration:e.zoomDuration})),(void 0===e.shiftDragZoom||e.shiftDragZoom)&&r.push(new Ou({duration:e.zoomDuration})),r}var Kp=Object.freeze({__proto__:null,defaults:Yp,DoubleClickZoom:Hl,DragAndDrop:Qu,DragBox:Pu,DragPan:du,DragRotate:vu,DragRotateAndZoom:eh,DragZoom:Ou,Draw:lp,Extent:yp,Interaction:Yl,KeyboardPan:ku,KeyboardZoom:ju,Modify:Rp,MouseWheelZoom:Bu,PinchRotate:Xu,PinchZoom:Yu,Pointer:$l,Select:Ap,Snap:zp,Translate:qp}),Zp=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)}}(),Hp=function(t){function e(e){return(e=gt({},e)).controls||(e.controls=function(t){var e=t||{},r=new us;return(void 0===e.zoom||e.zoom)&&r.push(new Cl(e.zoomOptions)),(void 0===e.rotate||e.rotate)&&r.push(new bl(e.rotateOptions)),(void 0===e.attribution||e.attribution)&&r.push(new ml(e.attributionOptions)),r}()),e.interactions||(e.interactions=Yp({onFocusOnly:!0})),t.call(this,e)||this}return Zp(e,t),e.prototype.createRenderer=function(){return new rs(this)},e}(fl),Jp=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.minX<this.minX&&(this.minX=t.minX),t.maxX>this.maxX&&(this.maxX=t.maxX),t.minY<this.minY&&(this.minY=t.minY),t.maxY>this.maxY&&(this.maxY=t.maxY)},t.prototype.getHeight=function(){return this.maxY-this.minY+1},t.prototype.getSize=function(){return[this.getWidth(),this.getHeight()]},t.prototype.getWidth=function(){return this.maxX-this.minX+1},t.prototype.intersects=function(t){return this.minX<=t.maxX&&this.maxX>=t.minX&&this.minY<=t.maxY&&this.maxY>=t.minY},t}();function Qp(t,e,r,n,i){return void 0!==i?(i.minX=t,i.maxX=e,i.minY=r,i.maxY=n,i):new Jp(t,e,r,n)}var $p=Jp;function tf(t,e,r,n){return void 0!==n?(n[0]=t,n[1]=e,n[2]=r,n):[t,e,r]}function ef(t,e,r){return t+"/"+e+"/"+r}function rf(t){return ef(t[0],t[1],t[2])}function nf(t){return t.split("/").map(Number)}function of(t){return(t[1]<<t[0])+t[2]}var af=[0,0,0],sf=function(){function t(t){var e;if(this.minZoom=void 0!==t.minZoom?t.minZoom:0,this.resolutions_=t.resolutions,_(function(t,e,r){var n=e||at;return t.every((function(e,i){if(0===i)return!0;var o=n(t[i-1],e);return!(o>0||r&&0===o)}))}(this.resolutions_,(function(t,e){return e-t}),!0),17),!t.origins)for(var r=0,n=this.resolutions_.length-1;r<n;++r)if(e){if(this.resolutions_[r]/this.resolutions_[r+1]!==e){e=void 0;break}}else e=this.resolutions_[r]/this.resolutions_[r+1];this.zoomFactor_=e,this.maxZoom=this.resolutions_.length-1,this.origin_=void 0!==t.origin?t.origin:null,this.origins_=null,void 0!==t.origins&&(this.origins_=t.origins,_(this.origins_.length==this.resolutions_.length,20));var i=t.extent;void 0===i||this.origin_||this.origins_||(this.origin_=mr(i)),_(!this.origin_&&this.origins_||this.origin_&&!this.origins_,18),this.tileSizes_=null,void 0!==t.tileSizes&&(this.tileSizes_=t.tileSizes,_(this.tileSizes_.length==this.resolutions_.length,19)),this.tileSize_=void 0!==t.tileSize?t.tileSize:this.tileSizes_?null:Ws,_(!this.tileSize_&&this.tileSizes_||this.tileSize_&&!this.tileSizes_,22),this.extent_=void 0!==i?i:null,this.fullTileRanges_=null,this.tmpSize_=[0,0],this.tmpExtent_=[0,0,0,0],void 0!==t.sizes?this.fullTileRanges_=t.sizes.map((function(t,e){var r=new $p(Math.min(0,t[0]),Math.max(t[0]-1,-1),Math.min(0,t[1]),Math.max(t[1]-1,-1));if(i){var n=this.getTileRangeForExtentAndZ(i,e);r.minX=Math.max(n.minX,r.minX),r.maxX=Math.min(n.maxX,r.maxX),r.minY=Math.max(n.minY,r.minY),r.maxY=Math.min(n.maxY,r.maxY)}return r}),this):i&&this.calculateTileRanges_(i)}return t.prototype.forEachTileCoord=function(t,e,r){for(var n=this.getTileRangeForExtentAndZ(t,e),i=n.minX,o=n.maxX;i<=o;++i)for(var a=n.minY,s=n.maxY;a<=s;++a)r([e,i,a])},t.prototype.forEachTileCoordParentTileRange=function(t,e,r,n){var i,o,a=null,s=t[0]-1;for(2===this.zoomFactor_?(i=t[1],o=t[2]):a=this.getTileCoordExtent(t,n);s>=this.minZoom;){if(e(s,2===this.zoomFactor_?Qp(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){if(2===this.zoomFactor_){var n=2*t[1],i=2*t[2];return Qp(n,n+1,i,i+1,e)}var o=this.getTileCoordExtent(t,r||this.tmpExtent_);return this.getTileRangeForExtentAndZ(o,t[0]+1,e)}return null},t.prototype.getTileRangeForTileCoordAndZ=function(t,e,r){if(e>this.maxZoom||e<this.minZoom)return null;var n=t[0],i=t[1],o=t[2];if(e===n)return Qp(i,o,i,o,r);if(this.zoomFactor_){var a=Math.pow(this.zoomFactor_,e-n),s=Math.floor(i*a),l=Math.floor(o*a);return e<n?Qp(s,s,l,l,r):Qp(s,Math.floor(a*(i+1))-1,l,Math.floor(a*(o+1))-1,r)}var u=this.getTileCoordExtent(t,this.tmpExtent_);return this.getTileRangeForExtentAndZ(u,e,r)},t.prototype.getTileRangeExtent=function(t,e,r){var n=this.getOrigin(t),i=this.getResolution(t),o=p(this.getTileSize(t),this.tmpSize_),a=n[0]+e.minX*o[0]*i,s=n[0]+(e.maxX+1)*o[0]*i;return tr(a,n[1]+e.minY*o[1]*i,s,n[1]+(e.maxY+1)*o[1]*i,r)},t.prototype.getTileRangeForExtentAndZ=function(t,e,r){var n=af;this.getTileCoordForXYAndZ_(t[0],t[3],e,!1,n);var i=n[1],o=n[2];return this.getTileCoordForXYAndZ_(t[2],t[1],e,!0,n),Qp(i,n[1],o,n[2],r)},t.prototype.getTileCoordCenter=function(t){var e=this.getOrigin(t[0]),r=this.getResolution(t[0]),n=p(this.getTileSize(t[0]),this.tmpSize_);return[e[0]+(t[1]+.5)*n[0]*r,e[1]-(t[2]+.5)*n[1]*r]},t.prototype.getTileCoordExtent=function(t,e){var r=this.getOrigin(t[0]),n=this.getResolution(t[0]),i=p(this.getTileSize(t[0]),this.tmpSize_),o=r[0]+t[1]*i[0]*n,a=r[1]-(t[2]+1)*i[1]*n;return tr(o,a,o+i[0]*n,a+i[1]*n,e)},t.prototype.getTileCoordForCoordAndResolution=function(t,e,r){return this.getTileCoordForXYAndResolution_(t[0],t[1],e,!1,r)},t.prototype.getTileCoordForXYAndResolution_=function(t,e,r,n,i){var o=this.getZForResolution(r),a=r/this.getResolution(o),s=this.getOrigin(o),l=p(this.getTileSize(o),this.tmpSize_),u=a*(t-s[0])/r/l[0],h=a*(s[1]-e)/r/l[1];return n?(u=M(u,5)-1,h=M(h,5)-1):(u=F(u,5),h=F(h,5)),tf(o,u,h,i)},t.prototype.getTileCoordForXYAndZ_=function(t,e,r,n,i){var o=this.getOrigin(r),a=this.getResolution(r),s=p(this.getTileSize(r),this.tmpSize_),l=(t-o[0])/a/s[0],u=(o[1]-e)/a/s[1];return n?(l=M(l,5)-1,u=M(u,5)-1):(l=F(l,5),u=F(u,5)),tf(r,l,u,i)},t.prototype.getTileCoordForCoordAndZ=function(t,e,r){return this.getTileCoordForXYAndZ_(t[0],t[1],e,!1,r)},t.prototype.getTileCoordResolution=function(t){return this.resolutions_[t[0]]},t.prototype.getTileSize=function(t){return this.tileSize_?this.tileSize_:this.tileSizes_[t]},t.prototype.getFullTileRange=function(t){return this.fullTileRanges_?this.fullTileRanges_[t]:this.extent_?this.getTileRangeForExtentAndZ(this.extent_,t):null},t.prototype.getZForResolution=function(t,e){return m(lt(this.resolutions_,t,e||0),this.minZoom,this.maxZoom)},t.prototype.tileCoordIntersectsViewport=function(t,e){return Ki(e,0,e.length,2,this.getTileCoordExtent(t))},t.prototype.calculateTileRanges_=function(t){for(var e=this.resolutions_.length,r=new Array(e),n=this.minZoom;n<e;++n)r[n]=this.getTileRangeForExtentAndZ(t,n);this.fullTileRanges_=r},t}(),lf=sf,uf=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)}}(),hf=function(t){function e(e,r,n){var i=t.call(this)||this,o=n||{};return i.tileCoord=e,i.state=r,i.interimTile=null,i.key="",i.transition_=void 0===o.transition?250:o.transition,i.transitionStarts_={},i.interpolate=!!o.interpolate,i}return uf(e,t),e.prototype.changed=function(){this.dispatchEvent(wt)},e.prototype.release=function(){},e.prototype.getKey=function(){return this.key+"/"+this.tileCoord},e.prototype.getInterimTile=function(){if(!this.interimTile)return this;var t=this.interimTile;do{if(t.getState()==js)return this.transition_=0,t;t=t.interimTile}while(t);return this},e.prototype.refreshInterimChain=function(){if(this.interimTile){var t=this.interimTile,e=this;do{if(t.getState()==js){t.interimTile=null;break}t.getState()==Ds?e=t:t.getState()==ks?e.interimTile=t.interimTile:e=t,t=e.interimTile}while(t)}},e.prototype.getTileCoord=function(){return this.tileCoord},e.prototype.getState=function(){return this.state},e.prototype.setState=function(t){if(this.state!==Gs&&this.state>t)throw new Error("Tile load sequence violation");this.state=t,this.changed()},e.prototype.load=function(){a()},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:$s(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}(xt),cf=hf,pf=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 ff,df=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 pf(e,t),e.prototype.getImage=function(){return this.image_},e.prototype.setImage=function(t){this.image_=t,this.state=js,this.unlistenImage_(),this.changed()},e.prototype.handleImageError_=function(){var t;this.state=Gs,this.unlistenImage_(),this.image_=((t=H(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=js:this.state=zs,this.unlistenImage_(),this.changed()},e.prototype.load=function(){this.state==Gs&&(this.state=ks,this.image_=new Image,null!==this.crossOrigin_&&(this.image_.crossOrigin=this.crossOrigin_)),this.state==ks&&(this.state=Ds,this.changed(),this.tileLoadFunction_(this,this.src_),this.unlisten_=Pr(this.image_,this.handleImageLoad_.bind(this),this.handleImageError_.bind(this)))},e.prototype.unlistenImage_=function(){this.unlisten_&&(this.unlisten_(),this.unlisten_=null)},e}(cf),gf=function(){function t(t,e,r,n,i,o){this.sourceProj_=t,this.targetProj_=e;var a={},s=Zn(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()&&wr(n)==wr(this.sourceProj_.getExtent()),this.sourceWorldWidth_=this.sourceProj_.getExtent()?wr(this.sourceProj_.getExtent()):null,this.targetWorldWidth_=this.targetProj_.getExtent()?wr(this.targetProj_.getExtent()):null;var l=mr(r),u=xr(r),h=pr(r),c=cr(r),p=this.transformInv_(l),f=this.transformInv_(u),d=this.transformInv_(h),g=this.transformInv_(c),y=10+(o?Math.max(0,Math.ceil(w(hr(r)/(o*o*256*256)))):0);if(this.addQuad_(l,u,h,c,p,f,d,g,y),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<this.sourceWorldWidth_/2&&(t.source=e)}}.bind(this))}a={}}return t.prototype.addTriangle_=function(t,e,r,n,i,o){this.triangles_.push({source:[n,i,o],target:[t,e,r]})},t.prototype.addQuad_=function(t,e,r,n,i,o,a,s,l){var u=We([i,o,a,s]),h=this.sourceWorldWidth_?wr(u)/this.sourceWorldWidth_:null,c=this.sourceWorldWidth_,p=this.sourceProj_.canWrapX()&&h>.5&&h<1,f=!1;if(l>0){if(this.targetProj_.isGlobal()&&this.targetWorldWidth_)f=wr(We([t,e,r,n]))/this.targetWorldWidth_>.25||f;!p&&this.sourceProj_.isGlobal()&&h&&(f=h>.25||f)}if(!(!f&&this.maxSourceExtent_&&isFinite(u[0])&&isFinite(u[1])&&isFinite(u[2])&&isFinite(u[3]))||br(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 g=[(t[0]+r[0])/2,(t[1]+r[1])/2],y=this.transformInv_(g),v=void 0;if(p)v=(T(i[0],c)+T(a[0],c))/2-T(y[0],c);else v=(i[0]+a[0])/2-y[0];var _=(i[1]+a[1])/2-y[1];f=v*v+_*_>this.errorThresholdSquared_}if(f){if(Math.abs(t[0]-r[0])<=Math.abs(t[1]-r[1])){var m=[(e[0]+r[0])/2,(e[1]+r[1])/2],x=this.transformInv_(m),w=[(n[0]+t[0])/2,(n[1]+t[1])/2],b=this.transformInv_(w);this.addQuad_(t,e,m,w,i,o,x,b,l-1),this.addQuad_(w,m,r,n,b,x,a,s,l-1)}else{var S=[(t[0]+e[0])/2,(t[1]+e[1])/2],C=this.transformInv_(S),E=[(r[0]+n[0])/2,(r[1]+n[1])/2],P=this.transformInv_(E);this.addQuad_(t,S,E,n,i,C,P,s,l-1),this.addQuad_(S,e,r,E,C,o,a,P,l-1)}return}}if(p){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;ar(t,i[0]),ar(t,i[1]),ar(t,i[2])})),t},t.prototype.getTriangles=function(){return this.triangles_},t}(),yf={imageSmoothingEnabled:!1,msImageSmoothingEnabled:!1},vf={imageSmoothingEnabled:!0,msImageSmoothingEnabled:!0},_f=[];function mf(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 xf(t,e){return Math.abs(t[4*e]-210)>2||Math.abs(t[4*e+3]-191.25)>2}function wf(t,e,r,n){var i=Hn(r,e,t),o=Vn(e,n,r),a=e.getMetersPerUnit();void 0!==a&&(o*=a);var s=t.getMetersPerUnit();void 0!==s&&(o/=s);var l=t.getExtent();if(!l||Ze(l,i)){var u=Vn(t,o,i)/o;isFinite(u)&&u>0&&(o/=u)}return o}function bf(t,e,r,n,i,o,a,s,l,u,h,c){var p=H(Math.round(r*t),Math.round(r*e),_f);if(c||gt(p,yf),0===l.length)return p.canvas;function f(t){return Math.round(t*r)/r}p.scale(r,r),p.globalCompositeOperation="lighter";var d=[1/0,1/0,-1/0,-1/0];l.forEach((function(t,e,r){or(d,t.extent)}));var g=wr(d),y=vr(d),v=H(Math.round(r*g/n),Math.round(r*y/n));c||gt(v,yf);var _=r/n;l.forEach((function(t,e,r){var n=t.extent[0]-d[0],i=-(t.extent[3]-d[3]),o=wr(t.extent),a=vr(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*_,i*_,o*_,a*_)}));var m=mr(a);return s.getTriangles().forEach((function(t,e,i){var a=t.source,s=t.target,l=a[0][0],u=a[0][1],h=a[1][0],g=a[1][1],y=a[2][0],_=a[2][1],x=f((s[0][0]-m[0])/o),w=f(-(s[0][1]-m[1])/o),b=f((s[1][0]-m[0])/o),S=f(-(s[1][1]-m[1])/o),C=f((s[2][0]-m[0])/o),E=f(-(s[2][1]-m[1])/o),T=l,P=u;l=0,u=0;var R=function(t){for(var e=t.length,r=0;r<e;r++){for(var n=r,i=Math.abs(t[r][r]),o=r+1;o<e;o++){var a=Math.abs(t[o][r]);a>i&&(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<e;l++)for(var u=-t[l][r]/t[r][r],h=r;h<e+1;h++)r==h?t[l][h]=0:t[l][h]+=u*t[r][h]}for(var c=new Array(e),p=e-1;p>=0;p--){c[p]=t[p][e]/t[p][p];for(var f=p-1;f>=0;f--)t[f][e]-=t[f][p]*c[p]}return c}([[h-=T,g-=P,0,0,b-x],[y-=T,_-=P,0,0,C-x],[0,0,h,g,S-w],[0,0,y,_,E-w]]);if(R){if(p.save(),p.beginPath(),function(){if(void 0===ff){var t=document.createElement("canvas").getContext("2d");t.globalCompositeOperation="lighter",t.fillStyle="rgba(210, 0, 0, 0.75)",mf(t,4,5,4,0),mf(t,4,5,0,5);var e=t.getImageData(0,0,3,3).data;ff=xf(e,0)||xf(e,4)||xf(e,8)}return ff}()||!c){p.moveTo(b,S);for(var O=x-b,F=w-S,M=0;M<4;M++)p.lineTo(b+f((M+1)*O/4),S+f(M*F/3)),3!=M&&p.lineTo(b+f((M+1)*O/4),S+f((M+1)*F/3));p.lineTo(C,E)}else p.moveTo(b,S),p.lineTo(x,w),p.lineTo(C,E);p.clip(),p.transform(R[0],R[2],R[1],R[3],x,w),p.translate(d[0]-T,d[3]-P),p.scale(n/r,-n/r),p.drawImage(v.canvas,0,0),p.restore()}})),h&&(p.save(),p.globalCompositeOperation="source-over",p.strokeStyle="black",p.lineWidth=1,s.getTriangles().forEach((function(t,e,r){var n=t.target,i=(n[0][0]-m[0])/o,a=-(n[0][1]-m[1])/o,s=(n[1][0]-m[0])/o,l=-(n[1][1]-m[1])/o,u=(n[2][0]-m[0])/o,h=-(n[2][1]-m[1])/o;p.beginPath(),p.moveTo(s,l),p.lineTo(i,a),p.lineTo(u,h),p.closePath(),p.stroke()})),p.restore()),p.canvas}var Sf=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)}}(),Cf=function(t){function e(e,r,n,i,o,a,s,l,u,h,c,p){var f=t.call(this,o,ks,{interpolate:!!p})||this;f.renderEdges_=void 0!==c&&c,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_),g=f.targetTileGrid_.getExtent(),y=f.sourceTileGrid_.getExtent(),v=g?_r(d,g):d;if(0===hr(v))return f.state=zs,f;var _=e.getExtent();_&&(y=y?_r(y,_):_);var x=i.getResolution(f.wrappedTileCoord_[0]),w=function(t,e,r,n){var i=fr(r),o=wf(t,e,i,n);return(!isFinite(o)||o<=0)&&ur(r,(function(r){return o=wf(t,e,r,n),isFinite(o)&&o>0})),o}(e,n,v,x);if(!isFinite(w)||w<=0)return f.state=zs,f;var b=void 0!==h?h:.5;if(f.triangulation_=new gf(e,n,v,y,w*b,x),0===f.triangulation_.getTriangles().length)return f.state=zs,f;f.sourceZ_=r.getZForResolution(w);var S=f.triangulation_.calculateSourceExtent();if(y&&(e.canWrapX()?(S[1]=m(S[1],y[1],y[3]),S[3]=m(S[3],y[1],y[3])):S=_r(S,y)),hr(S)){for(var C=r.getTileRangeForExtentAndZ(S,f.sourceZ_),E=C.minX;E<=C.maxX;E++)for(var T=C.minY;T<=C.maxY;T++){var P=u(f.sourceZ_,E,T,s);P&&f.sourceTiles_.push(P)}0===f.sourceTiles_.length&&(f.state=zs)}else f.state=zs;return f}return Sf(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()==js&&t.push({extent:this.sourceTileGrid_.getTileCoordExtent(e.tileCoord),image:e.getImage()})}.bind(this)),this.sourceTiles_.length=0,0===t.length)this.state=Gs;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_=bf(n,i,this.pixelRatio_,a,this.sourceTileGrid_.getExtent(),o,s,this.triangulation_,t,this.gutter_,this.renderEdges_,this.interpolate),this.state=js}this.changed()},e.prototype.load=function(){if(this.state==ks){this.state=Ds,this.changed();var t=0;this.sourcesListenerKeys_=[],this.sourceTiles_.forEach(function(e,r,n){var i=e.getState();if(i==ks||i==Ds){t++;var o=kt(e,wt,(function(r){var n=e.getState();n!=js&&n!=Gs&&n!=zs||(jt(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()==ks&&t.load()}))}},e.prototype.unlistenSources_=function(){this.sourcesListenerKeys_.forEach(jt),this.sourcesListenerKeys_=null},e.prototype.release=function(){this.canvas_&&(J(this.canvas_.getContext("2d")),_f.push(this.canvas_),this.canvas_=null),t.prototype.release.call(this)},e}(cf),Ef=function(){function t(t){this.highWaterMark=void 0!==t?t:2048,this.count_=0,this.entries_={},this.oldest_=null,this.newest_=null}return t.prototype.canExpireCache=function(){return this.highWaterMark>0&&this.getCount()>this.highWaterMark},t.prototype.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 _(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 _(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.peek=function(t){if(this.containsKey(t))return this.entries_[t].value_},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){_(!(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}(),Tf=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)}}(),Pf=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return Tf(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=nf(this.peekFirstKey())[0];this.forEach(function(e){e.tileCoord[0]!==t&&(this.remove(rf(e.tileCoord)),e.release())}.bind(this))}},e}(Ef),Rf=Pf,Of="tileloadstart",Ff="tileloadend",Mf="tileloaderror";function If(t){var e=t.getDefaultTileGrid();return e||(e=function(t,e,r,n){return function(t,e,r,n){var i=void 0!==n?n:"top-left",o=Af(t,e,r);return new lf({extent:t,origin:dr(t,i),resolutions:o,tileSize:r})}(kf(t),e,r,n)}(t),t.setDefaultTileGrid(e)),e}function Lf(t){var e=t||{},r=e.extent||Bn("EPSG:3857").getExtent(),n={extent:r,minZoom:e.minZoom,tileSize:e.tileSize,resolutions:Af(r,e.maxZoom,e.tileSize,e.maxResolution)};return new lf(n)}function Af(t,e,r,n){for(var i=void 0!==e?e:42,o=vr(t),a=wr(t),s=p(void 0!==r?r:Ws),l=n>0?n:Math.max(a/s[0],o/s[1]),u=i+1,h=new Array(u),c=0;c<u;++c)h[c]=l/Math.pow(2,c);return h}function kf(t){var e=(t=Bn(t)).getExtent();if(!e){var r=180*Vr[Wr.DEGREES]/t.getMetersPerUnit();e=tr(-r,-r,r,r)}return e}var Df=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)}}(),jf=function(t){function e(e){var r=t.call(this,{attributions:e.attributions,attributionsCollapsible:e.attributionsCollapsible,projection:e.projection,state:e.state,wrapX:e.wrapX,interpolate:e.interpolate})||this;r.on,r.once,r.un,r.opaque_=void 0!==e.opaque&&e.opaque,r.tilePixelRatio_=void 0!==e.tilePixelRatio?e.tilePixelRatio:1,r.tileGrid=void 0!==e.tileGrid?e.tileGrid:null;return r.tileGrid&&p(r.tileGrid.getTileSize(r.tileGrid.getMinZoom()),[256,256]),r.tileCache=new Rf(e.cacheSize||0),r.tmpSize=[0,0],r.key_=e.key||"",r.tileOptions={transition:e.transition,interpolate:e.interpolate},r.zDirection=e.zDirection?e.zDirection:0,r}return Df(e,t),e.prototype.canExpireCache=function(){return this.tileCache.canExpireCache()},e.prototype.expireCache=function(t,e){var r=this.getTileCacheForProjection(t);r&&r.expireCache(e)},e.prototype.forEachLoadedTile=function(t,e,r,n){var i=this.getTileCacheForProjection(t);if(!i)return!1;for(var o,a,s,l=!0,u=r.minX;u<=r.maxX;++u)for(var h=r.minY;h<=r.maxY;++h)a=ef(e,u,h),s=!1,i.containsKey(a)&&(s=(o=i.get(a)).getState()===js)&&(s=!1!==n(o)),s||(l=!1);return l},e.prototype.getGutterForProjection=function(t){return 0},e.prototype.getKey=function(){return this.key_},e.prototype.setKey=function(t){this.key_!==t&&(this.key_=t,this.changed())},e.prototype.getOpaque=function(t){return this.opaque_},e.prototype.getResolutions=function(){return this.tileGrid?this.tileGrid.getResolutions():null},e.prototype.getTile=function(t,e,r,n,i){return a()},e.prototype.getTileGrid=function(){return this.tileGrid},e.prototype.getTileGridForProjection=function(t){return this.tileGrid?this.tileGrid:If(t)},e.prototype.getTileCacheForProjection=function(t){var e=this.getProjection();return _(null===e||Yn(e,t),68),this.tileCache},e.prototype.getTilePixelRatio=function(t){return this.tilePixelRatio_},e.prototype.getTilePixelSize=function(t,e,r){var n=this.getTileGridForProjection(r),i=this.getTilePixelRatio(e),o=p(n.getTileSize(t),this.tmpSize);return 1==i?o:c(o,i,this.tmpSize)},e.prototype.getTileCoordForTileUrlFunction=function(t,e){var r=void 0!==e?e:this.getProjection(),n=this.getTileGridForProjection(r);return this.getWrapX()&&r.isGlobal()&&(t=function(t,e,r){var n=e[0],i=t.getTileCoordCenter(e),o=kf(r);if(Ze(o,i))return e;var a=wr(o),s=Math.ceil((o[0]-i[0])/a);return i[0]+=a*s,t.getTileCoordForCoordAndZ(i,n)}(n,t,r)),function(t,e){var r=t[0],n=t[1],i=t[2];if(e.getMinZoom()>r||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}(Gc),Gf=function(t){function e(e,r){var n=t.call(this,e)||this;return n.tile=r,n}return Df(e,t),e}(nt),zf=jf;function Nf(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 _(r,55),(r.getHeight()-a[2]-1).toString()})):void 0}}function Uf(t,e){for(var r=t.length,n=new Array(r),i=0;i<r;++i)n[i]=Nf(t[i],e);return Bf(n)}function Bf(t){return 1===t.length?t[0]:function(e,r,n){if(e){var i=T(of(e),t.length);return t[i](e,r,n)}}}var Vf=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)}}(),Xf=function(t){function e(r){var n=t.call(this,{attributions:r.attributions,cacheSize:r.cacheSize,opaque:r.opaque,projection:r.projection,state:r.state,tileGrid:r.tileGrid,tilePixelRatio:r.tilePixelRatio,wrapX:r.wrapX,transition:r.transition,interpolate:r.interpolate,key:r.key,attributionsCollapsible:r.attributionsCollapsible,zDirection:r.zDirection})||this;return n.generateTileUrlFunction_=n.tileUrlFunction===e.prototype.tileUrlFunction,n.tileLoadFunction=r.tileLoadFunction,r.tileUrlFunction&&(n.tileUrlFunction=r.tileUrlFunction),n.urls=null,r.urls?n.setUrls(r.urls):r.url&&n.setUrl(r.url),n.tileLoadingKeys_={},n}return Vf(e,t),e.prototype.getTileLoadFunction=function(){return this.tileLoadFunction},e.prototype.getTileUrlFunction=function(){return Object.getPrototypeOf(this).tileUrlFunction===this.tileUrlFunction?this.tileUrlFunction.bind(this):this.tileUrlFunction},e.prototype.getUrls=function(){return this.urls},e.prototype.handleTileChange=function(t){var e,r=t.target,n=l(r),i=r.getState();i==Ds?(this.tileLoadingKeys_[n]=!0,e=Of):n in this.tileLoadingKeys_&&(delete this.tileLoadingKeys_[n],e=i==Gs?Mf:i==js?Ff:void 0),null!=e&&this.dispatchEvent(new Gf(e,r))},e.prototype.setTileLoadFunction=function(t){this.tileCache.clear(),this.tileLoadFunction=t,this.changed()},e.prototype.setTileUrlFunction=function(t,e){this.tileUrlFunction=t,this.tileCache.pruneExceptNewestZ(),void 0!==e?this.setKey(e):this.changed()},e.prototype.setUrl=function(t){var e=function(t){var e=[],r=/\{([a-z])-([a-z])\}/.exec(t);if(r){var n=r[1].charCodeAt(0),i=r[2].charCodeAt(0),o=void 0;for(o=n;o<=i;++o)e.push(t.replace(r[0],String.fromCharCode(o)));return e}if(r=/\{(\d+)-(\d+)\}/.exec(t)){for(var a=parseInt(r[2],10),s=parseInt(r[1],10);s<=a;s++)e.push(t.replace(r[0],s.toString()));return e}return e.push(t),e}(t);this.urls=e,this.setUrls(e)},e.prototype.setUrls=function(t){this.urls=t;var e=t.join("\n");this.generateTileUrlFunction_?this.setTileUrlFunction(Uf(t,this.tileGrid),e):this.setKey(e)},e.prototype.tileUrlFunction=function(t,e,r){},e.prototype.useTile=function(t,e,r){var n=ef(t,e,r);this.tileCache.containsKey(n)&&this.tileCache.get(n)},e}(zf),Wf=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)}}(),qf=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:Yf,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:df,r.tileCacheForProjection={},r.tileGridForProjection={},r.reprojectionErrorThreshold_=e.reprojectionErrorThreshold,r.renderReprojectionEdges_=!1,r}return Wf(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&&!Yn(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&&!Yn(this.getProjection(),e))&&t.prototype.getOpaque.call(this,e)},e.prototype.getTileGridForProjection=function(t){var e=this.getProjection();if(!this.tileGrid||e&&!Yn(e,t)){var r=l(t);return r in this.tileGridForProjection||(this.tileGridForProjection[r]=If(t)),this.tileGridForProjection[r]}return this.tileGrid},e.prototype.getTileCacheForProjection=function(t){var e=this.getProjection();if(!e||Yn(e,t))return this.tileCache;var r=l(t);return r in this.tileCacheForProjection||(this.tileCacheForProjection[r]=new Rf(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?ks:zs,void 0!==l?l:"",this.crossOrigin,this.tileLoadFunction,this.tileOptions);return u.key=o,u.addEventListener(wt,this.handleTileChange.bind(this)),u},e.prototype.getTile=function(t,e,r,n,i){var o=this.getProjection();if(o&&i&&!Yn(o,i)){var a=this.getTileCacheForProjection(i),s=[t,e,r],l=void 0,u=rf(s);a.containsKey(u)&&(l=a.get(u));var h=this.getKey();if(l&&l.key==h)return l;var c=this.getTileGridForProjection(o),p=this.getTileGridForProjection(i),f=this.getTileCoordForTileUrlFunction(s,i),d=new Cf(o,c,i,p,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=h,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=ef(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()==ks?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=Bn(t);if(r){var n=l(r);n in this.tileGridForProjection||(this.tileGridForProjection[n]=e)}},e}(Xf);function Yf(t,e){t.getImage().src=e}var Kf=qf,Zf=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 Hf(t,e,r,n){var i=document.createElement("script"),o="olc_"+l(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.head.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}Zf(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}Zf(e,t)}(Error);var Jf=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)}}(),Qf=function(t){function e(e){var r=this,n=void 0===e.imageSmoothing||e.imageSmoothing;if(void 0!==e.interpolate&&(n=e.interpolate),(r=t.call(this,{attributions:e.attributions,cacheSize:e.cacheSize,crossOrigin:e.crossOrigin,interpolate:n,projection:Bn("EPSG:3857"),reprojectionErrorThreshold:e.reprojectionErrorThreshold,state:"loading",tileLoadFunction:e.tileLoadFunction,wrapX:void 0===e.wrapX||e.wrapX,transition:e.transition,zDirection:e.zDirection})||this).tileJSON_=null,r.tileSize_=e.tileSize,e.url)if(e.jsonp)Hf(e.url,r.handleTileJSONResponse.bind(r),r.handleTileJSONError.bind(r));else{var i=new XMLHttpRequest;i.addEventListener("load",r.onXHRLoad_.bind(r)),i.addEventListener("error",r.onXHRError_.bind(r)),i.open("GET",e.url),i.send()}else e.tileJSON?r.handleTileJSONResponse(e.tileJSON):_(!1,51);return r}return Jf(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.getTileJSON=function(){return this.tileJSON_},e.prototype.handleTileJSONResponse=function(t){var e,r=Bn("EPSG:4326"),n=this.getProjection();if(void 0!==t.bounds){var i=Kn(r,n);e=Cr(t.bounds,i)}var o=kf(n),a=t.minzoom||0,s=Lf({extent:o,maxZoom:t.maxzoom||22,minZoom:a,tileSize:this.tileSize_});if(this.tileGrid=s,this.tileUrlFunction=Uf(t.tiles,s),void 0!==t.attribution&&!this.getAttributions()){var l=void 0!==e?e:o;this.setAttributions((function(e){return br(l,e.extent)?[t.attribution]:null}))}this.tileJSON_=t,this.setState("ready")},e.prototype.handleTileJSONError=function(){this.setState("error")},e}(Kf),$f=Qf,td="preload",ed="useInterimTilesOnError",rd=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)}}(),nd=function(t){function e(e){var r=this,n=e||{},i=gt({},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 rd(e,t),e.prototype.getPreload=function(){return this.get(td)},e.prototype.setPreload=function(t){this.set(td,t)},e.prototype.getUseInterimTilesOnError=function(){return this.get(ed)},e.prototype.setUseInterimTilesOnError=function(t){this.set(ed,t)},e.prototype.getData=function(e){return t.prototype.getData.call(this,e)},e}(Ya),id=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)}}(),od=function(t){function e(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 $p(0,0,0,0),r}return id(e,t),e.prototype.isDrawableTile=function(t){var e=this.getLayer(),r=t.getState(),n=e.getUseInterimTilesOnError();return r==js||r==zs||r==Gs&&!n},e.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()==Gs&&(a.getUseInterimTilesOnError()?a.getPreload()>0&&(this.newTiles_=!0):s.setState(js)),this.isDrawableTile(s)||(s=s.getInterimTile()),s},e.prototype.getData=function(t){var e=this.frameState;if(!e)return null;var r=this.getLayer(),n=Hr(e.pixelToCoordinateTransform,t.slice()),i=r.getExtent();if(i&&!Ze(i,n))return null;for(var o=e.pixelRatio,a=e.viewState.projection,s=e.viewState,l=r.getRenderSource(),u=l.getTileGridForProjection(s.projection),h=l.getTilePixelRatio(e.pixelRatio),c=u.getZForResolution(s.resolution);c>=u.getMinZoom();--c){var f=u.getTileCoordForCoordAndZ(n,c),d=l.getTile(c,f[1],f[2],o,a);if(!(d instanceof df||d instanceof Cf))return null;if(d.getState()===js){var g=u.getOrigin(c),y=p(u.getTileSize(c)),v=u.getResolution(c),_=Math.floor(h*((n[0]-g[0])/v-f[1]*y[0])),m=Math.floor(h*((g[1]-n[1])/v-f[2]*y[1])),x=Math.round(h*l.getGutterForProjection(s.projection));return this.getImageData(d.getImage(),_+x,m+x)}}return null},e.prototype.loadedTileCallback=function(e,r,n){return!!this.isDrawableTile(n)&&t.prototype.loadedTileCallback.call(this,e,r,n)},e.prototype.prepareFrame=function(t){return!!this.getLayer().getSource()},e.prototype.renderFrame=function(t,e){var r=t.layerStatesArray[t.layerIndex],n=t.viewState,i=n.projection,o=n.resolution,a=n.center,s=n.rotation,u=t.pixelRatio,h=this.getLayer(),c=h.getSource(),p=c.getRevision(),f=c.getTileGridForProjection(i),d=f.getZForResolution(o,c.zDirection),g=f.getResolution(d),y=t.extent,v=t.viewState.resolution,_=c.getTilePixelRatio(u),m=Math.round(wr(y)/v*u),x=Math.round(vr(y)/v*u),w=r.extent&&ni(r.extent);w&&(y=_r(y,ni(r.extent)));var b=g*m/2/_,S=g*x/2/_,C=[a[0]-b,a[1]-S,a[0]+b,a[1]+S],E=f.getTileRangeForExtentAndZ(y,d),T={};T[d]={};var P=this.createLoadedTileFinder(c,i,T),R=this.tmpExtent,O=this.tmpTileRange_;this.newTiles_=!1;for(var F=s?yr(n.center,v,s,t.size):void 0,M=E.minX;M<=E.maxX;++M)for(var I=E.minY;I<=E.maxY;++I)if(!s||f.tileCoordIntersectsViewport([d,M,I],F)){var L=this.getTile(d,M,I,t);if(this.isDrawableTile(L)){var A=l(this);if(L.getState()==js)T[d][L.tileCoord.toString()]=L,(nt=L.inTransition(A))&&1!==r.opacity&&(L.endTransition(A),nt=!1),this.newTiles_||!nt&&-1!==this.renderedTiles.indexOf(L)||(this.newTiles_=!0);if(1===L.getAlpha(A,t.time))continue}var k=f.getTileCoordChildTileRange(L.tileCoord,O,R),D=!1;k&&(D=P(d+1,k)),D||f.forEachTileCoordParentTileRange(L.tileCoord,P,O,R)}var j=g/o*u/_;tn(this.pixelTransform,t.size[0]/2,t.size[1]/2,1/u,1/u,s,-m/2,-x/2);var G=rn(this.pixelTransform);this.useContainer(e,G,this.getBackground(t));var z=this.context,N=z.canvas;en(this.inversePixelTransform,this.pixelTransform),tn(this.tempTransform,m/2,x/2,j,j,0,-m/2,-x/2),N.width!=m||N.height!=x?(N.width=m,N.height=x):this.containerReused||z.clearRect(0,0,m,x),w&&this.clipUnrotated(z,t,w),c.getInterpolate()||gt(z,yf),this.preRender(z,t),this.renderedTiles.length=0;var U,B,V,X=Object.keys(T).map(Number);X.sort(at),1!==r.opacity||this.containerReused&&!c.getOpaque(t.viewState.projection)?(U=[],B=[]):X=X.reverse();for(var W=X.length-1;W>=0;--W){var q=X[W],Y=c.getTilePixelSize(q,u,i),K=f.getResolution(q)/g,Z=Y[0]*K*j,H=Y[1]*K*j,J=f.getTileCoordForCoordAndZ(mr(C),q),Q=f.getTileCoordExtent(J),$=Hr(this.tempTransform,[_*(Q[0]-C[0])/g,_*(C[3]-Q[3])/g]),tt=_*c.getGutterForProjection(i),et=T[q];for(var rt in et){var nt,it=(L=et[rt]).tileCoord,ot=J[1]-it[1],st=Math.round($[0]-(ot-1)*Z),lt=J[2]-it[2],ut=Math.round($[1]-(lt-1)*H),ht=st-(M=Math.round($[0]-ot*Z)),ct=ut-(I=Math.round($[1]-lt*H)),pt=d===q,ft=!1;if(!(nt=pt&&1!==L.getAlpha(l(this),t.time)))if(U){V=[M,I,M+ht,I,M+ht,I+ct,M,I+ct];for(var dt=0,yt=U.length;dt<yt;++dt)if(d!==q&&q<B[dt]){var vt=U[dt];br([M,I,M+ht,I+ct],[vt[0],vt[3],vt[4],vt[7]])&&(ft||(z.save(),ft=!0),z.beginPath(),z.moveTo(V[0],V[1]),z.lineTo(V[2],V[3]),z.lineTo(V[4],V[5]),z.lineTo(V[6],V[7]),z.moveTo(vt[6],vt[7]),z.lineTo(vt[4],vt[5]),z.lineTo(vt[2],vt[3]),z.lineTo(vt[0],vt[1]),z.clip())}U.push(V),B.push(q)}else z.clearRect(M,I,ht,ct);this.drawTileImage(L,t,M,I,ht,ct,tt,pt),U&&!nt?(ft&&z.restore(),this.renderedTiles.unshift(L)):this.renderedTiles.push(L),this.updateUsedTiles(t.usedTiles,c,L)}}return this.renderedRevision=p,this.renderedResolution=g,this.extentChanged=!this.renderedExtent_||!ir(this.renderedExtent_,C),this.renderedExtent_=C,this.renderedPixelRatio=u,this.renderedProjection=i,this.manageTilePyramid(t,c,f,u,i,y,d,h.getPreload()),this.scheduleExpireCache(t,c),this.postRender(z,t),r.extent&&z.restore(),gt(z,vf),G!==N.style.transform&&(N.style.transform=G),this.container},e.prototype.drawTileImage=function(t,e,r,n,i,o,a,s){var u=this.getTileImage(t);if(u){var h=l(this),c=e.layerStatesArray[e.layerIndex],p=c.opacity*(s?t.getAlpha(h,e.time):1),f=p!==this.context.globalAlpha;f&&(this.context.save(),this.context.globalAlpha=p),this.context.drawImage(u,a,a,u.width-2*a,u.height-2*a,r,n,i,o),f&&this.context.restore(),p!==c.opacity?e.animate=!0:s&&t.endTransition(h)}},e.prototype.getImage=function(){var t=this.context;return t?t.canvas:null},e.prototype.getTileImage=function(t){return t.getImage()},e.prototype.scheduleExpireCache=function(t,e){if(e.canExpireCache()){var r=function(t,e,r){var n=l(t);n in r.usedTiles&&t.expireCache(r.viewState.projection,r.usedTiles[n])}.bind(null,e);t.postRenderFunctions.push(r)}},e.prototype.updateUsedTiles=function(t,e,r){var n=l(e);n in t||(t[n]={}),t[n][r.getKey()]=!0},e.prototype.manageTilePyramid=function(t,e,r,n,i,o,a,s,u){var h=l(e);h in t.wantedTiles||(t.wantedTiles[h]={});var c,p,f,d,g,y,v=t.wantedTiles[h],_=t.tileQueue,m=r.getMinZoom(),x=t.viewState.rotation,w=x?yr(t.viewState.center,t.viewState.resolution,x,t.size):void 0,b=0;for(y=m;y<=a;++y)for(p=r.getTileRangeForExtentAndZ(o,y,p),f=r.getResolution(y),d=p.minX;d<=p.maxX;++d)for(g=p.minY;g<=p.maxY;++g)x&&!r.tileCoordIntersectsViewport([y,d,g],w)||(a-y<=s?(++b,(c=e.getTile(y,d,g,n,i)).getState()==ks&&(v[c.getKey()]=!0,_.isKeyQueued(c.getKey())||_.enqueue([c,h,r.getTileCoordCenter(c.tileCoord),f])),void 0!==u&&u(c)):e.useTile(y,d,g,i));e.updateCacheSize(b,i)},e}(ec),ad=od,sd=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)}}(),ld=function(t){function e(e){return t.call(this,e)||this}return sd(e,t),e.prototype.createRenderer=function(){return new ad(this)},e}(nd),ud="image",hd="hybrid",cd="vector",pd=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)}}(),fd={image:["Polygon","Circle","LineString","Image","Text"],hybrid:["Polygon","LineString"],vector:[]},dd={hybrid:["Image","Text","Default"],vector:["Polygon","Circle","LineString","Image","Text","Default"]},gd=function(t){function e(e){var r=t.call(this,e)||this;return r.boundHandleStyleImageChange_=r.handleStyleImageChange_.bind(r),r.renderedLayerRevision_,r.renderedPixelToCoordinateTransform_=null,r.renderedRotation_,r.tmpTransform_=[1,0,0,1,0,0],r}return pd(e,t),e.prototype.prepareTile=function(t,e,r){var n,i=t.getState();return i!==js&&i!==Gs||(this.updateExecutorGroup_(t,e,r),this.tileImageNeedsRender_(t)&&(n=!0)),n},e.prototype.getTile=function(e,r,n,i){var o=i.pixelRatio,a=i.viewState,s=a.resolution,l=a.projection,u=this.getLayer(),h=u.getSource().getTile(e,r,n,o,l),c=i.viewHints,p=!(c[Bs]||c[Vs]);return!p&&h.wantedResolution||(h.wantedResolution=s),this.prepareTile(h,o,l)&&(p||Date.now()-i.time<8)&&u.getRenderMode()!==cd&&this.renderTileImage_(h,i),t.prototype.getTile.call(this,e,r,n,i)},e.prototype.isDrawableTile=function(e){var r=this.getLayer();return t.prototype.isDrawableTile.call(this,e)&&(r.getRenderMode()===cd?l(r)in e.executorGroups:e.hasContext(r))},e.prototype.getTileImage=function(t){return t.getImage(this.getLayer())},e.prototype.prepareFrame=function(e){var r=this.getLayer().getRevision();return this.renderedLayerRevision_!==r&&(this.renderedLayerRevision_=r,this.renderedTiles.length=0),t.prototype.prepareFrame.call(this,e)},e.prototype.updateExecutorGroup_=function(t,e,r){var n=this.getLayer(),i=n.getRevision(),o=n.getRenderOrder()||null,a=t.wantedResolution,s=t.getReplayState(n);if(s.dirty||s.renderedResolution!==a||s.renderedRevision!=i||s.renderedRenderOrder!=o){var u=n.getSource(),h=n.getDeclutter(),c=u.getTileGrid(),p=u.getTileGridForProjection(r).getTileCoordExtent(t.wrappedTileCoord),f=u.getSourceTiles(e,r,t),d=l(n);delete t.hitDetectionImageData[d],t.executorGroups[d]=[],h&&(t.declutterExecutorGroups[d]=[]),s.dirty=!1;for(var g=function(r,i){var l=f[r];if(l.getState()!=js)return"continue";var g=l.tileCoord,v=c.getTileCoordExtent(g),_=_r(p,v),m=qe(_,n.getRenderBuffer()*a,y.tmpExtent),x=ir(v,_)?null:m,w=new Yh(0,m,a,e),b=h?new Yh(0,_,a,e):void 0,S=Tc(a,e),C=function(t){var e,r=t.getStyleFunction()||n.getStyleFunction();if(r&&(e=r(t,a)),e){var i=this.renderFeature(t,S,e,w,b);s.dirty=s.dirty||i}},E=l.getFeatures();o&&o!==s.renderedRenderOrder&&E.sort(o);for(var T=0,P=E.length;T<P;++T){var R=E[T];x&&!br(x,R.getGeometry().getExtent())||C.call(y,R)}var O=w.finish(),F=n.getRenderMode()!==cd&&h&&1===f.length?null:_,M=new vc(F,a,e,u.getOverlaps(),O,n.getRenderBuffer());if(t.executorGroups[d].push(M),b){var I=new vc(null,a,e,u.getOverlaps(),b.finish(),n.getRenderBuffer());t.declutterExecutorGroups[d].push(I)}},y=this,v=0,_=f.length;v<_;++v)g(v);s.renderedRevision=i,s.renderedRenderOrder=o,s.renderedResolution=a}},e.prototype.forEachFeatureAtCoordinate=function(t,e,r,n,i){var o=e.viewState.resolution,a=e.viewState.rotation;r=null==r?0:r;var s=this.getLayer(),u=s.getSource().getTileGridForProjection(e.viewState.projection),h=We([t]);qe(h,o*r,h);for(var c,p={},f=function(t,e,r){var o=t.getId();void 0===o&&(o=l(t));var a=p[o];if(a){if(!0!==a&&r<a.distanceSq){if(0===r)return p[o]=!0,i.splice(i.lastIndexOf(a),1),n(t,s,e);a.geometry=e,a.distanceSq=r}}else{if(0===r)return p[o]=!0,n(t,s,e);i.push(p[o]={feature:t,layer:s,geometry:e,distanceSq:r,callback:n})}},d=this.renderedTiles,g=function(n,i){var p=d[n];if(!br(u.getTileCoordExtent(p.wrappedTileCoord),h))return"continue";var g=l(s),y=[p.executorGroups[g]],v=p.declutterExecutorGroups[g];v&&y.push(v),y.some((function(n){for(var i=n===v?e.declutterTree.all().map((function(t){return t.value})):null,s=0,l=n.length;s<l;++s){var u=n[s];if(c=u.forEachFeatureAtCoordinate(t,o,a,r,f,i))return!0}}))},y=0,v=d.length;!c&&y<v;++y)g(y);return c},e.prototype.getFeatures=function(t){return new Promise(function(e,r){for(var n,i=this.getLayer(),o=l(i),a=i.getSource(),s=this.renderedProjection,u=s.getExtent(),h=this.renderedResolution,c=a.getTileGridForProjection(s),f=Hr(this.renderedPixelToCoordinateTransform_,t.slice()),d=c.getTileCoordForCoordAndResolution(f,h),g=0,y=this.renderedTiles.length;g<y;++g)if(d.toString()===this.renderedTiles[g].tileCoord.toString()){if((n=this.renderedTiles[g]).getState()===js){var v=c.getTileCoordExtent(n.tileCoord);a.getWrapX()&&s.canWrapX()&&!He(u,v)&&Mn(f,s);break}n=void 0}if(!n||n.loadingSourceTiles>0)e([]);else{var _=mr(c.getTileCoordExtent(n.wrappedTileCoord)),m=[(f[0]-_[0])/h,(_[1]-f[1])/h],x=n.getSourceTiles().reduce((function(t,e){return t.concat(e.getFeatures())}),[]),w=n.hitDetectionImageData[o];if(!w&&!this.animatingOrInteracting_){var b=p(c.getTileSize(c.getZForResolution(h,a.zDirection))),S=this.renderedRotation_;w=bc(b,[this.getRenderTransform(c.getTileCoordCenter(n.wrappedTileCoord),h,0,wc,b[0]*wc,b[1]*wc,0)],x,i.getStyleFunction(),c.getTileCoordExtent(n.wrappedTileCoord),n.getReplayState(i).renderedResolution,S),n.hitDetectionImageData[o]=w}e(Sc(m,x,w))}}.bind(this))},e.prototype.handleFontsChanged=function(){var t=this.getLayer();t.getVisible()&&void 0!==this.renderedLayerRevision_&&t.changed()},e.prototype.handleStyleImageChange_=function(t){this.renderIfReadyAndVisible()},e.prototype.renderDeclutter=function(t){var e=this.context,r=e.globalAlpha;e.globalAlpha=this.getLayer().getOpacity();for(var n=t.viewHints,i=!(n[Bs]||n[Vs]),o=this.renderedTiles,a=0,s=o.length;a<s;++a){var u=o[a],h=u.declutterExecutorGroups[l(this.getLayer())];if(h)for(var c=h.length-1;c>=0;--c)h[c].execute(this.context,1,this.getTileRenderTransform(u,t),t.viewState.rotation,i,void 0,t.declutterTree)}e.globalAlpha=r},e.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),h=this.getLayer().getSource().getTileGridForProjection(e.viewState.projection),c=t.tileCoord,p=h.getTileCoordExtent(t.wrappedTileCoord),f=h.getTileCoordExtent(c,this.tmpExtent)[0]-p[0];return Kr(Qr(this.inversePixelTransform.slice(),1/r,1/r),this.getRenderTransform(i,o,a,r,l,u,f))},e.prototype.renderFrame=function(e,r){var n=e.viewHints,i=!(n[Bs]||n[Vs]);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,u=s.globalAlpha;s.globalAlpha=o.getOpacity();for(var h=dd[a],c=e.viewState,p=c.rotation,f=o.getSource(),d=f.getTileGridForProjection(c.projection).getZForResolution(c.resolution,f.zDirection),g=this.renderedTiles,y=[],v=[],_=!0,m=g.length-1;m>=0;--m){var x=g[m];_=_&&!x.getReplayState(o).dirty;var w=x.executorGroups[l(o)].filter((function(t){return t.hasExecutors(h)}));if(0!==w.length){var b=this.getTileRenderTransform(x,e),S=x.tileCoord[0],C=!1,E=w[0].getClipCoords(b);if(E){for(var T=0,P=y.length;T<P;++T)if(d!==S&&S<v[T]){var R=y[T];br([E[0],E[3],E[4],E[7]],[R[0],R[3],R[4],R[7]])&&(C||(s.save(),C=!0),s.beginPath(),s.moveTo(E[0],E[1]),s.lineTo(E[2],E[3]),s.lineTo(E[4],E[5]),s.lineTo(E[6],E[7]),s.moveTo(R[6],R[7]),s.lineTo(R[4],R[5]),s.lineTo(R[2],R[3]),s.lineTo(R[0],R[1]),s.clip())}y.push(E),v.push(S)}for(var O=0,F=w.length;O<F;++O){w[O].execute(s,1,b,p,i,h)}C&&s.restore()}}return s.globalAlpha=u,this.ready=_,this.container},e.prototype.renderFeature=function(t,e,r,n,i){if(!r)return!1;var o=!1;if(Array.isArray(r))for(var a=0,s=r.length;a<s;++a)o=Rc(n,t,r[a],e,this.boundHandleStyleImageChange_,void 0,i)||o;else o=Rc(n,t,r,e,this.boundHandleStyleImageChange_,void 0,i);return o},e.prototype.tileImageNeedsRender_=function(t){var e=this.getLayer();if(e.getRenderMode()===cd)return!1;var r=t.getReplayState(e),n=e.getRevision(),i=t.wantedResolution;return r.renderedTileResolution!==i||r.renderedTileRevision!==n},e.prototype.renderTileImage_=function(t,e){var r=this.getLayer(),n=t.getReplayState(r),i=r.getRevision(),o=t.executorGroups[l(r)];n.renderedTileRevision=i;var a=t.wrappedTileCoord,s=a[0],u=r.getSource(),h=e.pixelRatio,c=e.viewState.projection,p=u.getTileGridForProjection(c),f=p.getResolution(t.tileCoord[0]),d=e.pixelRatio/t.wantedResolution*f,g=p.getResolution(s),y=t.getContext(r);h=Math.round(Math.max(h,d/h));var v=u.getTilePixelSize(s,h,c);y.canvas.width=v[0],y.canvas.height=v[1];var _=h/d;if(1!==_){var m=Yr(this.tmpTransform_);Qr(m,_,_),y.setTransform.apply(y,m)}var x=p.getTileCoordExtent(a,this.tmpExtent),w=d/g,b=Yr(this.tmpTransform_);Qr(b,w,-w),$r(b,-x[0],-x[3]);for(var S=0,C=o.length;S<C;++S){o[S].execute(y,_,b,0,!0,fd[r.getRenderMode()])}n.renderedTileResolution=t.wantedResolution},e}(ad),yd=gd,vd=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)}}(),_d=function(t){function e(e){var r=this,n=e||{},i=gt({},n);delete i.preload,delete i.useInterimTilesOnError,(r=t.call(this,i)||this).on,r.once,r.un,n.renderMode===ud&&(console.warn('renderMode: "image" is deprecated. Option ignored.'),n.renderMode=void 0);var o=n.renderMode||hd;return _(o==hd||o==cd,28),r.renderMode_=o,r.setPreload(n.preload?n.preload:0),r.setUseInterimTilesOnError(void 0===n.useInterimTilesOnError||n.useInterimTilesOnError),r.getBackground,r.setBackground,r}return vd(e,t),e.prototype.createRenderer=function(){return new yd(this)},e.prototype.getFeatures=function(e){return t.prototype.getFeatures.call(this,e)},e.prototype.getRenderMode=function(){return this.renderMode_},e.prototype.getPreload=function(){return this.get(td)},e.prototype.getUseInterimTilesOnError=function(){return this.get(ed)},e.prototype.setPreload=function(t){this.set(td,t)},e.prototype.setUseInterimTilesOnError=function(t){this.set(ed,t)},e}(bh),md=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)}}(),xd=function(t){function e(e,r,n,i,o,a){var s=t.call(this,e,r,a)||this;return s.extent=null,s.format_=i,s.features_=null,s.loader_,s.projection=null,s.resolution,s.tileLoadFunction_=o,s.url_=n,s.key=n,s}return md(e,t),e.prototype.getFormat=function(){return this.format_},e.prototype.getFeatures=function(){return this.features_},e.prototype.load=function(){this.state==ks&&(this.setState(Ds),this.tileLoadFunction_(this,this.url_),this.loader_&&this.loader_(this.extent,this.resolution,this.projection))},e.prototype.onLoad=function(t,e){this.setFeatures(t)},e.prototype.onError=function(){this.setState(Gs)},e.prototype.setFeatures=function(t){this.features_=t,this.setState(js)},e.prototype.setLoader=function(t){this.loader_=t},e}(cf),wd=xd,bd=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)}}(),Sd=[],Cd=function(t){function e(e,r,n,i){var o=t.call(this,e,r,{transition:0})||this;return o.context_={},o.executorGroups={},o.declutterExecutorGroups={},o.loadingSourceTiles=0,o.hitDetectionImageData={},o.replayState_={},o.sourceTiles=[],o.errorTileKeys={},o.wantedResolution,o.getSourceTiles=i.bind(void 0,o),o.wrappedTileCoord=n,o}return bd(e,t),e.prototype.getContext=function(t){var e=l(t);return e in this.context_||(this.context_[e]=H(1,1,Sd)),this.context_[e]},e.prototype.hasContext=function(t){return l(t)in this.context_},e.prototype.getImage=function(t){return this.hasContext(t)?this.getContext(t).canvas:null},e.prototype.getReplayState=function(t){var e=l(t);return e in this.replayState_||(this.replayState_[e]={dirty:!1,renderedRenderOrder:null,renderedResolution:NaN,renderedRevision:-1,renderedTileResolution:NaN,renderedTileRevision:-1,renderedTileZ:-1}),this.replayState_[e]},e.prototype.load=function(){this.getSourceTiles()},e.prototype.release=function(){for(var e in this.context_){var r=this.context_[e];J(r),Sd.push(r.canvas),delete this.context_[e]}t.prototype.release.call(this)},e}(cf),Ed=Cd,Td=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)}}(),Pd=function(t){function e(e){var r=this,n=e.projection||"EPSG:3857",i=e.extent||kf(n),o=e.tileGrid||Lf({extent:i,maxResolution:e.maxResolution,maxZoom:void 0!==e.maxZoom?e.maxZoom:22,minZoom:e.minZoom,tileSize:e.tileSize||512});return(r=t.call(this,{attributions:e.attributions,attributionsCollapsible:e.attributionsCollapsible,cacheSize:e.cacheSize,interpolate:!0,opaque:!1,projection:n,state:e.state,tileGrid:o,tileLoadFunction:e.tileLoadFunction?e.tileLoadFunction:Od,tileUrlFunction:e.tileUrlFunction,url:e.url,urls:e.urls,wrapX:void 0===e.wrapX||e.wrapX,transition:e.transition,zDirection:void 0===e.zDirection?1:e.zDirection})||this).format_=e.format?e.format:null,r.sourceTileCache=new Rf(r.tileCache.highWaterMark),r.overlaps_=null==e.overlaps||e.overlaps,r.tileClass=e.tileClass?e.tileClass:wd,r.tileGrids_={},r}return Td(e,t),e.prototype.getFeaturesInExtent=function(t){var e=[],r=this.tileCache;if(0===r.getCount())return e;var n=nf(r.peekFirstKey())[0],i=this.tileGrid;return r.forEach((function(r){if(r.tileCoord[0]===n&&r.getState()===js)for(var o=r.getSourceTiles(),a=0,s=o.length;a<s;++a){var l=o[a],u=l.tileCoord;if(br(t,i.getTileCoordExtent(u))){var h=l.getFeatures();if(h)for(var c=0,p=h.length;c<p;++c){var f=h[c],d=f.getGeometry();br(t,d.getExtent())&&e.push(f)}}}})),e},e.prototype.getOverlaps=function(){return this.overlaps_},e.prototype.clear=function(){this.tileCache.clear(),this.sourceTileCache.clear()},e.prototype.expireCache=function(e,r){var n=this.getTileCacheForProjection(e),i=Object.keys(r).reduce((function(t,e){var r,i,o=ef((i=(r=e).substring(r.lastIndexOf("/")+1,r.length).split(",").map(Number))[0],i[1],i[2]),a=n.peek(o);if(a)for(var s=a.sourceTiles,l=0,u=s.length;l<u;++l)t[s[l].getKey()]=!0;return t}),{});t.prototype.expireCache.call(this,e,r),this.sourceTileCache.expireCache(i)},e.prototype.getSourceTiles=function(t,e,r){var n=this;if(r.getState()===ks){r.setState(Ds);var i=r.wrappedTileCoord,o=this.getTileGridForProjection(e),a=o.getTileCoordExtent(i),s=i[0],l=o.getResolution(s);qe(a,-l,a);var u=this.tileGrid,h=u.getExtent();h&&_r(a,h,a);var c=u.getZForResolution(l,this.zDirection);u.forEachTileCoord(a,c,(function(i){var o=n.tileUrlFunction(i,t,e),a=n.sourceTileCache.containsKey(o)?n.sourceTileCache.get(o):new n.tileClass(i,o?ks:zs,o,n.format_,n.tileLoadFunction);r.sourceTiles.push(a);var s=a.getState();if(s<js){var l=function(t){n.handleTileChange(t);var e=a.getState();if(e===js||e===Gs){var i=a.getKey();i in r.errorTileKeys?a.getState()===js&&delete r.errorTileKeys[i]:r.loadingSourceTiles--,e===Gs?r.errorTileKeys[i]=!0:a.removeEventListener(wt,l),0===r.loadingSourceTiles&&r.setState(_t(r.errorTileKeys)?js:Gs)}};a.addEventListener(wt,l),r.loadingSourceTiles++}s===ks&&(a.extent=u.getTileCoordExtent(i),a.projection=e,a.resolution=u.getResolution(i[0]),n.sourceTileCache.set(o,a),a.load())})),r.loadingSourceTiles||r.setState(r.sourceTiles.some((function(t){return t.getState()===Gs}))?Gs:js)}return r.sourceTiles},e.prototype.getTile=function(t,e,r,n,i){var o,a=ef(t,e,r),s=this.getKey();if(this.tileCache.containsKey(a)&&(o=this.tileCache.get(a)).key===s)return o;var l=[t,e,r],u=this.getTileCoordForTileUrlFunction(l,i),h=this.getTileGrid().getExtent(),c=this.getTileGridForProjection(i);if(u&&h){var p=c.getTileCoordExtent(u);qe(p,-c.getResolution(t),p),br(h,p)||(u=null)}var f=!0;if(null!==u){var d=this.tileGrid,g=c.getResolution(t),y=d.getZForResolution(g,1),v=c.getTileCoordExtent(u);qe(v,-g,v),d.forEachTileCoord(v,y,function(t){f=f&&!this.tileUrlFunction(t,n,i)}.bind(this))}var _=new Ed(l,f?zs:ks,u,this.getSourceTiles.bind(this,n,i));return _.key=s,o?(_.interimTile=o,_.refreshInterimChain(),this.tileCache.replace(a,_)):this.tileCache.set(a,_),_},e.prototype.getTileGridForProjection=function(t){var e=t.getCode(),r=this.tileGrids_[e];if(!r){for(var n=this.tileGrid,i=n.getResolutions().slice(),o=i.map((function(t,e){return n.getOrigin(e)})),a=i.map((function(t,e){return n.getTileSize(e)})),s=i.length;s<43;++s)i.push(i[s-1]/2),o.push(o[s-1]),a.push(a[s-1]);r=new lf({extent:n.getExtent(),origins:o,resolutions:i,tileSizes:a}),this.tileGrids_[e]=r}return r},e.prototype.getTilePixelRatio=function(t){return t},e.prototype.getTilePixelSize=function(t,e,r){var n=p(this.getTileGridForProjection(r).getTileSize(t),this.tmpSize);return[Math.round(n[0]*e),Math.round(n[1]*e)]},e.prototype.updateCacheSize=function(e,r){t.prototype.updateCacheSize.call(this,2*e,r),this.sourceTileCache.highWaterMark=this.getTileCacheForProjection(r).highWaterMark},e}(Xf),Rd=Pd;function Od(t,e){t.setLoader((function(r,n,i){Yc(e,t.getFormat(),r,n,i,t.onLoad.bind(t),t.onError.bind(t))}))}var Fd,Md={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 Id(t){return(t=Math.round(t))<0?0:t>255?255:t}function Ld(t){return t<0?0:t>1?1:t}function Ad(t){return"%"===t[t.length-1]?Id(parseFloat(t)/100*255):Id(parseInt(t))}function kd(t){return"%"===t[t.length-1]?Ld(parseFloat(t)/100):Ld(parseFloat(t))}function Dd(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{Fd={}.parseCSSColor=function(t){var e,r=t.replace(/ /g,"").toLowerCase();if(r in Md)return Md[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=kd(a.pop());case"rgb":return 3!==a.length?null:[Ad(a[0]),Ad(a[1]),Ad(a[2]),s];case"hsla":if(4!==a.length)return null;s=kd(a.pop());case"hsl":if(3!==a.length)return null;var l=(parseFloat(a[0])%360+360)%360/360,u=kd(a[1]),h=kd(a[2]),c=h<=.5?h*(u+1):h+u-h*u,p=2*h-c;return[Id(255*Dd(p,c,l+1/3)),Id(255*Dd(p,c,l)),Id(255*Dd(p,c,l-1/3)),s];default:return null}}return null}}catch(t){}var jd=function(t,e,r,n){void 0===n&&(n=1),this.r=t,this.g=e,this.b=r,this.a=n};function Gd(t){return"object"==typeof t?["literal",t]:t}function zd(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,Gd(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],qd(t[1])]:[t[0],Gd(t[1])]})),n?function(t,e,r){for(var n={},i={},o=[],a=0;a<r.length;a++){var s=r[a],l=s[0].zoom;void 0===n[l]&&(n[l]={zoom:l,type:t.type,property:t.property,default:t.default},i[l]=[],o.push(l)),i[l].push([s[0].value,s[1]])}if("exponential"===Wd({},e)){for(var u=[Nd(t),["linear"],["zoom"]],h=0,c=o;h<c.length;h+=1){var p=c[h];Xd(u,p,Bd(n[p],e,i[p]),!1)}return u}for(var f=["step",["zoom"]],d=0,g=o;d<g.length;d+=1){var y=g[d];Xd(f,y,Bd(n[y],e,i[y]),!0)}return Vd(f),f}(t,e,r):o?function(t,e,r,n){void 0===n&&(n=["zoom"]);var i,o=Wd(t,e),a=!1;if("interval"===o)i=["step",n],a=!0;else{if("exponential"!==o)throw new Error('Unknown zoom function type "'+o+'"');var s=void 0!==t.base?t.base:1;i=[Nd(t),1===s?["linear"]:["exponential",s],n]}for(var l=0,u=r;l<u.length;l+=1){var h=u[l];Xd(i,h[0],h[1],a)}return Vd(i),i}(t,e,r):Bd(t,e,r)}function Nd(t){switch(t.colorSpace){case"hcl":return"interpolate-hcl";case"lab":return"interpolate-lab";default:return"interpolate"}}function Ud(t,e){var r,n,i=Gd((r=t.default,n=e.default,void 0!==r?r:void 0!==n?n:void 0));return void 0===i&&"resolvedImage"===e.type?"":i}function Bd(t,e,r){var n=Wd(t,e),i=["get",t.property];if("categorical"===n&&"boolean"==typeof r[0][0]){for(var o=["case"],a=0,s=r;a<s.length;a+=1){var l=s[a];o.push(["==",i,l[0]],l[1])}return o.push(Ud(t,e)),o}if("categorical"===n){for(var u=["match",i],h=0,c=r;h<c.length;h+=1){var p=c[h];Xd(u,p[0],p[1],!1)}return u.push(Ud(t,e)),u}if("interval"===n){for(var f=["step",["number",i]],d=0,g=r;d<g.length;d+=1){var y=g[d];Xd(f,y[0],y[1],!0)}return Vd(f),void 0===t.default?f:["case",["==",["typeof",i],"number"],f,Gd(t.default)]}if("exponential"===n){for(var v=void 0!==t.base?t.base:1,_=[Nd(t),1===v?["linear"]:["exponential",v],["number",i]],m=0,x=r;m<x.length;m+=1){var w=x[m];Xd(_,w[0],w[1],!1)}return void 0===t.default?_:["case",["==",["typeof",i],"number"],_,Gd(t.default)]}throw new Error("Unknown property function type "+n)}function Vd(t){"step"===t[0]&&3===t.length&&(t.push(0),t.push(t[3]))}function Xd(t,e,r,n){t.length>3&&e===t[t.length-2]||(n&&2===t.length||t.push(e),t.push(r))}function Wd(t,e){return t.type?t.type:e.expression.interpolated?"exponential":"interval"}function qd(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<t.length)e.push(t.slice(n));else if(2===e.length)return["to-string",e[1]];return e}jd.parse=function(t){if(t){if(t instanceof jd)return t;if("string"==typeof t){var e=Fd(t);if(e)return new jd(e[0]/255*e[3],e[1]/255*e[3],e[2]/255*e[3],e[3])}}},jd.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+")"},jd.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]},jd.prototype.toArray01=function(){var t=this,e=t.r,r=t.g,n=t.b,i=t.a;return 0===i?[0,0,0,0]:[e/i,r/i,n/i,i]},jd.prototype.toArray01PremultipliedAlpha=function(){var t=this;return[t.r,t.g,t.b,t.a]},jd.black=new jd(0,0,0,1),jd.white=new jd(1,1,1,1),jd.transparent=new jd(0,0,0,0),jd.red=new jd(1,0,0,1),jd.blue=new jd(0,0,1,1);var Yd=function(t){function e(e,r){t.call(this,r),this.message=r,this.key=e}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e}(Error),Kd=function(t,e){void 0===e&&(e=[]),this.parent=t,this.bindings={};for(var r=0,n=e;r<n.length;r+=1){var i=n[r],o=i[0],a=i[1];this.bindings[o]=a}};Kd.prototype.concat=function(t){return new Kd(this,t)},Kd.prototype.get=function(t){if(this.bindings[t])return this.bindings[t];if(this.parent)return this.parent.get(t);throw new Error(t+" not found in scope.")},Kd.prototype.has=function(t){return!!this.bindings[t]||!!this.parent&&this.parent.has(t)};var Zd={kind:"null"},Hd={kind:"number"},Jd={kind:"string"},Qd={kind:"boolean"},$d={kind:"color"},tg={kind:"object"},eg={kind:"value"},rg={kind:"collator"},ng={kind:"formatted"},ig={kind:"resolvedImage"};function og(t,e){return{kind:"array",itemType:t,N:e}}function ag(t){if("array"===t.kind){var e=ag(t.itemType);return"number"==typeof t.N?"array<"+e+", "+t.N+">":"value"===t.itemType.kind?"array":"array<"+e+">"}return t.kind}var sg=[Zd,Hd,Jd,Qd,$d,ng,tg,og(eg),ig];function lg(t,e){if("error"===e.kind)return null;if("array"===t.kind){if("array"===e.kind&&(0===e.N&&"value"===e.itemType.kind||!lg(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=sg;r<n.length;r+=1){if(!lg(n[r],e))return null}}return"Expected "+ag(t)+" but found "+ag(e)+" instead."}function ug(t,e){return e.some((function(e){return e.kind===t.kind}))}function hg(t,e){return e.some((function(e){return"null"===e?null===t:"array"===e?Array.isArray(t):"object"===e?t&&!Array.isArray(t)&&"object"==typeof t:e===typeof t}))}var cg=function(t,e,r){this.sensitivity=t?e?"variant":"case":e?"accent":"base",this.locale=r,this.collator=new Intl.Collator(this.locale?this.locale:[],{sensitivity:this.sensitivity,usage:"search"})};cg.prototype.compare=function(t,e){return this.collator.compare(t,e)},cg.prototype.resolvedLocale=function(){return new Intl.Collator(this.locale?this.locale:[]).resolvedOptions().locale};var pg=function(t,e,r,n,i){this.text=t.normalize?t.normalize():t,this.image=e,this.scale=r,this.fontStack=n,this.textColor=i},fg=function(t){this.sections=t};fg.fromString=function(t){return new fg([new pg(t,null,null,null,null)])},fg.prototype.isEmpty=function(){return 0===this.sections.length||!this.sections.some((function(t){return 0!==t.text.length||t.image&&0!==t.image.name.length}))},fg.factory=function(t){return t instanceof fg?t:fg.fromString(t)},fg.prototype.toString=function(){return 0===this.sections.length?"":this.sections.map((function(t){return t.text})).join("")},fg.prototype.serialize=function(){for(var t=["format"],e=0,r=this.sections;e<r.length;e+=1){var n=r[e];if(n.image)t.push(["image",n.image.name]);else{t.push(n.text);var i={};n.fontStack&&(i["text-font"]=["literal",n.fontStack.split(",")]),n.scale&&(i["font-scale"]=n.scale),n.textColor&&(i["text-color"]=["rgba"].concat(n.textColor.toArray())),t.push(i)}}return t};var dg=function(t){this.name=t.name,this.available=t.available};function gg(t,e,r,n){return"number"==typeof t&&t>=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 yg(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 jd)return!0;if(t instanceof cg)return!0;if(t instanceof fg)return!0;if(t instanceof dg)return!0;if(Array.isArray(t)){for(var e=0,r=t;e<r.length;e+=1){if(!yg(r[e]))return!1}return!0}if("object"==typeof t){for(var n in t)if(!yg(t[n]))return!1;return!0}return!1}function vg(t){if(null===t)return Zd;if("string"==typeof t)return Jd;if("boolean"==typeof t)return Qd;if("number"==typeof t)return Hd;if(t instanceof jd)return $d;if(t instanceof cg)return rg;if(t instanceof fg)return ng;if(t instanceof dg)return ig;if(Array.isArray(t)){for(var e,r=t.length,n=0,i=t;n<i.length;n+=1){var o=vg(i[n]);if(e){if(e===o)continue;e=eg;break}e=o}return og(e||eg,r)}return tg}function _g(t){var e=typeof t;return null===t?"":"string"===e||"number"===e||"boolean"===e?String(t):t instanceof jd||t instanceof fg||t instanceof dg?t.toString():JSON.stringify(t)}dg.prototype.toString=function(){return this.name},dg.fromString=function(t){return t?new dg({name:t,available:!1}):null},dg.prototype.serialize=function(){return["image",this.name]};var mg=function(t,e){this.type=t,this.value=e};mg.parse=function(t,e){if(2!==t.length)return e.error("'literal' expression requires exactly one argument, but found "+(t.length-1)+" instead.");if(!yg(t[1]))return e.error("invalid value");var r=t[1],n=vg(r),i=e.expectedType;return"array"!==n.kind||0!==n.N||!i||"array"!==i.kind||"number"==typeof i.N&&0!==i.N||(n=i),new mg(n,r)},mg.prototype.evaluate=function(){return this.value},mg.prototype.eachChild=function(){},mg.prototype.outputDefined=function(){return!0},mg.prototype.serialize=function(){return"array"===this.type.kind||"object"===this.type.kind?["literal",this.value]:this.value instanceof jd?["rgba"].concat(this.value.toArray()):this.value instanceof fg?this.value.serialize():this.value};var xg=function(t){this.name="ExpressionEvaluationError",this.message=t};xg.prototype.toJSON=function(){return this.message};var wg={string:Jd,number:Hd,boolean:Qd,object:tg},bg=function(t,e){this.type=t,this.args=e};bg.parse=function(t,e){if(t.length<2)return e.error("Expected at least one argument.");var r,n=1,i=t[0];if("array"===i){var o,a;if(t.length>2){var s=t[1];if("string"!=typeof s||!(s in wg)||"object"===s)return e.error('The item type argument of "array" must be one of string, number, boolean',1);o=wg[s],n++}else o=eg;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=og(o,a)}else r=wg[i];for(var l=[];n<t.length;n++){var u=e.parse(t[n],n,eg);if(!u)return null;l.push(u)}return new bg(r,l)},bg.prototype.evaluate=function(t){for(var e=0;e<this.args.length;e++){var r=this.args[e].evaluate(t);if(!lg(this.type,vg(r)))return r;if(e===this.args.length-1)throw new xg("Expected value to be of type "+ag(this.type)+", but found "+ag(vg(r))+" instead.")}return null},bg.prototype.eachChild=function(t){this.args.forEach(t)},bg.prototype.outputDefined=function(){return this.args.every((function(t){return t.outputDefined()}))},bg.prototype.serialize=function(){var t=this.type,e=[t.kind];if("array"===t.kind){var r=t.itemType;if("string"===r.kind||"number"===r.kind||"boolean"===r.kind){e.push(r.kind);var n=t.N;("number"==typeof n||this.args.length>1)&&e.push(n)}}return e.concat(this.args.map((function(t){return t.serialize()})))};var Sg=function(t){this.type=ng,this.sections=t};Sg.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,Hd)))return null;var l=null;if(a["text-font"]&&!(l=e.parse(a["text-font"],1,og(Jd))))return null;var u=null;if(a["text-color"]&&!(u=e.parse(a["text-color"],1,$d)))return null;var h=n[n.length-1];h.scale=s,h.font=l,h.textColor=u}else{var c=e.parse(t[o],1,eg);if(!c)return null;var p=c.type.kind;if("string"!==p&&"value"!==p&&"null"!==p&&"resolvedImage"!==p)return e.error("Formatted text type must be 'string', 'value', 'image' or 'null'.");i=!0,n.push({content:c,scale:null,font:null,textColor:null})}}return new Sg(n)},Sg.prototype.evaluate=function(t){return new fg(this.sections.map((function(e){var r=e.content.evaluate(t);return vg(r)===ig?new pg("",r,null,null,null):new pg(_g(r),null,e.scale?e.scale.evaluate(t):null,e.font?e.font.evaluate(t).join(","):null,e.textColor?e.textColor.evaluate(t):null)})))},Sg.prototype.eachChild=function(t){for(var e=0,r=this.sections;e<r.length;e+=1){var n=r[e];t(n.content),n.scale&&t(n.scale),n.font&&t(n.font),n.textColor&&t(n.textColor)}},Sg.prototype.outputDefined=function(){return!1},Sg.prototype.serialize=function(){for(var t=["format"],e=0,r=this.sections;e<r.length;e+=1){var n=r[e];t.push(n.content.serialize());var i={};n.scale&&(i["font-scale"]=n.scale.serialize()),n.font&&(i["text-font"]=n.font.serialize()),n.textColor&&(i["text-color"]=n.textColor.serialize()),t.push(i)}return t};var Cg=function(t){this.type=ig,this.input=t};Cg.parse=function(t,e){if(2!==t.length)return e.error("Expected two arguments.");var r=e.parse(t[1],1,Jd);return r?new Cg(r):e.error("No image name provided.")},Cg.prototype.evaluate=function(t){var e=this.input.evaluate(t),r=dg.fromString(e);return r&&t.availableImages&&(r.available=t.availableImages.indexOf(e)>-1),r},Cg.prototype.eachChild=function(t){t(this.input)},Cg.prototype.outputDefined=function(){return!1},Cg.prototype.serialize=function(){return["image",this.input.serialize()]};var Eg={"to-boolean":Qd,"to-color":$d,"to-number":Hd,"to-string":Jd},Tg=function(t,e){this.type=t,this.args=e};Tg.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=Eg[r],i=[],o=1;o<t.length;o++){var a=e.parse(t[o],o,eg);if(!a)return null;i.push(a)}return new Tg(n,i)},Tg.prototype.evaluate=function(t){if("boolean"===this.type.kind)return Boolean(this.args[0].evaluate(t));if("color"===this.type.kind){for(var e,r,n=0,i=this.args;n<i.length;n+=1){if(r=null,(e=i[n].evaluate(t))instanceof jd)return e;if("string"==typeof e){var o=t.parseColor(e);if(o)return o}else if(Array.isArray(e)&&!(r=e.length<3||e.length>4?"Invalid rbga value "+JSON.stringify(e)+": expected an array containing either three or four numeric values.":gg(e[0],e[1],e[2],e[3])))return new jd(e[0]/255,e[1]/255,e[2]/255,e[3])}throw new xg(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<l.length;s+=1){if(null===(a=l[s].evaluate(t)))return 0;var u=Number(a);if(!isNaN(u))return u}throw new xg("Could not convert "+JSON.stringify(a)+" to number.")}return"formatted"===this.type.kind?fg.fromString(_g(this.args[0].evaluate(t))):"resolvedImage"===this.type.kind?dg.fromString(_g(this.args[0].evaluate(t))):_g(this.args[0].evaluate(t))},Tg.prototype.eachChild=function(t){this.args.forEach(t)},Tg.prototype.outputDefined=function(){return this.args.every((function(t){return t.outputDefined()}))},Tg.prototype.serialize=function(){if("formatted"===this.type.kind)return new Sg([{content:this.args[0],scale:null,font:null,textColor:null}]).serialize();if("resolvedImage"===this.type.kind)return new Cg(this.args[0]).serialize();var t=["to-"+this.type.kind];return this.eachChild((function(e){t.push(e.serialize())})),t};var Pg=["Unknown","Point","LineString","Polygon"],Rg=function(){this.globals=null,this.feature=null,this.featureState=null,this.formattedSection=null,this._parseColorCache={},this.availableImages=null,this.canonical=null,this.featureTileCoord=null,this.featureDistanceData=null};Rg.prototype.id=function(){return this.feature&&"id"in this.feature&&this.feature.id?this.feature.id:null},Rg.prototype.geometryType=function(){return this.feature?"number"==typeof this.feature.type?Pg[this.feature.type]:this.feature.type:null},Rg.prototype.geometry=function(){return this.feature&&"geometry"in this.feature?this.feature.geometry:null},Rg.prototype.canonicalID=function(){return this.canonical},Rg.prototype.properties=function(){return this.feature&&this.feature.properties||{}},Rg.prototype.distanceFromCenter=function(){if(this.featureTileCoord&&this.featureDistanceData){var t=this.featureDistanceData.center,e=this.featureDistanceData.scale,r=this.featureTileCoord,n=r.x,i=r.y,o=n*e-t[0],a=i*e-t[1];return this.featureDistanceData.bearing[0]*o+this.featureDistanceData.bearing[1]*a}return 0},Rg.prototype.parseColor=function(t){var e=this._parseColorCache[t];return e||(e=this._parseColorCache[t]=jd.parse(t)),e};var Og=function(t,e,r,n){this.name=t,this.type=e,this._evaluate=r,this.args=n};Og.prototype.evaluate=function(t){return this._evaluate(t,this.args)},Og.prototype.eachChild=function(t){this.args.forEach(t)},Og.prototype.outputDefined=function(){return!1},Og.prototype.serialize=function(){return[this.name].concat(this.args.map((function(t){return t.serialize()})))},Og.parse=function(t,e){var r,n=t[0],i=Og.definitions[n];if(!i)return e.error('Unknown expression "'+n+'". If you wanted a literal array, use ["literal", [...]].',0);for(var o=Array.isArray(i)?i[0]:i.type,a=Array.isArray(i)?[[i[1],i[2]]]:i.overloads,s=a.filter((function(e){var r=e[0];return!Array.isArray(r)||r.length===t.length-1})),l=null,u=0,h=s;u<h.length;u+=1){var c=h[u],p=c[0],f=c[1];l=new $g(e.registry,e.path,null,e.scope);for(var d=[],g=!1,y=1;y<t.length;y++){var v=t[y],_=Array.isArray(p)?p[y-1]:p.type,m=l.parse(v,1+d.length,_);if(!m){g=!0;break}d.push(m)}if(!g)if(Array.isArray(p)&&p.length!==d.length)l.error("Expected "+p.length+" arguments, but found "+d.length+" instead.");else{for(var x=0;x<d.length;x++){var w=Array.isArray(p)?p[x]:p.type,b=d[x];l.concat(x+1).checkSubtype(w,b.type)}if(0===l.errors.length)return new Og(n,o,f,d)}}if(1===s.length)(r=e.errors).push.apply(r,l.errors);else{for(var S=(s.length?s:a).map((function(t){var e,r=t[0];return e=r,Array.isArray(e)?"("+e.map(ag).join(", ")+")":"("+ag(e.type)+"...)"})).join(" | "),C=[],E=1;E<t.length;E++){var T=e.parse(t[E],1+C.length);if(!T)return null;C.push(ag(T.type))}e.error("Expected arguments of type "+S+", but found ("+C.join(", ")+") instead.")}return null},Og.register=function(t,e){for(var r in Og.definitions=e,e)t[r]=Og};var Fg=function(t,e,r){this.type=rg,this.locale=r,this.caseSensitive=t,this.diacriticSensitive=e};Fg.parse=function(t,e){if(2!==t.length)return e.error("Expected one argument.");var r=t[1];if("object"!=typeof r||Array.isArray(r))return e.error("Collator options argument must be an object.");var n=e.parse(void 0!==r["case-sensitive"]&&r["case-sensitive"],1,Qd);if(!n)return null;var i=e.parse(void 0!==r["diacritic-sensitive"]&&r["diacritic-sensitive"],1,Qd);if(!i)return null;var o=null;return r.locale&&!(o=e.parse(r.locale,1,Jd))?null:new Fg(n,i,o)},Fg.prototype.evaluate=function(t){return new cg(this.caseSensitive.evaluate(t),this.diacriticSensitive.evaluate(t),this.locale?this.locale.evaluate(t):null)},Fg.prototype.eachChild=function(t){t(this.caseSensitive),t(this.diacriticSensitive),this.locale&&t(this.locale)},Fg.prototype.outputDefined=function(){return!1},Fg.prototype.serialize=function(){var t={};return t["case-sensitive"]=this.caseSensitive.serialize(),t["diacritic-sensitive"]=this.diacriticSensitive.serialize(),this.locale&&(t.locale=this.locale.serialize()),["collator",t]};var Mg=8192;function Ig(t,e){t[0]=Math.min(t[0],e[0]),t[1]=Math.min(t[1],e[1]),t[2]=Math.max(t[2],e[0]),t[3]=Math.max(t[3],e[1])}function Lg(t,e){return!(t[0]<=e[0])&&(!(t[2]>=e[2])&&(!(t[1]<=e[1])&&!(t[3]>=e[3])))}function Ag(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*Mg),Math.round(i*o*Mg)]}function kg(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 Dg(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 jg(t,e){for(var r=!1,n=0,i=e.length;n<i;n++)for(var o=e[n],a=0,s=o.length;a<s-1;a++){if(kg(t,o[a],o[a+1]))return!1;Dg(t,o[a],o[a+1])&&(r=!r)}return r}function Gg(t,e){for(var r=0;r<e.length;r++)if(jg(t,e[r]))return!0;return!1}function zg(t,e,r,n){var i=t[0]-r[0],o=t[1]-r[1],a=e[0]-r[0],s=e[1]-r[1],l=n[0]-r[0],u=n[1]-r[1],h=i*u-l*o,c=a*u-l*s;return h>0&&c<0||h<0&&c>0}function Ng(t,e,r){for(var n=0,i=r;n<i.length;n+=1)for(var o=i[n],a=0;a<o.length-1;++a)if(s=t,l=e,u=o[a],h=o[a+1],c=void 0,p=void 0,f=void 0,d=void 0,f=[l[0]-s[0],l[1]-s[1]],d=[h[0]-u[0],h[1]-u[1]],0!=(c=d)[0]*(p=f)[1]-c[1]*p[0]&&zg(s,l,u,h)&&zg(u,h,s,l))return!0;var s,l,u,h,c,p,f,d;return!1}function Ug(t,e){for(var r=0;r<t.length;++r)if(!jg(t[r],e))return!1;for(var n=0;n<t.length-1;++n)if(Ng(t[n],t[n+1],e))return!1;return!0}function Bg(t,e){for(var r=0;r<e.length;r++)if(Ug(t,e[r]))return!0;return!1}function Vg(t,e,r){for(var n=[],i=0;i<t.length;i++){for(var o=[],a=0;a<t[i].length;a++){var s=Ag(t[i][a],r);Ig(e,s),o.push(s)}n.push(o)}return n}function Xg(t,e,r){for(var n=[],i=0;i<t.length;i++){var o=Vg(t[i],e,r);n.push(o)}return n}function Wg(t,e,r,n){if(t[0]<r[0]||t[0]>r[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}Ig(e,t)}function qg(t,e,r,n){var i=Math.pow(2,n.z)*Mg,o=[n.x*Mg,n.y*Mg],a=[];if(!t)return a;for(var s=0,l=t;s<l.length;s+=1)for(var u=0,h=l[s];u<h.length;u+=1){var c=h[u],p=[c.x+o[0],c.y+o[1]];Wg(p,e,r,i),a.push(p)}return a}function Yg(t,e,r,n){var i,o=Math.pow(2,n.z)*Mg,a=[n.x*Mg,n.y*Mg],s=[];if(!t)return s;for(var l=0,u=t;l<u.length;l+=1){for(var h=[],c=0,p=u[l];c<p.length;c+=1){var f=p[c],d=[f.x+a[0],f.y+a[1]];Ig(e,d),h.push(d)}s.push(h)}if(e[2]-e[0]<=o/2){(i=e)[0]=i[1]=1/0,i[2]=i[3]=-1/0;for(var g=0,y=s;g<y.length;g+=1)for(var v=0,_=y[g];v<_.length;v+=1){Wg(_[v],e,r,o)}}return s}var Kg=function(t,e){this.type=Qd,this.geojson=t,this.geometries=e};function Zg(t){if(t instanceof Og){if("get"===t.name&&1===t.args.length)return!1;if("feature-state"===t.name)return!1;if("has"===t.name&&1===t.args.length)return!1;if("properties"===t.name||"geometry-type"===t.name||"id"===t.name)return!1;if(/^filter-/.test(t.name))return!1}if(t instanceof Kg)return!1;var e=!0;return t.eachChild((function(t){e&&!Zg(t)&&(e=!1)})),e}function Hg(t){if(t instanceof Og&&"feature-state"===t.name)return!1;var e=!0;return t.eachChild((function(t){e&&!Hg(t)&&(e=!1)})),e}function Jg(t,e){if(t instanceof Og&&e.indexOf(t.name)>=0)return!1;var r=!0;return t.eachChild((function(t){r&&!Jg(t,e)&&(r=!1)})),r}Kg.parse=function(t,e){if(2!==t.length)return e.error("'within' expression requires exactly one argument, but found "+(t.length-1)+" instead.");if(yg(t[1])){var r=t[1];if("FeatureCollection"===r.type)for(var n=0;n<r.features.length;++n){var i=r.features[n].geometry.type;if("Polygon"===i||"MultiPolygon"===i)return new Kg(r,r.features[n].geometry)}else if("Feature"===r.type){var o=r.geometry.type;if("Polygon"===o||"MultiPolygon"===o)return new Kg(r,r.geometry)}else if("Polygon"===r.type||"MultiPolygon"===r.type)return new Kg(r,r)}return e.error("'within' expression requires valid geojson object that contains polygon geometry type.")},Kg.prototype.evaluate=function(t){if(null!=t.geometry()&&null!=t.canonicalID()){if("Point"===t.geometryType())return function(t,e){var r=[1/0,1/0,-1/0,-1/0],n=[1/0,1/0,-1/0,-1/0],i=t.canonicalID();if(!i)return!1;if("Polygon"===e.type){var o=Vg(e.coordinates,n,i),a=qg(t.geometry(),r,n,i);if(!Lg(r,n))return!1;for(var s=0,l=a;s<l.length;s+=1)if(!jg(l[s],o))return!1}if("MultiPolygon"===e.type){var u=Xg(e.coordinates,n,i),h=qg(t.geometry(),r,n,i);if(!Lg(r,n))return!1;for(var c=0,p=h;c<p.length;c+=1)if(!Gg(p[c],u))return!1}return!0}(t,this.geometries);if("LineString"===t.geometryType())return function(t,e){var r=[1/0,1/0,-1/0,-1/0],n=[1/0,1/0,-1/0,-1/0],i=t.canonicalID();if(!i)return!1;if("Polygon"===e.type){var o=Vg(e.coordinates,n,i),a=Yg(t.geometry(),r,n,i);if(!Lg(r,n))return!1;for(var s=0,l=a;s<l.length;s+=1)if(!Ug(l[s],o))return!1}if("MultiPolygon"===e.type){var u=Xg(e.coordinates,n,i),h=Yg(t.geometry(),r,n,i);if(!Lg(r,n))return!1;for(var c=0,p=h;c<p.length;c+=1)if(!Bg(p[c],u))return!1}return!0}(t,this.geometries)}return!1},Kg.prototype.eachChild=function(){},Kg.prototype.outputDefined=function(){return!0},Kg.prototype.serialize=function(){return["within",this.geojson]};var Qg=function(t,e){this.type=e.type,this.name=t,this.boundExpression=e};Qg.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 Qg(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)},Qg.prototype.evaluate=function(t){return this.boundExpression.evaluate(t)},Qg.prototype.eachChild=function(){},Qg.prototype.outputDefined=function(){return!1},Qg.prototype.serialize=function(){return["var",this.name]};var $g=function(t,e,r,n,i){void 0===e&&(e=[]),void 0===n&&(n=new Kd),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};function ty(t){if(t instanceof Qg)return ty(t.boundExpression);if(t instanceof Og&&"error"===t.name)return!1;if(t instanceof Fg)return!1;if(t instanceof Kg)return!1;var e=t instanceof Tg||t instanceof bg,r=!0;return t.eachChild((function(t){r=e?r&&ty(t):r&&t instanceof mg})),!!r&&(Zg(t)&&Jg(t,["zoom","heatmap-density","line-progress","sky-radial-progress","accumulated","is-supported-script","pitch","distance-from-center"]))}function ey(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||e<n)return s;o=s+1}else{if(!(r>e))throw new xg("Input is not a number.");a=s-1}return 0}$g.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)},$g.prototype._parse=function(t,e){function r(t,e,r){return"assert"===r?new bg(e,[t]):"coerce"===r?new Tg(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 mg)&&"resolvedImage"!==o.type.kind&&ty(o)){var l=new Rg;try{o=new mg(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.")},$g.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 $g(this.registry,n,e||null,i,this.errors)},$g.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 Yd(n,t))},$g.prototype.checkSubtype=function(t,e){var r=lg(t,e);return r&&this.error(r),r};var ry=function(t,e,r){this.type=t,this.input=e,this.labels=[],this.outputs=[];for(var n=0,i=r;n<i.length;n+=1){var o=i[n],a=o[0],s=o[1];this.labels.push(a),this.outputs.push(s)}};ry.parse=function(t,e){if(t.length-1<4)return e.error("Expected at least 4 arguments, but found only "+(t.length-1)+".");if((t.length-1)%2!=0)return e.error("Expected an even number of arguments.");var r=e.parse(t[1],1,Hd);if(!r)return null;var n=[],i=null;e.expectedType&&"value"!==e.expectedType.kind&&(i=e.expectedType);for(var o=1;o<t.length;o+=2){var a=1===o?-1/0:t[o],s=t[o+1],l=o,u=o+1;if("number"!=typeof a)return e.error('Input/output pairs for "step" expressions must be defined using literal numeric values (not computed expressions) for the input values.',l);if(n.length&&n[n.length-1][0]>=a)return e.error('Input/output pairs for "step" expressions must be arranged with input values in strictly ascending order.',l);var h=e.parse(s,u,i);if(!h)return null;i=i||h.type,n.push([a,h])}return new ry(i,r,n)},ry.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[ey(e,n)].evaluate(t)},ry.prototype.eachChild=function(t){t(this.input);for(var e=0,r=this.outputs;e<r.length;e+=1){t(r[e])}},ry.prototype.outputDefined=function(){return this.outputs.every((function(t){return t.outputDefined()}))},ry.prototype.serialize=function(){for(var t=["step",this.input.serialize()],e=0;e<this.labels.length;e++)e>0&&t.push(this.labels[e]),t.push(this.outputs[e].serialize());return t};var ny=iy;function iy(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 oy(t,e,r){return t*(1-r)+e*r}iy.prototype.sampleCurveX=function(t){return((this.ax*t+this.bx)*t+this.cx)*t},iy.prototype.sampleCurveY=function(t){return((this.ay*t+this.by)*t+this.cy)*t},iy.prototype.sampleCurveDerivativeX=function(t){return(3*this.ax*t+2*this.bx)*t+this.cx},iy.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)<e)return i;var s=this.sampleCurveDerivativeX(i);if(Math.abs(s)<1e-6)break;i-=o/s}if((i=t)<(r=0))return r;if(i>(n=1))return n;for(;r<n;){if(o=this.sampleCurveX(i),Math.abs(o-t)<e)return i;t>o?r=i:n=i,i=.5*(n-r)+r}return i},iy.prototype.solve=function(t,e){return this.sampleCurveY(this.solveCurveX(t,e))};var ay=Object.freeze({__proto__:null,number:oy,color:function(t,e,r){return new jd(oy(t.r,e.r,r),oy(t.g,e.g,r),oy(t.b,e.b,r),oy(t.a,e.a,r))},array:function(t,e,r){return t.map((function(t,n){return oy(t,e[n],r)}))}}),sy=.95047,ly=1.08883,uy=4/29,hy=6/29,cy=3*hy*hy,py=Math.PI/180,fy=180/Math.PI;function dy(t){return t>.008856451679035631?Math.pow(t,1/3):t/cy+uy}function gy(t){return t>hy?t*t*t:cy*(t-uy)}function yy(t){return 255*(t<=.0031308?12.92*t:1.055*Math.pow(t,1/2.4)-.055)}function vy(t){return(t/=255)<=.04045?t/12.92:Math.pow((t+.055)/1.055,2.4)}function _y(t){var e=vy(t.r),r=vy(t.g),n=vy(t.b),i=dy((.4124564*e+.3575761*r+.1804375*n)/sy),o=dy((.2126729*e+.7151522*r+.072175*n)/1);return{l:116*o-16,a:500*(i-o),b:200*(o-dy((.0193339*e+.119192*r+.9503041*n)/ly)),alpha:t.a}}function my(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*gy(e),r=sy*gy(r),n=ly*gy(n),new jd(yy(3.2404542*r-1.5371385*e-.4985314*n),yy(-.969266*r+1.8760108*e+.041556*n),yy(.0556434*r-.2040259*e+1.0572252*n),t.alpha)}function xy(t,e,r){var n=e-t;return t+r*(n>180||n<-180?n-360*Math.round(n/360):n)}var wy={forward:_y,reverse:my,interpolate:function(t,e,r){return{l:oy(t.l,e.l,r),a:oy(t.a,e.a,r),b:oy(t.b,e.b,r),alpha:oy(t.alpha,e.alpha,r)}}},by={forward:function(t){var e=_y(t),r=e.l,n=e.a,i=e.b,o=Math.atan2(i,n)*fy;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*py,r=t.c;return my({l:t.l,a:Math.cos(e)*r,b:Math.sin(e)*r,alpha:t.alpha})},interpolate:function(t,e,r){return{h:xy(t.h,e.h,r),c:oy(t.c,e.c,r),l:oy(t.l,e.l,r),alpha:oy(t.alpha,e.alpha,r)}}},Sy=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;o<a.length;o+=1){var s=a[o],l=s[0],u=s[1];this.labels.push(l),this.outputs.push(u)}};function Cy(t,e,r,n){var i=n-r,o=t-r;return 0===i?0:1===e?o/i:(Math.pow(e,o)-1)/(Math.pow(e,i)-1)}Sy.interpolationFactor=function(t,e,r,n){var i=0;if("exponential"===t.name)i=Cy(e,t.base,r,n);else if("linear"===t.name)i=Cy(e,1,r,n);else if("cubic-bezier"===t.name){var o=t.controlPoints;i=new ny(o[0],o[1],o[2],o[3]).solve(Cy(e,1,r,n))}return i},Sy.parse=function(t,e){var r=t[0],n=t[1],i=t[2],o=t.slice(3);if(!Array.isArray(n)||0===n.length)return e.error("Expected an interpolation type expression.",1);if("linear"===n[0])n={name:"linear"};else if("exponential"===n[0]){var a=n[1];if("number"!=typeof a)return e.error("Exponential interpolation requires a numeric base.",1,1);n={name:"exponential",base:a}}else{if("cubic-bezier"!==n[0])return e.error("Unknown interpolation type "+String(n[0]),1,0);var s=n.slice(1);if(4!==s.length||s.some((function(t){return"number"!=typeof t||t<0||t>1})))return e.error("Cubic bezier interpolation requires four numeric arguments with values between 0 and 1.",1);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,Hd)))return null;var l=[],u=null;"interpolate-hcl"===r||"interpolate-lab"===r?u=$d:e.expectedType&&"value"!==e.expectedType.kind&&(u=e.expectedType);for(var h=0;h<o.length;h+=2){var c=o[h],p=o[h+1],f=h+3,d=h+4;if("number"!=typeof c)return e.error('Input/output pairs for "interpolate" expressions must be defined using literal numeric values (not computed expressions) for the input values.',f);if(l.length&&l[l.length-1][0]>=c)return e.error('Input/output pairs for "interpolate" expressions must be arranged with input values in strictly ascending order.',f);var g=e.parse(p,d,u);if(!g)return null;u=u||g.type,l.push([c,g])}return"number"===u.kind||"color"===u.kind||"array"===u.kind&&"number"===u.itemType.kind&&"number"==typeof u.N?new Sy(u,r,n,i,l):e.error("Type "+ag(u)+" is not interpolatable.")},Sy.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=ey(e,n),a=e[o],s=e[o+1],l=Sy.interpolationFactor(this.interpolation,n,a,s),u=r[o].evaluate(t),h=r[o+1].evaluate(t);return"interpolate"===this.operator?ay[this.type.kind.toLowerCase()](u,h,l):"interpolate-hcl"===this.operator?by.reverse(by.interpolate(by.forward(u),by.forward(h),l)):wy.reverse(wy.interpolate(wy.forward(u),wy.forward(h),l))},Sy.prototype.eachChild=function(t){t(this.input);for(var e=0,r=this.outputs;e<r.length;e+=1){t(r[e])}},Sy.prototype.outputDefined=function(){return this.outputs.every((function(t){return t.outputDefined()}))},Sy.prototype.serialize=function(){var t;t="linear"===this.interpolation.name?["linear"]:"exponential"===this.interpolation.name?1===this.interpolation.base?["linear"]:["exponential",this.interpolation.base]:["cubic-bezier"].concat(this.interpolation.controlPoints);for(var e=[this.operator,t,this.input.serialize()],r=0;r<this.labels.length;r++)e.push(this.labels[r],this.outputs[r].serialize());return e};var Ey=function(t,e){this.type=t,this.args=e};Ey.parse=function(t,e){if(t.length<2)return e.error("Expectected at least one argument.");var r=null,n=e.expectedType;n&&"value"!==n.kind&&(r=n);for(var i=[],o=0,a=t.slice(1);o<a.length;o+=1){var s=a[o],l=e.parse(s,1+i.length,r,void 0,{typeAnnotation:"omit"});if(!l)return null;r=r||l.type,i.push(l)}var u=n&&i.some((function(t){return lg(n,t.type)}));return new Ey(u?eg:r,i)},Ey.prototype.evaluate=function(t){for(var e,r=null,n=0,i=0,o=this.args;i<o.length;i+=1){if(n++,(r=o[i].evaluate(t))&&r instanceof dg&&!r.available&&(e||(e=r),r=null,n===this.args.length))return e;if(null!==r)break}return r},Ey.prototype.eachChild=function(t){this.args.forEach(t)},Ey.prototype.outputDefined=function(){return this.args.every((function(t){return t.outputDefined()}))},Ey.prototype.serialize=function(){var t=["coalesce"];return this.eachChild((function(e){t.push(e.serialize())})),t};var Ty=function(t,e){this.type=e.type,this.bindings=[].concat(t),this.result=e};Ty.prototype.evaluate=function(t){return this.result.evaluate(t)},Ty.prototype.eachChild=function(t){for(var e=0,r=this.bindings;e<r.length;e+=1){t(r[e][1])}t(this.result)},Ty.parse=function(t,e){if(t.length<4)return e.error("Expected at least 3 arguments, but found "+(t.length-1)+" instead.");for(var r=[],n=1;n<t.length-1;n+=2){var i=t[n];if("string"!=typeof i)return e.error("Expected string, but found "+typeof i+" instead.",n);if(/[^a-zA-Z0-9_]/.test(i))return e.error("Variable names must contain only alphanumeric characters or '_'.",n);var o=e.parse(t[n+1],n+1);if(!o)return null;r.push([i,o])}var a=e.parse(t[t.length-1],t.length-1,e.expectedType,r);return a?new Ty(r,a):null},Ty.prototype.outputDefined=function(){return this.result.outputDefined()},Ty.prototype.serialize=function(){for(var t=["let"],e=0,r=this.bindings;e<r.length;e+=1){var n=r[e],i=n[0],o=n[1];t.push(i,o.serialize())}return t.push(this.result.serialize()),t};var Py=function(t,e,r){this.type=t,this.index=e,this.input=r};Py.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,Hd),n=e.parse(t[2],2,og(e.expectedType||eg));if(!r||!n)return null;var i=n.type;return new Py(i.itemType,r,n)},Py.prototype.evaluate=function(t){var e=this.index.evaluate(t),r=this.input.evaluate(t);if(e<0)throw new xg("Array index out of bounds: "+e+" < 0.");if(e>=r.length)throw new xg("Array index out of bounds: "+e+" > "+(r.length-1)+".");if(e!==Math.floor(e))throw new xg("Array index must be an integer, but found "+e+" instead.");return r[e]},Py.prototype.eachChild=function(t){t(this.index),t(this.input)},Py.prototype.outputDefined=function(){return!1},Py.prototype.serialize=function(){return["at",this.index.serialize(),this.input.serialize()]};var Ry=function(t,e){this.type=Qd,this.needle=t,this.haystack=e};Ry.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,eg),n=e.parse(t[2],2,eg);return r&&n?ug(r.type,[Qd,Jd,Hd,Zd,eg])?new Ry(r,n):e.error("Expected first argument to be of type boolean, string, number or null, but found "+ag(r.type)+" instead"):null},Ry.prototype.evaluate=function(t){var e=this.needle.evaluate(t),r=this.haystack.evaluate(t);if(null==r)return!1;if(!hg(e,["boolean","string","number","null"]))throw new xg("Expected first argument to be of type boolean, string, number or null, but found "+ag(vg(e))+" instead.");if(!hg(r,["string","array"]))throw new xg("Expected second argument to be of type array or string, but found "+ag(vg(r))+" instead.");return r.indexOf(e)>=0},Ry.prototype.eachChild=function(t){t(this.needle),t(this.haystack)},Ry.prototype.outputDefined=function(){return!0},Ry.prototype.serialize=function(){return["in",this.needle.serialize(),this.haystack.serialize()]};var Oy=function(t,e,r){this.type=Hd,this.needle=t,this.haystack=e,this.fromIndex=r};Oy.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,eg),n=e.parse(t[2],2,eg);if(!r||!n)return null;if(!ug(r.type,[Qd,Jd,Hd,Zd,eg]))return e.error("Expected first argument to be of type boolean, string, number or null, but found "+ag(r.type)+" instead");if(4===t.length){var i=e.parse(t[3],3,Hd);return i?new Oy(r,n,i):null}return new Oy(r,n)},Oy.prototype.evaluate=function(t){var e=this.needle.evaluate(t),r=this.haystack.evaluate(t);if(!hg(e,["boolean","string","number","null"]))throw new xg("Expected first argument to be of type boolean, string, number or null, but found "+ag(vg(e))+" instead.");if(!hg(r,["string","array"]))throw new xg("Expected second argument to be of type array or string, but found "+ag(vg(r))+" instead.");if(this.fromIndex){var n=this.fromIndex.evaluate(t);return r.indexOf(e,n)}return r.indexOf(e)},Oy.prototype.eachChild=function(t){t(this.needle),t(this.haystack),this.fromIndex&&t(this.fromIndex)},Oy.prototype.outputDefined=function(){return!1},Oy.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 Fy=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};Fy.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;a<t.length-1;a+=2){var s=t[a],l=t[a+1];Array.isArray(s)||(s=[s]);var u=e.concat(a);if(0===s.length)return u.error("Expected at least one branch label.");for(var h=0,c=s;h<c.length;h+=1){var p=c[h];if("number"!=typeof p&&"string"!=typeof p)return u.error("Branch labels must be numbers or strings.");if("number"==typeof p&&Math.abs(p)>Number.MAX_SAFE_INTEGER)return u.error("Branch labels must be integers no larger than "+Number.MAX_SAFE_INTEGER+".");if("number"==typeof p&&Math.floor(p)!==p)return u.error("Numeric branch labels must be integer values.");if(r){if(u.checkSubtype(r,vg(p)))return null}else r=vg(p);if(void 0!==i[String(p)])return u.error("Branch labels must be unique.");i[String(p)]=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,eg);if(!d)return null;var g=e.parse(t[t.length-1],t.length-1,n);return g?"value"!==d.type.kind&&e.concat(1).checkSubtype(r,d.type)?null:new Fy(r,n,d,i,o,g):null},Fy.prototype.evaluate=function(t){var e=this.input.evaluate(t);return(vg(e)===this.inputType&&this.outputs[this.cases[e]]||this.otherwise).evaluate(t)},Fy.prototype.eachChild=function(t){t(this.input),this.outputs.forEach(t),t(this.otherwise)},Fy.prototype.outputDefined=function(){return this.outputs.every((function(t){return t.outputDefined()}))&&this.otherwise.outputDefined()},Fy.prototype.serialize=function(){for(var t=this,e=["match",this.input.serialize()],r=[],n={},i=0,o=Object.keys(this.cases).sort();i<o.length;i+=1){var a=o[i];void 0===(c=n[this.cases[a]])?(n[this.cases[a]]=r.length,r.push([this.cases[a],[a]])):r[c][1].push(a)}for(var s=function(e){return"number"===t.inputType.kind?Number(e):e},l=0,u=r;l<u.length;l+=1){var h=u[l],c=h[0],p=h[1];1===p.length?e.push(s(p[0])):e.push(p.map(s)),e.push(this.outputs[outputIndex$1].serialize())}return e.push(this.otherwise.serialize()),e};var My=function(t,e,r){this.type=t,this.branches=e,this.otherwise=r};My.parse=function(t,e){if(t.length<4)return e.error("Expected at least 3 arguments, but found only "+(t.length-1)+".");if(t.length%2!=0)return e.error("Expected an odd number of arguments.");var r;e.expectedType&&"value"!==e.expectedType.kind&&(r=e.expectedType);for(var n=[],i=1;i<t.length-1;i+=2){var o=e.parse(t[i],i,Qd);if(!o)return null;var a=e.parse(t[i+1],i+1,r);if(!a)return null;n.push([o,a]),r=r||a.type}var s=e.parse(t[t.length-1],t.length-1,r);return s?new My(r,n,s):null},My.prototype.evaluate=function(t){for(var e=0,r=this.branches;e<r.length;e+=1){var n=r[e],i=n[0],o=n[1];if(i.evaluate(t))return o.evaluate(t)}return this.otherwise.evaluate(t)},My.prototype.eachChild=function(t){for(var e=0,r=this.branches;e<r.length;e+=1){var n=r[e],i=n[0],o=n[1];t(i),t(o)}t(this.otherwise)},My.prototype.outputDefined=function(){return this.branches.every((function(t){return t[0],t[1].outputDefined()}))&&this.otherwise.outputDefined()},My.prototype.serialize=function(){var t=["case"];return this.eachChild((function(e){t.push(e.serialize())})),t};var Iy=function(t,e,r,n){this.type=t,this.input=e,this.beginIndex=r,this.endIndex=n};function Ly(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 Ay(t,e,r,n){return 0===n.compare(e,r)}function ky(t,e,r){var n="=="!==t&&"!="!==t;return function(){function i(t,e,r){this.type=Qd,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,eg);if(!o)return null;if(!Ly(r,o.type))return e.concat(1).error('"'+r+"\" comparisons are not supported for type '"+ag(o.type)+"'.");var a=e.parse(t[2],2,eg);if(!a)return null;if(!Ly(r,a.type))return e.concat(2).error('"'+r+"\" comparisons are not supported for type '"+ag(a.type)+"'.");if(o.type.kind!==a.type.kind&&"value"!==o.type.kind&&"value"!==a.type.kind)return e.error("Cannot compare types '"+ag(o.type)+"' and '"+ag(a.type)+"'.");n&&("value"===o.type.kind&&"value"!==a.type.kind?o=new bg(a.type,[o]):"value"!==o.type.kind&&"value"===a.type.kind&&(a=new bg(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,rg)))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=vg(o),l=vg(a);if(s.kind!==l.kind||"string"!==s.kind&&"number"!==s.kind)throw new xg('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=vg(o),h=vg(a);if("string"!==u.kind||"string"!==h.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}()}Iy.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,eg),n=e.parse(t[2],2,Hd);if(!r||!n)return null;if(!ug(r.type,[og(eg),Jd,eg]))return e.error("Expected first argument to be of type array or string, but found "+ag(r.type)+" instead");if(4===t.length){var i=e.parse(t[3],3,Hd);return i?new Iy(r.type,r,n,i):null}return new Iy(r.type,r,n)},Iy.prototype.evaluate=function(t){var e=this.input.evaluate(t),r=this.beginIndex.evaluate(t);if(!hg(e,["string","array"]))throw new xg("Expected first argument to be of type array or string, but found "+ag(vg(e))+" instead.");if(this.endIndex){var n=this.endIndex.evaluate(t);return e.slice(r,n)}return e.slice(r)},Iy.prototype.eachChild=function(t){t(this.input),t(this.beginIndex),this.endIndex&&t(this.endIndex)},Iy.prototype.outputDefined=function(){return!1},Iy.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 Dy=ky("==",(function(t,e,r){return e===r}),Ay),jy=ky("!=",(function(t,e,r){return e!==r}),(function(t,e,r,n){return!Ay(0,e,r,n)})),Gy=ky("<",(function(t,e,r){return e<r}),(function(t,e,r,n){return n.compare(e,r)<0})),zy=ky(">",(function(t,e,r){return e>r}),(function(t,e,r,n){return n.compare(e,r)>0})),Ny=ky("<=",(function(t,e,r){return e<=r}),(function(t,e,r,n){return n.compare(e,r)<=0})),Uy=ky(">=",(function(t,e,r){return e>=r}),(function(t,e,r,n){return n.compare(e,r)>=0})),By=function(t,e,r,n,i){this.type=Jd,this.number=t,this.locale=e,this.currency=r,this.minFractionDigits=n,this.maxFractionDigits=i};By.parse=function(t,e){if(3!==t.length)return e.error("Expected two arguments.");var r=e.parse(t[1],1,Hd);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,Jd)))return null;var o=null;if(n.currency&&!(o=e.parse(n.currency,1,Jd)))return null;var a=null;if(n["min-fraction-digits"]&&!(a=e.parse(n["min-fraction-digits"],1,Hd)))return null;var s=null;return n["max-fraction-digits"]&&!(s=e.parse(n["max-fraction-digits"],1,Hd))?null:new By(r,i,o,a,s)},By.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))},By.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)},By.prototype.outputDefined=function(){return!1},By.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 Vy=function(t){this.type=Hd,this.input=t};Vy.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 "+ag(r.type)+" instead."):new Vy(r):null},Vy.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 xg("Expected value to be of type string or array, but found "+ag(vg(e))+" instead.")},Vy.prototype.eachChild=function(t){t(this.input)},Vy.prototype.outputDefined=function(){return!1},Vy.prototype.serialize=function(){var t=["length"];return this.eachChild((function(e){t.push(e.serialize())})),t};var Xy={"==":Dy,"!=":jy,">":zy,"<":Gy,">=":Uy,"<=":Ny,array:bg,at:Py,boolean:bg,case:My,coalesce:Ey,collator:Fg,format:Sg,image:Cg,in:Ry,"index-of":Oy,interpolate:Sy,"interpolate-hcl":Sy,"interpolate-lab":Sy,length:Vy,let:Ty,literal:mg,match:Fy,number:bg,"number-format":By,object:bg,slice:Iy,step:ry,string:bg,"to-boolean":Tg,"to-color":Tg,"to-number":Tg,"to-string":Tg,var:Qg,within:Kg};function Wy(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=gg(r,n,i,a);if(s)throw new xg(s);return new jd(r/255*a,n/255*a,i/255*a,a)}function qy(t,e){return t in e}function Yy(t,e){var r=e[t];return void 0===r?null:r}function Ky(t){return{type:t}}function Zy(t){return{result:"success",value:t}}function Hy(t){return{result:"error",value:t}}function Jy(t){return"object"==typeof t&&null!==t&&!Array.isArray(t)}Og.register(Xy,{error:[{kind:"error"},[Jd],function(t,e){var r=e[0];throw new xg(r.evaluate(t))}],typeof:[Jd,[eg],function(t,e){return ag(vg(e[0].evaluate(t)))}],"to-rgba":[og(Hd,4),[$d],function(t,e){return e[0].evaluate(t).toArray()}],rgb:[$d,[Hd,Hd,Hd],Wy],rgba:[$d,[Hd,Hd,Hd,Hd],Wy],has:{type:Qd,overloads:[[[Jd],function(t,e){return qy(e[0].evaluate(t),t.properties())}],[[Jd,tg],function(t,e){var r=e[0],n=e[1];return qy(r.evaluate(t),n.evaluate(t))}]]},get:{type:eg,overloads:[[[Jd],function(t,e){return Yy(e[0].evaluate(t),t.properties())}],[[Jd,tg],function(t,e){var r=e[0],n=e[1];return Yy(r.evaluate(t),n.evaluate(t))}]]},"feature-state":[eg,[Jd],function(t,e){return Yy(e[0].evaluate(t),t.featureState||{})}],properties:[tg,[],function(t){return t.properties()}],"geometry-type":[Jd,[],function(t){return t.geometryType()}],id:[eg,[],function(t){return t.id()}],zoom:[Hd,[],function(t){return t.globals.zoom}],pitch:[Hd,[],function(t){return t.globals.pitch||0}],"distance-from-center":[Hd,[],function(t){return t.distanceFromCenter()}],"heatmap-density":[Hd,[],function(t){return t.globals.heatmapDensity||0}],"line-progress":[Hd,[],function(t){return t.globals.lineProgress||0}],"sky-radial-progress":[Hd,[],function(t){return t.globals.skyRadialProgress||0}],accumulated:[eg,[],function(t){return void 0===t.globals.accumulated?null:t.globals.accumulated}],"+":[Hd,Ky(Hd),function(t,e){for(var r=0,n=0,i=e;n<i.length;n+=1){r+=i[n].evaluate(t)}return r}],"*":[Hd,Ky(Hd),function(t,e){for(var r=1,n=0,i=e;n<i.length;n+=1){r*=i[n].evaluate(t)}return r}],"-":{type:Hd,overloads:[[[Hd,Hd],function(t,e){var r=e[0],n=e[1];return r.evaluate(t)-n.evaluate(t)}],[[Hd],function(t,e){return-e[0].evaluate(t)}]]},"/":[Hd,[Hd,Hd],function(t,e){var r=e[0],n=e[1];return r.evaluate(t)/n.evaluate(t)}],"%":[Hd,[Hd,Hd],function(t,e){var r=e[0],n=e[1];return r.evaluate(t)%n.evaluate(t)}],ln2:[Hd,[],function(){return Math.LN2}],pi:[Hd,[],function(){return Math.PI}],e:[Hd,[],function(){return Math.E}],"^":[Hd,[Hd,Hd],function(t,e){var r=e[0],n=e[1];return Math.pow(r.evaluate(t),n.evaluate(t))}],sqrt:[Hd,[Hd],function(t,e){var r=e[0];return Math.sqrt(r.evaluate(t))}],log10:[Hd,[Hd],function(t,e){var r=e[0];return Math.log(r.evaluate(t))/Math.LN10}],ln:[Hd,[Hd],function(t,e){var r=e[0];return Math.log(r.evaluate(t))}],log2:[Hd,[Hd],function(t,e){var r=e[0];return Math.log(r.evaluate(t))/Math.LN2}],sin:[Hd,[Hd],function(t,e){var r=e[0];return Math.sin(r.evaluate(t))}],cos:[Hd,[Hd],function(t,e){var r=e[0];return Math.cos(r.evaluate(t))}],tan:[Hd,[Hd],function(t,e){var r=e[0];return Math.tan(r.evaluate(t))}],asin:[Hd,[Hd],function(t,e){var r=e[0];return Math.asin(r.evaluate(t))}],acos:[Hd,[Hd],function(t,e){var r=e[0];return Math.acos(r.evaluate(t))}],atan:[Hd,[Hd],function(t,e){var r=e[0];return Math.atan(r.evaluate(t))}],min:[Hd,Ky(Hd),function(t,e){return Math.min.apply(Math,e.map((function(e){return e.evaluate(t)})))}],max:[Hd,Ky(Hd),function(t,e){return Math.max.apply(Math,e.map((function(e){return e.evaluate(t)})))}],abs:[Hd,[Hd],function(t,e){var r=e[0];return Math.abs(r.evaluate(t))}],round:[Hd,[Hd],function(t,e){var r=e[0].evaluate(t);return r<0?-Math.round(-r):Math.round(r)}],floor:[Hd,[Hd],function(t,e){var r=e[0];return Math.floor(r.evaluate(t))}],ceil:[Hd,[Hd],function(t,e){var r=e[0];return Math.ceil(r.evaluate(t))}],"filter-==":[Qd,[Jd,eg],function(t,e){var r=e[0],n=e[1];return t.properties()[r.value]===n.value}],"filter-id-==":[Qd,[eg],function(t,e){var r=e[0];return t.id()===r.value}],"filter-type-==":[Qd,[Jd],function(t,e){var r=e[0];return t.geometryType()===r.value}],"filter-<":[Qd,[Jd,eg],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-<":[Qd,[eg],function(t,e){var r=e[0],n=t.id(),i=r.value;return typeof n==typeof i&&n<i}],"filter->":[Qd,[Jd,eg],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->":[Qd,[eg],function(t,e){var r=e[0],n=t.id(),i=r.value;return typeof n==typeof i&&n>i}],"filter-<=":[Qd,[Jd,eg],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-<=":[Qd,[eg],function(t,e){var r=e[0],n=t.id(),i=r.value;return typeof n==typeof i&&n<=i}],"filter->=":[Qd,[Jd,eg],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->=":[Qd,[eg],function(t,e){var r=e[0],n=t.id(),i=r.value;return typeof n==typeof i&&n>=i}],"filter-has":[Qd,[eg],function(t,e){return e[0].value in t.properties()}],"filter-has-id":[Qd,[],function(t){return null!==t.id()&&void 0!==t.id()}],"filter-type-in":[Qd,[og(Jd)],function(t,e){return e[0].value.indexOf(t.geometryType())>=0}],"filter-id-in":[Qd,[og(eg)],function(t,e){return e[0].value.indexOf(t.id())>=0}],"filter-in-small":[Qd,[Jd,og(eg)],function(t,e){var r=e[0];return e[1].value.indexOf(t.properties()[r.value])>=0}],"filter-in-large":[Qd,[Jd,og(eg)],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:Qd,overloads:[[[Qd,Qd],function(t,e){var r=e[0],n=e[1];return r.evaluate(t)&&n.evaluate(t)}],[Ky(Qd),function(t,e){for(var r=0,n=e;r<n.length;r+=1){if(!n[r].evaluate(t))return!1}return!0}]]},any:{type:Qd,overloads:[[[Qd,Qd],function(t,e){var r=e[0],n=e[1];return r.evaluate(t)||n.evaluate(t)}],[Ky(Qd),function(t,e){for(var r=0,n=e;r<n.length;r+=1){if(n[r].evaluate(t))return!0}return!1}]]},"!":[Qd,[Qd],function(t,e){return!e[0].evaluate(t)}],"is-supported-script":[Qd,[Jd],function(t,e){var r=e[0],n=t.globals&&t.globals.isSupportedScript;return!n||n(r.evaluate(t))}],upcase:[Jd,[Jd],function(t,e){return e[0].evaluate(t).toUpperCase()}],downcase:[Jd,[Jd],function(t,e){return e[0].evaluate(t).toLowerCase()}],concat:[Jd,Ky(eg),function(t,e){return e.map((function(e){return _g(e.evaluate(t))})).join("")}],"resolved-locale":[Jd,[rg],function(t,e){return e[0].evaluate(t).resolvedLocale()}]});var Qy=function(t,e){this.expression=t,this._warningHistory={},this._evaluator=new Rg,this._defaultValue=e?function(t){return"color"===t.type&&(Jy(t.default)||Array.isArray(t.default))?new jd(0,0,0,0):"color"===t.type?jd.parse(t.default)||null:void 0===t.default?null:t.default}(e):null,this._enumValues=e&&"enum"===e.type?e.values:null};function $y(t,e){var r=new $g(Xy,[],e?function(t){var e={color:$d,string:Jd,number:Hd,enum:Jd,boolean:Qd,formatted:ng,resolvedImage:ig};if("array"===t.type)return og(e[t.value]||eg,t.length);return e[t.type]}(e):void 0),n=r.parse(t,void 0,void 0,void 0,e&&"string"===e.type?{typeAnnotation:"coerce"}:void 0);return n?Zy(new Qy(n,e)):Hy(r.errors)}Qy.prototype.evaluateWithoutErrorHandling=function(t,e,r,n,i,o,a,s){return this._evaluator.globals=t,this._evaluator.feature=e,this._evaluator.featureState=r,this._evaluator.canonical=n||null,this._evaluator.availableImages=i||null,this._evaluator.formattedSection=o,this._evaluator.featureTileCoord=a||null,this._evaluator.featureDistanceData=s||null,this.expression.evaluate(this._evaluator)},Qy.prototype.evaluate=function(t,e,r,n,i,o,a,s){this._evaluator.globals=t,this._evaluator.feature=e||null,this._evaluator.featureState=r||null,this._evaluator.canonical=n||null,this._evaluator.availableImages=i||null,this._evaluator.formattedSection=o||null,this._evaluator.featureTileCoord=a||null,this._evaluator.featureDistanceData=s||null;try{var l=this.expression.evaluate(this._evaluator);if(null==l||"number"==typeof l&&l!=l)return this._defaultValue;if(this._enumValues&&!(l in this._enumValues))throw new xg("Expected value to be one of "+Object.keys(this._enumValues).map((function(t){return JSON.stringify(t)})).join(", ")+", but found "+JSON.stringify(l)+" instead.");return l}catch(t){return this._warningHistory[t.message]||(this._warningHistory[t.message]=!0,"undefined"!=typeof console&&console.warn(t.message)),this._defaultValue}};var tv=function(t,e){this.kind=t,this._styleExpression=e,this.isStateDependent="constant"!==t&&!Hg(e.expression)};tv.prototype.evaluateWithoutErrorHandling=function(t,e,r,n,i,o){return this._styleExpression.evaluateWithoutErrorHandling(t,e,r,n,i,o)},tv.prototype.evaluate=function(t,e,r,n,i,o){return this._styleExpression.evaluate(t,e,r,n,i,o)};var ev=function(t,e,r,n){this.kind=t,this.zoomStops=r,this._styleExpression=e,this.isStateDependent="camera"!==t&&!Hg(e.expression),this.interpolationType=n};function rv(t,e){if("error"===(t=$y(t,e)).result)return t;var r=t.value.expression,n=Zg(r);if(!n&&!function(t){return"data-driven"===t["property-type"]||"cross-faded-data-driven"===t["property-type"]}(e))return Hy([new Yd("","data expressions not supported")]);var i=Jg(r,["zoom","pitch","distance-from-center"]);if(!i&&!function(t){return!!t.expression&&t.expression.parameters.indexOf("zoom")>-1}(e))return Hy([new Yd("","zoom expressions not supported")]);var o=nv(r);if(!o&&!i)return Hy([new Yd("",'"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression.')]);if(o instanceof Yd)return Hy([o]);if(o instanceof Sy&&!function(t){return!!t.expression&&t.expression.interpolated}(e))return Hy([new Yd("",'"interpolate" expressions cannot be used with this property')]);if(!o)return Zy(new tv(n?"constant":"source",t.value));var a=o instanceof Sy?o.interpolation:void 0;return Zy(new ev(n?"camera":"composite",t.value,o.labels,a))}function nv(t){var e=null;if(t instanceof Ty)e=nv(t.result);else if(t instanceof Ey)for(var r=0,n=t.args;r<n.length;r+=1){var i=n[r];if(e=nv(i))break}else(t instanceof ry||t instanceof Sy)&&t.input instanceof Og&&"zoom"===t.input.name&&(e=t);return e instanceof Yd||t.eachChild((function(t){var r=nv(t);r instanceof Yd?e=r:!e&&r?e=new Yd("",'"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression.'):e&&r&&e!==r&&(e=new Yd("",'Only one zoom-based "step" or "interpolate" subexpression may be used in an expression.'))})),e}function iv(t){if(Array.isArray(t))return t.map(iv);if(t instanceof Object&&!(t instanceof Number||t instanceof String||t instanceof Boolean)){var e={};for(var r in t)e[r]=iv(t[r]);return e}return function(t){return t instanceof Number||t instanceof String||t instanceof Boolean?t.valueOf():t}(t)}ev.prototype.evaluateWithoutErrorHandling=function(t,e,r,n,i,o){return this._styleExpression.evaluateWithoutErrorHandling(t,e,r,n,i,o)},ev.prototype.evaluate=function(t,e,r,n,i,o){return this._styleExpression.evaluate(t,e,r,n,i,o)},ev.prototype.interpolationFactor=function(t,e,r){return this.interpolationType?Sy.interpolationFactor(this.interpolationType,t,e,r):0};var ov={$version:8,$root:{version:{required:!0,type:"enum",values:[8]},name:{type:"string"},metadata:{type:"*"},center:{type:"array",value:"number"},zoom:{type:"number"},bearing:{type:"number",default:0,period:360,units:"degrees"},pitch:{type:"number",default:0,units:"degrees"},light:{type:"light"},terrain:{type:"terrain"},fog:{type:"fog"},sources:{required:!0,type:"sources"},sprite:{type:"string"},glyphs:{type:"string"},transition:{type:"transition"},projection:{type:"projection"},layers:{required:!0,type:"array",value:"layer"}},sources:{"*":{type:"source"}},source:["source_vector","source_raster","source_raster_dem","source_geojson","source_video","source_image"],source_vector:{type:{required:!0,type:"enum",values:{vector:{}}},url:{type:"string"},tiles:{type:"array",value:"string"},bounds:{type:"array",value:"number",length:4,default:[-180,-85.051129,180,85.051129]},scheme:{type:"enum",values:{xyz:{},tms:{}},default:"xyz"},minzoom:{type:"number",default:0},maxzoom:{type:"number",default:22},attribution:{type:"string"},promoteId:{type:"promoteId"},volatile:{type:"boolean",default:!1},"*":{type:"*"}},source_raster:{type:{required:!0,type:"enum",values:{raster:{}}},url:{type:"string"},tiles:{type:"array",value:"string"},bounds:{type:"array",value:"number",length:4,default:[-180,-85.051129,180,85.051129]},minzoom:{type:"number",default:0},maxzoom:{type:"number",default:22},tileSize:{type:"number",default:512,units:"pixels"},scheme:{type:"enum",values:{xyz:{},tms:{}},default:"xyz"},attribution:{type:"string"},volatile:{type:"boolean",default:!1},"*":{type:"*"}},source_raster_dem:{type:{required:!0,type:"enum",values:{"raster-dem":{}}},url:{type:"string"},tiles:{type:"array",value:"string"},bounds:{type:"array",value:"number",length:4,default:[-180,-85.051129,180,85.051129]},minzoom:{type:"number",default:0},maxzoom:{type:"number",default:22},tileSize:{type:"number",default:512,units:"pixels"},attribution:{type:"string"},encoding:{type:"enum",values:{terrarium:{},mapbox:{}},default:"mapbox"},volatile:{type:"boolean",default:!1},"*":{type:"*"}},source_geojson:{type:{required:!0,type:"enum",values:{geojson:{}}},data:{type:"*"},maxzoom:{type:"number",default:18},attribution:{type:"string"},buffer:{type:"number",default:128,maximum:512,minimum:0},filter:{type:"*"},tolerance:{type:"number",default:.375},cluster:{type:"boolean",default:!1},clusterRadius:{type:"number",default:50,minimum:0},clusterMaxZoom:{type:"number"},clusterMinPoints:{type:"number"},clusterProperties:{type:"*"},lineMetrics:{type:"boolean",default:!1},generateId:{type:"boolean",default:!1},promoteId:{type:"promoteId"}},source_video:{type:{required:!0,type:"enum",values:{video:{}}},urls:{required:!0,type:"array",value:"string"},coordinates:{required:!0,type:"array",length:4,value:{type:"array",length:2,value:"number"}}},source_image:{type:{required:!0,type:"enum",values:{image:{}}},url:{required:!0,type:"string"},coordinates:{required:!0,type:"array",length:4,value:{type:"array",length:2,value:"number"}}},layer:{id:{type:"string",required:!0},type:{type:"enum",values:{fill:{},line:{},symbol:{},circle:{},heatmap:{},"fill-extrusion":{},raster:{},hillshade:{},background:{},sky:{}},required:!0},metadata:{type:"*"},source:{type:"string"},"source-layer":{type:"string"},minzoom:{type:"number",minimum:0,maximum:24},maxzoom:{type:"number",minimum:0,maximum:24},filter:{type:"filter"},layout:{type:"layout"},paint:{type:"paint"}},layout:["layout_fill","layout_line","layout_circle","layout_heatmap","layout_fill-extrusion","layout_symbol","layout_raster","layout_hillshade","layout_background","layout_sky"],layout_background:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_sky:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_fill:{"fill-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_circle:{"circle-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_heatmap:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},"layout_fill-extrusion":{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_line:{"line-cap":{type:"enum",values:{butt:{},round:{},square:{}},default:"butt",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"line-join":{type:"enum",values:{bevel:{},round:{},miter:{}},default:"miter",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"line-miter-limit":{type:"number",default:2,requires:[{"line-join":"miter"}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"line-round-limit":{type:"number",default:1.05,requires:[{"line-join":"round"}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"line-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_symbol:{"symbol-placement":{type:"enum",values:{point:{},line:{},"line-center":{}},default:"point",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"symbol-spacing":{type:"number",default:250,minimum:1,units:"pixels",requires:[{"symbol-placement":"line"}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"symbol-avoid-edges":{type:"boolean",default:!1,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"symbol-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"symbol-z-order":{type:"enum",values:{auto:{},"viewport-y":{},source:{}},default:"auto",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-allow-overlap":{type:"boolean",default:!1,requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-ignore-placement":{type:"boolean",default:!1,requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-optional":{type:"boolean",default:!1,requires:["icon-image","text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-rotation-alignment":{type:"enum",values:{map:{},viewport:{},auto:{}},default:"auto",requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-size":{type:"number",default:1,minimum:0,units:"factor of the original icon size",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-text-fit":{type:"enum",values:{none:{},width:{},height:{},both:{}},default:"none",requires:["icon-image","text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-text-fit-padding":{type:"array",value:"number",length:4,default:[0,0,0,0],units:"pixels",requires:["icon-image","text-field",{"icon-text-fit":["both","width","height"]}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"icon-image":{type:"resolvedImage",tokens:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-rotate":{type:"number",default:0,period:360,units:"degrees",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-padding":{type:"number",default:2,minimum:0,units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"icon-keep-upright":{type:"boolean",default:!1,requires:["icon-image",{"icon-rotation-alignment":"map"},{"symbol-placement":["line","line-center"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-offset":{type:"array",value:"number",length:2,default:[0,0],requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-anchor":{type:"enum",values:{center:{},left:{},right:{},top:{},bottom:{},"top-left":{},"top-right":{},"bottom-left":{},"bottom-right":{}},default:"center",requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-pitch-alignment":{type:"enum",values:{map:{},viewport:{},auto:{}},default:"auto",requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-pitch-alignment":{type:"enum",values:{map:{},viewport:{},auto:{}},default:"auto",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-rotation-alignment":{type:"enum",values:{map:{},viewport:{},auto:{}},default:"auto",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-field":{type:"formatted",default:"",tokens:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-font":{type:"array",value:"string",default:["Open Sans Regular","Arial Unicode MS Regular"],requires:["text-field"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-size":{type:"number",default:16,minimum:0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-max-width":{type:"number",default:10,minimum:0,units:"ems",requires:["text-field",{"symbol-placement":["point"]}],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-line-height":{type:"number",default:1.2,units:"ems",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-letter-spacing":{type:"number",default:0,units:"ems",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-justify":{type:"enum",values:{auto:{},left:{},center:{},right:{}},default:"center",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-radial-offset":{type:"number",units:"ems",default:0,requires:["text-field"],"property-type":"data-driven",expression:{interpolated:!0,parameters:["zoom","feature"]}},"text-variable-anchor":{type:"array",value:"enum",values:{center:{},left:{},right:{},top:{},bottom:{},"top-left":{},"top-right":{},"bottom-left":{},"bottom-right":{}},requires:["text-field",{"symbol-placement":["point"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-anchor":{type:"enum",values:{center:{},left:{},right:{},top:{},bottom:{},"top-left":{},"top-right":{},"bottom-left":{},"bottom-right":{}},default:"center",requires:["text-field",{"!":"text-variable-anchor"}],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-max-angle":{type:"number",default:45,units:"degrees",requires:["text-field",{"symbol-placement":["line","line-center"]}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-writing-mode":{type:"array",value:"enum",values:{horizontal:{},vertical:{}},requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-rotate":{type:"number",default:0,period:360,units:"degrees",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-padding":{type:"number",default:2,minimum:0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-keep-upright":{type:"boolean",default:!0,requires:["text-field",{"text-rotation-alignment":"map"},{"symbol-placement":["line","line-center"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-transform":{type:"enum",values:{none:{},uppercase:{},lowercase:{}},default:"none",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-offset":{type:"array",value:"number",units:"ems",length:2,default:[0,0],requires:["text-field",{"!":"text-radial-offset"}],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-allow-overlap":{type:"boolean",default:!1,requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-ignore-placement":{type:"boolean",default:!1,requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-optional":{type:"boolean",default:!1,requires:["text-field","icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_raster:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_hillshade:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},filter:{type:"array",value:"*"},filter_symbol:{type:"boolean",default:!1,transition:!1,"property-type":"data-driven",expression:{interpolated:!1,parameters:["zoom","feature","pitch","distance-from-center"]}},filter_fill:{type:"boolean",default:!1,transition:!1,"property-type":"data-driven",expression:{interpolated:!1,parameters:["zoom","feature"]}},filter_line:{type:"boolean",default:!1,transition:!1,"property-type":"data-driven",expression:{interpolated:!1,parameters:["zoom","feature"]}},filter_circle:{type:"boolean",default:!1,transition:!1,"property-type":"data-driven",expression:{interpolated:!1,parameters:["zoom","feature"]}},"filter_fill-extrusion":{type:"boolean",default:!1,transition:!1,"property-type":"data-driven",expression:{interpolated:!1,parameters:["zoom","feature"]}},filter_heatmap:{type:"boolean",default:!1,transition:!1,"property-type":"data-driven",expression:{interpolated:!1,parameters:["zoom","feature"]}},filter_operator:{type:"enum",values:{"==":{},"!=":{},">":{},">=":{},"<":{},"<=":{},in:{},"!in":{},all:{},any:{},none:{},has:{},"!has":{},within:{}}},geometry_type:{type:"enum",values:{Point:{},LineString:{},Polygon:{}}},function:{expression:{type:"expression"},stops:{type:"array",value:"function_stop"},base:{type:"number",default:1,minimum:0},property:{type:"string",default:"$zoom"},type:{type:"enum",values:{identity:{},exponential:{},interval:{},categorical:{}},default:"exponential"},colorSpace:{type:"enum",values:{rgb:{},lab:{},hcl:{}},default:"rgb"},default:{type:"*",required:!1}},function_stop:{type:"array",minimum:0,maximum:24,value:["number","color"],length:2},expression:{type:"array",value:"*",minimum:1},expression_name:{type:"enum",values:{let:{group:"Variable binding"},var:{group:"Variable binding"},literal:{group:"Types"},array:{group:"Types"},at:{group:"Lookup"},in:{group:"Lookup"},"index-of":{group:"Lookup"},slice:{group:"Lookup"},case:{group:"Decision"},match:{group:"Decision"},coalesce:{group:"Decision"},step:{group:"Ramps, scales, curves"},interpolate:{group:"Ramps, scales, curves"},"interpolate-hcl":{group:"Ramps, scales, curves"},"interpolate-lab":{group:"Ramps, scales, curves"},ln2:{group:"Math"},pi:{group:"Math"},e:{group:"Math"},typeof:{group:"Types"},string:{group:"Types"},number:{group:"Types"},boolean:{group:"Types"},object:{group:"Types"},collator:{group:"Types"},format:{group:"Types"},image:{group:"Types"},"number-format":{group:"Types"},"to-string":{group:"Types"},"to-number":{group:"Types"},"to-boolean":{group:"Types"},"to-rgba":{group:"Color"},"to-color":{group:"Types"},rgb:{group:"Color"},rgba:{group:"Color"},get:{group:"Lookup"},has:{group:"Lookup"},length:{group:"Lookup"},properties:{group:"Feature data"},"feature-state":{group:"Feature data"},"geometry-type":{group:"Feature data"},id:{group:"Feature data"},zoom:{group:"Camera"},pitch:{group:"Camera"},"distance-from-center":{group:"Camera"},"heatmap-density":{group:"Heatmap"},"line-progress":{group:"Feature data"},"sky-radial-progress":{group:"sky"},accumulated:{group:"Feature data"},"+":{group:"Math"},"*":{group:"Math"},"-":{group:"Math"},"/":{group:"Math"},"%":{group:"Math"},"^":{group:"Math"},sqrt:{group:"Math"},log10:{group:"Math"},ln:{group:"Math"},log2:{group:"Math"},sin:{group:"Math"},cos:{group:"Math"},tan:{group:"Math"},asin:{group:"Math"},acos:{group:"Math"},atan:{group:"Math"},min:{group:"Math"},max:{group:"Math"},round:{group:"Math"},abs:{group:"Math"},ceil:{group:"Math"},floor:{group:"Math"},distance:{group:"Math"},"==":{group:"Decision"},"!=":{group:"Decision"},">":{group:"Decision"},"<":{group:"Decision"},">=":{group:"Decision"},"<=":{group:"Decision"},all:{group:"Decision"},any:{group:"Decision"},"!":{group:"Decision"},within:{group:"Decision"},"is-supported-script":{group:"String"},upcase:{group:"String"},downcase:{group:"String"},concat:{group:"String"},"resolved-locale":{group:"String"}}},fog:{range:{type:"array",default:[.5,10],minimum:-20,maximum:20,length:2,value:"number","property-type":"data-constant",transition:!0,expression:{interpolated:!0,parameters:["zoom"]}},color:{type:"color","property-type":"data-constant",default:"#ffffff",expression:{interpolated:!0,parameters:["zoom"]},transition:!0},"high-color":{type:"color","property-type":"data-constant",default:"#245cdf",expression:{interpolated:!0,parameters:["zoom"]},transition:!0},"space-color":{type:"color","property-type":"data-constant",default:["interpolate",["linear"],["zoom"],4,"#010b19",7,"#367ab9"],expression:{interpolated:!0,parameters:["zoom"]},transition:!0},"horizon-blend":{type:"number","property-type":"data-constant",default:["interpolate",["linear"],["zoom"],4,.2,7,.1],minimum:0,maximum:1,expression:{interpolated:!0,parameters:["zoom"]},transition:!0},"star-intensity":{type:"number","property-type":"data-constant",default:["interpolate",["linear"],["zoom"],5,.35,6,0],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:{},globe:{}},default:"mercator",required:!0},center:{type:"array",length:2,value:"number","property-type":"data-constant",minimum:[-180,-90],maximum:[180,90],transition:!1,requires:[{name:["albers","lambertConformalConic"]}]},parallels:{type:"array",length:2,value:"number","property-type":"data-constant",minimum:[-90,-90],maximum:[90,90],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,requires:["source"]}},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"},"line-trim-offset":{type:"array",value:"number",length:2,default:[0,0],minimum:[0,0],maximum:[1,1],transition:!1,requires:[{source:"geojson",has:{lineMetrics:!0}}],"property-type":"constant"}},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 av(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<r.length;e+=1){var n=r[e];if(!av(n)&&"boolean"!=typeof n)return!1}return!0;default:return!0}}function sv(t,e){if(void 0===e&&(e="fill"),null==t)return{filter:function(){return!0},needGeometry:!1,needFeature:!1};av(t)||(t=dv(t));var r=t,n=!0;try{n=function(t){if(!hv(t))return t;var e=iv(t);return uv(e),e=lv(e)}(r)}catch(t){console.warn("Failed to extract static filter. Filter will continue working, but at higher memory usage and slower framerate.\nThis is most likely a bug, please report this via https://github.com/mapbox/mapbox-gl-js/issues/new?assignees=&labels=&template=Bug_report.md\nand paste the contents of this message in the report.\nThank you!\nFilter Expression:\n"+JSON.stringify(r,null,2)+"\n ")}var i=ov["filter_"+e],o=$y(n,i),a=null;if("error"===o.result)throw new Error(o.value.map((function(t){return t.key+": "+t.message})).join(", "));a=function(t,e,r){return o.value.evaluate(t,e,{},r)};var s=null,l=null;if(n!==r){var u=$y(r,i);if("error"===u.result)throw new Error(u.value.map((function(t){return t.key+": "+t.message})).join(", "));s=function(t,e,r,n,i){return u.value.evaluate(t,e,{},r,void 0,void 0,n,i)},l=!Zg(u.value.expression)}return{filter:a,dynamicFilter:s||void 0,needGeometry:fv(n),needFeature:!!l}}function lv(t){if(!Array.isArray(t))return t;var e=function(t){if(cv.has(t[0]))for(var e=1;e<t.length;e++){if(hv(t[e]))return!0}return t}(t);return!0===e?e:e.map((function(t){return lv(t)}))}function uv(t){var e=!1,r=[];if("case"===t[0]){for(var n=1;n<t.length-1;n+=2)e=e||hv(t[n]),r.push(t[n+1]);r.push(t[t.length-1])}else if("match"===t[0]){e=e||hv(t[1]);for(var i=2;i<t.length-1;i+=2)r.push(t[i+1]);r.push(t[t.length-1])}else if("step"===t[0]){e=e||hv(t[1]);for(var o=1;o<t.length-1;o+=2)r.push(t[o+1])}e&&(t.length=0,t.push.apply(t,["any"].concat(r)));for(var a=1;a<t.length;a++)uv(t[a])}function hv(t){if(!Array.isArray(t))return!1;if("pitch"===(e=t[0])||"distance-from-center"===e)return!0;for(var e,r=1;r<t.length;r++){if(hv(t[r]))return!0}return!1}var cv=new Set(["in","==","!=",">",">=","<","<=","to-boolean"]);function pv(t,e){return t<e?-1:t>e?1:0}function fv(t){if(!Array.isArray(t))return!1;if("within"===t[0])return!0;for(var e=1;e<t.length;e++)if(fv(t[e]))return!0;return!1}function dv(t){if(!t)return!0;var e,r=t[0];return t.length<=1?"any"!==r:"=="===r?gv(t[1],t[2],"=="):"!="===r?_v(gv(t[1],t[2],"==")):"<"===r||">"===r||"<="===r||">="===r?gv(t[1],t[2],r):"any"===r?(e=t.slice(1),["any"].concat(e.map(dv))):"all"===r?["all"].concat(t.slice(1).map(dv)):"none"===r?["all"].concat(t.slice(1).map(dv).map(_v)):"in"===r?yv(t[1],t.slice(2)):"!in"===r?_v(yv(t[1],t.slice(2))):"has"===r?vv(t[1]):"!has"===r?_v(vv(t[1])):"within"!==r||t}function gv(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 yv(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(pv)]]:["filter-in-small",t,["literal",e]]}}function vv(t){switch(t){case"$type":return!0;case"$id":return["filter-has-id"];default:return["filter-has",t]}}function _v(t){return["!",t]}var mv=["type","source","source-layer","minzoom","maxzoom","filter","layout"];function xv(t,e){var r={};for(var n in t)"ref"!==n&&(r[n]=t[n]);return mv.forEach((function(t){t in e&&(r[t]=e[t])})),r}var wv={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},bv=" ",Sv=/(italic|oblique)$/i,Cv={},Ev=function(t,e,r){var n=Cv[t];if(!n){Array.isArray(t)||(t=[t]);for(var i=400,o="normal",a=[],s=0,l=t.length;s<l;++s){var u=t[s].split(" "),h=u[u.length-1].toLowerCase();for(var c in"normal"==h||"italic"==h||"oblique"==h?(o=h,u.pop(),h=u[u.length-1].toLowerCase()):Sv.test(h)&&(h=h.replace(Sv,""),o=u[u.length-1].replace(h,"")),wv){var p=u.length>1?u[u.length-2].toLowerCase():"";if(h==c||h==c.replace("-","")||p+"-"+h==c){i=wv[c],u.pop(),p&&c.startsWith(p)&&u.pop();break}}"number"==typeof h&&(i=h);var f=u.join(bv).replace("Klokantech Noto Sans","Noto Sans");-1!==f.indexOf(bv)&&(f='"'+f+'"'),a.push(f)}n=Cv[t]=[o,i,a]}return n[0]+bv+n[1]+bv+e+"px"+(r?"/"+r:"")+bv+n[2]},Tv="https://api.mapbox.com";function Pv(t){var e="mapbox://";return 0!==t.indexOf(e)?"":t.slice(e.length)}function Rv(t,e){var r=Pv(t);if(!r)return decodeURI(new URL(t,location.href).href);var n="styles/";if(0!==r.indexOf(n))throw new Error("unexpected style url: "+t);var i=r.slice(n.length);return Tv+"/styles/v1/"+i+"?&access_token="+e}function Ov(t,e,r,n){var i=new URL(t,n),o=Pv(t);return o?"https://{a-d}.tiles.mapbox.com/v4/"+o+"/{z}/{x}/{y}.vector.pbf?access_token="+e:e?(i.searchParams.set(r,e),decodeURI(i.href)):decodeURI(i.href)}function Fv(t){return t*Math.PI/180}var Mv=function(){for(var t=[],e=78271.51696402048;t.length<=24;e/=2)t.push(e);return t}();function Iv(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 Lv={};function Av(t,e,r){if(void 0===r&&(r={}),e in Lv)return Lv[e];var n=r.transformRequest&&r.transformRequest(e,t)||new Request(e);n.headers.get("Accept")||n.headers.set("Accept","application/json");var i=fetch(n).then((function(t){return delete Lv[e],t.ok?t.json():Promise.reject(new Error("Error fetching source "+e))})).catch((function(t){return delete Lv[e],Promise.reject(new Error("Error fetching source "+e))}));return Lv[e]=i,i}var kv={};var Dv,jv=Array(256).join("");function Gv(t,e){if(e>=.05){for(var r="",n=t.split("\n"),i=jv.slice(0,Math.round(e/.1)),o=0,a=n.length;o<a;++o)o>0&&(r+="\n"),r+=n[o].split("").join(i);return r}return t}function zv(){return Dv||(Dv=Iv(1,1).getContext("2d")),Dv}function Nv(t,e){return zv().measureText(t).width+(t.length-1)*e}var Uv={};function Bv(t,e,r,n){if(-1!==t.indexOf("\n")){for(var i=t.split("\n"),o=[],a=0,s=i.length;a<s;++a)o.push(Bv(i[a],e,r,n));return o.join("\n")}var l=r+","+e+","+t+","+n,u=Uv[l];if(!u){var h=t.split(" ");if(h.length>1){var c=zv();c.font=e;for(var p=c.measureText("M").width*r,f="",d=[],g=0,y=h.length;g<y;++g){var v=h[g],_=f+(f?" ":"")+v;Nv(_,n)<=p?f=_:(f&&d.push(f),f=v)}f&&d.push(f);for(var m=0,x=d.length;m<x&&x>1;++m){var w=d[m];if(Nv(w,n)<.35*p){var b=m>0?Nv(d[m-1],n):1/0,S=m<x-1?Nv(d[m+1],n):1/0;d.splice(m,1),x-=1,b<S?(d[m-1]+=" "+w,m-=1):d[m]=w+" "+d[m]}}for(var C=0,E=d.length-1;C<E;++C){var T=d[C],P=d[C+1];if(Nv(T,n)>.7*p&&Nv(P,n)<.6*p){var R=T.split(" "),O=R.pop();Nv(O,n)<.2*p&&(d[C]=R.join(" "),d[C+1]=O+" "+P),E-=1}}u=d.join("\n")}else u=t;u=Gv(u,n),Uv[l]=u}return u}var Vv,Xv=/font-family: ?([^;]*);/,Wv=/("|')/g;function qv(t){if(!Vv){Vv={};for(var e=document.styleSheets,r=0,n=e.length;r<n;++r){var i=e[r];try{var o=i.rules||i.cssRules;if(o)for(var a=0,s=o.length;a<s;++a){var l=o[a];if(5==l.type){var u=l.cssText.match(Xv);Vv[u[1].replace(Wv,"")]=!0}}}catch(t){}}}return t in Vv}var Yv={};function Kv(t){var e=t.toString();if(e in Yv)return Yv[e];for(var r=[],n=0,i=t.length;n<i;++n){t[n]=t[n].replace("Arial Unicode MS","Arial");var o=t[n],a=Ev(o,1);de(a);var s=a.split(" ");r.push([s.slice(3).join(" ").replace(/"/g,""),s[1],s[0]])}for(var l=0,u=r.length;l<u;++l){var h=r[l],c=h[0];if(!qv(c)&&100!==ue.get(h[2]+"\n"+h[1]+" \n"+c)){var p="https://fonts.googleapis.com/css?family="+c.replace(/ /g,"+")+":"+h[1]+h[2];if(!document.querySelector('link[href="'+p+'"]')){var f=document.createElement("link");f.href=p,f.rel="stylesheet",document.head.appendChild(f)}}}return Yv[e]=t,t}var Zv,Hv,Jv={Point:1,MultiPoint:1,LineString:2,MultiLineString:2,Polygon:3,MultiPolygon:3},Qv={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]},$v={},t_={zoom:0};function e_(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 h=(t[e]||$v)[r],c=ov[e+"_"+t.type][r];void 0===h&&(h=c.default);var p=(l=h,Array.isArray(l)&&l.length>0&&"string"==typeof l[0]&&l[0]in Xy);if(!p&&Jy(h)&&(h=zd(h,c),p=!0),p){var f=function(t,e){var r=rv(t,e);if("error"===r.result)throw new Error(r.value.map((function(t){return t.key+": "+t.message})).join(", "));return r.value}(h,c);u[r]=f.evaluate.bind(f)}else"color"==c.type&&(h=jd.parse(h)),u[r]=function(){return h}}return t_.zoom=n,u[r](t_,i,a)}function r_(t,e,r,n){return e_(t,"layout","icon-allow-overlap",e,r,n)?e_(t,"layout","icon-ignore-placement",e,r,n)?"none":"obstacle":"declutter"}function n_(t,e,r,n,i){return i||console.warn("No filterCache provided to evaluateFilter()"),t in i||(i[t]=sv(e).filter),t_.zoom=n,i[t](t_,r)}function i_(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 o_=/\{[^{}}]*\}/g;function a_(t,e){return t.replace(o_,(function(t){return e[t.slice(1,-1)]||""}))}function s_(t,e,r,n,i,o,a){if(void 0===n&&(n=Mv),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 h=self;h.postMessage({action:"loadImage",src:o}),h.addEventListener("message",(function(t){"imageLoaded"===t.data.action&&t.data.src===o&&(s=t.data.image,l=[s.width,s.height])}))}for(var c,p=function(t){t=t.slice();for(var e=Object.create(null),r=0;r<t.length;r++)e[t[r].id]=t[r];for(var n=0;n<t.length;n++)"ref"in t[n]&&(t[n]=xv(t[n],e[t[n].ref]));return t}(e.layers),f={},d=[],g={},y={},v={},_={},m=0,x=p.length;m<x;++m){var w=p[m],b=w.id;if("string"==typeof r&&w.source==r||-1!==r.indexOf(b)){var S=w["source-layer"];if(c){if(w.source!==c)throw new Error('Layer "'+b+'" does not use source "'+c)}else{c=w.source;var C=e.sources[c];if(!C)throw new Error('Source "'+c+'" is not defined');var E=C.type;if("vector"!==E&&"geojson"!==E)throw new Error('Source "'+c+'" is not of type "vector" or "geojson", but "'+E+'"')}var T=f[S];T||(T=[],f[S]=T),T.push({layer:w,index:m}),d.push(b)}}var P=new Fo,R=new Pe,O=[],F=function(e,r){var o=e.getProperties(),u=f[o.layer];if(u){var h=n.indexOf(r);-1==h&&(h=function(t,e){for(var r=0,n=e.length;r<n;++r)if(e[r]<t&&r+1<n){var i=e[r]/e[r+1];return r+Math.log(e[r]/t)/Math.log(i)}return n-1}(r,n));for(var c=Jv[e.getGeometry().getType()],p={properties:o,type:c},d=t.get("mapbox-featurestate")[e.getId()],m=-1,x=0,w=u.length;x<w;++x){var b=u[x],S=b.layer,C=S.id,E=S.layout||$v,T=S.paint||$v;if(!("none"===E.visibility||"minzoom"in S&&h<S.minzoom||"maxzoom"in S&&h>=S.maxzoom)){var F=S.filter;if(!F||n_(C,F,p,h,_)){var M=void 0,I=void 0,L=void 0,A=void 0,k=void 0,D=void 0,j=b.index;if(3==c&&("fill"==S.type||"fill-extrusion"==S.type))if(I=e_(S,"paint",S.type+"-opacity",h,p,v,d),S.type+"-pattern"in T){var G=e_(S,"paint",S.type+"-pattern",h,p,v,d);if(G){var z="string"==typeof G?a_(G,o):G.toString();if(s&&i&&i[z]){++m,(D=O[m])&&D.getFill()&&!D.getStroke()&&!D.getText()||(D=new Do({fill:new Pe}),O[m]=D),L=D.getFill(),D.setZIndex(j);var N=z+"."+I,U=y[N];if(!U){var B=i[z],V=Iv(B.width,B.height),X=V.getContext("2d");X.globalAlpha=I,X.drawImage(s,B.x,B.y,B.width,B.height,0,0,B.width,B.height),U=X.createPattern(V,"repeat"),y[N]=U}L.setColor(U)}}}else M=i_(e_(S,"paint",S.type+"-color",h,p,v,d),I),S.type+"-outline-color"in T&&(k=i_(e_(S,"paint",S.type+"-outline-color",h,p,v,d),I)),k||(k=M),(M||k)&&(++m,(!(D=O[m])||M&&!D.getFill()||!M&&D.getFill()||k&&!D.getStroke()||!k&&D.getStroke()||D.getText())&&(D=new Do({fill:M?new Pe:void 0,stroke:k?new Fo:void 0}),O[m]=D),M&&(L=D.getFill()).setColor(M),k&&((A=D.getStroke()).setColor(k),A.setWidth(.5)),D.setZIndex(j));if(1!=c&&"line"==S.type){M=!("line-pattern"in T)&&"line-color"in T?i_(e_(S,"paint","line-color",h,p,v,d),e_(S,"paint","line-opacity",h,p,v,d)):void 0;var W=e_(S,"paint","line-width",h,p,v,d);M&&W>0&&(++m,(D=O[m])&&D.getStroke()&&!D.getFill()&&!D.getText()||(D=new Do({stroke:new Fo}),O[m]=D),(A=D.getStroke()).setLineCap(e_(S,"layout","line-cap",h,p,v,d)),A.setLineJoin(e_(S,"layout","line-join",h,p,v,d)),A.setMiterLimit(e_(S,"layout","line-miter-limit",h,p,v,d)),A.setColor(M),A.setWidth(W),A.setLineDash(T["line-dasharray"]?e_(S,"paint","line-dasharray",h,p,v,d).map((function(t){return t*W})):null),D.setZIndex(j))}var q=!1,Y=null,K=0,Z=void 0,H=void 0,J=void 0;if((1==c||2==c)&&"icon-image"in E){var Q=e_(S,"layout","icon-image",h,p,v,d);if(Q){Z="string"==typeof Q?a_(Q,o):Q.toString();var $=void 0;if(s&&i&&i[Z]){var tt=e_(S,"layout","icon-rotation-alignment",h,p,v,d);if(2==c){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(Hv||(Hv=new Ro("Point",Zv=[NaN,NaN],[],{},null)),$=Hv,Zv[0]=nt[0],Zv[1]=nt[1],"line"===e_(S,"layout","symbol-placement",h,p,v,d)&&"map"===tt)for(var it=et.getStride(),ot=et.getFlatCoordinates(),at=0,st=ot.length-it;at<st;at+=it){var lt=ot[at],ut=ot[at+1],ht=ot[at+it],ct=ot[at+it+1],pt=Math.min(lt,ht),ft=Math.min(ut,ct),dt=Math.max(lt,ht),gt=Math.max(ut,ct);if(nt[0]>=pt&&nt[0]<=dt&&nt[1]>=ft&&nt[1]<=gt){K=Math.atan2(ut-ct,ht-lt);break}}}}}if(2!==c||$){var yt=e_(S,"layout","icon-size",h,p,v,d),vt=void 0!==T["icon-color"]?e_(S,"paint","icon-color",h,p,v,d):null;if(!vt||0!==vt.a){var _t=Z+"."+yt;if(null!==vt&&(_t+="."+vt),!(H=g[_t])){var mt=i[Z],xt=r_(S,h,p,v);H=new Ar({color:vt?[255*vt.r,255*vt.g,255*vt.b,vt.a]:void 0,img:s,imgSize:l,size:[mt.width,mt.height],offset:[mt.x,mt.y],rotateWithView:"map"===tt,scale:yt/mt.pixelRatio,displacement:"icon-offset"in E?e_(S,"layout","icon-offset",h,p,v,d).map((function(t){return-t*mt.pixelRatio})):void 0,declutterMode:xt}),g[_t]=H}}H&&(++m,(D=O[m])&&D.getImage()&&!D.getFill()&&!D.getStroke()||(D=new Do,O[m]=D),D.setGeometry($),H.setRotation(K+Fv(e_(S,"layout","icon-rotate",h,p,v,d))),H.setOpacity(e_(S,"paint","icon-opacity",h,p,v,d)),H.setAnchor(Qv[e_(S,"layout","icon-anchor",h,p,v,d)]),D.setImage(H),Y=D.getText(),D.setText(void 0),D.setZIndex(j),q=!0,J=!1)}else J=!0}}}if(1==c&&"circle"===S.type){++m,(D=O[m])&&D.getImage()&&!D.getFill()&&!D.getStroke()||(D=new Do,O[m]=D);var wt="circle-radius"in T?e_(S,"paint","circle-radius",h,p,v,d):5,bt=i_(e_(S,"paint","circle-stroke-color",h,p,v,d),e_(S,"paint","circle-stroke-opacity",h,p,v,d)),St=i_(e_(S,"paint","circle-color",h,p,v,d),e_(S,"paint","circle-opacity",h,p,v,d)),Ct=e_(S,"paint","circle-stroke-width",h,p,v,d),Et=wt+"."+bt+"."+St+"."+Ct;(H=g[Et])||(H=new Ee({radius:wt,stroke:bt&&Ct>0?new Fo({width:Ct,color:bt}):void 0,fill:St?new Pe({color:St}):void 0,declutterMode:"none"}),g[Et]=H),D.setImage(H),Y=D.getText(),D.setText(void 0),D.setGeometry(void 0),D.setZIndex(j),q=!0}var Tt=void 0,Pt=void 0,Rt=void 0,Ot=void 0,Ft=void 0,Mt=void 0;if("text-field"in E){Ot=Math.round(e_(S,"layout","text-size",h,p,v,d));var It=e_(S,"layout","text-font",h,p,v,d);Rt=e_(S,"layout","text-line-height",h,p,v,d),(Pt=Ev(a?a(It):It,Ot,Rt)).includes("sans-serif")||(Pt+=",sans-serif"),Ft=e_(S,"layout","text-letter-spacing",h,p,v,d),Mt=e_(S,"layout","text-max-width",h,p,v,d);var Lt=e_(S,"layout","text-field",h,p,v,d);Tt="object"==typeof Lt&&Lt.sections?1===Lt.sections.length?Lt.toString():Lt.sections.reduce((function(t,e,r){var n=e.fontStack?e.fontStack.split(","):It,i=Ev(a?a(n):n,Ot*(e.scale||1),Rt),o=e.text;if("\n"===o)return t.push("\n",""),t;if(2!=c){for(var s=0,l=(o=Bv(o,i,Mt,Ft).split("\n")).length;s<l;++s)s>0&&t.push("\n",""),t.push(o[s],i);return t}t.push(Gv(o,Ft),i)}),[]):a_(Lt,o).trim(),I=e_(S,"paint","text-opacity",h,p,v,d)}if(Tt&&I&&!J){q||(++m,(D=O[m])&&D.getText()&&!D.getFill()&&!D.getStroke()||(D=new Do,O[m]=D),D.setImage(void 0),D.setGeometry(void 0)),D.getText()||D.setText(Y||new No({padding:[2,2,2,2]})),Y=D.getText();var At=E["text-transform"];"uppercase"==At?Tt=Array.isArray(Tt)?Tt.map((function(t,e){return e%2?t:t.toUpperCase()})):Tt.toUpperCase():"lowercase"==At&&(Tt=Array.isArray(Tt)?Tt.map((function(t,e){return e%2?t:t.toLowerCase()})):Tt.toLowerCase());var kt=Array.isArray(Tt)?Tt:2==c?Gv(Tt,Ft):Bv(Tt,Pt,Mt,Ft);Y.setText(kt),Y.setFont(Pt),Y.setRotation(Fv(e_(S,"layout","text-rotate",h,p,v,d)));var Dt=e_(S,"layout","text-anchor",h,p,v,d),jt=q||1==c?"point":e_(S,"layout","symbol-placement",h,p,v,d);Y.setPlacement(jt),Y.setOverflow("point"===jt);var Gt=e_(S,"paint","text-halo-width",h,p,v,d),zt=e_(S,"layout","text-offset",h,p,v,d),Nt=e_(S,"paint","text-translate",h,p,v,d),Ut=0,Bt=0;if("point"==jt){var Vt="center";-1!==Dt.indexOf("left")?(Vt="left",Bt=Gt):-1!==Dt.indexOf("right")&&(Vt="right",Bt=-Gt),Y.setTextAlign(Vt);var Xt=e_(S,"layout","text-rotation-alignment",h,p,v,d);Y.setRotateWithView("map"==Xt)}else Y.setMaxAngle(Fv(e_(S,"layout","text-max-angle",h,p,v,d))*Tt.length/kt.length),Y.setTextAlign(),Y.setRotateWithView(!1);var Wt="middle";0==Dt.indexOf("bottom")?(Wt="bottom",Ut=-Gt-.5*(Rt-1)*Ot):0==Dt.indexOf("top")&&(Wt="top",Ut=Gt+.5*(Rt-1)*Ot),Y.setTextBaseline(Wt),Y.setOffsetX(zt[0]*Ot+Bt+Nt[0]),Y.setOffsetY(zt[1]*Ot+Ut+Nt[1]),R.setColor(i_(e_(S,"paint","text-color",h,p,v,d),I)),Y.setFill(R);var qt=i_(e_(S,"paint","text-halo-color",h,p,v,d),I);if(qt){P.setColor(qt),Gt*=2;var Yt=.5*Ot;P.setWidth(Gt<=Yt?Gt:Yt),Y.setStroke(P)}else Y.setStroke(void 0);var Kt=e_(S,"layout","text-padding",h,p,v,d),Zt=Y.getPadding();Kt!==Zt[0]&&(Zt[0]=Kt,Zt[1]=Kt,Zt[2]=Kt,Zt[3]=Kt),D.setZIndex(j)}}}}return m>-1?(O.length=m+1,O):void 0}};return t.setStyle(F),t.set("mapbox-source",c),t.set("mapbox-layers",d),t.set("mapbox-featurestate",{}),F}var l_=new Ho;var u_={exports:{}},h_=Jo(yl),c_=Jo(Bt),p_=Jo(ds);!function(t,e){t.exports=function(t,e,r){t="default"in t?t.default:t,r="default"in r?r.default:r;var n=function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")},i=function(){function t(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}return function(e,r,n){return r&&t(e.prototype,r),n&&t(e,n),e}}(),o=function t(e,r,n){null===e&&(e=Function.prototype);var i=Object.getOwnPropertyDescriptor(e,r);if(void 0===i){var o=Object.getPrototypeOf(e);return null===o?void 0:t(o,r,n)}if("value"in i)return i.value;var a=i.get;return void 0!==a?a.call(n):void 0},a=function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)},s=function(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e},l="layer-switcher-",u=function(t){function u(t){n(this,u);var e=Object.assign({},t),r=e.tipLabel?e.tipLabel:"Legend",i=e.collapseTipLabel?e.collapseTipLabel:"Collapse legend",o=document.createElement("div"),a=s(this,(u.__proto__||Object.getPrototypeOf(u)).call(this,{element:o,target:e.target}));a.activationMode=e.activationMode||"mouseover",a.startActive=!0===e.startActive;var h=void 0!==e.label?e.label:"",c=void 0!==e.collapseLabel?e.collapseLabel:"»";a.groupSelectStyle=u.getGroupSelectStyle(e.groupSelectStyle),a.reverse=!1!==e.reverse,a.mapListeners=[],a.hiddenClassName="ol-unselectable ol-control layer-switcher",u.isTouchDevice_()&&(a.hiddenClassName+=" touch"),a.shownClassName="shown",o.className=a.hiddenClassName;var p=document.createElement("button");return p.setAttribute("title",r),p.setAttribute("aria-label",r),o.appendChild(p),a.panel=document.createElement("div"),a.panel.className="panel",o.appendChild(a.panel),u.enableTouchScroll_(a.panel),p.textContent=h,o.classList.add(l+"group-select-style-"+a.groupSelectStyle),o.classList.add(l+"activation-mode-"+a.activationMode),"click"===a.activationMode?(o.classList.add("activationModeClick"),a.startActive&&(p.textContent=c,p.setAttribute("title",i),p.setAttribute("aria-label",i)),p.onclick=function(t){var e=t||window.event;a.element.classList.contains(a.shownClassName)?(a.hidePanel(),p.textContent=h,p.setAttribute("title",r),p.setAttribute("aria-label",r)):(a.showPanel(),p.textContent=c,p.setAttribute("title",i),p.setAttribute("aria-label",i)),e.preventDefault()}):(p.onmouseover=function(){a.showPanel()},p.onclick=function(t){var e=t||window.event;a.showPanel(),e.preventDefault()},a.panel.onmouseout=function(t){a.panel.contains(t.relatedTarget)||a.hidePanel()}),a}return a(u,t),i(u,[{key:"setMap",value:function(t){for(var r=this,n=0;n<this.mapListeners.length;n++)e.unByKey(this.mapListeners[n]);this.mapListeners.length=0,o(u.prototype.__proto__||Object.getPrototypeOf(u.prototype),"setMap",this).call(this,t),t&&(this.startActive?this.showPanel():this.renderPanel(),"click"!==this.activationMode&&this.mapListeners.push(t.on("pointerdown",(function(){r.hidePanel()}))))}},{key:"showPanel",value:function(){this.element.classList.contains(this.shownClassName)||(this.element.classList.add(this.shownClassName),this.renderPanel())}},{key:"hidePanel",value:function(){this.element.classList.contains(this.shownClassName)&&this.element.classList.remove(this.shownClassName)}},{key:"renderPanel",value:function(){this.dispatchEvent("render"),u.renderPanel(this.getMap(),this.panel,{groupSelectStyle:this.groupSelectStyle,reverse:this.reverse}),this.dispatchEvent("rendercomplete")}}],[{key:"renderPanel",value:function(t,e,r){var n=new Event("render");for(e.dispatchEvent(n),(r=r||{}).groupSelectStyle=u.getGroupSelectStyle(r.groupSelectStyle),u.ensureTopVisibleBaseLayerShown(t,r.groupSelectStyle);e.firstChild;)e.removeChild(e.firstChild);u.forEachRecursive(t,(function(t,e,r){t.set("indeterminate",!1)})),"children"===r.groupSelectStyle||"none"===r.groupSelectStyle?u.setGroupVisibility(t):"group"===r.groupSelectStyle&&u.setChildVisibility(t);var i=document.createElement("ul");e.appendChild(i),u.renderLayers_(t,t,i,r,(function(n){u.renderPanel(t,e,r)}));var o=new Event("rendercomplete");e.dispatchEvent(o)}},{key:"isBaseGroup",value:function(t){if(t instanceof r){var e=t.getLayers().getArray();return e.length&&"base"===e[0].get("type")}return!1}},{key:"setGroupVisibility",value:function(t){u.getGroupsAndLayers(t,(function(t){return t instanceof r&&!t.get("combine")&&!u.isBaseGroup(t)})).reverse().forEach((function(t){var e=t.getLayersArray().map((function(t){return t.getVisible()}));e.every((function(t){return!0===t}))?(t.setVisible(!0),t.set("indeterminate",!1)):e.every((function(t){return!1===t}))?(t.setVisible(!1),t.set("indeterminate",!1)):(t.setVisible(!0),t.set("indeterminate",!0))}))}},{key:"setChildVisibility",value:function(t){u.getGroupsAndLayers(t,(function(t){return t instanceof r&&!t.get("combine")&&!u.isBaseGroup(t)})).forEach((function(t){var e=t,r=e.getVisible(),n=e.get("indeterminate");e.getLayers().getArray().forEach((function(t){t.set("indeterminate",!1),r&&!n||!t.getVisible()||t.set("indeterminate",!0)}))}))}},{key:"ensureTopVisibleBaseLayerShown",value:function(t,e){var r=void 0;u.forEachRecursive(t,(function(t,e,n){"base"===t.get("type")&&t.getVisible()&&(r=t)})),r&&u.setVisible_(t,r,!0,e)}},{key:"getGroupsAndLayers",value:function(t,e){var r=[];return e=e||function(t,e,r){return!0},u.forEachRecursive(t,(function(t,n,i){t.get("title")&&e(t,n,i)&&r.push(t)})),r}},{key:"setVisible_",value:function(t,e,n,i){e.setVisible(n),n&&"base"===e.get("type")&&u.forEachRecursive(t,(function(t,r,n){t!=e&&"base"===t.get("type")&&t.setVisible(!1)})),e instanceof r&&!e.get("combine")&&"children"===i&&e.getLayers().forEach((function(r){u.setVisible_(t,r,e.getVisible(),i)}))}},{key:"renderLayer_",value:function(t,e,n,i,o){var a=document.createElement("li"),s=e.get("title"),h=u.uuid(),c=document.createElement("label");if(e instanceof r&&!e.get("combine")){var p=u.isBaseGroup(e);if(a.classList.add("group"),p&&a.classList.add(l+"base-group"),e.get("fold")){a.classList.add(l+"fold"),a.classList.add(l+e.get("fold"));var f=document.createElement("button");f.onclick=function(t){var r=t||window.event;u.toggleFold_(e,a),r.preventDefault()},a.appendChild(f)}if(!p&&"none"!=i.groupSelectStyle){var d=document.createElement("input");d.type="checkbox",d.id=h,d.checked=e.getVisible(),d.indeterminate=e.get("indeterminate"),d.onchange=function(r){var n=r.target;u.setVisible_(t,e,n.checked,i.groupSelectStyle),o(e)},a.appendChild(d),c.htmlFor=h}c.innerHTML=s,a.appendChild(c);var g=document.createElement("ul");a.appendChild(g),u.renderLayers_(t,e,g,i,o)}else{a.className="layer";var y=document.createElement("input");"base"===e.get("type")?(y.type="radio",y.name="base"):y.type="checkbox",y.id=h,y.checked=e.get("visible"),y.indeterminate=e.get("indeterminate"),y.onchange=function(r){var n=r.target;u.setVisible_(t,e,n.checked,i.groupSelectStyle),o(e)},a.appendChild(y),c.htmlFor=h,c.innerHTML=s;var v=t.getView().getResolution();(v>e.getMaxResolution()||v<e.getMinResolution())&&(c.className+=" disabled"),a.appendChild(c)}return a}},{key:"renderLayers_",value:function(t,e,r,n,i){var o=e.getLayers().getArray().slice();n.reverse&&(o=o.reverse());for(var a,s=0;s<o.length;s++)(a=o[s]).get("title")&&r.appendChild(u.renderLayer_(t,a,s,n,i))}},{key:"forEachRecursive",value:function(t,e){t.getLayers().forEach((function(t,n,i){e(t,n,i),t instanceof r&&u.forEachRecursive(t,e)}))}},{key:"uuid",value:function(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,(function(t){var e=16*Math.random()|0;return("x"==t?e:3&e|8).toString(16)}))}},{key:"enableTouchScroll_",value:function(t){if(u.isTouchDevice_()){var e=0;t.addEventListener("touchstart",(function(t){e=this.scrollTop+t.touches[0].pageY}),!1),t.addEventListener("touchmove",(function(t){this.scrollTop=e-t.touches[0].pageY}),!1)}}},{key:"isTouchDevice_",value:function(){try{return document.createEvent("TouchEvent"),!0}catch(t){return!1}}},{key:"toggleFold_",value:function(t,e){e.classList.remove(l+t.get("fold")),t.set("fold","open"===t.get("fold")?"close":"open"),e.classList.add(l+t.get("fold"))}},{key:"getGroupSelectStyle",value:function(t){return["none","children","group"].indexOf(t)>=0?t:"children"}}]),u}(t);return window.ol&&window.ol.control&&(window.ol.control.LayerSwitcher=u),u}(h_,c_,p_)}(u_);var f_=u_.exports,d_="http://www.w3.org/2001/XMLSchema-instance";function g_(t,e){return A_().createElementNS(t,e)}function y_(t,e){return v_(t,e,[]).join("")}function v_(t,e,r){if(t.nodeType==Node.CDATA_SECTION_NODE||t.nodeType==Node.TEXT_NODE)e?r.push(String(t.nodeValue).replace(/(\r\n|\r|\n)/g,"")):r.push(t.nodeValue);else{var n=void 0;for(n=t.firstChild;n;n=n.nextSibling)v_(n,e,r)}return r}function __(t){return"documentElement"in t}function m_(t){return(new DOMParser).parseFromString(t,"application/xml")}function x_(t,e){return function(r,n){var i=t.call(void 0!==e?e:this,r,n);void 0!==i&&ht(n[n.length-1],i)}}function w_(t,e){return function(r,n){var i=t.call(void 0!==e?e:this,r,n);void 0!==i&&n[n.length-1].push(i)}}function b_(t,e){return function(r,n){var i=t.call(void 0!==e?e:this,r,n);void 0!==i&&(n[n.length-1]=i)}}function S_(t,e,r){return function(n,i){var o=t.call(void 0!==r?r:this,n,i);void 0!==o&&(i[i.length-1][void 0!==e?e:n.localName]=o)}}function C_(t,e){return function(r,n,i){t.call(void 0!==e?e:this,r,n,i),i[i.length-1].node.appendChild(r)}}function E_(t,e){var r=t;return function(t,n,i){var o=n[n.length-1].node,a=r;return void 0===a&&(a=i),g_(void 0!==e?e:o.namespaceURI,a)}}var T_=E_();function P_(t,e){for(var r=e.length,n=new Array(r),i=0;i<r;++i)n[i]=t[e[i]];return n}function R_(t,e,r){var n,i,o=void 0!==r?r:{};for(n=0,i=t.length;n<i;++n)o[t[n]]=e;return o}function O_(t,e,r,n){var i;for(i=e.firstElementChild;i;i=i.nextElementSibling){var o=t[i.namespaceURI];if(void 0!==o){var a=o[i.localName];void 0!==a&&a.call(n,i,r)}}}function F_(t,e,r,n,i){return n.push(t),O_(e,r,n,i),n.pop()}function M_(t,e,r,n,i,o,a){return i.push(t),function(t,e,r,n,i,o){for(var a,s,l=(void 0!==i?i:r).length,u=0;u<l;++u)void 0!==(a=r[u])&&void 0!==(s=e.call(void 0!==o?o:this,a,n,void 0!==i?i[u]:void 0))&&t[s.namespaceURI][s.localName].call(o,s,a,n)}(e,r,n,i,o,a),i.pop()}var I_=void 0;var L_=void 0;function A_(){return void 0===L_&&"undefined"!=typeof document&&(L_=document.implementation.createDocument("","",null)),L_}var k_=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)}}(),D_=function(t){function e(){var e=t.call(this)||this;return e.xmlSerializer_=(void 0===I_&&"undefined"!=typeof XMLSerializer&&(I_=new XMLSerializer),I_),e}return k_(e,t),e.prototype.getType=function(){return"xml"},e.prototype.readFeature=function(t,e){if(t){if("string"==typeof t){var r=m_(t);return this.readFeatureFromDocument(r,e)}return __(t)?this.readFeatureFromDocument(t,e):this.readFeatureFromNode(t,e)}return null},e.prototype.readFeatureFromDocument=function(t,e){var r=this.readFeaturesFromDocument(t,e);return r.length>0?r[0]:null},e.prototype.readFeatureFromNode=function(t,e){return null},e.prototype.readFeatures=function(t,e){if(t){if("string"==typeof t){var r=m_(t);return this.readFeaturesFromDocument(r,e)}return __(t)?this.readFeaturesFromDocument(t,e):this.readFeaturesFromNode(t,e)}return[]},e.prototype.readFeaturesFromDocument=function(t,e){for(var r=[],n=t.firstChild;n;n=n.nextSibling)n.nodeType==Node.ELEMENT_NODE&&ht(r,this.readFeaturesFromNode(n,e));return r},e.prototype.readFeaturesFromNode=function(t,e){return a()},e.prototype.readGeometry=function(t,e){if(t){if("string"==typeof t){var r=m_(t);return this.readGeometryFromDocument(r,e)}return __(t)?this.readGeometryFromDocument(t,e):this.readGeometryFromNode(t,e)}return null},e.prototype.readGeometryFromDocument=function(t,e){return null},e.prototype.readGeometryFromNode=function(t,e){return null},e.prototype.readProjection=function(t){if(t){if("string"==typeof t){var e=m_(t);return this.readProjectionFromDocument(e)}return __(t)?this.readProjectionFromDocument(t):this.readProjectionFromNode(t)}return null},e.prototype.readProjectionFromDocument=function(t){return this.dataProjection},e.prototype.readProjectionFromNode=function(t){return this.dataProjection},e.prototype.writeFeature=function(t,e){var r=this.writeFeatureNode(t,e);return this.xmlSerializer_.serializeToString(r)},e.prototype.writeFeatureNode=function(t,e){return null},e.prototype.writeFeatures=function(t,e){var r=this.writeFeaturesNode(t,e);return this.xmlSerializer_.serializeToString(r)},e.prototype.writeFeaturesNode=function(t,e){return null},e.prototype.writeGeometry=function(t,e){var r=this.writeGeometryNode(t,e);return this.xmlSerializer_.serializeToString(r)},e.prototype.writeGeometryNode=function(t,e){return null},e}(Uo),j_=D_;function G_(t){var e,r=y_(t,!1);return(e=/^\s*(true|1)|(false|0)\s*$/.exec(r))?void 0!==e[1]||!1:void 0}function z_(t){var e,r=y_(t,!1);return(e=/^\s*([+\-]?\d*\.?\d+(?:e[+\-]?\d+)?)\s*$/i.exec(r))?parseFloat(e[1]):void 0}function N_(t){return y_(t,!1).trim()}function U_(t,e){V_(t,e?"1":"0")}function B_(t,e){var r=e.toPrecision();t.appendChild(A_().createTextNode(r))}function V_(t,e){t.appendChild(A_().createTextNode(e))}var X_,W_,q_,Y_,K_,Z_,H_,J_,Q_,$_=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)}}(),tm=["http://www.google.com/kml/ext/2.2"],em=[null,"http://earth.google.com/kml/2.0","http://earth.google.com/kml/2.1","http://earth.google.com/kml/2.2","http://www.opengis.net/kml/2.2"],rm={fraction:Re,pixels:Oe,insetPixels:Oe},nm=R_(em,{ExtendedData:Jm,Region:Qm,MultiGeometry:S_(Bm,"geometry"),LineString:S_(zm,"geometry"),LinearRing:S_(Nm,"geometry"),Point:S_(Vm,"geometry"),Polygon:S_(Wm,"geometry"),Style:S_(Ym),StyleMap:function(t,e){var r=Em.call(this,t,e);if(!r)return;var n=e[e.length-1];Array.isArray(r)?n.Style=r:"string"==typeof r?n.styleUrl=r:_(!1,38)},address:S_(N_),description:S_(N_),name:S_(N_),open:S_(G_),phoneNumber:S_(N_),styleUrl:S_(bm),visibility:S_(G_)},R_(tm,{MultiTrack:S_((function(t,e){var r=F_([],Im,t,e);if(!r)return;return new ro(r)}),"geometry"),Track:S_(Am,"geometry")})),im=R_(em,{ExtendedData:Jm,Region:Qm,Link:function(t,e){O_(om,t,e)},address:S_(N_),description:S_(N_),name:S_(N_),open:S_(G_),phoneNumber:S_(N_),visibility:S_(G_)}),om=R_(em,{href:S_(wm)}),am=R_(em,{LatLonAltBox:function(t,e){var r=F_({},ex,t,e);if(!r)return;var n=e[e.length-1],i=[parseFloat(r.west),parseFloat(r.south),parseFloat(r.east),parseFloat(r.north)];n.extent=i,n.altitudeMode=r.altitudeMode,n.minAltitude=parseFloat(r.minAltitude),n.maxAltitude=parseFloat(r.maxAltitude)},Lod:function(t,e){var r=F_({},rx,t,e);if(!r)return;var n=e[e.length-1];n.minLodPixels=parseFloat(r.minLodPixels),n.maxLodPixels=parseFloat(r.maxLodPixels),n.minFadeExtent=parseFloat(r.minFadeExtent),n.maxFadeExtent=parseFloat(r.maxFadeExtent)}}),sm=R_(em,["Document","Placemark"]),lm=R_(em,{Document:C_((function(t,e,r){M_({node:t},sx,lx,e,r,void 0,this)})),Placemark:C_(Ix)}),um=null,hm=null,cm=null,pm=null,fm=null,dm=null;function gm(t){return 32/Math.min(t[0],t[1])}function ym(t){return t}var vm=function(t){function e(e){var r=t.call(this)||this,n=e||{};return dm||(um=new Pe({color:X_=[255,255,255,1]}),Z_="https://maps.google.com/mapfiles/kml/pushpin/ylw-pushpin.png",hm=new Ar({anchor:W_=[20,2],anchorOrigin:Fe,anchorXUnits:q_=Oe,anchorYUnits:Y_=Oe,crossOrigin:"anonymous",rotation:0,scale:gm(K_=[64,64]),size:K_,src:Z_}),H_="NO_IMAGE",cm=new Fo({color:X_,width:1}),J_=new Fo({color:[51,51,51,1],width:2}),pm=new No({font:"bold 16px Helvetica",fill:um,stroke:J_,scale:.8}),fm=new Do({fill:um,image:hm,text:pm,stroke:cm,zIndex:0}),dm=[fm]),r.dataProjection=Bn("EPSG:4326"),r.defaultStyle_=n.defaultStyle?n.defaultStyle:dm,r.extractStyles_=void 0===n.extractStyles||n.extractStyles,r.writeStyles_=void 0===n.writeStyles||n.writeStyles,r.sharedStyles_={},r.showPointNames_=void 0===n.showPointNames||n.showPointNames,r.crossOrigin_=void 0!==n.crossOrigin?n.crossOrigin:"anonymous",r.iconUrlFunction_=n.iconUrlFunction?n.iconUrlFunction:ym,r.supportedMediaTypes=["application/vnd.google-earth.kml+xml"],r}return $_(e,t),e.prototype.readDocumentOrFolder_=function(t,e){var r=F_([],R_(em,{Document:x_(this.readDocumentOrFolder_,this),Folder:x_(this.readDocumentOrFolder_,this),Placemark:w_(this.readPlacemark_,this),Style:this.readSharedStyle_.bind(this),StyleMap:this.readSharedStyleMap_.bind(this)}),t,e,this);return r||void 0},e.prototype.readPlacemark_=function(t,e){var r=F_({geometry:null},nm,t,e,this);if(r){var n=new jr,i=t.getAttribute("id");null!==i&&n.setId(i);var o=e[0],a=r.geometry;if(a&&Bo(a,!1,o),n.setGeometry(a),delete r.geometry,this.extractStyles_){var s=function(t,e,r,n,i){return function(o,a){var s=i,l="",u=[];if(s){var h=o.getGeometry();if(h)if(h instanceof Si)u=h.getGeometriesArrayRecursive().filter((function(t){var e=t.getType();return"Point"===e||"MultiPoint"===e})),s=u.length>0;else{var c=h.getType();s="Point"===c||"MultiPoint"===c}}s&&(l=o.get("name"),(s=s&&!!l)&&l.search(/&[^&]+;/)>-1&&(Q_||(Q_=document.createElement("textarea")),Q_.innerHTML=l,l=Q_.value));var p=r;if(t?p=t:e&&(p=_m(e,r,n)),s){var f=function(t,e){var r=[0,0],n="start",i=t.getImage();if(i){var o=i.getSize();if(o&&2==o.length){var a=i.getScaleArray(),s=i.getAnchor();r[0]=a[0]*(o[0]-s[0]),r[1]=a[1]*(o[1]/2-s[1]),n="left"}}var l=t.getText();l?((l=l.clone()).setFont(l.getFont()||pm.getFont()),l.setScale(l.getScale()||pm.getScale()),l.setFill(l.getFill()||pm.getFill()),l.setStroke(l.getStroke()||J_)):l=pm.clone();return l.setText(e),l.setOffsetX(r[0]),l.setOffsetY(r[1]),l.setTextAlign(n),new Do({image:i,text:l})}(p[0],l);return u.length>0?(f.setGeometry(new Si(u)),[f,new Do({geometry:p[0].getGeometry(),image:null,fill:p[0].getFill(),stroke:p[0].getStroke(),text:null})].concat(p.slice(1))):f}return p}}(r.Style,r.styleUrl,this.defaultStyle_,this.sharedStyles_,this.showPointNames_);n.setStyle(s)}return delete r.Style,n.setProperties(r,!0),n}},e.prototype.readSharedStyle_=function(t,e){var r=t.getAttribute("id");if(null!==r){var n=Ym.call(this,t,e);if(n){var i=void 0,o=t.baseURI;if(o&&"about:blank"!=o||(o=window.location.href),o)i=new URL("#"+r,o).href;else i="#"+r;this.sharedStyles_[i]=n}}},e.prototype.readSharedStyleMap_=function(t,e){var r=t.getAttribute("id");if(null!==r){var n=Em.call(this,t,e);if(n){var i,o=t.baseURI;if(o&&"about:blank"!=o||(o=window.location.href),o)i=new URL("#"+r,o).href;else i="#"+r;this.sharedStyles_[i]=n}}},e.prototype.readFeatureFromNode=function(t,e){if(!st(em,t.namespaceURI))return null;var r=this.readPlacemark_(t,[this.getReadOptions(t,e)]);return r||null},e.prototype.readFeaturesFromNode=function(t,e){if(!st(em,t.namespaceURI))return[];var r,n=t.localName;if("Document"==n||"Folder"==n)return(r=this.readDocumentOrFolder_(t,[this.getReadOptions(t,e)]))||[];if("Placemark"==n){var i=this.readPlacemark_(t,[this.getReadOptions(t,e)]);return i?[i]:[]}if("kml"==n){r=[];for(var o=t.firstElementChild;o;o=o.nextElementSibling){var a=this.readFeaturesFromNode(o,e);a&&ht(r,a)}return r}return[]},e.prototype.readName=function(t){if(t){if("string"==typeof t){var e=m_(t);return this.readNameFromDocument(e)}return __(t)?this.readNameFromDocument(t):this.readNameFromNode(t)}},e.prototype.readNameFromDocument=function(t){for(var e=t.firstChild;e;e=e.nextSibling)if(e.nodeType==Node.ELEMENT_NODE){var r=this.readNameFromNode(e);if(r)return r}},e.prototype.readNameFromNode=function(t){for(var e=t.firstElementChild;e;e=e.nextElementSibling)if(st(em,e.namespaceURI)&&"name"==e.localName)return N_(e);for(e=t.firstElementChild;e;e=e.nextElementSibling){var r=e.localName;if(st(em,e.namespaceURI)&&("Document"==r||"Folder"==r||"Placemark"==r||"kml"==r)){var n=this.readNameFromNode(e);if(n)return n}}},e.prototype.readNetworkLinks=function(t){var e=[];if("string"==typeof t){var r=m_(t);ht(e,this.readNetworkLinksFromDocument(r))}else __(t)?ht(e,this.readNetworkLinksFromDocument(t)):ht(e,this.readNetworkLinksFromNode(t));return e},e.prototype.readNetworkLinksFromDocument=function(t){for(var e=[],r=t.firstChild;r;r=r.nextSibling)r.nodeType==Node.ELEMENT_NODE&&ht(e,this.readNetworkLinksFromNode(r));return e},e.prototype.readNetworkLinksFromNode=function(t){for(var e=[],r=t.firstElementChild;r;r=r.nextElementSibling)if(st(em,r.namespaceURI)&&"NetworkLink"==r.localName){var n=F_({},im,r,[]);e.push(n)}for(r=t.firstElementChild;r;r=r.nextElementSibling){var i=r.localName;!st(em,r.namespaceURI)||"Document"!=i&&"Folder"!=i&&"kml"!=i||ht(e,this.readNetworkLinksFromNode(r))}return e},e.prototype.readRegion=function(t){var e=[];if("string"==typeof t){var r=m_(t);ht(e,this.readRegionFromDocument(r))}else __(t)?ht(e,this.readRegionFromDocument(t)):ht(e,this.readRegionFromNode(t));return e},e.prototype.readRegionFromDocument=function(t){for(var e=[],r=t.firstChild;r;r=r.nextSibling)r.nodeType==Node.ELEMENT_NODE&&ht(e,this.readRegionFromNode(r));return e},e.prototype.readRegionFromNode=function(t){for(var e=[],r=t.firstElementChild;r;r=r.nextElementSibling)if(st(em,r.namespaceURI)&&"Region"==r.localName){var n=F_({},am,r,[]);e.push(n)}for(r=t.firstElementChild;r;r=r.nextElementSibling){var i=r.localName;!st(em,r.namespaceURI)||"Document"!=i&&"Folder"!=i&&"kml"!=i||ht(e,this.readRegionFromNode(r))}return e},e.prototype.writeFeaturesNode=function(t,e){e=this.adaptOptions(e);var r=g_(em[4],"kml"),n="http://www.w3.org/2000/xmlns/";r.setAttributeNS(n,"xmlns:gx",tm[0]),r.setAttributeNS(n,"xmlns:xsi",d_),r.setAttributeNS(d_,"xsi:schemaLocation","http://www.opengis.net/kml/2.2 https://developers.google.com/kml/schema/kml22gx.xsd");var i={node:r},o={};t.length>1?o.Document=t:1==t.length&&(o.Placemark=t[0]);var a=sm[r.namespaceURI],s=P_(o,a);return M_(i,lm,T_,s,[e],a,this),r},e}(j_);function _m(t,e,r){return Array.isArray(t)?t:"string"==typeof t?_m(r[t],e,r):e}function mm(t){var e=y_(t,!1),r=/^\s*#?\s*([0-9A-Fa-f]{8})\s*$/.exec(e);if(r){var n=r[1];return[parseInt(n.substr(6,2),16),parseInt(n.substr(4,2),16),parseInt(n.substr(2,2),16),parseInt(n.substr(0,2),16)/255]}}function xm(t){var e=y_(t,!1),r=[];e=e.replace(/\s*,\s*/g,",");for(var n,i=/^\s*([+\-]?\d*\.?\d+(?:e[+\-]?\d+)?),([+\-]?\d*\.?\d+(?:e[+\-]?\d+)?)(?:\s+|,|$)(?:([+\-]?\d*\.?\d+(?:e[+\-]?\d+)?)(?:\s+|$))?\s*/i;n=i.exec(e);){var o=parseFloat(n[1]),a=parseFloat(n[2]),s=n[3]?parseFloat(n[3]):0;r.push(o,a,s),e=e.substr(n[0].length)}if(""===e)return r}function wm(t){var e=y_(t,!1).trim(),r=t.baseURI;return r&&"about:blank"!=r||(r=window.location.href),r?new URL(e,r).href:e}function bm(t){var e=y_(t,!1).trim().replace(/^(?!.*#)/,"#"),r=t.baseURI;return r&&"about:blank"!=r||(r=window.location.href),r?new URL(e,r).href:e}function Sm(t){return z_(t)}var Cm=R_(em,{Pair:function(t,e){var r=F_({},$m,t,e,this);if(!r)return;var n=r.key;if(n&&"normal"==n){var i=r.styleUrl;i&&(e[e.length-1]=i);var o=r.Style;o&&(e[e.length-1]=o)}}});function Em(t,e){return F_(void 0,Cm,t,e,this)}var Tm=R_(em,{Icon:S_((function(t,e){var r=F_({},km,t,e);return r||null})),color:S_(mm),heading:S_(z_),hotSpot:S_((function(t){var e,r=t.getAttribute("xunits"),n=t.getAttribute("yunits");return e="insetPixels"!==r?"insetPixels"!==n?Fe:Ie:"insetPixels"!==n?Me:Le,{x:parseFloat(t.getAttribute("x")),xunits:rm[r],y:parseFloat(t.getAttribute("y")),yunits:rm[n],origin:e}})),scale:S_(Sm)});var Pm=R_(em,{color:S_(mm),scale:S_(Sm)});var Rm=R_(em,{color:S_(mm),width:S_(z_)});var Om=R_(em,{color:S_(mm),fill:S_(G_),outline:S_(G_)});var Fm=R_(em,{coordinates:b_(xm)});function Mm(t,e){return F_(null,Fm,t,e)}var Im=R_(tm,{Track:w_(Am)});var Lm=R_(em,{when:function(t,e){var r=e[e.length-1].whens,n=y_(t,!1),i=Date.parse(n);r.push(isNaN(i)?0:i)}},R_(tm,{coord:function(t,e){var r=e[e.length-1].coordinates,n=y_(t,!1),i=/^\s*([+\-]?\d+(?:\.\d*)?(?:e[+\-]?\d*)?)\s+([+\-]?\d+(?:\.\d*)?(?:e[+\-]?\d*)?)\s+([+\-]?\d+(?:\.\d*)?(?:e[+\-]?\d*)?)\s*$/i.exec(n);if(i){var o=parseFloat(i[1]),a=parseFloat(i[2]),s=parseFloat(i[3]);r.push([o,a,s])}else r.push([])}}));function Am(t,e){var r=F_({coordinates:[],whens:[]},Lm,t,e);if(r){for(var n=[],i=r.coordinates,o=r.whens,a=0,s=Math.min(i.length,o.length);a<s;++a)3==i[a].length&&n.push(i[a][0],i[a][1],i[a][2],o[a]);return new $i(n,Ur)}}var km=R_(em,{href:S_(wm)},R_(tm,{x:S_(z_),y:S_(z_),w:S_(z_),h:S_(z_)}));var Dm=R_(em,{coordinates:b_(xm)});function jm(t,e){return F_(null,Dm,t,e)}var Gm=R_(em,{extrude:S_(G_),tessellate:S_(G_),altitudeMode:S_(N_)});function zm(t,e){var r=F_({},Gm,t,e),n=jm(t,e);if(n){var i=new $i(n,zr);return i.setProperties(r,!0),i}}function Nm(t,e){var r=F_({},Gm,t,e),n=jm(t,e);if(n){var i=new mo(n,zr,[n.length]);return i.setProperties(r,!0),i}}var Um=R_(em,{LineString:w_(zm),LinearRing:w_(Nm),MultiGeometry:w_(Bm),Point:w_(Vm),Polygon:w_(Wm)});function Bm(t,e){var r,n=F_([],Um,t,e);if(!n)return null;if(0===n.length)return new Si(n);for(var i=!0,o=n[0].getType(),a=1,s=n.length;a<s;++a)if(n[a].getType()!=o){i=!1;break}if(i){var l=void 0,u=void 0;if("Point"==o){var h=n[0];l=h.getLayout(),u=h.getFlatCoordinates();for(a=1,s=n.length;a<s;++a)ht(u,n[a].getFlatCoordinates());Km(r=new lo(u,l),n)}else"LineString"==o?Km(r=new ro(n),n):"Polygon"==o?Km(r=new Eo(n),n):"GeometryCollection"==o?r=new Si(n):_(!1,37)}else r=new Si(n);return r}function Vm(t,e){var r=F_({},Gm,t,e),n=jm(t,e);if(n){var i=new oo(n,zr);return i.setProperties(r,!0),i}}var Xm=R_(em,{innerBoundaryIs:function(t,e){var r=F_([],nx,t,e);if(r.length>0){var n=e[e.length-1];n.push.apply(n,r)}},outerBoundaryIs:function(t,e){var r=F_(void 0,ix,t,e);if(r){e[e.length-1][0]=r}}});function Wm(t,e){var r=F_({},Gm,t,e),n=F_([null],Xm,t,e);if(n&&n[0]){for(var i=n[0],o=[i.length],a=1,s=n.length;a<s;++a)ht(i,n[a]),o.push(i.length);var l=new mo(i,zr,o);return l.setProperties(r,!0),l}}var qm=R_(em,{IconStyle:function(t,n){var i=F_({},Tm,t,n);if(i){var o,a,s,l,u=n[n.length-1],h="Icon"in i?i.Icon:{},c=!("Icon"in i)||Object.keys(h).length>0,p=h.href;p?o=p:c&&(o=Z_);var f,d=Fe,g=i.hotSpot;g?(a=[g.x,g.y],s=g.xunits,l=g.yunits,d=g.origin):/^http:\/\/maps\.(?:google|gstatic)\.com\//.test(o)&&(/pushpin/.test(o)?(a=W_,s=q_,l=Y_):/arrow-reverse/.test(o)?(a=[54,42],s=q_,l=Y_):/paddle/.test(o)&&(a=[32,1],s=q_,l=Y_));var y,v=h.x,_=h.y;void 0!==v&&void 0!==_&&(f=[v,_]);var m,x=h.w,w=h.h;void 0!==x&&void 0!==w&&(y=[x,w]);var b=i.heading;void 0!==b&&(m=E(b));var S=i.scale,C=i.color;if(c){o==Z_&&(y=K_);var T=new Ar({anchor:a,anchorOrigin:d,anchorXUnits:s,anchorYUnits:l,crossOrigin:this.crossOrigin_,offset:f,offsetOrigin:Fe,rotation:m,scale:S,size:y,src:this.iconUrlFunction_(o),color:C}),P=T.getScaleArray()[0],R=T.getSize();if(null===R){var O=T.getImageState();if(O===e||O===r){var F=function(){var t=T.getImageState();if(t!==e&&t!==r){var n=T.getSize();if(n&&2==n.length){var i=gm(n);T.setScale(P*i)}T.unlistenImageChange(F)}};T.listenImageChange(F),O===e&&T.load()}}else if(2==R.length){var M=gm(R);T.setScale(P*M)}u.imageStyle=T}else u.imageStyle=H_}},LabelStyle:function(t,e){var r=F_({},Pm,t,e);if(r){var n=e[e.length-1],i=new No({fill:new Pe({color:"color"in r?r.color:X_}),scale:r.scale});n.textStyle=i}},LineStyle:function(t,e){var r=F_({},Rm,t,e);if(r){var n=e[e.length-1],i=new Fo({color:"color"in r?r.color:X_,width:"width"in r?r.width:1});n.strokeStyle=i}},PolyStyle:function(t,e){var r=F_({},Om,t,e);if(r){var n=e[e.length-1],i=new Pe({color:"color"in r?r.color:X_});n.fillStyle=i;var o=r.fill;void 0!==o&&(n.fill=o);var a=r.outline;void 0!==a&&(n.outline=a)}}});function Ym(t,e){var r=F_({},qm,t,e,this);if(!r)return null;var n,i="fillStyle"in r?r.fillStyle:um,o=r.fill;void 0===o||o||(i=null),"imageStyle"in r?r.imageStyle!=H_&&(n=r.imageStyle):n=hm;var a="textStyle"in r?r.textStyle:pm,s="strokeStyle"in r?r.strokeStyle:cm,l=r.outline;return void 0===l||l?[new Do({fill:i,image:n,stroke:s,text:a,zIndex:void 0})]:[new Do({geometry:function(t){var e=t.getGeometry(),r=e.getType();return"GeometryCollection"===r?new Si(e.getGeometriesArrayRecursive().filter((function(t){var e=t.getType();return"Polygon"!==e&&"MultiPolygon"!==e}))):"Polygon"!==r&&"MultiPolygon"!==r?e:void 0},fill:i,image:n,stroke:s,text:a,zIndex:void 0}),new Do({geometry:function(t){var e=t.getGeometry(),r=e.getType();return"GeometryCollection"===r?new Si(e.getGeometriesArrayRecursive().filter((function(t){var e=t.getType();return"Polygon"===e||"MultiPolygon"===e}))):"Polygon"===r||"MultiPolygon"===r?e:void 0},fill:i,stroke:null,zIndex:void 0})]}function Km(t,e){var r,n,i,o=e.length,a=new Array(e.length),s=new Array(e.length),l=new Array(e.length);r=!1,n=!1,i=!1;for(var u=0;u<o;++u){var h=e[u];a[u]=h.get("extrude"),s[u]=h.get("tessellate"),l[u]=h.get("altitudeMode"),r=r||void 0!==a[u],n=n||void 0!==s[u],i=i||l[u]}r&&t.set("extrude",a),n&&t.set("tessellate",s),i&&t.set("altitudeMode",l)}var Zm=R_(em,{displayName:S_(N_),value:S_(N_)});var Hm=R_(em,{Data:function(t,e){var r=t.getAttribute("name");O_(Zm,t,e);var n=e[e.length-1];r&&n.displayName?n[r]={value:n.value,displayName:n.displayName,toString:function(){return n.value}}:null!==r?n[r]=n.value:null!==n.displayName&&(n[n.displayName]=n.value),delete n.value},SchemaData:function(t,e){O_(tx,t,e)}});function Jm(t,e){O_(Hm,t,e)}function Qm(t,e){O_(am,t,e)}var $m=R_(em,{Style:S_(Ym),key:S_(N_),styleUrl:S_(bm)});var tx=R_(em,{SimpleData:function(t,e){var r=t.getAttribute("name");if(null!==r){var n=N_(t);e[e.length-1][r]=n}}});var ex=R_(em,{altitudeMode:S_(N_),minAltitude:S_(z_),maxAltitude:S_(z_),north:S_(z_),south:S_(z_),east:S_(z_),west:S_(z_)});var rx=R_(em,{minLodPixels:S_(z_),maxLodPixels:S_(z_),minFadeExtent:S_(z_),maxFadeExtent:S_(z_)});var nx=R_(em,{LinearRing:w_(Mm)});var ix=R_(em,{LinearRing:b_(Mm)});function ox(t,e){for(var r=j(e),n=[255*(4==r.length?r[3]:1),r[2],r[1],r[0]],i=0;i<4;++i){var o=Math.floor(n[i]).toString(16);n[i]=1==o.length?"0"+o:o}V_(t,n.join(""))}var ax=R_(em,{Data:C_((function(t,e,r){t.setAttribute("name",e.name);var n={node:t},i=e.value;"object"==typeof i?(null!==i&&i.displayName&&M_(n,ax,T_,[i.displayName],r,["displayName"]),null!==i&&i.value&&M_(n,ax,T_,[i.value],r,["value"])):M_(n,ax,T_,[i],r,["value"])})),value:C_((function(t,e){V_(t,e)})),displayName:C_((function(t,e){!function(t,e){t.appendChild(A_().createCDATASection(e))}(t,e)}))});var sx=R_(em,{Placemark:C_(Ix)}),lx=function(t,e,r){return g_(e[e.length-1].node.namespaceURI,"Placemark")};var ux=E_("Data");var hx=R_(em,["href"],R_(tm,["x","y","w","h"])),cx=R_(em,{href:C_(V_)},R_(tm,{x:C_(B_),y:C_(B_),w:C_(B_),h:C_(B_)})),px=function(t,e,r){return g_(tm[0],"gx:"+r)};var fx=R_(em,["scale","heading","Icon","color","hotSpot"]),dx=R_(em,{Icon:C_((function(t,e,r){var n={node:t},i=r[r.length-1].node,o=hx[i.namespaceURI],a=P_(e,o);M_(n,cx,T_,a,r,o),a=P_(e,o=hx[tm[0]]),M_(n,cx,px,a,r,o)})),color:C_(ox),heading:C_(B_),hotSpot:C_((function(t,e){t.setAttribute("x",String(e.x)),t.setAttribute("y",String(e.y)),t.setAttribute("xunits",e.xunits),t.setAttribute("yunits",e.yunits)})),scale:C_(Bx)});var gx=R_(em,["color","scale"]),yx=R_(em,{color:C_(ox),scale:C_(Bx)});var vx=R_(em,["color","width"]),_x=R_(em,{color:C_(ox),width:C_(B_)});var mx={Point:"Point",LineString:"LineString",LinearRing:"LinearRing",Polygon:"Polygon",MultiPoint:"MultiGeometry",MultiLineString:"MultiGeometry",MultiPolygon:"MultiGeometry",GeometryCollection:"MultiGeometry"},xx=function(t,e,r){if(t)return g_(e[e.length-1].node.namespaceURI,mx[t.getType()])},wx=E_("Point"),bx=E_("LineString"),Sx=E_("LinearRing"),Cx=E_("Polygon"),Ex=R_(em,{LineString:C_(kx),Point:C_(kx),Polygon:C_(Nx),GeometryCollection:C_(Tx)});function Tx(t,e,r){var n,i={node:t},o=e.getType(),a=[];"GeometryCollection"===o?(e.getGeometriesArrayRecursive().forEach((function(t){var e=t.getType();"MultiPoint"===e?a=a.concat(t.getPoints()):"MultiLineString"===e?a=a.concat(t.getLineStrings()):"MultiPolygon"===e?a=a.concat(t.getPolygons()):"Point"===e||"LineString"===e||"Polygon"===e?a.push(t):_(!1,39)})),n=xx):"MultiPoint"===o?(a=e.getPoints(),n=wx):"MultiLineString"===o?(a=e.getLineStrings(),n=bx):"MultiPolygon"===o?(a=e.getPolygons(),n=Cx):_(!1,39),M_(i,Ex,n,a,r)}var Px=R_(em,{LinearRing:C_(kx)});function Rx(t,e,r){M_({node:t},Px,Sx,[e],r)}var Ox=R_(em,{ExtendedData:C_((function(t,e,r){for(var n={node:t},i=e.names,o=e.values,a=i.length,s=0;s<a;s++)M_(n,ax,ux,[{name:i[s],value:o[s]}],r)})),MultiGeometry:C_(Tx),LineString:C_(kx),LinearRing:C_(kx),Point:C_(kx),Polygon:C_(Nx),Style:C_((function(t,e,r){var n={node:t},i={};if(e.pointStyles.length){var o=e.pointStyles[0].getText();o&&(i.LabelStyle=o);var a=e.pointStyles[0].getImage();a&&"function"==typeof a.getSrc&&(i.IconStyle=a)}if(e.lineStyles.length){(s=e.lineStyles[0].getStroke())&&(i.LineStyle=s)}if(e.polyStyles.length){var s;(s=e.polyStyles[0].getStroke())&&!i.LineStyle&&(i.LineStyle=s),i.PolyStyle=e.polyStyles[0]}var l=r[r.length-1].node,u=Vx[l.namespaceURI],h=P_(i,u);M_(n,Xx,T_,h,r,u)})),address:C_(V_),description:C_(V_),name:C_(V_),open:C_(U_),phoneNumber:C_(V_),styleUrl:C_(V_),visibility:C_(U_)}),Fx=R_(em,["name","open","visibility","address","phoneNumber","description","styleUrl","Style"]),Mx=E_("ExtendedData");function Ix(t,e,r){var n={node:t};e.getId()&&t.setAttribute("id",e.getId());var i=e.getProperties(),o={address:1,description:1,name:1,open:1,phoneNumber:1,styleUrl:1,visibility:1};o[e.getGeometryName()]=1;var a=Object.keys(i||{}).sort().filter((function(t){return!o[t]})),s=e.getStyleFunction();if(s){var l=s(e,0);if(l){var u=Array.isArray(l)?l:[l],h=u;if(e.getGeometry()&&(h=u.filter((function(t){var r=t.getGeometryFunction()(e);if(r){var n=r.getType();return"GeometryCollection"===n?r.getGeometriesArrayRecursive().filter((function(t){var e=t.getType();return"Point"===e||"MultiPoint"===e})).length:"Point"===n||"MultiPoint"===n}}))),this.writeStyles_){var c=u,p=u;e.getGeometry()&&(c=u.filter((function(t){var r=t.getGeometryFunction()(e);if(r){var n=r.getType();return"GeometryCollection"===n?r.getGeometriesArrayRecursive().filter((function(t){var e=t.getType();return"LineString"===e||"MultiLineString"===e})).length:"LineString"===n||"MultiLineString"===n}})),p=u.filter((function(t){var r=t.getGeometryFunction()(e);if(r){var n=r.getType();return"GeometryCollection"===n?r.getGeometriesArrayRecursive().filter((function(t){var e=t.getType();return"Polygon"===e||"MultiPolygon"===e})).length:"Polygon"===n||"MultiPolygon"===n}}))),i.Style={pointStyles:h,lineStyles:c,polyStyles:p}}if(h.length&&void 0===i.name){var f=h[0].getText();f&&(i.name=f.getText())}}}var d=r[r.length-1].node,g=Fx[d.namespaceURI],y=P_(i,g);if(M_(n,Ox,T_,y,r,g),a.length>0){var v=P_(i,a);M_(n,Ox,Mx,[{names:a,values:v}],r)}var _=r[0],m=e.getGeometry();m&&(m=Bo(m,!0,_)),M_(n,Ox,xx,[m],r)}var Lx=R_(em,["extrude","tessellate","altitudeMode","coordinates"]),Ax=R_(em,{extrude:C_(U_),tessellate:C_(U_),altitudeMode:C_(V_),coordinates:C_((function(t,e,r){var n,i=r[r.length-1],o=i.layout,a=i.stride;o==Gr||o==Nr?n=2:o==zr||o==Ur?n=3:_(!1,34);var s=e.length,l="";if(s>0){l+=e[0];for(var u=1;u<n;++u)l+=","+e[u];for(var h=a;h<s;h+=a){l+=" "+e[h];for(u=1;u<n;++u)l+=","+e[h+u]}}V_(t,l)}))});function kx(t,e,r){var n=e.getFlatCoordinates(),i={node:t};i.layout=e.getLayout(),i.stride=e.getStride();var o=e.getProperties();o.coordinates=n;var a=r[r.length-1].node,s=Lx[a.namespaceURI],l=P_(o,s);M_(i,Ax,T_,l,r,s)}var Dx=R_(em,["color","fill","outline"]),jx=R_(em,{outerBoundaryIs:C_(Rx),innerBoundaryIs:C_(Rx)}),Gx=E_("innerBoundaryIs"),zx=E_("outerBoundaryIs");function Nx(t,e,r){var n=e.getLinearRings(),i=n.shift(),o={node:t};M_(o,jx,Gx,n,r),M_(o,jx,zx,[i],r)}var Ux=R_(em,{color:C_(ox),fill:C_(U_),outline:C_(U_)});function Bx(t,e){B_(t,Math.round(1e6*e)/1e6)}var Vx=R_(em,["IconStyle","LabelStyle","LineStyle","PolyStyle"]),Xx=R_(em,{IconStyle:C_((function(t,e,r){var n={node:t},i={},o=e.getSrc(),a=e.getSize(),s=e.getImageSize(),l={href:o};if(a){l.w=a[0],l.h=a[1];var u=e.getAnchor(),h=e.getOrigin();if(h&&s&&0!==h[0]&&h[1]!==a[1]&&(l.x=h[0],l.y=s[1]-(h[1]+a[1])),u&&(u[0]!==a[0]/2||u[1]!==a[1]/2)){var c={x:u[0],xunits:Oe,y:a[1]-u[1],yunits:Oe};i.hotSpot=c}}i.Icon=l;var p=e.getScaleArray()[0],f=a;null===f&&(f=K_),2==f.length&&(p/=gm(f)),1!==p&&(i.scale=p);var d=e.getRotation();0!==d&&(i.heading=d);var g=e.getColor();g&&(i.color=g);var y=r[r.length-1].node,v=fx[y.namespaceURI],_=P_(i,v);M_(n,dx,T_,_,r,v)})),LabelStyle:C_((function(t,e,r){var n={node:t},i={},o=e.getFill();o&&(i.color=o.getColor());var a=e.getScale();a&&1!==a&&(i.scale=a);var s=r[r.length-1].node,l=gx[s.namespaceURI],u=P_(i,l);M_(n,yx,T_,u,r,l)})),LineStyle:C_((function(t,e,r){var n={node:t},i={color:e.getColor(),width:Number(e.getWidth())||1},o=r[r.length-1].node,a=vx[o.namespaceURI],s=P_(i,a);M_(n,_x,T_,s,r,a)})),PolyStyle:C_((function(t,e,r){var n={node:t},i=e.getFill(),o=e.getStroke(),a={color:i?i.getColor():void 0,fill:!!i&&void 0,outline:!!o&&void 0},s=r[r.length-1].node,l=Dx[s.namespaceURI],u=P_(a,l);M_(n,Ux,T_,u,r,l)}))});var Wx=vm,qx=34962,Yx=34963,Kx=35044,Zx=35048,Hx=["experimental-webgl","webgl","webkit-3d","moz-webgl"];function Jx(t,e){for(var r=gt({preserveDrawingBuffer:!0,antialias:!V},e),n=Hx.length,i=0;i<n;++i)try{var o=t.getContext(Hx[i],r);if(o)return o}catch(t){}return null}var Qx=Kx,$x=function(){function t(t,e){this.array=null,this.type=t,_(t===qx||t===Yx,62),this.usage=void 0!==e?e:Qx}return t.prototype.ofSize=function(t){this.array=new(tw(this.type))(t)},t.prototype.fromArray=function(t){var e=tw(this.type);this.array=e.from?e.from(t):new e(t)},t.prototype.fromArrayBuffer=function(t){this.array=new(tw(this.type))(t)},t.prototype.getType=function(){return this.type},t.prototype.getArray=function(){return this.array},t.prototype.getUsage=function(){return this.usage},t.prototype.getSize=function(){return this.array?this.array.length:0},t}();function tw(t){switch(t){case qx:return Float32Array;case Yx:return Uint32Array;default:return Float32Array}}var ew=$x,rw="webglcontextlost",nw="webglcontextrestored",iw=function(){function t(t){this.gl_=t.webGlContext;var e=this.gl_;this.scaleRatio_=t.scaleRatio||1,this.renderTargetTexture_=e.createTexture(),this.renderTargetTextureSize_=null,this.frameBuffer_=e.createFramebuffer();var r=e.createShader(e.VERTEX_SHADER);e.shaderSource(r,t.vertexShader||"\n precision mediump float;\n \n attribute vec2 a_position;\n varying vec2 v_texCoord;\n varying vec2 v_screenCoord;\n \n uniform vec2 u_screenSize;\n \n void main() {\n v_texCoord = a_position * 0.5 + 0.5;\n v_screenCoord = v_texCoord * u_screenSize;\n gl_Position = vec4(a_position, 0.0, 1.0);\n }\n"),e.compileShader(r);var n=e.createShader(e.FRAGMENT_SHADER);e.shaderSource(n,t.fragmentShader||"\n precision mediump float;\n \n uniform sampler2D u_image;\n uniform float u_opacity;\n \n varying vec2 v_texCoord;\n \n void main() {\n gl_FragColor = texture2D(u_image, v_texCoord) * u_opacity;\n }\n"),e.compileShader(n),this.renderTargetProgram_=e.createProgram(),e.attachShader(this.renderTargetProgram_,r),e.attachShader(this.renderTargetProgram_,n),e.linkProgram(this.renderTargetProgram_),this.renderTargetVerticesBuffer_=e.createBuffer();e.bindBuffer(e.ARRAY_BUFFER,this.renderTargetVerticesBuffer_),e.bufferData(e.ARRAY_BUFFER,new Float32Array([-1,-1,1,-1,-1,1,1,-1,1,1,-1,1]),e.STATIC_DRAW),this.renderTargetAttribLocation_=e.getAttribLocation(this.renderTargetProgram_,"a_position"),this.renderTargetUniformLocation_=e.getUniformLocation(this.renderTargetProgram_,"u_screenSize"),this.renderTargetOpacityLocation_=e.getUniformLocation(this.renderTargetProgram_,"u_opacity"),this.renderTargetTextureLocation_=e.getUniformLocation(this.renderTargetProgram_,"u_image"),this.uniforms_=[],t.uniforms&&Object.keys(t.uniforms).forEach(function(r){this.uniforms_.push({value:t.uniforms[r],location:e.getUniformLocation(this.renderTargetProgram_,r)})}.bind(this))}return t.prototype.getGL=function(){return this.gl_},t.prototype.init=function(t){var e=this.getGL(),r=[e.drawingBufferWidth*this.scaleRatio_,e.drawingBufferHeight*this.scaleRatio_];if(e.bindFramebuffer(e.FRAMEBUFFER,this.getFrameBuffer()),e.viewport(0,0,r[0],r[1]),!this.renderTargetTextureSize_||this.renderTargetTextureSize_[0]!==r[0]||this.renderTargetTextureSize_[1]!==r[1]){this.renderTargetTextureSize_=r;var n=e.RGBA,i=e.RGBA,o=e.UNSIGNED_BYTE;e.bindTexture(e.TEXTURE_2D,this.renderTargetTexture_),e.texImage2D(e.TEXTURE_2D,0,n,r[0],r[1],0,i,o,null),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MIN_FILTER,e.LINEAR),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_S,e.CLAMP_TO_EDGE),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_T,e.CLAMP_TO_EDGE),e.framebufferTexture2D(e.FRAMEBUFFER,e.COLOR_ATTACHMENT0,e.TEXTURE_2D,this.renderTargetTexture_,0)}},t.prototype.apply=function(t,e,r,n){var i=this.getGL(),o=t.size;if(i.bindFramebuffer(i.FRAMEBUFFER,e?e.getFrameBuffer():null),i.activeTexture(i.TEXTURE0),i.bindTexture(i.TEXTURE_2D,this.renderTargetTexture_),!e){var a=l(i.canvas);if(!t.renderTargets[a]){var s=i.getContextAttributes();s&&s.preserveDrawingBuffer&&(i.clearColor(0,0,0,0),i.clear(i.COLOR_BUFFER_BIT)),t.renderTargets[a]=!0}}i.enable(i.BLEND),i.blendFunc(i.ONE,i.ONE_MINUS_SRC_ALPHA),i.viewport(0,0,i.drawingBufferWidth,i.drawingBufferHeight),i.bindBuffer(i.ARRAY_BUFFER,this.renderTargetVerticesBuffer_),i.useProgram(this.renderTargetProgram_),i.enableVertexAttribArray(this.renderTargetAttribLocation_),i.vertexAttribPointer(this.renderTargetAttribLocation_,2,i.FLOAT,!1,0,0),i.uniform2f(this.renderTargetUniformLocation_,o[0],o[1]),i.uniform1i(this.renderTargetTextureLocation_,0);var u=t.layerStatesArray[t.layerIndex].opacity;i.uniform1f(this.renderTargetOpacityLocation_,u),this.applyUniforms(t),r&&r(i,t),i.drawArrays(i.TRIANGLES,0,6),n&&n(i,t)},t.prototype.getFrameBuffer=function(){return this.frameBuffer_},t.prototype.applyUniforms=function(t){var e,r=this.getGL(),n=1;this.uniforms_.forEach((function(i){if((e="function"==typeof i.value?i.value(t):i.value)instanceof HTMLCanvasElement||e instanceof ImageData)i.texture||(i.texture=r.createTexture()),r.activeTexture(r["TEXTURE".concat(n)]),r.bindTexture(r.TEXTURE_2D,i.texture),r.texParameteri(r.TEXTURE_2D,r.TEXTURE_MIN_FILTER,r.LINEAR),r.texParameteri(r.TEXTURE_2D,r.TEXTURE_WRAP_S,r.CLAMP_TO_EDGE),r.texParameteri(r.TEXTURE_2D,r.TEXTURE_WRAP_T,r.CLAMP_TO_EDGE),e instanceof ImageData?r.texImage2D(r.TEXTURE_2D,0,r.RGBA,r.RGBA,e.width,e.height,0,r.UNSIGNED_BYTE,new Uint8Array(e.data)):r.texImage2D(r.TEXTURE_2D,0,r.RGBA,r.RGBA,r.UNSIGNED_BYTE,e),r.uniform1i(i.location,n++);else if(Array.isArray(e))switch(e.length){case 2:return void r.uniform2f(i.location,e[0],e[1]);case 3:return void r.uniform3f(i.location,e[0],e[1],e[2]);case 4:return void r.uniform4f(i.location,e[0],e[1],e[2],e[3]);default:return}else"number"==typeof e&&r.uniform1f(i.location,e)}))},t}(),ow=iw;function aw(t,e){return t[0]=e[0],t[1]=e[1],t[4]=e[2],t[5]=e[3],t[12]=e[4],t[13]=e[5],t}var sw=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)}}(),lw="u_projectionMatrix",uw="u_offsetScaleMatrix",hw="u_offsetRotateMatrix",cw="u_time",pw="u_zoom",fw="u_resolution",dw={UNSIGNED_BYTE:5121,UNSIGNED_SHORT:5123,UNSIGNED_INT:5125,FLOAT:5126},gw={};function yw(t){return"shared/"+t}var vw=0;var _w=function(t){function e(e){var r,n=t.call(this)||this,i=e||{};n.boundHandleWebGLContextLost_=n.handleWebGLContextLost.bind(n),n.boundHandleWebGLContextRestored_=n.handleWebGLContextRestored.bind(n),n.canvasCacheKey_=i.canvasCacheKey?yw(i.canvasCacheKey):(r="unique/"+vw,vw+=1,r),n.canvas_=function(t){var e=gw[t];if(!e){var r=document.createElement("canvas");r.style.position="absolute",r.style.left="0",e={users:0,canvas:r},gw[t]=e}return e.users+=1,e.canvas}(n.canvasCacheKey_),n.gl_=Jx(n.canvas_),n.bufferCache_={},n.extensionCache_={},n.currentProgram_=null,n.canvas_.addEventListener(rw,n.boundHandleWebGLContextLost_),n.canvas_.addEventListener(nw,n.boundHandleWebGLContextRestored_),n.offsetRotateMatrix_=[1,0,0,1,0,0],n.offsetScaleMatrix_=[1,0,0,1,0,0],n.tmpMat4_=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],n.uniformLocations_={},n.attribLocations_={},n.uniforms_=[],i.uniforms&&n.setUniforms(i.uniforms);var o=n.getGL();return n.postProcessPasses_=i.postProcesses?i.postProcesses.map((function(t){return new ow({webGlContext:o,scaleRatio:t.scaleRatio,vertexShader:t.vertexShader,fragmentShader:t.fragmentShader,uniforms:t.uniforms})})):[new ow({webGlContext:o})],n.shaderCompileErrors_=null,n.startTime_=Date.now(),n}return sw(e,t),e.prototype.setUniforms=function(t){for(var e in this.uniforms_=[],t)this.uniforms_.push({name:e,value:t[e]});this.uniformLocations_={}},e.prototype.canvasCacheKeyMatches=function(t){return this.canvasCacheKey_===yw(t)},e.prototype.getExtension=function(t){if(t in this.extensionCache_)return this.extensionCache_[t];var e=this.gl_.getExtension(t);return this.extensionCache_[t]=e,e},e.prototype.bindBuffer=function(t){var e=this.getGL(),r=l(t),n=this.bufferCache_[r];n||(n={buffer:t,webGlBuffer:e.createBuffer()},this.bufferCache_[r]=n);e.bindBuffer(t.getType(),n.webGlBuffer)},e.prototype.flushBufferData=function(t){var e=this.getGL();this.bindBuffer(t),e.bufferData(t.getType(),t.getArray(),t.getUsage())},e.prototype.deleteBuffer=function(t){var e=this.getGL(),r=l(t),n=this.bufferCache_[r];n&&!e.isContextLost()&&e.deleteBuffer(n.webGlBuffer),delete this.bufferCache_[r]},e.prototype.disposeInternal=function(){this.canvas_.removeEventListener(rw,this.boundHandleWebGLContextLost_),this.canvas_.removeEventListener(nw,this.boundHandleWebGLContextRestored_),function(t){var e=gw[t];if(e&&(e.users-=1,!(e.users>0))){var r=Jx(e.canvas).getExtension("WEBGL_lose_context");r&&r.loseContext(),delete gw[t]}}(this.canvasCacheKey_),delete this.gl_,delete this.canvas_},e.prototype.prepareDraw=function(t,e){var r=this.getGL(),n=this.getCanvas(),i=t.size,o=t.pixelRatio;n.width=i[0]*o,n.height=i[1]*o,n.style.width=i[0]+"px",n.style.height=i[1]+"px",r.useProgram(this.currentProgram_);for(var a=this.postProcessPasses_.length-1;a>=0;a--)this.postProcessPasses_[a].init(t);r.bindTexture(r.TEXTURE_2D,null),r.clearColor(0,0,0,0),r.clear(r.COLOR_BUFFER_BIT),r.enable(r.BLEND),r.blendFunc(r.ONE,e?r.ZERO:r.ONE_MINUS_SRC_ALPHA),r.useProgram(this.currentProgram_),this.applyFrameState(t),this.applyUniforms(t)},e.prototype.prepareDrawToRenderTarget=function(t,e,r){var n=this.getGL(),i=e.getSize();n.bindFramebuffer(n.FRAMEBUFFER,e.getFramebuffer()),n.viewport(0,0,i[0],i[1]),n.bindTexture(n.TEXTURE_2D,e.getTexture()),n.clearColor(0,0,0,0),n.clear(n.COLOR_BUFFER_BIT),n.enable(n.BLEND),n.blendFunc(n.ONE,r?n.ZERO:n.ONE_MINUS_SRC_ALPHA),n.useProgram(this.currentProgram_),this.applyFrameState(t),this.applyUniforms(t)},e.prototype.drawElements=function(t,e){var r=this.getGL();this.getExtension("OES_element_index_uint");var n=r.UNSIGNED_INT,i=e-t,o=4*t;r.drawElements(r.TRIANGLES,i,n,o)},e.prototype.finalizeDraw=function(t,e,r){for(var n=0,i=this.postProcessPasses_.length;n<i;n++)n===i-1?this.postProcessPasses_[n].apply(t,null,e,r):this.postProcessPasses_[n].apply(t,this.postProcessPasses_[n+1])},e.prototype.getCanvas=function(){return this.canvas_},e.prototype.getGL=function(){return this.gl_},e.prototype.applyFrameState=function(t){var e=t.size,r=t.viewState.rotation,n=Yr(this.offsetScaleMatrix_);Qr(n,2/e[0],2/e[1]);var i=Yr(this.offsetRotateMatrix_);0!==r&&Jr(i,-r),this.setUniformMatrixValue(uw,aw(this.tmpMat4_,n)),this.setUniformMatrixValue(hw,aw(this.tmpMat4_,i)),this.setUniformFloatValue(cw,.001*(Date.now()-this.startTime_)),this.setUniformFloatValue(pw,t.viewState.zoom),this.setUniformFloatValue(fw,t.viewState.resolution)},e.prototype.applyUniforms=function(t){var e,r=this.getGL(),n=0;this.uniforms_.forEach(function(i){if((e="function"==typeof i.value?i.value(t):i.value)instanceof HTMLCanvasElement||e instanceof HTMLImageElement||e instanceof ImageData)i.texture||(i.prevValue=void 0,i.texture=r.createTexture()),r.activeTexture(r["TEXTURE".concat(n)]),r.bindTexture(r.TEXTURE_2D,i.texture),r.texParameteri(r.TEXTURE_2D,r.TEXTURE_MIN_FILTER,r.LINEAR),r.texParameteri(r.TEXTURE_2D,r.TEXTURE_WRAP_S,r.CLAMP_TO_EDGE),r.texParameteri(r.TEXTURE_2D,r.TEXTURE_WRAP_T,r.CLAMP_TO_EDGE),(!(e instanceof HTMLImageElement)||e.complete)&&i.prevValue!==e&&(i.prevValue=e,r.texImage2D(r.TEXTURE_2D,0,r.RGBA,r.RGBA,r.UNSIGNED_BYTE,e)),r.uniform1i(this.getUniformLocation(i.name),n++);else if(Array.isArray(e)&&6===e.length)this.setUniformMatrixValue(i.name,aw(this.tmpMat4_,e));else if(Array.isArray(e)&&e.length<=4)switch(e.length){case 2:return void r.uniform2f(this.getUniformLocation(i.name),e[0],e[1]);case 3:return void r.uniform3f(this.getUniformLocation(i.name),e[0],e[1],e[2]);case 4:return void r.uniform4f(this.getUniformLocation(i.name),e[0],e[1],e[2],e[3]);default:return}else"number"==typeof e&&r.uniform1f(this.getUniformLocation(i.name),e)}.bind(this))},e.prototype.useProgram=function(t){return t!=this.currentProgram_&&(this.getGL().useProgram(t),this.currentProgram_=t,this.uniformLocations_={},this.attribLocations_={},!0)},e.prototype.compileShader=function(t,e){var r=this.getGL(),n=r.createShader(e);return r.shaderSource(n,t),r.compileShader(n),n},e.prototype.getProgram=function(t,e){var r=this.getGL(),n=this.compileShader(t,r.FRAGMENT_SHADER),i=this.compileShader(e,r.VERTEX_SHADER),o=r.createProgram();if(r.attachShader(o,n),r.attachShader(o,i),r.linkProgram(o),!r.getShaderParameter(n,r.COMPILE_STATUS)){var a="Fragment shader compliation failed: ".concat(r.getShaderInfoLog(n));throw new Error(a)}if(r.deleteShader(n),!r.getShaderParameter(i,r.COMPILE_STATUS)){a="Vertex shader compilation failed: ".concat(r.getShaderInfoLog(i));throw new Error(a)}if(r.deleteShader(i),!r.getProgramParameter(o,r.LINK_STATUS)){a="GL program linking failed: ".concat(r.getShaderInfoLog(i));throw new Error(a)}return o},e.prototype.getUniformLocation=function(t){return void 0===this.uniformLocations_[t]&&(this.uniformLocations_[t]=this.getGL().getUniformLocation(this.currentProgram_,t)),this.uniformLocations_[t]},e.prototype.getAttributeLocation=function(t){return void 0===this.attribLocations_[t]&&(this.attribLocations_[t]=this.getGL().getAttribLocation(this.currentProgram_,t)),this.attribLocations_[t]},e.prototype.makeProjectionTransform=function(t,e){var r=t.size,n=t.viewState.rotation,i=t.viewState.resolution,o=t.viewState.center;return Yr(e),tn(e,0,0,2/(i*r[0]),2/(i*r[1]),-n,-o[0],-o[1]),e},e.prototype.setUniformFloatValue=function(t,e){this.getGL().uniform1f(this.getUniformLocation(t),e)},e.prototype.setUniformFloatVec4=function(t,e){this.getGL().uniform4fv(this.getUniformLocation(t),e)},e.prototype.setUniformMatrixValue=function(t,e){this.getGL().uniformMatrix4fv(this.getUniformLocation(t),!1,e)},e.prototype.enableAttributeArray_=function(t,e,r,n,i){var o=this.getAttributeLocation(t);o<0||(this.getGL().enableVertexAttribArray(o),this.getGL().vertexAttribPointer(o,e,r,!1,n,i))},e.prototype.enableAttributes=function(t){for(var e=function(t){for(var e=0,r=0;r<t.length;r++){var n=t[r];e+=n.size*mw(n.type)}return e}(t),r=0,n=0;n<t.length;n++){var i=t[n];this.enableAttributeArray_(i.name,i.size,i.type||5126,e,r),r+=i.size*mw(i.type)}},e.prototype.handleWebGLContextLost=function(){yt(this.bufferCache_),this.currentProgram_=null},e.prototype.handleWebGLContextRestored=function(){},e.prototype.createTexture=function(t,e,r){var n=this.getGL(),i=r||n.createTexture(),o=n.RGBA,a=n.RGBA,s=n.UNSIGNED_BYTE;return n.bindTexture(n.TEXTURE_2D,i),e?n.texImage2D(n.TEXTURE_2D,0,o,a,s,e):n.texImage2D(n.TEXTURE_2D,0,o,t[0],t[1],0,a,s,null),n.texParameteri(n.TEXTURE_2D,n.TEXTURE_MIN_FILTER,n.LINEAR),n.texParameteri(n.TEXTURE_2D,n.TEXTURE_WRAP_S,n.CLAMP_TO_EDGE),n.texParameteri(n.TEXTURE_2D,n.TEXTURE_WRAP_T,n.CLAMP_TO_EDGE),i},e}(ot);function mw(t){switch(t){case dw.UNSIGNED_BYTE:return Uint8Array.BYTES_PER_ELEMENT;case dw.UNSIGNED_SHORT:return Uint16Array.BYTES_PER_ELEMENT;case dw.UNSIGNED_INT:return Uint32Array.BYTES_PER_ELEMENT;case dw.FLOAT:default:return Float32Array.BYTES_PER_ELEMENT}}var xw=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)}}(),ww="GENERATE_BUFFERS",bw=function(t){function e(e,r){var n=t.call(this,e)||this,i=r||{};return n.inversePixelTransform_=[1,0,0,1,0,0],n.pixelContext_=null,n.postProcesses_=i.postProcesses,n.uniforms_=i.uniforms,n.helper,e.addChangeListener(Da,n.removeHelper.bind(n)),n.dispatchPreComposeEvent=n.dispatchPreComposeEvent.bind(n),n.dispatchPostComposeEvent=n.dispatchPostComposeEvent.bind(n),n}return xw(e,t),e.prototype.dispatchPreComposeEvent=function(t,e){var r=this.getLayer();if(r.hasListener(Ua)){var n=new $a(Ua,void 0,e,t);r.dispatchEvent(n)}},e.prototype.dispatchPostComposeEvent=function(t,e){var r=this.getLayer();if(r.hasListener(Ba)){var n=new $a(Ba,void 0,e,t);r.dispatchEvent(n)}},e.prototype.reset=function(t){this.uniforms_=t.uniforms,this.helper&&this.helper.setUniforms(this.uniforms_)},e.prototype.removeHelper=function(){this.helper&&(this.helper.dispose(),delete this.helper)},e.prototype.prepareFrame=function(t){if(this.getLayer().getRenderSource()){for(var r=!0,n=-1,i=void 0,o=0,a=t.layerStatesArray.length;o<a;o++){var s=t.layerStatesArray[o].layer,l=s.getRenderer();if(l instanceof e){var u=s.getClassName();if((r||u!==i)&&(n+=1,r=!1),i=u,l===this)break}else r=!0}var h="map/"+t.mapId+"/group/"+n;this.helper&&this.helper.canvasCacheKeyMatches(h)||(this.removeHelper(),this.helper=new _w({postProcesses:this.postProcesses_,uniforms:this.uniforms_,canvasCacheKey:h}),i&&(this.helper.getCanvas().className=i),this.afterHelperCreated())}return this.prepareFrameInternal(t)},e.prototype.afterHelperCreated=function(){},e.prototype.prepareFrameInternal=function(t){return!0},e.prototype.disposeInternal=function(){this.removeHelper(),t.prototype.disposeInternal.call(this)},e.prototype.dispatchRenderEvent_=function(t,e,r){var n=this.getLayer();if(n.hasListener(t)){tn(this.inversePixelTransform_,0,0,r.pixelRatio,-r.pixelRatio,0,0,-r.size[1]);var i=new $a(t,this.inversePixelTransform_,r,e);n.dispatchEvent(i)}},e.prototype.preRender=function(t,e){this.dispatchRenderEvent_(za,t,e)},e.prototype.postRender=function(t,e){this.dispatchRenderEvent_(Na,t,e)},e.prototype.getDataAtPixel=function(t,e,r){var n=Hr([e.pixelRatio,0,0,e.pixelRatio,0,0],t.slice()),i=this.helper.getGL();if(!i)return null;var o=this.getLayer().getExtent();if(o&&!Ze(o,Hr(e.pixelToCoordinateTransform,t.slice())))return null;var a=i.getContextAttributes();if(!a||!a.preserveDrawingBuffer)return new Uint8Array;var s,l=Math.round(n[0]),u=Math.round(n[1]),h=this.pixelContext_;if(!h){var c=document.createElement("canvas");c.width=1,c.height=1,h=c.getContext("2d"),this.pixelContext_=h}h.clearRect(0,0,1,1);try{h.drawImage(i.canvas,l,u,1,1,0,0,1,1),s=h.getImageData(0,0,1,1).data}catch(t){return s}return 0===s[3]?null:s},e}(Hh);function Sw(t,e){var r=e||[],n=256,i=255;return r[0]=Math.floor(t/n/n/n)/i,r[1]=Math.floor(t/n/n)%n/i,r[2]=Math.floor(t/n)%n/i,r[3]=t%n/i,r}var Cw=bw,Ew=new Uint8Array(4),Tw=function(){function t(t,e){this.helper_=t;var r=t.getGL();this.texture_=r.createTexture(),this.framebuffer_=r.createFramebuffer(),this.size_=e||[1,1],this.data_=new Uint8Array(0),this.dataCacheDirty_=!0,this.updateSize_()}return t.prototype.setSize=function(t){ct(t,this.size_)||(this.size_[0]=t[0],this.size_[1]=t[1],this.updateSize_())},t.prototype.getSize=function(){return this.size_},t.prototype.clearCachedData=function(){this.dataCacheDirty_=!0},t.prototype.readAll=function(){if(this.dataCacheDirty_){var t=this.size_,e=this.helper_.getGL();e.bindFramebuffer(e.FRAMEBUFFER,this.framebuffer_),e.readPixels(0,0,t[0],t[1],e.RGBA,e.UNSIGNED_BYTE,this.data_),this.dataCacheDirty_=!1}return this.data_},t.prototype.readPixel=function(t,e){if(t<0||e<0||t>this.size_[0]||e>=this.size_[1])return Ew[0]=0,Ew[1]=0,Ew[2]=0,Ew[3]=0,Ew;this.readAll();var r=Math.floor(t)+(this.size_[1]-Math.floor(e)-1)*this.size_[0];return Ew[0]=this.data_[4*r],Ew[1]=this.data_[4*r+1],Ew[2]=this.data_[4*r+2],Ew[3]=this.data_[4*r+3],Ew},t.prototype.getTexture=function(){return this.texture_},t.prototype.getFramebuffer=function(){return this.framebuffer_},t.prototype.updateSize_=function(){var t=this.size_,e=this.helper_.getGL();this.texture_=this.helper_.createTexture(t,null,this.texture_),e.bindFramebuffer(e.FRAMEBUFFER,this.framebuffer_),e.viewport(0,0,t[0],t[1]),e.framebufferTexture2D(e.FRAMEBUFFER,e.COLOR_ATTACHMENT0,e.TEXTURE_2D,this.texture_,0),this.data_=new Uint8Array(t[0]*t[1]*4)},t}();var Pw=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)}}(),Rw=function(t){function e(e,r){var n=this,i=r.uniforms||{},o=[1,0,0,1,0,0];i[lw]=o,(n=t.call(this,e,{uniforms:i,postProcesses:r.postProcesses})||this).ready=!1,n.sourceRevision_=-1,n.verticesBuffer_=new ew(qx,Zx),n.hitVerticesBuffer_=new ew(qx,Zx),n.indicesBuffer_=new ew(Yx,Zx),n.vertexShader_=r.vertexShader,n.fragmentShader_=r.fragmentShader,n.program_,n.hitDetectionEnabled_=!(!r.hitFragmentShader||!r.hitVertexShader),n.hitVertexShader_=r.hitVertexShader,n.hitFragmentShader_=r.hitFragmentShader,n.hitProgram_;var a=r.attributes?r.attributes.map((function(t){return{name:"a_"+t.name,size:1,type:dw.FLOAT}})):[];n.attributes=[{name:"a_position",size:2,type:dw.FLOAT},{name:"a_index",size:1,type:dw.FLOAT}].concat(a),n.hitDetectionAttributes=[{name:"a_position",size:2,type:dw.FLOAT},{name:"a_index",size:1,type:dw.FLOAT},{name:"a_hitColor",size:4,type:dw.FLOAT},{name:"a_featureUid",size:1,type:dw.FLOAT}].concat(a),n.customAttributes=r.attributes?r.attributes:[],n.previousExtent_=[1/0,1/0,-1/0,-1/0],n.currentTransform_=o,n.renderTransform_=[1,0,0,1,0,0],n.invertRenderTransform_=[1,0,0,1,0,0],n.renderInstructions_=new Float32Array(0),n.hitRenderInstructions_=new Float32Array(0),n.hitRenderTarget_,n.generateBuffersRun_=0,n.worker_=function(){var t='const e="function"==typeof Object.assign?Object.assign:function(e,n){if(null==e)throw new TypeError("Cannot convert undefined or null to object");const t=Object(e);for(let e=1,n=arguments.length;e<n;++e){const n=arguments[e];if(null!=n)for(const e in n)n.hasOwnProperty(e)&&(t[e]=n[e])}return t},n="undefined"!=typeof navigator&&void 0!==navigator.userAgent?navigator.userAgent.toLowerCase():"";n.indexOf("firefox");-1!==n.indexOf("safari")&&-1==n.indexOf("chrom")&&(n.indexOf("version/15.4")>=0||n.match(/cpu (os|iphone os) 15_4 like mac os x/)),-1!==n.indexOf("webkit")&&n.indexOf("edge"),n.indexOf("macintosh"),"undefined"!=typeof WorkerGlobalScope&&"undefined"!=typeof OffscreenCanvas&&(self,WorkerGlobalScope),function(){let e=!1;try{const n=Object.defineProperty({},"passive",{get:function(){e=!0}});window.addEventListener("_",null,n),window.removeEventListener("_",null,n)}catch(e){}}(),new Array(6);const t="GENERATE_BUFFERS",o=[],r={vertexPosition:0,indexPosition:0};function i(e,n,t,o,r){e[n+0]=t,e[n+1]=o,e[n+2]=r}function s(e,n,t,s,f,c){const l=3+f,a=e[n+0],u=e[n+1],d=o;d.length=f;for(let t=0;t<d.length;t++)d[t]=e[n+2+t];let g=c?c.vertexPosition:0,x=c?c.indexPosition:0;const h=g/l;return i(t,g,a,u,0),d.length&&t.set(d,g+3),g+=l,i(t,g,a,u,1),d.length&&t.set(d,g+3),g+=l,i(t,g,a,u,2),d.length&&t.set(d,g+3),g+=l,i(t,g,a,u,3),d.length&&t.set(d,g+3),g+=l,s[x++]=h,s[x++]=h+1,s[x++]=h+3,s[x++]=h+1,s[x++]=h+2,s[x++]=h+3,r.vertexPosition=g,r.indexPosition=x,r}const f=self;f.onmessage=n=>{const o=n.data;if(o.type===t){const n=3,t=2,r=o.customAttributesCount,i=t+r,c=new Float32Array(o.renderInstructions),l=c.length/i,a=4*l*(r+n),u=new Uint32Array(6*l),d=new Float32Array(a);let g;for(let e=0;e<c.length;e+=i)g=s(c,e,d,u,r,g);const x=e({vertexBuffer:d.buffer,indexBuffer:u.buffer,renderInstructions:c.buffer},o);f.postMessage(x,[d.buffer,u.buffer,c.buffer])}};';return new Worker("undefined"==typeof Blob?"data:application/javascript;base64,"+Buffer.from(t,"binary").toString("base64"):URL.createObjectURL(new Blob([t],{type:"application/javascript"})))}(),n.worker_.addEventListener("message",function(t){var e=t.data;if(e.type===ww){var r=e.projectionTransform;e.hitDetection?(this.hitVerticesBuffer_.fromArrayBuffer(e.vertexBuffer),this.helper.flushBufferData(this.hitVerticesBuffer_)):(this.verticesBuffer_.fromArrayBuffer(e.vertexBuffer),this.helper.flushBufferData(this.verticesBuffer_)),this.indicesBuffer_.fromArrayBuffer(e.indexBuffer),this.helper.flushBufferData(this.indicesBuffer_),this.renderTransform_=r,en(this.invertRenderTransform_,this.renderTransform_),e.hitDetection?this.hitRenderInstructions_=new Float32Array(t.data.renderInstructions):(this.renderInstructions_=new Float32Array(t.data.renderInstructions),e.generateBuffersRun===this.generateBuffersRun_&&(this.ready=!0)),this.getLayer().changed()}}.bind(n)),n.featureCache_={},n.featureCount_=0;var s=n.getLayer().getSource();return n.sourceListenKeys_=[kt(s,zc,n.handleSourceFeatureAdded_,n),kt(s,Nc,n.handleSourceFeatureChanged_,n),kt(s,Bc,n.handleSourceFeatureDelete_,n),kt(s,Uc,n.handleSourceFeatureClear_,n)],s.forEachFeature(function(t){this.featureCache_[l(t)]={feature:t,properties:t.getProperties(),geometry:t.getGeometry()},this.featureCount_++}.bind(n)),n}return Pw(e,t),e.prototype.afterHelperCreated=function(){this.program_=this.helper.getProgram(this.fragmentShader_,this.vertexShader_),this.hitDetectionEnabled_&&(this.hitProgram_=this.helper.getProgram(this.hitFragmentShader_,this.hitVertexShader_),this.hitRenderTarget_=new Tw(this.helper))},e.prototype.handleSourceFeatureAdded_=function(t){var e=t.feature;this.featureCache_[l(e)]={feature:e,properties:e.getProperties(),geometry:e.getGeometry()},this.featureCount_++},e.prototype.handleSourceFeatureChanged_=function(t){var e=t.feature;this.featureCache_[l(e)]={feature:e,properties:e.getProperties(),geometry:e.getGeometry()}},e.prototype.handleSourceFeatureDelete_=function(t){var e=t.feature;delete this.featureCache_[l(e)],this.featureCount_--},e.prototype.handleSourceFeatureClear_=function(){this.featureCache_={},this.featureCount_=0},e.prototype.renderFrame=function(t){var e=this.helper.getGL();this.preRender(e,t);var r=t.viewState.projection,n=this.getLayer().getSource().getWrapX()&&r.canWrapX(),i=r.getExtent(),o=t.extent,a=n?wr(i):null,s=n?Math.ceil((o[2]-i[2])/a)+1:1,l=n?Math.floor((o[0]-i[0])/a):0,u=l,h=this.indicesBuffer_.getSize();do{this.helper.makeProjectionTransform(t,this.currentTransform_),$r(this.currentTransform_,u*a,0),Kr(this.currentTransform_,this.invertRenderTransform_),this.helper.applyUniforms(t),this.helper.drawElements(0,h)}while(++u<s);this.helper.finalizeDraw(t,this.dispatchPreComposeEvent,this.dispatchPostComposeEvent);var c=this.helper.getCanvas();return this.hitDetectionEnabled_&&(this.renderHitDetection(t,l,s,a),this.hitRenderTarget_.clearCachedData()),this.postRender(e,t),c},e.prototype.prepareFrameInternal=function(t){var e=this.getLayer(),r=e.getSource(),n=t.viewState,i=!t.viewHints[Bs]&&!t.viewHints[Vs],o=!ir(this.previousExtent_,t.extent),a=this.sourceRevision_<r.getRevision();if(a&&(this.sourceRevision_=r.getRevision()),i&&(o||a)){var s=n.projection,l=n.resolution,u=e instanceof bh?e.getRenderBuffer():0,h=qe(t.extent,u*l);r.loadFeatures(h,l,s),this.rebuildBuffers_(t),this.previousExtent_=t.extent.slice()}return this.helper.useProgram(this.program_),this.helper.prepareDraw(t),this.helper.bindBuffer(this.verticesBuffer_),this.helper.bindBuffer(this.indicesBuffer_),this.helper.enableAttributes(this.attributes),!0},e.prototype.rebuildBuffers_=function(t){var e=[1,0,0,1,0,0];this.helper.makeProjectionTransform(t,e);var r,n,i=(2+this.customAttributes.length)*this.featureCount_;if(this.renderInstructions_&&this.renderInstructions_.length===i||(this.renderInstructions_=new Float32Array(i)),this.hitDetectionEnabled_){var o=(7+this.customAttributes.length)*this.featureCount_;this.hitRenderInstructions_&&this.hitRenderInstructions_.length===o||(this.hitRenderInstructions_=new Float32Array(o))}var a,s=[],l=[],u=0,h=0;for(var c in this.featureCache_)if((n=(r=this.featureCache_[c]).geometry)&&"Point"===n.getType()){s[0]=n.getFlatCoordinates()[0],s[1]=n.getFlatCoordinates()[1],Hr(e,s),a=Sw(h+6,l),this.renderInstructions_[u++]=s[0],this.renderInstructions_[u++]=s[1],this.hitDetectionEnabled_&&(this.hitRenderInstructions_[h++]=s[0],this.hitRenderInstructions_[h++]=s[1],this.hitRenderInstructions_[h++]=a[0],this.hitRenderInstructions_[h++]=a[1],this.hitRenderInstructions_[h++]=a[2],this.hitRenderInstructions_[h++]=a[3],this.hitRenderInstructions_[h++]=Number(c));for(var p=void 0,f=0;f<this.customAttributes.length;f++)p=this.customAttributes[f].callback(r.feature,r.properties),this.renderInstructions_[u++]=p,this.hitDetectionEnabled_&&(this.hitRenderInstructions_[h++]=p)}var d={type:ww,renderInstructions:this.renderInstructions_.buffer,customAttributesCount:this.customAttributes.length};if(d.projectionTransform=e,d.generateBuffersRun=++this.generateBuffersRun_,this.ready=!1,this.worker_.postMessage(d,[this.renderInstructions_.buffer]),this.renderInstructions_=null,this.hitDetectionEnabled_){var g={type:ww,renderInstructions:this.hitRenderInstructions_.buffer,customAttributesCount:5+this.customAttributes.length};g.projectionTransform=e,g.hitDetection=!0,this.worker_.postMessage(g,[this.hitRenderInstructions_.buffer]),this.hitRenderInstructions_=null}},e.prototype.forEachFeatureAtCoordinate=function(t,e,r,n,i){if(_(this.hitDetectionEnabled_,66),this.hitRenderInstructions_){var o=Hr(e.coordinateToPixelTransform,t.slice()),a=this.hitRenderTarget_.readPixel(o[0]/2,o[1]/2),s=function(t){var e=0,r=256,n=255;return e+=Math.round(t[0]*r*r*r*n),e+=Math.round(t[1]*r*r*n),e+=Math.round(t[2]*r*n),e+Math.round(t[3]*n)}([a[0]/255,a[1]/255,a[2]/255,a[3]/255]),l=this.hitRenderInstructions_[s],u=Math.floor(l).toString(),h=this.getLayer().getSource().getFeatureByUid(u);return h?n(h,this.getLayer(),null):void 0}},e.prototype.renderHitDetection=function(t,e,r,n){if(this.hitVerticesBuffer_.getSize()){var i=e;this.hitRenderTarget_.setSize([Math.floor(t.size[0]/2),Math.floor(t.size[1]/2)]),this.helper.useProgram(this.hitProgram_),this.helper.prepareDrawToRenderTarget(t,this.hitRenderTarget_,!0),this.helper.bindBuffer(this.hitVerticesBuffer_),this.helper.bindBuffer(this.indicesBuffer_),this.helper.enableAttributes(this.hitDetectionAttributes);do{this.helper.makeProjectionTransform(t,this.currentTransform_),$r(this.currentTransform_,i*n,0),Kr(this.currentTransform_,this.invertRenderTransform_),this.helper.applyUniforms(t);var o=this.indicesBuffer_.getSize();this.helper.drawElements(0,o)}while(++i<r)}},e.prototype.disposeInternal=function(){this.worker_.terminate(),this.layer_=null,this.sourceListenKeys_.forEach((function(t){jt(t)})),this.sourceListenKeys_=null,t.prototype.disposeInternal.call(this)},e}(Cw),Ow=Rw,Fw=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)}}(),Mw="blur",Iw="gradient",Lw="radius",Aw=["#00f","#0ff","#0f0","#ff0","#f00"];var kw=function(t){function e(e){var r=this,n=e||{},i=gt({},n);delete i.gradient,delete i.radius,delete i.blur,delete i.weight,(r=t.call(this,i)||this).gradient_=null,r.addChangeListener(Iw,r.handleGradientChanged_),r.setGradient(n.gradient?n.gradient:Aw),r.setBlur(void 0!==n.blur?n.blur:15),r.setRadius(void 0!==n.radius?n.radius:8);var o=n.weight?n.weight:"weight";return r.weightFunction_="string"==typeof o?function(t){return t.get(o)}:o,r.setRenderOrder(null),r}return Fw(e,t),e.prototype.getBlur=function(){return this.get(Mw)},e.prototype.getGradient=function(){return this.get(Iw)},e.prototype.getRadius=function(){return this.get(Lw)},e.prototype.handleGradientChanged_=function(){this.gradient_=function(t){for(var e=1,r=256,n=H(e,r),i=n.createLinearGradient(0,0,e,r),o=1/(t.length-1),a=0,s=t.length;a<s;++a)i.addColorStop(a*o,t[a]);return n.fillStyle=i,n.fillRect(0,0,e,r),n.canvas}(this.getGradient())},e.prototype.setBlur=function(t){this.set(Mw,t)},e.prototype.setGradient=function(t){this.set(Iw,t)},e.prototype.setRadius=function(t){this.set(Lw,t)},e.prototype.createRenderer=function(){return new Ow(this,{className:this.getClassName(),attributes:[{name:"weight",callback:function(t){var e=this.weightFunction_(t);return void 0!==e?m(e,0,1):1}.bind(this)}],vertexShader:"\n precision mediump float;\n uniform mat4 u_projectionMatrix;\n uniform mat4 u_offsetScaleMatrix;\n uniform float u_size;\n attribute vec2 a_position;\n attribute float a_index;\n attribute float a_weight;\n\n varying vec2 v_texCoord;\n varying float v_weight;\n\n void main(void) {\n mat4 offsetMatrix = u_offsetScaleMatrix;\n float offsetX = a_index == 0.0 || a_index == 3.0 ? -u_size / 2.0 : u_size / 2.0;\n float offsetY = a_index == 0.0 || a_index == 1.0 ? -u_size / 2.0 : u_size / 2.0;\n vec4 offsets = offsetMatrix * vec4(offsetX, offsetY, 0.0, 0.0);\n gl_Position = u_projectionMatrix * vec4(a_position, 0.0, 1.0) + offsets;\n float u = a_index == 0.0 || a_index == 3.0 ? 0.0 : 1.0;\n float v = a_index == 0.0 || a_index == 1.0 ? 0.0 : 1.0;\n v_texCoord = vec2(u, v);\n v_weight = a_weight;\n }",fragmentShader:"\n precision mediump float;\n uniform float u_blurSlope;\n\n varying vec2 v_texCoord;\n varying float v_weight;\n\n void main(void) {\n vec2 texCoord = v_texCoord * 2.0 - vec2(1.0, 1.0);\n float sqRadius = texCoord.x * texCoord.x + texCoord.y * texCoord.y;\n float value = (1.0 - sqrt(sqRadius)) * u_blurSlope;\n float alpha = smoothstep(0.0, 1.0, value) * v_weight;\n gl_FragColor = vec4(alpha, alpha, alpha, alpha);\n }",hitVertexShader:"\n precision mediump float;\n uniform mat4 u_projectionMatrix;\n uniform mat4 u_offsetScaleMatrix;\n uniform float u_size;\n attribute vec2 a_position;\n attribute float a_index;\n attribute float a_weight;\n attribute vec4 a_hitColor;\n\n varying vec2 v_texCoord;\n varying float v_weight;\n varying vec4 v_hitColor;\n\n void main(void) {\n mat4 offsetMatrix = u_offsetScaleMatrix;\n float offsetX = a_index == 0.0 || a_index == 3.0 ? -u_size / 2.0 : u_size / 2.0;\n float offsetY = a_index == 0.0 || a_index == 1.0 ? -u_size / 2.0 : u_size / 2.0;\n vec4 offsets = offsetMatrix * vec4(offsetX, offsetY, 0.0, 0.0);\n gl_Position = u_projectionMatrix * vec4(a_position, 0.0, 1.0) + offsets;\n float u = a_index == 0.0 || a_index == 3.0 ? 0.0 : 1.0;\n float v = a_index == 0.0 || a_index == 1.0 ? 0.0 : 1.0;\n v_texCoord = vec2(u, v);\n v_hitColor = a_hitColor;\n v_weight = a_weight;\n }",hitFragmentShader:"\n precision mediump float;\n uniform float u_blurSlope;\n\n varying vec2 v_texCoord;\n varying float v_weight;\n varying vec4 v_hitColor;\n\n void main(void) {\n vec2 texCoord = v_texCoord * 2.0 - vec2(1.0, 1.0);\n float sqRadius = texCoord.x * texCoord.x + texCoord.y * texCoord.y;\n float value = (1.0 - sqrt(sqRadius)) * u_blurSlope;\n float alpha = smoothstep(0.0, 1.0, value) * v_weight;\n if (alpha < 0.05) {\n discard;\n }\n\n gl_FragColor = v_hitColor;\n }",uniforms:{u_size:function(){return 2*(this.get(Lw)+this.get(Mw))}.bind(this),u_blurSlope:function(){return this.get(Lw)/Math.max(1,this.get(Mw))}.bind(this)},postProcesses:[{fragmentShader:"\n precision mediump float;\n\n uniform sampler2D u_image;\n uniform sampler2D u_gradientTexture;\n uniform float u_opacity;\n\n varying vec2 v_texCoord;\n\n void main() {\n vec4 color = texture2D(u_image, v_texCoord);\n gl_FragColor.a = color.a * u_opacity;\n gl_FragColor.rgb = texture2D(u_gradientTexture, vec2(0.5, color.a)).rgb;\n gl_FragColor.rgb *= gl_FragColor.a;\n }",uniforms:{u_gradientTexture:function(){return this.gradient_}.bind(this),u_opacity:function(){return this.getOpacity()}.bind(this)}}]})},e.prototype.renderDeclutter=function(){},e}(bh),Dw=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)}}(),jw=function(t){function e(e){var r=e||{};return t.call(this,r)||this}return Dw(e,t),e}(Ya),Gw=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)}}(),zw=function(t){function e(e){var r=t.call(this,e)||this;return r.image_=null,r}return Gw(e,t),e.prototype.getImage=function(){return this.image_?this.image_.getImage():null},e.prototype.prepareFrame=function(t){var e=t.layerStatesArray[t.layerIndex],r=t.pixelRatio,n=t.viewState,i=n.resolution,a=this.getLayer().getSource(),s=t.viewHints,l=t.extent;if(void 0!==e.extent&&(l=_r(l,ni(e.extent,n.projection))),!s[Bs]&&!s[Vs]&&!Sr(l))if(a){var u=n.projection,h=a.getImage(l,i,r,u);h&&(this.loadImage(h)?this.image_=h:h.getState()===o&&(this.image_=null))}else this.image_=null;return!!this.image_},e.prototype.getData=function(t){var e=this.frameState;if(!e)return null;var r=this.getLayer(),n=Hr(e.pixelToCoordinateTransform,t.slice()),i=r.getExtent();if(i&&!Ze(i,n))return null;var o=this.image_.getExtent(),a=this.image_.getImage(),s=wr(o),l=Math.floor(a.width*((n[0]-o[0])/s));if(l<0||l>=a.width)return null;var u=vr(o),h=Math.floor(a.height*((o[3]-n[1])/u));return h<0||h>=a.height?null:this.getImageData(a,l,h)},e.prototype.renderFrame=function(t,e){var r=this.image_,n=r.getExtent(),i=r.getResolution(),o=r.getPixelRatio(),a=t.layerStatesArray[t.layerIndex],s=t.pixelRatio,l=t.viewState,u=l.center,h=s*i/(l.resolution*o),c=t.extent,p=l.resolution,f=l.rotation,d=Math.round(wr(c)/p*s),g=Math.round(vr(c)/p*s);tn(this.pixelTransform,t.size[0]/2,t.size[1]/2,1/s,1/s,f,-d/2,-g/2),en(this.inversePixelTransform,this.pixelTransform);var y=rn(this.pixelTransform);this.useContainer(e,y,this.getBackground(t));var v=this.context,_=v.canvas;_.width!=d||_.height!=g?(_.width=d,_.height=g):this.containerReused||v.clearRect(0,0,d,g);var m=!1,x=!0;if(a.extent){var w=ni(a.extent,l.projection);(m=(x=br(w,t.extent))&&!He(w,t.extent))&&this.clipUnrotated(v,t,w)}var b=r.getImage(),S=tn(this.tempTransform,d/2,g/2,h,h,0,o*(n[0]-u[0])/i,o*(u[1]-n[3])/i);this.renderedResolution=i*s/o;var C=b.width*S[0],E=b.height*S[3];if(this.getLayer().getSource().getInterpolate()||gt(v,yf),this.preRender(v,t),x&&C>=.5&&E>=.5){var T=S[4],P=S[5],R=a.opacity,O=void 0;1!==R&&(O=v.globalAlpha,v.globalAlpha=R),v.drawImage(b,0,0,+b.width,+b.height,T,P,C,E),1!==R&&(v.globalAlpha=O)}return this.postRender(v,t),m&&v.restore(),gt(v,vf),y!==_.style.transform&&(_.style.transform=y),this.container},e}(ec),Nw=zw,Uw=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)}}(),Bw=function(t){function e(e){return t.call(this,e)||this}return Uw(e,t),e.prototype.createRenderer=function(){return new Nw(this)},e.prototype.getData=function(e){return t.prototype.getData.call(this,e)},e}(jw),Vw=function(){function t(t,e){this.name=t,this.data=e,this.texture_=null}return t.prototype.getTexture=function(t){if(!this.texture_){var e=t.createTexture();t.bindTexture(t.TEXTURE_2D,e),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_S,t.CLAMP_TO_EDGE),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_T,t.CLAMP_TO_EDGE),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MIN_FILTER,t.NEAREST),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MAG_FILTER,t.NEAREST),t.texImage2D(t.TEXTURE_2D,0,t.RGBA,this.data.length/4,1,0,t.RGBA,t.UNSIGNED_BYTE,this.data),this.texture_=e}return this.texture_},t}(),Xw=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)}}(),Ww=function(t){function e(e){var r=this,n=ks;return(r=t.call(this,e.tileCoord,n,{transition:e.transition,interpolate:e.interpolate})||this).loader_=e.loader,r.data_=null,r.error_=null,r.size_=e.size||[256,256],r}return Xw(e,t),e.prototype.getSize=function(){return this.size_},e.prototype.getData=function(){return this.data_},e.prototype.getError=function(){return this.error_},e.prototype.load=function(){if(this.state===ks||this.state===Gs){this.state=Ds,this.changed();var t=this;this.loader_().then((function(e){t.data_=e,t.state=js,t.changed()})).catch((function(e){t.error_=e,t.state=Gs,t.changed()}))}},e}(cf),qw=Ww,Yw=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 Kw(t,e,r){var n=r?t.LINEAR:t.NEAREST;t.bindTexture(t.TEXTURE_2D,e),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_S,t.CLAMP_TO_EDGE),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_T,t.CLAMP_TO_EDGE),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MIN_FILTER,n),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MAG_FILTER,n)}function Zw(t,e,r,n,i,o){var a,s,l=t.getGL();r instanceof Float32Array?(a=l.FLOAT,t.getExtension("OES_texture_float"),s=null!==t.getExtension("OES_texture_float_linear")):(a=l.UNSIGNED_BYTE,s=!0);Kw(l,e,o&&s);var u,h=r.byteLength/n[1],c=1;switch(h%8==0?c=8:h%4==0?c=4:h%2==0&&(c=2),i){case 1:u=l.LUMINANCE;break;case 2:u=l.LUMINANCE_ALPHA;break;case 3:u=l.RGB;break;case 4:u=l.RGBA;break;default:throw new Error("Unsupported number of bands: ".concat(i))}var p=l.getParameter(l.UNPACK_ALIGNMENT);l.pixelStorei(l.UNPACK_ALIGNMENT,c),l.texImage2D(l.TEXTURE_2D,0,u,n[0],n[1],0,u,a,r),l.pixelStorei(l.UNPACK_ALIGNMENT,p)}var Hw=null;var Jw=function(t){function e(e){var r=t.call(this)||this;r.tile,r.textures=[],r.handleTileChange_=r.handleTileChange_.bind(r),r.renderSize_=p(e.grid.getTileSize(e.tile.tileCoord[0])),r.gutter_=e.gutter||0,r.bandCount=NaN,r.helper_=e.helper;var n=new ew(qx,Kx);return n.fromArray([0,1,1,1,1,0,0,0]),r.helper_.flushBufferData(n),r.coords=n,r.setTile(e.tile),r}return Yw(e,t),e.prototype.setTile=function(t){if(t!==this.tile)if(this.tile&&this.tile.removeEventListener(wt,this.handleTileChange_),this.tile=t,this.textures.length=0,this.loaded=t.getState()===js,this.loaded)this.uploadTile_();else{if(t instanceof df){var e=t.getImage();e instanceof Image&&!e.crossOrigin&&(e.crossOrigin="anonymous")}t.addEventListener(wt,this.handleTileChange_)}},e.prototype.uploadTile_=function(){var t=this.helper_,e=t.getGL(),r=this.tile;if(r instanceof df||r instanceof Cf){var n=e.createTexture();return this.textures.push(n),this.bandCount=4,void function(t,e,r,n){Kw(t,e,n),t.texImage2D(t.TEXTURE_2D,0,t.RGBA,t.RGBA,t.UNSIGNED_BYTE,r)}(e,n,r.getImage(),r.interpolate)}var i=r.getSize(),o=[i[0]+2*this.gutter_,i[1]+2*this.gutter_],a=r.getData(),s=a instanceof Float32Array,l=o[0]*o[1],u=s?Float32Array:Uint8Array,h=u.BYTES_PER_ELEMENT,c=a.byteLength/o[1];this.bandCount=Math.floor(c/h/o[0]);var p=Math.ceil(this.bandCount/4);if(1===p){n=e.createTexture();return this.textures.push(n),void Zw(t,n,a,o,this.bandCount,r.interpolate)}for(var f=new Array(p),d=0;d<p;++d){n=e.createTexture();this.textures.push(n);var g=d<p-1?4:this.bandCount%4;f[d]=new u(l*g)}for(var y=0,v=0,_=o[0]*this.bandCount,m=0;m<o[1];++m){for(var x=0;x<_;++x){var w=a[v+x],b=Math.floor(y/this.bandCount),S=x%this.bandCount;(C=f[d=Math.floor(S/4)])[b*(g=C.length/l)+S%4]=w,++y}v+=c/h}for(d=0;d<p;++d){var C;Zw(t,n=this.textures[d],C=f[d],o,g=C.length/l,r.interpolate)}},e.prototype.handleTileChange_=function(){this.tile.getState()===js&&(this.loaded=!0,this.uploadTile_(),this.dispatchEvent(wt))},e.prototype.disposeInternal=function(){var t=this.helper_.getGL();this.helper_.deleteBuffer(this.coords);for(var e=0;e<this.textures.length;++e)t.deleteTexture(this.textures[e]);this.tile.removeEventListener(wt,this.handleTileChange_)},e.prototype.getPixelData=function(t,e){if(!this.loaded)return null;var r,n=this.renderSize_[0],i=this.renderSize_[1],o=this.gutter_;if(this.tile instanceof qw){var a=this.tile.getSize(),s=a[0],l=a[1],u=s+2*o,h=l+2*o,c=o+Math.floor(s*(t/n)),p=o+Math.floor(l*(e/i)),f=this.tile.getData();if(f instanceof DataView){var d=f.byteLength/(u*h),g=d*(p*u+c),y=f.buffer.slice(g,g+d);return new DataView(y)}var v=this.bandCount*(p*u+c);return f.slice(v,v+this.bandCount)}Hw||((r=document.createElement("canvas")).width=1,r.height=1,Hw=r.getContext("2d")),Hw.clearRect(0,0,1,1);var _,m=this.tile.getImage(),x=m.width-2*o,w=m.height-2*o,b=o+Math.floor(x*(t/n)),S=o+Math.floor(w*(e/i));try{Hw.drawImage(m,b,S,1,1,0,0,1,1),_=Hw.getImageData(0,0,1,1).data}catch(t){return Hw=null,null}return _},e}(xt),Qw=Jw,$w=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)}}(),tb="u_tileTextures",eb="u_tileTransform",rb="u_transitionAlpha",nb="u_depth",ib="u_texturePixelWidth",ob="u_texturePixelHeight",ab="u_textureResolution",sb="u_textureOriginX",lb="u_textureOriginY",ub="u_renderExtent",hb="u_resolution",cb="u_zoom",pb=[{name:"a_textureCoord",size:2,type:dw.FLOAT}],fb={};function db(t){return 2*(1-1/(t+1))-1}function gb(t,e,r){r in t||(t[r]=[]),t[r].push(e)}function yb(t,e){var r=t.layerStatesArray[t.layerIndex];r.extent&&(e=_r(e,ni(r.extent,t.viewState.projection)));var n=r.layer.getRenderSource();if(!n.getWrapX()){var i=n.getTileGridForProjection(t.viewState.projection).getExtent();i&&(e=_r(e,i))}return e}function vb(t,e){return"".concat(t.getKey(),",").concat(rf(e))}!function(t){function e(e,r){var n=t.call(this,e,{uniforms:r.uniforms})||this;n.renderComplete=!1,n.tileTransform_=[1,0,0,1,0,0],n.tempMat4_=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],n.tempTileRange_=new $p(0,0,0,0),n.tempTileCoord_=tf(0,0,0),n.tempSize_=[0,0],n.program_,n.vertexShader_=r.vertexShader,n.fragmentShader_=r.fragmentShader,n.indices_=new ew(Yx,Kx),n.indices_.fromArray([0,1,3,1,2,3]);var i=void 0!==r.cacheSize?r.cacheSize:512;return n.tileTextureCache_=new Ef(i),n.paletteTextures_=r.paletteTextures||[],n.frameState_=null,n}$w(e,t),e.prototype.reset=function(e){t.prototype.reset.call(this,{uniforms:e.uniforms}),this.vertexShader_=e.vertexShader,this.fragmentShader_=e.fragmentShader,this.paletteTextures_=e.paletteTextures||[],this.helper&&(this.program_=this.helper.getProgram(this.fragmentShader_,this.vertexShader_))},e.prototype.afterHelperCreated=function(){this.program_=this.helper.getProgram(this.fragmentShader_,this.vertexShader_),this.helper.flushBufferData(this.indices_)},e.prototype.isDrawableTile_=function(t){var e=this.getLayer(),r=t.getState(),n=e.getUseInterimTilesOnError();return r==js||r==zs||r==Gs&&!n},e.prototype.prepareFrameInternal=function(t){var e=this.getLayer().getRenderSource();return!!e&&(!Sr(yb(t,t.extent))&&"ready"===e.getState())},e.prototype.enqueueTiles=function(t,e,r,n){var i=t.viewState,o=this.getLayer(),a=o.getRenderSource(),s=a.getTileGridForProjection(i.projection),u=a.getGutterForProjection(i.projection),h=l(a);h in t.wantedTiles||(t.wantedTiles[h]={});for(var c=t.wantedTiles[h],p=this.tileTextureCache_,f=Math.max(r-o.getPreload(),s.getMinZoom(),o.getMinZoom()),d=r;d>=f;--d)for(var g=s.getTileRangeForExtentAndZ(e,d,this.tempTileRange_),y=s.getResolution(d),v=g.minX;v<=g.maxX;++v)for(var _=g.minY;_<=g.maxY;++_){var m=tf(d,v,_,this.tempTileCoord_),x=vb(a,m),w=void 0,b=void 0;if(p.containsKey(x)&&(b=(w=p.get(x)).tile),!w||w.tile.key!==a.getKey())if(b=a.getTile(d,v,_,t.pixelRatio,i.projection),w)if(this.isDrawableTile_(b))w.setTile(b);else{var S=b.getInterimTile();w.setTile(S)}else w=new Qw({tile:b,grid:s,helper:this.helper,gutter:u}),p.set(x,w);gb(n,w,d);var C=b.getKey();c[C]=!0,b.getState()===ks&&(t.tileQueue.isKeyQueued(C)||t.tileQueue.enqueue([b,h,s.getTileCoordCenter(m),y]))}},e.prototype.renderFrame=function(t){this.frameState_=t,this.renderComplete=!0;var e=this.helper.getGL();this.preRender(e,t);var r=t.viewState,n=this.getLayer().getRenderSource(),i=n.getTileGridForProjection(r.projection),o=n.getGutterForProjection(r.projection),a=yb(t,t.extent),s=i.getZForResolution(r.resolution,n.zDirection),u={};if(t.nextExtent){var h=i.getZForResolution(r.nextResolution,n.zDirection),c=yb(t,t.nextExtent);this.enqueueTiles(t,c,h,u)}this.enqueueTiles(t,a,s,u);for(var f={},d=l(this),g=t.time,y=!1,v=u[s],_=0,m=v.length;_<m;++_){var x=(N=(tt=v[_]).tile).tileCoord;if(tt.loaded){if(1===(U=N.getAlpha(d,g))){N.endTransition(d);continue}y=!0,f[B=rf(x)]=U}if(this.renderComplete=!1,!this.findAltTiles_(i,x,s+1,u))for(var w=i.getMinZoom(),b=s-1;b>=w;--b){if(this.findAltTiles_(i,x,b,u))break}}this.helper.useProgram(this.program_),this.helper.prepareDraw(t,!y);for(var S=Object.keys(u).map(Number).sort(at),C=r.center[0],E=r.center[1],T=0,P=S.length;T<P;++T){var R=S[T],O=i.getResolution(R),F=p(i.getTileSize(R),this.tempSize_),M=i.getOrigin(R),I=F[0]+2*o,L=F[1]+2*o,A=I/L,k=(C-M[0])/(F[0]*O),D=(M[1]-E)/(F[1]*O),j=r.resolution/O,G=db(R),z=u[R];for(_=0,m=z.length;_<m;++_){if((tt=z[_]).loaded){var N,U,B=rf(x=(N=tt.tile).tileCoord),V=x[1],X=x[2];Yr(this.tileTransform_),Qr(this.tileTransform_,2/(t.size[0]*j/I),-2/(t.size[1]*j/I)),Jr(this.tileTransform_,r.rotation),Qr(this.tileTransform_,1,1/A),$r(this.tileTransform_,(F[0]*(V-k)-o)/I,(F[1]*(X-D)-o)/L),this.helper.setUniformMatrixValue(eb,aw(this.tempMat4_,this.tileTransform_)),this.helper.bindBuffer(tt.coords),this.helper.bindBuffer(this.indices_),this.helper.enableAttributes(pb);for(var W=0;W<tt.textures.length;){var q="TEXTURE"+W,Y="".concat(tb,"[").concat(W,"]");e.activeTexture(e[q]),e.bindTexture(e.TEXTURE_2D,tt.textures[W]),e.uniform1i(this.helper.getUniformLocation(Y),W),++W}for(var K=0;K<this.paletteTextures_.length;++K){var Z=this.paletteTextures_[K];e.activeTexture(e["TEXTURE"+W]);var H=Z.getTexture(e);e.bindTexture(e.TEXTURE_2D,H),e.uniform1i(this.helper.getUniformLocation(Z.name),W),++W}(U=B in f?f[B]:1)<1&&(t.animate=!0),this.helper.setUniformFloatValue(rb,U),this.helper.setUniformFloatValue(nb,G),this.helper.setUniformFloatValue(ib,I),this.helper.setUniformFloatValue(ob,L),this.helper.setUniformFloatValue(ab,O),this.helper.setUniformFloatValue(sb,M[0]+V*F[0]*O-o*O),this.helper.setUniformFloatValue(lb,M[1]-X*F[1]*O+o*O);var J=a;o>0&&_r(J=i.getTileCoordExtent(x),a,J),this.helper.setUniformFloatVec4(ub,J),this.helper.setUniformFloatValue(hb,r.resolution),this.helper.setUniformFloatValue(cb,r.zoom),this.helper.drawElements(0,this.indices_.getSize())}}}this.helper.finalizeDraw(t,this.dispatchPreComposeEvent,this.dispatchPostComposeEvent);for(var Q=this.helper.getCanvas(),$=this.tileTextureCache_;$.canExpireCache();){var tt;(tt=$.pop()).dispose()}return t.postRenderFunctions.push((function(t,e){n.expireCache(e.viewState.projection,fb)})),this.postRender(e,t),Q},e.prototype.getData=function(t){if(!this.helper.getGL())return null;var e=this.frameState_;if(!e)return null;var r=this.getLayer(),n=Hr(e.pixelToCoordinateTransform,t.slice()),i=e.viewState,o=r.getExtent();if(o&&!Ze(ni(o,i.projection),n))return null;var a,s,l,u=r.getSources(We([n]),i.resolution);for(a=u.length-1;a>=0;--a)if("ready"===(s=u[a]).getState()){if(l=s.getTileGridForProjection(i.projection),s.getWrapX())break;var h=l.getExtent();if(!h||Ze(h,n))break}if(a<0)return null;for(var c=this.tileTextureCache_,f=l.getZForResolution(i.resolution);f>=l.getMinZoom();--f){var d=l.getTileCoordForCoordAndZ(n,f),g=vb(s,d);if(c.containsKey(g)){var y=c.get(g);if(y.loaded){var v=l.getOrigin(f),_=p(l.getTileSize(f)),m=l.getResolution(f),x=(n[0]-v[0])/m-d[1]*_[0],w=(v[1]-n[1])/m-d[2]*_[1];return y.getPixelData(x,w)}}}return null},e.prototype.findAltTiles_=function(t,e,r,n){var i=t.getTileRangeForTileCoordAndZ(e,r,this.tempTileRange_);if(!i)return!1;for(var o=!0,a=this.tileTextureCache_,s=this.getLayer().getRenderSource(),l=i.minX;l<=i.maxX;++l)for(var u=i.minY;u<=i.maxY;++u){var h=vb(s,[r,l,u]),c=!1;if(a.containsKey(h)){var p=a.get(h);p.loaded&&(gb(n,p,r),c=!0)}c||(o=!1)}return o},e.prototype.removeHelper=function(){if(this.helper){var e=this.tileTextureCache_;e.forEach((function(t){return t.dispose()})),e.clear()}t.prototype.removeHelper.call(this)},e.prototype.disposeInternal=function(){var e=this.helper;e&&(e.getGL().deleteProgram(this.program_),delete this.program_,e.deleteBuffer(this.indices_));t.prototype.disposeInternal.call(this),delete this.indices_,delete this.tileTextureCache_,delete this.frameState_}}(Cw);var _b=1,mb=2,xb=4,wb=8,bb=16,Sb=31,Cb=0,Eb={};function Tb(t){if("number"==typeof t)return _b;if("boolean"==typeof t)return wb;if("string"==typeof t)return e=t,L.test(e)&&(e=k(e)),I.test(e)||0===e.indexOf("rgba(")||0===e.indexOf("rgb(")?xb|mb:mb;var e;if(!Array.isArray(t))throw new Error("Unhandled value type: ".concat(JSON.stringify(t)));var r=t;if(r.every((function(t){return"number"==typeof t})))return 3===r.length||4===r.length?xb|bb:bb;if("string"!=typeof r[0])throw new Error("Expected an expression operator but received: ".concat(JSON.stringify(r)));var n=Eb[r[0]];if(void 0===n)throw new Error("Unrecognized expression operator: ".concat(JSON.stringify(r)));return n.getReturnType(r.slice(1))}function Pb(t){var e=t.toString();return-1===e.indexOf(".")?e+".0":e}function Rb(t){if(t.length<2||t.length>4)throw new Error("`formatArray` can only output `vec2`, `vec3` or `vec4` arrays.");return"vec".concat(t.length,"(").concat(t.map(Pb).join(", "),")")}function Ob(t,e){return void 0===t.stringLiteralsMap[e]&&(t.stringLiteralsMap[e]=Object.keys(t.stringLiteralsMap).length),t.stringLiteralsMap[e]}function Fb(t,e,r){if(Array.isArray(e)&&"string"==typeof e[0]){var n=Eb[e[0]];if(void 0===n)throw new Error("Unrecognized expression operator: ".concat(JSON.stringify(e)));return n.toGlsl(t,e.slice(1),r)}var i=Tb(e);if((i&_b)>0)return Pb(e);if((i&wb)>0)return e.toString();if((i&mb)>0&&(void 0===r||r==mb))return function(t,e){return Pb(Ob(t,e))}(t,e.toString());if((i&xb)>0&&(void 0===r||r==xb))return function(t){var e=j(t).slice();return e.length<4&&e.push(1),Rb(e.map((function(t,e){return e<3?t/255:t})))}(e);if((i&bb)>0)return Rb(e);throw new Error("Unexpected expression ".concat(e," (expected type ").concat(r,")"))}function Mb(t){if(!(Tb(t)&_b))throw new Error("A numeric value was expected, got ".concat(JSON.stringify(t)," instead"))}function Ib(t){for(var e=0;e<t.length;e++)Mb(t[e])}function Lb(t){if(!(Tb(t)&mb))throw new Error("A string value was expected, got ".concat(JSON.stringify(t)," instead"))}function Ab(t){if(!(Tb(t)&wb))throw new Error("A boolean value was expected, got ".concat(JSON.stringify(t)," instead"))}function kb(t,e){if(t.length!==e)throw new Error("Exactly ".concat(e," arguments were expected, got ").concat(t.length," instead"))}function Db(t,e){if(t.length<e)throw new Error("At least ".concat(e," arguments were expected, got ").concat(t.length," instead"))}function jb(t,e){if(t.length>e)throw new Error("At most ".concat(e," arguments were expected, got ").concat(t.length," instead"))}function Gb(t){if(t.length%2!=0)throw new Error("An even amount of arguments was expected, got ".concat(t," instead"))}function zb(t,e){if(w(e)%1!=0)throw new Error("Could not infer only one type from the following expression: ".concat(JSON.stringify(t)))}function Nb(t){return"u_var_"+t}Eb.get={getReturnType:function(t){return Sb},toGlsl:function(t,e){kb(e,1),Lb(e[0]);var r=e[0].toString();return-1===t.attributes.indexOf(r)&&t.attributes.push(r),(t.inFragmentShader?"v_":"a_")+r}},Eb.var={getReturnType:function(t){return Sb},toGlsl:function(t,e){kb(e,1),Lb(e[0]);var r=e[0].toString();return-1===t.variables.indexOf(r)&&t.variables.push(r),Nb(r)}};Eb.palette={getReturnType:function(t){return xb},toGlsl:function(t,e){kb(e,2),Mb(e[0]);var r=Fb(t,e[0]),n=e[1];if(!Array.isArray(n))throw new Error("The second argument of palette must be an array");for(var i=n.length,o=new Uint8Array(4*i),a=0;a<i;a++){var s=n[a],l=void 0;if("string"==typeof s)l=D(s);else{if(!Array.isArray(s))throw new Error("The second argument of palette must be an array of strings or colors");var u=s.length;if(4===u)l=s;else{if(3!==u)throw new Error("Expected palette color to have 3 or 4 values, got ".concat(u));l=[s[0],s[1],s[2],1]}}var h=4*a;o[h]=l[0],o[h+1]=l[1],o[h+2]=l[2],o[h+3]=255*l[3]}t.paletteTextures||(t.paletteTextures=[]);var c="".concat("u_paletteTextures","[").concat(t.paletteTextures.length,"]"),p=new Vw(c,o);return t.paletteTextures.push(p),"texture2D(".concat(c,", vec2((").concat(r," + 0.5) / ").concat(i,".0, 0.5))")}};var Ub="getBandValue";function Bb(t){return{getReturnType:function(t){return wb},toGlsl:function(e,r){kb(r,2);for(var n=Sb,i=0;i<r.length;i++)n&=Tb(r[i]);if(n===Cb)throw new Error("All arguments should be of compatible type, got ".concat(JSON.stringify(r)," instead"));return n&=~xb,"(".concat(Fb(e,r[0],n)," ").concat(t," ").concat(Fb(e,r[1],n),")")}}}function Vb(t){return{getReturnType:function(t){return wb},toGlsl:function(e,r){Db(r,2);for(var n=0;n<r.length;n++)Ab(r[n]);var i="";return i=r.map((function(t){return Fb(e,t)})).join(" ".concat(t," ")),i="(".concat(i,")")}}}Eb.band={getReturnType:function(t){return _b},toGlsl:function(t,e){Db(e,1),jb(e,3);var r=e[0];if(!(Ub in t.functions)){for(var n="",i=t.bandCount||1,o=0;o<i;o++){var a=Math.floor(o/4),s=o%4;s===i-1&&1===s&&(s=3);var l="".concat(tb,"[").concat(a,"]");n+="\n if (band == ".concat(o+1,".0) {\n return texture2D(").concat(l,", v_textureCoord + vec2(dx, dy))[").concat(s,"];\n }\n ")}t.functions.getBandValue="\n float getBandValue(float band, float xOffset, float yOffset) {\n float dx = xOffset / ".concat(ib,";\n float dy = yOffset / ").concat(ob,";\n ").concat(n,"\n }\n ")}var u=Fb(t,r),h=Fb(t,e[1]||0),c=Fb(t,e[2]||0);return"".concat(Ub,"(").concat(u,", ").concat(h,", ").concat(c,")")}},Eb.time={getReturnType:function(t){return _b},toGlsl:function(t,e){return kb(e,0),"u_time"}},Eb.zoom={getReturnType:function(t){return _b},toGlsl:function(t,e){return kb(e,0),"u_zoom"}},Eb.resolution={getReturnType:function(t){return _b},toGlsl:function(t,e){return kb(e,0),"u_resolution"}},Eb["*"]={getReturnType:function(t){return _b},toGlsl:function(t,e){return kb(e,2),Ib(e),"(".concat(Fb(t,e[0])," * ").concat(Fb(t,e[1]),")")}},Eb["/"]={getReturnType:function(t){return _b},toGlsl:function(t,e){return kb(e,2),Ib(e),"(".concat(Fb(t,e[0])," / ").concat(Fb(t,e[1]),")")}},Eb["+"]={getReturnType:function(t){return _b},toGlsl:function(t,e){return kb(e,2),Ib(e),"(".concat(Fb(t,e[0])," + ").concat(Fb(t,e[1]),")")}},Eb["-"]={getReturnType:function(t){return _b},toGlsl:function(t,e){return kb(e,2),Ib(e),"(".concat(Fb(t,e[0])," - ").concat(Fb(t,e[1]),")")}},Eb.clamp={getReturnType:function(t){return _b},toGlsl:function(t,e){kb(e,3),Ib(e);var r=Fb(t,e[1]),n=Fb(t,e[2]);return"clamp(".concat(Fb(t,e[0]),", ").concat(r,", ").concat(n,")")}},Eb["%"]={getReturnType:function(t){return _b},toGlsl:function(t,e){return kb(e,2),Ib(e),"mod(".concat(Fb(t,e[0]),", ").concat(Fb(t,e[1]),")")}},Eb["^"]={getReturnType:function(t){return _b},toGlsl:function(t,e){return kb(e,2),Ib(e),"pow(".concat(Fb(t,e[0]),", ").concat(Fb(t,e[1]),")")}},Eb.abs={getReturnType:function(t){return _b},toGlsl:function(t,e){return kb(e,1),Ib(e),"abs(".concat(Fb(t,e[0]),")")}},Eb.floor={getReturnType:function(t){return _b},toGlsl:function(t,e){return kb(e,1),Ib(e),"floor(".concat(Fb(t,e[0]),")")}},Eb.round={getReturnType:function(t){return _b},toGlsl:function(t,e){return kb(e,1),Ib(e),"floor(".concat(Fb(t,e[0])," + 0.5)")}},Eb.ceil={getReturnType:function(t){return _b},toGlsl:function(t,e){return kb(e,1),Ib(e),"ceil(".concat(Fb(t,e[0]),")")}},Eb.sin={getReturnType:function(t){return _b},toGlsl:function(t,e){return kb(e,1),Ib(e),"sin(".concat(Fb(t,e[0]),")")}},Eb.cos={getReturnType:function(t){return _b},toGlsl:function(t,e){return kb(e,1),Ib(e),"cos(".concat(Fb(t,e[0]),")")}},Eb.atan={getReturnType:function(t){return _b},toGlsl:function(t,e){return Db(e,1),jb(e,2),Ib(e),2===e.length?"atan(".concat(Fb(t,e[0]),", ").concat(Fb(t,e[1]),")"):"atan(".concat(Fb(t,e[0]),")")}},Eb[">"]={getReturnType:function(t){return wb},toGlsl:function(t,e){return kb(e,2),Ib(e),"(".concat(Fb(t,e[0])," > ").concat(Fb(t,e[1]),")")}},Eb[">="]={getReturnType:function(t){return wb},toGlsl:function(t,e){return kb(e,2),Ib(e),"(".concat(Fb(t,e[0])," >= ").concat(Fb(t,e[1]),")")}},Eb["<"]={getReturnType:function(t){return wb},toGlsl:function(t,e){return kb(e,2),Ib(e),"(".concat(Fb(t,e[0])," < ").concat(Fb(t,e[1]),")")}},Eb["<="]={getReturnType:function(t){return wb},toGlsl:function(t,e){return kb(e,2),Ib(e),"(".concat(Fb(t,e[0])," <= ").concat(Fb(t,e[1]),")")}},Eb["=="]=Bb("=="),Eb["!="]=Bb("!="),Eb["!"]={getReturnType:function(t){return wb},toGlsl:function(t,e){return kb(e,1),Ab(e[0]),"(!".concat(Fb(t,e[0]),")")}},Eb.all=Vb("&&"),Eb.any=Vb("||"),Eb.between={getReturnType:function(t){return wb},toGlsl:function(t,e){kb(e,3),Ib(e);var r=Fb(t,e[1]),n=Fb(t,e[2]),i=Fb(t,e[0]);return"(".concat(i," >= ").concat(r," && ").concat(i," <= ").concat(n,")")}},Eb.array={getReturnType:function(t){return bb},toGlsl:function(t,e){Db(e,2),jb(e,4),Ib(e);var r=e.map((function(e){return Fb(t,e,_b)}));return"vec".concat(e.length,"(").concat(r.join(", "),")")}},Eb.color={getReturnType:function(t){return xb},toGlsl:function(t,e){Db(e,3),jb(e,4),Ib(e);var r=e;3===e.length&&r.push(1);var n=e.map((function(e,r){return Fb(t,e,_b)+(r<3?" / 255.0":"")}));return"vec".concat(e.length,"(").concat(n.join(", "),")")}},Eb.interpolate={getReturnType:function(t){for(var e=xb|_b,r=3;r<t.length;r+=2)e&=Tb(t[r]);return e},toGlsl:function(t,e,r){Gb(e),Db(e,6);var n,i=e[0];switch(i[0]){case"linear":n=1;break;case"exponential":n=i[1];break;default:n=null}if(!n)throw new Error('Invalid interpolation type for "interpolate" operator, received: '.concat(JSON.stringify(i)));var o=void 0!==r?r:Sb,a=Eb.interpolate.getReturnType(e)&o;zb(e,a);for(var s=Fb(t,e[1]),l=Pb(n),u="",h=2;h<e.length-2;h+=2){var c=Fb(t,e[h]),p=u||Fb(t,e[h+1],a),f=Fb(t,e[h+2]),d=Fb(t,e[h+3],a);u="mix(".concat(p,", ").concat(d,", pow(clamp((").concat(s," - ").concat(c,") / (").concat(f," - ").concat(c,"), 0.0, 1.0), ").concat(l,"))")}return u}},Eb.match={getReturnType:function(t){for(var e=Sb,r=2;r<t.length;r+=2)e&=Tb(t[r]);return e&=Tb(t[t.length-1])},toGlsl:function(t,e,r){Gb(e),Db(e,4);var n=void 0!==r?r:Sb,i=Eb.match.getReturnType(e)&n;zb(e,i);for(var o=Fb(t,e[0]),a=Fb(t,e[e.length-1],i),s=null,l=e.length-3;l>=1;l-=2){var u=Fb(t,e[l]),h=Fb(t,e[l+1],i);s="(".concat(o," == ").concat(u," ? ").concat(h," : ").concat(s||a,")")}return s}},Eb.case={getReturnType:function(t){for(var e=Sb,r=1;r<t.length;r+=2)e&=Tb(t[r]);return e&=Tb(t[t.length-1])},toGlsl:function(t,e,r){!function(t){if(t.length%2==0)throw new Error("An odd amount of arguments was expected, got ".concat(t," instead"))}(e),Db(e,3);var n=void 0!==r?r:Sb,i=Eb.case.getReturnType(e)&n;zb(e,i);for(var o=0;o<e.length-1;o+=2)Ab(e[o]);var a=Fb(t,e[e.length-1],i),s=null;for(o=e.length-3;o>=0;o-=2){var l=Fb(t,e[o]),u=Fb(t,e[o+1],i);s="(".concat(l," ? ").concat(u," : ").concat(s||a,")")}return s}};var Xb=function(){function t(){this.uniforms=[],this.attributes=[],this.varyings=[],this.sizeExpression="vec2(1.0)",this.rotationExpression="0.0",this.offsetExpression="vec2(0.0)",this.colorExpression="vec4(1.0)",this.texCoordExpression="vec4(0.0, 0.0, 1.0, 1.0)",this.discardExpression="false",this.rotateWithView=!1}return t.prototype.addUniform=function(t){return this.uniforms.push(t),this},t.prototype.addAttribute=function(t){return this.attributes.push(t),this},t.prototype.addVarying=function(t,e,r){return this.varyings.push({name:t,type:e,expression:r}),this},t.prototype.setSizeExpression=function(t){return this.sizeExpression=t,this},t.prototype.setRotationExpression=function(t){return this.rotationExpression=t,this},t.prototype.setSymbolOffsetExpression=function(t){return this.offsetExpression=t,this},t.prototype.setColorExpression=function(t){return this.colorExpression=t,this},t.prototype.setTextureCoordinateExpression=function(t){return this.texCoordExpression=t,this},t.prototype.setFragmentDiscardExpression=function(t){return this.discardExpression=t,this},t.prototype.setSymbolRotateWithView=function(t){return this.rotateWithView=t,this},t.prototype.getSizeExpression=function(){return this.sizeExpression},t.prototype.getOffsetExpression=function(){return this.offsetExpression},t.prototype.getColorExpression=function(){return this.colorExpression},t.prototype.getTextureCoordinateExpression=function(){return this.texCoordExpression},t.prototype.getFragmentDiscardExpression=function(){return this.discardExpression},t.prototype.getSymbolVertexShader=function(t){var e=this.rotateWithView?"u_offsetScaleMatrix * u_offsetRotateMatrix":"u_offsetScaleMatrix",r=this.attributes,n=this.varyings;return t&&(r=r.concat("vec4 a_hitColor"),n=n.concat({name:"v_hitColor",type:"vec4",expression:"a_hitColor"})),"precision mediump float;\nuniform mat4 u_projectionMatrix;\nuniform mat4 u_offsetScaleMatrix;\nuniform mat4 u_offsetRotateMatrix;\nuniform float u_time;\nuniform float u_zoom;\nuniform float u_resolution;\n".concat(this.uniforms.map((function(t){return"uniform "+t+";"})).join("\n"),"\nattribute vec2 a_position;\nattribute float a_index;\n").concat(r.map((function(t){return"attribute "+t+";"})).join("\n"),"\nvarying vec2 v_texCoord;\nvarying vec2 v_quadCoord;\n").concat(n.map((function(t){return"varying "+t.type+" "+t.name+";"})).join("\n"),"\nvoid main(void) {\n mat4 offsetMatrix = ").concat(e,";\n vec2 halfSize = ").concat(this.sizeExpression," * 0.5;\n vec2 offset = ").concat(this.offsetExpression,";\n float angle = ").concat(this.rotationExpression,";\n float offsetX;\n float offsetY;\n if (a_index == 0.0) {\n offsetX = (offset.x - halfSize.x) * cos(angle) + (offset.y - halfSize.y) * sin(angle);\n offsetY = (offset.y - halfSize.y) * cos(angle) - (offset.x - halfSize.x) * sin(angle);\n } else if (a_index == 1.0) {\n offsetX = (offset.x + halfSize.x) * cos(angle) + (offset.y - halfSize.y) * sin(angle);\n offsetY = (offset.y - halfSize.y) * cos(angle) - (offset.x + halfSize.x) * sin(angle);\n } else if (a_index == 2.0) {\n offsetX = (offset.x + halfSize.x) * cos(angle) + (offset.y + halfSize.y) * sin(angle);\n offsetY = (offset.y + halfSize.y) * cos(angle) - (offset.x + halfSize.x) * sin(angle);\n } else {\n offsetX = (offset.x - halfSize.x) * cos(angle) + (offset.y + halfSize.y) * sin(angle);\n offsetY = (offset.y + halfSize.y) * cos(angle) - (offset.x - halfSize.x) * sin(angle);\n }\n vec4 offsets = offsetMatrix * vec4(offsetX, offsetY, 0.0, 0.0);\n gl_Position = u_projectionMatrix * vec4(a_position, 0.0, 1.0) + offsets;\n vec4 texCoord = ").concat(this.texCoordExpression,";\n float u = a_index == 0.0 || a_index == 3.0 ? texCoord.s : texCoord.p;\n float v = a_index == 2.0 || a_index == 3.0 ? texCoord.t : texCoord.q;\n v_texCoord = vec2(u, v);\n u = a_index == 0.0 || a_index == 3.0 ? 0.0 : 1.0;\n v = a_index == 2.0 || a_index == 3.0 ? 0.0 : 1.0;\n v_quadCoord = vec2(u, v);\n").concat(n.map((function(t){return" "+t.name+" = "+t.expression+";"})).join("\n"),"\n}")},t.prototype.getSymbolFragmentShader=function(t){var e=t?" if (gl_FragColor.a < 0.1) { discard; } gl_FragColor = v_hitColor;":"",r=this.varyings;return t&&(r=r.concat({name:"v_hitColor",type:"vec4",expression:"a_hitColor"})),"precision mediump float;\nuniform float u_time;\nuniform float u_zoom;\nuniform float u_resolution;\n".concat(this.uniforms.map((function(t){return"uniform "+t+";"})).join("\n"),"\nvarying vec2 v_texCoord;\nvarying vec2 v_quadCoord;\n").concat(r.map((function(t){return"varying "+t.type+" "+t.name+";"})).join("\n"),"\nvoid main(void) {\n if (").concat(this.discardExpression,") { discard; }\n gl_FragColor = ").concat(this.colorExpression,";\n gl_FragColor.rgb *= gl_FragColor.a;\n").concat(e,"\n}")},t}();var Wb=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)}}(),qb=function(t){function e(e){var r=this,n=gt({},e);return(r=t.call(this,n)||this).parseResult_=function(t){var e=t.symbol,r=void 0!==e.size?e.size:1,n=e.color||"white",i=e.textureCoord||[0,0,1,1],o=e.offset||[0,0],a=void 0!==e.opacity?e.opacity:1,s=void 0!==e.rotation?e.rotation:0,l={inFragmentShader:!1,variables:[],attributes:[],stringLiteralsMap:{},functions:{}},u=Fb(l,r,bb|_b),h=Fb(l,o,bb),c=Fb(l,i,bb),p=Fb(l,s,_b),f={inFragmentShader:!0,variables:l.variables,attributes:[],stringLiteralsMap:l.stringLiteralsMap,functions:{}},d=Fb(f,n,xb),g=Fb(f,a,_b),y="1.0",v="vec2(".concat(Fb(f,r,bb|_b),").x");switch(e.symbolType){case"square":case"image":break;case"circle":y="(1.0-smoothstep(1.-4./".concat(v,",1.,dot(v_quadCoord-.5,v_quadCoord-.5)*4.))");break;case"triangle":var _="(v_quadCoord*2.-1.)",m="(atan(".concat(_,".x,").concat(_,".y))");y="(1.0-smoothstep(.5-3./".concat(v,",.5,cos(floor(.5+").concat(m,"/2.094395102)*2.094395102-").concat(m,")*length(").concat(_,")))");break;default:throw new Error("Unexpected symbol type: "+e.symbolType)}var x=(new Xb).setSizeExpression("vec2(".concat(u,")")).setRotationExpression(p).setSymbolOffsetExpression(h).setTextureCoordinateExpression(c).setSymbolRotateWithView(!!e.rotateWithView).setColorExpression("vec4(".concat(d,".rgb, ").concat(d,".a * ").concat(g," * ").concat(y,")"));if(t.filter){var w=Fb(f,t.filter,wb);x.setFragmentDiscardExpression("!".concat(w))}var b={};if(f.variables.forEach((function(e){var r=Nb(e);x.addUniform("float ".concat(r)),b[r]=function(){if(!t.variables||void 0===t.variables[e])throw new Error("The following variable is missing from the style: ".concat(e));var r=t.variables[e];return"string"==typeof r&&(r=Ob(l,r)),void 0!==r?r:-9999999}})),"image"===e.symbolType&&e.src){var S=new Image;S.crossOrigin=void 0===e.crossOrigin?"anonymous":e.crossOrigin,S.src=e.src,x.addUniform("sampler2D u_texture").setColorExpression(x.getColorExpression()+" * texture2D(u_texture, v_texCoord)"),b.u_texture=S}return f.attributes.forEach((function(t){-1===l.attributes.indexOf(t)&&l.attributes.push(t),x.addVarying("v_".concat(t),"float","a_".concat(t))})),l.attributes.forEach((function(t){x.addAttribute("float a_".concat(t))})),{builder:x,attributes:l.attributes.map((function(t){return{name:t,callback:function(e,r){var n=r[t];return"string"==typeof n&&(n=Ob(l,n)),void 0!==n?n:-9999999}}})),uniforms:b}}(e.style),r.styleVariables_=e.style.variables||{},r.hitDetectionDisabled_=!!e.disableHitDetection,r}return Wb(e,t),e.prototype.createRenderer=function(){return new Ow(this,{vertexShader:this.parseResult_.builder.getSymbolVertexShader(),fragmentShader:this.parseResult_.builder.getSymbolFragmentShader(),hitVertexShader:!this.hitDetectionDisabled_&&this.parseResult_.builder.getSymbolVertexShader(!0),hitFragmentShader:!this.hitDetectionDisabled_&&this.parseResult_.builder.getSymbolFragmentShader(!0),uniforms:this.parseResult_.uniforms,attributes:this.parseResult_.attributes})},e.prototype.updateStyleVariables=function(t){gt(this.styleVariables_,t),this.changed()},e}(Ya),Yb=qb,Kb=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 Zb=function(t){function e(e){var r=this,n=void 0!==e.hidpi&&e.hidpi,i=void 0===e.imageSmoothing||e.imageSmoothing;return void 0!==e.interpolate&&(i=e.interpolate),(r=t.call(this,{cacheSize:e.cacheSize,crossOrigin:"anonymous",interpolate:i,opaque:!0,projection:Bn("EPSG:3857"),reprojectionErrorThreshold:e.reprojectionErrorThreshold,state:"loading",tileLoadFunction:e.tileLoadFunction,tilePixelRatio:n?2:1,wrapX:void 0===e.wrapX||e.wrapX,transition:e.transition,zDirection:e.zDirection})||this).hidpi_=n,r.culture_=void 0!==e.culture?e.culture:"en-us",r.maxZoom_=void 0!==e.maxZoom?e.maxZoom:-1,r.apiKey_=e.key,r.imagerySet_=e.imagerySet,Hf("https://dev.virtualearth.net/REST/v1/Imagery/Metadata/"+r.imagerySet_+"?uriScheme=https&include=ImageryProviders&key="+r.apiKey_+"&c="+r.culture_,r.handleImageryMetadataResponse.bind(r),void 0,"jsonp"),r}return Kb(e,t),e.prototype.getApiKey=function(){return this.apiKey_},e.prototype.getImagerySet=function(){return this.imagerySet_},e.prototype.handleImageryMetadataResponse=function(t){if(200==t.statusCode&&"OK"==t.statusDescription&&"ValidCredentials"==t.authenticationResultCode&&1==t.resourceSets.length&&1==t.resourceSets[0].resources.length){var e=t.resourceSets[0].resources[0],r=-1==this.maxZoom_?e.zoomMax:this.maxZoom_,n=kf(this.getProjection()),i=this.hidpi_?2:1,o=e.imageWidth==e.imageHeight?e.imageWidth/i:[e.imageWidth/i,e.imageHeight/i],a=Lf({extent:n,minZoom:e.zoomMin,maxZoom:r,tileSize:o});this.tileGrid=a;var s=this.culture_,l=this.hidpi_;if(this.tileUrlFunction=Bf(e.imageUrlSubdomains.map((function(t){var r=[0,0,0],n=e.imageUrl.replace("{subdomain}",t).replace("{culture}",s);return function(t,e,i){if(t){tf(t[0],t[1],t[2],r);var o=n;return l&&(o+="&dpi=d1&device=mobile"),o.replace("{quadkey}",function(t){var e,r,n=t[0],i=new Array(n),o=1<<n-1;for(e=0;e<n;++e)r=48,t[1]&o&&(r+=1),t[2]&o&&(r+=2),i[e]=String.fromCharCode(r),o>>=1;return i.join("")}(r))}}}))),e.imageryProviders){var u=Kn(Bn("EPSG:4326"),this.getProjection());this.setAttributions(function(t){var r=[],n=t.viewState,i=this.getTileGrid(),o=i.getZForResolution(n.resolution,this.zDirection),a=i.getTileCoordForCoordAndZ(n.center,o)[0];return e.imageryProviders.map((function(e){for(var n=!1,i=e.coverageAreas,o=0,s=i.length;o<s;++o){var l=i[o];if(a>=l.zoomMin&&a<=l.zoomMax){var h=l.bbox;if(br(Cr([h[1],h[0],h[3],h[2]],u),t.extent)){n=!0;break}}}n&&r.push(e.attribution)})),r.push('<a class="ol-attribution-bing-tos" href="https://www.microsoft.com/maps/product/terms.html" target="_blank">Terms of Use</a>'),r}.bind(this))}this.setState("ready")}else this.setState("error")},e}(Kf),Hb=Zb,Jb=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)}}(),Qb=function(t){function e(e){var r=this,n=e||{},i=void 0===n.imageSmoothing||n.imageSmoothing;void 0!==n.interpolate&&(i=n.interpolate);var o=void 0!==n.projection?n.projection:"EPSG:3857",a=void 0!==n.tileGrid?n.tileGrid:Lf({extent:kf(o),maxResolution:n.maxResolution,maxZoom:n.maxZoom,minZoom:n.minZoom,tileSize:n.tileSize});return(r=t.call(this,{attributions:n.attributions,cacheSize:n.cacheSize,crossOrigin:n.crossOrigin,interpolate:i,opaque:n.opaque,projection:o,reprojectionErrorThreshold:n.reprojectionErrorThreshold,tileGrid:a,tileLoadFunction:n.tileLoadFunction,tilePixelRatio:n.tilePixelRatio,tileUrlFunction:n.tileUrlFunction,url:n.url,urls:n.urls,wrapX:void 0===n.wrapX||n.wrapX,transition:n.transition,attributionsCollapsible:n.attributionsCollapsible,zDirection:n.zDirection})||this).gutter_=void 0!==n.gutter?n.gutter:0,r}return Jb(e,t),e.prototype.getGutter=function(){return this.gutter_},e}(Kf),$b=Qb,tS=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)}}(),eS=function(t){function a(r,n,i,a,s,l,u){var h=this,c=r.getExtent(),p=n.getExtent(),f=p?_r(i,p):i,d=wf(r,n,fr(f),a),g=new gf(r,n,f,c,.5*d,a),y=l(g.calculateSourceExtent(),d,s),v=y?e:o,_=y?y.getPixelRatio():1;return(h=t.call(this,i,a,_,v)||this).targetProj_=n,h.maxSourceExtent_=c,h.triangulation_=g,h.targetResolution_=a,h.targetExtent_=i,h.sourceImage_=y,h.sourcePixelRatio_=_,h.interpolate_=u,h.canvas_=null,h.sourceListenerKey_=null,h}return tS(a,t),a.prototype.disposeInternal=function(){this.state==r&&this.unlistenSource_(),t.prototype.disposeInternal.call(this)},a.prototype.getImage=function(){return this.canvas_},a.prototype.getProjection=function(){return this.targetProj_},a.prototype.reproject_=function(){var t=this.sourceImage_.getState();if(t==n){var e=wr(this.targetExtent_)/this.targetResolution_,r=vr(this.targetExtent_)/this.targetResolution_;this.canvas_=bf(e,r,this.sourcePixelRatio_,this.sourceImage_.getResolution(),this.maxSourceExtent_,this.targetResolution_,this.targetExtent_,this.triangulation_,[{extent:this.sourceImage_.getExtent(),image:this.sourceImage_.getImage()}],0,void 0,this.interpolate_)}this.state=t,this.changed()},a.prototype.load=function(){if(this.state==e){this.state=r,this.changed();var t=this.sourceImage_.getState();t==n||t==i?this.reproject_():(this.sourceListenerKey_=kt(this.sourceImage_,wt,(function(t){var e=this.sourceImage_.getState();e!=n&&e!=i||(this.unlistenSource_(),this.reproject_())}),this),this.sourceImage_.load())}},a.prototype.unlistenSource_=function(){jt(this.sourceListenerKey_),this.sourceListenerKey_=null},a}(Ge),rS=eS,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="imageloadstart",oS="imageloadend",aS="imageloaderror",sS=function(t){function e(e,r){var n=t.call(this,e)||this;return n.image=r,n}return nS(e,t),e}(nt),lS=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,projection:e.projection,state:e.state,interpolate:n})||this).on,r.once,r.un,r.resolutions_=void 0!==e.resolutions?e.resolutions:null,r.reprojectedImage_=null,r.reprojectedRevision_=0,r}return nS(e,t),e.prototype.getResolutions=function(){return this.resolutions_},e.prototype.findNearestResolution=function(t){if(this.resolutions_){var e=lt(this.resolutions_,t,0);t=this.resolutions_[e]}return t},e.prototype.getImage=function(t,e,r,n){var i=this.getProjection();if(i&&n&&!Yn(i,n)){if(this.reprojectedImage_){if(this.reprojectedRevision_==this.getRevision()&&Yn(this.reprojectedImage_.getProjection(),n)&&this.reprojectedImage_.getResolution()==e&&ir(this.reprojectedImage_.getExtent(),t))return this.reprojectedImage_;this.reprojectedImage_.dispose(),this.reprojectedImage_=null}return this.reprojectedImage_=new rS(i,n,t,e,r,function(t,e,r){return this.getImageInternal(t,e,r,i)}.bind(this),this.getInterpolate()),this.reprojectedRevision_=this.getRevision(),this.reprojectedImage_}return i&&(n=i),this.getImageInternal(t,e,r,n)},e.prototype.getImageInternal=function(t,e,r,n){return a()},e.prototype.handleImageChange=function(t){var e,o=t.target;switch(o.getState()){case r:this.loading=!0,e=iS;break;case n:this.loading=!1,e=oS;break;case i:this.loading=!1,e=aS;break;default:return}this.hasListener(e)&&this.dispatchEvent(new sS(e,o))},e}(Gc);function uS(t,e){t.getImage().src=e}var hS=lS;function cS(t,e){var r=[];Object.keys(e).forEach((function(t){null!==e[t]&&void 0!==e[t]&&r.push(t+"="+encodeURIComponent(e[t]))}));var n=r.join("&");return(t=-1===(t=t.replace(/[?&]$/,"")).indexOf("?")?t+"?":t+"&")+n}var pS=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)}}(),fS=function(t){function e(e){var r=this,n=void 0!==e.crossOrigin?e.crossOrigin:null,i=void 0!==e.imageLoadFunction?e.imageLoadFunction:uS,o=void 0===e.imageSmoothing||e.imageSmoothing;return void 0!==e.interpolate&&(o=e.interpolate),(r=t.call(this,{attributions:e.attributions,interpolate:o,projection:Bn(e.projection)})||this).url_=e.url,r.imageExtent_=e.imageExtent,r.image_=new Rr(r.imageExtent_,void 0,1,r.url_,n,i),r.imageSize_=e.imageSize?e.imageSize:null,r.image_.addEventListener(wt,r.handleImageChange.bind(r)),r}return pS(e,t),e.prototype.getImageExtent=function(){return this.imageExtent_},e.prototype.getImageInternal=function(t,e,r,n){return br(t,this.image_.getExtent())?this.image_:null},e.prototype.getUrl=function(){return this.url_},e.prototype.handleImageChange=function(e){if(this.image_.getState()==n){var r=this.image_.getExtent(),i=this.image_.getImage(),o=void 0,a=void 0;this.imageSize_?(o=this.imageSize_[0],a=this.imageSize_[1]):(o=i.width,a=i.height);var s=wr(r),l=vr(r),u=s/o,h=l/a,c=o,p=a;if(u>h?c=Math.round(s/h):p=Math.round(l/u),c!==o||p!==a){var f=H(c,p);this.getInterpolate()||gt(f,yf);var d=f.canvas;f.drawImage(i,0,0,o,a,0,0,d.width,d.height),this.image_.setImage(d)}}t.prototype.handleImageChange.call(this,e)},e}(hS),dS=fS,gS="1.3.0",yS=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)}}(),vS=[101,101],_S=function(t){function e(e){var r=this,n=e||{},i=void 0===n.imageSmoothing||n.imageSmoothing;return void 0!==n.interpolate&&(i=n.interpolate),(r=t.call(this,{attributions:n.attributions,interpolate:i,projection:n.projection,resolutions:n.resolutions})||this).crossOrigin_=void 0!==n.crossOrigin?n.crossOrigin:null,r.url_=n.url,r.imageLoadFunction_=void 0!==n.imageLoadFunction?n.imageLoadFunction:uS,r.params_=n.params||{},r.v13_=!0,r.updateV13_(),r.serverType_=n.serverType,r.hidpi_=void 0===n.hidpi||n.hidpi,r.image_=null,r.imageSize_=[0,0],r.renderedRevision_=0,r.ratio_=void 0!==n.ratio?n.ratio:1.5,r}return yS(e,t),e.prototype.getFeatureInfoUrl=function(t,e,r,n){if(void 0!==this.url_){var i=Bn(r),o=this.getProjection();o&&o!==i&&(e=wf(o,i,t,e),t=Hn(t,i,o));var a=gr(t,e,0,vS),s={SERVICE:"WMS",VERSION:gS,REQUEST:"GetFeatureInfo",FORMAT:"image/png",TRANSPARENT:!0,QUERY_LAYERS:this.params_.LAYERS};gt(s,this.params_,n);var l=F((t[0]-a[0])/e,4),u=F((a[3]-t[1])/e,4);return s[this.v13_?"I":"X"]=l,s[this.v13_?"J":"Y"]=u,this.getRequestUrl_(a,vS,1,o||i,s)}},e.prototype.getLegendUrl=function(t,e){if(void 0!==this.url_){var r={SERVICE:"WMS",VERSION:gS,REQUEST:"GetLegendGraphic",FORMAT:"image/png"};if(void 0===e||void 0===e.LAYER){var n=this.params_.LAYERS;if(!(!Array.isArray(n)||1===n.length))return;r.LAYER=n}if(void 0!==t){var i=this.getProjection()?this.getProjection().getMetersPerUnit():1;r.SCALE=t*i/28e-5}return gt(r,e),cS(this.url_,r)}},e.prototype.getParams=function(){return this.params_},e.prototype.getImageInternal=function(t,e,r,n){if(void 0===this.url_)return null;e=this.findNearestResolution(e),1==r||this.hidpi_&&void 0!==this.serverType_||(r=1);var i=e/r,o=fr(t),a=gr(o,i,0,[M(wr(t)/i,4),M(vr(t)/i,4)]),s=gr(o,i,0,[M(this.ratio_*wr(t)/i,4),M(this.ratio_*vr(t)/i,4)]),l=this.image_;if(l&&this.renderedRevision_==this.getRevision()&&l.getResolution()==e&&l.getPixelRatio()==r&&He(l.getExtent(),a))return l;var u={SERVICE:"WMS",VERSION:gS,REQUEST:"GetMap",FORMAT:"image/png",TRANSPARENT:!0};gt(u,this.params_),this.imageSize_[0]=O(wr(s)/i,4),this.imageSize_[1]=O(vr(s)/i,4);var h=this.getRequestUrl_(s,this.imageSize_,r,n,u);return this.image_=new Rr(s,e,r,h,this.crossOrigin_,this.imageLoadFunction_),this.renderedRevision_=this.getRevision(),this.image_.addEventListener(wt,this.handleImageChange.bind(this)),this.image_},e.prototype.getImageLoadFunction=function(){return this.imageLoadFunction_},e.prototype.getRequestUrl_=function(t,e,r,n,i){if(_(void 0!==this.url_,9),i[this.v13_?"CRS":"SRS"]=n.getCode(),"STYLES"in this.params_||(i.STYLES=""),1!=r)switch(this.serverType_){case"geoserver":var o=90*r+.5|0;"FORMAT_OPTIONS"in i?i.FORMAT_OPTIONS+=";dpi:"+o:i.FORMAT_OPTIONS="dpi:"+o;break;case"mapserver":i.MAP_RESOLUTION=90*r;break;case"carmentaserver":case"qgis":i.DPI=90*r;break;default:_(!1,8)}i.WIDTH=e[0],i.HEIGHT=e[1];var a,s=n.getAxisOrientation();return a=this.v13_&&"ne"==s.substr(0,2)?[t[1],t[0],t[3],t[2]]:t,i.BBOX=a.join(","),cS(this.url_,i)},e.prototype.getUrl=function(){return this.url_},e.prototype.setImageLoadFunction=function(t){this.image_=null,this.imageLoadFunction_=t,this.changed()},e.prototype.setUrl=function(t){t!=this.url_&&(this.url_=t,this.image_=null,this.changed())},e.prototype.updateParams=function(t){gt(this.params_,t),this.updateV13_(),this.image_=null,this.changed()},e.prototype.updateV13_=function(){var t=this.params_.VERSION||gS;this.v13_=Sn(t,"1.3")>=0},e}(hS),mS=_S,xS=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)}}(),wS=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:['&#169; <a href="https://www.openstreetmap.org/copyright" target="_blank">OpenStreetMap</a> 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 xS(e,t),e}($b),bS=wS,SS=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)}}(),CS=function(t){function e(e){var r=this,n=e||{},i=void 0===n.imageSmoothing||n.imageSmoothing;void 0!==n.interpolate&&(i=n.interpolate);var o=n.params||{},a=!("TRANSPARENT"in o)||o.TRANSPARENT;return(r=t.call(this,{attributions:n.attributions,attributionsCollapsible:n.attributionsCollapsible,cacheSize:n.cacheSize,crossOrigin:n.crossOrigin,interpolate:i,opaque:!a,projection:n.projection,reprojectionErrorThreshold:n.reprojectionErrorThreshold,tileClass:n.tileClass,tileGrid:n.tileGrid,tileLoadFunction:n.tileLoadFunction,url:n.url,urls:n.urls,wrapX:void 0===n.wrapX||n.wrapX,transition:n.transition,zDirection:n.zDirection})||this).gutter_=void 0!==n.gutter?n.gutter:0,r.params_=o,r.v13_=!0,r.serverType_=n.serverType,r.hidpi_=void 0===n.hidpi||n.hidpi,r.tmpExtent_=[1/0,1/0,-1/0,-1/0],r.updateV13_(),r.setKey(r.getKeyForParams_()),r}return SS(e,t),e.prototype.getFeatureInfoUrl=function(t,e,r,n){var i=Bn(r),o=this.getProjection(),a=this.getTileGrid();a||(a=this.getTileGridForProjection(i));var s=a.getZForResolution(e,this.zDirection),l=a.getTileCoordForCoordAndZ(t,s);if(!(a.getResolutions().length<=l[0])){var h=a.getResolution(l[0]),c=a.getTileCoordExtent(l,this.tmpExtent_),f=p(a.getTileSize(l[0]),this.tmpSize),d=this.gutter_;0!==d&&(f=u(f,d,this.tmpSize),c=qe(c,h*d,c)),o&&o!==i&&(h=wf(o,i,t,h),c=function(t,e,r,n){return Cr(t,Zn(e,r),void 0,n)}(c,i,o),t=Hn(t,i,o));var g={SERVICE:"WMS",VERSION:gS,REQUEST:"GetFeatureInfo",FORMAT:"image/png",TRANSPARENT:!0,QUERY_LAYERS:this.params_.LAYERS};gt(g,this.params_,n);var y=Math.floor((t[0]-c[0])/h),v=Math.floor((c[3]-t[1])/h);return g[this.v13_?"I":"X"]=y,g[this.v13_?"J":"Y"]=v,this.getRequestUrl_(l,f,c,1,o||i,g)}},e.prototype.getLegendUrl=function(t,e){if(void 0!==this.urls[0]){var r={SERVICE:"WMS",VERSION:gS,REQUEST:"GetLegendGraphic",FORMAT:"image/png"};if(void 0===e||void 0===e.LAYER){var n=this.params_.LAYERS;if(!(!Array.isArray(n)||1===n.length))return;r.LAYER=n}if(void 0!==t){var i=this.getProjection()?this.getProjection().getMetersPerUnit():1;r.SCALE=t*i/28e-5}return gt(r,e),cS(this.urls[0],r)}},e.prototype.getGutter=function(){return this.gutter_},e.prototype.getParams=function(){return this.params_},e.prototype.getRequestUrl_=function(t,e,r,n,i,o){var a=this.urls;if(a){if(o.WIDTH=e[0],o.HEIGHT=e[1],o[this.v13_?"CRS":"SRS"]=i.getCode(),"STYLES"in this.params_||(o.STYLES=""),1!=n)switch(this.serverType_){case"geoserver":var s=90*n+.5|0;"FORMAT_OPTIONS"in o?o.FORMAT_OPTIONS+=";dpi:"+s:o.FORMAT_OPTIONS="dpi:"+s;break;case"mapserver":o.MAP_RESOLUTION=90*n;break;case"carmentaserver":case"qgis":o.DPI=90*n;break;default:_(!1,52)}var l,u=i.getAxisOrientation(),h=r;if(this.v13_&&"ne"==u.substr(0,2)){var c=void 0;c=r[0],h[0]=r[1],h[1]=c,c=r[2],h[2]=r[3],h[3]=c}if(o.BBOX=h.join(","),1==a.length)l=a[0];else l=a[T(of(t),a.length)];return cS(l,o)}},e.prototype.getTilePixelRatio=function(t){return this.hidpi_&&void 0!==this.serverType_?t:1},e.prototype.getKeyForParams_=function(){var t=0,e=[];for(var r in this.params_)e[t++]=r+"-"+this.params_[r];return e.join("/")},e.prototype.updateParams=function(t){gt(this.params_,t),this.updateV13_(),this.setKey(this.getKeyForParams_())},e.prototype.updateV13_=function(){var t=this.params_.VERSION||gS;this.v13_=Sn(t,"1.3")>=0},e.prototype.tileUrlFunction=function(t,e,r){var n=this.getTileGrid();if(n||(n=this.getTileGridForProjection(r)),!(n.getResolutions().length<=t[0])){1==e||this.hidpi_&&void 0!==this.serverType_||(e=1);var i=n.getResolution(t[0]),o=n.getTileCoordExtent(t,this.tmpExtent_),a=p(n.getTileSize(t[0]),this.tmpSize),s=this.gutter_;0!==s&&(a=u(a,s,this.tmpSize),o=qe(o,i*s,o)),1!=e&&(a=c(a,e,this.tmpSize));var l={SERVICE:"WMS",VERSION:gS,REQUEST:"GetMap",FORMAT:"image/png",TRANSPARENT:!0};return gt(l,this.params_),this.getRequestUrl_(t,a,o,e,r,l)}},e}(Kf),ES=CS;Ut.unByKey=Nt;let TS={Control:gl,Zoom:Cl,Attribution:ml,ScaleLine:Vl,LayerSwitcher:f_},PS={GeoJSON:Ho,KML:Wx,MVT:Ta},RS={Group:fs,Tile:ld,Vector:Ac,VectorTile:_d,WebGLPoints:Yb,Heatmap:kw,Image:Bw},OS={toLonLat:function(t,e){var r=Hn(t,void 0!==e?e:"EPSG:3857","EPSG:4326"),n=r[0];return(n<-180||n>180)&&(r[0]=T(n+180,360)-180),r},fromLonLat:qn},FS={LineString:$i,Point:oo,MultiPoint:lo},MS={Icon:Ar,Style:Do,Text:No,Stroke:Fo,Fill:Pe,Circle:Ee},IS={OSM:bS,XYZ:$b,TileWMS:ES,BingMaps:Hb,Vector:Jc,VectorTile:Rd,ImageWMS:mS,ImageStatic:dS};t.Collection=us,t.Feature=jr,t.Map=Hp,t.Observable=Ut,t.Overlay=Il,t.View=ll,t.applyStyle=function(t,e,r,n,i){var o,a,s;return void 0===r&&(r=""),void 0===n&&(n={}),void 0===i&&(i=void 0),"string"==typeof n?(o=n,s={}):(o=n.styleUrl,s=n),i||(i=s.resolutions),o||"string"!=typeof e||e.trim().startsWith("{")||(o=e),o&&(o=o.startsWith("data:")?location.href:Rv(o,s.accessToken),s=function(t,e){return e.accessToken||(e=gt({},e),new URL(t).searchParams.forEach((function(t,r){e.accessToken=t,e.accessTokenParam=r}))),e}(o,s)),new Promise((function(n,l){(function(t,e){if("string"!=typeof t)return Promise.resolve(t);if(!t.trim().startsWith("{"))return Av("Style",t=Rv(t,e.accessToken),e);try{var r=JSON.parse(t);return Promise.resolve(r)}catch(t){return Promise.reject(t)}})(e,s).then((function(e){if(8!=e.version)return l(new Error("glStyle version 8 required."));if(!(t instanceof Ac||t instanceof _d))return l(new Error("Can only apply to VectorLayer or VectorTileLayer"));var u,h,c,p=t instanceof _d?"vector":"geojson";if(r?a=Array.isArray(r)?e.layers.find((function(t){return t.id===r[0]})).source:r:(a=Object.keys(e.sources).find((function(t){return e.sources[t].type===p})),r=a),!a)return l(new Error("No "+p+" source found in the glStyle."));function f(){if(t instanceof _d)return function(t,e,r){return new Promise((function(n,i){(function(t,e,r){void 0===r&&(r={});var n=[e,JSON.stringify(t)].toString(),i=kv[n];if(!i||r.transformRequest){var o=t.url;if(o&&!t.tiles){var a=Ov(o,r.accessToken,r.accessTokenParam||"access_token",e||location.href);i=o.startsWith("mapbox://")?Promise.resolve(gt({},t,{url:void 0,tiles:a})):Av("Source",a,r).then((function(t){for(var e=0,n=t.tiles.length;e<n;++e){var i=t.tiles[e];if(r.transformRequest){var o=r.transformRequest(a,"Source");o&&(a=o.url)}var s=Ov(i,r.accessToken,r.accessTokenParam||"access_token",a);if(r.transformRequest){var l=r.transformRequest(s,"Tiles");l instanceof Request&&(s=decodeURI(l.url))}t.tiles[e]=s}return Promise.resolve(t)}))}else t=gt({},t,{tiles:t.tiles.map((function(t){return Ov(t,r.accessToken,r.accessTokenParam||"access_token",e||location.href)}))}),i=Promise.resolve(gt({},t));kv[n]=i}return i})(t,e,r).then((function(t){var e=new $f({tileJSON:t}),r=e.getTileJSON(),i=e.getTileGrid(),o=function(t){var e=t.bounds;if(e){var r=qn([e[0],e[1]]),n=qn([e[2],e[3]]);return[r[0],r[1],n[0],n[1]]}}(r),a=r.minzoom||0,s=r.maxzoom||22,l={attributions:e.getAttributions(),format:new Ta,tileGrid:new lf({origin:i.getOrigin(0),extent:o||i.getExtent(),minZoom:a,resolutions:Mv.slice(0,s+1),tileSize:512})};Array.isArray(r.tiles)?l.urls=r.tiles:l.url=r.tiles,t.olSourceOptions&&Object.assign(l,t.olSourceOptions),n(new Rd(l))})).catch(i)}))}(e.sources[a],o,s).then((function(e){var r=t.getSource();if(r?e!==r&&(r.setTileUrlFunction(e.getTileUrlFunction()),r.format_||(r.format_=e.format_),r.getAttributions()||r.setAttributions(e.getAttributions()),r.getTileLoadFunction()===Od&&r.setTileLoadFunction(e.getTileLoadFunction()),Yn(r.getProjection(),e.getProjection())&&(r.tileGrid=e.getTileGrid())):t.setSource(e),!isFinite(t.getMaxResolution())&&!isFinite(t.getMinZoom())){var n=t.getSource().getTileGrid();t.setMaxResolution(n.getResolution(n.getMinZoom()))}}));var r=e.sources[a],n=t.getSource();n&&n.get("mapbox-source")===r||(n=function(t,e,r){var n=t.data,i={};if("string"==typeof n){var o=Ov(n,r.accessToken,r.accessTokenParam||"access_token",e||location.href);if(r.transformRequest){var a=r.transformRequest(o,"GeoJSON");a instanceof Request&&(o=encodeURI(a.url))}i.url=o}else i.features=l_.readFeatures(n,{featureProjection:"EPSG:3857"});var s=new Jc(gt({attributions:t.attribution,format:l_},i));return s.set("mapbox-source",t),s}(r,o,s));var i=t.getSource();return i?n!==i&&(i.getAttributions()||i.setAttributions(n.getAttributions()),i.format_||(i.format_=n.getFormat()),i.url_=n.getUrl()):t.setSource(n),Promise.resolve()}function d(){c||e.sprite&&!u?c?(t.setStyle(c),f().then(n).catch(l)):l(new Error("Something went wrong trying to apply style.")):(c=s_(t,e,r,i,u,h,Kv),t.getStyle()?f().then(n).catch(l):l(new Error("Nothing to show for source ["+a+"]")))}if(e.sprite){var g=new URL(function(t,e,r){var n=Pv(t);if(!n)return decodeURI(new URL(t,r).href);var i="sprites/";if(0!==n.indexOf(i))throw new Error("unexpected sprites url: "+t);var o=n.slice(i.length);return Tv+"/styles/v1/"+o+"/sprite?access_token="+e}(e.sprite,s.accessToken,o||location.href)),y=.5==(window.devicePixelRatio>=1.5?.5:1)?"@2x":"",v=g.origin+g.pathname+y+".json"+g.search;new Promise((function(t,e){Av("Sprite",v,s).then(t).catch((function(r){Av("Sprite",v=g.origin+g.pathname+".json"+g.search,s).then(t).catch(e)}))})).then((function(t){if(void 0===t&&l(new Error("No sprites found.")),u=t,h=g.origin+g.pathname+y+".png"+g.search,s.transformRequest){var e=s.transformRequest(h,"SpriteImage");e instanceof Request&&(h=encodeURI(e.url))}d()})).catch((function(t){l(new Error("Sprites cannot be loaded: "+v+": "+t.message))}))}else d()})).catch(l)}))},t.control=TS,t.format=PS,t.geom=FS,t.interaction=Kp,t.layer=RS,t.proj=OS,t.source=IS,t.sphere=Dn,t.style=MS,t.stylefunction=s_,Object.defineProperty(t,"__esModule",{value:!0})}));
//# sourceMappingURL=ol-custom.js.map