@opensystemslab/map 0.4.1 → 0.4.2
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/map.es.js +7 -7
- package/dist/map.umd.js +7 -7
- package/dist/style.css +1 -1
- package/package.json +2 -2
package/dist/map.es.js
CHANGED
@@ -14,7 +14,7 @@ var t=Object.defineProperty,e=Object.defineProperties,i=Object.getOwnPropertyDes
|
|
14
14
|
* Copyright 2017 Google LLC
|
15
15
|
* SPDX-License-Identifier: BSD-3-Clause
|
16
16
|
*/
|
17
|
-
var S,C,T,E;w.finalized=!0,w.elementProperties=new Map,w.elementStyles=[],w.shadowRootOptions={mode:"open"},null===(g=(y=globalThis).reactiveElementPlatformSupport)||void 0===g||g.call(y,{ReactiveElement:w}),(null!==(m=(v=globalThis).reactiveElementVersions)&&void 0!==m?m:v.reactiveElementVersions=[]).push("1.0.0-rc.2");const k=globalThis.trustedTypes,P=k?k.createPolicy("lit-html",{createHTML:t=>t}):void 0,O=`lit$${(Math.random()+"").slice(9)}$`,R="?"+O,I=`<${R}>`,F=document,j=(t="")=>F.createComment(t),M=t=>null===t||"object"!=typeof t&&"function"!=typeof t,A=Array.isArray,L=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,
|
17
|
+
var S,C,T,E;w.finalized=!0,w.elementProperties=new Map,w.elementStyles=[],w.shadowRootOptions={mode:"open"},null===(g=(y=globalThis).reactiveElementPlatformSupport)||void 0===g||g.call(y,{ReactiveElement:w}),(null!==(m=(v=globalThis).reactiveElementVersions)&&void 0!==m?m:v.reactiveElementVersions=[]).push("1.0.0-rc.2");const k=globalThis.trustedTypes,P=k?k.createPolicy("lit-html",{createHTML:t=>t}):void 0,O=`lit$${(Math.random()+"").slice(9)}$`,R="?"+O,I=`<${R}>`,F=document,j=(t="")=>F.createComment(t),M=t=>null===t||"object"!=typeof t&&"function"!=typeof t,A=Array.isArray,L=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,D=/-->/g,z=/>/g,G=/>|[ \n\r](?:([^\s"'>=/]+)([ \n\r]*=[ \n\r]*(?:[^ \n\r"'`<>=]|("|')|))|$)/g,N=/'/g,B=/"/g,W=/^(?:script|style|textarea)$/i,q=(Y=1,(t,...e)=>({_$litType$:Y,strings:t,values:e})),V=Symbol.for("lit-noChange"),U=Symbol.for("lit-nothing"),X=new WeakMap,K=F.createTreeWalker(F,129,null,!1);var Y,Z,H,$,J,Q,tt;class et{constructor({strings:t,_$litType$:e},i){let n;this.parts=[];let r=0,o=0;const s=t.length-1,a=this.parts,[l,u]=((t,e)=>{const i=t.length-1,n=[];let r,o=2===e?"<svg>":"",s=L;for(let l=0;l<i;l++){const e=t[l];let i,a,u=-1,h=0;for(;h<e.length&&(s.lastIndex=h,a=s.exec(e),null!==a);)h=s.lastIndex,s===L?"!--"===a[1]?s=D:void 0!==a[1]?s=z:void 0!==a[2]?(W.test(a[2])&&(r=RegExp("</"+a[2],"g")),s=G):void 0!==a[3]&&(s=G):s===G?">"===a[0]?(s=null!=r?r:L,u=-1):void 0===a[1]?u=-2:(u=s.lastIndex-a[2].length,i=a[1],s=void 0===a[3]?G:'"'===a[3]?B:N):s===B||s===N?s=G:s===D||s===z?s=L:(s=G,r=void 0);const c=s===G&&t[l+1].startsWith("/>")?" ":"";o+=s===L?e+I:u>=0?(n.push(i),e.slice(0,u)+"$lit$"+e.slice(u)+O+c):e+O+(-2===u?(n.push(void 0),l):c)}const a=o+(t[i]||"<?>")+(2===e?"</svg>":"");return[void 0!==P?P.createHTML(a):a,n]})(t,e);if(this.el=et.createElement(l,i),K.currentNode=this.el.content,2===e){const t=this.el.content,e=t.firstChild;e.remove(),t.append(...e.childNodes)}for(;null!==(n=K.nextNode())&&a.length<s;){if(1===n.nodeType){if(n.hasAttributes()){const t=[];for(const e of n.getAttributeNames())if(e.endsWith("$lit$")||e.startsWith(O)){const i=u[o++];if(t.push(e),void 0!==i){const t=n.getAttribute(i.toLowerCase()+"$lit$").split(O),e=/([.?@])?(.*)/.exec(i);a.push({type:1,index:r,name:e[2],strings:t,ctor:"."===e[1]?st:"?"===e[1]?at:"@"===e[1]?lt:ot})}else a.push({type:6,index:r})}for(const e of t)n.removeAttribute(e)}if(W.test(n.tagName)){const t=n.textContent.split(O),e=t.length-1;if(e>0){n.textContent=k?k.emptyScript:"";for(let i=0;i<e;i++)n.append(t[i],j()),K.nextNode(),a.push({type:2,index:++r});n.append(t[e],j())}}}else if(8===n.nodeType)if(n.data===R)a.push({type:2,index:r});else{let t=-1;for(;-1!==(t=n.data.indexOf(O,t+1));)a.push({type:7,index:r}),t+=O.length-1}r++}}static createElement(t,e){const i=F.createElement("template");return i.innerHTML=t,i}}function it(t,e,i=t,n){var r,o,s,a;if(e===V)return e;let l=void 0!==n?null===(r=i.Σi)||void 0===r?void 0:r[n]:i.Σo;const u=M(e)?void 0:e._$litDirective$;return(null==l?void 0:l.constructor)!==u&&(null===(o=null==l?void 0:l.O)||void 0===o||o.call(l,!1),void 0===u?l=void 0:(l=new u(t),l.T(t,i,n)),void 0!==n?(null!==(s=(a=i).Σi)&&void 0!==s?s:a.Σi=[])[n]=l:i.Σo=l),void 0!==l&&(e=it(t,l.S(t,e.values),l,n)),e}class nt{constructor(t,e){this.l=[],this.N=void 0,this.D=t,this.M=e}u(t){var e;const{el:{content:i},parts:n}=this.D,r=(null!==(e=null==t?void 0:t.creationScope)&&void 0!==e?e:F).importNode(i,!0);K.currentNode=r;let o=K.nextNode(),s=0,a=0,l=n[0];for(;void 0!==l;){if(s===l.index){let e;2===l.type?e=new rt(o,o.nextSibling,this,t):1===l.type?e=new l.ctor(o,l.name,l.strings,this,t):6===l.type&&(e=new ut(o,this,t)),this.l.push(e),l=n[++a]}s!==(null==l?void 0:l.index)&&(o=K.nextNode(),s++)}return r}v(t){let e=0;for(const i of this.l)void 0!==i&&(void 0!==i.strings?(i.I(t,i,e),e+=i.strings.length-2):i.I(t[e])),e++}}class rt{constructor(t,e,i,n){this.type=2,this.N=void 0,this.A=t,this.B=e,this.M=i,this.options=n}setConnected(t){var e;null===(e=this.P)||void 0===e||e.call(this,t)}get parentNode(){return this.A.parentNode}get startNode(){return this.A}get endNode(){return this.B}I(t,e=this){t=it(this,t,e),M(t)?t===U||null==t||""===t?(this.H!==U&&this.R(),this.H=U):t!==this.H&&t!==V&&this.m(t):void 0!==t._$litType$?this._(t):void 0!==t.nodeType?this.$(t):(t=>{var e;return A(t)||"function"==typeof(null===(e=t)||void 0===e?void 0:e[Symbol.iterator])})(t)?this.g(t):this.m(t)}k(t,e=this.B){return this.A.parentNode.insertBefore(t,e)}$(t){this.H!==t&&(this.R(),this.H=this.k(t))}m(t){const e=this.A.nextSibling;null!==e&&3===e.nodeType&&(null===this.B?null===e.nextSibling:e===this.B.previousSibling)?e.data=t:this.$(F.createTextNode(t)),this.H=t}_(t){var e;const{values:i,_$litType$:n}=t,r="number"==typeof n?this.C(t):(void 0===n.el&&(n.el=et.createElement(n.h,this.options)),n);if((null===(e=this.H)||void 0===e?void 0:e.D)===r)this.H.v(i);else{const t=new nt(r,this),e=t.u(this.options);t.v(i),this.$(e),this.H=t}}C(t){let e=X.get(t.strings);return void 0===e&&X.set(t.strings,e=new et(t)),e}g(t){A(this.H)||(this.H=[],this.R());const e=this.H;let i,n=0;for(const r of t)n===e.length?e.push(i=new rt(this.k(j()),this.k(j()),this,this.options)):i=e[n],i.I(r),n++;n<e.length&&(this.R(i&&i.B.nextSibling,n),e.length=n)}R(t=this.A.nextSibling,e){var i;for(null===(i=this.P)||void 0===i||i.call(this,!1,!0,e);t&&t!==this.B;){const e=t.nextSibling;t.remove(),t=e}}}class ot{constructor(t,e,i,n,r){this.type=1,this.H=U,this.N=void 0,this.V=void 0,this.element=t,this.name=e,this.M=n,this.options=r,i.length>2||""!==i[0]||""!==i[1]?(this.H=Array(i.length-1).fill(U),this.strings=i):this.H=U}get tagName(){return this.element.tagName}I(t,e=this,i,n){const r=this.strings;let o=!1;if(void 0===r)t=it(this,t,e,0),o=!M(t)||t!==this.H&&t!==V,o&&(this.H=t);else{const n=t;let s,a;for(t=r[0],s=0;s<r.length-1;s++)a=it(this,n[i+s],e,s),a===V&&(a=this.H[s]),o||(o=!M(a)||a!==this.H[s]),a===U?t=U:t!==U&&(t+=(null!=a?a:"")+r[s+1]),this.H[s]=a}o&&!n&&this.W(t)}W(t){t===U?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,null!=t?t:"")}}class st extends ot{constructor(){super(...arguments),this.type=3}W(t){this.element[this.name]=t===U?void 0:t}}class at extends ot{constructor(){super(...arguments),this.type=4}W(t){t&&t!==U?this.element.setAttribute(this.name,""):this.element.removeAttribute(this.name)}}class lt extends ot{constructor(){super(...arguments),this.type=5}I(t,e=this){var i;if((t=null!==(i=it(this,t,e,0))&&void 0!==i?i:U)===V)return;const n=this.H,r=t===U&&n!==U||t.capture!==n.capture||t.once!==n.once||t.passive!==n.passive,o=t!==U&&(n===U||r);r&&this.element.removeEventListener(this.name,this,n),o&&this.element.addEventListener(this.name,this,t),this.H=t}handleEvent(t){var e,i;"function"==typeof this.H?this.H.call(null!==(i=null===(e=this.options)||void 0===e?void 0:e.host)&&void 0!==i?i:this.element,t):this.H.handleEvent(t)}}class ut{constructor(t,e,i){this.element=t,this.type=6,this.N=void 0,this.V=void 0,this.M=e,this.options=i}I(t){it(this,t)}}null===(C=(S=globalThis).litHtmlPlatformSupport)||void 0===C||C.call(S,et,rt),(null!==(T=(E=globalThis).litHtmlVersions)&&void 0!==T?T:E.litHtmlVersions=[]).push("2.0.0-rc.3"),(null!==(Z=(tt=globalThis).litElementVersions)&&void 0!==Z?Z:tt.litElementVersions=[]).push("3.0.0-rc.2");class ht extends w{constructor(){super(...arguments),this.renderOptions={host:this},this.Φt=void 0}createRenderRoot(){var t,e;const i=super.createRenderRoot();return null!==(t=(e=this.renderOptions).renderBefore)&&void 0!==t||(e.renderBefore=i.firstChild),i}update(t){const e=this.render();super.update(t),this.Φt=((t,e,i)=>{var n,r;const o=null!==(n=null==i?void 0:i.renderBefore)&&void 0!==n?n:e;let s=o._$litPart$;if(void 0===s){const t=null!==(r=null==i?void 0:i.renderBefore)&&void 0!==r?r:null;o._$litPart$=s=new rt(e.insertBefore(j(),t),t,void 0,i)}return s.I(t),s})(e,this.renderRoot,this.renderOptions)}connectedCallback(){var t;super.connectedCallback(),null===(t=this.Φt)||void 0===t||t.setConnected(!0)}disconnectedCallback(){var t;super.disconnectedCallback(),null===(t=this.Φt)||void 0===t||t.setConnected(!1)}render(){return V}}ht.finalized=!0,ht._$litElement$=!0,null===($=(H=globalThis).litElementHydrateSupport)||void 0===$||$.call(H,{LitElement:ht}),null===(Q=(J=globalThis).litElementPlatformSupport)||void 0===Q||Q.call(J,{LitElement:ht});
|
18
18
|
/**
|
19
19
|
* @license
|
20
20
|
* Copyright 2017 Google LLC
|
@@ -25,11 +25,9 @@ const ct=(t,e)=>"method"===e.kind&&e.descriptor&&!("value"in e.descriptor)?l(a({
|
|
25
25
|
* @license
|
26
26
|
* Copyright 2017 Google LLC
|
27
27
|
* SPDX-License-Identifier: BSD-3-Clause
|
28
|
-
*/function pt(t){return(e,i)=>{return void 0!==i?(n=t,r=i,void e.constructor.createProperty(r,n)):ct(t,e);var n,r}}var dt=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}(),ft="propertychange",yt=function(){function t(){this.disposed=!1}return t.prototype.dispose=function(){this.disposed||(this.disposed=!0,this.disposeInternal())},t.prototype.disposeInternal=function(){},t}();function gt(t,e){return t>e?1:t<e?-1:0}function mt(t,e,i){var n=t.length;if(t[0]<=e)return 0;if(e<=t[n-1])return n-1;var r=void 0;if(i>0){for(r=1;r<n;++r)if(t[r]<e)return r-1}else if(i<0){for(r=1;r<n;++r)if(t[r]<=e)return r}else for(r=1;r<n;++r){if(t[r]==e)return r;if(t[r]<e)return"function"==typeof i?i(e,t[r-1],t[r])>0?r-1:r:t[r-1]-e<e-t[r]?r-1:r}return n-1}function vt(t,e,i){for(;e<i;){var n=t[e];t[e]=t[i],t[i]=n,++e,--i}}function _t(t,e){for(var i=Array.isArray(e)?e:[e],n=i.length,r=0;r<n;r++)t[t.length]=i[r]}function xt(t,e){var i=t.length;if(i!==e.length)return!1;for(var n=0;n<i;n++)if(t[n]!==e[n])return!1;return!0}function bt(){return!0}function wt(){return!1}function St(){}var Ct="function"==typeof Object.assign?Object.assign:function(t,e){if(null==t)throw new TypeError("Cannot convert undefined or null to object");for(var i=Object(t),n=1,r=arguments.length;n<r;++n){var o=arguments[n];if(null!=o)for(var s in o)o.hasOwnProperty(s)&&(i[s]=o[s])}return i};function Tt(t){for(var e in t)delete t[e]}var Et="function"==typeof Object.values?Object.values:function(t){var e=[];for(var i in t)e.push(t[i]);return e};function kt(t){var e;for(e in t)return!1;return!e}var Pt,Ot=(Pt=function(t,e){return(Pt=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(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 i(){this.constructor=t}Pt(t,e),t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)}),Rt=function(t){function e(e){var i=t.call(this)||this;return i.eventTarget_=e,i.pendingRemovals_=null,i.dispatching_=null,i.listeners_=null,i}return Ot(e,t),e.prototype.addEventListener=function(t,e){if(t&&e){var i=this.listeners_||(this.listeners_={}),n=i[t]||(i[t]=[]);-1===n.indexOf(e)&&n.push(e)}},e.prototype.dispatchEvent=function(t){var e="string"==typeof t?new dt(t):t,i=e.type;e.target||(e.target=this.eventTarget_||this);var n,r=this.listeners_&&this.listeners_[i];if(r){var o=this.dispatching_||(this.dispatching_={}),s=this.pendingRemovals_||(this.pendingRemovals_={});i in o||(o[i]=0,s[i]=0),++o[i];for(var a=0,l=r.length;a<l;++a)if(!1===(n="handleEvent"in r[a]?r[a].handleEvent(e):r[a].call(this,e))||e.propagationStopped){n=!1;break}if(--o[i],0===o[i]){var u=s[i];for(delete s[i];u--;)this.removeEventListener(i,St);delete o[i]}return n}},e.prototype.disposeInternal=function(){this.listeners_&&Tt(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 i=this.listeners_&&this.listeners_[t];if(i){var n=i.indexOf(e);-1!==n&&(this.pendingRemovals_&&t in this.pendingRemovals_?(i[n]=St,++this.pendingRemovals_[t]):(i.splice(n,1),0===i.length&&delete this.listeners_[t]))}},e}(yt),It="change",Ft="error",jt="clear",Mt="contextmenu",At="click",Lt="dblclick",zt="keydown",Dt="keypress",Gt="load",Nt="resize",Bt="touchmove",Wt="wheel";function qt(t,e,i,n,r){if(n&&n!==t&&(i=i.bind(n)),r){var o=i;i=function(){t.removeEventListener(e,i),o.apply(this,arguments)}}var s={target:t,type:e,listener:i};return t.addEventListener(e,i),s}function Vt(t,e,i,n){return qt(t,e,i,n,!0)}function Ut(t){t&&t.target&&(t.target.removeEventListener(t.type,t.listener),Tt(t))}var Xt=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}(),Kt=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 Xt(e,t),e.prototype.changed=function(){++this.revision_,this.dispatchEvent(It)},e.prototype.getRevision=function(){return this.revision_},e.prototype.onInternal=function(t,e){if(Array.isArray(t)){for(var i=t.length,n=new Array(i),r=0;r<i;++r)n[r]=qt(this,t[r],e);return n}return qt(this,t,e)},e.prototype.onceInternal=function(t,e){var i;if(Array.isArray(t)){var n=t.length;i=new Array(n);for(var r=0;r<n;++r)i[r]=Vt(this,t[r],e)}else i=Vt(this,t,e);return e.ol_key=i,i},e.prototype.unInternal=function(t,e){var i=e.ol_key;if(i)!function(t){if(Array.isArray(t))for(var e=0,i=t.length;e<i;++e)Ut(t[e]);else Ut(t)}(i);else if(Array.isArray(t))for(var n=0,r=t.length;n<r;++n)this.removeEventListener(t[n],e);else this.removeEventListener(t,e)},e}(Rt);Kt.prototype.on,Kt.prototype.once,Kt.prototype.un;var Yt=Kt;function Zt(){return function(){throw new Error("Unimplemented abstract method.")}()}var Ht=0;function $t(t){return t.ol_uid||(t.ol_uid=String(++Ht))}var Jt=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}(),Qt=function(t){function e(e,i,n){var r=t.call(this,e)||this;return r.key=i,r.oldValue=n,r}return Jt(e,t),e}(dt),te=function(t){function e(e){var i=t.call(this)||this;return i.on,i.once,i.un,$t(i),i.values_=null,void 0!==e&&i.setProperties(e),i}return Jt(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_&&Ct({},this.values_)||{}},e.prototype.hasProperties=function(){return!!this.values_},e.prototype.notify=function(t,e){var i;i="change:"+t,this.dispatchEvent(new Qt(i,t,e)),i=ft,this.dispatchEvent(new Qt(i,t,e))},e.prototype.addChangeListener=function(t,e){this.addEventListener("change:"+t,e)},e.prototype.removeChangeListener=function(t,e){this.removeEventListener("change:"+t,e)},e.prototype.set=function(t,e,i){var n=this.values_||(this.values_={});if(i)n[t]=e;else{var r=n[t];n[t]=e,r!==e&&this.notify(t,r)}},e.prototype.setProperties=function(t,e){for(var i in t)this.set(i,t[i],e)},e.prototype.applyProperties=function(t){t.values_&&Ct(this.values_||(this.values_={}),t.values_)},e.prototype.unset=function(t,e){if(this.values_&&t in this.values_){var i=this.values_[t];delete this.values_[t],kt(this.values_)&&(this.values_=null),e||this.notify(t,i)}},e}(Yt),ee="postrender",ie="movestart",ne="moveend",re="undefined"!=typeof navigator&&void 0!==navigator.userAgent?navigator.userAgent.toLowerCase():"",oe=-1!==re.indexOf("firefox");-1!==re.indexOf("safari")&&re.indexOf("chrom");var se=-1!==re.indexOf("webkit")&&-1==re.indexOf("edge"),ae=-1!==re.indexOf("macintosh"),le="undefined"!=typeof devicePixelRatio?devicePixelRatio:1,ue="undefined"!=typeof WorkerGlobalScope&&"undefined"!=typeof OffscreenCanvas&&self instanceof WorkerGlobalScope,he="undefined"!=typeof Image&&Image.prototype.decode,ce=function(){var t=!1;try{var e=Object.defineProperty({},"passive",{get:function(){t=!0}});window.addEventListener("_",null,e),window.removeEventListener("_",null,e)}catch(i){}return t}();function pe(t,e,i,n){var r=i&&i.length?i.shift():ue?new OffscreenCanvas(t||300,e||300):document.createElement("canvas");return t&&(r.width=t),e&&(r.height=e),r.getContext("2d",n)}function de(t,e){var i=e.parentNode;i&&i.replaceChild(t,e)}function fe(t){return t&&t.parentNode?t.parentNode.removeChild(t):null}var ye=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}(),ge=function(t){function e(e){var i=t.call(this)||this,n=e.element;return!n||e.target||n.style.pointerEvents||(n.style.pointerEvents="auto"),i.element=n||null,i.target_=null,i.map_=null,i.listenerKeys=[],e.render&&(i.render=e.render),e.target&&i.setTarget(e.target),i}return ye(e,t),e.prototype.disposeInternal=function(){fe(this.element),t.prototype.disposeInternal.call(this)},e.prototype.getMap=function(){return this.map_},e.prototype.setMap=function(t){this.map_&&fe(this.element);for(var e=0,i=this.listenerKeys.length;e<i;++e)Ut(this.listenerKeys[e]);(this.listenerKeys.length=0,this.map_=t,this.map_)&&((this.target_?this.target_:t.getOverlayContainerStopEvent()).appendChild(this.element),this.render!==St&&this.listenerKeys.push(qt(t,ee,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}(te),me=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"),ve=["style","variant","weight","size","lineHeight","family"],_e=function(t){var e=t.match(me);if(!e)return null;for(var i={lineHeight:"normal",size:"1.2em",style:"normal",weight:"normal",variant:"normal"},n=0,r=ve.length;n<r;++n){var o=e[n+1];void 0!==o&&(i[ve[n]]=o)}return i.families=i.family.split(/,\s?/),i},xe="opacity",be="visible",we="extent",Se="zIndex",Ce="maxResolution",Te="minResolution",Ee="maxZoom",ke="minZoom",Pe="source",Oe=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}(),Re=function(t){function e(e){var i=this,n="Assertion failed. See https://openlayers.org/en/"+("v"+"6.6.1".split("-")[0])+"/doc/errors/#"+e+" for details.";return(i=t.call(this,n)||this).code=e,i.name="AssertionError",i.message=n,i}return Oe(e,t),e}(Error);function Ie(t,e){if(!t)throw new Re(e)}function Fe(t,e,i){return Math.min(Math.max(t,e),i)}var je="cosh"in Math?Math.cosh:function(t){var e=Math.exp(t);return(e+1/e)/2},Me="log2"in Math?Math.log2:function(t){return Math.log(t)*Math.LOG2E};function Ae(t,e,i,n,r,o){var s=r-i,a=o-n;if(0!==s||0!==a){var l=((t-i)*s+(e-n)*a)/(s*s+a*a);l>1?(i=r,n=o):l>0&&(i+=s*l,n+=a*l)}return Le(t,e,i,n)}function Le(t,e,i,n){var r=i-t,o=n-e;return r*r+o*o}function ze(t){return t*Math.PI/180}function De(t,e){var i=t%e;return i*e<0?i+e:i}function Ge(t,e,i){return t+i*(e-t)}var Ne=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}(),Be=function(t){function e(e){var i=t.call(this)||this;i.on,i.once,i.un;var n=Ct({},e);return"object"==typeof e.properties&&(delete n.properties,Ct(n,e.properties)),n[xe]=void 0!==e.opacity?e.opacity:1,Ie("number"==typeof n[xe],64),n[be]=void 0===e.visible||e.visible,n[Se]=e.zIndex,n[Ce]=void 0!==e.maxResolution?e.maxResolution:1/0,n[Te]=void 0!==e.minResolution?e.minResolution:0,n[ke]=void 0!==e.minZoom?e.minZoom:-1/0,n[Ee]=void 0!==e.maxZoom?e.maxZoom:1/0,i.className_=void 0!==n.className?e.className:"ol-layer",delete n.className,i.setProperties(n),i.state_=null,i}return Ne(e,t),e.prototype.getClassName=function(){return this.className_},e.prototype.getLayerState=function(t){var e=this.state_||{layer:this,managed:void 0===t||t},i=this.getZIndex();return e.opacity=Fe(Math.round(100*this.getOpacity())/100,0,1),e.sourceState=this.getSourceState(),e.visible=this.getVisible(),e.extent=this.getExtent(),e.zIndex=void 0!==i||e.managed?i: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 Zt()},e.prototype.getLayerStatesArray=function(t){return Zt()},e.prototype.getExtent=function(){return this.get(we)},e.prototype.getMaxResolution=function(){return this.get(Ce)},e.prototype.getMinResolution=function(){return this.get(Te)},e.prototype.getMinZoom=function(){return this.get(ke)},e.prototype.getMaxZoom=function(){return this.get(Ee)},e.prototype.getOpacity=function(){return this.get(xe)},e.prototype.getSourceState=function(){return Zt()},e.prototype.getVisible=function(){return this.get(be)},e.prototype.getZIndex=function(){return this.get(Se)},e.prototype.setExtent=function(t){this.set(we,t)},e.prototype.setMaxResolution=function(t){this.set(Ce,t)},e.prototype.setMinResolution=function(t){this.set(Te,t)},e.prototype.setMaxZoom=function(t){this.set(Ee,t)},e.prototype.setMinZoom=function(t){this.set(ke,t)},e.prototype.setOpacity=function(t){Ie("number"==typeof t,64),this.set(xe,t)},e.prototype.setVisible=function(t){this.set(be,t)},e.prototype.setZIndex=function(t){this.set(Se,t)},e.prototype.disposeInternal=function(){this.state_&&(this.state_.layer=null,this.state_=null),t.prototype.disposeInternal.call(this)},e}(te),We="prerender",qe="postrender",Ve="precompose",Ue="postcompose",Xe="rendercomplete",Ke="undefined",Ye="ready",Ze=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}();function He(t,e){if(!t.visible)return!1;var i=e.resolution;if(i<t.minResolution||i>=t.maxResolution)return!1;var n=e.zoom;return n>t.minZoom&&n<=t.maxZoom}var $e=function(t){function e(e){var i=this,n=Ct({},e);delete n.source,(i=t.call(this,n)||this).on,i.once,i.un,i.mapPrecomposeKey_=null,i.mapRenderKey_=null,i.sourceChangeKey_=null,i.renderer_=null,e.render&&(i.render=e.render),e.map&&i.setMap(e.map),i.addChangeListener(Pe,i.handleSourcePropertyChange_);var r=e.source?e.source:null;return i.setSource(r),i}return Ze(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(Pe)||null},e.prototype.getSourceState=function(){var t=this.getSource();return t?t.getState():Ke},e.prototype.handleSourceChange_=function(){this.changed()},e.prototype.handleSourcePropertyChange_=function(){this.sourceChangeKey_&&(Ut(this.sourceChangeKey_),this.sourceChangeKey_=null);var t=this.getSource();t&&(this.sourceChangeKey_=qt(t,It,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.render=function(t,e){var i=this.getRenderer();if(i.prepareFrame(t))return i.renderFrame(t,e)},e.prototype.setMap=function(t){this.mapPrecomposeKey_&&(Ut(this.mapPrecomposeKey_),this.mapPrecomposeKey_=null),t||this.changed(),this.mapRenderKey_&&(Ut(this.mapRenderKey_),this.mapRenderKey_=null),t&&(this.mapPrecomposeKey_=qt(t,Ve,(function(t){var e=t.frameState.layerStatesArray,i=this.getLayerState(!1);Ie(!e.some((function(t){return t.layer===i.layer})),67),e.push(i)}),this),this.mapRenderKey_=qt(this,It,t.render,t),this.changed())},e.prototype.setSource=function(t){this.set(Pe,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.setSource(null),t.prototype.disposeInternal.call(this)},e}(Be),Je=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}(),Qe=function(t){function e(e){var i=this,n=e||{};(i=t.call(this,{element:document.createElement("div"),render:n.render,target:n.target})||this).ulElement_=document.createElement("ul"),i.collapsed_=void 0===n.collapsed||n.collapsed,i.userCollapsed_=i.collapsed_,i.overrideCollapsible_=void 0!==n.collapsible,i.collapsible_=void 0===n.collapsible||n.collapsible,i.collapsible_||(i.collapsed_=!1);var r=void 0!==n.className?n.className:"ol-attribution",o=void 0!==n.tipLabel?n.tipLabel:"Attributions",s=void 0!==n.expandClassName?n.expandClassName:r+"-expand",a=void 0!==n.collapseLabel?n.collapseLabel:"»",l=void 0!==n.collapseClassName?n.collapseClassName:r+"-collpase";"string"==typeof a?(i.collapseLabel_=document.createElement("span"),i.collapseLabel_.textContent=a,i.collapseLabel_.className=l):i.collapseLabel_=a;var u=void 0!==n.label?n.label:"i";"string"==typeof u?(i.label_=document.createElement("span"),i.label_.textContent=u,i.label_.className=s):i.label_=u;var h=i.collapsible_&&!i.collapsed_?i.collapseLabel_:i.label_;i.toggleButton_=document.createElement("button"),i.toggleButton_.setAttribute("type","button"),i.toggleButton_.setAttribute("aria-expanded",String(!i.collapsed_)),i.toggleButton_.title=o,i.toggleButton_.appendChild(h),i.toggleButton_.addEventListener(At,i.handleClick_.bind(i),!1);var c=r+" ol-unselectable ol-control"+(i.collapsed_&&i.collapsible_?" ol-collapsed":"")+(i.collapsible_?"":" ol-uncollapsible"),p=i.element;return p.className=c,p.appendChild(i.toggleButton_),p.appendChild(i.ulElement_),i.renderedAttributions_=[],i.renderedVisible_=!0,i}return Je(e,t),e.prototype.collectSourceAttributions_=function(t){for(var e={},i=[],n=!0,r=t.layerStatesArray,o=0,s=r.length;o<s;++o){var a=r[o];if(He(a,t.viewState)){var l=a.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||(i.push(h[c]),e[h[c]]=!0);else h in e||(i.push(h),e[h]=!0)}}}}return this.overrideCollapsible_||this.setCollapsible(n),i},e.prototype.updateElement_=function(t){if(t){var e=this.collectSourceAttributions_(t),i=e.length>0;if(this.renderedVisible_!=i&&(this.element.style.display=i?"":"none",this.renderedVisible_=i),!xt(e,this.renderedAttributions_)){!function(t){for(;t.lastChild;)t.removeChild(t.lastChild)}(this.ulElement_);for(var n=0,r=e.length;n<r;++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("ol-collapsed"),this.collapsed_?de(this.collapseLabel_,this.label_):de(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}(ge),ti="add",ei="remove",ii=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}(),ni="length",ri=function(t){function e(e,i,n){var r=t.call(this,e)||this;return r.element=i,r.index=n,r}return ii(e,t),e}(dt),oi=function(t){function e(e,i){var n=t.call(this)||this;n.on,n.once,n.un;var r=i||{};if(n.unique_=!!r.unique,n.array_=e||[],n.unique_)for(var o=0,s=n.array_.length;o<s;++o)n.assertUnique_(n.array_[o],o);return n.updateLength_(),n}return ii(e,t),e.prototype.clear=function(){for(;this.getLength()>0;)this.pop()},e.prototype.extend=function(t){for(var e=0,i=t.length;e<i;++e)this.push(t[e]);return this},e.prototype.forEach=function(t){for(var e=this.array_,i=0,n=e.length;i<n;++i)t(e[i],i,e)},e.prototype.getArray=function(){return this.array_},e.prototype.item=function(t){return this.array_[t]},e.prototype.getLength=function(){return this.get(ni)},e.prototype.insertAt=function(t,e){this.unique_&&this.assertUnique_(e),this.array_.splice(t,0,e),this.updateLength_(),this.dispatchEvent(new ri(ti,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_,i=0,n=e.length;i<n;++i)if(e[i]===t)return this.removeAt(i)},e.prototype.removeAt=function(t){var e=this.array_[t];return this.array_.splice(t,1),this.updateLength_(),this.dispatchEvent(new ri(ei,e,t)),e},e.prototype.setAt=function(t,e){var i=this.getLength();if(t<i){this.unique_&&this.assertUnique_(e,t);var n=this.array_[t];this.array_[t]=e,this.dispatchEvent(new ri(ei,n,t)),this.dispatchEvent(new ri(ti,e,t))}else{for(var r=i;r<t;++r)this.insertAt(r,void 0);this.insertAt(t,e)}},e.prototype.updateLength_=function(){this.set(ni,this.array_.length)},e.prototype.assertUnique_=function(t,e){for(var i=0,n=this.array_.length;i<n;++i)if(this.array_[i]===t&&i!==e)throw new Re(58)},e}(te);function si(t){return Math.pow(t,3)}function ai(t){return 1-si(1-t)}function li(t){return 3*t*t-2*t*t*t}function ui(t){return t}var hi=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}(),ci=function(t){function e(e){var i=this,n=e||{};i=t.call(this,{element:document.createElement("div"),render:n.render,target:n.target})||this;var r=void 0!==n.className?n.className:"ol-rotate",o=void 0!==n.label?n.label:"⇧",s=void 0!==n.compassClassName?n.compassClassName:"ol-compass";i.label_=null,"string"==typeof o?(i.label_=document.createElement("span"),i.label_.className=s,i.label_.textContent=o):(i.label_=o,i.label_.classList.add(s));var a=n.tipLabel?n.tipLabel:"Reset rotation",l=document.createElement("button");l.className=r+"-reset",l.setAttribute("type","button"),l.title=a,l.appendChild(i.label_),l.addEventListener(At,i.handleClick_.bind(i),!1);var u=r+" ol-unselectable ol-control",h=i.element;return h.className=u,h.appendChild(l),i.callResetNorth_=n.resetNorth?n.resetNorth:void 0,i.duration_=void 0!==n.duration?n.duration:250,i.autoHide_=void 0===n.autoHide||n.autoHide,i.rotation_=void 0,i.autoHide_&&i.element.classList.add("ol-hidden"),i}return hi(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:ai}):t.setRotation(0))}},e.prototype.render=function(t){var e=t.frameState;if(e){var i=e.viewState.rotation;if(i!=this.rotation_){var n="rotate("+i+"rad)";if(this.autoHide_){var r=this.element.classList.contains("ol-hidden");r||0!==i?r&&0!==i&&this.element.classList.remove("ol-hidden"):this.element.classList.add("ol-hidden")}this.label_.style.transform=n}this.rotation_=i}},e}(ge),pi=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}(),di=function(t){function e(e){var i=this,n=e||{};i=t.call(this,{element:document.createElement("div"),target:n.target})||this;var r=void 0!==n.className?n.className:"ol-zoom",o=void 0!==n.delta?n.delta:1,s=void 0!==n.zoomInClassName?n.zoomInClassName:r+"-in",a=void 0!==n.zoomOutClassName?n.zoomOutClassName:r+"-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=s,p.setAttribute("type","button"),p.title=h,p.appendChild("string"==typeof l?document.createTextNode(l):l),p.addEventListener(At,i.handleClick_.bind(i,o),!1);var d=document.createElement("button");d.className=a,d.setAttribute("type","button"),d.title=c,d.appendChild("string"==typeof u?document.createTextNode(u):u),d.addEventListener(At,i.handleClick_.bind(i,-o),!1);var f=r+" ol-unselectable ol-control",y=i.element;return y.className=f,y.appendChild(p),y.appendChild(d),i.duration_=void 0!==n.duration?n.duration:250,i}return pi(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 i=e.getZoom();if(void 0!==i){var n=e.getConstrainedZoom(i+t);this.duration_>0?(e.getAnimating()&&e.cancelAnimations(),e.animate({zoom:n,duration:this.duration_,easing:ai})):e.setZoom(n)}}},e}(ge),fi="pointermove",yi="pointerdown",gi={DEGREES:"degrees",FEET:"ft",METERS:"m",PIXELS:"pixels",TILE_PIXELS:"tile-pixels",USFEET:"us-ft"},mi={};mi[gi.DEGREES]=2*Math.PI*6370997/360,mi[gi.FEET]=.3048,mi[gi.METERS]=1,mi[gi.USFEET]=1200/3937;var vi=gi,_i=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_||mi[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}(),xi=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}(),bi=6378137*Math.PI,wi=[-bi,-bi,bi,bi],Si=[-180,-85,180,85],Ci=6378137*Math.log(Math.tan(Math.PI/2)),Ti=function(t){function e(e){return t.call(this,{code:e,units:vi.METERS,extent:wi,global:!0,worldExtent:Si,getPointResolution:function(t,e){return t/je(e[1]/6378137)}})||this}return xi(e,t),e}(_i),Ei=[new Ti("EPSG:3857"),new Ti("EPSG:102100"),new Ti("EPSG:102113"),new Ti("EPSG:900913"),new Ti("http://www.opengis.net/gml/srs/epsg.xml#3857")];function ki(t,e,i){var n=t.length,r=i>1?i:2,o=e;void 0===o&&(o=r>2?t.slice():new Array(n));for(var s=0;s<n;s+=r){o[s]=bi*t[s]/180;var a=6378137*Math.log(Math.tan(Math.PI*(+t[s+1]+90)/360));a>Ci?a=Ci:a<-Ci&&(a=-Ci),o[s+1]=a}return o}function Pi(t,e,i){var n=t.length,r=i>1?i:2,o=e;void 0===o&&(o=r>2?t.slice():new Array(n));for(var s=0;s<n;s+=r)o[s]=180*t[s]/bi,o[s+1]=360*Math.atan(Math.exp(t[s+1]/6378137))/Math.PI-90;return o}var Oi=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}(),Ri=[-180,-90,180,90],Ii=6378137*Math.PI/180,Fi=function(t){function e(e,i){return t.call(this,{code:e,units:vi.DEGREES,extent:Ri,axisOrientation:i,global:!0,metersPerUnit:Ii,worldExtent:Ri})||this}return Oi(e,t),e}(_i),ji=[new Fi("CRS:84"),new Fi("EPSG:4326","neu"),new Fi("urn:ogc:def:crs:OGC:1.3:CRS84"),new Fi("urn:ogc:def:crs:OGC:2:84"),new Fi("http://www.opengis.net/gml/srs/epsg.xml#4326","neu")],Mi={};var Ai={};function Li(t,e,i){var n=t.getCode(),r=e.getCode();n in Ai||(Ai[n]={}),Ai[n][r]=i}var zi="bottom-left",Di="bottom-right",Gi="top-left",Ni="top-right",Bi=0,Wi=1,qi=2,Vi=4,Ui=8,Xi=16;function Ki(t){for(var e=en(),i=0,n=t.length;i<n;++i)un(e,t[i]);return e}function Yi(t,e,i){return i?(i[0]=t[0]-e,i[1]=t[1]-e,i[2]=t[2]+e,i[3]=t[3]+e,i):[t[0]-e,t[1]-e,t[2]+e,t[3]+e]}function Zi(t,e){return e?(e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e):t.slice()}function Hi(t,e,i){var n,r;return(n=e<t[0]?t[0]-e:t[2]<e?e-t[2]:0)*n+(r=i<t[1]?t[1]-i:t[3]<i?i-t[3]:0)*r}function $i(t,e){return Qi(t,e[0],e[1])}function Ji(t,e){return t[0]<=e[0]&&e[2]<=t[2]&&t[1]<=e[1]&&e[3]<=t[3]}function Qi(t,e,i){return t[0]<=e&&e<=t[2]&&t[1]<=i&&i<=t[3]}function tn(t,e){var i=t[0],n=t[1],r=t[2],o=t[3],s=e[0],a=e[1],l=Bi;return s<i?l|=Xi:s>r&&(l|=Vi),a<n?l|=Ui:a>o&&(l|=qi),l===Bi&&(l=Wi),l}function en(){return[1/0,1/0,-1/0,-1/0]}function nn(t,e,i,n,r){return r?(r[0]=t,r[1]=e,r[2]=i,r[3]=n,r):[t,e,i,n]}function rn(t){return nn(1/0,1/0,-1/0,-1/0,t)}function on(t,e){var i=t[0],n=t[1];return nn(i,n,i,n,e)}function sn(t,e,i,n,r){return hn(rn(r),t,e,i,n)}function an(t,e){return t[0]==e[0]&&t[2]==e[2]&&t[1]==e[1]&&t[3]==e[3]}function ln(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 un(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 hn(t,e,i,n,r){for(;i<n;i+=r)cn(t,e[i],e[i+1]);return t}function cn(t,e,i){t[0]=Math.min(t[0],e),t[1]=Math.min(t[1],i),t[2]=Math.max(t[2],e),t[3]=Math.max(t[3],i)}function pn(t,e){var i;return(i=e(fn(t)))||(i=e(yn(t)))||(i=e(wn(t)))?i:(i=e(bn(t)))||!1}function dn(t){var e=0;return Tn(t)||(e=Sn(t)*_n(t)),e}function fn(t){return[t[0],t[1]]}function yn(t){return[t[2],t[1]]}function gn(t){return[(t[0]+t[2])/2,(t[1]+t[3])/2]}function mn(t,e){var i;return e===zi?i=fn(t):e===Di?i=yn(t):e===Gi?i=bn(t):e===Ni?i=wn(t):Ie(!1,13),i}function vn(t,e,i,n,r){var o=e*n[0]/2,s=e*n[1]/2,a=Math.cos(i),l=Math.sin(i),u=o*a,h=o*l,c=s*a,p=s*l,d=t[0],f=t[1],y=d-u+p,g=d-u-p,m=d+u-p,v=d+u+p,_=f-h-c,x=f-h+c,b=f+h+c,w=f+h-c;return nn(Math.min(y,g,m,v),Math.min(_,x,b,w),Math.max(y,g,m,v),Math.max(_,x,b,w),r)}function _n(t){return t[3]-t[1]}function xn(t,e,i){var n=i||[1/0,1/0,-1/0,-1/0];return Cn(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]):rn(n),n}function bn(t){return[t[0],t[3]]}function wn(t){return[t[2],t[3]]}function Sn(t){return t[2]-t[0]}function Cn(t,e){return t[0]<=e[2]&&t[2]>=e[0]&&t[1]<=e[3]&&t[3]>=e[1]}function Tn(t){return t[2]<t[0]||t[3]<t[1]}function En(t,e,i,n){var r=[];if(n>1)for(var o=t[2]-t[0],s=t[3]-t[1],a=0;a<n;++a)r.push(t[0]+o*a/n,t[1],t[2],t[1]+s*a/n,t[2]-o*a/n,t[3],t[0],t[3]-s*a/n);else r=[t[0],t[1],t[2],t[1],t[2],t[3],t[0],t[3]];e(r,r,2);for(var l=[],u=[],h=(a=0,r.length);a<h;a+=2)l.push(r[a]),u.push(r[a+1]);return function(t,e,i){return nn(Math.min.apply(null,t),Math.min.apply(null,e),Math.max.apply(null,t),Math.max.apply(null,e),i)}(l,u,i)}var kn="Point",Pn="LineString",On="LinearRing",Rn="Polygon",In="MultiPoint",Fn="MultiLineString",jn="MultiPolygon",Mn="GeometryCollection",An="Circle";function Ln(t,e,i){var n=i||6371008.8,r=ze(t[1]),o=ze(e[1]),s=(o-r)/2,a=ze(e[0]-t[0])/2,l=Math.sin(s)*Math.sin(s)+Math.sin(a)*Math.sin(a)*Math.cos(r)*Math.cos(o);return 2*n*Math.atan2(Math.sqrt(l),Math.sqrt(1-l))}function zn(t,e){for(var i=0,n=t.length,r=t[n-1][0],o=t[n-1][1],s=0;s<n;s++){var a=t[s][0],l=t[s][1];i+=ze(a-r)*(2+Math.sin(ze(o))+Math.sin(ze(l))),r=a,o=l}return i*e*e/2}function Dn(t,e){var i=e||{},n=i.radius||6371008.8,r=i.projection||"EPSG:3857",o=t.getType();o!==Mn&&(t=t.clone().transform(r,"EPSG:4326"));var s,a,l,u,h,c,p=0;switch(o){case kn:case In:case Pn:case Fn:case On:break;case Rn:for(s=t.getCoordinates(),p=Math.abs(zn(s[0],n)),l=1,u=s.length;l<u;++l)p-=Math.abs(zn(s[l],n));break;case jn:for(l=0,u=(s=t.getCoordinates()).length;l<u;++l)for(a=s[l],p+=Math.abs(zn(a[0],n)),h=1,c=a.length;h<c;++h)p-=Math.abs(zn(a[h],n));break;case Mn:var d=t.getGeometries();for(l=0,u=d.length;l<u;++l)p+=Dn(d[l],e);break;default:throw new Error("Unsupported geometry type: "+o)}return p}function Gn(t,e){var i,n,r=t[0],o=t[1],s=e[0],a=e[1],l=s[0],u=s[1],h=a[0],c=a[1],p=h-l,d=c-u,f=0===p&&0===d?0:(p*(r-l)+d*(o-u))/(p*p+d*d||0);return f<=0?(i=l,n=u):f>=1?(i=h,n=c):(i=l+f*p,n=u+f*d),[i,n]}function Nn(t,e){for(var i=!0,n=t.length-1;n>=0;--n)if(t[n]!=e[n]){i=!1;break}return i}function Bn(t,e){var i=Math.cos(e),n=Math.sin(e),r=t[0]*i-t[1]*n,o=t[1]*i+t[0]*n;return t[0]=r,t[1]=o,t}function Wn(t,e){var i=t[0]-e[0],n=t[1]-e[1];return i*i+n*n}function qn(t,e){return Math.sqrt(Wn(t,e))}function Vn(t,e){return Wn(t,Gn(t,e))}function Un(t,e){if(e.canWrapX()){var i=Sn(e.getExtent()),n=function(t,e,i){var n=e.getExtent(),r=0;if(e.canWrapX()&&(t[0]<n[0]||t[0]>n[2])){var o=i||Sn(n);r=Math.floor((t[0]-n[0])/o)}return r}(t,e,i);n&&(t[0]-=n*i)}return t}function Xn(t,e,i){var n;if(void 0!==e){for(var r=0,o=t.length;r<o;++r)e[r]=t[r];n=e}else n=t.slice();return n}function Kn(t,e,i){if(void 0!==e&&t!==e){for(var n=0,r=t.length;n<r;++n)e[n]=t[n];t=e}return t}function Yn(t){!function(t,e){Mi[t]=e}(t.getCode(),t),Li(t,t,Xn)}function Zn(t){return"string"==typeof t?Mi[e=t]||Mi[e.replace(/urn:(x-)?ogc:def:crs:EPSG:(.*:)?(\w+)$/,"EPSG:$3")]||null:t||null;var e}function Hn(t,e,i,n){var r,o=(t=Zn(t)).getPointResolutionFunc();if(o){if(r=o(e,i),n&&n!==t.getUnits())(a=t.getMetersPerUnit())&&(r=r*a/mi[n])}else{var s=t.getUnits();if(s==vi.DEGREES&&!n||n==vi.DEGREES)r=e;else{var a,l=er(t,Zn("EPSG:4326"));if(l===Kn&&s!==vi.DEGREES)r=e*t.getMetersPerUnit();else{var u=[i[0]-e/2,i[1],i[0]+e/2,i[1],i[0],i[1]-e/2,i[0],i[1]+e/2];r=(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!==(a=n?mi[n]:t.getMetersPerUnit())&&(r/=a)}}return r}function $n(t){!function(t){t.forEach(Yn)}(t),t.forEach((function(e){t.forEach((function(t){e!==t&&Li(e,t,Xn)}))}))}function Jn(t,e){return t?"string"==typeof t?Zn(t):t:Zn(e)}function Qn(t,e){return nr(t,"EPSG:4326",void 0!==e?e:"EPSG:3857")}function tr(t,e){if(t===e)return!0;var i=t.getUnits()===e.getUnits();return(t.getCode()===e.getCode()||er(t,e)===Xn)&&i}function er(t,e){var i=function(t,e){var i;return t in Ai&&e in Ai[t]&&(i=Ai[t][e]),i}(t.getCode(),e.getCode());return i||(i=Kn),i}function ir(t,e){return er(Zn(t),Zn(e))}function nr(t,e,i){return ir(e,i)(t,void 0,t.length)}var rr,or,sr;function ar(t,e){return t}function lr(t,e){return t}function ur(t,e){return t}function hr(t,e){return t}$n(Ei),$n(ji),rr=Ei,or=ki,sr=Pi,ji.forEach((function(t){rr.forEach((function(e){Li(t,e,or),Li(e,t,sr)}))}));var cr,pr=new Array(6);function dr(t){return yr(t,1,0,0,1,0,0)}function fr(t,e){var i=t[0],n=t[1],r=t[2],o=t[3],s=t[4],a=t[5],l=e[0],u=e[1],h=e[2],c=e[3],p=e[4],d=e[5];return t[0]=i*l+r*u,t[1]=n*l+o*u,t[2]=i*h+r*c,t[3]=n*h+o*c,t[4]=i*p+r*d+s,t[5]=n*p+o*d+a,t}function yr(t,e,i,n,r,o,s){return t[0]=e,t[1]=i,t[2]=n,t[3]=r,t[4]=o,t[5]=s,t}function gr(t,e){var i=e[0],n=e[1];return e[0]=t[0]*i+t[2]*n+t[4],e[1]=t[1]*i+t[3]*n+t[5],e}function mr(t,e,i){return fr(t,yr(pr,e,0,0,i,0,0))}function vr(t,e,i,n,r,o,s,a){var l=Math.sin(o),u=Math.cos(o);return t[0]=n*u,t[1]=r*l,t[2]=-n*l,t[3]=r*u,t[4]=s*n*u-a*n*l+e,t[5]=s*r*l+a*r*u+i,t}function _r(t,e){var i,n=(i=e)[0]*i[3]-i[1]*i[2];Ie(0!==n,32);var r=e[0],o=e[1],s=e[2],a=e[3],l=e[4],u=e[5];return t[0]=a/n,t[1]=-o/n,t[2]=-s/n,t[3]=r/n,t[4]=(s*u-a*l)/n,t[5]=-(r*u-o*l)/n,t}function xr(t){var e="matrix("+t.join(", ")+")";if(ue)return e;var i=cr||(cr=document.createElement("div"));return i.style.transform=e,i.style.transform}var br=/^#([a-f0-9]{3}|[a-f0-9]{4}(?:[a-f0-9]{2}){0,2})$/i,wr=/^([a-z]*)$|^hsla?\(.*\)$/i;function Sr(t){return"string"==typeof t?t:Or(t)}var Cr,Tr,Er=(Cr={},Tr=0,function(t){var e;if(Cr.hasOwnProperty(t))e=Cr[t];else{if(Tr>=1024){var i=0;for(var n in Cr)0==(3&i++)&&(delete Cr[n],--Tr)}e=function(t){var e,i,n,r,o;if(wr.exec(t)&&(t=function(t){var e=document.createElement("div");if(e.style.color=t,""!==e.style.color){document.body.appendChild(e);var i=getComputedStyle(e).color;return document.body.removeChild(e),i}return""}(t)),br.exec(t)){var s=t.length-1,a=void 0;a=s<=4?1:2;var l=4===s||8===s;e=parseInt(t.substr(1+0*a,a),16),i=parseInt(t.substr(1+1*a,a),16),n=parseInt(t.substr(1+2*a,a),16),r=l?parseInt(t.substr(1+3*a,a),16):255,1==a&&(e=(e<<4)+e,i=(i<<4)+i,n=(n<<4)+n,l&&(r=(r<<4)+r)),o=[e,i,n,r/255]}else 0==t.indexOf("rgba(")?Pr(o=t.slice(5,-1).split(",").map(Number)):0==t.indexOf("rgb(")?((o=t.slice(4,-1).split(",").map(Number)).push(1),Pr(o)):Ie(!1,14);return o}(t),Cr[t]=e,++Tr}return e});function kr(t){return Array.isArray(t)?t:Er(t)}function Pr(t){return t[0]=Fe(t[0]+.5|0,0,255),t[1]=Fe(t[1]+.5|0,0,255),t[2]=Fe(t[2]+.5|0,0,255),t[3]=Fe(t[3],0,1),t}function Or(t){var e=t[0];e!=(0|e)&&(e=e+.5|0);var i=t[1];i!=(0|i)&&(i=i+.5|0);var n=t[2];return n!=(0|n)&&(n=n+.5|0),"rgba("+e+","+i+","+n+","+(void 0===t[3]?1:t[3])+")"}function Rr(t,e,i){return e+":"+t+":"+(i?Sr(i):"null")}var Ir=new(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 i=this.cache_[e];0!=(3&t++)||i.hasListener()||(delete this.cache_[e],--this.cacheSize_)}}},t.prototype.get=function(t,e,i){var n=Rr(t,e,i);return n in this.cache_?this.cache_[n]:null},t.prototype.set=function(t,e,i,n){var r=Rr(t,e,i);this.cache_[r]=n,++this.cacheSize_},t.prototype.setSize=function(t){this.maxCacheSize_=t,this.expire()},t}()),Fr=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}();function jr(t,e){Ir.expire()}var Mr=function(t){function e(e){var i=t.call(this)||this;return i.map_=e,i}return Fr(e,t),e.prototype.dispatchRenderEvent=function(t,e){Zt()},e.prototype.calculateMatrices2D=function(t){var e=t.viewState,i=t.coordinateToPixelTransform,n=t.pixelToCoordinateTransform;vr(i,t.size[0]/2,t.size[1]/2,1/e.resolution,-1/e.resolution,-e.rotation,-e.center[0],-e.center[1]),_r(n,i)},e.prototype.forEachFeatureAtCoordinate=function(t,e,i,n,r,o,s,a){var l,u=e.viewState;function h(t,e,i,n){return r.call(o,e,t?i:null,n)}var c=u.projection,p=Un(t.slice(),c),d=[[0,0]];if(c.canWrapX()&&n){var f=Sn(c.getExtent());d.push([-f,0],[f,0])}for(var y=e.layerStatesArray,g=y.length,m=[],v=[],_=0;_<d.length;_++)for(var x=g-1;x>=0;--x){var b=y[x],w=b.layer;if(w.hasRenderer()&&He(b,u)&&s.call(a,w)){var S=w.getRenderer(),C=w.getSource();if(S&&C){var T=C.getWrapX()?p:t,E=h.bind(null,b.managed);v[0]=T[0]+d[_][0],v[1]=T[1]+d[_][1],l=S.forEachFeatureAtCoordinate(v,e,i,E,m)}if(l)return l}}if(0!==m.length){var k=1/m.length;return m.forEach((function(t,e){return t.distanceSq+=e*k})),m.sort((function(t,e){return t.distanceSq-e.distanceSq})),m.some((function(t){return l=t.callback(t.feature,t.layer,t.geometry)})),l}},e.prototype.forEachLayerAtPixel=function(t,e,i,n,r){return Zt()},e.prototype.hasFeatureAtCoordinate=function(t,e,i,n,r,o){return void 0!==this.forEachFeatureAtCoordinate(t,e,i,n,bt,this,r,o)},e.prototype.getMap=function(){return this.map_},e.prototype.renderFrame=function(t){Zt()},e.prototype.scheduleExpireIconCache=function(t){Ir.canExpireCache()&&t.postRenderFunctions.push(jr)},e}(yt),Ar=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}(),Lr=function(t){function e(e,i,n,r){var o=t.call(this,e)||this;return o.inversePixelTransform=i,o.frameState=n,o.context=r,o}return Ar(e,t),e}(dt),zr=[],Dr=[0,0,0,0],Gr=new te,Nr=new Rt;Nr.setSize=function(){console.warn("labelCache is deprecated.")};var Br,Wr,qr=null,Vr={},Ur=function(){var t,e,i="32px ",n=["monospace","serif"],r=n.length,o="wmytzilWMYTZIL@#/&?$%10";function s(t,s,a){for(var l=!0,u=0;u<r;++u){var h=n[u];if(e=Yr(t+" "+s+" "+i+h,o),a!=h){var c=Yr(t+" "+s+" "+i+a+","+h,o);l=l&&c!=e}}return!!l}function a(){for(var e=!0,i=Gr.getKeys(),n=0,r=i.length;n<r;++n){var o=i[n];Gr.get(o)<100&&(s.apply(this,o.split("\n"))?(Tt(Vr),qr=null,Br=void 0,Gr.set(o,100)):(Gr.set(o,Gr.get(o)+1,!0),e=!1))}e&&(clearInterval(t),t=void 0)}return function(e){var i=_e(e);if(i)for(var n=i.families,r=0,o=n.length;r<o;++r){var l=n[r],u=i.style+"\n"+i.weight+"\n"+l;void 0===Gr.get(u)&&(Gr.set(u,100,!0),s(i.style,i.weight,l)||(Gr.set(u,0,!0),void 0===t&&(t=setInterval(a,32))))}}}(),Xr=function(t){var e=Vr[t];if(null==e){if(ue){var i=_e(t),n=Kr(t,"Žg");e=(isNaN(Number(i.lineHeight))?1.2:Number(i.lineHeight))*(n.actualBoundingBoxAscent+n.actualBoundingBoxDescent)}else Wr||((Wr=document.createElement("div")).innerHTML="M",Wr.style.minHeight="0",Wr.style.maxHeight="none",Wr.style.height="auto",Wr.style.padding="0",Wr.style.border="none",Wr.style.position="absolute",Wr.style.display="block",Wr.style.left="-99999px"),Wr.style.font=t,document.body.appendChild(Wr),e=Wr.offsetHeight,document.body.removeChild(Wr);Vr[t]=e}return e};function Kr(t,e){return qr||(qr=pe(1,1)),t!=Br&&(qr.font=t,Br=qr.font),qr.measureText(e)}function Yr(t,e){return Kr(t,e).width}function Zr(t,e,i){if(e in i)return i[e];var n=Yr(t,e);return i[e]=n,n}function Hr(t,e,i,n,r,o,s,a,l,u,h){t.save(),1!==i&&(t.globalAlpha*=i),e&&t.setTransform.apply(t,e),n.contextInstructions?(t.translate(l,u),t.scale(h[0],h[1]),function(t,e){for(var i=t.contextInstructions,n=0,r=i.length;n<r;n+=2)Array.isArray(i[n+1])?e[i[n]].apply(e,i[n+1]):e[i[n]]=i[n+1]}(n,t)):h[0]<0||h[1]<0?(t.translate(l,u),t.scale(h[0],h[1]),t.drawImage(n,r,o,s,a,0,0,s,a)):t.drawImage(n,r,o,s,a,l,u,s*h[0],a*h[1]),t.restore()}var $r=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}(),Jr=function(t){function e(e){var i=t.call(this,e)||this;i.fontChangeListenerKey_=qt(Gr,ft,e.redrawText.bind(e)),i.element_=document.createElement("div");var n=i.element_.style;n.position="absolute",n.width="100%",n.height="100%",n.zIndex="0",i.element_.className="ol-unselectable ol-layers";var r=e.getViewport();return r.insertBefore(i.element_,r.firstChild||null),i.children_=[],i.renderedVisible_=!0,i}return $r(e,t),e.prototype.dispatchRenderEvent=function(t,e){var i=this.getMap();if(i.hasListener(t)){var n=new Lr(t,void 0,e);i.dispatchEvent(n)}},e.prototype.disposeInternal=function(){Ut(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(Ve,t);var e=t.layerStatesArray.sort((function(t,e){return t.zIndex-e.zIndex})),i=t.viewState;this.children_.length=0;for(var n=[],r=null,o=0,s=e.length;o<s;++o){var a=e[o];if(t.layerIndex=o,He(a,i)&&(a.sourceState==Ye||a.sourceState==Ke)){var l=a.layer,u=l.render(t,r);u&&(u!==r&&(this.children_.push(u),r=u),"getDeclutter"in l&&n.push(l))}}for(o=n.length-1;o>=0;--o)n[o].renderDeclutter(t);!function(t,e){for(var i=t.childNodes,n=0;;++n){var r=i[n],o=e[n];if(!r&&!o)break;r!==o&&(r?o?t.insertBefore(o,r):(t.removeChild(r),--n):t.appendChild(o))}}(this.element_,this.children_),this.dispatchRenderEvent(Ue,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,i,n,r){for(var o=e.viewState,s=e.layerStatesArray,a=s.length-1;a>=0;--a){var l=s[a],u=l.layer;if(u.hasRenderer()&&He(l,o)&&r(u)){var h=u.getRenderer().getDataAtPixel(t,e,i);if(h){var c=n(u,h);if(c)return c}}}},e}(Mr),Qr="layergroup",to="size",eo="target",io="view",no=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}(),ro="layers",oo=function(t){function e(e){var i=this,n=e||{},r=Ct({},n);delete r.layers;var o=n.layers;return(i=t.call(this,r)||this).layersListenerKeys_=[],i.listenerKeys_={},i.addChangeListener(ro,i.handleLayersChanged_),o?Array.isArray(o)?o=new oi(o.slice(),{unique:!0}):Ie("function"==typeof o.getArray,43):o=new oi(void 0,{unique:!0}),i.setLayers(o),i}return no(e,t),e.prototype.handleLayerChange_=function(){this.changed()},e.prototype.handleLayersChanged_=function(){this.layersListenerKeys_.forEach(Ut),this.layersListenerKeys_.length=0;var t=this.getLayers();for(var e in this.layersListenerKeys_.push(qt(t,ti,this.handleLayersAdd_,this),qt(t,ei,this.handleLayersRemove_,this)),this.listenerKeys_)this.listenerKeys_[e].forEach(Ut);Tt(this.listenerKeys_);for(var i=t.getArray(),n=0,r=i.length;n<r;n++){var o=i[n];this.listenerKeys_[$t(o)]=[qt(o,ft,this.handleLayerChange_,this),qt(o,It,this.handleLayerChange_,this)]}this.changed()},e.prototype.handleLayersAdd_=function(t){var e=t.element;this.listenerKeys_[$t(e)]=[qt(e,ft,this.handleLayerChange_,this),qt(e,It,this.handleLayerChange_,this)],this.changed()},e.prototype.handleLayersRemove_=function(t){var e=$t(t.element);this.listenerKeys_[e].forEach(Ut),delete this.listenerKeys_[e],this.changed()},e.prototype.getLayers=function(){return this.get(ro)},e.prototype.setLayers=function(t){this.set(ro,t)},e.prototype.getLayersArray=function(t){var e=void 0!==t?t:[];return this.getLayers().forEach((function(t){t.getLayersArray(e)})),e},e.prototype.getLayerStatesArray=function(t){var e=void 0!==t?t:[],i=e.length;this.getLayers().forEach((function(t){t.getLayerStatesArray(e)}));var n=this.getLayerState(),r=n.zIndex;t||void 0!==n.zIndex||(r=0);for(var o=i,s=e.length;o<s;o++){var a=e[o];a.opacity*=n.opacity,a.visible=a.visible&&n.visible,a.maxResolution=Math.min(a.maxResolution,n.maxResolution),a.minResolution=Math.max(a.minResolution,n.minResolution),a.minZoom=Math.max(a.minZoom,n.minZoom),a.maxZoom=Math.min(a.maxZoom,n.maxZoom),void 0!==n.extent&&(void 0!==a.extent?a.extent=xn(a.extent,n.extent):a.extent=n.extent),void 0===a.zIndex&&(a.zIndex=r)}return e},e.prototype.getSourceState=function(){return Ye},e}(Be),so=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}(),ao=function(t){function e(e,i,n){var r=t.call(this,e)||this;return r.map=i,r.frameState=void 0!==n?n:null,r}return so(e,t),e}(dt),lo=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}(),uo=function(t){function e(e,i,n,r,o){var s=t.call(this,e,i,o)||this;return s.originalEvent=n,s.pixel_=null,s.coordinate_=null,s.dragging=void 0!==r&&r,s}return lo(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}(ao),ho={SINGLECLICK:"singleclick",CLICK:At,DBLCLICK:Lt,POINTERDRAG:"pointerdrag",POINTERMOVE:"pointermove",POINTERDOWN:"pointerdown",POINTERUP:"pointerup",POINTEROVER:"pointerover",POINTEROUT:"pointerout",POINTERENTER:"pointerenter",POINTERLEAVE:"pointerleave",POINTERCANCEL:"pointercancel"},co=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}(),po=function(t){function e(e,i){var n=t.call(this,e)||this;n.map_=e,n.clickTimeoutId_,n.emulateClicks_=!1,n.dragging_=!1,n.dragListenerKeys_=[],n.moveTolerance_=void 0===i?1:i,n.down_=null;var r=n.map_.getViewport();return n.activePointers_=0,n.trackedTouches_={},n.element_=r,n.pointerdownListenerKey_=qt(r,yi,n.handlePointerDown_,n),n.originalPointerMoveEvent_,n.relayedListenerKey_=qt(r,fi,n.relayEvent_,n),n.boundHandleTouchMove_=n.handleTouchMove_.bind(n),n.element_.addEventListener(Bt,n.boundHandleTouchMove_,!!ce&&{passive:!1}),n}return co(e,t),e.prototype.emulateClick_=function(t){var e=new uo(ho.CLICK,this.map_,t);this.dispatchEvent(e),void 0!==this.clickTimeoutId_?(clearTimeout(this.clickTimeoutId_),this.clickTimeoutId_=void 0,e=new uo(ho.DBLCLICK,this.map_,t),this.dispatchEvent(e)):this.clickTimeoutId_=setTimeout(function(){this.clickTimeoutId_=void 0;var e=new uo(ho.SINGLECLICK,this.map_,t);this.dispatchEvent(e)}.bind(this),250)},e.prototype.updateActivePointers_=function(t){var e=t;e.type==ho.POINTERUP||e.type==ho.POINTERCANCEL?delete this.trackedTouches_[e.pointerId]:e.type==ho.POINTERDOWN&&(this.trackedTouches_[e.pointerId]=!0),this.activePointers_=Object.keys(this.trackedTouches_).length},e.prototype.handlePointerUp_=function(t){this.updateActivePointers_(t);var e=new uo(ho.POINTERUP,this.map_,t);this.dispatchEvent(e),this.emulateClicks_&&!e.defaultPrevented&&!this.dragging_&&this.isMouseActionButton_(t)&&this.emulateClick_(this.down_),0===this.activePointers_&&(this.dragListenerKeys_.forEach(Ut),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_,this.updateActivePointers_(t);var e=new uo(ho.POINTERDOWN,this.map_,t);for(var i in this.dispatchEvent(e),this.down_={},t){var n=t[i];this.down_[i]="function"==typeof n?St:n}if(0===this.dragListenerKeys_.length){var r=this.map_.getOwnerDocument();this.dragListenerKeys_.push(qt(r,ho.POINTERMOVE,this.handlePointerMove_,this),qt(r,ho.POINTERUP,this.handlePointerUp_,this),qt(this.element_,ho.POINTERCANCEL,this.handlePointerUp_,this)),this.element_.getRootNode&&this.element_.getRootNode()!==r&&this.dragListenerKeys_.push(qt(this.element_.getRootNode(),ho.POINTERUP,this.handlePointerUp_,this))}},e.prototype.handlePointerMove_=function(t){if(this.isMoving_(t)){this.dragging_=!0;var e=new uo(ho.POINTERDRAG,this.map_,t,this.dragging_);this.dispatchEvent(e)}},e.prototype.relayEvent_=function(t){this.originalPointerMoveEvent_=t;var e=!(!this.down_||!this.isMoving_(t));this.dispatchEvent(new uo(t.type,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_&&(Ut(this.relayedListenerKey_),this.relayedListenerKey_=null),this.element_.removeEventListener(Bt,this.boundHandleTouchMove_),this.pointerdownListenerKey_&&(Ut(this.pointerdownListenerKey_),this.pointerdownListenerKey_=null),this.dragListenerKeys_.forEach(Ut),this.dragListenerKeys_.length=0,this.element_=null,t.prototype.disposeInternal.call(this)},e}(Rt),fo=1/0,yo=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,Tt(this.queuedElements_)},t.prototype.dequeue=function(){var t=this.elements_,e=this.priorities_,i=t[0];1==t.length?(t.length=0,e.length=0):(t[0]=t.pop(),e[0]=e.pop(),this.siftUp_(0));var n=this.keyFunction_(i);return delete this.queuedElements_[n],i},t.prototype.enqueue=function(t){Ie(!(this.keyFunction_(t)in this.queuedElements_),31);var e=this.priorityFunction_(t);return e!=fo&&(this.elements_.push(t),this.priorities_.push(e),this.queuedElements_[this.keyFunction_(t)]=!0,this.siftDown_(0,this.elements_.length-1),!0)},t.prototype.getCount=function(){return this.elements_.length},t.prototype.getLeftChildIndex_=function(t){return 2*t+1},t.prototype.getRightChildIndex_=function(t){return 2*t+2},t.prototype.getParentIndex_=function(t){return t-1>>1},t.prototype.heapify_=function(){var t;for(t=(this.elements_.length>>1)-1;t>=0;t--)this.siftUp_(t)},t.prototype.isEmpty=function(){return 0===this.elements_.length},t.prototype.isKeyQueued=function(t){return t in this.queuedElements_},t.prototype.isQueued=function(t){return this.isKeyQueued(this.keyFunction_(t))},t.prototype.siftUp_=function(t){for(var e=this.elements_,i=this.priorities_,n=e.length,r=e[t],o=i[t],s=t;t<n>>1;){var a=this.getLeftChildIndex_(t),l=this.getRightChildIndex_(t),u=l<n&&i[l]<i[a]?l:a;e[t]=e[u],i[t]=i[u],t=u}e[t]=r,i[t]=o,this.siftDown_(s,t)},t.prototype.siftDown_=function(t,e){for(var i=this.elements_,n=this.priorities_,r=i[e],o=n[e];e>t;){var s=this.getParentIndex_(e);if(!(n[s]>o))break;i[e]=i[s],n[e]=n[s],e=s}i[e]=r,n[e]=o},t.prototype.reprioritize=function(){var t,e,i,n=this.priorityFunction_,r=this.elements_,o=this.priorities_,s=0,a=r.length;for(e=0;e<a;++e)(i=n(t=r[e]))==fo?delete this.queuedElements_[this.keyFunction_(t)]:(o[s]=i,r[s++]=t);r.length=s,o.length=s,this.heapify_()},t}(),go=0,mo=1,vo=2,_o=3,xo=4,bo=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}(),wo=function(t){function e(e,i){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_=i,n.tilesLoading_=0,n.tilesLoadingKeys_={},n}return bo(e,t),e.prototype.enqueue=function(e){var i=t.prototype.enqueue.call(this,e);i&&e[0].addEventListener(It,this.boundHandleTileChange_);return i},e.prototype.getTilesLoading=function(){return this.tilesLoading_},e.prototype.handleTileChange=function(t){var e=t.target,i=e.getState();if(i===vo||i===_o||i===xo){e.removeEventListener(It,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 i,n,r=0;this.tilesLoading_<t&&r<e&&this.getCount()>0;)n=(i=this.dequeue()[0]).getKey(),i.getState()!==go||n in this.tilesLoadingKeys_||(this.tilesLoadingKeys_[n]=!0,++this.tilesLoading_,++r,i.load())},e}(yo);var So=0,Co=1,To="center",Eo="resolution",ko="rotation";function Po(t,e,i){return function(n,r,o,s,a){if(n){var l=e?0:o[0]*r,u=e?0:o[1]*r,h=a?a[0]:0,c=a?a[1]:0,p=t[0]+l/2+h,d=t[2]-l/2+h,f=t[1]+u/2+c,y=t[3]-u/2+c;p>d&&(d=p=(d+p)/2),f>y&&(y=f=(y+f)/2);var g=Fe(n[0],p,d),m=Fe(n[1],f,y),v=30*r;return s&&i&&(g+=-v*Math.log(1+Math.max(0,p-n[0])/v)+v*Math.log(1+Math.max(0,n[0]-d)/v),m+=-v*Math.log(1+Math.max(0,f-n[1])/v)+v*Math.log(1+Math.max(0,n[1]-y)/v)),[g,m]}}}function Oo(t){return t}function Ro(t,e,i,n){var r=Sn(e)/i[0],o=_n(e)/i[1];return n?Math.min(t,Math.max(r,o)):Math.min(t,Math.min(r,o))}function Io(t,e,i){var n=Math.min(t,e);return n*=Math.log(1+50*Math.max(0,t/e-1))/50+1,i&&(n=Math.max(n,i),n/=Math.log(1+50*Math.max(0,i/t-1))/50+1),Fe(n,i/2,2*e)}function Fo(t,e,i,n,r){return function(o,s,a,l){if(void 0!==o){var u=n?Ro(t,n,a,r):t;return(void 0===i||i)&&l?Io(o,u,e):Fe(o,e,u)}}}function jo(t){return void 0!==t?0:void 0}function Mo(t){return void 0!==t?t:void 0}var Ao="XY",Lo="XYZ",zo="XYM",Do="XYZM";function Go(t,e,i,n,r,o){for(var s=o||[],a=0,l=e;l<i;l+=n){var u=t[l],h=t[l+1];s[a++]=r[0]*u+r[2]*h+r[4],s[a++]=r[1]*u+r[3]*h+r[5]}return o&&s.length!=a&&(s.length=a),s}function No(t,e,i,n,r,o,s){for(var a=s||[],l=Math.cos(r),u=Math.sin(r),h=o[0],c=o[1],p=0,d=e;d<i;d+=n){var f=t[d]-h,y=t[d+1]-c;a[p++]=h+f*l-y*u,a[p++]=c+f*u+y*l;for(var g=d+2;g<d+n;++g)a[p++]=t[g]}return s&&a.length!=p&&(a.length=p),a}function Bo(t,e,i,n,r,o,s){for(var a=s||[],l=0,u=e;u<i;u+=n){a[l++]=t[u]+r,a[l++]=t[u+1]+o;for(var h=u+2;h<u+n;++h)a[l++]=t[h]}return s&&a.length!=l&&(a.length=l),a}var Wo=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}(),qo=[1,0,0,1,0,0],Vo=function(t){function e(){var e,i,n,r,o,s=t.call(this)||this;return s.extent_=[1/0,1/0,-1/0,-1/0],s.extentRevision_=-1,s.simplifiedGeometryMaxMinSquaredTolerance=0,s.simplifiedGeometryRevision=0,s.simplifyTransformedInternal=(e=function(t,e,i){if(!i)return this.getSimplifiedGeometry(e);var n=this.clone();return n.applyTransform(i),n.getSimplifiedGeometry(e)},o=!1,function(){var t=Array.prototype.slice.call(arguments);return o&&this===r&&xt(t,n)||(o=!0,r=this,n=t,i=e.apply(this,arguments)),i}),s}return Wo(e,t),e.prototype.simplifyTransformed=function(t,e){return this.simplifyTransformedInternal(this.getRevision(),t,e)},e.prototype.clone=function(){return Zt()},e.prototype.closestPointXY=function(t,e,i,n){return Zt()},e.prototype.containsXY=function(t,e){var i=this.getClosestPoint([t,e]);return i[0]===t&&i[1]===e},e.prototype.getClosestPoint=function(t,e){var i=e||[NaN,NaN];return this.closestPointXY(t[0],t[1],i,1/0),i},e.prototype.intersectsCoordinate=function(t){return this.containsXY(t[0],t[1])},e.prototype.computeExtent=function(t){return Zt()},e.prototype.getExtent=function(t){if(this.extentRevision_!=this.getRevision()){var e=this.computeExtent(this.extent_);(isNaN(e[0])||isNaN(e[1]))&&rn(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){Zt()},e.prototype.scale=function(t,e,i){Zt()},e.prototype.simplify=function(t){return this.getSimplifiedGeometry(t*t)},e.prototype.getSimplifiedGeometry=function(t){return Zt()},e.prototype.getType=function(){return Zt()},e.prototype.applyTransform=function(t){Zt()},e.prototype.intersectsExtent=function(t){return Zt()},e.prototype.translate=function(t,e){Zt()},e.prototype.transform=function(t,e){var i=Zn(t),n=i.getUnits()==vi.TILE_PIXELS?function(t,n,r){var o=i.getExtent(),s=i.getWorldExtent(),a=_n(s)/_n(o);return vr(qo,s[0],s[3],a,-a,0,0,0),Go(t,0,t.length,r,qo,n),ir(i,e)(t,n,r)}:ir(i,e);return this.applyTransform(n),this},e}(te),Uo=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}();function Xo(t){var e;return t==Ao?e=2:t==Lo||t==zo?e=3:t==Do&&(e=4),e}var Ko=function(t){function e(){var e=t.call(this)||this;return e.layout=Ao,e.stride=2,e.flatCoordinates=null,e}return Uo(e,t),e.prototype.computeExtent=function(t){return sn(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,t)},e.prototype.getCoordinates=function(){return Zt()},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=Xo(t),this.layout=t,this.flatCoordinates=e},e.prototype.setCoordinates=function(t,e){Zt()},e.prototype.setLayout=function(t,e,i){var n;if(t)n=Xo(t);else{for(var r=0;r<i;++r){if(0===e.length)return this.layout=Ao,void(this.stride=2);e=e[0]}t=function(t){var e;2==t?e=Ao:3==t?e=Lo:4==t&&(e=Do);return e}(n=e.length)}this.layout=t,this.stride=n},e.prototype.applyTransform=function(t){this.flatCoordinates&&(t(this.flatCoordinates,this.flatCoordinates,this.stride),this.changed())},e.prototype.rotate=function(t,e){var i=this.getFlatCoordinates();if(i){var n=this.getStride();No(i,0,i.length,n,t,e,i),this.changed()}},e.prototype.scale=function(t,e,i){var n=e;void 0===n&&(n=t);var r=i;r||(r=gn(this.getExtent()));var o=this.getFlatCoordinates();if(o){var s=this.getStride();!function(t,e,i,n,r,o,s,a){for(var l=a||[],u=s[0],h=s[1],c=0,p=e;p<i;p+=n){var d=t[p]-u,f=t[p+1]-h;l[c++]=u+r*d,l[c++]=h+o*f;for(var y=p+2;y<p+n;++y)l[c++]=t[y]}a&&l.length!=c&&(l.length=c)}(o,0,o.length,s,t,n,r,o),this.changed()}},e.prototype.translate=function(t,e){var i=this.getFlatCoordinates();if(i){var n=this.getStride();Bo(i,0,i.length,n,t,e,i),this.changed()}},e}(Vo);function Yo(t,e,i,n,r,o,s){var a,l=t[e],u=t[e+1],h=t[i]-l,c=t[i+1]-u;if(0===h&&0===c)a=e;else{var p=((r-l)*h+(o-u)*c)/(h*h+c*c);if(p>1)a=i;else{if(p>0){for(var d=0;d<n;++d)s[d]=Ge(t[e+d],t[i+d],p);return void(s.length=n)}a=e}}for(d=0;d<n;++d)s[d]=t[a+d];s.length=n}function Zo(t,e,i,n,r){var o=t[e],s=t[e+1];for(e+=n;e<i;e+=n){var a=t[e],l=t[e+1],u=Le(o,s,a,l);u>r&&(r=u),o=a,s=l}return r}function Ho(t,e,i,n,r){for(var o=0,s=i.length;o<s;++o){var a=i[o];r=Zo(t,e,a,n,r),e=a}return r}function $o(t,e,i,n,r,o,s,a,l,u,h){if(e==i)return u;var c,p;if(0===r){if((p=Le(s,a,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 d=h||[NaN,NaN],f=e+n;f<i;)if(Yo(t,f-n,f,n,s,a,d),(p=Le(s,a,d[0],d[1]))<u){for(u=p,c=0;c<n;++c)l[c]=d[c];l.length=n,f+=n}else f+=n*Math.max((Math.sqrt(p)-Math.sqrt(u))/r|0,1);if(o&&(Yo(t,i-n,e,n,s,a,d),(p=Le(s,a,d[0],d[1]))<u)){for(u=p,c=0;c<n;++c)l[c]=d[c];l.length=n}return u}function Jo(t,e,i,n,r,o,s,a,l,u,h){for(var c=h||[NaN,NaN],p=0,d=i.length;p<d;++p){var f=i[p];u=$o(t,e,f,n,r,o,s,a,l,u,c),e=f}return u}function Qo(t,e,i,n){for(var r=0,o=i.length;r<o;++r)t[e++]=i[r];return e}function ts(t,e,i,n){for(var r=0,o=i.length;r<o;++r)for(var s=i[r],a=0;a<n;++a)t[e++]=s[a];return e}function es(t,e,i,n,r){for(var o=r||[],s=0,a=0,l=i.length;a<l;++a){var u=ts(t,e,i[a],n);o[s++]=u,e=u}return o.length=s,o}function is(t,e,i,n,r,o,s){var a=(i-e)/n;if(a<3){for(;e<i;e+=n)o[s++]=t[e],o[s++]=t[e+1];return s}var l=new Array(a);l[0]=1,l[a-1]=1;for(var u=[e,i-n],h=0;u.length>0;){for(var c=u.pop(),p=u.pop(),d=0,f=t[p],y=t[p+1],g=t[c],m=t[c+1],v=p+n;v<c;v+=n){var _=Ae(t[v],t[v+1],f,y,g,m);_>d&&(h=v,d=_)}d>r&&(l[(h-e)/n]=1,p+n<h&&u.push(p,h),h+n<c&&u.push(h,c))}for(v=0;v<a;++v)l[v]&&(o[s++]=t[e+v*n],o[s++]=t[e+v*n+1]);return s}function ns(t,e){return e*Math.round(t/e)}function rs(t,e,i,n,r,o,s){if(e==i)return s;var a,l,u=ns(t[e],r),h=ns(t[e+1],r);e+=n,o[s++]=u,o[s++]=h;do{if(a=ns(t[e],r),l=ns(t[e+1],r),(e+=n)==i)return o[s++]=a,o[s++]=l,s}while(a==u&&l==h);for(;e<i;){var c=ns(t[e],r),p=ns(t[e+1],r);if(e+=n,c!=a||p!=l){var d=a-u,f=l-h,y=c-u,g=p-h;d*g==f*y&&(d<0&&y<d||d==y||d>0&&y>d)&&(f<0&&g<f||f==g||f>0&&g>f)?(a=c,l=p):(o[s++]=a,o[s++]=l,u=a,h=l,a=c,l=p)}}return o[s++]=a,o[s++]=l,s}function os(t,e,i,n,r,o,s,a){for(var l=0,u=i.length;l<u;++l){var h=i[l];s=rs(t,e,h,n,r,o,s),a.push(s),e=h}return s}function ss(t,e,i,n,r){for(var o=void 0!==r?r:[],s=0,a=e;a<i;a+=n)o[s++]=t.slice(a,a+n);return o.length=s,o}function as(t,e,i,n,r){for(var o=void 0!==r?r:[],s=0,a=0,l=i.length;a<l;++a){var u=i[a];o[s++]=ss(t,e,u,n,o[s]),e=u}return o.length=s,o}function ls(t,e,i,n,r){for(var o=void 0!==r?r:[],s=0,a=0,l=i.length;a<l;++a){var u=i[a];o[s++]=as(t,e,u,n,o[s]),e=u[u.length-1]}return o.length=s,o}function us(t,e,i,n){for(var r=0,o=t[i-n],s=t[i-n+1];e<i;e+=n){var a=t[e],l=t[e+1];r+=s*a-o*l,o=a,s=l}return r/2}function hs(t,e,i,n){for(var r=0,o=0,s=i.length;o<s;++o){var a=i[o];r+=us(t,e,a,n),e=a}return r}var cs=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}(),ps=function(t){function e(e,i){var n=t.call(this)||this;return n.maxDelta_=-1,n.maxDeltaRevision_=-1,void 0===i||Array.isArray(e[0])?n.setCoordinates(e,i):n.setFlatCoordinates(i,e),n}return cs(e,t),e.prototype.clone=function(){return new e(this.flatCoordinates.slice(),this.layout)},e.prototype.closestPointXY=function(t,e,i,n){return n<Hi(this.getExtent(),t,e)?n:(this.maxDeltaRevision_!=this.getRevision()&&(this.maxDelta_=Math.sqrt(Zo(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,0)),this.maxDeltaRevision_=this.getRevision()),$o(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,this.maxDelta_,!0,t,e,i,n))},e.prototype.getArea=function(){return us(this.flatCoordinates,0,this.flatCoordinates.length,this.stride)},e.prototype.getCoordinates=function(){return ss(this.flatCoordinates,0,this.flatCoordinates.length,this.stride)},e.prototype.getSimplifiedGeometryInternal=function(t){var i=[];return i.length=is(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,t,i,0),new e(i,Ao)},e.prototype.getType=function(){return On},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=ts(this.flatCoordinates,0,t,this.stride),this.changed()},e}(Ko),ds=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}(),fs=function(t){function e(e,i){var n=t.call(this)||this;return n.setCoordinates(e,i),n}return ds(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,i,n){var r=this.flatCoordinates,o=Le(t,e,r[0],r[1]);if(o<n){for(var s=this.stride,a=0;a<s;++a)i[a]=r[a];return i.length=s,o}return n},e.prototype.getCoordinates=function(){return this.flatCoordinates?this.flatCoordinates.slice():[]},e.prototype.computeExtent=function(t){return on(this.flatCoordinates,t)},e.prototype.getType=function(){return kn},e.prototype.intersectsExtent=function(t){return Qi(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=Qo(this.flatCoordinates,0,t,this.stride),this.changed()},e}(Ko);function ys(t,e,i,n,r){return!pn(r,(function(r){return!gs(t,e,i,n,r[0],r[1])}))}function gs(t,e,i,n,r,o){for(var s=0,a=t[i-n],l=t[i-n+1];e<i;e+=n){var u=t[e],h=t[e+1];l<=o?h>o&&(u-a)*(o-l)-(r-a)*(h-l)>0&&s++:h<=o&&(u-a)*(o-l)-(r-a)*(h-l)<0&&s--,a=u,l=h}return 0!==s}function ms(t,e,i,n,r,o){if(0===i.length)return!1;if(!gs(t,e,i[0],n,r,o))return!1;for(var s=1,a=i.length;s<a;++s)if(gs(t,i[s-1],i[s],n,r,o))return!1;return!0}function vs(t,e,i,n,r,o,s){for(var a,l,u,h,c,p,d,f=r[o+1],y=[],g=0,m=i.length;g<m;++g){var v=i[g];for(h=t[v-n],p=t[v-n+1],a=e;a<v;a+=n)c=t[a],d=t[a+1],(f<=p&&d<=f||p<=f&&f<=d)&&(u=(f-p)/(d-p)*(c-h)+h,y.push(u)),h=c,p=d}var _=NaN,x=-1/0;for(y.sort(gt),h=y[0],a=1,l=y.length;a<l;++a){c=y[a];var b=Math.abs(c-h);b>x&&ms(t,e,i,n,u=(h+c)/2,f)&&(_=u,x=b),h=c}return isNaN(_)&&(_=r[o]),s?(s.push(_,f,x),s):[_,f,x]}function _s(t,e,i,n,r){for(var o=[],s=0,a=i.length;s<a;++s){var l=i[s];o=vs(t,e,l,n,r,2*s,o),e=l[l.length-1]}return o}function xs(t,e,i,n,r){for(var o,s=[t[e],t[e+1]],a=[];e+n<i;e+=n){if(a[0]=t[e+n],a[1]=t[e+n+1],o=r(s,a))return o;s[0]=a[0],s[1]=a[1]}return!1}function bs(t,e,i,n,r){var o=hn([1/0,1/0,-1/0,-1/0],t,e,i,n);return!!Cn(r,o)&&(!!Ji(r,o)||(o[0]>=r[0]&&o[2]<=r[2]||(o[1]>=r[1]&&o[3]<=r[3]||xs(t,e,i,n,(function(t,e){return function(t,e,i){var n=!1,r=tn(t,e),o=tn(t,i);if(r===Wi||o===Wi)n=!0;else{var s=t[0],a=t[1],l=t[2],u=t[3],h=e[0],c=e[1],p=i[0],d=i[1],f=(d-c)/(p-h),y=void 0,g=void 0;o&qi&&!(r&qi)&&(n=(y=p-(d-u)/f)>=s&&y<=l),n||!(o&Vi)||r&Vi||(n=(g=d-(p-l)*f)>=a&&g<=u),n||!(o&Ui)||r&Ui||(n=(y=p-(d-a)/f)>=s&&y<=l),n||!(o&Xi)||r&Xi||(n=(g=d-(p-s)*f)>=a&&g<=u)}return n}(r,t,e)})))))}function ws(t,e,i,n,r){if(!function(t,e,i,n,r){return!!(bs(t,e,i,n,r)||gs(t,e,i,n,r[0],r[1])||gs(t,e,i,n,r[0],r[3])||gs(t,e,i,n,r[2],r[1])||gs(t,e,i,n,r[2],r[3]))}(t,e,i[0],n,r))return!1;if(1===i.length)return!0;for(var o=1,s=i.length;o<s;++o)if(ys(t,i[o-1],i[o],n,r)&&!bs(t,i[o-1],i[o],n,r))return!1;return!0}function Ss(t,e,i,n){for(;e<i-n;){for(var r=0;r<n;++r){var o=t[e+r];t[e+r]=t[i-n+r],t[i-n+r]=o}e+=n,i-=n}}function Cs(t,e,i,n){for(var r=0,o=t[i-n],s=t[i-n+1];e<i;e+=n){var a=t[e],l=t[e+1];r+=(a-o)*(l+s),o=a,s=l}return 0===r?void 0:r>0}function Ts(t,e,i,n,r){for(var o=void 0!==r&&r,s=0,a=i.length;s<a;++s){var l=i[s],u=Cs(t,e,l,n);if(0===s){if(o&&u||!o&&!u)return!1}else if(o&&!u||!o&&u)return!1;e=l}return!0}function Es(t,e,i,n,r){for(var o=void 0!==r&&r,s=0,a=i.length;s<a;++s){var l=i[s],u=Cs(t,e,l,n);(0===s?o&&u||!o&&!u:o&&!u||!o&&u)&&Ss(t,e,l,n),e=l}return e}function ks(t,e,i,n,r){for(var o=0,s=i.length;o<s;++o)e=Es(t,e,i[o],n,r);return e}var Ps=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}(),Os=function(t){function e(e,i,n){var r=t.call(this)||this;return r.ends_=[],r.flatInteriorPointRevision_=-1,r.flatInteriorPoint_=null,r.maxDelta_=-1,r.maxDeltaRevision_=-1,r.orientedRevision_=-1,r.orientedFlatCoordinates_=null,void 0!==i&&n?(r.setFlatCoordinates(i,e),r.ends_=n):r.setCoordinates(e,i),r}return Ps(e,t),e.prototype.appendLinearRing=function(t){this.flatCoordinates?_t(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,i,n){return n<Hi(this.getExtent(),t,e)?n:(this.maxDeltaRevision_!=this.getRevision()&&(this.maxDelta_=Math.sqrt(Ho(this.flatCoordinates,0,this.ends_,this.stride,0)),this.maxDeltaRevision_=this.getRevision()),Jo(this.flatCoordinates,0,this.ends_,this.stride,this.maxDelta_,!0,t,e,i,n))},e.prototype.containsXY=function(t,e){return ms(this.getOrientedFlatCoordinates(),0,this.ends_,this.stride,t,e)},e.prototype.getArea=function(){return hs(this.getOrientedFlatCoordinates(),0,this.ends_,this.stride)},e.prototype.getCoordinates=function(t){var e;return void 0!==t?Es(e=this.getOrientedFlatCoordinates().slice(),0,this.ends_,this.stride,t):e=this.flatCoordinates,as(e,0,this.ends_,this.stride)},e.prototype.getEnds=function(){return this.ends_},e.prototype.getFlatInteriorPoint=function(){if(this.flatInteriorPointRevision_!=this.getRevision()){var t=gn(this.getExtent());this.flatInteriorPoint_=vs(this.getOrientedFlatCoordinates(),0,this.ends_,this.stride,t,0),this.flatInteriorPointRevision_=this.getRevision()}return this.flatInteriorPoint_},e.prototype.getInteriorPoint=function(){return new fs(this.getFlatInteriorPoint(),zo)},e.prototype.getLinearRingCount=function(){return this.ends_.length},e.prototype.getLinearRing=function(t){return t<0||this.ends_.length<=t?null:new ps(this.flatCoordinates.slice(0===t?0:this.ends_[t-1],this.ends_[t]),this.layout)},e.prototype.getLinearRings=function(){for(var t=this.layout,e=this.flatCoordinates,i=this.ends_,n=[],r=0,o=0,s=i.length;o<s;++o){var a=i[o],l=new ps(e.slice(r,a),t);n.push(l),r=a}return n},e.prototype.getOrientedFlatCoordinates=function(){if(this.orientedRevision_!=this.getRevision()){var t=this.flatCoordinates;Ts(t,0,this.ends_,this.stride)?this.orientedFlatCoordinates_=t:(this.orientedFlatCoordinates_=t.slice(),this.orientedFlatCoordinates_.length=Es(this.orientedFlatCoordinates_,0,this.ends_,this.stride)),this.orientedRevision_=this.getRevision()}return this.orientedFlatCoordinates_},e.prototype.getSimplifiedGeometryInternal=function(t){var i=[],n=[];return i.length=os(this.flatCoordinates,0,this.ends_,this.stride,Math.sqrt(t),i,0,n),new e(i,Ao,n)},e.prototype.getType=function(){return Rn},e.prototype.intersectsExtent=function(t){return ws(this.getOrientedFlatCoordinates(),0,this.ends_,this.stride,t)},e.prototype.setCoordinates=function(t,e){this.setLayout(e,t,2),this.flatCoordinates||(this.flatCoordinates=[]);var i=es(this.flatCoordinates,0,t,this.stride,this.ends_);this.flatCoordinates.length=0===i.length?0:i[i.length-1],this.changed()},e}(Ko);function Rs(t){var e=t[0],i=t[1],n=t[2],r=t[3],o=[e,i,e,r,n,r,n,i,e,i];return new Os(o,Ao,[o.length])}function Is(t,e,i){for(var n=e||32,r=t.getStride(),o=t.getLayout(),s=t.getCenter(),a=r*(n+1),l=new Array(a),u=0;u<a;u+=r){l[u]=0,l[u+1]=0;for(var h=2;h<r;h++)l[u+h]=s[h]}var c=[l.length],p=new Os(l,o,c);return function(t,e,i,n){for(var r=t.getFlatCoordinates(),o=t.getStride(),s=r.length/o-1,a=n||0,l=0;l<=s;++l){var u=l*o,h=a+2*De(l,s)*Math.PI/s;r[u]=e[0]+i*Math.cos(h),r[u+1]=e[1]+i*Math.sin(h)}t.changed()}(p,s,t.getRadius(),i),p}var Fs=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}();function js(t,e){setTimeout((function(){t(e)}),0)}function Ms(t){return!(t.sourceCenter&&t.targetCenter&&!Nn(t.sourceCenter,t.targetCenter))&&(t.sourceResolution===t.targetResolution&&t.sourceRotation===t.targetRotation)}function As(t,e,i,n,r){var o=Math.cos(-r),s=Math.sin(-r),a=t[0]*o-t[1]*s,l=t[1]*o+t[0]*s;return[(a+=(e[0]/2-i[0])*n)*o-(l+=(i[1]-e[1]/2)*n)*(s=-s),l*o+a*s]}var Ls=function(t){function e(e){var i=t.call(this)||this;i.on,i.once,i.un;var n=Ct({},e);return i.hints_=[0,0],i.animations_=[],i.updateAnimationKey_,i.projection_=Jn(n.projection,"EPSG:3857"),i.viewportSize_=[100,100],i.targetCenter_=null,i.targetResolution_,i.targetRotation_,i.cancelAnchor_=void 0,n.center&&(n.center=lr(n.center,i.projection_)),n.extent&&(n.extent=hr(n.extent,i.projection_)),i.applyOptions_(n),i}return Fs(e,t),e.prototype.applyOptions_=function(t){var e=function(t){var e,i,n,r=28,o=2,s=void 0!==t.minZoom?t.minZoom:0,a=void 0!==t.maxZoom?t.maxZoom:r,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=Jn(t.projection,"EPSG:3857"),d=p.getExtent(),f=t.constrainOnlyCenter,y=t.extent;u||y||!p.isGlobal()||(f=!1,y=d);if(void 0!==t.resolutions){var g=t.resolutions;i=g[s],n=void 0!==g[a]?g[a]:g[g.length-1],e=t.constrainResolution?function(t,e,i,n){return function(r,o,s,a){if(void 0!==r){var l=t[0],u=t[t.length-1],h=i?Ro(l,i,s,n):l;if(a)return void 0===e||e?Io(r,h,u):Fe(r,u,h);var c=Math.min(h,r),p=Math.floor(mt(t,c,o));return t[p]>h&&p<t.length-1?t[p+1]:t[p]}}}(g,h,!f&&y,c):Fo(i,n,h,!f&&y,c)}else{var m=(d?Math.max(Sn(d),_n(d)):360*mi[vi.DEGREES]/p.getMetersPerUnit())/256/Math.pow(o,0),v=m/Math.pow(o,r-0);void 0!==(i=t.maxResolution)?s=0:i=m/Math.pow(l,s),void 0===(n=t.minResolution)&&(n=void 0!==t.maxZoom?void 0!==t.maxResolution?i/Math.pow(l,a):m/Math.pow(l,a):v),a=s+Math.floor(Math.log(i/n)/Math.log(l)),n=i/Math.pow(l,a-s),e=t.constrainResolution?function(t,e,i,n,r,o){return function(s,a,l,u){if(void 0!==s){var h=r?Ro(e,r,l,o):e,c=void 0!==i?i:0;if(u)return void 0===n||n?Io(s,h,c):Fe(s,c,h);var p=Math.ceil(Math.log(e/h)/Math.log(t)-1e-9),d=-a*(.5-1e-9)+.5,f=Math.min(h,s),y=Math.floor(Math.log(e/f)/Math.log(t)+d),g=Math.max(p,y);return Fe(e/Math.pow(t,g),c,h)}}}(l,i,n,h,!f&&y,c):Fo(i,n,h,!f&&y,c)}return{constraint:e,maxResolution:i,minResolution:n,minZoom:s,zoomFactor:l}}(t);this.maxResolution_=e.maxResolution,this.minResolution_=e.minResolution,this.zoomFactor_=e.zoomFactor,this.resolutions_=t.resolutions,this.padding_=t.padding,this.minZoom_=e.minZoom;var i=function(t){if(void 0!==t.extent){var e=void 0===t.smoothExtentConstraint||t.smoothExtentConstraint;return Po(t.extent,t.constrainOnlyCenter,e)}var i=Jn(t.projection,"EPSG:3857");if(!0!==t.multiWorld&&i.isGlobal()){var n=i.getExtent().slice();return n[0]=-1/0,n[2]=1/0,Po(n,!1,!1)}return Oo}(t),n=e.constraint,r=function(t){if(void 0===t.enableRotation||t.enableRotation){var e=t.constrainRotation;return void 0===e||!0===e?(o=r||ze(5),function(t,e){return e?t:void 0!==t?Math.abs(t)<=o?0:t:void 0}):!1===e?Mo:"number"==typeof e?(i=e,n=2*Math.PI/i,function(t,e){return e?t:void 0!==t?t=Math.floor(t/n+.5)*n:void 0}):Mo}return jo;var i,n;var r,o}(t);this.constraints_={center:i,resolution:n,rotation:r},this.setRotation(void 0!==t.rotation?t.rotation:0),this.setCenterInternal(void 0!==t.center?t.center:null),void 0!==t.resolution?this.setResolution(t.resolution):void 0!==t.zoom&&this.setZoom(t.zoom),this.setProperties({}),this.options_=t},Object.defineProperty(e.prototype,"padding",{get:function(){return this.padding_},set:function(t){var e=this.padding_;this.padding_=t;var i=this.getCenter();if(i){var n=t||[0,0,0,0];e=e||[0,0,0,0];var r=this.getResolution(),o=r/2*(n[3]-e[3]+e[1]-n[1]),s=r/2*(n[0]-e[0]+e[2]-n[2]);this.setCenterInternal([i[0]+o,i[1]-s])}},enumerable:!1,configurable:!0}),e.prototype.getUpdatedOptions_=function(t){var e=Ct({},this.options_);return void 0!==e.resolution?e.resolution=this.getResolution():e.zoom=this.getZoom(),e.center=this.getCenterInternal(),e.rotation=this.getRotation(),Ct({},e,t)},e.prototype.animate=function(t){this.isDef()&&!this.getAnimating()&&this.resolveConstraints(0);for(var e=new Array(arguments.length),i=0;i<e.length;++i){var n=arguments[i];n.center&&((n=Ct({},n)).center=lr(n.center,this.getProjection())),n.anchor&&((n=Ct({},n)).anchor=lr(n.anchor,this.getProjection())),e[i]=n}this.animateInternal.apply(this,e)},e.prototype.animateInternal=function(t){var e,i=arguments.length;if(i>1&&"function"==typeof arguments[i-1]&&(e=arguments[i-1],--i),!this.isDef()){var n=arguments[i-1];return n.center&&this.setCenterInternal(n.center),void 0!==n.zoom&&this.setZoom(n.zoom),void 0!==n.rotation&&this.setRotation(n.rotation),void(e&&js(e,!0))}for(var r=Date.now(),o=this.targetCenter_.slice(),s=this.targetResolution_,a=this.targetRotation_,l=[],u=0;u<i;++u){var h=arguments[u],c={start:r,complete:!1,anchor:h.anchor,duration:void 0!==h.duration?h.duration:1e3,easing:h.easing||li,callback:e};if(h.center&&(c.sourceCenter=o,c.targetCenter=h.center.slice(),o=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=a;var p=De(h.rotation-a+Math.PI,2*Math.PI)-Math.PI;c.targetRotation=a+p,a=c.targetRotation}Ms(c)?c.complete=!0:r+=c.duration,l.push(c)}this.animations_.push(l),this.setHint(So,1),this.updateAnimations_()},e.prototype.getAnimating=function(){return this.hints_[So]>0},e.prototype.getInteracting=function(){return this.hints_[Co]>0},e.prototype.cancelAnimations=function(){var t;this.setHint(So,-this.hints_[So]);for(var e=0,i=this.animations_.length;e<i;++e){var n=this.animations_[e];if(n[0].callback&&js(n[0].callback,!1),!t)for(var r=0,o=n.length;r<o;++r){var s=n[r];if(!s.complete){t=s.anchor;break}}}this.animations_.length=0,this.cancelAnchor_=t},e.prototype.updateAnimations_=function(){if(void 0!==this.updateAnimationKey_&&(cancelAnimationFrame(this.updateAnimationKey_),this.updateAnimationKey_=void 0),this.getAnimating()){for(var t=Date.now(),e=!1,i=this.animations_.length-1;i>=0;--i){for(var n=this.animations_[i],r=!0,o=0,s=n.length;o<s;++o){var a=n[o];if(!a.complete){var l=t-a.start,u=a.duration>0?l/a.duration:1;u>=1?(a.complete=!0,u=1):r=!1;var h=a.easing(u);if(a.sourceCenter){var c=a.sourceCenter[0],p=a.sourceCenter[1],d=c+h*(a.targetCenter[0]-c),f=p+h*(a.targetCenter[1]-p);this.targetCenter_=[d,f]}if(a.sourceResolution&&a.targetResolution){var y=1===h?a.targetResolution:a.sourceResolution+h*(a.targetResolution-a.sourceResolution);if(a.anchor){var g=this.getViewportSize_(this.getRotation()),m=this.constraints_.resolution(y,0,g,!0);this.targetCenter_=this.calculateCenterZoom(m,a.anchor)}this.targetResolution_=y,this.applyTargetState_(!0)}if(void 0!==a.sourceRotation&&void 0!==a.targetRotation){var v=1===h?De(a.targetRotation+Math.PI,2*Math.PI)-Math.PI:a.sourceRotation+h*(a.targetRotation-a.sourceRotation);if(a.anchor){var _=this.constraints_.rotation(v,!0);this.targetCenter_=this.calculateCenterRotate(_,a.anchor)}this.targetRotation_=v}if(this.applyTargetState_(!0),e=!0,!a.complete)break}}if(r){this.animations_[i]=null,this.setHint(So,-1);var x=n[0].callback;x&&js(x,!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 i,n,r,o=this.getCenterInternal();return void 0!==o&&(Bn(i=[o[0]-e[0],o[1]-e[1]],t-this.getRotation()),r=e,(n=i)[0]+=+r[0],n[1]+=+r[1]),i},e.prototype.calculateCenterZoom=function(t,e){var i,n=this.getCenterInternal(),r=this.getResolution();void 0!==n&&void 0!==r&&(i=[e[0]-t*(e[0]-n[0])/r,e[1]-t*(e[1]-n[1])/r]);return i},e.prototype.getViewportSize_=function(t){var e=this.viewportSize_;if(t){var i=e[0],n=e[1];return[Math.abs(i*Math.cos(t))+Math.abs(n*Math.sin(t)),Math.abs(i*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?ar(t,this.getProjection()):t},e.prototype.getCenterInternal=function(){return this.get(To)},e.prototype.getConstraints=function(){return this.constraints_},e.prototype.getConstrainResolution=function(){return this.options_.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 ur(this.calculateExtentInternal(t),this.getProjection())},e.prototype.calculateExtentInternal=function(t){var e=t||this.getViewportSizeMinusPadding_(),i=this.getCenterInternal();Ie(i,1);var n=this.getResolution();Ie(void 0!==n,2);var r=this.getRotation();return Ie(void 0!==r,3),vn(i,n,r,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(Eo)},e.prototype.getResolutions=function(){return this.resolutions_},e.prototype.getResolutionForExtent=function(t,e){return this.getResolutionForExtentInternal(hr(t,this.getProjection()),e)},e.prototype.getResolutionForExtentInternal=function(t,e){var i=e||this.getViewportSizeMinusPadding_(),n=Sn(t)/i[0],r=_n(t)/i[1];return Math.max(n,r)},e.prototype.getResolutionForValueFunction=function(t){var e=t||2,i=this.getConstrainedResolution(this.maxResolution_),n=this.minResolution_,r=Math.log(i/n)/Math.log(e);return function(t){return i/Math.pow(e,t*r)}},e.prototype.getRotation=function(){return this.get(ko)},e.prototype.getValueForResolutionFunction=function(t){var e=Math.log(t||2),i=this.getConstrainedResolution(this.maxResolution_),n=this.minResolution_,r=Math.log(i/n)/e;return function(t){return Math.log(i/t)/e/r}},e.prototype.getViewportSizeMinusPadding_=function(t){var e=this.getViewportSize_(t),i=this.padding_;return i&&(e=[e[0]-i[1]-i[3],e[1]-i[0]-i[2]]),e},e.prototype.getState=function(){var t=this.getProjection(),e=this.getResolution(),i=this.getRotation(),n=this.getCenterInternal(),r=this.padding_;if(r){var o=this.getViewportSizeMinusPadding_();n=As(n,this.getViewportSize_(),[o[0]/2+r[3],o[1]/2+r[0]],e,i)}return{center:n.slice(0),projection:void 0!==t?t:null,resolution:e,rotation:i,zoom:this.getZoom()}},e.prototype.getZoom=function(){var t,e=this.getResolution();return void 0!==e&&(t=this.getZoomForResolution(e)),t},e.prototype.getZoomForResolution=function(t){var e,i,n=this.minZoom_||0;if(this.resolutions_){var r=mt(this.resolutions_,t,1);n=r,e=this.resolutions_[r],i=r==this.resolutions_.length-1?2:e/this.resolutions_[r+1]}else e=this.maxResolution_,i=this.zoomFactor_;return n+Math.log(e/t)/Math.log(i)},e.prototype.getResolutionForZoom=function(t){if(this.resolutions_){if(this.resolutions_.length<=1)return 0;var e=Fe(Math.floor(t),0,this.resolutions_.length-2),i=this.resolutions_[e]/this.resolutions_[e+1];return this.resolutions_[e]/Math.pow(i,Fe(t-e,0,1))}return this.maxResolution_/Math.pow(this.zoomFactor_,t-this.minZoom_)},e.prototype.fit=function(t,e){var i;if(Ie(Array.isArray(t)||"function"==typeof t.getSimplifiedGeometry,24),Array.isArray(t))Ie(!Tn(t),25),i=Rs(n=hr(t,this.getProjection()));else if(t.getType()===An){var n;(i=Rs(n=hr(t.getExtent(),this.getProjection()))).rotate(this.getRotation(),gn(n))}else{i=t}this.fitInternal(i,e)},e.prototype.rotatedExtentForGeometry=function(t){for(var e=this.getRotation(),i=Math.cos(e),n=Math.sin(-e),r=t.getFlatCoordinates(),o=t.getStride(),s=1/0,a=1/0,l=-1/0,u=-1/0,h=0,c=r.length;h<c;h+=o){var p=r[h]*i-r[h+1]*n,d=r[h]*n+r[h+1]*i;s=Math.min(s,p),a=Math.min(a,d),l=Math.max(l,p),u=Math.max(u,d)}return[s,a,l,u]},e.prototype.fitInternal=function(t,e){var i=e||{},n=i.size;n||(n=this.getViewportSizeMinusPadding_());var r,o=void 0!==i.padding?i.padding:[0,0,0,0],s=void 0!==i.nearest&&i.nearest;r=void 0!==i.minResolution?i.minResolution:void 0!==i.maxZoom?this.getResolutionForZoom(i.maxZoom):0;var a=this.rotatedExtentForGeometry(t),l=this.getResolutionForExtentInternal(a,[n[0]-o[1]-o[3],n[1]-o[0]-o[2]]);l=isNaN(l)?r:Math.max(l,r),l=this.getConstrainedResolution(l,s?0:1);var u=this.getRotation(),h=Math.sin(u),c=Math.cos(u),p=gn(a);p[0]+=(o[1]-o[3])/2*l,p[1]+=(o[0]-o[2])/2*l;var d=p[0]*c-p[1]*h,f=p[1]*c+p[0]*h,y=this.getConstrainedCenter([d,f],l),g=i.callback?i.callback:St;void 0!==i.duration?this.animateInternal({resolution:l,center:y,duration:i.duration,easing:i.easing},g):(this.targetResolution_=l,this.targetCenter_=y,this.applyTargetState_(!1,!0),js(g,!0))},e.prototype.centerOn=function(t,e,i){this.centerOnInternal(lr(t,this.getProjection()),e,i)},e.prototype.centerOnInternal=function(t,e,i){this.setCenterInternal(As(t,e,i,this.getResolution(),this.getRotation()))},e.prototype.calculateCenterShift=function(t,e,i,n){var r,o=this.padding_;if(o&&t){var s=this.getViewportSizeMinusPadding_(-i),a=As(t,n,[s[0]/2+o[3],s[1]/2+o[0]],e,i);r=[t[0]-a[0],t[1]-a[1]]}return r},e.prototype.isDef=function(){return!!this.getCenterInternal()&&void 0!==this.getResolution()},e.prototype.adjustCenter=function(t){var e=ar(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 i=e&&lr(e,this.getProjection());this.adjustResolutionInternal(t,i)},e.prototype.adjustResolutionInternal=function(t,e){var i=this.getAnimating()||this.getInteracting(),n=this.getViewportSize_(this.getRotation()),r=this.constraints_.resolution(this.targetResolution_*t,0,n,i);e&&(this.targetCenter_=this.calculateCenterZoom(r,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=lr(e,this.getProjection())),this.adjustRotationInternal(t,e)},e.prototype.adjustRotationInternal=function(t,e){var i=this.getAnimating()||this.getInteracting(),n=this.constraints_.rotation(this.targetRotation_+t,i);e&&(this.targetCenter_=this.calculateCenterRotate(n,e)),this.targetRotation_+=t,this.applyTargetState_()},e.prototype.setCenter=function(t){this.setCenterInternal(lr(t,this.getProjection()))},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 i=this.getAnimating()||this.getInteracting()||e,n=this.constraints_.rotation(this.targetRotation_,i),r=this.getViewportSize_(n),o=this.constraints_.resolution(this.targetResolution_,0,r,i),s=this.constraints_.center(this.targetCenter_,o,r,i,this.calculateCenterShift(this.targetCenter_,o,n,r));this.get(ko)!==n&&this.set(ko,n),this.get(Eo)!==o&&this.set(Eo,o),this.get(To)&&Nn(this.get(To),s)||this.set(To,s),this.getAnimating()&&!t&&this.cancelAnimations(),this.cancelAnchor_=void 0},e.prototype.resolveConstraints=function(t,e,i){var n=void 0!==t?t:200,r=e||0,o=this.constraints_.rotation(this.targetRotation_),s=this.getViewportSize_(o),a=this.constraints_.resolution(this.targetResolution_,r,s),l=this.constraints_.center(this.targetCenter_,a,s,!1,this.calculateCenterShift(this.targetCenter_,a,o,s));if(0===n&&!this.cancelAnchor_)return this.targetResolution_=a,this.targetRotation_=o,this.targetCenter_=l,void this.applyTargetState_();var u=i||(0===n?this.cancelAnchor_:void 0);this.cancelAnchor_=void 0,this.getResolution()===a&&this.getRotation()===o&&this.getCenterInternal()&&Nn(this.getCenterInternal(),l)||(this.getAnimating()&&this.cancelAnimations(),this.animateInternal({rotation:o,center:l,resolution:a,duration:n,easing:ai,anchor:u}))},e.prototype.beginInteraction=function(){this.resolveConstraints(0),this.setHint(Co,1)},e.prototype.endInteraction=function(t,e,i){var n=i&&lr(i,this.getProjection());this.endInteractionInternal(t,e,n)},e.prototype.endInteractionInternal=function(t,e,i){this.setHint(Co,-1),this.resolveConstraints(t,e,i)},e.prototype.getConstrainedCenter=function(t,e){var i=this.getViewportSize_(this.getRotation());return this.constraints_.center(t,e||this.getResolution(),i)},e.prototype.getConstrainedZoom=function(t,e){var i=this.getResolutionForZoom(t);return this.getZoomForResolution(this.getConstrainedResolution(i,e))},e.prototype.getConstrainedResolution=function(t,e){var i=e||0,n=this.getViewportSize_(this.getRotation());return this.constraints_.resolution(t,i,n)},e}(te);function zs(t){return t[0]>0&&t[1]>0}function Ds(t,e){return Array.isArray(t)?t:(void 0===e?e=[t,t]:(e[0]=t,e[1]=t),e)}var Gs=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}();var Ns=function(t){function e(e){var i=t.call(this)||this;i.on,i.once,i.un;var n=function(t){var e=null;void 0!==t.keyboardEventTarget&&(e="string"==typeof t.keyboardEventTarget?document.getElementById(t.keyboardEventTarget):t.keyboardEventTarget);var i,n,r,o={},s=t.layers&&"function"==typeof t.layers.getLayers?t.layers:new oo({layers:t.layers});o[Qr]=s,o[eo]=t.target,o[io]=void 0!==t.view?t.view:new Ls,void 0!==t.controls&&(Array.isArray(t.controls)?i=new oi(t.controls.slice()):(Ie("function"==typeof t.controls.getArray,47),i=t.controls));void 0!==t.interactions&&(Array.isArray(t.interactions)?n=new oi(t.interactions.slice()):(Ie("function"==typeof t.interactions.getArray,48),n=t.interactions));void 0!==t.overlays?Array.isArray(t.overlays)?r=new oi(t.overlays.slice()):(Ie("function"==typeof t.overlays.getArray,49),r=t.overlays):r=new oi;return{controls:i,interactions:n,keyboardEventTarget:e,overlays:r,values:o}}(e);return i.boundHandleBrowserEvent_=i.handleBrowserEvent.bind(i),i.maxTilesLoading_=void 0!==e.maxTilesLoading?e.maxTilesLoading:16,i.pixelRatio_=void 0!==e.pixelRatio?e.pixelRatio:le,i.postRenderTimeoutHandle_,i.animationDelayKey_,i.animationDelay_=function(){this.animationDelayKey_=void 0,this.renderFrame_(Date.now())}.bind(i),i.coordinateToPixelTransform_=[1,0,0,1,0,0],i.pixelToCoordinateTransform_=[1,0,0,1,0,0],i.frameIndex_=0,i.frameState_=null,i.previousExtent_=null,i.viewPropertyListenerKey_=null,i.viewChangeListenerKey_=null,i.layerGroupPropertyListenerKeys_=null,i.viewport_=document.createElement("div"),i.viewport_.className="ol-viewport"+("ontouchstart"in window?" ol-touch":""),i.viewport_.style.position="relative",i.viewport_.style.overflow="hidden",i.viewport_.style.width="100%",i.viewport_.style.height="100%",i.overlayContainer_=document.createElement("div"),i.overlayContainer_.style.position="absolute",i.overlayContainer_.style.zIndex="0",i.overlayContainer_.style.width="100%",i.overlayContainer_.style.height="100%",i.overlayContainer_.style.pointerEvents="none",i.overlayContainer_.className="ol-overlaycontainer",i.viewport_.appendChild(i.overlayContainer_),i.overlayContainerStopEvent_=document.createElement("div"),i.overlayContainerStopEvent_.style.position="absolute",i.overlayContainerStopEvent_.style.zIndex="0",i.overlayContainerStopEvent_.style.width="100%",i.overlayContainerStopEvent_.style.height="100%",i.overlayContainerStopEvent_.style.pointerEvents="none",i.overlayContainerStopEvent_.className="ol-overlaycontainer-stopevent",i.viewport_.appendChild(i.overlayContainerStopEvent_),i.mapBrowserEventHandler_=null,i.moveTolerance_=e.moveTolerance,i.keyboardEventTarget_=n.keyboardEventTarget,i.keyHandlerKeys_=null,i.controls=n.controls||new oi,i.interactions=n.interactions||new oi,i.overlays_=n.overlays,i.overlayIdIndex_={},i.renderer_=null,i.handleResize_,i.postRenderFunctions_=[],i.tileQueue_=new wo(i.getTilePriority.bind(i),i.handleTileChange_.bind(i)),i.addChangeListener(Qr,i.handleLayerGroupChanged_),i.addChangeListener(io,i.handleViewChanged_),i.addChangeListener(to,i.handleSizeChanged_),i.addChangeListener(eo,i.handleTargetChanged_),i.setProperties(n.values),i.controls.forEach(function(t){t.setMap(this)}.bind(i)),i.controls.addEventListener(ti,function(t){t.element.setMap(this)}.bind(i)),i.controls.addEventListener(ei,function(t){t.element.setMap(null)}.bind(i)),i.interactions.forEach(function(t){t.setMap(this)}.bind(i)),i.interactions.addEventListener(ti,function(t){t.element.setMap(this)}.bind(i)),i.interactions.addEventListener(ei,function(t){t.element.setMap(null)}.bind(i)),i.overlays_.forEach(i.addOverlayInternal_.bind(i)),i.overlays_.addEventListener(ti,function(t){this.addOverlayInternal_(t.element)}.bind(i)),i.overlays_.addEventListener(ei,function(t){var e=t.element.getId();void 0!==e&&delete this.overlayIdIndex_[e.toString()],t.element.setMap(null)}.bind(i)),i}return Gs(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.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.setTarget(null),t.prototype.disposeInternal.call(this)},e.prototype.forEachFeatureAtPixel=function(t,e,i){if(this.frameState_){var n=this.getCoordinateFromPixelInternal(t),r=void 0!==(i=void 0!==i?i:{}).hitTolerance?i.hitTolerance:0,o=void 0!==i.layerFilter?i.layerFilter:bt,s=!1!==i.checkWrapped;return this.renderer_.forEachFeatureAtCoordinate(n,this.frameState_,r,s,e,null,o,null)}},e.prototype.getFeaturesAtPixel=function(t,e){var i=[];return this.forEachFeatureAtPixel(t,(function(t){i.push(t)}),e),i},e.prototype.forEachLayerAtPixel=function(t,e,i){if(this.frameState_){var n=i||{},r=void 0!==n.hitTolerance?n.hitTolerance:0,o=n.layerFilter||bt;return this.renderer_.forEachLayerAtPixel(t,this.frameState_,r,e,o)}},e.prototype.hasFeatureAtPixel=function(t,e){if(!this.frameState_)return!1;var i=this.getCoordinateFromPixelInternal(t),n=void 0!==(e=void 0!==e?e:{}).layerFilter?e.layerFilter:bt,r=void 0!==e.hitTolerance?e.hitTolerance:0,o=!1!==e.checkWrapped;return this.renderer_.hasFeatureAtCoordinate(i,this.frameState_,r,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(),i="changedTouches"in t?t.changedTouches[0]:t;return[i.clientX-e.left,i.clientY-e.top]},e.prototype.getTarget=function(){return this.get(eo)},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 ar(this.getCoordinateFromPixelInternal(t),this.getView().getProjection())},e.prototype.getCoordinateFromPixelInternal=function(t){var e=this.frameState_;return e?gr(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(Qr)},e.prototype.getLayers=function(){return this.getLayerGroup().getLayers()},e.prototype.getLoading=function(){for(var t=this.getLayerGroup().getLayerStatesArray(),e=0,i=t.length;e<i;++e){var n=t[e].layer.getSource();if(n&&n.loading)return!0}return!1},e.prototype.getPixelFromCoordinate=function(t){var e=lr(t,this.getView().getProjection());return this.getPixelFromCoordinateInternal(e)},e.prototype.getPixelFromCoordinateInternal=function(t){var e=this.frameState_;return e?gr(e.coordinateToPixelTransform,t.slice(0,2)):null},e.prototype.getRenderer=function(){return this.renderer_},e.prototype.getSize=function(){return this.get(to)},e.prototype.getView=function(){return this.get(io)},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,i,n){return function(t,e,i,n,r){if(!t||!(i in t.wantedTiles))return fo;if(!t.wantedTiles[i][e.getKey()])return fo;var o=t.viewState.center,s=n[0]-o[0],a=n[1]-o[1];return 65536*Math.log(r)+Math.sqrt(s*s+a*a)/r}(this.frameState_,t,e,i,n)},e.prototype.handleBrowserEvent=function(t,e){var i=e||t.type,n=new uo(i,this,t);this.handleMapBrowserEvent(n)},e.prototype.handleMapBrowserEvent=function(t){if(this.frameState_){var e=t.originalEvent,i=e.type;if(i===yi||i===Wt||i===zt){var n=this.getOwnerDocument(),r=this.viewport_.getRootNode?this.viewport_.getRootNode():n,o=e.target;if(this.overlayContainerStopEvent_.contains(o)||!(r===n?n.documentElement:r).contains(o))return}if(t.frameState=this.frameState_,!1!==this.dispatchEvent(t))for(var s=this.getInteractions().getArray().slice(),a=s.length-1;a>=0;a--){var l=s[a];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 i=this.maxTilesLoading_,n=i;if(t){var r=t.viewHints;if(r[So]||r[Co]){var o=Date.now()-t.time>8;i=o?0:8,n=o?0:2}}e.getTilesLoading()<i&&(e.reprioritize(),e.loadMoreTiles(i,n))}!t||!this.hasListener(Xe)||t.animate||this.tileQueue_.getTilesLoading()||this.getLoading()||this.renderer_.dispatchRenderEvent(Xe,t);for(var s=this.postRenderFunctions_,a=0,l=s.length;a<l;++a)s[a](this,t);s.length=0},e.prototype.handleSizeChanged_=function(){this.getView()&&!this.getView().getAnimating()&&this.getView().resolveConstraints(0),this.render()},e.prototype.handleTargetChanged_=function(){var t;if(this.getTarget()&&(t=this.getTargetElement()),this.mapBrowserEventHandler_){for(var e=0,i=this.keyHandlerKeys_.length;e<i;++e)Ut(this.keyHandlerKeys_[e]);this.keyHandlerKeys_=null,this.viewport_.removeEventListener(Mt,this.boundHandleBrowserEvent_),this.viewport_.removeEventListener(Wt,this.boundHandleBrowserEvent_),void 0!==this.handleResize_&&(removeEventListener(Nt,this.handleResize_,!1),this.handleResize_=void 0),this.mapBrowserEventHandler_.dispose(),this.mapBrowserEventHandler_=null,fe(this.viewport_)}if(t){for(var n in t.appendChild(this.viewport_),this.renderer_||(this.renderer_=this.createRenderer()),this.mapBrowserEventHandler_=new po(this,this.moveTolerance_),ho)this.mapBrowserEventHandler_.addEventListener(ho[n],this.handleMapBrowserEvent.bind(this));this.viewport_.addEventListener(Mt,this.boundHandleBrowserEvent_,!1),this.viewport_.addEventListener(Wt,this.boundHandleBrowserEvent_,!!ce&&{passive:!1});var r=this.keyboardEventTarget_?this.keyboardEventTarget_:t;this.keyHandlerKeys_=[qt(r,zt,this.handleBrowserEvent,this),qt(r,Dt,this.handleBrowserEvent,this)],this.handleResize_||(this.handleResize_=this.updateSize.bind(this),window.addEventListener(Nt,this.handleResize_,!1))}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_&&(Ut(this.viewPropertyListenerKey_),this.viewPropertyListenerKey_=null),this.viewChangeListenerKey_&&(Ut(this.viewChangeListenerKey_),this.viewChangeListenerKey_=null);var t=this.getView();t&&(this.updateViewportSize_(),this.viewPropertyListenerKey_=qt(t,ft,this.handleViewPropertyChanged_,this),this.viewChangeListenerKey_=qt(t,It,this.handleViewPropertyChanged_,this),t.resolveConstraints(0)),this.render()},e.prototype.handleLayerGroupChanged_=function(){this.layerGroupPropertyListenerKeys_&&(this.layerGroupPropertyListenerKeys_.forEach(Ut),this.layerGroupPropertyListenerKeys_=null);var t=this.getLayerGroup();t&&(this.layerGroupPropertyListenerKeys_=[qt(t,ft,this.render,this),qt(t,It,this.render,this)]),this.render()},e.prototype.isRendered=function(){return!!this.frameState_},e.prototype.renderSync=function(){this.animationDelayKey_&&cancelAnimationFrame(this.animationDelayKey_),this.animationDelay_()},e.prototype.redrawText=function(){for(var t=this.getLayerGroup().getLayerStatesArray(),e=0,i=t.length;e<i;++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.removeOverlay=function(t){return this.getOverlays().remove(t)},e.prototype.renderFrame_=function(t){var e=this,i=this.getSize(),n=this.getView(),r=this.frameState_,o=null;if(void 0!==i&&zs(i)&&n&&n.isDef()){var s=n.getHints(this.frameState_?this.frameState_.viewHints:void 0),a=n.getState();o={animate:!1,coordinateToPixelTransform:this.coordinateToPixelTransform_,declutterTree:null,extent:vn(a.center,a.resolution,a.rotation,i),index:this.frameIndex_++,layerIndex:0,layerStatesArray:this.getLayerGroup().getLayerStatesArray(),pixelRatio:this.pixelRatio_,pixelToCoordinateTransform:this.pixelToCoordinateTransform_,postRenderFunctions:[],size:i,tileQueue:this.tileQueue_,time:t,usedTiles:{},viewState:a,viewHints:s,wantedTiles:{}}}if(this.frameState_=o,this.renderer_.renderFrame(o),o){if(o.animate&&this.render(),Array.prototype.push.apply(this.postRenderFunctions_,o.postRenderFunctions),r)(!this.previousExtent_||!Tn(this.previousExtent_)&&!an(o.extent,this.previousExtent_))&&(this.dispatchEvent(new ao(ie,this,r)),this.previousExtent_=rn(this.previousExtent_));this.previousExtent_&&!o.viewHints[So]&&!o.viewHints[Co]&&!an(o.extent,this.previousExtent_)&&(this.dispatchEvent(new ao(ne,this,o)),Zi(o.extent,this.previousExtent_))}this.dispatchEvent(new ao(ee,this,o)),this.postRenderTimeoutHandle_||(this.postRenderTimeoutHandle_=setTimeout((function(){e.postRenderTimeoutHandle_=void 0,e.handlePostRender()}),0))},e.prototype.setLayerGroup=function(t){this.set(Qr,t)},e.prototype.setSize=function(t){this.set(to,t)},e.prototype.setTarget=function(t){this.set(eo,t)},e.prototype.setView=function(t){this.set(io,t)},e.prototype.updateSize=function(){var t=this.getTargetElement(),e=void 0;if(t){var i=getComputedStyle(t),n=t.offsetWidth-parseFloat(i.borderLeftWidth)-parseFloat(i.paddingLeft)-parseFloat(i.paddingRight)-parseFloat(i.borderRightWidth),r=t.offsetHeight-parseFloat(i.borderTopWidth)-parseFloat(i.paddingTop)-parseFloat(i.paddingBottom)-parseFloat(i.borderBottomWidth);isNaN(n)||isNaN(r)||zs(e=[n,r])||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,i=getComputedStyle(this.viewport_);i.width&&i.height&&(e=[parseInt(i.width,10),parseInt(i.height,10)]),t.setViewportSize(e)}},e}(te),Bs=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}(),Ws="degrees",qs="imperial",Vs="nautical",Us="metric",Xs="us",Ks=[1,2,5],Ys=function(t){function e(e){var i=this,n=e||{},r=void 0!==n.className?n.className:n.bar?"ol-scale-bar":"ol-scale-line";return(i=t.call(this,{element:document.createElement("div"),render:n.render,target:n.target})||this).on,i.once,i.un,i.innerElement_=document.createElement("div"),i.innerElement_.className=r+"-inner",i.element.className=r+" ol-unselectable",i.element.appendChild(i.innerElement_),i.viewState_=null,i.minWidth_=void 0!==n.minWidth?n.minWidth:64,i.renderedVisible_=!1,i.renderedWidth_=void 0,i.renderedHTML_="",i.addChangeListener("units",i.handleUnitsChanged_),i.setUnits(n.units||Us),i.scaleBar_=n.bar||!1,i.scaleBarSteps_=n.steps||4,i.scaleBarText_=n.text||!1,i.dpi_=n.dpi||void 0,i}return Bs(e,t),e.prototype.getUnits=function(){return this.get("units")},e.prototype.handleUnitsChanged_=function(){this.updateElement_()},e.prototype.setUnits=function(t){this.set("units",t)},e.prototype.setDpi=function(t){this.dpi_=t},e.prototype.updateElement_=function(){var t=this.viewState_;if(t){var e=t.center,i=t.projection,n=this.getUnits(),r=n==Ws?vi.DEGREES:vi.METERS,o=Hn(i,t.resolution,e,r),s=this.minWidth_*(this.dpi_||90.7142857142857)/90.7142857142857,a=s*o,l="";if(n==Ws){var u=mi[vi.DEGREES];(a*=u)<u/60?(l="″",o*=3600):a<u?(l="′",o*=60):l="°"}else n==qs?a<.9144?(l="in",o/=.0254):a<1609.344?(l="ft",o/=.3048):(l="mi",o/=1609.344):n==Vs?(o/=1852,l="nm"):n==Us?a<.001?(l="μm",o*=1e6):a<1?(l="mm",o*=1e3):a<1e3?l="m":(l="km",o/=1e3):n==Xs?a<.9144?(l="in",o*=39.37):a<1609.344?(l="ft",o/=.30480061):(l="mi",o/=1609.3472):Ie(!1,33);for(var h,c,p,d,f=3*Math.floor(Math.log(s*o)/Math.log(10));;){p=Math.floor(f/3);var y=Math.pow(10,p);if(h=Ks[(f%3+3)%3]*y,c=Math.round(h/o),isNaN(c))return this.element.style.display="none",void(this.renderedVisible_=!1);if(c>=s)break;++f}d=this.scaleBar_?this.createScaleBar(c,h,l):h.toFixed(p<0?-p:0)+" "+l,this.renderedHTML_!=d&&(this.innerElement_.innerHTML=d,this.renderedHTML_=d),this.renderedWidth_!=c&&(this.innerElement_.style.width=c+"px",this.renderedWidth_=c),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,i){for(var n="1 : "+Math.round(this.getScaleForResolution()).toLocaleString(),r=[],o=t/this.scaleBarSteps_,s="#ffffff",a=0;a<this.scaleBarSteps_;a++)0===a&&r.push(this.createMarker("absolute",a)),r.push('<div><div class="ol-scale-singlebar" style="width: '+o+"px;background-color: "+s+';"></div>'+this.createMarker("relative",a)+(a%2==0||2===this.scaleBarSteps_?this.createStepText(a,t,!1,e,i):"")+"</div>"),a===this.scaleBarSteps_-1&&r.push(this.createStepText(a+1,t,!0,e,i)),s="#ffffff"===s?"#000000":"#ffffff";return'<div style="display: flex;">'+(this.scaleBarText_?'<div class="ol-scale-text" style="width: '+t+'px;">'+n+"</div>":"")+r.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,i,n,r){var o=(0===t?0:Math.round(n/this.scaleBarSteps_*t*100)/100)+(0===t?"":" "+r);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: "+(i?e+"px":"unset")+';">'+o+"</div>"},e.prototype.getScaleForResolution=function(){var t=Hn(this.viewState_.projection,this.viewState_.resolution,this.viewState_.center),e=this.dpi_||90.7142857142857,i=this.viewState_.projection.getMetersPerUnit();return parseFloat(t.toString())*i*(1e3/25.4)*e},e.prototype.render=function(t){var e=t.frameState;this.viewState_=e?e.viewState:null,this.updateElement_()},e}(ge);function Zs(t){var e=t||{},i=new oi;return(void 0===e.zoom||e.zoom)&&i.push(new di(e.zoomOptions)),(void 0===e.rotate||e.rotate)&&i.push(new ci(e.rotateOptions)),(void 0===e.attribution||e.attribution)&&i.push(new Qe(e.attributionOptions)),i}var Hs=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}();var $s=function(t){function e(e){var i=t.call(this)||this;if(i.on,i.once,i.un,i.id_=void 0,i.geometryName_="geometry",i.style_=null,i.styleFunction_=void 0,i.geometryChangeKey_=null,i.addChangeListener(i.geometryName_,i.handleGeometryChanged_),e)if("function"==typeof e.getSimplifiedGeometry){var n=e;i.setGeometry(n)}else{var r=e;i.setProperties(r)}return i}return Hs(e,t),e.prototype.clone=function(){var t=new e(this.hasProperties()?this.getProperties():null);t.setGeometryName(this.getGeometryName());var i=this.getGeometry();i&&t.setGeometry(i.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_&&(Ut(this.geometryChangeKey_),this.geometryChangeKey_=null);var t=this.getGeometry();t&&(this.geometryChangeKey_=qt(t,It,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:(Ie("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}(te),Js=function(){function t(){this.dataProjection=void 0,this.defaultFeatureProjection=void 0}return t.prototype.getReadOptions=function(t,e){var i;if(e){var n=e.dataProjection?Zn(e.dataProjection):this.readProjection(t);e.extent&&n&&n.getUnits()===vi.TILE_PIXELS&&(n=Zn(n)).setWorldExtent(e.extent),i={dataProjection:n,featureProjection:e.featureProjection}}return this.adaptOptions(i)},t.prototype.adaptOptions=function(t){return Ct({dataProjection:this.dataProjection,featureProjection:this.defaultFeatureProjection},t)},t.prototype.getType=function(){return Zt()},t.prototype.readFeature=function(t,e){return Zt()},t.prototype.readFeatures=function(t,e){return Zt()},t.prototype.readGeometry=function(t,e){return Zt()},t.prototype.readProjection=function(t){return Zt()},t.prototype.writeFeature=function(t,e){return Zt()},t.prototype.writeFeatures=function(t,e){return Zt()},t.prototype.writeGeometry=function(t,e){return Zt()},t}();function Qs(t,e,i){var n,r=i?Zn(i.featureProjection):null,o=i?Zn(i.dataProjection):null;if(n=r&&o&&!tr(r,o)?(e?t.clone():t).transform(e?r:o,e?o:r):t,e&&i&&void 0!==i.decimals){var s=Math.pow(10,i.decimals);n===t&&(n=t.clone()),n.applyTransform((function(t){for(var e=0,i=t.length;e<i;++e)t[e]=Math.round(t[e]*s)/s;return t}))}return n}var ta="arraybuffer",ea="json",ia="text",na="xml",ra=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}();function oa(t){if("string"==typeof t){var e=JSON.parse(t);return e||null}return null!==t?t:null}var sa=function(t){function e(){return t.call(this)||this}return ra(e,t),e.prototype.getType=function(){return ea},e.prototype.readFeature=function(t,e){return this.readFeatureFromObject(oa(t),this.getReadOptions(t,e))},e.prototype.readFeatures=function(t,e){return this.readFeaturesFromObject(oa(t),this.getReadOptions(t,e))},e.prototype.readFeatureFromObject=function(t,e){return Zt()},e.prototype.readFeaturesFromObject=function(t,e){return Zt()},e.prototype.readGeometry=function(t,e){return this.readGeometryFromObject(oa(t),this.getReadOptions(t,e))},e.prototype.readGeometryFromObject=function(t,e){return Zt()},e.prototype.readProjection=function(t){return this.readProjectionFromObject(oa(t))},e.prototype.readProjectionFromObject=function(t){return Zt()},e.prototype.writeFeature=function(t,e){return JSON.stringify(this.writeFeatureObject(t,e))},e.prototype.writeFeatureObject=function(t,e){return Zt()},e.prototype.writeFeatures=function(t,e){return JSON.stringify(this.writeFeaturesObject(t,e))},e.prototype.writeFeaturesObject=function(t,e){return Zt()},e.prototype.writeGeometry=function(t,e){return JSON.stringify(this.writeGeometryObject(t,e))},e.prototype.writeGeometryObject=function(t,e){return Zt()},e}(Js);function aa(t,e,i,n,r,o,s){var a,l,u=(i-e)/n;if(1===u)a=e;else if(2===u)a=e,l=r;else if(0!==u){for(var h=t[e],c=t[e+1],p=0,d=[0],f=e+n;f<i;f+=n){var y=t[f],g=t[f+1];p+=Math.sqrt((y-h)*(y-h)+(g-c)*(g-c)),d.push(p),h=y,c=g}var m=r*p,v=function(t,e,i){for(var n,r,o=i||gt,s=0,a=t.length,l=!1;s<a;)(r=+o(t[n=s+(a-s>>1)],e))<0?s=n+1:(a=n,l=!r);return l?s:~s}(d,m);v<0?(l=(m-d[-v-2])/(d[-v-1]-d[-v-2]),a=e+(-v-2)*n):a=e+v*n}var _=s>1?s:2,x=o||new Array(_);for(f=0;f<_;++f)x[f]=void 0===a?NaN:void 0===l?t[a+f]:Ge(t[a+f],t[a+n+f],l);return x}function la(t,e,i,n,r,o){if(i==e)return null;var s;if(r<t[e+n-1])return o?((s=t.slice(e,e+n))[n-1]=r,s):null;if(t[i-1]<r)return o?((s=t.slice(i-n,i))[n-1]=r,s):null;if(r==t[e+n-1])return t.slice(e,e+n);for(var a=e/n,l=i/n;a<l;){var u=a+l>>1;r<t[(u+1)*n-1]?l=u:a=u+1}var h=t[a*n-1];if(r==h)return t.slice((a-1)*n,(a-1)*n+n);var c=(r-h)/(t[(a+1)*n-1]-h);s=[];for(var p=0;p<n-1;++p)s.push(Ge(t[(a-1)*n+p],t[a*n+p],c));return s.push(r),s}function ua(t,e,i,n){for(var r=t[e],o=t[e+1],s=0,a=e+n;a<i;a+=n){var l=t[a],u=t[a+1];s+=Math.sqrt((l-r)*(l-r)+(u-o)*(u-o)),r=l,o=u}return s}var ha=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}(),ca=function(t){function e(e,i){var n=t.call(this)||this;return n.flatMidpoint_=null,n.flatMidpointRevision_=-1,n.maxDelta_=-1,n.maxDeltaRevision_=-1,void 0===i||Array.isArray(e[0])?n.setCoordinates(e,i):n.setFlatCoordinates(i,e),n}return ha(e,t),e.prototype.appendCoordinate=function(t){this.flatCoordinates?_t(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,i,n){return n<Hi(this.getExtent(),t,e)?n:(this.maxDeltaRevision_!=this.getRevision()&&(this.maxDelta_=Math.sqrt(Zo(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,0)),this.maxDeltaRevision_=this.getRevision()),$o(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,this.maxDelta_,!1,t,e,i,n))},e.prototype.forEachSegment=function(t){return xs(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,t)},e.prototype.getCoordinateAtM=function(t,e){if(this.layout!=zo&&this.layout!=Do)return null;var i=void 0!==e&&e;return la(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,t,i)},e.prototype.getCoordinates=function(){return ss(this.flatCoordinates,0,this.flatCoordinates.length,this.stride)},e.prototype.getCoordinateAt=function(t,e){return aa(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,t,e,this.stride)},e.prototype.getLength=function(){return ua(this.flatCoordinates,0,this.flatCoordinates.length,this.stride)},e.prototype.getFlatMidpoint=function(){return this.flatMidpointRevision_!=this.getRevision()&&(this.flatMidpoint_=this.getCoordinateAt(.5,this.flatMidpoint_),this.flatMidpointRevision_=this.getRevision()),this.flatMidpoint_},e.prototype.getSimplifiedGeometryInternal=function(t){var i=[];return i.length=is(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,t,i,0),new e(i,Ao)},e.prototype.getType=function(){return Pn},e.prototype.intersectsExtent=function(t){return bs(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=ts(this.flatCoordinates,0,t,this.stride),this.changed()},e}(Ko),pa=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}(),da=function(t){function e(e,i,n){var r=t.call(this)||this;if(r.ends_=[],r.maxDelta_=-1,r.maxDeltaRevision_=-1,Array.isArray(e[0]))r.setCoordinates(e,i);else if(void 0!==i&&n)r.setFlatCoordinates(i,e),r.ends_=n;else{for(var o=r.getLayout(),s=e,a=[],l=[],u=0,h=s.length;u<h;++u){var c=s[u];0===u&&(o=c.getLayout()),_t(a,c.getFlatCoordinates()),l.push(a.length)}r.setFlatCoordinates(o,a),r.ends_=l}return r}return pa(e,t),e.prototype.appendLineString=function(t){this.flatCoordinates?_t(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,i,n){return n<Hi(this.getExtent(),t,e)?n:(this.maxDeltaRevision_!=this.getRevision()&&(this.maxDelta_=Math.sqrt(Ho(this.flatCoordinates,0,this.ends_,this.stride,0)),this.maxDeltaRevision_=this.getRevision()),Jo(this.flatCoordinates,0,this.ends_,this.stride,this.maxDelta_,!1,t,e,i,n))},e.prototype.getCoordinateAtM=function(t,e,i){if(this.layout!=zo&&this.layout!=Do||0===this.flatCoordinates.length)return null;var n=void 0!==e&&e,r=void 0!==i&&i;return function(t,e,i,n,r,o,s){if(s)return la(t,e,i[i.length-1],n,r,o);var a;if(r<t[n-1])return o?((a=t.slice(0,n))[n-1]=r,a):null;if(t[t.length-1]<r)return o?((a=t.slice(t.length-n))[n-1]=r,a):null;for(var l=0,u=i.length;l<u;++l){var h=i[l];if(e!=h){if(r<t[e+n-1])return null;if(r<=t[h-1])return la(t,e,h,n,r,!1);e=h}}return null}(this.flatCoordinates,0,this.ends_,this.stride,t,n,r)},e.prototype.getCoordinates=function(){return as(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 ca(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_,i=this.layout,n=[],r=0,o=0,s=e.length;o<s;++o){var a=e[o],l=new ca(t.slice(r,a),i);n.push(l),r=a}return n},e.prototype.getFlatMidpoints=function(){for(var t=[],e=this.flatCoordinates,i=0,n=this.ends_,r=this.stride,o=0,s=n.length;o<s;++o){var a=n[o];_t(t,aa(e,i,a,r,.5)),i=a}return t},e.prototype.getSimplifiedGeometryInternal=function(t){var i=[],n=[];return i.length=function(t,e,i,n,r,o,s,a){for(var l=0,u=i.length;l<u;++l){var h=i[l];s=is(t,e,h,n,r,o,s),a.push(s),e=h}return s}(this.flatCoordinates,0,this.ends_,this.stride,t,i,0,n),new e(i,Ao,n)},e.prototype.getType=function(){return Fn},e.prototype.intersectsExtent=function(t){return function(t,e,i,n,r){for(var o=0,s=i.length;o<s;++o){if(bs(t,e,i[o],n,r))return!0;e=i[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 i=es(this.flatCoordinates,0,t,this.stride,this.ends_);this.flatCoordinates.length=0===i.length?0:i[i.length-1],this.changed()},e}(Ko),fa=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}(),ya=function(t){function e(e,i){var n=t.call(this)||this;return i&&!Array.isArray(e[0])?n.setFlatCoordinates(i,e):n.setCoordinates(e,i),n}return fa(e,t),e.prototype.appendPoint=function(t){this.flatCoordinates?_t(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,i,n){if(n<Hi(this.getExtent(),t,e))return n;for(var r=this.flatCoordinates,o=this.stride,s=0,a=r.length;s<a;s+=o){var l=Le(t,e,r[s],r[s+1]);if(l<n){n=l;for(var u=0;u<o;++u)i[u]=r[s+u];i.length=o}}return n},e.prototype.getCoordinates=function(){return ss(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 fs(this.flatCoordinates.slice(t*this.stride,(t+1)*this.stride),this.layout)},e.prototype.getPoints=function(){for(var t=this.flatCoordinates,e=this.layout,i=this.stride,n=[],r=0,o=t.length;r<o;r+=i){var s=new fs(t.slice(r,r+i),e);n.push(s)}return n},e.prototype.getType=function(){return In},e.prototype.intersectsExtent=function(t){for(var e=this.flatCoordinates,i=this.stride,n=0,r=e.length;n<r;n+=i){if(Qi(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=ts(this.flatCoordinates,0,t,this.stride),this.changed()},e}(Ko);function ga(t,e,i,n){for(var r=[],o=[1/0,1/0,-1/0,-1/0],s=0,a=i.length;s<a;++s){var l=i[s];o=sn(t,e,l[0],n),r.push((o[0]+o[2])/2,(o[1]+o[3])/2),e=l[l.length-1]}return r}var ma=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}(),va=function(t){function e(e,i,n){var r=t.call(this)||this;if(r.endss_=[],r.flatInteriorPointsRevision_=-1,r.flatInteriorPoints_=null,r.maxDelta_=-1,r.maxDeltaRevision_=-1,r.orientedRevision_=-1,r.orientedFlatCoordinates_=null,!n&&!Array.isArray(e[0])){for(var o=r.getLayout(),s=e,a=[],l=[],u=0,h=s.length;u<h;++u){var c=s[u];0===u&&(o=c.getLayout());for(var p=a.length,d=c.getEnds(),f=0,y=d.length;f<y;++f)d[f]+=p;_t(a,c.getFlatCoordinates()),l.push(d)}i=o,e=a,n=l}return void 0!==i&&n?(r.setFlatCoordinates(i,e),r.endss_=n):r.setCoordinates(e,i),r}return ma(e,t),e.prototype.appendPolygon=function(t){var e;if(this.flatCoordinates){var i=this.flatCoordinates.length;_t(this.flatCoordinates,t.getFlatCoordinates());for(var n=0,r=(e=t.getEnds().slice()).length;n<r;++n)e[n]+=i}else this.flatCoordinates=t.getFlatCoordinates().slice(),e=t.getEnds().slice(),this.endss_.push();this.endss_.push(e),this.changed()},e.prototype.clone=function(){for(var t=this.endss_.length,i=new Array(t),n=0;n<t;++n)i[n]=this.endss_[n].slice();var r=new e(this.flatCoordinates.slice(),this.layout,i);return r.applyProperties(this),r},e.prototype.closestPointXY=function(t,e,i,n){return n<Hi(this.getExtent(),t,e)?n:(this.maxDeltaRevision_!=this.getRevision()&&(this.maxDelta_=Math.sqrt(function(t,e,i,n,r){for(var o=0,s=i.length;o<s;++o){var a=i[o];r=Ho(t,e,a,n,r),e=a[a.length-1]}return r}(this.flatCoordinates,0,this.endss_,this.stride,0)),this.maxDeltaRevision_=this.getRevision()),function(t,e,i,n,r,o,s,a,l,u,h){for(var c=h||[NaN,NaN],p=0,d=i.length;p<d;++p){var f=i[p];u=Jo(t,e,f,n,r,o,s,a,l,u,c),e=f[f.length-1]}return u}(this.getOrientedFlatCoordinates(),0,this.endss_,this.stride,this.maxDelta_,!0,t,e,i,n))},e.prototype.containsXY=function(t,e){return function(t,e,i,n,r,o){if(0===i.length)return!1;for(var s=0,a=i.length;s<a;++s){var l=i[s];if(ms(t,e,l,n,r,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,i,n){for(var r=0,o=0,s=i.length;o<s;++o){var a=i[o];r+=hs(t,e,a,n),e=a[a.length-1]}return r}(this.getOrientedFlatCoordinates(),0,this.endss_,this.stride)},e.prototype.getCoordinates=function(t){var e;return void 0!==t?ks(e=this.getOrientedFlatCoordinates().slice(),0,this.endss_,this.stride,t):e=this.flatCoordinates,ls(e,0,this.endss_,this.stride)},e.prototype.getEndss=function(){return this.endss_},e.prototype.getFlatInteriorPoints=function(){if(this.flatInteriorPointsRevision_!=this.getRevision()){var t=ga(this.flatCoordinates,0,this.endss_,this.stride);this.flatInteriorPoints_=_s(this.getOrientedFlatCoordinates(),0,this.endss_,this.stride,t),this.flatInteriorPointsRevision_=this.getRevision()}return this.flatInteriorPoints_},e.prototype.getInteriorPoints=function(){return new ya(this.getFlatInteriorPoints().slice(),zo)},e.prototype.getOrientedFlatCoordinates=function(){if(this.orientedRevision_!=this.getRevision()){var t=this.flatCoordinates;!function(t,e,i,n,r){for(var o=0,s=i.length;o<s;++o){var a=i[o];if(!Ts(t,e,a,n,r))return!1;a.length&&(e=a[a.length-1])}return!0}(t,0,this.endss_,this.stride)?(this.orientedFlatCoordinates_=t.slice(),this.orientedFlatCoordinates_.length=ks(this.orientedFlatCoordinates_,0,this.endss_,this.stride)):this.orientedFlatCoordinates_=t,this.orientedRevision_=this.getRevision()}return this.orientedFlatCoordinates_},e.prototype.getSimplifiedGeometryInternal=function(t){var i=[],n=[];return i.length=function(t,e,i,n,r,o,s,a){for(var l=0,u=i.length;l<u;++l){var h=i[l],c=[];s=os(t,e,h,n,r,o,s,c),a.push(c),e=h[h.length-1]}return s}(this.flatCoordinates,0,this.endss_,this.stride,Math.sqrt(t),i,0,n),new e(i,Ao,n)},e.prototype.getPolygon=function(t){if(t<0||this.endss_.length<=t)return null;var e;if(0===t)e=0;else{var i=this.endss_[t-1];e=i[i.length-1]}var n=this.endss_[t].slice(),r=n[n.length-1];if(0!==e)for(var o=0,s=n.length;o<s;++o)n[o]-=e;return new Os(this.flatCoordinates.slice(e,r),this.layout,n)},e.prototype.getPolygons=function(){for(var t=this.layout,e=this.flatCoordinates,i=this.endss_,n=[],r=0,o=0,s=i.length;o<s;++o){var a=i[o].slice(),l=a[a.length-1];if(0!==r)for(var u=0,h=a.length;u<h;++u)a[u]-=r;var c=new Os(e.slice(r,l),t,a);n.push(c),r=l}return n},e.prototype.getType=function(){return jn},e.prototype.intersectsExtent=function(t){return function(t,e,i,n,r){for(var o=0,s=i.length;o<s;++o){var a=i[o];if(ws(t,e,a,n,r))return!0;e=a[a.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 i=function(t,e,i,n,r){for(var o=r||[],s=0,a=0,l=i.length;a<l;++a){var u=es(t,e,i[a],n,o[s]);o[s++]=u,e=u[u.length-1]}return o.length=s,o}(this.flatCoordinates,0,t,this.stride,this.endss_);if(0===i.length)this.flatCoordinates.length=0;else{var n=i[i.length-1];this.flatCoordinates.length=0===n.length?0:n[n.length-1]}this.changed()},e}(Ko),_a=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}();function xa(t){for(var e=[],i=0,n=t.length;i<n;++i)e.push(t[i].clone());return e}var ba=function(t){function e(e){var i=t.call(this)||this;return i.geometries_=e||null,i.changeEventsKeys_=[],i.listenGeometriesChange_(),i}return _a(e,t),e.prototype.unlistenGeometriesChange_=function(){this.changeEventsKeys_.forEach(Ut),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(qt(this.geometries_[t],It,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,i,n){if(n<Hi(this.getExtent(),t,e))return n;for(var r=this.geometries_,o=0,s=r.length;o<s;++o)n=r[o].closestPointXY(t,e,i,n);return n},e.prototype.containsXY=function(t,e){for(var i=this.geometries_,n=0,r=i.length;n<r;++n)if(i[n].containsXY(t,e))return!0;return!1},e.prototype.computeExtent=function(t){rn(t);for(var e=this.geometries_,i=0,n=e.length;i<n;++i)ln(t,e[i].getExtent());return t},e.prototype.getGeometries=function(){return xa(this.geometries_)},e.prototype.getGeometriesArray=function(){return this.geometries_},e.prototype.getGeometriesArrayRecursive=function(){for(var t=[],e=this.geometries_,i=0,n=e.length;i<n;++i)e[i].getType()===this.getType()?t=t.concat(e[i].getGeometriesArrayRecursive()):t.push(e[i]);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 i=[],n=this.geometries_,r=!1,o=0,s=n.length;o<s;++o){var a=n[o],l=a.getSimplifiedGeometry(t);i.push(l),l!==a&&(r=!0)}if(r){var u=new e(null);return u.setGeometriesArray(i),u}return this.simplifiedGeometryMaxMinSquaredTolerance=t,this},e.prototype.getType=function(){return Mn},e.prototype.intersectsExtent=function(t){for(var e=this.geometries_,i=0,n=e.length;i<n;++i)if(e[i].intersectsExtent(t))return!0;return!1},e.prototype.isEmpty=function(){return 0===this.geometries_.length},e.prototype.rotate=function(t,e){for(var i=this.geometries_,n=0,r=i.length;n<r;++n)i[n].rotate(t,e);this.changed()},e.prototype.scale=function(t,e,i){var n=i;n||(n=gn(this.getExtent()));for(var r=this.geometries_,o=0,s=r.length;o<s;++o)r[o].scale(t,e,n);this.changed()},e.prototype.setGeometries=function(t){this.setGeometriesArray(xa(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_,i=0,n=e.length;i<n;++i)e[i].applyTransform(t);this.changed()},e.prototype.translate=function(t,e){for(var i=this.geometries_,n=0,r=i.length;n<r;++n)i[n].translate(t,e);this.changed()},e.prototype.disposeInternal=function(){this.unlistenGeometriesChange_(),t.prototype.disposeInternal.call(this)},e}(Vo),wa=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}();function Sa(t,e){if(!t)return null;var i;switch(t.type){case kn:i=function(t){return new fs(t.coordinates)}(t);break;case Pn:i=function(t){return new ca(t.coordinates)}(t);break;case Rn:i=function(t){return new Os(t.coordinates)}(t);break;case In:i=function(t){return new ya(t.coordinates)}(t);break;case Fn:i=function(t){return new da(t.coordinates)}(t);break;case jn:i=function(t){return new va(t.coordinates)}(t);break;case Mn:i=function(t,e){var i=t.geometries.map((function(t){return Sa(t,e)}));return new ba(i)}(t);break;default:throw new Error("Unsupported GeoJSON type: "+t.type)}return Qs(i,!1,e)}function Ca(t,e){var i,n=(t=Qs(t,!0,e)).getType();switch(n){case kn:i=function(t,e){return{type:"Point",coordinates:t.getCoordinates()}}(t);break;case Pn:i=function(t,e){return{type:"LineString",coordinates:t.getCoordinates()}}(t);break;case Rn:i=function(t,e){var i;e&&(i=e.rightHanded);return{type:"Polygon",coordinates:t.getCoordinates(i)}}(t,e);break;case In:i=function(t,e){return{type:"MultiPoint",coordinates:t.getCoordinates()}}(t);break;case Fn:i=function(t,e){return{type:"MultiLineString",coordinates:t.getCoordinates()}}(t);break;case jn:i=function(t,e){var i;e&&(i=e.rightHanded);return{type:"MultiPolygon",coordinates:t.getCoordinates(i)}}(t,e);break;case Mn:i=function(t,e){return{type:"GeometryCollection",geometries:t.getGeometriesArray().map((function(t){var i=Ct({},e);return delete i.featureProjection,Ca(t,i)}))}}(t,e);break;case An:i={type:"GeometryCollection",geometries:[]};break;default:throw new Error("Unsupported geometry type: "+n)}return i}var Ta=function(t){function e(e){var i=this,n=e||{};return(i=t.call(this)||this).dataProjection=Zn(n.dataProjection?n.dataProjection:"EPSG:4326"),n.featureProjection&&(i.defaultFeatureProjection=Zn(n.featureProjection)),i.geometryName_=n.geometryName,i.extractGeometryName_=n.extractGeometryName,i}return wa(e,t),e.prototype.readFeatureFromObject=function(t,e){var i=null,n=Sa((i="Feature"===t.type?t:{type:"Feature",geometry:t,properties:null}).geometry,e),r=new $s;return this.geometryName_?r.setGeometryName(this.geometryName_):this.extractGeometryName_&&"geometry_name"in i!==void 0&&r.setGeometryName(i.geometry_name),r.setGeometry(n),"id"in i&&r.setId(i.id),i.properties&&r.setProperties(i.properties,!0),r},e.prototype.readFeaturesFromObject=function(t,e){var i=null;if("FeatureCollection"===t.type){i=[];for(var n=t.features,r=0,o=n.length;r<o;++r)i.push(this.readFeatureFromObject(n[r],e))}else i=[this.readFeatureFromObject(t,e)];return i},e.prototype.readGeometryFromObject=function(t,e){return Sa(t,e)},e.prototype.readProjectionFromObject=function(t){var e,i=t.crs;return i?"name"==i.type?e=Zn(i.properties.name):"EPSG"===i.type?e=Zn("EPSG:"+i.properties.code):Ie(!1,36):e=this.dataProjection,e},e.prototype.writeFeatureObject=function(t,e){e=this.adaptOptions(e);var i={type:"Feature",geometry:null,properties:null},n=t.getId();if(void 0!==n&&(i.id=n),!t.hasProperties())return i;var r=t.getProperties(),o=t.getGeometry();return o&&(i.geometry=Ca(o,e),delete r[t.getGeometryName()]),kt(r)||(i.properties=r),i},e.prototype.writeFeaturesObject=function(t,e){e=this.adaptOptions(e);for(var i=[],n=0,r=t.length;n<r;++n)i.push(this.writeFeatureObject(t[n],e));return{type:"FeatureCollection",features:i}},e.prototype.writeGeometryObject=function(t,e){return Ca(t,this.adaptOptions(e))},e}(sa),Ea=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}(),ka="fraction",Pa="pixels",Oa="bottom-left",Ra="bottom-right",Ia="top-left",Fa="top-right",ja=0,Ma=1,Aa=2,La=3,za=function(){function t(t){this.opacity_=t.opacity,this.rotateWithView_=t.rotateWithView,this.rotation_=t.rotation,this.scale_=t.scale,this.scaleArray_=Ds(t.scale),this.displacement_=t.displacement}return t.prototype.clone=function(){var e=this.getScale();return new t({opacity:this.getOpacity(),scale:Array.isArray(e)?e.slice():e,rotation:this.getRotation(),rotateWithView:this.getRotateWithView(),displacement:this.getDisplacement().slice()})},t.prototype.getOpacity=function(){return this.opacity_},t.prototype.getRotateWithView=function(){return this.rotateWithView_},t.prototype.getRotation=function(){return this.rotation_},t.prototype.getScale=function(){return this.scale_},t.prototype.getScaleArray=function(){return this.scaleArray_},t.prototype.getDisplacement=function(){return this.displacement_},t.prototype.getAnchor=function(){return Zt()},t.prototype.getImage=function(t){return Zt()},t.prototype.getHitDetectionImage=function(){return Zt()},t.prototype.getPixelRatio=function(t){return 1},t.prototype.getImageState=function(){return Zt()},t.prototype.getImageSize=function(){return Zt()},t.prototype.getOrigin=function(){return Zt()},t.prototype.getSize=function(){return Zt()},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_=Ds(t)},t.prototype.listenImageChange=function(t){Zt()},t.prototype.load=function(){Zt()},t.prototype.unlistenImageChange=function(t){Zt()},t}(),Da=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}(),Ga=function(t){function e(e,i,n,r){var o=t.call(this)||this;return o.extent=e,o.pixelRatio_=n,o.resolution=i,o.state=r,o}return Da(e,t),e.prototype.changed=function(){this.dispatchEvent(It)},e.prototype.getExtent=function(){return this.extent},e.prototype.getImage=function(){return Zt()},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(){Zt()},e}(Rt),Na=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}();function Ba(t,e,i){var n=t;if(n.src&&he){var r=n.decode(),o=!0;return r.then((function(){o&&e()})).catch((function(t){o&&("EncodingError"===t.name&&"Invalid image type."===t.message?e():i())})),function(){o=!1}}var s=[Vt(n,Gt,e),Vt(n,Ft,i)];return function(){s.forEach(Ut)}}!function(t){function e(e,i,n,r,o,s){var a=t.call(this,e,i,n,ja)||this;return a.src_=r,a.image_=new Image,null!==o&&(a.image_.crossOrigin=o),a.unlisten_=null,a.state=ja,a.imageLoadFunction_=s,a}Na(e,t),e.prototype.getImage=function(){return this.image_},e.prototype.handleImageError_=function(){this.state=La,this.unlistenImage_(),this.changed()},e.prototype.handleImageLoad_=function(){void 0===this.resolution&&(this.resolution=_n(this.extent)/this.image_.height),this.state=Aa,this.unlistenImage_(),this.changed()},e.prototype.load=function(){this.state!=ja&&this.state!=La||(this.state=Ma,this.changed(),this.imageLoadFunction_(this,this.src_),this.unlisten_=Ba(this.image_,this.handleImageLoad_.bind(this),this.handleImageError_.bind(this)))},e.prototype.setImage=function(t){this.image_=t,this.resolution=_n(this.extent)/this.image_.height},e.prototype.unlistenImage_=function(){this.unlisten_&&(this.unlisten_(),this.unlisten_=null)}}(Ga);var Wa=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}(),qa=null,Va=function(t){function e(e,i,n,r,o,s){var a=t.call(this)||this;return a.hitDetectionImage_=null,a.image_=e||new Image,null!==r&&(a.image_.crossOrigin=r),a.canvas_={},a.color_=s,a.unlisten_=null,a.imageState_=o,a.size_=n,a.src_=i,a.tainted_,a}return Wa(e,t),e.prototype.isTainted_=function(){if(void 0===this.tainted_&&this.imageState_===Aa){qa||(qa=pe(1,1)),qa.drawImage(this.image_,0,0);try{qa.getImageData(0,0,1,1),this.tainted_=!1}catch(t){qa=null,this.tainted_=!0}}return!0===this.tainted_},e.prototype.dispatchChangeEvent_=function(){this.dispatchEvent(It)},e.prototype.handleImageError_=function(){this.imageState_=La,this.unlistenImage_(),this.dispatchChangeEvent_()},e.prototype.handleImageLoad_=function(){this.imageState_=Aa,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_()},e.prototype.getImage=function(t){return this.replaceColor_(t),this.canvas_[t]?this.canvas_[t]:this.image_},e.prototype.getPixelRatio=function(t){return this.replaceColor_(t),this.canvas_[t]?t:1},e.prototype.getImageState=function(){return this.imageState_},e.prototype.getHitDetectionImage=function(){if(!this.hitDetectionImage_)if(this.isTainted_()){var t=this.size_[0],e=this.size_[1],i=pe(t,e);i.fillRect(0,0,t,e),this.hitDetectionImage_=i.canvas}else this.hitDetectionImage_=this.image_;return this.hitDetectionImage_},e.prototype.getSize=function(){return this.size_},e.prototype.getSrc=function(){return this.src_},e.prototype.load=function(){if(this.imageState_==ja){this.imageState_=Ma;try{this.image_.src=this.src_}catch(t){this.handleImageError_()}this.unlisten_=Ba(this.image_,this.handleImageLoad_.bind(this),this.handleImageError_.bind(this))}},e.prototype.replaceColor_=function(t){if(this.color_&&!this.canvas_[t]){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 i=e.getContext("2d");if(i.scale(t,t),i.drawImage(this.image_,0,0),i.globalCompositeOperation="multiply","multiply"===i.globalCompositeOperation||this.isTainted_())i.fillStyle=Sr(this.color_),i.fillRect(0,0,e.width/t,e.height/t),i.globalCompositeOperation="destination-in",i.drawImage(this.image_,0,0);else{for(var n=i.getImageData(0,0,e.width,e.height),r=n.data,o=this.color_[0]/255,s=this.color_[1]/255,a=this.color_[2]/255,l=this.color_[3],u=0,h=r.length;u<h;u+=4)r[u]*=o,r[u+1]*=s,r[u+2]*=a,r[u+3]*=l;i.putImageData(n,0,0)}}},e.prototype.unlistenImage_=function(){this.unlisten_&&(this.unlisten_(),this.unlisten_=null)},e}(Rt);var Ua=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}(),Xa=function(t){function e(e){var i=this,n=e||{},r=void 0!==n.opacity?n.opacity:1,o=void 0!==n.rotation?n.rotation:0,s=void 0!==n.scale?n.scale:1,a=void 0!==n.rotateWithView&&n.rotateWithView;(i=t.call(this,{opacity:r,rotation:o,scale:s,displacement:void 0!==n.displacement?n.displacement:[0,0],rotateWithView:a})||this).anchor_=void 0!==n.anchor?n.anchor:[.5,.5],i.normalizedAnchor_=null,i.anchorOrigin_=void 0!==n.anchorOrigin?n.anchorOrigin:Ia,i.anchorXUnits_=void 0!==n.anchorXUnits?n.anchorXUnits:ka,i.anchorYUnits_=void 0!==n.anchorYUnits?n.anchorYUnits:ka,i.crossOrigin_=void 0!==n.crossOrigin?n.crossOrigin:null;var l=void 0!==n.img?n.img:null,u=void 0!==n.imgSize?n.imgSize:null,h=n.src;Ie(!(void 0!==h&&l),4),Ie(!l||l&&u,5),void 0!==h&&0!==h.length||!l||(h=l.src||$t(l)),Ie(void 0!==h&&h.length>0,6);var c=void 0!==n.src?ja:Aa;return i.color_=void 0!==n.color?kr(n.color):null,i.iconImage_=function(t,e,i,n,r,o){var s=Ir.get(e,n,o);return s||(s=new Va(t,e,i,n,r,o),Ir.set(e,n,o,s)),s}(l,h,u,i.crossOrigin_,c,i.color_),i.offset_=void 0!==n.offset?n.offset:[0,0],i.offsetOrigin_=void 0!==n.offsetOrigin?n.offsetOrigin:Ia,i.origin_=null,i.size_=void 0!==n.size?n.size:null,i}return Ua(e,t),e.prototype.clone=function(){var t=this.getScale();return new e({anchor:this.anchor_.slice(),anchorOrigin:this.anchorOrigin_,anchorXUnits:this.anchorXUnits_,anchorYUnits:this.anchorYUnits_,crossOrigin:this.crossOrigin_,color:this.color_&&this.color_.slice?this.color_.slice():this.color_||void 0,src:this.getSrc(),offset:this.offset_.slice(),offsetOrigin:this.offsetOrigin_,size:null!==this.size_?this.size_.slice():void 0,opacity:this.getOpacity(),scale:Array.isArray(t)?t.slice():t,rotation:this.getRotation(),rotateWithView:this.getRotateWithView()})},e.prototype.getAnchor=function(){if(this.normalizedAnchor_)return this.normalizedAnchor_;var t=this.anchor_,e=this.getSize();if(this.anchorXUnits_==ka||this.anchorYUnits_==ka){if(!e)return null;t=this.anchor_.slice(),this.anchorXUnits_==ka&&(t[0]*=e[0]),this.anchorYUnits_==ka&&(t[1]*=e[1])}if(this.anchorOrigin_!=Ia){if(!e)return null;t===this.anchor_&&(t=this.anchor_.slice()),this.anchorOrigin_!=Fa&&this.anchorOrigin_!=Ra||(t[0]=-t[0]+e[0]),this.anchorOrigin_!=Oa&&this.anchorOrigin_!=Ra||(t[1]=-t[1]+e[1])}var i=this.getDisplacement();return t[0]-=i[0],t[1]+=i[1],this.normalizedAnchor_=t,this.normalizedAnchor_},e.prototype.setAnchor=function(t){this.anchor_=t,this.normalizedAnchor_=null},e.prototype.getColor=function(){return this.color_},e.prototype.getImage=function(t){return this.iconImage_.getImage(t)},e.prototype.getPixelRatio=function(t){return this.iconImage_.getPixelRatio(t)},e.prototype.getImageSize=function(){return this.iconImage_.getSize()},e.prototype.getImageState=function(){return this.iconImage_.getImageState()},e.prototype.getHitDetectionImage=function(){return this.iconImage_.getHitDetectionImage()},e.prototype.getOrigin=function(){if(this.origin_)return this.origin_;var t=this.offset_;if(this.offsetOrigin_!=Ia){var e=this.getSize(),i=this.iconImage_.getSize();if(!e||!i)return null;t=t.slice(),this.offsetOrigin_!=Fa&&this.offsetOrigin_!=Ra||(t[0]=i[0]-e[0]-t[0]),this.offsetOrigin_!=Oa&&this.offsetOrigin_!=Ra||(t[1]=i[1]-e[1]-t[1])}return this.origin_=t,this.origin_},e.prototype.getSrc=function(){return this.iconImage_.getSrc()},e.prototype.getSize=function(){return this.size_?this.size_:this.iconImage_.getSize()},e.prototype.listenImageChange=function(t){this.iconImage_.addEventListener(It,t)},e.prototype.load=function(){this.iconImage_.load()},e.prototype.unlistenImageChange=function(t){this.iconImage_.removeEventListener(It,t)},e}(za),Ka=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}();function Ya(t){return Array.isArray(t)?Or(t):t}var Za=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}(),Ha=function(t){function e(e){var i=this,n=void 0!==e.rotateWithView&&e.rotateWithView;return(i=t.call(this,{opacity:1,rotateWithView:n,rotation:void 0!==e.rotation?e.rotation:0,scale:void 0!==e.scale?e.scale:1,displacement:void 0!==e.displacement?e.displacement:[0,0]})||this).canvas_=void 0,i.hitDetectionCanvas_=null,i.fill_=void 0!==e.fill?e.fill:null,i.origin_=[0,0],i.points_=e.points,i.radius_=void 0!==e.radius?e.radius:e.radius1,i.radius2_=e.radius2,i.angle_=void 0!==e.angle?e.angle:0,i.stroke_=void 0!==e.stroke?e.stroke:null,i.anchor_=null,i.size_=null,i.renderOptions_=null,i.render(),i}return Za(e,t),e.prototype.clone=function(){var t=this.getScale(),i=new e({fill:this.getFill()?this.getFill().clone():void 0,points:this.getPoints(),radius:this.getRadius(),radius2:this.getRadius2(),angle:this.getAngle(),stroke:this.getStroke()?this.getStroke().clone():void 0,rotation:this.getRotation(),rotateWithView:this.getRotateWithView(),scale:Array.isArray(t)?t.slice():t,displacement:this.getDisplacement().slice()});return i.setOpacity(this.getOpacity()),i},e.prototype.getAnchor=function(){return this.anchor_},e.prototype.getAngle=function(){return this.angle_},e.prototype.getFill=function(){return this.fill_},e.prototype.getHitDetectionImage=function(){return this.hitDetectionCanvas_||this.createHitDetectionCanvas_(this.renderOptions_),this.hitDetectionCanvas_},e.prototype.getImage=function(t){var e=this.canvas_[t];if(!e){var i=this.renderOptions_,n=pe(i.size*t,i.size*t);this.draw_(i,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 Aa},e.prototype.getOrigin=function(){return this.origin_},e.prototype.getPoints=function(){return this.points_},e.prototype.getRadius=function(){return this.radius_},e.prototype.getRadius2=function(){return this.radius2_},e.prototype.getSize=function(){return this.size_},e.prototype.getStroke=function(){return this.stroke_},e.prototype.listenImageChange=function(t){},e.prototype.load=function(){},e.prototype.unlistenImageChange=function(t){},e.prototype.calculateLineJoinSize_=function(t,e,i){if(0===e||this.points_===1/0||"bevel"!==t&&"miter"!==t)return e;var n=this.radius_,r=void 0===this.radius2_?n:this.radius2_;if(n<r){var o=n;n=r,r=o}var s=void 0===this.radius2_?this.points_:2*this.points_,a=2*Math.PI/s,l=r*Math.sin(a),u=n-Math.sqrt(r*r-l*l),h=Math.sqrt(l*l+u*u),c=h/l;if("miter"===t&&c<=i)return c*e;var p=e/2/c,d=e/2*(u/h),f=Math.sqrt((n+p)*(n+p)+d*d)-n;if(void 0===this.radius2_||"bevel"===t)return 2*f;var y=n*Math.sin(a),g=r-Math.sqrt(n*n-y*y),m=Math.sqrt(y*y+g*g)/y;if(m<=i){var v=m*e/2-r-n;return 2*Math.max(f,v)}return 2*f},e.prototype.createRenderOptions=function(){var t,e="round",i=0,n=null,r=0,o=0;this.stroke_&&(null===(t=this.stroke_.getColor())&&(t="#000"),t=Ya(t),void 0===(o=this.stroke_.getWidth())&&(o=1),n=this.stroke_.getLineDash(),r=this.stroke_.getLineDashOffset(),void 0===(e=this.stroke_.getLineJoin())&&(e="round"),void 0===(i=this.stroke_.getMiterLimit())&&(i=10));var s=this.calculateLineJoinSize_(e,o,i),a=Math.max(this.radius_,this.radius2_||0);return{strokeStyle:t,strokeWidth:o,size:Math.ceil(2*a+s),lineDash:n,lineDashOffset:r,lineJoin:e,miterLimit:i}},e.prototype.render=function(){this.renderOptions_=this.createRenderOptions();var t=this.renderOptions_.size,e=this.getDisplacement();this.canvas_={},this.anchor_=[t/2-e[0],t/2+e[1]],this.size_=[t,t]},e.prototype.draw_=function(t,e,i){if(e.scale(i,i),e.translate(t.size/2,t.size/2),this.createPath_(e),this.fill_){var n=this.fill_.getColor();null===n&&(n="#000"),e.fillStyle=Ya(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(),i=0;if("string"==typeof e&&(e=kr(e)),null===e?i=1:Array.isArray(e)&&(i=4===e.length?e[3]:1),0===i){var n=pe(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_,i=this.radius_;if(e===1/0)t.arc(0,0,i,0,2*Math.PI);else{var n=void 0===this.radius2_?i:this.radius2_;void 0!==this.radius2_&&(e*=2);for(var r=this.angle_-Math.PI/2,o=2*Math.PI/e,s=0;s<e;s++){var a=r+s*o,l=s%2==0?i:n;t.lineTo(l*Math.cos(a),l*Math.sin(a))}t.closePath()}},e.prototype.drawHitDetectionCanvas_=function(t,e){e.translate(t.size/2,t.size/2),this.createPath_(e),e.fillStyle="#000",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}(za),$a=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}(),Ja=function(t){function e(e){var i=e||{};return t.call(this,{points:1/0,fill:i.fill,radius:i.radius,stroke:i.stroke,scale:void 0!==i.scale?i.scale:1,rotation:void 0!==i.rotation?i.rotation:0,rotateWithView:void 0!==i.rotateWithView&&i.rotateWithView,displacement:void 0!==i.displacement?i.displacement:[0,0]})||this}return $a(e,t),e.prototype.clone=function(){var t=this.getScale(),i=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()});return i.setOpacity(this.getOpacity()),i},e.prototype.setRadius=function(t){this.radius_=t,this.render()},e}(Ha),Qa=function(){function t(t){var e=t||{};this.geometry_=null,this.geometryFunction_=nl,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.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.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_=nl,this.geometry_=t},t.prototype.setZIndex=function(t){this.zIndex_=t},t}();var tl=null;function el(t,e){if(!tl){var i=new Ea({color:"rgba(255,255,255,0.4)"}),n=new Ka({color:"#3399CC",width:1.25});tl=[new Qa({image:new Ja({fill:i,stroke:n,radius:5}),fill:i,stroke:n})]}return tl}function il(){var t={},e=[255,255,255,1],i=[0,153,255,1];return t[Rn]=[new Qa({fill:new Ea({color:[255,255,255,.5]})})],t[jn]=t[Rn],t[Pn]=[new Qa({stroke:new Ka({color:e,width:5})}),new Qa({stroke:new Ka({color:i,width:3})})],t[Fn]=t[Pn],t[An]=t[Rn].concat(t[Pn]),t[kn]=[new Qa({image:new Ja({radius:6,fill:new Ea({color:i}),stroke:new Ka({color:e,width:1.5})}),zIndex:1/0})],t[In]=t[kn],t[Mn]=t[Rn].concat(t[Pn],t[kn]),t}function nl(t){return t.getGeometry()}var rl=Qa,ol="point",sl="line",al=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_=Ds(void 0!==e.scale?e.scale:1),this.text_=e.text,this.textAlign_=e.textAlign,this.textBaseline_=e.textBaseline,this.fill_=void 0!==e.fill?e.fill:new Ea({color:"#333"}),this.maxAngle_=void 0!==e.maxAngle?e.maxAngle:Math.PI/4,this.placement_=void 0!==e.placement?e.placement:ol,this.overflow_=!!e.overflow,this.stroke_=void 0!==e.stroke?e.stroke:null,this.offsetX_=void 0!==e.offsetX?e.offsetX:0,this.offsetY_=void 0!==e.offsetY?e.offsetY:0,this.backgroundFill_=e.backgroundFill?e.backgroundFill:null,this.backgroundStroke_=e.backgroundStroke?e.backgroundStroke:null,this.padding_=void 0===e.padding?null:e.padding}return t.prototype.clone=function(){var e=this.getScale();return new t({font:this.getFont(),placement:this.getPlacement(),maxAngle:this.getMaxAngle(),overflow:this.getOverflow(),rotation:this.getRotation(),rotateWithView:this.getRotateWithView(),scale:Array.isArray(e)?e.slice():e,text:this.getText(),textAlign:this.getTextAlign(),textBaseline:this.getTextBaseline(),fill:this.getFill()?this.getFill().clone():void 0,stroke:this.getStroke()?this.getStroke().clone():void 0,offsetX:this.getOffsetX(),offsetY:this.getOffsetY(),backgroundFill:this.getBackgroundFill()?this.getBackgroundFill().clone():void 0,backgroundStroke:this.getBackgroundStroke()?this.getBackgroundStroke().clone():void 0,padding:this.getPadding()})},t.prototype.getOverflow=function(){return this.overflow_},t.prototype.getFont=function(){return this.font_},t.prototype.getMaxAngle=function(){return this.maxAngle_},t.prototype.getPlacement=function(){return this.placement_},t.prototype.getOffsetX=function(){return this.offsetX_},t.prototype.getOffsetY=function(){return this.offsetY_},t.prototype.getFill=function(){return this.fill_},t.prototype.getRotateWithView=function(){return this.rotateWithView_},t.prototype.getRotation=function(){return this.rotation_},t.prototype.getScale=function(){return this.scale_},t.prototype.getScaleArray=function(){return this.scaleArray_},t.prototype.getStroke=function(){return this.stroke_},t.prototype.getText=function(){return this.text_},t.prototype.getTextAlign=function(){return this.textAlign_},t.prototype.getTextBaseline=function(){return this.textBaseline_},t.prototype.getBackgroundFill=function(){return this.backgroundFill_},t.prototype.getBackgroundStroke=function(){return this.backgroundStroke_},t.prototype.getPadding=function(){return this.padding_},t.prototype.setOverflow=function(t){this.overflow_=t},t.prototype.setFont=function(t){this.font_=t},t.prototype.setMaxAngle=function(t){this.maxAngle_=t},t.prototype.setOffsetX=function(t){this.offsetX_=t},t.prototype.setOffsetY=function(t){this.offsetY_=t},t.prototype.setPlacement=function(t){this.placement_=t},t.prototype.setRotateWithView=function(t){this.rotateWithView_=t},t.prototype.setFill=function(t){this.fill_=t},t.prototype.setRotation=function(t){this.rotation_=t},t.prototype.setScale=function(t){this.scale_=t,this.scaleArray_=Ds(void 0!==t?t:1)},t.prototype.setStroke=function(t){this.stroke_=t},t.prototype.setText=function(t){this.text_=t},t.prototype.setTextAlign=function(t){this.textAlign_=t},t.prototype.setTextBaseline=function(t){this.textBaseline_=t},t.prototype.setBackgroundFill=function(t){this.backgroundFill_=t},t.prototype.setBackgroundStroke=function(t){this.backgroundStroke_=t},t.prototype.setPadding=function(t){this.padding_=t},t}(),ll={
|
28
|
+
*/function pt(t){return(e,i)=>{return void 0!==i?(n=t,r=i,void e.constructor.createProperty(r,n)):ct(t,e);var n,r}}var dt=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}(),ft="propertychange",yt=function(){function t(){this.disposed=!1}return t.prototype.dispose=function(){this.disposed||(this.disposed=!0,this.disposeInternal())},t.prototype.disposeInternal=function(){},t}();function gt(t,e){return t>e?1:t<e?-1:0}function mt(t,e,i){var n=t.length;if(t[0]<=e)return 0;if(e<=t[n-1])return n-1;var r=void 0;if(i>0){for(r=1;r<n;++r)if(t[r]<e)return r-1}else if(i<0){for(r=1;r<n;++r)if(t[r]<=e)return r}else for(r=1;r<n;++r){if(t[r]==e)return r;if(t[r]<e)return"function"==typeof i?i(e,t[r-1],t[r])>0?r-1:r:t[r-1]-e<e-t[r]?r-1:r}return n-1}function vt(t,e,i){for(;e<i;){var n=t[e];t[e]=t[i],t[i]=n,++e,--i}}function _t(t,e){for(var i=Array.isArray(e)?e:[e],n=i.length,r=0;r<n;r++)t[t.length]=i[r]}function xt(t,e){var i=t.length;if(i!==e.length)return!1;for(var n=0;n<i;n++)if(t[n]!==e[n])return!1;return!0}function bt(){return!0}function wt(){return!1}function St(){}var Ct="function"==typeof Object.assign?Object.assign:function(t,e){if(null==t)throw new TypeError("Cannot convert undefined or null to object");for(var i=Object(t),n=1,r=arguments.length;n<r;++n){var o=arguments[n];if(null!=o)for(var s in o)o.hasOwnProperty(s)&&(i[s]=o[s])}return i};function Tt(t){for(var e in t)delete t[e]}var Et="function"==typeof Object.values?Object.values:function(t){var e=[];for(var i in t)e.push(t[i]);return e};function kt(t){var e;for(e in t)return!1;return!e}var Pt,Ot=(Pt=function(t,e){return(Pt=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(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 i(){this.constructor=t}Pt(t,e),t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)}),Rt=function(t){function e(e){var i=t.call(this)||this;return i.eventTarget_=e,i.pendingRemovals_=null,i.dispatching_=null,i.listeners_=null,i}return Ot(e,t),e.prototype.addEventListener=function(t,e){if(t&&e){var i=this.listeners_||(this.listeners_={}),n=i[t]||(i[t]=[]);-1===n.indexOf(e)&&n.push(e)}},e.prototype.dispatchEvent=function(t){var e="string"==typeof t?new dt(t):t,i=e.type;e.target||(e.target=this.eventTarget_||this);var n,r=this.listeners_&&this.listeners_[i];if(r){var o=this.dispatching_||(this.dispatching_={}),s=this.pendingRemovals_||(this.pendingRemovals_={});i in o||(o[i]=0,s[i]=0),++o[i];for(var a=0,l=r.length;a<l;++a)if(!1===(n="handleEvent"in r[a]?r[a].handleEvent(e):r[a].call(this,e))||e.propagationStopped){n=!1;break}if(--o[i],0===o[i]){var u=s[i];for(delete s[i];u--;)this.removeEventListener(i,St);delete o[i]}return n}},e.prototype.disposeInternal=function(){this.listeners_&&Tt(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 i=this.listeners_&&this.listeners_[t];if(i){var n=i.indexOf(e);-1!==n&&(this.pendingRemovals_&&t in this.pendingRemovals_?(i[n]=St,++this.pendingRemovals_[t]):(i.splice(n,1),0===i.length&&delete this.listeners_[t]))}},e}(yt),It="change",Ft="error",jt="clear",Mt="contextmenu",At="click",Lt="dblclick",Dt="keydown",zt="keypress",Gt="load",Nt="resize",Bt="touchmove",Wt="wheel";function qt(t,e,i,n,r){if(n&&n!==t&&(i=i.bind(n)),r){var o=i;i=function(){t.removeEventListener(e,i),o.apply(this,arguments)}}var s={target:t,type:e,listener:i};return t.addEventListener(e,i),s}function Vt(t,e,i,n){return qt(t,e,i,n,!0)}function Ut(t){t&&t.target&&(t.target.removeEventListener(t.type,t.listener),Tt(t))}var Xt=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}(),Kt=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 Xt(e,t),e.prototype.changed=function(){++this.revision_,this.dispatchEvent(It)},e.prototype.getRevision=function(){return this.revision_},e.prototype.onInternal=function(t,e){if(Array.isArray(t)){for(var i=t.length,n=new Array(i),r=0;r<i;++r)n[r]=qt(this,t[r],e);return n}return qt(this,t,e)},e.prototype.onceInternal=function(t,e){var i;if(Array.isArray(t)){var n=t.length;i=new Array(n);for(var r=0;r<n;++r)i[r]=Vt(this,t[r],e)}else i=Vt(this,t,e);return e.ol_key=i,i},e.prototype.unInternal=function(t,e){var i=e.ol_key;if(i)!function(t){if(Array.isArray(t))for(var e=0,i=t.length;e<i;++e)Ut(t[e]);else Ut(t)}(i);else if(Array.isArray(t))for(var n=0,r=t.length;n<r;++n)this.removeEventListener(t[n],e);else this.removeEventListener(t,e)},e}(Rt);Kt.prototype.on,Kt.prototype.once,Kt.prototype.un;var Yt=Kt;function Zt(){return function(){throw new Error("Unimplemented abstract method.")}()}var Ht=0;function $t(t){return t.ol_uid||(t.ol_uid=String(++Ht))}var Jt=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}(),Qt=function(t){function e(e,i,n){var r=t.call(this,e)||this;return r.key=i,r.oldValue=n,r}return Jt(e,t),e}(dt),te=function(t){function e(e){var i=t.call(this)||this;return i.on,i.once,i.un,$t(i),i.values_=null,void 0!==e&&i.setProperties(e),i}return Jt(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_&&Ct({},this.values_)||{}},e.prototype.hasProperties=function(){return!!this.values_},e.prototype.notify=function(t,e){var i;i="change:"+t,this.dispatchEvent(new Qt(i,t,e)),i=ft,this.dispatchEvent(new Qt(i,t,e))},e.prototype.addChangeListener=function(t,e){this.addEventListener("change:"+t,e)},e.prototype.removeChangeListener=function(t,e){this.removeEventListener("change:"+t,e)},e.prototype.set=function(t,e,i){var n=this.values_||(this.values_={});if(i)n[t]=e;else{var r=n[t];n[t]=e,r!==e&&this.notify(t,r)}},e.prototype.setProperties=function(t,e){for(var i in t)this.set(i,t[i],e)},e.prototype.applyProperties=function(t){t.values_&&Ct(this.values_||(this.values_={}),t.values_)},e.prototype.unset=function(t,e){if(this.values_&&t in this.values_){var i=this.values_[t];delete this.values_[t],kt(this.values_)&&(this.values_=null),e||this.notify(t,i)}},e}(Yt),ee="postrender",ie="movestart",ne="moveend",re="undefined"!=typeof navigator&&void 0!==navigator.userAgent?navigator.userAgent.toLowerCase():"",oe=-1!==re.indexOf("firefox");-1!==re.indexOf("safari")&&re.indexOf("chrom");var se=-1!==re.indexOf("webkit")&&-1==re.indexOf("edge"),ae=-1!==re.indexOf("macintosh"),le="undefined"!=typeof devicePixelRatio?devicePixelRatio:1,ue="undefined"!=typeof WorkerGlobalScope&&"undefined"!=typeof OffscreenCanvas&&self instanceof WorkerGlobalScope,he="undefined"!=typeof Image&&Image.prototype.decode,ce=function(){var t=!1;try{var e=Object.defineProperty({},"passive",{get:function(){t=!0}});window.addEventListener("_",null,e),window.removeEventListener("_",null,e)}catch(i){}return t}();function pe(t,e,i,n){var r;return i&&i.length?r=i.shift():ue?r=new OffscreenCanvas(t||300,e||300):(r=document.createElement("canvas")).style.all="unset",t&&(r.width=t),e&&(r.height=e),r.getContext("2d",n)}function de(t,e){var i=e.parentNode;i&&i.replaceChild(t,e)}function fe(t){return t&&t.parentNode?t.parentNode.removeChild(t):null}var ye=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}(),ge=function(t){function e(e){var i=t.call(this)||this,n=e.element;return!n||e.target||n.style.pointerEvents||(n.style.pointerEvents="auto"),i.element=n||null,i.target_=null,i.map_=null,i.listenerKeys=[],e.render&&(i.render=e.render),e.target&&i.setTarget(e.target),i}return ye(e,t),e.prototype.disposeInternal=function(){fe(this.element),t.prototype.disposeInternal.call(this)},e.prototype.getMap=function(){return this.map_},e.prototype.setMap=function(t){this.map_&&fe(this.element);for(var e=0,i=this.listenerKeys.length;e<i;++e)Ut(this.listenerKeys[e]);(this.listenerKeys.length=0,this.map_=t,this.map_)&&((this.target_?this.target_:t.getOverlayContainerStopEvent()).appendChild(this.element),this.render!==St&&this.listenerKeys.push(qt(t,ee,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}(te),me=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"),ve=["style","variant","weight","size","lineHeight","family"],_e=function(t){var e=t.match(me);if(!e)return null;for(var i={lineHeight:"normal",size:"1.2em",style:"normal",weight:"normal",variant:"normal"},n=0,r=ve.length;n<r;++n){var o=e[n+1];void 0!==o&&(i[ve[n]]=o)}return i.families=i.family.split(/,\s?/),i};function xe(t){return 1===t?"":String(Math.round(100*t)/100)}var be="opacity",we="visible",Se="extent",Ce="zIndex",Te="maxResolution",Ee="minResolution",ke="maxZoom",Pe="minZoom",Oe="source",Re=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}(),Ie=function(t){function e(e){var i=this,n="Assertion failed. See https://openlayers.org/en/"+("v"+"6.9.0".split("-")[0])+"/doc/errors/#"+e+" for details.";return(i=t.call(this,n)||this).code=e,i.name="AssertionError",i.message=n,i}return Re(e,t),e}(Error);function Fe(t,e){if(!t)throw new Ie(e)}function je(t,e,i){return Math.min(Math.max(t,e),i)}var Me="cosh"in Math?Math.cosh:function(t){var e=Math.exp(t);return(e+1/e)/2},Ae="log2"in Math?Math.log2:function(t){return Math.log(t)*Math.LOG2E};function Le(t,e,i,n,r,o){var s=r-i,a=o-n;if(0!==s||0!==a){var l=((t-i)*s+(e-n)*a)/(s*s+a*a);l>1?(i=r,n=o):l>0&&(i+=s*l,n+=a*l)}return De(t,e,i,n)}function De(t,e,i,n){var r=i-t,o=n-e;return r*r+o*o}function ze(t){return t*Math.PI/180}function Ge(t,e){var i=t%e;return i*e<0?i+e:i}function Ne(t,e,i){return t+i*(e-t)}var Be=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}(),We=function(t){function e(e){var i=t.call(this)||this;i.on,i.once,i.un;var n=Ct({},e);return"object"==typeof e.properties&&(delete n.properties,Ct(n,e.properties)),n[be]=void 0!==e.opacity?e.opacity:1,Fe("number"==typeof n[be],64),n[we]=void 0===e.visible||e.visible,n[Ce]=e.zIndex,n[Te]=void 0!==e.maxResolution?e.maxResolution:1/0,n[Ee]=void 0!==e.minResolution?e.minResolution:0,n[Pe]=void 0!==e.minZoom?e.minZoom:-1/0,n[ke]=void 0!==e.maxZoom?e.maxZoom:1/0,i.className_=void 0!==n.className?e.className:"ol-layer",delete n.className,i.setProperties(n),i.state_=null,i}return Be(e,t),e.prototype.getClassName=function(){return this.className_},e.prototype.getLayerState=function(t){var e=this.state_||{layer:this,managed:void 0===t||t},i=this.getZIndex();return e.opacity=je(Math.round(100*this.getOpacity())/100,0,1),e.sourceState=this.getSourceState(),e.visible=this.getVisible(),e.extent=this.getExtent(),e.zIndex=void 0!==i||e.managed?i: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 Zt()},e.prototype.getLayerStatesArray=function(t){return Zt()},e.prototype.getExtent=function(){return this.get(Se)},e.prototype.getMaxResolution=function(){return this.get(Te)},e.prototype.getMinResolution=function(){return this.get(Ee)},e.prototype.getMinZoom=function(){return this.get(Pe)},e.prototype.getMaxZoom=function(){return this.get(ke)},e.prototype.getOpacity=function(){return this.get(be)},e.prototype.getSourceState=function(){return Zt()},e.prototype.getVisible=function(){return this.get(we)},e.prototype.getZIndex=function(){return this.get(Ce)},e.prototype.setExtent=function(t){this.set(Se,t)},e.prototype.setMaxResolution=function(t){this.set(Te,t)},e.prototype.setMinResolution=function(t){this.set(Ee,t)},e.prototype.setMaxZoom=function(t){this.set(ke,t)},e.prototype.setMinZoom=function(t){this.set(Pe,t)},e.prototype.setOpacity=function(t){Fe("number"==typeof t,64),this.set(be,t)},e.prototype.setVisible=function(t){this.set(we,t)},e.prototype.setZIndex=function(t){this.set(Ce,t)},e.prototype.disposeInternal=function(){this.state_&&(this.state_.layer=null,this.state_=null),t.prototype.disposeInternal.call(this)},e}(te),qe="prerender",Ve="postrender",Ue="precompose",Xe="postcompose",Ke="rendercomplete",Ye="undefined",Ze="ready",He=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}();function $e(t,e){if(!t.visible)return!1;var i=e.resolution;if(i<t.minResolution||i>=t.maxResolution)return!1;var n=e.zoom;return n>t.minZoom&&n<=t.maxZoom}var Je=function(t){function e(e){var i=this,n=Ct({},e);delete n.source,(i=t.call(this,n)||this).on,i.once,i.un,i.mapPrecomposeKey_=null,i.mapRenderKey_=null,i.sourceChangeKey_=null,i.renderer_=null,e.render&&(i.render=e.render),e.map&&i.setMap(e.map),i.addChangeListener(Oe,i.handleSourcePropertyChange_);var r=e.source?e.source:null;return i.setSource(r),i}return He(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(Oe)||null},e.prototype.getSourceState=function(){var t=this.getSource();return t?t.getState():Ye},e.prototype.handleSourceChange_=function(){this.changed()},e.prototype.handleSourcePropertyChange_=function(){this.sourceChangeKey_&&(Ut(this.sourceChangeKey_),this.sourceChangeKey_=null);var t=this.getSource();t&&(this.sourceChangeKey_=qt(t,It,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.render=function(t,e){var i=this.getRenderer();if(i.prepareFrame(t))return i.renderFrame(t,e)},e.prototype.setMap=function(t){this.mapPrecomposeKey_&&(Ut(this.mapPrecomposeKey_),this.mapPrecomposeKey_=null),t||this.changed(),this.mapRenderKey_&&(Ut(this.mapRenderKey_),this.mapRenderKey_=null),t&&(this.mapPrecomposeKey_=qt(t,Ue,(function(t){var e=t.frameState.layerStatesArray,i=this.getLayerState(!1);Fe(!e.some((function(t){return t.layer===i.layer})),67),e.push(i)}),this),this.mapRenderKey_=qt(this,It,t.render,t),this.changed())},e.prototype.setSource=function(t){this.set(Oe,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}(We),Qe=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}(),ti=function(t){function e(e){var i=this,n=e||{};(i=t.call(this,{element:document.createElement("div"),render:n.render,target:n.target})||this).ulElement_=document.createElement("ul"),i.collapsed_=void 0===n.collapsed||n.collapsed,i.userCollapsed_=i.collapsed_,i.overrideCollapsible_=void 0!==n.collapsible,i.collapsible_=void 0===n.collapsible||n.collapsible,i.collapsible_||(i.collapsed_=!1);var r=void 0!==n.className?n.className:"ol-attribution",o=void 0!==n.tipLabel?n.tipLabel:"Attributions",s=void 0!==n.expandClassName?n.expandClassName:r+"-expand",a=void 0!==n.collapseLabel?n.collapseLabel:"›",l=void 0!==n.collapseClassName?n.collapseClassName:r+"-collpase";"string"==typeof a?(i.collapseLabel_=document.createElement("span"),i.collapseLabel_.textContent=a,i.collapseLabel_.className=l):i.collapseLabel_=a;var u=void 0!==n.label?n.label:"i";"string"==typeof u?(i.label_=document.createElement("span"),i.label_.textContent=u,i.label_.className=s):i.label_=u;var h=i.collapsible_&&!i.collapsed_?i.collapseLabel_:i.label_;i.toggleButton_=document.createElement("button"),i.toggleButton_.setAttribute("type","button"),i.toggleButton_.setAttribute("aria-expanded",String(!i.collapsed_)),i.toggleButton_.title=o,i.toggleButton_.appendChild(h),i.toggleButton_.addEventListener(At,i.handleClick_.bind(i),!1);var c=r+" ol-unselectable ol-control"+(i.collapsed_&&i.collapsible_?" ol-collapsed":"")+(i.collapsible_?"":" ol-uncollapsible"),p=i.element;return p.className=c,p.appendChild(i.toggleButton_),p.appendChild(i.ulElement_),i.renderedAttributions_=[],i.renderedVisible_=!0,i}return Qe(e,t),e.prototype.collectSourceAttributions_=function(t){for(var e={},i=[],n=!0,r=t.layerStatesArray,o=0,s=r.length;o<s;++o){var a=r[o];if($e(a,t.viewState)){var l=a.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||(i.push(h[c]),e[h[c]]=!0);else h in e||(i.push(h),e[h]=!0)}}}}return this.overrideCollapsible_||this.setCollapsible(n),i},e.prototype.updateElement_=function(t){if(t){var e=this.collectSourceAttributions_(t),i=e.length>0;if(this.renderedVisible_!=i&&(this.element.style.display=i?"":"none",this.renderedVisible_=i),!xt(e,this.renderedAttributions_)){!function(t){for(;t.lastChild;)t.removeChild(t.lastChild)}(this.ulElement_);for(var n=0,r=e.length;n<r;++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("ol-collapsed"),this.collapsed_?de(this.collapseLabel_,this.label_):de(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}(ge),ei="add",ii="remove",ni=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}(),ri="length",oi=function(t){function e(e,i,n){var r=t.call(this,e)||this;return r.element=i,r.index=n,r}return ni(e,t),e}(dt),si=function(t){function e(e,i){var n=t.call(this)||this;n.on,n.once,n.un;var r=i||{};if(n.unique_=!!r.unique,n.array_=e||[],n.unique_)for(var o=0,s=n.array_.length;o<s;++o)n.assertUnique_(n.array_[o],o);return n.updateLength_(),n}return ni(e,t),e.prototype.clear=function(){for(;this.getLength()>0;)this.pop()},e.prototype.extend=function(t){for(var e=0,i=t.length;e<i;++e)this.push(t[e]);return this},e.prototype.forEach=function(t){for(var e=this.array_,i=0,n=e.length;i<n;++i)t(e[i],i,e)},e.prototype.getArray=function(){return this.array_},e.prototype.item=function(t){return this.array_[t]},e.prototype.getLength=function(){return this.get(ri)},e.prototype.insertAt=function(t,e){this.unique_&&this.assertUnique_(e),this.array_.splice(t,0,e),this.updateLength_(),this.dispatchEvent(new oi(ei,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_,i=0,n=e.length;i<n;++i)if(e[i]===t)return this.removeAt(i)},e.prototype.removeAt=function(t){var e=this.array_[t];return this.array_.splice(t,1),this.updateLength_(),this.dispatchEvent(new oi(ii,e,t)),e},e.prototype.setAt=function(t,e){var i=this.getLength();if(t<i){this.unique_&&this.assertUnique_(e,t);var n=this.array_[t];this.array_[t]=e,this.dispatchEvent(new oi(ii,n,t)),this.dispatchEvent(new oi(ei,e,t))}else{for(var r=i;r<t;++r)this.insertAt(r,void 0);this.insertAt(t,e)}},e.prototype.updateLength_=function(){this.set(ri,this.array_.length)},e.prototype.assertUnique_=function(t,e){for(var i=0,n=this.array_.length;i<n;++i)if(this.array_[i]===t&&i!==e)throw new Ie(58)},e}(te);function ai(t){return Math.pow(t,3)}function li(t){return 1-ai(1-t)}function ui(t){return 3*t*t-2*t*t*t}function hi(t){return t}var ci=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}(),pi=function(t){function e(e){var i=this,n=e||{};i=t.call(this,{element:document.createElement("div"),render:n.render,target:n.target})||this;var r=void 0!==n.className?n.className:"ol-rotate",o=void 0!==n.label?n.label:"⇧",s=void 0!==n.compassClassName?n.compassClassName:"ol-compass";i.label_=null,"string"==typeof o?(i.label_=document.createElement("span"),i.label_.className=s,i.label_.textContent=o):(i.label_=o,i.label_.classList.add(s));var a=n.tipLabel?n.tipLabel:"Reset rotation",l=document.createElement("button");l.className=r+"-reset",l.setAttribute("type","button"),l.title=a,l.appendChild(i.label_),l.addEventListener(At,i.handleClick_.bind(i),!1);var u=r+" ol-unselectable ol-control",h=i.element;return h.className=u,h.appendChild(l),i.callResetNorth_=n.resetNorth?n.resetNorth:void 0,i.duration_=void 0!==n.duration?n.duration:250,i.autoHide_=void 0===n.autoHide||n.autoHide,i.rotation_=void 0,i.autoHide_&&i.element.classList.add("ol-hidden"),i}return ci(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:li}):t.setRotation(0))}},e.prototype.render=function(t){var e=t.frameState;if(e){var i=e.viewState.rotation;if(i!=this.rotation_){var n="rotate("+i+"rad)";if(this.autoHide_){var r=this.element.classList.contains("ol-hidden");r||0!==i?r&&0!==i&&this.element.classList.remove("ol-hidden"):this.element.classList.add("ol-hidden")}this.label_.style.transform=n}this.rotation_=i}},e}(ge),di=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}(),fi=function(t){function e(e){var i=this,n=e||{};i=t.call(this,{element:document.createElement("div"),target:n.target})||this;var r=void 0!==n.className?n.className:"ol-zoom",o=void 0!==n.delta?n.delta:1,s=void 0!==n.zoomInClassName?n.zoomInClassName:r+"-in",a=void 0!==n.zoomOutClassName?n.zoomOutClassName:r+"-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=s,p.setAttribute("type","button"),p.title=h,p.appendChild("string"==typeof l?document.createTextNode(l):l),p.addEventListener(At,i.handleClick_.bind(i,o),!1);var d=document.createElement("button");d.className=a,d.setAttribute("type","button"),d.title=c,d.appendChild("string"==typeof u?document.createTextNode(u):u),d.addEventListener(At,i.handleClick_.bind(i,-o),!1);var f=r+" ol-unselectable ol-control",y=i.element;return y.className=f,y.appendChild(p),y.appendChild(d),i.duration_=void 0!==n.duration?n.duration:250,i}return di(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 i=e.getZoom();if(void 0!==i){var n=e.getConstrainedZoom(i+t);this.duration_>0?(e.getAnimating()&&e.cancelAnimations(),e.animate({zoom:n,duration:this.duration_,easing:li})):e.setZoom(n)}}},e}(ge),yi="pointermove",gi="pointerdown",mi={RADIANS:"radians",DEGREES:"degrees",FEET:"ft",METERS:"m",PIXELS:"pixels",TILE_PIXELS:"tile-pixels",USFEET:"us-ft"},vi={};vi[mi.RADIANS]=6370997/(2*Math.PI),vi[mi.DEGREES]=2*Math.PI*6370997/360,vi[mi.FEET]=.3048,vi[mi.METERS]=1,vi[mi.USFEET]=1200/3937;var _i=mi,xi=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_||vi[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}(),bi=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}(),wi=6378137*Math.PI,Si=[-wi,-wi,wi,wi],Ci=[-180,-85,180,85],Ti=6378137*Math.log(Math.tan(Math.PI/2)),Ei=function(t){function e(e){return t.call(this,{code:e,units:_i.METERS,extent:Si,global:!0,worldExtent:Ci,getPointResolution:function(t,e){return t/Me(e[1]/6378137)}})||this}return bi(e,t),e}(xi),ki=[new Ei("EPSG:3857"),new Ei("EPSG:102100"),new Ei("EPSG:102113"),new Ei("EPSG:900913"),new Ei("http://www.opengis.net/def/crs/EPSG/0/3857"),new Ei("http://www.opengis.net/gml/srs/epsg.xml#3857")];function Pi(t,e,i){var n=t.length,r=i>1?i:2,o=e;void 0===o&&(o=r>2?t.slice():new Array(n));for(var s=0;s<n;s+=r){o[s]=wi*t[s]/180;var a=6378137*Math.log(Math.tan(Math.PI*(+t[s+1]+90)/360));a>Ti?a=Ti:a<-Ti&&(a=-Ti),o[s+1]=a}return o}function Oi(t,e,i){var n=t.length,r=i>1?i:2,o=e;void 0===o&&(o=r>2?t.slice():new Array(n));for(var s=0;s<n;s+=r)o[s]=180*t[s]/wi,o[s+1]=360*Math.atan(Math.exp(t[s+1]/6378137))/Math.PI-90;return o}var Ri=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}(),Ii=[-180,-90,180,90],Fi=6378137*Math.PI/180,ji=function(t){function e(e,i){return t.call(this,{code:e,units:_i.DEGREES,extent:Ii,axisOrientation:i,global:!0,metersPerUnit:Fi,worldExtent:Ii})||this}return Ri(e,t),e}(xi),Mi=[new ji("CRS:84"),new ji("EPSG:4326","neu"),new ji("urn:ogc:def:crs:OGC:1.3:CRS84"),new ji("urn:ogc:def:crs:OGC:2:84"),new ji("http://www.opengis.net/def/crs/OGC/1.3/CRS84","neu"),new ji("http://www.opengis.net/gml/srs/epsg.xml#4326","neu"),new ji("http://www.opengis.net/def/crs/EPSG/0/4326","neu")],Ai={};var Li={};function Di(t,e,i){var n=t.getCode(),r=e.getCode();n in Li||(Li[n]={}),Li[n][r]=i}var zi="bottom-left",Gi="bottom-right",Ni="top-left",Bi="top-right",Wi=0,qi=1,Vi=2,Ui=4,Xi=8,Ki=16;function Yi(t){for(var e=nn(),i=0,n=t.length;i<n;++i)hn(e,t[i]);return e}function Zi(t,e,i){return i?(i[0]=t[0]-e,i[1]=t[1]-e,i[2]=t[2]+e,i[3]=t[3]+e,i):[t[0]-e,t[1]-e,t[2]+e,t[3]+e]}function Hi(t,e){return e?(e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e):t.slice()}function $i(t,e,i){var n,r;return(n=e<t[0]?t[0]-e:t[2]<e?e-t[2]:0)*n+(r=i<t[1]?t[1]-i:t[3]<i?i-t[3]:0)*r}function Ji(t,e){return tn(t,e[0],e[1])}function Qi(t,e){return t[0]<=e[0]&&e[2]<=t[2]&&t[1]<=e[1]&&e[3]<=t[3]}function tn(t,e,i){return t[0]<=e&&e<=t[2]&&t[1]<=i&&i<=t[3]}function en(t,e){var i=t[0],n=t[1],r=t[2],o=t[3],s=e[0],a=e[1],l=Wi;return s<i?l|=Ki:s>r&&(l|=Ui),a<n?l|=Xi:a>o&&(l|=Vi),l===Wi&&(l=qi),l}function nn(){return[1/0,1/0,-1/0,-1/0]}function rn(t,e,i,n,r){return r?(r[0]=t,r[1]=e,r[2]=i,r[3]=n,r):[t,e,i,n]}function on(t){return rn(1/0,1/0,-1/0,-1/0,t)}function sn(t,e){var i=t[0],n=t[1];return rn(i,n,i,n,e)}function an(t,e,i,n,r){return cn(on(r),t,e,i,n)}function ln(t,e){return t[0]==e[0]&&t[2]==e[2]&&t[1]==e[1]&&t[3]==e[3]}function un(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 hn(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 cn(t,e,i,n,r){for(;i<n;i+=r)pn(t,e[i],e[i+1]);return t}function pn(t,e,i){t[0]=Math.min(t[0],e),t[1]=Math.min(t[1],i),t[2]=Math.max(t[2],e),t[3]=Math.max(t[3],i)}function dn(t,e){var i;return(i=e(yn(t)))||(i=e(gn(t)))||(i=e(Sn(t)))?i:(i=e(wn(t)))||!1}function fn(t){var e=0;return En(t)||(e=Cn(t)*xn(t)),e}function yn(t){return[t[0],t[1]]}function gn(t){return[t[2],t[1]]}function mn(t){return[(t[0]+t[2])/2,(t[1]+t[3])/2]}function vn(t,e){var i;return e===zi?i=yn(t):e===Gi?i=gn(t):e===Ni?i=wn(t):e===Bi?i=Sn(t):Fe(!1,13),i}function _n(t,e,i,n,r){var o=e*n[0]/2,s=e*n[1]/2,a=Math.cos(i),l=Math.sin(i),u=o*a,h=o*l,c=s*a,p=s*l,d=t[0],f=t[1],y=d-u+p,g=d-u-p,m=d+u-p,v=d+u+p,_=f-h-c,x=f-h+c,b=f+h+c,w=f+h-c;return rn(Math.min(y,g,m,v),Math.min(_,x,b,w),Math.max(y,g,m,v),Math.max(_,x,b,w),r)}function xn(t){return t[3]-t[1]}function bn(t,e,i){var n=i||[1/0,1/0,-1/0,-1/0];return Tn(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]):on(n),n}function wn(t){return[t[0],t[3]]}function Sn(t){return[t[2],t[3]]}function Cn(t){return t[2]-t[0]}function Tn(t,e){return t[0]<=e[2]&&t[2]>=e[0]&&t[1]<=e[3]&&t[3]>=e[1]}function En(t){return t[2]<t[0]||t[3]<t[1]}function kn(t,e,i,n){var r=[];if(n>1)for(var o=t[2]-t[0],s=t[3]-t[1],a=0;a<n;++a)r.push(t[0]+o*a/n,t[1],t[2],t[1]+s*a/n,t[2]-o*a/n,t[3],t[0],t[3]-s*a/n);else r=[t[0],t[1],t[2],t[1],t[2],t[3],t[0],t[3]];e(r,r,2);for(var l=[],u=[],h=(a=0,r.length);a<h;a+=2)l.push(r[a]),u.push(r[a+1]);return function(t,e,i){return rn(Math.min.apply(null,t),Math.min.apply(null,e),Math.max.apply(null,t),Math.max.apply(null,e),i)}(l,u,i)}var Pn="Point",On="LineString",Rn="LinearRing",In="Polygon",Fn="MultiPoint",jn="MultiLineString",Mn="MultiPolygon",An="GeometryCollection",Ln="Circle";function Dn(t,e,i){var n=i||6371008.8,r=ze(t[1]),o=ze(e[1]),s=(o-r)/2,a=ze(e[0]-t[0])/2,l=Math.sin(s)*Math.sin(s)+Math.sin(a)*Math.sin(a)*Math.cos(r)*Math.cos(o);return 2*n*Math.atan2(Math.sqrt(l),Math.sqrt(1-l))}function zn(t,e){for(var i=0,n=t.length,r=t[n-1][0],o=t[n-1][1],s=0;s<n;s++){var a=t[s][0],l=t[s][1];i+=ze(a-r)*(2+Math.sin(ze(o))+Math.sin(ze(l))),r=a,o=l}return i*e*e/2}function Gn(t,e){var i=e||{},n=i.radius||6371008.8,r=i.projection||"EPSG:3857",o=t.getType();o!==An&&(t=t.clone().transform(r,"EPSG:4326"));var s,a,l,u,h,c,p=0;switch(o){case Pn:case Fn:case On:case jn:case Rn:break;case In:for(s=t.getCoordinates(),p=Math.abs(zn(s[0],n)),l=1,u=s.length;l<u;++l)p-=Math.abs(zn(s[l],n));break;case Mn:for(l=0,u=(s=t.getCoordinates()).length;l<u;++l)for(a=s[l],p+=Math.abs(zn(a[0],n)),h=1,c=a.length;h<c;++h)p-=Math.abs(zn(a[h],n));break;case An:var d=t.getGeometries();for(l=0,u=d.length;l<u;++l)p+=Gn(d[l],e);break;default:throw new Error("Unsupported geometry type: "+o)}return p}function Nn(t,e){var i,n,r=t[0],o=t[1],s=e[0],a=e[1],l=s[0],u=s[1],h=a[0],c=a[1],p=h-l,d=c-u,f=0===p&&0===d?0:(p*(r-l)+d*(o-u))/(p*p+d*d||0);return f<=0?(i=l,n=u):f>=1?(i=h,n=c):(i=l+f*p,n=u+f*d),[i,n]}function Bn(t,e){for(var i=!0,n=t.length-1;n>=0;--n)if(t[n]!=e[n]){i=!1;break}return i}function Wn(t,e){var i=Math.cos(e),n=Math.sin(e),r=t[0]*i-t[1]*n,o=t[1]*i+t[0]*n;return t[0]=r,t[1]=o,t}function qn(t,e){var i=t[0]-e[0],n=t[1]-e[1];return i*i+n*n}function Vn(t,e){return Math.sqrt(qn(t,e))}function Un(t,e){return qn(t,Nn(t,e))}function Xn(t,e){if(e.canWrapX()){var i=Cn(e.getExtent()),n=function(t,e,i){var n=e.getExtent(),r=0;if(e.canWrapX()&&(t[0]<n[0]||t[0]>n[2])){var o=i||Cn(n);r=Math.floor((t[0]-n[0])/o)}return r}(t,e,i);n&&(t[0]-=n*i)}return t}function Kn(t,e,i){var n;if(void 0!==e){for(var r=0,o=t.length;r<o;++r)e[r]=t[r];n=e}else n=t.slice();return n}function Yn(t,e,i){if(void 0!==e&&t!==e){for(var n=0,r=t.length;n<r;++n)e[n]=t[n];t=e}return t}function Zn(t){!function(t,e){Ai[t]=e}(t.getCode(),t),Di(t,t,Kn)}function Hn(t){return"string"==typeof t?Ai[e=t]||Ai[e.replace(/urn:(x-)?ogc:def:crs:EPSG:(.*:)?(\w+)$/,"EPSG:$3")]||null:t||null;var e}function $n(t,e,i,n){var r,o=(t=Hn(t)).getPointResolutionFunc();if(o){if(r=o(e,i),n&&n!==t.getUnits())(a=t.getMetersPerUnit())&&(r=r*a/vi[n])}else{var s=t.getUnits();if(s==_i.DEGREES&&!n||n==_i.DEGREES)r=e;else{var a,l=ir(t,Hn("EPSG:4326"));if(l===Yn&&s!==_i.DEGREES)r=e*t.getMetersPerUnit();else{var u=[i[0]-e/2,i[1],i[0]+e/2,i[1],i[0],i[1]-e/2,i[0],i[1]+e/2];r=(Dn((u=l(u,u,2)).slice(0,2),u.slice(2,4))+Dn(u.slice(4,6),u.slice(6,8)))/2}void 0!==(a=n?vi[n]:t.getMetersPerUnit())&&(r/=a)}}return r}function Jn(t){!function(t){t.forEach(Zn)}(t),t.forEach((function(e){t.forEach((function(t){e!==t&&Di(e,t,Kn)}))}))}function Qn(t,e){return t?"string"==typeof t?Hn(t):t:Hn(e)}function tr(t,e){return rr(t,"EPSG:4326",void 0!==e?e:"EPSG:3857")}function er(t,e){if(t===e)return!0;var i=t.getUnits()===e.getUnits();return(t.getCode()===e.getCode()||ir(t,e)===Kn)&&i}function ir(t,e){var i=function(t,e){var i;return t in Li&&e in Li[t]&&(i=Li[t][e]),i}(t.getCode(),e.getCode());return i||(i=Yn),i}function nr(t,e){return ir(Hn(t),Hn(e))}function rr(t,e,i){return nr(e,i)(t,void 0,t.length)}var or,sr,ar;function lr(t,e){return t}function ur(t,e){return t}function hr(t,e){return t}function cr(t,e){return t}Jn(ki),Jn(Mi),or=ki,sr=Pi,ar=Oi,Mi.forEach((function(t){or.forEach((function(e){Di(t,e,sr),Di(e,t,ar)}))}));var pr,dr=new Array(6);function fr(t){return gr(t,1,0,0,1,0,0)}function yr(t,e){var i=t[0],n=t[1],r=t[2],o=t[3],s=t[4],a=t[5],l=e[0],u=e[1],h=e[2],c=e[3],p=e[4],d=e[5];return t[0]=i*l+r*u,t[1]=n*l+o*u,t[2]=i*h+r*c,t[3]=n*h+o*c,t[4]=i*p+r*d+s,t[5]=n*p+o*d+a,t}function gr(t,e,i,n,r,o,s){return t[0]=e,t[1]=i,t[2]=n,t[3]=r,t[4]=o,t[5]=s,t}function mr(t,e){var i=e[0],n=e[1];return e[0]=t[0]*i+t[2]*n+t[4],e[1]=t[1]*i+t[3]*n+t[5],e}function vr(t,e,i){return yr(t,gr(dr,e,0,0,i,0,0))}function _r(t,e,i,n,r,o,s,a){var l=Math.sin(o),u=Math.cos(o);return t[0]=n*u,t[1]=r*l,t[2]=-n*l,t[3]=r*u,t[4]=s*n*u-a*n*l+e,t[5]=s*r*l+a*r*u+i,t}function xr(t,e){var i,n=(i=e)[0]*i[3]-i[1]*i[2];Fe(0!==n,32);var r=e[0],o=e[1],s=e[2],a=e[3],l=e[4],u=e[5];return t[0]=a/n,t[1]=-o/n,t[2]=-s/n,t[3]=r/n,t[4]=(s*u-a*l)/n,t[5]=-(r*u-o*l)/n,t}function br(t){var e="matrix("+t.join(", ")+")";if(ue)return e;var i=pr||(pr=document.createElement("div"));return i.style.transform=e,i.style.transform}var wr=/^#([a-f0-9]{3}|[a-f0-9]{4}(?:[a-f0-9]{2}){0,2})$/i,Sr=/^([a-z]*)$|^hsla?\(.*\)$/i;function Cr(t){return"string"==typeof t?t:Rr(t)}var Tr,Er,kr=(Tr={},Er=0,function(t){var e;if(Tr.hasOwnProperty(t))e=Tr[t];else{if(Er>=1024){var i=0;for(var n in Tr)0==(3&i++)&&(delete Tr[n],--Er)}e=function(t){var e,i,n,r,o;if(Sr.exec(t)&&(t=function(t){var e=document.createElement("div");if(e.style.color=t,""!==e.style.color){document.body.appendChild(e);var i=getComputedStyle(e).color;return document.body.removeChild(e),i}return""}(t)),wr.exec(t)){var s=t.length-1,a=void 0;a=s<=4?1:2;var l=4===s||8===s;e=parseInt(t.substr(1+0*a,a),16),i=parseInt(t.substr(1+1*a,a),16),n=parseInt(t.substr(1+2*a,a),16),r=l?parseInt(t.substr(1+3*a,a),16):255,1==a&&(e=(e<<4)+e,i=(i<<4)+i,n=(n<<4)+n,l&&(r=(r<<4)+r)),o=[e,i,n,r/255]}else 0==t.indexOf("rgba(")?Or(o=t.slice(5,-1).split(",").map(Number)):0==t.indexOf("rgb(")?((o=t.slice(4,-1).split(",").map(Number)).push(1),Or(o)):Fe(!1,14);return o}(t),Tr[t]=e,++Er}return e});function Pr(t){return Array.isArray(t)?t:kr(t)}function Or(t){return t[0]=je(t[0]+.5|0,0,255),t[1]=je(t[1]+.5|0,0,255),t[2]=je(t[2]+.5|0,0,255),t[3]=je(t[3],0,1),t}function Rr(t){var e=t[0];e!=(0|e)&&(e=e+.5|0);var i=t[1];i!=(0|i)&&(i=i+.5|0);var n=t[2];return n!=(0|n)&&(n=n+.5|0),"rgba("+e+","+i+","+n+","+(void 0===t[3]?1:t[3])+")"}function Ir(t,e,i){return e+":"+t+":"+(i?Cr(i):"null")}var Fr=new(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 i=this.cache_[e];0!=(3&t++)||i.hasListener()||(delete this.cache_[e],--this.cacheSize_)}}},t.prototype.get=function(t,e,i){var n=Ir(t,e,i);return n in this.cache_?this.cache_[n]:null},t.prototype.set=function(t,e,i,n){var r=Ir(t,e,i);this.cache_[r]=n,++this.cacheSize_},t.prototype.setSize=function(t){this.maxCacheSize_=t,this.expire()},t}()),jr=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}();function Mr(t,e){Fr.expire()}var Ar=function(t){function e(e){var i=t.call(this)||this;return i.map_=e,i}return jr(e,t),e.prototype.dispatchRenderEvent=function(t,e){Zt()},e.prototype.calculateMatrices2D=function(t){var e=t.viewState,i=t.coordinateToPixelTransform,n=t.pixelToCoordinateTransform;_r(i,t.size[0]/2,t.size[1]/2,1/e.resolution,-1/e.resolution,-e.rotation,-e.center[0],-e.center[1]),xr(n,i)},e.prototype.forEachFeatureAtCoordinate=function(t,e,i,n,r,o,s,a){var l,u=e.viewState;function h(t,e,i,n){return r.call(o,e,t?i:null,n)}var c=u.projection,p=Xn(t.slice(),c),d=[[0,0]];if(c.canWrapX()&&n){var f=Cn(c.getExtent());d.push([-f,0],[f,0])}for(var y=e.layerStatesArray,g=y.length,m=[],v=[],_=0;_<d.length;_++)for(var x=g-1;x>=0;--x){var b=y[x],w=b.layer;if(w.hasRenderer()&&$e(b,u)&&s.call(a,w)){var S=w.getRenderer(),C=w.getSource();if(S&&C){var T=C.getWrapX()?p:t,E=h.bind(null,b.managed);v[0]=T[0]+d[_][0],v[1]=T[1]+d[_][1],l=S.forEachFeatureAtCoordinate(v,e,i,E,m)}if(l)return l}}if(0!==m.length){var k=1/m.length;return m.forEach((function(t,e){return t.distanceSq+=e*k})),m.sort((function(t,e){return t.distanceSq-e.distanceSq})),m.some((function(t){return l=t.callback(t.feature,t.layer,t.geometry)})),l}},e.prototype.forEachLayerAtPixel=function(t,e,i,n,r){return Zt()},e.prototype.hasFeatureAtCoordinate=function(t,e,i,n,r,o){return void 0!==this.forEachFeatureAtCoordinate(t,e,i,n,bt,this,r,o)},e.prototype.getMap=function(){return this.map_},e.prototype.renderFrame=function(t){Zt()},e.prototype.scheduleExpireIconCache=function(t){Fr.canExpireCache()&&t.postRenderFunctions.push(Mr)},e}(yt),Lr=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}(),Dr=function(t){function e(e,i,n,r){var o=t.call(this,e)||this;return o.inversePixelTransform=i,o.frameState=n,o.context=r,o}return Lr(e,t),e}(dt),zr=[],Gr=[0,0,0,0],Nr=new te,Br=new Rt;Br.setSize=function(){console.warn("labelCache is deprecated.")};var Wr,qr,Vr=null,Ur={},Xr=function(){var t,e,i="32px ",n=["monospace","serif"],r=n.length,o="wmytzilWMYTZIL@#/&?$%10";function s(t,s,a){for(var l=!0,u=0;u<r;++u){var h=n[u];if(e=Zr(t+" "+s+" "+i+h,o),a!=h){var c=Zr(t+" "+s+" "+i+a+","+h,o);l=l&&c!=e}}return!!l}function a(){for(var e=!0,i=Nr.getKeys(),n=0,r=i.length;n<r;++n){var o=i[n];Nr.get(o)<100&&(s.apply(this,o.split("\n"))?(Tt(Ur),Vr=null,Wr=void 0,Nr.set(o,100)):(Nr.set(o,Nr.get(o)+1,!0),e=!1))}e&&(clearInterval(t),t=void 0)}return function(e){var i=_e(e);if(i)for(var n=i.families,r=0,o=n.length;r<o;++r){var l=n[r],u=i.style+"\n"+i.weight+"\n"+l;void 0===Nr.get(u)&&(Nr.set(u,100,!0),s(i.style,i.weight,l)||(Nr.set(u,0,!0),void 0===t&&(t=setInterval(a,32))))}}}(),Kr=function(t){var e=Ur[t];if(null==e){if(ue){var i=_e(t),n=Yr(t,"Žg");e=(isNaN(Number(i.lineHeight))?1.2:Number(i.lineHeight))*(n.actualBoundingBoxAscent+n.actualBoundingBoxDescent)}else qr||((qr=document.createElement("div")).innerHTML="M",qr.style.minHeight="0",qr.style.maxHeight="none",qr.style.height="auto",qr.style.padding="0",qr.style.border="none",qr.style.position="absolute",qr.style.display="block",qr.style.left="-99999px"),qr.style.font=t,document.body.appendChild(qr),e=qr.offsetHeight,document.body.removeChild(qr);Ur[t]=e}return e};function Yr(t,e){return Vr||(Vr=pe(1,1)),t!=Wr&&(Vr.font=t,Wr=Vr.font),Vr.measureText(e)}function Zr(t,e){return Yr(t,e).width}function Hr(t,e,i){if(e in i)return i[e];var n=Zr(t,e);return i[e]=n,n}function $r(t,e,i,n,r,o,s,a,l,u,h){t.save(),1!==i&&(t.globalAlpha*=i),e&&t.setTransform.apply(t,e),n.contextInstructions?(t.translate(l,u),t.scale(h[0],h[1]),function(t,e){for(var i=t.contextInstructions,n=0,r=i.length;n<r;n+=2)Array.isArray(i[n+1])?e[i[n]].apply(e,i[n+1]):e[i[n]]=i[n+1]}(n,t)):h[0]<0||h[1]<0?(t.translate(l,u),t.scale(h[0],h[1]),t.drawImage(n,r,o,s,a,0,0,s,a)):t.drawImage(n,r,o,s,a,l,u,s*h[0],a*h[1]),t.restore()}var Jr=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}(),Qr=function(t){function e(e){var i=t.call(this,e)||this;i.fontChangeListenerKey_=qt(Nr,ft,e.redrawText.bind(e)),i.element_=document.createElement("div");var n=i.element_.style;n.position="absolute",n.width="100%",n.height="100%",n.zIndex="0",i.element_.className="ol-unselectable ol-layers";var r=e.getViewport();return r.insertBefore(i.element_,r.firstChild||null),i.children_=[],i.renderedVisible_=!0,i}return Jr(e,t),e.prototype.dispatchRenderEvent=function(t,e){var i=this.getMap();if(i.hasListener(t)){var n=new Dr(t,void 0,e);i.dispatchEvent(n)}},e.prototype.disposeInternal=function(){Ut(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(Ue,t);var e=t.layerStatesArray.sort((function(t,e){return t.zIndex-e.zIndex})),i=t.viewState;this.children_.length=0;for(var n=[],r=null,o=0,s=e.length;o<s;++o){var a=e[o];if(t.layerIndex=o,$e(a,i)&&(a.sourceState==Ze||a.sourceState==Ye)){var l=a.layer,u=l.render(t,r);u&&(u!==r&&(this.children_.push(u),r=u),"getDeclutter"in l&&n.push(l))}}for(o=n.length-1;o>=0;--o)n[o].renderDeclutter(t);!function(t,e){for(var i=t.childNodes,n=0;;++n){var r=i[n],o=e[n];if(!r&&!o)break;r!==o&&(r?o?t.insertBefore(o,r):(t.removeChild(r),--n):t.appendChild(o))}}(this.element_,this.children_),this.dispatchRenderEvent(Xe,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,i,n,r){for(var o=e.viewState,s=e.layerStatesArray,a=s.length-1;a>=0;--a){var l=s[a],u=l.layer;if(u.hasRenderer()&&$e(l,o)&&r(u)){var h=u.getRenderer().getDataAtPixel(t,e,i);if(h){var c=n(u,h);if(c)return c}}}},e}(Ar),to="layergroup",eo="size",io="target",no="view",ro=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}(),oo="layers",so=function(t){function e(e){var i=this,n=e||{},r=Ct({},n);delete r.layers;var o=n.layers;return(i=t.call(this,r)||this).on,i.once,i.un,i.layersListenerKeys_=[],i.listenerKeys_={},i.addChangeListener(oo,i.handleLayersChanged_),o?Array.isArray(o)?o=new si(o.slice(),{unique:!0}):Fe("function"==typeof o.getArray,43):o=new si(void 0,{unique:!0}),i.setLayers(o),i}return ro(e,t),e.prototype.handleLayerChange_=function(){this.changed()},e.prototype.handleLayersChanged_=function(){this.layersListenerKeys_.forEach(Ut),this.layersListenerKeys_.length=0;var t=this.getLayers();for(var e in this.layersListenerKeys_.push(qt(t,ei,this.handleLayersAdd_,this),qt(t,ii,this.handleLayersRemove_,this)),this.listenerKeys_)this.listenerKeys_[e].forEach(Ut);Tt(this.listenerKeys_);for(var i=t.getArray(),n=0,r=i.length;n<r;n++){var o=i[n];this.listenerKeys_[$t(o)]=[qt(o,ft,this.handleLayerChange_,this),qt(o,It,this.handleLayerChange_,this)]}this.changed()},e.prototype.handleLayersAdd_=function(t){var e=t.element;this.listenerKeys_[$t(e)]=[qt(e,ft,this.handleLayerChange_,this),qt(e,It,this.handleLayerChange_,this)],this.changed()},e.prototype.handleLayersRemove_=function(t){var e=$t(t.element);this.listenerKeys_[e].forEach(Ut),delete this.listenerKeys_[e],this.changed()},e.prototype.getLayers=function(){return this.get(oo)},e.prototype.setLayers=function(t){this.set(oo,t)},e.prototype.getLayersArray=function(t){var e=void 0!==t?t:[];return this.getLayers().forEach((function(t){t.getLayersArray(e)})),e},e.prototype.getLayerStatesArray=function(t){var e=void 0!==t?t:[],i=e.length;this.getLayers().forEach((function(t){t.getLayerStatesArray(e)}));var n=this.getLayerState(),r=n.zIndex;t||void 0!==n.zIndex||(r=0);for(var o=i,s=e.length;o<s;o++){var a=e[o];a.opacity*=n.opacity,a.visible=a.visible&&n.visible,a.maxResolution=Math.min(a.maxResolution,n.maxResolution),a.minResolution=Math.max(a.minResolution,n.minResolution),a.minZoom=Math.max(a.minZoom,n.minZoom),a.maxZoom=Math.min(a.maxZoom,n.maxZoom),void 0!==n.extent&&(void 0!==a.extent?a.extent=bn(a.extent,n.extent):a.extent=n.extent),void 0===a.zIndex&&(a.zIndex=r)}return e},e.prototype.getSourceState=function(){return Ze},e}(We),ao=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}(),lo=function(t){function e(e,i,n){var r=t.call(this,e)||this;return r.map=i,r.frameState=void 0!==n?n:null,r}return ao(e,t),e}(dt),uo=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}(),ho=function(t){function e(e,i,n,r,o){var s=t.call(this,e,i,o)||this;return s.originalEvent=n,s.pixel_=null,s.coordinate_=null,s.dragging=void 0!==r&&r,s}return uo(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}(lo),co={SINGLECLICK:"singleclick",CLICK:At,DBLCLICK:Lt,POINTERDRAG:"pointerdrag",POINTERMOVE:"pointermove",POINTERDOWN:"pointerdown",POINTERUP:"pointerup",POINTEROVER:"pointerover",POINTEROUT:"pointerout",POINTERENTER:"pointerenter",POINTERLEAVE:"pointerleave",POINTERCANCEL:"pointercancel"},po=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}(),fo=function(t){function e(e,i){var n=t.call(this,e)||this;n.map_=e,n.clickTimeoutId_,n.emulateClicks_=!1,n.dragging_=!1,n.dragListenerKeys_=[],n.moveTolerance_=void 0===i?1:i,n.down_=null;var r=n.map_.getViewport();return n.activePointers_=0,n.trackedTouches_={},n.element_=r,n.pointerdownListenerKey_=qt(r,gi,n.handlePointerDown_,n),n.originalPointerMoveEvent_,n.relayedListenerKey_=qt(r,yi,n.relayEvent_,n),n.boundHandleTouchMove_=n.handleTouchMove_.bind(n),n.element_.addEventListener(Bt,n.boundHandleTouchMove_,!!ce&&{passive:!1}),n}return po(e,t),e.prototype.emulateClick_=function(t){var e=new ho(co.CLICK,this.map_,t);this.dispatchEvent(e),void 0!==this.clickTimeoutId_?(clearTimeout(this.clickTimeoutId_),this.clickTimeoutId_=void 0,e=new ho(co.DBLCLICK,this.map_,t),this.dispatchEvent(e)):this.clickTimeoutId_=setTimeout(function(){this.clickTimeoutId_=void 0;var e=new ho(co.SINGLECLICK,this.map_,t);this.dispatchEvent(e)}.bind(this),250)},e.prototype.updateActivePointers_=function(t){var e=t;e.type==co.POINTERUP||e.type==co.POINTERCANCEL?delete this.trackedTouches_[e.pointerId]:e.type==co.POINTERDOWN&&(this.trackedTouches_[e.pointerId]=!0),this.activePointers_=Object.keys(this.trackedTouches_).length},e.prototype.handlePointerUp_=function(t){this.updateActivePointers_(t);var e=new ho(co.POINTERUP,this.map_,t);this.dispatchEvent(e),this.emulateClicks_&&!e.defaultPrevented&&!this.dragging_&&this.isMouseActionButton_(t)&&this.emulateClick_(this.down_),0===this.activePointers_&&(this.dragListenerKeys_.forEach(Ut),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_,this.updateActivePointers_(t);var e=new ho(co.POINTERDOWN,this.map_,t);for(var i in this.dispatchEvent(e),this.down_={},t){var n=t[i];this.down_[i]="function"==typeof n?St:n}if(0===this.dragListenerKeys_.length){var r=this.map_.getOwnerDocument();this.dragListenerKeys_.push(qt(r,co.POINTERMOVE,this.handlePointerMove_,this),qt(r,co.POINTERUP,this.handlePointerUp_,this),qt(this.element_,co.POINTERCANCEL,this.handlePointerUp_,this)),this.element_.getRootNode&&this.element_.getRootNode()!==r&&this.dragListenerKeys_.push(qt(this.element_.getRootNode(),co.POINTERUP,this.handlePointerUp_,this))}},e.prototype.handlePointerMove_=function(t){if(this.isMoving_(t)){this.dragging_=!0;var e=new ho(co.POINTERDRAG,this.map_,t,this.dragging_);this.dispatchEvent(e)}},e.prototype.relayEvent_=function(t){this.originalPointerMoveEvent_=t;var e=!(!this.down_||!this.isMoving_(t));this.dispatchEvent(new ho(t.type,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_&&(Ut(this.relayedListenerKey_),this.relayedListenerKey_=null),this.element_.removeEventListener(Bt,this.boundHandleTouchMove_),this.pointerdownListenerKey_&&(Ut(this.pointerdownListenerKey_),this.pointerdownListenerKey_=null),this.dragListenerKeys_.forEach(Ut),this.dragListenerKeys_.length=0,this.element_=null,t.prototype.disposeInternal.call(this)},e}(Rt),yo=1/0,go=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,Tt(this.queuedElements_)},t.prototype.dequeue=function(){var t=this.elements_,e=this.priorities_,i=t[0];1==t.length?(t.length=0,e.length=0):(t[0]=t.pop(),e[0]=e.pop(),this.siftUp_(0));var n=this.keyFunction_(i);return delete this.queuedElements_[n],i},t.prototype.enqueue=function(t){Fe(!(this.keyFunction_(t)in this.queuedElements_),31);var e=this.priorityFunction_(t);return e!=yo&&(this.elements_.push(t),this.priorities_.push(e),this.queuedElements_[this.keyFunction_(t)]=!0,this.siftDown_(0,this.elements_.length-1),!0)},t.prototype.getCount=function(){return this.elements_.length},t.prototype.getLeftChildIndex_=function(t){return 2*t+1},t.prototype.getRightChildIndex_=function(t){return 2*t+2},t.prototype.getParentIndex_=function(t){return t-1>>1},t.prototype.heapify_=function(){var t;for(t=(this.elements_.length>>1)-1;t>=0;t--)this.siftUp_(t)},t.prototype.isEmpty=function(){return 0===this.elements_.length},t.prototype.isKeyQueued=function(t){return t in this.queuedElements_},t.prototype.isQueued=function(t){return this.isKeyQueued(this.keyFunction_(t))},t.prototype.siftUp_=function(t){for(var e=this.elements_,i=this.priorities_,n=e.length,r=e[t],o=i[t],s=t;t<n>>1;){var a=this.getLeftChildIndex_(t),l=this.getRightChildIndex_(t),u=l<n&&i[l]<i[a]?l:a;e[t]=e[u],i[t]=i[u],t=u}e[t]=r,i[t]=o,this.siftDown_(s,t)},t.prototype.siftDown_=function(t,e){for(var i=this.elements_,n=this.priorities_,r=i[e],o=n[e];e>t;){var s=this.getParentIndex_(e);if(!(n[s]>o))break;i[e]=i[s],n[e]=n[s],e=s}i[e]=r,n[e]=o},t.prototype.reprioritize=function(){var t,e,i,n=this.priorityFunction_,r=this.elements_,o=this.priorities_,s=0,a=r.length;for(e=0;e<a;++e)(i=n(t=r[e]))==yo?delete this.queuedElements_[this.keyFunction_(t)]:(o[s]=i,r[s++]=t);r.length=s,o.length=s,this.heapify_()},t}(),mo=0,vo=1,_o=2,xo=3,bo=4,wo=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}(),So=function(t){function e(e,i){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_=i,n.tilesLoading_=0,n.tilesLoadingKeys_={},n}return wo(e,t),e.prototype.enqueue=function(e){var i=t.prototype.enqueue.call(this,e);i&&e[0].addEventListener(It,this.boundHandleTileChange_);return i},e.prototype.getTilesLoading=function(){return this.tilesLoading_},e.prototype.handleTileChange=function(t){var e=t.target,i=e.getState();if(i===_o||i===xo||i===bo){e.removeEventListener(It,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 i,n,r=0;this.tilesLoading_<t&&r<e&&this.getCount()>0;)n=(i=this.dequeue()[0]).getKey(),i.getState()!==mo||n in this.tilesLoadingKeys_||(this.tilesLoadingKeys_[n]=!0,++this.tilesLoading_,++r,i.load())},e}(go);var Co=0,To=1,Eo="center",ko="resolution",Po="rotation";function Oo(t,e,i){return function(n,r,o,s,a){if(n){var l=e?0:o[0]*r,u=e?0:o[1]*r,h=a?a[0]:0,c=a?a[1]:0,p=t[0]+l/2+h,d=t[2]-l/2+h,f=t[1]+u/2+c,y=t[3]-u/2+c;p>d&&(d=p=(d+p)/2),f>y&&(y=f=(y+f)/2);var g=je(n[0],p,d),m=je(n[1],f,y),v=30*r;return s&&i&&(g+=-v*Math.log(1+Math.max(0,p-n[0])/v)+v*Math.log(1+Math.max(0,n[0]-d)/v),m+=-v*Math.log(1+Math.max(0,f-n[1])/v)+v*Math.log(1+Math.max(0,n[1]-y)/v)),[g,m]}}}function Ro(t){return t}function Io(t,e,i,n){var r=Cn(e)/i[0],o=xn(e)/i[1];return n?Math.min(t,Math.max(r,o)):Math.min(t,Math.min(r,o))}function Fo(t,e,i){var n=Math.min(t,e);return n*=Math.log(1+50*Math.max(0,t/e-1))/50+1,i&&(n=Math.max(n,i),n/=Math.log(1+50*Math.max(0,i/t-1))/50+1),je(n,i/2,2*e)}function jo(t,e,i,n,r){return function(o,s,a,l){if(void 0!==o){var u=n?Io(t,n,a,r):t;return(void 0===i||i)&&l?Fo(o,u,e):je(o,e,u)}}}function Mo(t){return void 0!==t?0:void 0}function Ao(t){return void 0!==t?t:void 0}var Lo="XY",Do="XYZ",zo="XYM",Go="XYZM";function No(t,e,i,n,r,o){for(var s=o||[],a=0,l=e;l<i;l+=n){var u=t[l],h=t[l+1];s[a++]=r[0]*u+r[2]*h+r[4],s[a++]=r[1]*u+r[3]*h+r[5]}return o&&s.length!=a&&(s.length=a),s}function Bo(t,e,i,n,r,o,s){for(var a=s||[],l=Math.cos(r),u=Math.sin(r),h=o[0],c=o[1],p=0,d=e;d<i;d+=n){var f=t[d]-h,y=t[d+1]-c;a[p++]=h+f*l-y*u,a[p++]=c+f*u+y*l;for(var g=d+2;g<d+n;++g)a[p++]=t[g]}return s&&a.length!=p&&(a.length=p),a}function Wo(t,e,i,n,r,o,s){for(var a=s||[],l=0,u=e;u<i;u+=n){a[l++]=t[u]+r,a[l++]=t[u+1]+o;for(var h=u+2;h<u+n;++h)a[l++]=t[h]}return s&&a.length!=l&&(a.length=l),a}var qo=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}(),Vo=[1,0,0,1,0,0],Uo=function(t){function e(){var e,i,n,r,o,s=t.call(this)||this;return s.extent_=[1/0,1/0,-1/0,-1/0],s.extentRevision_=-1,s.simplifiedGeometryMaxMinSquaredTolerance=0,s.simplifiedGeometryRevision=0,s.simplifyTransformedInternal=(e=function(t,e,i){if(!i)return this.getSimplifiedGeometry(e);var n=this.clone();return n.applyTransform(i),n.getSimplifiedGeometry(e)},o=!1,function(){var t=Array.prototype.slice.call(arguments);return o&&this===r&&xt(t,n)||(o=!0,r=this,n=t,i=e.apply(this,arguments)),i}),s}return qo(e,t),e.prototype.simplifyTransformed=function(t,e){return this.simplifyTransformedInternal(this.getRevision(),t,e)},e.prototype.clone=function(){return Zt()},e.prototype.closestPointXY=function(t,e,i,n){return Zt()},e.prototype.containsXY=function(t,e){var i=this.getClosestPoint([t,e]);return i[0]===t&&i[1]===e},e.prototype.getClosestPoint=function(t,e){var i=e||[NaN,NaN];return this.closestPointXY(t[0],t[1],i,1/0),i},e.prototype.intersectsCoordinate=function(t){return this.containsXY(t[0],t[1])},e.prototype.computeExtent=function(t){return Zt()},e.prototype.getExtent=function(t){if(this.extentRevision_!=this.getRevision()){var e=this.computeExtent(this.extent_);(isNaN(e[0])||isNaN(e[1]))&&on(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){Zt()},e.prototype.scale=function(t,e,i){Zt()},e.prototype.simplify=function(t){return this.getSimplifiedGeometry(t*t)},e.prototype.getSimplifiedGeometry=function(t){return Zt()},e.prototype.getType=function(){return Zt()},e.prototype.applyTransform=function(t){Zt()},e.prototype.intersectsExtent=function(t){return Zt()},e.prototype.translate=function(t,e){Zt()},e.prototype.transform=function(t,e){var i=Hn(t),n=i.getUnits()==_i.TILE_PIXELS?function(t,n,r){var o=i.getExtent(),s=i.getWorldExtent(),a=xn(s)/xn(o);return _r(Vo,s[0],s[3],a,-a,0,0,0),No(t,0,t.length,r,Vo,n),nr(i,e)(t,n,r)}:nr(i,e);return this.applyTransform(n),this},e}(te),Xo=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}();function Ko(t){var e;return t==Lo?e=2:t==Do||t==zo?e=3:t==Go&&(e=4),e}var Yo=function(t){function e(){var e=t.call(this)||this;return e.layout=Lo,e.stride=2,e.flatCoordinates=null,e}return Xo(e,t),e.prototype.computeExtent=function(t){return an(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,t)},e.prototype.getCoordinates=function(){return Zt()},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=Ko(t),this.layout=t,this.flatCoordinates=e},e.prototype.setCoordinates=function(t,e){Zt()},e.prototype.setLayout=function(t,e,i){var n;if(t)n=Ko(t);else{for(var r=0;r<i;++r){if(0===e.length)return this.layout=Lo,void(this.stride=2);e=e[0]}t=function(t){var e;2==t?e=Lo:3==t?e=Do:4==t&&(e=Go);return e}(n=e.length)}this.layout=t,this.stride=n},e.prototype.applyTransform=function(t){this.flatCoordinates&&(t(this.flatCoordinates,this.flatCoordinates,this.stride),this.changed())},e.prototype.rotate=function(t,e){var i=this.getFlatCoordinates();if(i){var n=this.getStride();Bo(i,0,i.length,n,t,e,i),this.changed()}},e.prototype.scale=function(t,e,i){var n=e;void 0===n&&(n=t);var r=i;r||(r=mn(this.getExtent()));var o=this.getFlatCoordinates();if(o){var s=this.getStride();!function(t,e,i,n,r,o,s,a){for(var l=a||[],u=s[0],h=s[1],c=0,p=e;p<i;p+=n){var d=t[p]-u,f=t[p+1]-h;l[c++]=u+r*d,l[c++]=h+o*f;for(var y=p+2;y<p+n;++y)l[c++]=t[y]}a&&l.length!=c&&(l.length=c)}(o,0,o.length,s,t,n,r,o),this.changed()}},e.prototype.translate=function(t,e){var i=this.getFlatCoordinates();if(i){var n=this.getStride();Wo(i,0,i.length,n,t,e,i),this.changed()}},e}(Uo);function Zo(t,e,i,n,r,o,s){var a,l=t[e],u=t[e+1],h=t[i]-l,c=t[i+1]-u;if(0===h&&0===c)a=e;else{var p=((r-l)*h+(o-u)*c)/(h*h+c*c);if(p>1)a=i;else{if(p>0){for(var d=0;d<n;++d)s[d]=Ne(t[e+d],t[i+d],p);return void(s.length=n)}a=e}}for(d=0;d<n;++d)s[d]=t[a+d];s.length=n}function Ho(t,e,i,n,r){var o=t[e],s=t[e+1];for(e+=n;e<i;e+=n){var a=t[e],l=t[e+1],u=De(o,s,a,l);u>r&&(r=u),o=a,s=l}return r}function $o(t,e,i,n,r){for(var o=0,s=i.length;o<s;++o){var a=i[o];r=Ho(t,e,a,n,r),e=a}return r}function Jo(t,e,i,n,r,o,s,a,l,u,h){if(e==i)return u;var c,p;if(0===r){if((p=De(s,a,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 d=h||[NaN,NaN],f=e+n;f<i;)if(Zo(t,f-n,f,n,s,a,d),(p=De(s,a,d[0],d[1]))<u){for(u=p,c=0;c<n;++c)l[c]=d[c];l.length=n,f+=n}else f+=n*Math.max((Math.sqrt(p)-Math.sqrt(u))/r|0,1);if(o&&(Zo(t,i-n,e,n,s,a,d),(p=De(s,a,d[0],d[1]))<u)){for(u=p,c=0;c<n;++c)l[c]=d[c];l.length=n}return u}function Qo(t,e,i,n,r,o,s,a,l,u,h){for(var c=h||[NaN,NaN],p=0,d=i.length;p<d;++p){var f=i[p];u=Jo(t,e,f,n,r,o,s,a,l,u,c),e=f}return u}function ts(t,e,i,n){for(var r=0,o=i.length;r<o;++r)t[e++]=i[r];return e}function es(t,e,i,n){for(var r=0,o=i.length;r<o;++r)for(var s=i[r],a=0;a<n;++a)t[e++]=s[a];return e}function is(t,e,i,n,r){for(var o=r||[],s=0,a=0,l=i.length;a<l;++a){var u=es(t,e,i[a],n);o[s++]=u,e=u}return o.length=s,o}function ns(t,e,i,n,r,o,s){var a=(i-e)/n;if(a<3){for(;e<i;e+=n)o[s++]=t[e],o[s++]=t[e+1];return s}var l=new Array(a);l[0]=1,l[a-1]=1;for(var u=[e,i-n],h=0;u.length>0;){for(var c=u.pop(),p=u.pop(),d=0,f=t[p],y=t[p+1],g=t[c],m=t[c+1],v=p+n;v<c;v+=n){var _=Le(t[v],t[v+1],f,y,g,m);_>d&&(h=v,d=_)}d>r&&(l[(h-e)/n]=1,p+n<h&&u.push(p,h),h+n<c&&u.push(h,c))}for(v=0;v<a;++v)l[v]&&(o[s++]=t[e+v*n],o[s++]=t[e+v*n+1]);return s}function rs(t,e){return e*Math.round(t/e)}function os(t,e,i,n,r,o,s){if(e==i)return s;var a,l,u=rs(t[e],r),h=rs(t[e+1],r);e+=n,o[s++]=u,o[s++]=h;do{if(a=rs(t[e],r),l=rs(t[e+1],r),(e+=n)==i)return o[s++]=a,o[s++]=l,s}while(a==u&&l==h);for(;e<i;){var c=rs(t[e],r),p=rs(t[e+1],r);if(e+=n,c!=a||p!=l){var d=a-u,f=l-h,y=c-u,g=p-h;d*g==f*y&&(d<0&&y<d||d==y||d>0&&y>d)&&(f<0&&g<f||f==g||f>0&&g>f)?(a=c,l=p):(o[s++]=a,o[s++]=l,u=a,h=l,a=c,l=p)}}return o[s++]=a,o[s++]=l,s}function ss(t,e,i,n,r,o,s,a){for(var l=0,u=i.length;l<u;++l){var h=i[l];s=os(t,e,h,n,r,o,s),a.push(s),e=h}return s}function as(t,e,i,n,r){for(var o=void 0!==r?r:[],s=0,a=e;a<i;a+=n)o[s++]=t.slice(a,a+n);return o.length=s,o}function ls(t,e,i,n,r){for(var o=void 0!==r?r:[],s=0,a=0,l=i.length;a<l;++a){var u=i[a];o[s++]=as(t,e,u,n,o[s]),e=u}return o.length=s,o}function us(t,e,i,n,r){for(var o=void 0!==r?r:[],s=0,a=0,l=i.length;a<l;++a){var u=i[a];o[s++]=ls(t,e,u,n,o[s]),e=u[u.length-1]}return o.length=s,o}function hs(t,e,i,n){for(var r=0,o=t[i-n],s=t[i-n+1];e<i;e+=n){var a=t[e],l=t[e+1];r+=s*a-o*l,o=a,s=l}return r/2}function cs(t,e,i,n){for(var r=0,o=0,s=i.length;o<s;++o){var a=i[o];r+=hs(t,e,a,n),e=a}return r}var ps=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}(),ds=function(t){function e(e,i){var n=t.call(this)||this;return n.maxDelta_=-1,n.maxDeltaRevision_=-1,void 0===i||Array.isArray(e[0])?n.setCoordinates(e,i):n.setFlatCoordinates(i,e),n}return ps(e,t),e.prototype.clone=function(){return new e(this.flatCoordinates.slice(),this.layout)},e.prototype.closestPointXY=function(t,e,i,n){return n<$i(this.getExtent(),t,e)?n:(this.maxDeltaRevision_!=this.getRevision()&&(this.maxDelta_=Math.sqrt(Ho(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,0)),this.maxDeltaRevision_=this.getRevision()),Jo(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,this.maxDelta_,!0,t,e,i,n))},e.prototype.getArea=function(){return hs(this.flatCoordinates,0,this.flatCoordinates.length,this.stride)},e.prototype.getCoordinates=function(){return as(this.flatCoordinates,0,this.flatCoordinates.length,this.stride)},e.prototype.getSimplifiedGeometryInternal=function(t){var i=[];return i.length=ns(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,t,i,0),new e(i,Lo)},e.prototype.getType=function(){return Rn},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=es(this.flatCoordinates,0,t,this.stride),this.changed()},e}(Yo),fs=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}(),ys=function(t){function e(e,i){var n=t.call(this)||this;return n.setCoordinates(e,i),n}return fs(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,i,n){var r=this.flatCoordinates,o=De(t,e,r[0],r[1]);if(o<n){for(var s=this.stride,a=0;a<s;++a)i[a]=r[a];return i.length=s,o}return n},e.prototype.getCoordinates=function(){return this.flatCoordinates?this.flatCoordinates.slice():[]},e.prototype.computeExtent=function(t){return sn(this.flatCoordinates,t)},e.prototype.getType=function(){return Pn},e.prototype.intersectsExtent=function(t){return tn(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=ts(this.flatCoordinates,0,t,this.stride),this.changed()},e}(Yo);function gs(t,e,i,n,r){return!dn(r,(function(r){return!ms(t,e,i,n,r[0],r[1])}))}function ms(t,e,i,n,r,o){for(var s=0,a=t[i-n],l=t[i-n+1];e<i;e+=n){var u=t[e],h=t[e+1];l<=o?h>o&&(u-a)*(o-l)-(r-a)*(h-l)>0&&s++:h<=o&&(u-a)*(o-l)-(r-a)*(h-l)<0&&s--,a=u,l=h}return 0!==s}function vs(t,e,i,n,r,o){if(0===i.length)return!1;if(!ms(t,e,i[0],n,r,o))return!1;for(var s=1,a=i.length;s<a;++s)if(ms(t,i[s-1],i[s],n,r,o))return!1;return!0}function _s(t,e,i,n,r,o,s){for(var a,l,u,h,c,p,d,f=r[o+1],y=[],g=0,m=i.length;g<m;++g){var v=i[g];for(h=t[v-n],p=t[v-n+1],a=e;a<v;a+=n)c=t[a],d=t[a+1],(f<=p&&d<=f||p<=f&&f<=d)&&(u=(f-p)/(d-p)*(c-h)+h,y.push(u)),h=c,p=d}var _=NaN,x=-1/0;for(y.sort(gt),h=y[0],a=1,l=y.length;a<l;++a){c=y[a];var b=Math.abs(c-h);b>x&&vs(t,e,i,n,u=(h+c)/2,f)&&(_=u,x=b),h=c}return isNaN(_)&&(_=r[o]),s?(s.push(_,f,x),s):[_,f,x]}function xs(t,e,i,n,r){for(var o=[],s=0,a=i.length;s<a;++s){var l=i[s];o=_s(t,e,l,n,r,2*s,o),e=l[l.length-1]}return o}function bs(t,e,i,n,r){var o;for(e+=n;e<i;e+=n)if(o=r(t.slice(e-n,e),t.slice(e,e+n)))return o;return!1}function ws(t,e,i,n,r){var o=cn([1/0,1/0,-1/0,-1/0],t,e,i,n);return!!Tn(r,o)&&(!!Qi(r,o)||(o[0]>=r[0]&&o[2]<=r[2]||(o[1]>=r[1]&&o[3]<=r[3]||bs(t,e,i,n,(function(t,e){return function(t,e,i){var n=!1,r=en(t,e),o=en(t,i);if(r===qi||o===qi)n=!0;else{var s=t[0],a=t[1],l=t[2],u=t[3],h=e[0],c=e[1],p=i[0],d=i[1],f=(d-c)/(p-h),y=void 0,g=void 0;o&Vi&&!(r&Vi)&&(n=(y=p-(d-u)/f)>=s&&y<=l),n||!(o&Ui)||r&Ui||(n=(g=d-(p-l)*f)>=a&&g<=u),n||!(o&Xi)||r&Xi||(n=(y=p-(d-a)/f)>=s&&y<=l),n||!(o&Ki)||r&Ki||(n=(g=d-(p-s)*f)>=a&&g<=u)}return n}(r,t,e)})))))}function Ss(t,e,i,n,r){if(!function(t,e,i,n,r){return!!(ws(t,e,i,n,r)||ms(t,e,i,n,r[0],r[1])||ms(t,e,i,n,r[0],r[3])||ms(t,e,i,n,r[2],r[1])||ms(t,e,i,n,r[2],r[3]))}(t,e,i[0],n,r))return!1;if(1===i.length)return!0;for(var o=1,s=i.length;o<s;++o)if(gs(t,i[o-1],i[o],n,r)&&!ws(t,i[o-1],i[o],n,r))return!1;return!0}function Cs(t,e,i,n){for(;e<i-n;){for(var r=0;r<n;++r){var o=t[e+r];t[e+r]=t[i-n+r],t[i-n+r]=o}e+=n,i-=n}}function Ts(t,e,i,n){for(var r=0,o=t[i-n],s=t[i-n+1];e<i;e+=n){var a=t[e],l=t[e+1];r+=(a-o)*(l+s),o=a,s=l}return 0===r?void 0:r>0}function Es(t,e,i,n,r){for(var o=void 0!==r&&r,s=0,a=i.length;s<a;++s){var l=i[s],u=Ts(t,e,l,n);if(0===s){if(o&&u||!o&&!u)return!1}else if(o&&!u||!o&&u)return!1;e=l}return!0}function ks(t,e,i,n,r){for(var o=void 0!==r&&r,s=0,a=i.length;s<a;++s){var l=i[s],u=Ts(t,e,l,n);(0===s?o&&u||!o&&!u:o&&!u||!o&&u)&&Cs(t,e,l,n),e=l}return e}function Ps(t,e,i,n,r){for(var o=0,s=i.length;o<s;++o)e=ks(t,e,i[o],n,r);return e}var Os=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}(),Rs=function(t){function e(e,i,n){var r=t.call(this)||this;return r.ends_=[],r.flatInteriorPointRevision_=-1,r.flatInteriorPoint_=null,r.maxDelta_=-1,r.maxDeltaRevision_=-1,r.orientedRevision_=-1,r.orientedFlatCoordinates_=null,void 0!==i&&n?(r.setFlatCoordinates(i,e),r.ends_=n):r.setCoordinates(e,i),r}return Os(e,t),e.prototype.appendLinearRing=function(t){this.flatCoordinates?_t(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,i,n){return n<$i(this.getExtent(),t,e)?n:(this.maxDeltaRevision_!=this.getRevision()&&(this.maxDelta_=Math.sqrt($o(this.flatCoordinates,0,this.ends_,this.stride,0)),this.maxDeltaRevision_=this.getRevision()),Qo(this.flatCoordinates,0,this.ends_,this.stride,this.maxDelta_,!0,t,e,i,n))},e.prototype.containsXY=function(t,e){return vs(this.getOrientedFlatCoordinates(),0,this.ends_,this.stride,t,e)},e.prototype.getArea=function(){return cs(this.getOrientedFlatCoordinates(),0,this.ends_,this.stride)},e.prototype.getCoordinates=function(t){var e;return void 0!==t?ks(e=this.getOrientedFlatCoordinates().slice(),0,this.ends_,this.stride,t):e=this.flatCoordinates,ls(e,0,this.ends_,this.stride)},e.prototype.getEnds=function(){return this.ends_},e.prototype.getFlatInteriorPoint=function(){if(this.flatInteriorPointRevision_!=this.getRevision()){var t=mn(this.getExtent());this.flatInteriorPoint_=_s(this.getOrientedFlatCoordinates(),0,this.ends_,this.stride,t,0),this.flatInteriorPointRevision_=this.getRevision()}return this.flatInteriorPoint_},e.prototype.getInteriorPoint=function(){return new ys(this.getFlatInteriorPoint(),zo)},e.prototype.getLinearRingCount=function(){return this.ends_.length},e.prototype.getLinearRing=function(t){return t<0||this.ends_.length<=t?null:new ds(this.flatCoordinates.slice(0===t?0:this.ends_[t-1],this.ends_[t]),this.layout)},e.prototype.getLinearRings=function(){for(var t=this.layout,e=this.flatCoordinates,i=this.ends_,n=[],r=0,o=0,s=i.length;o<s;++o){var a=i[o],l=new ds(e.slice(r,a),t);n.push(l),r=a}return n},e.prototype.getOrientedFlatCoordinates=function(){if(this.orientedRevision_!=this.getRevision()){var t=this.flatCoordinates;Es(t,0,this.ends_,this.stride)?this.orientedFlatCoordinates_=t:(this.orientedFlatCoordinates_=t.slice(),this.orientedFlatCoordinates_.length=ks(this.orientedFlatCoordinates_,0,this.ends_,this.stride)),this.orientedRevision_=this.getRevision()}return this.orientedFlatCoordinates_},e.prototype.getSimplifiedGeometryInternal=function(t){var i=[],n=[];return i.length=ss(this.flatCoordinates,0,this.ends_,this.stride,Math.sqrt(t),i,0,n),new e(i,Lo,n)},e.prototype.getType=function(){return In},e.prototype.intersectsExtent=function(t){return Ss(this.getOrientedFlatCoordinates(),0,this.ends_,this.stride,t)},e.prototype.setCoordinates=function(t,e){this.setLayout(e,t,2),this.flatCoordinates||(this.flatCoordinates=[]);var i=is(this.flatCoordinates,0,t,this.stride,this.ends_);this.flatCoordinates.length=0===i.length?0:i[i.length-1],this.changed()},e}(Yo),Is=Rs;function Fs(t){var e=t[0],i=t[1],n=t[2],r=t[3],o=[e,i,e,r,n,r,n,i,e,i];return new Rs(o,Lo,[o.length])}function js(t,e,i){for(var n=e||32,r=t.getStride(),o=t.getLayout(),s=t.getCenter(),a=r*(n+1),l=new Array(a),u=0;u<a;u+=r){l[u]=0,l[u+1]=0;for(var h=2;h<r;h++)l[u+h]=s[h]}var c=[l.length],p=new Rs(l,o,c);return function(t,e,i,n){for(var r=t.getFlatCoordinates(),o=t.getStride(),s=r.length/o-1,a=n||0,l=0;l<=s;++l){var u=l*o,h=a+2*Ge(l,s)*Math.PI/s;r[u]=e[0]+i*Math.cos(h),r[u+1]=e[1]+i*Math.sin(h)}t.changed()}(p,s,t.getRadius(),i),p}var Ms=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}();function As(t,e){setTimeout((function(){t(e)}),0)}function Ls(t){return!(t.sourceCenter&&t.targetCenter&&!Bn(t.sourceCenter,t.targetCenter))&&(t.sourceResolution===t.targetResolution&&t.sourceRotation===t.targetRotation)}function Ds(t,e,i,n,r){var o=Math.cos(-r),s=Math.sin(-r),a=t[0]*o-t[1]*s,l=t[1]*o+t[0]*s;return[(a+=(e[0]/2-i[0])*n)*o-(l+=(i[1]-e[1]/2)*n)*(s=-s),l*o+a*s]}var zs=function(t){function e(e){var i=t.call(this)||this;i.on,i.once,i.un;var n=Ct({},e);return i.hints_=[0,0],i.animations_=[],i.updateAnimationKey_,i.projection_=Qn(n.projection,"EPSG:3857"),i.viewportSize_=[100,100],i.targetCenter_=null,i.targetResolution_,i.targetRotation_,i.nextCenter_=null,i.nextResolution_,i.nextRotation_,i.cancelAnchor_=void 0,n.center&&(n.center=ur(n.center,i.projection_)),n.extent&&(n.extent=cr(n.extent,i.projection_)),i.applyOptions_(n),i}return Ms(e,t),e.prototype.applyOptions_=function(t){var e=function(t){var e,i,n,r=28,o=2,s=void 0!==t.minZoom?t.minZoom:0,a=void 0!==t.maxZoom?t.maxZoom:r,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=Qn(t.projection,"EPSG:3857"),d=p.getExtent(),f=t.constrainOnlyCenter,y=t.extent;u||y||!p.isGlobal()||(f=!1,y=d);if(void 0!==t.resolutions){var g=t.resolutions;i=g[s],n=void 0!==g[a]?g[a]:g[g.length-1],e=t.constrainResolution?function(t,e,i,n){return function(r,o,s,a){if(void 0!==r){var l=t[0],u=t[t.length-1],h=i?Io(l,i,s,n):l;if(a)return void 0===e||e?Fo(r,h,u):je(r,u,h);var c=Math.min(h,r),p=Math.floor(mt(t,c,o));return t[p]>h&&p<t.length-1?t[p+1]:t[p]}}}(g,h,!f&&y,c):jo(i,n,h,!f&&y,c)}else{var m=(d?Math.max(Cn(d),xn(d)):360*vi[_i.DEGREES]/p.getMetersPerUnit())/256/Math.pow(o,0),v=m/Math.pow(o,r-0);void 0!==(i=t.maxResolution)?s=0:i=m/Math.pow(l,s),void 0===(n=t.minResolution)&&(n=void 0!==t.maxZoom?void 0!==t.maxResolution?i/Math.pow(l,a):m/Math.pow(l,a):v),a=s+Math.floor(Math.log(i/n)/Math.log(l)),n=i/Math.pow(l,a-s),e=t.constrainResolution?function(t,e,i,n,r,o){return function(s,a,l,u){if(void 0!==s){var h=r?Io(e,r,l,o):e,c=void 0!==i?i:0;if(u)return void 0===n||n?Fo(s,h,c):je(s,c,h);var p=Math.ceil(Math.log(e/h)/Math.log(t)-1e-9),d=-a*(.5-1e-9)+.5,f=Math.min(h,s),y=Math.floor(Math.log(e/f)/Math.log(t)+d),g=Math.max(p,y);return je(e/Math.pow(t,g),c,h)}}}(l,i,n,h,!f&&y,c):jo(i,n,h,!f&&y,c)}return{constraint:e,maxResolution:i,minResolution:n,minZoom:s,zoomFactor:l}}(t);this.maxResolution_=e.maxResolution,this.minResolution_=e.minResolution,this.zoomFactor_=e.zoomFactor,this.resolutions_=t.resolutions,this.padding_=t.padding,this.minZoom_=e.minZoom;var i=function(t){if(void 0!==t.extent){var e=void 0===t.smoothExtentConstraint||t.smoothExtentConstraint;return Oo(t.extent,t.constrainOnlyCenter,e)}var i=Qn(t.projection,"EPSG:3857");if(!0!==t.multiWorld&&i.isGlobal()){var n=i.getExtent().slice();return n[0]=-1/0,n[2]=1/0,Oo(n,!1,!1)}return Ro}(t),n=e.constraint,r=function(t){if(void 0===t.enableRotation||t.enableRotation){var e=t.constrainRotation;return void 0===e||!0===e?(o=r||ze(5),function(t,e){return e?t:void 0!==t?Math.abs(t)<=o?0:t:void 0}):!1===e?Ao:"number"==typeof e?(i=e,n=2*Math.PI/i,function(t,e){return e?t:void 0!==t?t=Math.floor(t/n+.5)*n:void 0}):Ao}return Mo;var i,n;var r,o}(t);this.constraints_={center:i,resolution:n,rotation:r},this.setRotation(void 0!==t.rotation?t.rotation:0),this.setCenterInternal(void 0!==t.center?t.center:null),void 0!==t.resolution?this.setResolution(t.resolution):void 0!==t.zoom&&this.setZoom(t.zoom),this.setProperties({}),this.options_=t},Object.defineProperty(e.prototype,"padding",{get:function(){return this.padding_},set:function(t){var e=this.padding_;this.padding_=t;var i=this.getCenter();if(i){var n=t||[0,0,0,0];e=e||[0,0,0,0];var r=this.getResolution(),o=r/2*(n[3]-e[3]+e[1]-n[1]),s=r/2*(n[0]-e[0]+e[2]-n[2]);this.setCenterInternal([i[0]+o,i[1]-s])}},enumerable:!1,configurable:!0}),e.prototype.getUpdatedOptions_=function(t){var e=Ct({},this.options_);return void 0!==e.resolution?e.resolution=this.getResolution():e.zoom=this.getZoom(),e.center=this.getCenterInternal(),e.rotation=this.getRotation(),Ct({},e,t)},e.prototype.animate=function(t){this.isDef()&&!this.getAnimating()&&this.resolveConstraints(0);for(var e=new Array(arguments.length),i=0;i<e.length;++i){var n=arguments[i];n.center&&((n=Ct({},n)).center=ur(n.center,this.getProjection())),n.anchor&&((n=Ct({},n)).anchor=ur(n.anchor,this.getProjection())),e[i]=n}this.animateInternal.apply(this,e)},e.prototype.animateInternal=function(t){var e,i=arguments.length;i>1&&"function"==typeof arguments[i-1]&&(e=arguments[i-1],--i);for(var n=0;n<i&&!this.isDef();++n){var r=arguments[n];r.center&&this.setCenterInternal(r.center),void 0!==r.zoom?this.setZoom(r.zoom):r.resolution&&this.setResolution(r.resolution),void 0!==r.rotation&&this.setRotation(r.rotation)}if(n!==i){for(var o=Date.now(),s=this.targetCenter_.slice(),a=this.targetResolution_,l=this.targetRotation_,u=[];n<i;++n){var h=arguments[n],c={start:o,complete:!1,anchor:h.anchor,duration:void 0!==h.duration?h.duration:1e3,easing:h.easing||ui,callback:e};if(h.center&&(c.sourceCenter=s,c.targetCenter=h.center.slice(),s=c.targetCenter),void 0!==h.zoom?(c.sourceResolution=a,c.targetResolution=this.getResolutionForZoom(h.zoom),a=c.targetResolution):h.resolution&&(c.sourceResolution=a,c.targetResolution=h.resolution,a=c.targetResolution),void 0!==h.rotation){c.sourceRotation=l;var p=Ge(h.rotation-l+Math.PI,2*Math.PI)-Math.PI;c.targetRotation=l+p,l=c.targetRotation}Ls(c)?c.complete=!0:o+=c.duration,u.push(c)}this.animations_.push(u),this.setHint(Co,1),this.updateAnimations_()}else e&&As(e,!0)},e.prototype.getAnimating=function(){return this.hints_[Co]>0},e.prototype.getInteracting=function(){return this.hints_[To]>0},e.prototype.cancelAnimations=function(){var t;this.setHint(Co,-this.hints_[Co]);for(var e=0,i=this.animations_.length;e<i;++e){var n=this.animations_[e];if(n[0].callback&&As(n[0].callback,!1),!t)for(var r=0,o=n.length;r<o;++r){var s=n[r];if(!s.complete){t=s.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,i=this.animations_.length-1;i>=0;--i){for(var n=this.animations_[i],r=!0,o=0,s=n.length;o<s;++o){var a=n[o];if(!a.complete){var l=t-a.start,u=a.duration>0?l/a.duration:1;u>=1?(a.complete=!0,u=1):r=!1;var h=a.easing(u);if(a.sourceCenter){var c=a.sourceCenter[0],p=a.sourceCenter[1],d=a.targetCenter[0],f=a.targetCenter[1];this.nextCenter_=a.targetCenter;var y=c+h*(d-c),g=p+h*(f-p);this.targetCenter_=[y,g]}if(a.sourceResolution&&a.targetResolution){var m=1===h?a.targetResolution:a.sourceResolution+h*(a.targetResolution-a.sourceResolution);if(a.anchor){var v=this.getViewportSize_(this.getRotation()),_=this.constraints_.resolution(m,0,v,!0);this.targetCenter_=this.calculateCenterZoom(_,a.anchor)}this.nextResolution_=a.targetResolution,this.targetResolution_=m,this.applyTargetState_(!0)}if(void 0!==a.sourceRotation&&void 0!==a.targetRotation){var x=1===h?Ge(a.targetRotation+Math.PI,2*Math.PI)-Math.PI:a.sourceRotation+h*(a.targetRotation-a.sourceRotation);if(a.anchor){var b=this.constraints_.rotation(x,!0);this.targetCenter_=this.calculateCenterRotate(b,a.anchor)}this.nextRotation_=a.targetRotation,this.targetRotation_=x}if(this.applyTargetState_(!0),e=!0,!a.complete)break}}if(r){this.animations_[i]=null,this.setHint(Co,-1),this.nextCenter_=null,this.nextResolution_=NaN,this.nextRotation_=NaN;var w=n[0].callback;w&&As(w,!0)}}this.animations_=this.animations_.filter(Boolean),e&&void 0===this.updateAnimationKey_&&(this.updateAnimationKey_=requestAnimationFrame(this.updateAnimations_.bind(this)))}},e.prototype.calculateCenterRotate=function(t,e){var i,n,r,o=this.getCenterInternal();return void 0!==o&&(Wn(i=[o[0]-e[0],o[1]-e[1]],t-this.getRotation()),r=e,(n=i)[0]+=+r[0],n[1]+=+r[1]),i},e.prototype.calculateCenterZoom=function(t,e){var i,n=this.getCenterInternal(),r=this.getResolution();void 0!==n&&void 0!==r&&(i=[e[0]-t*(e[0]-n[0])/r,e[1]-t*(e[1]-n[1])/r]);return i},e.prototype.getViewportSize_=function(t){var e=this.viewportSize_;if(t){var i=e[0],n=e[1];return[Math.abs(i*Math.cos(t))+Math.abs(n*Math.sin(t)),Math.abs(i*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?lr(t,this.getProjection()):t},e.prototype.getCenterInternal=function(){return this.get(Eo)},e.prototype.getConstraints=function(){return this.constraints_},e.prototype.getConstrainResolution=function(){return this.options_.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 hr(this.calculateExtentInternal(t),this.getProjection())},e.prototype.calculateExtentInternal=function(t){var e=t||this.getViewportSizeMinusPadding_(),i=this.getCenterInternal();Fe(i,1);var n=this.getResolution();Fe(void 0!==n,2);var r=this.getRotation();return Fe(void 0!==r,3),_n(i,n,r,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(ko)},e.prototype.getResolutions=function(){return this.resolutions_},e.prototype.getResolutionForExtent=function(t,e){return this.getResolutionForExtentInternal(cr(t,this.getProjection()),e)},e.prototype.getResolutionForExtentInternal=function(t,e){var i=e||this.getViewportSizeMinusPadding_(),n=Cn(t)/i[0],r=xn(t)/i[1];return Math.max(n,r)},e.prototype.getResolutionForValueFunction=function(t){var e=t||2,i=this.getConstrainedResolution(this.maxResolution_),n=this.minResolution_,r=Math.log(i/n)/Math.log(e);return function(t){return i/Math.pow(e,t*r)}},e.prototype.getRotation=function(){return this.get(Po)},e.prototype.getValueForResolutionFunction=function(t){var e=Math.log(t||2),i=this.getConstrainedResolution(this.maxResolution_),n=this.minResolution_,r=Math.log(i/n)/e;return function(t){return Math.log(i/t)/e/r}},e.prototype.getViewportSizeMinusPadding_=function(t){var e=this.getViewportSize_(t),i=this.padding_;return i&&(e=[e[0]-i[1]-i[3],e[1]-i[0]-i[2]]),e},e.prototype.getState=function(){var t=this.getProjection(),e=this.getResolution(),i=this.getRotation(),n=this.getCenterInternal(),r=this.padding_;if(r){var o=this.getViewportSizeMinusPadding_();n=Ds(n,this.getViewportSize_(),[o[0]/2+r[3],o[1]/2+r[0]],e,i)}return{center:n.slice(0),projection:void 0!==t?t:null,resolution:e,nextCenter:this.nextCenter_,nextResolution:this.nextResolution_,nextRotation:this.nextRotation_,rotation:i,zoom:this.getZoom()}},e.prototype.getZoom=function(){var t,e=this.getResolution();return void 0!==e&&(t=this.getZoomForResolution(e)),t},e.prototype.getZoomForResolution=function(t){var e,i,n=this.minZoom_||0;if(this.resolutions_){var r=mt(this.resolutions_,t,1);n=r,e=this.resolutions_[r],i=r==this.resolutions_.length-1?2:e/this.resolutions_[r+1]}else e=this.maxResolution_,i=this.zoomFactor_;return n+Math.log(e/t)/Math.log(i)},e.prototype.getResolutionForZoom=function(t){if(this.resolutions_){if(this.resolutions_.length<=1)return 0;var e=je(Math.floor(t),0,this.resolutions_.length-2),i=this.resolutions_[e]/this.resolutions_[e+1];return this.resolutions_[e]/Math.pow(i,je(t-e,0,1))}return this.maxResolution_/Math.pow(this.zoomFactor_,t-this.minZoom_)},e.prototype.fit=function(t,e){var i;if(Fe(Array.isArray(t)||"function"==typeof t.getSimplifiedGeometry,24),Array.isArray(t))Fe(!En(t),25),i=Fs(n=cr(t,this.getProjection()));else if(t.getType()===Ln){var n;(i=Fs(n=cr(t.getExtent(),this.getProjection()))).rotate(this.getRotation(),mn(n))}else{i=t}this.fitInternal(i,e)},e.prototype.rotatedExtentForGeometry=function(t){for(var e=this.getRotation(),i=Math.cos(e),n=Math.sin(-e),r=t.getFlatCoordinates(),o=t.getStride(),s=1/0,a=1/0,l=-1/0,u=-1/0,h=0,c=r.length;h<c;h+=o){var p=r[h]*i-r[h+1]*n,d=r[h]*n+r[h+1]*i;s=Math.min(s,p),a=Math.min(a,d),l=Math.max(l,p),u=Math.max(u,d)}return[s,a,l,u]},e.prototype.fitInternal=function(t,e){var i=e||{},n=i.size;n||(n=this.getViewportSizeMinusPadding_());var r,o=void 0!==i.padding?i.padding:[0,0,0,0],s=void 0!==i.nearest&&i.nearest;r=void 0!==i.minResolution?i.minResolution:void 0!==i.maxZoom?this.getResolutionForZoom(i.maxZoom):0;var a=this.rotatedExtentForGeometry(t),l=this.getResolutionForExtentInternal(a,[n[0]-o[1]-o[3],n[1]-o[0]-o[2]]);l=isNaN(l)?r:Math.max(l,r),l=this.getConstrainedResolution(l,s?0:1);var u=this.getRotation(),h=Math.sin(u),c=Math.cos(u),p=mn(a);p[0]+=(o[1]-o[3])/2*l,p[1]+=(o[0]-o[2])/2*l;var d=p[0]*c-p[1]*h,f=p[1]*c+p[0]*h,y=this.getConstrainedCenter([d,f],l),g=i.callback?i.callback:St;void 0!==i.duration?this.animateInternal({resolution:l,center:y,duration:i.duration,easing:i.easing},g):(this.targetResolution_=l,this.targetCenter_=y,this.applyTargetState_(!1,!0),As(g,!0))},e.prototype.centerOn=function(t,e,i){this.centerOnInternal(ur(t,this.getProjection()),e,i)},e.prototype.centerOnInternal=function(t,e,i){this.setCenterInternal(Ds(t,e,i,this.getResolution(),this.getRotation()))},e.prototype.calculateCenterShift=function(t,e,i,n){var r,o=this.padding_;if(o&&t){var s=this.getViewportSizeMinusPadding_(-i),a=Ds(t,n,[s[0]/2+o[3],s[1]/2+o[0]],e,i);r=[t[0]-a[0],t[1]-a[1]]}return r},e.prototype.isDef=function(){return!!this.getCenterInternal()&&void 0!==this.getResolution()},e.prototype.adjustCenter=function(t){var e=lr(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 i=e&&ur(e,this.getProjection());this.adjustResolutionInternal(t,i)},e.prototype.adjustResolutionInternal=function(t,e){var i=this.getAnimating()||this.getInteracting(),n=this.getViewportSize_(this.getRotation()),r=this.constraints_.resolution(this.targetResolution_*t,0,n,i);e&&(this.targetCenter_=this.calculateCenterZoom(r,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=ur(e,this.getProjection())),this.adjustRotationInternal(t,e)},e.prototype.adjustRotationInternal=function(t,e){var i=this.getAnimating()||this.getInteracting(),n=this.constraints_.rotation(this.targetRotation_+t,i);e&&(this.targetCenter_=this.calculateCenterRotate(n,e)),this.targetRotation_+=t,this.applyTargetState_()},e.prototype.setCenter=function(t){this.setCenterInternal(ur(t,this.getProjection()))},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 i=this.getAnimating()||this.getInteracting()||e,n=this.constraints_.rotation(this.targetRotation_,i),r=this.getViewportSize_(n),o=this.constraints_.resolution(this.targetResolution_,0,r,i),s=this.constraints_.center(this.targetCenter_,o,r,i,this.calculateCenterShift(this.targetCenter_,o,n,r));this.get(Po)!==n&&this.set(Po,n),this.get(ko)!==o&&this.set(ko,o),this.get(Eo)&&Bn(this.get(Eo),s)||this.set(Eo,s),this.getAnimating()&&!t&&this.cancelAnimations(),this.cancelAnchor_=void 0},e.prototype.resolveConstraints=function(t,e,i){var n=void 0!==t?t:200,r=e||0,o=this.constraints_.rotation(this.targetRotation_),s=this.getViewportSize_(o),a=this.constraints_.resolution(this.targetResolution_,r,s),l=this.constraints_.center(this.targetCenter_,a,s,!1,this.calculateCenterShift(this.targetCenter_,a,o,s));if(0===n&&!this.cancelAnchor_)return this.targetResolution_=a,this.targetRotation_=o,this.targetCenter_=l,void this.applyTargetState_();var u=i||(0===n?this.cancelAnchor_:void 0);this.cancelAnchor_=void 0,this.getResolution()===a&&this.getRotation()===o&&this.getCenterInternal()&&Bn(this.getCenterInternal(),l)||(this.getAnimating()&&this.cancelAnimations(),this.animateInternal({rotation:o,center:l,resolution:a,duration:n,easing:li,anchor:u}))},e.prototype.beginInteraction=function(){this.resolveConstraints(0),this.setHint(To,1)},e.prototype.endInteraction=function(t,e,i){var n=i&&ur(i,this.getProjection());this.endInteractionInternal(t,e,n)},e.prototype.endInteractionInternal=function(t,e,i){this.setHint(To,-1),this.resolveConstraints(t,e,i)},e.prototype.getConstrainedCenter=function(t,e){var i=this.getViewportSize_(this.getRotation());return this.constraints_.center(t,e||this.getResolution(),i)},e.prototype.getConstrainedZoom=function(t,e){var i=this.getResolutionForZoom(t);return this.getZoomForResolution(this.getConstrainedResolution(i,e))},e.prototype.getConstrainedResolution=function(t,e){var i=e||0,n=this.getViewportSize_(this.getRotation());return this.constraints_.resolution(t,i,n)},e}(te);function Gs(t){return t[0]>0&&t[1]>0}function Ns(t,e){return Array.isArray(t)?t:(void 0===e?e=[t,t]:(e[0]=t,e[1]=t),e)}var Bs=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}();var Ws=function(t){function e(e){var i=t.call(this)||this;i.on,i.once,i.un;var n=function(t){var e=null;void 0!==t.keyboardEventTarget&&(e="string"==typeof t.keyboardEventTarget?document.getElementById(t.keyboardEventTarget):t.keyboardEventTarget);var i,n,r,o={},s=t.layers&&"function"==typeof t.layers.getLayers?t.layers:new so({layers:t.layers});o[to]=s,o[io]=t.target,o[no]=t.view instanceof zs?t.view:new zs,void 0!==t.controls&&(Array.isArray(t.controls)?i=new si(t.controls.slice()):(Fe("function"==typeof t.controls.getArray,47),i=t.controls));void 0!==t.interactions&&(Array.isArray(t.interactions)?n=new si(t.interactions.slice()):(Fe("function"==typeof t.interactions.getArray,48),n=t.interactions));void 0!==t.overlays?Array.isArray(t.overlays)?r=new si(t.overlays.slice()):(Fe("function"==typeof t.overlays.getArray,49),r=t.overlays):r=new si;return{controls:i,interactions:n,keyboardEventTarget:e,overlays:r,values:o}}(e);i.boundHandleBrowserEvent_=i.handleBrowserEvent.bind(i),i.maxTilesLoading_=void 0!==e.maxTilesLoading?e.maxTilesLoading:16,i.pixelRatio_=void 0!==e.pixelRatio?e.pixelRatio:le,i.postRenderTimeoutHandle_,i.animationDelayKey_,i.animationDelay_=function(){this.animationDelayKey_=void 0,this.renderFrame_(Date.now())}.bind(i),i.coordinateToPixelTransform_=[1,0,0,1,0,0],i.pixelToCoordinateTransform_=[1,0,0,1,0,0],i.frameIndex_=0,i.frameState_=null,i.previousExtent_=null,i.viewPropertyListenerKey_=null,i.viewChangeListenerKey_=null,i.layerGroupPropertyListenerKeys_=null,i.viewport_=document.createElement("div"),i.viewport_.className="ol-viewport"+("ontouchstart"in window?" ol-touch":""),i.viewport_.style.position="relative",i.viewport_.style.overflow="hidden",i.viewport_.style.width="100%",i.viewport_.style.height="100%",i.overlayContainer_=document.createElement("div"),i.overlayContainer_.style.position="absolute",i.overlayContainer_.style.zIndex="0",i.overlayContainer_.style.width="100%",i.overlayContainer_.style.height="100%",i.overlayContainer_.style.pointerEvents="none",i.overlayContainer_.className="ol-overlaycontainer",i.viewport_.appendChild(i.overlayContainer_),i.overlayContainerStopEvent_=document.createElement("div"),i.overlayContainerStopEvent_.style.position="absolute",i.overlayContainerStopEvent_.style.zIndex="0",i.overlayContainerStopEvent_.style.width="100%",i.overlayContainerStopEvent_.style.height="100%",i.overlayContainerStopEvent_.style.pointerEvents="none",i.overlayContainerStopEvent_.className="ol-overlaycontainer-stopevent",i.viewport_.appendChild(i.overlayContainerStopEvent_),i.mapBrowserEventHandler_=null,i.moveTolerance_=e.moveTolerance,i.keyboardEventTarget_=n.keyboardEventTarget,i.keyHandlerKeys_=null,i.controls=n.controls||new si,i.interactions=n.interactions||new si,i.overlays_=n.overlays,i.overlayIdIndex_={},i.renderer_=null,i.handleResize_,i.postRenderFunctions_=[],i.tileQueue_=new So(i.getTilePriority.bind(i),i.handleTileChange_.bind(i)),i.addChangeListener(to,i.handleLayerGroupChanged_),i.addChangeListener(no,i.handleViewChanged_),i.addChangeListener(eo,i.handleSizeChanged_),i.addChangeListener(io,i.handleTargetChanged_),i.setProperties(n.values);var r=i;return!e.view||e.view instanceof zs||e.view.then((function(t){r.setView(new zs(t))})),i.controls.addEventListener(ei,function(t){t.element.setMap(this)}.bind(i)),i.controls.addEventListener(ii,function(t){t.element.setMap(null)}.bind(i)),i.interactions.addEventListener(ei,function(t){t.element.setMap(this)}.bind(i)),i.interactions.addEventListener(ii,function(t){t.element.setMap(null)}.bind(i)),i.overlays_.addEventListener(ei,function(t){this.addOverlayInternal_(t.element)}.bind(i)),i.overlays_.addEventListener(ii,function(t){var e=t.element.getId();void 0!==e&&delete this.overlayIdIndex_[e.toString()],t.element.setMap(null)}.bind(i)),i.controls.forEach(function(t){t.setMap(this)}.bind(i)),i.interactions.forEach(function(t){t.setMap(this)}.bind(i)),i.overlays_.forEach(i.addOverlayInternal_.bind(i)),i}return Bs(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.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.setTarget(null),t.prototype.disposeInternal.call(this)},e.prototype.forEachFeatureAtPixel=function(t,e,i){if(this.frameState_){var n=this.getCoordinateFromPixelInternal(t),r=void 0!==(i=void 0!==i?i:{}).hitTolerance?i.hitTolerance:0,o=void 0!==i.layerFilter?i.layerFilter:bt,s=!1!==i.checkWrapped;return this.renderer_.forEachFeatureAtCoordinate(n,this.frameState_,r,s,e,null,o,null)}},e.prototype.getFeaturesAtPixel=function(t,e){var i=[];return this.forEachFeatureAtPixel(t,(function(t){i.push(t)}),e),i},e.prototype.forEachLayerAtPixel=function(t,e,i){if(this.frameState_){var n=i||{},r=void 0!==n.hitTolerance?n.hitTolerance:0,o=n.layerFilter||bt;return this.renderer_.forEachLayerAtPixel(t,this.frameState_,r,e,o)}},e.prototype.hasFeatureAtPixel=function(t,e){if(!this.frameState_)return!1;var i=this.getCoordinateFromPixelInternal(t),n=void 0!==(e=void 0!==e?e:{}).layerFilter?e.layerFilter:bt,r=void 0!==e.hitTolerance?e.hitTolerance:0,o=!1!==e.checkWrapped;return this.renderer_.hasFeatureAtCoordinate(i,this.frameState_,r,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(),i="changedTouches"in t?t.changedTouches[0]:t;return[i.clientX-e.left,i.clientY-e.top]},e.prototype.getTarget=function(){return this.get(io)},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 lr(this.getCoordinateFromPixelInternal(t),this.getView().getProjection())},e.prototype.getCoordinateFromPixelInternal=function(t){var e=this.frameState_;return e?mr(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(to)},e.prototype.setLayers=function(t){var e=this.getLayerGroup();if(t instanceof si)e.setLayers(t);else{var i=e.getLayers();i.clear(),i.extend(t)}},e.prototype.getLayers=function(){return this.getLayerGroup().getLayers()},e.prototype.getLoading=function(){for(var t=this.getLayerGroup().getLayerStatesArray(),e=0,i=t.length;e<i;++e){var n=t[e].layer.getSource();if(n&&n.loading)return!0}return!1},e.prototype.getPixelFromCoordinate=function(t){var e=ur(t,this.getView().getProjection());return this.getPixelFromCoordinateInternal(e)},e.prototype.getPixelFromCoordinateInternal=function(t){var e=this.frameState_;return e?mr(e.coordinateToPixelTransform,t.slice(0,2)):null},e.prototype.getRenderer=function(){return this.renderer_},e.prototype.getSize=function(){return this.get(eo)},e.prototype.getView=function(){return this.get(no)},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,i,n){return function(t,e,i,n,r){if(!t||!(i in t.wantedTiles))return yo;if(!t.wantedTiles[i][e.getKey()])return yo;var o=t.viewState.center,s=n[0]-o[0],a=n[1]-o[1];return 65536*Math.log(r)+Math.sqrt(s*s+a*a)/r}(this.frameState_,t,e,i,n)},e.prototype.handleBrowserEvent=function(t,e){var i=e||t.type,n=new ho(i,this,t);this.handleMapBrowserEvent(n)},e.prototype.handleMapBrowserEvent=function(t){if(this.frameState_){var e=t.originalEvent,i=e.type;if(i===gi||i===Wt||i===Dt){var n=this.getOwnerDocument(),r=this.viewport_.getRootNode?this.viewport_.getRootNode():n,o=e.target;if(this.overlayContainerStopEvent_.contains(o)||!(r===n?n.documentElement:r).contains(o))return}if(t.frameState=this.frameState_,!1!==this.dispatchEvent(t))for(var s=this.getInteractions().getArray().slice(),a=s.length-1;a>=0;a--){var l=s[a];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 i=this.maxTilesLoading_,n=i;if(t){var r=t.viewHints;if(r[Co]||r[To]){var o=Date.now()-t.time>8;i=o?0:8,n=o?0:2}}e.getTilesLoading()<i&&(e.reprioritize(),e.loadMoreTiles(i,n))}!t||!this.hasListener(Ke)||t.animate||this.tileQueue_.getTilesLoading()||this.getLoading()||this.renderer_.dispatchRenderEvent(Ke,t);for(var s=this.postRenderFunctions_,a=0,l=s.length;a<l;++a)s[a](this,t);s.length=0},e.prototype.handleSizeChanged_=function(){this.getView()&&!this.getView().getAnimating()&&this.getView().resolveConstraints(0),this.render()},e.prototype.handleTargetChanged_=function(){var t;if(this.getTarget()&&(t=this.getTargetElement()),this.mapBrowserEventHandler_){for(var e=0,i=this.keyHandlerKeys_.length;e<i;++e)Ut(this.keyHandlerKeys_[e]);this.keyHandlerKeys_=null,this.viewport_.removeEventListener(Mt,this.boundHandleBrowserEvent_),this.viewport_.removeEventListener(Wt,this.boundHandleBrowserEvent_),void 0!==this.handleResize_&&(removeEventListener(Nt,this.handleResize_,!1),this.handleResize_=void 0),this.mapBrowserEventHandler_.dispose(),this.mapBrowserEventHandler_=null,fe(this.viewport_)}if(t){for(var n in t.appendChild(this.viewport_),this.renderer_||(this.renderer_=this.createRenderer()),this.mapBrowserEventHandler_=new fo(this,this.moveTolerance_),co)this.mapBrowserEventHandler_.addEventListener(co[n],this.handleMapBrowserEvent.bind(this));this.viewport_.addEventListener(Mt,this.boundHandleBrowserEvent_,!1),this.viewport_.addEventListener(Wt,this.boundHandleBrowserEvent_,!!ce&&{passive:!1});var r=this.keyboardEventTarget_?this.keyboardEventTarget_:t;this.keyHandlerKeys_=[qt(r,Dt,this.handleBrowserEvent,this),qt(r,zt,this.handleBrowserEvent,this)],this.handleResize_||(this.handleResize_=this.updateSize.bind(this),window.addEventListener(Nt,this.handleResize_,!1))}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_&&(Ut(this.viewPropertyListenerKey_),this.viewPropertyListenerKey_=null),this.viewChangeListenerKey_&&(Ut(this.viewChangeListenerKey_),this.viewChangeListenerKey_=null);var t=this.getView();t&&(this.updateViewportSize_(),this.viewPropertyListenerKey_=qt(t,ft,this.handleViewPropertyChanged_,this),this.viewChangeListenerKey_=qt(t,It,this.handleViewPropertyChanged_,this),t.resolveConstraints(0)),this.render()},e.prototype.handleLayerGroupChanged_=function(){this.layerGroupPropertyListenerKeys_&&(this.layerGroupPropertyListenerKeys_.forEach(Ut),this.layerGroupPropertyListenerKeys_=null);var t=this.getLayerGroup();t&&(this.layerGroupPropertyListenerKeys_=[qt(t,ft,this.render,this),qt(t,It,this.render,this)]),this.render()},e.prototype.isRendered=function(){return!!this.frameState_},e.prototype.renderSync=function(){this.animationDelayKey_&&cancelAnimationFrame(this.animationDelayKey_),this.animationDelay_()},e.prototype.redrawText=function(){for(var t=this.getLayerGroup().getLayerStatesArray(),e=0,i=t.length;e<i;++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.removeOverlay=function(t){return this.getOverlays().remove(t)},e.prototype.renderFrame_=function(t){var e=this,i=this.getSize(),n=this.getView(),r=this.frameState_,o=null;if(void 0!==i&&Gs(i)&&n&&n.isDef()){var s=n.getHints(this.frameState_?this.frameState_.viewHints:void 0),a=n.getState();if(o={animate:!1,coordinateToPixelTransform:this.coordinateToPixelTransform_,declutterTree:null,extent:_n(a.center,a.resolution,a.rotation,i),index:this.frameIndex_++,layerIndex:0,layerStatesArray:this.getLayerGroup().getLayerStatesArray(),pixelRatio:this.pixelRatio_,pixelToCoordinateTransform:this.pixelToCoordinateTransform_,postRenderFunctions:[],size:i,tileQueue:this.tileQueue_,time:t,usedTiles:{},viewState:a,viewHints:s,wantedTiles:{}},a.nextCenter&&a.nextResolution){var l=isNaN(a.nextRotation)?a.rotation:a.nextRotation;o.nextExtent=_n(a.nextCenter,a.nextResolution,l,i)}}if(this.frameState_=o,this.renderer_.renderFrame(o),o){if(o.animate&&this.render(),Array.prototype.push.apply(this.postRenderFunctions_,o.postRenderFunctions),r)(!this.previousExtent_||!En(this.previousExtent_)&&!ln(o.extent,this.previousExtent_))&&(this.dispatchEvent(new lo(ie,this,r)),this.previousExtent_=on(this.previousExtent_));this.previousExtent_&&!o.viewHints[Co]&&!o.viewHints[To]&&!ln(o.extent,this.previousExtent_)&&(this.dispatchEvent(new lo(ne,this,o)),Hi(o.extent,this.previousExtent_))}this.dispatchEvent(new lo(ee,this,o)),this.postRenderTimeoutHandle_||(this.postRenderTimeoutHandle_=setTimeout((function(){e.postRenderTimeoutHandle_=void 0,e.handlePostRender()}),0))},e.prototype.setLayerGroup=function(t){this.set(to,t)},e.prototype.setSize=function(t){this.set(eo,t)},e.prototype.setTarget=function(t){this.set(io,t)},e.prototype.setView=function(t){if(!t||t instanceof zs)this.set(no,t);else{this.set(no,new zs);var e=this;t.then((function(t){e.setView(new zs(t))}))}},e.prototype.updateSize=function(){var t=this.getTargetElement(),e=void 0;if(t){var i=getComputedStyle(t),n=t.offsetWidth-parseFloat(i.borderLeftWidth)-parseFloat(i.paddingLeft)-parseFloat(i.paddingRight)-parseFloat(i.borderRightWidth),r=t.offsetHeight-parseFloat(i.borderTopWidth)-parseFloat(i.paddingTop)-parseFloat(i.paddingBottom)-parseFloat(i.borderBottomWidth);isNaN(n)||isNaN(r)||!Gs(e=[n,r])&&(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,i=getComputedStyle(this.viewport_);i.width&&i.height&&(e=[parseInt(i.width,10),parseInt(i.height,10)]),t.setViewportSize(e)}},e}(te),qs=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}(),Vs="degrees",Us="imperial",Xs="nautical",Ks="metric",Ys="us",Zs=[1,2,5],Hs=function(t){function e(e){var i=this,n=e||{},r=void 0!==n.className?n.className:n.bar?"ol-scale-bar":"ol-scale-line";return(i=t.call(this,{element:document.createElement("div"),render:n.render,target:n.target})||this).on,i.once,i.un,i.innerElement_=document.createElement("div"),i.innerElement_.className=r+"-inner",i.element.className=r+" ol-unselectable",i.element.appendChild(i.innerElement_),i.viewState_=null,i.minWidth_=void 0!==n.minWidth?n.minWidth:64,i.renderedVisible_=!1,i.renderedWidth_=void 0,i.renderedHTML_="",i.addChangeListener("units",i.handleUnitsChanged_),i.setUnits(n.units||Ks),i.scaleBar_=n.bar||!1,i.scaleBarSteps_=n.steps||4,i.scaleBarText_=n.text||!1,i.dpi_=n.dpi||void 0,i}return qs(e,t),e.prototype.getUnits=function(){return this.get("units")},e.prototype.handleUnitsChanged_=function(){this.updateElement_()},e.prototype.setUnits=function(t){this.set("units",t)},e.prototype.setDpi=function(t){this.dpi_=t},e.prototype.updateElement_=function(){var t=this.viewState_;if(t){var e=t.center,i=t.projection,n=this.getUnits(),r=n==Vs?_i.DEGREES:_i.METERS,o=$n(i,t.resolution,e,r),s=this.minWidth_*(this.dpi_||90.7142857142857)/90.7142857142857,a=s*o,l="";if(n==Vs){var u=vi[_i.DEGREES];(a*=u)<u/60?(l="″",o*=3600):a<u?(l="′",o*=60):l="°"}else n==Us?a<.9144?(l="in",o/=.0254):a<1609.344?(l="ft",o/=.3048):(l="mi",o/=1609.344):n==Xs?(o/=1852,l="nm"):n==Ks?a<.001?(l="μm",o*=1e6):a<1?(l="mm",o*=1e3):a<1e3?l="m":(l="km",o/=1e3):n==Ys?a<.9144?(l="in",o*=39.37):a<1609.344?(l="ft",o/=.30480061):(l="mi",o/=1609.3472):Fe(!1,33);for(var h,c,p,d,f=3*Math.floor(Math.log(s*o)/Math.log(10));;){p=Math.floor(f/3);var y=Math.pow(10,p);if(h=Zs[(f%3+3)%3]*y,c=Math.round(h/o),isNaN(c))return this.element.style.display="none",void(this.renderedVisible_=!1);if(c>=s)break;++f}d=this.scaleBar_?this.createScaleBar(c,h,l):h.toFixed(p<0?-p:0)+" "+l,this.renderedHTML_!=d&&(this.innerElement_.innerHTML=d,this.renderedHTML_=d),this.renderedWidth_!=c&&(this.innerElement_.style.width=c+"px",this.renderedWidth_=c),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,i){for(var n="1 : "+Math.round(this.getScaleForResolution()).toLocaleString(),r=[],o=t/this.scaleBarSteps_,s="#ffffff",a=0;a<this.scaleBarSteps_;a++)0===a&&r.push(this.createMarker("absolute",a)),r.push('<div><div class="ol-scale-singlebar" style="width: '+o+"px;background-color: "+s+';"></div>'+this.createMarker("relative",a)+(a%2==0||2===this.scaleBarSteps_?this.createStepText(a,t,!1,e,i):"")+"</div>"),a===this.scaleBarSteps_-1&&r.push(this.createStepText(a+1,t,!0,e,i)),s="#ffffff"===s?"#000000":"#ffffff";return'<div style="display: flex;">'+(this.scaleBarText_?'<div class="ol-scale-text" style="width: '+t+'px;">'+n+"</div>":"")+r.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,i,n,r){var o=(0===t?0:Math.round(n/this.scaleBarSteps_*t*100)/100)+(0===t?"":" "+r);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: "+(i?e+"px":"unset")+';">'+o+"</div>"},e.prototype.getScaleForResolution=function(){var t=$n(this.viewState_.projection,this.viewState_.resolution,this.viewState_.center),e=this.dpi_||90.7142857142857,i=this.viewState_.projection.getMetersPerUnit();return parseFloat(t.toString())*i*(1e3/25.4)*e},e.prototype.render=function(t){var e=t.frameState;this.viewState_=e?e.viewState:null,this.updateElement_()},e}(ge);function $s(t){var e=t||{},i=new si;return(void 0===e.zoom||e.zoom)&&i.push(new fi(e.zoomOptions)),(void 0===e.rotate||e.rotate)&&i.push(new pi(e.rotateOptions)),(void 0===e.attribution||e.attribution)&&i.push(new ti(e.attributionOptions)),i}var Js=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}();var Qs=function(t){function e(e){var i=t.call(this)||this;if(i.on,i.once,i.un,i.id_=void 0,i.geometryName_="geometry",i.style_=null,i.styleFunction_=void 0,i.geometryChangeKey_=null,i.addChangeListener(i.geometryName_,i.handleGeometryChanged_),e)if("function"==typeof e.getSimplifiedGeometry){var n=e;i.setGeometry(n)}else{var r=e;i.setProperties(r)}return i}return Js(e,t),e.prototype.clone=function(){var t=new e(this.hasProperties()?this.getProperties():null);t.setGeometryName(this.getGeometryName());var i=this.getGeometry();i&&t.setGeometry(i.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_&&(Ut(this.geometryChangeKey_),this.geometryChangeKey_=null);var t=this.getGeometry();t&&(this.geometryChangeKey_=qt(t,It,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:(Fe("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}(te),ta=function(){function t(){this.dataProjection=void 0,this.defaultFeatureProjection=void 0,this.supportedMediaTypes=null}return t.prototype.getReadOptions=function(t,e){var i;if(e){var n=e.dataProjection?Hn(e.dataProjection):this.readProjection(t);e.extent&&n&&n.getUnits()===_i.TILE_PIXELS&&(n=Hn(n)).setWorldExtent(e.extent),i={dataProjection:n,featureProjection:e.featureProjection}}return this.adaptOptions(i)},t.prototype.adaptOptions=function(t){return Ct({dataProjection:this.dataProjection,featureProjection:this.defaultFeatureProjection},t)},t.prototype.getType=function(){return Zt()},t.prototype.readFeature=function(t,e){return Zt()},t.prototype.readFeatures=function(t,e){return Zt()},t.prototype.readGeometry=function(t,e){return Zt()},t.prototype.readProjection=function(t){return Zt()},t.prototype.writeFeature=function(t,e){return Zt()},t.prototype.writeFeatures=function(t,e){return Zt()},t.prototype.writeGeometry=function(t,e){return Zt()},t}();function ea(t,e,i){var n,r=i?Hn(i.featureProjection):null,o=i?Hn(i.dataProjection):null;if(n=r&&o&&!er(r,o)?(e?t.clone():t).transform(e?r:o,e?o:r):t,e&&i&&void 0!==i.decimals){var s=Math.pow(10,i.decimals);n===t&&(n=t.clone()),n.applyTransform((function(t){for(var e=0,i=t.length;e<i;++e)t[e]=Math.round(t[e]*s)/s;return t}))}return n}var ia="arraybuffer",na="json",ra="text",oa="xml",sa=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}();function aa(t){if("string"==typeof t){var e=JSON.parse(t);return e||null}return null!==t?t:null}var la=function(t){function e(){return t.call(this)||this}return sa(e,t),e.prototype.getType=function(){return na},e.prototype.readFeature=function(t,e){return this.readFeatureFromObject(aa(t),this.getReadOptions(t,e))},e.prototype.readFeatures=function(t,e){return this.readFeaturesFromObject(aa(t),this.getReadOptions(t,e))},e.prototype.readFeatureFromObject=function(t,e){return Zt()},e.prototype.readFeaturesFromObject=function(t,e){return Zt()},e.prototype.readGeometry=function(t,e){return this.readGeometryFromObject(aa(t),this.getReadOptions(t,e))},e.prototype.readGeometryFromObject=function(t,e){return Zt()},e.prototype.readProjection=function(t){return this.readProjectionFromObject(aa(t))},e.prototype.readProjectionFromObject=function(t){return Zt()},e.prototype.writeFeature=function(t,e){return JSON.stringify(this.writeFeatureObject(t,e))},e.prototype.writeFeatureObject=function(t,e){return Zt()},e.prototype.writeFeatures=function(t,e){return JSON.stringify(this.writeFeaturesObject(t,e))},e.prototype.writeFeaturesObject=function(t,e){return Zt()},e.prototype.writeGeometry=function(t,e){return JSON.stringify(this.writeGeometryObject(t,e))},e.prototype.writeGeometryObject=function(t,e){return Zt()},e}(ta);function ua(t,e,i,n,r,o,s){var a,l,u=(i-e)/n;if(1===u)a=e;else if(2===u)a=e,l=r;else if(0!==u){for(var h=t[e],c=t[e+1],p=0,d=[0],f=e+n;f<i;f+=n){var y=t[f],g=t[f+1];p+=Math.sqrt((y-h)*(y-h)+(g-c)*(g-c)),d.push(p),h=y,c=g}var m=r*p,v=function(t,e,i){for(var n,r,o=i||gt,s=0,a=t.length,l=!1;s<a;)(r=+o(t[n=s+(a-s>>1)],e))<0?s=n+1:(a=n,l=!r);return l?s:~s}(d,m);v<0?(l=(m-d[-v-2])/(d[-v-1]-d[-v-2]),a=e+(-v-2)*n):a=e+v*n}var _=s>1?s:2,x=o||new Array(_);for(f=0;f<_;++f)x[f]=void 0===a?NaN:void 0===l?t[a+f]:Ne(t[a+f],t[a+n+f],l);return x}function ha(t,e,i,n,r,o){if(i==e)return null;var s;if(r<t[e+n-1])return o?((s=t.slice(e,e+n))[n-1]=r,s):null;if(t[i-1]<r)return o?((s=t.slice(i-n,i))[n-1]=r,s):null;if(r==t[e+n-1])return t.slice(e,e+n);for(var a=e/n,l=i/n;a<l;){var u=a+l>>1;r<t[(u+1)*n-1]?l=u:a=u+1}var h=t[a*n-1];if(r==h)return t.slice((a-1)*n,(a-1)*n+n);var c=(r-h)/(t[(a+1)*n-1]-h);s=[];for(var p=0;p<n-1;++p)s.push(Ne(t[(a-1)*n+p],t[a*n+p],c));return s.push(r),s}function ca(t,e,i,n){for(var r=t[e],o=t[e+1],s=0,a=e+n;a<i;a+=n){var l=t[a],u=t[a+1];s+=Math.sqrt((l-r)*(l-r)+(u-o)*(u-o)),r=l,o=u}return s}var pa=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}(),da=function(t){function e(e,i){var n=t.call(this)||this;return n.flatMidpoint_=null,n.flatMidpointRevision_=-1,n.maxDelta_=-1,n.maxDeltaRevision_=-1,void 0===i||Array.isArray(e[0])?n.setCoordinates(e,i):n.setFlatCoordinates(i,e),n}return pa(e,t),e.prototype.appendCoordinate=function(t){this.flatCoordinates?_t(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,i,n){return n<$i(this.getExtent(),t,e)?n:(this.maxDeltaRevision_!=this.getRevision()&&(this.maxDelta_=Math.sqrt(Ho(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,0)),this.maxDeltaRevision_=this.getRevision()),Jo(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,this.maxDelta_,!1,t,e,i,n))},e.prototype.forEachSegment=function(t){return bs(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,t)},e.prototype.getCoordinateAtM=function(t,e){if(this.layout!=zo&&this.layout!=Go)return null;var i=void 0!==e&&e;return ha(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,t,i)},e.prototype.getCoordinates=function(){return as(this.flatCoordinates,0,this.flatCoordinates.length,this.stride)},e.prototype.getCoordinateAt=function(t,e){return ua(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,t,e,this.stride)},e.prototype.getLength=function(){return ca(this.flatCoordinates,0,this.flatCoordinates.length,this.stride)},e.prototype.getFlatMidpoint=function(){return this.flatMidpointRevision_!=this.getRevision()&&(this.flatMidpoint_=this.getCoordinateAt(.5,this.flatMidpoint_),this.flatMidpointRevision_=this.getRevision()),this.flatMidpoint_},e.prototype.getSimplifiedGeometryInternal=function(t){var i=[];return i.length=ns(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,t,i,0),new e(i,Lo)},e.prototype.getType=function(){return On},e.prototype.intersectsExtent=function(t){return ws(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=es(this.flatCoordinates,0,t,this.stride),this.changed()},e}(Yo),fa=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}(),ya=function(t){function e(e,i,n){var r=t.call(this)||this;if(r.ends_=[],r.maxDelta_=-1,r.maxDeltaRevision_=-1,Array.isArray(e[0]))r.setCoordinates(e,i);else if(void 0!==i&&n)r.setFlatCoordinates(i,e),r.ends_=n;else{for(var o=r.getLayout(),s=e,a=[],l=[],u=0,h=s.length;u<h;++u){var c=s[u];0===u&&(o=c.getLayout()),_t(a,c.getFlatCoordinates()),l.push(a.length)}r.setFlatCoordinates(o,a),r.ends_=l}return r}return fa(e,t),e.prototype.appendLineString=function(t){this.flatCoordinates?_t(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,i,n){return n<$i(this.getExtent(),t,e)?n:(this.maxDeltaRevision_!=this.getRevision()&&(this.maxDelta_=Math.sqrt($o(this.flatCoordinates,0,this.ends_,this.stride,0)),this.maxDeltaRevision_=this.getRevision()),Qo(this.flatCoordinates,0,this.ends_,this.stride,this.maxDelta_,!1,t,e,i,n))},e.prototype.getCoordinateAtM=function(t,e,i){if(this.layout!=zo&&this.layout!=Go||0===this.flatCoordinates.length)return null;var n=void 0!==e&&e,r=void 0!==i&&i;return function(t,e,i,n,r,o,s){if(s)return ha(t,e,i[i.length-1],n,r,o);var a;if(r<t[n-1])return o?((a=t.slice(0,n))[n-1]=r,a):null;if(t[t.length-1]<r)return o?((a=t.slice(t.length-n))[n-1]=r,a):null;for(var l=0,u=i.length;l<u;++l){var h=i[l];if(e!=h){if(r<t[e+n-1])return null;if(r<=t[h-1])return ha(t,e,h,n,r,!1);e=h}}return null}(this.flatCoordinates,0,this.ends_,this.stride,t,n,r)},e.prototype.getCoordinates=function(){return ls(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 da(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_,i=this.layout,n=[],r=0,o=0,s=e.length;o<s;++o){var a=e[o],l=new da(t.slice(r,a),i);n.push(l),r=a}return n},e.prototype.getFlatMidpoints=function(){for(var t=[],e=this.flatCoordinates,i=0,n=this.ends_,r=this.stride,o=0,s=n.length;o<s;++o){var a=n[o];_t(t,ua(e,i,a,r,.5)),i=a}return t},e.prototype.getSimplifiedGeometryInternal=function(t){var i=[],n=[];return i.length=function(t,e,i,n,r,o,s,a){for(var l=0,u=i.length;l<u;++l){var h=i[l];s=ns(t,e,h,n,r,o,s),a.push(s),e=h}return s}(this.flatCoordinates,0,this.ends_,this.stride,t,i,0,n),new e(i,Lo,n)},e.prototype.getType=function(){return jn},e.prototype.intersectsExtent=function(t){return function(t,e,i,n,r){for(var o=0,s=i.length;o<s;++o){if(ws(t,e,i[o],n,r))return!0;e=i[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 i=is(this.flatCoordinates,0,t,this.stride,this.ends_);this.flatCoordinates.length=0===i.length?0:i[i.length-1],this.changed()},e}(Yo),ga=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}(),ma=function(t){function e(e,i){var n=t.call(this)||this;return i&&!Array.isArray(e[0])?n.setFlatCoordinates(i,e):n.setCoordinates(e,i),n}return ga(e,t),e.prototype.appendPoint=function(t){this.flatCoordinates?_t(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,i,n){if(n<$i(this.getExtent(),t,e))return n;for(var r=this.flatCoordinates,o=this.stride,s=0,a=r.length;s<a;s+=o){var l=De(t,e,r[s],r[s+1]);if(l<n){n=l;for(var u=0;u<o;++u)i[u]=r[s+u];i.length=o}}return n},e.prototype.getCoordinates=function(){return as(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 ys(this.flatCoordinates.slice(t*this.stride,(t+1)*this.stride),this.layout)},e.prototype.getPoints=function(){for(var t=this.flatCoordinates,e=this.layout,i=this.stride,n=[],r=0,o=t.length;r<o;r+=i){var s=new ys(t.slice(r,r+i),e);n.push(s)}return n},e.prototype.getType=function(){return Fn},e.prototype.intersectsExtent=function(t){for(var e=this.flatCoordinates,i=this.stride,n=0,r=e.length;n<r;n+=i){if(tn(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=es(this.flatCoordinates,0,t,this.stride),this.changed()},e}(Yo);function va(t,e,i,n){for(var r=[],o=[1/0,1/0,-1/0,-1/0],s=0,a=i.length;s<a;++s){var l=i[s];o=an(t,e,l[0],n),r.push((o[0]+o[2])/2,(o[1]+o[3])/2),e=l[l.length-1]}return r}var _a=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}(),xa=function(t){function e(e,i,n){var r=t.call(this)||this;if(r.endss_=[],r.flatInteriorPointsRevision_=-1,r.flatInteriorPoints_=null,r.maxDelta_=-1,r.maxDeltaRevision_=-1,r.orientedRevision_=-1,r.orientedFlatCoordinates_=null,!n&&!Array.isArray(e[0])){for(var o=r.getLayout(),s=e,a=[],l=[],u=0,h=s.length;u<h;++u){var c=s[u];0===u&&(o=c.getLayout());for(var p=a.length,d=c.getEnds(),f=0,y=d.length;f<y;++f)d[f]+=p;_t(a,c.getFlatCoordinates()),l.push(d)}i=o,e=a,n=l}return void 0!==i&&n?(r.setFlatCoordinates(i,e),r.endss_=n):r.setCoordinates(e,i),r}return _a(e,t),e.prototype.appendPolygon=function(t){var e;if(this.flatCoordinates){var i=this.flatCoordinates.length;_t(this.flatCoordinates,t.getFlatCoordinates());for(var n=0,r=(e=t.getEnds().slice()).length;n<r;++n)e[n]+=i}else this.flatCoordinates=t.getFlatCoordinates().slice(),e=t.getEnds().slice(),this.endss_.push();this.endss_.push(e),this.changed()},e.prototype.clone=function(){for(var t=this.endss_.length,i=new Array(t),n=0;n<t;++n)i[n]=this.endss_[n].slice();var r=new e(this.flatCoordinates.slice(),this.layout,i);return r.applyProperties(this),r},e.prototype.closestPointXY=function(t,e,i,n){return n<$i(this.getExtent(),t,e)?n:(this.maxDeltaRevision_!=this.getRevision()&&(this.maxDelta_=Math.sqrt(function(t,e,i,n,r){for(var o=0,s=i.length;o<s;++o){var a=i[o];r=$o(t,e,a,n,r),e=a[a.length-1]}return r}(this.flatCoordinates,0,this.endss_,this.stride,0)),this.maxDeltaRevision_=this.getRevision()),function(t,e,i,n,r,o,s,a,l,u,h){for(var c=h||[NaN,NaN],p=0,d=i.length;p<d;++p){var f=i[p];u=Qo(t,e,f,n,r,o,s,a,l,u,c),e=f[f.length-1]}return u}(this.getOrientedFlatCoordinates(),0,this.endss_,this.stride,this.maxDelta_,!0,t,e,i,n))},e.prototype.containsXY=function(t,e){return function(t,e,i,n,r,o){if(0===i.length)return!1;for(var s=0,a=i.length;s<a;++s){var l=i[s];if(vs(t,e,l,n,r,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,i,n){for(var r=0,o=0,s=i.length;o<s;++o){var a=i[o];r+=cs(t,e,a,n),e=a[a.length-1]}return r}(this.getOrientedFlatCoordinates(),0,this.endss_,this.stride)},e.prototype.getCoordinates=function(t){var e;return void 0!==t?Ps(e=this.getOrientedFlatCoordinates().slice(),0,this.endss_,this.stride,t):e=this.flatCoordinates,us(e,0,this.endss_,this.stride)},e.prototype.getEndss=function(){return this.endss_},e.prototype.getFlatInteriorPoints=function(){if(this.flatInteriorPointsRevision_!=this.getRevision()){var t=va(this.flatCoordinates,0,this.endss_,this.stride);this.flatInteriorPoints_=xs(this.getOrientedFlatCoordinates(),0,this.endss_,this.stride,t),this.flatInteriorPointsRevision_=this.getRevision()}return this.flatInteriorPoints_},e.prototype.getInteriorPoints=function(){return new ma(this.getFlatInteriorPoints().slice(),zo)},e.prototype.getOrientedFlatCoordinates=function(){if(this.orientedRevision_!=this.getRevision()){var t=this.flatCoordinates;!function(t,e,i,n,r){for(var o=0,s=i.length;o<s;++o){var a=i[o];if(!Es(t,e,a,n,r))return!1;a.length&&(e=a[a.length-1])}return!0}(t,0,this.endss_,this.stride)?(this.orientedFlatCoordinates_=t.slice(),this.orientedFlatCoordinates_.length=Ps(this.orientedFlatCoordinates_,0,this.endss_,this.stride)):this.orientedFlatCoordinates_=t,this.orientedRevision_=this.getRevision()}return this.orientedFlatCoordinates_},e.prototype.getSimplifiedGeometryInternal=function(t){var i=[],n=[];return i.length=function(t,e,i,n,r,o,s,a){for(var l=0,u=i.length;l<u;++l){var h=i[l],c=[];s=ss(t,e,h,n,r,o,s,c),a.push(c),e=h[h.length-1]}return s}(this.flatCoordinates,0,this.endss_,this.stride,Math.sqrt(t),i,0,n),new e(i,Lo,n)},e.prototype.getPolygon=function(t){if(t<0||this.endss_.length<=t)return null;var e;if(0===t)e=0;else{var i=this.endss_[t-1];e=i[i.length-1]}var n=this.endss_[t].slice(),r=n[n.length-1];if(0!==e)for(var o=0,s=n.length;o<s;++o)n[o]-=e;return new Is(this.flatCoordinates.slice(e,r),this.layout,n)},e.prototype.getPolygons=function(){for(var t=this.layout,e=this.flatCoordinates,i=this.endss_,n=[],r=0,o=0,s=i.length;o<s;++o){var a=i[o].slice(),l=a[a.length-1];if(0!==r)for(var u=0,h=a.length;u<h;++u)a[u]-=r;var c=new Is(e.slice(r,l),t,a);n.push(c),r=l}return n},e.prototype.getType=function(){return Mn},e.prototype.intersectsExtent=function(t){return function(t,e,i,n,r){for(var o=0,s=i.length;o<s;++o){var a=i[o];if(Ss(t,e,a,n,r))return!0;e=a[a.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 i=function(t,e,i,n,r){for(var o=r||[],s=0,a=0,l=i.length;a<l;++a){var u=is(t,e,i[a],n,o[s]);o[s++]=u,e=u[u.length-1]}return o.length=s,o}(this.flatCoordinates,0,t,this.stride,this.endss_);if(0===i.length)this.flatCoordinates.length=0;else{var n=i[i.length-1];this.flatCoordinates.length=0===n.length?0:n[n.length-1]}this.changed()},e}(Yo),ba=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}();function wa(t){for(var e=[],i=0,n=t.length;i<n;++i)e.push(t[i].clone());return e}var Sa=function(t){function e(e){var i=t.call(this)||this;return i.geometries_=e||null,i.changeEventsKeys_=[],i.listenGeometriesChange_(),i}return ba(e,t),e.prototype.unlistenGeometriesChange_=function(){this.changeEventsKeys_.forEach(Ut),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(qt(this.geometries_[t],It,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,i,n){if(n<$i(this.getExtent(),t,e))return n;for(var r=this.geometries_,o=0,s=r.length;o<s;++o)n=r[o].closestPointXY(t,e,i,n);return n},e.prototype.containsXY=function(t,e){for(var i=this.geometries_,n=0,r=i.length;n<r;++n)if(i[n].containsXY(t,e))return!0;return!1},e.prototype.computeExtent=function(t){on(t);for(var e=this.geometries_,i=0,n=e.length;i<n;++i)un(t,e[i].getExtent());return t},e.prototype.getGeometries=function(){return wa(this.geometries_)},e.prototype.getGeometriesArray=function(){return this.geometries_},e.prototype.getGeometriesArrayRecursive=function(){for(var t=[],e=this.geometries_,i=0,n=e.length;i<n;++i)e[i].getType()===this.getType()?t=t.concat(e[i].getGeometriesArrayRecursive()):t.push(e[i]);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 i=[],n=this.geometries_,r=!1,o=0,s=n.length;o<s;++o){var a=n[o],l=a.getSimplifiedGeometry(t);i.push(l),l!==a&&(r=!0)}if(r){var u=new e(null);return u.setGeometriesArray(i),u}return this.simplifiedGeometryMaxMinSquaredTolerance=t,this},e.prototype.getType=function(){return An},e.prototype.intersectsExtent=function(t){for(var e=this.geometries_,i=0,n=e.length;i<n;++i)if(e[i].intersectsExtent(t))return!0;return!1},e.prototype.isEmpty=function(){return 0===this.geometries_.length},e.prototype.rotate=function(t,e){for(var i=this.geometries_,n=0,r=i.length;n<r;++n)i[n].rotate(t,e);this.changed()},e.prototype.scale=function(t,e,i){var n=i;n||(n=mn(this.getExtent()));for(var r=this.geometries_,o=0,s=r.length;o<s;++o)r[o].scale(t,e,n);this.changed()},e.prototype.setGeometries=function(t){this.setGeometriesArray(wa(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_,i=0,n=e.length;i<n;++i)e[i].applyTransform(t);this.changed()},e.prototype.translate=function(t,e){for(var i=this.geometries_,n=0,r=i.length;n<r;++n)i[n].translate(t,e);this.changed()},e.prototype.disposeInternal=function(){this.unlistenGeometriesChange_(),t.prototype.disposeInternal.call(this)},e}(Uo),Ca=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}();function Ta(t,e){if(!t)return null;var i;switch(t.type){case Pn:i=function(t){return new ys(t.coordinates)}(t);break;case On:i=function(t){return new da(t.coordinates)}(t);break;case In:i=function(t){return new Is(t.coordinates)}(t);break;case Fn:i=function(t){return new ma(t.coordinates)}(t);break;case jn:i=function(t){return new ya(t.coordinates)}(t);break;case Mn:i=function(t){return new xa(t.coordinates)}(t);break;case An:i=function(t,e){var i=t.geometries.map((function(t){return Ta(t,e)}));return new Sa(i)}(t);break;default:throw new Error("Unsupported GeoJSON type: "+t.type)}return ea(i,!1,e)}function Ea(t,e){var i,n=(t=ea(t,!0,e)).getType();switch(n){case Pn:i=function(t,e){return{type:"Point",coordinates:t.getCoordinates()}}(t);break;case On:i=function(t,e){return{type:"LineString",coordinates:t.getCoordinates()}}(t);break;case In:i=function(t,e){var i;e&&(i=e.rightHanded);return{type:"Polygon",coordinates:t.getCoordinates(i)}}(t,e);break;case Fn:i=function(t,e){return{type:"MultiPoint",coordinates:t.getCoordinates()}}(t);break;case jn:i=function(t,e){return{type:"MultiLineString",coordinates:t.getCoordinates()}}(t);break;case Mn:i=function(t,e){var i;e&&(i=e.rightHanded);return{type:"MultiPolygon",coordinates:t.getCoordinates(i)}}(t,e);break;case An:i=function(t,e){return{type:"GeometryCollection",geometries:t.getGeometriesArray().map((function(t){var i=Ct({},e);return delete i.featureProjection,Ea(t,i)}))}}(t,e);break;case Ln:i={type:"GeometryCollection",geometries:[]};break;default:throw new Error("Unsupported geometry type: "+n)}return i}var ka=function(t){function e(e){var i=this,n=e||{};return(i=t.call(this)||this).dataProjection=Hn(n.dataProjection?n.dataProjection:"EPSG:4326"),n.featureProjection&&(i.defaultFeatureProjection=Hn(n.featureProjection)),i.geometryName_=n.geometryName,i.extractGeometryName_=n.extractGeometryName,i.supportedMediaTypes=["application/geo+json","application/vnd.geo+json"],i}return Ca(e,t),e.prototype.readFeatureFromObject=function(t,e){var i=null,n=Ta((i="Feature"===t.type?t:{type:"Feature",geometry:t,properties:null}).geometry,e),r=new Qs;return this.geometryName_?r.setGeometryName(this.geometryName_):this.extractGeometryName_&&"geometry_name"in i!==void 0&&r.setGeometryName(i.geometry_name),r.setGeometry(n),"id"in i&&r.setId(i.id),i.properties&&r.setProperties(i.properties,!0),r},e.prototype.readFeaturesFromObject=function(t,e){var i=null;if("FeatureCollection"===t.type){i=[];for(var n=t.features,r=0,o=n.length;r<o;++r)i.push(this.readFeatureFromObject(n[r],e))}else i=[this.readFeatureFromObject(t,e)];return i},e.prototype.readGeometryFromObject=function(t,e){return Ta(t,e)},e.prototype.readProjectionFromObject=function(t){var e,i=t.crs;return i?"name"==i.type?e=Hn(i.properties.name):"EPSG"===i.type?e=Hn("EPSG:"+i.properties.code):Fe(!1,36):e=this.dataProjection,e},e.prototype.writeFeatureObject=function(t,e){e=this.adaptOptions(e);var i={type:"Feature",geometry:null,properties:null},n=t.getId();if(void 0!==n&&(i.id=n),!t.hasProperties())return i;var r=t.getProperties(),o=t.getGeometry();return o&&(i.geometry=Ea(o,e),delete r[t.getGeometryName()]),kt(r)||(i.properties=r),i},e.prototype.writeFeaturesObject=function(t,e){e=this.adaptOptions(e);for(var i=[],n=0,r=t.length;n<r;++n)i.push(this.writeFeatureObject(t[n],e));return{type:"FeatureCollection",features:i}},e.prototype.writeGeometryObject=function(t,e){return Ea(t,this.adaptOptions(e))},e}(la),Pa=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}(),Oa="fraction",Ra="pixels",Ia="bottom-left",Fa="bottom-right",ja="top-left",Ma="top-right",Aa=0,La=1,Da=2,za=3,Ga=function(){function t(t){this.opacity_=t.opacity,this.rotateWithView_=t.rotateWithView,this.rotation_=t.rotation,this.scale_=t.scale,this.scaleArray_=Ns(t.scale),this.displacement_=t.displacement}return t.prototype.clone=function(){var e=this.getScale();return new t({opacity:this.getOpacity(),scale:Array.isArray(e)?e.slice():e,rotation:this.getRotation(),rotateWithView:this.getRotateWithView(),displacement:this.getDisplacement().slice()})},t.prototype.getOpacity=function(){return this.opacity_},t.prototype.getRotateWithView=function(){return this.rotateWithView_},t.prototype.getRotation=function(){return this.rotation_},t.prototype.getScale=function(){return this.scale_},t.prototype.getScaleArray=function(){return this.scaleArray_},t.prototype.getDisplacement=function(){return this.displacement_},t.prototype.getAnchor=function(){return Zt()},t.prototype.getImage=function(t){return Zt()},t.prototype.getHitDetectionImage=function(){return Zt()},t.prototype.getPixelRatio=function(t){return 1},t.prototype.getImageState=function(){return Zt()},t.prototype.getImageSize=function(){return Zt()},t.prototype.getOrigin=function(){return Zt()},t.prototype.getSize=function(){return Zt()},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_=Ns(t)},t.prototype.listenImageChange=function(t){Zt()},t.prototype.load=function(){Zt()},t.prototype.unlistenImageChange=function(t){Zt()},t}(),Na=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}(),Ba=function(t){function e(e,i,n,r){var o=t.call(this)||this;return o.extent=e,o.pixelRatio_=n,o.resolution=i,o.state=r,o}return Na(e,t),e.prototype.changed=function(){this.dispatchEvent(It)},e.prototype.getExtent=function(){return this.extent},e.prototype.getImage=function(){return Zt()},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(){Zt()},e}(Rt),Wa=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}();function qa(t,e,i){var n=t;if(n.src&&he){var r=n.decode(),o=!0;return r.then((function(){o&&e()})).catch((function(t){o&&("EncodingError"===t.name&&"Invalid image type."===t.message?e():i())})),function(){o=!1}}var s=[Vt(n,Gt,e),Vt(n,Ft,i)];return function(){s.forEach(Ut)}}!function(t){function e(e,i,n,r,o,s){var a=t.call(this,e,i,n,Aa)||this;return a.src_=r,a.image_=new Image,null!==o&&(a.image_.crossOrigin=o),a.unlisten_=null,a.state=Aa,a.imageLoadFunction_=s,a}Wa(e,t),e.prototype.getImage=function(){return this.image_},e.prototype.handleImageError_=function(){this.state=za,this.unlistenImage_(),this.changed()},e.prototype.handleImageLoad_=function(){void 0===this.resolution&&(this.resolution=xn(this.extent)/this.image_.height),this.state=Da,this.unlistenImage_(),this.changed()},e.prototype.load=function(){this.state!=Aa&&this.state!=za||(this.state=La,this.changed(),this.imageLoadFunction_(this,this.src_),this.unlisten_=qa(this.image_,this.handleImageLoad_.bind(this),this.handleImageError_.bind(this)))},e.prototype.setImage=function(t){this.image_=t,this.resolution=xn(this.extent)/this.image_.height},e.prototype.unlistenImage_=function(){this.unlisten_&&(this.unlisten_(),this.unlisten_=null)}}(Ba);var Va=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}(),Ua=null,Xa=function(t){function e(e,i,n,r,o,s){var a=t.call(this)||this;return a.hitDetectionImage_=null,a.image_=e||new Image,null!==r&&(a.image_.crossOrigin=r),a.canvas_={},a.color_=s,a.unlisten_=null,a.imageState_=o,a.size_=n,a.src_=i,a.tainted_,a}return Va(e,t),e.prototype.isTainted_=function(){if(void 0===this.tainted_&&this.imageState_===Da){Ua||(Ua=pe(1,1)),Ua.drawImage(this.image_,0,0);try{Ua.getImageData(0,0,1,1),this.tainted_=!1}catch(t){Ua=null,this.tainted_=!0}}return!0===this.tainted_},e.prototype.dispatchChangeEvent_=function(){this.dispatchEvent(It)},e.prototype.handleImageError_=function(){this.imageState_=za,this.unlistenImage_(),this.dispatchChangeEvent_()},e.prototype.handleImageLoad_=function(){this.imageState_=Da,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_()},e.prototype.getImage=function(t){return this.replaceColor_(t),this.canvas_[t]?this.canvas_[t]:this.image_},e.prototype.getPixelRatio=function(t){return this.replaceColor_(t),this.canvas_[t]?t:1},e.prototype.getImageState=function(){return this.imageState_},e.prototype.getHitDetectionImage=function(){if(!this.hitDetectionImage_)if(this.isTainted_()){var t=this.size_[0],e=this.size_[1],i=pe(t,e);i.fillRect(0,0,t,e),this.hitDetectionImage_=i.canvas}else this.hitDetectionImage_=this.image_;return this.hitDetectionImage_},e.prototype.getSize=function(){return this.size_},e.prototype.getSrc=function(){return this.src_},e.prototype.load=function(){if(this.imageState_==Aa){this.imageState_=La;try{this.image_.src=this.src_}catch(t){this.handleImageError_()}this.unlisten_=qa(this.image_,this.handleImageLoad_.bind(this),this.handleImageError_.bind(this))}},e.prototype.replaceColor_=function(t){if(this.color_&&!this.canvas_[t]&&this.imageState_===Da){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 i=e.getContext("2d");if(i.scale(t,t),i.drawImage(this.image_,0,0),i.globalCompositeOperation="multiply","multiply"===i.globalCompositeOperation||this.isTainted_())i.fillStyle=Cr(this.color_),i.fillRect(0,0,e.width/t,e.height/t),i.globalCompositeOperation="destination-in",i.drawImage(this.image_,0,0);else{for(var n=i.getImageData(0,0,e.width,e.height),r=n.data,o=this.color_[0]/255,s=this.color_[1]/255,a=this.color_[2]/255,l=this.color_[3],u=0,h=r.length;u<h;u+=4)r[u]*=o,r[u+1]*=s,r[u+2]*=a,r[u+3]*=l;i.putImageData(n,0,0)}}},e.prototype.unlistenImage_=function(){this.unlisten_&&(this.unlisten_(),this.unlisten_=null)},e}(Rt);var Ka=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}(),Ya=function(t){function e(e){var i=this,n=e||{},r=void 0!==n.opacity?n.opacity:1,o=void 0!==n.rotation?n.rotation:0,s=void 0!==n.scale?n.scale:1,a=void 0!==n.rotateWithView&&n.rotateWithView;(i=t.call(this,{opacity:r,rotation:o,scale:s,displacement:void 0!==n.displacement?n.displacement:[0,0],rotateWithView:a})||this).anchor_=void 0!==n.anchor?n.anchor:[.5,.5],i.normalizedAnchor_=null,i.anchorOrigin_=void 0!==n.anchorOrigin?n.anchorOrigin:ja,i.anchorXUnits_=void 0!==n.anchorXUnits?n.anchorXUnits:Oa,i.anchorYUnits_=void 0!==n.anchorYUnits?n.anchorYUnits:Oa,i.crossOrigin_=void 0!==n.crossOrigin?n.crossOrigin:null;var l=void 0!==n.img?n.img:null,u=void 0!==n.imgSize?n.imgSize:null,h=n.src;Fe(!(void 0!==h&&l),4),Fe(!l||l&&u,5),void 0!==h&&0!==h.length||!l||(h=l.src||$t(l)),Fe(void 0!==h&&h.length>0,6);var c=void 0!==n.src?Aa:Da;return i.color_=void 0!==n.color?Pr(n.color):null,i.iconImage_=function(t,e,i,n,r,o){var s=Fr.get(e,n,o);return s||(s=new Xa(t,e,i,n,r,o),Fr.set(e,n,o,s)),s}(l,h,u,i.crossOrigin_,c,i.color_),i.offset_=void 0!==n.offset?n.offset:[0,0],i.offsetOrigin_=void 0!==n.offsetOrigin?n.offsetOrigin:ja,i.origin_=null,i.size_=void 0!==n.size?n.size:null,i}return Ka(e,t),e.prototype.clone=function(){var t=this.getScale();return new e({anchor:this.anchor_.slice(),anchorOrigin:this.anchorOrigin_,anchorXUnits:this.anchorXUnits_,anchorYUnits:this.anchorYUnits_,crossOrigin:this.crossOrigin_,color:this.color_&&this.color_.slice?this.color_.slice():this.color_||void 0,src:this.getSrc(),offset:this.offset_.slice(),offsetOrigin:this.offsetOrigin_,size:null!==this.size_?this.size_.slice():void 0,opacity:this.getOpacity(),scale:Array.isArray(t)?t.slice():t,rotation:this.getRotation(),rotateWithView:this.getRotateWithView()})},e.prototype.getAnchor=function(){if(this.normalizedAnchor_)return this.normalizedAnchor_;var t=this.anchor_,e=this.getSize();if(this.anchorXUnits_==Oa||this.anchorYUnits_==Oa){if(!e)return null;t=this.anchor_.slice(),this.anchorXUnits_==Oa&&(t[0]*=e[0]),this.anchorYUnits_==Oa&&(t[1]*=e[1])}if(this.anchorOrigin_!=ja){if(!e)return null;t===this.anchor_&&(t=this.anchor_.slice()),this.anchorOrigin_!=Ma&&this.anchorOrigin_!=Fa||(t[0]=-t[0]+e[0]),this.anchorOrigin_!=Ia&&this.anchorOrigin_!=Fa||(t[1]=-t[1]+e[1])}var i=this.getDisplacement();return t[0]-=i[0],t[1]+=i[1],this.normalizedAnchor_=t,this.normalizedAnchor_},e.prototype.setAnchor=function(t){this.anchor_=t,this.normalizedAnchor_=null},e.prototype.getColor=function(){return this.color_},e.prototype.getImage=function(t){return this.iconImage_.getImage(t)},e.prototype.getPixelRatio=function(t){return this.iconImage_.getPixelRatio(t)},e.prototype.getImageSize=function(){return this.iconImage_.getSize()},e.prototype.getImageState=function(){return this.iconImage_.getImageState()},e.prototype.getHitDetectionImage=function(){return this.iconImage_.getHitDetectionImage()},e.prototype.getOrigin=function(){if(this.origin_)return this.origin_;var t=this.offset_;if(this.offsetOrigin_!=ja){var e=this.getSize(),i=this.iconImage_.getSize();if(!e||!i)return null;t=t.slice(),this.offsetOrigin_!=Ma&&this.offsetOrigin_!=Fa||(t[0]=i[0]-e[0]-t[0]),this.offsetOrigin_!=Ia&&this.offsetOrigin_!=Fa||(t[1]=i[1]-e[1]-t[1])}return this.origin_=t,this.origin_},e.prototype.getSrc=function(){return this.iconImage_.getSrc()},e.prototype.getSize=function(){return this.size_?this.size_:this.iconImage_.getSize()},e.prototype.listenImageChange=function(t){this.iconImage_.addEventListener(It,t)},e.prototype.load=function(){this.iconImage_.load()},e.prototype.unlistenImageChange=function(t){this.iconImage_.removeEventListener(It,t)},e}(Ga),Za=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}();function Ha(t){return Array.isArray(t)?Rr(t):t}var $a=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}(),Ja=function(t){function e(e){var i=this,n=void 0!==e.rotateWithView&&e.rotateWithView;return(i=t.call(this,{opacity:1,rotateWithView:n,rotation:void 0!==e.rotation?e.rotation:0,scale:void 0!==e.scale?e.scale:1,displacement:void 0!==e.displacement?e.displacement:[0,0]})||this).canvas_=void 0,i.hitDetectionCanvas_=null,i.fill_=void 0!==e.fill?e.fill:null,i.origin_=[0,0],i.points_=e.points,i.radius_=void 0!==e.radius?e.radius:e.radius1,i.radius2_=e.radius2,i.angle_=void 0!==e.angle?e.angle:0,i.stroke_=void 0!==e.stroke?e.stroke:null,i.anchor_=null,i.size_=null,i.renderOptions_=null,i.render(),i}return $a(e,t),e.prototype.clone=function(){var t=this.getScale(),i=new e({fill:this.getFill()?this.getFill().clone():void 0,points:this.getPoints(),radius:this.getRadius(),radius2:this.getRadius2(),angle:this.getAngle(),stroke:this.getStroke()?this.getStroke().clone():void 0,rotation:this.getRotation(),rotateWithView:this.getRotateWithView(),scale:Array.isArray(t)?t.slice():t,displacement:this.getDisplacement().slice()});return i.setOpacity(this.getOpacity()),i},e.prototype.getAnchor=function(){return this.anchor_},e.prototype.getAngle=function(){return this.angle_},e.prototype.getFill=function(){return this.fill_},e.prototype.getHitDetectionImage=function(){return this.hitDetectionCanvas_||this.createHitDetectionCanvas_(this.renderOptions_),this.hitDetectionCanvas_},e.prototype.getImage=function(t){var e=this.canvas_[t];if(!e){var i=this.renderOptions_,n=pe(i.size*t,i.size*t);this.draw_(i,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 Da},e.prototype.getOrigin=function(){return this.origin_},e.prototype.getPoints=function(){return this.points_},e.prototype.getRadius=function(){return this.radius_},e.prototype.getRadius2=function(){return this.radius2_},e.prototype.getSize=function(){return this.size_},e.prototype.getStroke=function(){return this.stroke_},e.prototype.listenImageChange=function(t){},e.prototype.load=function(){},e.prototype.unlistenImageChange=function(t){},e.prototype.calculateLineJoinSize_=function(t,e,i){if(0===e||this.points_===1/0||"bevel"!==t&&"miter"!==t)return e;var n=this.radius_,r=void 0===this.radius2_?n:this.radius2_;if(n<r){var o=n;n=r,r=o}var s=void 0===this.radius2_?this.points_:2*this.points_,a=2*Math.PI/s,l=r*Math.sin(a),u=n-Math.sqrt(r*r-l*l),h=Math.sqrt(l*l+u*u),c=h/l;if("miter"===t&&c<=i)return c*e;var p=e/2/c,d=e/2*(u/h),f=Math.sqrt((n+p)*(n+p)+d*d)-n;if(void 0===this.radius2_||"bevel"===t)return 2*f;var y=n*Math.sin(a),g=r-Math.sqrt(n*n-y*y),m=Math.sqrt(y*y+g*g)/y;if(m<=i){var v=m*e/2-r-n;return 2*Math.max(f,v)}return 2*f},e.prototype.createRenderOptions=function(){var t,e="round",i=0,n=null,r=0,o=0;this.stroke_&&(null===(t=this.stroke_.getColor())&&(t="#000"),t=Ha(t),void 0===(o=this.stroke_.getWidth())&&(o=1),n=this.stroke_.getLineDash(),r=this.stroke_.getLineDashOffset(),void 0===(e=this.stroke_.getLineJoin())&&(e="round"),void 0===(i=this.stroke_.getMiterLimit())&&(i=10));var s=this.calculateLineJoinSize_(e,o,i),a=Math.max(this.radius_,this.radius2_||0);return{strokeStyle:t,strokeWidth:o,size:Math.ceil(2*a+s),lineDash:n,lineDashOffset:r,lineJoin:e,miterLimit:i}},e.prototype.render=function(){this.renderOptions_=this.createRenderOptions();var t=this.renderOptions_.size,e=this.getDisplacement();this.canvas_={},this.anchor_=[t/2-e[0],t/2+e[1]],this.size_=[t,t]},e.prototype.draw_=function(t,e,i){if(e.scale(i,i),e.translate(t.size/2,t.size/2),this.createPath_(e),this.fill_){var n=this.fill_.getColor();null===n&&(n="#000"),e.fillStyle=Ha(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(),i=0;if("string"==typeof e&&(e=Pr(e)),null===e?i=1:Array.isArray(e)&&(i=4===e.length?e[3]:1),0===i){var n=pe(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_,i=this.radius_;if(e===1/0)t.arc(0,0,i,0,2*Math.PI);else{var n=void 0===this.radius2_?i:this.radius2_;void 0!==this.radius2_&&(e*=2);for(var r=this.angle_-Math.PI/2,o=2*Math.PI/e,s=0;s<e;s++){var a=r+s*o,l=s%2==0?i:n;t.lineTo(l*Math.cos(a),l*Math.sin(a))}t.closePath()}},e.prototype.drawHitDetectionCanvas_=function(t,e){e.translate(t.size/2,t.size/2),this.createPath_(e),e.fillStyle="#000",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}(Ga),Qa=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}(),tl=function(t){function e(e){var i=e||{};return t.call(this,{points:1/0,fill:i.fill,radius:i.radius,stroke:i.stroke,scale:void 0!==i.scale?i.scale:1,rotation:void 0!==i.rotation?i.rotation:0,rotateWithView:void 0!==i.rotateWithView&&i.rotateWithView,displacement:void 0!==i.displacement?i.displacement:[0,0]})||this}return Qa(e,t),e.prototype.clone=function(){var t=this.getScale(),i=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()});return i.setOpacity(this.getOpacity()),i},e.prototype.setRadius=function(t){this.radius_=t,this.render()},e}(Ja),el=function(){function t(t){var e=t||{};this.geometry_=null,this.geometryFunction_=ol,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_=ol,this.geometry_=t},t.prototype.setZIndex=function(t){this.zIndex_=t},t}();var il=null;function nl(t,e){if(!il){var i=new Pa({color:"rgba(255,255,255,0.4)"}),n=new Za({color:"#3399CC",width:1.25});il=[new el({image:new tl({fill:i,stroke:n,radius:5}),fill:i,stroke:n})]}return il}function rl(){var t={},e=[255,255,255,1],i=[0,153,255,1];return t[In]=[new el({fill:new Pa({color:[255,255,255,.5]})})],t[Mn]=t[In],t[On]=[new el({stroke:new Za({color:e,width:5})}),new el({stroke:new Za({color:i,width:3})})],t[jn]=t[On],t[Ln]=t[In].concat(t[On]),t[Pn]=[new el({image:new tl({radius:6,fill:new Pa({color:i}),stroke:new Za({color:e,width:1.5})}),zIndex:1/0})],t[Fn]=t[Pn],t[An]=t[In].concat(t[On],t[Pn]),t}function ol(t){return t.getGeometry()}var sl=el,al="point",ll="line",ul=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_=Ns(void 0!==e.scale?e.scale:1),this.text_=e.text,this.textAlign_=e.textAlign,this.textBaseline_=e.textBaseline,this.fill_=void 0!==e.fill?e.fill:new Pa({color:"#333"}),this.maxAngle_=void 0!==e.maxAngle?e.maxAngle:Math.PI/4,this.placement_=void 0!==e.placement?e.placement:al,this.overflow_=!!e.overflow,this.stroke_=void 0!==e.stroke?e.stroke:null,this.offsetX_=void 0!==e.offsetX?e.offsetX:0,this.offsetY_=void 0!==e.offsetY?e.offsetY:0,this.backgroundFill_=e.backgroundFill?e.backgroundFill:null,this.backgroundStroke_=e.backgroundStroke?e.backgroundStroke:null,this.padding_=void 0===e.padding?null:e.padding}return t.prototype.clone=function(){var e=this.getScale();return new t({font:this.getFont(),placement:this.getPlacement(),maxAngle:this.getMaxAngle(),overflow:this.getOverflow(),rotation:this.getRotation(),rotateWithView:this.getRotateWithView(),scale:Array.isArray(e)?e.slice():e,text:this.getText(),textAlign:this.getTextAlign(),textBaseline:this.getTextBaseline(),fill:this.getFill()?this.getFill().clone():void 0,stroke:this.getStroke()?this.getStroke().clone():void 0,offsetX:this.getOffsetX(),offsetY:this.getOffsetY(),backgroundFill:this.getBackgroundFill()?this.getBackgroundFill().clone():void 0,backgroundStroke:this.getBackgroundStroke()?this.getBackgroundStroke().clone():void 0,padding:this.getPadding()})},t.prototype.getOverflow=function(){return this.overflow_},t.prototype.getFont=function(){return this.font_},t.prototype.getMaxAngle=function(){return this.maxAngle_},t.prototype.getPlacement=function(){return this.placement_},t.prototype.getOffsetX=function(){return this.offsetX_},t.prototype.getOffsetY=function(){return this.offsetY_},t.prototype.getFill=function(){return this.fill_},t.prototype.getRotateWithView=function(){return this.rotateWithView_},t.prototype.getRotation=function(){return this.rotation_},t.prototype.getScale=function(){return this.scale_},t.prototype.getScaleArray=function(){return this.scaleArray_},t.prototype.getStroke=function(){return this.stroke_},t.prototype.getText=function(){return this.text_},t.prototype.getTextAlign=function(){return this.textAlign_},t.prototype.getTextBaseline=function(){return this.textBaseline_},t.prototype.getBackgroundFill=function(){return this.backgroundFill_},t.prototype.getBackgroundStroke=function(){return this.backgroundStroke_},t.prototype.getPadding=function(){return this.padding_},t.prototype.setOverflow=function(t){this.overflow_=t},t.prototype.setFont=function(t){this.font_=t},t.prototype.setMaxAngle=function(t){this.maxAngle_=t},t.prototype.setOffsetX=function(t){this.offsetX_=t},t.prototype.setOffsetY=function(t){this.offsetY_=t},t.prototype.setPlacement=function(t){this.placement_=t},t.prototype.setRotateWithView=function(t){this.rotateWithView_=t},t.prototype.setFill=function(t){this.fill_=t},t.prototype.setRotation=function(t){this.rotation_=t},t.prototype.setScale=function(t){this.scale_=t,this.scaleArray_=Ns(void 0!==t?t:1)},t.prototype.setStroke=function(t){this.stroke_=t},t.prototype.setText=function(t){this.text_=t},t.prototype.setTextAlign=function(t){this.textAlign_=t},t.prototype.setTextBaseline=function(t){this.textBaseline_=t},t.prototype.setBackgroundFill=function(t){this.backgroundFill_=t},t.prototype.setBackgroundStroke=function(t){this.backgroundStroke_=t},t.prototype.setPadding=function(t){this.padding_=t},t}(),hl={
|
29
29
|
/*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh <https://feross.org/opensource> */
|
30
|
-
read:function(t,e,i,n,r){var o,s,a=8*r-n-1,l=(1<<a)-1,u=l>>1,h=-7,c=i?r-1:0,p=i?-1:1,d=t[e+c];for(c+=p,o=d&(1<<-h)-1,d>>=-h,h+=a;h>0;o=256*o+t[e+c],c+=p,h-=8);for(s=o&(1<<-h)-1,o>>=-h,h+=n;h>0;s=256*s+t[e+c],c+=p,h-=8);if(0===o)o=1-u;else{if(o===l)return s?NaN:1/0*(d?-1:1);s+=Math.pow(2,n),o-=u}return(d?-1:1)*s*Math.pow(2,o-n)},write:function(t,e,i,n,r,o){var s,a,l,u=8*o-r-1,h=(1<<u)-1,c=h>>1,p=23===r?Math.pow(2,-24)-Math.pow(2,-77):0,d=n?0:o-1,f=n?1:-1,y=e<0||0===e&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(a=isNaN(e)?1:0,s=h):(s=Math.floor(Math.log(e)/Math.LN2),e*(l=Math.pow(2,-s))<1&&(s--,l*=2),(e+=s+c>=1?p/l:p*Math.pow(2,1-c))*l>=2&&(s++,l/=2),s+c>=h?(a=0,s=h):s+c>=1?(a=(e*l-1)*Math.pow(2,r),s+=c):(a=e*Math.pow(2,c-1)*Math.pow(2,r),s=0));r>=8;t[i+d]=255&a,d+=f,a/=256,r-=8);for(s=s<<r|a,u+=r;u>0;t[i+d]=255&s,d+=f,s/=256,u-=8);t[i+d-f]|=128*y}},ul=cl,hl=ll;function cl(t){this.buf=ArrayBuffer.isView&&ArrayBuffer.isView(t)?t:new Uint8Array(t||0),this.pos=0,this.type=0,this.length=this.buf.length}cl.Varint=0,cl.Fixed64=1,cl.Bytes=2,cl.Fixed32=5;var pl="undefined"==typeof TextDecoder?null:new TextDecoder("utf8");function dl(t){return t.type===cl.Bytes?t.readVarint()+t.pos:t.pos+1}function fl(t,e,i){return i?4294967296*e+(t>>>0):4294967296*(e>>>0)+(t>>>0)}function yl(t,e,i){var n=e<=16383?1:e<=2097151?2:e<=268435455?3:Math.floor(Math.log(e)/(7*Math.LN2));i.realloc(n);for(var r=i.pos-1;r>=t;r--)i.buf[r+n]=i.buf[r]}function gl(t,e){for(var i=0;i<t.length;i++)e.writeVarint(t[i])}function ml(t,e){for(var i=0;i<t.length;i++)e.writeSVarint(t[i])}function vl(t,e){for(var i=0;i<t.length;i++)e.writeFloat(t[i])}function _l(t,e){for(var i=0;i<t.length;i++)e.writeDouble(t[i])}function xl(t,e){for(var i=0;i<t.length;i++)e.writeBoolean(t[i])}function bl(t,e){for(var i=0;i<t.length;i++)e.writeFixed32(t[i])}function wl(t,e){for(var i=0;i<t.length;i++)e.writeSFixed32(t[i])}function Sl(t,e){for(var i=0;i<t.length;i++)e.writeFixed64(t[i])}function Cl(t,e){for(var i=0;i<t.length;i++)e.writeSFixed64(t[i])}function Tl(t,e){return(t[e]|t[e+1]<<8|t[e+2]<<16)+16777216*t[e+3]}function El(t,e,i){t[i]=e,t[i+1]=e>>>8,t[i+2]=e>>>16,t[i+3]=e>>>24}function kl(t,e){return(t[e]|t[e+1]<<8|t[e+2]<<16)+(t[e+3]<<24)}cl.prototype={destroy:function(){this.buf=null},readFields:function(t,e,i){for(i=i||this.length;this.pos<i;){var n=this.readVarint(),r=n>>3,o=this.pos;this.type=7&n,t(r,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=Tl(this.buf,this.pos);return this.pos+=4,t},readSFixed32:function(){var t=kl(this.buf,this.pos);return this.pos+=4,t},readFixed64:function(){var t=Tl(this.buf,this.pos)+4294967296*Tl(this.buf,this.pos+4);return this.pos+=8,t},readSFixed64:function(){var t=Tl(this.buf,this.pos)+4294967296*kl(this.buf,this.pos+4);return this.pos+=8,t},readFloat:function(){var t=hl.read(this.buf,this.pos,!0,23,4);return this.pos+=4,t},readDouble:function(){var t=hl.read(this.buf,this.pos,!0,52,8);return this.pos+=8,t},readVarint:function(t){var e,i,n=this.buf;return e=127&(i=n[this.pos++]),i<128?e:(e|=(127&(i=n[this.pos++]))<<7,i<128?e:(e|=(127&(i=n[this.pos++]))<<14,i<128?e:(e|=(127&(i=n[this.pos++]))<<21,i<128?e:function(t,e,i){var n,r,o=i.buf;if(r=o[i.pos++],n=(112&r)>>4,r<128)return fl(t,n,e);if(r=o[i.pos++],n|=(127&r)<<3,r<128)return fl(t,n,e);if(r=o[i.pos++],n|=(127&r)<<10,r<128)return fl(t,n,e);if(r=o[i.pos++],n|=(127&r)<<17,r<128)return fl(t,n,e);if(r=o[i.pos++],n|=(127&r)<<24,r<128)return fl(t,n,e);if(r=o[i.pos++],n|=(1&r)<<31,r<128)return fl(t,n,e);throw new Error("Expected varint not more than 10 bytes")}(e|=(15&(i=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&&pl?function(t,e,i){return pl.decode(t.subarray(e,i))}(this.buf,e,t):function(t,e,i){var n="",r=e;for(;r<i;){var o,s,a,l=t[r],u=null,h=l>239?4:l>223?3:l>191?2:1;if(r+h>i)break;1===h?l<128&&(u=l):2===h?128==(192&(o=t[r+1]))&&(u=(31&l)<<6|63&o)<=127&&(u=null):3===h?(o=t[r+1],s=t[r+2],128==(192&o)&&128==(192&s)&&((u=(15&l)<<12|(63&o)<<6|63&s)<=2047||u>=55296&&u<=57343)&&(u=null)):4===h&&(o=t[r+1],s=t[r+2],a=t[r+3],128==(192&o)&&128==(192&s)&&128==(192&a)&&((u=(15&l)<<18|(63&o)<<12|(63&s)<<6|63&a)<=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),r+=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!==cl.Bytes)return t.push(this.readVarint(e));var i=dl(this);for(t=t||[];this.pos<i;)t.push(this.readVarint(e));return t},readPackedSVarint:function(t){if(this.type!==cl.Bytes)return t.push(this.readSVarint());var e=dl(this);for(t=t||[];this.pos<e;)t.push(this.readSVarint());return t},readPackedBoolean:function(t){if(this.type!==cl.Bytes)return t.push(this.readBoolean());var e=dl(this);for(t=t||[];this.pos<e;)t.push(this.readBoolean());return t},readPackedFloat:function(t){if(this.type!==cl.Bytes)return t.push(this.readFloat());var e=dl(this);for(t=t||[];this.pos<e;)t.push(this.readFloat());return t},readPackedDouble:function(t){if(this.type!==cl.Bytes)return t.push(this.readDouble());var e=dl(this);for(t=t||[];this.pos<e;)t.push(this.readDouble());return t},readPackedFixed32:function(t){if(this.type!==cl.Bytes)return t.push(this.readFixed32());var e=dl(this);for(t=t||[];this.pos<e;)t.push(this.readFixed32());return t},readPackedSFixed32:function(t){if(this.type!==cl.Bytes)return t.push(this.readSFixed32());var e=dl(this);for(t=t||[];this.pos<e;)t.push(this.readSFixed32());return t},readPackedFixed64:function(t){if(this.type!==cl.Bytes)return t.push(this.readFixed64());var e=dl(this);for(t=t||[];this.pos<e;)t.push(this.readFixed64());return t},readPackedSFixed64:function(t){if(this.type!==cl.Bytes)return t.push(this.readSFixed64());var e=dl(this);for(t=t||[];this.pos<e;)t.push(this.readSFixed64());return t},skip:function(t){var e=7&t;if(e===cl.Varint)for(;this.buf[this.pos++]>127;);else if(e===cl.Bytes)this.pos=this.readVarint()+this.pos;else if(e===cl.Fixed32)this.pos+=4;else{if(e!==cl.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 i=new Uint8Array(e);i.set(this.buf),this.buf=i,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),El(this.buf,t,this.pos),this.pos+=4},writeSFixed32:function(t){this.realloc(4),El(this.buf,t,this.pos),this.pos+=4},writeFixed64:function(t){this.realloc(8),El(this.buf,-1&t,this.pos),El(this.buf,Math.floor(2.3283064365386963e-10*t),this.pos+4),this.pos+=8},writeSFixed64:function(t){this.realloc(8),El(this.buf,-1&t,this.pos),El(this.buf,Math.floor(2.3283064365386963e-10*t),this.pos+4),this.pos+=8},writeVarint:function(t){(t=+t||0)>268435455||t<0?function(t,e){var i,n;t>=0?(i=t%4294967296|0,n=t/4294967296|0):(n=~(-t/4294967296),4294967295^(i=~(-t%4294967296))?i=i+1|0:(i=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,i){i.buf[i.pos++]=127&t|128,t>>>=7,i.buf[i.pos++]=127&t|128,t>>>=7,i.buf[i.pos++]=127&t|128,t>>>=7,i.buf[i.pos++]=127&t|128,t>>>=7,i.buf[i.pos]=127&t}(i,0,e),function(t,e){var i=(7&t)<<4;if(e.buf[e.pos++]|=i|((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,i){for(var n,r,o=0;o<e.length;o++){if((n=e.charCodeAt(o))>55295&&n<57344){if(!r){n>56319||o+1===e.length?(t[i++]=239,t[i++]=191,t[i++]=189):r=n;continue}if(n<56320){t[i++]=239,t[i++]=191,t[i++]=189,r=n;continue}n=r-55296<<10|n-56320|65536,r=null}else r&&(t[i++]=239,t[i++]=191,t[i++]=189,r=null);n<128?t[i++]=n:(n<2048?t[i++]=n>>6|192:(n<65536?t[i++]=n>>12|224:(t[i++]=n>>18|240,t[i++]=n>>12&63|128),t[i++]=n>>6&63|128),t[i++]=63&n|128)}return i}(this.buf,t,this.pos);var i=this.pos-e;i>=128&&yl(e,i,this),this.pos=e-1,this.writeVarint(i),this.pos+=i},writeFloat:function(t){this.realloc(4),hl.write(this.buf,t,this.pos,!0,23,4),this.pos+=4},writeDouble:function(t){this.realloc(8),hl.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 i=0;i<e;i++)this.buf[this.pos++]=t[i]},writeRawMessage:function(t,e){this.pos++;var i=this.pos;t(e,this);var n=this.pos-i;n>=128&&yl(i,n,this),this.pos=i-1,this.writeVarint(n),this.pos+=n},writeMessage:function(t,e,i){this.writeTag(t,cl.Bytes),this.writeRawMessage(e,i)},writePackedVarint:function(t,e){e.length&&this.writeMessage(t,gl,e)},writePackedSVarint:function(t,e){e.length&&this.writeMessage(t,ml,e)},writePackedBoolean:function(t,e){e.length&&this.writeMessage(t,xl,e)},writePackedFloat:function(t,e){e.length&&this.writeMessage(t,vl,e)},writePackedDouble:function(t,e){e.length&&this.writeMessage(t,_l,e)},writePackedFixed32:function(t,e){e.length&&this.writeMessage(t,bl,e)},writePackedSFixed32:function(t,e){e.length&&this.writeMessage(t,wl,e)},writePackedFixed64:function(t,e){e.length&&this.writeMessage(t,Sl,e)},writePackedSFixed64:function(t,e){e.length&&this.writeMessage(t,Cl,e)},writeBytesField:function(t,e){this.writeTag(t,cl.Bytes),this.writeBytes(e)},writeFixed32Field:function(t,e){this.writeTag(t,cl.Fixed32),this.writeFixed32(e)},writeSFixed32Field:function(t,e){this.writeTag(t,cl.Fixed32),this.writeSFixed32(e)},writeFixed64Field:function(t,e){this.writeTag(t,cl.Fixed64),this.writeFixed64(e)},writeSFixed64Field:function(t,e){this.writeTag(t,cl.Fixed64),this.writeSFixed64(e)},writeVarintField:function(t,e){this.writeTag(t,cl.Varint),this.writeVarint(e)},writeSVarintField:function(t,e){this.writeTag(t,cl.Varint),this.writeSVarint(e)},writeStringField:function(t,e){this.writeTag(t,cl.Bytes),this.writeString(e)},writeFloatField:function(t,e){this.writeTag(t,cl.Fixed32),this.writeFloat(e)},writeDoubleField:function(t,e){this.writeTag(t,cl.Fixed64),this.writeDouble(e)},writeBooleanField:function(t,e){this.writeVarintField(t,Boolean(e))}};var Pl=[1,0,0,1,0,0],Ol=function(){function t(t,e,i,n,r){this.extent_,this.id_=r,this.type_=t,this.flatCoordinates_=e,this.flatInteriorPoints_=null,this.flatMidpoints_=null,this.ends_=i,this.properties_=n}return t.prototype.get=function(t){return this.properties_[t]},t.prototype.getExtent=function(){return this.extent_||(this.extent_=this.type_===kn?on(this.flatCoordinates_):sn(this.flatCoordinates_,0,this.flatCoordinates_.length,2)),this.extent_},t.prototype.getFlatInteriorPoint=function(){if(!this.flatInteriorPoints_){var t=gn(this.getExtent());this.flatInteriorPoints_=vs(this.flatCoordinates_,0,this.ends_,2,t,0)}return this.flatInteriorPoints_},t.prototype.getFlatInteriorPoints=function(){if(!this.flatInteriorPoints_){var t=ga(this.flatCoordinates_,0,this.ends_,2);this.flatInteriorPoints_=_s(this.flatCoordinates_,0,this.ends_,2,t)}return this.flatInteriorPoints_},t.prototype.getFlatMidpoint=function(){return this.flatMidpoints_||(this.flatMidpoints_=aa(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,i=this.ends_,n=0,r=i.length;n<r;++n){var o=i[n],s=aa(t,e,o,2,.5);_t(this.flatMidpoints_,s),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(){},t.prototype.getType=function(){return this.type_},t.prototype.transform=function(t){var e=(t=Zn(t)).getExtent(),i=t.getWorldExtent();if(e&&i){var n=_n(i)/_n(e);vr(Pl,i[0],i[3],n,-n,0,0,0),Go(this.flatCoordinates_,0,this.flatCoordinates_.length,2,Pl,this.flatCoordinates_)}},t.prototype.getEnds=function(){return this.ends_},t}();Ol.prototype.getEndss=Ol.prototype.getEnds,Ol.prototype.getFlatCoordinates=Ol.prototype.getOrientedFlatCoordinates;var Rl=Ol,Il=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}();function Fl(t,e,i){if(3===t){var n={keys:[],values:[],features:[]},r=i.readVarint()+i.pos;i.readFields(jl,n,r),n.length=n.features.length,n.length&&(e[n.name]=n)}}function jl(t,e,i){if(15===t)e.version=i.readVarint();else if(1===t)e.name=i.readString();else if(5===t)e.extent=i.readVarint();else if(2===t)e.features.push(i.pos);else if(3===t)e.keys.push(i.readString());else if(4===t){for(var n=null,r=i.readVarint()+i.pos;i.pos<r;)n=1===(t=i.readVarint()>>3)?i.readString():2===t?i.readFloat():3===t?i.readDouble():4===t?i.readVarint64():5===t?i.readVarint():6===t?i.readSVarint():7===t?i.readBoolean():null;e.values.push(n)}}function Ml(t,e,i){if(1==t)e.id=i.readVarint();else if(2==t)for(var n=i.readVarint()+i.pos;i.pos<n;){var r=e.layer.keys[i.readVarint()],o=e.layer.values[i.readVarint()];e.properties[r]=o}else 3==t?e.type=i.readVarint():4==t&&(e.geometry=i.pos)}function Al(t,e,i){t.pos=e.features[i];var n=t.readVarint()+t.pos,r={layer:e,type:0,properties:{}};return t.readFields(Ml,r,n),r}var Ll=function(t){function e(e){var i=t.call(this)||this,n=e||{};return i.dataProjection=new _i({code:"",units:vi.TILE_PIXELS}),i.featureClass_=n.featureClass?n.featureClass:Rl,i.geometryName_=n.geometryName,i.layerName_=n.layerName?n.layerName:"layer",i.layers_=n.layers?n.layers:null,i.idProperty_=n.idProperty,i}return Il(e,t),e.prototype.readRawGeometry_=function(t,e,i,n){t.pos=e.geometry;for(var r=t.readVarint()+t.pos,o=1,s=0,a=0,l=0,u=0,h=0;t.pos<r;){if(!s){var c=t.readVarint();o=7&c,s=c>>3}s--,1===o||2===o?(a+=t.readSVarint(),l+=t.readSVarint(),1===o&&u>h&&(n.push(u),h=u),i.push(a,l),u+=2):7===o?u>h&&(i.push(i[h],i[h+1]),u+=2):Ie(!1,59)}u>h&&(n.push(u),h=u)},e.prototype.createFeature_=function(t,e,i){var n,r=e.type;if(0===r)return null;var o,s=e.properties;this.idProperty_?(o=s[this.idProperty_],delete s[this.idProperty_]):o=e.id,s[this.layerName_]=e.layer.name;var a=[],l=[];this.readRawGeometry_(t,e,a,l);var u=function(t,e){var i;1===t?i=1===e?kn:In:2===t?i=1===e?Pn:Fn:3===t&&(i=Rn);return i}(r,l.length);if(this.featureClass_===Rl)(n=new this.featureClass_(u,a,l,s,o)).transform(i.dataProjection);else{var h=void 0;if(u==Rn){for(var c=[],p=0,d=0,f=0,y=l.length;f<y;++f){var g=l[f];if(Cs(a,p,g,2)){if(0===c.length)continue;c[c.length-1].push(l[d])}else c.push(l.slice(d,f+1));d=f+1,p=g}h=c.length>1?new va(a,Ao,c):new Os(a,Ao,l)}else h=u===kn?new fs(a,Ao):u===Pn?new ca(a,Ao):u===Rn?new Os(a,Ao,l):u===In?new ya(a,Ao):u===Fn?new da(a,Ao,l):null;n=new(0,this.featureClass_),this.geometryName_&&n.setGeometryName(this.geometryName_);var m=Qs(h,!1,i);n.setGeometry(m),n.setId(o),n.setProperties(s,!0)}return n},e.prototype.getType=function(){return ta},e.prototype.readFeatures=function(t,e){var i=this.layers_,n=this.adaptOptions(e),r=Zn(n.dataProjection);r.setWorldExtent(n.extent),n.dataProjection=r;var o=new ul(t),s=o.readFields(Fl,{}),a=[];for(var l in s)if(!i||-1!=i.indexOf(l)){var u=s[l],h=u?[0,0,u.extent,u.extent]:null;r.setExtent(h);for(var c=0,p=u.length;c<p;++c){var d=Al(o,u,c);a.push(this.createFeature_(o,d,n))}}return a},e.prototype.readProjection=function(t){return this.dataProjection},e.prototype.setLayers=function(t){this.layers_=t},e}(Js),zl="active",Dl=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}();function Gl(t,e,i,n){var r=t.getZoom();if(void 0!==r){var o=t.getConstrainedZoom(r+e),s=t.getResolutionForZoom(o);t.getAnimating()&&t.cancelAnimations(),t.animate({resolution:s,anchor:i,duration:void 0!==n?n:250,easing:ai})}}var Nl=function(t){function e(e){var i=t.call(this)||this;return i.on,i.once,i.un,e&&e.handleEvent&&(i.handleEvent=e.handleEvent),i.map_=null,i.setActive(!0),i}return Dl(e,t),e.prototype.getActive=function(){return this.get(zl)},e.prototype.getMap=function(){return this.map_},e.prototype.handleEvent=function(t){return!0},e.prototype.setActive=function(t){this.set(zl,t)},e.prototype.setMap=function(t){this.map_=t},e}(te),Bl=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}(),Wl=function(t){function e(e){var i=t.call(this)||this,n=e||{};return i.delta_=n.delta?n.delta:1,i.duration_=void 0!==n.duration?n.duration:250,i}return Bl(e,t),e.prototype.handleEvent=function(t){var e=!1;if(t.type==ho.DBLCLICK){var i=t.originalEvent,n=t.map,r=t.coordinate,o=i.shiftKey?-this.delta_:this.delta_;Gl(n.getView(),o,r,this.duration_),i.preventDefault(),e=!0}return!e},e}(Nl),ql=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}();function Vl(t){for(var e=t.length,i=0,n=0,r=0;r<e;r++)i+=t[r].clientX,n+=t[r].clientY;return[i/e,n/e]}var Ul=function(t){function e(e){var i=this,n=e||{};return i=t.call(this,n)||this,n.handleDownEvent&&(i.handleDownEvent=n.handleDownEvent),n.handleDragEvent&&(i.handleDragEvent=n.handleDragEvent),n.handleMoveEvent&&(i.handleMoveEvent=n.handleMoveEvent),n.handleUpEvent&&(i.handleUpEvent=n.handleUpEvent),n.stopDown&&(i.stopDown=n.stopDown),i.handlingDownUpSequence=!1,i.trackedPointers_={},i.targetPointers=[],i}return ql(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==ho.POINTERDRAG)this.handleDragEvent(t),t.originalEvent.preventDefault();else if(t.type==ho.POINTERUP){var i=this.handleUpEvent(t);this.handlingDownUpSequence=i&&this.targetPointers.length>0}}else if(t.type==ho.POINTERDOWN){var n=this.handleDownEvent(t);this.handlingDownUpSequence=n,e=this.stopDown(n)}else t.type==ho.POINTERMOVE&&this.handleMoveEvent(t);return!e},e.prototype.handleMoveEvent=function(t){},e.prototype.handleUpEvent=function(t){return!1},e.prototype.stopDown=function(t){return t},e.prototype.updateTrackedPointers_=function(t){if(function(t){var e=t.type;return e===ho.POINTERDOWN||e===ho.POINTERDRAG||e===ho.POINTERUP}(t)){var e=t.originalEvent,i=e.pointerId.toString();t.type==ho.POINTERUP?delete this.trackedPointers_[i]:(t.type==ho.POINTERDOWN||i in this.trackedPointers_)&&(this.trackedPointers_[i]=e),this.targetPointers=Et(this.trackedPointers_)}},e}(Nl);function Xl(t){var e=arguments;return function(t){for(var i=!0,n=0,r=e.length;n<r&&(i=i&&e[n](t));++n);return i}}var Kl=function(t){var e=t.originalEvent;return e.altKey&&!(e.metaKey||e.ctrlKey)&&e.shiftKey},Yl=function(t){return!t.map.getTargetElement().hasAttribute("tabindex")||function(t){return t.target.getTargetElement().contains(document.activeElement)}(t)},Zl=bt,Hl=function(t){var e=t.originalEvent;return 0==e.button&&!(se&&ae&&e.ctrlKey)},$l=function(t){var e=t.originalEvent;return!e.altKey&&!(e.metaKey||e.ctrlKey)&&!e.shiftKey},Jl=function(t){var e=t.originalEvent;return!e.altKey&&!(e.metaKey||e.ctrlKey)&&e.shiftKey},Ql=function(t){var e=t.originalEvent.target.tagName;return"INPUT"!==e&&"SELECT"!==e&&"TEXTAREA"!==e},tu=function(t){var e=t.originalEvent;return Ie(void 0!==e,56),"mouse"==e.pointerType},eu=function(t){var e=t.originalEvent;return Ie(void 0!==e,56),e.isPrimary&&0===e.button},iu=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}(),nu=function(t){function e(e){var i=t.call(this,{stopDown:wt})||this,n=e||{};i.kinetic_=n.kinetic,i.lastCentroid=null,i.lastPointersCount_,i.panning_=!1;var r=n.condition?n.condition:Xl($l,eu);return i.condition_=n.onFocusOnly?Xl(Yl,r):r,i.noKinetic_=!1,i}return iu(e,t),e.prototype.handleDragEvent=function(t){this.panning_||(this.panning_=!0,this.getMap().getView().beginInteraction());var e,i,n=this.targetPointers,r=Vl(n);if(n.length==this.lastPointersCount_){if(this.kinetic_&&this.kinetic_.update(r[0],r[1]),this.lastCentroid){var o=[this.lastCentroid[0]-r[0],r[1]-this.lastCentroid[1]],s=t.map.getView();e=o,i=s.getResolution(),e[0]*=i,e[1]*=i,Bn(o,s.getRotation()),s.adjustCenterInternal(o)}}else this.kinetic_&&this.kinetic_.begin();this.lastCentroid=r,this.lastPointersCount_=n.length,t.originalEvent.preventDefault()},e.prototype.handleUpEvent=function(t){var e=t.map,i=e.getView();if(0===this.targetPointers.length){if(!this.noKinetic_&&this.kinetic_&&this.kinetic_.end()){var n=this.kinetic_.getDistance(),r=this.kinetic_.getAngle(),o=i.getCenterInternal(),s=e.getPixelFromCoordinateInternal(o),a=e.getCoordinateFromPixelInternal([s[0]-n*Math.cos(r),s[1]-n*Math.sin(r)]);i.animateInternal({center:i.getConstrainedCenter(a),duration:500,easing:ai})}return this.panning_&&(this.panning_=!1,i.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}(Ul),ru=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}(),ou=function(t){function e(e){var i=this,n=e||{};return(i=t.call(this,{stopDown:wt})||this).condition_=n.condition?n.condition:Kl,i.lastAngle_=void 0,i.duration_=void 0!==n.duration?n.duration:250,i}return ru(e,t),e.prototype.handleDragEvent=function(t){if(tu(t)){var e=t.map,i=e.getView();if(i.getConstraints().rotation!==jo){var n=e.getSize(),r=t.pixel,o=Math.atan2(n[1]/2-r[1],r[0]-n[0]/2);if(void 0!==this.lastAngle_){var s=o-this.lastAngle_;i.adjustRotationInternal(-s)}this.lastAngle_=o}}},e.prototype.handleUpEvent=function(t){return!tu(t)||(t.map.getView().endInteraction(this.duration_),!1)},e.prototype.handleDownEvent=function(t){return!!tu(t)&&(!(!Hl(t)||!this.condition_(t))&&(t.map.getView().beginInteraction(),this.lastAngle_=void 0,!0))},e}(Ul),su=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}(),au=function(t){function e(e){var i=t.call(this)||this;return i.geometry_=null,i.element_=document.createElement("div"),i.element_.style.position="absolute",i.element_.style.pointerEvents="auto",i.element_.className="ol-box "+e,i.map_=null,i.startPixel_=null,i.endPixel_=null,i}return su(e,t),e.prototype.disposeInternal=function(){this.setMap(null)},e.prototype.render_=function(){var t=this.startPixel_,e=this.endPixel_,i="px",n=this.element_.style;n.left=Math.min(t[0],e[0])+i,n.top=Math.min(t[1],e[1])+i,n.width=Math.abs(e[0]-t[0])+i,n.height=Math.abs(e[1]-t[1])+i},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_,i=[t,[t[0],e[1]],e,[e[0],t[1]]].map(this.map_.getCoordinateFromPixelInternal,this.map_);i[4]=i[0].slice(),this.geometry_?this.geometry_.setCoordinates([i]):this.geometry_=new Os([i])},e.prototype.getGeometry=function(){return this.geometry_},e}(yt),lu=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}(),uu="boxstart",hu="boxdrag",cu="boxend",pu="boxcancel",du=function(t){function e(e,i,n){var r=t.call(this,e)||this;return r.coordinate=i,r.mapBrowserEvent=n,r}return lu(e,t),e}(dt),fu=function(t){function e(e){var i=t.call(this)||this;i.on,i.once,i.un;var n=e||{};return i.box_=new au(n.className||"ol-dragbox"),i.minArea_=void 0!==n.minArea?n.minArea:64,n.onBoxEnd&&(i.onBoxEnd=n.onBoxEnd),i.startPixel_=null,i.condition_=n.condition?n.condition:Hl,i.boxEndCondition_=n.boxEndCondition?n.boxEndCondition:i.defaultBoxEndCondition,i}return lu(e,t),e.prototype.defaultBoxEndCondition=function(t,e,i){var n=i[0]-e[0],r=i[1]-e[1];return n*n+r*r>=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 du(hu,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 du(e?cu:pu,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 du(uu,t.coordinate,t)),!0)},e.prototype.onBoxEnd=function(t){},e}(Ul),yu=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}(),gu=function(t){function e(e){var i=this,n=e||{},r=n.condition?n.condition:Jl;return(i=t.call(this,{condition:r,className:n.className||"ol-dragzoom",minArea:n.minArea})||this).duration_=void 0!==n.duration?n.duration:200,i.out_=void 0!==n.out&&n.out,i}return yu(e,t),e.prototype.onBoxEnd=function(t){var e=this.getMap().getView(),i=this.getGeometry();if(this.out_){var n=e.rotatedExtentForGeometry(i),r=e.getResolutionForExtentInternal(n),o=e.getResolution()/r;(i=i.clone()).scale(o*o)}e.fitInternal(i,{duration:this.duration_,easing:ai})},e}(fu),mu=37,vu=38,_u=39,xu=40,bu=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}(),wu=function(t){function e(e){var i=t.call(this)||this,n=e||{};return i.defaultCondition_=function(t){return $l(t)&&Ql(t)},i.condition_=void 0!==n.condition?n.condition:i.defaultCondition_,i.duration_=void 0!==n.duration?n.duration:100,i.pixelDelta_=void 0!==n.pixelDelta?n.pixelDelta:128,i}return bu(e,t),e.prototype.handleEvent=function(t){var e=!1;if(t.type==zt){var i=t.originalEvent,n=i.keyCode;if(this.condition_(t)&&(n==xu||n==mu||n==_u||n==vu)){var r=t.map.getView(),o=r.getResolution()*this.pixelDelta_,s=0,a=0;n==xu?a=-o:n==mu?s=-o:n==_u?s=o:a=o;var l=[s,a];Bn(l,r.getRotation()),function(t,e,i){var n=t.getCenterInternal();if(n){var r=[n[0]+e[0],n[1]+e[1]];t.animateInternal({duration:void 0!==i?i:250,easing:ui,center:t.getConstrainedCenter(r)})}}(r,l,this.duration_),i.preventDefault(),e=!0}}return!e},e}(Nl),Su=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}(),Cu=function(t){function e(e){var i=t.call(this)||this,n=e||{};return i.condition_=n.condition?n.condition:Ql,i.delta_=n.delta?n.delta:1,i.duration_=void 0!==n.duration?n.duration:100,i}return Su(e,t),e.prototype.handleEvent=function(t){var e=!1;if(t.type==zt||t.type==Dt){var i=t.originalEvent,n=i.charCode;if(this.condition_(t)&&(n=="+".charCodeAt(0)||n=="-".charCodeAt(0))){var r=t.map,o=n=="+".charCodeAt(0)?this.delta_:-this.delta_;Gl(r.getView(),o,void 0,this.duration_),i.preventDefault(),e=!0}}return!e},e}(Nl),Tu=function(){function t(t,e,i){this.decay_=t,this.minVelocity_=e,this.delay_=i,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 i=e-3;i>0&&this.points_[i+2]>t;)i-=3;var n=this.points_[e+2]-this.points_[i+2];if(n<1e3/60)return!1;var r=this.points_[e]-this.points_[i],o=this.points_[e+1]-this.points_[i+1];return this.angle_=Math.atan2(o,r),this.initialVelocity_=Math.sqrt(r*r+o*o)/n,this.initialVelocity_>this.minVelocity_},t.prototype.getDistance=function(){return(this.minVelocity_-this.initialVelocity_)/this.decay_},t.prototype.getAngle=function(){return this.angle_},t}(),Eu=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}(),ku="trackpad",Pu="wheel",Ou=function(t){function e(e){var i=this,n=e||{};(i=t.call(this,n)||this).totalDelta_=0,i.lastDelta_=0,i.maxDelta_=void 0!==n.maxDelta?n.maxDelta:1,i.duration_=void 0!==n.duration?n.duration:250,i.timeout_=void 0!==n.timeout?n.timeout:80,i.useAnchor_=void 0===n.useAnchor||n.useAnchor,i.constrainResolution_=void 0!==n.constrainResolution&&n.constrainResolution;var r=n.condition?n.condition:Zl;return i.condition_=n.onFocusOnly?Xl(Yl,r):r,i.lastAnchor_=null,i.startTime_=void 0,i.timeoutId_,i.mode_=void 0,i.trackpadEventGap_=400,i.trackpadTimeoutId_,i.deltaPerZoom_=300,i}return Eu(e,t),e.prototype.endInteraction_=function(){this.trackpadTimeoutId_=void 0,this.getMap().getView().endInteraction(void 0,this.lastDelta_?this.lastDelta_>0?1:-1:0,this.lastAnchor_)},e.prototype.handleEvent=function(t){if(!this.condition_(t))return!0;if(t.type!==Wt)return!0;var e,i=t.map,n=t.originalEvent;if(n.preventDefault(),this.useAnchor_&&(this.lastAnchor_=t.coordinate),t.type==Wt&&(e=n.deltaY,oe&&n.deltaMode===WheelEvent.DOM_DELTA_PIXEL&&(e/=le),n.deltaMode===WheelEvent.DOM_DELTA_LINE&&(e*=40)),0===e)return!1;this.lastDelta_=e;var r=Date.now();void 0===this.startTime_&&(this.startTime_=r),(!this.mode_||r-this.startTime_>this.trackpadEventGap_)&&(this.mode_=Math.abs(e)<4?ku:Pu);var o=i.getView();if(this.mode_===ku&&!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_=r,!1;this.totalDelta_+=e;var s=Math.max(this.timeout_-(r-this.startTime_),0);return clearTimeout(this.timeoutId_),this.timeoutId_=setTimeout(this.handleWheelZoom_.bind(this,i),s),!1},e.prototype.handleWheelZoom_=function(t){var e=t.getView();e.getAnimating()&&e.cancelAnimations();var i=-Fe(this.totalDelta_,-this.maxDelta_*this.deltaPerZoom_,this.maxDelta_*this.deltaPerZoom_)/this.deltaPerZoom_;(e.getConstrainResolution()||this.constrainResolution_)&&(i=i?i>0?1:-1:0),Gl(e,i,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}(Nl),Ru=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}(),Iu=function(t){function e(e){var i=this,n=e||{},r=n;return r.stopDown||(r.stopDown=wt),(i=t.call(this,r)||this).anchor_=null,i.lastAngle_=void 0,i.rotating_=!1,i.rotationDelta_=0,i.threshold_=void 0!==n.threshold?n.threshold:.3,i.duration_=void 0!==n.duration?n.duration:250,i}return Ru(e,t),e.prototype.handleDragEvent=function(t){var e=0,i=this.targetPointers[0],n=this.targetPointers[1],r=Math.atan2(n.clientY-i.clientY,n.clientX-i.clientX);if(void 0!==this.lastAngle_){var o=r-this.lastAngle_;this.rotationDelta_+=o,!this.rotating_&&Math.abs(this.rotationDelta_)>this.threshold_&&(this.rotating_=!0),e=o}this.lastAngle_=r;var s=t.map,a=s.getView();if(a.getConstraints().rotation!==jo){var l=s.getViewport().getBoundingClientRect(),u=Vl(this.targetPointers);u[0]-=l.left,u[1]-=l.top,this.anchor_=s.getCoordinateFromPixelInternal(u),this.rotating_&&(s.render(),a.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}(Ul),Fu=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}(),ju=function(t){function e(e){var i=this,n=e||{},r=n;return r.stopDown||(r.stopDown=wt),(i=t.call(this,r)||this).anchor_=null,i.duration_=void 0!==n.duration?n.duration:400,i.lastDistance_=void 0,i.lastScaleDelta_=1,i}return Fu(e,t),e.prototype.handleDragEvent=function(t){var e=1,i=this.targetPointers[0],n=this.targetPointers[1],r=i.clientX-n.clientX,o=i.clientY-n.clientY,s=Math.sqrt(r*r+o*o);void 0!==this.lastDistance_&&(e=this.lastDistance_/s),this.lastDistance_=s;var a=t.map,l=a.getView();1!=e&&(this.lastScaleDelta_=e);var u=a.getViewport().getBoundingClientRect(),h=Vl(this.targetPointers);h[0]-=u.left,h[1]-=u.top,this.anchor_=a.getCoordinateFromPixelInternal(h),a.render(),l.adjustResolutionInternal(e,this.anchor_)},e.prototype.handleUpEvent=function(t){if(this.targetPointers.length<2){var e=t.map.getView(),i=this.lastScaleDelta_>1?1:-1;return e.endInteraction(this.duration_,i),!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}(Ul),Mu=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}(),Au=function(t){function e(e,i,n){var r=t.call(this)||this;if(void 0!==n&&void 0===i)r.setFlatCoordinates(n,e);else{var o=i||0;r.setCenterAndRadius(e,o,n)}return r}return Mu(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,i,n){var r=this.flatCoordinates,o=t-r[0],s=e-r[1],a=o*o+s*s;if(a<n){if(0===a)for(var l=0;l<this.stride;++l)i[l]=r[l];else{var u=this.getRadius()/Math.sqrt(a);i[0]=r[0]+u*o,i[1]=r[1]+u*s;for(l=2;l<this.stride;++l)i[l]=r[l]}return i.length=this.stride,a}return n},e.prototype.containsXY=function(t,e){var i=this.flatCoordinates,n=t-i[0],r=e-i[1];return n*n+r*r<=this.getRadiusSquared_()},e.prototype.getCenter=function(){return this.flatCoordinates.slice(0,this.stride)},e.prototype.computeExtent=function(t){var e=this.flatCoordinates,i=e[this.stride]-e[0];return nn(e[0]-i,e[1]-i,e[0]+i,e[1]+i,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 An},e.prototype.intersectsExtent=function(t){if(Cn(t,this.getExtent())){var e=this.getCenter();return t[0]<=e[0]&&t[2]>=e[0]||(t[1]<=e[1]&&t[3]>=e[1]||pn(t,this.intersectsCoordinate.bind(this)))}return!1},e.prototype.setCenter=function(t){var e=this.stride,i=this.flatCoordinates[e]-this.flatCoordinates[0],n=t.slice();n[e]=n[0]+i;for(var r=1;r<e;++r)n[e+r]=t[r];this.setFlatCoordinates(this.layout,n),this.changed()},e.prototype.setCenterAndRadius=function(t,e,i){this.setLayout(i,t,0),this.flatCoordinates||(this.flatCoordinates=[]);var n=this.flatCoordinates,r=Qo(n,0,t,this.stride);n[r++]=n[0]+e;for(var o=1,s=this.stride;o<s;++o)n[r++]=n[o];n.length=r,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 i=this.getCenter(),n=this.getStride();this.setCenter(No(i,0,i.length,n,t,e,i)),this.changed()},e.prototype.translate=function(t,e){var i=this.getCenter(),n=this.getStride();this.setCenter(Bo(i,0,i.length,n,t,e,i)),this.changed()},e}(Ko);Au.prototype.transform;var Lu=Au;function zu(t,e,i,n,r){Du(t,e,i||0,n||t.length-1,r||Nu)}function Du(t,e,i,n,r){for(;n>i;){if(n-i>600){var o=n-i+1,s=e-i+1,a=Math.log(o),l=.5*Math.exp(2*a/3),u=.5*Math.sqrt(a*l*(o-l)/o)*(s-o/2<0?-1:1);Du(t,e,Math.max(i,Math.floor(e-s*l/o+u)),Math.min(n,Math.floor(e+(o-s)*l/o+u)),r)}var h=t[e],c=i,p=n;for(Gu(t,i,e),r(t[n],h)>0&&Gu(t,i,n);c<p;){for(Gu(t,c,p),c++,p--;r(t[c],h)<0;)c++;for(;r(t[p],h)>0;)p--}0===r(t[i],h)?Gu(t,i,p):Gu(t,++p,n),p<=e&&(i=p+1),e<=p&&(n=p-1)}}function Gu(t,e,i){var n=t[e];t[e]=t[i],t[i]=n}function Nu(t,e){return t<e?-1:t>e?1:0}class Bu{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 i=[];if(!Ju(t,e))return i;const n=this.toBBox,r=[];for(;e;){for(let o=0;o<e.children.length;o++){const s=e.children[o],a=e.leaf?n(s):s;Ju(t,a)&&(e.leaf?i.push(s):$u(t,a)?this._all(s,i):r.push(s))}e=r.pop()}return i}collides(t){let e=this.data;if(!Ju(t,e))return!1;const i=[];for(;e;){for(let n=0;n<e.children.length;n++){const r=e.children[n],o=e.leaf?this.toBBox(r):r;if(Ju(t,o)){if(e.leaf||$u(t,o))return!0;i.push(r)}}e=i.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=Qu([]),this}remove(t,e){if(!t)return this;let i=this.data;const n=this.toBBox(t),r=[],o=[];let s,a,l;for(;i||r.length;){if(i||(i=r.pop(),a=r[r.length-1],s=o.pop(),l=!0),i.leaf){const n=Wu(t,i.children,e);if(-1!==n)return i.children.splice(n,1),r.push(i),this._condense(r),this}l||i.leaf||!$u(i,n)?a?(s++,i=a.children[s],l=!1):i=null:(r.push(i),o.push(s),s=0,a=i,i=i.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 i=[];for(;t;)t.leaf?e.push(...t.children):i.push(...t.children),t=i.pop();return e}_build(t,e,i,n){const r=i-e+1;let o,s=this._maxEntries;if(r<=s)return o=Qu(t.slice(e,i+1)),qu(o,this.toBBox),o;n||(n=Math.ceil(Math.log(r)/Math.log(s)),s=Math.ceil(r/Math.pow(s,n-1))),o=Qu([]),o.leaf=!1,o.height=n;const a=Math.ceil(r/s),l=a*Math.ceil(Math.sqrt(s));th(t,e,i,l,this.compareMinX);for(let u=e;u<=i;u+=l){const e=Math.min(u+l-1,i);th(t,u,e,a,this.compareMinY);for(let i=u;i<=e;i+=a){const r=Math.min(i+a-1,e);o.children.push(this._build(t,i,r,n-1))}}return qu(o,this.toBBox),o}_chooseSubtree(t,e,i,n){for(;n.push(e),!e.leaf&&n.length-1!==i;){let i,n=1/0,s=1/0;for(let a=0;a<e.children.length;a++){const l=e.children[a],u=Yu(l),h=(r=t,o=l,(Math.max(o.maxX,r.maxX)-Math.min(o.minX,r.minX))*(Math.max(o.maxY,r.maxY)-Math.min(o.minY,r.minY))-u);h<s?(s=h,n=u<n?u:n,i=l):h===s&&u<n&&(n=u,i=l)}e=i||e.children[0]}var r,o;return e}_insert(t,e,i){const n=i?t:this.toBBox(t),r=[],o=this._chooseSubtree(n,this.data,e,r);for(o.children.push(t),Uu(o,n);e>=0&&r[e].children.length>this._maxEntries;)this._split(r,e),e--;this._adjustParentBBoxes(n,r,e)}_split(t,e){const i=t[e],n=i.children.length,r=this._minEntries;this._chooseSplitAxis(i,r,n);const o=this._chooseSplitIndex(i,r,n),s=Qu(i.children.splice(o,i.children.length-o));s.height=i.height,s.leaf=i.leaf,qu(i,this.toBBox),qu(s,this.toBBox),e?t[e-1].children.push(s):this._splitRoot(i,s)}_splitRoot(t,e){this.data=Qu([t,e]),this.data.height=t.height+1,this.data.leaf=!1,qu(this.data,this.toBBox)}_chooseSplitIndex(t,e,i){let n,r=1/0,o=1/0;for(let s=e;s<=i-e;s++){const e=Vu(t,0,s,this.toBBox),a=Vu(t,s,i,this.toBBox),l=Hu(e,a),u=Yu(e)+Yu(a);l<r?(r=l,n=s,o=u<o?u:o):l===r&&u<o&&(o=u,n=s)}return n||i-e}_chooseSplitAxis(t,e,i){const n=t.leaf?this.compareMinX:Xu,r=t.leaf?this.compareMinY:Ku;this._allDistMargin(t,e,i,n)<this._allDistMargin(t,e,i,r)&&t.children.sort(n)}_allDistMargin(t,e,i,n){t.children.sort(n);const r=this.toBBox,o=Vu(t,0,e,r),s=Vu(t,i-e,i,r);let a=Zu(o)+Zu(s);for(let l=e;l<i-e;l++){const e=t.children[l];Uu(o,t.leaf?r(e):e),a+=Zu(o)}for(let l=i-e-1;l>=e;l--){const e=t.children[l];Uu(s,t.leaf?r(e):e),a+=Zu(s)}return a}_adjustParentBBoxes(t,e,i){for(let n=i;n>=0;n--)Uu(e[n],t)}_condense(t){for(let e,i=t.length-1;i>=0;i--)0===t[i].children.length?i>0?(e=t[i-1].children,e.splice(e.indexOf(t[i]),1)):this.clear():qu(t[i],this.toBBox)}}function Wu(t,e,i){if(!i)return e.indexOf(t);for(let n=0;n<e.length;n++)if(i(t,e[n]))return n;return-1}function qu(t,e){Vu(t,0,t.children.length,e,t)}function Vu(t,e,i,n,r){r||(r=Qu(null)),r.minX=1/0,r.minY=1/0,r.maxX=-1/0,r.maxY=-1/0;for(let o=e;o<i;o++){const e=t.children[o];Uu(r,t.leaf?n(e):e)}return r}function Uu(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 Xu(t,e){return t.minX-e.minX}function Ku(t,e){return t.minY-e.minY}function Yu(t){return(t.maxX-t.minX)*(t.maxY-t.minY)}function Zu(t){return t.maxX-t.minX+(t.maxY-t.minY)}function Hu(t,e){const i=Math.max(t.minX,e.minX),n=Math.max(t.minY,e.minY),r=Math.min(t.maxX,e.maxX),o=Math.min(t.maxY,e.maxY);return Math.max(0,r-i)*Math.max(0,o-n)}function $u(t,e){return t.minX<=e.minX&&t.minY<=e.minY&&e.maxX<=t.maxX&&e.maxY<=t.maxY}function Ju(t,e){return e.minX<=t.maxX&&e.minY<=t.maxY&&e.maxX>=t.minX&&e.maxY>=t.minY}function Qu(t){return{children:t,height:1,leaf:!0,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}}function th(t,e,i,n,r){const o=[e,i];for(;o.length;){if((i=o.pop())-(e=o.pop())<=n)continue;const s=e+Math.ceil((i-e)/n/2)*n;zu(t,s,e,i,r),o.push(e,s,s,i)}}var eh=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}(),ih="renderOrder",nh=function(t){function e(e){var i=this,n=e||{},r=Ct({},n);return delete r.style,delete r.renderBuffer,delete r.updateWhileAnimating,delete r.updateWhileInteracting,(i=t.call(this,r)||this).declutter_=void 0!==n.declutter&&n.declutter,i.renderBuffer_=void 0!==n.renderBuffer?n.renderBuffer:100,i.style_=null,i.styleFunction_=void 0,i.setStyle(n.style),i.updateWhileAnimating_=void 0!==n.updateWhileAnimating&&n.updateWhileAnimating,i.updateWhileInteracting_=void 0!==n.updateWhileInteracting&&n.updateWhileInteracting,i}return eh(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(ih)},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 Bu(9)),this.getRenderer().renderDeclutter(t)},e.prototype.setRenderOrder=function(t){this.set(ih,t)},e.prototype.setStyle=function(t){this.style_=void 0!==t?t:el,this.styleFunction_=null===t?void 0:function(t){var e;if("function"==typeof t)e=t;else{var i;Array.isArray(t)?i=t:(Ie("function"==typeof t.getZIndex,41),i=[t]),e=function(){return i}}return e}(this.style_),this.changed()},e}($e),rh={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},oh=[rh.FILL],sh=[rh.STROKE],ah=[rh.BEGIN_PATH],lh=[rh.CLOSE_PATH],uh=rh,hh=function(){function t(){}return t.prototype.drawCustom=function(t,e,i){},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}(),ch=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}(),ph=function(t){function e(e,i,n,r){var o=t.call(this)||this;return o.tolerance=e,o.maxExtent=i,o.pixelRatio=r,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 ch(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 i=this.getBufferedMaxExtent(),n=this.tmpCoordinate_,r=this.coordinates,o=r.length,s=0,a=t.length;s<a;s+=e)n[0]=t[s],n[1]=t[s+1],$i(i,n)&&(r[o++]=n[0],r[o++]=n[1]);return o},e.prototype.appendFlatLineCoordinates=function(t,e,i,n,r,o){var s=this.coordinates,a=s.length,l=this.getBufferedMaxExtent();o&&(e+=n);var u,h,c,p=t[e],d=t[e+1],f=this.tmpCoordinate_,y=!0;for(u=e+n;u<i;u+=n)f[0]=t[u],f[1]=t[u+1],(c=tn(l,f))!==h?(y&&(s[a++]=p,s[a++]=d,y=!1),s[a++]=f[0],s[a++]=f[1]):c===Wi?(s[a++]=f[0],s[a++]=f[1],y=!1):y=!0,p=f[0],d=f[1],h=c;return(r&&y||u===e+n)&&(s[a++]=p,s[a++]=d),a},e.prototype.drawCustomCoordinates_=function(t,e,i,n,r){for(var o=0,s=i.length;o<s;++o){var a=i[o],l=this.appendFlatLineCoordinates(t,e,a,n,!1,!1);r.push(l),e=a}return e},e.prototype.drawCustom=function(t,e,i){this.beginGeometry(t,e);var n,r,o,s,a,l=t.getType(),u=t.getStride(),h=this.coordinates.length;if(l==jn){n=t.getOrientedFlatCoordinates(),s=[];var c=t.getEndss();a=0;for(var p=0,d=c.length;p<d;++p){var f=[];a=this.drawCustomCoordinates_(n,a,c[p],u,f),s.push(f)}this.instructions.push([uh.CUSTOM,h,s,t,i,ls])}else l==Rn||l==Fn?(o=[],n=l==Rn?t.getOrientedFlatCoordinates():t.getFlatCoordinates(),a=this.drawCustomCoordinates_(n,0,t.getEnds(),u,o),this.instructions.push([uh.CUSTOM,h,o,t,i,as])):l==Pn||l==An?(n=t.getFlatCoordinates(),r=this.appendFlatLineCoordinates(n,0,n.length,u,!1,!1),this.instructions.push([uh.CUSTOM,h,r,t,i,ss])):l==In?(n=t.getFlatCoordinates(),(r=this.appendFlatPointCoordinates(n,u))>h&&this.instructions.push([uh.CUSTOM,h,r,t,i,ss])):l==kn&&(n=t.getFlatCoordinates(),this.coordinates.push(n[0],n[1]),r=this.coordinates.length,this.instructions.push([uh.CUSTOM,h,r,t,i]));this.endGeometry(e)},e.prototype.beginGeometry=function(t,e){this.beginGeometryInstruction1_=[uh.BEGIN_GEOMETRY,e,0,t],this.instructions.push(this.beginGeometryInstruction1_),this.beginGeometryInstruction2_=[uh.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 i,n,r=e.length,o=-1;for(t=0;t<r;++t)(n=(i=e[t])[0])==uh.END_GEOMETRY?o=t:n==uh.BEGIN_GEOMETRY&&(i[2]=t,vt(this.hitDetectionInstructions,o,t),o=-1)},e.prototype.setFillStrokeStyle=function(t,e){var i=this.state;if(t){var n=t.getColor();i.fillStyle=Ya(n||"#000")}else i.fillStyle=void 0;if(e){var r=e.getColor();i.strokeStyle=Ya(r||"#000");var o=e.getLineCap();i.lineCap=void 0!==o?o:"round";var s=e.getLineDash();i.lineDash=s?s.slice():zr;var a=e.getLineDashOffset();i.lineDashOffset=a||0;var l=e.getLineJoin();i.lineJoin=void 0!==l?l:"round";var u=e.getWidth();i.lineWidth=void 0!==u?u:1;var h=e.getMiterLimit();i.miterLimit=void 0!==h?h:10,i.lineWidth>this.maxLineWidth&&(this.maxLineWidth=i.lineWidth,this.bufferedMaxExtent_=null)}else i.strokeStyle=void 0,i.lineCap=void 0,i.lineDash=null,i.lineDashOffset=void 0,i.lineJoin=void 0,i.lineWidth=void 0,i.miterLimit=void 0},e.prototype.createFill=function(t){var e=t.fillStyle,i=[uh.SET_FILL_STYLE,e];return"string"!=typeof e&&i.push(!0),i},e.prototype.applyStroke=function(t){this.instructions.push(this.createStroke(t))},e.prototype.createStroke=function(t){return[uh.SET_STROKE_STYLE,t.strokeStyle,t.lineWidth*this.pixelRatio,t.lineCap,t.lineJoin,t.miterLimit,this.applyPixelRatio(t.lineDash),t.lineDashOffset*this.pixelRatio]},e.prototype.updateFillStyle=function(t,e){var i=t.fillStyle;"string"==typeof i&&t.currentFillStyle==i||(void 0!==i&&this.instructions.push(e.call(this,t)),t.currentFillStyle=i)},e.prototype.updateStrokeStyle=function(t,e){var i=t.strokeStyle,n=t.lineCap,r=t.lineDash,o=t.lineDashOffset,s=t.lineJoin,a=t.lineWidth,l=t.miterLimit;(t.currentStrokeStyle!=i||t.currentLineCap!=n||r!=t.currentLineDash&&!xt(t.currentLineDash,r)||t.currentLineDashOffset!=o||t.currentLineJoin!=s||t.currentLineWidth!=a||t.currentMiterLimit!=l)&&(void 0!==i&&e.call(this,t),t.currentStrokeStyle=i,t.currentLineCap=n,t.currentLineDash=r,t.currentLineDashOffset=o,t.currentLineJoin=s,t.currentLineWidth=a,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=[uh.END_GEOMETRY,t];this.instructions.push(e),this.hitDetectionInstructions.push(e)},e.prototype.getBufferedMaxExtent=function(){if(!this.bufferedMaxExtent_&&(this.bufferedMaxExtent_=Zi(this.maxExtent),this.maxLineWidth>0)){var t=this.resolution*(this.maxLineWidth+1)/2;Yi(this.bufferedMaxExtent_,t,this.bufferedMaxExtent_)}return this.bufferedMaxExtent_},e}(hh),dh=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}(),fh=function(t){function e(e,i,n,r){var o=t.call(this,e,i,n,r)||this;return o.hitDetectionImage_=null,o.image_=null,o.imagePixelRatio_=void 0,o.anchorX_=void 0,o.anchorY_=void 0,o.height_=void 0,o.opacity_=void 0,o.originX_=void 0,o.originY_=void 0,o.rotateWithView_=void 0,o.rotation_=void 0,o.scale_=void 0,o.width_=void 0,o.declutterImageWithText_=void 0,o}return dh(e,t),e.prototype.drawPoint=function(t,e){if(this.image_){this.beginGeometry(t,e);var i=t.getFlatCoordinates(),n=t.getStride(),r=this.coordinates.length,o=this.appendFlatPointCoordinates(i,n);this.instructions.push([uh.DRAW_IMAGE,r,o,this.image_,this.anchorX_*this.imagePixelRatio_,this.anchorY_*this.imagePixelRatio_,Math.ceil(this.height_*this.imagePixelRatio_),this.opacity_,this.originX_,this.originY_,this.rotateWithView_,this.rotation_,[this.scale_[0]*this.pixelRatio/this.imagePixelRatio_,this.scale_[1]*this.pixelRatio/this.imagePixelRatio_],Math.ceil(this.width_*this.imagePixelRatio_),this.declutterImageWithText_]),this.hitDetectionInstructions.push([uh.DRAW_IMAGE,r,o,this.hitDetectionImage_,this.anchorX_,this.anchorY_,this.height_,this.opacity_,this.originX_,this.originY_,this.rotateWithView_,this.rotation_,this.scale_,this.width_,this.declutterImageWithText_]),this.endGeometry(e)}},e.prototype.drawMultiPoint=function(t,e){if(this.image_){this.beginGeometry(t,e);var i=t.getFlatCoordinates(),n=t.getStride(),r=this.coordinates.length,o=this.appendFlatPointCoordinates(i,n);this.instructions.push([uh.DRAW_IMAGE,r,o,this.image_,this.anchorX_*this.imagePixelRatio_,this.anchorY_*this.imagePixelRatio_,Math.ceil(this.height_*this.imagePixelRatio_),this.opacity_,this.originX_,this.originY_,this.rotateWithView_,this.rotation_,[this.scale_[0]*this.pixelRatio/this.imagePixelRatio_,this.scale_[1]*this.pixelRatio/this.imagePixelRatio_],Math.ceil(this.width_*this.imagePixelRatio_),this.declutterImageWithText_]),this.hitDetectionInstructions.push([uh.DRAW_IMAGE,r,o,this.hitDetectionImage_,this.anchorX_,this.anchorY_,this.height_,this.opacity_,this.originX_,this.originY_,this.rotateWithView_,this.rotation_,this.scale_,this.width_,this.declutterImageWithText_]),this.endGeometry(e)}},e.prototype.finish=function(){return this.reverseHitDetectionInstructions(),this.anchorX_=void 0,this.anchorY_=void 0,this.hitDetectionImage_=null,this.image_=null,this.imagePixelRatio_=void 0,this.height_=void 0,this.scale_=void 0,this.opacity_=void 0,this.originX_=void 0,this.originY_=void 0,this.rotateWithView_=void 0,this.rotation_=void 0,this.width_=void 0,t.prototype.finish.call(this)},e.prototype.setImageStyle=function(t,e){var i=t.getAnchor(),n=t.getSize(),r=t.getHitDetectionImage(),o=t.getImage(this.pixelRatio),s=t.getOrigin();this.imagePixelRatio_=t.getPixelRatio(this.pixelRatio),this.anchorX_=i[0],this.anchorY_=i[1],this.hitDetectionImage_=r,this.image_=o,this.height_=n[1],this.opacity_=t.getOpacity(),this.originX_=s[0],this.originY_=s[1],this.rotateWithView_=t.getRotateWithView(),this.rotation_=t.getRotation(),this.scale_=t.getScaleArray(),this.width_=n[0],this.declutterImageWithText_=e},e}(ph),yh=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}(),gh=function(t){function e(e,i,n,r){return t.call(this,e,i,n,r)||this}return yh(e,t),e.prototype.drawFlatCoordinates_=function(t,e,i,n){var r=this.coordinates.length,o=this.appendFlatLineCoordinates(t,e,i,n,!1,!1),s=[uh.MOVE_TO_LINE_TO,r,o];return this.instructions.push(s),this.hitDetectionInstructions.push(s),i},e.prototype.drawLineString=function(t,e){var i=this.state,n=i.strokeStyle,r=i.lineWidth;if(void 0!==n&&void 0!==r){this.updateStrokeStyle(i,this.applyStroke),this.beginGeometry(t,e),this.hitDetectionInstructions.push([uh.SET_STROKE_STYLE,i.strokeStyle,i.lineWidth,i.lineCap,i.lineJoin,i.miterLimit,zr,0],ah);var o=t.getFlatCoordinates(),s=t.getStride();this.drawFlatCoordinates_(o,0,o.length,s),this.hitDetectionInstructions.push(sh),this.endGeometry(e)}},e.prototype.drawMultiLineString=function(t,e){var i=this.state,n=i.strokeStyle,r=i.lineWidth;if(void 0!==n&&void 0!==r){this.updateStrokeStyle(i,this.applyStroke),this.beginGeometry(t,e),this.hitDetectionInstructions.push([uh.SET_STROKE_STYLE,i.strokeStyle,i.lineWidth,i.lineCap,i.lineJoin,i.miterLimit,i.lineDash,i.lineDashOffset],ah);for(var o=t.getEnds(),s=t.getFlatCoordinates(),a=t.getStride(),l=0,u=0,h=o.length;u<h;++u)l=this.drawFlatCoordinates_(s,l,o[u],a);this.hitDetectionInstructions.push(sh),this.endGeometry(e)}},e.prototype.finish=function(){var e=this.state;return null!=e.lastStroke&&e.lastStroke!=this.coordinates.length&&this.instructions.push(sh),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(sh),e.lastStroke=this.coordinates.length),e.lastStroke=0,t.prototype.applyStroke.call(this,e),this.instructions.push(ah)},e}(ph),mh=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}(),vh=function(t){function e(e,i,n,r){return t.call(this,e,i,n,r)||this}return mh(e,t),e.prototype.drawFlatCoordinatess_=function(t,e,i,n){var r=this.state,o=void 0!==r.fillStyle,s=void 0!==r.strokeStyle,a=i.length;this.instructions.push(ah),this.hitDetectionInstructions.push(ah);for(var l=0;l<a;++l){var u=i[l],h=this.coordinates.length,c=this.appendFlatLineCoordinates(t,e,u,n,!0,!s),p=[uh.MOVE_TO_LINE_TO,h,c];this.instructions.push(p),this.hitDetectionInstructions.push(p),s&&(this.instructions.push(lh),this.hitDetectionInstructions.push(lh)),e=u}return o&&(this.instructions.push(oh),this.hitDetectionInstructions.push(oh)),s&&(this.instructions.push(sh),this.hitDetectionInstructions.push(sh)),e},e.prototype.drawCircle=function(t,e){var i=this.state,n=i.fillStyle,r=i.strokeStyle;if(void 0!==n||void 0!==r){this.setFillStrokeStyles_(),this.beginGeometry(t,e),void 0!==i.fillStyle&&this.hitDetectionInstructions.push([uh.SET_FILL_STYLE,"#000"]),void 0!==i.strokeStyle&&this.hitDetectionInstructions.push([uh.SET_STROKE_STYLE,i.strokeStyle,i.lineWidth,i.lineCap,i.lineJoin,i.miterLimit,i.lineDash,i.lineDashOffset]);var o=t.getFlatCoordinates(),s=t.getStride(),a=this.coordinates.length;this.appendFlatLineCoordinates(o,0,o.length,s,!1,!1);var l=[uh.CIRCLE,a];this.instructions.push(ah,l),this.hitDetectionInstructions.push(ah,l),void 0!==i.fillStyle&&(this.instructions.push(oh),this.hitDetectionInstructions.push(oh)),void 0!==i.strokeStyle&&(this.instructions.push(sh),this.hitDetectionInstructions.push(sh)),this.endGeometry(e)}},e.prototype.drawPolygon=function(t,e){var i=this.state,n=i.fillStyle,r=i.strokeStyle;if(void 0!==n||void 0!==r){this.setFillStrokeStyles_(),this.beginGeometry(t,e),void 0!==i.fillStyle&&this.hitDetectionInstructions.push([uh.SET_FILL_STYLE,"#000"]),void 0!==i.strokeStyle&&this.hitDetectionInstructions.push([uh.SET_STROKE_STYLE,i.strokeStyle,i.lineWidth,i.lineCap,i.lineJoin,i.miterLimit,i.lineDash,i.lineDashOffset]);var o=t.getEnds(),s=t.getOrientedFlatCoordinates(),a=t.getStride();this.drawFlatCoordinatess_(s,0,o,a),this.endGeometry(e)}},e.prototype.drawMultiPolygon=function(t,e){var i=this.state,n=i.fillStyle,r=i.strokeStyle;if(void 0!==n||void 0!==r){this.setFillStrokeStyles_(),this.beginGeometry(t,e),void 0!==i.fillStyle&&this.hitDetectionInstructions.push([uh.SET_FILL_STYLE,"#000"]),void 0!==i.strokeStyle&&this.hitDetectionInstructions.push([uh.SET_STROKE_STYLE,i.strokeStyle,i.lineWidth,i.lineCap,i.lineJoin,i.miterLimit,i.lineDash,i.lineDashOffset]);for(var o=t.getEndss(),s=t.getOrientedFlatCoordinates(),a=t.getStride(),l=0,u=0,h=o.length;u<h;++u)l=this.drawFlatCoordinatess_(s,l,o[u],a);this.endGeometry(e)}},e.prototype.finish=function(){this.reverseHitDetectionInstructions(),this.state=null;var e=this.tolerance;if(0!==e)for(var i=this.coordinates,n=0,r=i.length;n<r;++n)i[n]=ns(i[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}(ph);function _h(t,e,i,n,r){var o,s,a,l,u,h,c,p,d,f=i,y=i,g=0,m=0,v=i;for(o=i;o<n;o+=r){var _=e[o],x=e[o+1];void 0!==l&&(p=_-l,d=x-u,a=Math.sqrt(p*p+d*d),void 0!==h&&(m+=s,Math.acos((h*p+c*d)/(s*a))>t&&(m>g&&(g=m,f=v,y=o),m=0,v=o-r)),s=a,h=p,c=d),l=_,u=x}return(m+=a)>g?[v,o]:[f,y]}var xh=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}(),bh={left:0,end:0,center:.5,right:1,start:1,top:0,middle:.5,hanging:.2,alphabetic:.8,ideographic:.8,bottom:1},wh={Circle:vh,Default:ph,Image:fh,LineString:gh,Polygon:vh,Text:function(t){function e(e,i,n,r){var o=t.call(this,e,i,n,r)||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 xh(e,t),e.prototype.finish=function(){var e=t.prototype.finish.call(this);return e.textStates=this.textStates,e.fillStates=this.fillStates,e.strokeStates=this.strokeStates,e},e.prototype.drawText=function(t,e){var i=this.textFillState_,n=this.textStrokeState_,r=this.textState_;if(""!==this.text_&&r&&(i||n)){var o=this.coordinates,s=o.length,a=t.getType(),l=null,u=t.getStride();if(r.placement!==sl||a!=Pn&&a!=Fn&&a!=Rn&&a!=jn){var h=r.overflow?null:[];switch(a){case kn:case In:l=t.getFlatCoordinates();break;case Pn:l=t.getFlatMidpoint();break;case An:l=t.getCenter();break;case Fn:l=t.getFlatMidpoints(),u=2;break;case Rn:l=t.getFlatInteriorPoint(),r.overflow||h.push(l[2]/this.resolution),u=3;break;case jn:var c=t.getFlatInteriorPoints();l=[];for(w=0,S=c.length;w<S;w+=3)r.overflow||h.push(c[w+2]/this.resolution),l.push(c[w],c[w+1]);if(0===l.length)return;u=2}if((R=this.appendFlatPointCoordinates(l,u))===s)return;if(h&&(R-s)/2!=l.length/u){var p=s/2;h=h.filter((function(t,e){var i=o[2*(p+e)]===l[e*u]&&o[2*(p+e)+1]===l[e*u+1];return i||--p,i}))}this.saveTextStates_(),(r.backgroundFill||r.backgroundStroke)&&(this.setFillStrokeStyle(r.backgroundFill,r.backgroundStroke),r.backgroundFill&&(this.updateFillStyle(this.state,this.createFill),this.hitDetectionInstructions.push(this.createFill(this.state))),r.backgroundStroke&&(this.updateStrokeStyle(this.state,this.applyStroke),this.hitDetectionInstructions.push(this.createStroke(this.state)))),this.beginGeometry(t,e);var d=r.padding;if(d!=Dr&&(r.scale[0]<0||r.scale[1]<0)){var f=r.padding[0],y=r.padding[1],g=r.padding[2],m=r.padding[3];r.scale[0]<0&&(y=-y,m=-m),r.scale[1]<0&&(f=-f,g=-g),d=[f,y,g,m]}var v=this.pixelRatio;this.instructions.push([uh.DRAW_IMAGE,s,R,null,NaN,NaN,NaN,1,0,0,this.textRotateWithView_,this.textRotation_,[1,1],NaN,this.declutterImageWithText_,d==Dr?Dr:d.map((function(t){return t*v})),!!r.backgroundFill,!!r.backgroundStroke,this.text_,this.textKey_,this.strokeKey_,this.fillKey_,this.textOffsetX_,this.textOffsetY_,h]);var _=1/v;this.hitDetectionInstructions.push([uh.DRAW_IMAGE,s,R,null,NaN,NaN,NaN,1,0,0,this.textRotateWithView_,this.textRotation_,[_,_],NaN,this.declutterImageWithText_,d,!!r.backgroundFill,!!r.backgroundStroke,this.text_,this.textKey_,this.strokeKey_,this.fillKey_,this.textOffsetX_,this.textOffsetY_,h]),this.endGeometry(e)}else{if(!Cn(this.getBufferedMaxExtent(),t.getExtent()))return;var x=void 0;if(l=t.getFlatCoordinates(),a==Pn)x=[l.length];else if(a==Fn)x=t.getEnds();else if(a==Rn)x=t.getEnds().slice(0,1);else if(a==jn){var b=t.getEndss();x=[];for(var w=0,S=b.length;w<S;++w)x.push(b[w][0])}this.beginGeometry(t,e);for(var C=r.textAlign,T=0,E=void 0,k=0,P=x.length;k<P;++k){if(null==C){var O=_h(r.maxAngle,l,T,x[k],u);T=O[0],E=O[1]}else E=x[k];for(var w=T;w<E;w+=u)o.push(l[w],l[w+1]);var R=o.length;T=x[k],this.drawChars_(s,R),s=R}this.endGeometry(e)}}},e.prototype.saveTextStates_=function(){var t=this.textStrokeState_,e=this.textState_,i=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 r=this.textKey_;r in this.textStates||(this.textStates[r]={font:e.font,textAlign:e.textAlign||"center",textBaseline:e.textBaseline||"middle",scale:e.scale});var o=this.fillKey_;i&&(o in this.fillStates||(this.fillStates[o]={fillStyle:i.fillStyle}))},e.prototype.drawChars_=function(t,e){var i=this.textStrokeState_,n=this.textState_,r=this.strokeKey_,o=this.textKey_,s=this.fillKey_;this.saveTextStates_();var a=this.pixelRatio,l=bh[n.textBaseline],u=this.textOffsetY_*a,h=this.text_,c=i?i.lineWidth*Math.abs(n.scale[0])/2:0;this.instructions.push([uh.DRAW_CHARS,t,e,l,n.overflow,s,n.maxAngle,a,u,r,c*a,h,o,1]),this.hitDetectionInstructions.push([uh.DRAW_CHARS,t,e,l,n.overflow,s,n.maxAngle,1,u,r,c,h,o,1/a])},e.prototype.setTextStyle=function(t,e){var i,n,r;if(t){var o=t.getFill();o?((n=this.textFillState_)||(n={},this.textFillState_=n),n.fillStyle=Ya(o.getColor()||"#000")):(n=null,this.textFillState_=n);var s=t.getStroke();if(s){(r=this.textStrokeState_)||(r={},this.textStrokeState_=r);var a=s.getLineDash(),l=s.getLineDashOffset(),u=s.getWidth(),h=s.getMiterLimit();r.lineCap=s.getLineCap()||"round",r.lineDash=a?a.slice():zr,r.lineDashOffset=void 0===l?0:l,r.lineJoin=s.getLineJoin()||"round",r.lineWidth=void 0===u?1:u,r.miterLimit=void 0===h?10:h,r.strokeStyle=Ya(s.getColor()||"#000")}else r=null,this.textStrokeState_=r;i=this.textState_;var c=t.getFont()||"10px sans-serif";Ur(c);var p=t.getScaleArray();i.overflow=t.getOverflow(),i.font=c,i.maxAngle=t.getMaxAngle(),i.placement=t.getPlacement(),i.textAlign=t.getTextAlign(),i.textBaseline=t.getTextBaseline()||"middle",i.backgroundFill=t.getBackgroundFill(),i.backgroundStroke=t.getBackgroundStroke(),i.padding=t.getPadding()||Dr,i.scale=void 0===p?[1,1]:p;var d=t.getOffsetX(),f=t.getOffsetY(),y=t.getRotateWithView(),g=t.getRotation();this.text_=t.getText()||"",this.textOffsetX_=void 0===d?0:d,this.textOffsetY_=void 0===f?0:f,this.textRotateWithView_=void 0!==y&&y,this.textRotation_=void 0===g?0:g,this.strokeKey_=r?("string"==typeof r.strokeStyle?r.strokeStyle:$t(r.strokeStyle))+r.lineCap+r.lineDashOffset+"|"+r.lineWidth+r.lineJoin+r.miterLimit+"["+r.lineDash.join()+"]":"",this.textKey_=i.font+i.scale+(i.textAlign||"?")+(i.textBaseline||"?"),this.fillKey_=n?"string"==typeof n.fillStyle?n.fillStyle:"|"+$t(n.fillStyle):""}else this.text_="";this.declutterImageWithText_=e},e}(ph)},Sh=function(){function t(t,e,i,n){this.tolerance_=t,this.maxExtent_=e,this.pixelRatio_=n,this.resolution_=i,this.buildersByZIndex_={}}return t.prototype.finish=function(){var t={};for(var e in this.buildersByZIndex_){t[e]=t[e]||{};var i=this.buildersByZIndex_[e];for(var n in i){var r=i[n].finish();t[e][n]=r}}return t},t.prototype.getBuilder=function(t,e){var i=void 0!==t?t.toString():"0",n=this.buildersByZIndex_[i];void 0===n&&(n={},this.buildersByZIndex_[i]=n);var r=n[e];void 0===r&&(r=new(0,wh[e])(this.tolerance_,this.maxExtent_,this.resolution_,this.pixelRatio_),n[e]=r);return r},t}(),Ch=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}(),Th=function(t){function e(e){var i=t.call(this)||this;return i.boundHandleImageChange_=i.handleImageChange_.bind(i),i.layer_=e,i.declutterExecutorGroup=null,i}return Ch(e,t),e.prototype.getFeatures=function(t){return Zt()},e.prototype.prepareFrame=function(t){return Zt()},e.prototype.renderFrame=function(t,e){return Zt()},e.prototype.loadedTileCallback=function(t,e,i){t[e]||(t[e]={}),t[e][i.tileCoord.toString()]=i},e.prototype.createLoadedTileFinder=function(t,e,i){return function(n,r){var o=this.loadedTileCallback.bind(this,i,n);return t.forEachLoadedTile(e,n,r,o)}.bind(this)},e.prototype.forEachFeatureAtCoordinate=function(t,e,i,n,r){},e.prototype.getDataAtPixel=function(t,e,i){return Zt()},e.prototype.getLayer=function(){return this.layer_},e.prototype.handleFontsChanged=function(){},e.prototype.handleImageChange_=function(t){t.target.getState()===Aa&&this.renderIfReadyAndVisible()},e.prototype.loadImage=function(t){var e=t.getState();return e!=Aa&&e!=La&&t.addEventListener(It,this.boundHandleImageChange_),e==ja&&(t.load(),e=t.getState()),e==Aa},e.prototype.renderIfReadyAndVisible=function(){var t=this.getLayer();t.getVisible()&&t.getSourceState()==Ye&&t.changed()},e}(Yt),Eh=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}(),kh=function(t){function e(e){var i=t.call(this,e)||this;return i.container=null,i.renderedResolution,i.tempTransform=[1,0,0,1,0,0],i.pixelTransform=[1,0,0,1,0,0],i.inversePixelTransform=[1,0,0,1,0,0],i.context=null,i.containerReused=!1,i}return Eh(e,t),e.prototype.useContainer=function(t,e,i){var n,r,o=this.getLayer().getClassName();t&&""===t.style.opacity&&t.className===o&&((a=t.firstElementChild)instanceof HTMLCanvasElement&&(r=a.getContext("2d")));if(!r||0!==r.canvas.width&&r.canvas.style.transform!==e?this.containerReused&&(this.container=null,this.context=null,this.containerReused=!1):(this.container=t,this.context=r,this.containerReused=!0),!this.container){(n=document.createElement("div")).className=o;var s=n.style;s.position="absolute",s.width="100%",s.height="100%";var a=(r=pe()).canvas;n.appendChild(a),(s=a.style).position="absolute",s.left="0",s.transformOrigin="top left",this.container=n,this.context=r}},e.prototype.clipUnrotated=function(t,e,i){var n=bn(i),r=wn(i),o=yn(i),s=fn(i);gr(e.coordinateToPixelTransform,n),gr(e.coordinateToPixelTransform,r),gr(e.coordinateToPixelTransform,o),gr(e.coordinateToPixelTransform,s);var a=this.inversePixelTransform;gr(a,n),gr(a,r),gr(a,o),gr(a,s),t.save(),t.beginPath(),t.moveTo(Math.round(n[0]),Math.round(n[1])),t.lineTo(Math.round(r[0]),Math.round(r[1])),t.lineTo(Math.round(o[0]),Math.round(o[1])),t.lineTo(Math.round(s[0]),Math.round(s[1])),t.clip()},e.prototype.dispatchRenderEvent_=function(t,e,i){var n=this.getLayer();if(n.hasListener(t)){var r=new Lr(t,this.inversePixelTransform,i,e);n.dispatchEvent(r)}},e.prototype.preRender=function(t,e){this.dispatchRenderEvent_(We,t,e)},e.prototype.postRender=function(t,e){this.dispatchRenderEvent_(qe,t,e)},e.prototype.getRenderTransform=function(t,e,i,n,r,o,s){var a=r/2,l=o/2,u=n/e,h=-u,c=-t[0]+s,p=-t[1];return vr(this.tempTransform,a,l,u,h,-i,c,p)},e.prototype.getDataAtPixel=function(t,e,i){var n,r=gr(this.inversePixelTransform,t.slice()),o=this.context,s=this.getLayer().getExtent();if(s&&!$i(s,gr(e.pixelToCoordinateTransform,t.slice())))return null;try{var a=Math.round(r[0]),l=Math.round(r[1]),u=document.createElement("canvas"),h=u.getContext("2d");u.width=1,u.height=1,h.clearRect(0,0,1,1),h.drawImage(o.canvas,a,l,1,1,0,0,1,1),n=h.getImageData(0,0,1,1).data}catch(c){return"SecurityError"===c.name?new Uint8Array:n}return 0===n[3]?null:n},e}(Th),Ph="Circle",Oh="Default",Rh="Image",Ih="LineString",Fh="Polygon",jh="Text";function Mh(t,e,i,n,r,o,s,a,l,u,h,c){var p=t[e],d=t[e+1],f=0,y=0,g=0,m=0;function v(){f=p,y=d,p=t[e+=n],d=t[e+1],m+=g,g=Math.sqrt((p-f)*(p-f)+(d-y)*(d-y))}do{v()}while(e<i-n&&m+g<o);for(var _=(o-m)/g,x=Ge(f,p,_),b=Ge(y,d,_),w=e-n,S=m,C=o+a*l(u,r,h);e<i-n&&m+g<C;)v();var T,E=Ge(f,p,_=(C-m)/g),k=Ge(y,d,_);if(c){var P=[x,b,E,k];No(P,0,4,2,c,P,P),T=P[0]>P[2]}else T=x>E;var O,R=Math.PI,I=[],F=w+n===e;if(g=0,m=S,p=t[e=w],d=t[e+1],F){v();var j=Math.atan2(d-y,p-f);T&&(j+=j>0?-R:R);var M=(E+x)/2,A=(k+b)/2;return I[0]=[M,A,(C-o)/2,j,r],I}for(var L=0,z=r.length;L<z;){v();var D=Math.atan2(d-y,p-f);if(T&&(D+=D>0?-R:R),void 0!==O){var G=D-O;if(G+=G>R?-2*R:G<-R?2*R:0,Math.abs(G)>s)return null}O=D;for(var N=L,B=0;L<z;++L){var W=a*l(u,r[T?z-L-1:L],h);if(e+n<i&&m+g<o+B+W/2)break;B+=W}if(L!==N){var q=T?r.substring(z-N,z-L):r.substring(N,L);M=Ge(f,p,_=(o+B/2-m)/g),A=Ge(y,d,_);I.push([M,A,B/2,D,q]),o+=B}}return I}var Ah=[1/0,1/0,-1/0,-1/0],Lh=[],zh=[],Dh=[],Gh=[];function Nh(t){return t[3].declutterBox}var Bh=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 Wh(t,e){return"start"!==e&&"end"!==e||Bh.test(t)||(e="start"===e?"left":"right"),bh[e]}var qh=function(){function t(t,e,i,n){this.overlaps=i,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,i,n){var r=t+e+i+n;if(this.labels_[r])return this.labels_[r];var o=n?this.strokeStates[n]:null,s=i?this.fillStates[i]:null,a=this.textStates[e],l=this.pixelRatio,u=[a.scale[0]*l,a.scale[1]*l],h=Wh(t,a.textAlign||"center"),c=n&&o.lineWidth?o.lineWidth:0,p=t.split("\n"),d=p.length,f=[],y=function(t,e,i){for(var n=e.length,r=0,o=0;o<n;++o){var s=Yr(t,e[o]);r=Math.max(r,s),i.push(s)}return r}(a.font,p,f),g=Xr(a.font),m=y+c,v=[],_=(m+2)*u[0],x=(g*d+c)*u[1],b={width:_<0?Math.floor(_):Math.ceil(_),height:x<0?Math.floor(x):Math.ceil(x),contextInstructions:v};(1==u[0]&&1==u[1]||v.push("scale",u),v.push("font",a.font),n)&&(v.push("strokeStyle",o.strokeStyle),v.push("lineWidth",c),v.push("lineCap",o.lineCap),v.push("lineJoin",o.lineJoin),v.push("miterLimit",o.miterLimit),(ue?OffscreenCanvasRenderingContext2D:CanvasRenderingContext2D).prototype.setLineDash&&(v.push("setLineDash",[o.lineDash]),v.push("lineDashOffset",o.lineDashOffset)));i&&v.push("fillStyle",s.fillStyle),v.push("textBaseline","middle"),v.push("textAlign","center");var w,S=.5-h,C=h*m+S*c;if(n)for(w=0;w<d;++w)v.push("strokeText",[p[w],C+S*f[w],.5*(c+g)+w*g]);if(i)for(w=0;w<d;++w)v.push("fillText",[p[w],C+S*f[w],.5*(c+g)+w*g]);return this.labels_[r]=b,b},t.prototype.replayTextBackground_=function(t,e,i,n,r,o,s){t.beginPath(),t.moveTo.apply(t,e),t.lineTo.apply(t,i),t.lineTo.apply(t,n),t.lineTo.apply(t,r),t.lineTo.apply(t,e),o&&(this.alignFill_=o[2],this.fill_(t)),s&&(this.setStrokeStyle_(t,s),t.stroke())},t.prototype.calculateImageOrLabelDimensions_=function(t,e,i,n,r,o,s,a,l,u,h,c,p,d,f,y){var g,m=i-(s*=c[0]),v=n-(a*=c[1]),_=r+l>t?t-l:r,x=o+u>e?e-u:o,b=d[3]+_*c[0]+d[1],w=d[0]+x*c[1]+d[2],S=m-d[3],C=v-d[0];return(f||0!==h)&&(Lh[0]=S,Gh[0]=S,Lh[1]=C,zh[1]=C,zh[0]=S+b,Dh[0]=zh[0],Dh[1]=C+w,Gh[1]=Dh[1]),0!==h?(gr(g=vr([1,0,0,1,0,0],i,n,1,1,h,-i,-n),Lh),gr(g,zh),gr(g,Dh),gr(g,Gh),nn(Math.min(Lh[0],zh[0],Dh[0],Gh[0]),Math.min(Lh[1],zh[1],Dh[1],Gh[1]),Math.max(Lh[0],zh[0],Dh[0],Gh[0]),Math.max(Lh[1],zh[1],Dh[1],Gh[1]),Ah)):nn(Math.min(S,S+b),Math.min(C,C+w),Math.max(S,S+b),Math.max(C,C+w),Ah),p&&(m=Math.round(m),v=Math.round(v)),{drawImageX:m,drawImageY:v,drawImageW:_,drawImageH:x,originX:l,originY:u,declutterBox:{minX:Ah[0],minY:Ah[1],maxX:Ah[2],maxY:Ah[3],value:y},canvasTransform:g,scale:c}},t.prototype.replayImageOrLabel_=function(t,e,i,n,r,o,s){var a=!(!o&&!s),l=n.declutterBox,u=t.canvas,h=s?s[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&&(a&&this.replayTextBackground_(t,Lh,zh,Dh,Gh,o,s),Hr(t,n.canvasTransform,r,i,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=gr(this.renderedTransform_,[0,0]),i=512*this.pixelRatio;t.save(),t.translate(e[0]%i,e[1]%i),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,i,n){var r=this.textStates[e],o=this.createLabel(t,e,n,i),s=this.strokeStates[i],a=this.pixelRatio,l=Wh(t,r.textAlign||"center"),u=bh[r.textBaseline||"middle"],h=s&&s.lineWidth?s.lineWidth:0;return{label:o,anchorX:l*(o.width/a-2*r.scale[0])+2*(.5-l)*h,anchorY:u*o.height/a+2*(.5-u)*h}},t.prototype.execute_=function(t,e,i,n,r,o,s,a){var l;this.pixelCoordinates_&&xt(i,this.renderedTransform_)?l=this.pixelCoordinates_:(this.pixelCoordinates_||(this.pixelCoordinates_=[]),l=Go(this.coordinates,0,this.coordinates.length,2,i,this.pixelCoordinates_),function(t,e){t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5]}(this.renderedTransform_,i));for(var u,h,c,p,d,f,y,g,m,v,_,x,b,w,S,C,T=0,E=n.length,k=0,P=0,O=0,R=null,I=null,F=this.coordinateCache_,j=this.viewRotation_,M=Math.round(1e12*Math.atan2(-i[1],i[0]))/1e12,A={context:t,pixelRatio:this.pixelRatio,resolution:this.resolution,rotation:j},L=this.instructions!=n||this.overlaps?0:200;T<E;){var z=n[T];switch(z[0]){case uh.BEGIN_GEOMETRY:b=z[1],C=z[3],b.getGeometry()?void 0===s||Cn(s,C.getExtent())?++T:T=z[2]+1:T=z[2];break;case uh.BEGIN_PATH:P>L&&(this.fill_(t),P=0),O>L&&(t.stroke(),O=0),P||O||(t.beginPath(),p=NaN,d=NaN),++T;break;case uh.CIRCLE:var D=l[k=z[1]],G=l[k+1],N=l[k+2]-D,B=l[k+3]-G,W=Math.sqrt(N*N+B*B);t.moveTo(D+W,G),t.arc(D,G,W,0,2*Math.PI,!0),++T;break;case uh.CLOSE_PATH:t.closePath(),++T;break;case uh.CUSTOM:k=z[1],u=z[2];var q=z[3],V=z[4],U=6==z.length?z[5]:void 0;A.geometry=q,A.feature=b,T in F||(F[T]=[]);var X=F[T];U?U(l,k,u,2,X):(X[0]=l[k],X[1]=l[k+1],X.length=2),V(X,A),++T;break;case uh.DRAW_IMAGE:k=z[1],u=z[2],g=z[3],h=z[4],c=z[5];var K=z[6],Y=z[7],Z=z[8],H=z[9],$=z[10],J=z[11],Q=z[12],tt=z[13],et=z[14];if(!g&&z.length>=19){m=z[18],v=z[19],_=z[20],x=z[21];var it=this.drawLabelWithPointPlacement_(m,v,_,x);g=it.label,z[3]=g;var nt=z[22];h=(it.anchorX-nt)*this.pixelRatio,z[4]=h;var rt=z[23];c=(it.anchorY-rt)*this.pixelRatio,z[5]=c,K=g.height,z[6]=K,tt=g.width,z[13]=tt}var ot=void 0;z.length>24&&(ot=z[24]);var st=void 0,at=void 0,lt=void 0;z.length>16?(st=z[15],at=z[16],lt=z[17]):(st=Dr,at=!1,lt=!1),$&&M?J+=j:$||M||(J-=j);for(var ut=0;k<u;k+=2)if(!(ot&&ot[ut++]<tt/this.pixelRatio)){var ht=[t,e,g,Dt=this.calculateImageOrLabelDimensions_(g.width,g.height,l[k],l[k+1],tt,K,h,c,Z,H,J,Q,r,st,at||lt,b),Y,at?R:null,lt?I:null],ct=void 0,pt=void 0;if(a&&et){var dt=u-k;if(!et[dt]){et[dt]=ht;continue}if(ct=et[dt],delete et[dt],pt=Nh(ct),a.collides(pt))continue}a&&a.collides(Dt.declutterBox)||(ct&&(a&&a.insert(pt),this.replayImageOrLabel_.apply(this,ct)),a&&a.insert(Dt.declutterBox),this.replayImageOrLabel_.apply(this,ht))}++T;break;case uh.DRAW_CHARS:var ft=z[1],yt=z[2],gt=z[3],mt=z[4];x=z[5];var vt=z[6],_t=z[7],bt=z[8];_=z[9];var wt=z[10];m=z[11],v=z[12];var St=[z[13],z[13]],Ct=this.textStates[v],Tt=Ct.font,Et=[Ct.scale[0]*_t,Ct.scale[1]*_t],kt=void 0;Tt in this.widths_?kt=this.widths_[Tt]:(kt={},this.widths_[Tt]=kt);var Pt=ua(l,ft,yt,2),Ot=Math.abs(Et[0])*Zr(Tt,m,kt);if(mt||Ot<=Pt){var Rt=this.textStates[v].textAlign,It=Mh(l,ft,yt,2,m,(Pt-Ot)*bh[Rt],vt,Math.abs(Et[0]),Zr,Tt,kt,M?0:this.viewRotation_);t:if(It){var Ft=[],jt=void 0,Mt=void 0,At=void 0,Lt=void 0,zt=void 0;if(_)for(jt=0,Mt=It.length;jt<Mt;++jt){At=(zt=It[jt])[4],Lt=this.createLabel(At,v,"",_),h=zt[2]+(Et[0]<0?-wt:wt),c=gt*Lt.height+2*(.5-gt)*wt*Et[1]/Et[0]-bt;var Dt=this.calculateImageOrLabelDimensions_(Lt.width,Lt.height,zt[0],zt[1],Lt.width,Lt.height,h,c,0,0,zt[3],St,!1,Dr,!1,b);if(a&&a.collides(Dt.declutterBox))break t;Ft.push([t,e,Lt,Dt,1,null,null])}if(x)for(jt=0,Mt=It.length;jt<Mt;++jt){At=(zt=It[jt])[4],Lt=this.createLabel(At,v,x,""),h=zt[2],c=gt*Lt.height-bt;Dt=this.calculateImageOrLabelDimensions_(Lt.width,Lt.height,zt[0],zt[1],Lt.width,Lt.height,h,c,0,0,zt[3],St,!1,Dr,!1,b);if(a&&a.collides(Dt.declutterBox))break t;Ft.push([t,e,Lt,Dt,1,null,null])}a&&a.load(Ft.map(Nh));for(var Gt=0,Nt=Ft.length;Gt<Nt;++Gt)this.replayImageOrLabel_.apply(this,Ft[Gt])}}++T;break;case uh.END_GEOMETRY:if(void 0!==o){var Bt=o(b=z[1],C);if(Bt)return Bt}++T;break;case uh.FILL:L?P++:this.fill_(t),++T;break;case uh.MOVE_TO_LINE_TO:for(k=z[1],u=z[2],w=l[k],y=(S=l[k+1])+.5|0,(f=w+.5|0)===p&&y===d||(t.moveTo(w,S),p=f,d=y),k+=2;k<u;k+=2)f=(w=l[k])+.5|0,y=(S=l[k+1])+.5|0,k!=u-2&&f===p&&y===d||(t.lineTo(w,S),p=f,d=y);++T;break;case uh.SET_FILL_STYLE:R=z,this.alignFill_=z[2],P&&(this.fill_(t),P=0,O&&(t.stroke(),O=0)),t.fillStyle=z[1],++T;break;case uh.SET_STROKE_STYLE:I=z,O&&(t.stroke(),O=0),this.setStrokeStyle_(t,z),++T;break;case uh.STROKE:L?O++:t.stroke(),++T;break;default:++T}}P&&this.fill_(t),O&&t.stroke()},t.prototype.execute=function(t,e,i,n,r,o){this.viewRotation_=n,this.execute_(t,e,i,this.instructions,r,void 0,void 0,o)},t.prototype.executeHitDetection=function(t,e,i,n,r){return this.viewRotation_=i,this.execute_(t,1,e,this.hitDetectionInstructions,!0,n,r)},t}(),Vh=[Fh,Ph,Ih,Rh,jh,Oh],Uh=function(){function t(t,e,i,n,r,o){this.maxExtent_=t,this.overlaps_=n,this.pixelRatio_=i,this.resolution_=e,this.renderBuffer_=o,this.executorsByZIndex_={},this.hitDetectionContext_=null,this.hitDetectionTransform_=[1,0,0,1,0,0],this.createExecutors_(r)}return t.prototype.clip=function(t,e){var i=this.getClipCoords(e);t.beginPath(),t.moveTo(i[0],i[1]),t.lineTo(i[2],i[3]),t.lineTo(i[4],i[5]),t.lineTo(i[6],i[7]),t.clip()},t.prototype.createExecutors_=function(t){for(var e in t){var i=this.executorsByZIndex_[e];void 0===i&&(i={},this.executorsByZIndex_[e]=i);var n=t[e];for(var r in n){var o=n[r];i[r]=new qh(this.resolution_,this.pixelRatio_,this.overlaps_,o)}}},t.prototype.hasExecutors=function(t){for(var e in this.executorsByZIndex_)for(var i=this.executorsByZIndex_[e],n=0,r=t.length;n<r;++n)if(t[n]in i)return!0;return!1},t.prototype.forEachFeatureAtCoordinate=function(t,e,i,n,r,o){var s=2*(n=Math.round(n))+1,a=vr(this.hitDetectionTransform_,n+.5,n+.5,1/e,-1/e,-i,-t[0],-t[1]),l=!this.hitDetectionContext_;l&&(this.hitDetectionContext_=pe(s,s));var u,h=this.hitDetectionContext_;h.canvas.width!==s||h.canvas.height!==s?(h.canvas.width=s,h.canvas.height=s):l||h.clearRect(0,0,s,s),void 0!==this.renderBuffer_&&(un(u=[1/0,1/0,-1/0,-1/0],t),Yi(u,e*(this.renderBuffer_+n),u));var c,p=function(t){if(void 0!==Xh[t])return Xh[t];for(var e=2*t+1,i=t*t,n=new Array(i+1),r=0;r<=t;++r)for(var o=0;o<=t;++o){var s=r*r+o*o;if(s>i)break;var a=n[s];a||(a=[],n[s]=a),a.push(4*((t+r)*e+(t+o))+3),r>0&&a.push(4*((t-r)*e+(t+o))+3),o>0&&(a.push(4*((t+r)*e+(t-o))+3),r>0&&a.push(4*((t-r)*e+(t-o))+3))}for(var l=[],u=(r=0,n.length);r<u;++r)n[r]&&l.push.apply(l,n[r]);return Xh[t]=l,l}(n);function d(t,e){for(var i=h.getImageData(0,0,s,s).data,a=0,l=p.length;a<l;a++)if(i[p[a]]>0){if(!o||c!==Rh&&c!==jh||-1!==o.indexOf(t)){var u=(p[a]-3)/4,d=n-u%s,f=n-(u/s|0),y=r(t,e,d*d+f*f);if(y)return y}h.clearRect(0,0,s,s);break}}var f,y,g,m,v,_=Object.keys(this.executorsByZIndex_).map(Number);for(_.sort(gt),f=_.length-1;f>=0;--f){var x=_[f].toString();for(g=this.executorsByZIndex_[x],y=Vh.length-1;y>=0;--y)if(void 0!==(m=g[c=Vh[y]])&&(v=m.executeHitDetection(h,a,i,d,u)))return v}},t.prototype.getClipCoords=function(t){var e=this.maxExtent_;if(!e)return null;var i=e[0],n=e[1],r=e[2],o=e[3],s=[i,n,i,o,r,o,r,n];return Go(s,0,8,2,t,s),s},t.prototype.isEmpty=function(){return kt(this.executorsByZIndex_)},t.prototype.execute=function(t,e,i,n,r,o,s){var a=Object.keys(this.executorsByZIndex_).map(Number);a.sort(gt),this.maxExtent_&&(t.save(),this.clip(t,i));var l,u,h,c,p,d,f=o||Vh;for(s&&a.reverse(),l=0,u=a.length;l<u;++l){var y=a[l].toString();for(p=this.executorsByZIndex_[y],h=0,c=f.length;h<c;++h){void 0!==(d=p[f[h]])&&d.execute(t,e,i,n,r,s)}}this.maxExtent_&&t.restore()},t}(),Xh={};var Kh=Uh,Yh=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}(),Zh=function(t){function e(e,i,n,r,o,s,a){var l=t.call(this)||this;return l.context_=e,l.pixelRatio_=i,l.extent_=n,l.transform_=r,l.viewRotation_=o,l.squaredTolerance_=s,l.userTransform_=a,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 Yh(e,t),e.prototype.drawImages_=function(t,e,i,n){if(this.image_){var r=Go(t,e,i,n,this.transform_,this.pixelCoordinates_),o=this.context_,s=this.tmpLocalTransform_,a=o.globalAlpha;1!=this.imageOpacity_&&(o.globalAlpha=a*this.imageOpacity_);var l=this.imageRotation_;this.imageRotateWithView_&&(l+=this.viewRotation_);for(var u=0,h=r.length;u<h;u+=2){var c=r[u]-this.imageAnchorX_,p=r[u+1]-this.imageAnchorY_;if(0!==l||1!=this.imageScale_[0]||1!=this.imageScale_[1]){var d=c+this.imageAnchorX_,f=p+this.imageAnchorY_;vr(s,d,f,1,1,l,-d,-f),o.setTransform.apply(o,s),o.translate(d,f),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=a)}},e.prototype.drawText_=function(t,e,i,n){if(this.textState_&&""!==this.text_){this.textFillState_&&this.setContextFillState_(this.textFillState_),this.textStrokeState_&&this.setContextStrokeState_(this.textStrokeState_),this.setContextTextState_(this.textState_);var r=Go(t,e,i,n,this.transform_,this.pixelCoordinates_),o=this.context_,s=this.textRotation_;for(this.textRotateWithView_&&(s+=this.viewRotation_);e<i;e+=n){var a=r[e]+this.textOffsetX_,l=r[e+1]+this.textOffsetY_;if(0!==s||1!=this.textScale_[0]||1!=this.textScale_[1]){var u=vr(this.tmpLocalTransform_,a,l,1,1,s,-a,-l);o.setTransform.apply(o,u),o.translate(a,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_,a,l),this.textFillState_&&o.fillText(this.text_,a,l)}}},e.prototype.moveToLineTo_=function(t,e,i,n,r){var o=this.context_,s=Go(t,e,i,n,this.transform_,this.pixelCoordinates_);o.moveTo(s[0],s[1]);var a=s.length;r&&(a-=2);for(var l=2;l<a;l+=2)o.lineTo(s[l],s[l+1]);return r&&o.closePath(),i},e.prototype.drawRings_=function(t,e,i,n){for(var r=0,o=i.length;r<o;++r)e=this.moveToLineTo_(t,e,i[r],n,!0);return e},e.prototype.drawCircle=function(t){if(Cn(this.extent_,t.getExtent())){if(this.fillState_||this.strokeState_){this.fillState_&&this.setContextFillState_(this.fillState_),this.strokeState_&&this.setContextStrokeState_(this.strokeState_);var e=function(t,e,i){var n=t.getFlatCoordinates();if(n){var r=t.getStride();return Go(n,0,n.length,r,e,i)}return null}(t,this.transform_,this.pixelCoordinates_),i=e[2]-e[0],n=e[3]-e[1],r=Math.sqrt(i*i+n*n),o=this.context_;o.beginPath(),o.arc(e[0],e[1],r,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 kn:this.drawPoint(t);break;case Pn:this.drawLineString(t);break;case Rn:this.drawPolygon(t);break;case In:this.drawMultiPoint(t);break;case Fn:this.drawMultiLineString(t);break;case jn:this.drawMultiPolygon(t);break;case Mn:this.drawGeometryCollection(t);break;case An:this.drawCircle(t)}},e.prototype.drawFeature=function(t,e){var i=e.getGeometryFunction()(t);i&&Cn(this.extent_,i.getExtent())&&(this.setStyle(e),this.drawGeometry(i))},e.prototype.drawGeometryCollection=function(t){for(var e=t.getGeometriesArray(),i=0,n=e.length;i<n;++i)this.drawGeometry(e[i])},e.prototype.drawPoint=function(t){this.squaredTolerance_&&(t=t.simplifyTransformed(this.squaredTolerance_,this.userTransform_));var e=t.getFlatCoordinates(),i=t.getStride();this.image_&&this.drawImages_(e,0,e.length,i),""!==this.text_&&this.drawText_(e,0,e.length,i)},e.prototype.drawMultiPoint=function(t){this.squaredTolerance_&&(t=t.simplifyTransformed(this.squaredTolerance_,this.userTransform_));var e=t.getFlatCoordinates(),i=t.getStride();this.image_&&this.drawImages_(e,0,e.length,i),""!==this.text_&&this.drawText_(e,0,e.length,i)},e.prototype.drawLineString=function(t){if(this.squaredTolerance_&&(t=t.simplifyTransformed(this.squaredTolerance_,this.userTransform_)),Cn(this.extent_,t.getExtent())){if(this.strokeState_){this.setContextStrokeState_(this.strokeState_);var e=this.context_,i=t.getFlatCoordinates();e.beginPath(),this.moveToLineTo_(i,0,i.length,t.getStride(),!1),e.stroke()}if(""!==this.text_){var n=t.getFlatMidpoint();this.drawText_(n,0,2,2)}}},e.prototype.drawMultiLineString=function(t){this.squaredTolerance_&&(t=t.simplifyTransformed(this.squaredTolerance_,this.userTransform_));var e=t.getExtent();if(Cn(this.extent_,e)){if(this.strokeState_){this.setContextStrokeState_(this.strokeState_);var i=this.context_,n=t.getFlatCoordinates(),r=0,o=t.getEnds(),s=t.getStride();i.beginPath();for(var a=0,l=o.length;a<l;++a)r=this.moveToLineTo_(n,r,o[a],s,!1);i.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_)),Cn(this.extent_,t.getExtent())){if(this.strokeState_||this.fillState_){this.fillState_&&this.setContextFillState_(this.fillState_),this.strokeState_&&this.setContextStrokeState_(this.strokeState_);var e=this.context_;e.beginPath(),this.drawRings_(t.getOrientedFlatCoordinates(),0,t.getEnds(),t.getStride()),this.fillState_&&e.fill(),this.strokeState_&&e.stroke()}if(""!==this.text_){var i=t.getFlatInteriorPoint();this.drawText_(i,0,2,2)}}},e.prototype.drawMultiPolygon=function(t){if(this.squaredTolerance_&&(t=t.simplifyTransformed(this.squaredTolerance_,this.userTransform_)),Cn(this.extent_,t.getExtent())){if(this.strokeState_||this.fillState_){this.fillState_&&this.setContextFillState_(this.fillState_),this.strokeState_&&this.setContextStrokeState_(this.strokeState_);var e=this.context_,i=t.getOrientedFlatCoordinates(),n=0,r=t.getEndss(),o=t.getStride();e.beginPath();for(var s=0,a=r.length;s<a;++s){var l=r[s];n=this.drawRings_(i,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_,i=this.contextFillState_;i?i.fillStyle!=t.fillStyle&&(i.fillStyle=t.fillStyle,e.fillStyle=t.fillStyle):(e.fillStyle=t.fillStyle,this.contextFillState_={fillStyle:t.fillStyle})},e.prototype.setContextStrokeState_=function(t){var e=this.context_,i=this.contextStrokeState_;i?(i.lineCap!=t.lineCap&&(i.lineCap=t.lineCap,e.lineCap=t.lineCap),e.setLineDash&&(xt(i.lineDash,t.lineDash)||e.setLineDash(i.lineDash=t.lineDash),i.lineDashOffset!=t.lineDashOffset&&(i.lineDashOffset=t.lineDashOffset,e.lineDashOffset=t.lineDashOffset)),i.lineJoin!=t.lineJoin&&(i.lineJoin=t.lineJoin,e.lineJoin=t.lineJoin),i.lineWidth!=t.lineWidth&&(i.lineWidth=t.lineWidth,e.lineWidth=t.lineWidth),i.miterLimit!=t.miterLimit&&(i.miterLimit=t.miterLimit,e.miterLimit=t.miterLimit),i.strokeStyle!=t.strokeStyle&&(i.strokeStyle=t.strokeStyle,e.strokeStyle=t.strokeStyle)):(e.lineCap=t.lineCap,e.setLineDash&&(e.setLineDash(t.lineDash),e.lineDashOffset=t.lineDashOffset),e.lineJoin=t.lineJoin,e.lineWidth=t.lineWidth,e.miterLimit=t.miterLimit,e.strokeStyle=t.strokeStyle,this.contextStrokeState_={lineCap:t.lineCap,lineDash:t.lineDash,lineDashOffset:t.lineDashOffset,lineJoin:t.lineJoin,lineWidth:t.lineWidth,miterLimit:t.miterLimit,strokeStyle:t.strokeStyle})},e.prototype.setContextTextState_=function(t){var e=this.context_,i=this.contextTextState_,n=t.textAlign?t.textAlign:"center";i?(i.font!=t.font&&(i.font=t.font,e.font=t.font),i.textAlign!=n&&(i.textAlign=n,e.textAlign=n),i.textBaseline!=t.textBaseline&&(i.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 i=this;if(t){var n=t.getColor();this.fillState_={fillStyle:Ya(n||"#000")}}else this.fillState_=null;if(e){var r=e.getColor(),o=e.getLineCap(),s=e.getLineDash(),a=e.getLineDashOffset(),l=e.getLineJoin(),u=e.getWidth(),h=e.getMiterLimit(),c=s||zr;this.strokeState_={lineCap:void 0!==o?o:"round",lineDash:1===this.pixelRatio_?c:c.map((function(t){return t*i.pixelRatio_})),lineDashOffset:(a||0)*this.pixelRatio_,lineJoin:void 0!==l?l:"round",lineWidth:(void 0!==u?u:1)*this.pixelRatio_,miterLimit:void 0!==h?h:10,strokeStyle:Ya(r||"#000")}}else this.strokeState_=null},e.prototype.setImageStyle=function(t){var e;if(t&&(e=t.getSize())){var i=t.getAnchor(),n=t.getOrigin();this.image_=t.getImage(this.pixelRatio_),this.imageAnchorX_=i[0]*this.pixelRatio_,this.imageAnchorY_=i[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 i=e.getColor();this.textFillState_={fillStyle:Ya(i||"#000")}}else this.textFillState_=null;var n=t.getStroke();if(n){var r=n.getColor(),o=n.getLineCap(),s=n.getLineDash(),a=n.getLineDashOffset(),l=n.getLineJoin(),u=n.getWidth(),h=n.getMiterLimit();this.textStrokeState_={lineCap:void 0!==o?o:"round",lineDash:s||zr,lineDashOffset:a||0,lineJoin:void 0!==l?l:"round",lineWidth:void 0!==u?u:1,miterLimit:void 0!==h?h:10,strokeStyle:Ya(r||"#000")}}else this.textStrokeState_=null;var c=t.getFont(),p=t.getOffsetX(),d=t.getOffsetY(),f=t.getRotateWithView(),y=t.getRotation(),g=t.getScaleArray(),m=t.getText(),v=t.getTextAlign(),_=t.getTextBaseline();this.textState_={font:void 0!==c?c:"10px sans-serif",textAlign:void 0!==v?v:"center",textBaseline:void 0!==_?_:"middle"},this.text_=void 0!==m?m:"",this.textOffsetX_=void 0!==p?this.pixelRatio_*p:0,this.textOffsetY_=void 0!==d?this.pixelRatio_*d:0,this.textRotateWithView_=void 0!==f&&f,this.textRotation_=void 0!==y?y:0,this.textScale_=[this.pixelRatio_*g[0],this.pixelRatio_*g[1]]}else this.text_=""},e}(hh);function Hh(t,e,i,n,r,o,s){var a=pe(.5*t[0],.5*t[1]);a.imageSmoothingEnabled=!1;for(var l=a.canvas,u=new Zh(a,.5,r,null,s),h=i.length,c=Math.floor(16777215/h),p={},d=1;d<=h;++d){var f=i[d-1],y=f.getStyleFunction()||n;if(n){var g=y(f,o);if(g){Array.isArray(g)||(g=[g]);for(var m="#"+("000000"+(d*c).toString(16)).slice(-6),v=0,_=g.length;v<_;++v){var x=g[v],b=x.getGeometryFunction()(f);if(b&&Cn(r,b.getExtent())){var w=x.clone(),S=w.getFill();S&&S.setColor(m);var C=w.getStroke();C&&(C.setColor(m),C.setLineDash(null)),w.setText(void 0);var T=x.getImage();if(T&&0!==T.getOpacity()){var E=T.getImageSize();if(!E)continue;var k=pe(E[0],E[1],void 0,{alpha:!1}),P=k.canvas;k.fillStyle=m,k.fillRect(0,0,P.width,P.height),w.setImage(new Xa({img:P,imgSize:E,anchor:T.getAnchor(),anchorXUnits:Pa,anchorYUnits:Pa,offset:T.getOrigin(),opacity:1,size:T.getSize(),scale:T.getScale(),rotation:T.getRotation(),rotateWithView:T.getRotateWithView()}))}var O=w.getZIndex()||0;(F=p[O])||(F={},p[O]=F,F[Rn]=[],F[An]=[],F[Pn]=[],F[kn]=[]),F[b.getType().replace("Multi","")].push(b,w)}}}}}for(var R=Object.keys(p).map(Number).sort(gt),I=(d=0,R.length);d<I;++d){var F=p[R[d]];for(var j in F){var M=F[j];for(v=0,_=M.length;v<_;v+=2){u.setStyle(M[v+1]);for(var A=0,L=e.length;A<L;++A)u.setTransform(e[A]),u.drawGeometry(M[v])}}}return a.getImageData(0,0,l.width,l.height)}function $h(t,e,i){var n=[];if(i){var r=Math.floor(.5*Math.round(t[0])),o=Math.floor(.5*Math.round(t[1])),s=4*(Fe(r,0,i.width-1)+Fe(o,0,i.height-1)*i.width),a=i.data[s],l=i.data[s+1],u=i.data[s+2]+256*(l+256*a),h=Math.floor(16777215/e.length);u&&u%h==0&&n.push(e[u/h-1])}return n}var Jh={Point:function(t,e,i,n,r){var o,s=i.getImage(),a=i.getText();r&&(t=r,o=s&&a&&a.getText()?{}:void 0);if(s){if(s.getImageState()!=Aa)return;var l=t.getBuilder(i.getZIndex(),Rh);l.setImageStyle(s,o),l.drawPoint(e,n)}if(a&&a.getText()){var u=t.getBuilder(i.getZIndex(),jh);u.setTextStyle(a,o),u.drawText(e,n)}},LineString:function(t,e,i,n,r){var o=i.getStroke();if(o){var s=t.getBuilder(i.getZIndex(),Ih);s.setFillStrokeStyle(null,o),s.drawLineString(e,n)}var a=i.getText();if(a&&a.getText()){var l=(r||t).getBuilder(i.getZIndex(),jh);l.setTextStyle(a),l.drawText(e,n)}},Polygon:function(t,e,i,n,r){var o=i.getFill(),s=i.getStroke();if(o||s){var a=t.getBuilder(i.getZIndex(),Fh);a.setFillStrokeStyle(o,s),a.drawPolygon(e,n)}var l=i.getText();if(l&&l.getText()){var u=(r||t).getBuilder(i.getZIndex(),jh);u.setTextStyle(l),u.drawText(e,n)}},MultiPoint:function(t,e,i,n,r){var o,s=i.getImage(),a=i.getText();r&&(t=r,o=s&&a&&a.getText()?{}:void 0);if(s){if(s.getImageState()!=Aa)return;var l=t.getBuilder(i.getZIndex(),Rh);l.setImageStyle(s,o),l.drawMultiPoint(e,n)}if(a&&a.getText()){var u=(r||t).getBuilder(i.getZIndex(),jh);u.setTextStyle(a,o),u.drawText(e,n)}},MultiLineString:function(t,e,i,n,r){var o=i.getStroke();if(o){var s=t.getBuilder(i.getZIndex(),Ih);s.setFillStrokeStyle(null,o),s.drawMultiLineString(e,n)}var a=i.getText();if(a&&a.getText()){var l=(r||t).getBuilder(i.getZIndex(),jh);l.setTextStyle(a),l.drawText(e,n)}},MultiPolygon:function(t,e,i,n,r){var o=i.getFill(),s=i.getStroke();if(s||o){var a=t.getBuilder(i.getZIndex(),Fh);a.setFillStrokeStyle(o,s),a.drawMultiPolygon(e,n)}var l=i.getText();if(l&&l.getText()){var u=(r||t).getBuilder(i.getZIndex(),jh);u.setTextStyle(l),u.drawText(e,n)}},GeometryCollection:function(t,e,i,n,r){var o,s,a=e.getGeometriesArray();for(o=0,s=a.length;o<s;++o){(0,Jh[a[o].getType()])(t,a[o],i,n,r)}},Circle:function(t,e,i,n,r){var o=i.getFill(),s=i.getStroke();if(o||s){var a=t.getBuilder(i.getZIndex(),Ph);a.setFillStrokeStyle(o,s),a.drawCircle(e,n)}var l=i.getText();if(l&&l.getText()){var u=(r||t).getBuilder(i.getZIndex(),jh);u.setTextStyle(l),u.drawText(e,n)}}};function Qh(t,e){return parseInt($t(t),10)-parseInt($t(e),10)}function tc(t,e){var i=ec(t,e);return i*i}function ec(t,e){return.5*t/e}function ic(t,e,i,n,r,o,s){var a=!1,l=i.getImage();if(l){var u=l.getImageState();u==Aa||u==La?l.unlistenImageChange(r):(u==ja&&l.load(),u=l.getImageState(),l.listenImageChange(r),a=!0)}return function(t,e,i,n,r,o){var s=i.getGeometryFunction()(e);if(!s)return;var a=s.simplifyTransformed(n,r);if(i.getRenderer())nc(t,a,i,e);else{(0,Jh[a.getType()])(t,a,i,e,o)}}(t,e,i,n,o,s),a}function nc(t,e,i,n){if(e.getType()!=Mn)t.getBuilder(i.getZIndex(),Oh).drawCustom(e,n,i.getRenderer());else for(var r=e.getGeometries(),o=0,s=r.length;o<s;++o)nc(t,r[o],i,n)}var rc=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}(),oc=function(t){function e(e){var i=t.call(this,e)||this;return i.boundHandleStyleImageChange_=i.handleStyleImageChange_.bind(i),i.animatingOrInteracting_,i.dirty_=!1,i.hitDetectionImageData_=null,i.renderedFeatures_=null,i.renderedRevision_=-1,i.renderedResolution_=NaN,i.renderedExtent_=[1/0,1/0,-1/0,-1/0],i.wrappedRenderedExtent_=[1/0,1/0,-1/0,-1/0],i.renderedRotation_,i.renderedCenter_=null,i.renderedProjection_=null,i.renderedRenderOrder_=null,i.replayGroup_=null,i.replayGroupChanged=!0,i.declutterExecutorGroup=null,i.clipping=!0,i}return rc(e,t),e.prototype.useContainer=function(e,i,n){n<1&&(e=null),t.prototype.useContainer.call(this,e,i,n)},e.prototype.renderWorlds=function(t,e,i){var n=e.extent,r=e.viewState,o=r.center,s=r.resolution,a=r.projection,l=r.rotation,u=a.getExtent(),h=this.getLayer().getSource(),c=e.pixelRatio,p=e.viewHints,d=!(p[So]||p[Co]),f=this.context,y=Math.round(e.size[0]*c),g=Math.round(e.size[1]*c),m=h.getWrapX()&&a.canWrapX(),v=m?Sn(u):null,_=m?Math.ceil((n[2]-u[2])/v)+1:1,x=m?Math.floor((n[0]-u[0])/v):0;do{var b=this.getRenderTransform(o,s,l,c,y,g,x*v);t.execute(f,1,b,l,d,void 0,i)}while(++x<_)},e.prototype.renderDeclutter=function(t){this.declutterExecutorGroup&&this.renderWorlds(this.declutterExecutorGroup,t,t.declutterTree)},e.prototype.renderFrame=function(t,e){var i=t.pixelRatio,n=t.layerStatesArray[t.layerIndex];!function(t,e,i){yr(t,e,0,0,i,0,0)}(this.pixelTransform,1/i,1/i),_r(this.inversePixelTransform,this.pixelTransform);var r=xr(this.pixelTransform);this.useContainer(e,r,n.opacity);var o=this.context,s=o.canvas,a=this.replayGroup_,l=this.declutterExecutorGroup;if((!a||a.isEmpty())&&(!l||l.isEmpty()))return!this.containerReused&&s.width>0&&(s.width=0),this.container;var u=Math.round(t.size[0]*i),h=Math.round(t.size[1]*i);s.width!=u||s.height!=h?(s.width=u,s.height=h,s.style.transform!==r&&(s.style.transform=r)):this.containerReused||o.clearRect(0,0,u,h),this.preRender(o,t);var c=t.viewState;c.projection;var p=!1,d=!0;if(n.extent&&this.clipping){var f=hr(n.extent);(p=(d=Cn(f,t.extent))&&!Ji(f,t.extent))&&this.clipUnrotated(o,t,f)}d&&this.renderWorlds(a,t),p&&o.restore(),this.postRender(o,t);var y=n.opacity,g=this.container;return y!==parseFloat(g.style.opacity)&&(g.style.opacity=1===y?"":String(y)),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 i=[this.context.canvas.width,this.context.canvas.height];gr(this.pixelTransform,i);var n=this.renderedCenter_,r=this.renderedResolution_,o=this.renderedRotation_,s=this.renderedProjection_,a=this.wrappedRenderedExtent_,l=this.getLayer(),u=[],h=.5*i[0],c=.5*i[1];u.push(this.getRenderTransform(n,r,o,.5,h,c,0).slice());var p=l.getSource(),d=s.getExtent();if(p.getWrapX()&&s.canWrapX()&&!Ji(d,a)){for(var f=a[0],y=Sn(d),g=0,m=void 0;f<d[0];)m=y*--g,u.push(this.getRenderTransform(n,r,o,.5,h,c,m).slice()),f+=y;for(g=0,f=a[2];f>d[2];)m=y*++g,u.push(this.getRenderTransform(n,r,o,.5,h,c,m).slice()),f-=y}this.hitDetectionImageData_=Hh(i,u,this.renderedFeatures_,l.getStyleFunction(),a,r,o)}e($h(t,this.renderedFeatures_,this.hitDetectionImageData_))}.bind(this))},e.prototype.forEachFeatureAtCoordinate=function(t,e,i,n,r){var o=this;if(this.replayGroup_){var s,a=e.viewState.resolution,l=e.viewState.rotation,u=this.getLayer(),h={},c=function(t,e,i){var o=$t(t),s=h[o];if(s){if(!0!==s&&i<s.distanceSq){if(0===i)return h[o]=!0,r.splice(r.lastIndexOf(s),1),n(t,u,e);s.geometry=e,s.distanceSq=i}}else{if(0===i)return h[o]=!0,n(t,u,e);r.push(h[o]={feature:t,layer:u,geometry:e,distanceSq:i,callback:n})}},p=[this.replayGroup_];return this.declutterExecutorGroup&&p.push(this.declutterExecutorGroup),p.some((function(n){return s=n.forEachFeatureAtCoordinate(t,a,l,i,c,n===o.declutterExecutorGroup?e.declutterTree.all().map((function(t){return t.value})):null)})),s}},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(),i=e.getSource();if(!i)return!1;var n=t.viewHints[So],r=t.viewHints[Co],o=e.getUpdateWhileAnimating(),s=e.getUpdateWhileInteracting();if(!this.dirty_&&!o&&n||!s&&r)return this.animatingOrInteracting_=!0,!0;this.animatingOrInteracting_=!1;var a=t.extent,l=t.viewState,u=l.projection,h=l.resolution,c=t.pixelRatio,p=e.getRevision(),d=e.getRenderBuffer(),f=e.getRenderOrder();void 0===f&&(f=Qh);var y=l.center.slice(),g=Yi(a,d*h),m=g.slice(),v=[g.slice()],_=u.getExtent();if(i.getWrapX()&&u.canWrapX()&&!Ji(_,t.extent)){var x=Sn(_),b=Math.max(Sn(g)/2,x);g[0]=_[0]-b,g[2]=_[2]+b,Un(y,u);var w=function(t,e){var i=e.getExtent(),n=gn(t);if(e.canWrapX()&&(n[0]<i[0]||n[0]>=i[2])){var r=Sn(i),o=Math.floor((n[0]-i[0])/r)*r;t[0]-=o,t[2]-=o}return t}(v[0],u);w[0]<_[0]&&w[2]<_[2]?v.push([w[0]+x,w[1],w[2]+x,w[3]]):w[0]>_[0]&&w[2]>_[2]&&v.push([w[0]-x,w[1],w[2]-x,w[3]])}if(!this.dirty_&&this.renderedResolution_==h&&this.renderedRevision_==p&&this.renderedRenderOrder_==f&&Ji(this.wrappedRenderedExtent_,g))return xt(this.renderedExtent_,m)||(this.hitDetectionImageData_=null,this.renderedExtent_=m),this.renderedCenter_=y,this.replayGroupChanged=!1,!0;this.replayGroup_=null,this.dirty_=!1;var S,C=new Sh(ec(h,c),g,h,c);this.getLayer().getDeclutter()&&(S=new Sh(ec(h,c),g,h,c));for(var T=0,E=v.length;T<E;++T)i.loadFeatures(v[T],h,u);var k=tc(h,c),P=function(t){var i,n=t.getStyleFunction()||e.getStyleFunction();if(n&&(i=n(t,h)),i){var r=this.renderFeature(t,k,i,C,undefined,S);this.dirty_=this.dirty_||r}}.bind(this),O=ur(g),R=i.getFeaturesInExtent(O);f&&R.sort(f);for(T=0,E=R.length;T<E;++T)P(R[T]);this.renderedFeatures_=R;var I=C.finish(),F=new Kh(g,h,c,i.getOverlaps(),I,e.getRenderBuffer());return S&&(this.declutterExecutorGroup=new Kh(g,h,c,i.getOverlaps(),S.finish(),e.getRenderBuffer())),this.renderedResolution_=h,this.renderedRevision_=p,this.renderedRenderOrder_=f,this.renderedExtent_=m,this.wrappedRenderedExtent_=g,this.renderedCenter_=y,this.renderedProjection_=u,this.replayGroup_=F,this.hitDetectionImageData_=null,this.replayGroupChanged=!0,!0},e.prototype.renderFeature=function(t,e,i,n,r,o){if(!i)return!1;var s=!1;if(Array.isArray(i))for(var a=0,l=i.length;a<l;++a)s=ic(n,t,i[a],e,this.boundHandleStyleImageChange_,r,o)||s;else s=ic(n,t,i,e,this.boundHandleStyleImageChange_,r,o);return s},e}(kh),sc=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}(),ac=function(t){function e(e){return t.call(this,e)||this}return sc(e,t),e.prototype.createRenderer=function(){return new oc(this)},e}(nh),lc=function(){function t(t){this.rbush_=new Bu(t),this.items_={}}return t.prototype.insert=function(t,e){var i={minX:t[0],minY:t[1],maxX:t[2],maxY:t[3],value:e};this.rbush_.insert(i),this.items_[$t(e)]=i},t.prototype.load=function(t,e){for(var i=new Array(e.length),n=0,r=e.length;n<r;n++){var o=t[n],s=e[n],a={minX:o[0],minY:o[1],maxX:o[2],maxY:o[3],value:s};i[n]=a,this.items_[$t(s)]=a}this.rbush_.load(i)},t.prototype.remove=function(t){var e=$t(t),i=this.items_[e];return delete this.items_[e],null!==this.rbush_.remove(i)},t.prototype.update=function(t,e){var i=this.items_[$t(e)];an([i.minX,i.minY,i.maxX,i.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 i,n=0,r=t.length;n<r;n++)if(i=e(t[n]))return i;return i},t.prototype.isEmpty=function(){return kt(this.items_)},t.prototype.clear=function(){this.rbush_.clear(),this.items_={}},t.prototype.getExtent=function(t){var e=this.rbush_.toJSON();return nn(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}(),uc=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}();function hc(t){return t?Array.isArray(t)?function(e){return t}:"function"==typeof t?t:function(e){return[t]}:null}var cc=function(t){function e(e){var i=t.call(this)||this;return i.projection=Zn(e.projection),i.attributions_=hc(e.attributions),i.attributionsCollapsible_=void 0===e.attributionsCollapsible||e.attributionsCollapsible,i.loading=!1,i.state_=void 0!==e.state?e.state:Ye,i.wrapX_=void 0!==e.wrapX&&e.wrapX,i}return uc(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 Zt()},e.prototype.getState=function(){return this.state_},e.prototype.getWrapX=function(){return this.wrapX_},e.prototype.getContextOptions=function(){},e.prototype.refresh=function(){this.changed()},e.prototype.setAttributions=function(t){this.attributions_=hc(t),this.changed()},e.prototype.setState=function(t){this.state_=t,this.changed()},e}(te),pc="addfeature",dc="changefeature",fc="clear",yc="removefeature",gc="featuresloadstart",mc="featuresloadend",vc="featuresloaderror";function _c(t,e){return[[-1/0,-1/0,1/0,1/0]]}function xc(t,e,i,n,r,o,s){var a=new XMLHttpRequest;a.open("GET","function"==typeof t?t(i,n,r):t,!0),e.getType()==ta&&(a.responseType="arraybuffer"),a.withCredentials=false,a.onload=function(t){if(!a.status||a.status>=200&&a.status<300){var n=e.getType(),l=void 0;n==ea||n==ia?l=a.responseText:n==na?(l=a.responseXML)||(l=(new DOMParser).parseFromString(a.responseText,"application/xml")):n==ta&&(l=a.response),l?o(e.readFeatures(l,{extent:i,featureProjection:r}),e.readProjection(l)):s()}else s()},a.onerror=s,a.send()}function bc(t,e){return function(i,n,r,o,s){var a=this;xc(t,e,i,n,r,(function(t,e){a.addFeatures(t),void 0!==o&&o(t)}),s||St)}}var wc=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}(),Sc=function(t){function e(e,i,n){var r=t.call(this,e)||this;return r.feature=i,r.features=n,r}return wc(e,t),e}(dt),Cc=function(t){function e(e){var i=this,n=e||{};(i=t.call(this,{attributions:n.attributions,projection:void 0,state:Ye,wrapX:void 0===n.wrapX||n.wrapX})||this).on,i.once,i.un,i.loader_=St,i.format_=n.format,i.overlaps_=void 0===n.overlaps||n.overlaps,i.url_=n.url,void 0!==n.loader?i.loader_=n.loader:void 0!==i.url_&&(Ie(i.format_,7),i.loader_=bc(i.url_,i.format_)),i.strategy_=void 0!==n.strategy?n.strategy:_c;var r,o,s=void 0===n.useSpatialIndex||n.useSpatialIndex;return i.featuresRtree_=s?new lc:null,i.loadedExtentsRtree_=new lc,i.loadingExtentsCount_=0,i.nullGeometryFeatures_={},i.idIndex_={},i.uidIndex_={},i.featureChangeKeys_={},i.featuresCollection_=null,Array.isArray(n.features)?o=n.features:n.features&&(o=(r=n.features).getArray()),s||void 0!==r||(r=new oi(o)),void 0!==o&&i.addFeaturesInternal(o),void 0!==r&&i.bindFeaturesCollection_(r),i}return wc(e,t),e.prototype.addFeature=function(t){this.addFeatureInternal(t),this.changed()},e.prototype.addFeatureInternal=function(t){var e=$t(t);if(this.addToIndex_(e,t)){this.setupChangeEvents_(e,t);var i=t.getGeometry();if(i){var n=i.getExtent();this.featuresRtree_&&this.featuresRtree_.insert(n,t)}else this.nullGeometryFeatures_[e]=t;this.dispatchEvent(new Sc(pc,t))}else this.featuresCollection_&&this.featuresCollection_.remove(t)},e.prototype.setupChangeEvents_=function(t,e){this.featureChangeKeys_[t]=[qt(e,It,this.handleFeatureChange_,this),qt(e,ft,this.handleFeatureChange_,this)]},e.prototype.addToIndex_=function(t,e){var i=!0,n=e.getId();return void 0!==n&&(n.toString()in this.idIndex_?i=!1:this.idIndex_[n.toString()]=e),i&&(Ie(!(t in this.uidIndex_),30),this.uidIndex_[t]=e),i},e.prototype.addFeatures=function(t){this.addFeaturesInternal(t),this.changed()},e.prototype.addFeaturesInternal=function(t){for(var e=[],i=[],n=[],r=0,o=t.length;r<o;r++){var s=$t(l=t[r]);this.addToIndex_(s,l)&&i.push(l)}r=0;for(var a=i.length;r<a;r++){var l;s=$t(l=i[r]);this.setupChangeEvents_(s,l);var u=l.getGeometry();if(u){var h=u.getExtent();e.push(h),n.push(l)}else this.nullGeometryFeatures_[s]=l}this.featuresRtree_&&this.featuresRtree_.load(e,n);r=0;for(var c=i.length;r<c;r++)this.dispatchEvent(new Sc(pc,i[r]))},e.prototype.bindFeaturesCollection_=function(t){var e=!1;this.addEventListener(pc,(function(i){e||(e=!0,t.push(i.feature),e=!1)})),this.addEventListener(yc,(function(i){e||(e=!0,t.remove(i.feature),e=!1)})),t.addEventListener(ti,function(t){e||(e=!0,this.addFeature(t.element),e=!1)}.bind(this)),t.addEventListener(ei,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(Ut)}this.featuresCollection_||(this.featureChangeKeys_={},this.idIndex_={},this.uidIndex_={})}else if(this.featuresRtree_)for(var i in this.featuresRtree_.forEach(this.removeFeatureInternal.bind(this)),this.nullGeometryFeatures_)this.removeFeatureInternal(this.nullGeometryFeatures_[i]);this.featuresCollection_&&this.featuresCollection_.clear(),this.featuresRtree_&&this.featuresRtree_.clear(),this.nullGeometryFeatures_={};var n=new Sc(fc);this.dispatchEvent(n),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 i=[t[0],t[1],t[0],t[1]];return this.forEachFeatureInExtent(i,(function(i){return i.getGeometry().intersectsCoordinate(t)?e(i):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(i){if(i.getGeometry().intersectsExtent(t)){var n=e(i);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(),kt(this.nullGeometryFeatures_)||_t(t,Et(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){return this.featuresRtree_?this.featuresRtree_.getInExtent(t):this.featuresCollection_?this.featuresCollection_.getArray().slice(0):[]},e.prototype.getClosestFeatureToCoordinate=function(t,e){var i=t[0],n=t[1],r=null,o=[NaN,NaN],s=1/0,a=[-1/0,-1/0,1/0,1/0],l=e||bt;return this.featuresRtree_.forEachInExtent(a,(function(t){if(l(t)){var e=t.getGeometry(),u=s;if((s=e.closestPointXY(i,n,o,s))<u){r=t;var h=Math.sqrt(s);a[0]=i-h,a[1]=n-h,a[2]=i+h,a[3]=n+h}}})),r},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,i=$t(e),n=e.getGeometry();if(n){var r=n.getExtent();i in this.nullGeometryFeatures_?(delete this.nullGeometryFeatures_[i],this.featuresRtree_&&this.featuresRtree_.insert(r,e)):this.featuresRtree_&&this.featuresRtree_.update(r,e)}else i in this.nullGeometryFeatures_||(this.featuresRtree_&&this.featuresRtree_.remove(e),this.nullGeometryFeatures_[i]=e);var o=e.getId();if(void 0!==o){var s=o.toString();this.idIndex_[s]!==e&&(this.removeFromIdIndex_(e),this.idIndex_[s]=e)}else this.removeFromIdIndex_(e),this.uidIndex_[i]=e;this.changed(),this.dispatchEvent(new Sc(dc,e))},e.prototype.hasFeature=function(t){var e=t.getId();return void 0!==e?e in this.idIndex_:$t(t)in this.uidIndex_},e.prototype.isEmpty=function(){return this.featuresRtree_.isEmpty()&&kt(this.nullGeometryFeatures_)},e.prototype.loadFeatures=function(t,e,i){for(var n=this.loadedExtentsRtree_,r=this.strategy_(t,e),o=function(t,o){var a=r[t];n.forEachInExtent(a,(function(t){return Ji(t.extent,a)}))||(++s.loadingExtentsCount_,s.dispatchEvent(new Sc(gc)),s.loader_.call(s,a,e,i,function(t){--this.loadingExtentsCount_,this.dispatchEvent(new Sc(mc,void 0,t))}.bind(s),function(){--this.loadingExtentsCount_,this.dispatchEvent(new Sc(vc))}.bind(s)),n.insert(a,{extent:a.slice()}))},s=this,a=0,l=r.length;a<l;++a)o(a);this.loading=this.loader_!==St&&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,i=this.loadedExtentsRtree_;i.forEachInExtent(t,(function(i){if(an(i.extent,t))return e=i,!0})),e&&i.remove(e)},e.prototype.removeFeature=function(t){var e=$t(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=$t(t);this.featureChangeKeys_[e].forEach(Ut),delete this.featureChangeKeys_[e];var i=t.getId();void 0!==i&&delete this.idIndex_[i.toString()],delete this.uidIndex_[e],this.dispatchEvent(new Sc(yc,t))},e.prototype.removeFromIdIndex_=function(t){var e=!1;for(var i in this.idIndex_)if(this.idIndex_[i]===t){delete this.idIndex_[i],e=!0;break}return e},e.prototype.setLoader=function(t){this.loader_=t},e.prototype.setUrl=function(t){Ie(this.format_,7),this.url_=t,this.setLoader(bc(t,this.format_))},e}(cc),Tc=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}(),Ec="Point",kc="LineString",Pc="Polygon",Oc="Circle",Rc="drawstart",Ic="drawend",Fc="drawabort",jc=function(t){function e(e,i){var n=t.call(this,e)||this;return n.feature=i,n}return Tc(e,t),e}(dt);var Mc=function(t){function e(e){var i=this,n=e;n.stopDown||(n.stopDown=wt),(i=t.call(this,n)||this).on,i.once,i.un,i.shouldHandle_=!1,i.downPx_=null,i.downTimeout_,i.lastDragTime_,i.pointerType_,i.freehand_=!1,i.source_=e.source?e.source:null,i.features_=e.features?e.features:null,i.snapTolerance_=e.snapTolerance?e.snapTolerance:12,i.type_=e.type,i.mode_=function(t){switch(t){case kn:case In:return Ec;case Pn:case Fn:return kc;case Rn:case jn:return Pc;case An:return Oc;default:throw new Error("Invalid type: "+t)}}(i.type_),i.stopClick_=!!e.stopClick,i.minPoints_=e.minPoints?e.minPoints:i.mode_===Pc?3:2,i.maxPoints_=i.mode_===Oc?2:e.maxPoints?e.maxPoints:1/0,i.finishCondition_=e.finishCondition?e.finishCondition:bt;var r,o=e.geometryFunction;if(!o){var s,a=i.mode_;if(a===Oc)o=function(t,e,i){var n=e||new Lu([NaN,NaN]),r=lr(t[0]),o=Wn(r,lr(t[t.length-1]));return n.setCenterAndRadius(r,Math.sqrt(o)),n};else a===Ec?s=fs:a===kc?s=ca:a===Pc&&(s=Os),o=function(t,e,i){return e?a===Pc?t[0].length?e.setCoordinates([t[0].concat([t[0][0]])]):e.setCoordinates([]):e.setCoordinates(t):e=new s(t),e}}return i.geometryFunction_=o,i.dragVertexDelay_=void 0!==e.dragVertexDelay?e.dragVertexDelay:500,i.finishCoordinate_=null,i.sketchFeature_=null,i.sketchPoint_=null,i.sketchCoords_=null,i.sketchLine_=null,i.sketchLineCoords_=null,i.squaredClickTolerance_=e.clickTolerance?e.clickTolerance*e.clickTolerance:36,i.overlay_=new ac({source:new Cc({useSpatialIndex:!1,wrapX:!!e.wrapX&&e.wrapX}),style:e.style?e.style:(r=il(),function(t,e){return r[t.getGeometry().getType()]}),updateWhileInteracting:!0}),i.geometryName_=e.geometryName,i.condition_=e.condition?e.condition:$l,i.freehandCondition_,e.freehand?i.freehandCondition_=Zl:i.freehandCondition_=e.freehandCondition?e.freehandCondition:Jl,i.addChangeListener(zl,i.updateState_),i}return Tc(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===Mt&&e.originalEvent.preventDefault(),this.freehand_=this.mode_!==Ec&&this.freehandCondition_(e);var i=e.type===ho.POINTERMOVE,n=!0;!this.freehand_&&this.lastDragTime_&&e.type===ho.POINTERDRAG&&(Date.now()-this.lastDragTime_>=this.dragVertexDelay_?(this.downPx_=e.pixel,this.shouldHandle_=!this.freehand_,i=!0):this.lastDragTime_=void 0,this.shouldHandle_&&void 0!==this.downTimeout_&&(clearTimeout(this.downTimeout_),this.downTimeout_=void 0));return this.freehand_&&e.type===ho.POINTERDRAG&&null!==this.sketchFeature_?(this.addToDrawing_(e.coordinate),n=!1):this.freehand_&&e.type===ho.POINTERDOWN?n=!1:i&&this.getPointerCount()<2?(n=e.type===ho.POINTERMOVE)&&this.freehand_?(this.handlePointerMove_(e),this.shouldHandle_&&e.originalEvent.preventDefault()):("mouse"===e.originalEvent.pointerType||e.type===ho.POINTERDRAG&&void 0===this.downTimeout_)&&this.handlePointerMove_(e):e.type===ho.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 uo(ho.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 i=!this.finishCoordinate_;i&&this.startDrawing_(t.coordinate),!i&&this.freehand_?this.finishDrawing():this.freehand_||i&&this.mode_!==Ec||(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_,i=t.pixel,n=e[0]-i[0],r=e[1]-i[1],o=n*n+r*r;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 i=!1,n=[this.finishCoordinate_],r=this.mode_;if(r===Ec)e=!0;else if(r===Oc)e=2===this.sketchCoords_.length;else if(r===kc)i=this.sketchCoords_.length>this.minPoints_;else if(r===Pc){var o=this.sketchCoords_;i=o[0].length>this.minPoints_,n=[o[0][0],o[0][o[0].length-2]]}if(i)for(var s=this.getMap(),a=0,l=n.length;a<l;a++){var u=n[a],h=s.getPixelFromCoordinate(u),c=t[0]-h[0],p=t[1]-h[1],d=this.freehand_?1:this.snapTolerance_;if(e=Math.sqrt(c*c+p*p)<=d){this.finishCoordinate_=u;break}}}return e},e.prototype.createOrUpdateSketchPoint_=function(t){this.sketchPoint_?this.sketchPoint_.getGeometry().setCoordinates(t):(this.sketchPoint_=new $s(new fs(t)),this.updateSketchFeatures_())},e.prototype.createOrUpdateCustomSketchLine_=function(t){this.sketchLine_||(this.sketchLine_=new $s);var e=t.getLinearRing(0),i=this.sketchLine_.getGeometry();i?(i.setFlatCoordinates(e.getLayout(),e.getFlatCoordinates()),i.changed()):(i=new ca(e.getFlatCoordinates(),e.getLayout()),this.sketchLine_.setGeometry(i))},e.prototype.startDrawing_=function(t){var e=this.getMap().getView().getProjection();this.finishCoordinate_=t,this.mode_===Ec?this.sketchCoords_=t.slice():this.mode_===Pc?(this.sketchCoords_=[[t.slice(),t.slice()]],this.sketchLineCoords_=this.sketchCoords_[0]):this.sketchCoords_=[t.slice(),t.slice()],this.sketchLineCoords_&&(this.sketchLine_=new $s(new ca(this.sketchLineCoords_)));var i=this.geometryFunction_(this.sketchCoords_,void 0,e);this.sketchFeature_=new $s,this.geometryName_&&this.sketchFeature_.setGeometryName(this.geometryName_),this.sketchFeature_.setGeometry(i),this.updateSketchFeatures_(),this.dispatchEvent(new jc(Rc,this.sketchFeature_))},e.prototype.modifyDrawing_=function(t){var e,i,n=this.getMap(),r=this.sketchFeature_.getGeometry(),o=n.getView().getProjection();(this.mode_===Ec?i=this.sketchCoords_:this.mode_===Pc?(i=(e=this.sketchCoords_[0])[e.length-1],this.atFinish_(n.getPixelFromCoordinate(t))&&(t=this.finishCoordinate_.slice())):i=(e=this.sketchCoords_)[e.length-1],i[0]=t[0],i[1]=t[1],this.geometryFunction_(this.sketchCoords_,r,o),this.sketchPoint_)&&this.sketchPoint_.getGeometry().setCoordinates(t);if(r.getType()===Rn&&this.mode_!==Pc)this.createOrUpdateCustomSketchLine_(r);else if(this.sketchLineCoords_){this.sketchLine_.getGeometry().setCoordinates(this.sketchLineCoords_)}this.updateSketchFeatures_()},e.prototype.addToDrawing_=function(t){var e,i,n=this.sketchFeature_.getGeometry(),r=this.getMap().getView().getProjection(),o=this.mode_;o===kc||o===Oc?(this.finishCoordinate_=t.slice(),(i=this.sketchCoords_).length>=this.maxPoints_&&(this.freehand_?i.pop():e=!0),i.push(t.slice()),this.geometryFunction_(i,n,r)):o===Pc&&((i=this.sketchCoords_[0]).length>=this.maxPoints_&&(this.freehand_?i.pop():e=!0),i.push(t.slice()),e&&(this.finishCoordinate_=i[0]),this.geometryFunction_(this.sketchCoords_,n,r)),this.createOrUpdateSketchPoint_(t.slice()),this.updateSketchFeatures_(),e&&this.finishDrawing()},e.prototype.removeLastPoint=function(){if(this.sketchFeature_){var t,e=this.sketchFeature_.getGeometry(),i=this.getMap().getView().getProjection(),n=this.mode_;if(n===kc||n===Oc){if((t=this.sketchCoords_).splice(-2,1),t.length>=2){this.finishCoordinate_=t[t.length-2].slice();var r=this.finishCoordinate_.slice();t[t.length-1]=r,this.createOrUpdateSketchPoint_(r)}this.geometryFunction_(t,e,i),e.getType()===Rn&&this.sketchLine_&&this.createOrUpdateCustomSketchLine_(e)}else if(n===Pc){(t=this.sketchCoords_[0]).splice(-2,1);var o=this.sketchLine_.getGeometry();if(t.length>=2){r=t[t.length-2].slice();t[t.length-1]=r,this.createOrUpdateSketchPoint_(r)}o.setCoordinates(t),this.geometryFunction_(this.sketchCoords_,e,i)}1===t.length&&this.abortDrawing(),this.updateSketchFeatures_()}},e.prototype.finishDrawing=function(){var t=this.abortDrawing_();if(t){var e=this.sketchCoords_,i=t.getGeometry(),n=this.getMap().getView().getProjection();this.mode_===kc?(e.pop(),this.geometryFunction_(e,i,n)):this.mode_===Pc&&(e[0].pop(),this.geometryFunction_(e,i,n),e=i.getCoordinates()),this.type_===In?t.setGeometry(new ya([e])):this.type_===Fn?t.setGeometry(new da([e])):this.type_===jn&&t.setGeometry(new va([e])),this.dispatchEvent(new jc(Ic,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 jc(Fc,t))},e.prototype.appendCoordinates=function(t){var e,i=this.mode_,n=!this.sketchFeature_;if(n&&this.startDrawing_(t[0]),i===kc||i===Oc)e=this.sketchCoords_;else{if(i!==Pc)return;e=this.sketchCoords_&&this.sketchCoords_.length?this.sketchCoords_[0]:[]}n&&e.shift(),e.pop();for(var r=0;r<t.length;r++)this.addToDrawing_(t[r]);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 i=this.sketchCoords_[this.sketchCoords_.length-1];this.finishCoordinate_=i.slice(),this.sketchCoords_.push(i.slice()),this.sketchPoint_=new $s(new fs(i)),this.updateSketchFeatures_(),this.dispatchEvent(new jc(Rc,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}(Ul),Ac=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}(),Lc=[0,0,0,0],zc=[],Dc="modifystart",Gc="modifyend",Nc=function(t){function e(e,i,n){var r=t.call(this,e)||this;return r.features=i,r.mapBrowserEvent=n,r}return Ac(e,t),e}(dt);function Bc(t,e){return t.index-e.index}function Wc(t,e,i){var n=e.geometry;if(n.getType()===An){var r=n;if(1===e.index){null;var o=Wn(r.getCenter(),lr(t)),s=Math.sqrt(o)-r.getRadius();return s*s}}var a=lr(t);return zc[0]=lr(e.segment[0]),zc[1]=lr(e.segment[1]),Vn(a,zc)}function qc(t,e,i){var n=e.geometry;if(n.getType()===An&&1===e.index){var r=n;return ar(r.getClosestPoint(lr(t)))}var o=lr(t);return zc[0]=lr(e.segment[0]),zc[1]=lr(e.segment[1]),ar(Gn(o,zc))}var Vc=function(t){function e(e){var i,n,r=t.call(this,e)||this;if(r.on,r.once,r.un,r.boundHandleFeatureChange_=r.handleFeatureChange_.bind(r),r.condition_=e.condition?e.condition:eu,r.defaultDeleteCondition_=function(t){return function(t){var e=t.originalEvent;return e.altKey&&!(e.metaKey||e.ctrlKey)&&!e.shiftKey}(t)&&function(t){return t.type==ho.SINGLECLICK}(t)},r.deleteCondition_=e.deleteCondition?e.deleteCondition:r.defaultDeleteCondition_,r.insertVertexCondition_=e.insertVertexCondition?e.insertVertexCondition:Zl,r.vertexFeature_=null,r.vertexSegments_=null,r.lastPixel_=[0,0],r.ignoreNextSingleClick_=!1,r.featuresBeingModified_=null,r.rBush_=new lc,r.pixelTolerance_=void 0!==e.pixelTolerance?e.pixelTolerance:10,r.snappedToVertex_=!1,r.changingFeature_=!1,r.dragSegments_=[],r.overlay_=new ac({source:new Cc({useSpatialIndex:!1,wrapX:!!e.wrapX}),style:e.style?e.style:(i=il(),function(t,e){return i[kn]}),updateWhileAnimating:!0,updateWhileInteracting:!0}),r.SEGMENT_WRITERS_={Point:r.writePointGeometry_.bind(r),LineString:r.writeLineStringGeometry_.bind(r),LinearRing:r.writeLineStringGeometry_.bind(r),Polygon:r.writePolygonGeometry_.bind(r),MultiPoint:r.writeMultiPointGeometry_.bind(r),MultiLineString:r.writeMultiLineStringGeometry_.bind(r),MultiPolygon:r.writeMultiPolygonGeometry_.bind(r),Circle:r.writeCircleGeometry_.bind(r),GeometryCollection:r.writeGeometryCollectionGeometry_.bind(r)},r.source_=null,r.hitDetection_=null,e.features?n=e.features:e.source&&(r.source_=e.source,n=new oi(r.source_.getFeatures()),r.source_.addEventListener(pc,r.handleSourceAdd_.bind(r)),r.source_.addEventListener(yc,r.handleSourceRemove_.bind(r))),!n)throw new Error("The modify interaction requires features, a source or a layer");return e.hitDetection&&(r.hitDetection_=e.hitDetection),r.features_=n,r.features_.forEach(r.addFeature_.bind(r)),r.features_.addEventListener(ti,r.handleFeatureAdd_.bind(r)),r.features_.addEventListener(ei,r.handleFeatureRemove_.bind(r)),r.lastPointerEvent_=null,r.delta_=[0,0],r.snapToPointer_=void 0===e.snapToPointer?!r.hitDetection_:e.snapToPointer,r}return Ac(e,t),e.prototype.addFeature_=function(t){var e=t.getGeometry();if(e){var i=this.SEGMENT_WRITERS_[e.getType()];i&&i(t,e)}var n=this.getMap();n&&n.isRendered()&&this.getActive()&&this.handlePointerAtPixel_(this.lastPixel_,n),t.addEventListener(It,this.boundHandleFeatureChange_)},e.prototype.willModifyFeatures_=function(t,e){if(!this.featuresBeingModified_){this.featuresBeingModified_=new oi;for(var i=this.featuresBeingModified_.getArray(),n=0,r=e.length;n<r;++n)for(var o=e[n],s=0,a=o.length;s<a;++s){var l=o[s].feature;l&&-1===i.indexOf(l)&&this.featuresBeingModified_.push(l)}0===this.featuresBeingModified_.getLength()?this.featuresBeingModified_=null:this.dispatchEvent(new Nc(Dc,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(It,this.boundHandleFeatureChange_)},e.prototype.removeFeatureSegmentData_=function(t){var e=this.rBush_,i=[];e.forEach((function(e){t===e.feature&&i.push(e)}));for(var n=i.length-1;n>=0;--n){for(var r=i[n],o=this.dragSegments_.length-1;o>=0;--o)this.dragSegments_[o][0]===r&&this.dragSegments_.splice(o,1);e.remove(r)}},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 i=e.getCoordinates(),n={feature:t,geometry:e,segment:[i,i]};this.rBush_.insert(e.getExtent(),n)},e.prototype.writeMultiPointGeometry_=function(t,e){for(var i=e.getCoordinates(),n=0,r=i.length;n<r;++n){var o=i[n],s={feature:t,geometry:e,depth:[n],index:n,segment:[o,o]};this.rBush_.insert(e.getExtent(),s)}},e.prototype.writeLineStringGeometry_=function(t,e){for(var i=e.getCoordinates(),n=0,r=i.length-1;n<r;++n){var o=i.slice(n,n+2),s={feature:t,geometry:e,index:n,segment:o};this.rBush_.insert(Ki(o),s)}},e.prototype.writeMultiLineStringGeometry_=function(t,e){for(var i=e.getCoordinates(),n=0,r=i.length;n<r;++n)for(var o=i[n],s=0,a=o.length-1;s<a;++s){var l=o.slice(s,s+2),u={feature:t,geometry:e,depth:[n],index:s,segment:l};this.rBush_.insert(Ki(l),u)}},e.prototype.writePolygonGeometry_=function(t,e){for(var i=e.getCoordinates(),n=0,r=i.length;n<r;++n)for(var o=i[n],s=0,a=o.length-1;s<a;++s){var l=o.slice(s,s+2),u={feature:t,geometry:e,depth:[n],index:s,segment:l};this.rBush_.insert(Ki(l),u)}},e.prototype.writeMultiPolygonGeometry_=function(t,e){for(var i=e.getCoordinates(),n=0,r=i.length;n<r;++n)for(var o=i[n],s=0,a=o.length;s<a;++s)for(var l=o[s],u=0,h=l.length-1;u<h;++u){var c=l.slice(u,u+2),p={feature:t,geometry:e,depth:[s,n],index:u,segment:c};this.rBush_.insert(Ki(c),p)}},e.prototype.writeCircleGeometry_=function(t,e){var i=e.getCenter(),n={feature:t,geometry:e,index:0,segment:[i,i]},r={feature:t,geometry:e,index:1,segment:[i,i]},o=[n,r];n.featureSegments=o,r.featureSegments=o,this.rBush_.insert(on(i),n);var s=e;this.rBush_.insert(s.getExtent(),r)},e.prototype.writeGeometryCollectionGeometry_=function(t,e){for(var i=e.getGeometriesArray(),n=0;n<i.length;++n){var r=i[n];(0,this.SEGMENT_WRITERS_[r.getType()])(t,r)}},e.prototype.createOrUpdateVertexFeature_=function(t,e,i){var n=this.vertexFeature_;n?n.getGeometry().setCoordinates(t):(n=new $s(new fs(t)),this.vertexFeature_=n,this.overlay_.getSource().addFeature(n));return n.set("features",e),n.set("geometries",i),n},e.prototype.handleEvent=function(e){return!e.originalEvent||(this.lastPointerEvent_=e,e.map.getView().getInteracting()||e.type!=ho.POINTERMOVE||this.handlingDownUpSequence||this.handlePointerMove_(e),this.vertexFeature_&&this.deleteCondition_(e)&&(i=!(e.type!=ho.SINGLECLICK||!this.ignoreNextSingleClick_)||this.removePoint()),e.type==ho.SINGLECLICK&&(this.ignoreNextSingleClick_=!1),t.prototype.handleEvent.call(this,e)&&!i);var i},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]],i=[],n=[],r=0,o=this.dragSegments_.length;r<o;++r){var s=this.dragSegments_[r],a=s[0],l=a.feature;-1===i.indexOf(l)&&i.push(l);var u=a.geometry;-1===n.indexOf(u)&&n.push(u);for(var h=a.depth,c=void 0,p=a.segment,d=s[1];e.length<u.getStride();)e.push(p[d][e.length]);switch(u.getType()){case kn:c=e,p[0]=e,p[1]=e;break;case In:(c=u.getCoordinates())[a.index]=e,p[0]=e,p[1]=e;break;case Pn:(c=u.getCoordinates())[a.index+d]=e,p[d]=e;break;case Fn:case Rn:(c=u.getCoordinates())[h[0]][a.index+d]=e,p[d]=e;break;case jn:(c=u.getCoordinates())[h[1]][h[0]][a.index+d]=e,p[d]=e;break;case An:if(p[0]=e,p[1]=e,0===a.index)this.changingFeature_=!0,u.setCenter(e),this.changingFeature_=!1;else{this.changingFeature_=!0;t.map.getView().getProjection();var f=qn(lr(u.getCenter()),lr(e));u.setRadius(f),this.changingFeature_=!1}}c&&this.setGeometryCoordinates_(u,c)}this.createOrUpdateVertexFeature_(e,i,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 i=this.vertexFeature_;if(i){var n=t.map.getView().getProjection(),r=[],o=i.getGeometry().getCoordinates(),s=Ki([o]),a=this.rBush_.getInExtent(s),l={};a.sort(Bc);for(var u=0,h=a.length;u<h;++u){var c=a[u],p=c.segment,d=$t(c.geometry),f=c.depth;if(f&&(d+="-"+f.join("-")),l[d]||(l[d]=new Array(2)),c.geometry.getType()!==An||1!==c.index)if(!Nn(p[0],o)||l[d][0])if(!Nn(p[1],o)||l[d][1])$t(p)in this.vertexSegments_&&!l[d][0]&&!l[d][1]&&this.insertVertexCondition_(t)&&r.push(c);else{if((c.geometry.getType()===Pn||c.geometry.getType()===Fn)&&l[d][0]&&0===l[d][0].index)continue;this.dragSegments_.push([c,1]),l[d][1]=c}else this.dragSegments_.push([c,0]),l[d][0]=c;else Nn(qc(e,c,n),o)&&!l[d][0]&&(this.dragSegments_.push([c,0]),l[d][0]=c)}r.length&&this.willModifyFeatures_(t,[r]);for(var y=r.length-1;y>=0;--y)this.insertVertex_(r[y],o)}return!!this.vertexFeature_},e.prototype.handleUpEvent=function(t){for(var e=this.dragSegments_.length-1;e>=0;--e){var i=this.dragSegments_[e][0],n=i.geometry;if(n.getType()===An){var r=n.getCenter(),o=i.featureSegments[0],s=i.featureSegments[1];o.segment[0]=r,o.segment[1]=r,s.segment[0]=r,s.segment[1]=r,this.rBush_.update(on(r),o);var a=n;this.rBush_.update(a.getExtent(),s)}else this.rBush_.update(Ki(i.segment),i)}return this.featuresBeingModified_&&(this.dispatchEvent(new Nc(Gc,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,i){var n,r,o=this,s=i||e.getCoordinateFromPixel(t),a=e.getView().getProjection();if(this.hitDetection_){var l="object"==typeof this.hitDetection_?function(t){return t===o.hitDetection_}:void 0;e.forEachFeatureAtPixel(t,(function(t,e,i){if((i=i||t.getGeometry()).getType()===kn&&(a=o.features_.getArray(),l=t,a.indexOf(l)>=0)){r=i;var s=i.getFlatCoordinates().slice(0,2);n=[{feature:t,geometry:i,segment:[s,s]}]}var a,l;return!0}),{layerFilter:l})}if(!n){var u=ur(Yi(hr(on(s,Lc)),e.getView().getResolution()*this.pixelTolerance_,Lc));n=this.rBush_.getInExtent(u)}if(n&&n.length>0){var h=n.sort((function(t,e){return Wc(s,t,a)-Wc(s,e,a)}))[0],c=h.segment,p=qc(s,h,a),d=e.getPixelFromCoordinate(p),f=qn(t,d);if(r||f<=this.pixelTolerance_){var y={};if(y[$t(c)]=!0,this.snapToPointer_||(this.delta_[0]=p[0]-s[0],this.delta_[1]=p[1]-s[1]),h.geometry.getType()===An&&1===h.index)this.snappedToVertex_=!0,this.createOrUpdateVertexFeature_(p,[h.feature],[h.geometry]);else{var g=e.getPixelFromCoordinate(c[0]),m=e.getPixelFromCoordinate(c[1]),v=Wn(d,g),_=Wn(d,m);f=Math.sqrt(Math.min(v,_)),this.snappedToVertex_=f<=this.pixelTolerance_,this.snappedToVertex_&&(p=v>_?c[1]:c[0]),this.createOrUpdateVertexFeature_(p,[h.feature],[h.geometry]);var x={};x[$t(h.geometry)]=!0;for(var b=1,w=n.length;b<w;++b){var S=n[b].segment;if(!(Nn(c[0],S[0])&&Nn(c[1],S[1])||Nn(c[0],S[1])&&Nn(c[1],S[0])))break;var C=$t(n[b].geometry);C in x||(x[C]=!0,y[$t(S)]=!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 i,n=t.segment,r=t.feature,o=t.geometry,s=t.depth,a=t.index;e.length<o.getStride();)e.push(0);switch(o.getType()){case Fn:case Rn:(i=o.getCoordinates())[s[0]].splice(a+1,0,e);break;case jn:(i=o.getCoordinates())[s[1]][s[0]].splice(a+1,0,e);break;case Pn:(i=o.getCoordinates()).splice(a+1,0,e);break;default:return}this.setGeometryCoordinates_(o,i);var l=this.rBush_;l.remove(t),this.updateSegmentIndices_(o,a,s,1);var u={segment:[n[0],e],feature:r,geometry:o,depth:s,index:a};l.insert(Ki(u.segment),u),this.dragSegments_.push([u,1]);var h={segment:[e,n[1]],feature:r,geometry:o,depth:s,index:a+1};l.insert(Ki(h.segment),h),this.dragSegments_.push([h,0]),this.ignoreNextSingleClick_=!0},e.prototype.removePoint=function(){if(this.lastPointerEvent_&&this.lastPointerEvent_.type!=ho.POINTERDRAG){var t=this.lastPointerEvent_;this.willModifyFeatures_(t,this.dragSegments_);var e=this.removeVertex_();return this.dispatchEvent(new Nc(Gc,this.featuresBeingModified_,t)),this.featuresBeingModified_=null,e}return!1},e.prototype.removeVertex_=function(){var t,e,i,n,r,o,s,a,l,u,h,c=this.dragSegments_,p={},d=!1;for(r=c.length-1;r>=0;--r)h=$t((u=(i=c[r])[0]).feature),u.depth&&(h+="-"+u.depth.join("-")),h in p||(p[h]={}),0===i[1]?(p[h].right=u,p[h].index=u.index):1==i[1]&&(p[h].left=u,p[h].index=u.index+1);for(h in p){switch(l=p[h].right,s=p[h].left,(a=(o=p[h].index)-1)<0&&(a=0),t=e=(n=(u=void 0!==s?s:l).geometry).getCoordinates(),d=!1,n.getType()){case Fn:e[u.depth[0]].length>2&&(e[u.depth[0]].splice(o,1),d=!0);break;case Pn:e.length>2&&(e.splice(o,1),d=!0);break;case jn:t=t[u.depth[1]];case Rn:(t=t[u.depth[0]]).length>4&&(o==t.length-1&&(o=0),t.splice(o,1),d=!0,0===o&&(t.pop(),t.push(t[0]),a=t.length-1))}if(d){this.setGeometryCoordinates_(n,e);var f=[];if(void 0!==s&&(this.rBush_.remove(s),f.push(s.segment[0])),void 0!==l&&(this.rBush_.remove(l),f.push(l.segment[1])),void 0!==s&&void 0!==l){var y={depth:u.depth,feature:u.feature,geometry:u.geometry,index:a,segment:f};this.rBush_.insert(Ki(y.segment),y)}this.updateSegmentIndices_(n,o,u.depth,-1),this.vertexFeature_&&(this.overlay_.getSource().removeFeature(this.vertexFeature_),this.vertexFeature_=null),c.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,i,n){this.rBush_.forEachInExtent(t.getExtent(),(function(r){r.geometry===t&&(void 0===i||void 0===r.depth||xt(r.depth,i))&&r.index>e&&(r.index+=n)}))},e}(Ul),Uc=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}();function Xc(t){return t.feature?t.feature:t.element?t.element:void 0}var Kc=[],Yc=function(t){function e(e){var i=this,n=e||{},r=n;return r.handleDownEvent||(r.handleDownEvent=bt),r.stopDown||(r.stopDown=wt),(i=t.call(this,r)||this).source_=n.source?n.source:null,i.vertex_=void 0===n.vertex||n.vertex,i.edge_=void 0===n.edge||n.edge,i.features_=n.features?n.features:null,i.featuresListenerKeys_=[],i.featureChangeListenerKeys_={},i.indexedFeaturesExtents_={},i.pendingFeatures_={},i.pixelTolerance_=void 0!==n.pixelTolerance?n.pixelTolerance:10,i.rBush_=new lc,i.SEGMENT_WRITERS_={Point:i.writePointGeometry_.bind(i),LineString:i.writeLineStringGeometry_.bind(i),LinearRing:i.writeLineStringGeometry_.bind(i),Polygon:i.writePolygonGeometry_.bind(i),MultiPoint:i.writeMultiPointGeometry_.bind(i),MultiLineString:i.writeMultiLineStringGeometry_.bind(i),MultiPolygon:i.writeMultiPolygonGeometry_.bind(i),GeometryCollection:i.writeGeometryCollectionGeometry_.bind(i),Circle:i.writeCircleGeometry_.bind(i)},i}return Uc(e,t),e.prototype.addFeature=function(t,e){var i=void 0===e||e,n=$t(t),r=t.getGeometry();if(r){var o=this.SEGMENT_WRITERS_[r.getType()];o&&(this.indexedFeaturesExtents_[n]=r.getExtent([1/0,1/0,-1/0,-1/0]),o(t,r))}i&&(this.featureChangeListenerKeys_[n]=qt(t,It,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 i=this.snapTo(e.pixel,e.coordinate,e.map);return i.snapped&&(e.coordinate=i.vertex.slice(0,2),e.pixel=i.vertexPixel),t.prototype.handleEvent.call(this,e)},e.prototype.handleFeatureAdd_=function(t){var e=Xc(t);this.addFeature(e)},e.prototype.handleFeatureRemove_=function(t){var e=Xc(t);this.removeFeature(e)},e.prototype.handleFeatureChange_=function(t){var e=t.target;if(this.handlingDownUpSequence){var i=$t(e);i in this.pendingFeatures_||(this.pendingFeatures_[i]=e)}else this.updateFeature_(e)},e.prototype.handleUpEvent=function(t){var e=Et(this.pendingFeatures_);return e.length&&(e.forEach(this.updateFeature_.bind(this)),this.pendingFeatures_={}),!1},e.prototype.removeFeature=function(t,e){var i=void 0===e||e,n=$t(t),r=this.indexedFeaturesExtents_[n];if(r){var o=this.rBush_,s=[];o.forEachInExtent(r,(function(e){t===e.feature&&s.push(e)}));for(var a=s.length-1;a>=0;--a)o.remove(s[a])}i&&(Ut(this.featureChangeListenerKeys_[n]),delete this.featureChangeListenerKeys_[n])},e.prototype.setMap=function(e){var i=this.getMap(),n=this.featuresListenerKeys_,r=this.getFeatures_();i&&(n.forEach(Ut),n.length=0,r.forEach(this.forEachFeatureRemove_.bind(this))),t.prototype.setMap.call(this,e),e&&(this.features_?n.push(qt(this.features_,ti,this.handleFeatureAdd_,this),qt(this.features_,ei,this.handleFeatureRemove_,this)):this.source_&&n.push(qt(this.source_,pc,this.handleFeatureAdd_,this),qt(this.source_,yc,this.handleFeatureRemove_,this)),r.forEach(this.forEachFeatureAdd_.bind(this)))},e.prototype.snapTo=function(t,e,i){var n=Ki([i.getCoordinateFromPixel([t[0]-this.pixelTolerance_,t[1]+this.pixelTolerance_]),i.getCoordinateFromPixel([t[0]+this.pixelTolerance_,t[1]-this.pixelTolerance_])]),r=this.rBush_.getInExtent(n);this.vertex_&&!this.edge_&&(r=r.filter((function(t){return t.feature.getGeometry().getType()!==An})));var o=!1,s=null,a=null;if(0===r.length)return{snapped:o,vertex:s,vertexPixel:a};i.getView().getProjection();for(var l,u=lr(e),h=1/0,c=0;c<r.length;++c){var p=r[c];Kc[0]=lr(p.segment[0]),Kc[1]=lr(p.segment[1]);var d=Vn(u,Kc);d<h&&(l=p,h=d)}var f=l.segment;if(this.vertex_&&!this.edge_){var y=i.getPixelFromCoordinate(f[0]),g=i.getPixelFromCoordinate(f[1]),m=Wn(t,y),v=Wn(t,g);Math.sqrt(Math.min(m,v))<=this.pixelTolerance_&&(o=!0,s=m>v?f[1]:f[0],a=i.getPixelFromCoordinate(s))}else if(this.edge_){var _=l.feature.getGeometry().getType()===An;if(_){var x=l.feature.getGeometry();null,s=ar(function(t,e){var i=e.getRadius(),n=e.getCenter(),r=n[0],o=n[1],s=t[0]-r,a=t[1]-o;0===s&&0===a&&(s=1);var l=Math.sqrt(s*s+a*a);return[r+i*s/l,o+i*a/l]}(u,x))}else Kc[0]=lr(f[0]),Kc[1]=lr(f[1]),s=ar(Gn(u,Kc));if(qn(t,a=i.getPixelFromCoordinate(s))<=this.pixelTolerance_&&(o=!0,this.vertex_&&!_)){y=i.getPixelFromCoordinate(f[0]),g=i.getPixelFromCoordinate(f[1]),m=Wn(a,y),v=Wn(a,g);Math.sqrt(Math.min(m,v))<=this.pixelTolerance_&&(s=m>v?f[1]:f[0],a=i.getPixelFromCoordinate(s))}}return o&&(a=[Math.round(a[0]),Math.round(a[1])]),{snapped:o,vertex:s,vertexPixel:a}},e.prototype.updateFeature_=function(t){this.removeFeature(t,!1),this.addFeature(t,!1)},e.prototype.writeCircleGeometry_=function(t,e){this.getMap().getView().getProjection();for(var i=Is(e).getCoordinates()[0],n=0,r=i.length-1;n<r;++n){var o=i.slice(n,n+2),s={feature:t,segment:o};this.rBush_.insert(Ki(o),s)}},e.prototype.writeGeometryCollectionGeometry_=function(t,e){for(var i=e.getGeometriesArray(),n=0;n<i.length;++n){var r=this.SEGMENT_WRITERS_[i[n].getType()];r&&r(t,i[n])}},e.prototype.writeLineStringGeometry_=function(t,e){for(var i=e.getCoordinates(),n=0,r=i.length-1;n<r;++n){var o=i.slice(n,n+2),s={feature:t,segment:o};this.rBush_.insert(Ki(o),s)}},e.prototype.writeMultiLineStringGeometry_=function(t,e){for(var i=e.getCoordinates(),n=0,r=i.length;n<r;++n)for(var o=i[n],s=0,a=o.length-1;s<a;++s){var l=o.slice(s,s+2),u={feature:t,segment:l};this.rBush_.insert(Ki(l),u)}},e.prototype.writeMultiPointGeometry_=function(t,e){for(var i=e.getCoordinates(),n=0,r=i.length;n<r;++n){var o=i[n],s={feature:t,segment:[o,o]};this.rBush_.insert(e.getExtent(),s)}},e.prototype.writeMultiPolygonGeometry_=function(t,e){for(var i=e.getCoordinates(),n=0,r=i.length;n<r;++n)for(var o=i[n],s=0,a=o.length;s<a;++s)for(var l=o[s],u=0,h=l.length-1;u<h;++u){var c=l.slice(u,u+2),p={feature:t,segment:c};this.rBush_.insert(Ki(c),p)}},e.prototype.writePointGeometry_=function(t,e){var i=e.getCoordinates(),n={feature:t,segment:[i,i]};this.rBush_.insert(e.getExtent(),n)},e.prototype.writePolygonGeometry_=function(t,e){for(var i=e.getCoordinates(),n=0,r=i.length;n<r;++n)for(var o=i[n],s=0,a=o.length-1;s<a;++s){var l=o.slice(s,s+2),u={feature:t,segment:l};this.rBush_.insert(Ki(l),u)}},e}(Ul);function Zc(t){var e=t||{},i=new oi,n=new Tu(-.005,.05,100);return(void 0===e.altShiftDragRotate||e.altShiftDragRotate)&&i.push(new ou),(void 0===e.doubleClickZoom||e.doubleClickZoom)&&i.push(new Wl({delta:e.zoomDelta,duration:e.zoomDuration})),(void 0===e.dragPan||e.dragPan)&&i.push(new nu({onFocusOnly:e.onFocusOnly,kinetic:n})),(void 0===e.pinchRotate||e.pinchRotate)&&i.push(new Iu),(void 0===e.pinchZoom||e.pinchZoom)&&i.push(new ju({duration:e.zoomDuration})),(void 0===e.keyboard||e.keyboard)&&(i.push(new wu),i.push(new Cu({delta:e.zoomDelta,duration:e.zoomDuration}))),(void 0===e.mouseWheelZoom||e.mouseWheelZoom)&&i.push(new Ou({onFocusOnly:e.onFocusOnly,duration:e.zoomDuration})),(void 0===e.shiftDragZoom||e.shiftDragZoom)&&i.push(new gu({duration:e.zoomDuration})),i}var Hc=function(){function t(t,e,i,n){this.minX=t,this.maxX=e,this.minY=i,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 $c(t,e,i,n,r){return void 0!==r?(r.minX=t,r.maxX=e,r.minY=i,r.maxY=n,r):new Hc(t,e,i,n)}var Jc=Hc,Qc=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}(),tp=function(t){function e(e){var i=t.call(this,e)||this;return i.extentChanged=!0,i.renderedExtent_=null,i.renderedPixelRatio,i.renderedProjection=null,i.renderedRevision,i.renderedTiles=[],i.newTiles_=!1,i.tmpExtent=[1/0,1/0,-1/0,-1/0],i.tmpTileRange_=new Jc(0,0,0,0),i}return Qc(e,t),e.prototype.isDrawableTile=function(t){var e=this.getLayer(),i=t.getState(),n=e.getUseInterimTilesOnError();return i==vo||i==xo||i==_o&&!n},e.prototype.getTile=function(t,e,i,n){var r=n.pixelRatio,o=n.viewState.projection,s=this.getLayer(),a=s.getSource().getTile(t,e,i,r,o);return a.getState()==_o&&(s.getUseInterimTilesOnError()?s.getPreload()>0&&(this.newTiles_=!0):a.setState(vo)),this.isDrawableTile(a)||(a=a.getInterimTile()),a},e.prototype.loadedTileCallback=function(e,i,n){return!!this.isDrawableTile(n)&&t.prototype.loadedTileCallback.call(this,e,i,n)},e.prototype.prepareFrame=function(t){return!!this.getLayer().getSource()},e.prototype.renderFrame=function(t,e){var i=t.layerStatesArray[t.layerIndex],n=t.viewState,r=n.projection,o=n.resolution,s=n.center,a=n.rotation,l=t.pixelRatio,u=this.getLayer(),h=u.getSource(),c=h.getRevision(),p=h.getTileGridForProjection(r),d=p.getZForResolution(o,h.zDirection),f=p.getResolution(d),y=t.extent,g=i.extent&&hr(i.extent);g&&(y=xn(y,hr(i.extent)));var m=h.getTilePixelRatio(l),v=Math.round(t.size[0]*m),_=Math.round(t.size[1]*m);if(a){var x=Math.round(Math.sqrt(v*v+_*_));v=x,_=x}var b=f*v/2/m,w=f*_/2/m,S=[s[0]-b,s[1]-w,s[0]+b,s[1]+w],C=p.getTileRangeForExtentAndZ(y,d),T={};T[d]={};var E=this.createLoadedTileFinder(h,r,T),k=this.tmpExtent,P=this.tmpTileRange_;this.newTiles_=!1;for(var O=C.minX;O<=C.maxX;++O)for(var R=C.minY;R<=C.maxY;++R){var I=this.getTile(d,O,R,t);if(this.isDrawableTile(I)){var F=$t(this);if(I.getState()==vo){T[d][I.tileCoord.toString()]=I;var j=I.inTransition(F);this.newTiles_||!j&&-1!==this.renderedTiles.indexOf(I)||(this.newTiles_=!0)}if(1===I.getAlpha(F,t.time))continue}var M=p.getTileCoordChildTileRange(I.tileCoord,P,k),A=!1;M&&(A=E(d+1,M)),A||p.forEachTileCoordParentTileRange(I.tileCoord,E,P,k)}var L=f/o;vr(this.pixelTransform,t.size[0]/2,t.size[1]/2,1/m,1/m,a,-v/2,-_/2);var z=xr(this.pixelTransform);this.useContainer(e,z,i.opacity);var D=this.context,G=D.canvas;_r(this.inversePixelTransform,this.pixelTransform),vr(this.tempTransform,v/2,_/2,L,L,0,-v/2,-_/2),G.width!=v||G.height!=_?(G.width=v,G.height=_):this.containerReused||D.clearRect(0,0,v,_),g&&this.clipUnrotated(D,t,g),Ct(D,h.getContextOptions()),this.preRender(D,t),this.renderedTiles.length=0;var N,B,W,q=Object.keys(T).map(Number);q.sort(gt),1!==i.opacity||this.containerReused&&!h.getOpaque(t.viewState.projection)?(N=[],B=[]):q=q.reverse();for(var V=q.length-1;V>=0;--V){var U=q[V],X=h.getTilePixelSize(U,l,r),K=p.getResolution(U)/f,Y=X[0]*K*L,Z=X[1]*K*L,H=p.getTileCoordForCoordAndZ(bn(S),U),$=p.getTileCoordExtent(H),J=gr(this.tempTransform,[m*($[0]-S[0])/f,m*(S[3]-$[3])/f]),Q=m*h.getGutterForProjection(r),tt=T[U];for(var et in tt){var it=(I=tt[et]).tileCoord,nt=H[1]-it[1],rt=Math.round(J[0]-(nt-1)*Y),ot=H[2]-it[2],st=Math.round(J[1]-(ot-1)*Z),at=rt-(O=Math.round(J[0]-nt*Y)),lt=st-(R=Math.round(J[1]-ot*Z)),ut=d===U;if(!(j=ut&&1!==I.getAlpha($t(this),t.time)))if(N){D.save(),W=[O,R,O+at,R,O+at,R+lt,O,R+lt];for(var ht=0,ct=N.length;ht<ct;++ht)if(d!==U&&U<B[ht]){var pt=N[ht];D.beginPath(),D.moveTo(W[0],W[1]),D.lineTo(W[2],W[3]),D.lineTo(W[4],W[5]),D.lineTo(W[6],W[7]),D.moveTo(pt[6],pt[7]),D.lineTo(pt[4],pt[5]),D.lineTo(pt[2],pt[3]),D.lineTo(pt[0],pt[1]),D.clip()}N.push(W),B.push(U)}else D.clearRect(O,R,at,lt);this.drawTileImage(I,t,O,R,at,lt,Q,ut,i.opacity),N&&!j?(D.restore(),this.renderedTiles.unshift(I)):this.renderedTiles.push(I),this.updateUsedTiles(t.usedTiles,h,I)}}return this.renderedRevision=c,this.renderedResolution=f,this.extentChanged=!this.renderedExtent_||!an(this.renderedExtent_,S),this.renderedExtent_=S,this.renderedPixelRatio=l,this.renderedProjection=r,this.manageTilePyramid(t,h,p,l,r,y,d,u.getPreload()),this.scheduleExpireCache(t,h),this.postRender(D,t),i.extent&&D.restore(),z!==G.style.transform&&(G.style.transform=z),this.container},e.prototype.drawTileImage=function(t,e,i,n,r,o,s,a,l){var u=this.getTileImage(t);if(u){var h=$t(this),c=a?t.getAlpha(h,e.time):1,p=l*c,d=p!==this.context.globalAlpha;d&&(this.context.save(),this.context.globalAlpha=p),this.context.drawImage(u,s,s,u.width-2*s,u.height-2*s,i,n,r,o),d&&this.context.restore(),1!==c?e.animate=!0:a&&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 i=function(t,e,i){var n=$t(t);n in i.usedTiles&&t.expireCache(i.viewState.projection,i.usedTiles[n])}.bind(null,e);t.postRenderFunctions.push(i)}},e.prototype.updateUsedTiles=function(t,e,i){var n=$t(e);n in t||(t[n]={}),t[n][i.getKey()]=!0},e.prototype.manageTilePyramid=function(t,e,i,n,r,o,s,a,l){var u=$t(e);u in t.wantedTiles||(t.wantedTiles[u]={});var h,c,p,d,f,y,g=t.wantedTiles[u],m=t.tileQueue,v=0;for(y=i.getMinZoom();y<=s;++y)for(c=i.getTileRangeForExtentAndZ(o,y,c),p=i.getResolution(y),d=c.minX;d<=c.maxX;++d)for(f=c.minY;f<=c.maxY;++f)s-y<=a?(++v,(h=e.getTile(y,d,f,n,r)).getState()==go&&(g[h.getKey()]=!0,m.isKeyQueued(h.getKey())||m.enqueue([h,u,i.getTileCoordCenter(h.tileCoord),p])),void 0!==l&&l(h)):e.useTile(y,d,f,r);e.updateCacheSize(v,r)},e}(kh);tp.prototype.getLayer;var ep=tp,ip="image",np="hybrid",rp="vector",op=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}(),sp={image:[Fh,Ph,Ih,Rh,jh],hybrid:[Fh,Ih],vector:[]},ap={hybrid:[Rh,jh,Oh],vector:[Fh,Ph,Ih,Rh,jh,Oh]},lp=function(t){function e(e){var i=t.call(this,e)||this;return i.boundHandleStyleImageChange_=i.handleStyleImageChange_.bind(i),i.dirty_=!1,i.renderedLayerRevision_,i.renderedPixelToCoordinateTransform_=null,i.renderedRotation_,i.renderTileImageQueue_={},i.tileListenerKeys_={},i.tmpTransform_=[1,0,0,1,0,0],i}return op(e,t),e.prototype.prepareTile=function(t,e,i,n){var r,o=$t(t),s=t.getState();return s!==vo&&s!==_o||!(o in this.tileListenerKeys_)||(Ut(this.tileListenerKeys_[o]),delete this.tileListenerKeys_[o]),s!==vo&&s!==_o||(this.updateExecutorGroup_(t,e,i),this.tileImageNeedsRender_(t)&&(r=!0,n&&(this.renderTileImageQueue_[o]=t))),r},e.prototype.getTile=function(e,i,n,r){var o=r.pixelRatio,s=r.viewState,a=s.resolution,l=s.projection,u=this.getLayer(),h=u.getSource().getTile(e,i,n,o,l);if(h.getState()<vo){h.wantedResolution=a;var c=$t(h);if(!(c in this.tileListenerKeys_)){var p=qt(h,It,this.prepareTile.bind(this,h,o,l,!0));this.tileListenerKeys_[c]=p}}else{var d=r.viewHints;!!(d[So]||d[Co])&&h.wantedResolution||(h.wantedResolution=a),this.prepareTile(h,o,l,!1)&&u.getRenderMode()!==rp&&this.renderTileImage_(h,r)}return t.prototype.getTile.call(this,e,i,n,r)},e.prototype.isDrawableTile=function(e){var i=this.getLayer();return t.prototype.isDrawableTile.call(this,e)&&(i.getRenderMode()===rp?$t(i)in e.executorGroups:e.hasContext(i))},e.prototype.getTileImage=function(t){return t.getImage(this.getLayer())},e.prototype.prepareFrame=function(e){var i=this.getLayer().getRevision();return this.renderedLayerRevision_!=i&&(this.renderedTiles.length=0),this.renderedLayerRevision_=i,t.prototype.prepareFrame.call(this,e)},e.prototype.updateExecutorGroup_=function(t,e,i){var n=this.getLayer(),r=n.getRevision(),o=n.getRenderOrder()||null,s=t.wantedResolution,a=t.getReplayState(n);if(a.dirty||a.renderedResolution!==s||a.renderedRevision!=r||a.renderedRenderOrder!=o){var l=n.getSource(),u=n.getDeclutter(),h=l.getTileGrid(),c=l.getTileGridForProjection(i).getTileCoordExtent(t.wrappedTileCoord),p=l.getSourceTiles(e,i,t),d=$t(n);delete t.hitDetectionImageData[d],t.executorGroups[d]=[],u&&(t.declutterExecutorGroups[d]=[]);for(var f=function(i,r){var f=p[i];if(f.getState()!=vo)return"continue";var g=f.tileCoord,m=h.getTileCoordExtent(g),v=xn(c,m),_=Yi(v,n.getRenderBuffer()*s,y.tmpExtent),x=an(m,v)?null:_;a.dirty=!1;var b=new Sh(0,_,s,e),w=u?new Sh(0,v,s,e):void 0,S=tc(s,e),C=function(t){var e,i=t.getStyleFunction()||n.getStyleFunction();if(i&&(e=i(t,s)),e){var r=this.renderFeature(t,S,e,b,w);this.dirty_=this.dirty_||r,a.dirty=a.dirty||r}},T=f.getFeatures();o&&o!==a.renderedRenderOrder&&T.sort(o);for(var E=0,k=T.length;E<k;++E){var P=T[E];x&&!Cn(x,P.getGeometry().getExtent())||C.call(y,P)}var O=b.finish(),R=n.getRenderMode()!==rp&&u&&1===p.length?null:v,I=new Kh(R,s,e,l.getOverlaps(),O,n.getRenderBuffer());if(t.executorGroups[d].push(I),w){var F=new Kh(null,s,e,l.getOverlaps(),w.finish(),n.getRenderBuffer());t.declutterExecutorGroups[d].push(F)}},y=this,g=0,m=p.length;g<m;++g)f(g);a.renderedRevision=r,a.renderedRenderOrder=o,a.renderedResolution=s}},e.prototype.forEachFeatureAtCoordinate=function(t,e,i,n,r){var o=e.viewState.resolution,s=e.viewState.rotation;i=null==i?0:i;var a=this.getLayer(),l=a.getSource().getTileGridForProjection(e.viewState.projection),u=Ki([t]);Yi(u,o*i,u);for(var h,c={},p=function(t,e,i){var o=t.getId();void 0===o&&(o=$t(t));var s=c[o];if(s){if(!0!==s&&i<s.distanceSq){if(0===i)return c[o]=!0,r.splice(r.lastIndexOf(s),1),n(t,a,e);s.geometry=e,s.distanceSq=i}}else{if(0===i)return c[o]=!0,n(t,a,e);r.push(c[o]={feature:t,layer:a,geometry:e,distanceSq:i,callback:n})}},d=this.renderedTiles,f=function(n,r){var c=d[n];if(!Cn(l.getTileCoordExtent(c.wrappedTileCoord),u))return"continue";var f=$t(a),y=[c.executorGroups[f]],g=c.declutterExecutorGroups[f];g&&y.push(g),y.some((function(n){for(var r=n===g?e.declutterTree.all().map((function(t){return t.value})):null,a=0,l=n.length;a<l;++a){var u=n[a];if(h=u.forEachFeatureAtCoordinate(t,o,s,i,p,r))return!0}}))},y=0,g=d.length;!h&&y<g;++y)f(y);return h},e.prototype.getFeatures=function(t){return new Promise(function(e,i){for(var n,r=this.getLayer(),o=$t(r),s=r.getSource(),a=this.renderedProjection,l=a.getExtent(),u=this.renderedResolution,h=s.getTileGridForProjection(a),c=gr(this.renderedPixelToCoordinateTransform_,t.slice()),p=h.getTileCoordForCoordAndResolution(c,u),d=0,f=this.renderedTiles.length;d<f;++d)if(p.toString()===this.renderedTiles[d].tileCoord.toString()){if((n=this.renderedTiles[d]).getState()===vo){var y=h.getTileCoordExtent(n.tileCoord);s.getWrapX()&&a.canWrapX()&&!Ji(l,y)&&Un(c,a);break}n=void 0}if(!n||n.loadingSourceTiles>0)e([]);else{var g=bn(h.getTileCoordExtent(n.wrappedTileCoord)),m=[(c[0]-g[0])/u,(g[1]-c[1])/u],v=n.getSourceTiles().reduce((function(t,e){return t.concat(e.getFeatures())}),[]),_=n.hitDetectionImageData[o];if(!_&&!this.animatingOrInteracting_){var x=Ds(h.getTileSize(h.getZForResolution(u))),b=this.renderedRotation_;_=Hh(x,[this.getRenderTransform(h.getTileCoordCenter(n.wrappedTileCoord),u,0,.5,.5*x[0],.5*x[1],0)],v,r.getStyleFunction(),h.getTileCoordExtent(n.wrappedTileCoord),n.getReplayState(r).renderedResolution,b),n.hitDetectionImageData[o]=_}e($h(m,v,_))}}.bind(this))},e.prototype.handleFontsChanged=function(){Tt(this.renderTileImageQueue_);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,i=e.globalAlpha;e.globalAlpha=this.getLayer().getOpacity();for(var n=t.viewHints,r=!(n[So]||n[Co]),o=this.renderedTiles,s=0,a=o.length;s<a;++s){var l=o[s],u=l.declutterExecutorGroups[$t(this.getLayer())];if(u)for(var h=u.length-1;h>=0;--h)u[h].execute(this.context,1,this.getTileRenderTransform(l,t),t.viewState.rotation,r,void 0,t.declutterTree)}e.globalAlpha=i},e.prototype.getTileRenderTransform=function(t,e){var i=e.pixelRatio,n=e.viewState,r=n.center,o=n.resolution,s=n.rotation,a=e.size,l=Math.round(a[0]*i),u=Math.round(a[1]*i),h=this.getLayer().getSource().getTileGridForProjection(e.viewState.projection),c=t.tileCoord,p=h.getTileCoordExtent(t.wrappedTileCoord),d=h.getTileCoordExtent(c,this.tmpExtent)[0]-p[0];return fr(mr(this.inversePixelTransform.slice(),1/i,1/i),this.getRenderTransform(r,o,s,i,l,u,d))},e.prototype.renderFrame=function(e,i){var n=e.viewHints,r=!(n[So]||n[Co]);this.renderQueuedTileImages_(r,e),t.prototype.renderFrame.call(this,e,i),this.renderedPixelToCoordinateTransform_=e.pixelToCoordinateTransform.slice(),this.renderedRotation_=e.viewState.rotation;var o=this.getLayer(),s=o.getRenderMode(),a=o.getSource(),l=e.usedTiles[$t(a)];for(var u in this.renderTileImageQueue_)l&&u in l||delete this.renderTileImageQueue_[u];var h=this.context,c=h.globalAlpha;h.globalAlpha=o.getOpacity();for(var p=ap[s],d=e.viewState.rotation,f=this.renderedTiles,y=[],g=[],m=f.length-1;m>=0;--m)for(var v=f[m],_=this.getTileRenderTransform(v,e),x=v.executorGroups[$t(o)],b=!1,w=0,S=x.length;w<S;++w){var C=x[w];if(C.hasExecutors(p)){var T=v.tileCoord[0],E=void 0;if(!b&&(E=C.getClipCoords(_))){h.save();for(var k=0,P=y.length;k<P;++k){var O=y[k];T<g[k]&&(h.beginPath(),h.moveTo(E[0],E[1]),h.lineTo(E[2],E[3]),h.lineTo(E[4],E[5]),h.lineTo(E[6],E[7]),h.moveTo(O[6],O[7]),h.lineTo(O[4],O[5]),h.lineTo(O[2],O[3]),h.lineTo(O[0],O[1]),h.clip())}}C.execute(h,1,_,d,r,p),!b&&E&&(h.restore(),y.push(E),g.push(T),b=!0)}}return h.globalAlpha=c,this.container},e.prototype.renderQueuedTileImages_=function(t,e){for(var i in this.renderTileImageQueue_){if(!t&&Date.now()-e.time>8){e.animate=!0;break}var n=this.renderTileImageQueue_[i];delete this.renderTileImageQueue_[i],this.renderTileImage_(n,e)}},e.prototype.renderFeature=function(t,e,i,n,r){if(!i)return!1;var o=!1;if(Array.isArray(i))for(var s=0,a=i.length;s<a;++s)o=ic(n,t,i[s],e,this.boundHandleStyleImageChange_,void 0,r)||o;else o=ic(n,t,i,e,this.boundHandleStyleImageChange_,void 0,r);return o},e.prototype.tileImageNeedsRender_=function(t){var e=this.getLayer();if(e.getRenderMode()===rp)return!1;var i=t.getReplayState(e),n=e.getRevision(),r=t.wantedResolution;return i.renderedTileResolution!==r||i.renderedTileRevision!==n},e.prototype.renderTileImage_=function(t,e){var i=this.getLayer(),n=t.getReplayState(i),r=i.getRevision(),o=t.executorGroups[$t(i)];n.renderedTileRevision=r;var s=t.wrappedTileCoord,a=s[0],l=i.getSource(),u=e.pixelRatio,h=e.viewState.projection,c=l.getTileGridForProjection(h),p=c.getResolution(t.tileCoord[0]),d=e.pixelRatio/t.wantedResolution*p,f=c.getResolution(a),y=t.getContext(i);u=Math.round(Math.max(u,d/u));var g=l.getTilePixelSize(a,u,h);y.canvas.width=g[0],y.canvas.height=g[1];var m=u/d;if(1!==m){var v=dr(this.tmpTransform_);mr(v,m,m),y.setTransform.apply(y,v)}var _=c.getTileCoordExtent(s,this.tmpExtent),x=d/f,b=dr(this.tmpTransform_);mr(b,x,-x),function(t,e,i){fr(t,yr(pr,1,0,0,1,e,i))}(b,-_[0],-_[3]);for(var w=0,S=o.length;w<S;++w){o[w].execute(y,m,b,0,!0,sp[i.getRenderMode()])}n.renderedTileResolution=t.wantedResolution},e}(ep),up="preload",hp="useInterimTilesOnError",cp=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}(),pp=function(t){function e(e){var i=this,n=e||{},r=Ct({},n);delete r.preload,delete r.useInterimTilesOnError,(i=t.call(this,r)||this).on,i.once,i.un,n.renderMode===ip&&(console.warn('renderMode: "image" is deprecated. Option ignored.'),n.renderMode=void 0);var o=n.renderMode||np;return Ie(o==np||o==rp,28),i.renderMode_=o,i.setPreload(n.preload?n.preload:0),i.setUseInterimTilesOnError(void 0===n.useInterimTilesOnError||n.useInterimTilesOnError),i}return cp(e,t),e.prototype.createRenderer=function(){return new lp(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(up)},e.prototype.getUseInterimTilesOnError=function(){return this.get(hp)},e.prototype.setPreload=function(t){this.set(up,t)},e.prototype.setUseInterimTilesOnError=function(t){this.set(hp,t)},e}(nh),dp=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}(),fp=function(t){function e(e,i,n){var r=t.call(this)||this,o=n||{};return r.tileCoord=e,r.state=i,r.interimTile=null,r.key="",r.transition_=void 0===o.transition?250:o.transition,r.transitionStarts_={},r}return dp(e,t),e.prototype.changed=function(){this.dispatchEvent(It)},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()==vo)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()==vo){t.interimTile=null;break}t.getState()==mo?e=t:t.getState()==go?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!==_o&&this.state>t)throw new Error("Tile load sequence violation");this.state=t,this.changed()},e.prototype.load=function(){Zt()},e.prototype.getAlpha=function(t,e){if(!this.transition_)return 1;var i=this.transitionStarts_[t];if(i){if(-1===i)return 1}else i=e,this.transitionStarts_[t]=i;var n=e-i+1e3/60;return n>=this.transition_?1:si(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}(Rt),yp=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}(),gp=function(t){function e(e,i,n,r,o,s){var a=t.call(this,e,i,s)||this;return a.extent=null,a.format_=r,a.features_=null,a.loader_,a.projection=null,a.resolution,a.tileLoadFunction_=o,a.url_=n,a.key=n,a}return yp(e,t),e.prototype.getFormat=function(){return this.format_},e.prototype.getFeatures=function(){return this.features_},e.prototype.load=function(){this.state==go&&(this.setState(mo),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(_o)},e.prototype.setFeatures=function(t){this.features_=t,this.setState(vo)},e.prototype.setLoader=function(t){this.loader_=t},e}(fp),mp=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.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 i=this.entries_[t];return Ie(void 0!==i,15),i===this.newest_||(i===this.oldest_?(this.oldest_=this.oldest_.newer,this.oldest_.older=null):(i.newer.older=i.older,i.older.newer=i.newer),i.newer=null,i.older=this.newest_,this.newest_.newer=i,this.newest_=i),i.value_},t.prototype.remove=function(t){var e=this.entries_[t];return Ie(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_),i=0;for(t=this.newest_;t;t=t.older)e[i++]=t.key_;return e},t.prototype.getValues=function(){var t,e=new Array(this.count_),i=0;for(t=this.newest_;t;t=t.older)e[i++]=t.value_;return e},t.prototype.peekLast=function(){return this.oldest_.value_},t.prototype.peekLastKey=function(){return this.oldest_.key_},t.prototype.peekFirstKey=function(){return this.newest_.key_},t.prototype.pop=function(){var t=this.oldest_;return delete this.entries_[t.key_],t.newer&&(t.newer.older=null),this.oldest_=t.newer,this.oldest_||(this.newest_=null),--this.count_,t.value_},t.prototype.replace=function(t,e){this.get(t),this.entries_[t].value_=e},t.prototype.set=function(t,e){Ie(!(t in this.entries_),16);var i={key_:t,newer:null,older:this.newest_,value_:e};this.newest_?this.newest_.newer=i:this.oldest_=i,this.newest_=i,this.entries_[t]=i,++this.count_},t.prototype.setSize=function(t){this.highWaterMark=t},t}();function vp(t,e,i,n){return void 0!==n?(n[0]=t,n[1]=e,n[2]=i,n):[t,e,i]}function _p(t,e,i){return t+"/"+e+"/"+i}function xp(t){return _p(t[0],t[1],t[2])}function bp(t){return t.split("/").map(Number)}var wp=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}(),Sp=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return wp(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=bp(this.peekFirstKey())[0];this.forEach(function(e){e.tileCoord[0]!==t&&(this.remove(xp(e.tileCoord)),e.release())}.bind(this))}},e}(mp),Cp="tileloadstart",Tp="tileloadend",Ep="tileloaderror",kp=[0,0,0],Pp=function(){function t(t){var e,i,n,r;if(this.minZoom=void 0!==t.minZoom?t.minZoom:0,this.resolutions_=t.resolutions,Ie((e=this.resolutions_,i=!0,n=function(t,e){return e-t}||gt,e.every((function(t,r){if(0===r)return!0;var o=n(e[r-1],t);return!(o>0||i&&0===o)}))),17),!t.origins)for(var o=0,s=this.resolutions_.length-1;o<s;++o)if(r){if(this.resolutions_[o]/this.resolutions_[o+1]!==r){r=void 0;break}}else r=this.resolutions_[o]/this.resolutions_[o+1];this.zoomFactor_=r,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,Ie(this.origins_.length==this.resolutions_.length,20));var a=t.extent;void 0===a||this.origin_||this.origins_||(this.origin_=bn(a)),Ie(!this.origin_&&this.origins_||this.origin_&&!this.origins_,18),this.tileSizes_=null,void 0!==t.tileSizes&&(this.tileSizes_=t.tileSizes,Ie(this.tileSizes_.length==this.resolutions_.length,19)),this.tileSize_=void 0!==t.tileSize?t.tileSize:this.tileSizes_?null:256,Ie(!this.tileSize_&&this.tileSizes_||this.tileSize_&&!this.tileSizes_,22),this.extent_=void 0!==a?a: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 i=new Jc(Math.min(0,t[0]),Math.max(t[0]-1,-1),Math.min(0,t[1]),Math.max(t[1]-1,-1));if(a){var n=this.getTileRangeForExtentAndZ(a,e);i.minX=Math.max(n.minX,i.minX),i.maxX=Math.min(n.maxX,i.maxX),i.minY=Math.max(n.minY,i.minY),i.maxY=Math.min(n.maxY,i.maxY)}return i}),this):a&&this.calculateTileRanges_(a)}return t.prototype.forEachTileCoord=function(t,e,i){for(var n=this.getTileRangeForExtentAndZ(t,e),r=n.minX,o=n.maxX;r<=o;++r)for(var s=n.minY,a=n.maxY;s<=a;++s)i([e,r,s])},t.prototype.forEachTileCoordParentTileRange=function(t,e,i,n){var r,o,s=null,a=t[0]-1;for(2===this.zoomFactor_?(r=t[1],o=t[2]):s=this.getTileCoordExtent(t,n);a>=this.minZoom;){if(e(a,2===this.zoomFactor_?$c(r=Math.floor(r/2),r,o=Math.floor(o/2),o,i):this.getTileRangeForExtentAndZ(s,a,i)))return!0;--a}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,i){if(t[0]<this.maxZoom){if(2===this.zoomFactor_){var n=2*t[1],r=2*t[2];return $c(n,n+1,r,r+1,e)}var o=this.getTileCoordExtent(t,i||this.tmpExtent_);return this.getTileRangeForExtentAndZ(o,t[0]+1,e)}return null},t.prototype.getTileRangeForTileCoordAndZ=function(t,e,i){if(e>this.maxZoom||e<this.minZoom)return null;var n=t[0],r=t[1],o=t[2];if(e===n)return $c(r,o,r,o,i);if(this.zoomFactor_){var s=Math.pow(this.zoomFactor_,e-n),a=Math.floor(r*s),l=Math.floor(o*s);return e<n?$c(a,a,l,l,i):$c(a,Math.floor(s*(r+1))-1,l,Math.floor(s*(o+1))-1,i)}var u=this.getTileCoordExtent(t,this.tmpExtent_);return this.getTileRangeForExtentAndZ(u,e,i)},t.prototype.getTileRangeExtent=function(t,e,i){var n=this.getOrigin(t),r=this.getResolution(t),o=Ds(this.getTileSize(t),this.tmpSize_),s=n[0]+e.minX*o[0]*r,a=n[0]+(e.maxX+1)*o[0]*r;return nn(s,n[1]+e.minY*o[1]*r,a,n[1]+(e.maxY+1)*o[1]*r,i)},t.prototype.getTileRangeForExtentAndZ=function(t,e,i){var n=kp;this.getTileCoordForXYAndZ_(t[0],t[3],e,!1,n);var r=n[1],o=n[2];return this.getTileCoordForXYAndZ_(t[2],t[1],e,!0,n),$c(r,n[1],o,n[2],i)},t.prototype.getTileCoordCenter=function(t){var e=this.getOrigin(t[0]),i=this.getResolution(t[0]),n=Ds(this.getTileSize(t[0]),this.tmpSize_);return[e[0]+(t[1]+.5)*n[0]*i,e[1]-(t[2]+.5)*n[1]*i]},t.prototype.getTileCoordExtent=function(t,e){var i=this.getOrigin(t[0]),n=this.getResolution(t[0]),r=Ds(this.getTileSize(t[0]),this.tmpSize_),o=i[0]+t[1]*r[0]*n,s=i[1]-(t[2]+1)*r[1]*n;return nn(o,s,o+r[0]*n,s+r[1]*n,e)},t.prototype.getTileCoordForCoordAndResolution=function(t,e,i){return this.getTileCoordForXYAndResolution_(t[0],t[1],e,!1,i)},t.prototype.getTileCoordForXYAndResolution_=function(t,e,i,n,r){var o=this.getZForResolution(i),s=i/this.getResolution(o),a=this.getOrigin(o),l=Ds(this.getTileSize(o),this.tmpSize_),u=n?.5:0,h=n?.5:0,c=Math.floor((t-a[0])/i+u),p=Math.floor((a[1]-e)/i+h),d=s*c/l[0],f=s*p/l[1];return n?(d=Math.ceil(d)-1,f=Math.ceil(f)-1):(d=Math.floor(d),f=Math.floor(f)),vp(o,d,f,r)},t.prototype.getTileCoordForXYAndZ_=function(t,e,i,n,r){var o=this.getOrigin(i),s=this.getResolution(i),a=Ds(this.getTileSize(i),this.tmpSize_),l=n?.5:0,u=n?.5:0,h=Math.floor((t-o[0])/s+l),c=Math.floor((o[1]-e)/s+u),p=h/a[0],d=c/a[1];return n?(p=Math.ceil(p)-1,d=Math.ceil(d)-1):(p=Math.floor(p),d=Math.floor(d)),vp(i,p,d,r)},t.prototype.getTileCoordForCoordAndZ=function(t,e,i){return this.getTileCoordForXYAndZ_(t[0],t[1],e,!1,i)},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 Fe(mt(this.resolutions_,t,e||0),this.minZoom,this.maxZoom)},t.prototype.calculateTileRanges_=function(t){for(var e=this.resolutions_.length,i=new Array(e),n=this.minZoom;n<e;++n)i[n]=this.getTileRangeForExtentAndZ(t,n);this.fullTileRanges_=i},t}();function Op(t){var e=t.getDefaultTileGrid();return e||(e=Fp(t),t.setDefaultTileGrid(e)),e}function Rp(t){var e=t||{},i=e.extent||Zn("EPSG:3857").getExtent(),n={extent:i,minZoom:e.minZoom,tileSize:e.tileSize,resolutions:Ip(i,e.maxZoom,e.tileSize,e.maxResolution)};return new Pp(n)}function Ip(t,e,i,n){for(var r=void 0!==e?e:42,o=_n(t),s=Sn(t),a=Ds(void 0!==i?i:256),l=n>0?n:Math.max(s/a[0],o/a[1]),u=r+1,h=new Array(u),c=0;c<u;++c)h[c]=l/Math.pow(2,c);return h}function Fp(t,e,i,n){return function(t,e,i,n){var r=void 0!==n?n:Gi,o=Ip(t,e,i);return new Pp({extent:t,origin:mn(t,r),resolutions:o,tileSize:i})}(jp(t),e,i,n)}function jp(t){var e=(t=Zn(t)).getExtent();if(!e){var i=180*mi[vi.DEGREES]/t.getMetersPerUnit();e=nn(-i,-i,i,i)}return e}var Mp=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}(),Ap=function(t){function e(e){var i=t.call(this,{attributions:e.attributions,attributionsCollapsible:e.attributionsCollapsible,projection:e.projection,state:e.state,wrapX:e.wrapX})||this;i.on,i.once,i.un,i.opaque_=void 0!==e.opaque&&e.opaque,i.tilePixelRatio_=void 0!==e.tilePixelRatio?e.tilePixelRatio:1,i.tileGrid=void 0!==e.tileGrid?e.tileGrid:null;var n=e.tileGrid;return n&&Ds(n.getTileSize(n.getMinZoom()),[256,256]),i.tileCache=new Sp(e.cacheSize||0),i.tmpSize=[0,0],i.key_=e.key||"",i.tileOptions={transition:e.transition},i.zDirection=e.zDirection?e.zDirection:0,i}return Mp(e,t),e.prototype.canExpireCache=function(){return this.tileCache.canExpireCache()},e.prototype.expireCache=function(t,e){var i=this.getTileCacheForProjection(t);i&&i.expireCache(e)},e.prototype.forEachLoadedTile=function(t,e,i,n){var r=this.getTileCacheForProjection(t);if(!r)return!1;for(var o,s,a,l=!0,u=i.minX;u<=i.maxX;++u)for(var h=i.minY;h<=i.maxY;++h)s=_p(e,u,h),a=!1,r.containsKey(s)&&(a=(o=r.get(s)).getState()===vo)&&(a=!1!==n(o)),a||(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.getResolutions()},e.prototype.getTile=function(t,e,i,n,r){return Zt()},e.prototype.getTileGrid=function(){return this.tileGrid},e.prototype.getTileGridForProjection=function(t){return this.tileGrid?this.tileGrid:Op(t)},e.prototype.getTileCacheForProjection=function(t){return Ie(tr(this.getProjection(),t),68),this.tileCache},e.prototype.getTilePixelRatio=function(t){return this.tilePixelRatio_},e.prototype.getTilePixelSize=function(t,e,i){var n,r,o,s=this.getTileGridForProjection(i),a=this.getTilePixelRatio(e),l=Ds(s.getTileSize(t),this.tmpSize);return 1==a?l:(n=l,r=a,void 0===(o=this.tmpSize)&&(o=[0,0]),o[0]=n[0]*r+.5|0,o[1]=n[1]*r+.5|0,o)},e.prototype.getTileCoordForTileUrlFunction=function(t,e){var i=void 0!==e?e:this.getProjection(),n=this.getTileGridForProjection(i);return this.getWrapX()&&i.isGlobal()&&(t=function(t,e,i){var n=e[0],r=t.getTileCoordCenter(e),o=jp(i);if($i(o,r))return e;var s=Sn(o),a=Math.ceil((o[0]-r[0])/s);return r[0]+=s*a,t.getTileCoordForCoordAndZ(r,n)}(n,t,i)),function(t,e){var i=t[0],n=t[1],r=t[2];if(e.getMinZoom()>i||i>e.getMaxZoom())return!1;var o=e.getFullTileRange(i);return!o||o.containsXY(n,r)}(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 i=this.getTileCacheForProjection(e);t>i.highWaterMark&&(i.highWaterMark=t)},e.prototype.useTile=function(t,e,i,n){},e}(cc),Lp=function(t){function e(e,i){var n=t.call(this,e)||this;return n.tile=i,n}return Mp(e,t),e}(dt),zp=Ap;function Dp(t,e){var i=/\{z\}/g,n=/\{x\}/g,r=/\{y\}/g,o=/\{-y\}/g;return function(s,a,l){return s?t.replace(i,s[0].toString()).replace(n,s[1].toString()).replace(r,s[2].toString()).replace(o,(function(){var t=s[0],i=e.getFullTileRange(t);return Ie(i,55),(i.getHeight()-s[2]-1).toString()})):void 0}}function Gp(t,e){for(var i=t.length,n=new Array(i),r=0;r<i;++r)n[r]=Dp(t[r],e);return function(t){if(1===t.length)return t[0];return function(e,i,n){if(e){var r=De(function(t){return(t[1]<<t[0])+t[2]}(e),t.length);return t[r](e,i,n)}}}(n)}var Np=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}(),Bp=function(t){function e(i){var n=t.call(this,{attributions:i.attributions,cacheSize:i.cacheSize,opaque:i.opaque,projection:i.projection,state:i.state,tileGrid:i.tileGrid,tilePixelRatio:i.tilePixelRatio,wrapX:i.wrapX,transition:i.transition,key:i.key,attributionsCollapsible:i.attributionsCollapsible,zDirection:i.zDirection})||this;return n.generateTileUrlFunction_=n.tileUrlFunction===e.prototype.tileUrlFunction,n.tileLoadFunction=i.tileLoadFunction,i.tileUrlFunction&&(n.tileUrlFunction=i.tileUrlFunction),n.urls=null,i.urls?n.setUrls(i.urls):i.url&&n.setUrl(i.url),n.tileLoadingKeys_={},n}return Np(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,i=t.target,n=$t(i),r=i.getState();r==mo?(this.tileLoadingKeys_[n]=!0,e=Cp):n in this.tileLoadingKeys_&&(delete this.tileLoadingKeys_[n],e=r==_o?Ep:r==vo?Tp:void 0),null!=e&&this.dispatchEvent(new Lp(e,i))},e.prototype.setTileLoadFunction=function(t){this.tileCache.clear(),this.tileLoadFunction=t,this.changed()},e.prototype.setTileUrlFunction=function(t,e){this.tileUrlFunction=t,this.tileCache.pruneExceptNewestZ(),void 0!==e?this.setKey(e):this.changed()},e.prototype.setUrl=function(t){var e=function(t){var e=[],i=/\{([a-z])-([a-z])\}/.exec(t);if(i){var n=i[1].charCodeAt(0),r=i[2].charCodeAt(0),o=void 0;for(o=n;o<=r;++o)e.push(t.replace(i[0],String.fromCharCode(o)));return e}if(i=/\{(\d+)-(\d+)\}/.exec(t)){for(var s=parseInt(i[2],10),a=parseInt(i[1],10);a<=s;a++)e.push(t.replace(i[0],a.toString()));return e}return e.push(t),e}(t);this.urls=e,this.setUrls(e)},e.prototype.setUrls=function(t){this.urls=t;var e=t.join("\n");this.generateTileUrlFunction_?this.setTileUrlFunction(Gp(t,this.tileGrid),e):this.setKey(e)},e.prototype.tileUrlFunction=function(t,e,i){},e.prototype.useTile=function(t,e,i){var n=_p(t,e,i);this.tileCache.containsKey(n)&&this.tileCache.get(n)},e}(zp),Wp=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}(),qp=[],Vp=function(t){function e(e,i,n,r){var o=t.call(this,e,i,{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=r.bind(void 0,o),o.wrappedTileCoord=n,o}return Wp(e,t),e.prototype.getContext=function(t){var e=$t(t);return e in this.context_||(this.context_[e]=pe(1,1,qp)),this.context_[e]},e.prototype.hasContext=function(t){return $t(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=$t(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_)qp.push(this.context_[e].canvas),delete this.context_[e];t.prototype.release.call(this)},e}(fp),Up=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}(),Xp=function(t){function e(e){var i=this,n=e.projection||"EPSG:3857",r=e.extent||jp(n),o=e.tileGrid||Rp({extent:r,maxResolution:e.maxResolution,maxZoom:void 0!==e.maxZoom?e.maxZoom:22,minZoom:e.minZoom,tileSize:e.tileSize||512});return(i=t.call(this,{attributions:e.attributions,attributionsCollapsible:e.attributionsCollapsible,cacheSize:e.cacheSize,opaque:!1,projection:n,state:e.state,tileGrid:o,tileLoadFunction:e.tileLoadFunction?e.tileLoadFunction:Kp,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,i.sourceTileCache=new Sp(i.tileCache.highWaterMark),i.overlaps_=null==e.overlaps||e.overlaps,i.tileClass=e.tileClass?e.tileClass:gp,i.tileGrids_={},i}return Up(e,t),e.prototype.getFeaturesInExtent=function(t){var e=[],i=this.tileCache;if(0===i.getCount())return e;var n=bp(i.peekFirstKey())[0],r=this.tileGrid;return i.forEach((function(i){if(i.tileCoord[0]===n&&i.getState()===vo)for(var o=i.getSourceTiles(),s=0,a=o.length;s<a;++s){var l=o[s],u=l.tileCoord;if(Cn(t,r.getTileCoordExtent(u))){var h=l.getFeatures();if(h)for(var c=0,p=h.length;c<p;++c){var d=h[c],f=d.getGeometry();Cn(t,f.getExtent())&&e.push(d)}}}})),e},e.prototype.getOverlaps=function(){return this.overlaps_},e.prototype.clear=function(){this.tileCache.clear(),this.sourceTileCache.clear()},e.prototype.expireCache=function(e,i){var n=this.getTileCacheForProjection(e),r=Object.keys(i).reduce((function(t,e){var i,r,o=_p((r=(i=e).substring(i.lastIndexOf("/")+1,i.length).split(",").map(Number))[0],r[1],r[2]);if(n.containsKey(o))for(var s=n.get(o).sourceTiles,a=0,l=s.length;a<l;++a)t[s[a].getKey()]=!0;return t}),{});t.prototype.expireCache.call(this,e,i),this.sourceTileCache.expireCache(r)},e.prototype.getSourceTiles=function(t,e,i){var n=this;if(i.getState()===go){i.setState(mo);var r=i.wrappedTileCoord,o=this.getTileGridForProjection(e),s=o.getTileCoordExtent(r),a=r[0],l=o.getResolution(a);Yi(s,-l,s);var u=this.tileGrid,h=u.getExtent();h&&xn(s,h,s);var c=u.getZForResolution(l,1);u.forEachTileCoord(s,c,(function(r){var o=n.tileUrlFunction(r,t,e),s=n.sourceTileCache.containsKey(o)?n.sourceTileCache.get(o):new n.tileClass(r,o?go:xo,o,n.format_,n.tileLoadFunction);i.sourceTiles.push(s);var a=s.getState();if(a<vo){var l=function(t){n.handleTileChange(t);var e=s.getState();if(e===vo||e===_o){var r=s.getKey();r in i.errorTileKeys?s.getState()===vo&&delete i.errorTileKeys[r]:i.loadingSourceTiles--,e===_o?i.errorTileKeys[r]=!0:s.removeEventListener(It,l),0===i.loadingSourceTiles&&i.setState(kt(i.errorTileKeys)?vo:_o)}};s.addEventListener(It,l),i.loadingSourceTiles++}a===go&&(s.extent=u.getTileCoordExtent(r),s.projection=e,s.resolution=u.getResolution(r[0]),n.sourceTileCache.set(o,s),s.load())})),i.loadingSourceTiles||i.setState(i.sourceTiles.some((function(t){return t.getState()===_o}))?_o:vo)}return i.sourceTiles},e.prototype.getTile=function(t,e,i,n,r){var o,s=_p(t,e,i),a=this.getKey();if(this.tileCache.containsKey(s)&&(o=this.tileCache.get(s)).key===a)return o;var l=[t,e,i],u=this.getTileCoordForTileUrlFunction(l,r),h=this.getTileGrid().getExtent(),c=this.getTileGridForProjection(r);if(u&&h){var p=c.getTileCoordExtent(u);Yi(p,-c.getResolution(t),p),Cn(h,p)||(u=null)}var d=!0;if(null!==u){var f=this.tileGrid,y=c.getResolution(t),g=f.getZForResolution(y,1),m=c.getTileCoordExtent(u);Yi(m,-y,m),f.forEachTileCoord(m,g,function(t){d=d&&!this.tileUrlFunction(t,n,r)}.bind(this))}var v=new Vp(l,d?xo:go,u,this.getSourceTiles.bind(this,n,r));return v.key=a,o?(v.interimTile=o,v.refreshInterimChain(),this.tileCache.replace(s,v)):this.tileCache.set(s,v),v},e.prototype.getTileGridForProjection=function(t){var e=t.getCode(),i=this.tileGrids_[e];if(!i){var n=this.tileGrid;i=Fp(t,void 0,n?n.getTileSize(n.getMinZoom()):void 0),this.tileGrids_[e]=i}return i},e.prototype.getTilePixelRatio=function(t){return t},e.prototype.getTilePixelSize=function(t,e,i){var n=Ds(this.getTileGridForProjection(i).getTileSize(t),this.tmpSize);return[Math.round(n[0]*e),Math.round(n[1]*e)]},e.prototype.updateCacheSize=function(e,i){t.prototype.updateCacheSize.call(this,2*e,i),this.sourceTileCache.highWaterMark=this.getTileCacheForProjection(i).highWaterMark},e}(Bp);function Kp(t,e){t.setLoader((function(i,n,r){xc(e,t.getFormat(),i,n,r,t.onLoad.bind(t),t.onError.bind(t))}))}var Yp=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}(),Zp=function(t){function e(e){return(e=Ct({},e)).controls||(e.controls=Zs()),e.interactions||(e.interactions=Zc({onFocusOnly:!0})),t.call(this,e)||this}return Yp(e,t),e.prototype.createRenderer=function(){return new Jr(this)},e}(Ns),Hp=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}();var $p,Jp=function(t){function e(e,i,n,r,o,s){var a=t.call(this,e,i,s)||this;return a.crossOrigin_=r,a.src_=n,a.key=n,a.image_=new Image,null!==r&&(a.image_.crossOrigin=r),a.unlisten_=null,a.tileLoadFunction_=o,a}return Hp(e,t),e.prototype.getImage=function(){return this.image_},e.prototype.setImage=function(t){this.image_=t,this.state=vo,this.unlistenImage_(),this.changed()},e.prototype.handleImageError_=function(){var t;this.state=_o,this.unlistenImage_(),this.image_=((t=pe(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=vo:this.state=xo,this.unlistenImage_(),this.changed()},e.prototype.load=function(){this.state==_o&&(this.state=go,this.image_=new Image,null!==this.crossOrigin_&&(this.image_.crossOrigin=this.crossOrigin_)),this.state==go&&(this.state=mo,this.changed(),this.tileLoadFunction_(this,this.src_),this.unlisten_=Ba(this.image_,this.handleImageLoad_.bind(this),this.handleImageError_.bind(this)))},e.prototype.unlistenImage_=function(){this.unlisten_&&(this.unlisten_(),this.unlisten_=null)},e}(fp),Qp=function(){function t(t,e,i,n,r,o){this.sourceProj_=t,this.targetProj_=e;var s={},a=ir(this.targetProj_,this.sourceProj_);this.transformInv_=function(t){var e=t[0]+"/"+t[1];return s[e]||(s[e]=a(t)),s[e]},this.maxSourceExtent_=n,this.errorThresholdSquared_=r*r,this.triangles_=[],this.wrapsXInSource_=!1,this.canWrapXInSource_=this.sourceProj_.canWrapX()&&!!n&&!!this.sourceProj_.getExtent()&&Sn(n)==Sn(this.sourceProj_.getExtent()),this.sourceWorldWidth_=this.sourceProj_.getExtent()?Sn(this.sourceProj_.getExtent()):null,this.targetWorldWidth_=this.targetProj_.getExtent()?Sn(this.targetProj_.getExtent()):null;var l=bn(i),u=wn(i),h=yn(i),c=fn(i),p=this.transformInv_(l),d=this.transformInv_(u),f=this.transformInv_(h),y=this.transformInv_(c),g=10+(o?Math.max(0,Math.ceil(Me(dn(i)/(o*o*256*256)))):0);if(this.addQuad_(l,u,h,c,p,d,f,y,g),this.wrapsXInSource_){var m=1/0;this.triangles_.forEach((function(t,e,i){m=Math.min(m,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])-m>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]-m>this.sourceWorldWidth_/2&&(e[0][0]-=this.sourceWorldWidth_),e[1][0]-m>this.sourceWorldWidth_/2&&(e[1][0]-=this.sourceWorldWidth_),e[2][0]-m>this.sourceWorldWidth_/2&&(e[2][0]-=this.sourceWorldWidth_);var i=Math.min(e[0][0],e[1][0],e[2][0]);Math.max(e[0][0],e[1][0],e[2][0])-i<this.sourceWorldWidth_/2&&(t.source=e)}}.bind(this))}s={}}return t.prototype.addTriangle_=function(t,e,i,n,r,o){this.triangles_.push({source:[n,r,o],target:[t,e,i]})},t.prototype.addQuad_=function(t,e,i,n,r,o,s,a,l){var u=Ki([r,o,s,a]),h=this.sourceWorldWidth_?Sn(u)/this.sourceWorldWidth_:null,c=this.sourceWorldWidth_,p=this.sourceProj_.canWrapX()&&h>.5&&h<1,d=!1;if(l>0){if(this.targetProj_.isGlobal()&&this.targetWorldWidth_)d=Sn(Ki([t,e,i,n]))/this.targetWorldWidth_>.25||d;!p&&this.sourceProj_.isGlobal()&&h&&(d=h>.25||d)}if(!(!d&&this.maxSourceExtent_&&isFinite(u[0])&&isFinite(u[1])&&isFinite(u[2])&&isFinite(u[3]))||Cn(u,this.maxSourceExtent_)){var f=0;if(!(d||isFinite(r[0])&&isFinite(r[1])&&isFinite(o[0])&&isFinite(o[1])&&isFinite(s[0])&&isFinite(s[1])&&isFinite(a[0])&&isFinite(a[1])))if(l>0)d=!0;else if(1!=(f=(isFinite(r[0])&&isFinite(r[1])?0:8)+(isFinite(o[0])&&isFinite(o[1])?0:4)+(isFinite(s[0])&&isFinite(s[1])?0:2)+(isFinite(a[0])&&isFinite(a[1])?0:1))&&2!=f&&4!=f&&8!=f)return;if(l>0){if(!d){var y=[(t[0]+i[0])/2,(t[1]+i[1])/2],g=this.transformInv_(y),m=void 0;if(p)m=(De(r[0],c)+De(s[0],c))/2-De(g[0],c);else m=(r[0]+s[0])/2-g[0];var v=(r[1]+s[1])/2-g[1];d=m*m+v*v>this.errorThresholdSquared_}if(d){if(Math.abs(t[0]-i[0])<=Math.abs(t[1]-i[1])){var _=[(e[0]+i[0])/2,(e[1]+i[1])/2],x=this.transformInv_(_),b=[(n[0]+t[0])/2,(n[1]+t[1])/2],w=this.transformInv_(b);this.addQuad_(t,e,_,b,r,o,x,w,l-1),this.addQuad_(b,_,i,n,w,x,s,a,l-1)}else{var S=[(t[0]+e[0])/2,(t[1]+e[1])/2],C=this.transformInv_(S),T=[(i[0]+n[0])/2,(i[1]+n[1])/2],E=this.transformInv_(T);this.addQuad_(t,S,T,n,r,C,E,a,l-1),this.addQuad_(S,e,i,T,C,o,s,E,l-1)}return}}if(p){if(!this.canWrapXInSource_)return;this.wrapsXInSource_=!0}0==(11&f)&&this.addTriangle_(t,i,n,r,s,a),0==(14&f)&&this.addTriangle_(t,i,e,r,s,o),f&&(0==(13&f)&&this.addTriangle_(e,n,t,o,a,r),0==(7&f)&&this.addTriangle_(e,n,i,o,a,s))}},t.prototype.calculateSourceExtent=function(){var t=[1/0,1/0,-1/0,-1/0];return this.triangles_.forEach((function(e,i,n){var r=e.source;un(t,r[0]),un(t,r[1]),un(t,r[2])})),t},t.prototype.getTriangles=function(){return this.triangles_},t}(),td={imageSmoothingEnabled:!1,msImageSmoothingEnabled:!1};function ed(t,e,i,n,r){t.beginPath(),t.moveTo(0,0),t.lineTo(e,i),t.lineTo(n,r),t.closePath(),t.save(),t.clip(),t.fillRect(0,0,Math.max(e,n)+1,Math.max(i,r)),t.restore()}function id(t,e){return Math.abs(t[4*e]-210)>2||Math.abs(t[4*e+3]-191.25)>2}function nd(t,e,i,n){var r=nr(i,e,t),o=Hn(e,n,i),s=e.getMetersPerUnit();void 0!==s&&(o*=s);var a=t.getMetersPerUnit();void 0!==a&&(o/=a);var l=t.getExtent();if(!l||$i(l,r)){var u=Hn(t,o,r)/o;isFinite(u)&&u>0&&(o/=u)}return o}function rd(t,e,i,n,r,o,s,a,l,u,h,c){var p=pe(Math.round(i*t),Math.round(i*e));if(Ct(p,c),0===l.length)return p.canvas;function d(t){return Math.round(t*i)/i}p.scale(i,i),p.globalCompositeOperation="lighter";var f=[1/0,1/0,-1/0,-1/0];l.forEach((function(t,e,i){ln(f,t.extent)}));var y=Sn(f),g=_n(f),m=pe(Math.round(i*y/n),Math.round(i*g/n));Ct(m,c);var v=i/n;l.forEach((function(t,e,i){var n=t.extent[0]-f[0],r=-(t.extent[3]-f[3]),o=Sn(t.extent),s=_n(t.extent);t.image.width>0&&t.image.height>0&&m.drawImage(t.image,u,u,t.image.width-2*u,t.image.height-2*u,n*v,r*v,o*v,s*v)}));var _=bn(s);return a.getTriangles().forEach((function(t,e,r){var s=t.source,a=t.target,l=s[0][0],u=s[0][1],h=s[1][0],y=s[1][1],g=s[2][0],v=s[2][1],x=d((a[0][0]-_[0])/o),b=d(-(a[0][1]-_[1])/o),w=d((a[1][0]-_[0])/o),S=d(-(a[1][1]-_[1])/o),C=d((a[2][0]-_[0])/o),T=d(-(a[2][1]-_[1])/o),E=l,k=u;l=0,u=0;var P=function(t){for(var e=t.length,i=0;i<e;i++){for(var n=i,r=Math.abs(t[i][i]),o=i+1;o<e;o++){var s=Math.abs(t[o][i]);s>r&&(r=s,n=o)}if(0===r)return null;var a=t[n];t[n]=t[i],t[i]=a;for(var l=i+1;l<e;l++)for(var u=-t[l][i]/t[i][i],h=i;h<e+1;h++)i==h?t[l][h]=0:t[l][h]+=u*t[i][h]}for(var c=new Array(e),p=e-1;p>=0;p--){c[p]=t[p][e]/t[p][p];for(var d=p-1;d>=0;d--)t[d][e]-=t[d][p]*c[p]}return c}([[h-=E,y-=k,0,0,w-x],[g-=E,v-=k,0,0,C-x],[0,0,h,y,S-b],[0,0,g,v,T-b]]);if(P){if(p.save(),p.beginPath(),function(){if(void 0===$p){var t=document.createElement("canvas").getContext("2d");t.globalCompositeOperation="lighter",t.fillStyle="rgba(210, 0, 0, 0.75)",ed(t,4,5,4,0),ed(t,4,5,0,5);var e=t.getImageData(0,0,3,3).data;$p=id(e,0)||id(e,4)||id(e,8)}return $p}()||c===td){p.moveTo(w,S);for(var O=x-w,R=b-S,I=0;I<4;I++)p.lineTo(w+d((I+1)*O/4),S+d(I*R/3)),3!=I&&p.lineTo(w+d((I+1)*O/4),S+d((I+1)*R/3));p.lineTo(C,T)}else p.moveTo(w,S),p.lineTo(x,b),p.lineTo(C,T);p.clip(),p.transform(P[0],P[2],P[1],P[3],x,b),p.translate(f[0]-E,f[3]-k),p.scale(n/i,-n/i),p.drawImage(m.canvas,0,0),p.restore()}})),h&&(p.save(),p.globalCompositeOperation="source-over",p.strokeStyle="black",p.lineWidth=1,a.getTriangles().forEach((function(t,e,i){var n=t.target,r=(n[0][0]-_[0])/o,s=-(n[0][1]-_[1])/o,a=(n[1][0]-_[0])/o,l=-(n[1][1]-_[1])/o,u=(n[2][0]-_[0])/o,h=-(n[2][1]-_[1])/o;p.beginPath(),p.moveTo(a,l),p.lineTo(r,s),p.lineTo(u,h),p.closePath(),p.stroke()})),p.restore()),p.canvas}var od=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}(),sd=function(t){function e(e,i,n,r,o,s,a,l,u,h,c,p){var d=t.call(this,o,go)||this;d.renderEdges_=void 0!==c&&c,d.contextOptions_=p,d.pixelRatio_=a,d.gutter_=l,d.canvas_=null,d.sourceTileGrid_=i,d.targetTileGrid_=r,d.wrappedTileCoord_=s||o,d.sourceTiles_=[],d.sourcesListenerKeys_=null,d.sourceZ_=0;var f=r.getTileCoordExtent(d.wrappedTileCoord_),y=d.targetTileGrid_.getExtent(),g=d.sourceTileGrid_.getExtent(),m=y?xn(f,y):f;if(0===dn(m))return d.state=xo,d;var v=e.getExtent();v&&(g=g?xn(g,v):v);var _=r.getResolution(d.wrappedTileCoord_[0]),x=function(t,e,i,n){var r=gn(i),o=nd(t,e,r,n);return(!isFinite(o)||o<=0)&&pn(i,(function(i){return o=nd(t,e,i,n),isFinite(o)&&o>0})),o}(e,n,m,_);if(!isFinite(x)||x<=0)return d.state=xo,d;var b=void 0!==h?h:.5;if(d.triangulation_=new Qp(e,n,m,g,x*b,_),0===d.triangulation_.getTriangles().length)return d.state=xo,d;d.sourceZ_=i.getZForResolution(x);var w=d.triangulation_.calculateSourceExtent();if(g&&(e.canWrapX()?(w[1]=Fe(w[1],g[1],g[3]),w[3]=Fe(w[3],g[1],g[3])):w=xn(w,g)),dn(w)){for(var S=i.getTileRangeForExtentAndZ(w,d.sourceZ_),C=S.minX;C<=S.maxX;C++)for(var T=S.minY;T<=S.maxY;T++){var E=u(d.sourceZ_,C,T,a);E&&d.sourceTiles_.push(E)}0===d.sourceTiles_.length&&(d.state=xo)}else d.state=xo;return d}return od(e,t),e.prototype.getImage=function(){return this.canvas_},e.prototype.reproject_=function(){var t=[];if(this.sourceTiles_.forEach(function(e,i,n){e&&e.getState()==vo&&t.push({extent:this.sourceTileGrid_.getTileCoordExtent(e.tileCoord),image:e.getImage()})}.bind(this)),this.sourceTiles_.length=0,0===t.length)this.state=_o;else{var e=this.wrappedTileCoord_[0],i=this.targetTileGrid_.getTileSize(e),n="number"==typeof i?i:i[0],r="number"==typeof i?i:i[1],o=this.targetTileGrid_.getResolution(e),s=this.sourceTileGrid_.getResolution(this.sourceZ_),a=this.targetTileGrid_.getTileCoordExtent(this.wrappedTileCoord_);this.canvas_=rd(n,r,this.pixelRatio_,s,this.sourceTileGrid_.getExtent(),o,a,this.triangulation_,t,this.gutter_,this.renderEdges_,this.contextOptions_),this.state=vo}this.changed()},e.prototype.load=function(){if(this.state==go){this.state=mo,this.changed();var t=0;this.sourcesListenerKeys_=[],this.sourceTiles_.forEach(function(e,i,n){var r=e.getState();if(r==go||r==mo){t++;var o=qt(e,It,(function(i){var n=e.getState();n!=vo&&n!=_o&&n!=xo||(Ut(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,i){t.getState()==go&&t.load()}))}},e.prototype.unlistenSources_=function(){this.sourcesListenerKeys_.forEach(Ut),this.sourcesListenerKeys_=null},e}(fp),ad=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}();function ld(t,e){t.getImage().src=e}var ud=function(t){function e(e){var i=t.call(this,{attributions:e.attributions,cacheSize:e.cacheSize,opaque:e.opaque,projection:e.projection,state:e.state,tileGrid:e.tileGrid,tileLoadFunction:e.tileLoadFunction?e.tileLoadFunction:ld,tilePixelRatio:e.tilePixelRatio,tileUrlFunction:e.tileUrlFunction,url:e.url,urls:e.urls,wrapX:e.wrapX,transition:e.transition,key:e.key,attributionsCollapsible:e.attributionsCollapsible,zDirection:e.zDirection})||this;return i.crossOrigin=void 0!==e.crossOrigin?e.crossOrigin:null,i.tileClass=void 0!==e.tileClass?e.tileClass:Jp,i.tileCacheForProjection={},i.tileGridForProjection={},i.reprojectionErrorThreshold_=e.reprojectionErrorThreshold,i.contextOptions_=!1===e.imageSmoothing?td:void 0,i.renderReprojectionEdges_=!1,i}return ad(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 i=this.getTileCacheForProjection(t);for(var n in this.tileCache.expireCache(this.tileCache==i?e:{}),this.tileCacheForProjection){var r=this.tileCacheForProjection[n];r.expireCache(r==i?e:{})}},e.prototype.getContextOptions=function(){return this.contextOptions_},e.prototype.getGutterForProjection=function(t){return this.getProjection()&&t&&!tr(this.getProjection(),t)?0:this.getGutter()},e.prototype.getGutter=function(){return 0},e.prototype.getKey=function(){return t.prototype.getKey.call(this)+(this.contextOptions_?"\n"+JSON.stringify(this.contextOptions_):"")},e.prototype.getOpaque=function(e){return!(this.getProjection()&&e&&!tr(this.getProjection(),e))&&t.prototype.getOpaque.call(this,e)},e.prototype.getTileGridForProjection=function(t){var e=this.getProjection();if(!this.tileGrid||e&&!tr(e,t)){var i=$t(t);return i in this.tileGridForProjection||(this.tileGridForProjection[i]=Op(t)),this.tileGridForProjection[i]}return this.tileGrid},e.prototype.getTileCacheForProjection=function(t){var e=this.getProjection();if(!e||tr(e,t))return this.tileCache;var i=$t(t);return i in this.tileCacheForProjection||(this.tileCacheForProjection[i]=new Sp(this.tileCache.highWaterMark)),this.tileCacheForProjection[i]},e.prototype.createTile_=function(t,e,i,n,r,o){var s=[t,e,i],a=this.getTileCoordForTileUrlFunction(s,r),l=a?this.tileUrlFunction(a,n,r):void 0,u=new this.tileClass(s,void 0!==l?go:xo,void 0!==l?l:"",this.crossOrigin,this.tileLoadFunction,this.tileOptions);return u.key=o,u.addEventListener(It,this.handleTileChange.bind(this)),u},e.prototype.getTile=function(t,e,i,n,r){var o=this.getProjection();if(o&&r&&!tr(o,r)){var s=this.getTileCacheForProjection(r),a=[t,e,i],l=void 0,u=xp(a);s.containsKey(u)&&(l=s.get(u));var h=this.getKey();if(l&&l.key==h)return l;var c=this.getTileGridForProjection(o),p=this.getTileGridForProjection(r),d=this.getTileCoordForTileUrlFunction(a,r),f=new sd(o,c,r,p,a,d,this.getTilePixelRatio(n),this.getGutter(),function(t,e,i,n){return this.getTileInternal(t,e,i,n,o)}.bind(this),this.reprojectionErrorThreshold_,this.renderReprojectionEdges_,this.contextOptions_);return f.key=h,l?(f.interimTile=l,f.refreshInterimChain(),s.replace(u,f)):s.set(u,f),f}return this.getTileInternal(t,e,i,n,o||r)},e.prototype.getTileInternal=function(t,e,i,n,r){var o=null,s=_p(t,e,i),a=this.getKey();if(this.tileCache.containsKey(s)){if((o=this.tileCache.get(s)).key!=a){var l=o;o=this.createTile_(t,e,i,n,r,a),l.getState()==go?o.interimTile=l.interimTile:o.interimTile=l,o.refreshInterimChain(),this.tileCache.replace(s,o)}}else o=this.createTile_(t,e,i,n,r,a),this.tileCache.set(s,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 i=Zn(t);if(i){var n=$t(i);n in this.tileGridForProjection||(this.tileGridForProjection[n]=e)}},e}(Bp),hd=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}(),cd=function(t){function e(e){var i=this,n=e||{},r=Ct({},n);return delete r.preload,delete r.useInterimTilesOnError,(i=t.call(this,r)||this).on,i.once,i.un,i.setPreload(void 0!==n.preload?n.preload:0),i.setUseInterimTilesOnError(void 0===n.useInterimTilesOnError||n.useInterimTilesOnError),i}return hd(e,t),e.prototype.getPreload=function(){return this.get(up)},e.prototype.setPreload=function(t){this.set(up,t)},e.prototype.getUseInterimTilesOnError=function(){return this.get(hp)},e.prototype.setUseInterimTilesOnError=function(t){this.set(hp,t)},e}($e),pd=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}(),dd=function(t){function e(e){return t.call(this,e)||this}return pd(e,t),e.prototype.createRenderer=function(){return new ep(this)},e}(cd),fd={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},yd=/(italic|oblique)$/i,gd={},md={$version:8,$root:{version:{required:!0,type:"enum",values:[8],doc:"Style specification version number. Must be 8.",example:8},name:{type:"string",doc:"A human-readable name for the style.",example:"Bright"},metadata:{type:"*",doc:"Arbitrary properties useful to track with the stylesheet, but do not influence rendering. Properties should be prefixed to avoid collisions, like 'mapbox:'."},center:{type:"array",value:"number",doc:"Default map center in longitude and latitude. The style center will be used only if the map has not been positioned by other means (e.g. map options or user interaction).",example:[-73.9749,40.7736]},zoom:{type:"number",doc:"Default zoom level. The style zoom will be used only if the map has not been positioned by other means (e.g. map options or user interaction).",example:12.5},bearing:{type:"number",default:0,period:360,units:"degrees",doc:'Default bearing, in degrees. The bearing is the compass direction that is "up"; for example, a bearing of 90° orients the map so that east is up. This value will be used only if the map has not been positioned by other means (e.g. map options or user interaction).',example:29},pitch:{type:"number",default:0,units:"degrees",doc:"Default pitch, in degrees. Zero is perpendicular to the surface, for a look straight down at the map, while a greater value like 60 looks ahead towards the horizon. The style pitch will be used only if the map has not been positioned by other means (e.g. map options or user interaction).",example:50},light:{type:"light",doc:"The global light source.",example:{anchor:"viewport",color:"white",intensity:.4}},terrain:{type:"terrain",doc:"A global modifier that elevates layers and markers based on a DEM data source."},fog:{type:"fog",doc:"A global effect that fades layers and markers based on their distance to the camera. The fog can be used to approximate the effect of atmosphere on distant objects and enhance the depth perception of the map when used with terrain or 3D features."},sources:{required:!0,type:"sources",doc:"Data source specifications.",example:{"mapbox-streets":{type:"vector",url:"mapbox://mapbox.mapbox-streets-v6"}}},sprite:{type:"string",doc:"A base URL for retrieving the sprite image and metadata. The extensions `.png`, `.json` and scale factor `@2x.png` will be automatically appended. This property is required if any layer uses the `background-pattern`, `fill-pattern`, `line-pattern`, `fill-extrusion-pattern`, or `icon-image` properties. The URL must be absolute, containing the [scheme, authority and path components](https://en.wikipedia.org/wiki/URL#Syntax).",example:"mapbox://sprites/mapbox/bright-v8"},glyphs:{type:"string",doc:"A URL template for loading signed-distance-field glyph sets in PBF format. The URL must include `{fontstack}` and `{range}` tokens. This property is required if any layer uses the `text-field` layout property. The URL must be absolute, containing the [scheme, authority and path components](https://en.wikipedia.org/wiki/URL#Syntax).",example:"mapbox://fonts/mapbox/{fontstack}/{range}.pbf"},transition:{type:"transition",doc:"A global transition definition to use as a default across properties, to be used for timing transitions between one value and the next when no property-specific transition is set. Collision-based symbol fading is controlled independently of the style's `transition` property.",example:{duration:300,delay:0}},layers:{required:!0,type:"array",value:"layer",doc:"Layers will be drawn in the order of this array.",example:[{id:"water",source:"mapbox-streets","source-layer":"water",type:"fill",paint:{"fill-color":"#00ffff"}}]}},sources:{"*":{type:"source",doc:"Specification of a data source. For vector and raster sources, either TileJSON or a URL to a TileJSON must be provided. For image and video sources, a URL must be provided. For GeoJSON sources, a URL or inline GeoJSON must be provided."}},source:["source_vector","source_raster","source_raster_dem","source_geojson","source_video","source_image"],source_vector:{type:{required:!0,type:"enum",values:{vector:{doc:"A vector tile source."}},doc:"The type of the source."},url:{type:"string",doc:"A URL to a TileJSON resource. Supported protocols are `http:`, `https:`, and `mapbox://<Tileset ID>`."},tiles:{type:"array",value:"string",doc:"An array of one or more tile source URLs, as in the TileJSON spec."},bounds:{type:"array",value:"number",length:4,default:[-180,-85.051129,180,85.051129],doc:"An array containing the longitude and latitude of the southwest and northeast corners of the source's bounding box in the following order: `[sw.lng, sw.lat, ne.lng, ne.lat]`. When this property is included in a source, no tiles outside of the given bounds are requested by Mapbox GL."},scheme:{type:"enum",values:{xyz:{doc:"Slippy map tilenames scheme."},tms:{doc:"OSGeo spec scheme."}},default:"xyz",doc:"Influences the y direction of the tile coordinates. The global-mercator (aka Spherical Mercator) profile is assumed."},minzoom:{type:"number",default:0,doc:"Minimum zoom level for which tiles are available, as in the TileJSON spec."},maxzoom:{type:"number",default:22,doc:"Maximum zoom level for which tiles are available, as in the TileJSON spec. Data from tiles at the maxzoom are used when displaying the map at higher zoom levels."},attribution:{type:"string",doc:"Contains an attribution to be displayed when the map is shown to a user."},promoteId:{type:"promoteId",doc:"A property to use as a feature id (for feature state). Either a property name, or an object of the form `{<sourceLayer>: <propertyName>}`. If specified as a string for a vector tile source, the same property is used across all its source layers."},volatile:{type:"boolean",default:!1,doc:"A setting to determine whether a source's tiles are cached locally.","sdk-support":{"basic functionality":{android:"9.3.0",ios:"5.10.0"}}},"*":{type:"*",doc:"Other keys to configure the data source."}},source_raster:{type:{required:!0,type:"enum",values:{raster:{doc:"A raster tile source."}},doc:"The type of the source."},url:{type:"string",doc:"A URL to a TileJSON resource. Supported protocols are `http:`, `https:`, and `mapbox://<Tileset ID>`."},tiles:{type:"array",value:"string",doc:"An array of one or more tile source URLs, as in the TileJSON spec."},bounds:{type:"array",value:"number",length:4,default:[-180,-85.051129,180,85.051129],doc:"An array containing the longitude and latitude of the southwest and northeast corners of the source's bounding box in the following order: `[sw.lng, sw.lat, ne.lng, ne.lat]`. When this property is included in a source, no tiles outside of the given bounds are requested by Mapbox GL."},minzoom:{type:"number",default:0,doc:"Minimum zoom level for which tiles are available, as in the TileJSON spec."},maxzoom:{type:"number",default:22,doc:"Maximum zoom level for which tiles are available, as in the TileJSON spec. Data from tiles at the maxzoom are used when displaying the map at higher zoom levels."},tileSize:{type:"number",default:512,units:"pixels",doc:"The minimum visual size to display tiles for this layer. Only configurable for raster layers."},scheme:{type:"enum",values:{xyz:{doc:"Slippy map tilenames scheme."},tms:{doc:"OSGeo spec scheme."}},default:"xyz",doc:"Influences the y direction of the tile coordinates. The global-mercator (aka Spherical Mercator) profile is assumed."},attribution:{type:"string",doc:"Contains an attribution to be displayed when the map is shown to a user."},volatile:{type:"boolean",default:!1,doc:"A setting to determine whether a source's tiles are cached locally.","sdk-support":{"basic functionality":{android:"9.3.0",ios:"5.10.0"}}},"*":{type:"*",doc:"Other keys to configure the data source."}},source_raster_dem:{type:{required:!0,type:"enum",values:{"raster-dem":{doc:"A RGB-encoded raster DEM source"}},doc:"The type of the source."},url:{type:"string",doc:"A URL to a TileJSON resource. Supported protocols are `http:`, `https:`, and `mapbox://<Tileset ID>`."},tiles:{type:"array",value:"string",doc:"An array of one or more tile source URLs, as in the TileJSON spec."},bounds:{type:"array",value:"number",length:4,default:[-180,-85.051129,180,85.051129],doc:"An array containing the longitude and latitude of the southwest and northeast corners of the source's bounding box in the following order: `[sw.lng, sw.lat, ne.lng, ne.lat]`. When this property is included in a source, no tiles outside of the given bounds are requested by Mapbox GL."},minzoom:{type:"number",default:0,doc:"Minimum zoom level for which tiles are available, as in the TileJSON spec."},maxzoom:{type:"number",default:22,doc:"Maximum zoom level for which tiles are available, as in the TileJSON spec. Data from tiles at the maxzoom are used when displaying the map at higher zoom levels."},tileSize:{type:"number",default:512,units:"pixels",doc:"The minimum visual size to display tiles for this layer. Only configurable for raster layers."},attribution:{type:"string",doc:"Contains an attribution to be displayed when the map is shown to a user."},encoding:{type:"enum",values:{terrarium:{doc:"Terrarium format PNG tiles. See https://aws.amazon.com/es/public-datasets/terrain/ for more info."},mapbox:{doc:"Mapbox Terrain RGB tiles. See https://www.mapbox.com/help/access-elevation-data/#mapbox-terrain-rgb for more info."}},default:"mapbox",doc:"The encoding used by this source. Mapbox Terrain RGB is used by default"},volatile:{type:"boolean",default:!1,doc:"A setting to determine whether a source's tiles are cached locally.","sdk-support":{"basic functionality":{android:"9.3.0",ios:"5.10.0"}}},"*":{type:"*",doc:"Other keys to configure the data source."}},source_geojson:{type:{required:!0,type:"enum",values:{geojson:{doc:"A GeoJSON data source."}},doc:"The data type of the GeoJSON source."},data:{type:"*",doc:"A URL to a GeoJSON file, or inline GeoJSON."},maxzoom:{type:"number",default:18,doc:"Maximum zoom level at which to create vector tiles (higher means greater detail at high zoom levels)."},attribution:{type:"string",doc:"Contains an attribution to be displayed when the map is shown to a user."},buffer:{type:"number",default:128,maximum:512,minimum:0,doc:"Size of the tile buffer on each side. A value of 0 produces no buffer. A value of 512 produces a buffer as wide as the tile itself. Larger values produce fewer rendering artifacts near tile edges and slower performance."},filter:{type:"*",doc:"An expression for filtering features prior to processing them for rendering."},tolerance:{type:"number",default:.375,doc:"Douglas-Peucker simplification tolerance (higher means simpler geometries and faster performance)."},cluster:{type:"boolean",default:!1,doc:"If the data is a collection of point features, setting this to true clusters the points by radius into groups. Cluster groups become new `Point` features in the source with additional properties:\n * `cluster` Is `true` if the point is a cluster \n * `cluster_id` A unqiue id for the cluster to be used in conjunction with the [cluster inspection methods](https://www.mapbox.com/mapbox-gl-js/api/#geojsonsource#getclusterexpansionzoom)\n * `point_count` Number of original points grouped into this cluster\n * `point_count_abbreviated` An abbreviated point count"},clusterRadius:{type:"number",default:50,minimum:0,doc:"Radius of each cluster if clustering is enabled. A value of 512 indicates a radius equal to the width of a tile."},clusterMaxZoom:{type:"number",doc:"Max zoom on which to cluster points if clustering is enabled. Defaults to one zoom less than maxzoom (so that last zoom features are not clustered). Clusters are re-evaluated at integer zoom levels so setting clusterMaxZoom to 14 means the clusters will be displayed until z15."},clusterMinPoints:{type:"number",doc:"Minimum number of points necessary to form a cluster if clustering is enabled. Defaults to `2`."},clusterProperties:{type:"*",doc:'An object defining custom properties on the generated clusters if clustering is enabled, aggregating values from clustered points. Has the form `{"property_name": [operator, map_expression]}`. `operator` is any expression function that accepts at least 2 operands (e.g. `"+"` or `"max"`) — it accumulates the property value from clusters/points the cluster contains; `map_expression` produces the value of a single point.\n\nExample: `{"sum": ["+", ["get", "scalerank"]]}`.\n\nFor more advanced use cases, in place of `operator`, you can use a custom reduce expression that references a special `["accumulated"]` value, e.g.:\n`{"sum": [["+", ["accumulated"], ["get", "sum"]], ["get", "scalerank"]]}`'},lineMetrics:{type:"boolean",default:!1,doc:"Whether to calculate line distance metrics. This is required for line layers that specify `line-gradient` values."},generateId:{type:"boolean",default:!1,doc:"Whether to generate ids for the geojson features. When enabled, the `feature.id` property will be auto assigned based on its index in the `features` array, over-writing any previous values."},promoteId:{type:"promoteId",doc:"A property to use as a feature id (for feature state). Either a property name, or an object of the form `{<sourceLayer>: <propertyName>}`."}},source_video:{type:{required:!0,type:"enum",values:{video:{doc:"A video data source."}},doc:"The data type of the video source."},urls:{required:!0,type:"array",value:"string",doc:"URLs to video content in order of preferred format."},coordinates:{required:!0,doc:"Corners of video specified in longitude, latitude pairs.",type:"array",length:4,value:{type:"array",length:2,value:"number",doc:"A single longitude, latitude pair."}}},source_image:{type:{required:!0,type:"enum",values:{image:{doc:"An image data source."}},doc:"The data type of the image source."},url:{required:!0,type:"string",doc:"URL that points to an image."},coordinates:{required:!0,doc:"Corners of image specified in longitude, latitude pairs.",type:"array",length:4,value:{type:"array",length:2,value:"number",doc:"A single longitude, latitude pair."}}},layer:{id:{type:"string",doc:"Unique layer name.",required:!0},type:{type:"enum",values:{fill:{doc:"A filled polygon with an optional stroked border.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}}},line:{doc:"A stroked line.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}}},symbol:{doc:"An icon or a text label.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}}},circle:{doc:"A filled circle.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}}},heatmap:{doc:"A heatmap.","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},"fill-extrusion":{doc:"An extruded (3D) polygon.","sdk-support":{"basic functionality":{js:"0.27.0",android:"5.1.0",ios:"3.6.0",macos:"0.5.0"}}},raster:{doc:"Raster map textures such as satellite imagery.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}}},hillshade:{doc:"Client-side hillshading visualization based on DEM data. Currently, the implementation only supports Mapbox Terrain RGB and Mapzen Terrarium tiles.","sdk-support":{"basic functionality":{js:"0.43.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},background:{doc:"The background color or pattern of the map.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}}},sky:{doc:"A spherical dome around the map that is always rendered behind all other layers.","sdk-support":{"basic functionality":{js:"2.0.0",ios:"10.0.0",android:"10.0.0"}}}},doc:"Rendering type of this layer.",required:!0},metadata:{type:"*",doc:"Arbitrary properties useful to track with the layer, but do not influence rendering. Properties should be prefixed to avoid collisions, like 'mapbox:'."},source:{type:"string",doc:"Name of a source description to be used for this layer. Required for all layer types except `background`."},"source-layer":{type:"string",doc:"Layer to use from a vector tile source. Required for vector tile sources; prohibited for all other source types, including GeoJSON sources."},minzoom:{type:"number",minimum:0,maximum:24,doc:"The minimum zoom level for the layer. At zoom levels less than the minzoom, the layer will be hidden."},maxzoom:{type:"number",minimum:0,maximum:24,doc:"The maximum zoom level for the layer. At zoom levels equal to or greater than the maxzoom, the layer will be hidden."},filter:{type:"filter",doc:"A expression specifying conditions on source features. Only features that match the filter are displayed. Zoom expressions in filters are only evaluated at integer zoom levels. The `feature-state` expression is not supported in filter expressions."},layout:{type:"layout",doc:"Layout properties for the layer."},paint:{type:"paint",doc:"Default paint properties for this layer."}},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:{doc:"The layer is shown."},none:{doc:"The layer is not shown."}},default:"visible",doc:"Whether this layer is displayed.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},"property-type":"constant"}},layout_sky:{visibility:{type:"enum",values:{visible:{doc:"The layer is shown."},none:{doc:"The layer is not shown."}},default:"visible",doc:"Whether this layer is displayed.","sdk-support":{"basic functionality":{js:"2.0.0",ios:"10.0.0",android:"10.0.0"}},"property-type":"constant"}},layout_fill:{"fill-sort-key":{type:"number",doc:"Sorts features in ascending order based on this value. Features with a higher sort key will appear above features with a lower sort key.","sdk-support":{"basic functionality":{js:"1.2.0",android:"9.1.0",ios:"5.8.0",macos:"0.15.0"},"data-driven styling":{js:"1.2.0",android:"9.1.0",ios:"5.8.0",macos:"0.15.0"}},expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},visibility:{type:"enum",values:{visible:{doc:"The layer is shown."},none:{doc:"The layer is not shown."}},default:"visible",doc:"Whether this layer is displayed.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},"property-type":"constant"}},layout_circle:{"circle-sort-key":{type:"number",doc:"Sorts features in ascending order based on this value. Features with a higher sort key will appear above features with a lower sort key.","sdk-support":{"basic functionality":{js:"1.2.0",android:"9.2.0",ios:"5.9.0",macos:"0.16.0"},"data-driven styling":{js:"1.2.0",android:"9.2.0",ios:"5.9.0",macos:"0.16.0"}},expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},visibility:{type:"enum",values:{visible:{doc:"The layer is shown."},none:{doc:"The layer is not shown."}},default:"visible",doc:"Whether this layer is displayed.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},"property-type":"constant"}},layout_heatmap:{visibility:{type:"enum",values:{visible:{doc:"The layer is shown."},none:{doc:"The layer is not shown."}},default:"visible",doc:"Whether this layer is displayed.","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}},"property-type":"constant"}},"layout_fill-extrusion":{visibility:{type:"enum",values:{visible:{doc:"The layer is shown."},none:{doc:"The layer is not shown."}},default:"visible",doc:"Whether this layer is displayed.","sdk-support":{"basic functionality":{js:"0.27.0",android:"5.1.0",ios:"3.6.0",macos:"0.5.0"}},"property-type":"constant"}},layout_line:{"line-cap":{type:"enum",values:{butt:{doc:"A cap with a squared-off end which is drawn to the exact endpoint of the line."},round:{doc:"A cap with a rounded end which is drawn beyond the endpoint of the line at a radius of one-half of the line's width and centered on the endpoint of the line."},square:{doc:"A cap with a squared-off end which is drawn beyond the endpoint of the line at a distance of one-half of the line's width."}},default:"butt",doc:"The display of line endings.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"2.3.0"}},expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"line-join":{type:"enum",values:{bevel:{doc:"A join with a squared-off end which is drawn beyond the endpoint of the line at a distance of one-half of the line's width."},round:{doc:"A join with a rounded end which is drawn beyond the endpoint of the line at a radius of one-half of the line's width and centered on the endpoint of the line."},miter:{doc:"A join with a sharp, angled corner which is drawn with the outer sides beyond the endpoint of the path until they meet."}},default:"miter",doc:"The display of lines when joining.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.40.0",android:"5.2.0",ios:"3.7.0",macos:"0.6.0"}},expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"line-miter-limit":{type:"number",default:2,doc:"Used to automatically convert miter joins to bevel joins for sharp angles.",requires:[{"line-join":"miter"}],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"line-round-limit":{type:"number",default:1.05,doc:"Used to automatically convert round joins to miter joins for shallow angles.",requires:[{"line-join":"round"}],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"line-sort-key":{type:"number",doc:"Sorts features in ascending order based on this value. Features with a higher sort key will appear above features with a lower sort key.","sdk-support":{"basic functionality":{js:"1.2.0",android:"9.1.0",ios:"5.8.0",macos:"0.15.0"},"data-driven styling":{js:"1.2.0",android:"9.1.0",ios:"5.8.0",macos:"0.15.0"}},expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},visibility:{type:"enum",values:{visible:{doc:"The layer is shown."},none:{doc:"The layer is not shown."}},default:"visible",doc:"Whether this layer is displayed.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},"property-type":"constant"}},layout_symbol:{"symbol-placement":{type:"enum",values:{point:{doc:"The label is placed at the point where the geometry is located."},line:{doc:"The label is placed along the line of the geometry. Can only be used on `LineString` and `Polygon` geometries."},"line-center":{doc:"The label is placed at the center of the line of the geometry. Can only be used on `LineString` and `Polygon` geometries. Note that a single feature in a vector tile may contain multiple line geometries."}},default:"point",doc:"Label placement relative to its geometry.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"`line-center` value":{js:"0.47.0",android:"6.4.0",ios:"4.3.0",macos:"0.10.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"symbol-spacing":{type:"number",default:250,minimum:1,units:"pixels",doc:"Distance between two symbol anchors.",requires:[{"symbol-placement":"line"}],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"symbol-avoid-edges":{type:"boolean",default:!1,doc:"If true, the symbols will not cross tile edges to avoid mutual collisions. Recommended in layers that don't have enough padding in the vector tile to prevent collisions, or if it is a point symbol layer placed after a line symbol layer. When using a client that supports global collision detection, like Mapbox GL JS version 0.42.0 or greater, enabling this property is not needed to prevent clipped labels at tile boundaries.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"symbol-sort-key":{type:"number",doc:"Sorts features in ascending order based on this value. Features with lower sort keys are drawn and placed first. When `icon-allow-overlap` or `text-allow-overlap` is `false`, features with a lower sort key will have priority during placement. When `icon-allow-overlap` or `text-allow-overlap` is set to `true`, features with a higher sort key will overlap over features with a lower sort key.","sdk-support":{"basic functionality":{js:"0.53.0",android:"7.4.0",ios:"4.11.0",macos:"0.14.0"},"data-driven styling":{js:"0.53.0",android:"7.4.0",ios:"4.11.0",macos:"0.14.0"}},expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"symbol-z-order":{type:"enum",values:{auto:{doc:"Sorts symbols by `symbol-sort-key` if set. Otherwise, sorts symbols by their y-position relative to the viewport if `icon-allow-overlap` or `text-allow-overlap` is set to `true` or `icon-ignore-placement` or `text-ignore-placement` is `false`."},"viewport-y":{doc:"Sorts symbols by their y-position relative to the viewport if `icon-allow-overlap` or `text-allow-overlap` is set to `true` or `icon-ignore-placement` or `text-ignore-placement` is `false`."},source:{doc:"Sorts symbols by `symbol-sort-key` if set. Otherwise, no sorting is applied; symbols are rendered in the same order as the source data."}},default:"auto",doc:"Determines whether overlapping symbols in the same layer are rendered in the order that they appear in the data source or by their y-position relative to the viewport. To control the order and prioritization of symbols otherwise, use `symbol-sort-key`.","sdk-support":{"basic functionality":{js:"0.49.0",android:"6.6.0",ios:"4.5.0",macos:"0.12.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-allow-overlap":{type:"boolean",default:!1,doc:"If true, the icon will be visible even if it collides with other previously drawn symbols.",requires:["icon-image"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-ignore-placement":{type:"boolean",default:!1,doc:"If true, other symbols can be visible even if they collide with the icon.",requires:["icon-image"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-optional":{type:"boolean",default:!1,doc:"If true, text will display without their corresponding icons when the icon collides with other symbols and the text does not.",requires:["icon-image","text-field"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-rotation-alignment":{type:"enum",values:{map:{doc:"When `symbol-placement` is set to `point`, aligns icons east-west. When `symbol-placement` is set to `line` or `line-center`, aligns icon x-axes with the line."},viewport:{doc:"Produces icons whose x-axes are aligned with the x-axis of the viewport, regardless of the value of `symbol-placement`."},auto:{doc:"When `symbol-placement` is set to `point`, this is equivalent to `viewport`. When `symbol-placement` is set to `line` or `line-center`, this is equivalent to `map`."}},default:"auto",doc:"In combination with `symbol-placement`, determines the rotation behavior of icons.",requires:["icon-image"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"`auto` value":{js:"0.25.0",android:"4.2.0",ios:"3.4.0",macos:"0.3.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-size":{type:"number",default:1,minimum:0,units:"factor of the original icon size",doc:"Scales the original size of the icon by the provided factor. The new pixel size of the image will be the original pixel size multiplied by `icon-size`. 1 is the original size; 3 triples the size of the image.",requires:["icon-image"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.35.0",android:"5.1.0",ios:"3.6.0",macos:"0.5.0"}},expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-text-fit":{type:"enum",values:{none:{doc:"The icon is displayed at its intrinsic aspect ratio."},width:{doc:"The icon is scaled in the x-dimension to fit the width of the text."},height:{doc:"The icon is scaled in the y-dimension to fit the height of the text."},both:{doc:"The icon is scaled in both x- and y-dimensions."}},default:"none",doc:"Scales the icon to fit around the associated text.",requires:["icon-image","text-field"],"sdk-support":{"basic functionality":{js:"0.21.0",android:"4.2.0",ios:"3.4.0",macos:"0.2.1"},"stretchable icons":{js:"1.6.0",android:"9.2.0",ios:"5.8.0",macos:"0.15.0"}},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",doc:"Size of the additional area added to dimensions determined by `icon-text-fit`, in clockwise order: top, right, bottom, left.",requires:["icon-image","text-field",{"icon-text-fit":["both","width","height"]}],"sdk-support":{"basic functionality":{js:"0.21.0",android:"4.2.0",ios:"3.4.0",macos:"0.2.1"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"icon-image":{type:"resolvedImage",doc:"Name of image in sprite to use for drawing an image background.",tokens:!0,"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.35.0",android:"5.1.0",ios:"3.6.0",macos:"0.5.0"}},expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-rotate":{type:"number",default:0,period:360,units:"degrees",doc:"Rotates the icon clockwise.",requires:["icon-image"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.21.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-padding":{type:"number",default:2,minimum:0,units:"pixels",doc:"Size of the additional area around the icon bounding box used for detecting symbol collisions.",requires:["icon-image"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"icon-keep-upright":{type:"boolean",default:!1,doc:"If true, the icon may be flipped to prevent it from being rendered upside-down.",requires:["icon-image",{"icon-rotation-alignment":"map"},{"symbol-placement":["line","line-center"]}],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-offset":{type:"array",value:"number",length:2,default:[0,0],doc:"Offset distance of icon from its anchor. Positive values indicate right and down, while negative values indicate left and up. Each component is multiplied by the value of `icon-size` to obtain the final offset in pixels. When combined with `icon-rotate` the offset will be as if the rotated direction was up.",requires:["icon-image"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.29.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-anchor":{type:"enum",values:{center:{doc:"The center of the icon is placed closest to the anchor."},left:{doc:"The left side of the icon is placed closest to the anchor."},right:{doc:"The right side of the icon is placed closest to the anchor."},top:{doc:"The top of the icon is placed closest to the anchor."},bottom:{doc:"The bottom of the icon is placed closest to the anchor."},"top-left":{doc:"The top left corner of the icon is placed closest to the anchor."},"top-right":{doc:"The top right corner of the icon is placed closest to the anchor."},"bottom-left":{doc:"The bottom left corner of the icon is placed closest to the anchor."},"bottom-right":{doc:"The bottom right corner of the icon is placed closest to the anchor."}},default:"center",doc:"Part of the icon placed closest to the anchor.",requires:["icon-image"],"sdk-support":{"basic functionality":{js:"0.40.0",android:"5.2.0",ios:"3.7.0",macos:"0.6.0"},"data-driven styling":{js:"0.40.0",android:"5.2.0",ios:"3.7.0",macos:"0.6.0"}},expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-pitch-alignment":{type:"enum",values:{map:{doc:"The icon is aligned to the plane of the map."},viewport:{doc:"The icon is aligned to the plane of the viewport."},auto:{doc:"Automatically matches the value of `icon-rotation-alignment`."}},default:"auto",doc:"Orientation of icon when map is pitched.",requires:["icon-image"],"sdk-support":{"basic functionality":{js:"0.39.0",android:"5.2.0",ios:"3.7.0",macos:"0.6.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-pitch-alignment":{type:"enum",values:{map:{doc:"The text is aligned to the plane of the map."},viewport:{doc:"The text is aligned to the plane of the viewport."},auto:{doc:"Automatically matches the value of `text-rotation-alignment`."}},default:"auto",doc:"Orientation of text when map is pitched.",requires:["text-field"],"sdk-support":{"basic functionality":{js:"0.21.0",android:"4.2.0",ios:"3.4.0",macos:"0.2.1"},"`auto` value":{js:"0.25.0",android:"4.2.0",ios:"3.4.0",macos:"0.3.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-rotation-alignment":{type:"enum",values:{map:{doc:"When `symbol-placement` is set to `point`, aligns text east-west. When `symbol-placement` is set to `line` or `line-center`, aligns text x-axes with the line."},viewport:{doc:"Produces glyphs whose x-axes are aligned with the x-axis of the viewport, regardless of the value of `symbol-placement`."},auto:{doc:"When `symbol-placement` is set to `point`, this is equivalent to `viewport`. When `symbol-placement` is set to `line` or `line-center`, this is equivalent to `map`."}},default:"auto",doc:"In combination with `symbol-placement`, determines the rotation behavior of the individual glyphs forming the text.",requires:["text-field"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"`auto` value":{js:"0.25.0",android:"4.2.0",ios:"3.4.0",macos:"0.3.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-field":{type:"formatted",default:"",tokens:!0,doc:"Value to use for a text label. If a plain `string` is provided, it will be treated as a `formatted` with default/inherited formatting options.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.33.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.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"],doc:"Font stack to use for displaying text.",requires:["text-field"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.43.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}},expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-size":{type:"number",default:16,minimum:0,units:"pixels",doc:"Font size.",requires:["text-field"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.35.0",android:"5.1.0",ios:"3.6.0",macos:"0.5.0"}},expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-max-width":{type:"number",default:10,minimum:0,units:"ems",doc:"The maximum line width for text wrapping.",requires:["text-field",{"symbol-placement":["point"]}],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.40.0",android:"5.2.0",ios:"3.7.0",macos:"0.6.0"}},expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-line-height":{type:"number",default:1.2,units:"ems",doc:"Text leading value for multi-line text.",requires:["text-field"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"2.3.0"}},expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-letter-spacing":{type:"number",default:0,units:"ems",doc:"Text tracking amount.",requires:["text-field"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.40.0",android:"5.2.0",ios:"3.7.0",macos:"0.6.0"}},expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-justify":{type:"enum",values:{auto:{doc:"The text is aligned towards the anchor position."},left:{doc:"The text is aligned to the left."},center:{doc:"The text is centered."},right:{doc:"The text is aligned to the right."}},default:"center",doc:"Text justification options.",requires:["text-field"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.39.0",android:"5.2.0",ios:"3.7.0",macos:"0.6.0"},auto:{js:"0.54.0",android:"7.4.0",ios:"4.10.0",macos:"0.14.0"}},expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-radial-offset":{type:"number",units:"ems",default:0,doc:"Radial offset of text, in the direction of the symbol's anchor. Useful in combination with `text-variable-anchor`, which defaults to using the two-dimensional `text-offset` if present.","sdk-support":{"basic functionality":{js:"0.54.0",android:"7.4.0",ios:"4.10.0",macos:"0.14.0"},"data-driven styling":{js:"0.54.0",android:"7.4.0",ios:"4.10.0",macos:"0.14.0"}},requires:["text-field"],"property-type":"data-driven",expression:{interpolated:!0,parameters:["zoom","feature"]}},"text-variable-anchor":{type:"array",value:"enum",values:{center:{doc:"The center of the text is placed closest to the anchor."},left:{doc:"The left side of the text is placed closest to the anchor."},right:{doc:"The right side of the text is placed closest to the anchor."},top:{doc:"The top of the text is placed closest to the anchor."},bottom:{doc:"The bottom of the text is placed closest to the anchor."},"top-left":{doc:"The top left corner of the text is placed closest to the anchor."},"top-right":{doc:"The top right corner of the text is placed closest to the anchor."},"bottom-left":{doc:"The bottom left corner of the text is placed closest to the anchor."},"bottom-right":{doc:"The bottom right corner of the text is placed closest to the anchor."}},requires:["text-field",{"symbol-placement":["point"]}],doc:"To increase the chance of placing high-priority labels on the map, you can provide an array of `text-anchor` locations: the renderer will attempt to place the label at each location, in order, before moving onto the next label. Use `text-justify: auto` to choose justification based on anchor position. To apply an offset, use the `text-radial-offset` or the two-dimensional `text-offset`.","sdk-support":{"basic functionality":{js:"0.54.0",android:"7.4.0",ios:"4.10.0",macos:"0.14.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-anchor":{type:"enum",values:{center:{doc:"The center of the text is placed closest to the anchor."},left:{doc:"The left side of the text is placed closest to the anchor."},right:{doc:"The right side of the text is placed closest to the anchor."},top:{doc:"The top of the text is placed closest to the anchor."},bottom:{doc:"The bottom of the text is placed closest to the anchor."},"top-left":{doc:"The top left corner of the text is placed closest to the anchor."},"top-right":{doc:"The top right corner of the text is placed closest to the anchor."},"bottom-left":{doc:"The bottom left corner of the text is placed closest to the anchor."},"bottom-right":{doc:"The bottom right corner of the text is placed closest to the anchor."}},default:"center",doc:"Part of the text placed closest to the anchor.",requires:["text-field",{"!":"text-variable-anchor"}],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.39.0",android:"5.2.0",ios:"3.7.0",macos:"0.6.0"}},expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-max-angle":{type:"number",default:45,units:"degrees",doc:"Maximum angle change between adjacent characters.",requires:["text-field",{"symbol-placement":["line","line-center"]}],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-writing-mode":{type:"array",value:"enum",values:{horizontal:{doc:"If a text's language supports horizontal writing mode, symbols would be laid out horizontally."},vertical:{doc:"If a text's language supports vertical writing mode, symbols would be laid out vertically."}},doc:"The property allows control over a symbol's orientation. Note that the property values act as a hint, so that a symbol whose language doesn’t support the provided orientation will be laid out in its natural orientation. Example: English point symbol will be rendered horizontally even if array value contains single 'vertical' enum value. For symbol with point placement, the order of elements in an array define priority order for the placement of an orientation variant. For symbol with line placement, the default text writing mode is either ['horizontal', 'vertical'] or ['vertical', 'horizontal'], the order doesn't affect the placement.",requires:["text-field"],"sdk-support":{"basic functionality":{js:"1.3.0",android:"8.3.0",ios:"5.3.0",macos:"0.15.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-rotate":{type:"number",default:0,period:360,units:"degrees",doc:"Rotates the text clockwise.",requires:["text-field"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.35.0",android:"5.1.0",ios:"3.6.0",macos:"0.5.0"}},expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-padding":{type:"number",default:2,minimum:0,units:"pixels",doc:"Size of the additional area around the text bounding box used for detecting symbol collisions.",requires:["text-field"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-keep-upright":{type:"boolean",default:!0,doc:"If true, the text may be flipped vertically to prevent it from being rendered upside-down.",requires:["text-field",{"text-rotation-alignment":"map"},{"symbol-placement":["line","line-center"]}],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-transform":{type:"enum",values:{none:{doc:"The text is not altered."},uppercase:{doc:"Forces all letters to be displayed in uppercase."},lowercase:{doc:"Forces all letters to be displayed in lowercase."}},default:"none",doc:"Specifies how to capitalize text, similar to the CSS `text-transform` property.",requires:["text-field"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.33.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-offset":{type:"array",doc:"Offset distance of text from its anchor. Positive values indicate right and down, while negative values indicate left and up. If used with text-variable-anchor, input values will be taken as absolute values. Offsets along the x- and y-axis will be applied automatically based on the anchor position.",value:"number",units:"ems",length:2,default:[0,0],requires:["text-field",{"!":"text-radial-offset"}],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.35.0",android:"5.1.0",ios:"3.6.0",macos:"0.5.0"}},expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-allow-overlap":{type:"boolean",default:!1,doc:"If true, the text will be visible even if it collides with other previously drawn symbols.",requires:["text-field"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-ignore-placement":{type:"boolean",default:!1,doc:"If true, other symbols can be visible even if they collide with the text.",requires:["text-field"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-optional":{type:"boolean",default:!1,doc:"If true, icons will display without their corresponding text when the text collides with other symbols and the icon does not.",requires:["text-field","icon-image"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},visibility:{type:"enum",values:{visible:{doc:"The layer is shown."},none:{doc:"The layer is not shown."}},default:"visible",doc:"Whether this layer is displayed.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},"property-type":"constant"}},layout_raster:{visibility:{type:"enum",values:{visible:{doc:"The layer is shown."},none:{doc:"The layer is not shown."}},default:"visible",doc:"Whether this layer is displayed.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},"property-type":"constant"}},layout_hillshade:{visibility:{type:"enum",values:{visible:{doc:"The layer is shown."},none:{doc:"The layer is not shown."}},default:"visible",doc:"Whether this layer is displayed.","sdk-support":{"basic functionality":{js:"0.43.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}},"property-type":"constant"}},filter:{type:"array",value:"*",doc:"A filter selects specific features from a layer."},filter_operator:{type:"enum",values:{"==":{doc:'`["==", key, value]` equality: `feature[key] = value`'},"!=":{doc:'`["!=", key, value]` inequality: `feature[key] ≠ value`'},">":{doc:'`[">", key, value]` greater than: `feature[key] > value`'},">=":{doc:'`[">=", key, value]` greater than or equal: `feature[key] ≥ value`'},"<":{doc:'`["<", key, value]` less than: `feature[key] < value`'},"<=":{doc:'`["<=", key, value]` less than or equal: `feature[key] ≤ value`'},in:{doc:'`["in", key, v0, ..., vn]` set inclusion: `feature[key] ∈ {v0, ..., vn}`'},"!in":{doc:'`["!in", key, v0, ..., vn]` set exclusion: `feature[key] ∉ {v0, ..., vn}`'},all:{doc:'`["all", f0, ..., fn]` logical `AND`: `f0 ∧ ... ∧ fn`'},any:{doc:'`["any", f0, ..., fn]` logical `OR`: `f0 ∨ ... ∨ fn`'},none:{doc:'`["none", f0, ..., fn]` logical `NOR`: `¬f0 ∧ ... ∧ ¬fn`'},has:{doc:'`["has", key]` `feature[key]` exists'},"!has":{doc:'`["!has", key]` `feature[key]` does not exist'},within:{doc:'`["within", object]` feature geometry is within object geometry'}},doc:"The filter operator."},geometry_type:{type:"enum",values:{Point:{doc:"Filter to point geometries."},LineString:{doc:"Filter to line geometries."},Polygon:{doc:"Filter to polygon geometries."}},doc:"The geometry type for the filter to select."},function:{expression:{type:"expression",doc:"An expression."},stops:{type:"array",doc:"An array of stops.",value:"function_stop"},base:{type:"number",default:1,minimum:0,doc:"The exponential base of the interpolation curve. It controls the rate at which the result increases. Higher values make the result increase more towards the high end of the range. With `1` the stops are interpolated linearly."},property:{type:"string",doc:"The name of a feature property to use as the function input.",default:"$zoom"},type:{type:"enum",values:{identity:{doc:"Return the input value as the output value."},exponential:{doc:"Generate an output by interpolating between stops just less than and just greater than the function input."},interval:{doc:"Return the output value of the stop just less than the function input."},categorical:{doc:"Return the output value of the stop equal to the function input."}},doc:"The interpolation strategy to use in function evaluation.",default:"exponential"},colorSpace:{type:"enum",values:{rgb:{doc:"Use the RGB color space to interpolate color values"},lab:{doc:"Use the LAB color space to interpolate color values."},hcl:{doc:"Use the HCL color space to interpolate color values, interpolating the Hue, Chroma, and Luminance channels individually."}},doc:"The color space in which colors interpolated. Interpolating colors in perceptual color spaces like LAB and HCL tend to produce color ramps that look more consistent and produce colors that can be differentiated more easily than those interpolated in RGB space.",default:"rgb"},default:{type:"*",required:!1,doc:"A value to serve as a fallback function result when a value isn't otherwise available. It is used in the following circumstances:\n* In categorical functions, when the feature value does not match any of the stop domain values.\n* In property and zoom-and-property functions, when a feature does not contain a value for the specified property.\n* In identity functions, when the feature value is not valid for the style property (for example, if the function is being used for a `circle-color` property but the feature property value is not a string or not a valid color).\n* In interval or exponential property and zoom-and-property functions, when the feature value is not numeric.\nIf no default is provided, the style property's default is used in these circumstances."}},function_stop:{type:"array",minimum:0,maximum:24,value:["number","color"],length:2,doc:"Zoom level and value pair."},expression:{type:"array",value:"*",minimum:1,doc:"An expression defines a function that can be used for data-driven style properties or feature filters."},expression_name:{doc:"",type:"enum",values:{let:{doc:'Binds expressions to named variables, which can then be referenced in the result expression using ["var", "variable_name"].',group:"Variable binding","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},var:{doc:'References variable bound using "let".',group:"Variable binding","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},literal:{doc:"Provides a literal array or object value.",group:"Types","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},array:{doc:"Asserts that the input is an array (optionally with a specific item type and length). If, when the input expression is evaluated, it is not of the asserted type, then this assertion will cause the whole expression to be aborted.",group:"Types","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},at:{doc:"Retrieves an item from an array.",group:"Lookup","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},in:{doc:"Determines whether an item exists in an array or a substring exists in a string. In the specific case when the second and third arguments are string literals, you must wrap at least one of them in a [`literal`](#types-literal) expression to hint correct interpretation to the [type system](#type-system).",group:"Lookup","sdk-support":{"basic functionality":{js:"1.6.0",android:"9.1.0",ios:"5.8.0",macos:"0.15.0"}}},"index-of":{doc:"Returns the first position at which an item can be found in an array or a substring can be found in a string, or `-1` if the input cannot be found. Accepts an optional index from where to begin the search.",group:"Lookup","sdk-support":{"basic functionality":{js:"1.10.0"}}},slice:{doc:"Returns an item from an array or a substring from a string from a specified start index, or between a start index and an end index if set. The return value is inclusive of the start index but not of the end index.",group:"Lookup","sdk-support":{"basic functionality":{js:"1.10.0"}}},case:{doc:"Selects the first output whose corresponding test condition evaluates to true, or the fallback value otherwise.",group:"Decision","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},match:{doc:'Selects the output for which the label value matches the input value, or the fallback value if no match is found. The input can be any expression (for example, `["get", "building_type"]`). Each label must be unique, and must be either:\n - a single literal value; or\n - an array of literal values, the values of which must be all strings or all numbers (for example `[100, 101]` or `["c", "b"]`).\n\nThe input matches if any of the values in the array matches using strict equality, similar to the `"in"` operator.\nIf the input type does not match the type of the labels, the result will be the fallback value.',group:"Decision","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},coalesce:{doc:"Evaluates each expression in turn until the first non-null value is obtained, and returns that value.",group:"Decision","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},step:{doc:'Produces discrete, stepped results by evaluating a piecewise-constant function defined by pairs of input and output values ("stops"). The `input` may be any numeric expression (e.g., `["get", "population"]`). Stop inputs must be numeric literals in strictly ascending order. Returns the output value of the stop just less than the input, or the first output if the input is less than the first stop.',group:"Ramps, scales, curves","sdk-support":{"basic functionality":{js:"0.42.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},interpolate:{doc:'Produces continuous, smooth results by interpolating between pairs of input and output values ("stops"). The `input` may be any numeric expression (e.g., `["get", "population"]`). Stop inputs must be numeric literals in strictly ascending order. The output type must be `number`, `array<number>`, or `color`.\n\nInterpolation types:\n- `["linear"]`: Interpolates linearly between the pair of stops just less than and just greater than the input.\n- `["exponential", base]`: Interpolates exponentially between the stops just less than and just greater than the input. `base` controls the rate at which the output increases: higher values make the output increase more towards the high end of the range. With values close to 1 the output increases linearly.\n- `["cubic-bezier", x1, y1, x2, y2]`: Interpolates using the cubic bezier curve defined by the given control points.',group:"Ramps, scales, curves","sdk-support":{"basic functionality":{js:"0.42.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},"interpolate-hcl":{doc:'Produces continuous, smooth results by interpolating between pairs of input and output values ("stops"). Works like `interpolate`, but the output type must be `color`, and the interpolation is performed in the Hue-Chroma-Luminance color space.',group:"Ramps, scales, curves","sdk-support":{"basic functionality":{js:"0.49.0"}}},"interpolate-lab":{doc:'Produces continuous, smooth results by interpolating between pairs of input and output values ("stops"). Works like `interpolate`, but the output type must be `color`, and the interpolation is performed in the CIELAB color space.',group:"Ramps, scales, curves","sdk-support":{"basic functionality":{js:"0.49.0"}}},ln2:{doc:"Returns mathematical constant ln(2).",group:"Math","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},pi:{doc:"Returns the mathematical constant pi.",group:"Math","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},e:{doc:"Returns the mathematical constant e.",group:"Math","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},typeof:{doc:"Returns a string describing the type of the given value.",group:"Types","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},string:{doc:"Asserts that the input value is a string. If multiple values are provided, each one is evaluated in order until a string is obtained. If none of the inputs are strings, the expression is an error.",group:"Types","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},number:{doc:"Asserts that the input value is a number. If multiple values are provided, each one is evaluated in order until a number is obtained. If none of the inputs are numbers, the expression is an error.",group:"Types","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},boolean:{doc:"Asserts that the input value is a boolean. If multiple values are provided, each one is evaluated in order until a boolean is obtained. If none of the inputs are booleans, the expression is an error.",group:"Types","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},object:{doc:"Asserts that the input value is an object. If multiple values are provided, each one is evaluated in order until an object is obtained. If none of the inputs are objects, the expression is an error.",group:"Types","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},collator:{doc:"Returns a `collator` for use in locale-dependent comparison operations. The `case-sensitive` and `diacritic-sensitive` options default to `false`. The `locale` argument specifies the IETF language tag of the locale to use. If none is provided, the default locale is used. If the requested locale is not available, the `collator` will use a system-defined fallback locale. Use `resolved-locale` to test the results of locale fallback behavior.",group:"Types","sdk-support":{"basic functionality":{js:"0.45.0",android:"6.5.0",ios:"4.2.0",macos:"0.9.0"}}},format:{doc:'Returns a `formatted` string for displaying mixed-format text in the `text-field` property. The input may contain a string literal or expression, including an [`\'image\'`](#types-image) expression. Strings may be followed by a style override object that supports the following properties:\n- `"text-font"`: Overrides the font stack specified by the root layout property.\n- `"text-color"`: Overrides the color specified by the root paint property.\n- `"font-scale"`: Applies a scaling factor on `text-size` as specified by the root layout property.',group:"Types","sdk-support":{"basic functionality":{js:"0.48.0",android:"6.7.0",ios:"4.6.0",macos:"0.12.0"},"text-font":{js:"0.48.0",android:"6.7.0",ios:"4.6.0",macos:"0.12.0"},"font-scale":{js:"0.48.0",android:"6.7.0",ios:"4.6.0",macos:"0.12.0"},"text-color":{js:"1.3.0",android:"7.3.0",ios:"4.10.0",macos:"0.14.0"},image:{js:"1.6.0",android:"8.6.0",ios:"5.7.0",macos:"0.15.0"}}},image:{doc:"Returns an `image` type for use in `icon-image`, `*-pattern` entries and as a section in the `format` expression. If set, the `image` argument will check that the requested image exists in the style and will return either the resolved image name or `null`, depending on whether or not the image is currently in the style. This validation process is synchronous and requires the image to have been added to the style before requesting it in the `image` argument.",group:"Types","sdk-support":{"basic functionality":{js:"1.4.0",android:"8.6.0",ios:"5.7.0",macos:"0.15.0"}}},"number-format":{doc:"Converts the input number into a string representation using the providing formatting rules. If set, the `locale` argument specifies the locale to use, as a BCP 47 language tag. If set, the `currency` argument specifies an ISO 4217 code to use for currency-style formatting. If set, the `min-fraction-digits` and `max-fraction-digits` arguments specify the minimum and maximum number of fractional digits to include.",group:"Types","sdk-support":{"basic functionality":{js:"0.54.0",android:"8.4.0",ios:"5.4.0",macos:"0.15.0"}}},"to-string":{doc:'Converts the input value to a string. If the input is `null`, the result is `""`. If the input is a boolean, the result is `"true"` or `"false"`. If the input is a number, it is converted to a string as specified by the ["NumberToString" algorithm](https://tc39.github.io/ecma262/#sec-tostring-applied-to-the-number-type) of the ECMAScript Language Specification. If the input is a color, it is converted to a string of the form `"rgba(r,g,b,a)"`, where `r`, `g`, and `b` are numerals ranging from 0 to 255, and `a` ranges from 0 to 1. Otherwise, the input is converted to a string in the format specified by the [`JSON.stringify`](https://tc39.github.io/ecma262/#sec-json.stringify) function of the ECMAScript Language Specification.',group:"Types","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},"to-number":{doc:'Converts the input value to a number, if possible. If the input is `null` or `false`, the result is 0. If the input is `true`, the result is 1. If the input is a string, it is converted to a number as specified by the ["ToNumber Applied to the String Type" algorithm](https://tc39.github.io/ecma262/#sec-tonumber-applied-to-the-string-type) of the ECMAScript Language Specification. If multiple values are provided, each one is evaluated in order until the first successful conversion is obtained. If none of the inputs can be converted, the expression is an error.',group:"Types","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},"to-boolean":{doc:"Converts the input value to a boolean. The result is `false` when then input is an empty string, 0, `false`, `null`, or `NaN`; otherwise it is `true`.",group:"Types","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},"to-rgba":{doc:"Returns a four-element array containing the input color's red, green, blue, and alpha components, in that order.",group:"Color","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},"to-color":{doc:"Converts the input value to a color. If multiple values are provided, each one is evaluated in order until the first successful conversion is obtained. If none of the inputs can be converted, the expression is an error.",group:"Types","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},rgb:{doc:"Creates a color value from red, green, and blue components, which must range between 0 and 255, and an alpha component of 1. If any component is out of range, the expression is an error.",group:"Color","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},rgba:{doc:"Creates a color value from red, green, blue components, which must range between 0 and 255, and an alpha component which must range between 0 and 1. If any component is out of range, the expression is an error.",group:"Color","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},get:{doc:"Retrieves a property value from the current feature's properties, or from another object if a second argument is provided. Returns null if the requested property is missing.",group:"Lookup","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},has:{doc:"Tests for the presence of an property value in the current feature's properties, or from another object if a second argument is provided.",group:"Lookup","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},length:{doc:"Gets the length of an array or string.",group:"Lookup","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},properties:{doc:'Gets the feature properties object. Note that in some cases, it may be more efficient to use ["get", "property_name"] directly.',group:"Feature data","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},"feature-state":{doc:"Retrieves a property value from the current feature's state. Returns null if the requested property is not present on the feature's state. A feature's state is not part of the GeoJSON or vector tile data, and must be set programmatically on each feature. Features are identified by their `id` attribute, which must be an integer or a string that can be cast to an integer. Note that [\"feature-state\"] can only be used with paint properties that support data-driven styling.",group:"Feature data","sdk-support":{"basic functionality":{js:"0.46.0"}}},"geometry-type":{doc:"Gets the feature's geometry type: `Point`, `MultiPoint`, `LineString`, `MultiLineString`, `Polygon`, `MultiPolygon`. `Multi*` feature types are only returned in GeoJSON sources. When working with vector tile sources, use the singular forms.",group:"Feature data","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},id:{doc:"Gets the feature's id, if it has one.",group:"Feature data","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},zoom:{doc:'Gets the current zoom level. Note that in style layout and paint properties, ["zoom"] may only appear as the input to a top-level "step" or "interpolate" expression.',group:"Zoom","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},"heatmap-density":{doc:"Gets the kernel density estimation of a pixel in a heatmap layer, which is a relative measure of how many data points are crowded around a particular pixel. Can only be used in the `heatmap-color` property.",group:"Heatmap","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},"line-progress":{doc:"Gets the progress along a gradient line. Can only be used in the `line-gradient` property.",group:"Feature data","sdk-support":{"basic functionality":{js:"0.45.0",android:"6.5.0",ios:"4.6.0",macos:"0.12.0"}}},"sky-radial-progress":{doc:"Gets the distance of a point on the sky from the sun position. Returns 0 at sun position and 1 when the distance reaches `sky-gradient-radius`. Can only be used in the `sky-gradient` property.",group:"sky","sdk-support":{"basic functionality":{js:"2.0.0",ios:"10.0.0",android:"10.0.0"}}},accumulated:{doc:"Gets the value of a cluster property accumulated so far. Can only be used in the `clusterProperties` option of a clustered GeoJSON source.",group:"Feature data","sdk-support":{"basic functionality":{js:"0.53.0",android:"8.4.0",ios:"5.5.0",macos:"0.15.0"}}},"+":{doc:"Returns the sum of the inputs.",group:"Math","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},"*":{doc:"Returns the product of the inputs.",group:"Math","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},"-":{doc:"For two inputs, returns the result of subtracting the second input from the first. For a single input, returns the result of subtracting it from 0.",group:"Math","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},"/":{doc:"Returns the result of floating point division of the first input by the second.",group:"Math","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},"%":{doc:"Returns the remainder after integer division of the first input by the second.",group:"Math","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},"^":{doc:"Returns the result of raising the first input to the power specified by the second.",group:"Math","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},sqrt:{doc:"Returns the square root of the input.",group:"Math","sdk-support":{"basic functionality":{js:"0.42.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},log10:{doc:"Returns the base-ten logarithm of the input.",group:"Math","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},ln:{doc:"Returns the natural logarithm of the input.",group:"Math","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},log2:{doc:"Returns the base-two logarithm of the input.",group:"Math","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},sin:{doc:"Returns the sine of the input.",group:"Math","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},cos:{doc:"Returns the cosine of the input.",group:"Math","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},tan:{doc:"Returns the tangent of the input.",group:"Math","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},asin:{doc:"Returns the arcsine of the input.",group:"Math","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},acos:{doc:"Returns the arccosine of the input.",group:"Math","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},atan:{doc:"Returns the arctangent of the input.",group:"Math","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},min:{doc:"Returns the minimum value of the inputs.",group:"Math","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},max:{doc:"Returns the maximum value of the inputs.",group:"Math","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},round:{doc:'Rounds the input to the nearest integer. Halfway values are rounded away from zero. For example, `["round", -1.5]` evaluates to -2.',group:"Math","sdk-support":{"basic functionality":{js:"0.45.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},abs:{doc:"Returns the absolute value of the input.",group:"Math","sdk-support":{"basic functionality":{js:"0.45.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},ceil:{doc:"Returns the smallest integer that is greater than or equal to the input.",group:"Math","sdk-support":{"basic functionality":{js:"0.45.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},floor:{doc:"Returns the largest integer that is less than or equal to the input.",group:"Math","sdk-support":{"basic functionality":{js:"0.45.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},distance:{doc:"Returns the shortest distance in meters between the evaluated feature and the input geometry. The input value can be a valid GeoJSON of type `Point`, `MultiPoint`, `LineString`, `MultiLineString`, `Polygon`, `MultiPolygon`, `Feature`, or `FeatureCollection`. Distance values returned may vary in precision due to loss in precision from encoding geometries, particularly below zoom level 13.",group:"Math","sdk-support":{"basic functionality":{android:"9.2.0",ios:"5.9.0",macos:"0.16.0"}}},"==":{doc:"Returns `true` if the input values are equal, `false` otherwise. The comparison is strictly typed: values of different runtime types are always considered unequal. Cases where the types are known to be different at parse time are considered invalid and will produce a parse error. Accepts an optional `collator` argument to control locale-dependent string comparisons.",group:"Decision","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"},collator:{js:"0.45.0",android:"6.5.0",ios:"4.2.0",macos:"0.9.0"}}},"!=":{doc:"Returns `true` if the input values are not equal, `false` otherwise. The comparison is strictly typed: values of different runtime types are always considered unequal. Cases where the types are known to be different at parse time are considered invalid and will produce a parse error. Accepts an optional `collator` argument to control locale-dependent string comparisons.",group:"Decision","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"},collator:{js:"0.45.0",android:"6.5.0",ios:"4.2.0",macos:"0.9.0"}}},">":{doc:"Returns `true` if the first input is strictly greater than the second, `false` otherwise. The arguments are required to be either both strings or both numbers; if during evaluation they are not, expression evaluation produces an error. Cases where this constraint is known not to hold at parse time are considered in valid and will produce a parse error. Accepts an optional `collator` argument to control locale-dependent string comparisons.",group:"Decision","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"},collator:{js:"0.45.0",android:"6.5.0",ios:"4.2.0",macos:"0.9.0"}}},"<":{doc:"Returns `true` if the first input is strictly less than the second, `false` otherwise. The arguments are required to be either both strings or both numbers; if during evaluation they are not, expression evaluation produces an error. Cases where this constraint is known not to hold at parse time are considered in valid and will produce a parse error. Accepts an optional `collator` argument to control locale-dependent string comparisons.",group:"Decision","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"},collator:{js:"0.45.0",android:"6.5.0",ios:"4.2.0",macos:"0.9.0"}}},">=":{doc:"Returns `true` if the first input is greater than or equal to the second, `false` otherwise. The arguments are required to be either both strings or both numbers; if during evaluation they are not, expression evaluation produces an error. Cases where this constraint is known not to hold at parse time are considered in valid and will produce a parse error. Accepts an optional `collator` argument to control locale-dependent string comparisons.",group:"Decision","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"},collator:{js:"0.45.0",android:"6.5.0",ios:"4.2.0",macos:"0.9.0"}}},"<=":{doc:"Returns `true` if the first input is less than or equal to the second, `false` otherwise. The arguments are required to be either both strings or both numbers; if during evaluation they are not, expression evaluation produces an error. Cases where this constraint is known not to hold at parse time are considered in valid and will produce a parse error. Accepts an optional `collator` argument to control locale-dependent string comparisons.",group:"Decision","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"},collator:{js:"0.45.0",android:"6.5.0",ios:"4.2.0",macos:"0.9.0"}}},all:{doc:"Returns `true` if all the inputs are `true`, `false` otherwise. The inputs are evaluated in order, and evaluation is short-circuiting: once an input expression evaluates to `false`, the result is `false` and no further input expressions are evaluated.",group:"Decision","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},any:{doc:"Returns `true` if any of the inputs are `true`, `false` otherwise. The inputs are evaluated in order, and evaluation is short-circuiting: once an input expression evaluates to `true`, the result is `true` and no further input expressions are evaluated.",group:"Decision","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},"!":{doc:"Logical negation. Returns `true` if the input is `false`, and `false` if the input is `true`.",group:"Decision","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},within:{doc:"Returns `true` if the evaluated feature is fully contained inside a boundary of the input geometry, `false` otherwise. The input value can be a valid GeoJSON of type `Polygon`, `MultiPolygon`, `Feature`, or `FeatureCollection`. Supported features for evaluation:\n- `Point`: Returns `false` if a point is on the boundary or falls outside the boundary.\n- `LineString`: Returns `false` if any part of a line falls outside the boundary, the line intersects the boundary, or a line's endpoint is on the boundary.",group:"Decision","sdk-support":{"basic functionality":{js:"1.9.0",android:"9.1.0",ios:"5.8.0",macos:"0.15.0"}}},"is-supported-script":{doc:"Returns `true` if the input string is expected to render legibly. Returns `false` if the input string contains sections that cannot be rendered without potential loss of meaning (e.g. Indic scripts that require complex text shaping, or right-to-left scripts if the the `mapbox-gl-rtl-text` plugin is not in use in Mapbox GL JS).",group:"String","sdk-support":{"basic functionality":{js:"0.45.0",android:"6.6.0"}}},upcase:{doc:"Returns the input string converted to uppercase. Follows the Unicode Default Case Conversion algorithm and the locale-insensitive case mappings in the Unicode Character Database.",group:"String","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},downcase:{doc:"Returns the input string converted to lowercase. Follows the Unicode Default Case Conversion algorithm and the locale-insensitive case mappings in the Unicode Character Database.",group:"String","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},concat:{doc:"Returns a `string` consisting of the concatenation of the inputs. Each input is converted to a string as if by `to-string`.",group:"String","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},"resolved-locale":{doc:"Returns the IETF language tag of the locale being used by the provided `collator`. This can be used to determine the default system locale, or to determine if a requested locale was successfully loaded.",group:"String","sdk-support":{"basic functionality":{js:"0.45.0",android:"6.5.0",ios:"4.2.0",macos:"0.9.0"}}}}},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"]},doc:"The start and end distance range in which fog fades from fully transparent to fully opaque. The distance to the point at the center of the map is defined as zero, so that negative range values are closer to the camera, and positive values are farther away.",example:[.5,10],"sdk-support":{"basic functionality":{js:"2.3.0"}}},color:{type:"color","property-type":"data-constant",default:"#ffffff",expression:{interpolated:!0,parameters:["zoom"]},transition:!0,doc:"The color of the fog. Using opacity is recommended only for smoothly transitioning fog on/off as anything less than 100% opacity results in more tiles loaded and drawn.","sdk-support":{"basic functionality":{js:"2.3.0"}}},"horizon-blend":{type:"number","property-type":"data-constant",default:.1,minimum:0,maximum:1,expression:{interpolated:!0,parameters:["zoom"]},transition:!0,doc:"Horizon blend applies a smooth fade from the color of the fog to the color of the sky. A value of zero leaves a sharp transition from fog to sky. Increasing the value blends the color of fog into increasingly high angles of the sky.","sdk-support":{"basic functionality":{js:"2.3.0"}}}},light:{anchor:{type:"enum",default:"viewport",values:{map:{doc:"The position of the light source is aligned to the rotation of the map."},viewport:{doc:"The position of the light source is aligned to the rotation of the viewport."}},"property-type":"data-constant",transition:!1,expression:{interpolated:!1,parameters:["zoom"]},doc:"Whether extruded geometries are lit relative to the map or viewport.",example:"map","sdk-support":{"basic functionality":{js:"0.27.0",android:"5.1.0",ios:"3.6.0",macos:"0.5.0"}}},position:{type:"array",default:[1.15,210,30],length:3,value:"number","property-type":"data-constant",transition:!0,expression:{interpolated:!0,parameters:["zoom"]},doc:"Position of the light source relative to lit (extruded) geometries, in [r radial coordinate, a azimuthal angle, p polar angle] where r indicates the distance from the center of the base of an object to its light, a indicates the position of the light relative to 0° (0° when `light.anchor` is set to `viewport` corresponds to the top of the viewport, or 0° when `light.anchor` is set to `map` corresponds to due north, and degrees proceed clockwise), and p indicates the height of the light (from 0°, directly above, to 180°, directly below).",example:[1.5,90,80],"sdk-support":{"basic functionality":{js:"0.27.0",android:"5.1.0",ios:"3.6.0",macos:"0.5.0"}}},color:{type:"color","property-type":"data-constant",default:"#ffffff",expression:{interpolated:!0,parameters:["zoom"]},transition:!0,doc:"Color tint for lighting extruded geometries.","sdk-support":{"basic functionality":{js:"0.27.0",android:"5.1.0",ios:"3.6.0",macos:"0.5.0"}}},intensity:{type:"number","property-type":"data-constant",default:.5,minimum:0,maximum:1,expression:{interpolated:!0,parameters:["zoom"]},transition:!0,doc:"Intensity of lighting (on a scale from 0 to 1). Higher numbers will present as more extreme contrast.","sdk-support":{"basic functionality":{js:"0.27.0",android:"5.1.0",ios:"3.6.0",macos:"0.5.0"}}}},terrain:{source:{type:"string",doc:"Name of a source of `raster_dem` type to be used for terrain elevation.",required:!0,"sdk-support":{"basic functionality":{js:"2.0.0",ios:"10.0.0",android:"10.0.0"}}},exaggeration:{type:"number","property-type":"data-constant",default:1,minimum:0,maximum:1e3,expression:{interpolated:!0,parameters:["zoom"]},transition:!0,doc:"Exaggerates the elevation of the terrain by multiplying the data from the DEM with this value.","sdk-support":{"basic functionality":{js:"2.0.0",ios:"10.0.0",android:"10.0.0"}}}},paint:["paint_fill","paint_line","paint_circle","paint_heatmap","paint_fill-extrusion","paint_symbol","paint_raster","paint_hillshade","paint_background","paint_sky"],paint_fill:{"fill-antialias":{type:"boolean",default:!0,doc:"Whether or not the fill should be antialiased.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"fill-opacity":{type:"number",default:1,minimum:0,maximum:1,doc:"The opacity of the entire fill layer. In contrast to the `fill-color`, this value will also affect the 1px stroke around the fill, if the stroke is used.",transition:!0,"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.21.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-color":{type:"color",default:"#000000",doc:"The color of the filled part of this layer. This color can be specified as `rgba` with an alpha component and the color's opacity will not affect the opacity of the 1px stroke, if it is used.",transition:!0,requires:[{"!":"fill-pattern"}],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.19.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-outline-color":{type:"color",doc:"The outline color of the fill. Matches the value of `fill-color` if unspecified.",transition:!0,requires:[{"!":"fill-pattern"},{"fill-antialias":!0}],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.19.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.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",doc:"The geometry's offset. Values are [x, y] where negatives indicate left and up, respectively.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"fill-translate-anchor":{type:"enum",values:{map:{doc:"The fill is translated relative to the map."},viewport:{doc:"The fill is translated relative to the viewport."}},doc:"Controls the frame of reference for `fill-translate`.",default:"map",requires:["fill-translate"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"fill-pattern":{type:"resolvedImage",transition:!0,doc:"Name of image in sprite to use for drawing image fills. For seamless patterns, image width and height must be a factor of two (2, 4, 8, ..., 512). Note that zoom-dependent expressions will be evaluated only at integer zoom levels.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.49.0",android:"6.5.0",macos:"0.11.0",ios:"4.4.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,doc:"The opacity of the entire fill extrusion layer. This is rendered on a per-layer, not per-feature, basis, and data-driven styling is not available.",transition:!0,"sdk-support":{"basic functionality":{js:"0.27.0",android:"5.1.0",ios:"3.6.0",macos:"0.5.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"fill-extrusion-color":{type:"color",default:"#000000",doc:"The base color of the extruded fill. The extrusion's surfaces will be shaded differently based on this color in combination with the root `light` settings. If this color is specified as `rgba` with an alpha component, the alpha component will be ignored; use `fill-extrusion-opacity` to set layer opacity.",transition:!0,requires:[{"!":"fill-extrusion-pattern"}],"sdk-support":{"basic functionality":{js:"0.27.0",android:"5.1.0",ios:"3.6.0",macos:"0.5.0"},"data-driven styling":{js:"0.27.0",android:"5.1.0",ios:"3.6.0",macos:"0.5.0"}},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",doc:"The geometry's offset. Values are [x, y] where negatives indicate left and up (on the flat plane), respectively.","sdk-support":{"basic functionality":{js:"0.27.0",android:"5.1.0",ios:"3.6.0",macos:"0.5.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"fill-extrusion-translate-anchor":{type:"enum",values:{map:{doc:"The fill extrusion is translated relative to the map."},viewport:{doc:"The fill extrusion is translated relative to the viewport."}},doc:"Controls the frame of reference for `fill-extrusion-translate`.",default:"map",requires:["fill-extrusion-translate"],"sdk-support":{"basic functionality":{js:"0.27.0",android:"5.1.0",ios:"3.6.0",macos:"0.5.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"fill-extrusion-pattern":{type:"resolvedImage",transition:!0,doc:"Name of image in sprite to use for drawing images on extruded fills. For seamless patterns, image width and height must be a factor of two (2, 4, 8, ..., 512). Note that zoom-dependent expressions will be evaluated only at integer zoom levels.","sdk-support":{"basic functionality":{js:"0.27.0",android:"5.1.0",ios:"3.6.0",macos:"0.5.0"},"data-driven styling":{js:"0.49.0",android:"6.5.0",macos:"0.11.0",ios:"4.4.0"}},expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"cross-faded-data-driven"},"fill-extrusion-height":{type:"number",default:0,minimum:0,units:"meters",doc:"The height with which to extrude this layer.",transition:!0,"sdk-support":{"basic functionality":{js:"0.27.0",android:"5.1.0",ios:"3.6.0",macos:"0.5.0"},"data-driven styling":{js:"0.27.0",android:"5.1.0",ios:"3.6.0",macos:"0.5.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-base":{type:"number",default:0,minimum:0,units:"meters",doc:"The height with which to extrude the base of this layer. Must be less than or equal to `fill-extrusion-height`.",transition:!0,requires:["fill-extrusion-height"],"sdk-support":{"basic functionality":{js:"0.27.0",android:"5.1.0",ios:"3.6.0",macos:"0.5.0"},"data-driven styling":{js:"0.27.0",android:"5.1.0",ios:"3.6.0",macos:"0.5.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-vertical-gradient":{type:"boolean",default:!0,doc:"Whether to apply a vertical gradient to the sides of a fill-extrusion layer. If true, sides will be shaded slightly darker farther down.",transition:!1,"sdk-support":{"basic functionality":{js:"0.50.0",android:"7.0.0",ios:"4.7.0",macos:"0.13.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"}},paint_line:{"line-opacity":{type:"number",doc:"The opacity at which the line will be drawn.",default:1,minimum:0,maximum:1,transition:!0,"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.29.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-color":{type:"color",doc:"The color with which the line will be drawn.",default:"#000000",transition:!0,requires:[{"!":"line-pattern"}],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.23.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},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",doc:"The geometry's offset. Values are [x, y] where negatives indicate left and up, respectively.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"line-translate-anchor":{type:"enum",values:{map:{doc:"The line is translated relative to the map."},viewport:{doc:"The line is translated relative to the viewport."}},doc:"Controls the frame of reference for `line-translate`.",default:"map",requires:["line-translate"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"line-width":{type:"number",default:1,minimum:0,transition:!0,units:"pixels",doc:"Stroke thickness.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.39.0",android:"5.2.0",ios:"3.7.0",macos:"0.6.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-gap-width":{type:"number",default:0,minimum:0,doc:"Draws a line casing outside of a line's actual path. Value indicates the width of the inner gap.",transition:!0,units:"pixels","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.29.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-offset":{type:"number",default:0,doc:"The line's offset. For linear features, a positive value offsets the line to the right, relative to the direction of the line, and a negative value to the left. For polygon features, a positive value results in an inset, and a negative value results in an outset.",transition:!0,units:"pixels","sdk-support":{"basic functionality":{js:"0.12.1",android:"3.0.0",ios:"3.1.0",macos:"0.1.0"},"data-driven styling":{js:"0.29.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-blur":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",doc:"Blur applied to the line, in pixels.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.29.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-dasharray":{type:"array",value:"number",doc:"Specifies the lengths of the alternating dashes and gaps that form the dash pattern. The lengths are later scaled by the line width. To convert a dash length to pixels, multiply the length by the current line width. Note that GeoJSON sources with `lineMetrics: true` specified won't render dashed lines to the expected scale. Also note that zoom-dependent expressions will be evaluated only at integer zoom levels.",minimum:0,transition:!0,units:"line widths",requires:[{"!":"line-pattern"}],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"2.3.0"}},expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"cross-faded-data-driven"},"line-pattern":{type:"resolvedImage",transition:!0,doc:"Name of image in sprite to use for drawing image lines. For seamless patterns, image width must be a factor of two (2, 4, 8, ..., 512). Note that zoom-dependent expressions will be evaluated only at integer zoom levels.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.49.0",android:"6.5.0",macos:"0.11.0",ios:"4.4.0"}},expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"cross-faded-data-driven"},"line-gradient":{type:"color",doc:'Defines a gradient with which to color a line feature. Can only be used with GeoJSON sources that specify `"lineMetrics": true`.',transition:!1,requires:[{"!":"line-dasharray"},{"!":"line-pattern"},{source:"geojson",has:{lineMetrics:!0}}],"sdk-support":{"basic functionality":{js:"0.45.0",android:"6.5.0",ios:"4.4.0",macos:"0.11.0"},"data-driven styling":{}},expression:{interpolated:!0,parameters:["line-progress"]},"property-type":"color-ramp"}},paint_circle:{"circle-radius":{type:"number",default:5,minimum:0,transition:!0,units:"pixels",doc:"Circle radius.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.18.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-color":{type:"color",default:"#000000",doc:"The fill color of the circle.",transition:!0,"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.18.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-blur":{type:"number",default:0,doc:"Amount to blur the circle. 1 blurs the circle such that only the centerpoint is full opacity.",transition:!0,"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.20.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-opacity":{type:"number",doc:"The opacity at which the circle will be drawn.",default:1,minimum:0,maximum:1,transition:!0,"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.20.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.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",doc:"The geometry's offset. Values are [x, y] where negatives indicate left and up, respectively.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"circle-translate-anchor":{type:"enum",values:{map:{doc:"The circle is translated relative to the map."},viewport:{doc:"The circle is translated relative to the viewport."}},doc:"Controls the frame of reference for `circle-translate`.",default:"map",requires:["circle-translate"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"circle-pitch-scale":{type:"enum",values:{map:{doc:"Circles are scaled according to their apparent distance to the camera."},viewport:{doc:"Circles are not scaled."}},default:"map",doc:"Controls the scaling behavior of the circle when the map is pitched.","sdk-support":{"basic functionality":{js:"0.21.0",android:"4.2.0",ios:"3.4.0",macos:"0.2.1"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"circle-pitch-alignment":{type:"enum",values:{map:{doc:"The circle is aligned to the plane of the map."},viewport:{doc:"The circle is aligned to the plane of the viewport."}},default:"viewport",doc:"Orientation of circle when map is pitched.","sdk-support":{"basic functionality":{js:"0.39.0",android:"5.2.0",ios:"3.7.0",macos:"0.6.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"circle-stroke-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",doc:"The width of the circle's stroke. Strokes are placed outside of the `circle-radius`.","sdk-support":{"basic functionality":{js:"0.29.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"},"data-driven styling":{js:"0.29.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-stroke-color":{type:"color",default:"#000000",doc:"The stroke color of the circle.",transition:!0,"sdk-support":{"basic functionality":{js:"0.29.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"},"data-driven styling":{js:"0.29.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-stroke-opacity":{type:"number",doc:"The opacity of the circle's stroke.",default:1,minimum:0,maximum:1,transition:!0,"sdk-support":{"basic functionality":{js:"0.29.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"},"data-driven styling":{js:"0.29.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.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",doc:"Radius of influence of one heatmap point in pixels. Increasing the value makes the heatmap smoother, but less detailed.","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"},"data-driven styling":{js:"0.43.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"heatmap-weight":{type:"number",default:1,minimum:0,transition:!1,doc:"A measure of how much an individual point contributes to the heatmap. A value of 10 would be equivalent to having 10 points of weight 1 in the same spot. Especially useful when combined with clustering.","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"},"data-driven styling":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"heatmap-intensity":{type:"number",default:1,minimum:0,transition:!0,doc:"Similar to `heatmap-weight` but controls the intensity of the heatmap globally. Primarily used for adjusting the heatmap based on zoom level.","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.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"],doc:'Defines the color of each pixel based on its density value in a heatmap. Should be an expression that uses `["heatmap-density"]` as input.',transition:!1,"sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"},"data-driven styling":{}},expression:{interpolated:!0,parameters:["heatmap-density"]},"property-type":"color-ramp"},"heatmap-opacity":{type:"number",doc:"The global opacity at which the heatmap layer will be drawn.",default:1,minimum:0,maximum:1,transition:!0,"sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},paint_symbol:{"icon-opacity":{doc:"The opacity at which the icon will be drawn.",type:"number",default:1,minimum:0,maximum:1,transition:!0,requires:["icon-image"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.33.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-color":{type:"color",default:"#000000",transition:!0,doc:"The color of the icon. This can only be used with sdf icons.",requires:["icon-image"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.33.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},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,doc:"The color of the icon's halo. Icon halos can only be used with SDF icons.",requires:["icon-image"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.33.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},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",doc:"Distance of halo to the icon outline.",requires:["icon-image"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.33.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},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",doc:"Fade out the halo towards the outside.",requires:["icon-image"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.33.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},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",doc:"Distance that the icon's anchor is moved from its original placement. Positive values indicate right and down, while negative values indicate left and up.",requires:["icon-image"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"icon-translate-anchor":{type:"enum",values:{map:{doc:"Icons are translated relative to the map."},viewport:{doc:"Icons are translated relative to the viewport."}},doc:"Controls the frame of reference for `icon-translate`.",default:"map",requires:["icon-image","icon-translate"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-opacity":{type:"number",doc:"The opacity at which the text will be drawn.",default:1,minimum:0,maximum:1,transition:!0,requires:["text-field"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.33.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-color":{type:"color",doc:"The color with which the text will be drawn.",default:"#000000",transition:!0,overridable:!0,requires:["text-field"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.33.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},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,doc:"The color of the text's halo, which helps it stand out from backgrounds.",requires:["text-field"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.33.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},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",doc:"Distance of halo to the font outline. Max text halo width is 1/4 of the font-size.",requires:["text-field"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.33.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},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",doc:"The halo's fadeout distance towards the outside.",requires:["text-field"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.33.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},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",doc:"Distance that the text's anchor is moved from its original placement. Positive values indicate right and down, while negative values indicate left and up.",requires:["text-field"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-translate-anchor":{type:"enum",values:{map:{doc:"The text is translated relative to the map."},viewport:{doc:"The text is translated relative to the viewport."}},doc:"Controls the frame of reference for `text-translate`.",default:"map",requires:["text-field","text-translate"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"}},paint_raster:{"raster-opacity":{type:"number",doc:"The opacity at which the image will be drawn.",default:1,minimum:0,maximum:1,transition:!0,"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-hue-rotate":{type:"number",default:0,period:360,transition:!0,units:"degrees",doc:"Rotates hues around the color wheel.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-brightness-min":{type:"number",doc:"Increase or reduce the brightness of the image. The value is the minimum brightness.",default:0,minimum:0,maximum:1,transition:!0,"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-brightness-max":{type:"number",doc:"Increase or reduce the brightness of the image. The value is the maximum brightness.",default:1,minimum:0,maximum:1,transition:!0,"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-saturation":{type:"number",doc:"Increase or reduce the saturation of the image.",default:0,minimum:-1,maximum:1,transition:!0,"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-contrast":{type:"number",doc:"Increase or reduce the contrast of the image.",default:0,minimum:-1,maximum:1,transition:!0,"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-resampling":{type:"enum",doc:"The resampling/interpolation method to use for overscaling, also known as texture magnification filter",values:{linear:{doc:"(Bi)linear filtering interpolates pixel values using the weighted average of the four closest original source pixels creating a smooth but blurry look when overscaled"},nearest:{doc:"Nearest neighbor filtering interpolates pixel values using the nearest original source pixel creating a sharp but pixelated look when overscaled"}},default:"linear","sdk-support":{"basic functionality":{js:"0.47.0",android:"6.3.0",ios:"4.2.0",macos:"0.9.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"raster-fade-duration":{type:"number",default:300,minimum:0,transition:!1,units:"milliseconds",doc:"Fade duration when a new tile is added.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},paint_hillshade:{"hillshade-illumination-direction":{type:"number",default:335,minimum:0,maximum:359,doc:"The direction of the light source used to generate the hillshading with 0 as the top of the viewport if `hillshade-illumination-anchor` is set to `viewport` and due north if `hillshade-illumination-anchor` is set to `map`.",transition:!1,"sdk-support":{"basic functionality":{js:"0.43.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-illumination-anchor":{type:"enum",values:{map:{doc:"The hillshade illumination is relative to the north direction."},viewport:{doc:"The hillshade illumination is relative to the top of the viewport."}},default:"viewport",doc:"Direction of light source when map is rotated.","sdk-support":{"basic functionality":{js:"0.43.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-exaggeration":{type:"number",doc:"Intensity of the hillshade",default:.5,minimum:0,maximum:1,transition:!0,"sdk-support":{"basic functionality":{js:"0.43.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-shadow-color":{type:"color",default:"#000000",doc:"The shading color of areas that face away from the light source.",transition:!0,"sdk-support":{"basic functionality":{js:"0.43.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-highlight-color":{type:"color",default:"#FFFFFF",doc:"The shading color of areas that faces towards the light source.",transition:!0,"sdk-support":{"basic functionality":{js:"0.43.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-accent-color":{type:"color",default:"#000000",doc:"The shading color used to accentuate rugged terrain like sharp cliffs and gorges.",transition:!0,"sdk-support":{"basic functionality":{js:"0.43.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},paint_background:{"background-color":{type:"color",default:"#000000",doc:"The color with which the background will be drawn.",transition:!0,requires:[{"!":"background-pattern"}],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"background-pattern":{type:"resolvedImage",transition:!0,doc:"Name of image in sprite to use for drawing an image background. For seamless patterns, image width and height must be a factor of two (2, 4, 8, ..., 512). Note that zoom-dependent expressions will be evaluated only at integer zoom levels.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"cross-faded"},"background-opacity":{type:"number",default:1,minimum:0,maximum:1,doc:"The opacity at which the background will be drawn.",transition:!0,"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},paint_sky:{"sky-type":{type:"enum",values:{gradient:{doc:"Renders the sky with a gradient that can be configured with `sky-gradient-radius` and `sky-gradient`."},atmosphere:{doc:"Renders the sky with a simulated atmospheric scattering algorithm, the sun direction can be attached to the light position or explicitly set through `sky-atmosphere-sun`."}},default:"atmosphere",doc:"The type of the sky","sdk-support":{"basic functionality":{js:"2.0.0",ios:"10.0.0",android:"10.0.0"}},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,doc:"Position of the sun center [a azimuthal angle, p polar angle]. The azimuthal angle indicates the position of the sun relative to 0° north, where degrees proceed clockwise. The polar angle indicates the height of the sun, where 0° is directly above, at zenith, and 90° at the horizon. When this property is ommitted, the sun center is directly inherited from the light position.","sdk-support":{"basic functionality":{js:"2.0.0",ios:"10.0.0",android:"10.0.0"}},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,doc:"Intensity of the sun as a light source in the atmosphere (on a scale from 0 to a 100). Setting higher values will brighten up the sky.","sdk-support":{"basic functionality":{js:"2.0.0",ios:"10.0.0",android:"10.0.0"}},"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,doc:"Position of the gradient center [a azimuthal angle, p polar angle]. The azimuthal angle indicates the position of the gradient center relative to 0° north, where degrees proceed clockwise. The polar angle indicates the height of the gradient center, where 0° is directly above, at zenith, and 90° at the horizon.","sdk-support":{"basic functionality":{js:"2.0.0",ios:"10.0.0",android:"10.0.0"}},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,doc:"The angular distance (measured in degrees) from `sky-gradient-center` up to which the gradient extends. A value of 180 causes the gradient to wrap around to the opposite direction from `sky-gradient-center`.","sdk-support":{"basic functionality":{js:"2.0.0",ios:"10.0.0",android:"10.0.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"sky-gradient":{type:"color",default:["interpolate",["linear"],["sky-radial-progress"],.8,"#87ceeb",1,"white"],doc:"Defines a radial color gradient with which to color the sky. The color values can be interpolated with an expression using `sky-radial-progress`. The range [0, 1] for the interpolant covers a radial distance (in degrees) of [0, `sky-gradient-radius`] centered at the position specified by `sky-gradient-center`.",transition:!1,requires:[{"sky-type":"gradient"}],"sdk-support":{"basic functionality":{js:"2.0.0",ios:"10.0.0",android:"10.0.0"},"data-driven styling":{}},expression:{interpolated:!0,parameters:["sky-radial-progress"]},"property-type":"color-ramp"},"sky-atmosphere-halo-color":{type:"color",default:"white",doc:"A color applied to the atmosphere sun halo. The alpha channel describes how strongly the sun halo is represented in an atmosphere sky layer.",transition:!1,requires:[{"sky-type":"atmosphere"}],"sdk-support":{"basic functionality":{js:"2.0.0",ios:"10.0.0",android:"10.0.0"}},"property-type":"data-constant"},"sky-atmosphere-color":{type:"color",default:"white",doc:"A color used to tweak the main atmospheric scattering coefficients. Using white applies the default coefficients giving the natural blue color to the atmosphere. This color affects how heavily the corresponding wavelength is represented during scattering. The alpha channel describes the density of the atmosphere, with 1 maximum density and 0 no density.",transition:!1,requires:[{"sky-type":"atmosphere"}],"sdk-support":{"basic functionality":{js:"2.0.0",ios:"10.0.0",android:"10.0.0"}},"property-type":"data-constant"},"sky-opacity":{type:"number",default:1,minimum:0,maximum:1,doc:"The opacity of the entire sky layer.",transition:!0,"sdk-support":{"basic functionality":{js:"2.0.0",ios:"10.0.0",android:"10.0.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},transition:{duration:{type:"number",default:300,minimum:0,units:"milliseconds",doc:"Time allotted for transitions to complete."},delay:{type:"number",default:0,minimum:0,units:"milliseconds",doc:"Length of time before a transition begins."}},"property-type":{"data-driven":{type:"property-type",doc:"Property is interpolable and can be represented using a property expression."},"cross-faded":{type:"property-type",doc:"Property is non-interpolable; rather, its values will be cross-faded to smoothly transition between integer zooms."},"cross-faded-data-driven":{type:"property-type",doc:"Property is non-interpolable; rather, its values will be cross-faded to smoothly transition between integer zooms. It can be represented using a property expression."},"color-ramp":{type:"property-type",doc:"Property should be specified using a color ramp from which the output color can be sampled based on a property calculation."},"data-constant":{type:"property-type",doc:"Property is interpolable but cannot be represented using a property expression."},constant:{type:"property-type",doc:"Property is constant across all zoom levels and property values."}},promoteId:{"*":{type:"string",doc:"A name of a feature property to use as ID for feature state."}}},vd="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function _d(t){var e={exports:{}};return t(e,e.exports),e.exports}function xd(t,e){return Object.prototype.hasOwnProperty.call(t,e)}
|
31
|
-
/*! https://mths.be/punycode v1.3.2 by @mathias */
|
32
|
-
_d((function(t,e){!function(i){var n=e&&!e.nodeType&&e,r=t&&!t.nodeType&&t,o="object"==typeof vd&&vd;o.global!==o&&o.window!==o&&o.self!==o||(i=o);var s,a,l=2147483647,u=36,h=/^xn--/,c=/[^\x20-\x7E]/,p=/[\x2E\u3002\uFF0E\uFF61]/g,d={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},f=Math.floor,y=String.fromCharCode;function g(t){throw RangeError(d[t])}function m(t,e){for(var i=t.length,n=[];i--;)n[i]=e(t[i]);return n}function v(t,e){var i=t.split("@"),n="";return i.length>1&&(n=i[0]+"@",t=i[1]),n+m((t=t.replace(p,".")).split("."),e).join(".")}function _(t){for(var e,i,n=[],r=0,o=t.length;r<o;)(e=t.charCodeAt(r++))>=55296&&e<=56319&&r<o?56320==(64512&(i=t.charCodeAt(r++)))?n.push(((1023&e)<<10)+(1023&i)+65536):(n.push(e),r--):n.push(e);return n}function x(t){return m(t,(function(t){var e="";return t>65535&&(e+=y((t-=65536)>>>10&1023|55296),t=56320|1023&t),e+=y(t)})).join("")}function b(t,e){return t+22+75*(t<26)-((0!=e)<<5)}function w(t,e,i){var n=0;for(t=i?f(t/700):t>>1,t+=f(t/e);t>455;n+=u)t=f(t/35);return f(n+36*t/(t+38))}function S(t){var e,i,n,r,o,s,a,h,c,p,d,y=[],m=t.length,v=0,_=128,b=72;for((i=t.lastIndexOf("-"))<0&&(i=0),n=0;n<i;++n)t.charCodeAt(n)>=128&&g("not-basic"),y.push(t.charCodeAt(n));for(r=i>0?i+1:0;r<m;){for(o=v,s=1,a=u;r>=m&&g("invalid-input"),((h=(d=t.charCodeAt(r++))-48<10?d-22:d-65<26?d-65:d-97<26?d-97:u)>=u||h>f((l-v)/s))&&g("overflow"),v+=h*s,!(h<(c=a<=b?1:a>=b+26?26:a-b));a+=u)s>f(l/(p=u-c))&&g("overflow"),s*=p;b=w(v-o,e=y.length+1,0==o),f(v/e)>l-_&&g("overflow"),_+=f(v/e),v%=e,y.splice(v++,0,_)}return x(y)}function C(t){var e,i,n,r,o,s,a,h,c,p,d,m,v,x,S,C=[];for(m=(t=_(t)).length,e=128,i=0,o=72,s=0;s<m;++s)(d=t[s])<128&&C.push(y(d));for(n=r=C.length,r&&C.push("-");n<m;){for(a=l,s=0;s<m;++s)(d=t[s])>=e&&d<a&&(a=d);for(a-e>f((l-i)/(v=n+1))&&g("overflow"),i+=(a-e)*v,e=a,s=0;s<m;++s)if((d=t[s])<e&&++i>l&&g("overflow"),d==e){for(h=i,c=u;!(h<(p=c<=o?1:c>=o+26?26:c-o));c+=u)S=h-p,x=u-p,C.push(y(b(p+S%x,0))),h=f(S/x);C.push(y(b(h,0))),o=w(i,v,n==r),i=0,++n}++i,++e}return C.join("")}if(s={version:"1.3.2",ucs2:{decode:_,encode:x},decode:S,encode:C,toASCII:function(t){return v(t,(function(t){return c.test(t)?"xn--"+C(t):t}))},toUnicode:function(t){return v(t,(function(t){return h.test(t)?S(t.slice(4).toLowerCase()):t}))}},n&&r)if(t.exports==n)r.exports=s;else for(a in s)s.hasOwnProperty(a)&&(n[a]=s[a]);else i.punycode=s}(vd)}));var bd=function(t,e,i,n){e=e||"&",i=i||"=";var r={};if("string"!=typeof t||0===t.length)return r;var o=/\+/g;t=t.split(e);var s=1e3;n&&"number"==typeof n.maxKeys&&(s=n.maxKeys);var a=t.length;s>0&&a>s&&(a=s);for(var l=0;l<a;++l){var u,h,c,p,d=t[l].replace(o,"%20"),f=d.indexOf(i);f>=0?(u=d.substr(0,f),h=d.substr(f+1)):(u=d,h=""),c=decodeURIComponent(u),p=decodeURIComponent(h),xd(r,c)?Array.isArray(r[c])?r[c].push(p):r[c]=[r[c],p]:r[c]=p}return r},wd=function(t){switch(typeof t){case"string":return t;case"boolean":return t?"true":"false";case"number":return isFinite(t)?t:"";default:return""}},Sd=function(t,e,i,n){return e=e||"&",i=i||"=",null===t&&(t=void 0),"object"==typeof t?Object.keys(t).map((function(n){var r=encodeURIComponent(wd(n))+i;return Array.isArray(t[n])?t[n].map((function(t){return r+encodeURIComponent(wd(t))})).join(e):r+encodeURIComponent(wd(t[n]))})).join(e):n?encodeURIComponent(wd(n))+i+encodeURIComponent(wd(t)):""};_d((function(t,e){e.decode=e.parse=bd,e.encode=e.stringify=Sd}));class Cd extends Error{constructor(t,e){super(e),this.message=e,this.key=t}}class Td{constructor(t,e=[]){this.parent=t,this.bindings={};for(const[i,n]of e)this.bindings[i]=n}concat(t){return new Td(this,t)}get(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.`)}has(t){return!!this.bindings[t]||!!this.parent&&this.parent.has(t)}}const Ed={kind:"null"},kd={kind:"number"},Pd={kind:"string"},Od={kind:"boolean"},Rd={kind:"color"},Id={kind:"object"},Fd={kind:"value"},jd={kind:"collator"},Md={kind:"formatted"},Ad={kind:"resolvedImage"};function Ld(t,e){return{kind:"array",itemType:t,N:e}}function zd(t){if("array"===t.kind){const e=zd(t.itemType);return"number"==typeof t.N?`array<${e}, ${t.N}>`:"value"===t.itemType.kind?"array":`array<${e}>`}return t.kind}const Dd=[Ed,kd,Pd,Od,Rd,Md,Id,Ld(Fd),Ad];function Gd(t,e){if("error"===e.kind)return null;if("array"===t.kind){if("array"===e.kind&&(0===e.N&&"value"===e.itemType.kind||!Gd(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(const t of Dd)if(!Gd(t,e))return null}return`Expected ${zd(t)} but found ${zd(e)} instead.`}function Nd(t,e){return e.some((e=>e.kind===t.kind))}function Bd(t,e){return e.some((e=>"null"===e?null===t:"array"===e?Array.isArray(t):"object"===e?t&&!Array.isArray(t)&&"object"==typeof t:e===typeof t))}var Wd=_d((function(t,e){var i={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 n(t){return(t=Math.round(t))<0?0:t>255?255:t}function r(t){return t<0?0:t>1?1:t}function o(t){return"%"===t[t.length-1]?n(parseFloat(t)/100*255):n(parseInt(t))}function s(t){return"%"===t[t.length-1]?r(parseFloat(t)/100):r(parseFloat(t))}function a(t,e,i){return i<0?i+=1:i>1&&(i-=1),6*i<1?t+(e-t)*i*6:2*i<1?e:3*i<2?t+(e-t)*(2/3-i)*6:t}try{e.parseCSSColor=function(t){var e,r=t.replace(/ /g,"").toLowerCase();if(r in i)return i[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 l=r.indexOf("("),u=r.indexOf(")");if(-1!==l&&u+1===r.length){var h=r.substr(0,l),c=r.substr(l+1,u-(l+1)).split(","),p=1;switch(h){case"rgba":if(4!==c.length)return null;p=s(c.pop());case"rgb":return 3!==c.length?null:[o(c[0]),o(c[1]),o(c[2]),p];case"hsla":if(4!==c.length)return null;p=s(c.pop());case"hsl":if(3!==c.length)return null;var d=(parseFloat(c[0])%360+360)%360/360,f=s(c[1]),y=s(c[2]),g=y<=.5?y*(f+1):y+f-y*f,m=2*y-g;return[n(255*a(m,g,d+1/3)),n(255*a(m,g,d)),n(255*a(m,g,d-1/3)),p];default:return null}}return null}}catch(l){}}));class qd{constructor(t,e,i,n=1){this.r=t,this.g=e,this.b=i,this.a=n}static parse(t){if(!t)return;if(t instanceof qd)return t;if("string"!=typeof t)return;const e=Wd.parseCSSColor(t);return e?new qd(e[0]/255*e[3],e[1]/255*e[3],e[2]/255*e[3],e[3]):void 0}toString(){const[t,e,i,n]=this.toArray();return`rgba(${Math.round(t)},${Math.round(e)},${Math.round(i)},${n})`}toArray(){const{r:t,g:e,b:i,a:n}=this;return 0===n?[0,0,0,0]:[255*t/n,255*e/n,255*i/n,n]}}qd.black=new qd(0,0,0,1),qd.white=new qd(1,1,1,1),qd.transparent=new qd(0,0,0,0),qd.red=new qd(1,0,0,1),qd.blue=new qd(0,0,1,1);class Vd{constructor(t,e,i){this.sensitivity=t?e?"variant":"case":e?"accent":"base",this.locale=i,this.collator=new Intl.Collator(this.locale?this.locale:[],{sensitivity:this.sensitivity,usage:"search"})}compare(t,e){return this.collator.compare(t,e)}resolvedLocale(){return new Intl.Collator(this.locale?this.locale:[]).resolvedOptions().locale}}class Ud{constructor(t,e,i,n,r){this.text=t,this.image=e,this.scale=i,this.fontStack=n,this.textColor=r}}class Xd{constructor(t){this.sections=t}static fromString(t){return new Xd([new Ud(t,null,null,null,null)])}isEmpty(){return 0===this.sections.length||!this.sections.some((t=>0!==t.text.length||t.image&&0!==t.image.name.length))}static factory(t){return t instanceof Xd?t:Xd.fromString(t)}toString(){return 0===this.sections.length?"":this.sections.map((t=>t.text)).join("")}serialize(){const t=["format"];for(const e of this.sections){if(e.image){t.push(["image",e.image.name]);continue}t.push(e.text);const i={};e.fontStack&&(i["text-font"]=["literal",e.fontStack.split(",")]),e.scale&&(i["font-scale"]=e.scale),e.textColor&&(i["text-color"]=["rgba"].concat(e.textColor.toArray())),t.push(i)}return t}}class Kd{constructor(t){this.name=t.name,this.available=t.available}toString(){return this.name}static fromString(t){return t?new Kd({name:t,available:!1}):null}serialize(){return["image",this.name]}}function Yd(t,e,i,n){if(!("number"==typeof t&&t>=0&&t<=255&&"number"==typeof e&&e>=0&&e<=255&&"number"==typeof i&&i>=0&&i<=255)){return`Invalid rgba value [${("number"==typeof n?[t,e,i,n]:[t,e,i]).join(", ")}]: 'r', 'g', and 'b' must be between 0 and 255.`}return void 0===n||"number"==typeof n&&n>=0&&n<=1?null:`Invalid rgba value [${[t,e,i,n].join(", ")}]: 'a' must be between 0 and 1.`}function Zd(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 qd)return!0;if(t instanceof Vd)return!0;if(t instanceof Xd)return!0;if(t instanceof Kd)return!0;if(Array.isArray(t)){for(const e of t)if(!Zd(e))return!1;return!0}if("object"==typeof t){for(const e in t)if(!Zd(t[e]))return!1;return!0}return!1}function Hd(t){if(null===t)return Ed;if("string"==typeof t)return Pd;if("boolean"==typeof t)return Od;if("number"==typeof t)return kd;if(t instanceof qd)return Rd;if(t instanceof Vd)return jd;if(t instanceof Xd)return Md;if(t instanceof Kd)return Ad;if(Array.isArray(t)){const e=t.length;let i;for(const n of t){const t=Hd(n);if(i){if(i===t)continue;i=Fd;break}i=t}return Ld(i||Fd,e)}return Id}function $d(t){const e=typeof t;return null===t?"":"string"===e||"number"===e||"boolean"===e?String(t):t instanceof qd||t instanceof Xd||t instanceof Kd?t.toString():JSON.stringify(t)}class Jd{constructor(t,e){this.type=t,this.value=e}static parse(t,e){if(2!==t.length)return e.error(`'literal' expression requires exactly one argument, but found ${t.length-1} instead.`);if(!Zd(t[1]))return e.error("invalid value");const i=t[1];let n=Hd(i);const r=e.expectedType;return"array"!==n.kind||0!==n.N||!r||"array"!==r.kind||"number"==typeof r.N&&0!==r.N||(n=r),new Jd(n,i)}evaluate(){return this.value}eachChild(){}outputDefined(){return!0}serialize(){return"array"===this.type.kind||"object"===this.type.kind?["literal",this.value]:this.value instanceof qd?["rgba"].concat(this.value.toArray()):this.value instanceof Xd?this.value.serialize():this.value}}class Qd{constructor(t){this.name="ExpressionEvaluationError",this.message=t}toJSON(){return this.message}}const tf={string:Pd,number:kd,boolean:Od,object:Id};class ef{constructor(t,e){this.type=t,this.args=e}static parse(t,e){if(t.length<2)return e.error("Expected at least one argument.");let i,n=1;const r=t[0];if("array"===r){let r,o;if(t.length>2){const i=t[1];if("string"!=typeof i||!(i in tf)||"object"===i)return e.error('The item type argument of "array" must be one of string, number, boolean',1);r=tf[i],n++}else r=Fd;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);o=t[2],n++}i=Ld(r,o)}else i=tf[r];const o=[];for(;n<t.length;n++){const i=e.parse(t[n],n,Fd);if(!i)return null;o.push(i)}return new ef(i,o)}evaluate(t){for(let e=0;e<this.args.length;e++){const i=this.args[e].evaluate(t);if(!Gd(this.type,Hd(i)))return i;if(e===this.args.length-1)throw new Qd(`Expected value to be of type ${zd(this.type)}, but found ${zd(Hd(i))} instead.`)}return null}eachChild(t){this.args.forEach(t)}outputDefined(){return this.args.every((t=>t.outputDefined()))}serialize(){const t=this.type,e=[t.kind];if("array"===t.kind){const i=t.itemType;if("string"===i.kind||"number"===i.kind||"boolean"===i.kind){e.push(i.kind);const n=t.N;("number"==typeof n||this.args.length>1)&&e.push(n)}}return e.concat(this.args.map((t=>t.serialize())))}}class nf{constructor(t){this.type=Md,this.sections=t}static parse(t,e){if(t.length<2)return e.error("Expected at least one argument.");const i=t[1];if(!Array.isArray(i)&&"object"==typeof i)return e.error("First argument must be an image or text section.");const n=[];let r=!1;for(let o=1;o<=t.length-1;++o){const i=t[o];if(r&&"object"==typeof i&&!Array.isArray(i)){r=!1;let t=null;if(i["font-scale"]&&(t=e.parse(i["font-scale"],1,kd),!t))return null;let o=null;if(i["text-font"]&&(o=e.parse(i["text-font"],1,Ld(Pd)),!o))return null;let s=null;if(i["text-color"]&&(s=e.parse(i["text-color"],1,Rd),!s))return null;const a=n[n.length-1];a.scale=t,a.font=o,a.textColor=s}else{const i=e.parse(t[o],1,Fd);if(!i)return null;const s=i.type.kind;if("string"!==s&&"value"!==s&&"null"!==s&&"resolvedImage"!==s)return e.error("Formatted text type must be 'string', 'value', 'image' or 'null'.");r=!0,n.push({content:i,scale:null,font:null,textColor:null})}}return new nf(n)}evaluate(t){return new Xd(this.sections.map((e=>{const i=e.content.evaluate(t);return Hd(i)===Ad?new Ud("",i,null,null,null):new Ud($d(i),null,e.scale?e.scale.evaluate(t):null,e.font?e.font.evaluate(t).join(","):null,e.textColor?e.textColor.evaluate(t):null)})))}eachChild(t){for(const e of this.sections)t(e.content),e.scale&&t(e.scale),e.font&&t(e.font),e.textColor&&t(e.textColor)}outputDefined(){return!1}serialize(){const t=["format"];for(const e of this.sections){t.push(e.content.serialize());const i={};e.scale&&(i["font-scale"]=e.scale.serialize()),e.font&&(i["text-font"]=e.font.serialize()),e.textColor&&(i["text-color"]=e.textColor.serialize()),t.push(i)}return t}}class rf{constructor(t){this.type=Ad,this.input=t}static parse(t,e){if(2!==t.length)return e.error("Expected two arguments.");const i=e.parse(t[1],1,Pd);return i?new rf(i):e.error("No image name provided.")}evaluate(t){const e=this.input.evaluate(t),i=Kd.fromString(e);return i&&t.availableImages&&(i.available=t.availableImages.indexOf(e)>-1),i}eachChild(t){t(this.input)}outputDefined(){return!1}serialize(){return["image",this.input.serialize()]}}const of={"to-boolean":Od,"to-color":Rd,"to-number":kd,"to-string":Pd};class sf{constructor(t,e){this.type=t,this.args=e}static parse(t,e){if(t.length<2)return e.error("Expected at least one argument.");const i=t[0];if(("to-boolean"===i||"to-string"===i)&&2!==t.length)return e.error("Expected one argument.");const n=of[i],r=[];for(let o=1;o<t.length;o++){const i=e.parse(t[o],o,Fd);if(!i)return null;r.push(i)}return new sf(n,r)}evaluate(t){if("boolean"===this.type.kind)return Boolean(this.args[0].evaluate(t));if("color"===this.type.kind){let e,i;for(const n of this.args){if(e=n.evaluate(t),i=null,e instanceof qd)return e;if("string"==typeof e){const i=t.parseColor(e);if(i)return i}else if(Array.isArray(e)&&(i=e.length<3||e.length>4?`Invalid rbga value ${JSON.stringify(e)}: expected an array containing either three or four numeric values.`:Yd(e[0],e[1],e[2],e[3]),!i))return new qd(e[0]/255,e[1]/255,e[2]/255,e[3])}throw new Qd(i||`Could not parse color from value '${"string"==typeof e?e:String(JSON.stringify(e))}'`)}if("number"===this.type.kind){let e=null;for(const i of this.args){if(e=i.evaluate(t),null===e)return 0;const n=Number(e);if(!isNaN(n))return n}throw new Qd(`Could not convert ${JSON.stringify(e)} to number.`)}return"formatted"===this.type.kind?Xd.fromString($d(this.args[0].evaluate(t))):"resolvedImage"===this.type.kind?Kd.fromString($d(this.args[0].evaluate(t))):$d(this.args[0].evaluate(t))}eachChild(t){this.args.forEach(t)}outputDefined(){return this.args.every((t=>t.outputDefined()))}serialize(){if("formatted"===this.type.kind)return new nf([{content:this.args[0],scale:null,font:null,textColor:null}]).serialize();if("resolvedImage"===this.type.kind)return new rf(this.args[0]).serialize();const t=[`to-${this.type.kind}`];return this.eachChild((e=>{t.push(e.serialize())})),t}}const af=["Unknown","Point","LineString","Polygon"];class lf{constructor(){this.globals=null,this.feature=null,this.featureState=null,this.formattedSection=null,this._parseColorCache={},this.availableImages=null,this.canonical=null}id(){return this.feature&&"id"in this.feature?this.feature.id:null}geometryType(){return this.feature?"number"==typeof this.feature.type?af[this.feature.type]:this.feature.type:null}geometry(){return this.feature&&"geometry"in this.feature?this.feature.geometry:null}canonicalID(){return this.canonical}properties(){return this.feature&&this.feature.properties||{}}parseColor(t){let e=this._parseColorCache[t];return e||(e=this._parseColorCache[t]=qd.parse(t)),e}}class uf{constructor(t,e,i,n){this.name=t,this.type=e,this._evaluate=i,this.args=n}evaluate(t){return this._evaluate(t,this.args)}eachChild(t){this.args.forEach(t)}outputDefined(){return!1}serialize(){return[this.name].concat(this.args.map((t=>t.serialize())))}static parse(t,e){const i=t[0],n=uf.definitions[i];if(!n)return e.error(`Unknown expression "${i}". If you wanted a literal array, use ["literal", [...]].`,0);const r=Array.isArray(n)?n[0]:n.type,o=Array.isArray(n)?[[n[1],n[2]]]:n.overloads,s=o.filter((([e])=>!Array.isArray(e)||e.length===t.length-1));let a=null;for(const[l,u]of s){a=new Ff(e.registry,e.path,null,e.scope);const n=[];let o=!1;for(let e=1;e<t.length;e++){const i=t[e],r=Array.isArray(l)?l[e-1]:l.type,s=a.parse(i,1+n.length,r);if(!s){o=!0;break}n.push(s)}if(!o)if(Array.isArray(l)&&l.length!==n.length)a.error(`Expected ${l.length} arguments, but found ${n.length} instead.`);else{for(let t=0;t<n.length;t++){const e=Array.isArray(l)?l[t]:l.type,i=n[t];a.concat(t+1).checkSubtype(e,i.type)}if(0===a.errors.length)return new uf(i,r,u,n)}}if(1===s.length)e.errors.push(...a.errors);else{const i=(s.length?s:o).map((([t])=>{return e=t,Array.isArray(e)?`(${e.map(zd).join(", ")})`:`(${zd(e.type)}...)`;var e})).join(" | "),n=[];for(let r=1;r<t.length;r++){const i=e.parse(t[r],1+n.length);if(!i)return null;n.push(zd(i.type))}e.error(`Expected arguments of type ${i}, but found (${n.join(", ")}) instead.`)}return null}static register(t,e){uf.definitions=e;for(const i in e)t[i]=uf}}class hf{constructor(t,e,i){this.type=jd,this.locale=i,this.caseSensitive=t,this.diacriticSensitive=e}static parse(t,e){if(2!==t.length)return e.error("Expected one argument.");const i=t[1];if("object"!=typeof i||Array.isArray(i))return e.error("Collator options argument must be an object.");const n=e.parse(void 0!==i["case-sensitive"]&&i["case-sensitive"],1,Od);if(!n)return null;const r=e.parse(void 0!==i["diacritic-sensitive"]&&i["diacritic-sensitive"],1,Od);if(!r)return null;let o=null;return i.locale&&(o=e.parse(i.locale,1,Pd),!o)?null:new hf(n,r,o)}evaluate(t){return new Vd(this.caseSensitive.evaluate(t),this.diacriticSensitive.evaluate(t),this.locale?this.locale.evaluate(t):null)}eachChild(t){t(this.caseSensitive),t(this.diacriticSensitive),this.locale&&t(this.locale)}outputDefined(){return!1}serialize(){const t={};return t["case-sensitive"]=this.caseSensitive.serialize(),t["diacritic-sensitive"]=this.diacriticSensitive.serialize(),this.locale&&(t.locale=this.locale.serialize()),["collator",t]}}function cf(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 pf(t,e){return!(t[0]<=e[0])&&(!(t[2]>=e[2])&&(!(t[1]<=e[1])&&!(t[3]>=e[3])))}function df(t,e){const i=(180+t[0])/360;const n=(r=t[1],(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+r*Math.PI/360)))/360);var r;const o=Math.pow(2,e.z);return[Math.round(i*o*8192),Math.round(n*o*8192)]}function ff(t,e,i){const n=t[0]-e[0],r=t[1]-e[1],o=t[0]-i[0],s=t[1]-i[1];return n*s-o*r==0&&n*o<=0&&r*s<=0}function yf(t,e){let i=!1;for(let s=0,a=e.length;s<a;s++){const a=e[s];for(let e=0,s=a.length;e<s-1;e++){if(ff(t,a[e],a[e+1]))return!1;n=t,r=a[e],o=a[e+1],r[1]>n[1]!=o[1]>n[1]&&n[0]<(o[0]-r[0])*(n[1]-r[1])/(o[1]-r[1])+r[0]&&(i=!i)}}var n,r,o;return i}function gf(t,e){for(let i=0;i<e.length;i++)if(yf(t,e[i]))return!0;return!1}function mf(t,e,i,n){const r=t[0]-i[0],o=t[1]-i[1],s=e[0]-i[0],a=e[1]-i[1],l=n[0]-i[0],u=n[1]-i[1],h=r*u-l*o,c=s*u-l*a;return h>0&&c<0||h<0&&c>0}function vf(t,e,i,n){const r=[e[0]-t[0],e[1]-t[1]],o=[n[0]-i[0],n[1]-i[1]];return 0!=(s=o)[0]*(a=r)[1]-s[1]*a[0]&&!(!mf(t,e,i,n)||!mf(i,n,t,e));var s,a}function _f(t,e,i){for(const n of i)for(let i=0;i<n.length-1;++i)if(vf(t,e,n[i],n[i+1]))return!0;return!1}function xf(t,e){for(let i=0;i<t.length;++i)if(!yf(t[i],e))return!1;for(let i=0;i<t.length-1;++i)if(_f(t[i],t[i+1],e))return!1;return!0}function bf(t,e){for(let i=0;i<e.length;i++)if(xf(t,e[i]))return!0;return!1}function wf(t,e,i){const n=[];for(let r=0;r<t.length;r++){const o=[];for(let n=0;n<t[r].length;n++){const s=df(t[r][n],i);cf(e,s),o.push(s)}n.push(o)}return n}function Sf(t,e,i){const n=[];for(let r=0;r<t.length;r++){const o=wf(t[r],e,i);n.push(o)}return n}function Cf(t,e,i,n){if(t[0]<i[0]||t[0]>i[2]){const e=.5*n;let r=t[0]-i[0]>e?-n:i[0]-t[0]>e?n:0;0===r&&(r=t[0]-i[2]>e?-n:i[2]-t[0]>e?n:0),t[0]+=r}cf(e,t)}function Tf(t,e,i,n){const r=8192*Math.pow(2,n.z),o=[8192*n.x,8192*n.y],s=[];for(const a of t)for(const t of a){const n=[t.x+o[0],t.y+o[1]];Cf(n,e,i,r),s.push(n)}return s}function Ef(t,e,i,n){const r=8192*Math.pow(2,n.z),o=[8192*n.x,8192*n.y],s=[];for(const l of t){const t=[];for(const i of l){const n=[i.x+o[0],i.y+o[1]];cf(e,n),t.push(n)}s.push(t)}if(e[2]-e[0]<=r/2){(a=e)[0]=a[1]=1/0,a[2]=a[3]=-1/0;for(const t of s)for(const n of t)Cf(n,e,i,r)}var a;return s}class kf{constructor(t,e){this.type=Od,this.geojson=t,this.geometries=e}static parse(t,e){if(2!==t.length)return e.error(`'within' expression requires exactly one argument, but found ${t.length-1} instead.`);if(Zd(t[1])){const e=t[1];if("FeatureCollection"===e.type)for(let t=0;t<e.features.length;++t){const i=e.features[t].geometry.type;if("Polygon"===i||"MultiPolygon"===i)return new kf(e,e.features[t].geometry)}else if("Feature"===e.type){const t=e.geometry.type;if("Polygon"===t||"MultiPolygon"===t)return new kf(e,e.geometry)}else if("Polygon"===e.type||"MultiPolygon"===e.type)return new kf(e,e)}return e.error("'within' expression requires valid geojson object that contains polygon geometry type.")}evaluate(t){if(null!=t.geometry()&&null!=t.canonicalID()){if("Point"===t.geometryType())return function(t,e){const i=[1/0,1/0,-1/0,-1/0],n=[1/0,1/0,-1/0,-1/0],r=t.canonicalID();if("Polygon"===e.type){const o=wf(e.coordinates,n,r),s=Tf(t.geometry(),i,n,r);if(!pf(i,n))return!1;for(const t of s)if(!yf(t,o))return!1}if("MultiPolygon"===e.type){const o=Sf(e.coordinates,n,r),s=Tf(t.geometry(),i,n,r);if(!pf(i,n))return!1;for(const t of s)if(!gf(t,o))return!1}return!0}(t,this.geometries);if("LineString"===t.geometryType())return function(t,e){const i=[1/0,1/0,-1/0,-1/0],n=[1/0,1/0,-1/0,-1/0],r=t.canonicalID();if("Polygon"===e.type){const o=wf(e.coordinates,n,r),s=Ef(t.geometry(),i,n,r);if(!pf(i,n))return!1;for(const t of s)if(!xf(t,o))return!1}if("MultiPolygon"===e.type){const o=Sf(e.coordinates,n,r),s=Ef(t.geometry(),i,n,r);if(!pf(i,n))return!1;for(const t of s)if(!bf(t,o))return!1}return!0}(t,this.geometries)}return!1}eachChild(){}outputDefined(){return!0}serialize(){return["within",this.geojson]}}function Pf(t){if(t instanceof uf){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 kf)return!1;let e=!0;return t.eachChild((t=>{e&&!Pf(t)&&(e=!1)})),e}function Of(t){if(t instanceof uf&&"feature-state"===t.name)return!1;let e=!0;return t.eachChild((t=>{e&&!Of(t)&&(e=!1)})),e}function Rf(t,e){if(t instanceof uf&&e.indexOf(t.name)>=0)return!1;let i=!0;return t.eachChild((t=>{i&&!Rf(t,e)&&(i=!1)})),i}class If{constructor(t,e){this.type=e.type,this.name=t,this.boundExpression=e}static parse(t,e){if(2!==t.length||"string"!=typeof t[1])return e.error("'var' expression requires exactly one string literal argument.");const i=t[1];return e.scope.has(i)?new If(i,e.scope.get(i)):e.error(`Unknown variable "${i}". Make sure "${i}" has been bound in an enclosing "let" expression before using it.`,1)}evaluate(t){return this.boundExpression.evaluate(t)}eachChild(){}outputDefined(){return!1}serialize(){return["var",this.name]}}class Ff{constructor(t,e=[],i,n=new Td,r=[]){this.registry=t,this.path=e,this.key=e.map((t=>`[${t}]`)).join(""),this.scope=n,this.errors=r,this.expectedType=i}parse(t,e,i,n,r={}){return e?this.concat(e,i,n)._parse(t,r):this._parse(t,r)}_parse(t,e){function i(t,e,i){return"assert"===i?new ef(e,[t]):"coerce"===i?new sf(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", []].');const r=t[0];if("string"!=typeof r)return this.error(`Expression name must be a string, but found ${typeof r} instead. If you wanted a literal array, use ["literal", [...]].`,0),null;const o=this.registry[r];if(o){let r=o.parse(t,this);if(!r)return null;if(this.expectedType){const t=this.expectedType,n=r.type;if("string"!==t.kind&&"number"!==t.kind&&"boolean"!==t.kind&&"object"!==t.kind&&"array"!==t.kind||"value"!==n.kind)if("color"!==t.kind&&"formatted"!==t.kind&&"resolvedImage"!==t.kind||"value"!==n.kind&&"string"!==n.kind){if(this.checkSubtype(t,n))return null}else r=i(r,t,e.typeAnnotation||"coerce");else r=i(r,t,e.typeAnnotation||"assert")}if(!(r instanceof Jd)&&"resolvedImage"!==r.type.kind&&jf(r)){const t=new lf;try{r=new Jd(r.type,r.evaluate(t))}catch(n){return this.error(n.message),null}}return r}return this.error(`Unknown expression "${r}". 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.`)}concat(t,e,i){const n="number"==typeof t?this.path.concat(t):this.path,r=i?this.scope.concat(i):this.scope;return new Ff(this.registry,n,e||null,r,this.errors)}error(t,...e){const i=`${this.key}${e.map((t=>`[${t}]`)).join("")}`;this.errors.push(new Cd(i,t))}checkSubtype(t,e){const i=Gd(t,e);return i&&this.error(i),i}}function jf(t){if(t instanceof If)return jf(t.boundExpression);if(t instanceof uf&&"error"===t.name)return!1;if(t instanceof hf)return!1;if(t instanceof kf)return!1;const e=t instanceof sf||t instanceof ef;let i=!0;return t.eachChild((t=>{i=e?i&&jf(t):i&&t instanceof Jd})),!!i&&(Pf(t)&&Rf(t,["zoom","heatmap-density","line-progress","sky-radial-progress","accumulated","is-supported-script"]))}function Mf(t,e){const i=t.length-1;let n,r,o=0,s=i,a=0;for(;o<=s;)if(a=Math.floor((o+s)/2),n=t[a],r=t[a+1],n<=e){if(a===i||e<r)return a;o=a+1}else{if(!(n>e))throw new Qd("Input is not a number.");s=a-1}return 0}class Af{constructor(t,e,i){this.type=t,this.input=e,this.labels=[],this.outputs=[];for(const[n,r]of i)this.labels.push(n),this.outputs.push(r)}static parse(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.");const i=e.parse(t[1],1,kd);if(!i)return null;const n=[];let r=null;e.expectedType&&"value"!==e.expectedType.kind&&(r=e.expectedType);for(let o=1;o<t.length;o+=2){const i=1===o?-1/0:t[o],s=t[o+1],a=o,l=o+1;if("number"!=typeof i)return e.error('Input/output pairs for "step" expressions must be defined using literal numeric values (not computed expressions) for the input values.',a);if(n.length&&n[n.length-1][0]>=i)return e.error('Input/output pairs for "step" expressions must be arranged with input values in strictly ascending order.',a);const u=e.parse(s,l,r);if(!u)return null;r=r||u.type,n.push([i,u])}return new Af(r,i,n)}evaluate(t){const e=this.labels,i=this.outputs;if(1===e.length)return i[0].evaluate(t);const n=this.input.evaluate(t);if(n<=e[0])return i[0].evaluate(t);const r=e.length;if(n>=e[r-1])return i[r-1].evaluate(t);return i[Mf(e,n)].evaluate(t)}eachChild(t){t(this.input);for(const e of this.outputs)t(e)}outputDefined(){return this.outputs.every((t=>t.outputDefined()))}serialize(){const t=["step",this.input.serialize()];for(let e=0;e<this.labels.length;e++)e>0&&t.push(this.labels[e]),t.push(this.outputs[e].serialize());return t}}var Lf=zf;function zf(t,e,i,n){this.cx=3*t,this.bx=3*(i-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=i,this.p2y=n}function Df(t,e,i){return t*(1-i)+e*i}zf.prototype.sampleCurveX=function(t){return((this.ax*t+this.bx)*t+this.cx)*t},zf.prototype.sampleCurveY=function(t){return((this.ay*t+this.by)*t+this.cy)*t},zf.prototype.sampleCurveDerivativeX=function(t){return(3*this.ax*t+2*this.bx)*t+this.cx},zf.prototype.solveCurveX=function(t,e){var i,n,r,o,s;for(void 0===e&&(e=1e-6),r=t,s=0;s<8;s++){if(o=this.sampleCurveX(r)-t,Math.abs(o)<e)return r;var a=this.sampleCurveDerivativeX(r);if(Math.abs(a)<1e-6)break;r-=o/a}if((r=t)<(i=0))return i;if(r>(n=1))return n;for(;i<n;){if(o=this.sampleCurveX(r),Math.abs(o-t)<e)return r;t>o?i=r:n=r,r=.5*(n-i)+i}return r},zf.prototype.solve=function(t,e){return this.sampleCurveY(this.solveCurveX(t,e))};var Gf=Object.freeze({__proto__:null,number:Df,color:function(t,e,i){return new qd(Df(t.r,e.r,i),Df(t.g,e.g,i),Df(t.b,e.b,i),Df(t.a,e.a,i))},array:function(t,e,i){return t.map(((t,n)=>Df(t,e[n],i)))}});const Nf=4/29,Bf=6/29,Wf=3*Bf*Bf,qf=Math.PI/180,Vf=180/Math.PI;function Uf(t){return t>.008856451679035631?Math.pow(t,1/3):t/Wf+Nf}function Xf(t){return t>Bf?t*t*t:Wf*(t-Nf)}function Kf(t){return 255*(t<=.0031308?12.92*t:1.055*Math.pow(t,1/2.4)-.055)}function Yf(t){return(t/=255)<=.04045?t/12.92:Math.pow((t+.055)/1.055,2.4)}function Zf(t){const e=Yf(t.r),i=Yf(t.g),n=Yf(t.b),r=Uf((.4124564*e+.3575761*i+.1804375*n)/.95047),o=Uf((.2126729*e+.7151522*i+.072175*n)/1);return{l:116*o-16,a:500*(r-o),b:200*(o-Uf((.0193339*e+.119192*i+.9503041*n)/1.08883)),alpha:t.a}}function Hf(t){let e=(t.l+16)/116,i=isNaN(t.a)?e:e+t.a/500,n=isNaN(t.b)?e:e-t.b/200;return e=1*Xf(e),i=.95047*Xf(i),n=1.08883*Xf(n),new qd(Kf(3.2404542*i-1.5371385*e-.4985314*n),Kf(-.969266*i+1.8760108*e+.041556*n),Kf(.0556434*i-.2040259*e+1.0572252*n),t.alpha)}function $f(t,e,i){const n=e-t;return t+i*(n>180||n<-180?n-360*Math.round(n/360):n)}const Jf={forward:Zf,reverse:Hf,interpolate:function(t,e,i){return{l:Df(t.l,e.l,i),a:Df(t.a,e.a,i),b:Df(t.b,e.b,i),alpha:Df(t.alpha,e.alpha,i)}}},Qf={forward:function(t){const{l:e,a:i,b:n}=Zf(t),r=Math.atan2(n,i)*Vf;return{h:r<0?r+360:r,c:Math.sqrt(i*i+n*n),l:e,alpha:t.a}},reverse:function(t){const e=t.h*qf,i=t.c;return Hf({l:t.l,a:Math.cos(e)*i,b:Math.sin(e)*i,alpha:t.alpha})},interpolate:function(t,e,i){return{h:$f(t.h,e.h,i),c:Df(t.c,e.c,i),l:Df(t.l,e.l,i),alpha:Df(t.alpha,e.alpha,i)}}};class ty{constructor(t,e,i,n,r){this.type=t,this.operator=e,this.interpolation=i,this.input=n,this.labels=[],this.outputs=[];for(const[o,s]of r)this.labels.push(o),this.outputs.push(s)}static interpolationFactor(t,e,i,n){let r=0;if("exponential"===t.name)r=ey(e,t.base,i,n);else if("linear"===t.name)r=ey(e,1,i,n);else if("cubic-bezier"===t.name){const o=t.controlPoints;r=new Lf(o[0],o[1],o[2],o[3]).solve(ey(e,1,i,n))}return r}static parse(t,e){let[i,n,r,...o]=t;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]){const t=n[1];if("number"!=typeof t)return e.error("Exponential interpolation requires a numeric base.",1,1);n={name:"exponential",base:t}}else{if("cubic-bezier"!==n[0])return e.error(`Unknown interpolation type ${String(n[0])}`,1,0);{const t=n.slice(1);if(4!==t.length||t.some((t=>"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:t}}}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(r=e.parse(r,2,kd),!r)return null;const s=[];let a=null;"interpolate-hcl"===i||"interpolate-lab"===i?a=Rd:e.expectedType&&"value"!==e.expectedType.kind&&(a=e.expectedType);for(let l=0;l<o.length;l+=2){const t=o[l],i=o[l+1],n=l+3,r=l+4;if("number"!=typeof t)return e.error('Input/output pairs for "interpolate" expressions must be defined using literal numeric values (not computed expressions) for the input values.',n);if(s.length&&s[s.length-1][0]>=t)return e.error('Input/output pairs for "interpolate" expressions must be arranged with input values in strictly ascending order.',n);const u=e.parse(i,r,a);if(!u)return null;a=a||u.type,s.push([t,u])}return"number"===a.kind||"color"===a.kind||"array"===a.kind&&"number"===a.itemType.kind&&"number"==typeof a.N?new ty(a,i,n,r,s):e.error(`Type ${zd(a)} is not interpolatable.`)}evaluate(t){const e=this.labels,i=this.outputs;if(1===e.length)return i[0].evaluate(t);const n=this.input.evaluate(t);if(n<=e[0])return i[0].evaluate(t);const r=e.length;if(n>=e[r-1])return i[r-1].evaluate(t);const o=Mf(e,n),s=e[o],a=e[o+1],l=ty.interpolationFactor(this.interpolation,n,s,a),u=i[o].evaluate(t),h=i[o+1].evaluate(t);return"interpolate"===this.operator?Gf[this.type.kind.toLowerCase()](u,h,l):"interpolate-hcl"===this.operator?Qf.reverse(Qf.interpolate(Qf.forward(u),Qf.forward(h),l)):Jf.reverse(Jf.interpolate(Jf.forward(u),Jf.forward(h),l))}eachChild(t){t(this.input);for(const e of this.outputs)t(e)}outputDefined(){return this.outputs.every((t=>t.outputDefined()))}serialize(){let 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);const e=[this.operator,t,this.input.serialize()];for(let i=0;i<this.labels.length;i++)e.push(this.labels[i],this.outputs[i].serialize());return e}}function ey(t,e,i,n){const r=n-i,o=t-i;return 0===r?0:1===e?o/r:(Math.pow(e,o)-1)/(Math.pow(e,r)-1)}class iy{constructor(t,e){this.type=t,this.args=e}static parse(t,e){if(t.length<2)return e.error("Expectected at least one argument.");let i=null;const n=e.expectedType;n&&"value"!==n.kind&&(i=n);const r=[];for(const s of t.slice(1)){const t=e.parse(s,1+r.length,i,void 0,{typeAnnotation:"omit"});if(!t)return null;i=i||t.type,r.push(t)}const o=n&&r.some((t=>Gd(n,t.type)));return new iy(o?Fd:i,r)}evaluate(t){let e,i=null,n=0;for(const r of this.args)if(n++,i=r.evaluate(t),i&&i instanceof Kd&&!i.available&&(e||(e=i.name),i=null,n===this.args.length&&(i=e)),null!==i)break;return i}eachChild(t){this.args.forEach(t)}outputDefined(){return this.args.every((t=>t.outputDefined()))}serialize(){const t=["coalesce"];return this.eachChild((e=>{t.push(e.serialize())})),t}}class ny{constructor(t,e){this.type=e.type,this.bindings=[].concat(t),this.result=e}evaluate(t){return this.result.evaluate(t)}eachChild(t){for(const e of this.bindings)t(e[1]);t(this.result)}static parse(t,e){if(t.length<4)return e.error(`Expected at least 3 arguments, but found ${t.length-1} instead.`);const i=[];for(let r=1;r<t.length-1;r+=2){const n=t[r];if("string"!=typeof n)return e.error(`Expected string, but found ${typeof n} instead.`,r);if(/[^a-zA-Z0-9_]/.test(n))return e.error("Variable names must contain only alphanumeric characters or '_'.",r);const o=e.parse(t[r+1],r+1);if(!o)return null;i.push([n,o])}const n=e.parse(t[t.length-1],t.length-1,e.expectedType,i);return n?new ny(i,n):null}outputDefined(){return this.result.outputDefined()}serialize(){const t=["let"];for(const[e,i]of this.bindings)t.push(e,i.serialize());return t.push(this.result.serialize()),t}}class ry{constructor(t,e,i){this.type=t,this.index=e,this.input=i}static parse(t,e){if(3!==t.length)return e.error(`Expected 2 arguments, but found ${t.length-1} instead.`);const i=e.parse(t[1],1,kd),n=e.parse(t[2],2,Ld(e.expectedType||Fd));if(!i||!n)return null;const r=n.type;return new ry(r.itemType,i,n)}evaluate(t){const e=this.index.evaluate(t),i=this.input.evaluate(t);if(e<0)throw new Qd(`Array index out of bounds: ${e} < 0.`);if(e>=i.length)throw new Qd(`Array index out of bounds: ${e} > ${i.length-1}.`);if(e!==Math.floor(e))throw new Qd(`Array index must be an integer, but found ${e} instead.`);return i[e]}eachChild(t){t(this.index),t(this.input)}outputDefined(){return!1}serialize(){return["at",this.index.serialize(),this.input.serialize()]}}class oy{constructor(t,e){this.type=Od,this.needle=t,this.haystack=e}static parse(t,e){if(3!==t.length)return e.error(`Expected 2 arguments, but found ${t.length-1} instead.`);const i=e.parse(t[1],1,Fd),n=e.parse(t[2],2,Fd);return i&&n?Nd(i.type,[Od,Pd,kd,Ed,Fd])?new oy(i,n):e.error(`Expected first argument to be of type boolean, string, number or null, but found ${zd(i.type)} instead`):null}evaluate(t){const e=this.needle.evaluate(t),i=this.haystack.evaluate(t);if(!i)return!1;if(!Bd(e,["boolean","string","number","null"]))throw new Qd(`Expected first argument to be of type boolean, string, number or null, but found ${zd(Hd(e))} instead.`);if(!Bd(i,["string","array"]))throw new Qd(`Expected second argument to be of type array or string, but found ${zd(Hd(i))} instead.`);return i.indexOf(e)>=0}eachChild(t){t(this.needle),t(this.haystack)}outputDefined(){return!0}serialize(){return["in",this.needle.serialize(),this.haystack.serialize()]}}class sy{constructor(t,e,i){this.type=kd,this.needle=t,this.haystack=e,this.fromIndex=i}static parse(t,e){if(t.length<=2||t.length>=5)return e.error(`Expected 3 or 4 arguments, but found ${t.length-1} instead.`);const i=e.parse(t[1],1,Fd),n=e.parse(t[2],2,Fd);if(!i||!n)return null;if(!Nd(i.type,[Od,Pd,kd,Ed,Fd]))return e.error(`Expected first argument to be of type boolean, string, number or null, but found ${zd(i.type)} instead`);if(4===t.length){const r=e.parse(t[3],3,kd);return r?new sy(i,n,r):null}return new sy(i,n)}evaluate(t){const e=this.needle.evaluate(t),i=this.haystack.evaluate(t);if(!Bd(e,["boolean","string","number","null"]))throw new Qd(`Expected first argument to be of type boolean, string, number or null, but found ${zd(Hd(e))} instead.`);if(!Bd(i,["string","array"]))throw new Qd(`Expected second argument to be of type array or string, but found ${zd(Hd(i))} instead.`);if(this.fromIndex){const n=this.fromIndex.evaluate(t);return i.indexOf(e,n)}return i.indexOf(e)}eachChild(t){t(this.needle),t(this.haystack),this.fromIndex&&t(this.fromIndex)}outputDefined(){return!1}serialize(){if(null!=this.fromIndex&&void 0!==this.fromIndex){const t=this.fromIndex.serialize();return["index-of",this.needle.serialize(),this.haystack.serialize(),t]}return["index-of",this.needle.serialize(),this.haystack.serialize()]}}class ay{constructor(t,e,i,n,r,o){this.inputType=t,this.type=e,this.input=i,this.cases=n,this.outputs=r,this.otherwise=o}static parse(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.");let i,n;e.expectedType&&"value"!==e.expectedType.kind&&(n=e.expectedType);const r={},o=[];for(let l=2;l<t.length-1;l+=2){let s=t[l];const a=t[l+1];Array.isArray(s)||(s=[s]);const u=e.concat(l);if(0===s.length)return u.error("Expected at least one branch label.");for(const t of s){if("number"!=typeof t&&"string"!=typeof t)return u.error("Branch labels must be numbers or strings.");if("number"==typeof t&&Math.abs(t)>Number.MAX_SAFE_INTEGER)return u.error(`Branch labels must be integers no larger than ${Number.MAX_SAFE_INTEGER}.`);if("number"==typeof t&&Math.floor(t)!==t)return u.error("Numeric branch labels must be integer values.");if(i){if(u.checkSubtype(i,Hd(t)))return null}else i=Hd(t);if(void 0!==r[String(t)])return u.error("Branch labels must be unique.");r[String(t)]=o.length}const h=e.parse(a,l,n);if(!h)return null;n=n||h.type,o.push(h)}const s=e.parse(t[1],1,Fd);if(!s)return null;const a=e.parse(t[t.length-1],t.length-1,n);return a?"value"!==s.type.kind&&e.concat(1).checkSubtype(i,s.type)?null:new ay(i,n,s,r,o,a):null}evaluate(t){const e=this.input.evaluate(t);return(Hd(e)===this.inputType&&this.outputs[this.cases[e]]||this.otherwise).evaluate(t)}eachChild(t){t(this.input),this.outputs.forEach(t),t(this.otherwise)}outputDefined(){return this.outputs.every((t=>t.outputDefined()))&&this.otherwise.outputDefined()}serialize(){const t=["match",this.input.serialize()],e=Object.keys(this.cases).sort(),i=[],n={};for(const o of e){const t=n[this.cases[o]];void 0===t?(n[this.cases[o]]=i.length,i.push([this.cases[o],[o]])):i[t][1].push(o)}const r=t=>"number"===this.inputType.kind?Number(t):t;for(const[o,s]of i)1===s.length?t.push(r(s[0])):t.push(s.map(r)),t.push(this.outputs[o].serialize());return t.push(this.otherwise.serialize()),t}}class ly{constructor(t,e,i){this.type=t,this.branches=e,this.otherwise=i}static parse(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.");let i;e.expectedType&&"value"!==e.expectedType.kind&&(i=e.expectedType);const n=[];for(let o=1;o<t.length-1;o+=2){const r=e.parse(t[o],o,Od);if(!r)return null;const s=e.parse(t[o+1],o+1,i);if(!s)return null;n.push([r,s]),i=i||s.type}const r=e.parse(t[t.length-1],t.length-1,i);return r?new ly(i,n,r):null}evaluate(t){for(const[e,i]of this.branches)if(e.evaluate(t))return i.evaluate(t);return this.otherwise.evaluate(t)}eachChild(t){for(const[e,i]of this.branches)t(e),t(i);t(this.otherwise)}outputDefined(){return this.branches.every((([t,e])=>e.outputDefined()))&&this.otherwise.outputDefined()}serialize(){const t=["case"];return this.eachChild((e=>{t.push(e.serialize())})),t}}class uy{constructor(t,e,i,n){this.type=t,this.input=e,this.beginIndex=i,this.endIndex=n}static parse(t,e){if(t.length<=2||t.length>=5)return e.error(`Expected 3 or 4 arguments, but found ${t.length-1} instead.`);const i=e.parse(t[1],1,Fd),n=e.parse(t[2],2,kd);if(!i||!n)return null;if(!Nd(i.type,[Ld(Fd),Pd,Fd]))return e.error(`Expected first argument to be of type array or string, but found ${zd(i.type)} instead`);if(4===t.length){const r=e.parse(t[3],3,kd);return r?new uy(i.type,i,n,r):null}return new uy(i.type,i,n)}evaluate(t){const e=this.input.evaluate(t),i=this.beginIndex.evaluate(t);if(!Bd(e,["string","array"]))throw new Qd(`Expected first argument to be of type array or string, but found ${zd(Hd(e))} instead.`);if(this.endIndex){const n=this.endIndex.evaluate(t);return e.slice(i,n)}return e.slice(i)}eachChild(t){t(this.input),t(this.beginIndex),this.endIndex&&t(this.endIndex)}outputDefined(){return!1}serialize(){if(null!=this.endIndex&&void 0!==this.endIndex){const t=this.endIndex.serialize();return["slice",this.input.serialize(),this.beginIndex.serialize(),t]}return["slice",this.input.serialize(),this.beginIndex.serialize()]}}function hy(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 cy(t,e,i,n){return 0===n.compare(e,i)}function py(t,e,i){const n="=="!==t&&"!="!==t;return class r{constructor(t,e,i){this.type=Od,this.lhs=t,this.rhs=e,this.collator=i,this.hasUntypedArgument="value"===t.type.kind||"value"===e.type.kind}static parse(t,e){if(3!==t.length&&4!==t.length)return e.error("Expected two or three arguments.");const i=t[0];let o=e.parse(t[1],1,Fd);if(!o)return null;if(!hy(i,o.type))return e.concat(1).error(`"${i}" comparisons are not supported for type '${zd(o.type)}'.`);let s=e.parse(t[2],2,Fd);if(!s)return null;if(!hy(i,s.type))return e.concat(2).error(`"${i}" comparisons are not supported for type '${zd(s.type)}'.`);if(o.type.kind!==s.type.kind&&"value"!==o.type.kind&&"value"!==s.type.kind)return e.error(`Cannot compare types '${zd(o.type)}' and '${zd(s.type)}'.`);n&&("value"===o.type.kind&&"value"!==s.type.kind?o=new ef(s.type,[o]):"value"!==o.type.kind&&"value"===s.type.kind&&(s=new ef(o.type,[s])));let a=null;if(4===t.length){if("string"!==o.type.kind&&"string"!==s.type.kind&&"value"!==o.type.kind&&"value"!==s.type.kind)return e.error("Cannot use collator to compare non-string types.");if(a=e.parse(t[3],3,jd),!a)return null}return new r(o,s,a)}evaluate(r){const o=this.lhs.evaluate(r),s=this.rhs.evaluate(r);if(n&&this.hasUntypedArgument){const e=Hd(o),i=Hd(s);if(e.kind!==i.kind||"string"!==e.kind&&"number"!==e.kind)throw new Qd(`Expected arguments for "${t}" to be (string, string) or (number, number), but found (${e.kind}, ${i.kind}) instead.`)}if(this.collator&&!n&&this.hasUntypedArgument){const t=Hd(o),i=Hd(s);if("string"!==t.kind||"string"!==i.kind)return e(r,o,s)}return this.collator?i(r,o,s,this.collator.evaluate(r)):e(r,o,s)}eachChild(t){t(this.lhs),t(this.rhs),this.collator&&t(this.collator)}outputDefined(){return!0}serialize(){const e=[t];return this.eachChild((t=>{e.push(t.serialize())})),e}}}const dy=py("==",(function(t,e,i){return e===i}),cy),fy=py("!=",(function(t,e,i){return e!==i}),(function(t,e,i,n){return!cy(0,e,i,n)})),yy=py("<",(function(t,e,i){return e<i}),(function(t,e,i,n){return n.compare(e,i)<0})),gy=py(">",(function(t,e,i){return e>i}),(function(t,e,i,n){return n.compare(e,i)>0})),my=py("<=",(function(t,e,i){return e<=i}),(function(t,e,i,n){return n.compare(e,i)<=0})),vy=py(">=",(function(t,e,i){return e>=i}),(function(t,e,i,n){return n.compare(e,i)>=0}));class _y{constructor(t,e,i,n,r){this.type=Pd,this.number=t,this.locale=e,this.currency=i,this.minFractionDigits=n,this.maxFractionDigits=r}static parse(t,e){if(3!==t.length)return e.error("Expected two arguments.");const i=e.parse(t[1],1,kd);if(!i)return null;const n=t[2];if("object"!=typeof n||Array.isArray(n))return e.error("NumberFormat options argument must be an object.");let r=null;if(n.locale&&(r=e.parse(n.locale,1,Pd),!r))return null;let o=null;if(n.currency&&(o=e.parse(n.currency,1,Pd),!o))return null;let s=null;if(n["min-fraction-digits"]&&(s=e.parse(n["min-fraction-digits"],1,kd),!s))return null;let a=null;return n["max-fraction-digits"]&&(a=e.parse(n["max-fraction-digits"],1,kd),!a)?null:new _y(i,r,o,s,a)}evaluate(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))}eachChild(t){t(this.number),this.locale&&t(this.locale),this.currency&&t(this.currency),this.minFractionDigits&&t(this.minFractionDigits),this.maxFractionDigits&&t(this.maxFractionDigits)}outputDefined(){return!1}serialize(){const 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]}}class xy{constructor(t){this.type=kd,this.input=t}static parse(t,e){if(2!==t.length)return e.error(`Expected 1 argument, but found ${t.length-1} instead.`);const i=e.parse(t[1],1);return i?"array"!==i.type.kind&&"string"!==i.type.kind&&"value"!==i.type.kind?e.error(`Expected argument of type string or array, but found ${zd(i.type)} instead.`):new xy(i):null}evaluate(t){const e=this.input.evaluate(t);if("string"==typeof e)return e.length;if(Array.isArray(e))return e.length;throw new Qd(`Expected value to be of type string or array, but found ${zd(Hd(e))} instead.`)}eachChild(t){t(this.input)}outputDefined(){return!1}serialize(){const t=["length"];return this.eachChild((e=>{t.push(e.serialize())})),t}}const by={"==":dy,"!=":fy,">":gy,"<":yy,">=":vy,"<=":my,array:ef,at:ry,boolean:ef,case:ly,coalesce:iy,collator:hf,format:nf,image:rf,in:oy,"index-of":sy,interpolate:ty,"interpolate-hcl":ty,"interpolate-lab":ty,length:xy,let:ny,literal:Jd,match:ay,number:ef,"number-format":_y,object:ef,slice:uy,step:Af,string:ef,"to-boolean":sf,"to-color":sf,"to-number":sf,"to-string":sf,var:If,within:kf};function wy(t,[e,i,n,r]){e=e.evaluate(t),i=i.evaluate(t),n=n.evaluate(t);const o=r?r.evaluate(t):1,s=Yd(e,i,n,o);if(s)throw new Qd(s);return new qd(e/255*o,i/255*o,n/255*o,o)}function Sy(t,e){return t in e}function Cy(t,e){const i=e[t];return void 0===i?null:i}function Ty(t){return{type:t}}function Ey(t){return{result:"success",value:t}}function ky(t){return{result:"error",value:t}}function Py(t){return!!t.expression&&t.expression.interpolated}function Oy(t){return"object"==typeof t&&null!==t&&!Array.isArray(t)}uf.register(by,{error:[{kind:"error"},[Pd],(t,[e])=>{throw new Qd(e.evaluate(t))}],typeof:[Pd,[Fd],(t,[e])=>zd(Hd(e.evaluate(t)))],"to-rgba":[Ld(kd,4),[Rd],(t,[e])=>e.evaluate(t).toArray()],rgb:[Rd,[kd,kd,kd],wy],rgba:[Rd,[kd,kd,kd,kd],wy],has:{type:Od,overloads:[[[Pd],(t,[e])=>Sy(e.evaluate(t),t.properties())],[[Pd,Id],(t,[e,i])=>Sy(e.evaluate(t),i.evaluate(t))]]},get:{type:Fd,overloads:[[[Pd],(t,[e])=>Cy(e.evaluate(t),t.properties())],[[Pd,Id],(t,[e,i])=>Cy(e.evaluate(t),i.evaluate(t))]]},"feature-state":[Fd,[Pd],(t,[e])=>Cy(e.evaluate(t),t.featureState||{})],properties:[Id,[],t=>t.properties()],"geometry-type":[Pd,[],t=>t.geometryType()],id:[Fd,[],t=>t.id()],zoom:[kd,[],t=>t.globals.zoom],"heatmap-density":[kd,[],t=>t.globals.heatmapDensity||0],"line-progress":[kd,[],t=>t.globals.lineProgress||0],"sky-radial-progress":[kd,[],t=>t.globals.skyRadialProgress||0],accumulated:[Fd,[],t=>void 0===t.globals.accumulated?null:t.globals.accumulated],"+":[kd,Ty(kd),(t,e)=>{let i=0;for(const n of e)i+=n.evaluate(t);return i}],"*":[kd,Ty(kd),(t,e)=>{let i=1;for(const n of e)i*=n.evaluate(t);return i}],"-":{type:kd,overloads:[[[kd,kd],(t,[e,i])=>e.evaluate(t)-i.evaluate(t)],[[kd],(t,[e])=>-e.evaluate(t)]]},"/":[kd,[kd,kd],(t,[e,i])=>e.evaluate(t)/i.evaluate(t)],"%":[kd,[kd,kd],(t,[e,i])=>e.evaluate(t)%i.evaluate(t)],ln2:[kd,[],()=>Math.LN2],pi:[kd,[],()=>Math.PI],e:[kd,[],()=>Math.E],"^":[kd,[kd,kd],(t,[e,i])=>Math.pow(e.evaluate(t),i.evaluate(t))],sqrt:[kd,[kd],(t,[e])=>Math.sqrt(e.evaluate(t))],log10:[kd,[kd],(t,[e])=>Math.log(e.evaluate(t))/Math.LN10],ln:[kd,[kd],(t,[e])=>Math.log(e.evaluate(t))],log2:[kd,[kd],(t,[e])=>Math.log(e.evaluate(t))/Math.LN2],sin:[kd,[kd],(t,[e])=>Math.sin(e.evaluate(t))],cos:[kd,[kd],(t,[e])=>Math.cos(e.evaluate(t))],tan:[kd,[kd],(t,[e])=>Math.tan(e.evaluate(t))],asin:[kd,[kd],(t,[e])=>Math.asin(e.evaluate(t))],acos:[kd,[kd],(t,[e])=>Math.acos(e.evaluate(t))],atan:[kd,[kd],(t,[e])=>Math.atan(e.evaluate(t))],min:[kd,Ty(kd),(t,e)=>Math.min(...e.map((e=>e.evaluate(t))))],max:[kd,Ty(kd),(t,e)=>Math.max(...e.map((e=>e.evaluate(t))))],abs:[kd,[kd],(t,[e])=>Math.abs(e.evaluate(t))],round:[kd,[kd],(t,[e])=>{const i=e.evaluate(t);return i<0?-Math.round(-i):Math.round(i)}],floor:[kd,[kd],(t,[e])=>Math.floor(e.evaluate(t))],ceil:[kd,[kd],(t,[e])=>Math.ceil(e.evaluate(t))],"filter-==":[Od,[Pd,Fd],(t,[e,i])=>t.properties()[e.value]===i.value],"filter-id-==":[Od,[Fd],(t,[e])=>t.id()===e.value],"filter-type-==":[Od,[Pd],(t,[e])=>t.geometryType()===e.value],"filter-<":[Od,[Pd,Fd],(t,[e,i])=>{const n=t.properties()[e.value],r=i.value;return typeof n==typeof r&&n<r}],"filter-id-<":[Od,[Fd],(t,[e])=>{const i=t.id(),n=e.value;return typeof i==typeof n&&i<n}],"filter->":[Od,[Pd,Fd],(t,[e,i])=>{const n=t.properties()[e.value],r=i.value;return typeof n==typeof r&&n>r}],"filter-id->":[Od,[Fd],(t,[e])=>{const i=t.id(),n=e.value;return typeof i==typeof n&&i>n}],"filter-<=":[Od,[Pd,Fd],(t,[e,i])=>{const n=t.properties()[e.value],r=i.value;return typeof n==typeof r&&n<=r}],"filter-id-<=":[Od,[Fd],(t,[e])=>{const i=t.id(),n=e.value;return typeof i==typeof n&&i<=n}],"filter->=":[Od,[Pd,Fd],(t,[e,i])=>{const n=t.properties()[e.value],r=i.value;return typeof n==typeof r&&n>=r}],"filter-id->=":[Od,[Fd],(t,[e])=>{const i=t.id(),n=e.value;return typeof i==typeof n&&i>=n}],"filter-has":[Od,[Fd],(t,[e])=>e.value in t.properties()],"filter-has-id":[Od,[],t=>null!==t.id()&&void 0!==t.id()],"filter-type-in":[Od,[Ld(Pd)],(t,[e])=>e.value.indexOf(t.geometryType())>=0],"filter-id-in":[Od,[Ld(Fd)],(t,[e])=>e.value.indexOf(t.id())>=0],"filter-in-small":[Od,[Pd,Ld(Fd)],(t,[e,i])=>i.value.indexOf(t.properties()[e.value])>=0],"filter-in-large":[Od,[Pd,Ld(Fd)],(t,[e,i])=>function(t,e,i,n){for(;i<=n;){const r=i+n>>1;if(e[r]===t)return!0;e[r]>t?n=r-1:i=r+1}return!1}(t.properties()[e.value],i.value,0,i.value.length-1)],all:{type:Od,overloads:[[[Od,Od],(t,[e,i])=>e.evaluate(t)&&i.evaluate(t)],[Ty(Od),(t,e)=>{for(const i of e)if(!i.evaluate(t))return!1;return!0}]]},any:{type:Od,overloads:[[[Od,Od],(t,[e,i])=>e.evaluate(t)||i.evaluate(t)],[Ty(Od),(t,e)=>{for(const i of e)if(i.evaluate(t))return!0;return!1}]]},"!":[Od,[Od],(t,[e])=>!e.evaluate(t)],"is-supported-script":[Od,[Pd],(t,[e])=>{const i=t.globals&&t.globals.isSupportedScript;return!i||i(e.evaluate(t))}],upcase:[Pd,[Pd],(t,[e])=>e.evaluate(t).toUpperCase()],downcase:[Pd,[Pd],(t,[e])=>e.evaluate(t).toLowerCase()],concat:[Pd,Ty(Fd),(t,e)=>e.map((e=>$d(e.evaluate(t)))).join("")],"resolved-locale":[Pd,[jd],(t,[e])=>e.evaluate(t).resolvedLocale()]});class Ry{constructor(t,e){var i;this.expression=t,this._warningHistory={},this._evaluator=new lf,this._defaultValue=e?"color"===(i=e).type&&Oy(i.default)?new qd(0,0,0,0):"color"===i.type?qd.parse(i.default)||null:void 0===i.default?null:i.default:null,this._enumValues=e&&"enum"===e.type?e.values:null}evaluateWithoutErrorHandling(t,e,i,n,r,o){return this._evaluator.globals=t,this._evaluator.feature=e,this._evaluator.featureState=i,this._evaluator.canonical=n,this._evaluator.availableImages=r||null,this._evaluator.formattedSection=o,this.expression.evaluate(this._evaluator)}evaluate(t,e,i,n,r,o){this._evaluator.globals=t,this._evaluator.feature=e||null,this._evaluator.featureState=i||null,this._evaluator.canonical=n,this._evaluator.availableImages=r||null,this._evaluator.formattedSection=o||null;try{const t=this.expression.evaluate(this._evaluator);if(null==t||"number"==typeof t&&t!=t)return this._defaultValue;if(this._enumValues&&!(t in this._enumValues))throw new Qd(`Expected value to be one of ${Object.keys(this._enumValues).map((t=>JSON.stringify(t))).join(", ")}, but found ${JSON.stringify(t)} instead.`);return t}catch(s){return this._warningHistory[s.message]||(this._warningHistory[s.message]=!0,"undefined"!=typeof console&&console.warn(s.message)),this._defaultValue}}}function Iy(t){return Array.isArray(t)&&t.length>0&&"string"==typeof t[0]&&t[0]in by}function Fy(t,e){const i=new Ff(by,[],e?function(t){const e={color:Rd,string:Pd,number:kd,enum:Pd,boolean:Od,formatted:Md,resolvedImage:Ad};if("array"===t.type)return Ld(e[t.value]||Fd,t.length);return e[t.type]}(e):void 0),n=i.parse(t,void 0,void 0,void 0,e&&"string"===e.type?{typeAnnotation:"coerce"}:void 0);return n?Ey(new Ry(n,e)):ky(i.errors)}class jy{constructor(t,e){this.kind=t,this._styleExpression=e,this.isStateDependent="constant"!==t&&!Of(e.expression)}evaluateWithoutErrorHandling(t,e,i,n,r,o){return this._styleExpression.evaluateWithoutErrorHandling(t,e,i,n,r,o)}evaluate(t,e,i,n,r,o){return this._styleExpression.evaluate(t,e,i,n,r,o)}}class My{constructor(t,e,i,n){this.kind=t,this.zoomStops=i,this._styleExpression=e,this.isStateDependent="camera"!==t&&!Of(e.expression),this.interpolationType=n}evaluateWithoutErrorHandling(t,e,i,n,r,o){return this._styleExpression.evaluateWithoutErrorHandling(t,e,i,n,r,o)}evaluate(t,e,i,n,r,o){return this._styleExpression.evaluate(t,e,i,n,r,o)}interpolationFactor(t,e,i){return this.interpolationType?ty.interpolationFactor(this.interpolationType,t,e,i):0}}function Ay(t,e){if("error"===(t=Fy(t,e)).result)return t;const i=t.value.expression,n=Pf(i);if(!n&&("data-driven"!==(r=e)["property-type"]&&"cross-faded-data-driven"!==r["property-type"]))return ky([new Cd("","data expressions not supported")]);var r;const o=Rf(i,["zoom"]);if(!o&&!function(t){return!!t.expression&&t.expression.parameters.indexOf("zoom")>-1}(e))return ky([new Cd("","zoom expressions not supported")]);const s=Ly(i);if(!s&&!o)return ky([new Cd("",'"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression.')]);if(s instanceof Cd)return ky([s]);if(s instanceof ty&&!Py(e))return ky([new Cd("",'"interpolate" expressions cannot be used with this property')]);if(!s)return Ey(new jy(n?"constant":"source",t.value));const a=s instanceof ty?s.interpolation:void 0;return Ey(new My(n?"camera":"composite",t.value,s.labels,a))}function Ly(t){let e=null;if(t instanceof ny)e=Ly(t.result);else if(t instanceof iy){for(const i of t.args)if(e=Ly(i),e)break}else(t instanceof Af||t instanceof ty)&&t.input instanceof uf&&"zoom"===t.input.name&&(e=t);return e instanceof Cd||t.eachChild((t=>{const i=Ly(t);i instanceof Cd?e=i:!e&&i?e=new Cd("",'"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression.'):e&&i&&e!==i&&(e=new Cd("",'Only one zoom-based "step" or "interpolate" subexpression may be used in an expression.'))})),e}function zy(t){return"object"==typeof t?["literal",t]:t}function Dy(t){switch(t.colorSpace){case"hcl":return"interpolate-hcl";case"lab":return"interpolate-lab";default:return"interpolate"}}function Gy(t,e){const i=zy((n=t.default,r=e.default,void 0!==n?n:void 0!==r?r:void 0));var n,r;return void 0===i&&"resolvedImage"===e.type?"":i}function Ny(t,e,i){const n=qy(t,e),r=["get",t.property];if("categorical"===n&&"boolean"==typeof i[0][0]){const n=["case"];for(const t of i)n.push(["==",r,t[0]],t[1]);return n.push(Gy(t,e)),n}if("categorical"===n){const n=["match",r];for(const t of i)Wy(n,t[0],t[1],!1);return n.push(Gy(t,e)),n}if("interval"===n){const e=["step",["number",r]];for(const t of i)Wy(e,t[0],t[1],!0);return By(e),void 0===t.default?e:["case",["==",["typeof",r],"number"],e,zy(t.default)]}if("exponential"===n){const e=void 0!==t.base?t.base:1,n=[Dy(t),1===e?["linear"]:["exponential",e],["number",r]];for(const t of i)Wy(n,t[0],t[1],!1);return void 0===t.default?n:["case",["==",["typeof",r],"number"],n,zy(t.default)]}throw new Error(`Unknown property function type ${n}`)}function By(t){"step"===t[0]&&3===t.length&&(t.push(0),t.push(t[3]))}function Wy(t,e,i,n){t.length>3&&e===t[t.length-2]||(n&&2===t.length||t.push(e),t.push(i))}function qy(t,e){return t.type?t.type:e.expression.interpolated?"exponential":"interval"}function Vy(t){const e=["concat"],i=/{([^{}]+)}/g;let n=0;for(let r=i.exec(t);null!==r;r=i.exec(t)){const o=t.slice(n,i.lastIndex-r[0].length);n=i.lastIndex,o.length>0&&e.push(o),e.push(["get",r[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}function Uy(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(const e of t.slice(1))if(!Uy(e)&&"boolean"!=typeof e)return!1;return!0;default:return!0}}const Xy={type:"boolean",default:!1,transition:!1,"property-type":"data-driven",expression:{interpolated:!1,parameters:["zoom","feature"]}};function Ky(t){if(null==t)return{filter:()=>!0,needGeometry:!1};Uy(t)||(t=Hy(t));const e=Fy(t,Xy);if("error"===e.result)throw new Error(e.value.map((t=>`${t.key}: ${t.message}`)).join(", "));return{filter:(t,i,n)=>e.value.evaluate(t,i,{},n),needGeometry:Zy(t)}}function Yy(t,e){return t<e?-1:t>e?1:0}function Zy(t){if(!Array.isArray(t))return!1;if("within"===t[0])return!0;for(let e=1;e<t.length;e++)if(Zy(t[e]))return!0;return!1}function Hy(t){if(!t)return!0;const e=t[0];if(t.length<=1)return"any"!==e;var i;return"=="===e?$y(t[1],t[2],"=="):"!="===e?tg($y(t[1],t[2],"==")):"<"===e||">"===e||"<="===e||">="===e?$y(t[1],t[2],e):"any"===e?(i=t.slice(1),["any"].concat(i.map(Hy))):"all"===e?["all"].concat(t.slice(1).map(Hy)):"none"===e?["all"].concat(t.slice(1).map(Hy).map(tg)):"in"===e?Jy(t[1],t.slice(2)):"!in"===e?tg(Jy(t[1],t.slice(2))):"has"===e?Qy(t[1]):"!has"===e?tg(Qy(t[1])):"within"!==e||t}function $y(t,e,i){switch(t){case"$type":return[`filter-type-${i}`,e];case"$id":return[`filter-id-${i}`,e];default:return[`filter-${i}`,t,e]}}function Jy(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((t=>typeof t!=typeof e[0]))?["filter-in-large",t,["literal",e.sort(Yy)]]:["filter-in-small",t,["literal",e]]}}function Qy(t){switch(t){case"$type":return!0;case"$id":return["filter-has-id"];default:return["filter-has",t]}}function tg(t){return["!",t]}var eg=["type","source","source-layer","minzoom","maxzoom","filter","layout"];function ig(t,e){const i={};for(const n in t)"ref"!==n&&(i[n]=t[n]);return eg.forEach((t=>{t in e&&(i[t]=e[t])})),i}_d((function(t,e){var i=function(){var t=function(t,e,i,n){for(i=i||{},n=t.length;n--;i[t[n]]=e);return i},e=[1,12],i=[1,13],n=[1,9],r=[1,10],o=[1,11],s=[1,14],a=[1,15],l=[14,18,22,24],u=[18,22],h=[22,24],c={trace:function(){},yy:{},symbols_:{error:2,JSONString:3,STRING:4,JSONNumber:5,NUMBER:6,JSONNullLiteral:7,NULL:8,JSONBooleanLiteral:9,TRUE:10,FALSE:11,JSONText:12,JSONValue:13,EOF:14,JSONObject:15,JSONArray:16,"{":17,"}":18,JSONMemberList:19,JSONMember:20,":":21,",":22,"[":23,"]":24,JSONElementList:25,$accept:0,$end:1},terminals_:{2:"error",4:"STRING",6:"NUMBER",8:"NULL",10:"TRUE",11:"FALSE",14:"EOF",17:"{",18:"}",21:":",22:",",23:"[",24:"]"},productions_:[0,[3,1],[5,1],[7,1],[9,1],[9,1],[12,2],[13,1],[13,1],[13,1],[13,1],[13,1],[13,1],[15,2],[15,3],[20,3],[19,1],[19,3],[16,2],[16,3],[25,1],[25,3]],performAction:function(t,e,i,n,r,o,s){var a=o.length-1;switch(r){case 1:this.$=new String(t.replace(/\\(\\|")/g,"$1").replace(/\\n/g,"\n").replace(/\\r/g,"\r").replace(/\\t/g,"\t").replace(/\\v/g,"\v").replace(/\\f/g,"\f").replace(/\\b/g,"\b")),this.$.__line__=this._$.first_line;break;case 2:this.$=new Number(t),this.$.__line__=this._$.first_line;break;case 3:this.$=null;break;case 4:this.$=new Boolean(!0),this.$.__line__=this._$.first_line;break;case 5:this.$=new Boolean(!1),this.$.__line__=this._$.first_line;break;case 6:return this.$=o[a-1];case 13:this.$={},Object.defineProperty(this.$,"__line__",{value:this._$.first_line,enumerable:!1});break;case 14:case 19:this.$=o[a-1],Object.defineProperty(this.$,"__line__",{value:this._$.first_line,enumerable:!1});break;case 15:this.$=[o[a-2],o[a]];break;case 16:this.$={},this.$[o[a][0]]=o[a][1];break;case 17:this.$=o[a-2],o[a-2][o[a][0]]=o[a][1];break;case 18:this.$=[],Object.defineProperty(this.$,"__line__",{value:this._$.first_line,enumerable:!1});break;case 20:this.$=[o[a]];break;case 21:this.$=o[a-2],o[a-2].push(o[a])}},table:[{3:5,4:e,5:6,6:i,7:3,8:n,9:4,10:r,11:o,12:1,13:2,15:7,16:8,17:s,23:a},{1:[3]},{14:[1,16]},t(l,[2,7]),t(l,[2,8]),t(l,[2,9]),t(l,[2,10]),t(l,[2,11]),t(l,[2,12]),t(l,[2,3]),t(l,[2,4]),t(l,[2,5]),t([14,18,21,22,24],[2,1]),t(l,[2,2]),{3:20,4:e,18:[1,17],19:18,20:19},{3:5,4:e,5:6,6:i,7:3,8:n,9:4,10:r,11:o,13:23,15:7,16:8,17:s,23:a,24:[1,21],25:22},{1:[2,6]},t(l,[2,13]),{18:[1,24],22:[1,25]},t(u,[2,16]),{21:[1,26]},t(l,[2,18]),{22:[1,28],24:[1,27]},t(h,[2,20]),t(l,[2,14]),{3:20,4:e,20:29},{3:5,4:e,5:6,6:i,7:3,8:n,9:4,10:r,11:o,13:30,15:7,16:8,17:s,23:a},t(l,[2,19]),{3:5,4:e,5:6,6:i,7:3,8:n,9:4,10:r,11:o,13:31,15:7,16:8,17:s,23:a},t(u,[2,17]),t(u,[2,15]),t(h,[2,21])],defaultActions:{16:[2,6]},parseError:function(t,e){if(!e.recoverable)throw new Error(t);this.trace(t)},parse:function(t){var e=this,i=[0],n=[null],r=[],o=this.table,s="",a=0,l=0,u=2,h=1,c=r.slice.call(arguments,1),p=Object.create(this.lexer),d={yy:{}};for(var f in this.yy)Object.prototype.hasOwnProperty.call(this.yy,f)&&(d.yy[f]=this.yy[f]);p.setInput(t,d.yy),d.yy.lexer=p,d.yy.parser=this,void 0===p.yylloc&&(p.yylloc={});var y=p.yylloc;r.push(y);var g=p.options&&p.options.ranges;function m(){var t;return"number"!=typeof(t=p.lex()||h)&&(t=e.symbols_[t]||t),t}"function"==typeof d.yy.parseError?this.parseError=d.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;for(var v,_,x,b,w,S,C,T,E={};;){if(_=i[i.length-1],this.defaultActions[_]?x=this.defaultActions[_]:(null==v&&(v=m()),x=o[_]&&o[_][v]),void 0===x||!x.length||!x[0]){var k="";for(w in T=[],o[_])this.terminals_[w]&&w>u&&T.push("'"+this.terminals_[w]+"'");k=p.showPosition?"Parse error on line "+(a+1)+":\n"+p.showPosition()+"\nExpecting "+T.join(", ")+", got '"+(this.terminals_[v]||v)+"'":"Parse error on line "+(a+1)+": Unexpected "+(v==h?"end of input":"'"+(this.terminals_[v]||v)+"'"),this.parseError(k,{text:p.match,token:this.terminals_[v]||v,line:p.yylineno,loc:y,expected:T})}if(x[0]instanceof Array&&x.length>1)throw new Error("Parse Error: multiple actions possible at state: "+_+", token: "+v);switch(x[0]){case 1:i.push(v),n.push(p.yytext),r.push(p.yylloc),i.push(x[1]),v=null,l=p.yyleng,s=p.yytext,a=p.yylineno,y=p.yylloc;break;case 2:if(S=this.productions_[x[1]][1],E.$=n[n.length-S],E._$={first_line:r[r.length-(S||1)].first_line,last_line:r[r.length-1].last_line,first_column:r[r.length-(S||1)].first_column,last_column:r[r.length-1].last_column},g&&(E._$.range=[r[r.length-(S||1)].range[0],r[r.length-1].range[1]]),void 0!==(b=this.performAction.apply(E,[s,l,a,d.yy,x[1],n,r].concat(c))))return b;S&&(i=i.slice(0,-1*S*2),n=n.slice(0,-1*S),r=r.slice(0,-1*S)),i.push(this.productions_[x[1]][0]),n.push(E.$),r.push(E._$),C=o[i[i.length-2]][i[i.length-1]],i.push(C);break;case 3:return!0}}return!0}},p={EOF:1,parseError:function(t,e){if(!this.yy.parser)throw new Error(t);this.yy.parser.parseError(t,e)},setInput:function(t,e){return this.yy=e||this.yy||{},this._input=t,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},input:function(){var t=this._input[0];return this.yytext+=t,this.yyleng++,this.offset++,this.match+=t,this.matched+=t,t.match(/(?:\r\n?|\n).*/g)?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),t},unput:function(t){var e=t.length,i=t.split(/(?:\r\n?|\n)/g);this._input=t+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-e),this.offset-=e;var n=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),i.length-1&&(this.yylineno-=i.length-1);var r=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:i?(i.length===n.length?this.yylloc.first_column:0)+n[n.length-i.length].length-i[0].length:this.yylloc.first_column-e},this.options.ranges&&(this.yylloc.range=[r[0],r[0]+this.yyleng-e]),this.yyleng=this.yytext.length,this},more:function(){return this._more=!0,this},reject:function(){return this.options.backtrack_lexer?(this._backtrack=!0,this):this.parseError("Lexical error on line "+(this.yylineno+1)+". You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})},less:function(t){this.unput(this.match.slice(t))},pastInput:function(){var t=this.matched.substr(0,this.matched.length-this.match.length);return(t.length>20?"...":"")+t.substr(-20).replace(/\n/g,"")},upcomingInput:function(){var t=this.match;return t.length<20&&(t+=this._input.substr(0,20-t.length)),(t.substr(0,20)+(t.length>20?"...":"")).replace(/\n/g,"")},showPosition:function(){var t=this.pastInput(),e=new Array(t.length+1).join("-");return t+this.upcomingInput()+"\n"+e+"^"},test_match:function(t,e){var i,n,r;if(this.options.backtrack_lexer&&(r={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(r.yylloc.range=this.yylloc.range.slice(0))),(n=t[0].match(/(?:\r\n?|\n).*/g))&&(this.yylineno+=n.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:n?n[n.length-1].length-n[n.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+t[0].length},this.yytext+=t[0],this.match+=t[0],this.matches=t,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(t[0].length),this.matched+=t[0],i=this.performAction.call(this,this.yy,this,e,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),i)return i;if(this._backtrack){for(var o in r)this[o]=r[o];return!1}return!1},next:function(){if(this.done)return this.EOF;var t,e,i,n;this._input||(this.done=!0),this._more||(this.yytext="",this.match="");for(var r=this._currentRules(),o=0;o<r.length;o++)if((i=this._input.match(this.rules[r[o]]))&&(!e||i[0].length>e[0].length)){if(e=i,n=o,this.options.backtrack_lexer){if(!1!==(t=this.test_match(i,r[o])))return t;if(this._backtrack){e=!1;continue}return!1}if(!this.options.flex)break}return e?!1!==(t=this.test_match(e,r[n]))&&t:""===this._input?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+". Unrecognized text.\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})},lex:function(){var t=this.next();return t||this.lex()},begin:function(t){this.conditionStack.push(t)},popState:function(){return this.conditionStack.length-1>0?this.conditionStack.pop():this.conditionStack[0]},_currentRules:function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},topState:function(t){return(t=this.conditionStack.length-1-Math.abs(t||0))>=0?this.conditionStack[t]:"INITIAL"},pushState:function(t){this.begin(t)},stateStackSize:function(){return this.conditionStack.length},options:{},performAction:function(t,e,i,n){switch(i){case 0:break;case 1:return 6;case 2:return e.yytext=e.yytext.substr(1,e.yyleng-2),4;case 3:return 17;case 4:return 18;case 5:return 23;case 6:return 24;case 7:return 22;case 8:return 21;case 9:return 10;case 10:return 11;case 11:return 8;case 12:return 14;case 13:return"INVALID"}},rules:[/^(?:\s+)/,/^(?:(-?([0-9]|[1-9][0-9]+))(\.[0-9]+)?([eE][-+]?[0-9]+)?\b)/,/^(?:"(?:\\[\\"bfnrt/]|\\u[a-fA-F0-9]{4}|[^\\\0-\x09\x0a-\x1f"])*")/,/^(?:\{)/,/^(?:\})/,/^(?:\[)/,/^(?:\])/,/^(?:,)/,/^(?::)/,/^(?:true\b)/,/^(?:false\b)/,/^(?:null\b)/,/^(?:$)/,/^(?:.)/],conditions:{INITIAL:{rules:[0,1,2,3,4,5,6,7,8,9,10,11,12,13],inclusive:!0}}};function d(){this.yy={}}return c.lexer=p,d.prototype=c,c.Parser=d,new d}();e.parser=i,e.Parser=i.Parser,e.parse=function(){return i.parse.apply(i,arguments)}}));const ng=Iy,rg=Ay,og=function(t,e){let i=t.stops;if(!i)return function(t,e){const i=["get",t.property];if(void 0===t.default)return"string"===e.type?["string",i]:i;if("enum"===e.type)return["match",i,Object.keys(e.values),i,t.default];{const n=["color"===e.type?"to-color":e.type,i,zy(t.default)];return"array"===e.type&&n.splice(1,0,e.value,e.length||null),n}}(t,e);const n=i&&"object"==typeof i[0][0],r=n||void 0!==t.property,o=n||!r;return i=i.map((t=>!r&&e.tokens&&"string"==typeof t[1]?[t[0],Vy(t[1])]:[t[0],zy(t[1])])),n?function(t,e,i){const n={},r={},o=[];for(let s=0;s<i.length;s++){const e=i[s],a=e[0].zoom;void 0===n[a]&&(n[a]={zoom:a,type:t.type,property:t.property,default:t.default},r[a]=[],o.push(a)),r[a].push([e[0].value,e[1]])}if("exponential"===qy({},e)){const i=[Dy(t),["linear"],["zoom"]];for(const t of o){Wy(i,t,Ny(n[t],e,r[t]),!1)}return i}{const t=["step",["zoom"]];for(const i of o){Wy(t,i,Ny(n[i],e,r[i]),!0)}return By(t),t}}(t,e,i):o?function(t,e,i,n=["zoom"]){const r=qy(t,e);let o,s=!1;if("interval"===r)o=["step",n],s=!0;else{if("exponential"!==r)throw new Error(`Unknown zoom function type "${r}"`);{const e=void 0!==t.base?t.base:1;o=[Dy(t),1===e?["linear"]:["exponential",e],n]}}for(const a of i)Wy(o,a[0],a[1],s);return By(o),o}(t,e,i):Ny(t,e,i)},sg=Oy;function ag(t){return t*Math.PI/180}var lg=function(){for(var t=[],e=78271.51696402048;t.length<=24;e/=2)t.push(e);return t}();function ug(t,e){if("undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope&&"undefined"!=typeof OffscreenCanvas)return new OffscreenCanvas(t,e);var i=document.createElement("canvas");return i.width=t,i.height=e,i}var hg,cg=Array(256).join(" ");function pg(t,e){if(e>=.05){for(var i="",n=t.split("\n"),r=cg.slice(0,Math.round(e/.1)),o=0,s=n.length;o<s;++o)o>0&&(i+="\n"),i+=n[o].split("").join(r);return i}return t}function dg(){return hg||(hg=ug(1,1).getContext("2d")),hg}function fg(t,e){return dg().measureText(t).width+(t.length-1)*e}var yg={};function gg(t,e,i,n){if(-1!==t.indexOf("\n")){for(var r=t.split("\n"),o=[],s=0,a=r.length;s<a;++s)o.push(gg(r[s],e,i,n));return o.join("\n")}var l=i+","+e+","+t+","+n,u=yg[l];if(!u){var h=t.split(" ");if(h.length>1){var c=dg();c.font=e;var p=c.measureText("M").width*i,d="";for(o=[],s=0,a=h.length;s<a;++s){var f=h[s],y=d+(d?" ":"")+f;fg(y,n)<=p?d=y:(d&&o.push(d),d=f)}d&&o.push(d);for(s=0,a=o.length;s<a&&a>1;++s){var g=o[s];if(fg(g,n)<.35*p){var m=s>0?fg(o[s-1],n):1/0,v=s<a-1?fg(o[s+1],n):1/0;o.splice(s,1),a-=1,m<v?(o[s-1]+=" "+g,s-=1):o[s]=g+" "+o[s]}}for(s=0,a=o.length-1;s<a;++s){var _=o[s],x=o[s+1];if(fg(_,n)>.7*p&&fg(x,n)<.6*p){var b=_.split(" "),w=b.pop();fg(w,n)<.2*p&&(o[s]=b.join(" "),o[s+1]=w+" "+x),a-=1}}u=o.join("\n")}else u=t;u=pg(u,n),yg[l]=u}return u}Nr&&qt(Nr,jt,(function(){yg={}}));var mg,vg,_g=sg,xg=og,bg=ng,wg=rg,Sg={Point:1,MultiPoint:1,LineString:2,MultiLineString:2,Polygon:3,MultiPolygon:3},Cg={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]},Tg={},Eg={zoom:0},kg={};function Pg(t,e,i,n,r){var o=t.id;kg[o]||(kg[o]={});var s=kg[o];if(!s[i]){var a=(t[e]||Tg)[i],l=md[e+"_"+t.type][i];void 0===a&&(a=l.default);var u=bg(a);if(!u&&_g(a)&&(a=xg(a,l),u=!0),u){var h=function(t,e){var i=wg(t,e);if("error"===i.result)throw new Error(i.value.map((function(t){return t.key+": "+t.message})).join(", "));return i.value}(a,l);s[i]=h.evaluate.bind(h)}else"color"==l.type&&(a=qd.parse(a)),s[i]=function(){return a}}return Eg.zoom=n,s[i](Eg,r)}var Og={};function Rg(t,e){if(t){if(0===t.a||0===e)return;var i=t.a;return e=void 0===e?1:e,"rgba("+Math.round(255*t.r/i)+","+Math.round(255*t.g/i)+","+Math.round(255*t.b/i)+","+i*e+")"}return t}var Ig=/^([^]*)\{(.*)\}([^]*)$/;function Fg(t,e){var i;do{if(i=t.match(Ig)){var n=e[i[2]]||"";t=i[1]+n+i[3]}}while(i);return t}function jg(t,e,i,n,r,o,s){if(void 0===n&&(n=lg),"string"==typeof e&&(e=JSON.parse(e)),8!=e.version)throw new Error("glStyle version 8 required.");var a,l;if(o)if("undefined"!=typeof Image){var u=new Image;u.crossOrigin="anonymous",u.onload=function(){a=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&&(a=t.data.image,l=[a.width,a.height])}))}for(var c,p=function(t){t=t.slice();const e=Object.create(null);for(let i=0;i<t.length;i++)e[t[i].id]=t[i];for(let i=0;i<t.length;i++)"ref"in t[i]&&(t[i]=ig(t[i],e[t[i].ref]));return t}(e.layers),d={},f=[],y=0,g=p.length;y<g;++y){var m=p[y],v=m.id;if("string"==typeof i&&m.source==i||-1!==i.indexOf(v)){var _=m["source-layer"];if(!c){c=m.source;var x=e.sources[c];if(!x)throw new Error('Source "'+c+'" is not defined');var b=x.type;if("vector"!==b&&"geojson"!==b)throw new Error('Source "'+c+'" is not of type "vector" or "geojson", but "'+b+'"')}var w=d[_];w||(w=[],d[_]=w),w.push({layer:m,index:y}),f.push(v)}delete kg[v],delete Og[v]}var S=new Ka,C=new Ea,T={},E={},k=[],P=function(t,e){var i=t.getProperties(),o=d[i.layer];if(o){var u=n.indexOf(e);-1==u&&(u=function(t,e){for(var i=0,n=e.length;i<n;++i)if(e[i]<t&&i+1<n){var r=e[i]/e[i+1];return i+Math.log(e[i]/t)/Math.log(r)}return n-1}(e,n));for(var h=Sg[t.getGeometry().getType()],c={properties:i,type:h},p=-1,f=function(n,d){var f=o[n],y=f.layer,g=y.id,m=y.layout||Tg,v=y.paint||Tg;if("none"===m.visibility||"minzoom"in y&&u<y.minzoom||"maxzoom"in y&&u>=y.maxzoom)return"continue";var _=y.filter;if(!_||function(t,e,i,n){return t in Og||(Og[t]=Ky(e).filter),Eg.zoom=n,Og[t](Eg,i)}(g,_,c,u)){var x=void 0,b=void 0,w=void 0,P=void 0,O=void 0,R=void 0,I=f.index;if(3==h&&("fill"==y.type||"fill-extrusion"==y.type))if(b=Pg(y,"paint",y.type+"-opacity",u,c),y.type+"-pattern"in v){var F=Pg(y,"paint",y.type+"-pattern",u,c);if(F){var j="string"==typeof F?Fg(F,i):F.toString();if(a&&r&&r[j]){++p,(R=k[p])&&R.getFill()&&!R.getStroke()&&!R.getText()||(R=new rl({fill:new Ea}),k[p]=R),w=R.getFill(),R.setZIndex(I);var M=E[lt=j+"."+b];if(!M)(ct=(ht=ug((ut=r[j]).width,ut.height)).getContext("2d")).globalAlpha=b,ct.drawImage(a,ut.x,ut.y,ut.width,ut.height,0,0,ut.width,ut.height),M=ct.createPattern(ht,"repeat"),E[lt]=M;w.setColor(M)}}}else(x=Rg(Pg(y,"paint",y.type+"-color",u,c),b))&&(y.type+"-outline-color"in v&&(O=Rg(Pg(y,"paint",y.type+"-outline-color",u,c),b)),O||(O=x),++p,(R=k[p])&&R.getFill()&&R.getStroke()&&!R.getText()||(R=new rl({fill:new Ea,stroke:new Ka}),k[p]=R),(w=R.getFill()).setColor(x),(P=R.getStroke()).setColor(O),P.setWidth(1),R.setZIndex(I));if(1!=h&&"line"==y.type){x=!("line-pattern"in v)&&"line-color"in v?Rg(Pg(y,"paint","line-color",u,c),Pg(y,"paint","line-opacity",u,c)):void 0;var A=Pg(y,"paint","line-width",u,c);x&&A>0&&(++p,(R=k[p])&&R.getStroke()&&!R.getFill()&&!R.getText()||(R=new rl({stroke:new Ka}),k[p]=R),(P=R.getStroke()).setLineCap(Pg(y,"layout","line-cap",u,c)),P.setLineJoin(Pg(y,"layout","line-join",u,c)),P.setMiterLimit(Pg(y,"layout","line-miter-limit",u,c)),P.setColor(x),P.setWidth(A),P.setLineDash(v["line-dasharray"]?Pg(y,"paint","line-dasharray",u,c).map((function(t){return t*A})):null),R.setZIndex(I))}var L=!1,z=null,D=0,G=void 0,N=void 0,B=void 0;if((1==h||2==h)&&"icon-image"in m){var W=Pg(y,"layout","icon-image",u,c);if(W){G="string"==typeof W?Fg(W,i):W.toString();var q=void 0;if(a&&r&&r[G]){var V=Pg(y,"layout","icon-rotation-alignment",u,c);if(2==h){var U=t.getGeometry();if(U.getFlatMidpoint||U.getFlatMidpoints){var X=U.getExtent();if(Math.sqrt(Math.max(Math.pow((X[2]-X[0])/e,2),Math.pow((X[3]-X[1])/e,2)))>150){var K="MultiLineString"===U.getType()?U.getFlatMidpoints():U.getFlatMidpoint();if(vg||(vg=new Rl("Point",mg=[NaN,NaN],[],{},null)),q=vg,mg[0]=K[0],mg[1]=K[1],"line"===(It=Pg(y,"layout","symbol-placement",u,c))&&"map"===V)for(var Y=U.getStride(),Z=U.getFlatCoordinates(),H=0,$=Z.length-Y;H<$;H+=Y){var J=Z[H],Q=Z[H+1],tt=Z[H+Y],et=Z[H+Y+1],it=Math.min(J,tt),nt=Math.min(Q,et),rt=Math.max(J,tt),ot=Math.max(Q,et);if(K[0]>=it&&K[0]<=rt&&K[1]>=nt&&K[1]<=ot){D=Math.atan2(Q-et,tt-J);break}}}}}if(2!==h||q){var st=Pg(y,"layout","icon-size",u,c),at=void 0!==v["icon-color"]?Pg(y,"paint","icon-color",u,c):null;if(!at||0!==at.a){var lt=G+"."+st;if(null!==at&&(lt+="."+at),!(N=T[lt])){var ut=r[G];if(null!==at){var ht,ct;(ct=(ht=ug(ut.width,ut.height)).getContext("2d")).drawImage(a,ut.x,ut.y,ut.width,ut.height,0,0,ut.width,ut.height);for(var pt=ct.getImageData(0,0,ht.width,ht.height),dt=0,ft=pt.data.length;dt<ft;dt+=4){var yt=at.a;0!==yt&&(pt.data[dt]=255*at.r/yt,pt.data[dt+1]=255*at.g/yt,pt.data[dt+2]=255*at.b/yt),pt.data[dt+3]=yt}ct.putImageData(pt,0,0),N=new Xa({img:ht,imgSize:[ht.width,ht.height],scale:st/ut.pixelRatio}),T[lt]=N}else N=new Xa({img:a,imgSize:l,size:[ut.width,ut.height],offset:[ut.x,ut.y],rotateWithView:"map"===V,scale:st/ut.pixelRatio}),T[lt]=N}}N&&(++p,(R=k[p])&&R.getImage()&&!R.getFill()&&!R.getStroke()||(R=new rl,k[p]=R),R.setGeometry(q),N.setRotation(D+ag(Pg(y,"layout","icon-rotate",u,c))),N.setOpacity(Pg(y,"paint","icon-opacity",u,c)),N.setAnchor(Cg[Pg(y,"layout","icon-anchor",u,c)]),R.setImage(N),z=R.getText(),R.setText(void 0),R.setZIndex(I),L=!0,B=!1)}else B=!0}}}if(1==h&&"circle-radius"in v){++p,(R=k[p])&&R.getImage()&&!R.getFill()&&!R.getStroke()||(R=new rl,k[p]=R);var gt=Pg(y,"paint","circle-radius",u,c),mt=Rg(Pg(y,"paint","circle-stroke-color",u,c),Pg(y,"paint","circle-stroke-opacity",u,c)),vt=Rg(Pg(y,"paint","circle-color",u,c),Pg(y,"paint","circle-opacity",u,c)),_t=Pg(y,"paint","circle-stroke-width",u,c),xt=gt+"."+mt+"."+vt+"."+_t;(N=T[xt])||(N=new Ja({radius:gt,stroke:mt&&_t>0?new Ka({width:_t,color:mt}):void 0,fill:vt?new Ea({color:vt}):void 0}),T[xt]=N),R.setImage(N),z=R.getText(),R.setText(void 0),R.setGeometry(void 0),R.setZIndex(I),L=!0}var bt=void 0;if("text-field"in m)bt=Fg(Pg(y,"layout","text-field",u,c).toString(),i).trim(),b=Pg(y,"paint","text-opacity",u,c);if(bt&&b&&!B){L||(++p,(R=k[p])&&R.getText()&&!R.getFill()&&!R.getStroke()||(R=new rl,k[p]=R),R.setImage(void 0),R.setGeometry(void 0)),R.getText()||R.setText(z||new al({padding:[2,2,2,2]})),z=R.getText();var wt=Math.round(Pg(y,"layout","text-size",u,c)),St=Pg(y,"layout","text-font",u,c),Ct=Pg(y,"layout","text-line-height",u,c),Tt=function(t,e,i){var n=gd[t];if(!n){Array.isArray(t)||(t=[t]);for(var r=400,o="normal",s=[],a=0,l=t.length;a<l;++a){var u=t[a].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()):yd.test(h)&&(h=h.replace(yd,""),o=u[u.length-1].replace(h,"")),fd)if(h==c||h==c.replace("-","")||h==c.replace("-"," ")){r=fd[c],u.pop();break}"number"==typeof h&&(r=h);var p=u.join(" ").replace("Klokantech Noto Sans","Noto Sans");-1!==p.indexOf(" ")&&(p='"'+p+'"'),s.push(p)}n=gd[t]=[o,r,s]}return n[0]+" "+n[1]+" "+e+"px"+(i?"/"+i:"")+" "+n[2]}(s?s(St):St,wt,Ct),Et=m["text-transform"];"uppercase"==Et?bt=bt.toUpperCase():"lowercase"==Et&&(bt=bt.toLowerCase());var kt=Pg(y,"layout","text-max-width",u,c),Pt=Pg(y,"layout","text-letter-spacing",u,c),Ot=2==h?pg(bt,Pt):gg(bt,Tt,kt,Pt);z.setText(Ot),z.setFont(Tt),z.setRotation(ag(Pg(y,"layout","text-rotate",u,c)));var Rt=Pg(y,"layout","text-anchor",u,c),It=L||1==h?"point":Pg(y,"layout","symbol-placement",u,c);z.setPlacement(It);var Ft=Pg(y,"paint","text-halo-width",u,c),jt=Pg(y,"layout","text-offset",u,c),Mt=Pg(y,"paint","text-translate",u,c),At=0,Lt=0;if("point"==It){var zt="center";-1!==Rt.indexOf("left")?(zt="left",Lt=Ft):-1!==Rt.indexOf("right")&&(zt="right",Lt=-Ft),z.setTextAlign(zt);var Dt=Pg(y,"layout","text-rotation-alignment",u,c);z.setRotateWithView("map"==Dt)}else z.setMaxAngle(ag(Pg(y,"layout","text-max-angle",u,c))*bt.length/Ot.length),z.setTextAlign(),z.setRotateWithView(!1);var Gt="middle";0==Rt.indexOf("bottom")?(Gt="bottom",At=-Ft-.5*(Ct-1)*wt):0==Rt.indexOf("top")&&(Gt="top",At=Ft+.5*(Ct-1)*wt),z.setTextBaseline(Gt),z.setOffsetX(jt[0]*wt+Lt+Mt[0]),z.setOffsetY(jt[1]*wt+At+Mt[1]),C.setColor(Rg(Pg(y,"paint","text-color",u,c),b)),z.setFill(C);var Nt=Rg(Pg(y,"paint","text-halo-color",u,c),b);if(Nt){S.setColor(Nt),Ft*=2;var Bt=.5*wt;S.setWidth(Ft<=Bt?Ft:Bt),z.setStroke(S)}else z.setStroke(void 0);var Wt=Pg(y,"layout","text-padding",u,c),qt=z.getPadding();Wt!==qt[0]&&(qt[0]=Wt,qt[1]=Wt,qt[2]=Wt,qt[3]=Wt),R.setZIndex(I)}}},y=0,g=o.length;y<g;++y)f(y);return p>-1?(k.length=p+1,k):void 0}};return t.setStyle(P),t.set("mapbox-source",c),t.set("mapbox-layers",f),P}var Mg=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}(),Ag=function(t){function e(e){var i=e||{},n=void 0!==i.projection?i.projection:"EPSG:3857",r=void 0!==i.tileGrid?i.tileGrid:Rp({extent:jp(n),maxResolution:i.maxResolution,maxZoom:i.maxZoom,minZoom:i.minZoom,tileSize:i.tileSize});return t.call(this,{attributions:i.attributions,cacheSize:i.cacheSize,crossOrigin:i.crossOrigin,imageSmoothing:i.imageSmoothing,opaque:i.opaque,projection:n,reprojectionErrorThreshold:i.reprojectionErrorThreshold,tileGrid:r,tileLoadFunction:i.tileLoadFunction,tilePixelRatio:i.tilePixelRatio,tileUrlFunction:i.tileUrlFunction,url:i.url,urls:i.urls,wrapX:void 0===i.wrapX||i.wrapX,transition:i.transition,attributionsCollapsible:i.attributionsCollapsible,zDirection:i.zDirection})||this}return Mg(e,t),e}(ud),Lg=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}(),zg='© <a href="https://www.openstreetmap.org/copyright" target="_blank">OpenStreetMap</a> contributors.',Dg=function(t){function e(e){var i,n=e||{};i=void 0!==n.attributions?n.attributions:[zg];var r=void 0!==n.crossOrigin?n.crossOrigin:"anonymous",o=void 0!==n.url?n.url:"https://{a-c}.tile.openstreetmap.org/{z}/{x}/{y}.png";return t.call(this,{attributions:i,attributionsCollapsible:!1,cacheSize:n.cacheSize,crossOrigin:r,imageSmoothing:n.imageSmoothing,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:o,wrapX:n.wrapX,zDirection:n.zDirection})||this}return Lg(e,t),e}(Ag);const Gg=Array.isArray;function Ng(t,e){if(1===arguments.length)return e=>Ng(t,e);if(t<1)throw new Error("First argument to splitEvery must be a positive integer");const i=[];let n=0;for(;n<e.length;)i.push(e.slice(n,n+=t));return i}(function t(e,i=[]){return(...n)=>{return(r=[...i,...n]).length>=e.length?e(...r):t(e,r);var r}})((function(t,e,i){if(!Gg(i))throw new TypeError("reduce: list must be array or iterable");let n=0;const r=i.length;for(;n<r;)e=t(e,i[n],n,i),n++;return e}))((function t(e,i){return 1===arguments.length?i=>t(e,i):e*i}),1);const Bg=new Cc({features:[],wrapX:!1}),Wg=new ac({source:Bg,style:new rl({image:new Ja({radius:3,fill:new Ea({color:"grey"})})})});function qg(t,e){return Ng(2,t.getSource().getFeaturesInExtent(e).filter((t=>"Point"!==t.getGeometry().getType())).flatMap((t=>t.flatCoordinates_))).forEach(((t,e)=>{Bg.addFeature(new $s({geometry:new fs(t),i:e}))}))}const Vg={color:"#ff0000",width:3},Ug=new Ka(Vg),Xg=new Ka(l(a({},Vg),{lineDash:[2,8]})),Kg=new Ea({color:"rgba(255, 0, 0, 0.1)"}),Yg=new Ha({stroke:new Ka({color:"red",width:2}),points:4,radius1:15,radius2:1}),Zg=new Ja({radius:6,fill:new Ea({color:"#ff0000"})}),Hg=new rl({image:new Ha({fill:new Ea({color:"#fff"}),stroke:new Ka({color:"#ff0000",width:2}),points:4,radius:5,angle:Math.PI/4}),geometry:function(t){const e=t.getGeometry().getCoordinates()[0];return new ya(e)}}),$g=new Cc,Jg=new ac({source:$g,style:[new rl({fill:Kg,stroke:Ug}),Hg]});const Qg=new Yc({source:Bg,pixelTolerance:15});
|
30
|
+
read:function(t,e,i,n,r){var o,s,a=8*r-n-1,l=(1<<a)-1,u=l>>1,h=-7,c=i?r-1:0,p=i?-1:1,d=t[e+c];for(c+=p,o=d&(1<<-h)-1,d>>=-h,h+=a;h>0;o=256*o+t[e+c],c+=p,h-=8);for(s=o&(1<<-h)-1,o>>=-h,h+=n;h>0;s=256*s+t[e+c],c+=p,h-=8);if(0===o)o=1-u;else{if(o===l)return s?NaN:1/0*(d?-1:1);s+=Math.pow(2,n),o-=u}return(d?-1:1)*s*Math.pow(2,o-n)},write:function(t,e,i,n,r,o){var s,a,l,u=8*o-r-1,h=(1<<u)-1,c=h>>1,p=23===r?Math.pow(2,-24)-Math.pow(2,-77):0,d=n?0:o-1,f=n?1:-1,y=e<0||0===e&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(a=isNaN(e)?1:0,s=h):(s=Math.floor(Math.log(e)/Math.LN2),e*(l=Math.pow(2,-s))<1&&(s--,l*=2),(e+=s+c>=1?p/l:p*Math.pow(2,1-c))*l>=2&&(s++,l/=2),s+c>=h?(a=0,s=h):s+c>=1?(a=(e*l-1)*Math.pow(2,r),s+=c):(a=e*Math.pow(2,c-1)*Math.pow(2,r),s=0));r>=8;t[i+d]=255&a,d+=f,a/=256,r-=8);for(s=s<<r|a,u+=r;u>0;t[i+d]=255&s,d+=f,s/=256,u-=8);t[i+d-f]|=128*y}},cl=dl,pl=hl;function dl(t){this.buf=ArrayBuffer.isView&&ArrayBuffer.isView(t)?t:new Uint8Array(t||0),this.pos=0,this.type=0,this.length=this.buf.length}dl.Varint=0,dl.Fixed64=1,dl.Bytes=2,dl.Fixed32=5;var fl="undefined"==typeof TextDecoder?null:new TextDecoder("utf8");function yl(t){return t.type===dl.Bytes?t.readVarint()+t.pos:t.pos+1}function gl(t,e,i){return i?4294967296*e+(t>>>0):4294967296*(e>>>0)+(t>>>0)}function ml(t,e,i){var n=e<=16383?1:e<=2097151?2:e<=268435455?3:Math.floor(Math.log(e)/(7*Math.LN2));i.realloc(n);for(var r=i.pos-1;r>=t;r--)i.buf[r+n]=i.buf[r]}function vl(t,e){for(var i=0;i<t.length;i++)e.writeVarint(t[i])}function _l(t,e){for(var i=0;i<t.length;i++)e.writeSVarint(t[i])}function xl(t,e){for(var i=0;i<t.length;i++)e.writeFloat(t[i])}function bl(t,e){for(var i=0;i<t.length;i++)e.writeDouble(t[i])}function wl(t,e){for(var i=0;i<t.length;i++)e.writeBoolean(t[i])}function Sl(t,e){for(var i=0;i<t.length;i++)e.writeFixed32(t[i])}function Cl(t,e){for(var i=0;i<t.length;i++)e.writeSFixed32(t[i])}function Tl(t,e){for(var i=0;i<t.length;i++)e.writeFixed64(t[i])}function El(t,e){for(var i=0;i<t.length;i++)e.writeSFixed64(t[i])}function kl(t,e){return(t[e]|t[e+1]<<8|t[e+2]<<16)+16777216*t[e+3]}function Pl(t,e,i){t[i]=e,t[i+1]=e>>>8,t[i+2]=e>>>16,t[i+3]=e>>>24}function Ol(t,e){return(t[e]|t[e+1]<<8|t[e+2]<<16)+(t[e+3]<<24)}dl.prototype={destroy:function(){this.buf=null},readFields:function(t,e,i){for(i=i||this.length;this.pos<i;){var n=this.readVarint(),r=n>>3,o=this.pos;this.type=7&n,t(r,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=kl(this.buf,this.pos);return this.pos+=4,t},readSFixed32:function(){var t=Ol(this.buf,this.pos);return this.pos+=4,t},readFixed64:function(){var t=kl(this.buf,this.pos)+4294967296*kl(this.buf,this.pos+4);return this.pos+=8,t},readSFixed64:function(){var t=kl(this.buf,this.pos)+4294967296*Ol(this.buf,this.pos+4);return this.pos+=8,t},readFloat:function(){var t=pl.read(this.buf,this.pos,!0,23,4);return this.pos+=4,t},readDouble:function(){var t=pl.read(this.buf,this.pos,!0,52,8);return this.pos+=8,t},readVarint:function(t){var e,i,n=this.buf;return e=127&(i=n[this.pos++]),i<128?e:(e|=(127&(i=n[this.pos++]))<<7,i<128?e:(e|=(127&(i=n[this.pos++]))<<14,i<128?e:(e|=(127&(i=n[this.pos++]))<<21,i<128?e:function(t,e,i){var n,r,o=i.buf;if(r=o[i.pos++],n=(112&r)>>4,r<128)return gl(t,n,e);if(r=o[i.pos++],n|=(127&r)<<3,r<128)return gl(t,n,e);if(r=o[i.pos++],n|=(127&r)<<10,r<128)return gl(t,n,e);if(r=o[i.pos++],n|=(127&r)<<17,r<128)return gl(t,n,e);if(r=o[i.pos++],n|=(127&r)<<24,r<128)return gl(t,n,e);if(r=o[i.pos++],n|=(1&r)<<31,r<128)return gl(t,n,e);throw new Error("Expected varint not more than 10 bytes")}(e|=(15&(i=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&&fl?function(t,e,i){return fl.decode(t.subarray(e,i))}(this.buf,e,t):function(t,e,i){var n="",r=e;for(;r<i;){var o,s,a,l=t[r],u=null,h=l>239?4:l>223?3:l>191?2:1;if(r+h>i)break;1===h?l<128&&(u=l):2===h?128==(192&(o=t[r+1]))&&(u=(31&l)<<6|63&o)<=127&&(u=null):3===h?(o=t[r+1],s=t[r+2],128==(192&o)&&128==(192&s)&&((u=(15&l)<<12|(63&o)<<6|63&s)<=2047||u>=55296&&u<=57343)&&(u=null)):4===h&&(o=t[r+1],s=t[r+2],a=t[r+3],128==(192&o)&&128==(192&s)&&128==(192&a)&&((u=(15&l)<<18|(63&o)<<12|(63&s)<<6|63&a)<=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),r+=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!==dl.Bytes)return t.push(this.readVarint(e));var i=yl(this);for(t=t||[];this.pos<i;)t.push(this.readVarint(e));return t},readPackedSVarint:function(t){if(this.type!==dl.Bytes)return t.push(this.readSVarint());var e=yl(this);for(t=t||[];this.pos<e;)t.push(this.readSVarint());return t},readPackedBoolean:function(t){if(this.type!==dl.Bytes)return t.push(this.readBoolean());var e=yl(this);for(t=t||[];this.pos<e;)t.push(this.readBoolean());return t},readPackedFloat:function(t){if(this.type!==dl.Bytes)return t.push(this.readFloat());var e=yl(this);for(t=t||[];this.pos<e;)t.push(this.readFloat());return t},readPackedDouble:function(t){if(this.type!==dl.Bytes)return t.push(this.readDouble());var e=yl(this);for(t=t||[];this.pos<e;)t.push(this.readDouble());return t},readPackedFixed32:function(t){if(this.type!==dl.Bytes)return t.push(this.readFixed32());var e=yl(this);for(t=t||[];this.pos<e;)t.push(this.readFixed32());return t},readPackedSFixed32:function(t){if(this.type!==dl.Bytes)return t.push(this.readSFixed32());var e=yl(this);for(t=t||[];this.pos<e;)t.push(this.readSFixed32());return t},readPackedFixed64:function(t){if(this.type!==dl.Bytes)return t.push(this.readFixed64());var e=yl(this);for(t=t||[];this.pos<e;)t.push(this.readFixed64());return t},readPackedSFixed64:function(t){if(this.type!==dl.Bytes)return t.push(this.readSFixed64());var e=yl(this);for(t=t||[];this.pos<e;)t.push(this.readSFixed64());return t},skip:function(t){var e=7&t;if(e===dl.Varint)for(;this.buf[this.pos++]>127;);else if(e===dl.Bytes)this.pos=this.readVarint()+this.pos;else if(e===dl.Fixed32)this.pos+=4;else{if(e!==dl.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 i=new Uint8Array(e);i.set(this.buf),this.buf=i,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),Pl(this.buf,t,this.pos),this.pos+=4},writeSFixed32:function(t){this.realloc(4),Pl(this.buf,t,this.pos),this.pos+=4},writeFixed64:function(t){this.realloc(8),Pl(this.buf,-1&t,this.pos),Pl(this.buf,Math.floor(2.3283064365386963e-10*t),this.pos+4),this.pos+=8},writeSFixed64:function(t){this.realloc(8),Pl(this.buf,-1&t,this.pos),Pl(this.buf,Math.floor(2.3283064365386963e-10*t),this.pos+4),this.pos+=8},writeVarint:function(t){(t=+t||0)>268435455||t<0?function(t,e){var i,n;t>=0?(i=t%4294967296|0,n=t/4294967296|0):(n=~(-t/4294967296),4294967295^(i=~(-t%4294967296))?i=i+1|0:(i=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,i){i.buf[i.pos++]=127&t|128,t>>>=7,i.buf[i.pos++]=127&t|128,t>>>=7,i.buf[i.pos++]=127&t|128,t>>>=7,i.buf[i.pos++]=127&t|128,t>>>=7,i.buf[i.pos]=127&t}(i,0,e),function(t,e){var i=(7&t)<<4;if(e.buf[e.pos++]|=i|((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,i){for(var n,r,o=0;o<e.length;o++){if((n=e.charCodeAt(o))>55295&&n<57344){if(!r){n>56319||o+1===e.length?(t[i++]=239,t[i++]=191,t[i++]=189):r=n;continue}if(n<56320){t[i++]=239,t[i++]=191,t[i++]=189,r=n;continue}n=r-55296<<10|n-56320|65536,r=null}else r&&(t[i++]=239,t[i++]=191,t[i++]=189,r=null);n<128?t[i++]=n:(n<2048?t[i++]=n>>6|192:(n<65536?t[i++]=n>>12|224:(t[i++]=n>>18|240,t[i++]=n>>12&63|128),t[i++]=n>>6&63|128),t[i++]=63&n|128)}return i}(this.buf,t,this.pos);var i=this.pos-e;i>=128&&ml(e,i,this),this.pos=e-1,this.writeVarint(i),this.pos+=i},writeFloat:function(t){this.realloc(4),pl.write(this.buf,t,this.pos,!0,23,4),this.pos+=4},writeDouble:function(t){this.realloc(8),pl.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 i=0;i<e;i++)this.buf[this.pos++]=t[i]},writeRawMessage:function(t,e){this.pos++;var i=this.pos;t(e,this);var n=this.pos-i;n>=128&&ml(i,n,this),this.pos=i-1,this.writeVarint(n),this.pos+=n},writeMessage:function(t,e,i){this.writeTag(t,dl.Bytes),this.writeRawMessage(e,i)},writePackedVarint:function(t,e){e.length&&this.writeMessage(t,vl,e)},writePackedSVarint:function(t,e){e.length&&this.writeMessage(t,_l,e)},writePackedBoolean:function(t,e){e.length&&this.writeMessage(t,wl,e)},writePackedFloat:function(t,e){e.length&&this.writeMessage(t,xl,e)},writePackedDouble:function(t,e){e.length&&this.writeMessage(t,bl,e)},writePackedFixed32:function(t,e){e.length&&this.writeMessage(t,Sl,e)},writePackedSFixed32:function(t,e){e.length&&this.writeMessage(t,Cl,e)},writePackedFixed64:function(t,e){e.length&&this.writeMessage(t,Tl,e)},writePackedSFixed64:function(t,e){e.length&&this.writeMessage(t,El,e)},writeBytesField:function(t,e){this.writeTag(t,dl.Bytes),this.writeBytes(e)},writeFixed32Field:function(t,e){this.writeTag(t,dl.Fixed32),this.writeFixed32(e)},writeSFixed32Field:function(t,e){this.writeTag(t,dl.Fixed32),this.writeSFixed32(e)},writeFixed64Field:function(t,e){this.writeTag(t,dl.Fixed64),this.writeFixed64(e)},writeSFixed64Field:function(t,e){this.writeTag(t,dl.Fixed64),this.writeSFixed64(e)},writeVarintField:function(t,e){this.writeTag(t,dl.Varint),this.writeVarint(e)},writeSVarintField:function(t,e){this.writeTag(t,dl.Varint),this.writeSVarint(e)},writeStringField:function(t,e){this.writeTag(t,dl.Bytes),this.writeString(e)},writeFloatField:function(t,e){this.writeTag(t,dl.Fixed32),this.writeFloat(e)},writeDoubleField:function(t,e){this.writeTag(t,dl.Fixed64),this.writeDouble(e)},writeBooleanField:function(t,e){this.writeVarintField(t,Boolean(e))}};var Rl=[1,0,0,1,0,0],Il=function(){function t(t,e,i,n,r){this.extent_,this.id_=r,this.type_=t,this.flatCoordinates_=e,this.flatInteriorPoints_=null,this.flatMidpoints_=null,this.ends_=i,this.properties_=n}return t.prototype.get=function(t){return this.properties_[t]},t.prototype.getExtent=function(){return this.extent_||(this.extent_=this.type_===Pn?sn(this.flatCoordinates_):an(this.flatCoordinates_,0,this.flatCoordinates_.length,2)),this.extent_},t.prototype.getFlatInteriorPoint=function(){if(!this.flatInteriorPoints_){var t=mn(this.getExtent());this.flatInteriorPoints_=_s(this.flatCoordinates_,0,this.ends_,2,t,0)}return this.flatInteriorPoints_},t.prototype.getFlatInteriorPoints=function(){if(!this.flatInteriorPoints_){var t=va(this.flatCoordinates_,0,this.ends_,2);this.flatInteriorPoints_=xs(this.flatCoordinates_,0,this.ends_,2,t)}return this.flatInteriorPoints_},t.prototype.getFlatMidpoint=function(){return this.flatMidpoints_||(this.flatMidpoints_=ua(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,i=this.ends_,n=0,r=i.length;n<r;++n){var o=i[n],s=ua(t,e,o,2,.5);_t(this.flatMidpoints_,s),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(){},t.prototype.getType=function(){return this.type_},t.prototype.transform=function(t){var e=(t=Hn(t)).getExtent(),i=t.getWorldExtent();if(e&&i){var n=xn(i)/xn(e);_r(Rl,i[0],i[3],n,-n,0,0,0),No(this.flatCoordinates_,0,this.flatCoordinates_.length,2,Rl,this.flatCoordinates_)}},t.prototype.getEnds=function(){return this.ends_},t}();Il.prototype.getEndss=Il.prototype.getEnds,Il.prototype.getFlatCoordinates=Il.prototype.getOrientedFlatCoordinates;var Fl=Il,jl=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}();function Ml(t,e,i){if(3===t){var n={keys:[],values:[],features:[]},r=i.readVarint()+i.pos;i.readFields(Al,n,r),n.length=n.features.length,n.length&&(e[n.name]=n)}}function Al(t,e,i){if(15===t)e.version=i.readVarint();else if(1===t)e.name=i.readString();else if(5===t)e.extent=i.readVarint();else if(2===t)e.features.push(i.pos);else if(3===t)e.keys.push(i.readString());else if(4===t){for(var n=null,r=i.readVarint()+i.pos;i.pos<r;)n=1===(t=i.readVarint()>>3)?i.readString():2===t?i.readFloat():3===t?i.readDouble():4===t?i.readVarint64():5===t?i.readVarint():6===t?i.readSVarint():7===t?i.readBoolean():null;e.values.push(n)}}function Ll(t,e,i){if(1==t)e.id=i.readVarint();else if(2==t)for(var n=i.readVarint()+i.pos;i.pos<n;){var r=e.layer.keys[i.readVarint()],o=e.layer.values[i.readVarint()];e.properties[r]=o}else 3==t?e.type=i.readVarint():4==t&&(e.geometry=i.pos)}function Dl(t,e,i){t.pos=e.features[i];var n=t.readVarint()+t.pos,r={layer:e,type:0,properties:{}};return t.readFields(Ll,r,n),r}var zl=function(t){function e(e){var i=t.call(this)||this,n=e||{};return i.dataProjection=new xi({code:"",units:_i.TILE_PIXELS}),i.featureClass_=n.featureClass?n.featureClass:Fl,i.geometryName_=n.geometryName,i.layerName_=n.layerName?n.layerName:"layer",i.layers_=n.layers?n.layers:null,i.idProperty_=n.idProperty,i.supportedMediaTypes=["application/vnd.mapbox-vector-tile","application/x-protobuf"],i}return jl(e,t),e.prototype.readRawGeometry_=function(t,e,i,n){t.pos=e.geometry;for(var r=t.readVarint()+t.pos,o=1,s=0,a=0,l=0,u=0,h=0;t.pos<r;){if(!s){var c=t.readVarint();o=7&c,s=c>>3}s--,1===o||2===o?(a+=t.readSVarint(),l+=t.readSVarint(),1===o&&u>h&&(n.push(u),h=u),i.push(a,l),u+=2):7===o?u>h&&(i.push(i[h],i[h+1]),u+=2):Fe(!1,59)}u>h&&(n.push(u),h=u)},e.prototype.createFeature_=function(t,e,i){var n,r=e.type;if(0===r)return null;var o,s=e.properties;this.idProperty_?(o=s[this.idProperty_],delete s[this.idProperty_]):o=e.id,s[this.layerName_]=e.layer.name;var a=[],l=[];this.readRawGeometry_(t,e,a,l);var u=function(t,e){var i;1===t?i=1===e?Pn:Fn:2===t?i=1===e?On:jn:3===t&&(i=In);return i}(r,l.length);if(this.featureClass_===Fl)(n=new this.featureClass_(u,a,l,s,o)).transform(i.dataProjection);else{var h=void 0;if(u==In){for(var c=[],p=0,d=0,f=0,y=l.length;f<y;++f){var g=l[f];if(Ts(a,p,g,2)){if(0===c.length)continue;c[c.length-1].push(l[d])}else c.push(l.slice(d,f+1));d=f+1,p=g}h=c.length>1?new xa(a,Lo,c):new Is(a,Lo,l)}else h=u===Pn?new ys(a,Lo):u===On?new da(a,Lo):u===In?new Is(a,Lo,l):u===Fn?new ma(a,Lo):u===jn?new ya(a,Lo,l):null;n=new(0,this.featureClass_),this.geometryName_&&n.setGeometryName(this.geometryName_);var m=ea(h,!1,i);n.setGeometry(m),n.setId(o),n.setProperties(s,!0)}return n},e.prototype.getType=function(){return ia},e.prototype.readFeatures=function(t,e){var i=this.layers_,n=this.adaptOptions(e),r=Hn(n.dataProjection);r.setWorldExtent(n.extent),n.dataProjection=r;var o=new cl(t),s=o.readFields(Ml,{}),a=[];for(var l in s)if(!i||-1!=i.indexOf(l)){var u=s[l],h=u?[0,0,u.extent,u.extent]:null;r.setExtent(h);for(var c=0,p=u.length;c<p;++c){var d=Dl(o,u,c);a.push(this.createFeature_(o,d,n))}}return a},e.prototype.readProjection=function(t){return this.dataProjection},e.prototype.setLayers=function(t){this.layers_=t},e}(ta),Gl="active",Nl=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}();function Bl(t,e,i,n){var r=t.getZoom();if(void 0!==r){var o=t.getConstrainedZoom(r+e),s=t.getResolutionForZoom(o);t.getAnimating()&&t.cancelAnimations(),t.animate({resolution:s,anchor:i,duration:void 0!==n?n:250,easing:li})}}var Wl=function(t){function e(e){var i=t.call(this)||this;return i.on,i.once,i.un,e&&e.handleEvent&&(i.handleEvent=e.handleEvent),i.map_=null,i.setActive(!0),i}return Nl(e,t),e.prototype.getActive=function(){return this.get(Gl)},e.prototype.getMap=function(){return this.map_},e.prototype.handleEvent=function(t){return!0},e.prototype.setActive=function(t){this.set(Gl,t)},e.prototype.setMap=function(t){this.map_=t},e}(te),ql=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}(),Vl=function(t){function e(e){var i=t.call(this)||this,n=e||{};return i.delta_=n.delta?n.delta:1,i.duration_=void 0!==n.duration?n.duration:250,i}return ql(e,t),e.prototype.handleEvent=function(t){var e=!1;if(t.type==co.DBLCLICK){var i=t.originalEvent,n=t.map,r=t.coordinate,o=i.shiftKey?-this.delta_:this.delta_;Bl(n.getView(),o,r,this.duration_),i.preventDefault(),e=!0}return!e},e}(Wl),Ul=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}();function Xl(t){for(var e=t.length,i=0,n=0,r=0;r<e;r++)i+=t[r].clientX,n+=t[r].clientY;return[i/e,n/e]}var Kl=function(t){function e(e){var i=this,n=e||{};return i=t.call(this,n)||this,n.handleDownEvent&&(i.handleDownEvent=n.handleDownEvent),n.handleDragEvent&&(i.handleDragEvent=n.handleDragEvent),n.handleMoveEvent&&(i.handleMoveEvent=n.handleMoveEvent),n.handleUpEvent&&(i.handleUpEvent=n.handleUpEvent),n.stopDown&&(i.stopDown=n.stopDown),i.handlingDownUpSequence=!1,i.trackedPointers_={},i.targetPointers=[],i}return Ul(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==co.POINTERDRAG)this.handleDragEvent(t),t.originalEvent.preventDefault();else if(t.type==co.POINTERUP){var i=this.handleUpEvent(t);this.handlingDownUpSequence=i&&this.targetPointers.length>0}}else if(t.type==co.POINTERDOWN){var n=this.handleDownEvent(t);this.handlingDownUpSequence=n,e=this.stopDown(n)}else t.type==co.POINTERMOVE&&this.handleMoveEvent(t);return!e},e.prototype.handleMoveEvent=function(t){},e.prototype.handleUpEvent=function(t){return!1},e.prototype.stopDown=function(t){return t},e.prototype.updateTrackedPointers_=function(t){if(function(t){var e=t.type;return e===co.POINTERDOWN||e===co.POINTERDRAG||e===co.POINTERUP}(t)){var e=t.originalEvent,i=e.pointerId.toString();t.type==co.POINTERUP?delete this.trackedPointers_[i]:(t.type==co.POINTERDOWN||i in this.trackedPointers_)&&(this.trackedPointers_[i]=e),this.targetPointers=Et(this.trackedPointers_)}},e}(Wl);function Yl(t){var e=arguments;return function(t){for(var i=!0,n=0,r=e.length;n<r&&(i=i&&e[n](t));++n);return i}}var Zl=function(t){var e=t.originalEvent;return e.altKey&&!(e.metaKey||e.ctrlKey)&&e.shiftKey},Hl=function(t){return!t.map.getTargetElement().hasAttribute("tabindex")||function(t){return t.target.getTargetElement().contains(document.activeElement)}(t)},$l=bt,Jl=function(t){var e=t.originalEvent;return 0==e.button&&!(se&&ae&&e.ctrlKey)},Ql=function(t){var e=t.originalEvent;return!e.altKey&&!(e.metaKey||e.ctrlKey)&&!e.shiftKey},tu=function(t){var e=t.originalEvent;return!e.altKey&&!(e.metaKey||e.ctrlKey)&&e.shiftKey},eu=function(t){var e=t.originalEvent.target.tagName;return"INPUT"!==e&&"SELECT"!==e&&"TEXTAREA"!==e},iu=function(t){var e=t.originalEvent;return Fe(void 0!==e,56),"mouse"==e.pointerType},nu=function(t){var e=t.originalEvent;return Fe(void 0!==e,56),e.isPrimary&&0===e.button},ru=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}(),ou=function(t){function e(e){var i=t.call(this,{stopDown:wt})||this,n=e||{};i.kinetic_=n.kinetic,i.lastCentroid=null,i.lastPointersCount_,i.panning_=!1;var r=n.condition?n.condition:Yl(Ql,nu);return i.condition_=n.onFocusOnly?Yl(Hl,r):r,i.noKinetic_=!1,i}return ru(e,t),e.prototype.handleDragEvent=function(t){this.panning_||(this.panning_=!0,this.getMap().getView().beginInteraction());var e,i,n=this.targetPointers,r=Xl(n);if(n.length==this.lastPointersCount_){if(this.kinetic_&&this.kinetic_.update(r[0],r[1]),this.lastCentroid){var o=[this.lastCentroid[0]-r[0],r[1]-this.lastCentroid[1]],s=t.map.getView();e=o,i=s.getResolution(),e[0]*=i,e[1]*=i,Wn(o,s.getRotation()),s.adjustCenterInternal(o)}}else this.kinetic_&&this.kinetic_.begin();this.lastCentroid=r,this.lastPointersCount_=n.length,t.originalEvent.preventDefault()},e.prototype.handleUpEvent=function(t){var e=t.map,i=e.getView();if(0===this.targetPointers.length){if(!this.noKinetic_&&this.kinetic_&&this.kinetic_.end()){var n=this.kinetic_.getDistance(),r=this.kinetic_.getAngle(),o=i.getCenterInternal(),s=e.getPixelFromCoordinateInternal(o),a=e.getCoordinateFromPixelInternal([s[0]-n*Math.cos(r),s[1]-n*Math.sin(r)]);i.animateInternal({center:i.getConstrainedCenter(a),duration:500,easing:li})}return this.panning_&&(this.panning_=!1,i.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}(Kl),su=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}(),au=function(t){function e(e){var i=this,n=e||{};return(i=t.call(this,{stopDown:wt})||this).condition_=n.condition?n.condition:Zl,i.lastAngle_=void 0,i.duration_=void 0!==n.duration?n.duration:250,i}return su(e,t),e.prototype.handleDragEvent=function(t){if(iu(t)){var e=t.map,i=e.getView();if(i.getConstraints().rotation!==Mo){var n=e.getSize(),r=t.pixel,o=Math.atan2(n[1]/2-r[1],r[0]-n[0]/2);if(void 0!==this.lastAngle_){var s=o-this.lastAngle_;i.adjustRotationInternal(-s)}this.lastAngle_=o}}},e.prototype.handleUpEvent=function(t){return!iu(t)||(t.map.getView().endInteraction(this.duration_),!1)},e.prototype.handleDownEvent=function(t){return!!iu(t)&&(!(!Jl(t)||!this.condition_(t))&&(t.map.getView().beginInteraction(),this.lastAngle_=void 0,!0))},e}(Kl),lu=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}(),uu=function(t){function e(e){var i=t.call(this)||this;return i.geometry_=null,i.element_=document.createElement("div"),i.element_.style.position="absolute",i.element_.style.pointerEvents="auto",i.element_.className="ol-box "+e,i.map_=null,i.startPixel_=null,i.endPixel_=null,i}return lu(e,t),e.prototype.disposeInternal=function(){this.setMap(null)},e.prototype.render_=function(){var t=this.startPixel_,e=this.endPixel_,i="px",n=this.element_.style;n.left=Math.min(t[0],e[0])+i,n.top=Math.min(t[1],e[1])+i,n.width=Math.abs(e[0]-t[0])+i,n.height=Math.abs(e[1]-t[1])+i},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_,i=[t,[t[0],e[1]],e,[e[0],t[1]]].map(this.map_.getCoordinateFromPixelInternal,this.map_);i[4]=i[0].slice(),this.geometry_?this.geometry_.setCoordinates([i]):this.geometry_=new Is([i])},e.prototype.getGeometry=function(){return this.geometry_},e}(yt),hu=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}(),cu="boxstart",pu="boxdrag",du="boxend",fu="boxcancel",yu=function(t){function e(e,i,n){var r=t.call(this,e)||this;return r.coordinate=i,r.mapBrowserEvent=n,r}return hu(e,t),e}(dt),gu=function(t){function e(e){var i=t.call(this)||this;i.on,i.once,i.un;var n=e||{};return i.box_=new uu(n.className||"ol-dragbox"),i.minArea_=void 0!==n.minArea?n.minArea:64,n.onBoxEnd&&(i.onBoxEnd=n.onBoxEnd),i.startPixel_=null,i.condition_=n.condition?n.condition:Jl,i.boxEndCondition_=n.boxEndCondition?n.boxEndCondition:i.defaultBoxEndCondition,i}return hu(e,t),e.prototype.defaultBoxEndCondition=function(t,e,i){var n=i[0]-e[0],r=i[1]-e[1];return n*n+r*r>=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 yu(pu,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 yu(e?du:fu,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 yu(cu,t.coordinate,t)),!0)},e.prototype.onBoxEnd=function(t){},e}(Kl),mu=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}(),vu=function(t){function e(e){var i=this,n=e||{},r=n.condition?n.condition:tu;return(i=t.call(this,{condition:r,className:n.className||"ol-dragzoom",minArea:n.minArea})||this).duration_=void 0!==n.duration?n.duration:200,i.out_=void 0!==n.out&&n.out,i}return mu(e,t),e.prototype.onBoxEnd=function(t){var e=this.getMap().getView(),i=this.getGeometry();if(this.out_){var n=e.rotatedExtentForGeometry(i),r=e.getResolutionForExtentInternal(n),o=e.getResolution()/r;(i=i.clone()).scale(o*o)}e.fitInternal(i,{duration:this.duration_,easing:li})},e}(gu),_u=37,xu=38,bu=39,wu=40,Su=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}(),Cu=function(t){function e(e){var i=t.call(this)||this,n=e||{};return i.defaultCondition_=function(t){return Ql(t)&&eu(t)},i.condition_=void 0!==n.condition?n.condition:i.defaultCondition_,i.duration_=void 0!==n.duration?n.duration:100,i.pixelDelta_=void 0!==n.pixelDelta?n.pixelDelta:128,i}return Su(e,t),e.prototype.handleEvent=function(t){var e=!1;if(t.type==Dt){var i=t.originalEvent,n=i.keyCode;if(this.condition_(t)&&(n==wu||n==_u||n==bu||n==xu)){var r=t.map.getView(),o=r.getResolution()*this.pixelDelta_,s=0,a=0;n==wu?a=-o:n==_u?s=-o:n==bu?s=o:a=o;var l=[s,a];Wn(l,r.getRotation()),function(t,e,i){var n=t.getCenterInternal();if(n){var r=[n[0]+e[0],n[1]+e[1]];t.animateInternal({duration:void 0!==i?i:250,easing:hi,center:t.getConstrainedCenter(r)})}}(r,l,this.duration_),i.preventDefault(),e=!0}}return!e},e}(Wl),Tu=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}(),Eu=function(t){function e(e){var i=t.call(this)||this,n=e||{};return i.condition_=n.condition?n.condition:eu,i.delta_=n.delta?n.delta:1,i.duration_=void 0!==n.duration?n.duration:100,i}return Tu(e,t),e.prototype.handleEvent=function(t){var e=!1;if(t.type==Dt||t.type==zt){var i=t.originalEvent,n=i.charCode;if(this.condition_(t)&&(n=="+".charCodeAt(0)||n=="-".charCodeAt(0))){var r=t.map,o=n=="+".charCodeAt(0)?this.delta_:-this.delta_;Bl(r.getView(),o,void 0,this.duration_),i.preventDefault(),e=!0}}return!e},e}(Wl),ku=function(){function t(t,e,i){this.decay_=t,this.minVelocity_=e,this.delay_=i,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 i=e-3;i>0&&this.points_[i+2]>t;)i-=3;var n=this.points_[e+2]-this.points_[i+2];if(n<1e3/60)return!1;var r=this.points_[e]-this.points_[i],o=this.points_[e+1]-this.points_[i+1];return this.angle_=Math.atan2(o,r),this.initialVelocity_=Math.sqrt(r*r+o*o)/n,this.initialVelocity_>this.minVelocity_},t.prototype.getDistance=function(){return(this.minVelocity_-this.initialVelocity_)/this.decay_},t.prototype.getAngle=function(){return this.angle_},t}(),Pu=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}(),Ou="trackpad",Ru="wheel",Iu=function(t){function e(e){var i=this,n=e||{};(i=t.call(this,n)||this).totalDelta_=0,i.lastDelta_=0,i.maxDelta_=void 0!==n.maxDelta?n.maxDelta:1,i.duration_=void 0!==n.duration?n.duration:250,i.timeout_=void 0!==n.timeout?n.timeout:80,i.useAnchor_=void 0===n.useAnchor||n.useAnchor,i.constrainResolution_=void 0!==n.constrainResolution&&n.constrainResolution;var r=n.condition?n.condition:$l;return i.condition_=n.onFocusOnly?Yl(Hl,r):r,i.lastAnchor_=null,i.startTime_=void 0,i.timeoutId_,i.mode_=void 0,i.trackpadEventGap_=400,i.trackpadTimeoutId_,i.deltaPerZoom_=300,i}return Pu(e,t),e.prototype.endInteraction_=function(){this.trackpadTimeoutId_=void 0,this.getMap().getView().endInteraction(void 0,this.lastDelta_?this.lastDelta_>0?1:-1:0,this.lastAnchor_)},e.prototype.handleEvent=function(t){if(!this.condition_(t))return!0;if(t.type!==Wt)return!0;var e,i=t.map,n=t.originalEvent;if(n.preventDefault(),this.useAnchor_&&(this.lastAnchor_=t.coordinate),t.type==Wt&&(e=n.deltaY,oe&&n.deltaMode===WheelEvent.DOM_DELTA_PIXEL&&(e/=le),n.deltaMode===WheelEvent.DOM_DELTA_LINE&&(e*=40)),0===e)return!1;this.lastDelta_=e;var r=Date.now();void 0===this.startTime_&&(this.startTime_=r),(!this.mode_||r-this.startTime_>this.trackpadEventGap_)&&(this.mode_=Math.abs(e)<4?Ou:Ru);var o=i.getView();if(this.mode_===Ou&&!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_=r,!1;this.totalDelta_+=e;var s=Math.max(this.timeout_-(r-this.startTime_),0);return clearTimeout(this.timeoutId_),this.timeoutId_=setTimeout(this.handleWheelZoom_.bind(this,i),s),!1},e.prototype.handleWheelZoom_=function(t){var e=t.getView();e.getAnimating()&&e.cancelAnimations();var i=-je(this.totalDelta_,-this.maxDelta_*this.deltaPerZoom_,this.maxDelta_*this.deltaPerZoom_)/this.deltaPerZoom_;(e.getConstrainResolution()||this.constrainResolution_)&&(i=i?i>0?1:-1:0),Bl(e,i,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}(Wl),Fu=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}(),ju=function(t){function e(e){var i=this,n=e||{},r=n;return r.stopDown||(r.stopDown=wt),(i=t.call(this,r)||this).anchor_=null,i.lastAngle_=void 0,i.rotating_=!1,i.rotationDelta_=0,i.threshold_=void 0!==n.threshold?n.threshold:.3,i.duration_=void 0!==n.duration?n.duration:250,i}return Fu(e,t),e.prototype.handleDragEvent=function(t){var e=0,i=this.targetPointers[0],n=this.targetPointers[1],r=Math.atan2(n.clientY-i.clientY,n.clientX-i.clientX);if(void 0!==this.lastAngle_){var o=r-this.lastAngle_;this.rotationDelta_+=o,!this.rotating_&&Math.abs(this.rotationDelta_)>this.threshold_&&(this.rotating_=!0),e=o}this.lastAngle_=r;var s=t.map,a=s.getView();if(a.getConstraints().rotation!==Mo){var l=s.getViewport().getBoundingClientRect(),u=Xl(this.targetPointers);u[0]-=l.left,u[1]-=l.top,this.anchor_=s.getCoordinateFromPixelInternal(u),this.rotating_&&(s.render(),a.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}(Kl),Mu=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}(),Au=function(t){function e(e){var i=this,n=e||{},r=n;return r.stopDown||(r.stopDown=wt),(i=t.call(this,r)||this).anchor_=null,i.duration_=void 0!==n.duration?n.duration:400,i.lastDistance_=void 0,i.lastScaleDelta_=1,i}return Mu(e,t),e.prototype.handleDragEvent=function(t){var e=1,i=this.targetPointers[0],n=this.targetPointers[1],r=i.clientX-n.clientX,o=i.clientY-n.clientY,s=Math.sqrt(r*r+o*o);void 0!==this.lastDistance_&&(e=this.lastDistance_/s),this.lastDistance_=s;var a=t.map,l=a.getView();1!=e&&(this.lastScaleDelta_=e);var u=a.getViewport().getBoundingClientRect(),h=Xl(this.targetPointers);h[0]-=u.left,h[1]-=u.top,this.anchor_=a.getCoordinateFromPixelInternal(h),a.render(),l.adjustResolutionInternal(e,this.anchor_)},e.prototype.handleUpEvent=function(t){if(this.targetPointers.length<2){var e=t.map.getView(),i=this.lastScaleDelta_>1?1:-1;return e.endInteraction(this.duration_,i),!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}(Kl),Lu=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}(),Du=function(t){function e(e,i,n){var r=t.call(this)||this;if(void 0!==n&&void 0===i)r.setFlatCoordinates(n,e);else{var o=i||0;r.setCenterAndRadius(e,o,n)}return r}return Lu(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,i,n){var r=this.flatCoordinates,o=t-r[0],s=e-r[1],a=o*o+s*s;if(a<n){if(0===a)for(var l=0;l<this.stride;++l)i[l]=r[l];else{var u=this.getRadius()/Math.sqrt(a);i[0]=r[0]+u*o,i[1]=r[1]+u*s;for(l=2;l<this.stride;++l)i[l]=r[l]}return i.length=this.stride,a}return n},e.prototype.containsXY=function(t,e){var i=this.flatCoordinates,n=t-i[0],r=e-i[1];return n*n+r*r<=this.getRadiusSquared_()},e.prototype.getCenter=function(){return this.flatCoordinates.slice(0,this.stride)},e.prototype.computeExtent=function(t){var e=this.flatCoordinates,i=e[this.stride]-e[0];return rn(e[0]-i,e[1]-i,e[0]+i,e[1]+i,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 Ln},e.prototype.intersectsExtent=function(t){if(Tn(t,this.getExtent())){var e=this.getCenter();return t[0]<=e[0]&&t[2]>=e[0]||(t[1]<=e[1]&&t[3]>=e[1]||dn(t,this.intersectsCoordinate.bind(this)))}return!1},e.prototype.setCenter=function(t){var e=this.stride,i=this.flatCoordinates[e]-this.flatCoordinates[0],n=t.slice();n[e]=n[0]+i;for(var r=1;r<e;++r)n[e+r]=t[r];this.setFlatCoordinates(this.layout,n),this.changed()},e.prototype.setCenterAndRadius=function(t,e,i){this.setLayout(i,t,0),this.flatCoordinates||(this.flatCoordinates=[]);var n=this.flatCoordinates,r=ts(n,0,t,this.stride);n[r++]=n[0]+e;for(var o=1,s=this.stride;o<s;++o)n[r++]=n[o];n.length=r,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 i=this.getCenter(),n=this.getStride();this.setCenter(Bo(i,0,i.length,n,t,e,i)),this.changed()},e.prototype.translate=function(t,e){var i=this.getCenter(),n=this.getStride();this.setCenter(Wo(i,0,i.length,n,t,e,i)),this.changed()},e}(Yo);Du.prototype.transform;var zu=Du;function Gu(t,e,i,n,r){Nu(t,e,i||0,n||t.length-1,r||Wu)}function Nu(t,e,i,n,r){for(;n>i;){if(n-i>600){var o=n-i+1,s=e-i+1,a=Math.log(o),l=.5*Math.exp(2*a/3),u=.5*Math.sqrt(a*l*(o-l)/o)*(s-o/2<0?-1:1);Nu(t,e,Math.max(i,Math.floor(e-s*l/o+u)),Math.min(n,Math.floor(e+(o-s)*l/o+u)),r)}var h=t[e],c=i,p=n;for(Bu(t,i,e),r(t[n],h)>0&&Bu(t,i,n);c<p;){for(Bu(t,c,p),c++,p--;r(t[c],h)<0;)c++;for(;r(t[p],h)>0;)p--}0===r(t[i],h)?Bu(t,i,p):Bu(t,++p,n),p<=e&&(i=p+1),e<=p&&(n=p-1)}}function Bu(t,e,i){var n=t[e];t[e]=t[i],t[i]=n}function Wu(t,e){return t<e?-1:t>e?1:0}class qu{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 i=[];if(!th(t,e))return i;const n=this.toBBox,r=[];for(;e;){for(let o=0;o<e.children.length;o++){const s=e.children[o],a=e.leaf?n(s):s;th(t,a)&&(e.leaf?i.push(s):Qu(t,a)?this._all(s,i):r.push(s))}e=r.pop()}return i}collides(t){let e=this.data;if(!th(t,e))return!1;const i=[];for(;e;){for(let n=0;n<e.children.length;n++){const r=e.children[n],o=e.leaf?this.toBBox(r):r;if(th(t,o)){if(e.leaf||Qu(t,o))return!0;i.push(r)}}e=i.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=eh([]),this}remove(t,e){if(!t)return this;let i=this.data;const n=this.toBBox(t),r=[],o=[];let s,a,l;for(;i||r.length;){if(i||(i=r.pop(),a=r[r.length-1],s=o.pop(),l=!0),i.leaf){const n=Vu(t,i.children,e);if(-1!==n)return i.children.splice(n,1),r.push(i),this._condense(r),this}l||i.leaf||!Qu(i,n)?a?(s++,i=a.children[s],l=!1):i=null:(r.push(i),o.push(s),s=0,a=i,i=i.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 i=[];for(;t;)t.leaf?e.push(...t.children):i.push(...t.children),t=i.pop();return e}_build(t,e,i,n){const r=i-e+1;let o,s=this._maxEntries;if(r<=s)return o=eh(t.slice(e,i+1)),Uu(o,this.toBBox),o;n||(n=Math.ceil(Math.log(r)/Math.log(s)),s=Math.ceil(r/Math.pow(s,n-1))),o=eh([]),o.leaf=!1,o.height=n;const a=Math.ceil(r/s),l=a*Math.ceil(Math.sqrt(s));ih(t,e,i,l,this.compareMinX);for(let u=e;u<=i;u+=l){const e=Math.min(u+l-1,i);ih(t,u,e,a,this.compareMinY);for(let i=u;i<=e;i+=a){const r=Math.min(i+a-1,e);o.children.push(this._build(t,i,r,n-1))}}return Uu(o,this.toBBox),o}_chooseSubtree(t,e,i,n){for(;n.push(e),!e.leaf&&n.length-1!==i;){let i,n=1/0,s=1/0;for(let a=0;a<e.children.length;a++){const l=e.children[a],u=Hu(l),h=(r=t,o=l,(Math.max(o.maxX,r.maxX)-Math.min(o.minX,r.minX))*(Math.max(o.maxY,r.maxY)-Math.min(o.minY,r.minY))-u);h<s?(s=h,n=u<n?u:n,i=l):h===s&&u<n&&(n=u,i=l)}e=i||e.children[0]}var r,o;return e}_insert(t,e,i){const n=i?t:this.toBBox(t),r=[],o=this._chooseSubtree(n,this.data,e,r);for(o.children.push(t),Ku(o,n);e>=0&&r[e].children.length>this._maxEntries;)this._split(r,e),e--;this._adjustParentBBoxes(n,r,e)}_split(t,e){const i=t[e],n=i.children.length,r=this._minEntries;this._chooseSplitAxis(i,r,n);const o=this._chooseSplitIndex(i,r,n),s=eh(i.children.splice(o,i.children.length-o));s.height=i.height,s.leaf=i.leaf,Uu(i,this.toBBox),Uu(s,this.toBBox),e?t[e-1].children.push(s):this._splitRoot(i,s)}_splitRoot(t,e){this.data=eh([t,e]),this.data.height=t.height+1,this.data.leaf=!1,Uu(this.data,this.toBBox)}_chooseSplitIndex(t,e,i){let n,r=1/0,o=1/0;for(let s=e;s<=i-e;s++){const e=Xu(t,0,s,this.toBBox),a=Xu(t,s,i,this.toBBox),l=Ju(e,a),u=Hu(e)+Hu(a);l<r?(r=l,n=s,o=u<o?u:o):l===r&&u<o&&(o=u,n=s)}return n||i-e}_chooseSplitAxis(t,e,i){const n=t.leaf?this.compareMinX:Yu,r=t.leaf?this.compareMinY:Zu;this._allDistMargin(t,e,i,n)<this._allDistMargin(t,e,i,r)&&t.children.sort(n)}_allDistMargin(t,e,i,n){t.children.sort(n);const r=this.toBBox,o=Xu(t,0,e,r),s=Xu(t,i-e,i,r);let a=$u(o)+$u(s);for(let l=e;l<i-e;l++){const e=t.children[l];Ku(o,t.leaf?r(e):e),a+=$u(o)}for(let l=i-e-1;l>=e;l--){const e=t.children[l];Ku(s,t.leaf?r(e):e),a+=$u(s)}return a}_adjustParentBBoxes(t,e,i){for(let n=i;n>=0;n--)Ku(e[n],t)}_condense(t){for(let e,i=t.length-1;i>=0;i--)0===t[i].children.length?i>0?(e=t[i-1].children,e.splice(e.indexOf(t[i]),1)):this.clear():Uu(t[i],this.toBBox)}}function Vu(t,e,i){if(!i)return e.indexOf(t);for(let n=0;n<e.length;n++)if(i(t,e[n]))return n;return-1}function Uu(t,e){Xu(t,0,t.children.length,e,t)}function Xu(t,e,i,n,r){r||(r=eh(null)),r.minX=1/0,r.minY=1/0,r.maxX=-1/0,r.maxY=-1/0;for(let o=e;o<i;o++){const e=t.children[o];Ku(r,t.leaf?n(e):e)}return r}function Ku(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 Yu(t,e){return t.minX-e.minX}function Zu(t,e){return t.minY-e.minY}function Hu(t){return(t.maxX-t.minX)*(t.maxY-t.minY)}function $u(t){return t.maxX-t.minX+(t.maxY-t.minY)}function Ju(t,e){const i=Math.max(t.minX,e.minX),n=Math.max(t.minY,e.minY),r=Math.min(t.maxX,e.maxX),o=Math.min(t.maxY,e.maxY);return Math.max(0,r-i)*Math.max(0,o-n)}function Qu(t,e){return t.minX<=e.minX&&t.minY<=e.minY&&e.maxX<=t.maxX&&e.maxY<=t.maxY}function th(t,e){return e.minX<=t.maxX&&e.minY<=t.maxY&&e.maxX>=t.minX&&e.maxY>=t.minY}function eh(t){return{children:t,height:1,leaf:!0,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}}function ih(t,e,i,n,r){const o=[e,i];for(;o.length;){if((i=o.pop())-(e=o.pop())<=n)continue;const s=e+Math.ceil((i-e)/n/2)*n;Gu(t,s,e,i,r),o.push(e,s,s,i)}}var nh=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}(),rh="renderOrder",oh=function(t){function e(e){var i=this,n=e||{},r=Ct({},n);return delete r.style,delete r.renderBuffer,delete r.updateWhileAnimating,delete r.updateWhileInteracting,(i=t.call(this,r)||this).declutter_=void 0!==n.declutter&&n.declutter,i.renderBuffer_=void 0!==n.renderBuffer?n.renderBuffer:100,i.style_=null,i.styleFunction_=void 0,i.setStyle(n.style),i.updateWhileAnimating_=void 0!==n.updateWhileAnimating&&n.updateWhileAnimating,i.updateWhileInteracting_=void 0!==n.updateWhileInteracting&&n.updateWhileInteracting,i}return nh(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(rh)},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 qu(9)),this.getRenderer().renderDeclutter(t)},e.prototype.setRenderOrder=function(t){this.set(rh,t)},e.prototype.setStyle=function(t){this.style_=void 0!==t?t:nl,this.styleFunction_=null===t?void 0:function(t){var e;if("function"==typeof t)e=t;else{var i;Array.isArray(t)?i=t:(Fe("function"==typeof t.getZIndex,41),i=[t]),e=function(){return i}}return e}(this.style_),this.changed()},e}(Je),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},ah=[sh.FILL],lh=[sh.STROKE],uh=[sh.BEGIN_PATH],hh=[sh.CLOSE_PATH],ch=sh,ph=function(){function t(){}return t.prototype.drawCustom=function(t,e,i,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}(),dh=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}(),fh=function(t){function e(e,i,n,r){var o=t.call(this)||this;return o.tolerance=e,o.maxExtent=i,o.pixelRatio=r,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 dh(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 i=this.getBufferedMaxExtent(),n=this.tmpCoordinate_,r=this.coordinates,o=r.length,s=0,a=t.length;s<a;s+=e)n[0]=t[s],n[1]=t[s+1],Ji(i,n)&&(r[o++]=n[0],r[o++]=n[1]);return o},e.prototype.appendFlatLineCoordinates=function(t,e,i,n,r,o){var s=this.coordinates,a=s.length,l=this.getBufferedMaxExtent();o&&(e+=n);var u,h,c,p=t[e],d=t[e+1],f=this.tmpCoordinate_,y=!0;for(u=e+n;u<i;u+=n)f[0]=t[u],f[1]=t[u+1],(c=en(l,f))!==h?(y&&(s[a++]=p,s[a++]=d,y=!1),s[a++]=f[0],s[a++]=f[1]):c===qi?(s[a++]=f[0],s[a++]=f[1],y=!1):y=!0,p=f[0],d=f[1],h=c;return(r&&y||u===e+n)&&(s[a++]=p,s[a++]=d),a},e.prototype.drawCustomCoordinates_=function(t,e,i,n,r){for(var o=0,s=i.length;o<s;++o){var a=i[o],l=this.appendFlatLineCoordinates(t,e,a,n,!1,!1);r.push(l),e=a}return e},e.prototype.drawCustom=function(t,e,i,n){this.beginGeometry(t,e);var r,o,s,a,l,u=t.getType(),h=t.getStride(),c=this.coordinates.length;switch(u){case Mn:r=t.getOrientedFlatCoordinates(),a=[];var p=t.getEndss();l=0;for(var d=0,f=p.length;d<f;++d){var y=[];l=this.drawCustomCoordinates_(r,l,p[d],h,y),a.push(y)}this.instructions.push([ch.CUSTOM,c,a,t,i,us]),this.hitDetectionInstructions.push([ch.CUSTOM,c,a,t,n||i,us]);break;case In:case jn:s=[],r=u==In?t.getOrientedFlatCoordinates():t.getFlatCoordinates(),l=this.drawCustomCoordinates_(r,0,t.getEnds(),h,s),this.instructions.push([ch.CUSTOM,c,s,t,i,ls]),this.hitDetectionInstructions.push([ch.CUSTOM,c,s,t,n||i,ls]);break;case On:case Ln:r=t.getFlatCoordinates(),o=this.appendFlatLineCoordinates(r,0,r.length,h,!1,!1),this.instructions.push([ch.CUSTOM,c,o,t,i,as]),this.hitDetectionInstructions.push([ch.CUSTOM,c,o,t,n||i,as]);break;case Fn:r=t.getFlatCoordinates(),(o=this.appendFlatPointCoordinates(r,h))>c&&(this.instructions.push([ch.CUSTOM,c,o,t,i,as]),this.hitDetectionInstructions.push([ch.CUSTOM,c,o,t,n||i,as]));break;case Pn:r=t.getFlatCoordinates(),this.coordinates.push(r[0],r[1]),o=this.coordinates.length,this.instructions.push([ch.CUSTOM,c,o,t,i]),this.hitDetectionInstructions.push([ch.CUSTOM,c,o,t,n||i])}this.endGeometry(e)},e.prototype.beginGeometry=function(t,e){this.beginGeometryInstruction1_=[ch.BEGIN_GEOMETRY,e,0,t],this.instructions.push(this.beginGeometryInstruction1_),this.beginGeometryInstruction2_=[ch.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 i,n,r=e.length,o=-1;for(t=0;t<r;++t)(n=(i=e[t])[0])==ch.END_GEOMETRY?o=t:n==ch.BEGIN_GEOMETRY&&(i[2]=t,vt(this.hitDetectionInstructions,o,t),o=-1)},e.prototype.setFillStrokeStyle=function(t,e){var i=this.state;if(t){var n=t.getColor();i.fillStyle=Ha(n||"#000")}else i.fillStyle=void 0;if(e){var r=e.getColor();i.strokeStyle=Ha(r||"#000");var o=e.getLineCap();i.lineCap=void 0!==o?o:"round";var s=e.getLineDash();i.lineDash=s?s.slice():zr;var a=e.getLineDashOffset();i.lineDashOffset=a||0;var l=e.getLineJoin();i.lineJoin=void 0!==l?l:"round";var u=e.getWidth();i.lineWidth=void 0!==u?u:1;var h=e.getMiterLimit();i.miterLimit=void 0!==h?h:10,i.lineWidth>this.maxLineWidth&&(this.maxLineWidth=i.lineWidth,this.bufferedMaxExtent_=null)}else i.strokeStyle=void 0,i.lineCap=void 0,i.lineDash=null,i.lineDashOffset=void 0,i.lineJoin=void 0,i.lineWidth=void 0,i.miterLimit=void 0},e.prototype.createFill=function(t){var e=t.fillStyle,i=[ch.SET_FILL_STYLE,e];return"string"!=typeof e&&i.push(!0),i},e.prototype.applyStroke=function(t){this.instructions.push(this.createStroke(t))},e.prototype.createStroke=function(t){return[ch.SET_STROKE_STYLE,t.strokeStyle,t.lineWidth*this.pixelRatio,t.lineCap,t.lineJoin,t.miterLimit,this.applyPixelRatio(t.lineDash),t.lineDashOffset*this.pixelRatio]},e.prototype.updateFillStyle=function(t,e){var i=t.fillStyle;"string"==typeof i&&t.currentFillStyle==i||(void 0!==i&&this.instructions.push(e.call(this,t)),t.currentFillStyle=i)},e.prototype.updateStrokeStyle=function(t,e){var i=t.strokeStyle,n=t.lineCap,r=t.lineDash,o=t.lineDashOffset,s=t.lineJoin,a=t.lineWidth,l=t.miterLimit;(t.currentStrokeStyle!=i||t.currentLineCap!=n||r!=t.currentLineDash&&!xt(t.currentLineDash,r)||t.currentLineDashOffset!=o||t.currentLineJoin!=s||t.currentLineWidth!=a||t.currentMiterLimit!=l)&&(void 0!==i&&e.call(this,t),t.currentStrokeStyle=i,t.currentLineCap=n,t.currentLineDash=r,t.currentLineDashOffset=o,t.currentLineJoin=s,t.currentLineWidth=a,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=[ch.END_GEOMETRY,t];this.instructions.push(e),this.hitDetectionInstructions.push(e)},e.prototype.getBufferedMaxExtent=function(){if(!this.bufferedMaxExtent_&&(this.bufferedMaxExtent_=Hi(this.maxExtent),this.maxLineWidth>0)){var t=this.resolution*(this.maxLineWidth+1)/2;Zi(this.bufferedMaxExtent_,t,this.bufferedMaxExtent_)}return this.bufferedMaxExtent_},e}(ph),yh=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}(),gh=function(t){function e(e,i,n,r){var o=t.call(this,e,i,n,r)||this;return o.hitDetectionImage_=null,o.image_=null,o.imagePixelRatio_=void 0,o.anchorX_=void 0,o.anchorY_=void 0,o.height_=void 0,o.opacity_=void 0,o.originX_=void 0,o.originY_=void 0,o.rotateWithView_=void 0,o.rotation_=void 0,o.scale_=void 0,o.width_=void 0,o.declutterImageWithText_=void 0,o}return yh(e,t),e.prototype.drawPoint=function(t,e){if(this.image_){this.beginGeometry(t,e);var i=t.getFlatCoordinates(),n=t.getStride(),r=this.coordinates.length,o=this.appendFlatPointCoordinates(i,n);this.instructions.push([ch.DRAW_IMAGE,r,o,this.image_,this.anchorX_*this.imagePixelRatio_,this.anchorY_*this.imagePixelRatio_,Math.ceil(this.height_*this.imagePixelRatio_),this.opacity_,this.originX_,this.originY_,this.rotateWithView_,this.rotation_,[this.scale_[0]*this.pixelRatio/this.imagePixelRatio_,this.scale_[1]*this.pixelRatio/this.imagePixelRatio_],Math.ceil(this.width_*this.imagePixelRatio_),this.declutterImageWithText_]),this.hitDetectionInstructions.push([ch.DRAW_IMAGE,r,o,this.hitDetectionImage_,this.anchorX_,this.anchorY_,this.height_,this.opacity_,this.originX_,this.originY_,this.rotateWithView_,this.rotation_,this.scale_,this.width_,this.declutterImageWithText_]),this.endGeometry(e)}},e.prototype.drawMultiPoint=function(t,e){if(this.image_){this.beginGeometry(t,e);var i=t.getFlatCoordinates(),n=t.getStride(),r=this.coordinates.length,o=this.appendFlatPointCoordinates(i,n);this.instructions.push([ch.DRAW_IMAGE,r,o,this.image_,this.anchorX_*this.imagePixelRatio_,this.anchorY_*this.imagePixelRatio_,Math.ceil(this.height_*this.imagePixelRatio_),this.opacity_,this.originX_,this.originY_,this.rotateWithView_,this.rotation_,[this.scale_[0]*this.pixelRatio/this.imagePixelRatio_,this.scale_[1]*this.pixelRatio/this.imagePixelRatio_],Math.ceil(this.width_*this.imagePixelRatio_),this.declutterImageWithText_]),this.hitDetectionInstructions.push([ch.DRAW_IMAGE,r,o,this.hitDetectionImage_,this.anchorX_,this.anchorY_,this.height_,this.opacity_,this.originX_,this.originY_,this.rotateWithView_,this.rotation_,this.scale_,this.width_,this.declutterImageWithText_]),this.endGeometry(e)}},e.prototype.finish=function(){return this.reverseHitDetectionInstructions(),this.anchorX_=void 0,this.anchorY_=void 0,this.hitDetectionImage_=null,this.image_=null,this.imagePixelRatio_=void 0,this.height_=void 0,this.scale_=void 0,this.opacity_=void 0,this.originX_=void 0,this.originY_=void 0,this.rotateWithView_=void 0,this.rotation_=void 0,this.width_=void 0,t.prototype.finish.call(this)},e.prototype.setImageStyle=function(t,e){var i=t.getAnchor(),n=t.getSize(),r=t.getHitDetectionImage(),o=t.getImage(this.pixelRatio),s=t.getOrigin();this.imagePixelRatio_=t.getPixelRatio(this.pixelRatio),this.anchorX_=i[0],this.anchorY_=i[1],this.hitDetectionImage_=r,this.image_=o,this.height_=n[1],this.opacity_=t.getOpacity(),this.originX_=s[0]*this.imagePixelRatio_,this.originY_=s[1]*this.imagePixelRatio_,this.rotateWithView_=t.getRotateWithView(),this.rotation_=t.getRotation(),this.scale_=t.getScaleArray(),this.width_=n[0],this.declutterImageWithText_=e},e}(fh),mh=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}(),vh=function(t){function e(e,i,n,r){return t.call(this,e,i,n,r)||this}return mh(e,t),e.prototype.drawFlatCoordinates_=function(t,e,i,n){var r=this.coordinates.length,o=this.appendFlatLineCoordinates(t,e,i,n,!1,!1),s=[ch.MOVE_TO_LINE_TO,r,o];return this.instructions.push(s),this.hitDetectionInstructions.push(s),i},e.prototype.drawLineString=function(t,e){var i=this.state,n=i.strokeStyle,r=i.lineWidth;if(void 0!==n&&void 0!==r){this.updateStrokeStyle(i,this.applyStroke),this.beginGeometry(t,e),this.hitDetectionInstructions.push([ch.SET_STROKE_STYLE,i.strokeStyle,i.lineWidth,i.lineCap,i.lineJoin,i.miterLimit,zr,0],uh);var o=t.getFlatCoordinates(),s=t.getStride();this.drawFlatCoordinates_(o,0,o.length,s),this.hitDetectionInstructions.push(lh),this.endGeometry(e)}},e.prototype.drawMultiLineString=function(t,e){var i=this.state,n=i.strokeStyle,r=i.lineWidth;if(void 0!==n&&void 0!==r){this.updateStrokeStyle(i,this.applyStroke),this.beginGeometry(t,e),this.hitDetectionInstructions.push([ch.SET_STROKE_STYLE,i.strokeStyle,i.lineWidth,i.lineCap,i.lineJoin,i.miterLimit,i.lineDash,i.lineDashOffset],uh);for(var o=t.getEnds(),s=t.getFlatCoordinates(),a=t.getStride(),l=0,u=0,h=o.length;u<h;++u)l=this.drawFlatCoordinates_(s,l,o[u],a);this.hitDetectionInstructions.push(lh),this.endGeometry(e)}},e.prototype.finish=function(){var e=this.state;return null!=e.lastStroke&&e.lastStroke!=this.coordinates.length&&this.instructions.push(lh),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(lh),e.lastStroke=this.coordinates.length),e.lastStroke=0,t.prototype.applyStroke.call(this,e),this.instructions.push(uh)},e}(fh),_h=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}(),xh=function(t){function e(e,i,n,r){return t.call(this,e,i,n,r)||this}return _h(e,t),e.prototype.drawFlatCoordinatess_=function(t,e,i,n){var r=this.state,o=void 0!==r.fillStyle,s=void 0!==r.strokeStyle,a=i.length;this.instructions.push(uh),this.hitDetectionInstructions.push(uh);for(var l=0;l<a;++l){var u=i[l],h=this.coordinates.length,c=this.appendFlatLineCoordinates(t,e,u,n,!0,!s),p=[ch.MOVE_TO_LINE_TO,h,c];this.instructions.push(p),this.hitDetectionInstructions.push(p),s&&(this.instructions.push(hh),this.hitDetectionInstructions.push(hh)),e=u}return o&&(this.instructions.push(ah),this.hitDetectionInstructions.push(ah)),s&&(this.instructions.push(lh),this.hitDetectionInstructions.push(lh)),e},e.prototype.drawCircle=function(t,e){var i=this.state,n=i.fillStyle,r=i.strokeStyle;if(void 0!==n||void 0!==r){this.setFillStrokeStyles_(),this.beginGeometry(t,e),void 0!==i.fillStyle&&this.hitDetectionInstructions.push([ch.SET_FILL_STYLE,"#000"]),void 0!==i.strokeStyle&&this.hitDetectionInstructions.push([ch.SET_STROKE_STYLE,i.strokeStyle,i.lineWidth,i.lineCap,i.lineJoin,i.miterLimit,i.lineDash,i.lineDashOffset]);var o=t.getFlatCoordinates(),s=t.getStride(),a=this.coordinates.length;this.appendFlatLineCoordinates(o,0,o.length,s,!1,!1);var l=[ch.CIRCLE,a];this.instructions.push(uh,l),this.hitDetectionInstructions.push(uh,l),void 0!==i.fillStyle&&(this.instructions.push(ah),this.hitDetectionInstructions.push(ah)),void 0!==i.strokeStyle&&(this.instructions.push(lh),this.hitDetectionInstructions.push(lh)),this.endGeometry(e)}},e.prototype.drawPolygon=function(t,e){var i=this.state,n=i.fillStyle,r=i.strokeStyle;if(void 0!==n||void 0!==r){this.setFillStrokeStyles_(),this.beginGeometry(t,e),void 0!==i.fillStyle&&this.hitDetectionInstructions.push([ch.SET_FILL_STYLE,"#000"]),void 0!==i.strokeStyle&&this.hitDetectionInstructions.push([ch.SET_STROKE_STYLE,i.strokeStyle,i.lineWidth,i.lineCap,i.lineJoin,i.miterLimit,i.lineDash,i.lineDashOffset]);var o=t.getEnds(),s=t.getOrientedFlatCoordinates(),a=t.getStride();this.drawFlatCoordinatess_(s,0,o,a),this.endGeometry(e)}},e.prototype.drawMultiPolygon=function(t,e){var i=this.state,n=i.fillStyle,r=i.strokeStyle;if(void 0!==n||void 0!==r){this.setFillStrokeStyles_(),this.beginGeometry(t,e),void 0!==i.fillStyle&&this.hitDetectionInstructions.push([ch.SET_FILL_STYLE,"#000"]),void 0!==i.strokeStyle&&this.hitDetectionInstructions.push([ch.SET_STROKE_STYLE,i.strokeStyle,i.lineWidth,i.lineCap,i.lineJoin,i.miterLimit,i.lineDash,i.lineDashOffset]);for(var o=t.getEndss(),s=t.getOrientedFlatCoordinates(),a=t.getStride(),l=0,u=0,h=o.length;u<h;++u)l=this.drawFlatCoordinatess_(s,l,o[u],a);this.endGeometry(e)}},e.prototype.finish=function(){this.reverseHitDetectionInstructions(),this.state=null;var e=this.tolerance;if(0!==e)for(var i=this.coordinates,n=0,r=i.length;n<r;++n)i[n]=rs(i[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}(fh);function bh(t,e,i,n,r){var o,s,a,l,u,h,c,p,d,f=i,y=i,g=0,m=0,v=i;for(o=i;o<n;o+=r){var _=e[o],x=e[o+1];void 0!==l&&(p=_-l,d=x-u,a=Math.sqrt(p*p+d*d),void 0!==h&&(m+=s,Math.acos((h*p+c*d)/(s*a))>t&&(m>g&&(g=m,f=v,y=o),m=0,v=o-r)),s=a,h=p,c=d),l=_,u=x}return(m+=a)>g?[v,o]:[f,y]}var wh=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}(),Sh={left:0,end:0,center:.5,right:1,start:1,top:0,middle:.5,hanging:.2,alphabetic:.8,ideographic:.8,bottom:1},Ch={Circle:xh,Default:fh,Image:gh,LineString:vh,Polygon:xh,Text:function(t){function e(e,i,n,r){var o=t.call(this,e,i,n,r)||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 wh(e,t),e.prototype.finish=function(){var e=t.prototype.finish.call(this);return e.textStates=this.textStates,e.fillStates=this.fillStates,e.strokeStates=this.strokeStates,e},e.prototype.drawText=function(t,e){var i=this.textFillState_,n=this.textStrokeState_,r=this.textState_;if(""!==this.text_&&r&&(i||n)){var o=this.coordinates,s=o.length,a=t.getType(),l=null,u=t.getStride();if(r.placement!==ll||a!=On&&a!=jn&&a!=In&&a!=Mn){var h=r.overflow?null:[];switch(a){case Pn:case Fn:l=t.getFlatCoordinates();break;case On:l=t.getFlatMidpoint();break;case Ln:l=t.getCenter();break;case jn:l=t.getFlatMidpoints(),u=2;break;case In:l=t.getFlatInteriorPoint(),r.overflow||h.push(l[2]/this.resolution),u=3;break;case Mn:var c=t.getFlatInteriorPoints();l=[];for(w=0,S=c.length;w<S;w+=3)r.overflow||h.push(c[w+2]/this.resolution),l.push(c[w],c[w+1]);if(0===l.length)return;u=2}if((R=this.appendFlatPointCoordinates(l,u))===s)return;if(h&&(R-s)/2!=l.length/u){var p=s/2;h=h.filter((function(t,e){var i=o[2*(p+e)]===l[e*u]&&o[2*(p+e)+1]===l[e*u+1];return i||--p,i}))}this.saveTextStates_(),(r.backgroundFill||r.backgroundStroke)&&(this.setFillStrokeStyle(r.backgroundFill,r.backgroundStroke),r.backgroundFill&&(this.updateFillStyle(this.state,this.createFill),this.hitDetectionInstructions.push(this.createFill(this.state))),r.backgroundStroke&&(this.updateStrokeStyle(this.state,this.applyStroke),this.hitDetectionInstructions.push(this.createStroke(this.state)))),this.beginGeometry(t,e);var d=r.padding;if(d!=Gr&&(r.scale[0]<0||r.scale[1]<0)){var f=r.padding[0],y=r.padding[1],g=r.padding[2],m=r.padding[3];r.scale[0]<0&&(y=-y,m=-m),r.scale[1]<0&&(f=-f,g=-g),d=[f,y,g,m]}var v=this.pixelRatio;this.instructions.push([ch.DRAW_IMAGE,s,R,null,NaN,NaN,NaN,1,0,0,this.textRotateWithView_,this.textRotation_,[1,1],NaN,this.declutterImageWithText_,d==Gr?Gr:d.map((function(t){return t*v})),!!r.backgroundFill,!!r.backgroundStroke,this.text_,this.textKey_,this.strokeKey_,this.fillKey_,this.textOffsetX_,this.textOffsetY_,h]);var _=1/v;this.hitDetectionInstructions.push([ch.DRAW_IMAGE,s,R,null,NaN,NaN,NaN,1,0,0,this.textRotateWithView_,this.textRotation_,[_,_],NaN,this.declutterImageWithText_,d,!!r.backgroundFill,!!r.backgroundStroke,this.text_,this.textKey_,this.strokeKey_,this.fillKey_,this.textOffsetX_,this.textOffsetY_,h]),this.endGeometry(e)}else{if(!Tn(this.getBufferedMaxExtent(),t.getExtent()))return;var x=void 0;if(l=t.getFlatCoordinates(),a==On)x=[l.length];else if(a==jn)x=t.getEnds();else if(a==In)x=t.getEnds().slice(0,1);else if(a==Mn){var b=t.getEndss();x=[];for(var w=0,S=b.length;w<S;++w)x.push(b[w][0])}this.beginGeometry(t,e);for(var C=r.textAlign,T=0,E=void 0,k=0,P=x.length;k<P;++k){if(null==C){var O=bh(r.maxAngle,l,T,x[k],u);T=O[0],E=O[1]}else E=x[k];for(var w=T;w<E;w+=u)o.push(l[w],l[w+1]);var R=o.length;T=x[k],this.drawChars_(s,R),s=R}this.endGeometry(e)}}},e.prototype.saveTextStates_=function(){var t=this.textStrokeState_,e=this.textState_,i=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 r=this.textKey_;r in this.textStates||(this.textStates[r]={font:e.font,textAlign:e.textAlign||"center",textBaseline:e.textBaseline||"middle",scale:e.scale});var o=this.fillKey_;i&&(o in this.fillStates||(this.fillStates[o]={fillStyle:i.fillStyle}))},e.prototype.drawChars_=function(t,e){var i=this.textStrokeState_,n=this.textState_,r=this.strokeKey_,o=this.textKey_,s=this.fillKey_;this.saveTextStates_();var a=this.pixelRatio,l=Sh[n.textBaseline],u=this.textOffsetY_*a,h=this.text_,c=i?i.lineWidth*Math.abs(n.scale[0])/2:0;this.instructions.push([ch.DRAW_CHARS,t,e,l,n.overflow,s,n.maxAngle,a,u,r,c*a,h,o,1]),this.hitDetectionInstructions.push([ch.DRAW_CHARS,t,e,l,n.overflow,s,n.maxAngle,1,u,r,c,h,o,1/a])},e.prototype.setTextStyle=function(t,e){var i,n,r;if(t){var o=t.getFill();o?((n=this.textFillState_)||(n={},this.textFillState_=n),n.fillStyle=Ha(o.getColor()||"#000")):(n=null,this.textFillState_=n);var s=t.getStroke();if(s){(r=this.textStrokeState_)||(r={},this.textStrokeState_=r);var a=s.getLineDash(),l=s.getLineDashOffset(),u=s.getWidth(),h=s.getMiterLimit();r.lineCap=s.getLineCap()||"round",r.lineDash=a?a.slice():zr,r.lineDashOffset=void 0===l?0:l,r.lineJoin=s.getLineJoin()||"round",r.lineWidth=void 0===u?1:u,r.miterLimit=void 0===h?10:h,r.strokeStyle=Ha(s.getColor()||"#000")}else r=null,this.textStrokeState_=r;i=this.textState_;var c=t.getFont()||"10px sans-serif";Xr(c);var p=t.getScaleArray();i.overflow=t.getOverflow(),i.font=c,i.maxAngle=t.getMaxAngle(),i.placement=t.getPlacement(),i.textAlign=t.getTextAlign(),i.textBaseline=t.getTextBaseline()||"middle",i.backgroundFill=t.getBackgroundFill(),i.backgroundStroke=t.getBackgroundStroke(),i.padding=t.getPadding()||Gr,i.scale=void 0===p?[1,1]:p;var d=t.getOffsetX(),f=t.getOffsetY(),y=t.getRotateWithView(),g=t.getRotation();this.text_=t.getText()||"",this.textOffsetX_=void 0===d?0:d,this.textOffsetY_=void 0===f?0:f,this.textRotateWithView_=void 0!==y&&y,this.textRotation_=void 0===g?0:g,this.strokeKey_=r?("string"==typeof r.strokeStyle?r.strokeStyle:$t(r.strokeStyle))+r.lineCap+r.lineDashOffset+"|"+r.lineWidth+r.lineJoin+r.miterLimit+"["+r.lineDash.join()+"]":"",this.textKey_=i.font+i.scale+(i.textAlign||"?")+(i.textBaseline||"?"),this.fillKey_=n?"string"==typeof n.fillStyle?n.fillStyle:"|"+$t(n.fillStyle):""}else this.text_="";this.declutterImageWithText_=e},e}(fh)},Th=function(){function t(t,e,i,n){this.tolerance_=t,this.maxExtent_=e,this.pixelRatio_=n,this.resolution_=i,this.buildersByZIndex_={}}return t.prototype.finish=function(){var t={};for(var e in this.buildersByZIndex_){t[e]=t[e]||{};var i=this.buildersByZIndex_[e];for(var n in i){var r=i[n].finish();t[e][n]=r}}return t},t.prototype.getBuilder=function(t,e){var i=void 0!==t?t.toString():"0",n=this.buildersByZIndex_[i];void 0===n&&(n={},this.buildersByZIndex_[i]=n);var r=n[e];void 0===r&&(r=new(0,Ch[e])(this.tolerance_,this.maxExtent_,this.resolution_,this.pixelRatio_),n[e]=r);return r},t}(),Eh=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}(),kh=function(t){function e(e){var i=t.call(this)||this;return i.boundHandleImageChange_=i.handleImageChange_.bind(i),i.layer_=e,i.declutterExecutorGroup=null,i}return Eh(e,t),e.prototype.getFeatures=function(t){return Zt()},e.prototype.prepareFrame=function(t){return Zt()},e.prototype.renderFrame=function(t,e){return Zt()},e.prototype.loadedTileCallback=function(t,e,i){t[e]||(t[e]={}),t[e][i.tileCoord.toString()]=i},e.prototype.createLoadedTileFinder=function(t,e,i){return function(n,r){var o=this.loadedTileCallback.bind(this,i,n);return t.forEachLoadedTile(e,n,r,o)}.bind(this)},e.prototype.forEachFeatureAtCoordinate=function(t,e,i,n,r){},e.prototype.getDataAtPixel=function(t,e,i){return null},e.prototype.getLayer=function(){return this.layer_},e.prototype.handleFontsChanged=function(){},e.prototype.handleImageChange_=function(t){t.target.getState()===Da&&this.renderIfReadyAndVisible()},e.prototype.loadImage=function(t){var e=t.getState();return e!=Da&&e!=za&&t.addEventListener(It,this.boundHandleImageChange_),e==Aa&&(t.load(),e=t.getState()),e==Da},e.prototype.renderIfReadyAndVisible=function(){var t=this.getLayer();t.getVisible()&&t.getSourceState()==Ze&&t.changed()},e}(Yt),Ph=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}(),Oh=function(t){function e(e){var i=t.call(this,e)||this;return i.container=null,i.renderedResolution,i.tempTransform=[1,0,0,1,0,0],i.pixelTransform=[1,0,0,1,0,0],i.inversePixelTransform=[1,0,0,1,0,0],i.context=null,i.containerReused=!1,i}return Ph(e,t),e.prototype.useContainer=function(t,e,i){var n,r,o=this.getLayer().getClassName();t&&t.style.opacity===xe(i)&&t.className===o&&((a=t.firstElementChild)instanceof HTMLCanvasElement&&(r=a.getContext("2d")));if(r&&r.canvas.style.transform===e?(this.container=t,this.context=r,this.containerReused=!0):this.containerReused&&(this.container=null,this.context=null,this.containerReused=!1),!this.container){(n=document.createElement("div")).className=o;var s=n.style;s.position="absolute",s.width="100%",s.height="100%";var a=(r=pe()).canvas;n.appendChild(a),(s=a.style).position="absolute",s.left="0",s.transformOrigin="top left",this.container=n,this.context=r}},e.prototype.clipUnrotated=function(t,e,i){var n=wn(i),r=Sn(i),o=gn(i),s=yn(i);mr(e.coordinateToPixelTransform,n),mr(e.coordinateToPixelTransform,r),mr(e.coordinateToPixelTransform,o),mr(e.coordinateToPixelTransform,s);var a=this.inversePixelTransform;mr(a,n),mr(a,r),mr(a,o),mr(a,s),t.save(),t.beginPath(),t.moveTo(Math.round(n[0]),Math.round(n[1])),t.lineTo(Math.round(r[0]),Math.round(r[1])),t.lineTo(Math.round(o[0]),Math.round(o[1])),t.lineTo(Math.round(s[0]),Math.round(s[1])),t.clip()},e.prototype.dispatchRenderEvent_=function(t,e,i){var n=this.getLayer();if(n.hasListener(t)){var r=new Dr(t,this.inversePixelTransform,i,e);n.dispatchEvent(r)}},e.prototype.preRender=function(t,e){this.dispatchRenderEvent_(qe,t,e)},e.prototype.postRender=function(t,e){this.dispatchRenderEvent_(Ve,t,e)},e.prototype.getRenderTransform=function(t,e,i,n,r,o,s){var a=r/2,l=o/2,u=n/e,h=-u,c=-t[0]+s,p=-t[1];return _r(this.tempTransform,a,l,u,h,-i,c,p)},e.prototype.getDataAtPixel=function(t,e,i){var n,r=mr(this.inversePixelTransform,t.slice()),o=this.context,s=this.getLayer().getExtent();if(s&&!Ji(s,mr(e.pixelToCoordinateTransform,t.slice())))return null;try{var a=Math.round(r[0]),l=Math.round(r[1]),u=document.createElement("canvas"),h=u.getContext("2d");u.width=1,u.height=1,h.clearRect(0,0,1,1),h.drawImage(o.canvas,a,l,1,1,0,0,1,1),n=h.getImageData(0,0,1,1).data}catch(c){return"SecurityError"===c.name?new Uint8Array:n}return 0===n[3]?null:n},e}(kh),Rh="Circle",Ih="Default",Fh="Image",jh="LineString",Mh="Polygon",Ah="Text";function Lh(t,e,i,n,r,o,s,a,l,u,h,c){var p=t[e],d=t[e+1],f=0,y=0,g=0,m=0;function v(){f=p,y=d,p=t[e+=n],d=t[e+1],m+=g,g=Math.sqrt((p-f)*(p-f)+(d-y)*(d-y))}do{v()}while(e<i-n&&m+g<o);for(var _=0===g?0:(o-m)/g,x=Ne(f,p,_),b=Ne(y,d,_),w=e-n,S=m,C=o+a*l(u,r,h);e<i-n&&m+g<C;)v();var T,E=Ne(f,p,_=0===g?0:(C-m)/g),k=Ne(y,d,_);if(c){var P=[x,b,E,k];Bo(P,0,4,2,c,P,P),T=P[0]>P[2]}else T=x>E;var O,R=Math.PI,I=[],F=w+n===e;if(g=0,m=S,p=t[e=w],d=t[e+1],F){v(),O=Math.atan2(d-y,p-f),T&&(O+=O>0?-R:R);var j=(E+x)/2,M=(k+b)/2;return I[0]=[j,M,(C-o)/2,O,r],I}for(var A=0,L=r.length;A<L;){v();var D=Math.atan2(d-y,p-f);if(T&&(D+=D>0?-R:R),void 0!==O){var z=D-O;if(z+=z>R?-2*R:z<-R?2*R:0,Math.abs(z)>s)return null}O=D;for(var G=A,N=0;A<L;++A){var B=a*l(u,r[T?L-A-1:A],h);if(e+n<i&&m+g<o+N+B/2)break;N+=B}if(A!==G){var W=T?r.substring(L-G,L-A):r.substring(G,A);j=Ne(f,p,_=0===g?0:(o+N/2-m)/g),M=Ne(y,d,_);I.push([j,M,N/2,D,W]),o+=N}}return I}var Dh=[1/0,1/0,-1/0,-1/0],zh=[],Gh=[],Nh=[],Bh=[];function Wh(t){return t[3].declutterBox}var qh=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 Vh(t,e){return"start"!==e&&"end"!==e||qh.test(t)||(e="start"===e?"left":"right"),Sh[e]}var Uh=function(){function t(t,e,i,n){this.overlaps=i,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,i,n){var r=t+e+i+n;if(this.labels_[r])return this.labels_[r];var o=n?this.strokeStates[n]:null,s=i?this.fillStates[i]:null,a=this.textStates[e],l=this.pixelRatio,u=[a.scale[0]*l,a.scale[1]*l],h=Vh(t,a.textAlign||"center"),c=n&&o.lineWidth?o.lineWidth:0,p=t.split("\n"),d=p.length,f=[],y=function(t,e,i){for(var n=e.length,r=0,o=0;o<n;++o){var s=Zr(t,e[o]);r=Math.max(r,s),i.push(s)}return r}(a.font,p,f),g=Kr(a.font),m=y+c,v=[],_=(m+2)*u[0],x=(g*d+c)*u[1],b={width:_<0?Math.floor(_):Math.ceil(_),height:x<0?Math.floor(x):Math.ceil(x),contextInstructions:v};(1==u[0]&&1==u[1]||v.push("scale",u),v.push("font",a.font),n)&&(v.push("strokeStyle",o.strokeStyle),v.push("lineWidth",c),v.push("lineCap",o.lineCap),v.push("lineJoin",o.lineJoin),v.push("miterLimit",o.miterLimit),(ue?OffscreenCanvasRenderingContext2D:CanvasRenderingContext2D).prototype.setLineDash&&(v.push("setLineDash",[o.lineDash]),v.push("lineDashOffset",o.lineDashOffset)));i&&v.push("fillStyle",s.fillStyle),v.push("textBaseline","middle"),v.push("textAlign","center");var w,S=.5-h,C=h*m+S*c;if(n)for(w=0;w<d;++w)v.push("strokeText",[p[w],C+S*f[w],.5*(c+g)+w*g]);if(i)for(w=0;w<d;++w)v.push("fillText",[p[w],C+S*f[w],.5*(c+g)+w*g]);return this.labels_[r]=b,b},t.prototype.replayTextBackground_=function(t,e,i,n,r,o,s){t.beginPath(),t.moveTo.apply(t,e),t.lineTo.apply(t,i),t.lineTo.apply(t,n),t.lineTo.apply(t,r),t.lineTo.apply(t,e),o&&(this.alignFill_=o[2],this.fill_(t)),s&&(this.setStrokeStyle_(t,s),t.stroke())},t.prototype.calculateImageOrLabelDimensions_=function(t,e,i,n,r,o,s,a,l,u,h,c,p,d,f,y){var g,m=i-(s*=c[0]),v=n-(a*=c[1]),_=r+l>t?t-l:r,x=o+u>e?e-u:o,b=d[3]+_*c[0]+d[1],w=d[0]+x*c[1]+d[2],S=m-d[3],C=v-d[0];return(f||0!==h)&&(zh[0]=S,Bh[0]=S,zh[1]=C,Gh[1]=C,Gh[0]=S+b,Nh[0]=Gh[0],Nh[1]=C+w,Bh[1]=Nh[1]),0!==h?(mr(g=_r([1,0,0,1,0,0],i,n,1,1,h,-i,-n),zh),mr(g,Gh),mr(g,Nh),mr(g,Bh),rn(Math.min(zh[0],Gh[0],Nh[0],Bh[0]),Math.min(zh[1],Gh[1],Nh[1],Bh[1]),Math.max(zh[0],Gh[0],Nh[0],Bh[0]),Math.max(zh[1],Gh[1],Nh[1],Bh[1]),Dh)):rn(Math.min(S,S+b),Math.min(C,C+w),Math.max(S,S+b),Math.max(C,C+w),Dh),p&&(m=Math.round(m),v=Math.round(v)),{drawImageX:m,drawImageY:v,drawImageW:_,drawImageH:x,originX:l,originY:u,declutterBox:{minX:Dh[0],minY:Dh[1],maxX:Dh[2],maxY:Dh[3],value:y},canvasTransform:g,scale:c}},t.prototype.replayImageOrLabel_=function(t,e,i,n,r,o,s){var a=!(!o&&!s),l=n.declutterBox,u=t.canvas,h=s?s[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&&(a&&this.replayTextBackground_(t,zh,Gh,Nh,Bh,o,s),$r(t,n.canvasTransform,r,i,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=mr(this.renderedTransform_,[0,0]),i=512*this.pixelRatio;t.save(),t.translate(e[0]%i,e[1]%i),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,i,n){var r=this.textStates[e],o=this.createLabel(t,e,n,i),s=this.strokeStates[i],a=this.pixelRatio,l=Vh(t,r.textAlign||"center"),u=Sh[r.textBaseline||"middle"],h=s&&s.lineWidth?s.lineWidth:0;return{label:o,anchorX:l*(o.width/a-2*r.scale[0])+2*(.5-l)*h,anchorY:u*o.height/a+2*(.5-u)*h}},t.prototype.execute_=function(t,e,i,n,r,o,s,a){var l;this.pixelCoordinates_&&xt(i,this.renderedTransform_)?l=this.pixelCoordinates_:(this.pixelCoordinates_||(this.pixelCoordinates_=[]),l=No(this.coordinates,0,this.coordinates.length,2,i,this.pixelCoordinates_),function(t,e){t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5]}(this.renderedTransform_,i));for(var u,h,c,p,d,f,y,g,m,v,_,x,b,w,S,C,T=0,E=n.length,k=0,P=0,O=0,R=null,I=null,F=this.coordinateCache_,j=this.viewRotation_,M=Math.round(1e12*Math.atan2(-i[1],i[0]))/1e12,A={context:t,pixelRatio:this.pixelRatio,resolution:this.resolution,rotation:j},L=this.instructions!=n||this.overlaps?0:200;T<E;){var D=n[T];switch(D[0]){case ch.BEGIN_GEOMETRY:b=D[1],C=D[3],b.getGeometry()?void 0===s||Tn(s,C.getExtent())?++T:T=D[2]+1:T=D[2];break;case ch.BEGIN_PATH:P>L&&(this.fill_(t),P=0),O>L&&(t.stroke(),O=0),P||O||(t.beginPath(),p=NaN,d=NaN),++T;break;case ch.CIRCLE:var z=l[k=D[1]],G=l[k+1],N=l[k+2]-z,B=l[k+3]-G,W=Math.sqrt(N*N+B*B);t.moveTo(z+W,G),t.arc(z,G,W,0,2*Math.PI,!0),++T;break;case ch.CLOSE_PATH:t.closePath(),++T;break;case ch.CUSTOM:k=D[1],u=D[2];var q=D[3],V=D[4],U=6==D.length?D[5]:void 0;A.geometry=q,A.feature=b,T in F||(F[T]=[]);var X=F[T];U?U(l,k,u,2,X):(X[0]=l[k],X[1]=l[k+1],X.length=2),V(X,A),++T;break;case ch.DRAW_IMAGE:k=D[1],u=D[2],g=D[3],h=D[4],c=D[5];var K=D[6],Y=D[7],Z=D[8],H=D[9],$=D[10],J=D[11],Q=D[12],tt=D[13],et=D[14];if(!g&&D.length>=19){m=D[18],v=D[19],_=D[20],x=D[21];var it=this.drawLabelWithPointPlacement_(m,v,_,x);g=it.label,D[3]=g;var nt=D[22];h=(it.anchorX-nt)*this.pixelRatio,D[4]=h;var rt=D[23];c=(it.anchorY-rt)*this.pixelRatio,D[5]=c,K=g.height,D[6]=K,tt=g.width,D[13]=tt}var ot=void 0;D.length>24&&(ot=D[24]);var st=void 0,at=void 0,lt=void 0;D.length>16?(st=D[15],at=D[16],lt=D[17]):(st=Gr,at=!1,lt=!1),$&&M?J+=j:$||M||(J-=j);for(var ut=0;k<u;k+=2)if(!(ot&&ot[ut++]<tt/this.pixelRatio)){var ht=[t,e,g,zt=this.calculateImageOrLabelDimensions_(g.width,g.height,l[k],l[k+1],tt,K,h,c,Z,H,J,Q,r,st,at||lt,b),Y,at?R:null,lt?I:null],ct=void 0,pt=void 0;if(a&&et){var dt=u-k;if(!et[dt]){et[dt]=ht;continue}if(ct=et[dt],delete et[dt],pt=Wh(ct),a.collides(pt))continue}a&&a.collides(zt.declutterBox)||(ct&&(a&&a.insert(pt),this.replayImageOrLabel_.apply(this,ct)),a&&a.insert(zt.declutterBox),this.replayImageOrLabel_.apply(this,ht))}++T;break;case ch.DRAW_CHARS:var ft=D[1],yt=D[2],gt=D[3],mt=D[4];x=D[5];var vt=D[6],_t=D[7],bt=D[8];_=D[9];var wt=D[10];m=D[11],v=D[12];var St=[D[13],D[13]],Ct=this.textStates[v],Tt=Ct.font,Et=[Ct.scale[0]*_t,Ct.scale[1]*_t],kt=void 0;Tt in this.widths_?kt=this.widths_[Tt]:(kt={},this.widths_[Tt]=kt);var Pt=ca(l,ft,yt,2),Ot=Math.abs(Et[0])*Hr(Tt,m,kt);if(mt||Ot<=Pt){var Rt=this.textStates[v].textAlign,It=Lh(l,ft,yt,2,m,(Pt-Ot)*Sh[Rt],vt,Math.abs(Et[0]),Hr,Tt,kt,M?0:this.viewRotation_);t:if(It){var Ft=[],jt=void 0,Mt=void 0,At=void 0,Lt=void 0,Dt=void 0;if(_)for(jt=0,Mt=It.length;jt<Mt;++jt){At=(Dt=It[jt])[4],Lt=this.createLabel(At,v,"",_),h=Dt[2]+(Et[0]<0?-wt:wt),c=gt*Lt.height+2*(.5-gt)*wt*Et[1]/Et[0]-bt;var zt=this.calculateImageOrLabelDimensions_(Lt.width,Lt.height,Dt[0],Dt[1],Lt.width,Lt.height,h,c,0,0,Dt[3],St,!1,Gr,!1,b);if(a&&a.collides(zt.declutterBox))break t;Ft.push([t,e,Lt,zt,1,null,null])}if(x)for(jt=0,Mt=It.length;jt<Mt;++jt){At=(Dt=It[jt])[4],Lt=this.createLabel(At,v,x,""),h=Dt[2],c=gt*Lt.height-bt;zt=this.calculateImageOrLabelDimensions_(Lt.width,Lt.height,Dt[0],Dt[1],Lt.width,Lt.height,h,c,0,0,Dt[3],St,!1,Gr,!1,b);if(a&&a.collides(zt.declutterBox))break t;Ft.push([t,e,Lt,zt,1,null,null])}a&&a.load(Ft.map(Wh));for(var Gt=0,Nt=Ft.length;Gt<Nt;++Gt)this.replayImageOrLabel_.apply(this,Ft[Gt])}}++T;break;case ch.END_GEOMETRY:if(void 0!==o){var Bt=o(b=D[1],C);if(Bt)return Bt}++T;break;case ch.FILL:L?P++:this.fill_(t),++T;break;case ch.MOVE_TO_LINE_TO:for(k=D[1],u=D[2],w=l[k],y=(S=l[k+1])+.5|0,(f=w+.5|0)===p&&y===d||(t.moveTo(w,S),p=f,d=y),k+=2;k<u;k+=2)f=(w=l[k])+.5|0,y=(S=l[k+1])+.5|0,k!=u-2&&f===p&&y===d||(t.lineTo(w,S),p=f,d=y);++T;break;case ch.SET_FILL_STYLE:R=D,this.alignFill_=D[2],P&&(this.fill_(t),P=0,O&&(t.stroke(),O=0)),t.fillStyle=D[1],++T;break;case ch.SET_STROKE_STYLE:I=D,O&&(t.stroke(),O=0),this.setStrokeStyle_(t,D),++T;break;case ch.STROKE:L?O++:t.stroke(),++T;break;default:++T}}P&&this.fill_(t),O&&t.stroke()},t.prototype.execute=function(t,e,i,n,r,o){this.viewRotation_=n,this.execute_(t,e,i,this.instructions,r,void 0,void 0,o)},t.prototype.executeHitDetection=function(t,e,i,n,r){return this.viewRotation_=i,this.execute_(t,1,e,this.hitDetectionInstructions,!0,n,r)},t}(),Xh=[Mh,Rh,jh,Fh,Ah,Ih],Kh=function(){function t(t,e,i,n,r,o){this.maxExtent_=t,this.overlaps_=n,this.pixelRatio_=i,this.resolution_=e,this.renderBuffer_=o,this.executorsByZIndex_={},this.hitDetectionContext_=null,this.hitDetectionTransform_=[1,0,0,1,0,0],this.createExecutors_(r)}return t.prototype.clip=function(t,e){var i=this.getClipCoords(e);t.beginPath(),t.moveTo(i[0],i[1]),t.lineTo(i[2],i[3]),t.lineTo(i[4],i[5]),t.lineTo(i[6],i[7]),t.clip()},t.prototype.createExecutors_=function(t){for(var e in t){var i=this.executorsByZIndex_[e];void 0===i&&(i={},this.executorsByZIndex_[e]=i);var n=t[e];for(var r in n){var o=n[r];i[r]=new Uh(this.resolution_,this.pixelRatio_,this.overlaps_,o)}}},t.prototype.hasExecutors=function(t){for(var e in this.executorsByZIndex_)for(var i=this.executorsByZIndex_[e],n=0,r=t.length;n<r;++n)if(t[n]in i)return!0;return!1},t.prototype.forEachFeatureAtCoordinate=function(t,e,i,n,r,o){var s=2*(n=Math.round(n))+1,a=_r(this.hitDetectionTransform_,n+.5,n+.5,1/e,-1/e,-i,-t[0],-t[1]),l=!this.hitDetectionContext_;l&&(this.hitDetectionContext_=pe(s,s));var u,h=this.hitDetectionContext_;h.canvas.width!==s||h.canvas.height!==s?(h.canvas.width=s,h.canvas.height=s):l||h.clearRect(0,0,s,s),void 0!==this.renderBuffer_&&(hn(u=[1/0,1/0,-1/0,-1/0],t),Zi(u,e*(this.renderBuffer_+n),u));var c,p=function(t){if(void 0!==Yh[t])return Yh[t];for(var e=2*t+1,i=t*t,n=new Array(i+1),r=0;r<=t;++r)for(var o=0;o<=t;++o){var s=r*r+o*o;if(s>i)break;var a=n[s];a||(a=[],n[s]=a),a.push(4*((t+r)*e+(t+o))+3),r>0&&a.push(4*((t-r)*e+(t+o))+3),o>0&&(a.push(4*((t+r)*e+(t-o))+3),r>0&&a.push(4*((t-r)*e+(t-o))+3))}for(var l=[],u=(r=0,n.length);r<u;++r)n[r]&&l.push.apply(l,n[r]);return Yh[t]=l,l}(n);function d(t,e){for(var i=h.getImageData(0,0,s,s).data,a=0,l=p.length;a<l;a++)if(i[p[a]]>0){if(!o||c!==Fh&&c!==Ah||-1!==o.indexOf(t)){var u=(p[a]-3)/4,d=n-u%s,f=n-(u/s|0),y=r(t,e,d*d+f*f);if(y)return y}h.clearRect(0,0,s,s);break}}var f,y,g,m,v,_=Object.keys(this.executorsByZIndex_).map(Number);for(_.sort(gt),f=_.length-1;f>=0;--f){var x=_[f].toString();for(g=this.executorsByZIndex_[x],y=Xh.length-1;y>=0;--y)if(void 0!==(m=g[c=Xh[y]])&&(v=m.executeHitDetection(h,a,i,d,u)))return v}},t.prototype.getClipCoords=function(t){var e=this.maxExtent_;if(!e)return null;var i=e[0],n=e[1],r=e[2],o=e[3],s=[i,n,i,o,r,o,r,n];return No(s,0,8,2,t,s),s},t.prototype.isEmpty=function(){return kt(this.executorsByZIndex_)},t.prototype.execute=function(t,e,i,n,r,o,s){var a=Object.keys(this.executorsByZIndex_).map(Number);a.sort(gt),this.maxExtent_&&(t.save(),this.clip(t,i));var l,u,h,c,p,d,f=o||Xh;for(s&&a.reverse(),l=0,u=a.length;l<u;++l){var y=a[l].toString();for(p=this.executorsByZIndex_[y],h=0,c=f.length;h<c;++h){void 0!==(d=p[f[h]])&&d.execute(t,e,i,n,r,s)}}this.maxExtent_&&t.restore()},t}(),Yh={};var Zh=Kh,Hh=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}(),$h=function(t){function e(e,i,n,r,o,s,a){var l=t.call(this)||this;return l.context_=e,l.pixelRatio_=i,l.extent_=n,l.transform_=r,l.viewRotation_=o,l.squaredTolerance_=s,l.userTransform_=a,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 Hh(e,t),e.prototype.drawImages_=function(t,e,i,n){if(this.image_){var r=No(t,e,i,n,this.transform_,this.pixelCoordinates_),o=this.context_,s=this.tmpLocalTransform_,a=o.globalAlpha;1!=this.imageOpacity_&&(o.globalAlpha=a*this.imageOpacity_);var l=this.imageRotation_;this.imageRotateWithView_&&(l+=this.viewRotation_);for(var u=0,h=r.length;u<h;u+=2){var c=r[u]-this.imageAnchorX_,p=r[u+1]-this.imageAnchorY_;if(0!==l||1!=this.imageScale_[0]||1!=this.imageScale_[1]){var d=c+this.imageAnchorX_,f=p+this.imageAnchorY_;_r(s,d,f,1,1,l,-d,-f),o.setTransform.apply(o,s),o.translate(d,f),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=a)}},e.prototype.drawText_=function(t,e,i,n){if(this.textState_&&""!==this.text_){this.textFillState_&&this.setContextFillState_(this.textFillState_),this.textStrokeState_&&this.setContextStrokeState_(this.textStrokeState_),this.setContextTextState_(this.textState_);var r=No(t,e,i,n,this.transform_,this.pixelCoordinates_),o=this.context_,s=this.textRotation_;for(this.textRotateWithView_&&(s+=this.viewRotation_);e<i;e+=n){var a=r[e]+this.textOffsetX_,l=r[e+1]+this.textOffsetY_;if(0!==s||1!=this.textScale_[0]||1!=this.textScale_[1]){var u=_r(this.tmpLocalTransform_,a,l,1,1,s,-a,-l);o.setTransform.apply(o,u),o.translate(a,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_,a,l),this.textFillState_&&o.fillText(this.text_,a,l)}}},e.prototype.moveToLineTo_=function(t,e,i,n,r){var o=this.context_,s=No(t,e,i,n,this.transform_,this.pixelCoordinates_);o.moveTo(s[0],s[1]);var a=s.length;r&&(a-=2);for(var l=2;l<a;l+=2)o.lineTo(s[l],s[l+1]);return r&&o.closePath(),i},e.prototype.drawRings_=function(t,e,i,n){for(var r=0,o=i.length;r<o;++r)e=this.moveToLineTo_(t,e,i[r],n,!0);return e},e.prototype.drawCircle=function(t){if(Tn(this.extent_,t.getExtent())){if(this.fillState_||this.strokeState_){this.fillState_&&this.setContextFillState_(this.fillState_),this.strokeState_&&this.setContextStrokeState_(this.strokeState_);var e=function(t,e,i){var n=t.getFlatCoordinates();if(n){var r=t.getStride();return No(n,0,n.length,r,e,i)}return null}(t,this.transform_,this.pixelCoordinates_),i=e[2]-e[0],n=e[3]-e[1],r=Math.sqrt(i*i+n*n),o=this.context_;o.beginPath(),o.arc(e[0],e[1],r,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 Pn:this.drawPoint(t);break;case On:this.drawLineString(t);break;case In:this.drawPolygon(t);break;case Fn:this.drawMultiPoint(t);break;case jn:this.drawMultiLineString(t);break;case Mn:this.drawMultiPolygon(t);break;case An:this.drawGeometryCollection(t);break;case Ln:this.drawCircle(t)}},e.prototype.drawFeature=function(t,e){var i=e.getGeometryFunction()(t);i&&Tn(this.extent_,i.getExtent())&&(this.setStyle(e),this.drawGeometry(i))},e.prototype.drawGeometryCollection=function(t){for(var e=t.getGeometriesArray(),i=0,n=e.length;i<n;++i)this.drawGeometry(e[i])},e.prototype.drawPoint=function(t){this.squaredTolerance_&&(t=t.simplifyTransformed(this.squaredTolerance_,this.userTransform_));var e=t.getFlatCoordinates(),i=t.getStride();this.image_&&this.drawImages_(e,0,e.length,i),""!==this.text_&&this.drawText_(e,0,e.length,i)},e.prototype.drawMultiPoint=function(t){this.squaredTolerance_&&(t=t.simplifyTransformed(this.squaredTolerance_,this.userTransform_));var e=t.getFlatCoordinates(),i=t.getStride();this.image_&&this.drawImages_(e,0,e.length,i),""!==this.text_&&this.drawText_(e,0,e.length,i)},e.prototype.drawLineString=function(t){if(this.squaredTolerance_&&(t=t.simplifyTransformed(this.squaredTolerance_,this.userTransform_)),Tn(this.extent_,t.getExtent())){if(this.strokeState_){this.setContextStrokeState_(this.strokeState_);var e=this.context_,i=t.getFlatCoordinates();e.beginPath(),this.moveToLineTo_(i,0,i.length,t.getStride(),!1),e.stroke()}if(""!==this.text_){var n=t.getFlatMidpoint();this.drawText_(n,0,2,2)}}},e.prototype.drawMultiLineString=function(t){this.squaredTolerance_&&(t=t.simplifyTransformed(this.squaredTolerance_,this.userTransform_));var e=t.getExtent();if(Tn(this.extent_,e)){if(this.strokeState_){this.setContextStrokeState_(this.strokeState_);var i=this.context_,n=t.getFlatCoordinates(),r=0,o=t.getEnds(),s=t.getStride();i.beginPath();for(var a=0,l=o.length;a<l;++a)r=this.moveToLineTo_(n,r,o[a],s,!1);i.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_)),Tn(this.extent_,t.getExtent())){if(this.strokeState_||this.fillState_){this.fillState_&&this.setContextFillState_(this.fillState_),this.strokeState_&&this.setContextStrokeState_(this.strokeState_);var e=this.context_;e.beginPath(),this.drawRings_(t.getOrientedFlatCoordinates(),0,t.getEnds(),t.getStride()),this.fillState_&&e.fill(),this.strokeState_&&e.stroke()}if(""!==this.text_){var i=t.getFlatInteriorPoint();this.drawText_(i,0,2,2)}}},e.prototype.drawMultiPolygon=function(t){if(this.squaredTolerance_&&(t=t.simplifyTransformed(this.squaredTolerance_,this.userTransform_)),Tn(this.extent_,t.getExtent())){if(this.strokeState_||this.fillState_){this.fillState_&&this.setContextFillState_(this.fillState_),this.strokeState_&&this.setContextStrokeState_(this.strokeState_);var e=this.context_,i=t.getOrientedFlatCoordinates(),n=0,r=t.getEndss(),o=t.getStride();e.beginPath();for(var s=0,a=r.length;s<a;++s){var l=r[s];n=this.drawRings_(i,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_,i=this.contextFillState_;i?i.fillStyle!=t.fillStyle&&(i.fillStyle=t.fillStyle,e.fillStyle=t.fillStyle):(e.fillStyle=t.fillStyle,this.contextFillState_={fillStyle:t.fillStyle})},e.prototype.setContextStrokeState_=function(t){var e=this.context_,i=this.contextStrokeState_;i?(i.lineCap!=t.lineCap&&(i.lineCap=t.lineCap,e.lineCap=t.lineCap),e.setLineDash&&(xt(i.lineDash,t.lineDash)||e.setLineDash(i.lineDash=t.lineDash),i.lineDashOffset!=t.lineDashOffset&&(i.lineDashOffset=t.lineDashOffset,e.lineDashOffset=t.lineDashOffset)),i.lineJoin!=t.lineJoin&&(i.lineJoin=t.lineJoin,e.lineJoin=t.lineJoin),i.lineWidth!=t.lineWidth&&(i.lineWidth=t.lineWidth,e.lineWidth=t.lineWidth),i.miterLimit!=t.miterLimit&&(i.miterLimit=t.miterLimit,e.miterLimit=t.miterLimit),i.strokeStyle!=t.strokeStyle&&(i.strokeStyle=t.strokeStyle,e.strokeStyle=t.strokeStyle)):(e.lineCap=t.lineCap,e.setLineDash&&(e.setLineDash(t.lineDash),e.lineDashOffset=t.lineDashOffset),e.lineJoin=t.lineJoin,e.lineWidth=t.lineWidth,e.miterLimit=t.miterLimit,e.strokeStyle=t.strokeStyle,this.contextStrokeState_={lineCap:t.lineCap,lineDash:t.lineDash,lineDashOffset:t.lineDashOffset,lineJoin:t.lineJoin,lineWidth:t.lineWidth,miterLimit:t.miterLimit,strokeStyle:t.strokeStyle})},e.prototype.setContextTextState_=function(t){var e=this.context_,i=this.contextTextState_,n=t.textAlign?t.textAlign:"center";i?(i.font!=t.font&&(i.font=t.font,e.font=t.font),i.textAlign!=n&&(i.textAlign=n,e.textAlign=n),i.textBaseline!=t.textBaseline&&(i.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 i=this;if(t){var n=t.getColor();this.fillState_={fillStyle:Ha(n||"#000")}}else this.fillState_=null;if(e){var r=e.getColor(),o=e.getLineCap(),s=e.getLineDash(),a=e.getLineDashOffset(),l=e.getLineJoin(),u=e.getWidth(),h=e.getMiterLimit(),c=s||zr;this.strokeState_={lineCap:void 0!==o?o:"round",lineDash:1===this.pixelRatio_?c:c.map((function(t){return t*i.pixelRatio_})),lineDashOffset:(a||0)*this.pixelRatio_,lineJoin:void 0!==l?l:"round",lineWidth:(void 0!==u?u:1)*this.pixelRatio_,miterLimit:void 0!==h?h:10,strokeStyle:Ha(r||"#000")}}else this.strokeState_=null},e.prototype.setImageStyle=function(t){var e;if(t&&(e=t.getSize())){var i=t.getAnchor(),n=t.getOrigin();this.image_=t.getImage(this.pixelRatio_),this.imageAnchorX_=i[0]*this.pixelRatio_,this.imageAnchorY_=i[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 i=e.getColor();this.textFillState_={fillStyle:Ha(i||"#000")}}else this.textFillState_=null;var n=t.getStroke();if(n){var r=n.getColor(),o=n.getLineCap(),s=n.getLineDash(),a=n.getLineDashOffset(),l=n.getLineJoin(),u=n.getWidth(),h=n.getMiterLimit();this.textStrokeState_={lineCap:void 0!==o?o:"round",lineDash:s||zr,lineDashOffset:a||0,lineJoin:void 0!==l?l:"round",lineWidth:void 0!==u?u:1,miterLimit:void 0!==h?h:10,strokeStyle:Ha(r||"#000")}}else this.textStrokeState_=null;var c=t.getFont(),p=t.getOffsetX(),d=t.getOffsetY(),f=t.getRotateWithView(),y=t.getRotation(),g=t.getScaleArray(),m=t.getText(),v=t.getTextAlign(),_=t.getTextBaseline();this.textState_={font:void 0!==c?c:"10px sans-serif",textAlign:void 0!==v?v:"center",textBaseline:void 0!==_?_:"middle"},this.text_=void 0!==m?m:"",this.textOffsetX_=void 0!==p?this.pixelRatio_*p:0,this.textOffsetY_=void 0!==d?this.pixelRatio_*d:0,this.textRotateWithView_=void 0!==f&&f,this.textRotation_=void 0!==y?y:0,this.textScale_=[this.pixelRatio_*g[0],this.pixelRatio_*g[1]]}else this.text_=""},e}(ph);function Jh(t,e,i,n,r,o,s){var a=pe(.5*t[0],.5*t[1]);a.imageSmoothingEnabled=!1;for(var l=a.canvas,u=new $h(a,.5,r,null,s),h=i.length,c=Math.floor(16777215/h),p={},d=1;d<=h;++d){var f=i[d-1],y=f.getStyleFunction()||n;if(n){var g=y(f,o);if(g){Array.isArray(g)||(g=[g]);for(var m="#"+("000000"+(d*c).toString(16)).slice(-6),v=0,_=g.length;v<_;++v){var x=g[v],b=x.getGeometryFunction()(f);if(b&&Tn(r,b.getExtent())){var w=x.clone(),S=w.getFill();S&&S.setColor(m);var C=w.getStroke();C&&(C.setColor(m),C.setLineDash(null)),w.setText(void 0);var T=x.getImage();if(T&&0!==T.getOpacity()){var E=T.getImageSize();if(!E)continue;var k=pe(E[0],E[1],void 0,{alpha:!1}),P=k.canvas;k.fillStyle=m,k.fillRect(0,0,P.width,P.height),w.setImage(new Ya({img:P,imgSize:E,anchor:T.getAnchor(),anchorXUnits:Ra,anchorYUnits:Ra,offset:T.getOrigin(),opacity:1,size:T.getSize(),scale:T.getScale(),rotation:T.getRotation(),rotateWithView:T.getRotateWithView()}))}var O=w.getZIndex()||0;(F=p[O])||(F={},p[O]=F,F[In]=[],F[Ln]=[],F[On]=[],F[Pn]=[]),F[b.getType().replace("Multi","")].push(b,w)}}}}}for(var R=Object.keys(p).map(Number).sort(gt),I=(d=0,R.length);d<I;++d){var F=p[R[d]];for(var j in F){var M=F[j];for(v=0,_=M.length;v<_;v+=2){u.setStyle(M[v+1]);for(var A=0,L=e.length;A<L;++A)u.setTransform(e[A]),u.drawGeometry(M[v])}}}return a.getImageData(0,0,l.width,l.height)}function Qh(t,e,i){var n=[];if(i){var r=Math.floor(.5*Math.round(t[0])),o=Math.floor(.5*Math.round(t[1])),s=4*(je(r,0,i.width-1)+je(o,0,i.height-1)*i.width),a=i.data[s],l=i.data[s+1],u=i.data[s+2]+256*(l+256*a),h=Math.floor(16777215/e.length);u&&u%h==0&&n.push(e[u/h-1])}return n}var tc={Point:function(t,e,i,n,r){var o,s=i.getImage(),a=i.getText();r&&(t=r,o=s&&a&&a.getText()?{}:void 0);if(s){if(s.getImageState()!=Da)return;var l=t.getBuilder(i.getZIndex(),Fh);l.setImageStyle(s,o),l.drawPoint(e,n)}if(a&&a.getText()){var u=t.getBuilder(i.getZIndex(),Ah);u.setTextStyle(a,o),u.drawText(e,n)}},LineString:function(t,e,i,n,r){var o=i.getStroke();if(o){var s=t.getBuilder(i.getZIndex(),jh);s.setFillStrokeStyle(null,o),s.drawLineString(e,n)}var a=i.getText();if(a&&a.getText()){var l=(r||t).getBuilder(i.getZIndex(),Ah);l.setTextStyle(a),l.drawText(e,n)}},Polygon:function(t,e,i,n,r){var o=i.getFill(),s=i.getStroke();if(o||s){var a=t.getBuilder(i.getZIndex(),Mh);a.setFillStrokeStyle(o,s),a.drawPolygon(e,n)}var l=i.getText();if(l&&l.getText()){var u=(r||t).getBuilder(i.getZIndex(),Ah);u.setTextStyle(l),u.drawText(e,n)}},MultiPoint:function(t,e,i,n,r){var o,s=i.getImage(),a=i.getText();r&&(t=r,o=s&&a&&a.getText()?{}:void 0);if(s){if(s.getImageState()!=Da)return;var l=t.getBuilder(i.getZIndex(),Fh);l.setImageStyle(s,o),l.drawMultiPoint(e,n)}if(a&&a.getText()){var u=(r||t).getBuilder(i.getZIndex(),Ah);u.setTextStyle(a,o),u.drawText(e,n)}},MultiLineString:function(t,e,i,n,r){var o=i.getStroke();if(o){var s=t.getBuilder(i.getZIndex(),jh);s.setFillStrokeStyle(null,o),s.drawMultiLineString(e,n)}var a=i.getText();if(a&&a.getText()){var l=(r||t).getBuilder(i.getZIndex(),Ah);l.setTextStyle(a),l.drawText(e,n)}},MultiPolygon:function(t,e,i,n,r){var o=i.getFill(),s=i.getStroke();if(s||o){var a=t.getBuilder(i.getZIndex(),Mh);a.setFillStrokeStyle(o,s),a.drawMultiPolygon(e,n)}var l=i.getText();if(l&&l.getText()){var u=(r||t).getBuilder(i.getZIndex(),Ah);u.setTextStyle(l),u.drawText(e,n)}},GeometryCollection:function(t,e,i,n,r){var o,s,a=e.getGeometriesArray();for(o=0,s=a.length;o<s;++o){(0,tc[a[o].getType()])(t,a[o],i,n,r)}},Circle:function(t,e,i,n,r){var o=i.getFill(),s=i.getStroke();if(o||s){var a=t.getBuilder(i.getZIndex(),Rh);a.setFillStrokeStyle(o,s),a.drawCircle(e,n)}var l=i.getText();if(l&&l.getText()){var u=(r||t).getBuilder(i.getZIndex(),Ah);u.setTextStyle(l),u.drawText(e,n)}}};function ec(t,e){return parseInt($t(t),10)-parseInt($t(e),10)}function ic(t,e){var i=nc(t,e);return i*i}function nc(t,e){return.5*t/e}function rc(t,e,i,n,r,o,s){var a=!1,l=i.getImage();if(l){var u=l.getImageState();u==Da||u==za?l.unlistenImageChange(r):(u==Aa&&l.load(),u=l.getImageState(),l.listenImageChange(r),a=!0)}return function(t,e,i,n,r,o){var s=i.getGeometryFunction()(e);if(!s)return;var a=s.simplifyTransformed(n,r);if(i.getRenderer())oc(t,a,i,e);else{(0,tc[a.getType()])(t,a,i,e,o)}}(t,e,i,n,o,s),a}function oc(t,e,i,n){if(e.getType()!=An)t.getBuilder(i.getZIndex(),Ih).drawCustom(e,n,i.getRenderer(),i.getHitDetectionRenderer());else for(var r=e.getGeometries(),o=0,s=r.length;o<s;++o)oc(t,r[o],i,n)}var sc=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}(),ac=function(t){function e(e){var i=t.call(this,e)||this;return i.boundHandleStyleImageChange_=i.handleStyleImageChange_.bind(i),i.animatingOrInteracting_,i.dirty_=!1,i.hitDetectionImageData_=null,i.renderedFeatures_=null,i.renderedRevision_=-1,i.renderedResolution_=NaN,i.renderedExtent_=[1/0,1/0,-1/0,-1/0],i.wrappedRenderedExtent_=[1/0,1/0,-1/0,-1/0],i.renderedRotation_,i.renderedCenter_=null,i.renderedProjection_=null,i.renderedRenderOrder_=null,i.replayGroup_=null,i.replayGroupChanged=!0,i.declutterExecutorGroup=null,i.clipping=!0,i}return sc(e,t),e.prototype.useContainer=function(e,i,n){n<1&&(e=null),t.prototype.useContainer.call(this,e,i,n)},e.prototype.renderWorlds=function(t,e,i){var n=e.extent,r=e.viewState,o=r.center,s=r.resolution,a=r.projection,l=r.rotation,u=a.getExtent(),h=this.getLayer().getSource(),c=e.pixelRatio,p=e.viewHints,d=!(p[Co]||p[To]),f=this.context,y=Math.round(e.size[0]*c),g=Math.round(e.size[1]*c),m=h.getWrapX()&&a.canWrapX(),v=m?Cn(u):null,_=m?Math.ceil((n[2]-u[2])/v)+1:1,x=m?Math.floor((n[0]-u[0])/v):0;do{var b=this.getRenderTransform(o,s,l,c,y,g,x*v);t.execute(f,1,b,l,d,void 0,i)}while(++x<_)},e.prototype.renderDeclutter=function(t){this.declutterExecutorGroup&&this.renderWorlds(this.declutterExecutorGroup,t,t.declutterTree)},e.prototype.renderFrame=function(t,e){var i=t.pixelRatio,n=t.layerStatesArray[t.layerIndex];!function(t,e,i){gr(t,e,0,0,i,0,0)}(this.pixelTransform,1/i,1/i),xr(this.inversePixelTransform,this.pixelTransform);var r=br(this.pixelTransform);this.useContainer(e,r,n.opacity);var o=this.context,s=o.canvas,a=this.replayGroup_,l=this.declutterExecutorGroup;if((!a||a.isEmpty())&&(!l||l.isEmpty()))return null;var u=Math.round(t.size[0]*i),h=Math.round(t.size[1]*i);s.width!=u||s.height!=h?(s.width=u,s.height=h,s.style.transform!==r&&(s.style.transform=r)):this.containerReused||o.clearRect(0,0,u,h),this.preRender(o,t);var c=t.viewState;c.projection;var p=!1,d=!0;if(n.extent&&this.clipping){var f=cr(n.extent);(p=(d=Tn(f,t.extent))&&!Qi(f,t.extent))&&this.clipUnrotated(o,t,f)}d&&this.renderWorlds(a,t),p&&o.restore(),this.postRender(o,t);var y=xe(n.opacity),g=this.container;return y!==g.style.opacity&&(g.style.opacity=y),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 i=[this.context.canvas.width,this.context.canvas.height];mr(this.pixelTransform,i);var n=this.renderedCenter_,r=this.renderedResolution_,o=this.renderedRotation_,s=this.renderedProjection_,a=this.wrappedRenderedExtent_,l=this.getLayer(),u=[],h=.5*i[0],c=.5*i[1];u.push(this.getRenderTransform(n,r,o,.5,h,c,0).slice());var p=l.getSource(),d=s.getExtent();if(p.getWrapX()&&s.canWrapX()&&!Qi(d,a)){for(var f=a[0],y=Cn(d),g=0,m=void 0;f<d[0];)m=y*--g,u.push(this.getRenderTransform(n,r,o,.5,h,c,m).slice()),f+=y;for(g=0,f=a[2];f>d[2];)m=y*++g,u.push(this.getRenderTransform(n,r,o,.5,h,c,m).slice()),f-=y}this.hitDetectionImageData_=Jh(i,u,this.renderedFeatures_,l.getStyleFunction(),a,r,o)}e(Qh(t,this.renderedFeatures_,this.hitDetectionImageData_))}.bind(this))},e.prototype.forEachFeatureAtCoordinate=function(t,e,i,n,r){var o=this;if(this.replayGroup_){var s,a=e.viewState.resolution,l=e.viewState.rotation,u=this.getLayer(),h={},c=function(t,e,i){var o=$t(t),s=h[o];if(s){if(!0!==s&&i<s.distanceSq){if(0===i)return h[o]=!0,r.splice(r.lastIndexOf(s),1),n(t,u,e);s.geometry=e,s.distanceSq=i}}else{if(0===i)return h[o]=!0,n(t,u,e);r.push(h[o]={feature:t,layer:u,geometry:e,distanceSq:i,callback:n})}},p=[this.replayGroup_];return this.declutterExecutorGroup&&p.push(this.declutterExecutorGroup),p.some((function(n){return s=n.forEachFeatureAtCoordinate(t,a,l,i,c,n===o.declutterExecutorGroup?e.declutterTree.all().map((function(t){return t.value})):null)})),s}},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(),i=e.getSource();if(!i)return!1;var n=t.viewHints[Co],r=t.viewHints[To],o=e.getUpdateWhileAnimating(),s=e.getUpdateWhileInteracting();if(!this.dirty_&&!o&&n||!s&&r)return this.animatingOrInteracting_=!0,!0;this.animatingOrInteracting_=!1;var a=t.extent,l=t.viewState,u=l.projection,h=l.resolution,c=t.pixelRatio,p=e.getRevision(),d=e.getRenderBuffer(),f=e.getRenderOrder();void 0===f&&(f=ec);var y=l.center.slice(),g=Zi(a,d*h),m=g.slice(),v=[g.slice()],_=u.getExtent();if(i.getWrapX()&&u.canWrapX()&&!Qi(_,t.extent)){var x=Cn(_),b=Math.max(Cn(g)/2,x);g[0]=_[0]-b,g[2]=_[2]+b,Xn(y,u);var w=function(t,e){var i=e.getExtent(),n=mn(t);if(e.canWrapX()&&(n[0]<i[0]||n[0]>=i[2])){var r=Cn(i),o=Math.floor((n[0]-i[0])/r)*r;t[0]-=o,t[2]-=o}return t}(v[0],u);w[0]<_[0]&&w[2]<_[2]?v.push([w[0]+x,w[1],w[2]+x,w[3]]):w[0]>_[0]&&w[2]>_[2]&&v.push([w[0]-x,w[1],w[2]-x,w[3]])}if(!this.dirty_&&this.renderedResolution_==h&&this.renderedRevision_==p&&this.renderedRenderOrder_==f&&Qi(this.wrappedRenderedExtent_,g))return xt(this.renderedExtent_,m)||(this.hitDetectionImageData_=null,this.renderedExtent_=m),this.renderedCenter_=y,this.replayGroupChanged=!1,!0;this.replayGroup_=null,this.dirty_=!1;var S,C=new Th(nc(h,c),g,h,c);this.getLayer().getDeclutter()&&(S=new Th(nc(h,c),g,h,c));for(var T=0,E=v.length;T<E;++T)i.loadFeatures(v[T],h,u);var k=ic(h,c),P=function(t){var i,n=t.getStyleFunction()||e.getStyleFunction();if(n&&(i=n(t,h)),i){var r=this.renderFeature(t,k,i,C,undefined,S);this.dirty_=this.dirty_||r}}.bind(this),O=hr(g),R=i.getFeaturesInExtent(O);f&&R.sort(f);for(T=0,E=R.length;T<E;++T)P(R[T]);this.renderedFeatures_=R;var I=C.finish(),F=new Zh(g,h,c,i.getOverlaps(),I,e.getRenderBuffer());return S&&(this.declutterExecutorGroup=new Zh(g,h,c,i.getOverlaps(),S.finish(),e.getRenderBuffer())),this.renderedResolution_=h,this.renderedRevision_=p,this.renderedRenderOrder_=f,this.renderedExtent_=m,this.wrappedRenderedExtent_=g,this.renderedCenter_=y,this.renderedProjection_=u,this.replayGroup_=F,this.hitDetectionImageData_=null,this.replayGroupChanged=!0,!0},e.prototype.renderFeature=function(t,e,i,n,r,o){if(!i)return!1;var s=!1;if(Array.isArray(i))for(var a=0,l=i.length;a<l;++a)s=rc(n,t,i[a],e,this.boundHandleStyleImageChange_,r,o)||s;else s=rc(n,t,i,e,this.boundHandleStyleImageChange_,r,o);return s},e}(Oh),lc=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}(),uc=function(t){function e(e){return t.call(this,e)||this}return lc(e,t),e.prototype.createRenderer=function(){return new ac(this)},e}(oh),hc=function(){function t(t){this.rbush_=new qu(t),this.items_={}}return t.prototype.insert=function(t,e){var i={minX:t[0],minY:t[1],maxX:t[2],maxY:t[3],value:e};this.rbush_.insert(i),this.items_[$t(e)]=i},t.prototype.load=function(t,e){for(var i=new Array(e.length),n=0,r=e.length;n<r;n++){var o=t[n],s=e[n],a={minX:o[0],minY:o[1],maxX:o[2],maxY:o[3],value:s};i[n]=a,this.items_[$t(s)]=a}this.rbush_.load(i)},t.prototype.remove=function(t){var e=$t(t),i=this.items_[e];return delete this.items_[e],null!==this.rbush_.remove(i)},t.prototype.update=function(t,e){var i=this.items_[$t(e)];ln([i.minX,i.minY,i.maxX,i.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 i,n=0,r=t.length;n<r;n++)if(i=e(t[n]))return i;return i},t.prototype.isEmpty=function(){return kt(this.items_)},t.prototype.clear=function(){this.rbush_.clear(),this.items_={}},t.prototype.getExtent=function(t){var e=this.rbush_.toJSON();return rn(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}(),cc=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}();function pc(t){return t?Array.isArray(t)?function(e){return t}:"function"==typeof t?t:function(e){return[t]}:null}var dc=function(t){function e(e){var i=t.call(this)||this;i.projection=Hn(e.projection),i.attributions_=pc(e.attributions),i.attributionsCollapsible_=void 0===e.attributionsCollapsible||e.attributionsCollapsible,i.loading=!1,i.state_=void 0!==e.state?e.state:Ze,i.wrapX_=void 0!==e.wrapX&&e.wrapX,i.viewResolver=null,i.viewRejector=null;var n=i;return i.viewPromise_=new Promise((function(t,e){n.viewResolver=t,n.viewRejector=e})),i}return cc(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 Zt()},e.prototype.getView=function(){return this.viewPromise_},e.prototype.getState=function(){return this.state_},e.prototype.getWrapX=function(){return this.wrapX_},e.prototype.getContextOptions=function(){},e.prototype.refresh=function(){this.changed()},e.prototype.setAttributions=function(t){this.attributions_=pc(t),this.changed()},e.prototype.setState=function(t){this.state_=t,this.changed()},e}(te),fc="addfeature",yc="changefeature",gc="clear",mc="removefeature",vc="featuresloadstart",_c="featuresloadend",xc="featuresloaderror";function bc(t,e){return[[-1/0,-1/0,1/0,1/0]]}function wc(t,e,i,n,r,o,s){var a=new XMLHttpRequest;a.open("GET","function"==typeof t?t(i,n,r):t,!0),e.getType()==ia&&(a.responseType="arraybuffer"),a.withCredentials=false,a.onload=function(t){if(!a.status||a.status>=200&&a.status<300){var n=e.getType(),l=void 0;n==na||n==ra?l=a.responseText:n==oa?(l=a.responseXML)||(l=(new DOMParser).parseFromString(a.responseText,"application/xml")):n==ia&&(l=a.response),l?o(e.readFeatures(l,{extent:i,featureProjection:r}),e.readProjection(l)):s()}else s()},a.onerror=s,a.send()}function Sc(t,e){return function(i,n,r,o,s){var a=this;wc(t,e,i,n,r,(function(t,e){a.addFeatures(t),void 0!==o&&o(t)}),s||St)}}var Cc=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}(),Tc=function(t){function e(e,i,n){var r=t.call(this,e)||this;return r.feature=i,r.features=n,r}return Cc(e,t),e}(dt),Ec=function(t){function e(e){var i=this,n=e||{};(i=t.call(this,{attributions:n.attributions,projection:void 0,state:Ze,wrapX:void 0===n.wrapX||n.wrapX})||this).on,i.once,i.un,i.loader_=St,i.format_=n.format,i.overlaps_=void 0===n.overlaps||n.overlaps,i.url_=n.url,void 0!==n.loader?i.loader_=n.loader:void 0!==i.url_&&(Fe(i.format_,7),i.loader_=Sc(i.url_,i.format_)),i.strategy_=void 0!==n.strategy?n.strategy:bc;var r,o,s=void 0===n.useSpatialIndex||n.useSpatialIndex;return i.featuresRtree_=s?new hc:null,i.loadedExtentsRtree_=new hc,i.loadingExtentsCount_=0,i.nullGeometryFeatures_={},i.idIndex_={},i.uidIndex_={},i.featureChangeKeys_={},i.featuresCollection_=null,Array.isArray(n.features)?o=n.features:n.features&&(o=(r=n.features).getArray()),s||void 0!==r||(r=new si(o)),void 0!==o&&i.addFeaturesInternal(o),void 0!==r&&i.bindFeaturesCollection_(r),i}return Cc(e,t),e.prototype.addFeature=function(t){this.addFeatureInternal(t),this.changed()},e.prototype.addFeatureInternal=function(t){var e=$t(t);if(this.addToIndex_(e,t)){this.setupChangeEvents_(e,t);var i=t.getGeometry();if(i){var n=i.getExtent();this.featuresRtree_&&this.featuresRtree_.insert(n,t)}else this.nullGeometryFeatures_[e]=t;this.dispatchEvent(new Tc(fc,t))}else this.featuresCollection_&&this.featuresCollection_.remove(t)},e.prototype.setupChangeEvents_=function(t,e){this.featureChangeKeys_[t]=[qt(e,It,this.handleFeatureChange_,this),qt(e,ft,this.handleFeatureChange_,this)]},e.prototype.addToIndex_=function(t,e){var i=!0,n=e.getId();return void 0!==n&&(n.toString()in this.idIndex_?i=!1:this.idIndex_[n.toString()]=e),i&&(Fe(!(t in this.uidIndex_),30),this.uidIndex_[t]=e),i},e.prototype.addFeatures=function(t){this.addFeaturesInternal(t),this.changed()},e.prototype.addFeaturesInternal=function(t){for(var e=[],i=[],n=[],r=0,o=t.length;r<o;r++){var s=$t(l=t[r]);this.addToIndex_(s,l)&&i.push(l)}r=0;for(var a=i.length;r<a;r++){var l;s=$t(l=i[r]);this.setupChangeEvents_(s,l);var u=l.getGeometry();if(u){var h=u.getExtent();e.push(h),n.push(l)}else this.nullGeometryFeatures_[s]=l}this.featuresRtree_&&this.featuresRtree_.load(e,n);r=0;for(var c=i.length;r<c;r++)this.dispatchEvent(new Tc(fc,i[r]))},e.prototype.bindFeaturesCollection_=function(t){var e=!1;this.addEventListener(fc,(function(i){e||(e=!0,t.push(i.feature),e=!1)})),this.addEventListener(mc,(function(i){e||(e=!0,t.remove(i.feature),e=!1)})),t.addEventListener(ei,function(t){e||(e=!0,this.addFeature(t.element),e=!1)}.bind(this)),t.addEventListener(ii,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(Ut)}this.featuresCollection_||(this.featureChangeKeys_={},this.idIndex_={},this.uidIndex_={})}else if(this.featuresRtree_)for(var i in this.featuresRtree_.forEach(this.removeFeatureInternal.bind(this)),this.nullGeometryFeatures_)this.removeFeatureInternal(this.nullGeometryFeatures_[i]);this.featuresCollection_&&this.featuresCollection_.clear(),this.featuresRtree_&&this.featuresRtree_.clear(),this.nullGeometryFeatures_={};var n=new Tc(gc);this.dispatchEvent(n),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 i=[t[0],t[1],t[0],t[1]];return this.forEachFeatureInExtent(i,(function(i){return i.getGeometry().intersectsCoordinate(t)?e(i):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(i){if(i.getGeometry().intersectsExtent(t)){var n=e(i);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(),kt(this.nullGeometryFeatures_)||_t(t,Et(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){return this.featuresRtree_?this.featuresRtree_.getInExtent(t):this.featuresCollection_?this.featuresCollection_.getArray().slice(0):[]},e.prototype.getClosestFeatureToCoordinate=function(t,e){var i=t[0],n=t[1],r=null,o=[NaN,NaN],s=1/0,a=[-1/0,-1/0,1/0,1/0],l=e||bt;return this.featuresRtree_.forEachInExtent(a,(function(t){if(l(t)){var e=t.getGeometry(),u=s;if((s=e.closestPointXY(i,n,o,s))<u){r=t;var h=Math.sqrt(s);a[0]=i-h,a[1]=n-h,a[2]=i+h,a[3]=n+h}}})),r},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,i=$t(e),n=e.getGeometry();if(n){var r=n.getExtent();i in this.nullGeometryFeatures_?(delete this.nullGeometryFeatures_[i],this.featuresRtree_&&this.featuresRtree_.insert(r,e)):this.featuresRtree_&&this.featuresRtree_.update(r,e)}else i in this.nullGeometryFeatures_||(this.featuresRtree_&&this.featuresRtree_.remove(e),this.nullGeometryFeatures_[i]=e);var o=e.getId();if(void 0!==o){var s=o.toString();this.idIndex_[s]!==e&&(this.removeFromIdIndex_(e),this.idIndex_[s]=e)}else this.removeFromIdIndex_(e),this.uidIndex_[i]=e;this.changed(),this.dispatchEvent(new Tc(yc,e))},e.prototype.hasFeature=function(t){var e=t.getId();return void 0!==e?e in this.idIndex_:$t(t)in this.uidIndex_},e.prototype.isEmpty=function(){return this.featuresRtree_.isEmpty()&&kt(this.nullGeometryFeatures_)},e.prototype.loadFeatures=function(t,e,i){for(var n=this.loadedExtentsRtree_,r=this.strategy_(t,e,i),o=function(t,o){var a=r[t];n.forEachInExtent(a,(function(t){return Qi(t.extent,a)}))||(++s.loadingExtentsCount_,s.dispatchEvent(new Tc(vc)),s.loader_.call(s,a,e,i,function(t){--this.loadingExtentsCount_,this.dispatchEvent(new Tc(_c,void 0,t))}.bind(s),function(){--this.loadingExtentsCount_,this.dispatchEvent(new Tc(xc))}.bind(s)),n.insert(a,{extent:a.slice()}))},s=this,a=0,l=r.length;a<l;++a)o(a);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,i=this.loadedExtentsRtree_;i.forEachInExtent(t,(function(i){if(ln(i.extent,t))return e=i,!0})),e&&i.remove(e)},e.prototype.removeFeature=function(t){var e=$t(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=$t(t);this.featureChangeKeys_[e].forEach(Ut),delete this.featureChangeKeys_[e];var i=t.getId();void 0!==i&&delete this.idIndex_[i.toString()],delete this.uidIndex_[e],this.dispatchEvent(new Tc(mc,t))},e.prototype.removeFromIdIndex_=function(t){var e=!1;for(var i in this.idIndex_)if(this.idIndex_[i]===t){delete this.idIndex_[i],e=!0;break}return e},e.prototype.setLoader=function(t){this.loader_=t},e.prototype.setUrl=function(t){Fe(this.format_,7),this.url_=t,this.setLoader(Sc(t,this.format_))},e}(dc),kc=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}(),Pc="Point",Oc="LineString",Rc="Polygon",Ic="Circle",Fc="drawstart",jc="drawend",Mc="drawabort",Ac=function(t){function e(e,i){var n=t.call(this,e)||this;return n.feature=i,n}return kc(e,t),e}(dt);var Lc=function(t){function e(e){var i=this,n=e;n.stopDown||(n.stopDown=wt),(i=t.call(this,n)||this).on,i.once,i.un,i.shouldHandle_=!1,i.downPx_=null,i.downTimeout_,i.lastDragTime_,i.pointerType_,i.freehand_=!1,i.source_=e.source?e.source:null,i.features_=e.features?e.features:null,i.snapTolerance_=e.snapTolerance?e.snapTolerance:12,i.type_=e.type,i.mode_=function(t){switch(t){case Pn:case Fn:return Pc;case On:case jn:return Oc;case In:case Mn:return Rc;case Ln:return Ic;default:throw new Error("Invalid type: "+t)}}(i.type_),i.stopClick_=!!e.stopClick,i.minPoints_=e.minPoints?e.minPoints:i.mode_===Rc?3:2,i.maxPoints_=i.mode_===Ic?2:e.maxPoints?e.maxPoints:1/0,i.finishCondition_=e.finishCondition?e.finishCondition:bt;var r,o=e.geometryFunction;if(!o){var s,a=i.mode_;if(a===Ic)o=function(t,e,i){var n=e||new zu([NaN,NaN]),r=ur(t[0]),o=qn(r,ur(t[t.length-1]));return n.setCenterAndRadius(r,Math.sqrt(o)),n};else a===Pc?s=ys:a===Oc?s=da:a===Rc&&(s=Is),o=function(t,e,i){return e?a===Rc?t[0].length?e.setCoordinates([t[0].concat([t[0][0]])]):e.setCoordinates([]):e.setCoordinates(t):e=new s(t),e}}return i.geometryFunction_=o,i.dragVertexDelay_=void 0!==e.dragVertexDelay?e.dragVertexDelay:500,i.finishCoordinate_=null,i.sketchFeature_=null,i.sketchPoint_=null,i.sketchCoords_=null,i.sketchLine_=null,i.sketchLineCoords_=null,i.squaredClickTolerance_=e.clickTolerance?e.clickTolerance*e.clickTolerance:36,i.overlay_=new uc({source:new Ec({useSpatialIndex:!1,wrapX:!!e.wrapX&&e.wrapX}),style:e.style?e.style:(r=rl(),function(t,e){return r[t.getGeometry().getType()]}),updateWhileInteracting:!0}),i.geometryName_=e.geometryName,i.condition_=e.condition?e.condition:Ql,i.freehandCondition_,e.freehand?i.freehandCondition_=$l:i.freehandCondition_=e.freehandCondition?e.freehandCondition:tu,i.addChangeListener(Gl,i.updateState_),i}return kc(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===Mt&&e.originalEvent.preventDefault(),this.freehand_=this.mode_!==Pc&&this.freehandCondition_(e);var i=e.type===co.POINTERMOVE,n=!0;!this.freehand_&&this.lastDragTime_&&e.type===co.POINTERDRAG&&(Date.now()-this.lastDragTime_>=this.dragVertexDelay_?(this.downPx_=e.pixel,this.shouldHandle_=!this.freehand_,i=!0):this.lastDragTime_=void 0,this.shouldHandle_&&void 0!==this.downTimeout_&&(clearTimeout(this.downTimeout_),this.downTimeout_=void 0));return this.freehand_&&e.type===co.POINTERDRAG&&null!==this.sketchFeature_?(this.addToDrawing_(e.coordinate),n=!1):this.freehand_&&e.type===co.POINTERDOWN?n=!1:i&&this.getPointerCount()<2?(n=e.type===co.POINTERMOVE)&&this.freehand_?(this.handlePointerMove_(e),this.shouldHandle_&&e.originalEvent.preventDefault()):("mouse"===e.originalEvent.pointerType||e.type===co.POINTERDRAG&&void 0===this.downTimeout_)&&this.handlePointerMove_(e):e.type===co.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 ho(co.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 i=!this.finishCoordinate_;i&&this.startDrawing_(t.coordinate),!i&&this.freehand_?this.finishDrawing():this.freehand_||i&&this.mode_!==Pc||(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_,i=t.pixel,n=e[0]-i[0],r=e[1]-i[1],o=n*n+r*r;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 i=!1,n=[this.finishCoordinate_],r=this.mode_;if(r===Pc)e=!0;else if(r===Ic)e=2===this.sketchCoords_.length;else if(r===Oc)i=this.sketchCoords_.length>this.minPoints_;else if(r===Rc){var o=this.sketchCoords_;i=o[0].length>this.minPoints_,n=[o[0][0],o[0][o[0].length-2]]}if(i)for(var s=this.getMap(),a=0,l=n.length;a<l;a++){var u=n[a],h=s.getPixelFromCoordinate(u),c=t[0]-h[0],p=t[1]-h[1],d=this.freehand_?1:this.snapTolerance_;if(e=Math.sqrt(c*c+p*p)<=d){this.finishCoordinate_=u;break}}}return e},e.prototype.createOrUpdateSketchPoint_=function(t){this.sketchPoint_?this.sketchPoint_.getGeometry().setCoordinates(t):(this.sketchPoint_=new Qs(new ys(t)),this.updateSketchFeatures_())},e.prototype.createOrUpdateCustomSketchLine_=function(t){this.sketchLine_||(this.sketchLine_=new Qs);var e=t.getLinearRing(0),i=this.sketchLine_.getGeometry();i?(i.setFlatCoordinates(e.getLayout(),e.getFlatCoordinates()),i.changed()):(i=new da(e.getFlatCoordinates(),e.getLayout()),this.sketchLine_.setGeometry(i))},e.prototype.startDrawing_=function(t){var e=this.getMap().getView().getProjection();this.finishCoordinate_=t,this.mode_===Pc?this.sketchCoords_=t.slice():this.mode_===Rc?(this.sketchCoords_=[[t.slice(),t.slice()]],this.sketchLineCoords_=this.sketchCoords_[0]):this.sketchCoords_=[t.slice(),t.slice()],this.sketchLineCoords_&&(this.sketchLine_=new Qs(new da(this.sketchLineCoords_)));var i=this.geometryFunction_(this.sketchCoords_,void 0,e);this.sketchFeature_=new Qs,this.geometryName_&&this.sketchFeature_.setGeometryName(this.geometryName_),this.sketchFeature_.setGeometry(i),this.updateSketchFeatures_(),this.dispatchEvent(new Ac(Fc,this.sketchFeature_))},e.prototype.modifyDrawing_=function(t){var e,i,n=this.getMap(),r=this.sketchFeature_.getGeometry(),o=n.getView().getProjection();(this.mode_===Pc?i=this.sketchCoords_:this.mode_===Rc?(i=(e=this.sketchCoords_[0])[e.length-1],this.atFinish_(n.getPixelFromCoordinate(t))&&(t=this.finishCoordinate_.slice())):i=(e=this.sketchCoords_)[e.length-1],i[0]=t[0],i[1]=t[1],this.geometryFunction_(this.sketchCoords_,r,o),this.sketchPoint_)&&this.sketchPoint_.getGeometry().setCoordinates(t);if(r.getType()===In&&this.mode_!==Rc)this.createOrUpdateCustomSketchLine_(r);else if(this.sketchLineCoords_){this.sketchLine_.getGeometry().setCoordinates(this.sketchLineCoords_)}this.updateSketchFeatures_()},e.prototype.addToDrawing_=function(t){var e,i,n=this.sketchFeature_.getGeometry(),r=this.getMap().getView().getProjection(),o=this.mode_;o===Oc||o===Ic?(this.finishCoordinate_=t.slice(),(i=this.sketchCoords_).length>=this.maxPoints_&&(this.freehand_?i.pop():e=!0),i.push(t.slice()),this.geometryFunction_(i,n,r)):o===Rc&&((i=this.sketchCoords_[0]).length>=this.maxPoints_&&(this.freehand_?i.pop():e=!0),i.push(t.slice()),e&&(this.finishCoordinate_=i[0]),this.geometryFunction_(this.sketchCoords_,n,r)),this.createOrUpdateSketchPoint_(t.slice()),this.updateSketchFeatures_(),e&&this.finishDrawing()},e.prototype.removeLastPoint=function(){if(this.sketchFeature_){var t,e=this.sketchFeature_.getGeometry(),i=this.getMap().getView().getProjection(),n=this.mode_;if(n===Oc||n===Ic){if((t=this.sketchCoords_).splice(-2,1),t.length>=2){this.finishCoordinate_=t[t.length-2].slice();var r=this.finishCoordinate_.slice();t[t.length-1]=r,this.createOrUpdateSketchPoint_(r)}this.geometryFunction_(t,e,i),e.getType()===In&&this.sketchLine_&&this.createOrUpdateCustomSketchLine_(e)}else if(n===Rc){(t=this.sketchCoords_[0]).splice(-2,1);var o=this.sketchLine_.getGeometry();if(t.length>=2){r=t[t.length-2].slice();t[t.length-1]=r,this.createOrUpdateSketchPoint_(r)}o.setCoordinates(t),this.geometryFunction_(this.sketchCoords_,e,i)}1===t.length&&this.abortDrawing(),this.updateSketchFeatures_()}},e.prototype.finishDrawing=function(){var t=this.abortDrawing_();if(t){var e=this.sketchCoords_,i=t.getGeometry(),n=this.getMap().getView().getProjection();this.mode_===Oc?(e.pop(),this.geometryFunction_(e,i,n)):this.mode_===Rc&&(e[0].pop(),this.geometryFunction_(e,i,n),e=i.getCoordinates()),this.type_===Fn?t.setGeometry(new ma([e])):this.type_===jn?t.setGeometry(new ya([e])):this.type_===Mn&&t.setGeometry(new xa([e])),this.dispatchEvent(new Ac(jc,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 Ac(Mc,t))},e.prototype.appendCoordinates=function(t){var e,i=this.mode_,n=!this.sketchFeature_;if(n&&this.startDrawing_(t[0]),i===Oc||i===Ic)e=this.sketchCoords_;else{if(i!==Rc)return;e=this.sketchCoords_&&this.sketchCoords_.length?this.sketchCoords_[0]:[]}n&&e.shift(),e.pop();for(var r=0;r<t.length;r++)this.addToDrawing_(t[r]);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 i=this.sketchCoords_[this.sketchCoords_.length-1];this.finishCoordinate_=i.slice(),this.sketchCoords_.push(i.slice()),this.sketchPoint_=new Qs(new ys(i)),this.updateSketchFeatures_(),this.dispatchEvent(new Ac(Fc,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}(Kl),Dc=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}(),zc=[0,0,0,0],Gc=[],Nc="modifystart",Bc="modifyend",Wc=function(t){function e(e,i,n){var r=t.call(this,e)||this;return r.features=i,r.mapBrowserEvent=n,r}return Dc(e,t),e}(dt);function qc(t,e){return t.index-e.index}function Vc(t,e,i){var n=e.geometry;if(n.getType()===Ln){var r=n;if(1===e.index){null;var o=qn(r.getCenter(),ur(t)),s=Math.sqrt(o)-r.getRadius();return s*s}}var a=ur(t);return Gc[0]=ur(e.segment[0]),Gc[1]=ur(e.segment[1]),Un(a,Gc)}function Uc(t,e,i){var n=e.geometry;if(n.getType()===Ln&&1===e.index){var r=n;return lr(r.getClosestPoint(ur(t)))}var o=ur(t);return Gc[0]=ur(e.segment[0]),Gc[1]=ur(e.segment[1]),lr(Nn(o,Gc))}var Xc=function(t){function e(e){var i,n,r=t.call(this,e)||this;if(r.on,r.once,r.un,r.boundHandleFeatureChange_=r.handleFeatureChange_.bind(r),r.condition_=e.condition?e.condition:nu,r.defaultDeleteCondition_=function(t){return function(t){var e=t.originalEvent;return e.altKey&&!(e.metaKey||e.ctrlKey)&&!e.shiftKey}(t)&&function(t){return t.type==co.SINGLECLICK}(t)},r.deleteCondition_=e.deleteCondition?e.deleteCondition:r.defaultDeleteCondition_,r.insertVertexCondition_=e.insertVertexCondition?e.insertVertexCondition:$l,r.vertexFeature_=null,r.vertexSegments_=null,r.lastPixel_=[0,0],r.ignoreNextSingleClick_=!1,r.featuresBeingModified_=null,r.rBush_=new hc,r.pixelTolerance_=void 0!==e.pixelTolerance?e.pixelTolerance:10,r.snappedToVertex_=!1,r.changingFeature_=!1,r.dragSegments_=[],r.overlay_=new uc({source:new Ec({useSpatialIndex:!1,wrapX:!!e.wrapX}),style:e.style?e.style:(i=rl(),function(t,e){return i[Pn]}),updateWhileAnimating:!0,updateWhileInteracting:!0}),r.SEGMENT_WRITERS_={Point:r.writePointGeometry_.bind(r),LineString:r.writeLineStringGeometry_.bind(r),LinearRing:r.writeLineStringGeometry_.bind(r),Polygon:r.writePolygonGeometry_.bind(r),MultiPoint:r.writeMultiPointGeometry_.bind(r),MultiLineString:r.writeMultiLineStringGeometry_.bind(r),MultiPolygon:r.writeMultiPolygonGeometry_.bind(r),Circle:r.writeCircleGeometry_.bind(r),GeometryCollection:r.writeGeometryCollectionGeometry_.bind(r)},r.source_=null,r.hitDetection_=null,e.features?n=e.features:e.source&&(r.source_=e.source,n=new si(r.source_.getFeatures()),r.source_.addEventListener(fc,r.handleSourceAdd_.bind(r)),r.source_.addEventListener(mc,r.handleSourceRemove_.bind(r))),!n)throw new Error("The modify interaction requires features, a source or a layer");return e.hitDetection&&(r.hitDetection_=e.hitDetection),r.features_=n,r.features_.forEach(r.addFeature_.bind(r)),r.features_.addEventListener(ei,r.handleFeatureAdd_.bind(r)),r.features_.addEventListener(ii,r.handleFeatureRemove_.bind(r)),r.lastPointerEvent_=null,r.delta_=[0,0],r.snapToPointer_=void 0===e.snapToPointer?!r.hitDetection_:e.snapToPointer,r}return Dc(e,t),e.prototype.addFeature_=function(t){var e=t.getGeometry();if(e){var i=this.SEGMENT_WRITERS_[e.getType()];i&&i(t,e)}var n=this.getMap();n&&n.isRendered()&&this.getActive()&&this.handlePointerAtPixel_(this.lastPixel_,n),t.addEventListener(It,this.boundHandleFeatureChange_)},e.prototype.willModifyFeatures_=function(t,e){if(!this.featuresBeingModified_){this.featuresBeingModified_=new si;for(var i=this.featuresBeingModified_.getArray(),n=0,r=e.length;n<r;++n)for(var o=e[n],s=0,a=o.length;s<a;++s){var l=o[s].feature;l&&-1===i.indexOf(l)&&this.featuresBeingModified_.push(l)}0===this.featuresBeingModified_.getLength()?this.featuresBeingModified_=null:this.dispatchEvent(new Wc(Nc,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(It,this.boundHandleFeatureChange_)},e.prototype.removeFeatureSegmentData_=function(t){var e=this.rBush_,i=[];e.forEach((function(e){t===e.feature&&i.push(e)}));for(var n=i.length-1;n>=0;--n){for(var r=i[n],o=this.dragSegments_.length-1;o>=0;--o)this.dragSegments_[o][0]===r&&this.dragSegments_.splice(o,1);e.remove(r)}},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 i=e.getCoordinates(),n={feature:t,geometry:e,segment:[i,i]};this.rBush_.insert(e.getExtent(),n)},e.prototype.writeMultiPointGeometry_=function(t,e){for(var i=e.getCoordinates(),n=0,r=i.length;n<r;++n){var o=i[n],s={feature:t,geometry:e,depth:[n],index:n,segment:[o,o]};this.rBush_.insert(e.getExtent(),s)}},e.prototype.writeLineStringGeometry_=function(t,e){for(var i=e.getCoordinates(),n=0,r=i.length-1;n<r;++n){var o=i.slice(n,n+2),s={feature:t,geometry:e,index:n,segment:o};this.rBush_.insert(Yi(o),s)}},e.prototype.writeMultiLineStringGeometry_=function(t,e){for(var i=e.getCoordinates(),n=0,r=i.length;n<r;++n)for(var o=i[n],s=0,a=o.length-1;s<a;++s){var l=o.slice(s,s+2),u={feature:t,geometry:e,depth:[n],index:s,segment:l};this.rBush_.insert(Yi(l),u)}},e.prototype.writePolygonGeometry_=function(t,e){for(var i=e.getCoordinates(),n=0,r=i.length;n<r;++n)for(var o=i[n],s=0,a=o.length-1;s<a;++s){var l=o.slice(s,s+2),u={feature:t,geometry:e,depth:[n],index:s,segment:l};this.rBush_.insert(Yi(l),u)}},e.prototype.writeMultiPolygonGeometry_=function(t,e){for(var i=e.getCoordinates(),n=0,r=i.length;n<r;++n)for(var o=i[n],s=0,a=o.length;s<a;++s)for(var l=o[s],u=0,h=l.length-1;u<h;++u){var c=l.slice(u,u+2),p={feature:t,geometry:e,depth:[s,n],index:u,segment:c};this.rBush_.insert(Yi(c),p)}},e.prototype.writeCircleGeometry_=function(t,e){var i=e.getCenter(),n={feature:t,geometry:e,index:0,segment:[i,i]},r={feature:t,geometry:e,index:1,segment:[i,i]},o=[n,r];n.featureSegments=o,r.featureSegments=o,this.rBush_.insert(sn(i),n);var s=e;this.rBush_.insert(s.getExtent(),r)},e.prototype.writeGeometryCollectionGeometry_=function(t,e){for(var i=e.getGeometriesArray(),n=0;n<i.length;++n){var r=i[n];(0,this.SEGMENT_WRITERS_[r.getType()])(t,r)}},e.prototype.createOrUpdateVertexFeature_=function(t,e,i){var n=this.vertexFeature_;n?n.getGeometry().setCoordinates(t):(n=new Qs(new ys(t)),this.vertexFeature_=n,this.overlay_.getSource().addFeature(n));return n.set("features",e),n.set("geometries",i),n},e.prototype.handleEvent=function(e){return!e.originalEvent||(this.lastPointerEvent_=e,e.map.getView().getInteracting()||e.type!=co.POINTERMOVE||this.handlingDownUpSequence||this.handlePointerMove_(e),this.vertexFeature_&&this.deleteCondition_(e)&&(i=!(e.type!=co.SINGLECLICK||!this.ignoreNextSingleClick_)||this.removePoint()),e.type==co.SINGLECLICK&&(this.ignoreNextSingleClick_=!1),t.prototype.handleEvent.call(this,e)&&!i);var i},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]],i=[],n=[],r=0,o=this.dragSegments_.length;r<o;++r){var s=this.dragSegments_[r],a=s[0],l=a.feature;-1===i.indexOf(l)&&i.push(l);var u=a.geometry;-1===n.indexOf(u)&&n.push(u);for(var h=a.depth,c=void 0,p=a.segment,d=s[1];e.length<u.getStride();)e.push(p[d][e.length]);switch(u.getType()){case Pn:c=e,p[0]=e,p[1]=e;break;case Fn:(c=u.getCoordinates())[a.index]=e,p[0]=e,p[1]=e;break;case On:(c=u.getCoordinates())[a.index+d]=e,p[d]=e;break;case jn:case In:(c=u.getCoordinates())[h[0]][a.index+d]=e,p[d]=e;break;case Mn:(c=u.getCoordinates())[h[1]][h[0]][a.index+d]=e,p[d]=e;break;case Ln:if(p[0]=e,p[1]=e,0===a.index)this.changingFeature_=!0,u.setCenter(e),this.changingFeature_=!1;else{this.changingFeature_=!0;t.map.getView().getProjection();var f=Vn(ur(u.getCenter()),ur(e));u.setRadius(f),this.changingFeature_=!1}}c&&this.setGeometryCoordinates_(u,c)}this.createOrUpdateVertexFeature_(e,i,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 i=this.vertexFeature_;if(i){var n=t.map.getView().getProjection(),r=[],o=i.getGeometry().getCoordinates(),s=Yi([o]),a=this.rBush_.getInExtent(s),l={};a.sort(qc);for(var u=0,h=a.length;u<h;++u){var c=a[u],p=c.segment,d=$t(c.geometry),f=c.depth;if(f&&(d+="-"+f.join("-")),l[d]||(l[d]=new Array(2)),c.geometry.getType()!==Ln||1!==c.index)if(!Bn(p[0],o)||l[d][0])if(!Bn(p[1],o)||l[d][1])$t(p)in this.vertexSegments_&&!l[d][0]&&!l[d][1]&&this.insertVertexCondition_(t)&&r.push(c);else{if((c.geometry.getType()===On||c.geometry.getType()===jn)&&l[d][0]&&0===l[d][0].index)continue;this.dragSegments_.push([c,1]),l[d][1]=c}else this.dragSegments_.push([c,0]),l[d][0]=c;else Bn(Uc(e,c,n),o)&&!l[d][0]&&(this.dragSegments_.push([c,0]),l[d][0]=c)}r.length&&this.willModifyFeatures_(t,[r]);for(var y=r.length-1;y>=0;--y)this.insertVertex_(r[y],o)}return!!this.vertexFeature_},e.prototype.handleUpEvent=function(t){for(var e=this.dragSegments_.length-1;e>=0;--e){var i=this.dragSegments_[e][0],n=i.geometry;if(n.getType()===Ln){var r=n.getCenter(),o=i.featureSegments[0],s=i.featureSegments[1];o.segment[0]=r,o.segment[1]=r,s.segment[0]=r,s.segment[1]=r,this.rBush_.update(sn(r),o);var a=n;this.rBush_.update(a.getExtent(),s)}else this.rBush_.update(Yi(i.segment),i)}return this.featuresBeingModified_&&(this.dispatchEvent(new Wc(Bc,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,i){var n,r,o=this,s=i||e.getCoordinateFromPixel(t),a=e.getView().getProjection();if(this.hitDetection_){var l="object"==typeof this.hitDetection_?function(t){return t===o.hitDetection_}:void 0;e.forEachFeatureAtPixel(t,(function(t,e,i){if((i=i||t.getGeometry()).getType()===Pn&&(a=o.features_.getArray(),l=t,a.indexOf(l)>=0)){r=i;var s=i.getFlatCoordinates().slice(0,2);n=[{feature:t,geometry:i,segment:[s,s]}]}var a,l;return!0}),{layerFilter:l})}if(!n){var u=hr(Zi(cr(sn(s,zc)),e.getView().getResolution()*this.pixelTolerance_,zc));n=this.rBush_.getInExtent(u)}if(n&&n.length>0){var h=n.sort((function(t,e){return Vc(s,t,a)-Vc(s,e,a)}))[0],c=h.segment,p=Uc(s,h,a),d=e.getPixelFromCoordinate(p),f=Vn(t,d);if(r||f<=this.pixelTolerance_){var y={};if(y[$t(c)]=!0,this.snapToPointer_||(this.delta_[0]=p[0]-s[0],this.delta_[1]=p[1]-s[1]),h.geometry.getType()===Ln&&1===h.index)this.snappedToVertex_=!0,this.createOrUpdateVertexFeature_(p,[h.feature],[h.geometry]);else{var g=e.getPixelFromCoordinate(c[0]),m=e.getPixelFromCoordinate(c[1]),v=qn(d,g),_=qn(d,m);f=Math.sqrt(Math.min(v,_)),this.snappedToVertex_=f<=this.pixelTolerance_,this.snappedToVertex_&&(p=v>_?c[1]:c[0]),this.createOrUpdateVertexFeature_(p,[h.feature],[h.geometry]);var x={};x[$t(h.geometry)]=!0;for(var b=1,w=n.length;b<w;++b){var S=n[b].segment;if(!(Bn(c[0],S[0])&&Bn(c[1],S[1])||Bn(c[0],S[1])&&Bn(c[1],S[0])))break;var C=$t(n[b].geometry);C in x||(x[C]=!0,y[$t(S)]=!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 i,n=t.segment,r=t.feature,o=t.geometry,s=t.depth,a=t.index;e.length<o.getStride();)e.push(0);switch(o.getType()){case jn:case In:(i=o.getCoordinates())[s[0]].splice(a+1,0,e);break;case Mn:(i=o.getCoordinates())[s[1]][s[0]].splice(a+1,0,e);break;case On:(i=o.getCoordinates()).splice(a+1,0,e);break;default:return}this.setGeometryCoordinates_(o,i);var l=this.rBush_;l.remove(t),this.updateSegmentIndices_(o,a,s,1);var u={segment:[n[0],e],feature:r,geometry:o,depth:s,index:a};l.insert(Yi(u.segment),u),this.dragSegments_.push([u,1]);var h={segment:[e,n[1]],feature:r,geometry:o,depth:s,index:a+1};l.insert(Yi(h.segment),h),this.dragSegments_.push([h,0]),this.ignoreNextSingleClick_=!0},e.prototype.removePoint=function(){if(this.lastPointerEvent_&&this.lastPointerEvent_.type!=co.POINTERDRAG){var t=this.lastPointerEvent_;this.willModifyFeatures_(t,this.dragSegments_);var e=this.removeVertex_();return this.dispatchEvent(new Wc(Bc,this.featuresBeingModified_,t)),this.featuresBeingModified_=null,e}return!1},e.prototype.removeVertex_=function(){var t,e,i,n,r,o,s,a,l,u,h,c=this.dragSegments_,p={},d=!1;for(r=c.length-1;r>=0;--r)h=$t((u=(i=c[r])[0]).feature),u.depth&&(h+="-"+u.depth.join("-")),h in p||(p[h]={}),0===i[1]?(p[h].right=u,p[h].index=u.index):1==i[1]&&(p[h].left=u,p[h].index=u.index+1);for(h in p){switch(l=p[h].right,s=p[h].left,(a=(o=p[h].index)-1)<0&&(a=0),t=e=(n=(u=void 0!==s?s:l).geometry).getCoordinates(),d=!1,n.getType()){case jn:e[u.depth[0]].length>2&&(e[u.depth[0]].splice(o,1),d=!0);break;case On:e.length>2&&(e.splice(o,1),d=!0);break;case Mn:t=t[u.depth[1]];case In:(t=t[u.depth[0]]).length>4&&(o==t.length-1&&(o=0),t.splice(o,1),d=!0,0===o&&(t.pop(),t.push(t[0]),a=t.length-1))}if(d){this.setGeometryCoordinates_(n,e);var f=[];if(void 0!==s&&(this.rBush_.remove(s),f.push(s.segment[0])),void 0!==l&&(this.rBush_.remove(l),f.push(l.segment[1])),void 0!==s&&void 0!==l){var y={depth:u.depth,feature:u.feature,geometry:u.geometry,index:a,segment:f};this.rBush_.insert(Yi(y.segment),y)}this.updateSegmentIndices_(n,o,u.depth,-1),this.vertexFeature_&&(this.overlay_.getSource().removeFeature(this.vertexFeature_),this.vertexFeature_=null),c.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,i,n){this.rBush_.forEachInExtent(t.getExtent(),(function(r){r.geometry===t&&(void 0===i||void 0===r.depth||xt(r.depth,i))&&r.index>e&&(r.index+=n)}))},e}(Kl),Kc=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}();function Yc(t){return t.feature?t.feature:t.element?t.element:void 0}var Zc=[],Hc=function(t){function e(e){var i=this,n=e||{},r=n;return r.handleDownEvent||(r.handleDownEvent=bt),r.stopDown||(r.stopDown=wt),(i=t.call(this,r)||this).source_=n.source?n.source:null,i.vertex_=void 0===n.vertex||n.vertex,i.edge_=void 0===n.edge||n.edge,i.features_=n.features?n.features:null,i.featuresListenerKeys_=[],i.featureChangeListenerKeys_={},i.indexedFeaturesExtents_={},i.pendingFeatures_={},i.pixelTolerance_=void 0!==n.pixelTolerance?n.pixelTolerance:10,i.rBush_=new hc,i.SEGMENT_WRITERS_={Point:i.writePointGeometry_.bind(i),LineString:i.writeLineStringGeometry_.bind(i),LinearRing:i.writeLineStringGeometry_.bind(i),Polygon:i.writePolygonGeometry_.bind(i),MultiPoint:i.writeMultiPointGeometry_.bind(i),MultiLineString:i.writeMultiLineStringGeometry_.bind(i),MultiPolygon:i.writeMultiPolygonGeometry_.bind(i),GeometryCollection:i.writeGeometryCollectionGeometry_.bind(i),Circle:i.writeCircleGeometry_.bind(i)},i}return Kc(e,t),e.prototype.addFeature=function(t,e){var i=void 0===e||e,n=$t(t),r=t.getGeometry();if(r){var o=this.SEGMENT_WRITERS_[r.getType()];o&&(this.indexedFeaturesExtents_[n]=r.getExtent([1/0,1/0,-1/0,-1/0]),o(t,r))}i&&(this.featureChangeListenerKeys_[n]=qt(t,It,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 i=this.snapTo(e.pixel,e.coordinate,e.map);return i.snapped&&(e.coordinate=i.vertex.slice(0,2),e.pixel=i.vertexPixel),t.prototype.handleEvent.call(this,e)},e.prototype.handleFeatureAdd_=function(t){var e=Yc(t);this.addFeature(e)},e.prototype.handleFeatureRemove_=function(t){var e=Yc(t);this.removeFeature(e)},e.prototype.handleFeatureChange_=function(t){var e=t.target;if(this.handlingDownUpSequence){var i=$t(e);i in this.pendingFeatures_||(this.pendingFeatures_[i]=e)}else this.updateFeature_(e)},e.prototype.handleUpEvent=function(t){var e=Et(this.pendingFeatures_);return e.length&&(e.forEach(this.updateFeature_.bind(this)),this.pendingFeatures_={}),!1},e.prototype.removeFeature=function(t,e){var i=void 0===e||e,n=$t(t),r=this.indexedFeaturesExtents_[n];if(r){var o=this.rBush_,s=[];o.forEachInExtent(r,(function(e){t===e.feature&&s.push(e)}));for(var a=s.length-1;a>=0;--a)o.remove(s[a])}i&&(Ut(this.featureChangeListenerKeys_[n]),delete this.featureChangeListenerKeys_[n])},e.prototype.setMap=function(e){var i=this.getMap(),n=this.featuresListenerKeys_,r=this.getFeatures_();i&&(n.forEach(Ut),n.length=0,r.forEach(this.forEachFeatureRemove_.bind(this))),t.prototype.setMap.call(this,e),e&&(this.features_?n.push(qt(this.features_,ei,this.handleFeatureAdd_,this),qt(this.features_,ii,this.handleFeatureRemove_,this)):this.source_&&n.push(qt(this.source_,fc,this.handleFeatureAdd_,this),qt(this.source_,mc,this.handleFeatureRemove_,this)),r.forEach(this.forEachFeatureAdd_.bind(this)))},e.prototype.snapTo=function(t,e,i){var n=Yi([i.getCoordinateFromPixel([t[0]-this.pixelTolerance_,t[1]+this.pixelTolerance_]),i.getCoordinateFromPixel([t[0]+this.pixelTolerance_,t[1]-this.pixelTolerance_])]),r=this.rBush_.getInExtent(n);this.vertex_&&!this.edge_&&(r=r.filter((function(t){return t.feature.getGeometry().getType()!==Ln})));var o=!1,s=null,a=null;if(0===r.length)return{snapped:o,vertex:s,vertexPixel:a};i.getView().getProjection();for(var l,u=ur(e),h=1/0,c=0;c<r.length;++c){var p=r[c];Zc[0]=ur(p.segment[0]),Zc[1]=ur(p.segment[1]);var d=Un(u,Zc);d<h&&(l=p,h=d)}var f=l.segment;if(this.vertex_&&!this.edge_){var y=i.getPixelFromCoordinate(f[0]),g=i.getPixelFromCoordinate(f[1]),m=qn(t,y),v=qn(t,g);Math.sqrt(Math.min(m,v))<=this.pixelTolerance_&&(o=!0,s=m>v?f[1]:f[0],a=i.getPixelFromCoordinate(s))}else if(this.edge_){var _=l.feature.getGeometry().getType()===Ln;if(_){var x=l.feature.getGeometry();null,s=lr(function(t,e){var i=e.getRadius(),n=e.getCenter(),r=n[0],o=n[1],s=t[0]-r,a=t[1]-o;0===s&&0===a&&(s=1);var l=Math.sqrt(s*s+a*a);return[r+i*s/l,o+i*a/l]}(u,x))}else Zc[0]=ur(f[0]),Zc[1]=ur(f[1]),s=lr(Nn(u,Zc));if(Vn(t,a=i.getPixelFromCoordinate(s))<=this.pixelTolerance_&&(o=!0,this.vertex_&&!_)){y=i.getPixelFromCoordinate(f[0]),g=i.getPixelFromCoordinate(f[1]),m=qn(a,y),v=qn(a,g);Math.sqrt(Math.min(m,v))<=this.pixelTolerance_&&(s=m>v?f[1]:f[0],a=i.getPixelFromCoordinate(s))}}return o&&(a=[Math.round(a[0]),Math.round(a[1])]),{snapped:o,vertex:s,vertexPixel:a}},e.prototype.updateFeature_=function(t){this.removeFeature(t,!1),this.addFeature(t,!1)},e.prototype.writeCircleGeometry_=function(t,e){this.getMap().getView().getProjection();for(var i=js(e).getCoordinates()[0],n=0,r=i.length-1;n<r;++n){var o=i.slice(n,n+2),s={feature:t,segment:o};this.rBush_.insert(Yi(o),s)}},e.prototype.writeGeometryCollectionGeometry_=function(t,e){for(var i=e.getGeometriesArray(),n=0;n<i.length;++n){var r=this.SEGMENT_WRITERS_[i[n].getType()];r&&r(t,i[n])}},e.prototype.writeLineStringGeometry_=function(t,e){for(var i=e.getCoordinates(),n=0,r=i.length-1;n<r;++n){var o=i.slice(n,n+2),s={feature:t,segment:o};this.rBush_.insert(Yi(o),s)}},e.prototype.writeMultiLineStringGeometry_=function(t,e){for(var i=e.getCoordinates(),n=0,r=i.length;n<r;++n)for(var o=i[n],s=0,a=o.length-1;s<a;++s){var l=o.slice(s,s+2),u={feature:t,segment:l};this.rBush_.insert(Yi(l),u)}},e.prototype.writeMultiPointGeometry_=function(t,e){for(var i=e.getCoordinates(),n=0,r=i.length;n<r;++n){var o=i[n],s={feature:t,segment:[o,o]};this.rBush_.insert(e.getExtent(),s)}},e.prototype.writeMultiPolygonGeometry_=function(t,e){for(var i=e.getCoordinates(),n=0,r=i.length;n<r;++n)for(var o=i[n],s=0,a=o.length;s<a;++s)for(var l=o[s],u=0,h=l.length-1;u<h;++u){var c=l.slice(u,u+2),p={feature:t,segment:c};this.rBush_.insert(Yi(c),p)}},e.prototype.writePointGeometry_=function(t,e){var i=e.getCoordinates(),n={feature:t,segment:[i,i]};this.rBush_.insert(e.getExtent(),n)},e.prototype.writePolygonGeometry_=function(t,e){for(var i=e.getCoordinates(),n=0,r=i.length;n<r;++n)for(var o=i[n],s=0,a=o.length-1;s<a;++s){var l=o.slice(s,s+2),u={feature:t,segment:l};this.rBush_.insert(Yi(l),u)}},e}(Kl);function $c(t){var e=t||{},i=new si,n=new ku(-.005,.05,100);return(void 0===e.altShiftDragRotate||e.altShiftDragRotate)&&i.push(new au),(void 0===e.doubleClickZoom||e.doubleClickZoom)&&i.push(new Vl({delta:e.zoomDelta,duration:e.zoomDuration})),(void 0===e.dragPan||e.dragPan)&&i.push(new ou({onFocusOnly:e.onFocusOnly,kinetic:n})),(void 0===e.pinchRotate||e.pinchRotate)&&i.push(new ju),(void 0===e.pinchZoom||e.pinchZoom)&&i.push(new Au({duration:e.zoomDuration})),(void 0===e.keyboard||e.keyboard)&&(i.push(new Cu),i.push(new Eu({delta:e.zoomDelta,duration:e.zoomDuration}))),(void 0===e.mouseWheelZoom||e.mouseWheelZoom)&&i.push(new Iu({onFocusOnly:e.onFocusOnly,duration:e.zoomDuration})),(void 0===e.shiftDragZoom||e.shiftDragZoom)&&i.push(new vu({duration:e.zoomDuration})),i}var Jc=function(){function t(t,e,i,n){this.minX=t,this.maxX=e,this.minY=i,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 Qc(t,e,i,n,r){return void 0!==r?(r.minX=t,r.maxX=e,r.minY=i,r.maxY=n,r):new Jc(t,e,i,n)}var tp=Jc,ep=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}(),ip=function(t){function e(e){var i=t.call(this,e)||this;return i.extentChanged=!0,i.renderedExtent_=null,i.renderedPixelRatio,i.renderedProjection=null,i.renderedRevision,i.renderedTiles=[],i.newTiles_=!1,i.tmpExtent=[1/0,1/0,-1/0,-1/0],i.tmpTileRange_=new tp(0,0,0,0),i}return ep(e,t),e.prototype.isDrawableTile=function(t){var e=this.getLayer(),i=t.getState(),n=e.getUseInterimTilesOnError();return i==_o||i==bo||i==xo&&!n},e.prototype.getTile=function(t,e,i,n){var r=n.pixelRatio,o=n.viewState.projection,s=this.getLayer(),a=s.getSource().getTile(t,e,i,r,o);return a.getState()==xo&&(s.getUseInterimTilesOnError()?s.getPreload()>0&&(this.newTiles_=!0):a.setState(_o)),this.isDrawableTile(a)||(a=a.getInterimTile()),a},e.prototype.loadedTileCallback=function(e,i,n){return!!this.isDrawableTile(n)&&t.prototype.loadedTileCallback.call(this,e,i,n)},e.prototype.prepareFrame=function(t){return!!this.getLayer().getSource()},e.prototype.renderFrame=function(t,e){var i=t.layerStatesArray[t.layerIndex],n=t.viewState,r=n.projection,o=n.resolution,s=n.center,a=n.rotation,l=t.pixelRatio,u=this.getLayer(),h=u.getSource(),c=h.getRevision(),p=h.getTileGridForProjection(r),d=p.getZForResolution(o,h.zDirection),f=p.getResolution(d),y=t.extent,g=i.extent&&cr(i.extent);g&&(y=bn(y,cr(i.extent)));var m=h.getTilePixelRatio(l),v=Math.round(t.size[0]*m),_=Math.round(t.size[1]*m);if(a){var x=Math.round(Math.sqrt(v*v+_*_));v=x,_=x}var b=f*v/2/m,w=f*_/2/m,S=[s[0]-b,s[1]-w,s[0]+b,s[1]+w],C=p.getTileRangeForExtentAndZ(y,d),T={};T[d]={};var E=this.createLoadedTileFinder(h,r,T),k=this.tmpExtent,P=this.tmpTileRange_;this.newTiles_=!1;for(var O=C.minX;O<=C.maxX;++O)for(var R=C.minY;R<=C.maxY;++R){var I=this.getTile(d,O,R,t);if(this.isDrawableTile(I)){var F=$t(this);if(I.getState()==_o){T[d][I.tileCoord.toString()]=I;var j=I.inTransition(F);this.newTiles_||!j&&-1!==this.renderedTiles.indexOf(I)||(this.newTiles_=!0)}if(1===I.getAlpha(F,t.time))continue}var M=p.getTileCoordChildTileRange(I.tileCoord,P,k),A=!1;M&&(A=E(d+1,M)),A||p.forEachTileCoordParentTileRange(I.tileCoord,E,P,k)}var L=f/o;_r(this.pixelTransform,t.size[0]/2,t.size[1]/2,1/m,1/m,a,-v/2,-_/2);var D=br(this.pixelTransform);this.useContainer(e,D,i.opacity);var z=this.context,G=z.canvas;xr(this.inversePixelTransform,this.pixelTransform),_r(this.tempTransform,v/2,_/2,L,L,0,-v/2,-_/2),G.width!=v||G.height!=_?(G.width=v,G.height=_):this.containerReused||z.clearRect(0,0,v,_),g&&this.clipUnrotated(z,t,g),Ct(z,h.getContextOptions()),this.preRender(z,t),this.renderedTiles.length=0;var N,B,W,q=Object.keys(T).map(Number);q.sort(gt),1!==i.opacity||this.containerReused&&!h.getOpaque(t.viewState.projection)?(N=[],B=[]):q=q.reverse();for(var V=q.length-1;V>=0;--V){var U=q[V],X=h.getTilePixelSize(U,l,r),K=p.getResolution(U)/f,Y=X[0]*K*L,Z=X[1]*K*L,H=p.getTileCoordForCoordAndZ(wn(S),U),$=p.getTileCoordExtent(H),J=mr(this.tempTransform,[m*($[0]-S[0])/f,m*(S[3]-$[3])/f]),Q=m*h.getGutterForProjection(r),tt=T[U];for(var et in tt){var it=(I=tt[et]).tileCoord,nt=H[1]-it[1],rt=Math.round(J[0]-(nt-1)*Y),ot=H[2]-it[2],st=Math.round(J[1]-(ot-1)*Z),at=rt-(O=Math.round(J[0]-nt*Y)),lt=st-(R=Math.round(J[1]-ot*Z)),ut=d===U;if(!(j=ut&&1!==I.getAlpha($t(this),t.time)))if(N){z.save(),W=[O,R,O+at,R,O+at,R+lt,O,R+lt];for(var ht=0,ct=N.length;ht<ct;++ht)if(d!==U&&U<B[ht]){var pt=N[ht];z.beginPath(),z.moveTo(W[0],W[1]),z.lineTo(W[2],W[3]),z.lineTo(W[4],W[5]),z.lineTo(W[6],W[7]),z.moveTo(pt[6],pt[7]),z.lineTo(pt[4],pt[5]),z.lineTo(pt[2],pt[3]),z.lineTo(pt[0],pt[1]),z.clip()}N.push(W),B.push(U)}else z.clearRect(O,R,at,lt);this.drawTileImage(I,t,O,R,at,lt,Q,ut),N&&!j?(z.restore(),this.renderedTiles.unshift(I)):this.renderedTiles.push(I),this.updateUsedTiles(t.usedTiles,h,I)}}this.renderedRevision=c,this.renderedResolution=f,this.extentChanged=!this.renderedExtent_||!ln(this.renderedExtent_,S),this.renderedExtent_=S,this.renderedPixelRatio=l,this.renderedProjection=r,this.manageTilePyramid(t,h,p,l,r,y,d,u.getPreload()),this.scheduleExpireCache(t,h),this.postRender(z,t),i.extent&&z.restore(),D!==G.style.transform&&(G.style.transform=D);var dt=xe(i.opacity),ft=this.container;return dt!==ft.style.opacity&&(ft.style.opacity=dt),this.container},e.prototype.drawTileImage=function(t,e,i,n,r,o,s,a){var l=this.getTileImage(t);if(l){var u=$t(this),h=a?t.getAlpha(u,e.time):1,c=h!==this.context.globalAlpha;c&&(this.context.save(),this.context.globalAlpha=h),this.context.drawImage(l,s,s,l.width-2*s,l.height-2*s,i,n,r,o),c&&this.context.restore(),1!==h?e.animate=!0:a&&t.endTransition(u)}},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 i=function(t,e,i){var n=$t(t);n in i.usedTiles&&t.expireCache(i.viewState.projection,i.usedTiles[n])}.bind(null,e);t.postRenderFunctions.push(i)}},e.prototype.updateUsedTiles=function(t,e,i){var n=$t(e);n in t||(t[n]={}),t[n][i.getKey()]=!0},e.prototype.manageTilePyramid=function(t,e,i,n,r,o,s,a,l){var u=$t(e);u in t.wantedTiles||(t.wantedTiles[u]={});var h,c,p,d,f,y,g=t.wantedTiles[u],m=t.tileQueue,v=0;for(y=i.getMinZoom();y<=s;++y)for(c=i.getTileRangeForExtentAndZ(o,y,c),p=i.getResolution(y),d=c.minX;d<=c.maxX;++d)for(f=c.minY;f<=c.maxY;++f)s-y<=a?(++v,(h=e.getTile(y,d,f,n,r)).getState()==mo&&(g[h.getKey()]=!0,m.isKeyQueued(h.getKey())||m.enqueue([h,u,i.getTileCoordCenter(h.tileCoord),p])),void 0!==l&&l(h)):e.useTile(y,d,f,r);e.updateCacheSize(v,r)},e}(Oh);ip.prototype.getLayer;var np=ip,rp="image",op="hybrid",sp="vector",ap=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}(),lp={image:[Mh,Rh,jh,Fh,Ah],hybrid:[Mh,jh],vector:[]},up={hybrid:[Fh,Ah,Ih],vector:[Mh,Rh,jh,Fh,Ah,Ih]},hp=function(t){function e(e){var i=t.call(this,e)||this;return i.boundHandleStyleImageChange_=i.handleStyleImageChange_.bind(i),i.dirty_=!1,i.renderedLayerRevision_,i.renderedPixelToCoordinateTransform_=null,i.renderedRotation_,i.tmpTransform_=[1,0,0,1,0,0],i}return ap(e,t),e.prototype.prepareTile=function(t,e,i){var n,r=t.getState();return r!==_o&&r!==xo||(this.updateExecutorGroup_(t,e,i),this.tileImageNeedsRender_(t)&&(n=!0)),n},e.prototype.getTile=function(e,i,n,r){var o=r.pixelRatio,s=r.viewState,a=s.resolution,l=s.projection,u=this.getLayer(),h=u.getSource().getTile(e,i,n,o,l),c=r.viewHints,p=!(c[Co]||c[To]);return!p&&h.wantedResolution||(h.wantedResolution=a),this.prepareTile(h,o,l)&&(p||Date.now()-r.time<8)&&u.getRenderMode()!==sp&&this.renderTileImage_(h,r),t.prototype.getTile.call(this,e,i,n,r)},e.prototype.isDrawableTile=function(e){var i=this.getLayer();return t.prototype.isDrawableTile.call(this,e)&&(i.getRenderMode()===sp?$t(i)in e.executorGroups:e.hasContext(i))},e.prototype.getTileImage=function(t){return t.getImage(this.getLayer())},e.prototype.prepareFrame=function(e){var i=this.getLayer().getRevision();return this.renderedLayerRevision_!=i&&(this.renderedTiles.length=0),this.renderedLayerRevision_=i,t.prototype.prepareFrame.call(this,e)},e.prototype.updateExecutorGroup_=function(t,e,i){var n=this.getLayer(),r=n.getRevision(),o=n.getRenderOrder()||null,s=t.wantedResolution,a=t.getReplayState(n);if(a.dirty||a.renderedResolution!==s||a.renderedRevision!=r||a.renderedRenderOrder!=o){var l=n.getSource(),u=n.getDeclutter(),h=l.getTileGrid(),c=l.getTileGridForProjection(i).getTileCoordExtent(t.wrappedTileCoord),p=l.getSourceTiles(e,i,t),d=$t(n);delete t.hitDetectionImageData[d],t.executorGroups[d]=[],u&&(t.declutterExecutorGroups[d]=[]);for(var f=function(i,r){var f=p[i];if(f.getState()!=_o)return"continue";var g=f.tileCoord,m=h.getTileCoordExtent(g),v=bn(c,m),_=Zi(v,n.getRenderBuffer()*s,y.tmpExtent),x=ln(m,v)?null:_;a.dirty=!1;var b=new Th(0,_,s,e),w=u?new Th(0,v,s,e):void 0,S=ic(s,e),C=function(t){var e,i=t.getStyleFunction()||n.getStyleFunction();if(i&&(e=i(t,s)),e){var r=this.renderFeature(t,S,e,b,w);this.dirty_=this.dirty_||r,a.dirty=a.dirty||r}},T=f.getFeatures();o&&o!==a.renderedRenderOrder&&T.sort(o);for(var E=0,k=T.length;E<k;++E){var P=T[E];x&&!Tn(x,P.getGeometry().getExtent())||C.call(y,P)}var O=b.finish(),R=n.getRenderMode()!==sp&&u&&1===p.length?null:v,I=new Zh(R,s,e,l.getOverlaps(),O,n.getRenderBuffer());if(t.executorGroups[d].push(I),w){var F=new Zh(null,s,e,l.getOverlaps(),w.finish(),n.getRenderBuffer());t.declutterExecutorGroups[d].push(F)}},y=this,g=0,m=p.length;g<m;++g)f(g);a.renderedRevision=r,a.renderedRenderOrder=o,a.renderedResolution=s}},e.prototype.forEachFeatureAtCoordinate=function(t,e,i,n,r){var o=e.viewState.resolution,s=e.viewState.rotation;i=null==i?0:i;var a=this.getLayer(),l=a.getSource().getTileGridForProjection(e.viewState.projection),u=Yi([t]);Zi(u,o*i,u);for(var h,c={},p=function(t,e,i){var o=t.getId();void 0===o&&(o=$t(t));var s=c[o];if(s){if(!0!==s&&i<s.distanceSq){if(0===i)return c[o]=!0,r.splice(r.lastIndexOf(s),1),n(t,a,e);s.geometry=e,s.distanceSq=i}}else{if(0===i)return c[o]=!0,n(t,a,e);r.push(c[o]={feature:t,layer:a,geometry:e,distanceSq:i,callback:n})}},d=this.renderedTiles,f=function(n,r){var c=d[n];if(!Tn(l.getTileCoordExtent(c.wrappedTileCoord),u))return"continue";var f=$t(a),y=[c.executorGroups[f]],g=c.declutterExecutorGroups[f];g&&y.push(g),y.some((function(n){for(var r=n===g?e.declutterTree.all().map((function(t){return t.value})):null,a=0,l=n.length;a<l;++a){var u=n[a];if(h=u.forEachFeatureAtCoordinate(t,o,s,i,p,r))return!0}}))},y=0,g=d.length;!h&&y<g;++y)f(y);return h},e.prototype.getFeatures=function(t){return new Promise(function(e,i){for(var n,r=this.getLayer(),o=$t(r),s=r.getSource(),a=this.renderedProjection,l=a.getExtent(),u=this.renderedResolution,h=s.getTileGridForProjection(a),c=mr(this.renderedPixelToCoordinateTransform_,t.slice()),p=h.getTileCoordForCoordAndResolution(c,u),d=0,f=this.renderedTiles.length;d<f;++d)if(p.toString()===this.renderedTiles[d].tileCoord.toString()){if((n=this.renderedTiles[d]).getState()===_o){var y=h.getTileCoordExtent(n.tileCoord);s.getWrapX()&&a.canWrapX()&&!Qi(l,y)&&Xn(c,a);break}n=void 0}if(!n||n.loadingSourceTiles>0)e([]);else{var g=wn(h.getTileCoordExtent(n.wrappedTileCoord)),m=[(c[0]-g[0])/u,(g[1]-c[1])/u],v=n.getSourceTiles().reduce((function(t,e){return t.concat(e.getFeatures())}),[]),_=n.hitDetectionImageData[o];if(!_&&!this.animatingOrInteracting_){var x=Ns(h.getTileSize(h.getZForResolution(u))),b=this.renderedRotation_;_=Jh(x,[this.getRenderTransform(h.getTileCoordCenter(n.wrappedTileCoord),u,0,.5,.5*x[0],.5*x[1],0)],v,r.getStyleFunction(),h.getTileCoordExtent(n.wrappedTileCoord),n.getReplayState(r).renderedResolution,b),n.hitDetectionImageData[o]=_}e(Qh(m,v,_))}}.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,i=e.globalAlpha;e.globalAlpha=this.getLayer().getOpacity();for(var n=t.viewHints,r=!(n[Co]||n[To]),o=this.renderedTiles,s=0,a=o.length;s<a;++s){var l=o[s],u=l.declutterExecutorGroups[$t(this.getLayer())];if(u)for(var h=u.length-1;h>=0;--h)u[h].execute(this.context,1,this.getTileRenderTransform(l,t),t.viewState.rotation,r,void 0,t.declutterTree)}e.globalAlpha=i},e.prototype.getTileRenderTransform=function(t,e){var i=e.pixelRatio,n=e.viewState,r=n.center,o=n.resolution,s=n.rotation,a=e.size,l=Math.round(a[0]*i),u=Math.round(a[1]*i),h=this.getLayer().getSource().getTileGridForProjection(e.viewState.projection),c=t.tileCoord,p=h.getTileCoordExtent(t.wrappedTileCoord),d=h.getTileCoordExtent(c,this.tmpExtent)[0]-p[0];return yr(vr(this.inversePixelTransform.slice(),1/i,1/i),this.getRenderTransform(r,o,s,i,l,u,d))},e.prototype.renderFrame=function(e,i){var n=e.viewHints,r=!(n[Co]||n[To]);t.prototype.renderFrame.call(this,e,i),this.renderedPixelToCoordinateTransform_=e.pixelToCoordinateTransform.slice(),this.renderedRotation_=e.viewState.rotation;var o=this.getLayer(),s=o.getRenderMode(),a=this.context,l=a.globalAlpha;a.globalAlpha=o.getOpacity();for(var u=up[s],h=e.viewState.rotation,c=this.renderedTiles,p=[],d=[],f=c.length-1;f>=0;--f)for(var y=c[f],g=this.getTileRenderTransform(y,e),m=y.executorGroups[$t(o)],v=!1,_=0,x=m.length;_<x;++_){var b=m[_];if(b.hasExecutors(u)){var w=y.tileCoord[0],S=void 0;if(!v&&(S=b.getClipCoords(g))){a.save();for(var C=0,T=p.length;C<T;++C){var E=p[C];w<d[C]&&(a.beginPath(),a.moveTo(S[0],S[1]),a.lineTo(S[2],S[3]),a.lineTo(S[4],S[5]),a.lineTo(S[6],S[7]),a.moveTo(E[6],E[7]),a.lineTo(E[4],E[5]),a.lineTo(E[2],E[3]),a.lineTo(E[0],E[1]),a.clip())}}b.execute(a,1,g,h,r,u),!v&&S&&(a.restore(),p.push(S),d.push(w),v=!0)}}return a.globalAlpha=l,this.container},e.prototype.renderFeature=function(t,e,i,n,r){if(!i)return!1;var o=!1;if(Array.isArray(i))for(var s=0,a=i.length;s<a;++s)o=rc(n,t,i[s],e,this.boundHandleStyleImageChange_,void 0,r)||o;else o=rc(n,t,i,e,this.boundHandleStyleImageChange_,void 0,r);return o},e.prototype.tileImageNeedsRender_=function(t){var e=this.getLayer();if(e.getRenderMode()===sp)return!1;var i=t.getReplayState(e),n=e.getRevision(),r=t.wantedResolution;return i.renderedTileResolution!==r||i.renderedTileRevision!==n},e.prototype.renderTileImage_=function(t,e){var i=this.getLayer(),n=t.getReplayState(i),r=i.getRevision(),o=t.executorGroups[$t(i)];n.renderedTileRevision=r;var s=t.wrappedTileCoord,a=s[0],l=i.getSource(),u=e.pixelRatio,h=e.viewState.projection,c=l.getTileGridForProjection(h),p=c.getResolution(t.tileCoord[0]),d=e.pixelRatio/t.wantedResolution*p,f=c.getResolution(a),y=t.getContext(i);u=Math.round(Math.max(u,d/u));var g=l.getTilePixelSize(a,u,h);y.canvas.width=g[0],y.canvas.height=g[1];var m=u/d;if(1!==m){var v=fr(this.tmpTransform_);vr(v,m,m),y.setTransform.apply(y,v)}var _=c.getTileCoordExtent(s,this.tmpExtent),x=d/f,b=fr(this.tmpTransform_);vr(b,x,-x),function(t,e,i){yr(t,gr(dr,1,0,0,1,e,i))}(b,-_[0],-_[3]);for(var w=0,S=o.length;w<S;++w){o[w].execute(y,m,b,0,!0,lp[i.getRenderMode()])}n.renderedTileResolution=t.wantedResolution},e}(np),cp="preload",pp="useInterimTilesOnError",dp=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}(),fp=function(t){function e(e){var i=this,n=e||{},r=Ct({},n);delete r.preload,delete r.useInterimTilesOnError,(i=t.call(this,r)||this).on,i.once,i.un,n.renderMode===rp&&(console.warn('renderMode: "image" is deprecated. Option ignored.'),n.renderMode=void 0);var o=n.renderMode||op;return Fe(o==op||o==sp,28),i.renderMode_=o,i.setPreload(n.preload?n.preload:0),i.setUseInterimTilesOnError(void 0===n.useInterimTilesOnError||n.useInterimTilesOnError),i}return dp(e,t),e.prototype.createRenderer=function(){return new hp(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(cp)},e.prototype.getUseInterimTilesOnError=function(){return this.get(pp)},e.prototype.setPreload=function(t){this.set(cp,t)},e.prototype.setUseInterimTilesOnError=function(t){this.set(pp,t)},e}(oh),yp=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}(),gp=function(t){function e(e,i,n){var r=t.call(this)||this,o=n||{};return r.tileCoord=e,r.state=i,r.interimTile=null,r.key="",r.transition_=void 0===o.transition?250:o.transition,r.transitionStarts_={},r}return yp(e,t),e.prototype.changed=function(){this.dispatchEvent(It)},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()==_o)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()==_o){t.interimTile=null;break}t.getState()==vo?e=t:t.getState()==mo?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!==xo&&this.state>t)throw new Error("Tile load sequence violation");this.state=t,this.changed()},e.prototype.load=function(){Zt()},e.prototype.getAlpha=function(t,e){if(!this.transition_)return 1;var i=this.transitionStarts_[t];if(i){if(-1===i)return 1}else i=e,this.transitionStarts_[t]=i;var n=e-i+1e3/60;return n>=this.transition_?1:ai(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}(Rt),mp=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}(),vp=function(t){function e(e,i,n,r,o,s){var a=t.call(this,e,i,s)||this;return a.extent=null,a.format_=r,a.features_=null,a.loader_,a.projection=null,a.resolution,a.tileLoadFunction_=o,a.url_=n,a.key=n,a}return mp(e,t),e.prototype.getFormat=function(){return this.format_},e.prototype.getFeatures=function(){return this.features_},e.prototype.load=function(){this.state==mo&&(this.setState(vo),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(xo)},e.prototype.setFeatures=function(t){this.features_=t,this.setState(_o)},e.prototype.setLoader=function(t){this.loader_=t},e}(gp),_p=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.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 i=this.entries_[t];return Fe(void 0!==i,15),i===this.newest_||(i===this.oldest_?(this.oldest_=this.oldest_.newer,this.oldest_.older=null):(i.newer.older=i.older,i.older.newer=i.newer),i.newer=null,i.older=this.newest_,this.newest_.newer=i,this.newest_=i),i.value_},t.prototype.remove=function(t){var e=this.entries_[t];return Fe(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_),i=0;for(t=this.newest_;t;t=t.older)e[i++]=t.key_;return e},t.prototype.getValues=function(){var t,e=new Array(this.count_),i=0;for(t=this.newest_;t;t=t.older)e[i++]=t.value_;return e},t.prototype.peekLast=function(){return this.oldest_.value_},t.prototype.peekLastKey=function(){return this.oldest_.key_},t.prototype.peekFirstKey=function(){return this.newest_.key_},t.prototype.pop=function(){var t=this.oldest_;return delete this.entries_[t.key_],t.newer&&(t.newer.older=null),this.oldest_=t.newer,this.oldest_||(this.newest_=null),--this.count_,t.value_},t.prototype.replace=function(t,e){this.get(t),this.entries_[t].value_=e},t.prototype.set=function(t,e){Fe(!(t in this.entries_),16);var i={key_:t,newer:null,older:this.newest_,value_:e};this.newest_?this.newest_.newer=i:this.oldest_=i,this.newest_=i,this.entries_[t]=i,++this.count_},t.prototype.setSize=function(t){this.highWaterMark=t},t}();function xp(t,e,i,n){return void 0!==n?(n[0]=t,n[1]=e,n[2]=i,n):[t,e,i]}function bp(t,e,i){return t+"/"+e+"/"+i}function wp(t){return bp(t[0],t[1],t[2])}function Sp(t){return t.split("/").map(Number)}var Cp=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}(),Tp=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return Cp(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=Sp(this.peekFirstKey())[0];this.forEach(function(e){e.tileCoord[0]!==t&&(this.remove(wp(e.tileCoord)),e.release())}.bind(this))}},e}(_p),Ep="tileloadstart",kp="tileloadend",Pp="tileloaderror",Op=[0,0,0],Rp=function(){function t(t){var e,i,n,r;if(this.minZoom=void 0!==t.minZoom?t.minZoom:0,this.resolutions_=t.resolutions,Fe((e=this.resolutions_,i=!0,n=function(t,e){return e-t}||gt,e.every((function(t,r){if(0===r)return!0;var o=n(e[r-1],t);return!(o>0||i&&0===o)}))),17),!t.origins)for(var o=0,s=this.resolutions_.length-1;o<s;++o)if(r){if(this.resolutions_[o]/this.resolutions_[o+1]!==r){r=void 0;break}}else r=this.resolutions_[o]/this.resolutions_[o+1];this.zoomFactor_=r,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,Fe(this.origins_.length==this.resolutions_.length,20));var a=t.extent;void 0===a||this.origin_||this.origins_||(this.origin_=wn(a)),Fe(!this.origin_&&this.origins_||this.origin_&&!this.origins_,18),this.tileSizes_=null,void 0!==t.tileSizes&&(this.tileSizes_=t.tileSizes,Fe(this.tileSizes_.length==this.resolutions_.length,19)),this.tileSize_=void 0!==t.tileSize?t.tileSize:this.tileSizes_?null:256,Fe(!this.tileSize_&&this.tileSizes_||this.tileSize_&&!this.tileSizes_,22),this.extent_=void 0!==a?a: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 i=new tp(Math.min(0,t[0]),Math.max(t[0]-1,-1),Math.min(0,t[1]),Math.max(t[1]-1,-1));if(a){var n=this.getTileRangeForExtentAndZ(a,e);i.minX=Math.max(n.minX,i.minX),i.maxX=Math.min(n.maxX,i.maxX),i.minY=Math.max(n.minY,i.minY),i.maxY=Math.min(n.maxY,i.maxY)}return i}),this):a&&this.calculateTileRanges_(a)}return t.prototype.forEachTileCoord=function(t,e,i){for(var n=this.getTileRangeForExtentAndZ(t,e),r=n.minX,o=n.maxX;r<=o;++r)for(var s=n.minY,a=n.maxY;s<=a;++s)i([e,r,s])},t.prototype.forEachTileCoordParentTileRange=function(t,e,i,n){var r,o,s=null,a=t[0]-1;for(2===this.zoomFactor_?(r=t[1],o=t[2]):s=this.getTileCoordExtent(t,n);a>=this.minZoom;){if(e(a,2===this.zoomFactor_?Qc(r=Math.floor(r/2),r,o=Math.floor(o/2),o,i):this.getTileRangeForExtentAndZ(s,a,i)))return!0;--a}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,i){if(t[0]<this.maxZoom){if(2===this.zoomFactor_){var n=2*t[1],r=2*t[2];return Qc(n,n+1,r,r+1,e)}var o=this.getTileCoordExtent(t,i||this.tmpExtent_);return this.getTileRangeForExtentAndZ(o,t[0]+1,e)}return null},t.prototype.getTileRangeForTileCoordAndZ=function(t,e,i){if(e>this.maxZoom||e<this.minZoom)return null;var n=t[0],r=t[1],o=t[2];if(e===n)return Qc(r,o,r,o,i);if(this.zoomFactor_){var s=Math.pow(this.zoomFactor_,e-n),a=Math.floor(r*s),l=Math.floor(o*s);return e<n?Qc(a,a,l,l,i):Qc(a,Math.floor(s*(r+1))-1,l,Math.floor(s*(o+1))-1,i)}var u=this.getTileCoordExtent(t,this.tmpExtent_);return this.getTileRangeForExtentAndZ(u,e,i)},t.prototype.getTileRangeExtent=function(t,e,i){var n=this.getOrigin(t),r=this.getResolution(t),o=Ns(this.getTileSize(t),this.tmpSize_),s=n[0]+e.minX*o[0]*r,a=n[0]+(e.maxX+1)*o[0]*r;return rn(s,n[1]+e.minY*o[1]*r,a,n[1]+(e.maxY+1)*o[1]*r,i)},t.prototype.getTileRangeForExtentAndZ=function(t,e,i){var n=Op;this.getTileCoordForXYAndZ_(t[0],t[3],e,!1,n);var r=n[1],o=n[2];return this.getTileCoordForXYAndZ_(t[2],t[1],e,!0,n),Qc(r,n[1],o,n[2],i)},t.prototype.getTileCoordCenter=function(t){var e=this.getOrigin(t[0]),i=this.getResolution(t[0]),n=Ns(this.getTileSize(t[0]),this.tmpSize_);return[e[0]+(t[1]+.5)*n[0]*i,e[1]-(t[2]+.5)*n[1]*i]},t.prototype.getTileCoordExtent=function(t,e){var i=this.getOrigin(t[0]),n=this.getResolution(t[0]),r=Ns(this.getTileSize(t[0]),this.tmpSize_),o=i[0]+t[1]*r[0]*n,s=i[1]-(t[2]+1)*r[1]*n;return rn(o,s,o+r[0]*n,s+r[1]*n,e)},t.prototype.getTileCoordForCoordAndResolution=function(t,e,i){return this.getTileCoordForXYAndResolution_(t[0],t[1],e,!1,i)},t.prototype.getTileCoordForXYAndResolution_=function(t,e,i,n,r){var o=this.getZForResolution(i),s=i/this.getResolution(o),a=this.getOrigin(o),l=Ns(this.getTileSize(o),this.tmpSize_),u=n?.5:0,h=n?.5:0,c=Math.floor((t-a[0])/i+u),p=Math.floor((a[1]-e)/i+h),d=s*c/l[0],f=s*p/l[1];return n?(d=Math.ceil(d)-1,f=Math.ceil(f)-1):(d=Math.floor(d),f=Math.floor(f)),xp(o,d,f,r)},t.prototype.getTileCoordForXYAndZ_=function(t,e,i,n,r){var o=this.getOrigin(i),s=this.getResolution(i),a=Ns(this.getTileSize(i),this.tmpSize_),l=n?.5:0,u=n?.5:0,h=Math.floor((t-o[0])/s+l),c=Math.floor((o[1]-e)/s+u),p=h/a[0],d=c/a[1];return n?(p=Math.ceil(p)-1,d=Math.ceil(d)-1):(p=Math.floor(p),d=Math.floor(d)),xp(i,p,d,r)},t.prototype.getTileCoordForCoordAndZ=function(t,e,i){return this.getTileCoordForXYAndZ_(t[0],t[1],e,!1,i)},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 je(mt(this.resolutions_,t,e||0),this.minZoom,this.maxZoom)},t.prototype.calculateTileRanges_=function(t){for(var e=this.resolutions_.length,i=new Array(e),n=this.minZoom;n<e;++n)i[n]=this.getTileRangeForExtentAndZ(t,n);this.fullTileRanges_=i},t}();function Ip(t){var e=t.getDefaultTileGrid();return e||(e=Mp(t),t.setDefaultTileGrid(e)),e}function Fp(t){var e=t||{},i=e.extent||Hn("EPSG:3857").getExtent(),n={extent:i,minZoom:e.minZoom,tileSize:e.tileSize,resolutions:jp(i,e.maxZoom,e.tileSize,e.maxResolution)};return new Rp(n)}function jp(t,e,i,n){for(var r=void 0!==e?e:42,o=xn(t),s=Cn(t),a=Ns(void 0!==i?i:256),l=n>0?n:Math.max(s/a[0],o/a[1]),u=r+1,h=new Array(u),c=0;c<u;++c)h[c]=l/Math.pow(2,c);return h}function Mp(t,e,i,n){return function(t,e,i,n){var r=void 0!==n?n:Ni,o=jp(t,e,i);return new Rp({extent:t,origin:vn(t,r),resolutions:o,tileSize:i})}(Ap(t),e,i,n)}function Ap(t){var e=(t=Hn(t)).getExtent();if(!e){var i=180*vi[_i.DEGREES]/t.getMetersPerUnit();e=rn(-i,-i,i,i)}return e}var Lp=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}(),Dp=function(t){function e(e){var i=t.call(this,{attributions:e.attributions,attributionsCollapsible:e.attributionsCollapsible,projection:e.projection,state:e.state,wrapX:e.wrapX})||this;i.on,i.once,i.un,i.opaque_=void 0!==e.opaque&&e.opaque,i.tilePixelRatio_=void 0!==e.tilePixelRatio?e.tilePixelRatio:1,i.tileGrid=void 0!==e.tileGrid?e.tileGrid:null;var n=e.tileGrid;return n&&Ns(n.getTileSize(n.getMinZoom()),[256,256]),i.tileCache=new Tp(e.cacheSize||0),i.tmpSize=[0,0],i.key_=e.key||"",i.tileOptions={transition:e.transition},i.zDirection=e.zDirection?e.zDirection:0,i}return Lp(e,t),e.prototype.canExpireCache=function(){return this.tileCache.canExpireCache()},e.prototype.expireCache=function(t,e){var i=this.getTileCacheForProjection(t);i&&i.expireCache(e)},e.prototype.forEachLoadedTile=function(t,e,i,n){var r=this.getTileCacheForProjection(t);if(!r)return!1;for(var o,s,a,l=!0,u=i.minX;u<=i.maxX;++u)for(var h=i.minY;h<=i.maxY;++h)s=bp(e,u,h),a=!1,r.containsKey(s)&&(a=(o=r.get(s)).getState()===_o)&&(a=!1!==n(o)),a||(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.getResolutions()},e.prototype.getTile=function(t,e,i,n,r){return Zt()},e.prototype.getTileGrid=function(){return this.tileGrid},e.prototype.getTileGridForProjection=function(t){return this.tileGrid?this.tileGrid:Ip(t)},e.prototype.getTileCacheForProjection=function(t){return Fe(er(this.getProjection(),t),68),this.tileCache},e.prototype.getTilePixelRatio=function(t){return this.tilePixelRatio_},e.prototype.getTilePixelSize=function(t,e,i){var n,r,o,s=this.getTileGridForProjection(i),a=this.getTilePixelRatio(e),l=Ns(s.getTileSize(t),this.tmpSize);return 1==a?l:(n=l,r=a,void 0===(o=this.tmpSize)&&(o=[0,0]),o[0]=n[0]*r+.5|0,o[1]=n[1]*r+.5|0,o)},e.prototype.getTileCoordForTileUrlFunction=function(t,e){var i=void 0!==e?e:this.getProjection(),n=this.getTileGridForProjection(i);return this.getWrapX()&&i.isGlobal()&&(t=function(t,e,i){var n=e[0],r=t.getTileCoordCenter(e),o=Ap(i);if(Ji(o,r))return e;var s=Cn(o),a=Math.ceil((o[0]-r[0])/s);return r[0]+=s*a,t.getTileCoordForCoordAndZ(r,n)}(n,t,i)),function(t,e){var i=t[0],n=t[1],r=t[2];if(e.getMinZoom()>i||i>e.getMaxZoom())return!1;var o=e.getFullTileRange(i);return!o||o.containsXY(n,r)}(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 i=this.getTileCacheForProjection(e);t>i.highWaterMark&&(i.highWaterMark=t)},e.prototype.useTile=function(t,e,i,n){},e}(dc),zp=function(t){function e(e,i){var n=t.call(this,e)||this;return n.tile=i,n}return Lp(e,t),e}(dt),Gp=Dp;function Np(t,e){var i=/\{z\}/g,n=/\{x\}/g,r=/\{y\}/g,o=/\{-y\}/g;return function(s,a,l){return s?t.replace(i,s[0].toString()).replace(n,s[1].toString()).replace(r,s[2].toString()).replace(o,(function(){var t=s[0],i=e.getFullTileRange(t);return Fe(i,55),(i.getHeight()-s[2]-1).toString()})):void 0}}function Bp(t,e){for(var i=t.length,n=new Array(i),r=0;r<i;++r)n[r]=Np(t[r],e);return function(t){if(1===t.length)return t[0];return function(e,i,n){if(e){var r=Ge(function(t){return(t[1]<<t[0])+t[2]}(e),t.length);return t[r](e,i,n)}}}(n)}var Wp=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}(),qp=function(t){function e(i){var n=t.call(this,{attributions:i.attributions,cacheSize:i.cacheSize,opaque:i.opaque,projection:i.projection,state:i.state,tileGrid:i.tileGrid,tilePixelRatio:i.tilePixelRatio,wrapX:i.wrapX,transition:i.transition,key:i.key,attributionsCollapsible:i.attributionsCollapsible,zDirection:i.zDirection})||this;return n.generateTileUrlFunction_=n.tileUrlFunction===e.prototype.tileUrlFunction,n.tileLoadFunction=i.tileLoadFunction,i.tileUrlFunction&&(n.tileUrlFunction=i.tileUrlFunction),n.urls=null,i.urls?n.setUrls(i.urls):i.url&&n.setUrl(i.url),n.tileLoadingKeys_={},n}return Wp(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,i=t.target,n=$t(i),r=i.getState();r==vo?(this.tileLoadingKeys_[n]=!0,e=Ep):n in this.tileLoadingKeys_&&(delete this.tileLoadingKeys_[n],e=r==xo?Pp:r==_o?kp:void 0),null!=e&&this.dispatchEvent(new zp(e,i))},e.prototype.setTileLoadFunction=function(t){this.tileCache.clear(),this.tileLoadFunction=t,this.changed()},e.prototype.setTileUrlFunction=function(t,e){this.tileUrlFunction=t,this.tileCache.pruneExceptNewestZ(),void 0!==e?this.setKey(e):this.changed()},e.prototype.setUrl=function(t){var e=function(t){var e=[],i=/\{([a-z])-([a-z])\}/.exec(t);if(i){var n=i[1].charCodeAt(0),r=i[2].charCodeAt(0),o=void 0;for(o=n;o<=r;++o)e.push(t.replace(i[0],String.fromCharCode(o)));return e}if(i=/\{(\d+)-(\d+)\}/.exec(t)){for(var s=parseInt(i[2],10),a=parseInt(i[1],10);a<=s;a++)e.push(t.replace(i[0],a.toString()));return e}return e.push(t),e}(t);this.urls=e,this.setUrls(e)},e.prototype.setUrls=function(t){this.urls=t;var e=t.join("\n");this.generateTileUrlFunction_?this.setTileUrlFunction(Bp(t,this.tileGrid),e):this.setKey(e)},e.prototype.tileUrlFunction=function(t,e,i){},e.prototype.useTile=function(t,e,i){var n=bp(t,e,i);this.tileCache.containsKey(n)&&this.tileCache.get(n)},e}(Gp),Vp=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}(),Up=[],Xp=function(t){function e(e,i,n,r){var o=t.call(this,e,i,{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=r.bind(void 0,o),o.wrappedTileCoord=n,o}return Vp(e,t),e.prototype.getContext=function(t){var e=$t(t);return e in this.context_||(this.context_[e]=pe(1,1,Up)),this.context_[e]},e.prototype.hasContext=function(t){return $t(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=$t(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_)Up.push(this.context_[e].canvas),delete this.context_[e];t.prototype.release.call(this)},e}(gp),Kp=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}(),Yp=function(t){function e(e){var i=this,n=e.projection||"EPSG:3857",r=e.extent||Ap(n),o=e.tileGrid||Fp({extent:r,maxResolution:e.maxResolution,maxZoom:void 0!==e.maxZoom?e.maxZoom:22,minZoom:e.minZoom,tileSize:e.tileSize||512});return(i=t.call(this,{attributions:e.attributions,attributionsCollapsible:e.attributionsCollapsible,cacheSize:e.cacheSize,opaque:!1,projection:n,state:e.state,tileGrid:o,tileLoadFunction:e.tileLoadFunction?e.tileLoadFunction:Zp,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,i.sourceTileCache=new Tp(i.tileCache.highWaterMark),i.overlaps_=null==e.overlaps||e.overlaps,i.tileClass=e.tileClass?e.tileClass:vp,i.tileGrids_={},i}return Kp(e,t),e.prototype.getFeaturesInExtent=function(t){var e=[],i=this.tileCache;if(0===i.getCount())return e;var n=Sp(i.peekFirstKey())[0],r=this.tileGrid;return i.forEach((function(i){if(i.tileCoord[0]===n&&i.getState()===_o)for(var o=i.getSourceTiles(),s=0,a=o.length;s<a;++s){var l=o[s],u=l.tileCoord;if(Tn(t,r.getTileCoordExtent(u))){var h=l.getFeatures();if(h)for(var c=0,p=h.length;c<p;++c){var d=h[c],f=d.getGeometry();Tn(t,f.getExtent())&&e.push(d)}}}})),e},e.prototype.getOverlaps=function(){return this.overlaps_},e.prototype.clear=function(){this.tileCache.clear(),this.sourceTileCache.clear()},e.prototype.expireCache=function(e,i){var n=this.getTileCacheForProjection(e),r=Object.keys(i).reduce((function(t,e){var i,r,o=bp((r=(i=e).substring(i.lastIndexOf("/")+1,i.length).split(",").map(Number))[0],r[1],r[2]);if(n.containsKey(o))for(var s=n.get(o).sourceTiles,a=0,l=s.length;a<l;++a)t[s[a].getKey()]=!0;return t}),{});t.prototype.expireCache.call(this,e,i),this.sourceTileCache.expireCache(r)},e.prototype.getSourceTiles=function(t,e,i){var n=this;if(i.getState()===mo){i.setState(vo);var r=i.wrappedTileCoord,o=this.getTileGridForProjection(e),s=o.getTileCoordExtent(r),a=r[0],l=o.getResolution(a);Zi(s,-l,s);var u=this.tileGrid,h=u.getExtent();h&&bn(s,h,s);var c=u.getZForResolution(l,1);u.forEachTileCoord(s,c,(function(r){var o=n.tileUrlFunction(r,t,e),s=n.sourceTileCache.containsKey(o)?n.sourceTileCache.get(o):new n.tileClass(r,o?mo:bo,o,n.format_,n.tileLoadFunction);i.sourceTiles.push(s);var a=s.getState();if(a<_o){var l=function(t){n.handleTileChange(t);var e=s.getState();if(e===_o||e===xo){var r=s.getKey();r in i.errorTileKeys?s.getState()===_o&&delete i.errorTileKeys[r]:i.loadingSourceTiles--,e===xo?i.errorTileKeys[r]=!0:s.removeEventListener(It,l),0===i.loadingSourceTiles&&i.setState(kt(i.errorTileKeys)?_o:xo)}};s.addEventListener(It,l),i.loadingSourceTiles++}a===mo&&(s.extent=u.getTileCoordExtent(r),s.projection=e,s.resolution=u.getResolution(r[0]),n.sourceTileCache.set(o,s),s.load())})),i.loadingSourceTiles||i.setState(i.sourceTiles.some((function(t){return t.getState()===xo}))?xo:_o)}return i.sourceTiles},e.prototype.getTile=function(t,e,i,n,r){var o,s=bp(t,e,i),a=this.getKey();if(this.tileCache.containsKey(s)&&(o=this.tileCache.get(s)).key===a)return o;var l=[t,e,i],u=this.getTileCoordForTileUrlFunction(l,r),h=this.getTileGrid().getExtent(),c=this.getTileGridForProjection(r);if(u&&h){var p=c.getTileCoordExtent(u);Zi(p,-c.getResolution(t),p),Tn(h,p)||(u=null)}var d=!0;if(null!==u){var f=this.tileGrid,y=c.getResolution(t),g=f.getZForResolution(y,1),m=c.getTileCoordExtent(u);Zi(m,-y,m),f.forEachTileCoord(m,g,function(t){d=d&&!this.tileUrlFunction(t,n,r)}.bind(this))}var v=new Xp(l,d?bo:mo,u,this.getSourceTiles.bind(this,n,r));return v.key=a,o?(v.interimTile=o,v.refreshInterimChain(),this.tileCache.replace(s,v)):this.tileCache.set(s,v),v},e.prototype.getTileGridForProjection=function(t){var e=t.getCode(),i=this.tileGrids_[e];if(!i){var n=this.tileGrid;i=Mp(t,void 0,n?n.getTileSize(n.getMinZoom()):void 0),this.tileGrids_[e]=i}return i},e.prototype.getTilePixelRatio=function(t){return t},e.prototype.getTilePixelSize=function(t,e,i){var n=Ns(this.getTileGridForProjection(i).getTileSize(t),this.tmpSize);return[Math.round(n[0]*e),Math.round(n[1]*e)]},e.prototype.updateCacheSize=function(e,i){t.prototype.updateCacheSize.call(this,2*e,i),this.sourceTileCache.highWaterMark=this.getTileCacheForProjection(i).highWaterMark},e}(qp);function Zp(t,e){t.setLoader((function(i,n,r){wc(e,t.getFormat(),i,n,r,t.onLoad.bind(t),t.onError.bind(t))}))}var Hp=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}(),$p=function(t){function e(e){return(e=Ct({},e)).controls||(e.controls=$s()),e.interactions||(e.interactions=$c({onFocusOnly:!0})),t.call(this,e)||this}return Hp(e,t),e.prototype.createRenderer=function(){return new Qr(this)},e}(Ws),Jp=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}();var Qp,td=function(t){function e(e,i,n,r,o,s){var a=t.call(this,e,i,s)||this;return a.crossOrigin_=r,a.src_=n,a.key=n,a.image_=new Image,null!==r&&(a.image_.crossOrigin=r),a.unlisten_=null,a.tileLoadFunction_=o,a}return Jp(e,t),e.prototype.getImage=function(){return this.image_},e.prototype.setImage=function(t){this.image_=t,this.state=_o,this.unlistenImage_(),this.changed()},e.prototype.handleImageError_=function(){var t;this.state=xo,this.unlistenImage_(),this.image_=((t=pe(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=_o:this.state=bo,this.unlistenImage_(),this.changed()},e.prototype.load=function(){this.state==xo&&(this.state=mo,this.image_=new Image,null!==this.crossOrigin_&&(this.image_.crossOrigin=this.crossOrigin_)),this.state==mo&&(this.state=vo,this.changed(),this.tileLoadFunction_(this,this.src_),this.unlisten_=qa(this.image_,this.handleImageLoad_.bind(this),this.handleImageError_.bind(this)))},e.prototype.unlistenImage_=function(){this.unlisten_&&(this.unlisten_(),this.unlisten_=null)},e}(gp),ed=function(){function t(t,e,i,n,r,o){this.sourceProj_=t,this.targetProj_=e;var s={},a=nr(this.targetProj_,this.sourceProj_);this.transformInv_=function(t){var e=t[0]+"/"+t[1];return s[e]||(s[e]=a(t)),s[e]},this.maxSourceExtent_=n,this.errorThresholdSquared_=r*r,this.triangles_=[],this.wrapsXInSource_=!1,this.canWrapXInSource_=this.sourceProj_.canWrapX()&&!!n&&!!this.sourceProj_.getExtent()&&Cn(n)==Cn(this.sourceProj_.getExtent()),this.sourceWorldWidth_=this.sourceProj_.getExtent()?Cn(this.sourceProj_.getExtent()):null,this.targetWorldWidth_=this.targetProj_.getExtent()?Cn(this.targetProj_.getExtent()):null;var l=wn(i),u=Sn(i),h=gn(i),c=yn(i),p=this.transformInv_(l),d=this.transformInv_(u),f=this.transformInv_(h),y=this.transformInv_(c),g=10+(o?Math.max(0,Math.ceil(Ae(fn(i)/(o*o*256*256)))):0);if(this.addQuad_(l,u,h,c,p,d,f,y,g),this.wrapsXInSource_){var m=1/0;this.triangles_.forEach((function(t,e,i){m=Math.min(m,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])-m>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]-m>this.sourceWorldWidth_/2&&(e[0][0]-=this.sourceWorldWidth_),e[1][0]-m>this.sourceWorldWidth_/2&&(e[1][0]-=this.sourceWorldWidth_),e[2][0]-m>this.sourceWorldWidth_/2&&(e[2][0]-=this.sourceWorldWidth_);var i=Math.min(e[0][0],e[1][0],e[2][0]);Math.max(e[0][0],e[1][0],e[2][0])-i<this.sourceWorldWidth_/2&&(t.source=e)}}.bind(this))}s={}}return t.prototype.addTriangle_=function(t,e,i,n,r,o){this.triangles_.push({source:[n,r,o],target:[t,e,i]})},t.prototype.addQuad_=function(t,e,i,n,r,o,s,a,l){var u=Yi([r,o,s,a]),h=this.sourceWorldWidth_?Cn(u)/this.sourceWorldWidth_:null,c=this.sourceWorldWidth_,p=this.sourceProj_.canWrapX()&&h>.5&&h<1,d=!1;if(l>0){if(this.targetProj_.isGlobal()&&this.targetWorldWidth_)d=Cn(Yi([t,e,i,n]))/this.targetWorldWidth_>.25||d;!p&&this.sourceProj_.isGlobal()&&h&&(d=h>.25||d)}if(!(!d&&this.maxSourceExtent_&&isFinite(u[0])&&isFinite(u[1])&&isFinite(u[2])&&isFinite(u[3]))||Tn(u,this.maxSourceExtent_)){var f=0;if(!(d||isFinite(r[0])&&isFinite(r[1])&&isFinite(o[0])&&isFinite(o[1])&&isFinite(s[0])&&isFinite(s[1])&&isFinite(a[0])&&isFinite(a[1])))if(l>0)d=!0;else if(1!=(f=(isFinite(r[0])&&isFinite(r[1])?0:8)+(isFinite(o[0])&&isFinite(o[1])?0:4)+(isFinite(s[0])&&isFinite(s[1])?0:2)+(isFinite(a[0])&&isFinite(a[1])?0:1))&&2!=f&&4!=f&&8!=f)return;if(l>0){if(!d){var y=[(t[0]+i[0])/2,(t[1]+i[1])/2],g=this.transformInv_(y),m=void 0;if(p)m=(Ge(r[0],c)+Ge(s[0],c))/2-Ge(g[0],c);else m=(r[0]+s[0])/2-g[0];var v=(r[1]+s[1])/2-g[1];d=m*m+v*v>this.errorThresholdSquared_}if(d){if(Math.abs(t[0]-i[0])<=Math.abs(t[1]-i[1])){var _=[(e[0]+i[0])/2,(e[1]+i[1])/2],x=this.transformInv_(_),b=[(n[0]+t[0])/2,(n[1]+t[1])/2],w=this.transformInv_(b);this.addQuad_(t,e,_,b,r,o,x,w,l-1),this.addQuad_(b,_,i,n,w,x,s,a,l-1)}else{var S=[(t[0]+e[0])/2,(t[1]+e[1])/2],C=this.transformInv_(S),T=[(i[0]+n[0])/2,(i[1]+n[1])/2],E=this.transformInv_(T);this.addQuad_(t,S,T,n,r,C,E,a,l-1),this.addQuad_(S,e,i,T,C,o,s,E,l-1)}return}}if(p){if(!this.canWrapXInSource_)return;this.wrapsXInSource_=!0}0==(11&f)&&this.addTriangle_(t,i,n,r,s,a),0==(14&f)&&this.addTriangle_(t,i,e,r,s,o),f&&(0==(13&f)&&this.addTriangle_(e,n,t,o,a,r),0==(7&f)&&this.addTriangle_(e,n,i,o,a,s))}},t.prototype.calculateSourceExtent=function(){var t=[1/0,1/0,-1/0,-1/0];return this.triangles_.forEach((function(e,i,n){var r=e.source;hn(t,r[0]),hn(t,r[1]),hn(t,r[2])})),t},t.prototype.getTriangles=function(){return this.triangles_},t}(),id={imageSmoothingEnabled:!1,msImageSmoothingEnabled:!1};function nd(t,e,i,n,r){t.beginPath(),t.moveTo(0,0),t.lineTo(e,i),t.lineTo(n,r),t.closePath(),t.save(),t.clip(),t.fillRect(0,0,Math.max(e,n)+1,Math.max(i,r)),t.restore()}function rd(t,e){return Math.abs(t[4*e]-210)>2||Math.abs(t[4*e+3]-191.25)>2}function od(t,e,i,n){var r=rr(i,e,t),o=$n(e,n,i),s=e.getMetersPerUnit();void 0!==s&&(o*=s);var a=t.getMetersPerUnit();void 0!==a&&(o/=a);var l=t.getExtent();if(!l||Ji(l,r)){var u=$n(t,o,r)/o;isFinite(u)&&u>0&&(o/=u)}return o}function sd(t,e,i,n,r,o,s,a,l,u,h,c){var p=pe(Math.round(i*t),Math.round(i*e));if(Ct(p,c),0===l.length)return p.canvas;function d(t){return Math.round(t*i)/i}p.scale(i,i),p.globalCompositeOperation="lighter";var f=[1/0,1/0,-1/0,-1/0];l.forEach((function(t,e,i){un(f,t.extent)}));var y=Cn(f),g=xn(f),m=pe(Math.round(i*y/n),Math.round(i*g/n));Ct(m,c);var v=i/n;l.forEach((function(t,e,i){var n=t.extent[0]-f[0],r=-(t.extent[3]-f[3]),o=Cn(t.extent),s=xn(t.extent);t.image.width>0&&t.image.height>0&&m.drawImage(t.image,u,u,t.image.width-2*u,t.image.height-2*u,n*v,r*v,o*v,s*v)}));var _=wn(s);return a.getTriangles().forEach((function(t,e,r){var s=t.source,a=t.target,l=s[0][0],u=s[0][1],h=s[1][0],y=s[1][1],g=s[2][0],v=s[2][1],x=d((a[0][0]-_[0])/o),b=d(-(a[0][1]-_[1])/o),w=d((a[1][0]-_[0])/o),S=d(-(a[1][1]-_[1])/o),C=d((a[2][0]-_[0])/o),T=d(-(a[2][1]-_[1])/o),E=l,k=u;l=0,u=0;var P=function(t){for(var e=t.length,i=0;i<e;i++){for(var n=i,r=Math.abs(t[i][i]),o=i+1;o<e;o++){var s=Math.abs(t[o][i]);s>r&&(r=s,n=o)}if(0===r)return null;var a=t[n];t[n]=t[i],t[i]=a;for(var l=i+1;l<e;l++)for(var u=-t[l][i]/t[i][i],h=i;h<e+1;h++)i==h?t[l][h]=0:t[l][h]+=u*t[i][h]}for(var c=new Array(e),p=e-1;p>=0;p--){c[p]=t[p][e]/t[p][p];for(var d=p-1;d>=0;d--)t[d][e]-=t[d][p]*c[p]}return c}([[h-=E,y-=k,0,0,w-x],[g-=E,v-=k,0,0,C-x],[0,0,h,y,S-b],[0,0,g,v,T-b]]);if(P){if(p.save(),p.beginPath(),function(){if(void 0===Qp){var t=document.createElement("canvas").getContext("2d");t.globalCompositeOperation="lighter",t.fillStyle="rgba(210, 0, 0, 0.75)",nd(t,4,5,4,0),nd(t,4,5,0,5);var e=t.getImageData(0,0,3,3).data;Qp=rd(e,0)||rd(e,4)||rd(e,8)}return Qp}()||c===id){p.moveTo(w,S);for(var O=x-w,R=b-S,I=0;I<4;I++)p.lineTo(w+d((I+1)*O/4),S+d(I*R/3)),3!=I&&p.lineTo(w+d((I+1)*O/4),S+d((I+1)*R/3));p.lineTo(C,T)}else p.moveTo(w,S),p.lineTo(x,b),p.lineTo(C,T);p.clip(),p.transform(P[0],P[2],P[1],P[3],x,b),p.translate(f[0]-E,f[3]-k),p.scale(n/i,-n/i),p.drawImage(m.canvas,0,0),p.restore()}})),h&&(p.save(),p.globalCompositeOperation="source-over",p.strokeStyle="black",p.lineWidth=1,a.getTriangles().forEach((function(t,e,i){var n=t.target,r=(n[0][0]-_[0])/o,s=-(n[0][1]-_[1])/o,a=(n[1][0]-_[0])/o,l=-(n[1][1]-_[1])/o,u=(n[2][0]-_[0])/o,h=-(n[2][1]-_[1])/o;p.beginPath(),p.moveTo(a,l),p.lineTo(r,s),p.lineTo(u,h),p.closePath(),p.stroke()})),p.restore()),p.canvas}var ad=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}(),ld=function(t){function e(e,i,n,r,o,s,a,l,u,h,c,p){var d=t.call(this,o,mo)||this;d.renderEdges_=void 0!==c&&c,d.contextOptions_=p,d.pixelRatio_=a,d.gutter_=l,d.canvas_=null,d.sourceTileGrid_=i,d.targetTileGrid_=r,d.wrappedTileCoord_=s||o,d.sourceTiles_=[],d.sourcesListenerKeys_=null,d.sourceZ_=0;var f=r.getTileCoordExtent(d.wrappedTileCoord_),y=d.targetTileGrid_.getExtent(),g=d.sourceTileGrid_.getExtent(),m=y?bn(f,y):f;if(0===fn(m))return d.state=bo,d;var v=e.getExtent();v&&(g=g?bn(g,v):v);var _=r.getResolution(d.wrappedTileCoord_[0]),x=function(t,e,i,n){var r=mn(i),o=od(t,e,r,n);return(!isFinite(o)||o<=0)&&dn(i,(function(i){return o=od(t,e,i,n),isFinite(o)&&o>0})),o}(e,n,m,_);if(!isFinite(x)||x<=0)return d.state=bo,d;var b=void 0!==h?h:.5;if(d.triangulation_=new ed(e,n,m,g,x*b,_),0===d.triangulation_.getTriangles().length)return d.state=bo,d;d.sourceZ_=i.getZForResolution(x);var w=d.triangulation_.calculateSourceExtent();if(g&&(e.canWrapX()?(w[1]=je(w[1],g[1],g[3]),w[3]=je(w[3],g[1],g[3])):w=bn(w,g)),fn(w)){for(var S=i.getTileRangeForExtentAndZ(w,d.sourceZ_),C=S.minX;C<=S.maxX;C++)for(var T=S.minY;T<=S.maxY;T++){var E=u(d.sourceZ_,C,T,a);E&&d.sourceTiles_.push(E)}0===d.sourceTiles_.length&&(d.state=bo)}else d.state=bo;return d}return ad(e,t),e.prototype.getImage=function(){return this.canvas_},e.prototype.reproject_=function(){var t=[];if(this.sourceTiles_.forEach(function(e,i,n){e&&e.getState()==_o&&t.push({extent:this.sourceTileGrid_.getTileCoordExtent(e.tileCoord),image:e.getImage()})}.bind(this)),this.sourceTiles_.length=0,0===t.length)this.state=xo;else{var e=this.wrappedTileCoord_[0],i=this.targetTileGrid_.getTileSize(e),n="number"==typeof i?i:i[0],r="number"==typeof i?i:i[1],o=this.targetTileGrid_.getResolution(e),s=this.sourceTileGrid_.getResolution(this.sourceZ_),a=this.targetTileGrid_.getTileCoordExtent(this.wrappedTileCoord_);this.canvas_=sd(n,r,this.pixelRatio_,s,this.sourceTileGrid_.getExtent(),o,a,this.triangulation_,t,this.gutter_,this.renderEdges_,this.contextOptions_),this.state=_o}this.changed()},e.prototype.load=function(){if(this.state==mo){this.state=vo,this.changed();var t=0;this.sourcesListenerKeys_=[],this.sourceTiles_.forEach(function(e,i,n){var r=e.getState();if(r==mo||r==vo){t++;var o=qt(e,It,(function(i){var n=e.getState();n!=_o&&n!=xo&&n!=bo||(Ut(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,i){t.getState()==mo&&t.load()}))}},e.prototype.unlistenSources_=function(){this.sourcesListenerKeys_.forEach(Ut),this.sourcesListenerKeys_=null},e}(gp),ud=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}();function hd(t,e){t.getImage().src=e}var cd=function(t){function e(e){var i=t.call(this,{attributions:e.attributions,cacheSize:e.cacheSize,opaque:e.opaque,projection:e.projection,state:e.state,tileGrid:e.tileGrid,tileLoadFunction:e.tileLoadFunction?e.tileLoadFunction:hd,tilePixelRatio:e.tilePixelRatio,tileUrlFunction:e.tileUrlFunction,url:e.url,urls:e.urls,wrapX:e.wrapX,transition:e.transition,key:e.key,attributionsCollapsible:e.attributionsCollapsible,zDirection:e.zDirection})||this;return i.crossOrigin=void 0!==e.crossOrigin?e.crossOrigin:null,i.tileClass=void 0!==e.tileClass?e.tileClass:td,i.tileCacheForProjection={},i.tileGridForProjection={},i.reprojectionErrorThreshold_=e.reprojectionErrorThreshold,i.contextOptions_=!1===e.imageSmoothing?id:void 0,i.renderReprojectionEdges_=!1,i}return ud(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 i=this.getTileCacheForProjection(t);for(var n in this.tileCache.expireCache(this.tileCache==i?e:{}),this.tileCacheForProjection){var r=this.tileCacheForProjection[n];r.expireCache(r==i?e:{})}},e.prototype.getContextOptions=function(){return this.contextOptions_},e.prototype.getGutterForProjection=function(t){return this.getProjection()&&t&&!er(this.getProjection(),t)?0:this.getGutter()},e.prototype.getGutter=function(){return 0},e.prototype.getKey=function(){return t.prototype.getKey.call(this)+(this.contextOptions_?"\n"+JSON.stringify(this.contextOptions_):"")},e.prototype.getOpaque=function(e){return!(this.getProjection()&&e&&!er(this.getProjection(),e))&&t.prototype.getOpaque.call(this,e)},e.prototype.getTileGridForProjection=function(t){var e=this.getProjection();if(!this.tileGrid||e&&!er(e,t)){var i=$t(t);return i in this.tileGridForProjection||(this.tileGridForProjection[i]=Ip(t)),this.tileGridForProjection[i]}return this.tileGrid},e.prototype.getTileCacheForProjection=function(t){var e=this.getProjection();if(!e||er(e,t))return this.tileCache;var i=$t(t);return i in this.tileCacheForProjection||(this.tileCacheForProjection[i]=new Tp(this.tileCache.highWaterMark)),this.tileCacheForProjection[i]},e.prototype.createTile_=function(t,e,i,n,r,o){var s=[t,e,i],a=this.getTileCoordForTileUrlFunction(s,r),l=a?this.tileUrlFunction(a,n,r):void 0,u=new this.tileClass(s,void 0!==l?mo:bo,void 0!==l?l:"",this.crossOrigin,this.tileLoadFunction,this.tileOptions);return u.key=o,u.addEventListener(It,this.handleTileChange.bind(this)),u},e.prototype.getTile=function(t,e,i,n,r){var o=this.getProjection();if(o&&r&&!er(o,r)){var s=this.getTileCacheForProjection(r),a=[t,e,i],l=void 0,u=wp(a);s.containsKey(u)&&(l=s.get(u));var h=this.getKey();if(l&&l.key==h)return l;var c=this.getTileGridForProjection(o),p=this.getTileGridForProjection(r),d=this.getTileCoordForTileUrlFunction(a,r),f=new ld(o,c,r,p,a,d,this.getTilePixelRatio(n),this.getGutter(),function(t,e,i,n){return this.getTileInternal(t,e,i,n,o)}.bind(this),this.reprojectionErrorThreshold_,this.renderReprojectionEdges_,this.contextOptions_);return f.key=h,l?(f.interimTile=l,f.refreshInterimChain(),s.replace(u,f)):s.set(u,f),f}return this.getTileInternal(t,e,i,n,o||r)},e.prototype.getTileInternal=function(t,e,i,n,r){var o=null,s=bp(t,e,i),a=this.getKey();if(this.tileCache.containsKey(s)){if((o=this.tileCache.get(s)).key!=a){var l=o;o=this.createTile_(t,e,i,n,r,a),l.getState()==mo?o.interimTile=l.interimTile:o.interimTile=l,o.refreshInterimChain(),this.tileCache.replace(s,o)}}else o=this.createTile_(t,e,i,n,r,a),this.tileCache.set(s,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 i=Hn(t);if(i){var n=$t(i);n in this.tileGridForProjection||(this.tileGridForProjection[n]=e)}},e}(qp),pd=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}(),dd=function(t){function e(e){var i=this,n=e||{},r=Ct({},n);return delete r.preload,delete r.useInterimTilesOnError,(i=t.call(this,r)||this).on,i.once,i.un,i.setPreload(void 0!==n.preload?n.preload:0),i.setUseInterimTilesOnError(void 0===n.useInterimTilesOnError||n.useInterimTilesOnError),i}return pd(e,t),e.prototype.getPreload=function(){return this.get(cp)},e.prototype.setPreload=function(t){this.set(cp,t)},e.prototype.getUseInterimTilesOnError=function(){return this.get(pp)},e.prototype.setUseInterimTilesOnError=function(t){this.set(pp,t)},e}(Je),fd=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}(),yd=function(t){function e(e){return t.call(this,e)||this}return fd(e,t),e.prototype.createRenderer=function(){return new np(this)},e}(dd),gd={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},md=/(italic|oblique)$/i,vd={},_d=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}(),xd=function(t){function e(e){var i=e||{},n=void 0!==i.projection?i.projection:"EPSG:3857",r=void 0!==i.tileGrid?i.tileGrid:Fp({extent:Ap(n),maxResolution:i.maxResolution,maxZoom:i.maxZoom,minZoom:i.minZoom,tileSize:i.tileSize});return t.call(this,{attributions:i.attributions,cacheSize:i.cacheSize,crossOrigin:i.crossOrigin,imageSmoothing:i.imageSmoothing,opaque:i.opaque,projection:n,reprojectionErrorThreshold:i.reprojectionErrorThreshold,tileGrid:r,tileLoadFunction:i.tileLoadFunction,tilePixelRatio:i.tilePixelRatio,tileUrlFunction:i.tileUrlFunction,url:i.url,urls:i.urls,wrapX:void 0===i.wrapX||i.wrapX,transition:i.transition,attributionsCollapsible:i.attributionsCollapsible,zDirection:i.zDirection})||this}return _d(e,t),e}(cd),bd=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}(),wd='© <a href="https://www.openstreetmap.org/copyright" target="_blank">OpenStreetMap</a> contributors.',Sd=function(t){function e(e){var i,n=e||{};i=void 0!==n.attributions?n.attributions:[wd];var r=void 0!==n.crossOrigin?n.crossOrigin:"anonymous",o=void 0!==n.url?n.url:"https://{a-c}.tile.openstreetmap.org/{z}/{x}/{y}.png";return t.call(this,{attributions:i,attributionsCollapsible:!1,cacheSize:n.cacheSize,crossOrigin:r,imageSmoothing:n.imageSmoothing,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:o,wrapX:n.wrapX,zDirection:n.zDirection})||this}return bd(e,t),e}(xd);const Cd=Array.isArray;function Td(t,e){if(1===arguments.length)return e=>Td(t,e);if(t<1)throw new Error("First argument to splitEvery must be a positive integer");const i=[];let n=0;for(;n<e.length;)i.push(e.slice(n,n+=t));return i}(function t(e,i=[]){return(...n)=>{return(r=[...i,...n]).length>=e.length?e(...r):t(e,r);var r}})((function(t,e,i){if(!Cd(i))throw new TypeError("reduce: list must be array or iterable");let n=0;const r=i.length;for(;n<r;)e=t(e,i[n],n,i),n++;return e}))((function t(e,i){return 1===arguments.length?i=>t(e,i):e*i}),1);const Ed=new Ec({features:[],wrapX:!1}),kd=new uc({source:Ed,style:new sl({image:new tl({radius:3,fill:new Pa({color:"grey"})})})});function Pd(t,e){return Td(2,t.getSource().getFeaturesInExtent(e).filter((t=>{var e;return"Point"!==(null==(e=t.getGeometry())?void 0:e.getType())})).flatMap((t=>t.flatCoordinates_))).forEach(((t,e)=>{Ed.addFeature(new Qs({geometry:new ys(t),i:e}))}))}const Od={color:"#ff0000",width:3},Rd=new Za(Od),Id=new Za(l(a({},Od),{lineDash:[2,8]})),Fd=new Pa({color:"rgba(255, 0, 0, 0.1)"}),jd=new Ja({stroke:new Za({color:"red",width:2}),points:4,radius1:15,radius2:1}),Md=new tl({radius:6,fill:new Pa({color:"#ff0000"})}),Ad=new sl({image:new Ja({fill:new Pa({color:"#fff"}),stroke:new Za({color:"#ff0000",width:2}),points:4,radius:5,angle:Math.PI/4}),geometry:function(t){const e=t.getGeometry();if(e instanceof Is){const t=e.getCoordinates()[0];return new ma(t)}}}),Ld=new Ec,Dd=new uc({source:Ld,style:[new sl({fill:Fd,stroke:Rd}),Ad]});const zd=new Hc({source:Ed,pixelTolerance:15});
|
33
31
|
/**
|
34
32
|
* splaytree v3.1.0
|
35
33
|
* Fast Splay tree for Node and browser
|
@@ -38,7 +36,9 @@ _d((function(t,e){!function(i){var n=e&&!e.nodeType&&e,r=t&&!t.nodeType&&t,o="ob
|
|
38
36
|
* @license MIT
|
39
37
|
* @preserve
|
40
38
|
*/
|
41
|
-
var tm=function(t,e){this.next=null,this.key=t,this.data=e,this.left=null,this.right=null};function em(t,e){return t>e?1:t<e?-1:0}function im(t,e,i){for(var n=new tm(null,null),r=n,o=n;;){var s=i(t,e.key);if(s<0){if(null===e.left)break;if(i(t,e.left.key)<0){var a=e.left;if(e.left=a.right,a.right=e,null===(e=a).left)break}o.left=e,o=e,e=e.left}else{if(!(s>0))break;if(null===e.right)break;if(i(t,e.right.key)>0){a=e.right;if(e.right=a.left,a.left=e,null===(e=a).right)break}r.right=e,r=e,e=e.right}}return r.right=e.left,o.left=e.right,e.left=n.right,e.right=n.left,e}function nm(t,e,i,n){var r=new tm(t,e);if(null===i)return r.left=r.right=null,r;var o=n(t,(i=im(t,i,n)).key);return o<0?(r.left=i.left,r.right=i,i.left=null):o>=0&&(r.right=i.right,r.left=i,i.right=null),r}function rm(t,e,i){var n=null,r=null;if(e){var o=i((e=im(t,e,i)).key,t);0===o?(n=e.left,r=e.right):o<0?(r=e.right,e.right=null,n=e):(n=e.left,e.left=null,r=e)}return{left:n,right:r}}function om(t,e,i,n,r){if(t){n(e+(i?"└── ":"├── ")+r(t)+"\n");var o=e+(i?" ":"│ ");t.left&&om(t.left,o,!1,n,r),t.right&&om(t.right,o,!0,n,r)}}var sm=function(){function t(t){void 0===t&&(t=em),this._root=null,this._size=0,this._comparator=t}return t.prototype.insert=function(t,e){return this._size++,this._root=nm(t,e,this._root,this._comparator)},t.prototype.add=function(t,e){var i=new tm(t,e);null===this._root&&(i.left=i.right=null,this._size++,this._root=i);var n=this._comparator,r=im(t,this._root,n),o=n(t,r.key);return 0===o?this._root=r:(o<0?(i.left=r.left,i.right=r,r.left=null):o>0&&(i.right=r.right,i.left=r,r.right=null),this._size++,this._root=i),this._root},t.prototype.remove=function(t){this._root=this._remove(t,this._root,this._comparator)},t.prototype._remove=function(t,e,i){var n;return null===e?null:0===i(t,(e=im(t,e,i)).key)?(null===e.left?n=e.right:(n=im(t,e.left,i)).right=e.right,this._size--,n):e},t.prototype.pop=function(){var t=this._root;if(t){for(;t.left;)t=t.left;return this._root=im(t.key,this._root,this._comparator),this._root=this._remove(t.key,this._root,this._comparator),{key:t.key,data:t.data}}return null},t.prototype.findStatic=function(t){for(var e=this._root,i=this._comparator;e;){var n=i(t,e.key);if(0===n)return e;e=n<0?e.left:e.right}return null},t.prototype.find=function(t){return this._root&&(this._root=im(t,this._root,this._comparator),0!==this._comparator(t,this._root.key))?null:this._root},t.prototype.contains=function(t){for(var e=this._root,i=this._comparator;e;){var n=i(t,e.key);if(0===n)return!0;e=n<0?e.left:e.right}return!1},t.prototype.forEach=function(t,e){for(var i=this._root,n=[],r=!1;!r;)null!==i?(n.push(i),i=i.left):0!==n.length?(i=n.pop(),t.call(e,i),i=i.right):r=!0;return this},t.prototype.range=function(t,e,i,n){for(var r=[],o=this._comparator,s=this._root;0!==r.length||s;)if(s)r.push(s),s=s.left;else{if(o((s=r.pop()).key,e)>0)break;if(o(s.key,t)>=0&&i.call(n,s))return this;s=s.right}return this},t.prototype.keys=function(){var t=[];return this.forEach((function(e){var i=e.key;return t.push(i)})),t},t.prototype.values=function(){var t=[];return this.forEach((function(e){var i=e.data;return t.push(i)})),t},t.prototype.min=function(){return this._root?this.minNode(this._root).key:null},t.prototype.max=function(){return this._root?this.maxNode(this._root).key:null},t.prototype.minNode=function(t){if(void 0===t&&(t=this._root),t)for(;t.left;)t=t.left;return t},t.prototype.maxNode=function(t){if(void 0===t&&(t=this._root),t)for(;t.right;)t=t.right;return t},t.prototype.at=function(t){for(var e=this._root,i=!1,n=0,r=[];!i;)if(e)r.push(e),e=e.left;else if(r.length>0){if(e=r.pop(),n===t)return e;n++,e=e.right}else i=!0;return null},t.prototype.next=function(t){var e=this._root,i=null;if(t.right){for(i=t.right;i.left;)i=i.left;return i}for(var n=this._comparator;e;){var r=n(t.key,e.key);if(0===r)break;r<0?(i=e,e=e.left):e=e.right}return i},t.prototype.prev=function(t){var e=this._root,i=null;if(null!==t.left){for(i=t.left;i.right;)i=i.right;return i}for(var n=this._comparator;e;){var r=n(t.key,e.key);if(0===r)break;r<0?e=e.left:(i=e,e=e.right)}return i},t.prototype.clear=function(){return this._root=null,this._size=0,this},t.prototype.toList=function(){return function(t){var e=t,i=[],n=!1,r=new tm(null,null),o=r;for(;!n;)e?(i.push(e),e=e.left):i.length>0?e=(e=o=o.next=i.pop()).right:n=!0;return o.next=null,r.next}(this._root)},t.prototype.load=function(t,e,i){void 0===e&&(e=[]),void 0===i&&(i=!1);var n=t.length,r=this._comparator;if(i&&um(t,e,0,n-1,r),null===this._root)this._root=am(t,e,0,n),this._size=n;else{var o=function(t,e,i){var n=new tm(null,null),r=n,o=t,s=e;for(;null!==o&&null!==s;)i(o.key,s.key)<0?(r.next=o,o=o.next):(r.next=s,s=s.next),r=r.next;null!==o?r.next=o:null!==s&&(r.next=s);return n.next}(this.toList(),function(t,e){for(var i=new tm(null,null),n=i,r=0;r<t.length;r++)n=n.next=new tm(t[r],e[r]);return n.next=null,i.next}(t,e),r);n=this._size+n,this._root=lm({head:o},0,n)}return this},t.prototype.isEmpty=function(){return null===this._root},Object.defineProperty(t.prototype,"size",{get:function(){return this._size},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"root",{get:function(){return this._root},enumerable:!0,configurable:!0}),t.prototype.toString=function(t){void 0===t&&(t=function(t){return String(t.key)});var e=[];return om(this._root,"",!0,(function(t){return e.push(t)}),t),e.join("")},t.prototype.update=function(t,e,i){var n=this._comparator,r=rm(t,this._root,n),o=r.left,s=r.right;n(t,e)<0?s=nm(e,i,s,n):o=nm(e,i,o,n),this._root=function(t,e,i){return null===e?t:(null===t||((e=im(t.key,e,i)).left=t),e)}(o,s,n)},t.prototype.split=function(t){return rm(t,this._root,this._comparator)},t}();function am(t,e,i,n){var r=n-i;if(r>0){var o=i+Math.floor(r/2),s=t[o],a=e[o],l=new tm(s,a);return l.left=am(t,e,i,o),l.right=am(t,e,o+1,n),l}return null}function lm(t,e,i){var n=i-e;if(n>0){var r=e+Math.floor(n/2),o=lm(t,e,r),s=t.head;return s.left=o,t.head=t.head.next,s.right=lm(t,r+1,i),s}return null}function um(t,e,i,n,r){if(!(i>=n)){for(var o=t[i+n>>1],s=i-1,a=n+1;;){do{s++}while(r(t[s],o)<0);do{a--}while(r(t[a],o)>0);if(s>=a)break;var l=t[s];t[s]=t[a],t[a]=l,l=e[s],e[s]=e[a],e[a]=l}um(t,e,i,a,r),um(t,e,a+1,n,r)}}function hm(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function cm(t,e){for(var i=0;i<e.length;i++){var n=e[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function pm(t,e,i){return e&&cm(t.prototype,e),i&&cm(t,i),t}var dm=function(t,e){return t.ll.x<=e.x&&e.x<=t.ur.x&&t.ll.y<=e.y&&e.y<=t.ur.y},fm=function(t,e){if(e.ur.x<t.ll.x||t.ur.x<e.ll.x||e.ur.y<t.ll.y||t.ur.y<e.ll.y)return null;var i=t.ll.x<e.ll.x?e.ll.x:t.ll.x,n=t.ur.x<e.ur.x?t.ur.x:e.ur.x;return{ll:{x:i,y:t.ll.y<e.ll.y?e.ll.y:t.ll.y},ur:{x:n,y:t.ur.y<e.ur.y?t.ur.y:e.ur.y}}},ym=Number.EPSILON;void 0===ym&&(ym=Math.pow(2,-52));var gm=ym*ym,mm=function(t,e){if(-ym<t&&t<ym&&-ym<e&&e<ym)return 0;var i=t-e;return i*i<gm*t*e?0:t<e?-1:1},vm=function(){function t(){hm(this,t),this.reset()}return pm(t,[{key:"reset",value:function(){this.xRounder=new _m,this.yRounder=new _m}},{key:"round",value:function(t,e){return{x:this.xRounder.round(t),y:this.yRounder.round(e)}}}]),t}(),_m=function(){function t(){hm(this,t),this.tree=new sm,this.round(0)}return pm(t,[{key:"round",value:function(t){var e=this.tree.add(t),i=this.tree.prev(e);if(null!==i&&0===mm(e.key,i.key))return this.tree.remove(t),i.key;var n=this.tree.next(e);return null!==n&&0===mm(e.key,n.key)?(this.tree.remove(t),n.key):t}}]),t}(),xm=new vm,bm=function(t,e){return t.x*e.y-t.y*e.x},wm=function(t,e){return t.x*e.x+t.y*e.y},Sm=function(t,e,i){var n={x:e.x-t.x,y:e.y-t.y},r={x:i.x-t.x,y:i.y-t.y},o=bm(n,r);return mm(o,0)},Cm=function(t){return Math.sqrt(wm(t,t))},Tm=function(t,e,i){var n={x:e.x-t.x,y:e.y-t.y},r={x:i.x-t.x,y:i.y-t.y};return wm(r,n)/Cm(r)/Cm(n)},Em=function(t,e,i){return 0===e.y?null:{x:t.x+e.x/e.y*(i-t.y),y:i}},km=function(t,e,i){return 0===e.x?null:{x:i,y:t.y+e.y/e.x*(i-t.x)}},Pm=function(){function t(e,i){hm(this,t),void 0===e.events?e.events=[this]:e.events.push(this),this.point=e,this.isLeft=i}return pm(t,null,[{key:"compare",value:function(e,i){var n=t.comparePoints(e.point,i.point);return 0!==n?n:(e.point!==i.point&&e.link(i),e.isLeft!==i.isLeft?e.isLeft?1:-1:Rm.compare(e.segment,i.segment))}},{key:"comparePoints",value:function(t,e){return t.x<e.x?-1:t.x>e.x?1:t.y<e.y?-1:t.y>e.y?1:0}}]),pm(t,[{key:"link",value:function(t){if(t.point===this.point)throw new Error("Tried to link already linked events");for(var e=t.point.events,i=0,n=e.length;i<n;i++){var r=e[i];this.point.events.push(r),r.point=this.point}this.checkForConsuming()}},{key:"checkForConsuming",value:function(){for(var t=this.point.events.length,e=0;e<t;e++){var i=this.point.events[e];if(void 0===i.segment.consumedBy)for(var n=e+1;n<t;n++){var r=this.point.events[n];void 0===r.consumedBy&&(i.otherSE.point.events===r.otherSE.point.events&&i.segment.consume(r.segment))}}}},{key:"getAvailableLinkedEvents",value:function(){for(var t=[],e=0,i=this.point.events.length;e<i;e++){var n=this.point.events[e];n!==this&&!n.segment.ringOut&&n.segment.isInResult()&&t.push(n)}return t}},{key:"getLeftmostComparator",value:function(t){var e=this,i=new Map,n=function(n){var r,o,s,a,l,u=n.otherSE;i.set(n,{sine:(r=e.point,o=t.point,s=u.point,a={x:o.x-r.x,y:o.y-r.y},l={x:s.x-r.x,y:s.y-r.y},bm(l,a)/Cm(l)/Cm(a)),cosine:Tm(e.point,t.point,u.point)})};return function(t,e){i.has(t)||n(t),i.has(e)||n(e);var r=i.get(t),o=r.sine,s=r.cosine,a=i.get(e),l=a.sine,u=a.cosine;return o>=0&&l>=0?s<u?1:s>u?-1:0:o<0&&l<0?s<u?-1:s>u?1:0:l<o?-1:l>o?1:0}}}]),t}(),Om=0,Rm=function(){function t(e,i,n,r){hm(this,t),this.id=++Om,this.leftSE=e,e.segment=this,e.otherSE=i,this.rightSE=i,i.segment=this,i.otherSE=e,this.rings=n,this.windings=r}return pm(t,null,[{key:"compare",value:function(t,e){var i=t.leftSE.point.x,n=e.leftSE.point.x,r=t.rightSE.point.x,o=e.rightSE.point.x;if(o<i)return 1;if(r<n)return-1;var s=t.leftSE.point.y,a=e.leftSE.point.y,l=t.rightSE.point.y,u=e.rightSE.point.y;if(i<n){if(a<s&&a<l)return 1;if(a>s&&a>l)return-1;var h=t.comparePoint(e.leftSE.point);if(h<0)return 1;if(h>0)return-1;var c=e.comparePoint(t.rightSE.point);return 0!==c?c:-1}if(i>n){if(s<a&&s<u)return-1;if(s>a&&s>u)return 1;var p=e.comparePoint(t.leftSE.point);if(0!==p)return p;var d=t.comparePoint(e.rightSE.point);return d<0?1:d>0?-1:1}if(s<a)return-1;if(s>a)return 1;if(r<o){var f=e.comparePoint(t.rightSE.point);if(0!==f)return f}if(r>o){var y=t.comparePoint(e.rightSE.point);if(y<0)return 1;if(y>0)return-1}if(r!==o){var g=l-s,m=r-i,v=u-a,_=o-n;if(g>m&&v<_)return 1;if(g<m&&v>_)return-1}return r>o?1:r<o||l<u?-1:l>u?1:t.id<e.id?-1:t.id>e.id?1:0}}]),pm(t,[{key:"replaceRightSE",value:function(t){this.rightSE=t,this.rightSE.segment=this,this.rightSE.otherSE=this.leftSE,this.leftSE.otherSE=this.rightSE}},{key:"bbox",value:function(){var t=this.leftSE.point.y,e=this.rightSE.point.y;return{ll:{x:this.leftSE.point.x,y:t<e?t:e},ur:{x:this.rightSE.point.x,y:t>e?t:e}}}},{key:"vector",value:function(){return{x:this.rightSE.point.x-this.leftSE.point.x,y:this.rightSE.point.y-this.leftSE.point.y}}},{key:"isAnEndpoint",value:function(t){return t.x===this.leftSE.point.x&&t.y===this.leftSE.point.y||t.x===this.rightSE.point.x&&t.y===this.rightSE.point.y}},{key:"comparePoint",value:function(t){if(this.isAnEndpoint(t))return 0;var e=this.leftSE.point,i=this.rightSE.point,n=this.vector();if(e.x===i.x)return t.x===e.x?0:t.x<e.x?1:-1;var r=(t.y-e.y)/n.y,o=e.x+r*n.x;if(t.x===o)return 0;var s=(t.x-e.x)/n.x,a=e.y+s*n.y;return t.y===a?0:t.y<a?-1:1}},{key:"getIntersection",value:function(t){var e=this.bbox(),i=t.bbox(),n=fm(e,i);if(null===n)return null;var r=this.leftSE.point,o=this.rightSE.point,s=t.leftSE.point,a=t.rightSE.point,l=dm(e,s)&&0===this.comparePoint(s),u=dm(i,r)&&0===t.comparePoint(r),h=dm(e,a)&&0===this.comparePoint(a),c=dm(i,o)&&0===t.comparePoint(o);if(u&&l)return c&&!h?o:!c&&h?a:null;if(u)return h&&r.x===a.x&&r.y===a.y?null:r;if(l)return c&&o.x===s.x&&o.y===s.y?null:s;if(c&&h)return null;if(c)return o;if(h)return a;var p=function(t,e,i,n){if(0===e.x)return km(i,n,t.x);if(0===n.x)return km(t,e,i.x);if(0===e.y)return Em(i,n,t.y);if(0===n.y)return Em(t,e,i.y);var r=bm(e,n);if(0==r)return null;var o={x:i.x-t.x,y:i.y-t.y},s=bm(o,e)/r,a=bm(o,n)/r;return{x:(t.x+a*e.x+(i.x+s*n.x))/2,y:(t.y+a*e.y+(i.y+s*n.y))/2}}(r,this.vector(),s,t.vector());return null===p?null:dm(n,p)?xm.round(p.x,p.y):null}},{key:"split",value:function(e){var i=[],n=void 0!==e.events,r=new Pm(e,!0),o=new Pm(e,!1),s=this.rightSE;this.replaceRightSE(o),i.push(o),i.push(r);var a=new t(r,s,this.rings.slice(),this.windings.slice());return Pm.comparePoints(a.leftSE.point,a.rightSE.point)>0&&a.swapEvents(),Pm.comparePoints(this.leftSE.point,this.rightSE.point)>0&&this.swapEvents(),n&&(r.checkForConsuming(),o.checkForConsuming()),i}},{key:"swapEvents",value:function(){var t=this.rightSE;this.rightSE=this.leftSE,this.leftSE=t,this.leftSE.isLeft=!0,this.rightSE.isLeft=!1;for(var e=0,i=this.windings.length;e<i;e++)this.windings[e]*=-1}},{key:"consume",value:function(e){for(var i=this,n=e;i.consumedBy;)i=i.consumedBy;for(;n.consumedBy;)n=n.consumedBy;var r=t.compare(i,n);if(0!==r){if(r>0){var o=i;i=n,n=o}if(i.prev===n){var s=i;i=n,n=s}for(var a=0,l=n.rings.length;a<l;a++){var u=n.rings[a],h=n.windings[a],c=i.rings.indexOf(u);-1===c?(i.rings.push(u),i.windings.push(h)):i.windings[c]+=h}n.rings=null,n.windings=null,n.consumedBy=i,n.leftSE.consumedBy=i.leftSE,n.rightSE.consumedBy=i.rightSE}}},{key:"prevInResult",value:function(){return void 0!==this._prevInResult||(this.prev?this.prev.isInResult()?this._prevInResult=this.prev:this._prevInResult=this.prev.prevInResult():this._prevInResult=null),this._prevInResult}},{key:"beforeState",value:function(){if(void 0!==this._beforeState)return this._beforeState;if(this.prev){var t=this.prev.consumedBy||this.prev;this._beforeState=t.afterState()}else this._beforeState={rings:[],windings:[],multiPolys:[]};return this._beforeState}},{key:"afterState",value:function(){if(void 0!==this._afterState)return this._afterState;var t=this.beforeState();this._afterState={rings:t.rings.slice(0),windings:t.windings.slice(0),multiPolys:[]};for(var e=this._afterState.rings,i=this._afterState.windings,n=this._afterState.multiPolys,r=0,o=this.rings.length;r<o;r++){var s=this.rings[r],a=this.windings[r],l=e.indexOf(s);-1===l?(e.push(s),i.push(a)):i[l]+=a}for(var u=[],h=[],c=0,p=e.length;c<p;c++)if(0!==i[c]){var d=e[c],f=d.poly;if(-1===h.indexOf(f))if(d.isExterior)u.push(f);else{-1===h.indexOf(f)&&h.push(f);var y=u.indexOf(d.poly);-1!==y&&u.splice(y,1)}}for(var g=0,m=u.length;g<m;g++){var v=u[g].multiPoly;-1===n.indexOf(v)&&n.push(v)}return this._afterState}},{key:"isInResult",value:function(){if(this.consumedBy)return!1;if(void 0!==this._isInResult)return this._isInResult;var t=this.beforeState().multiPolys,e=this.afterState().multiPolys;switch(Nm.type){case"union":var i=0===t.length,n=0===e.length;this._isInResult=i!==n;break;case"intersection":var r,o;t.length<e.length?(r=t.length,o=e.length):(r=e.length,o=t.length),this._isInResult=o===Nm.numMultiPolys&&r<o;break;case"xor":var s=Math.abs(t.length-e.length);this._isInResult=s%2==1;break;case"difference":var a=function(t){return 1===t.length&&t[0].isSubject};this._isInResult=a(t)!==a(e);break;default:throw new Error("Unrecognized operation type found ".concat(Nm.type))}return this._isInResult}}],[{key:"fromRing",value:function(e,i,n){var r,o,s,a=Pm.comparePoints(e,i);if(a<0)r=e,o=i,s=1;else{if(!(a>0))throw new Error("Tried to create degenerate segment at [".concat(e.x,", ").concat(e.y,"]"));r=i,o=e,s=-1}return new t(new Pm(r,!0),new Pm(o,!1),[n],[s])}}]),t}(),Im=function(){function t(e,i,n){if(hm(this,t),!Array.isArray(e)||0===e.length)throw new Error("Input geometry is not a valid Polygon or MultiPolygon");if(this.poly=i,this.isExterior=n,this.segments=[],"number"!=typeof e[0][0]||"number"!=typeof e[0][1])throw new Error("Input geometry is not a valid Polygon or MultiPolygon");var r=xm.round(e[0][0],e[0][1]);this.bbox={ll:{x:r.x,y:r.y},ur:{x:r.x,y:r.y}};for(var o=r,s=1,a=e.length;s<a;s++){if("number"!=typeof e[s][0]||"number"!=typeof e[s][1])throw new Error("Input geometry is not a valid Polygon or MultiPolygon");var l=xm.round(e[s][0],e[s][1]);l.x===o.x&&l.y===o.y||(this.segments.push(Rm.fromRing(o,l,this)),l.x<this.bbox.ll.x&&(this.bbox.ll.x=l.x),l.y<this.bbox.ll.y&&(this.bbox.ll.y=l.y),l.x>this.bbox.ur.x&&(this.bbox.ur.x=l.x),l.y>this.bbox.ur.y&&(this.bbox.ur.y=l.y),o=l)}r.x===o.x&&r.y===o.y||this.segments.push(Rm.fromRing(o,r,this))}return pm(t,[{key:"getSweepEvents",value:function(){for(var t=[],e=0,i=this.segments.length;e<i;e++){var n=this.segments[e];t.push(n.leftSE),t.push(n.rightSE)}return t}}]),t}(),Fm=function(){function t(e,i){if(hm(this,t),!Array.isArray(e))throw new Error("Input geometry is not a valid Polygon or MultiPolygon");this.exteriorRing=new Im(e[0],this,!0),this.bbox={ll:{x:this.exteriorRing.bbox.ll.x,y:this.exteriorRing.bbox.ll.y},ur:{x:this.exteriorRing.bbox.ur.x,y:this.exteriorRing.bbox.ur.y}},this.interiorRings=[];for(var n=1,r=e.length;n<r;n++){var o=new Im(e[n],this,!1);o.bbox.ll.x<this.bbox.ll.x&&(this.bbox.ll.x=o.bbox.ll.x),o.bbox.ll.y<this.bbox.ll.y&&(this.bbox.ll.y=o.bbox.ll.y),o.bbox.ur.x>this.bbox.ur.x&&(this.bbox.ur.x=o.bbox.ur.x),o.bbox.ur.y>this.bbox.ur.y&&(this.bbox.ur.y=o.bbox.ur.y),this.interiorRings.push(o)}this.multiPoly=i}return pm(t,[{key:"getSweepEvents",value:function(){for(var t=this.exteriorRing.getSweepEvents(),e=0,i=this.interiorRings.length;e<i;e++)for(var n=this.interiorRings[e].getSweepEvents(),r=0,o=n.length;r<o;r++)t.push(n[r]);return t}}]),t}(),jm=function(){function t(e,i){if(hm(this,t),!Array.isArray(e))throw new Error("Input geometry is not a valid Polygon or MultiPolygon");try{"number"==typeof e[0][0][0]&&(e=[e])}catch(s){}this.polys=[],this.bbox={ll:{x:Number.POSITIVE_INFINITY,y:Number.POSITIVE_INFINITY},ur:{x:Number.NEGATIVE_INFINITY,y:Number.NEGATIVE_INFINITY}};for(var n=0,r=e.length;n<r;n++){var o=new Fm(e[n],this);o.bbox.ll.x<this.bbox.ll.x&&(this.bbox.ll.x=o.bbox.ll.x),o.bbox.ll.y<this.bbox.ll.y&&(this.bbox.ll.y=o.bbox.ll.y),o.bbox.ur.x>this.bbox.ur.x&&(this.bbox.ur.x=o.bbox.ur.x),o.bbox.ur.y>this.bbox.ur.y&&(this.bbox.ur.y=o.bbox.ur.y),this.polys.push(o)}this.isSubject=i}return pm(t,[{key:"getSweepEvents",value:function(){for(var t=[],e=0,i=this.polys.length;e<i;e++)for(var n=this.polys[e].getSweepEvents(),r=0,o=n.length;r<o;r++)t.push(n[r]);return t}}]),t}(),Mm=function(){function t(e){hm(this,t),this.events=e;for(var i=0,n=e.length;i<n;i++)e[i].segment.ringOut=this;this.poly=null}return pm(t,null,[{key:"factory",value:function(e){for(var i=[],n=0,r=e.length;n<r;n++){var o=e[n];if(o.isInResult()&&!o.ringOut){for(var s=null,a=o.leftSE,l=o.rightSE,u=[a],h=a.point,c=[];s=a,a=l,u.push(a),a.point!==h;)for(;;){var p=a.getAvailableLinkedEvents();if(0===p.length){var d=u[0].point,f=u[u.length-1].point;throw new Error("Unable to complete output ring starting at [".concat(d.x,",")+" ".concat(d.y,"]. Last matching segment found ends at")+" [".concat(f.x,", ").concat(f.y,"]."))}if(1===p.length){l=p[0].otherSE;break}for(var y=null,g=0,m=c.length;g<m;g++)if(c[g].point===a.point){y=g;break}if(null===y){c.push({index:u.length,point:a.point});var v=a.getLeftmostComparator(s);l=p.sort(v)[0].otherSE;break}var _=c.splice(y)[0],x=u.splice(_.index);x.unshift(x[0].otherSE),i.push(new t(x.reverse()))}i.push(new t(u))}}return i}}]),pm(t,[{key:"getGeom",value:function(){for(var t=this.events[0].point,e=[t],i=1,n=this.events.length-1;i<n;i++){var r=this.events[i].point,o=this.events[i+1].point;0!==Sm(r,t,o)&&(e.push(r),t=r)}if(1===e.length)return null;var s=e[0],a=e[1];0===Sm(s,t,a)&&e.shift(),e.push(e[0]);for(var l=this.isExteriorRing()?1:-1,u=this.isExteriorRing()?0:e.length-1,h=this.isExteriorRing()?e.length:-1,c=[],p=u;p!=h;p+=l)c.push([e[p].x,e[p].y]);return c}},{key:"isExteriorRing",value:function(){if(void 0===this._isExteriorRing){var t=this.enclosingRing();this._isExteriorRing=!t||!t.isExteriorRing()}return this._isExteriorRing}},{key:"enclosingRing",value:function(){return void 0===this._enclosingRing&&(this._enclosingRing=this._calcEnclosingRing()),this._enclosingRing}},{key:"_calcEnclosingRing",value:function(){for(var t=this.events[0],e=1,i=this.events.length;e<i;e++){var n=this.events[e];Pm.compare(t,n)>0&&(t=n)}for(var r=t.segment.prevInResult(),o=r?r.prevInResult():null;;){if(!r)return null;if(!o)return r.ringOut;if(o.ringOut!==r.ringOut)return o.ringOut.enclosingRing()!==r.ringOut?r.ringOut:r.ringOut.enclosingRing();r=o.prevInResult(),o=r?r.prevInResult():null}}}]),t}(),Am=function(){function t(e){hm(this,t),this.exteriorRing=e,e.poly=this,this.interiorRings=[]}return pm(t,[{key:"addInterior",value:function(t){this.interiorRings.push(t),t.poly=this}},{key:"getGeom",value:function(){var t=[this.exteriorRing.getGeom()];if(null===t[0])return null;for(var e=0,i=this.interiorRings.length;e<i;e++){var n=this.interiorRings[e].getGeom();null!==n&&t.push(n)}return t}}]),t}(),Lm=function(){function t(e){hm(this,t),this.rings=e,this.polys=this._composePolys(e)}return pm(t,[{key:"getGeom",value:function(){for(var t=[],e=0,i=this.polys.length;e<i;e++){var n=this.polys[e].getGeom();null!==n&&t.push(n)}return t}},{key:"_composePolys",value:function(t){for(var e=[],i=0,n=t.length;i<n;i++){var r=t[i];if(!r.poly)if(r.isExteriorRing())e.push(new Am(r));else{var o=r.enclosingRing();o.poly||e.push(new Am(o)),o.poly.addInterior(r)}}return e}}]),t}(),zm=function(){function t(e){var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Rm.compare;hm(this,t),this.queue=e,this.tree=new sm(i),this.segments=[]}return pm(t,[{key:"process",value:function(t){var e=t.segment,i=[];if(t.consumedBy)return t.isLeft?this.queue.remove(t.otherSE):this.tree.remove(e),i;var n=t.isLeft?this.tree.insert(e):this.tree.find(e);if(!n)throw new Error("Unable to find segment #".concat(e.id," ")+"[".concat(e.leftSE.point.x,", ").concat(e.leftSE.point.y,"] -> ")+"[".concat(e.rightSE.point.x,", ").concat(e.rightSE.point.y,"] ")+"in SweepLine tree. Please submit a bug report.");for(var r=n,o=n,s=void 0,a=void 0;void 0===s;)null===(r=this.tree.prev(r))?s=null:void 0===r.key.consumedBy&&(s=r.key);for(;void 0===a;)null===(o=this.tree.next(o))?a=null:void 0===o.key.consumedBy&&(a=o.key);if(t.isLeft){var l=null;if(s){var u=s.getIntersection(e);if(null!==u&&(e.isAnEndpoint(u)||(l=u),!s.isAnEndpoint(u)))for(var h=this._splitSafely(s,u),c=0,p=h.length;c<p;c++)i.push(h[c])}var d=null;if(a){var f=a.getIntersection(e);if(null!==f&&(e.isAnEndpoint(f)||(d=f),!a.isAnEndpoint(f)))for(var y=this._splitSafely(a,f),g=0,m=y.length;g<m;g++)i.push(y[g])}if(null!==l||null!==d){var v=null;if(null===l)v=d;else if(null===d)v=l;else{v=Pm.comparePoints(l,d)<=0?l:d}this.queue.remove(e.rightSE),i.push(e.rightSE);for(var _=e.split(v),x=0,b=_.length;x<b;x++)i.push(_[x])}i.length>0?(this.tree.remove(e),i.push(t)):(this.segments.push(e),e.prev=s)}else{if(s&&a){var w=s.getIntersection(a);if(null!==w){if(!s.isAnEndpoint(w))for(var S=this._splitSafely(s,w),C=0,T=S.length;C<T;C++)i.push(S[C]);if(!a.isAnEndpoint(w))for(var E=this._splitSafely(a,w),k=0,P=E.length;k<P;k++)i.push(E[k])}}this.tree.remove(e)}return i}},{key:"_splitSafely",value:function(t,e){this.tree.remove(t);var i=t.rightSE;this.queue.remove(i);var n=t.split(e);return n.push(i),void 0===t.consumedBy&&this.tree.insert(t),n}}]),t}(),Dm="undefined"!=typeof process&&{}.POLYGON_CLIPPING_MAX_QUEUE_SIZE||1e6,Gm="undefined"!=typeof process&&{}.POLYGON_CLIPPING_MAX_SWEEPLINE_SEGMENTS||1e6,Nm=new(function(){function t(){hm(this,t)}return pm(t,[{key:"run",value:function(t,e,i){Nm.type=t,xm.reset();for(var n=[new jm(e,!0)],r=0,o=i.length;r<o;r++)n.push(new jm(i[r],!1));if(Nm.numMultiPolys=n.length,"difference"===Nm.type)for(var s=n[0],a=1;a<n.length;)null!==fm(n[a].bbox,s.bbox)?a++:n.splice(a,1);if("intersection"===Nm.type)for(var l=0,u=n.length;l<u;l++)for(var h=n[l],c=l+1,p=n.length;c<p;c++)if(null===fm(h.bbox,n[c].bbox))return[];for(var d=new sm(Pm.compare),f=0,y=n.length;f<y;f++)for(var g=n[f].getSweepEvents(),m=0,v=g.length;m<v;m++)if(d.insert(g[m]),d.size>Dm)throw new Error("Infinite loop when putting segment endpoints in a priority queue (queue size too big). Please file a bug report.");for(var _=new zm(d),x=d.size,b=d.pop();b;){var w=b.key;if(d.size===x){var S=w.segment;throw new Error("Unable to pop() ".concat(w.isLeft?"left":"right"," SweepEvent ")+"[".concat(w.point.x,", ").concat(w.point.y,"] from segment #").concat(S.id," ")+"[".concat(S.leftSE.point.x,", ").concat(S.leftSE.point.y,"] -> ")+"[".concat(S.rightSE.point.x,", ").concat(S.rightSE.point.y,"] from queue. ")+"Please file a bug report.")}if(d.size>Dm)throw new Error("Infinite loop when passing sweep line over endpoints (queue size too big). Please file a bug report.");if(_.segments.length>Gm)throw new Error("Infinite loop when passing sweep line over endpoints (too many sweep line segments). Please file a bug report.");for(var C=_.process(w),T=0,E=C.length;T<E;T++){var k=C[T];void 0===k.consumedBy&&d.insert(k)}x=d.size,b=d.pop()}xm.reset();var P=Mm.factory(_.segments);return new Lm(P).getGeom()}}]),t}()),Bm=function(t){for(var e=arguments.length,i=new Array(e>1?e-1:0),n=1;n<e;n++)i[n-1]=arguments[n];return Nm.run("union",t,i)};function Wm(t,e,i){void 0===i&&(i={});var n={type:"Feature"};return(0===i.id||i.id)&&(n.id=i.id),i.bbox&&(n.bbox=i.bbox),n.properties=e||{},n.geometry=t,n}function qm(t){return"Feature"===t.type?t.geometry:t}function Vm(t,e,i){void 0===i&&(i={});var n=qm(t),r=qm(e),o=Bm(n.coordinates,r.coordinates);return 0===o.length?null:1===o.length?function(t,e,i){void 0===i&&(i={});for(var n=0,r=t;n<r.length;n++){var o=r[n];if(o.length<4)throw new Error("Each LinearRing of a Polygon must have 4 or more Positions.");for(var s=0;s<o[o.length-1].length;s++)if(o[o.length-1][s]!==o[0][s])throw new Error("First and last Position are not equivalent.")}return Wm({type:"Polygon",coordinates:t},e,i)}(o[0],i.properties):function(t,e,i){return void 0===i&&(i={}),Wm({type:"MultiPolygon",coordinates:t},e,i)}(o,i.properties)}function Um(t,e){const i=Dn(t),n=Math.round(100*i)/100;let r;return"m2"===e?r=n+" m²":"ha"===e&&(r=n/1e4+" ha"),r}function Xm(t,e,i){const n=e.getExtent();return t.getView().fit(Yi(n,i))}function Km(t,e){const[i,n,r]=Array.from(kr(t));return Sr([i,n,r,e])}const Ym=new Cc,Zm=new Cc;function Hm(t,e){const i=`\n <ogc:Filter>\n <ogc:Contains>\n <ogc:PropertyName>SHAPE</ogc:PropertyName>\n <gml:Point srsName="urn:ogc:def:crs:EPSG::4326">\n <gml:coordinates>${(n=t,o=nr(n,void 0!==r?r:"EPSG:3857","EPSG:4326"),s=o[0],(s<-180||s>180)&&(o[0]=De(s+180,360)-180),o).reverse().join(",")}</gml:coordinates>\n </gml:Point>\n </ogc:Contains>\n </ogc:Filter>\n `;var n,r,o,s;fetch(function(t){const e=Object.keys(t).map((e=>e+"="+encodeURI(t[e]))).join("&");return`https://api.os.uk/features/v1/wfs?${e}`}({key:e,service:"WFS",request:"GetFeature",version:"2.0.0",typeNames:"Topography_TopographicArea",propertyName:"TOID,DescriptiveGroup,SHAPE",outputFormat:"GEOJSON",srsName:"urn:ogc:def:crs:EPSG::4326",filter:i,count:1})).then((t=>t.json())).then((t=>{if(!t.features.length)return;const e=t.features[0].properties,i=["TOID","DescriptiveGroup"];Object.keys(e).forEach((t=>i.includes(t)||delete e[t]));const n=new Ta;n.readFeatures(t,{featureProjection:"EPSG:3857"}).forEach((t=>{const e=t.getProperties().TOID,i=Ym.getFeatureById(e);i?Ym.removeFeature(i):(t.setId(e),Ym.addFeature(t))})),Zm.clear(),Zm.addFeature(n.readFeature(Ym.getFeatures().reduce(((t,e)=>{const i=n.writeFeatureObject(e).geometry;return t?Vm(t,i):i}),null)))})).catch((t=>console.log(t)))}var $m,Jm=Object.freeze,Qm=Object.defineProperty,tv=Object.getOwnPropertyDescriptor,ev=(t,e,i,n)=>{for(var r,o=n>1?void 0:n?tv(e,i):e,s=t.length-1;s>=0;s--)(r=t[s])&&(o=(n?r(e,i,o):r(o))||o);return n&&o&&Qm(e,i,o),o};let iv=class extends ht{constructor(){super(...arguments),this.latitude=51.507351,this.longitude=-.127758,this.zoom=10,this.minZoom=7,this.maxZoom=22,this.drawMode=!1,this.drawGeojsonData={type:"Feature",geometry:{}},this.drawGeojsonDataBuffer=100,this.drawPointer="crosshair",this.showFeaturesAtPoint=!1,this.clickFeatures=!1,this.featureColor="#0000ff",this.featureFill=!1,this.featureBuffer=40,this.geojsonData={type:"FeatureCollection",features:[]},this.geojsonColor="#ff0000",this.geojsonFill=!1,this.geojsonBuffer=12,this.disableVectorTiles=!1,this.osVectorTilesApiKey="",this.osFeaturesApiKey="",this.osCopyright=`© Crown copyright and database rights ${(new Date).getFullYear()} OS (0)100024857`,this.hideResetControl=!1,this.staticMode=!1,this.areaUnit="m2",this.showScale=!1,this.useScaleBarStyle=!1,this.dispatch=(t,e)=>this.dispatchEvent(new CustomEvent(t,{detail:e}))}firstUpdated(){var t;const e=null==(t=this.shadowRoot)?void 0:t.querySelector("#map"),i=!this.disableVectorTiles&&Boolean(this.osVectorTilesApiKey),n=(r=this.osCopyright,o=this.osVectorTilesApiKey,new dd({source:o?new Ag({url:"https://api.os.uk/maps/raster/v1/zxy/Light_3857/{z}/{x}/{y}.png?key="+o,attributions:[r],attributionsCollapsible:!1,maxZoom:20}):new Dg({attributions:[zg]})}));var r,o;const s=function(t,e){let i=new pp({declutter:!0,source:new Xp({format:new Ll,url:"https://api.os.uk/maps/vector/v1/vts/tile/{z}/{y}/{x}.pbf?srs=3857&key="+e,attributions:[t],attributionsCollapsible:!1})});return e&&fetch("https://api.os.uk/maps/vector/v1/vts/resources/styles?srs=3857&key="+e).then((t=>t.json())).then((t=>jg(i,t,"esri"))).catch((t=>console.log(t))),i}(this.osCopyright,this.osVectorTilesApiKey),a=new Zp({target:e,layers:[i?s:n],view:new Ls({projection:"EPSG:3857",extent:(u=[-10.76418,49.528423,1.9134116,61.331151],h="EPSG:4326",c="EPSG:3857",En(u,ir(h,c),void 0,p)),minZoom:this.minZoom,maxZoom:this.maxZoom,center:Qn([this.longitude,this.latitude]),zoom:this.zoom,enableRotation:!1}),controls:Zs({attribution:!0,zoom:!this.staticMode}).extend(this.showScale?[(l=this.useScaleBarStyle,new Ys({units:"metric",bar:l,steps:4,text:!0,minWidth:140}))]:[]),interactions:Zc({doubleClickZoom:!this.staticMode,dragPan:!this.staticMode,mouseWheelZoom:!this.staticMode})});var l,u,h,c,p;const d=(f=this.drawPointer,new Mc({source:$g,type:"Polygon",style:new rl({stroke:Xg,fill:Kg,image:"crosshair"===f?Yg:Zg})}));var f;const y=function(t){return new Vc({source:$g,style:new rl({image:"crosshair"===t?Yg:Zg})})}(this.drawPointer),g=document.createElement("button");g.innerHTML="↻",g.title="Reset map view";g.addEventListener("click",(()=>{this.showFeaturesAtPoint?Xm(a,Zm,this.featureBuffer):_.getFeatures().length>0?Xm(a,_,this.geojsonBuffer):(a.getView().setCenter(Qn([this.longitude,this.latitude])),a.getView().setZoom(this.zoom)),this.drawMode&&($g.clear(),a.addInteraction(d),a.addInteraction(Qg))}),!1);const m=document.createElement("div");m.className="reset-control ol-unselectable ol-control",m.appendChild(g);var v=new ge({element:m});this.hideResetControl||a.addControl(v),a.on("pointerdrag",(()=>{a.getViewport().style.cursor="grabbing"})),a.on("pointermove",(()=>{a.getViewport().style.cursor="grab"}));const _=new Cc;if("FeatureCollection"===this.geojsonData.type){let t=(new Ta).readFeatures(this.geojsonData,{featureProjection:"EPSG:3857"});_.addFeatures(t)}else if("Feature"===this.geojsonData.type){let t=(new Ta).readFeature(this.geojsonData,{featureProjection:"EPSG:3857"});_.addFeature(t)}const x=new ac({source:_,style:new rl({stroke:new Ka({color:this.geojsonColor,width:3}),fill:new Ea({color:this.geojsonFill?Km(this.geojsonColor,.2):Km(this.geojsonColor,0)})})});if(a.addLayer(x),_.getFeatures().length>0){Xm(a,_,this.geojsonBuffer);const t=_.getFeatures()[0].getGeometry();this.dispatch("geojsonDataArea",Um(t,this.areaUnit))}if(this.drawMode){const t=Object.keys(this.drawGeojsonData.geometry).length>0;if(t){let t=(new Ta).readFeature(this.drawGeojsonData,{featureProjection:"EPSG:3857"});$g.addFeature(t),Xm(a,$g,this.drawGeojsonDataBuffer)}else $g.clear();a.addLayer(Jg),t||a.addInteraction(d),a.addInteraction(y),a.addInteraction(Qg),$g.on("change",(()=>{const t=$g.getFeatures();if(t.length>0){const i=(e=t,"string"==typeof e?e[e.length-1]||"":e[e.length-1]).getGeometry();this.dispatch("geojsonChange",(new Ta).writeFeaturesObject(t,{featureProjection:"EPSG:3857"})),this.dispatch("areaChange",Um(i,this.areaUnit)),a.removeInteraction(d)}var e}))}if(this.drawMode&&Boolean(this.osVectorTilesApiKey)&&!this.disableVectorTiles&&(a.addLayer(Wg),Jg.setZIndex(1001),a.on("moveend",(()=>{a.getView().getZoom()<20?Bg.clear():setTimeout((()=>{Bg.clear();const t=a.getView().calculateExtent(a.getSize());qg(s,t)}),200)}))),this.showFeaturesAtPoint&&Boolean(this.osFeaturesApiKey)){Hm(Qn([this.longitude,this.latitude]),this.osFeaturesApiKey),this.clickFeatures&&a.on("singleclick",(t=>{Hm(t.coordinate,this.osFeaturesApiKey)}));const t=(b=this.featureColor,w=this.featureFill,new ac({source:Zm,style:new rl({stroke:new Ka({width:3,color:b}),fill:new Ea({color:Km(b,w?.2:0)})})}));a.addLayer(t),Zm.on("change",(()=>{if("ready"===Zm.getState()&&Zm.getFeatures().length>0){Xm(a,Zm,this.featureBuffer),this.dispatch("featuresGeojsonChange",(new Ta).writeFeaturesObject(Zm.getFeatures(),{featureProjection:"EPSG:3857"}));const t=Zm.getFeatures()[0].getGeometry();this.dispatch("featuresAreaChange",Um(t,this.areaUnit))}}))}var b,w;setTimeout((()=>{window.dispatchEvent(new Event("resize")),e.style.opacity="1",this.dispatch("ready")}),500)}render(){return q($m||($m=Jm(Qm(t=['<script src="https://cdn.polyfill.io/v2/polyfill.min.js"><\/script>\n <link rel="stylesheet" href="https://cdn.skypack.dev/ol@^6.6.1/ol.css" />\n <div id="map" tabindex="0" />'],"raw",{value:Jm(e||t.slice())}))));var t,e}};var nv;iv.styles=((t,...e)=>{const i=1===t.length?t[0]:e.reduce(((e,i,n)=>e+(t=>{if(t instanceof c)return t.cssText;if("number"==typeof t)return t;throw Error("Value passed to 'css' function must be a 'css' function result: "+t+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(i)+t[n+1]),t[0]);return d(i)})`
|
39
|
+
var Gd=function(t,e){this.next=null,this.key=t,this.data=e,this.left=null,this.right=null};function Nd(t,e){return t>e?1:t<e?-1:0}function Bd(t,e,i){for(var n=new Gd(null,null),r=n,o=n;;){var s=i(t,e.key);if(s<0){if(null===e.left)break;if(i(t,e.left.key)<0){var a=e.left;if(e.left=a.right,a.right=e,null===(e=a).left)break}o.left=e,o=e,e=e.left}else{if(!(s>0))break;if(null===e.right)break;if(i(t,e.right.key)>0){a=e.right;if(e.right=a.left,a.left=e,null===(e=a).right)break}r.right=e,r=e,e=e.right}}return r.right=e.left,o.left=e.right,e.left=n.right,e.right=n.left,e}function Wd(t,e,i,n){var r=new Gd(t,e);if(null===i)return r.left=r.right=null,r;var o=n(t,(i=Bd(t,i,n)).key);return o<0?(r.left=i.left,r.right=i,i.left=null):o>=0&&(r.right=i.right,r.left=i,i.right=null),r}function qd(t,e,i){var n=null,r=null;if(e){var o=i((e=Bd(t,e,i)).key,t);0===o?(n=e.left,r=e.right):o<0?(r=e.right,e.right=null,n=e):(n=e.left,e.left=null,r=e)}return{left:n,right:r}}function Vd(t,e,i,n,r){if(t){n(e+(i?"└── ":"├── ")+r(t)+"\n");var o=e+(i?" ":"│ ");t.left&&Vd(t.left,o,!1,n,r),t.right&&Vd(t.right,o,!0,n,r)}}var Ud=function(){function t(t){void 0===t&&(t=Nd),this._root=null,this._size=0,this._comparator=t}return t.prototype.insert=function(t,e){return this._size++,this._root=Wd(t,e,this._root,this._comparator)},t.prototype.add=function(t,e){var i=new Gd(t,e);null===this._root&&(i.left=i.right=null,this._size++,this._root=i);var n=this._comparator,r=Bd(t,this._root,n),o=n(t,r.key);return 0===o?this._root=r:(o<0?(i.left=r.left,i.right=r,r.left=null):o>0&&(i.right=r.right,i.left=r,r.right=null),this._size++,this._root=i),this._root},t.prototype.remove=function(t){this._root=this._remove(t,this._root,this._comparator)},t.prototype._remove=function(t,e,i){var n;return null===e?null:0===i(t,(e=Bd(t,e,i)).key)?(null===e.left?n=e.right:(n=Bd(t,e.left,i)).right=e.right,this._size--,n):e},t.prototype.pop=function(){var t=this._root;if(t){for(;t.left;)t=t.left;return this._root=Bd(t.key,this._root,this._comparator),this._root=this._remove(t.key,this._root,this._comparator),{key:t.key,data:t.data}}return null},t.prototype.findStatic=function(t){for(var e=this._root,i=this._comparator;e;){var n=i(t,e.key);if(0===n)return e;e=n<0?e.left:e.right}return null},t.prototype.find=function(t){return this._root&&(this._root=Bd(t,this._root,this._comparator),0!==this._comparator(t,this._root.key))?null:this._root},t.prototype.contains=function(t){for(var e=this._root,i=this._comparator;e;){var n=i(t,e.key);if(0===n)return!0;e=n<0?e.left:e.right}return!1},t.prototype.forEach=function(t,e){for(var i=this._root,n=[],r=!1;!r;)null!==i?(n.push(i),i=i.left):0!==n.length?(i=n.pop(),t.call(e,i),i=i.right):r=!0;return this},t.prototype.range=function(t,e,i,n){for(var r=[],o=this._comparator,s=this._root;0!==r.length||s;)if(s)r.push(s),s=s.left;else{if(o((s=r.pop()).key,e)>0)break;if(o(s.key,t)>=0&&i.call(n,s))return this;s=s.right}return this},t.prototype.keys=function(){var t=[];return this.forEach((function(e){var i=e.key;return t.push(i)})),t},t.prototype.values=function(){var t=[];return this.forEach((function(e){var i=e.data;return t.push(i)})),t},t.prototype.min=function(){return this._root?this.minNode(this._root).key:null},t.prototype.max=function(){return this._root?this.maxNode(this._root).key:null},t.prototype.minNode=function(t){if(void 0===t&&(t=this._root),t)for(;t.left;)t=t.left;return t},t.prototype.maxNode=function(t){if(void 0===t&&(t=this._root),t)for(;t.right;)t=t.right;return t},t.prototype.at=function(t){for(var e=this._root,i=!1,n=0,r=[];!i;)if(e)r.push(e),e=e.left;else if(r.length>0){if(e=r.pop(),n===t)return e;n++,e=e.right}else i=!0;return null},t.prototype.next=function(t){var e=this._root,i=null;if(t.right){for(i=t.right;i.left;)i=i.left;return i}for(var n=this._comparator;e;){var r=n(t.key,e.key);if(0===r)break;r<0?(i=e,e=e.left):e=e.right}return i},t.prototype.prev=function(t){var e=this._root,i=null;if(null!==t.left){for(i=t.left;i.right;)i=i.right;return i}for(var n=this._comparator;e;){var r=n(t.key,e.key);if(0===r)break;r<0?e=e.left:(i=e,e=e.right)}return i},t.prototype.clear=function(){return this._root=null,this._size=0,this},t.prototype.toList=function(){return function(t){var e=t,i=[],n=!1,r=new Gd(null,null),o=r;for(;!n;)e?(i.push(e),e=e.left):i.length>0?e=(e=o=o.next=i.pop()).right:n=!0;return o.next=null,r.next}(this._root)},t.prototype.load=function(t,e,i){void 0===e&&(e=[]),void 0===i&&(i=!1);var n=t.length,r=this._comparator;if(i&&Yd(t,e,0,n-1,r),null===this._root)this._root=Xd(t,e,0,n),this._size=n;else{var o=function(t,e,i){var n=new Gd(null,null),r=n,o=t,s=e;for(;null!==o&&null!==s;)i(o.key,s.key)<0?(r.next=o,o=o.next):(r.next=s,s=s.next),r=r.next;null!==o?r.next=o:null!==s&&(r.next=s);return n.next}(this.toList(),function(t,e){for(var i=new Gd(null,null),n=i,r=0;r<t.length;r++)n=n.next=new Gd(t[r],e[r]);return n.next=null,i.next}(t,e),r);n=this._size+n,this._root=Kd({head:o},0,n)}return this},t.prototype.isEmpty=function(){return null===this._root},Object.defineProperty(t.prototype,"size",{get:function(){return this._size},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"root",{get:function(){return this._root},enumerable:!0,configurable:!0}),t.prototype.toString=function(t){void 0===t&&(t=function(t){return String(t.key)});var e=[];return Vd(this._root,"",!0,(function(t){return e.push(t)}),t),e.join("")},t.prototype.update=function(t,e,i){var n=this._comparator,r=qd(t,this._root,n),o=r.left,s=r.right;n(t,e)<0?s=Wd(e,i,s,n):o=Wd(e,i,o,n),this._root=function(t,e,i){return null===e?t:(null===t||((e=Bd(t.key,e,i)).left=t),e)}(o,s,n)},t.prototype.split=function(t){return qd(t,this._root,this._comparator)},t}();function Xd(t,e,i,n){var r=n-i;if(r>0){var o=i+Math.floor(r/2),s=t[o],a=e[o],l=new Gd(s,a);return l.left=Xd(t,e,i,o),l.right=Xd(t,e,o+1,n),l}return null}function Kd(t,e,i){var n=i-e;if(n>0){var r=e+Math.floor(n/2),o=Kd(t,e,r),s=t.head;return s.left=o,t.head=t.head.next,s.right=Kd(t,r+1,i),s}return null}function Yd(t,e,i,n,r){if(!(i>=n)){for(var o=t[i+n>>1],s=i-1,a=n+1;;){do{s++}while(r(t[s],o)<0);do{a--}while(r(t[a],o)>0);if(s>=a)break;var l=t[s];t[s]=t[a],t[a]=l,l=e[s],e[s]=e[a],e[a]=l}Yd(t,e,i,a,r),Yd(t,e,a+1,n,r)}}function Zd(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Hd(t,e){for(var i=0;i<e.length;i++){var n=e[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function $d(t,e,i){return e&&Hd(t.prototype,e),i&&Hd(t,i),t}var Jd=function(t,e){return t.ll.x<=e.x&&e.x<=t.ur.x&&t.ll.y<=e.y&&e.y<=t.ur.y},Qd=function(t,e){if(e.ur.x<t.ll.x||t.ur.x<e.ll.x||e.ur.y<t.ll.y||t.ur.y<e.ll.y)return null;var i=t.ll.x<e.ll.x?e.ll.x:t.ll.x,n=t.ur.x<e.ur.x?t.ur.x:e.ur.x;return{ll:{x:i,y:t.ll.y<e.ll.y?e.ll.y:t.ll.y},ur:{x:n,y:t.ur.y<e.ur.y?t.ur.y:e.ur.y}}},tf=Number.EPSILON;void 0===tf&&(tf=Math.pow(2,-52));var ef=tf*tf,nf=function(t,e){if(-tf<t&&t<tf&&-tf<e&&e<tf)return 0;var i=t-e;return i*i<ef*t*e?0:t<e?-1:1},rf=function(){function t(){Zd(this,t),this.reset()}return $d(t,[{key:"reset",value:function(){this.xRounder=new of,this.yRounder=new of}},{key:"round",value:function(t,e){return{x:this.xRounder.round(t),y:this.yRounder.round(e)}}}]),t}(),of=function(){function t(){Zd(this,t),this.tree=new Ud,this.round(0)}return $d(t,[{key:"round",value:function(t){var e=this.tree.add(t),i=this.tree.prev(e);if(null!==i&&0===nf(e.key,i.key))return this.tree.remove(t),i.key;var n=this.tree.next(e);return null!==n&&0===nf(e.key,n.key)?(this.tree.remove(t),n.key):t}}]),t}(),sf=new rf,af=function(t,e){return t.x*e.y-t.y*e.x},lf=function(t,e){return t.x*e.x+t.y*e.y},uf=function(t,e,i){var n={x:e.x-t.x,y:e.y-t.y},r={x:i.x-t.x,y:i.y-t.y},o=af(n,r);return nf(o,0)},hf=function(t){return Math.sqrt(lf(t,t))},cf=function(t,e,i){var n={x:e.x-t.x,y:e.y-t.y},r={x:i.x-t.x,y:i.y-t.y};return lf(r,n)/hf(r)/hf(n)},pf=function(t,e,i){return 0===e.y?null:{x:t.x+e.x/e.y*(i-t.y),y:i}},df=function(t,e,i){return 0===e.x?null:{x:i,y:t.y+e.y/e.x*(i-t.x)}},ff=function(){function t(e,i){Zd(this,t),void 0===e.events?e.events=[this]:e.events.push(this),this.point=e,this.isLeft=i}return $d(t,null,[{key:"compare",value:function(e,i){var n=t.comparePoints(e.point,i.point);return 0!==n?n:(e.point!==i.point&&e.link(i),e.isLeft!==i.isLeft?e.isLeft?1:-1:gf.compare(e.segment,i.segment))}},{key:"comparePoints",value:function(t,e){return t.x<e.x?-1:t.x>e.x?1:t.y<e.y?-1:t.y>e.y?1:0}}]),$d(t,[{key:"link",value:function(t){if(t.point===this.point)throw new Error("Tried to link already linked events");for(var e=t.point.events,i=0,n=e.length;i<n;i++){var r=e[i];this.point.events.push(r),r.point=this.point}this.checkForConsuming()}},{key:"checkForConsuming",value:function(){for(var t=this.point.events.length,e=0;e<t;e++){var i=this.point.events[e];if(void 0===i.segment.consumedBy)for(var n=e+1;n<t;n++){var r=this.point.events[n];void 0===r.consumedBy&&(i.otherSE.point.events===r.otherSE.point.events&&i.segment.consume(r.segment))}}}},{key:"getAvailableLinkedEvents",value:function(){for(var t=[],e=0,i=this.point.events.length;e<i;e++){var n=this.point.events[e];n!==this&&!n.segment.ringOut&&n.segment.isInResult()&&t.push(n)}return t}},{key:"getLeftmostComparator",value:function(t){var e=this,i=new Map,n=function(n){var r,o,s,a,l,u=n.otherSE;i.set(n,{sine:(r=e.point,o=t.point,s=u.point,a={x:o.x-r.x,y:o.y-r.y},l={x:s.x-r.x,y:s.y-r.y},af(l,a)/hf(l)/hf(a)),cosine:cf(e.point,t.point,u.point)})};return function(t,e){i.has(t)||n(t),i.has(e)||n(e);var r=i.get(t),o=r.sine,s=r.cosine,a=i.get(e),l=a.sine,u=a.cosine;return o>=0&&l>=0?s<u?1:s>u?-1:0:o<0&&l<0?s<u?-1:s>u?1:0:l<o?-1:l>o?1:0}}}]),t}(),yf=0,gf=function(){function t(e,i,n,r){Zd(this,t),this.id=++yf,this.leftSE=e,e.segment=this,e.otherSE=i,this.rightSE=i,i.segment=this,i.otherSE=e,this.rings=n,this.windings=r}return $d(t,null,[{key:"compare",value:function(t,e){var i=t.leftSE.point.x,n=e.leftSE.point.x,r=t.rightSE.point.x,o=e.rightSE.point.x;if(o<i)return 1;if(r<n)return-1;var s=t.leftSE.point.y,a=e.leftSE.point.y,l=t.rightSE.point.y,u=e.rightSE.point.y;if(i<n){if(a<s&&a<l)return 1;if(a>s&&a>l)return-1;var h=t.comparePoint(e.leftSE.point);if(h<0)return 1;if(h>0)return-1;var c=e.comparePoint(t.rightSE.point);return 0!==c?c:-1}if(i>n){if(s<a&&s<u)return-1;if(s>a&&s>u)return 1;var p=e.comparePoint(t.leftSE.point);if(0!==p)return p;var d=t.comparePoint(e.rightSE.point);return d<0?1:d>0?-1:1}if(s<a)return-1;if(s>a)return 1;if(r<o){var f=e.comparePoint(t.rightSE.point);if(0!==f)return f}if(r>o){var y=t.comparePoint(e.rightSE.point);if(y<0)return 1;if(y>0)return-1}if(r!==o){var g=l-s,m=r-i,v=u-a,_=o-n;if(g>m&&v<_)return 1;if(g<m&&v>_)return-1}return r>o?1:r<o||l<u?-1:l>u?1:t.id<e.id?-1:t.id>e.id?1:0}}]),$d(t,[{key:"replaceRightSE",value:function(t){this.rightSE=t,this.rightSE.segment=this,this.rightSE.otherSE=this.leftSE,this.leftSE.otherSE=this.rightSE}},{key:"bbox",value:function(){var t=this.leftSE.point.y,e=this.rightSE.point.y;return{ll:{x:this.leftSE.point.x,y:t<e?t:e},ur:{x:this.rightSE.point.x,y:t>e?t:e}}}},{key:"vector",value:function(){return{x:this.rightSE.point.x-this.leftSE.point.x,y:this.rightSE.point.y-this.leftSE.point.y}}},{key:"isAnEndpoint",value:function(t){return t.x===this.leftSE.point.x&&t.y===this.leftSE.point.y||t.x===this.rightSE.point.x&&t.y===this.rightSE.point.y}},{key:"comparePoint",value:function(t){if(this.isAnEndpoint(t))return 0;var e=this.leftSE.point,i=this.rightSE.point,n=this.vector();if(e.x===i.x)return t.x===e.x?0:t.x<e.x?1:-1;var r=(t.y-e.y)/n.y,o=e.x+r*n.x;if(t.x===o)return 0;var s=(t.x-e.x)/n.x,a=e.y+s*n.y;return t.y===a?0:t.y<a?-1:1}},{key:"getIntersection",value:function(t){var e=this.bbox(),i=t.bbox(),n=Qd(e,i);if(null===n)return null;var r=this.leftSE.point,o=this.rightSE.point,s=t.leftSE.point,a=t.rightSE.point,l=Jd(e,s)&&0===this.comparePoint(s),u=Jd(i,r)&&0===t.comparePoint(r),h=Jd(e,a)&&0===this.comparePoint(a),c=Jd(i,o)&&0===t.comparePoint(o);if(u&&l)return c&&!h?o:!c&&h?a:null;if(u)return h&&r.x===a.x&&r.y===a.y?null:r;if(l)return c&&o.x===s.x&&o.y===s.y?null:s;if(c&&h)return null;if(c)return o;if(h)return a;var p=function(t,e,i,n){if(0===e.x)return df(i,n,t.x);if(0===n.x)return df(t,e,i.x);if(0===e.y)return pf(i,n,t.y);if(0===n.y)return pf(t,e,i.y);var r=af(e,n);if(0==r)return null;var o={x:i.x-t.x,y:i.y-t.y},s=af(o,e)/r,a=af(o,n)/r;return{x:(t.x+a*e.x+(i.x+s*n.x))/2,y:(t.y+a*e.y+(i.y+s*n.y))/2}}(r,this.vector(),s,t.vector());return null===p?null:Jd(n,p)?sf.round(p.x,p.y):null}},{key:"split",value:function(e){var i=[],n=void 0!==e.events,r=new ff(e,!0),o=new ff(e,!1),s=this.rightSE;this.replaceRightSE(o),i.push(o),i.push(r);var a=new t(r,s,this.rings.slice(),this.windings.slice());return ff.comparePoints(a.leftSE.point,a.rightSE.point)>0&&a.swapEvents(),ff.comparePoints(this.leftSE.point,this.rightSE.point)>0&&this.swapEvents(),n&&(r.checkForConsuming(),o.checkForConsuming()),i}},{key:"swapEvents",value:function(){var t=this.rightSE;this.rightSE=this.leftSE,this.leftSE=t,this.leftSE.isLeft=!0,this.rightSE.isLeft=!1;for(var e=0,i=this.windings.length;e<i;e++)this.windings[e]*=-1}},{key:"consume",value:function(e){for(var i=this,n=e;i.consumedBy;)i=i.consumedBy;for(;n.consumedBy;)n=n.consumedBy;var r=t.compare(i,n);if(0!==r){if(r>0){var o=i;i=n,n=o}if(i.prev===n){var s=i;i=n,n=s}for(var a=0,l=n.rings.length;a<l;a++){var u=n.rings[a],h=n.windings[a],c=i.rings.indexOf(u);-1===c?(i.rings.push(u),i.windings.push(h)):i.windings[c]+=h}n.rings=null,n.windings=null,n.consumedBy=i,n.leftSE.consumedBy=i.leftSE,n.rightSE.consumedBy=i.rightSE}}},{key:"prevInResult",value:function(){return void 0!==this._prevInResult||(this.prev?this.prev.isInResult()?this._prevInResult=this.prev:this._prevInResult=this.prev.prevInResult():this._prevInResult=null),this._prevInResult}},{key:"beforeState",value:function(){if(void 0!==this._beforeState)return this._beforeState;if(this.prev){var t=this.prev.consumedBy||this.prev;this._beforeState=t.afterState()}else this._beforeState={rings:[],windings:[],multiPolys:[]};return this._beforeState}},{key:"afterState",value:function(){if(void 0!==this._afterState)return this._afterState;var t=this.beforeState();this._afterState={rings:t.rings.slice(0),windings:t.windings.slice(0),multiPolys:[]};for(var e=this._afterState.rings,i=this._afterState.windings,n=this._afterState.multiPolys,r=0,o=this.rings.length;r<o;r++){var s=this.rings[r],a=this.windings[r],l=e.indexOf(s);-1===l?(e.push(s),i.push(a)):i[l]+=a}for(var u=[],h=[],c=0,p=e.length;c<p;c++)if(0!==i[c]){var d=e[c],f=d.poly;if(-1===h.indexOf(f))if(d.isExterior)u.push(f);else{-1===h.indexOf(f)&&h.push(f);var y=u.indexOf(d.poly);-1!==y&&u.splice(y,1)}}for(var g=0,m=u.length;g<m;g++){var v=u[g].multiPoly;-1===n.indexOf(v)&&n.push(v)}return this._afterState}},{key:"isInResult",value:function(){if(this.consumedBy)return!1;if(void 0!==this._isInResult)return this._isInResult;var t=this.beforeState().multiPolys,e=this.afterState().multiPolys;switch(Ef.type){case"union":var i=0===t.length,n=0===e.length;this._isInResult=i!==n;break;case"intersection":var r,o;t.length<e.length?(r=t.length,o=e.length):(r=e.length,o=t.length),this._isInResult=o===Ef.numMultiPolys&&r<o;break;case"xor":var s=Math.abs(t.length-e.length);this._isInResult=s%2==1;break;case"difference":var a=function(t){return 1===t.length&&t[0].isSubject};this._isInResult=a(t)!==a(e);break;default:throw new Error("Unrecognized operation type found ".concat(Ef.type))}return this._isInResult}}],[{key:"fromRing",value:function(e,i,n){var r,o,s,a=ff.comparePoints(e,i);if(a<0)r=e,o=i,s=1;else{if(!(a>0))throw new Error("Tried to create degenerate segment at [".concat(e.x,", ").concat(e.y,"]"));r=i,o=e,s=-1}return new t(new ff(r,!0),new ff(o,!1),[n],[s])}}]),t}(),mf=function(){function t(e,i,n){if(Zd(this,t),!Array.isArray(e)||0===e.length)throw new Error("Input geometry is not a valid Polygon or MultiPolygon");if(this.poly=i,this.isExterior=n,this.segments=[],"number"!=typeof e[0][0]||"number"!=typeof e[0][1])throw new Error("Input geometry is not a valid Polygon or MultiPolygon");var r=sf.round(e[0][0],e[0][1]);this.bbox={ll:{x:r.x,y:r.y},ur:{x:r.x,y:r.y}};for(var o=r,s=1,a=e.length;s<a;s++){if("number"!=typeof e[s][0]||"number"!=typeof e[s][1])throw new Error("Input geometry is not a valid Polygon or MultiPolygon");var l=sf.round(e[s][0],e[s][1]);l.x===o.x&&l.y===o.y||(this.segments.push(gf.fromRing(o,l,this)),l.x<this.bbox.ll.x&&(this.bbox.ll.x=l.x),l.y<this.bbox.ll.y&&(this.bbox.ll.y=l.y),l.x>this.bbox.ur.x&&(this.bbox.ur.x=l.x),l.y>this.bbox.ur.y&&(this.bbox.ur.y=l.y),o=l)}r.x===o.x&&r.y===o.y||this.segments.push(gf.fromRing(o,r,this))}return $d(t,[{key:"getSweepEvents",value:function(){for(var t=[],e=0,i=this.segments.length;e<i;e++){var n=this.segments[e];t.push(n.leftSE),t.push(n.rightSE)}return t}}]),t}(),vf=function(){function t(e,i){if(Zd(this,t),!Array.isArray(e))throw new Error("Input geometry is not a valid Polygon or MultiPolygon");this.exteriorRing=new mf(e[0],this,!0),this.bbox={ll:{x:this.exteriorRing.bbox.ll.x,y:this.exteriorRing.bbox.ll.y},ur:{x:this.exteriorRing.bbox.ur.x,y:this.exteriorRing.bbox.ur.y}},this.interiorRings=[];for(var n=1,r=e.length;n<r;n++){var o=new mf(e[n],this,!1);o.bbox.ll.x<this.bbox.ll.x&&(this.bbox.ll.x=o.bbox.ll.x),o.bbox.ll.y<this.bbox.ll.y&&(this.bbox.ll.y=o.bbox.ll.y),o.bbox.ur.x>this.bbox.ur.x&&(this.bbox.ur.x=o.bbox.ur.x),o.bbox.ur.y>this.bbox.ur.y&&(this.bbox.ur.y=o.bbox.ur.y),this.interiorRings.push(o)}this.multiPoly=i}return $d(t,[{key:"getSweepEvents",value:function(){for(var t=this.exteriorRing.getSweepEvents(),e=0,i=this.interiorRings.length;e<i;e++)for(var n=this.interiorRings[e].getSweepEvents(),r=0,o=n.length;r<o;r++)t.push(n[r]);return t}}]),t}(),_f=function(){function t(e,i){if(Zd(this,t),!Array.isArray(e))throw new Error("Input geometry is not a valid Polygon or MultiPolygon");try{"number"==typeof e[0][0][0]&&(e=[e])}catch(s){}this.polys=[],this.bbox={ll:{x:Number.POSITIVE_INFINITY,y:Number.POSITIVE_INFINITY},ur:{x:Number.NEGATIVE_INFINITY,y:Number.NEGATIVE_INFINITY}};for(var n=0,r=e.length;n<r;n++){var o=new vf(e[n],this);o.bbox.ll.x<this.bbox.ll.x&&(this.bbox.ll.x=o.bbox.ll.x),o.bbox.ll.y<this.bbox.ll.y&&(this.bbox.ll.y=o.bbox.ll.y),o.bbox.ur.x>this.bbox.ur.x&&(this.bbox.ur.x=o.bbox.ur.x),o.bbox.ur.y>this.bbox.ur.y&&(this.bbox.ur.y=o.bbox.ur.y),this.polys.push(o)}this.isSubject=i}return $d(t,[{key:"getSweepEvents",value:function(){for(var t=[],e=0,i=this.polys.length;e<i;e++)for(var n=this.polys[e].getSweepEvents(),r=0,o=n.length;r<o;r++)t.push(n[r]);return t}}]),t}(),xf=function(){function t(e){Zd(this,t),this.events=e;for(var i=0,n=e.length;i<n;i++)e[i].segment.ringOut=this;this.poly=null}return $d(t,null,[{key:"factory",value:function(e){for(var i=[],n=0,r=e.length;n<r;n++){var o=e[n];if(o.isInResult()&&!o.ringOut){for(var s=null,a=o.leftSE,l=o.rightSE,u=[a],h=a.point,c=[];s=a,a=l,u.push(a),a.point!==h;)for(;;){var p=a.getAvailableLinkedEvents();if(0===p.length){var d=u[0].point,f=u[u.length-1].point;throw new Error("Unable to complete output ring starting at [".concat(d.x,",")+" ".concat(d.y,"]. Last matching segment found ends at")+" [".concat(f.x,", ").concat(f.y,"]."))}if(1===p.length){l=p[0].otherSE;break}for(var y=null,g=0,m=c.length;g<m;g++)if(c[g].point===a.point){y=g;break}if(null===y){c.push({index:u.length,point:a.point});var v=a.getLeftmostComparator(s);l=p.sort(v)[0].otherSE;break}var _=c.splice(y)[0],x=u.splice(_.index);x.unshift(x[0].otherSE),i.push(new t(x.reverse()))}i.push(new t(u))}}return i}}]),$d(t,[{key:"getGeom",value:function(){for(var t=this.events[0].point,e=[t],i=1,n=this.events.length-1;i<n;i++){var r=this.events[i].point,o=this.events[i+1].point;0!==uf(r,t,o)&&(e.push(r),t=r)}if(1===e.length)return null;var s=e[0],a=e[1];0===uf(s,t,a)&&e.shift(),e.push(e[0]);for(var l=this.isExteriorRing()?1:-1,u=this.isExteriorRing()?0:e.length-1,h=this.isExteriorRing()?e.length:-1,c=[],p=u;p!=h;p+=l)c.push([e[p].x,e[p].y]);return c}},{key:"isExteriorRing",value:function(){if(void 0===this._isExteriorRing){var t=this.enclosingRing();this._isExteriorRing=!t||!t.isExteriorRing()}return this._isExteriorRing}},{key:"enclosingRing",value:function(){return void 0===this._enclosingRing&&(this._enclosingRing=this._calcEnclosingRing()),this._enclosingRing}},{key:"_calcEnclosingRing",value:function(){for(var t=this.events[0],e=1,i=this.events.length;e<i;e++){var n=this.events[e];ff.compare(t,n)>0&&(t=n)}for(var r=t.segment.prevInResult(),o=r?r.prevInResult():null;;){if(!r)return null;if(!o)return r.ringOut;if(o.ringOut!==r.ringOut)return o.ringOut.enclosingRing()!==r.ringOut?r.ringOut:r.ringOut.enclosingRing();r=o.prevInResult(),o=r?r.prevInResult():null}}}]),t}(),bf=function(){function t(e){Zd(this,t),this.exteriorRing=e,e.poly=this,this.interiorRings=[]}return $d(t,[{key:"addInterior",value:function(t){this.interiorRings.push(t),t.poly=this}},{key:"getGeom",value:function(){var t=[this.exteriorRing.getGeom()];if(null===t[0])return null;for(var e=0,i=this.interiorRings.length;e<i;e++){var n=this.interiorRings[e].getGeom();null!==n&&t.push(n)}return t}}]),t}(),wf=function(){function t(e){Zd(this,t),this.rings=e,this.polys=this._composePolys(e)}return $d(t,[{key:"getGeom",value:function(){for(var t=[],e=0,i=this.polys.length;e<i;e++){var n=this.polys[e].getGeom();null!==n&&t.push(n)}return t}},{key:"_composePolys",value:function(t){for(var e=[],i=0,n=t.length;i<n;i++){var r=t[i];if(!r.poly)if(r.isExteriorRing())e.push(new bf(r));else{var o=r.enclosingRing();o.poly||e.push(new bf(o)),o.poly.addInterior(r)}}return e}}]),t}(),Sf=function(){function t(e){var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:gf.compare;Zd(this,t),this.queue=e,this.tree=new Ud(i),this.segments=[]}return $d(t,[{key:"process",value:function(t){var e=t.segment,i=[];if(t.consumedBy)return t.isLeft?this.queue.remove(t.otherSE):this.tree.remove(e),i;var n=t.isLeft?this.tree.insert(e):this.tree.find(e);if(!n)throw new Error("Unable to find segment #".concat(e.id," ")+"[".concat(e.leftSE.point.x,", ").concat(e.leftSE.point.y,"] -> ")+"[".concat(e.rightSE.point.x,", ").concat(e.rightSE.point.y,"] ")+"in SweepLine tree. Please submit a bug report.");for(var r=n,o=n,s=void 0,a=void 0;void 0===s;)null===(r=this.tree.prev(r))?s=null:void 0===r.key.consumedBy&&(s=r.key);for(;void 0===a;)null===(o=this.tree.next(o))?a=null:void 0===o.key.consumedBy&&(a=o.key);if(t.isLeft){var l=null;if(s){var u=s.getIntersection(e);if(null!==u&&(e.isAnEndpoint(u)||(l=u),!s.isAnEndpoint(u)))for(var h=this._splitSafely(s,u),c=0,p=h.length;c<p;c++)i.push(h[c])}var d=null;if(a){var f=a.getIntersection(e);if(null!==f&&(e.isAnEndpoint(f)||(d=f),!a.isAnEndpoint(f)))for(var y=this._splitSafely(a,f),g=0,m=y.length;g<m;g++)i.push(y[g])}if(null!==l||null!==d){var v=null;if(null===l)v=d;else if(null===d)v=l;else{v=ff.comparePoints(l,d)<=0?l:d}this.queue.remove(e.rightSE),i.push(e.rightSE);for(var _=e.split(v),x=0,b=_.length;x<b;x++)i.push(_[x])}i.length>0?(this.tree.remove(e),i.push(t)):(this.segments.push(e),e.prev=s)}else{if(s&&a){var w=s.getIntersection(a);if(null!==w){if(!s.isAnEndpoint(w))for(var S=this._splitSafely(s,w),C=0,T=S.length;C<T;C++)i.push(S[C]);if(!a.isAnEndpoint(w))for(var E=this._splitSafely(a,w),k=0,P=E.length;k<P;k++)i.push(E[k])}}this.tree.remove(e)}return i}},{key:"_splitSafely",value:function(t,e){this.tree.remove(t);var i=t.rightSE;this.queue.remove(i);var n=t.split(e);return n.push(i),void 0===t.consumedBy&&this.tree.insert(t),n}}]),t}(),Cf="undefined"!=typeof process&&{}.POLYGON_CLIPPING_MAX_QUEUE_SIZE||1e6,Tf="undefined"!=typeof process&&{}.POLYGON_CLIPPING_MAX_SWEEPLINE_SEGMENTS||1e6,Ef=new(function(){function t(){Zd(this,t)}return $d(t,[{key:"run",value:function(t,e,i){Ef.type=t,sf.reset();for(var n=[new _f(e,!0)],r=0,o=i.length;r<o;r++)n.push(new _f(i[r],!1));if(Ef.numMultiPolys=n.length,"difference"===Ef.type)for(var s=n[0],a=1;a<n.length;)null!==Qd(n[a].bbox,s.bbox)?a++:n.splice(a,1);if("intersection"===Ef.type)for(var l=0,u=n.length;l<u;l++)for(var h=n[l],c=l+1,p=n.length;c<p;c++)if(null===Qd(h.bbox,n[c].bbox))return[];for(var d=new Ud(ff.compare),f=0,y=n.length;f<y;f++)for(var g=n[f].getSweepEvents(),m=0,v=g.length;m<v;m++)if(d.insert(g[m]),d.size>Cf)throw new Error("Infinite loop when putting segment endpoints in a priority queue (queue size too big). Please file a bug report.");for(var _=new Sf(d),x=d.size,b=d.pop();b;){var w=b.key;if(d.size===x){var S=w.segment;throw new Error("Unable to pop() ".concat(w.isLeft?"left":"right"," SweepEvent ")+"[".concat(w.point.x,", ").concat(w.point.y,"] from segment #").concat(S.id," ")+"[".concat(S.leftSE.point.x,", ").concat(S.leftSE.point.y,"] -> ")+"[".concat(S.rightSE.point.x,", ").concat(S.rightSE.point.y,"] from queue. ")+"Please file a bug report.")}if(d.size>Cf)throw new Error("Infinite loop when passing sweep line over endpoints (queue size too big). Please file a bug report.");if(_.segments.length>Tf)throw new Error("Infinite loop when passing sweep line over endpoints (too many sweep line segments). Please file a bug report.");for(var C=_.process(w),T=0,E=C.length;T<E;T++){var k=C[T];void 0===k.consumedBy&&d.insert(k)}x=d.size,b=d.pop()}sf.reset();var P=xf.factory(_.segments);return new wf(P).getGeom()}}]),t}()),kf=function(t){for(var e=arguments.length,i=new Array(e>1?e-1:0),n=1;n<e;n++)i[n-1]=arguments[n];return Ef.run("union",t,i)};function Pf(t,e,i){void 0===i&&(i={});var n={type:"Feature"};return(0===i.id||i.id)&&(n.id=i.id),i.bbox&&(n.bbox=i.bbox),n.properties=e||{},n.geometry=t,n}function Of(t){return"Feature"===t.type?t.geometry:t}function Rf(t,e,i){void 0===i&&(i={});var n=Of(t),r=Of(e),o=kf(n.coordinates,r.coordinates);return 0===o.length?null:1===o.length?function(t,e,i){void 0===i&&(i={});for(var n=0,r=t;n<r.length;n++){var o=r[n];if(o.length<4)throw new Error("Each LinearRing of a Polygon must have 4 or more Positions.");for(var s=0;s<o[o.length-1].length;s++)if(o[o.length-1][s]!==o[0][s])throw new Error("First and last Position are not equivalent.")}return Pf({type:"Polygon",coordinates:t},e,i)}(o[0],i.properties):function(t,e,i){return void 0===i&&(i={}),Pf({type:"MultiPolygon",coordinates:t},e,i)}(o,i.properties)}function If(t,e){const i=Gn(t),n=Math.round(100*i)/100;let r;return"m2"===e?r=n+" m²":"ha"===e&&(r=n/1e4+" ha"),r}function Ff(t,e,i){const n=e.getExtent();return t.getView().fit(Zi(n,i))}function jf(t,e){const[i,n,r]=Array.from(Pr(t));return Cr([i,n,r,e])}const Mf=new Ec,Af=new Ec;function Lf(t,e){const i=`\n <ogc:Filter>\n <ogc:Contains>\n <ogc:PropertyName>SHAPE</ogc:PropertyName>\n <gml:Point srsName="urn:ogc:def:crs:EPSG::4326">\n <gml:coordinates>${(n=t,o=rr(n,void 0!==r?r:"EPSG:3857","EPSG:4326"),s=o[0],(s<-180||s>180)&&(o[0]=Ge(s+180,360)-180),o).reverse().join(",")}</gml:coordinates>\n </gml:Point>\n </ogc:Contains>\n </ogc:Filter>\n `;var n,r,o,s;fetch(function(t){const e=Object.keys(t).map((e=>e+"="+encodeURI(t[e]))).join("&");return`https://api.os.uk/features/v1/wfs?${e}`}({key:e,service:"WFS",request:"GetFeature",version:"2.0.0",typeNames:"Topography_TopographicArea",propertyName:"TOID,DescriptiveGroup,SHAPE",outputFormat:"GEOJSON",srsName:"urn:ogc:def:crs:EPSG::4326",filter:i,count:1})).then((t=>t.json())).then((t=>{if(!t.features.length)return;const e=t.features[0].properties,i=["TOID","DescriptiveGroup"];Object.keys(e).forEach((t=>i.includes(t)||delete e[t]));const n=new ka;n.readFeatures(t,{featureProjection:"EPSG:3857"}).forEach((t=>{const e=t.getProperties().TOID,i=Mf.getFeatureById(e);i?Mf.removeFeature(i):(t.setId(e),Mf.addFeature(t))})),Af.clear(),Af.addFeature(n.readFeature(Mf.getFeatures().reduce(((t,e)=>{const i=n.writeFeatureObject(e).geometry;return t?Rf(t,i):i}),null)))})).catch((t=>console.log(t)))}var Df={$version:8,$root:{version:{required:!0,type:"enum",values:[8],doc:"Style specification version number. Must be 8.",example:8},name:{type:"string",doc:"A human-readable name for the style.",example:"Bright"},metadata:{type:"*",doc:"Arbitrary properties useful to track with the stylesheet, but do not influence rendering. Properties should be prefixed to avoid collisions, like 'mapbox:'."},center:{type:"array",value:"number",doc:"Default map center in longitude and latitude. The style center will be used only if the map has not been positioned by other means (e.g. map options or user interaction).",example:[-73.9749,40.7736]},zoom:{type:"number",doc:"Default zoom level. The style zoom will be used only if the map has not been positioned by other means (e.g. map options or user interaction).",example:12.5},bearing:{type:"number",default:0,period:360,units:"degrees",doc:'Default bearing, in degrees. The bearing is the compass direction that is "up"; for example, a bearing of 90° orients the map so that east is up. This value will be used only if the map has not been positioned by other means (e.g. map options or user interaction).',example:29},pitch:{type:"number",default:0,units:"degrees",doc:"Default pitch, in degrees. Zero is perpendicular to the surface, for a look straight down at the map, while a greater value like 60 looks ahead towards the horizon. The style pitch will be used only if the map has not been positioned by other means (e.g. map options or user interaction).",example:50},light:{type:"light",doc:"The global light source.",example:{anchor:"viewport",color:"white",intensity:.4}},terrain:{type:"terrain",doc:"A global modifier that elevates layers and markers based on a DEM data source."},fog:{type:"fog",doc:"A global effect that fades layers and markers based on their distance to the camera. The fog can be used to approximate the effect of atmosphere on distant objects and enhance the depth perception of the map when used with terrain or 3D features."},sources:{required:!0,type:"sources",doc:"Data source specifications.",example:{"mapbox-streets":{type:"vector",url:"mapbox://mapbox.mapbox-streets-v6"}}},sprite:{type:"string",doc:"A base URL for retrieving the sprite image and metadata. The extensions `.png`, `.json` and scale factor `@2x.png` will be automatically appended. This property is required if any layer uses the `background-pattern`, `fill-pattern`, `line-pattern`, `fill-extrusion-pattern`, or `icon-image` properties. The URL must be absolute, containing the [scheme, authority and path components](https://en.wikipedia.org/wiki/URL#Syntax).",example:"mapbox://sprites/mapbox/bright-v8"},glyphs:{type:"string",doc:"A URL template for loading signed-distance-field glyph sets in PBF format. The URL must include `{fontstack}` and `{range}` tokens. This property is required if any layer uses the `text-field` layout property. The URL must be absolute, containing the [scheme, authority and path components](https://en.wikipedia.org/wiki/URL#Syntax).",example:"mapbox://fonts/mapbox/{fontstack}/{range}.pbf"},transition:{type:"transition",doc:"A global transition definition to use as a default across properties, to be used for timing transitions between one value and the next when no property-specific transition is set. Collision-based symbol fading is controlled independently of the style's `transition` property.",example:{duration:300,delay:0}},layers:{required:!0,type:"array",value:"layer",doc:"Layers will be drawn in the order of this array.",example:[{id:"water",source:"mapbox-streets","source-layer":"water",type:"fill",paint:{"fill-color":"#00ffff"}}]}},sources:{"*":{type:"source",doc:"Specification of a data source. For vector and raster sources, either TileJSON or a URL to a TileJSON must be provided. For image and video sources, a URL must be provided. For GeoJSON sources, a URL or inline GeoJSON must be provided."}},source:["source_vector","source_raster","source_raster_dem","source_geojson","source_video","source_image"],source_vector:{type:{required:!0,type:"enum",values:{vector:{doc:"A vector tile source."}},doc:"The type of the source."},url:{type:"string",doc:"A URL to a TileJSON resource. Supported protocols are `http:`, `https:`, and `mapbox://<Tileset ID>`."},tiles:{type:"array",value:"string",doc:"An array of one or more tile source URLs, as in the TileJSON spec."},bounds:{type:"array",value:"number",length:4,default:[-180,-85.051129,180,85.051129],doc:"An array containing the longitude and latitude of the southwest and northeast corners of the source's bounding box in the following order: `[sw.lng, sw.lat, ne.lng, ne.lat]`. When this property is included in a source, no tiles outside of the given bounds are requested by Mapbox GL."},scheme:{type:"enum",values:{xyz:{doc:"Slippy map tilenames scheme."},tms:{doc:"OSGeo spec scheme."}},default:"xyz",doc:"Influences the y direction of the tile coordinates. The global-mercator (aka Spherical Mercator) profile is assumed."},minzoom:{type:"number",default:0,doc:"Minimum zoom level for which tiles are available, as in the TileJSON spec."},maxzoom:{type:"number",default:22,doc:"Maximum zoom level for which tiles are available, as in the TileJSON spec. Data from tiles at the maxzoom are used when displaying the map at higher zoom levels."},attribution:{type:"string",doc:"Contains an attribution to be displayed when the map is shown to a user."},promoteId:{type:"promoteId",doc:"A property to use as a feature id (for feature state). Either a property name, or an object of the form `{<sourceLayer>: <propertyName>}`. If specified as a string for a vector tile source, the same property is used across all its source layers."},volatile:{type:"boolean",default:!1,doc:"A setting to determine whether a source's tiles are cached locally.","sdk-support":{"basic functionality":{android:"9.3.0",ios:"5.10.0"}}},"*":{type:"*",doc:"Other keys to configure the data source."}},source_raster:{type:{required:!0,type:"enum",values:{raster:{doc:"A raster tile source."}},doc:"The type of the source."},url:{type:"string",doc:"A URL to a TileJSON resource. Supported protocols are `http:`, `https:`, and `mapbox://<Tileset ID>`."},tiles:{type:"array",value:"string",doc:"An array of one or more tile source URLs, as in the TileJSON spec."},bounds:{type:"array",value:"number",length:4,default:[-180,-85.051129,180,85.051129],doc:"An array containing the longitude and latitude of the southwest and northeast corners of the source's bounding box in the following order: `[sw.lng, sw.lat, ne.lng, ne.lat]`. When this property is included in a source, no tiles outside of the given bounds are requested by Mapbox GL."},minzoom:{type:"number",default:0,doc:"Minimum zoom level for which tiles are available, as in the TileJSON spec."},maxzoom:{type:"number",default:22,doc:"Maximum zoom level for which tiles are available, as in the TileJSON spec. Data from tiles at the maxzoom are used when displaying the map at higher zoom levels."},tileSize:{type:"number",default:512,units:"pixels",doc:"The minimum visual size to display tiles for this layer. Only configurable for raster layers."},scheme:{type:"enum",values:{xyz:{doc:"Slippy map tilenames scheme."},tms:{doc:"OSGeo spec scheme."}},default:"xyz",doc:"Influences the y direction of the tile coordinates. The global-mercator (aka Spherical Mercator) profile is assumed."},attribution:{type:"string",doc:"Contains an attribution to be displayed when the map is shown to a user."},volatile:{type:"boolean",default:!1,doc:"A setting to determine whether a source's tiles are cached locally.","sdk-support":{"basic functionality":{android:"9.3.0",ios:"5.10.0"}}},"*":{type:"*",doc:"Other keys to configure the data source."}},source_raster_dem:{type:{required:!0,type:"enum",values:{"raster-dem":{doc:"A RGB-encoded raster DEM source"}},doc:"The type of the source."},url:{type:"string",doc:"A URL to a TileJSON resource. Supported protocols are `http:`, `https:`, and `mapbox://<Tileset ID>`."},tiles:{type:"array",value:"string",doc:"An array of one or more tile source URLs, as in the TileJSON spec."},bounds:{type:"array",value:"number",length:4,default:[-180,-85.051129,180,85.051129],doc:"An array containing the longitude and latitude of the southwest and northeast corners of the source's bounding box in the following order: `[sw.lng, sw.lat, ne.lng, ne.lat]`. When this property is included in a source, no tiles outside of the given bounds are requested by Mapbox GL."},minzoom:{type:"number",default:0,doc:"Minimum zoom level for which tiles are available, as in the TileJSON spec."},maxzoom:{type:"number",default:22,doc:"Maximum zoom level for which tiles are available, as in the TileJSON spec. Data from tiles at the maxzoom are used when displaying the map at higher zoom levels."},tileSize:{type:"number",default:512,units:"pixels",doc:"The minimum visual size to display tiles for this layer. Only configurable for raster layers."},attribution:{type:"string",doc:"Contains an attribution to be displayed when the map is shown to a user."},encoding:{type:"enum",values:{terrarium:{doc:"Terrarium format PNG tiles. See https://aws.amazon.com/es/public-datasets/terrain/ for more info."},mapbox:{doc:"Mapbox Terrain RGB tiles. See https://www.mapbox.com/help/access-elevation-data/#mapbox-terrain-rgb for more info."}},default:"mapbox",doc:"The encoding used by this source. Mapbox Terrain RGB is used by default"},volatile:{type:"boolean",default:!1,doc:"A setting to determine whether a source's tiles are cached locally.","sdk-support":{"basic functionality":{android:"9.3.0",ios:"5.10.0"}}},"*":{type:"*",doc:"Other keys to configure the data source."}},source_geojson:{type:{required:!0,type:"enum",values:{geojson:{doc:"A GeoJSON data source."}},doc:"The data type of the GeoJSON source."},data:{type:"*",doc:"A URL to a GeoJSON file, or inline GeoJSON."},maxzoom:{type:"number",default:18,doc:"Maximum zoom level at which to create vector tiles (higher means greater detail at high zoom levels)."},attribution:{type:"string",doc:"Contains an attribution to be displayed when the map is shown to a user."},buffer:{type:"number",default:128,maximum:512,minimum:0,doc:"Size of the tile buffer on each side. A value of 0 produces no buffer. A value of 512 produces a buffer as wide as the tile itself. Larger values produce fewer rendering artifacts near tile edges and slower performance."},filter:{type:"*",doc:"An expression for filtering features prior to processing them for rendering."},tolerance:{type:"number",default:.375,doc:"Douglas-Peucker simplification tolerance (higher means simpler geometries and faster performance)."},cluster:{type:"boolean",default:!1,doc:"If the data is a collection of point features, setting this to true clusters the points by radius into groups. Cluster groups become new `Point` features in the source with additional properties:\n * `cluster` Is `true` if the point is a cluster \n * `cluster_id` A unqiue id for the cluster to be used in conjunction with the [cluster inspection methods](https://www.mapbox.com/mapbox-gl-js/api/#geojsonsource#getclusterexpansionzoom)\n * `point_count` Number of original points grouped into this cluster\n * `point_count_abbreviated` An abbreviated point count"},clusterRadius:{type:"number",default:50,minimum:0,doc:"Radius of each cluster if clustering is enabled. A value of 512 indicates a radius equal to the width of a tile."},clusterMaxZoom:{type:"number",doc:"Max zoom on which to cluster points if clustering is enabled. Defaults to one zoom less than maxzoom (so that last zoom features are not clustered). Clusters are re-evaluated at integer zoom levels so setting clusterMaxZoom to 14 means the clusters will be displayed until z15."},clusterMinPoints:{type:"number",doc:"Minimum number of points necessary to form a cluster if clustering is enabled. Defaults to `2`."},clusterProperties:{type:"*",doc:'An object defining custom properties on the generated clusters if clustering is enabled, aggregating values from clustered points. Has the form `{"property_name": [operator, map_expression]}`. `operator` is any expression function that accepts at least 2 operands (e.g. `"+"` or `"max"`) — it accumulates the property value from clusters/points the cluster contains; `map_expression` produces the value of a single point.\n\nExample: `{"sum": ["+", ["get", "scalerank"]]}`.\n\nFor more advanced use cases, in place of `operator`, you can use a custom reduce expression that references a special `["accumulated"]` value, e.g.:\n`{"sum": [["+", ["accumulated"], ["get", "sum"]], ["get", "scalerank"]]}`'},lineMetrics:{type:"boolean",default:!1,doc:"Whether to calculate line distance metrics. This is required for line layers that specify `line-gradient` values."},generateId:{type:"boolean",default:!1,doc:"Whether to generate ids for the geojson features. When enabled, the `feature.id` property will be auto assigned based on its index in the `features` array, over-writing any previous values."},promoteId:{type:"promoteId",doc:"A property to use as a feature id (for feature state). Either a property name, or an object of the form `{<sourceLayer>: <propertyName>}`."}},source_video:{type:{required:!0,type:"enum",values:{video:{doc:"A video data source."}},doc:"The data type of the video source."},urls:{required:!0,type:"array",value:"string",doc:"URLs to video content in order of preferred format."},coordinates:{required:!0,doc:"Corners of video specified in longitude, latitude pairs.",type:"array",length:4,value:{type:"array",length:2,value:"number",doc:"A single longitude, latitude pair."}}},source_image:{type:{required:!0,type:"enum",values:{image:{doc:"An image data source."}},doc:"The data type of the image source."},url:{required:!0,type:"string",doc:"URL that points to an image."},coordinates:{required:!0,doc:"Corners of image specified in longitude, latitude pairs.",type:"array",length:4,value:{type:"array",length:2,value:"number",doc:"A single longitude, latitude pair."}}},layer:{id:{type:"string",doc:"Unique layer name.",required:!0},type:{type:"enum",values:{fill:{doc:"A filled polygon with an optional stroked border.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}}},line:{doc:"A stroked line.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}}},symbol:{doc:"An icon or a text label.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}}},circle:{doc:"A filled circle.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}}},heatmap:{doc:"A heatmap.","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},"fill-extrusion":{doc:"An extruded (3D) polygon.","sdk-support":{"basic functionality":{js:"0.27.0",android:"5.1.0",ios:"3.6.0",macos:"0.5.0"}}},raster:{doc:"Raster map textures such as satellite imagery.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}}},hillshade:{doc:"Client-side hillshading visualization based on DEM data. Currently, the implementation only supports Mapbox Terrain RGB and Mapzen Terrarium tiles.","sdk-support":{"basic functionality":{js:"0.43.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},background:{doc:"The background color or pattern of the map.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}}},sky:{doc:"A spherical dome around the map that is always rendered behind all other layers.","sdk-support":{"basic functionality":{js:"2.0.0",ios:"10.0.0",android:"10.0.0"}}}},doc:"Rendering type of this layer.",required:!0},metadata:{type:"*",doc:"Arbitrary properties useful to track with the layer, but do not influence rendering. Properties should be prefixed to avoid collisions, like 'mapbox:'."},source:{type:"string",doc:"Name of a source description to be used for this layer. Required for all layer types except `background`."},"source-layer":{type:"string",doc:"Layer to use from a vector tile source. Required for vector tile sources; prohibited for all other source types, including GeoJSON sources."},minzoom:{type:"number",minimum:0,maximum:24,doc:"The minimum zoom level for the layer. At zoom levels less than the minzoom, the layer will be hidden."},maxzoom:{type:"number",minimum:0,maximum:24,doc:"The maximum zoom level for the layer. At zoom levels equal to or greater than the maxzoom, the layer will be hidden."},filter:{type:"filter",doc:"A expression specifying conditions on source features. Only features that match the filter are displayed. Zoom expressions in filters are only evaluated at integer zoom levels. The `feature-state` expression is not supported in filter expressions."},layout:{type:"layout",doc:"Layout properties for the layer."},paint:{type:"paint",doc:"Default paint properties for this layer."}},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:{doc:"The layer is shown."},none:{doc:"The layer is not shown."}},default:"visible",doc:"Whether this layer is displayed.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},"property-type":"constant"}},layout_sky:{visibility:{type:"enum",values:{visible:{doc:"The layer is shown."},none:{doc:"The layer is not shown."}},default:"visible",doc:"Whether this layer is displayed.","sdk-support":{"basic functionality":{js:"2.0.0",ios:"10.0.0",android:"10.0.0"}},"property-type":"constant"}},layout_fill:{"fill-sort-key":{type:"number",doc:"Sorts features in ascending order based on this value. Features with a higher sort key will appear above features with a lower sort key.","sdk-support":{"basic functionality":{js:"1.2.0",android:"9.1.0",ios:"5.8.0",macos:"0.15.0"},"data-driven styling":{js:"1.2.0",android:"9.1.0",ios:"5.8.0",macos:"0.15.0"}},expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},visibility:{type:"enum",values:{visible:{doc:"The layer is shown."},none:{doc:"The layer is not shown."}},default:"visible",doc:"Whether this layer is displayed.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},"property-type":"constant"}},layout_circle:{"circle-sort-key":{type:"number",doc:"Sorts features in ascending order based on this value. Features with a higher sort key will appear above features with a lower sort key.","sdk-support":{"basic functionality":{js:"1.2.0",android:"9.2.0",ios:"5.9.0",macos:"0.16.0"},"data-driven styling":{js:"1.2.0",android:"9.2.0",ios:"5.9.0",macos:"0.16.0"}},expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},visibility:{type:"enum",values:{visible:{doc:"The layer is shown."},none:{doc:"The layer is not shown."}},default:"visible",doc:"Whether this layer is displayed.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},"property-type":"constant"}},layout_heatmap:{visibility:{type:"enum",values:{visible:{doc:"The layer is shown."},none:{doc:"The layer is not shown."}},default:"visible",doc:"Whether this layer is displayed.","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}},"property-type":"constant"}},"layout_fill-extrusion":{visibility:{type:"enum",values:{visible:{doc:"The layer is shown."},none:{doc:"The layer is not shown."}},default:"visible",doc:"Whether this layer is displayed.","sdk-support":{"basic functionality":{js:"0.27.0",android:"5.1.0",ios:"3.6.0",macos:"0.5.0"}},"property-type":"constant"}},layout_line:{"line-cap":{type:"enum",values:{butt:{doc:"A cap with a squared-off end which is drawn to the exact endpoint of the line."},round:{doc:"A cap with a rounded end which is drawn beyond the endpoint of the line at a radius of one-half of the line's width and centered on the endpoint of the line."},square:{doc:"A cap with a squared-off end which is drawn beyond the endpoint of the line at a distance of one-half of the line's width."}},default:"butt",doc:"The display of line endings.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"2.3.0"}},expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"line-join":{type:"enum",values:{bevel:{doc:"A join with a squared-off end which is drawn beyond the endpoint of the line at a distance of one-half of the line's width."},round:{doc:"A join with a rounded end which is drawn beyond the endpoint of the line at a radius of one-half of the line's width and centered on the endpoint of the line."},miter:{doc:"A join with a sharp, angled corner which is drawn with the outer sides beyond the endpoint of the path until they meet."}},default:"miter",doc:"The display of lines when joining.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.40.0",android:"5.2.0",ios:"3.7.0",macos:"0.6.0"}},expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"line-miter-limit":{type:"number",default:2,doc:"Used to automatically convert miter joins to bevel joins for sharp angles.",requires:[{"line-join":"miter"}],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"line-round-limit":{type:"number",default:1.05,doc:"Used to automatically convert round joins to miter joins for shallow angles.",requires:[{"line-join":"round"}],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"line-sort-key":{type:"number",doc:"Sorts features in ascending order based on this value. Features with a higher sort key will appear above features with a lower sort key.","sdk-support":{"basic functionality":{js:"1.2.0",android:"9.1.0",ios:"5.8.0",macos:"0.15.0"},"data-driven styling":{js:"1.2.0",android:"9.1.0",ios:"5.8.0",macos:"0.15.0"}},expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},visibility:{type:"enum",values:{visible:{doc:"The layer is shown."},none:{doc:"The layer is not shown."}},default:"visible",doc:"Whether this layer is displayed.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},"property-type":"constant"}},layout_symbol:{"symbol-placement":{type:"enum",values:{point:{doc:"The label is placed at the point where the geometry is located."},line:{doc:"The label is placed along the line of the geometry. Can only be used on `LineString` and `Polygon` geometries."},"line-center":{doc:"The label is placed at the center of the line of the geometry. Can only be used on `LineString` and `Polygon` geometries. Note that a single feature in a vector tile may contain multiple line geometries."}},default:"point",doc:"Label placement relative to its geometry.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"`line-center` value":{js:"0.47.0",android:"6.4.0",ios:"4.3.0",macos:"0.10.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"symbol-spacing":{type:"number",default:250,minimum:1,units:"pixels",doc:"Distance between two symbol anchors.",requires:[{"symbol-placement":"line"}],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"symbol-avoid-edges":{type:"boolean",default:!1,doc:"If true, the symbols will not cross tile edges to avoid mutual collisions. Recommended in layers that don't have enough padding in the vector tile to prevent collisions, or if it is a point symbol layer placed after a line symbol layer. When using a client that supports global collision detection, like Mapbox GL JS version 0.42.0 or greater, enabling this property is not needed to prevent clipped labels at tile boundaries.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"symbol-sort-key":{type:"number",doc:"Sorts features in ascending order based on this value. Features with lower sort keys are drawn and placed first. When `icon-allow-overlap` or `text-allow-overlap` is `false`, features with a lower sort key will have priority during placement. When `icon-allow-overlap` or `text-allow-overlap` is set to `true`, features with a higher sort key will overlap over features with a lower sort key.","sdk-support":{"basic functionality":{js:"0.53.0",android:"7.4.0",ios:"4.11.0",macos:"0.14.0"},"data-driven styling":{js:"0.53.0",android:"7.4.0",ios:"4.11.0",macos:"0.14.0"}},expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"symbol-z-order":{type:"enum",values:{auto:{doc:"Sorts symbols by `symbol-sort-key` if set. Otherwise, sorts symbols by their y-position relative to the viewport if `icon-allow-overlap` or `text-allow-overlap` is set to `true` or `icon-ignore-placement` or `text-ignore-placement` is `false`."},"viewport-y":{doc:"Sorts symbols by their y-position relative to the viewport if `icon-allow-overlap` or `text-allow-overlap` is set to `true` or `icon-ignore-placement` or `text-ignore-placement` is `false`."},source:{doc:"Sorts symbols by `symbol-sort-key` if set. Otherwise, no sorting is applied; symbols are rendered in the same order as the source data."}},default:"auto",doc:"Determines whether overlapping symbols in the same layer are rendered in the order that they appear in the data source or by their y-position relative to the viewport. To control the order and prioritization of symbols otherwise, use `symbol-sort-key`.","sdk-support":{"basic functionality":{js:"0.49.0",android:"6.6.0",ios:"4.5.0",macos:"0.12.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-allow-overlap":{type:"boolean",default:!1,doc:"If true, the icon will be visible even if it collides with other previously drawn symbols.",requires:["icon-image"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-ignore-placement":{type:"boolean",default:!1,doc:"If true, other symbols can be visible even if they collide with the icon.",requires:["icon-image"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-optional":{type:"boolean",default:!1,doc:"If true, text will display without their corresponding icons when the icon collides with other symbols and the text does not.",requires:["icon-image","text-field"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-rotation-alignment":{type:"enum",values:{map:{doc:"When `symbol-placement` is set to `point`, aligns icons east-west. When `symbol-placement` is set to `line` or `line-center`, aligns icon x-axes with the line."},viewport:{doc:"Produces icons whose x-axes are aligned with the x-axis of the viewport, regardless of the value of `symbol-placement`."},auto:{doc:"When `symbol-placement` is set to `point`, this is equivalent to `viewport`. When `symbol-placement` is set to `line` or `line-center`, this is equivalent to `map`."}},default:"auto",doc:"In combination with `symbol-placement`, determines the rotation behavior of icons.",requires:["icon-image"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"`auto` value":{js:"0.25.0",android:"4.2.0",ios:"3.4.0",macos:"0.3.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-size":{type:"number",default:1,minimum:0,units:"factor of the original icon size",doc:"Scales the original size of the icon by the provided factor. The new pixel size of the image will be the original pixel size multiplied by `icon-size`. 1 is the original size; 3 triples the size of the image.",requires:["icon-image"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.35.0",android:"5.1.0",ios:"3.6.0",macos:"0.5.0"}},expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-text-fit":{type:"enum",values:{none:{doc:"The icon is displayed at its intrinsic aspect ratio."},width:{doc:"The icon is scaled in the x-dimension to fit the width of the text."},height:{doc:"The icon is scaled in the y-dimension to fit the height of the text."},both:{doc:"The icon is scaled in both x- and y-dimensions."}},default:"none",doc:"Scales the icon to fit around the associated text.",requires:["icon-image","text-field"],"sdk-support":{"basic functionality":{js:"0.21.0",android:"4.2.0",ios:"3.4.0",macos:"0.2.1"},"stretchable icons":{js:"1.6.0",android:"9.2.0",ios:"5.8.0",macos:"0.15.0"}},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",doc:"Size of the additional area added to dimensions determined by `icon-text-fit`, in clockwise order: top, right, bottom, left.",requires:["icon-image","text-field",{"icon-text-fit":["both","width","height"]}],"sdk-support":{"basic functionality":{js:"0.21.0",android:"4.2.0",ios:"3.4.0",macos:"0.2.1"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"icon-image":{type:"resolvedImage",doc:"Name of image in sprite to use for drawing an image background.",tokens:!0,"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.35.0",android:"5.1.0",ios:"3.6.0",macos:"0.5.0"}},expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-rotate":{type:"number",default:0,period:360,units:"degrees",doc:"Rotates the icon clockwise.",requires:["icon-image"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.21.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-padding":{type:"number",default:2,minimum:0,units:"pixels",doc:"Size of the additional area around the icon bounding box used for detecting symbol collisions.",requires:["icon-image"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"icon-keep-upright":{type:"boolean",default:!1,doc:"If true, the icon may be flipped to prevent it from being rendered upside-down.",requires:["icon-image",{"icon-rotation-alignment":"map"},{"symbol-placement":["line","line-center"]}],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-offset":{type:"array",value:"number",length:2,default:[0,0],doc:"Offset distance of icon from its anchor. Positive values indicate right and down, while negative values indicate left and up. Each component is multiplied by the value of `icon-size` to obtain the final offset in pixels. When combined with `icon-rotate` the offset will be as if the rotated direction was up.",requires:["icon-image"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.29.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-anchor":{type:"enum",values:{center:{doc:"The center of the icon is placed closest to the anchor."},left:{doc:"The left side of the icon is placed closest to the anchor."},right:{doc:"The right side of the icon is placed closest to the anchor."},top:{doc:"The top of the icon is placed closest to the anchor."},bottom:{doc:"The bottom of the icon is placed closest to the anchor."},"top-left":{doc:"The top left corner of the icon is placed closest to the anchor."},"top-right":{doc:"The top right corner of the icon is placed closest to the anchor."},"bottom-left":{doc:"The bottom left corner of the icon is placed closest to the anchor."},"bottom-right":{doc:"The bottom right corner of the icon is placed closest to the anchor."}},default:"center",doc:"Part of the icon placed closest to the anchor.",requires:["icon-image"],"sdk-support":{"basic functionality":{js:"0.40.0",android:"5.2.0",ios:"3.7.0",macos:"0.6.0"},"data-driven styling":{js:"0.40.0",android:"5.2.0",ios:"3.7.0",macos:"0.6.0"}},expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-pitch-alignment":{type:"enum",values:{map:{doc:"The icon is aligned to the plane of the map."},viewport:{doc:"The icon is aligned to the plane of the viewport."},auto:{doc:"Automatically matches the value of `icon-rotation-alignment`."}},default:"auto",doc:"Orientation of icon when map is pitched.",requires:["icon-image"],"sdk-support":{"basic functionality":{js:"0.39.0",android:"5.2.0",ios:"3.7.0",macos:"0.6.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-pitch-alignment":{type:"enum",values:{map:{doc:"The text is aligned to the plane of the map."},viewport:{doc:"The text is aligned to the plane of the viewport."},auto:{doc:"Automatically matches the value of `text-rotation-alignment`."}},default:"auto",doc:"Orientation of text when map is pitched.",requires:["text-field"],"sdk-support":{"basic functionality":{js:"0.21.0",android:"4.2.0",ios:"3.4.0",macos:"0.2.1"},"`auto` value":{js:"0.25.0",android:"4.2.0",ios:"3.4.0",macos:"0.3.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-rotation-alignment":{type:"enum",values:{map:{doc:"When `symbol-placement` is set to `point`, aligns text east-west. When `symbol-placement` is set to `line` or `line-center`, aligns text x-axes with the line."},viewport:{doc:"Produces glyphs whose x-axes are aligned with the x-axis of the viewport, regardless of the value of `symbol-placement`."},auto:{doc:"When `symbol-placement` is set to `point`, this is equivalent to `viewport`. When `symbol-placement` is set to `line` or `line-center`, this is equivalent to `map`."}},default:"auto",doc:"In combination with `symbol-placement`, determines the rotation behavior of the individual glyphs forming the text.",requires:["text-field"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"`auto` value":{js:"0.25.0",android:"4.2.0",ios:"3.4.0",macos:"0.3.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-field":{type:"formatted",default:"",tokens:!0,doc:"Value to use for a text label. If a plain `string` is provided, it will be treated as a `formatted` with default/inherited formatting options.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.33.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.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"],doc:"Font stack to use for displaying text.",requires:["text-field"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.43.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}},expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-size":{type:"number",default:16,minimum:0,units:"pixels",doc:"Font size.",requires:["text-field"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.35.0",android:"5.1.0",ios:"3.6.0",macos:"0.5.0"}},expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-max-width":{type:"number",default:10,minimum:0,units:"ems",doc:"The maximum line width for text wrapping.",requires:["text-field",{"symbol-placement":["point"]}],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.40.0",android:"5.2.0",ios:"3.7.0",macos:"0.6.0"}},expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-line-height":{type:"number",default:1.2,units:"ems",doc:"Text leading value for multi-line text.",requires:["text-field"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"2.3.0"}},expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-letter-spacing":{type:"number",default:0,units:"ems",doc:"Text tracking amount.",requires:["text-field"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.40.0",android:"5.2.0",ios:"3.7.0",macos:"0.6.0"}},expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-justify":{type:"enum",values:{auto:{doc:"The text is aligned towards the anchor position."},left:{doc:"The text is aligned to the left."},center:{doc:"The text is centered."},right:{doc:"The text is aligned to the right."}},default:"center",doc:"Text justification options.",requires:["text-field"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.39.0",android:"5.2.0",ios:"3.7.0",macos:"0.6.0"},auto:{js:"0.54.0",android:"7.4.0",ios:"4.10.0",macos:"0.14.0"}},expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-radial-offset":{type:"number",units:"ems",default:0,doc:"Radial offset of text, in the direction of the symbol's anchor. Useful in combination with `text-variable-anchor`, which defaults to using the two-dimensional `text-offset` if present.","sdk-support":{"basic functionality":{js:"0.54.0",android:"7.4.0",ios:"4.10.0",macos:"0.14.0"},"data-driven styling":{js:"0.54.0",android:"7.4.0",ios:"4.10.0",macos:"0.14.0"}},requires:["text-field"],"property-type":"data-driven",expression:{interpolated:!0,parameters:["zoom","feature"]}},"text-variable-anchor":{type:"array",value:"enum",values:{center:{doc:"The center of the text is placed closest to the anchor."},left:{doc:"The left side of the text is placed closest to the anchor."},right:{doc:"The right side of the text is placed closest to the anchor."},top:{doc:"The top of the text is placed closest to the anchor."},bottom:{doc:"The bottom of the text is placed closest to the anchor."},"top-left":{doc:"The top left corner of the text is placed closest to the anchor."},"top-right":{doc:"The top right corner of the text is placed closest to the anchor."},"bottom-left":{doc:"The bottom left corner of the text is placed closest to the anchor."},"bottom-right":{doc:"The bottom right corner of the text is placed closest to the anchor."}},requires:["text-field",{"symbol-placement":["point"]}],doc:"To increase the chance of placing high-priority labels on the map, you can provide an array of `text-anchor` locations: the renderer will attempt to place the label at each location, in order, before moving onto the next label. Use `text-justify: auto` to choose justification based on anchor position. To apply an offset, use the `text-radial-offset` or the two-dimensional `text-offset`.","sdk-support":{"basic functionality":{js:"0.54.0",android:"7.4.0",ios:"4.10.0",macos:"0.14.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-anchor":{type:"enum",values:{center:{doc:"The center of the text is placed closest to the anchor."},left:{doc:"The left side of the text is placed closest to the anchor."},right:{doc:"The right side of the text is placed closest to the anchor."},top:{doc:"The top of the text is placed closest to the anchor."},bottom:{doc:"The bottom of the text is placed closest to the anchor."},"top-left":{doc:"The top left corner of the text is placed closest to the anchor."},"top-right":{doc:"The top right corner of the text is placed closest to the anchor."},"bottom-left":{doc:"The bottom left corner of the text is placed closest to the anchor."},"bottom-right":{doc:"The bottom right corner of the text is placed closest to the anchor."}},default:"center",doc:"Part of the text placed closest to the anchor.",requires:["text-field",{"!":"text-variable-anchor"}],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.39.0",android:"5.2.0",ios:"3.7.0",macos:"0.6.0"}},expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-max-angle":{type:"number",default:45,units:"degrees",doc:"Maximum angle change between adjacent characters.",requires:["text-field",{"symbol-placement":["line","line-center"]}],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-writing-mode":{type:"array",value:"enum",values:{horizontal:{doc:"If a text's language supports horizontal writing mode, symbols would be laid out horizontally."},vertical:{doc:"If a text's language supports vertical writing mode, symbols would be laid out vertically."}},doc:"The property allows control over a symbol's orientation. Note that the property values act as a hint, so that a symbol whose language doesn’t support the provided orientation will be laid out in its natural orientation. Example: English point symbol will be rendered horizontally even if array value contains single 'vertical' enum value. For symbol with point placement, the order of elements in an array define priority order for the placement of an orientation variant. For symbol with line placement, the default text writing mode is either ['horizontal', 'vertical'] or ['vertical', 'horizontal'], the order doesn't affect the placement.",requires:["text-field"],"sdk-support":{"basic functionality":{js:"1.3.0",android:"8.3.0",ios:"5.3.0",macos:"0.15.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-rotate":{type:"number",default:0,period:360,units:"degrees",doc:"Rotates the text clockwise.",requires:["text-field"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.35.0",android:"5.1.0",ios:"3.6.0",macos:"0.5.0"}},expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-padding":{type:"number",default:2,minimum:0,units:"pixels",doc:"Size of the additional area around the text bounding box used for detecting symbol collisions.",requires:["text-field"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-keep-upright":{type:"boolean",default:!0,doc:"If true, the text may be flipped vertically to prevent it from being rendered upside-down.",requires:["text-field",{"text-rotation-alignment":"map"},{"symbol-placement":["line","line-center"]}],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-transform":{type:"enum",values:{none:{doc:"The text is not altered."},uppercase:{doc:"Forces all letters to be displayed in uppercase."},lowercase:{doc:"Forces all letters to be displayed in lowercase."}},default:"none",doc:"Specifies how to capitalize text, similar to the CSS `text-transform` property.",requires:["text-field"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.33.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-offset":{type:"array",doc:"Offset distance of text from its anchor. Positive values indicate right and down, while negative values indicate left and up. If used with text-variable-anchor, input values will be taken as absolute values. Offsets along the x- and y-axis will be applied automatically based on the anchor position.",value:"number",units:"ems",length:2,default:[0,0],requires:["text-field",{"!":"text-radial-offset"}],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.35.0",android:"5.1.0",ios:"3.6.0",macos:"0.5.0"}},expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-allow-overlap":{type:"boolean",default:!1,doc:"If true, the text will be visible even if it collides with other previously drawn symbols.",requires:["text-field"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-ignore-placement":{type:"boolean",default:!1,doc:"If true, other symbols can be visible even if they collide with the text.",requires:["text-field"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-optional":{type:"boolean",default:!1,doc:"If true, icons will display without their corresponding text when the text collides with other symbols and the icon does not.",requires:["text-field","icon-image"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},visibility:{type:"enum",values:{visible:{doc:"The layer is shown."},none:{doc:"The layer is not shown."}},default:"visible",doc:"Whether this layer is displayed.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},"property-type":"constant"}},layout_raster:{visibility:{type:"enum",values:{visible:{doc:"The layer is shown."},none:{doc:"The layer is not shown."}},default:"visible",doc:"Whether this layer is displayed.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},"property-type":"constant"}},layout_hillshade:{visibility:{type:"enum",values:{visible:{doc:"The layer is shown."},none:{doc:"The layer is not shown."}},default:"visible",doc:"Whether this layer is displayed.","sdk-support":{"basic functionality":{js:"0.43.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}},"property-type":"constant"}},filter:{type:"array",value:"*",doc:"A filter selects specific features from a layer."},filter_operator:{type:"enum",values:{"==":{doc:'`["==", key, value]` equality: `feature[key] = value`'},"!=":{doc:'`["!=", key, value]` inequality: `feature[key] ≠ value`'},">":{doc:'`[">", key, value]` greater than: `feature[key] > value`'},">=":{doc:'`[">=", key, value]` greater than or equal: `feature[key] ≥ value`'},"<":{doc:'`["<", key, value]` less than: `feature[key] < value`'},"<=":{doc:'`["<=", key, value]` less than or equal: `feature[key] ≤ value`'},in:{doc:'`["in", key, v0, ..., vn]` set inclusion: `feature[key] ∈ {v0, ..., vn}`'},"!in":{doc:'`["!in", key, v0, ..., vn]` set exclusion: `feature[key] ∉ {v0, ..., vn}`'},all:{doc:'`["all", f0, ..., fn]` logical `AND`: `f0 ∧ ... ∧ fn`'},any:{doc:'`["any", f0, ..., fn]` logical `OR`: `f0 ∨ ... ∨ fn`'},none:{doc:'`["none", f0, ..., fn]` logical `NOR`: `¬f0 ∧ ... ∧ ¬fn`'},has:{doc:'`["has", key]` `feature[key]` exists'},"!has":{doc:'`["!has", key]` `feature[key]` does not exist'},within:{doc:'`["within", object]` feature geometry is within object geometry'}},doc:"The filter operator."},geometry_type:{type:"enum",values:{Point:{doc:"Filter to point geometries."},LineString:{doc:"Filter to line geometries."},Polygon:{doc:"Filter to polygon geometries."}},doc:"The geometry type for the filter to select."},function:{expression:{type:"expression",doc:"An expression."},stops:{type:"array",doc:"An array of stops.",value:"function_stop"},base:{type:"number",default:1,minimum:0,doc:"The exponential base of the interpolation curve. It controls the rate at which the result increases. Higher values make the result increase more towards the high end of the range. With `1` the stops are interpolated linearly."},property:{type:"string",doc:"The name of a feature property to use as the function input.",default:"$zoom"},type:{type:"enum",values:{identity:{doc:"Return the input value as the output value."},exponential:{doc:"Generate an output by interpolating between stops just less than and just greater than the function input."},interval:{doc:"Return the output value of the stop just less than the function input."},categorical:{doc:"Return the output value of the stop equal to the function input."}},doc:"The interpolation strategy to use in function evaluation.",default:"exponential"},colorSpace:{type:"enum",values:{rgb:{doc:"Use the RGB color space to interpolate color values"},lab:{doc:"Use the LAB color space to interpolate color values."},hcl:{doc:"Use the HCL color space to interpolate color values, interpolating the Hue, Chroma, and Luminance channels individually."}},doc:"The color space in which colors interpolated. Interpolating colors in perceptual color spaces like LAB and HCL tend to produce color ramps that look more consistent and produce colors that can be differentiated more easily than those interpolated in RGB space.",default:"rgb"},default:{type:"*",required:!1,doc:"A value to serve as a fallback function result when a value isn't otherwise available. It is used in the following circumstances:\n* In categorical functions, when the feature value does not match any of the stop domain values.\n* In property and zoom-and-property functions, when a feature does not contain a value for the specified property.\n* In identity functions, when the feature value is not valid for the style property (for example, if the function is being used for a `circle-color` property but the feature property value is not a string or not a valid color).\n* In interval or exponential property and zoom-and-property functions, when the feature value is not numeric.\nIf no default is provided, the style property's default is used in these circumstances."}},function_stop:{type:"array",minimum:0,maximum:24,value:["number","color"],length:2,doc:"Zoom level and value pair."},expression:{type:"array",value:"*",minimum:1,doc:"An expression defines a function that can be used for data-driven style properties or feature filters."},expression_name:{doc:"",type:"enum",values:{let:{doc:'Binds expressions to named variables, which can then be referenced in the result expression using ["var", "variable_name"].',group:"Variable binding","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},var:{doc:'References variable bound using "let".',group:"Variable binding","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},literal:{doc:"Provides a literal array or object value.",group:"Types","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},array:{doc:"Asserts that the input is an array (optionally with a specific item type and length). If, when the input expression is evaluated, it is not of the asserted type, then this assertion will cause the whole expression to be aborted.",group:"Types","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},at:{doc:"Retrieves an item from an array.",group:"Lookup","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},in:{doc:"Determines whether an item exists in an array or a substring exists in a string. In the specific case when the second and third arguments are string literals, you must wrap at least one of them in a [`literal`](#types-literal) expression to hint correct interpretation to the [type system](#type-system).",group:"Lookup","sdk-support":{"basic functionality":{js:"1.6.0",android:"9.1.0",ios:"5.8.0",macos:"0.15.0"}}},"index-of":{doc:"Returns the first position at which an item can be found in an array or a substring can be found in a string, or `-1` if the input cannot be found. Accepts an optional index from where to begin the search.",group:"Lookup","sdk-support":{"basic functionality":{js:"1.10.0"}}},slice:{doc:"Returns an item from an array or a substring from a string from a specified start index, or between a start index and an end index if set. The return value is inclusive of the start index but not of the end index.",group:"Lookup","sdk-support":{"basic functionality":{js:"1.10.0"}}},case:{doc:"Selects the first output whose corresponding test condition evaluates to true, or the fallback value otherwise.",group:"Decision","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},match:{doc:'Selects the output for which the label value matches the input value, or the fallback value if no match is found. The input can be any expression (for example, `["get", "building_type"]`). Each label must be unique, and must be either:\n - a single literal value; or\n - an array of literal values, the values of which must be all strings or all numbers (for example `[100, 101]` or `["c", "b"]`).\n\nThe input matches if any of the values in the array matches using strict equality, similar to the `"in"` operator.\nIf the input type does not match the type of the labels, the result will be the fallback value.',group:"Decision","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},coalesce:{doc:"Evaluates each expression in turn until the first non-null value is obtained, and returns that value.",group:"Decision","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},step:{doc:'Produces discrete, stepped results by evaluating a piecewise-constant function defined by pairs of input and output values ("stops"). The `input` may be any numeric expression (e.g., `["get", "population"]`). Stop inputs must be numeric literals in strictly ascending order. Returns the output value of the stop just less than the input, or the first output if the input is less than the first stop.',group:"Ramps, scales, curves","sdk-support":{"basic functionality":{js:"0.42.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},interpolate:{doc:'Produces continuous, smooth results by interpolating between pairs of input and output values ("stops"). The `input` may be any numeric expression (e.g., `["get", "population"]`). Stop inputs must be numeric literals in strictly ascending order. The output type must be `number`, `array<number>`, or `color`.\n\nInterpolation types:\n- `["linear"]`: Interpolates linearly between the pair of stops just less than and just greater than the input.\n- `["exponential", base]`: Interpolates exponentially between the stops just less than and just greater than the input. `base` controls the rate at which the output increases: higher values make the output increase more towards the high end of the range. With values close to 1 the output increases linearly.\n- `["cubic-bezier", x1, y1, x2, y2]`: Interpolates using the cubic bezier curve defined by the given control points.',group:"Ramps, scales, curves","sdk-support":{"basic functionality":{js:"0.42.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},"interpolate-hcl":{doc:'Produces continuous, smooth results by interpolating between pairs of input and output values ("stops"). Works like `interpolate`, but the output type must be `color`, and the interpolation is performed in the Hue-Chroma-Luminance color space.',group:"Ramps, scales, curves","sdk-support":{"basic functionality":{js:"0.49.0"}}},"interpolate-lab":{doc:'Produces continuous, smooth results by interpolating between pairs of input and output values ("stops"). Works like `interpolate`, but the output type must be `color`, and the interpolation is performed in the CIELAB color space.',group:"Ramps, scales, curves","sdk-support":{"basic functionality":{js:"0.49.0"}}},ln2:{doc:"Returns mathematical constant ln(2).",group:"Math","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},pi:{doc:"Returns the mathematical constant pi.",group:"Math","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},e:{doc:"Returns the mathematical constant e.",group:"Math","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},typeof:{doc:"Returns a string describing the type of the given value.",group:"Types","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},string:{doc:"Asserts that the input value is a string. If multiple values are provided, each one is evaluated in order until a string is obtained. If none of the inputs are strings, the expression is an error.",group:"Types","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},number:{doc:"Asserts that the input value is a number. If multiple values are provided, each one is evaluated in order until a number is obtained. If none of the inputs are numbers, the expression is an error.",group:"Types","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},boolean:{doc:"Asserts that the input value is a boolean. If multiple values are provided, each one is evaluated in order until a boolean is obtained. If none of the inputs are booleans, the expression is an error.",group:"Types","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},object:{doc:"Asserts that the input value is an object. If multiple values are provided, each one is evaluated in order until an object is obtained. If none of the inputs are objects, the expression is an error.",group:"Types","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},collator:{doc:"Returns a `collator` for use in locale-dependent comparison operations. The `case-sensitive` and `diacritic-sensitive` options default to `false`. The `locale` argument specifies the IETF language tag of the locale to use. If none is provided, the default locale is used. If the requested locale is not available, the `collator` will use a system-defined fallback locale. Use `resolved-locale` to test the results of locale fallback behavior.",group:"Types","sdk-support":{"basic functionality":{js:"0.45.0",android:"6.5.0",ios:"4.2.0",macos:"0.9.0"}}},format:{doc:'Returns a `formatted` string for displaying mixed-format text in the `text-field` property. The input may contain a string literal or expression, including an [`\'image\'`](#types-image) expression. Strings may be followed by a style override object that supports the following properties:\n- `"text-font"`: Overrides the font stack specified by the root layout property.\n- `"text-color"`: Overrides the color specified by the root paint property.\n- `"font-scale"`: Applies a scaling factor on `text-size` as specified by the root layout property.',group:"Types","sdk-support":{"basic functionality":{js:"0.48.0",android:"6.7.0",ios:"4.6.0",macos:"0.12.0"},"text-font":{js:"0.48.0",android:"6.7.0",ios:"4.6.0",macos:"0.12.0"},"font-scale":{js:"0.48.0",android:"6.7.0",ios:"4.6.0",macos:"0.12.0"},"text-color":{js:"1.3.0",android:"7.3.0",ios:"4.10.0",macos:"0.14.0"},image:{js:"1.6.0",android:"8.6.0",ios:"5.7.0",macos:"0.15.0"}}},image:{doc:"Returns an `image` type for use in `icon-image`, `*-pattern` entries and as a section in the `format` expression. If set, the `image` argument will check that the requested image exists in the style and will return either the resolved image name or `null`, depending on whether or not the image is currently in the style. This validation process is synchronous and requires the image to have been added to the style before requesting it in the `image` argument.",group:"Types","sdk-support":{"basic functionality":{js:"1.4.0",android:"8.6.0",ios:"5.7.0",macos:"0.15.0"}}},"number-format":{doc:"Converts the input number into a string representation using the providing formatting rules. If set, the `locale` argument specifies the locale to use, as a BCP 47 language tag. If set, the `currency` argument specifies an ISO 4217 code to use for currency-style formatting. If set, the `min-fraction-digits` and `max-fraction-digits` arguments specify the minimum and maximum number of fractional digits to include.",group:"Types","sdk-support":{"basic functionality":{js:"0.54.0",android:"8.4.0",ios:"5.4.0",macos:"0.15.0"}}},"to-string":{doc:'Converts the input value to a string. If the input is `null`, the result is `""`. If the input is a boolean, the result is `"true"` or `"false"`. If the input is a number, it is converted to a string as specified by the ["NumberToString" algorithm](https://tc39.github.io/ecma262/#sec-tostring-applied-to-the-number-type) of the ECMAScript Language Specification. If the input is a color, it is converted to a string of the form `"rgba(r,g,b,a)"`, where `r`, `g`, and `b` are numerals ranging from 0 to 255, and `a` ranges from 0 to 1. Otherwise, the input is converted to a string in the format specified by the [`JSON.stringify`](https://tc39.github.io/ecma262/#sec-json.stringify) function of the ECMAScript Language Specification.',group:"Types","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},"to-number":{doc:'Converts the input value to a number, if possible. If the input is `null` or `false`, the result is 0. If the input is `true`, the result is 1. If the input is a string, it is converted to a number as specified by the ["ToNumber Applied to the String Type" algorithm](https://tc39.github.io/ecma262/#sec-tonumber-applied-to-the-string-type) of the ECMAScript Language Specification. If multiple values are provided, each one is evaluated in order until the first successful conversion is obtained. If none of the inputs can be converted, the expression is an error.',group:"Types","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},"to-boolean":{doc:"Converts the input value to a boolean. The result is `false` when then input is an empty string, 0, `false`, `null`, or `NaN`; otherwise it is `true`.",group:"Types","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},"to-rgba":{doc:"Returns a four-element array containing the input color's red, green, blue, and alpha components, in that order.",group:"Color","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},"to-color":{doc:"Converts the input value to a color. If multiple values are provided, each one is evaluated in order until the first successful conversion is obtained. If none of the inputs can be converted, the expression is an error.",group:"Types","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},rgb:{doc:"Creates a color value from red, green, and blue components, which must range between 0 and 255, and an alpha component of 1. If any component is out of range, the expression is an error.",group:"Color","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},rgba:{doc:"Creates a color value from red, green, blue components, which must range between 0 and 255, and an alpha component which must range between 0 and 1. If any component is out of range, the expression is an error.",group:"Color","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},get:{doc:"Retrieves a property value from the current feature's properties, or from another object if a second argument is provided. Returns null if the requested property is missing.",group:"Lookup","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},has:{doc:"Tests for the presence of an property value in the current feature's properties, or from another object if a second argument is provided.",group:"Lookup","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},length:{doc:"Gets the length of an array or string.",group:"Lookup","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},properties:{doc:'Gets the feature properties object. Note that in some cases, it may be more efficient to use ["get", "property_name"] directly.',group:"Feature data","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},"feature-state":{doc:"Retrieves a property value from the current feature's state. Returns null if the requested property is not present on the feature's state. A feature's state is not part of the GeoJSON or vector tile data, and must be set programmatically on each feature. Features are identified by their `id` attribute, which must be an integer or a string that can be cast to an integer. Note that [\"feature-state\"] can only be used with paint properties that support data-driven styling.",group:"Feature data","sdk-support":{"basic functionality":{js:"0.46.0"}}},"geometry-type":{doc:"Gets the feature's geometry type: `Point`, `MultiPoint`, `LineString`, `MultiLineString`, `Polygon`, `MultiPolygon`. `Multi*` feature types are only returned in GeoJSON sources. When working with vector tile sources, use the singular forms.",group:"Feature data","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},id:{doc:"Gets the feature's id, if it has one.",group:"Feature data","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},zoom:{doc:'Gets the current zoom level. Note that in style layout and paint properties, ["zoom"] may only appear as the input to a top-level "step" or "interpolate" expression.',group:"Zoom","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},"heatmap-density":{doc:"Gets the kernel density estimation of a pixel in a heatmap layer, which is a relative measure of how many data points are crowded around a particular pixel. Can only be used in the `heatmap-color` property.",group:"Heatmap","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},"line-progress":{doc:"Gets the progress along a gradient line. Can only be used in the `line-gradient` property.",group:"Feature data","sdk-support":{"basic functionality":{js:"0.45.0",android:"6.5.0",ios:"4.6.0",macos:"0.12.0"}}},"sky-radial-progress":{doc:"Gets the distance of a point on the sky from the sun position. Returns 0 at sun position and 1 when the distance reaches `sky-gradient-radius`. Can only be used in the `sky-gradient` property.",group:"sky","sdk-support":{"basic functionality":{js:"2.0.0",ios:"10.0.0",android:"10.0.0"}}},accumulated:{doc:"Gets the value of a cluster property accumulated so far. Can only be used in the `clusterProperties` option of a clustered GeoJSON source.",group:"Feature data","sdk-support":{"basic functionality":{js:"0.53.0",android:"8.4.0",ios:"5.5.0",macos:"0.15.0"}}},"+":{doc:"Returns the sum of the inputs.",group:"Math","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},"*":{doc:"Returns the product of the inputs.",group:"Math","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},"-":{doc:"For two inputs, returns the result of subtracting the second input from the first. For a single input, returns the result of subtracting it from 0.",group:"Math","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},"/":{doc:"Returns the result of floating point division of the first input by the second.",group:"Math","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},"%":{doc:"Returns the remainder after integer division of the first input by the second.",group:"Math","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},"^":{doc:"Returns the result of raising the first input to the power specified by the second.",group:"Math","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},sqrt:{doc:"Returns the square root of the input.",group:"Math","sdk-support":{"basic functionality":{js:"0.42.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},log10:{doc:"Returns the base-ten logarithm of the input.",group:"Math","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},ln:{doc:"Returns the natural logarithm of the input.",group:"Math","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},log2:{doc:"Returns the base-two logarithm of the input.",group:"Math","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},sin:{doc:"Returns the sine of the input.",group:"Math","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},cos:{doc:"Returns the cosine of the input.",group:"Math","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},tan:{doc:"Returns the tangent of the input.",group:"Math","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},asin:{doc:"Returns the arcsine of the input.",group:"Math","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},acos:{doc:"Returns the arccosine of the input.",group:"Math","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},atan:{doc:"Returns the arctangent of the input.",group:"Math","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},min:{doc:"Returns the minimum value of the inputs.",group:"Math","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},max:{doc:"Returns the maximum value of the inputs.",group:"Math","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},round:{doc:'Rounds the input to the nearest integer. Halfway values are rounded away from zero. For example, `["round", -1.5]` evaluates to -2.',group:"Math","sdk-support":{"basic functionality":{js:"0.45.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},abs:{doc:"Returns the absolute value of the input.",group:"Math","sdk-support":{"basic functionality":{js:"0.45.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},ceil:{doc:"Returns the smallest integer that is greater than or equal to the input.",group:"Math","sdk-support":{"basic functionality":{js:"0.45.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},floor:{doc:"Returns the largest integer that is less than or equal to the input.",group:"Math","sdk-support":{"basic functionality":{js:"0.45.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},distance:{doc:"Returns the shortest distance in meters between the evaluated feature and the input geometry. The input value can be a valid GeoJSON of type `Point`, `MultiPoint`, `LineString`, `MultiLineString`, `Polygon`, `MultiPolygon`, `Feature`, or `FeatureCollection`. Distance values returned may vary in precision due to loss in precision from encoding geometries, particularly below zoom level 13.",group:"Math","sdk-support":{"basic functionality":{android:"9.2.0",ios:"5.9.0",macos:"0.16.0"}}},"==":{doc:"Returns `true` if the input values are equal, `false` otherwise. The comparison is strictly typed: values of different runtime types are always considered unequal. Cases where the types are known to be different at parse time are considered invalid and will produce a parse error. Accepts an optional `collator` argument to control locale-dependent string comparisons.",group:"Decision","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"},collator:{js:"0.45.0",android:"6.5.0",ios:"4.2.0",macos:"0.9.0"}}},"!=":{doc:"Returns `true` if the input values are not equal, `false` otherwise. The comparison is strictly typed: values of different runtime types are always considered unequal. Cases where the types are known to be different at parse time are considered invalid and will produce a parse error. Accepts an optional `collator` argument to control locale-dependent string comparisons.",group:"Decision","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"},collator:{js:"0.45.0",android:"6.5.0",ios:"4.2.0",macos:"0.9.0"}}},">":{doc:"Returns `true` if the first input is strictly greater than the second, `false` otherwise. The arguments are required to be either both strings or both numbers; if during evaluation they are not, expression evaluation produces an error. Cases where this constraint is known not to hold at parse time are considered in valid and will produce a parse error. Accepts an optional `collator` argument to control locale-dependent string comparisons.",group:"Decision","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"},collator:{js:"0.45.0",android:"6.5.0",ios:"4.2.0",macos:"0.9.0"}}},"<":{doc:"Returns `true` if the first input is strictly less than the second, `false` otherwise. The arguments are required to be either both strings or both numbers; if during evaluation they are not, expression evaluation produces an error. Cases where this constraint is known not to hold at parse time are considered in valid and will produce a parse error. Accepts an optional `collator` argument to control locale-dependent string comparisons.",group:"Decision","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"},collator:{js:"0.45.0",android:"6.5.0",ios:"4.2.0",macos:"0.9.0"}}},">=":{doc:"Returns `true` if the first input is greater than or equal to the second, `false` otherwise. The arguments are required to be either both strings or both numbers; if during evaluation they are not, expression evaluation produces an error. Cases where this constraint is known not to hold at parse time are considered in valid and will produce a parse error. Accepts an optional `collator` argument to control locale-dependent string comparisons.",group:"Decision","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"},collator:{js:"0.45.0",android:"6.5.0",ios:"4.2.0",macos:"0.9.0"}}},"<=":{doc:"Returns `true` if the first input is less than or equal to the second, `false` otherwise. The arguments are required to be either both strings or both numbers; if during evaluation they are not, expression evaluation produces an error. Cases where this constraint is known not to hold at parse time are considered in valid and will produce a parse error. Accepts an optional `collator` argument to control locale-dependent string comparisons.",group:"Decision","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"},collator:{js:"0.45.0",android:"6.5.0",ios:"4.2.0",macos:"0.9.0"}}},all:{doc:"Returns `true` if all the inputs are `true`, `false` otherwise. The inputs are evaluated in order, and evaluation is short-circuiting: once an input expression evaluates to `false`, the result is `false` and no further input expressions are evaluated.",group:"Decision","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},any:{doc:"Returns `true` if any of the inputs are `true`, `false` otherwise. The inputs are evaluated in order, and evaluation is short-circuiting: once an input expression evaluates to `true`, the result is `true` and no further input expressions are evaluated.",group:"Decision","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},"!":{doc:"Logical negation. Returns `true` if the input is `false`, and `false` if the input is `true`.",group:"Decision","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},within:{doc:"Returns `true` if the evaluated feature is fully contained inside a boundary of the input geometry, `false` otherwise. The input value can be a valid GeoJSON of type `Polygon`, `MultiPolygon`, `Feature`, or `FeatureCollection`. Supported features for evaluation:\n- `Point`: Returns `false` if a point is on the boundary or falls outside the boundary.\n- `LineString`: Returns `false` if any part of a line falls outside the boundary, the line intersects the boundary, or a line's endpoint is on the boundary.",group:"Decision","sdk-support":{"basic functionality":{js:"1.9.0",android:"9.1.0",ios:"5.8.0",macos:"0.15.0"}}},"is-supported-script":{doc:"Returns `true` if the input string is expected to render legibly. Returns `false` if the input string contains sections that cannot be rendered without potential loss of meaning (e.g. Indic scripts that require complex text shaping, or right-to-left scripts if the the `mapbox-gl-rtl-text` plugin is not in use in Mapbox GL JS).",group:"String","sdk-support":{"basic functionality":{js:"0.45.0",android:"6.6.0"}}},upcase:{doc:"Returns the input string converted to uppercase. Follows the Unicode Default Case Conversion algorithm and the locale-insensitive case mappings in the Unicode Character Database.",group:"String","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},downcase:{doc:"Returns the input string converted to lowercase. Follows the Unicode Default Case Conversion algorithm and the locale-insensitive case mappings in the Unicode Character Database.",group:"String","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},concat:{doc:"Returns a `string` consisting of the concatenation of the inputs. Each input is converted to a string as if by `to-string`.",group:"String","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},"resolved-locale":{doc:"Returns the IETF language tag of the locale being used by the provided `collator`. This can be used to determine the default system locale, or to determine if a requested locale was successfully loaded.",group:"String","sdk-support":{"basic functionality":{js:"0.45.0",android:"6.5.0",ios:"4.2.0",macos:"0.9.0"}}}}},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"]},doc:"The start and end distance range in which fog fades from fully transparent to fully opaque. The distance to the point at the center of the map is defined as zero, so that negative range values are closer to the camera, and positive values are farther away.",example:[.5,10],"sdk-support":{"basic functionality":{js:"2.3.0"}}},color:{type:"color","property-type":"data-constant",default:"#ffffff",expression:{interpolated:!0,parameters:["zoom"]},transition:!0,doc:"The color of the fog. Using opacity is recommended only for smoothly transitioning fog on/off as anything less than 100% opacity results in more tiles loaded and drawn.","sdk-support":{"basic functionality":{js:"2.3.0"}}},"horizon-blend":{type:"number","property-type":"data-constant",default:.1,minimum:0,maximum:1,expression:{interpolated:!0,parameters:["zoom"]},transition:!0,doc:"Horizon blend applies a smooth fade from the color of the fog to the color of the sky. A value of zero leaves a sharp transition from fog to sky. Increasing the value blends the color of fog into increasingly high angles of the sky.","sdk-support":{"basic functionality":{js:"2.3.0"}}}},light:{anchor:{type:"enum",default:"viewport",values:{map:{doc:"The position of the light source is aligned to the rotation of the map."},viewport:{doc:"The position of the light source is aligned to the rotation of the viewport."}},"property-type":"data-constant",transition:!1,expression:{interpolated:!1,parameters:["zoom"]},doc:"Whether extruded geometries are lit relative to the map or viewport.",example:"map","sdk-support":{"basic functionality":{js:"0.27.0",android:"5.1.0",ios:"3.6.0",macos:"0.5.0"}}},position:{type:"array",default:[1.15,210,30],length:3,value:"number","property-type":"data-constant",transition:!0,expression:{interpolated:!0,parameters:["zoom"]},doc:"Position of the light source relative to lit (extruded) geometries, in [r radial coordinate, a azimuthal angle, p polar angle] where r indicates the distance from the center of the base of an object to its light, a indicates the position of the light relative to 0° (0° when `light.anchor` is set to `viewport` corresponds to the top of the viewport, or 0° when `light.anchor` is set to `map` corresponds to due north, and degrees proceed clockwise), and p indicates the height of the light (from 0°, directly above, to 180°, directly below).",example:[1.5,90,80],"sdk-support":{"basic functionality":{js:"0.27.0",android:"5.1.0",ios:"3.6.0",macos:"0.5.0"}}},color:{type:"color","property-type":"data-constant",default:"#ffffff",expression:{interpolated:!0,parameters:["zoom"]},transition:!0,doc:"Color tint for lighting extruded geometries.","sdk-support":{"basic functionality":{js:"0.27.0",android:"5.1.0",ios:"3.6.0",macos:"0.5.0"}}},intensity:{type:"number","property-type":"data-constant",default:.5,minimum:0,maximum:1,expression:{interpolated:!0,parameters:["zoom"]},transition:!0,doc:"Intensity of lighting (on a scale from 0 to 1). Higher numbers will present as more extreme contrast.","sdk-support":{"basic functionality":{js:"0.27.0",android:"5.1.0",ios:"3.6.0",macos:"0.5.0"}}}},terrain:{source:{type:"string",doc:"Name of a source of `raster_dem` type to be used for terrain elevation.",required:!0,"sdk-support":{"basic functionality":{js:"2.0.0",ios:"10.0.0",android:"10.0.0"}}},exaggeration:{type:"number","property-type":"data-constant",default:1,minimum:0,maximum:1e3,expression:{interpolated:!0,parameters:["zoom"]},transition:!0,doc:"Exaggerates the elevation of the terrain by multiplying the data from the DEM with this value.","sdk-support":{"basic functionality":{js:"2.0.0",ios:"10.0.0",android:"10.0.0"}}}},paint:["paint_fill","paint_line","paint_circle","paint_heatmap","paint_fill-extrusion","paint_symbol","paint_raster","paint_hillshade","paint_background","paint_sky"],paint_fill:{"fill-antialias":{type:"boolean",default:!0,doc:"Whether or not the fill should be antialiased.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"fill-opacity":{type:"number",default:1,minimum:0,maximum:1,doc:"The opacity of the entire fill layer. In contrast to the `fill-color`, this value will also affect the 1px stroke around the fill, if the stroke is used.",transition:!0,"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.21.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-color":{type:"color",default:"#000000",doc:"The color of the filled part of this layer. This color can be specified as `rgba` with an alpha component and the color's opacity will not affect the opacity of the 1px stroke, if it is used.",transition:!0,requires:[{"!":"fill-pattern"}],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.19.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-outline-color":{type:"color",doc:"The outline color of the fill. Matches the value of `fill-color` if unspecified.",transition:!0,requires:[{"!":"fill-pattern"},{"fill-antialias":!0}],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.19.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.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",doc:"The geometry's offset. Values are [x, y] where negatives indicate left and up, respectively.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"fill-translate-anchor":{type:"enum",values:{map:{doc:"The fill is translated relative to the map."},viewport:{doc:"The fill is translated relative to the viewport."}},doc:"Controls the frame of reference for `fill-translate`.",default:"map",requires:["fill-translate"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"fill-pattern":{type:"resolvedImage",transition:!0,doc:"Name of image in sprite to use for drawing image fills. For seamless patterns, image width and height must be a factor of two (2, 4, 8, ..., 512). Note that zoom-dependent expressions will be evaluated only at integer zoom levels.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.49.0",android:"6.5.0",macos:"0.11.0",ios:"4.4.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,doc:"The opacity of the entire fill extrusion layer. This is rendered on a per-layer, not per-feature, basis, and data-driven styling is not available.",transition:!0,"sdk-support":{"basic functionality":{js:"0.27.0",android:"5.1.0",ios:"3.6.0",macos:"0.5.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"fill-extrusion-color":{type:"color",default:"#000000",doc:"The base color of the extruded fill. The extrusion's surfaces will be shaded differently based on this color in combination with the root `light` settings. If this color is specified as `rgba` with an alpha component, the alpha component will be ignored; use `fill-extrusion-opacity` to set layer opacity.",transition:!0,requires:[{"!":"fill-extrusion-pattern"}],"sdk-support":{"basic functionality":{js:"0.27.0",android:"5.1.0",ios:"3.6.0",macos:"0.5.0"},"data-driven styling":{js:"0.27.0",android:"5.1.0",ios:"3.6.0",macos:"0.5.0"}},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",doc:"The geometry's offset. Values are [x, y] where negatives indicate left and up (on the flat plane), respectively.","sdk-support":{"basic functionality":{js:"0.27.0",android:"5.1.0",ios:"3.6.0",macos:"0.5.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"fill-extrusion-translate-anchor":{type:"enum",values:{map:{doc:"The fill extrusion is translated relative to the map."},viewport:{doc:"The fill extrusion is translated relative to the viewport."}},doc:"Controls the frame of reference for `fill-extrusion-translate`.",default:"map",requires:["fill-extrusion-translate"],"sdk-support":{"basic functionality":{js:"0.27.0",android:"5.1.0",ios:"3.6.0",macos:"0.5.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"fill-extrusion-pattern":{type:"resolvedImage",transition:!0,doc:"Name of image in sprite to use for drawing images on extruded fills. For seamless patterns, image width and height must be a factor of two (2, 4, 8, ..., 512). Note that zoom-dependent expressions will be evaluated only at integer zoom levels.","sdk-support":{"basic functionality":{js:"0.27.0",android:"5.1.0",ios:"3.6.0",macos:"0.5.0"},"data-driven styling":{js:"0.49.0",android:"6.5.0",macos:"0.11.0",ios:"4.4.0"}},expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"cross-faded-data-driven"},"fill-extrusion-height":{type:"number",default:0,minimum:0,units:"meters",doc:"The height with which to extrude this layer.",transition:!0,"sdk-support":{"basic functionality":{js:"0.27.0",android:"5.1.0",ios:"3.6.0",macos:"0.5.0"},"data-driven styling":{js:"0.27.0",android:"5.1.0",ios:"3.6.0",macos:"0.5.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-base":{type:"number",default:0,minimum:0,units:"meters",doc:"The height with which to extrude the base of this layer. Must be less than or equal to `fill-extrusion-height`.",transition:!0,requires:["fill-extrusion-height"],"sdk-support":{"basic functionality":{js:"0.27.0",android:"5.1.0",ios:"3.6.0",macos:"0.5.0"},"data-driven styling":{js:"0.27.0",android:"5.1.0",ios:"3.6.0",macos:"0.5.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-vertical-gradient":{type:"boolean",default:!0,doc:"Whether to apply a vertical gradient to the sides of a fill-extrusion layer. If true, sides will be shaded slightly darker farther down.",transition:!1,"sdk-support":{"basic functionality":{js:"0.50.0",android:"7.0.0",ios:"4.7.0",macos:"0.13.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"}},paint_line:{"line-opacity":{type:"number",doc:"The opacity at which the line will be drawn.",default:1,minimum:0,maximum:1,transition:!0,"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.29.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-color":{type:"color",doc:"The color with which the line will be drawn.",default:"#000000",transition:!0,requires:[{"!":"line-pattern"}],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.23.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},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",doc:"The geometry's offset. Values are [x, y] where negatives indicate left and up, respectively.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"line-translate-anchor":{type:"enum",values:{map:{doc:"The line is translated relative to the map."},viewport:{doc:"The line is translated relative to the viewport."}},doc:"Controls the frame of reference for `line-translate`.",default:"map",requires:["line-translate"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"line-width":{type:"number",default:1,minimum:0,transition:!0,units:"pixels",doc:"Stroke thickness.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.39.0",android:"5.2.0",ios:"3.7.0",macos:"0.6.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-gap-width":{type:"number",default:0,minimum:0,doc:"Draws a line casing outside of a line's actual path. Value indicates the width of the inner gap.",transition:!0,units:"pixels","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.29.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-offset":{type:"number",default:0,doc:"The line's offset. For linear features, a positive value offsets the line to the right, relative to the direction of the line, and a negative value to the left. For polygon features, a positive value results in an inset, and a negative value results in an outset.",transition:!0,units:"pixels","sdk-support":{"basic functionality":{js:"0.12.1",android:"3.0.0",ios:"3.1.0",macos:"0.1.0"},"data-driven styling":{js:"0.29.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-blur":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",doc:"Blur applied to the line, in pixels.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.29.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-dasharray":{type:"array",value:"number",doc:"Specifies the lengths of the alternating dashes and gaps that form the dash pattern. The lengths are later scaled by the line width. To convert a dash length to pixels, multiply the length by the current line width. Note that GeoJSON sources with `lineMetrics: true` specified won't render dashed lines to the expected scale. Also note that zoom-dependent expressions will be evaluated only at integer zoom levels.",minimum:0,transition:!0,units:"line widths",requires:[{"!":"line-pattern"}],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"2.3.0"}},expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"cross-faded-data-driven"},"line-pattern":{type:"resolvedImage",transition:!0,doc:"Name of image in sprite to use for drawing image lines. For seamless patterns, image width must be a factor of two (2, 4, 8, ..., 512). Note that zoom-dependent expressions will be evaluated only at integer zoom levels.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.49.0",android:"6.5.0",macos:"0.11.0",ios:"4.4.0"}},expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"cross-faded-data-driven"},"line-gradient":{type:"color",doc:'Defines a gradient with which to color a line feature. Can only be used with GeoJSON sources that specify `"lineMetrics": true`.',transition:!1,requires:[{"!":"line-dasharray"},{"!":"line-pattern"},{source:"geojson",has:{lineMetrics:!0}}],"sdk-support":{"basic functionality":{js:"0.45.0",android:"6.5.0",ios:"4.4.0",macos:"0.11.0"},"data-driven styling":{}},expression:{interpolated:!0,parameters:["line-progress"]},"property-type":"color-ramp"}},paint_circle:{"circle-radius":{type:"number",default:5,minimum:0,transition:!0,units:"pixels",doc:"Circle radius.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.18.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-color":{type:"color",default:"#000000",doc:"The fill color of the circle.",transition:!0,"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.18.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-blur":{type:"number",default:0,doc:"Amount to blur the circle. 1 blurs the circle such that only the centerpoint is full opacity.",transition:!0,"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.20.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-opacity":{type:"number",doc:"The opacity at which the circle will be drawn.",default:1,minimum:0,maximum:1,transition:!0,"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.20.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.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",doc:"The geometry's offset. Values are [x, y] where negatives indicate left and up, respectively.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"circle-translate-anchor":{type:"enum",values:{map:{doc:"The circle is translated relative to the map."},viewport:{doc:"The circle is translated relative to the viewport."}},doc:"Controls the frame of reference for `circle-translate`.",default:"map",requires:["circle-translate"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"circle-pitch-scale":{type:"enum",values:{map:{doc:"Circles are scaled according to their apparent distance to the camera."},viewport:{doc:"Circles are not scaled."}},default:"map",doc:"Controls the scaling behavior of the circle when the map is pitched.","sdk-support":{"basic functionality":{js:"0.21.0",android:"4.2.0",ios:"3.4.0",macos:"0.2.1"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"circle-pitch-alignment":{type:"enum",values:{map:{doc:"The circle is aligned to the plane of the map."},viewport:{doc:"The circle is aligned to the plane of the viewport."}},default:"viewport",doc:"Orientation of circle when map is pitched.","sdk-support":{"basic functionality":{js:"0.39.0",android:"5.2.0",ios:"3.7.0",macos:"0.6.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"circle-stroke-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",doc:"The width of the circle's stroke. Strokes are placed outside of the `circle-radius`.","sdk-support":{"basic functionality":{js:"0.29.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"},"data-driven styling":{js:"0.29.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-stroke-color":{type:"color",default:"#000000",doc:"The stroke color of the circle.",transition:!0,"sdk-support":{"basic functionality":{js:"0.29.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"},"data-driven styling":{js:"0.29.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-stroke-opacity":{type:"number",doc:"The opacity of the circle's stroke.",default:1,minimum:0,maximum:1,transition:!0,"sdk-support":{"basic functionality":{js:"0.29.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"},"data-driven styling":{js:"0.29.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.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",doc:"Radius of influence of one heatmap point in pixels. Increasing the value makes the heatmap smoother, but less detailed.","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"},"data-driven styling":{js:"0.43.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"heatmap-weight":{type:"number",default:1,minimum:0,transition:!1,doc:"A measure of how much an individual point contributes to the heatmap. A value of 10 would be equivalent to having 10 points of weight 1 in the same spot. Especially useful when combined with clustering.","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"},"data-driven styling":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"heatmap-intensity":{type:"number",default:1,minimum:0,transition:!0,doc:"Similar to `heatmap-weight` but controls the intensity of the heatmap globally. Primarily used for adjusting the heatmap based on zoom level.","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.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"],doc:'Defines the color of each pixel based on its density value in a heatmap. Should be an expression that uses `["heatmap-density"]` as input.',transition:!1,"sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"},"data-driven styling":{}},expression:{interpolated:!0,parameters:["heatmap-density"]},"property-type":"color-ramp"},"heatmap-opacity":{type:"number",doc:"The global opacity at which the heatmap layer will be drawn.",default:1,minimum:0,maximum:1,transition:!0,"sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},paint_symbol:{"icon-opacity":{doc:"The opacity at which the icon will be drawn.",type:"number",default:1,minimum:0,maximum:1,transition:!0,requires:["icon-image"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.33.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-color":{type:"color",default:"#000000",transition:!0,doc:"The color of the icon. This can only be used with sdf icons.",requires:["icon-image"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.33.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},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,doc:"The color of the icon's halo. Icon halos can only be used with SDF icons.",requires:["icon-image"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.33.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},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",doc:"Distance of halo to the icon outline.",requires:["icon-image"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.33.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},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",doc:"Fade out the halo towards the outside.",requires:["icon-image"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.33.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},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",doc:"Distance that the icon's anchor is moved from its original placement. Positive values indicate right and down, while negative values indicate left and up.",requires:["icon-image"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"icon-translate-anchor":{type:"enum",values:{map:{doc:"Icons are translated relative to the map."},viewport:{doc:"Icons are translated relative to the viewport."}},doc:"Controls the frame of reference for `icon-translate`.",default:"map",requires:["icon-image","icon-translate"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-opacity":{type:"number",doc:"The opacity at which the text will be drawn.",default:1,minimum:0,maximum:1,transition:!0,requires:["text-field"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.33.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-color":{type:"color",doc:"The color with which the text will be drawn.",default:"#000000",transition:!0,overridable:!0,requires:["text-field"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.33.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},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,doc:"The color of the text's halo, which helps it stand out from backgrounds.",requires:["text-field"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.33.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},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",doc:"Distance of halo to the font outline. Max text halo width is 1/4 of the font-size.",requires:["text-field"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.33.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},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",doc:"The halo's fadeout distance towards the outside.",requires:["text-field"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.33.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},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",doc:"Distance that the text's anchor is moved from its original placement. Positive values indicate right and down, while negative values indicate left and up.",requires:["text-field"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-translate-anchor":{type:"enum",values:{map:{doc:"The text is translated relative to the map."},viewport:{doc:"The text is translated relative to the viewport."}},doc:"Controls the frame of reference for `text-translate`.",default:"map",requires:["text-field","text-translate"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"}},paint_raster:{"raster-opacity":{type:"number",doc:"The opacity at which the image will be drawn.",default:1,minimum:0,maximum:1,transition:!0,"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-hue-rotate":{type:"number",default:0,period:360,transition:!0,units:"degrees",doc:"Rotates hues around the color wheel.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-brightness-min":{type:"number",doc:"Increase or reduce the brightness of the image. The value is the minimum brightness.",default:0,minimum:0,maximum:1,transition:!0,"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-brightness-max":{type:"number",doc:"Increase or reduce the brightness of the image. The value is the maximum brightness.",default:1,minimum:0,maximum:1,transition:!0,"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-saturation":{type:"number",doc:"Increase or reduce the saturation of the image.",default:0,minimum:-1,maximum:1,transition:!0,"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-contrast":{type:"number",doc:"Increase or reduce the contrast of the image.",default:0,minimum:-1,maximum:1,transition:!0,"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-resampling":{type:"enum",doc:"The resampling/interpolation method to use for overscaling, also known as texture magnification filter",values:{linear:{doc:"(Bi)linear filtering interpolates pixel values using the weighted average of the four closest original source pixels creating a smooth but blurry look when overscaled"},nearest:{doc:"Nearest neighbor filtering interpolates pixel values using the nearest original source pixel creating a sharp but pixelated look when overscaled"}},default:"linear","sdk-support":{"basic functionality":{js:"0.47.0",android:"6.3.0",ios:"4.2.0",macos:"0.9.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"raster-fade-duration":{type:"number",default:300,minimum:0,transition:!1,units:"milliseconds",doc:"Fade duration when a new tile is added.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},paint_hillshade:{"hillshade-illumination-direction":{type:"number",default:335,minimum:0,maximum:359,doc:"The direction of the light source used to generate the hillshading with 0 as the top of the viewport if `hillshade-illumination-anchor` is set to `viewport` and due north if `hillshade-illumination-anchor` is set to `map`.",transition:!1,"sdk-support":{"basic functionality":{js:"0.43.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-illumination-anchor":{type:"enum",values:{map:{doc:"The hillshade illumination is relative to the north direction."},viewport:{doc:"The hillshade illumination is relative to the top of the viewport."}},default:"viewport",doc:"Direction of light source when map is rotated.","sdk-support":{"basic functionality":{js:"0.43.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-exaggeration":{type:"number",doc:"Intensity of the hillshade",default:.5,minimum:0,maximum:1,transition:!0,"sdk-support":{"basic functionality":{js:"0.43.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-shadow-color":{type:"color",default:"#000000",doc:"The shading color of areas that face away from the light source.",transition:!0,"sdk-support":{"basic functionality":{js:"0.43.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-highlight-color":{type:"color",default:"#FFFFFF",doc:"The shading color of areas that faces towards the light source.",transition:!0,"sdk-support":{"basic functionality":{js:"0.43.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-accent-color":{type:"color",default:"#000000",doc:"The shading color used to accentuate rugged terrain like sharp cliffs and gorges.",transition:!0,"sdk-support":{"basic functionality":{js:"0.43.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},paint_background:{"background-color":{type:"color",default:"#000000",doc:"The color with which the background will be drawn.",transition:!0,requires:[{"!":"background-pattern"}],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"background-pattern":{type:"resolvedImage",transition:!0,doc:"Name of image in sprite to use for drawing an image background. For seamless patterns, image width and height must be a factor of two (2, 4, 8, ..., 512). Note that zoom-dependent expressions will be evaluated only at integer zoom levels.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"cross-faded"},"background-opacity":{type:"number",default:1,minimum:0,maximum:1,doc:"The opacity at which the background will be drawn.",transition:!0,"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},paint_sky:{"sky-type":{type:"enum",values:{gradient:{doc:"Renders the sky with a gradient that can be configured with `sky-gradient-radius` and `sky-gradient`."},atmosphere:{doc:"Renders the sky with a simulated atmospheric scattering algorithm, the sun direction can be attached to the light position or explicitly set through `sky-atmosphere-sun`."}},default:"atmosphere",doc:"The type of the sky","sdk-support":{"basic functionality":{js:"2.0.0",ios:"10.0.0",android:"10.0.0"}},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,doc:"Position of the sun center [a azimuthal angle, p polar angle]. The azimuthal angle indicates the position of the sun relative to 0° north, where degrees proceed clockwise. The polar angle indicates the height of the sun, where 0° is directly above, at zenith, and 90° at the horizon. When this property is ommitted, the sun center is directly inherited from the light position.","sdk-support":{"basic functionality":{js:"2.0.0",ios:"10.0.0",android:"10.0.0"}},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,doc:"Intensity of the sun as a light source in the atmosphere (on a scale from 0 to a 100). Setting higher values will brighten up the sky.","sdk-support":{"basic functionality":{js:"2.0.0",ios:"10.0.0",android:"10.0.0"}},"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,doc:"Position of the gradient center [a azimuthal angle, p polar angle]. The azimuthal angle indicates the position of the gradient center relative to 0° north, where degrees proceed clockwise. The polar angle indicates the height of the gradient center, where 0° is directly above, at zenith, and 90° at the horizon.","sdk-support":{"basic functionality":{js:"2.0.0",ios:"10.0.0",android:"10.0.0"}},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,doc:"The angular distance (measured in degrees) from `sky-gradient-center` up to which the gradient extends. A value of 180 causes the gradient to wrap around to the opposite direction from `sky-gradient-center`.","sdk-support":{"basic functionality":{js:"2.0.0",ios:"10.0.0",android:"10.0.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"sky-gradient":{type:"color",default:["interpolate",["linear"],["sky-radial-progress"],.8,"#87ceeb",1,"white"],doc:"Defines a radial color gradient with which to color the sky. The color values can be interpolated with an expression using `sky-radial-progress`. The range [0, 1] for the interpolant covers a radial distance (in degrees) of [0, `sky-gradient-radius`] centered at the position specified by `sky-gradient-center`.",transition:!1,requires:[{"sky-type":"gradient"}],"sdk-support":{"basic functionality":{js:"2.0.0",ios:"10.0.0",android:"10.0.0"},"data-driven styling":{}},expression:{interpolated:!0,parameters:["sky-radial-progress"]},"property-type":"color-ramp"},"sky-atmosphere-halo-color":{type:"color",default:"white",doc:"A color applied to the atmosphere sun halo. The alpha channel describes how strongly the sun halo is represented in an atmosphere sky layer.",transition:!1,requires:[{"sky-type":"atmosphere"}],"sdk-support":{"basic functionality":{js:"2.0.0",ios:"10.0.0",android:"10.0.0"}},"property-type":"data-constant"},"sky-atmosphere-color":{type:"color",default:"white",doc:"A color used to tweak the main atmospheric scattering coefficients. Using white applies the default coefficients giving the natural blue color to the atmosphere. This color affects how heavily the corresponding wavelength is represented during scattering. The alpha channel describes the density of the atmosphere, with 1 maximum density and 0 no density.",transition:!1,requires:[{"sky-type":"atmosphere"}],"sdk-support":{"basic functionality":{js:"2.0.0",ios:"10.0.0",android:"10.0.0"}},"property-type":"data-constant"},"sky-opacity":{type:"number",default:1,minimum:0,maximum:1,doc:"The opacity of the entire sky layer.",transition:!0,"sdk-support":{"basic functionality":{js:"2.0.0",ios:"10.0.0",android:"10.0.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},transition:{duration:{type:"number",default:300,minimum:0,units:"milliseconds",doc:"Time allotted for transitions to complete."},delay:{type:"number",default:0,minimum:0,units:"milliseconds",doc:"Length of time before a transition begins."}},"property-type":{"data-driven":{type:"property-type",doc:"Property is interpolable and can be represented using a property expression."},"cross-faded":{type:"property-type",doc:"Property is non-interpolable; rather, its values will be cross-faded to smoothly transition between integer zooms."},"cross-faded-data-driven":{type:"property-type",doc:"Property is non-interpolable; rather, its values will be cross-faded to smoothly transition between integer zooms. It can be represented using a property expression."},"color-ramp":{type:"property-type",doc:"Property should be specified using a color ramp from which the output color can be sampled based on a property calculation."},"data-constant":{type:"property-type",doc:"Property is interpolable but cannot be represented using a property expression."},constant:{type:"property-type",doc:"Property is constant across all zoom levels and property values."}},promoteId:{"*":{type:"string",doc:"A name of a feature property to use as ID for feature state."}}},zf="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function Gf(t){var e={exports:{}};return t(e,e.exports),e.exports}function Nf(t,e){return Object.prototype.hasOwnProperty.call(t,e)}
|
40
|
+
/*! https://mths.be/punycode v1.3.2 by @mathias */
|
41
|
+
Gf((function(t,e){!function(i){var n=e&&!e.nodeType&&e,r=t&&!t.nodeType&&t,o="object"==typeof zf&&zf;o.global!==o&&o.window!==o&&o.self!==o||(i=o);var s,a,l=2147483647,u=36,h=/^xn--/,c=/[^\x20-\x7E]/,p=/[\x2E\u3002\uFF0E\uFF61]/g,d={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},f=Math.floor,y=String.fromCharCode;function g(t){throw RangeError(d[t])}function m(t,e){for(var i=t.length,n=[];i--;)n[i]=e(t[i]);return n}function v(t,e){var i=t.split("@"),n="";return i.length>1&&(n=i[0]+"@",t=i[1]),n+m((t=t.replace(p,".")).split("."),e).join(".")}function _(t){for(var e,i,n=[],r=0,o=t.length;r<o;)(e=t.charCodeAt(r++))>=55296&&e<=56319&&r<o?56320==(64512&(i=t.charCodeAt(r++)))?n.push(((1023&e)<<10)+(1023&i)+65536):(n.push(e),r--):n.push(e);return n}function x(t){return m(t,(function(t){var e="";return t>65535&&(e+=y((t-=65536)>>>10&1023|55296),t=56320|1023&t),e+=y(t)})).join("")}function b(t,e){return t+22+75*(t<26)-((0!=e)<<5)}function w(t,e,i){var n=0;for(t=i?f(t/700):t>>1,t+=f(t/e);t>455;n+=u)t=f(t/35);return f(n+36*t/(t+38))}function S(t){var e,i,n,r,o,s,a,h,c,p,d,y=[],m=t.length,v=0,_=128,b=72;for((i=t.lastIndexOf("-"))<0&&(i=0),n=0;n<i;++n)t.charCodeAt(n)>=128&&g("not-basic"),y.push(t.charCodeAt(n));for(r=i>0?i+1:0;r<m;){for(o=v,s=1,a=u;r>=m&&g("invalid-input"),((h=(d=t.charCodeAt(r++))-48<10?d-22:d-65<26?d-65:d-97<26?d-97:u)>=u||h>f((l-v)/s))&&g("overflow"),v+=h*s,!(h<(c=a<=b?1:a>=b+26?26:a-b));a+=u)s>f(l/(p=u-c))&&g("overflow"),s*=p;b=w(v-o,e=y.length+1,0==o),f(v/e)>l-_&&g("overflow"),_+=f(v/e),v%=e,y.splice(v++,0,_)}return x(y)}function C(t){var e,i,n,r,o,s,a,h,c,p,d,m,v,x,S,C=[];for(m=(t=_(t)).length,e=128,i=0,o=72,s=0;s<m;++s)(d=t[s])<128&&C.push(y(d));for(n=r=C.length,r&&C.push("-");n<m;){for(a=l,s=0;s<m;++s)(d=t[s])>=e&&d<a&&(a=d);for(a-e>f((l-i)/(v=n+1))&&g("overflow"),i+=(a-e)*v,e=a,s=0;s<m;++s)if((d=t[s])<e&&++i>l&&g("overflow"),d==e){for(h=i,c=u;!(h<(p=c<=o?1:c>=o+26?26:c-o));c+=u)S=h-p,x=u-p,C.push(y(b(p+S%x,0))),h=f(S/x);C.push(y(b(h,0))),o=w(i,v,n==r),i=0,++n}++i,++e}return C.join("")}if(s={version:"1.3.2",ucs2:{decode:_,encode:x},decode:S,encode:C,toASCII:function(t){return v(t,(function(t){return c.test(t)?"xn--"+C(t):t}))},toUnicode:function(t){return v(t,(function(t){return h.test(t)?S(t.slice(4).toLowerCase()):t}))}},n&&r)if(t.exports==n)r.exports=s;else for(a in s)s.hasOwnProperty(a)&&(n[a]=s[a]);else i.punycode=s}(zf)}));var Bf=function(t,e,i,n){e=e||"&",i=i||"=";var r={};if("string"!=typeof t||0===t.length)return r;var o=/\+/g;t=t.split(e);var s=1e3;n&&"number"==typeof n.maxKeys&&(s=n.maxKeys);var a=t.length;s>0&&a>s&&(a=s);for(var l=0;l<a;++l){var u,h,c,p,d=t[l].replace(o,"%20"),f=d.indexOf(i);f>=0?(u=d.substr(0,f),h=d.substr(f+1)):(u=d,h=""),c=decodeURIComponent(u),p=decodeURIComponent(h),Nf(r,c)?Array.isArray(r[c])?r[c].push(p):r[c]=[r[c],p]:r[c]=p}return r},Wf=function(t){switch(typeof t){case"string":return t;case"boolean":return t?"true":"false";case"number":return isFinite(t)?t:"";default:return""}},qf=function(t,e,i,n){return e=e||"&",i=i||"=",null===t&&(t=void 0),"object"==typeof t?Object.keys(t).map((function(n){var r=encodeURIComponent(Wf(n))+i;return Array.isArray(t[n])?t[n].map((function(t){return r+encodeURIComponent(Wf(t))})).join(e):r+encodeURIComponent(Wf(t[n]))})).join(e):n?encodeURIComponent(Wf(n))+i+encodeURIComponent(Wf(t)):""};Gf((function(t,e){e.decode=e.parse=Bf,e.encode=e.stringify=qf}));class Vf extends Error{constructor(t,e){super(e),this.message=e,this.key=t}}class Uf{constructor(t,e=[]){this.parent=t,this.bindings={};for(const[i,n]of e)this.bindings[i]=n}concat(t){return new Uf(this,t)}get(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.`)}has(t){return!!this.bindings[t]||!!this.parent&&this.parent.has(t)}}const Xf={kind:"null"},Kf={kind:"number"},Yf={kind:"string"},Zf={kind:"boolean"},Hf={kind:"color"},$f={kind:"object"},Jf={kind:"value"},Qf={kind:"collator"},ty={kind:"formatted"},ey={kind:"resolvedImage"};function iy(t,e){return{kind:"array",itemType:t,N:e}}function ny(t){if("array"===t.kind){const e=ny(t.itemType);return"number"==typeof t.N?`array<${e}, ${t.N}>`:"value"===t.itemType.kind?"array":`array<${e}>`}return t.kind}const ry=[Xf,Kf,Yf,Zf,Hf,ty,$f,iy(Jf),ey];function oy(t,e){if("error"===e.kind)return null;if("array"===t.kind){if("array"===e.kind&&(0===e.N&&"value"===e.itemType.kind||!oy(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(const t of ry)if(!oy(t,e))return null}return`Expected ${ny(t)} but found ${ny(e)} instead.`}function sy(t,e){return e.some((e=>e.kind===t.kind))}function ay(t,e){return e.some((e=>"null"===e?null===t:"array"===e?Array.isArray(t):"object"===e?t&&!Array.isArray(t)&&"object"==typeof t:e===typeof t))}var ly=Gf((function(t,e){var i={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 n(t){return(t=Math.round(t))<0?0:t>255?255:t}function r(t){return t<0?0:t>1?1:t}function o(t){return"%"===t[t.length-1]?n(parseFloat(t)/100*255):n(parseInt(t))}function s(t){return"%"===t[t.length-1]?r(parseFloat(t)/100):r(parseFloat(t))}function a(t,e,i){return i<0?i+=1:i>1&&(i-=1),6*i<1?t+(e-t)*i*6:2*i<1?e:3*i<2?t+(e-t)*(2/3-i)*6:t}try{e.parseCSSColor=function(t){var e,r=t.replace(/ /g,"").toLowerCase();if(r in i)return i[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 l=r.indexOf("("),u=r.indexOf(")");if(-1!==l&&u+1===r.length){var h=r.substr(0,l),c=r.substr(l+1,u-(l+1)).split(","),p=1;switch(h){case"rgba":if(4!==c.length)return null;p=s(c.pop());case"rgb":return 3!==c.length?null:[o(c[0]),o(c[1]),o(c[2]),p];case"hsla":if(4!==c.length)return null;p=s(c.pop());case"hsl":if(3!==c.length)return null;var d=(parseFloat(c[0])%360+360)%360/360,f=s(c[1]),y=s(c[2]),g=y<=.5?y*(f+1):y+f-y*f,m=2*y-g;return[n(255*a(m,g,d+1/3)),n(255*a(m,g,d)),n(255*a(m,g,d-1/3)),p];default:return null}}return null}}catch(l){}}));class uy{constructor(t,e,i,n=1){this.r=t,this.g=e,this.b=i,this.a=n}static parse(t){if(!t)return;if(t instanceof uy)return t;if("string"!=typeof t)return;const e=ly.parseCSSColor(t);return e?new uy(e[0]/255*e[3],e[1]/255*e[3],e[2]/255*e[3],e[3]):void 0}toString(){const[t,e,i,n]=this.toArray();return`rgba(${Math.round(t)},${Math.round(e)},${Math.round(i)},${n})`}toArray(){const{r:t,g:e,b:i,a:n}=this;return 0===n?[0,0,0,0]:[255*t/n,255*e/n,255*i/n,n]}}uy.black=new uy(0,0,0,1),uy.white=new uy(1,1,1,1),uy.transparent=new uy(0,0,0,0),uy.red=new uy(1,0,0,1),uy.blue=new uy(0,0,1,1);class hy{constructor(t,e,i){this.sensitivity=t?e?"variant":"case":e?"accent":"base",this.locale=i,this.collator=new Intl.Collator(this.locale?this.locale:[],{sensitivity:this.sensitivity,usage:"search"})}compare(t,e){return this.collator.compare(t,e)}resolvedLocale(){return new Intl.Collator(this.locale?this.locale:[]).resolvedOptions().locale}}class cy{constructor(t,e,i,n,r){this.text=t,this.image=e,this.scale=i,this.fontStack=n,this.textColor=r}}class py{constructor(t){this.sections=t}static fromString(t){return new py([new cy(t,null,null,null,null)])}isEmpty(){return 0===this.sections.length||!this.sections.some((t=>0!==t.text.length||t.image&&0!==t.image.name.length))}static factory(t){return t instanceof py?t:py.fromString(t)}toString(){return 0===this.sections.length?"":this.sections.map((t=>t.text)).join("")}serialize(){const t=["format"];for(const e of this.sections){if(e.image){t.push(["image",e.image.name]);continue}t.push(e.text);const i={};e.fontStack&&(i["text-font"]=["literal",e.fontStack.split(",")]),e.scale&&(i["font-scale"]=e.scale),e.textColor&&(i["text-color"]=["rgba"].concat(e.textColor.toArray())),t.push(i)}return t}}class dy{constructor(t){this.name=t.name,this.available=t.available}toString(){return this.name}static fromString(t){return t?new dy({name:t,available:!1}):null}serialize(){return["image",this.name]}}function fy(t,e,i,n){if(!("number"==typeof t&&t>=0&&t<=255&&"number"==typeof e&&e>=0&&e<=255&&"number"==typeof i&&i>=0&&i<=255)){return`Invalid rgba value [${("number"==typeof n?[t,e,i,n]:[t,e,i]).join(", ")}]: 'r', 'g', and 'b' must be between 0 and 255.`}return void 0===n||"number"==typeof n&&n>=0&&n<=1?null:`Invalid rgba value [${[t,e,i,n].join(", ")}]: 'a' must be between 0 and 1.`}function yy(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 uy)return!0;if(t instanceof hy)return!0;if(t instanceof py)return!0;if(t instanceof dy)return!0;if(Array.isArray(t)){for(const e of t)if(!yy(e))return!1;return!0}if("object"==typeof t){for(const e in t)if(!yy(t[e]))return!1;return!0}return!1}function gy(t){if(null===t)return Xf;if("string"==typeof t)return Yf;if("boolean"==typeof t)return Zf;if("number"==typeof t)return Kf;if(t instanceof uy)return Hf;if(t instanceof hy)return Qf;if(t instanceof py)return ty;if(t instanceof dy)return ey;if(Array.isArray(t)){const e=t.length;let i;for(const n of t){const t=gy(n);if(i){if(i===t)continue;i=Jf;break}i=t}return iy(i||Jf,e)}return $f}function my(t){const e=typeof t;return null===t?"":"string"===e||"number"===e||"boolean"===e?String(t):t instanceof uy||t instanceof py||t instanceof dy?t.toString():JSON.stringify(t)}class vy{constructor(t,e){this.type=t,this.value=e}static parse(t,e){if(2!==t.length)return e.error(`'literal' expression requires exactly one argument, but found ${t.length-1} instead.`);if(!yy(t[1]))return e.error("invalid value");const i=t[1];let n=gy(i);const r=e.expectedType;return"array"!==n.kind||0!==n.N||!r||"array"!==r.kind||"number"==typeof r.N&&0!==r.N||(n=r),new vy(n,i)}evaluate(){return this.value}eachChild(){}outputDefined(){return!0}serialize(){return"array"===this.type.kind||"object"===this.type.kind?["literal",this.value]:this.value instanceof uy?["rgba"].concat(this.value.toArray()):this.value instanceof py?this.value.serialize():this.value}}class _y{constructor(t){this.name="ExpressionEvaluationError",this.message=t}toJSON(){return this.message}}const xy={string:Yf,number:Kf,boolean:Zf,object:$f};class by{constructor(t,e){this.type=t,this.args=e}static parse(t,e){if(t.length<2)return e.error("Expected at least one argument.");let i,n=1;const r=t[0];if("array"===r){let r,o;if(t.length>2){const i=t[1];if("string"!=typeof i||!(i in xy)||"object"===i)return e.error('The item type argument of "array" must be one of string, number, boolean',1);r=xy[i],n++}else r=Jf;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);o=t[2],n++}i=iy(r,o)}else i=xy[r];const o=[];for(;n<t.length;n++){const i=e.parse(t[n],n,Jf);if(!i)return null;o.push(i)}return new by(i,o)}evaluate(t){for(let e=0;e<this.args.length;e++){const i=this.args[e].evaluate(t);if(!oy(this.type,gy(i)))return i;if(e===this.args.length-1)throw new _y(`Expected value to be of type ${ny(this.type)}, but found ${ny(gy(i))} instead.`)}return null}eachChild(t){this.args.forEach(t)}outputDefined(){return this.args.every((t=>t.outputDefined()))}serialize(){const t=this.type,e=[t.kind];if("array"===t.kind){const i=t.itemType;if("string"===i.kind||"number"===i.kind||"boolean"===i.kind){e.push(i.kind);const n=t.N;("number"==typeof n||this.args.length>1)&&e.push(n)}}return e.concat(this.args.map((t=>t.serialize())))}}class wy{constructor(t){this.type=ty,this.sections=t}static parse(t,e){if(t.length<2)return e.error("Expected at least one argument.");const i=t[1];if(!Array.isArray(i)&&"object"==typeof i)return e.error("First argument must be an image or text section.");const n=[];let r=!1;for(let o=1;o<=t.length-1;++o){const i=t[o];if(r&&"object"==typeof i&&!Array.isArray(i)){r=!1;let t=null;if(i["font-scale"]&&(t=e.parse(i["font-scale"],1,Kf),!t))return null;let o=null;if(i["text-font"]&&(o=e.parse(i["text-font"],1,iy(Yf)),!o))return null;let s=null;if(i["text-color"]&&(s=e.parse(i["text-color"],1,Hf),!s))return null;const a=n[n.length-1];a.scale=t,a.font=o,a.textColor=s}else{const i=e.parse(t[o],1,Jf);if(!i)return null;const s=i.type.kind;if("string"!==s&&"value"!==s&&"null"!==s&&"resolvedImage"!==s)return e.error("Formatted text type must be 'string', 'value', 'image' or 'null'.");r=!0,n.push({content:i,scale:null,font:null,textColor:null})}}return new wy(n)}evaluate(t){return new py(this.sections.map((e=>{const i=e.content.evaluate(t);return gy(i)===ey?new cy("",i,null,null,null):new cy(my(i),null,e.scale?e.scale.evaluate(t):null,e.font?e.font.evaluate(t).join(","):null,e.textColor?e.textColor.evaluate(t):null)})))}eachChild(t){for(const e of this.sections)t(e.content),e.scale&&t(e.scale),e.font&&t(e.font),e.textColor&&t(e.textColor)}outputDefined(){return!1}serialize(){const t=["format"];for(const e of this.sections){t.push(e.content.serialize());const i={};e.scale&&(i["font-scale"]=e.scale.serialize()),e.font&&(i["text-font"]=e.font.serialize()),e.textColor&&(i["text-color"]=e.textColor.serialize()),t.push(i)}return t}}class Sy{constructor(t){this.type=ey,this.input=t}static parse(t,e){if(2!==t.length)return e.error("Expected two arguments.");const i=e.parse(t[1],1,Yf);return i?new Sy(i):e.error("No image name provided.")}evaluate(t){const e=this.input.evaluate(t),i=dy.fromString(e);return i&&t.availableImages&&(i.available=t.availableImages.indexOf(e)>-1),i}eachChild(t){t(this.input)}outputDefined(){return!1}serialize(){return["image",this.input.serialize()]}}const Cy={"to-boolean":Zf,"to-color":Hf,"to-number":Kf,"to-string":Yf};class Ty{constructor(t,e){this.type=t,this.args=e}static parse(t,e){if(t.length<2)return e.error("Expected at least one argument.");const i=t[0];if(("to-boolean"===i||"to-string"===i)&&2!==t.length)return e.error("Expected one argument.");const n=Cy[i],r=[];for(let o=1;o<t.length;o++){const i=e.parse(t[o],o,Jf);if(!i)return null;r.push(i)}return new Ty(n,r)}evaluate(t){if("boolean"===this.type.kind)return Boolean(this.args[0].evaluate(t));if("color"===this.type.kind){let e,i;for(const n of this.args){if(e=n.evaluate(t),i=null,e instanceof uy)return e;if("string"==typeof e){const i=t.parseColor(e);if(i)return i}else if(Array.isArray(e)&&(i=e.length<3||e.length>4?`Invalid rbga value ${JSON.stringify(e)}: expected an array containing either three or four numeric values.`:fy(e[0],e[1],e[2],e[3]),!i))return new uy(e[0]/255,e[1]/255,e[2]/255,e[3])}throw new _y(i||`Could not parse color from value '${"string"==typeof e?e:String(JSON.stringify(e))}'`)}if("number"===this.type.kind){let e=null;for(const i of this.args){if(e=i.evaluate(t),null===e)return 0;const n=Number(e);if(!isNaN(n))return n}throw new _y(`Could not convert ${JSON.stringify(e)} to number.`)}return"formatted"===this.type.kind?py.fromString(my(this.args[0].evaluate(t))):"resolvedImage"===this.type.kind?dy.fromString(my(this.args[0].evaluate(t))):my(this.args[0].evaluate(t))}eachChild(t){this.args.forEach(t)}outputDefined(){return this.args.every((t=>t.outputDefined()))}serialize(){if("formatted"===this.type.kind)return new wy([{content:this.args[0],scale:null,font:null,textColor:null}]).serialize();if("resolvedImage"===this.type.kind)return new Sy(this.args[0]).serialize();const t=[`to-${this.type.kind}`];return this.eachChild((e=>{t.push(e.serialize())})),t}}const Ey=["Unknown","Point","LineString","Polygon"];class ky{constructor(){this.globals=null,this.feature=null,this.featureState=null,this.formattedSection=null,this._parseColorCache={},this.availableImages=null,this.canonical=null}id(){return this.feature&&"id"in this.feature?this.feature.id:null}geometryType(){return this.feature?"number"==typeof this.feature.type?Ey[this.feature.type]:this.feature.type:null}geometry(){return this.feature&&"geometry"in this.feature?this.feature.geometry:null}canonicalID(){return this.canonical}properties(){return this.feature&&this.feature.properties||{}}parseColor(t){let e=this._parseColorCache[t];return e||(e=this._parseColorCache[t]=uy.parse(t)),e}}class Py{constructor(t,e,i,n){this.name=t,this.type=e,this._evaluate=i,this.args=n}evaluate(t){return this._evaluate(t,this.args)}eachChild(t){this.args.forEach(t)}outputDefined(){return!1}serialize(){return[this.name].concat(this.args.map((t=>t.serialize())))}static parse(t,e){const i=t[0],n=Py.definitions[i];if(!n)return e.error(`Unknown expression "${i}". If you wanted a literal array, use ["literal", [...]].`,0);const r=Array.isArray(n)?n[0]:n.type,o=Array.isArray(n)?[[n[1],n[2]]]:n.overloads,s=o.filter((([e])=>!Array.isArray(e)||e.length===t.length-1));let a=null;for(const[l,u]of s){a=new $y(e.registry,e.path,null,e.scope);const n=[];let o=!1;for(let e=1;e<t.length;e++){const i=t[e],r=Array.isArray(l)?l[e-1]:l.type,s=a.parse(i,1+n.length,r);if(!s){o=!0;break}n.push(s)}if(!o)if(Array.isArray(l)&&l.length!==n.length)a.error(`Expected ${l.length} arguments, but found ${n.length} instead.`);else{for(let t=0;t<n.length;t++){const e=Array.isArray(l)?l[t]:l.type,i=n[t];a.concat(t+1).checkSubtype(e,i.type)}if(0===a.errors.length)return new Py(i,r,u,n)}}if(1===s.length)e.errors.push(...a.errors);else{const i=(s.length?s:o).map((([t])=>{return e=t,Array.isArray(e)?`(${e.map(ny).join(", ")})`:`(${ny(e.type)}...)`;var e})).join(" | "),n=[];for(let r=1;r<t.length;r++){const i=e.parse(t[r],1+n.length);if(!i)return null;n.push(ny(i.type))}e.error(`Expected arguments of type ${i}, but found (${n.join(", ")}) instead.`)}return null}static register(t,e){Py.definitions=e;for(const i in e)t[i]=Py}}class Oy{constructor(t,e,i){this.type=Qf,this.locale=i,this.caseSensitive=t,this.diacriticSensitive=e}static parse(t,e){if(2!==t.length)return e.error("Expected one argument.");const i=t[1];if("object"!=typeof i||Array.isArray(i))return e.error("Collator options argument must be an object.");const n=e.parse(void 0!==i["case-sensitive"]&&i["case-sensitive"],1,Zf);if(!n)return null;const r=e.parse(void 0!==i["diacritic-sensitive"]&&i["diacritic-sensitive"],1,Zf);if(!r)return null;let o=null;return i.locale&&(o=e.parse(i.locale,1,Yf),!o)?null:new Oy(n,r,o)}evaluate(t){return new hy(this.caseSensitive.evaluate(t),this.diacriticSensitive.evaluate(t),this.locale?this.locale.evaluate(t):null)}eachChild(t){t(this.caseSensitive),t(this.diacriticSensitive),this.locale&&t(this.locale)}outputDefined(){return!1}serialize(){const t={};return t["case-sensitive"]=this.caseSensitive.serialize(),t["diacritic-sensitive"]=this.diacriticSensitive.serialize(),this.locale&&(t.locale=this.locale.serialize()),["collator",t]}}function Ry(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 Iy(t,e){return!(t[0]<=e[0])&&(!(t[2]>=e[2])&&(!(t[1]<=e[1])&&!(t[3]>=e[3])))}function Fy(t,e){const i=(180+t[0])/360;const n=(r=t[1],(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+r*Math.PI/360)))/360);var r;const o=Math.pow(2,e.z);return[Math.round(i*o*8192),Math.round(n*o*8192)]}function jy(t,e,i){const n=t[0]-e[0],r=t[1]-e[1],o=t[0]-i[0],s=t[1]-i[1];return n*s-o*r==0&&n*o<=0&&r*s<=0}function My(t,e){let i=!1;for(let s=0,a=e.length;s<a;s++){const a=e[s];for(let e=0,s=a.length;e<s-1;e++){if(jy(t,a[e],a[e+1]))return!1;n=t,r=a[e],o=a[e+1],r[1]>n[1]!=o[1]>n[1]&&n[0]<(o[0]-r[0])*(n[1]-r[1])/(o[1]-r[1])+r[0]&&(i=!i)}}var n,r,o;return i}function Ay(t,e){for(let i=0;i<e.length;i++)if(My(t,e[i]))return!0;return!1}function Ly(t,e,i,n){const r=t[0]-i[0],o=t[1]-i[1],s=e[0]-i[0],a=e[1]-i[1],l=n[0]-i[0],u=n[1]-i[1],h=r*u-l*o,c=s*u-l*a;return h>0&&c<0||h<0&&c>0}function Dy(t,e,i,n){const r=[e[0]-t[0],e[1]-t[1]],o=[n[0]-i[0],n[1]-i[1]];return 0!=(s=o)[0]*(a=r)[1]-s[1]*a[0]&&!(!Ly(t,e,i,n)||!Ly(i,n,t,e));var s,a}function zy(t,e,i){for(const n of i)for(let i=0;i<n.length-1;++i)if(Dy(t,e,n[i],n[i+1]))return!0;return!1}function Gy(t,e){for(let i=0;i<t.length;++i)if(!My(t[i],e))return!1;for(let i=0;i<t.length-1;++i)if(zy(t[i],t[i+1],e))return!1;return!0}function Ny(t,e){for(let i=0;i<e.length;i++)if(Gy(t,e[i]))return!0;return!1}function By(t,e,i){const n=[];for(let r=0;r<t.length;r++){const o=[];for(let n=0;n<t[r].length;n++){const s=Fy(t[r][n],i);Ry(e,s),o.push(s)}n.push(o)}return n}function Wy(t,e,i){const n=[];for(let r=0;r<t.length;r++){const o=By(t[r],e,i);n.push(o)}return n}function qy(t,e,i,n){if(t[0]<i[0]||t[0]>i[2]){const e=.5*n;let r=t[0]-i[0]>e?-n:i[0]-t[0]>e?n:0;0===r&&(r=t[0]-i[2]>e?-n:i[2]-t[0]>e?n:0),t[0]+=r}Ry(e,t)}function Vy(t,e,i,n){const r=8192*Math.pow(2,n.z),o=[8192*n.x,8192*n.y],s=[];for(const a of t)for(const t of a){const n=[t.x+o[0],t.y+o[1]];qy(n,e,i,r),s.push(n)}return s}function Uy(t,e,i,n){const r=8192*Math.pow(2,n.z),o=[8192*n.x,8192*n.y],s=[];for(const l of t){const t=[];for(const i of l){const n=[i.x+o[0],i.y+o[1]];Ry(e,n),t.push(n)}s.push(t)}if(e[2]-e[0]<=r/2){(a=e)[0]=a[1]=1/0,a[2]=a[3]=-1/0;for(const t of s)for(const n of t)qy(n,e,i,r)}var a;return s}class Xy{constructor(t,e){this.type=Zf,this.geojson=t,this.geometries=e}static parse(t,e){if(2!==t.length)return e.error(`'within' expression requires exactly one argument, but found ${t.length-1} instead.`);if(yy(t[1])){const e=t[1];if("FeatureCollection"===e.type)for(let t=0;t<e.features.length;++t){const i=e.features[t].geometry.type;if("Polygon"===i||"MultiPolygon"===i)return new Xy(e,e.features[t].geometry)}else if("Feature"===e.type){const t=e.geometry.type;if("Polygon"===t||"MultiPolygon"===t)return new Xy(e,e.geometry)}else if("Polygon"===e.type||"MultiPolygon"===e.type)return new Xy(e,e)}return e.error("'within' expression requires valid geojson object that contains polygon geometry type.")}evaluate(t){if(null!=t.geometry()&&null!=t.canonicalID()){if("Point"===t.geometryType())return function(t,e){const i=[1/0,1/0,-1/0,-1/0],n=[1/0,1/0,-1/0,-1/0],r=t.canonicalID();if("Polygon"===e.type){const o=By(e.coordinates,n,r),s=Vy(t.geometry(),i,n,r);if(!Iy(i,n))return!1;for(const t of s)if(!My(t,o))return!1}if("MultiPolygon"===e.type){const o=Wy(e.coordinates,n,r),s=Vy(t.geometry(),i,n,r);if(!Iy(i,n))return!1;for(const t of s)if(!Ay(t,o))return!1}return!0}(t,this.geometries);if("LineString"===t.geometryType())return function(t,e){const i=[1/0,1/0,-1/0,-1/0],n=[1/0,1/0,-1/0,-1/0],r=t.canonicalID();if("Polygon"===e.type){const o=By(e.coordinates,n,r),s=Uy(t.geometry(),i,n,r);if(!Iy(i,n))return!1;for(const t of s)if(!Gy(t,o))return!1}if("MultiPolygon"===e.type){const o=Wy(e.coordinates,n,r),s=Uy(t.geometry(),i,n,r);if(!Iy(i,n))return!1;for(const t of s)if(!Ny(t,o))return!1}return!0}(t,this.geometries)}return!1}eachChild(){}outputDefined(){return!0}serialize(){return["within",this.geojson]}}function Ky(t){if(t instanceof Py){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 Xy)return!1;let e=!0;return t.eachChild((t=>{e&&!Ky(t)&&(e=!1)})),e}function Yy(t){if(t instanceof Py&&"feature-state"===t.name)return!1;let e=!0;return t.eachChild((t=>{e&&!Yy(t)&&(e=!1)})),e}function Zy(t,e){if(t instanceof Py&&e.indexOf(t.name)>=0)return!1;let i=!0;return t.eachChild((t=>{i&&!Zy(t,e)&&(i=!1)})),i}class Hy{constructor(t,e){this.type=e.type,this.name=t,this.boundExpression=e}static parse(t,e){if(2!==t.length||"string"!=typeof t[1])return e.error("'var' expression requires exactly one string literal argument.");const i=t[1];return e.scope.has(i)?new Hy(i,e.scope.get(i)):e.error(`Unknown variable "${i}". Make sure "${i}" has been bound in an enclosing "let" expression before using it.`,1)}evaluate(t){return this.boundExpression.evaluate(t)}eachChild(){}outputDefined(){return!1}serialize(){return["var",this.name]}}class $y{constructor(t,e=[],i,n=new Uf,r=[]){this.registry=t,this.path=e,this.key=e.map((t=>`[${t}]`)).join(""),this.scope=n,this.errors=r,this.expectedType=i}parse(t,e,i,n,r={}){return e?this.concat(e,i,n)._parse(t,r):this._parse(t,r)}_parse(t,e){function i(t,e,i){return"assert"===i?new by(e,[t]):"coerce"===i?new Ty(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", []].');const r=t[0];if("string"!=typeof r)return this.error(`Expression name must be a string, but found ${typeof r} instead. If you wanted a literal array, use ["literal", [...]].`,0),null;const o=this.registry[r];if(o){let r=o.parse(t,this);if(!r)return null;if(this.expectedType){const t=this.expectedType,n=r.type;if("string"!==t.kind&&"number"!==t.kind&&"boolean"!==t.kind&&"object"!==t.kind&&"array"!==t.kind||"value"!==n.kind)if("color"!==t.kind&&"formatted"!==t.kind&&"resolvedImage"!==t.kind||"value"!==n.kind&&"string"!==n.kind){if(this.checkSubtype(t,n))return null}else r=i(r,t,e.typeAnnotation||"coerce");else r=i(r,t,e.typeAnnotation||"assert")}if(!(r instanceof vy)&&"resolvedImage"!==r.type.kind&&Jy(r)){const t=new ky;try{r=new vy(r.type,r.evaluate(t))}catch(n){return this.error(n.message),null}}return r}return this.error(`Unknown expression "${r}". 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.`)}concat(t,e,i){const n="number"==typeof t?this.path.concat(t):this.path,r=i?this.scope.concat(i):this.scope;return new $y(this.registry,n,e||null,r,this.errors)}error(t,...e){const i=`${this.key}${e.map((t=>`[${t}]`)).join("")}`;this.errors.push(new Vf(i,t))}checkSubtype(t,e){const i=oy(t,e);return i&&this.error(i),i}}function Jy(t){if(t instanceof Hy)return Jy(t.boundExpression);if(t instanceof Py&&"error"===t.name)return!1;if(t instanceof Oy)return!1;if(t instanceof Xy)return!1;const e=t instanceof Ty||t instanceof by;let i=!0;return t.eachChild((t=>{i=e?i&&Jy(t):i&&t instanceof vy})),!!i&&(Ky(t)&&Zy(t,["zoom","heatmap-density","line-progress","sky-radial-progress","accumulated","is-supported-script"]))}function Qy(t,e){const i=t.length-1;let n,r,o=0,s=i,a=0;for(;o<=s;)if(a=Math.floor((o+s)/2),n=t[a],r=t[a+1],n<=e){if(a===i||e<r)return a;o=a+1}else{if(!(n>e))throw new _y("Input is not a number.");s=a-1}return 0}class tg{constructor(t,e,i){this.type=t,this.input=e,this.labels=[],this.outputs=[];for(const[n,r]of i)this.labels.push(n),this.outputs.push(r)}static parse(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.");const i=e.parse(t[1],1,Kf);if(!i)return null;const n=[];let r=null;e.expectedType&&"value"!==e.expectedType.kind&&(r=e.expectedType);for(let o=1;o<t.length;o+=2){const i=1===o?-1/0:t[o],s=t[o+1],a=o,l=o+1;if("number"!=typeof i)return e.error('Input/output pairs for "step" expressions must be defined using literal numeric values (not computed expressions) for the input values.',a);if(n.length&&n[n.length-1][0]>=i)return e.error('Input/output pairs for "step" expressions must be arranged with input values in strictly ascending order.',a);const u=e.parse(s,l,r);if(!u)return null;r=r||u.type,n.push([i,u])}return new tg(r,i,n)}evaluate(t){const e=this.labels,i=this.outputs;if(1===e.length)return i[0].evaluate(t);const n=this.input.evaluate(t);if(n<=e[0])return i[0].evaluate(t);const r=e.length;if(n>=e[r-1])return i[r-1].evaluate(t);return i[Qy(e,n)].evaluate(t)}eachChild(t){t(this.input);for(const e of this.outputs)t(e)}outputDefined(){return this.outputs.every((t=>t.outputDefined()))}serialize(){const t=["step",this.input.serialize()];for(let e=0;e<this.labels.length;e++)e>0&&t.push(this.labels[e]),t.push(this.outputs[e].serialize());return t}}var eg=ig;function ig(t,e,i,n){this.cx=3*t,this.bx=3*(i-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=i,this.p2y=n}function ng(t,e,i){return t*(1-i)+e*i}ig.prototype.sampleCurveX=function(t){return((this.ax*t+this.bx)*t+this.cx)*t},ig.prototype.sampleCurveY=function(t){return((this.ay*t+this.by)*t+this.cy)*t},ig.prototype.sampleCurveDerivativeX=function(t){return(3*this.ax*t+2*this.bx)*t+this.cx},ig.prototype.solveCurveX=function(t,e){var i,n,r,o,s;for(void 0===e&&(e=1e-6),r=t,s=0;s<8;s++){if(o=this.sampleCurveX(r)-t,Math.abs(o)<e)return r;var a=this.sampleCurveDerivativeX(r);if(Math.abs(a)<1e-6)break;r-=o/a}if((r=t)<(i=0))return i;if(r>(n=1))return n;for(;i<n;){if(o=this.sampleCurveX(r),Math.abs(o-t)<e)return r;t>o?i=r:n=r,r=.5*(n-i)+i}return r},ig.prototype.solve=function(t,e){return this.sampleCurveY(this.solveCurveX(t,e))};var rg=Object.freeze({__proto__:null,number:ng,color:function(t,e,i){return new uy(ng(t.r,e.r,i),ng(t.g,e.g,i),ng(t.b,e.b,i),ng(t.a,e.a,i))},array:function(t,e,i){return t.map(((t,n)=>ng(t,e[n],i)))}});const og=4/29,sg=6/29,ag=3*sg*sg,lg=Math.PI/180,ug=180/Math.PI;function hg(t){return t>.008856451679035631?Math.pow(t,1/3):t/ag+og}function cg(t){return t>sg?t*t*t:ag*(t-og)}function pg(t){return 255*(t<=.0031308?12.92*t:1.055*Math.pow(t,1/2.4)-.055)}function dg(t){return(t/=255)<=.04045?t/12.92:Math.pow((t+.055)/1.055,2.4)}function fg(t){const e=dg(t.r),i=dg(t.g),n=dg(t.b),r=hg((.4124564*e+.3575761*i+.1804375*n)/.95047),o=hg((.2126729*e+.7151522*i+.072175*n)/1);return{l:116*o-16,a:500*(r-o),b:200*(o-hg((.0193339*e+.119192*i+.9503041*n)/1.08883)),alpha:t.a}}function yg(t){let e=(t.l+16)/116,i=isNaN(t.a)?e:e+t.a/500,n=isNaN(t.b)?e:e-t.b/200;return e=1*cg(e),i=.95047*cg(i),n=1.08883*cg(n),new uy(pg(3.2404542*i-1.5371385*e-.4985314*n),pg(-.969266*i+1.8760108*e+.041556*n),pg(.0556434*i-.2040259*e+1.0572252*n),t.alpha)}function gg(t,e,i){const n=e-t;return t+i*(n>180||n<-180?n-360*Math.round(n/360):n)}const mg={forward:fg,reverse:yg,interpolate:function(t,e,i){return{l:ng(t.l,e.l,i),a:ng(t.a,e.a,i),b:ng(t.b,e.b,i),alpha:ng(t.alpha,e.alpha,i)}}},vg={forward:function(t){const{l:e,a:i,b:n}=fg(t),r=Math.atan2(n,i)*ug;return{h:r<0?r+360:r,c:Math.sqrt(i*i+n*n),l:e,alpha:t.a}},reverse:function(t){const e=t.h*lg,i=t.c;return yg({l:t.l,a:Math.cos(e)*i,b:Math.sin(e)*i,alpha:t.alpha})},interpolate:function(t,e,i){return{h:gg(t.h,e.h,i),c:ng(t.c,e.c,i),l:ng(t.l,e.l,i),alpha:ng(t.alpha,e.alpha,i)}}};class _g{constructor(t,e,i,n,r){this.type=t,this.operator=e,this.interpolation=i,this.input=n,this.labels=[],this.outputs=[];for(const[o,s]of r)this.labels.push(o),this.outputs.push(s)}static interpolationFactor(t,e,i,n){let r=0;if("exponential"===t.name)r=xg(e,t.base,i,n);else if("linear"===t.name)r=xg(e,1,i,n);else if("cubic-bezier"===t.name){const o=t.controlPoints;r=new eg(o[0],o[1],o[2],o[3]).solve(xg(e,1,i,n))}return r}static parse(t,e){let[i,n,r,...o]=t;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]){const t=n[1];if("number"!=typeof t)return e.error("Exponential interpolation requires a numeric base.",1,1);n={name:"exponential",base:t}}else{if("cubic-bezier"!==n[0])return e.error(`Unknown interpolation type ${String(n[0])}`,1,0);{const t=n.slice(1);if(4!==t.length||t.some((t=>"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:t}}}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(r=e.parse(r,2,Kf),!r)return null;const s=[];let a=null;"interpolate-hcl"===i||"interpolate-lab"===i?a=Hf:e.expectedType&&"value"!==e.expectedType.kind&&(a=e.expectedType);for(let l=0;l<o.length;l+=2){const t=o[l],i=o[l+1],n=l+3,r=l+4;if("number"!=typeof t)return e.error('Input/output pairs for "interpolate" expressions must be defined using literal numeric values (not computed expressions) for the input values.',n);if(s.length&&s[s.length-1][0]>=t)return e.error('Input/output pairs for "interpolate" expressions must be arranged with input values in strictly ascending order.',n);const u=e.parse(i,r,a);if(!u)return null;a=a||u.type,s.push([t,u])}return"number"===a.kind||"color"===a.kind||"array"===a.kind&&"number"===a.itemType.kind&&"number"==typeof a.N?new _g(a,i,n,r,s):e.error(`Type ${ny(a)} is not interpolatable.`)}evaluate(t){const e=this.labels,i=this.outputs;if(1===e.length)return i[0].evaluate(t);const n=this.input.evaluate(t);if(n<=e[0])return i[0].evaluate(t);const r=e.length;if(n>=e[r-1])return i[r-1].evaluate(t);const o=Qy(e,n),s=e[o],a=e[o+1],l=_g.interpolationFactor(this.interpolation,n,s,a),u=i[o].evaluate(t),h=i[o+1].evaluate(t);return"interpolate"===this.operator?rg[this.type.kind.toLowerCase()](u,h,l):"interpolate-hcl"===this.operator?vg.reverse(vg.interpolate(vg.forward(u),vg.forward(h),l)):mg.reverse(mg.interpolate(mg.forward(u),mg.forward(h),l))}eachChild(t){t(this.input);for(const e of this.outputs)t(e)}outputDefined(){return this.outputs.every((t=>t.outputDefined()))}serialize(){let 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);const e=[this.operator,t,this.input.serialize()];for(let i=0;i<this.labels.length;i++)e.push(this.labels[i],this.outputs[i].serialize());return e}}function xg(t,e,i,n){const r=n-i,o=t-i;return 0===r?0:1===e?o/r:(Math.pow(e,o)-1)/(Math.pow(e,r)-1)}class bg{constructor(t,e){this.type=t,this.args=e}static parse(t,e){if(t.length<2)return e.error("Expectected at least one argument.");let i=null;const n=e.expectedType;n&&"value"!==n.kind&&(i=n);const r=[];for(const s of t.slice(1)){const t=e.parse(s,1+r.length,i,void 0,{typeAnnotation:"omit"});if(!t)return null;i=i||t.type,r.push(t)}const o=n&&r.some((t=>oy(n,t.type)));return new bg(o?Jf:i,r)}evaluate(t){let e,i=null,n=0;for(const r of this.args)if(n++,i=r.evaluate(t),i&&i instanceof dy&&!i.available&&(e||(e=i.name),i=null,n===this.args.length&&(i=e)),null!==i)break;return i}eachChild(t){this.args.forEach(t)}outputDefined(){return this.args.every((t=>t.outputDefined()))}serialize(){const t=["coalesce"];return this.eachChild((e=>{t.push(e.serialize())})),t}}class wg{constructor(t,e){this.type=e.type,this.bindings=[].concat(t),this.result=e}evaluate(t){return this.result.evaluate(t)}eachChild(t){for(const e of this.bindings)t(e[1]);t(this.result)}static parse(t,e){if(t.length<4)return e.error(`Expected at least 3 arguments, but found ${t.length-1} instead.`);const i=[];for(let r=1;r<t.length-1;r+=2){const n=t[r];if("string"!=typeof n)return e.error(`Expected string, but found ${typeof n} instead.`,r);if(/[^a-zA-Z0-9_]/.test(n))return e.error("Variable names must contain only alphanumeric characters or '_'.",r);const o=e.parse(t[r+1],r+1);if(!o)return null;i.push([n,o])}const n=e.parse(t[t.length-1],t.length-1,e.expectedType,i);return n?new wg(i,n):null}outputDefined(){return this.result.outputDefined()}serialize(){const t=["let"];for(const[e,i]of this.bindings)t.push(e,i.serialize());return t.push(this.result.serialize()),t}}class Sg{constructor(t,e,i){this.type=t,this.index=e,this.input=i}static parse(t,e){if(3!==t.length)return e.error(`Expected 2 arguments, but found ${t.length-1} instead.`);const i=e.parse(t[1],1,Kf),n=e.parse(t[2],2,iy(e.expectedType||Jf));if(!i||!n)return null;const r=n.type;return new Sg(r.itemType,i,n)}evaluate(t){const e=this.index.evaluate(t),i=this.input.evaluate(t);if(e<0)throw new _y(`Array index out of bounds: ${e} < 0.`);if(e>=i.length)throw new _y(`Array index out of bounds: ${e} > ${i.length-1}.`);if(e!==Math.floor(e))throw new _y(`Array index must be an integer, but found ${e} instead.`);return i[e]}eachChild(t){t(this.index),t(this.input)}outputDefined(){return!1}serialize(){return["at",this.index.serialize(),this.input.serialize()]}}class Cg{constructor(t,e){this.type=Zf,this.needle=t,this.haystack=e}static parse(t,e){if(3!==t.length)return e.error(`Expected 2 arguments, but found ${t.length-1} instead.`);const i=e.parse(t[1],1,Jf),n=e.parse(t[2],2,Jf);return i&&n?sy(i.type,[Zf,Yf,Kf,Xf,Jf])?new Cg(i,n):e.error(`Expected first argument to be of type boolean, string, number or null, but found ${ny(i.type)} instead`):null}evaluate(t){const e=this.needle.evaluate(t),i=this.haystack.evaluate(t);if(!i)return!1;if(!ay(e,["boolean","string","number","null"]))throw new _y(`Expected first argument to be of type boolean, string, number or null, but found ${ny(gy(e))} instead.`);if(!ay(i,["string","array"]))throw new _y(`Expected second argument to be of type array or string, but found ${ny(gy(i))} instead.`);return i.indexOf(e)>=0}eachChild(t){t(this.needle),t(this.haystack)}outputDefined(){return!0}serialize(){return["in",this.needle.serialize(),this.haystack.serialize()]}}class Tg{constructor(t,e,i){this.type=Kf,this.needle=t,this.haystack=e,this.fromIndex=i}static parse(t,e){if(t.length<=2||t.length>=5)return e.error(`Expected 3 or 4 arguments, but found ${t.length-1} instead.`);const i=e.parse(t[1],1,Jf),n=e.parse(t[2],2,Jf);if(!i||!n)return null;if(!sy(i.type,[Zf,Yf,Kf,Xf,Jf]))return e.error(`Expected first argument to be of type boolean, string, number or null, but found ${ny(i.type)} instead`);if(4===t.length){const r=e.parse(t[3],3,Kf);return r?new Tg(i,n,r):null}return new Tg(i,n)}evaluate(t){const e=this.needle.evaluate(t),i=this.haystack.evaluate(t);if(!ay(e,["boolean","string","number","null"]))throw new _y(`Expected first argument to be of type boolean, string, number or null, but found ${ny(gy(e))} instead.`);if(!ay(i,["string","array"]))throw new _y(`Expected second argument to be of type array or string, but found ${ny(gy(i))} instead.`);if(this.fromIndex){const n=this.fromIndex.evaluate(t);return i.indexOf(e,n)}return i.indexOf(e)}eachChild(t){t(this.needle),t(this.haystack),this.fromIndex&&t(this.fromIndex)}outputDefined(){return!1}serialize(){if(null!=this.fromIndex&&void 0!==this.fromIndex){const t=this.fromIndex.serialize();return["index-of",this.needle.serialize(),this.haystack.serialize(),t]}return["index-of",this.needle.serialize(),this.haystack.serialize()]}}class Eg{constructor(t,e,i,n,r,o){this.inputType=t,this.type=e,this.input=i,this.cases=n,this.outputs=r,this.otherwise=o}static parse(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.");let i,n;e.expectedType&&"value"!==e.expectedType.kind&&(n=e.expectedType);const r={},o=[];for(let l=2;l<t.length-1;l+=2){let s=t[l];const a=t[l+1];Array.isArray(s)||(s=[s]);const u=e.concat(l);if(0===s.length)return u.error("Expected at least one branch label.");for(const t of s){if("number"!=typeof t&&"string"!=typeof t)return u.error("Branch labels must be numbers or strings.");if("number"==typeof t&&Math.abs(t)>Number.MAX_SAFE_INTEGER)return u.error(`Branch labels must be integers no larger than ${Number.MAX_SAFE_INTEGER}.`);if("number"==typeof t&&Math.floor(t)!==t)return u.error("Numeric branch labels must be integer values.");if(i){if(u.checkSubtype(i,gy(t)))return null}else i=gy(t);if(void 0!==r[String(t)])return u.error("Branch labels must be unique.");r[String(t)]=o.length}const h=e.parse(a,l,n);if(!h)return null;n=n||h.type,o.push(h)}const s=e.parse(t[1],1,Jf);if(!s)return null;const a=e.parse(t[t.length-1],t.length-1,n);return a?"value"!==s.type.kind&&e.concat(1).checkSubtype(i,s.type)?null:new Eg(i,n,s,r,o,a):null}evaluate(t){const e=this.input.evaluate(t);return(gy(e)===this.inputType&&this.outputs[this.cases[e]]||this.otherwise).evaluate(t)}eachChild(t){t(this.input),this.outputs.forEach(t),t(this.otherwise)}outputDefined(){return this.outputs.every((t=>t.outputDefined()))&&this.otherwise.outputDefined()}serialize(){const t=["match",this.input.serialize()],e=Object.keys(this.cases).sort(),i=[],n={};for(const o of e){const t=n[this.cases[o]];void 0===t?(n[this.cases[o]]=i.length,i.push([this.cases[o],[o]])):i[t][1].push(o)}const r=t=>"number"===this.inputType.kind?Number(t):t;for(const[o,s]of i)1===s.length?t.push(r(s[0])):t.push(s.map(r)),t.push(this.outputs[o].serialize());return t.push(this.otherwise.serialize()),t}}class kg{constructor(t,e,i){this.type=t,this.branches=e,this.otherwise=i}static parse(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.");let i;e.expectedType&&"value"!==e.expectedType.kind&&(i=e.expectedType);const n=[];for(let o=1;o<t.length-1;o+=2){const r=e.parse(t[o],o,Zf);if(!r)return null;const s=e.parse(t[o+1],o+1,i);if(!s)return null;n.push([r,s]),i=i||s.type}const r=e.parse(t[t.length-1],t.length-1,i);return r?new kg(i,n,r):null}evaluate(t){for(const[e,i]of this.branches)if(e.evaluate(t))return i.evaluate(t);return this.otherwise.evaluate(t)}eachChild(t){for(const[e,i]of this.branches)t(e),t(i);t(this.otherwise)}outputDefined(){return this.branches.every((([t,e])=>e.outputDefined()))&&this.otherwise.outputDefined()}serialize(){const t=["case"];return this.eachChild((e=>{t.push(e.serialize())})),t}}class Pg{constructor(t,e,i,n){this.type=t,this.input=e,this.beginIndex=i,this.endIndex=n}static parse(t,e){if(t.length<=2||t.length>=5)return e.error(`Expected 3 or 4 arguments, but found ${t.length-1} instead.`);const i=e.parse(t[1],1,Jf),n=e.parse(t[2],2,Kf);if(!i||!n)return null;if(!sy(i.type,[iy(Jf),Yf,Jf]))return e.error(`Expected first argument to be of type array or string, but found ${ny(i.type)} instead`);if(4===t.length){const r=e.parse(t[3],3,Kf);return r?new Pg(i.type,i,n,r):null}return new Pg(i.type,i,n)}evaluate(t){const e=this.input.evaluate(t),i=this.beginIndex.evaluate(t);if(!ay(e,["string","array"]))throw new _y(`Expected first argument to be of type array or string, but found ${ny(gy(e))} instead.`);if(this.endIndex){const n=this.endIndex.evaluate(t);return e.slice(i,n)}return e.slice(i)}eachChild(t){t(this.input),t(this.beginIndex),this.endIndex&&t(this.endIndex)}outputDefined(){return!1}serialize(){if(null!=this.endIndex&&void 0!==this.endIndex){const t=this.endIndex.serialize();return["slice",this.input.serialize(),this.beginIndex.serialize(),t]}return["slice",this.input.serialize(),this.beginIndex.serialize()]}}function Og(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 Rg(t,e,i,n){return 0===n.compare(e,i)}function Ig(t,e,i){const n="=="!==t&&"!="!==t;return class r{constructor(t,e,i){this.type=Zf,this.lhs=t,this.rhs=e,this.collator=i,this.hasUntypedArgument="value"===t.type.kind||"value"===e.type.kind}static parse(t,e){if(3!==t.length&&4!==t.length)return e.error("Expected two or three arguments.");const i=t[0];let o=e.parse(t[1],1,Jf);if(!o)return null;if(!Og(i,o.type))return e.concat(1).error(`"${i}" comparisons are not supported for type '${ny(o.type)}'.`);let s=e.parse(t[2],2,Jf);if(!s)return null;if(!Og(i,s.type))return e.concat(2).error(`"${i}" comparisons are not supported for type '${ny(s.type)}'.`);if(o.type.kind!==s.type.kind&&"value"!==o.type.kind&&"value"!==s.type.kind)return e.error(`Cannot compare types '${ny(o.type)}' and '${ny(s.type)}'.`);n&&("value"===o.type.kind&&"value"!==s.type.kind?o=new by(s.type,[o]):"value"!==o.type.kind&&"value"===s.type.kind&&(s=new by(o.type,[s])));let a=null;if(4===t.length){if("string"!==o.type.kind&&"string"!==s.type.kind&&"value"!==o.type.kind&&"value"!==s.type.kind)return e.error("Cannot use collator to compare non-string types.");if(a=e.parse(t[3],3,Qf),!a)return null}return new r(o,s,a)}evaluate(r){const o=this.lhs.evaluate(r),s=this.rhs.evaluate(r);if(n&&this.hasUntypedArgument){const e=gy(o),i=gy(s);if(e.kind!==i.kind||"string"!==e.kind&&"number"!==e.kind)throw new _y(`Expected arguments for "${t}" to be (string, string) or (number, number), but found (${e.kind}, ${i.kind}) instead.`)}if(this.collator&&!n&&this.hasUntypedArgument){const t=gy(o),i=gy(s);if("string"!==t.kind||"string"!==i.kind)return e(r,o,s)}return this.collator?i(r,o,s,this.collator.evaluate(r)):e(r,o,s)}eachChild(t){t(this.lhs),t(this.rhs),this.collator&&t(this.collator)}outputDefined(){return!0}serialize(){const e=[t];return this.eachChild((t=>{e.push(t.serialize())})),e}}}const Fg=Ig("==",(function(t,e,i){return e===i}),Rg),jg=Ig("!=",(function(t,e,i){return e!==i}),(function(t,e,i,n){return!Rg(0,e,i,n)})),Mg=Ig("<",(function(t,e,i){return e<i}),(function(t,e,i,n){return n.compare(e,i)<0})),Ag=Ig(">",(function(t,e,i){return e>i}),(function(t,e,i,n){return n.compare(e,i)>0})),Lg=Ig("<=",(function(t,e,i){return e<=i}),(function(t,e,i,n){return n.compare(e,i)<=0})),Dg=Ig(">=",(function(t,e,i){return e>=i}),(function(t,e,i,n){return n.compare(e,i)>=0}));class zg{constructor(t,e,i,n,r){this.type=Yf,this.number=t,this.locale=e,this.currency=i,this.minFractionDigits=n,this.maxFractionDigits=r}static parse(t,e){if(3!==t.length)return e.error("Expected two arguments.");const i=e.parse(t[1],1,Kf);if(!i)return null;const n=t[2];if("object"!=typeof n||Array.isArray(n))return e.error("NumberFormat options argument must be an object.");let r=null;if(n.locale&&(r=e.parse(n.locale,1,Yf),!r))return null;let o=null;if(n.currency&&(o=e.parse(n.currency,1,Yf),!o))return null;let s=null;if(n["min-fraction-digits"]&&(s=e.parse(n["min-fraction-digits"],1,Kf),!s))return null;let a=null;return n["max-fraction-digits"]&&(a=e.parse(n["max-fraction-digits"],1,Kf),!a)?null:new zg(i,r,o,s,a)}evaluate(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))}eachChild(t){t(this.number),this.locale&&t(this.locale),this.currency&&t(this.currency),this.minFractionDigits&&t(this.minFractionDigits),this.maxFractionDigits&&t(this.maxFractionDigits)}outputDefined(){return!1}serialize(){const 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]}}class Gg{constructor(t){this.type=Kf,this.input=t}static parse(t,e){if(2!==t.length)return e.error(`Expected 1 argument, but found ${t.length-1} instead.`);const i=e.parse(t[1],1);return i?"array"!==i.type.kind&&"string"!==i.type.kind&&"value"!==i.type.kind?e.error(`Expected argument of type string or array, but found ${ny(i.type)} instead.`):new Gg(i):null}evaluate(t){const e=this.input.evaluate(t);if("string"==typeof e)return e.length;if(Array.isArray(e))return e.length;throw new _y(`Expected value to be of type string or array, but found ${ny(gy(e))} instead.`)}eachChild(t){t(this.input)}outputDefined(){return!1}serialize(){const t=["length"];return this.eachChild((e=>{t.push(e.serialize())})),t}}const Ng={"==":Fg,"!=":jg,">":Ag,"<":Mg,">=":Dg,"<=":Lg,array:by,at:Sg,boolean:by,case:kg,coalesce:bg,collator:Oy,format:wy,image:Sy,in:Cg,"index-of":Tg,interpolate:_g,"interpolate-hcl":_g,"interpolate-lab":_g,length:Gg,let:wg,literal:vy,match:Eg,number:by,"number-format":zg,object:by,slice:Pg,step:tg,string:by,"to-boolean":Ty,"to-color":Ty,"to-number":Ty,"to-string":Ty,var:Hy,within:Xy};function Bg(t,[e,i,n,r]){e=e.evaluate(t),i=i.evaluate(t),n=n.evaluate(t);const o=r?r.evaluate(t):1,s=fy(e,i,n,o);if(s)throw new _y(s);return new uy(e/255*o,i/255*o,n/255*o,o)}function Wg(t,e){return t in e}function qg(t,e){const i=e[t];return void 0===i?null:i}function Vg(t){return{type:t}}function Ug(t){return{result:"success",value:t}}function Xg(t){return{result:"error",value:t}}function Kg(t){return!!t.expression&&t.expression.interpolated}function Yg(t){return"object"==typeof t&&null!==t&&!Array.isArray(t)}Py.register(Ng,{error:[{kind:"error"},[Yf],(t,[e])=>{throw new _y(e.evaluate(t))}],typeof:[Yf,[Jf],(t,[e])=>ny(gy(e.evaluate(t)))],"to-rgba":[iy(Kf,4),[Hf],(t,[e])=>e.evaluate(t).toArray()],rgb:[Hf,[Kf,Kf,Kf],Bg],rgba:[Hf,[Kf,Kf,Kf,Kf],Bg],has:{type:Zf,overloads:[[[Yf],(t,[e])=>Wg(e.evaluate(t),t.properties())],[[Yf,$f],(t,[e,i])=>Wg(e.evaluate(t),i.evaluate(t))]]},get:{type:Jf,overloads:[[[Yf],(t,[e])=>qg(e.evaluate(t),t.properties())],[[Yf,$f],(t,[e,i])=>qg(e.evaluate(t),i.evaluate(t))]]},"feature-state":[Jf,[Yf],(t,[e])=>qg(e.evaluate(t),t.featureState||{})],properties:[$f,[],t=>t.properties()],"geometry-type":[Yf,[],t=>t.geometryType()],id:[Jf,[],t=>t.id()],zoom:[Kf,[],t=>t.globals.zoom],"heatmap-density":[Kf,[],t=>t.globals.heatmapDensity||0],"line-progress":[Kf,[],t=>t.globals.lineProgress||0],"sky-radial-progress":[Kf,[],t=>t.globals.skyRadialProgress||0],accumulated:[Jf,[],t=>void 0===t.globals.accumulated?null:t.globals.accumulated],"+":[Kf,Vg(Kf),(t,e)=>{let i=0;for(const n of e)i+=n.evaluate(t);return i}],"*":[Kf,Vg(Kf),(t,e)=>{let i=1;for(const n of e)i*=n.evaluate(t);return i}],"-":{type:Kf,overloads:[[[Kf,Kf],(t,[e,i])=>e.evaluate(t)-i.evaluate(t)],[[Kf],(t,[e])=>-e.evaluate(t)]]},"/":[Kf,[Kf,Kf],(t,[e,i])=>e.evaluate(t)/i.evaluate(t)],"%":[Kf,[Kf,Kf],(t,[e,i])=>e.evaluate(t)%i.evaluate(t)],ln2:[Kf,[],()=>Math.LN2],pi:[Kf,[],()=>Math.PI],e:[Kf,[],()=>Math.E],"^":[Kf,[Kf,Kf],(t,[e,i])=>Math.pow(e.evaluate(t),i.evaluate(t))],sqrt:[Kf,[Kf],(t,[e])=>Math.sqrt(e.evaluate(t))],log10:[Kf,[Kf],(t,[e])=>Math.log(e.evaluate(t))/Math.LN10],ln:[Kf,[Kf],(t,[e])=>Math.log(e.evaluate(t))],log2:[Kf,[Kf],(t,[e])=>Math.log(e.evaluate(t))/Math.LN2],sin:[Kf,[Kf],(t,[e])=>Math.sin(e.evaluate(t))],cos:[Kf,[Kf],(t,[e])=>Math.cos(e.evaluate(t))],tan:[Kf,[Kf],(t,[e])=>Math.tan(e.evaluate(t))],asin:[Kf,[Kf],(t,[e])=>Math.asin(e.evaluate(t))],acos:[Kf,[Kf],(t,[e])=>Math.acos(e.evaluate(t))],atan:[Kf,[Kf],(t,[e])=>Math.atan(e.evaluate(t))],min:[Kf,Vg(Kf),(t,e)=>Math.min(...e.map((e=>e.evaluate(t))))],max:[Kf,Vg(Kf),(t,e)=>Math.max(...e.map((e=>e.evaluate(t))))],abs:[Kf,[Kf],(t,[e])=>Math.abs(e.evaluate(t))],round:[Kf,[Kf],(t,[e])=>{const i=e.evaluate(t);return i<0?-Math.round(-i):Math.round(i)}],floor:[Kf,[Kf],(t,[e])=>Math.floor(e.evaluate(t))],ceil:[Kf,[Kf],(t,[e])=>Math.ceil(e.evaluate(t))],"filter-==":[Zf,[Yf,Jf],(t,[e,i])=>t.properties()[e.value]===i.value],"filter-id-==":[Zf,[Jf],(t,[e])=>t.id()===e.value],"filter-type-==":[Zf,[Yf],(t,[e])=>t.geometryType()===e.value],"filter-<":[Zf,[Yf,Jf],(t,[e,i])=>{const n=t.properties()[e.value],r=i.value;return typeof n==typeof r&&n<r}],"filter-id-<":[Zf,[Jf],(t,[e])=>{const i=t.id(),n=e.value;return typeof i==typeof n&&i<n}],"filter->":[Zf,[Yf,Jf],(t,[e,i])=>{const n=t.properties()[e.value],r=i.value;return typeof n==typeof r&&n>r}],"filter-id->":[Zf,[Jf],(t,[e])=>{const i=t.id(),n=e.value;return typeof i==typeof n&&i>n}],"filter-<=":[Zf,[Yf,Jf],(t,[e,i])=>{const n=t.properties()[e.value],r=i.value;return typeof n==typeof r&&n<=r}],"filter-id-<=":[Zf,[Jf],(t,[e])=>{const i=t.id(),n=e.value;return typeof i==typeof n&&i<=n}],"filter->=":[Zf,[Yf,Jf],(t,[e,i])=>{const n=t.properties()[e.value],r=i.value;return typeof n==typeof r&&n>=r}],"filter-id->=":[Zf,[Jf],(t,[e])=>{const i=t.id(),n=e.value;return typeof i==typeof n&&i>=n}],"filter-has":[Zf,[Jf],(t,[e])=>e.value in t.properties()],"filter-has-id":[Zf,[],t=>null!==t.id()&&void 0!==t.id()],"filter-type-in":[Zf,[iy(Yf)],(t,[e])=>e.value.indexOf(t.geometryType())>=0],"filter-id-in":[Zf,[iy(Jf)],(t,[e])=>e.value.indexOf(t.id())>=0],"filter-in-small":[Zf,[Yf,iy(Jf)],(t,[e,i])=>i.value.indexOf(t.properties()[e.value])>=0],"filter-in-large":[Zf,[Yf,iy(Jf)],(t,[e,i])=>function(t,e,i,n){for(;i<=n;){const r=i+n>>1;if(e[r]===t)return!0;e[r]>t?n=r-1:i=r+1}return!1}(t.properties()[e.value],i.value,0,i.value.length-1)],all:{type:Zf,overloads:[[[Zf,Zf],(t,[e,i])=>e.evaluate(t)&&i.evaluate(t)],[Vg(Zf),(t,e)=>{for(const i of e)if(!i.evaluate(t))return!1;return!0}]]},any:{type:Zf,overloads:[[[Zf,Zf],(t,[e,i])=>e.evaluate(t)||i.evaluate(t)],[Vg(Zf),(t,e)=>{for(const i of e)if(i.evaluate(t))return!0;return!1}]]},"!":[Zf,[Zf],(t,[e])=>!e.evaluate(t)],"is-supported-script":[Zf,[Yf],(t,[e])=>{const i=t.globals&&t.globals.isSupportedScript;return!i||i(e.evaluate(t))}],upcase:[Yf,[Yf],(t,[e])=>e.evaluate(t).toUpperCase()],downcase:[Yf,[Yf],(t,[e])=>e.evaluate(t).toLowerCase()],concat:[Yf,Vg(Jf),(t,e)=>e.map((e=>my(e.evaluate(t)))).join("")],"resolved-locale":[Yf,[Qf],(t,[e])=>e.evaluate(t).resolvedLocale()]});class Zg{constructor(t,e){var i;this.expression=t,this._warningHistory={},this._evaluator=new ky,this._defaultValue=e?"color"===(i=e).type&&Yg(i.default)?new uy(0,0,0,0):"color"===i.type?uy.parse(i.default)||null:void 0===i.default?null:i.default:null,this._enumValues=e&&"enum"===e.type?e.values:null}evaluateWithoutErrorHandling(t,e,i,n,r,o){return this._evaluator.globals=t,this._evaluator.feature=e,this._evaluator.featureState=i,this._evaluator.canonical=n,this._evaluator.availableImages=r||null,this._evaluator.formattedSection=o,this.expression.evaluate(this._evaluator)}evaluate(t,e,i,n,r,o){this._evaluator.globals=t,this._evaluator.feature=e||null,this._evaluator.featureState=i||null,this._evaluator.canonical=n,this._evaluator.availableImages=r||null,this._evaluator.formattedSection=o||null;try{const t=this.expression.evaluate(this._evaluator);if(null==t||"number"==typeof t&&t!=t)return this._defaultValue;if(this._enumValues&&!(t in this._enumValues))throw new _y(`Expected value to be one of ${Object.keys(this._enumValues).map((t=>JSON.stringify(t))).join(", ")}, but found ${JSON.stringify(t)} instead.`);return t}catch(s){return this._warningHistory[s.message]||(this._warningHistory[s.message]=!0,"undefined"!=typeof console&&console.warn(s.message)),this._defaultValue}}}function Hg(t){return Array.isArray(t)&&t.length>0&&"string"==typeof t[0]&&t[0]in Ng}function $g(t,e){const i=new $y(Ng,[],e?function(t){const e={color:Hf,string:Yf,number:Kf,enum:Yf,boolean:Zf,formatted:ty,resolvedImage:ey};if("array"===t.type)return iy(e[t.value]||Jf,t.length);return e[t.type]}(e):void 0),n=i.parse(t,void 0,void 0,void 0,e&&"string"===e.type?{typeAnnotation:"coerce"}:void 0);return n?Ug(new Zg(n,e)):Xg(i.errors)}class Jg{constructor(t,e){this.kind=t,this._styleExpression=e,this.isStateDependent="constant"!==t&&!Yy(e.expression)}evaluateWithoutErrorHandling(t,e,i,n,r,o){return this._styleExpression.evaluateWithoutErrorHandling(t,e,i,n,r,o)}evaluate(t,e,i,n,r,o){return this._styleExpression.evaluate(t,e,i,n,r,o)}}class Qg{constructor(t,e,i,n){this.kind=t,this.zoomStops=i,this._styleExpression=e,this.isStateDependent="camera"!==t&&!Yy(e.expression),this.interpolationType=n}evaluateWithoutErrorHandling(t,e,i,n,r,o){return this._styleExpression.evaluateWithoutErrorHandling(t,e,i,n,r,o)}evaluate(t,e,i,n,r,o){return this._styleExpression.evaluate(t,e,i,n,r,o)}interpolationFactor(t,e,i){return this.interpolationType?_g.interpolationFactor(this.interpolationType,t,e,i):0}}function tm(t,e){if("error"===(t=$g(t,e)).result)return t;const i=t.value.expression,n=Ky(i);if(!n&&("data-driven"!==(r=e)["property-type"]&&"cross-faded-data-driven"!==r["property-type"]))return Xg([new Vf("","data expressions not supported")]);var r;const o=Zy(i,["zoom"]);if(!o&&!function(t){return!!t.expression&&t.expression.parameters.indexOf("zoom")>-1}(e))return Xg([new Vf("","zoom expressions not supported")]);const s=em(i);if(!s&&!o)return Xg([new Vf("",'"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression.')]);if(s instanceof Vf)return Xg([s]);if(s instanceof _g&&!Kg(e))return Xg([new Vf("",'"interpolate" expressions cannot be used with this property')]);if(!s)return Ug(new Jg(n?"constant":"source",t.value));const a=s instanceof _g?s.interpolation:void 0;return Ug(new Qg(n?"camera":"composite",t.value,s.labels,a))}function em(t){let e=null;if(t instanceof wg)e=em(t.result);else if(t instanceof bg){for(const i of t.args)if(e=em(i),e)break}else(t instanceof tg||t instanceof _g)&&t.input instanceof Py&&"zoom"===t.input.name&&(e=t);return e instanceof Vf||t.eachChild((t=>{const i=em(t);i instanceof Vf?e=i:!e&&i?e=new Vf("",'"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression.'):e&&i&&e!==i&&(e=new Vf("",'Only one zoom-based "step" or "interpolate" subexpression may be used in an expression.'))})),e}function im(t){return"object"==typeof t?["literal",t]:t}function nm(t){switch(t.colorSpace){case"hcl":return"interpolate-hcl";case"lab":return"interpolate-lab";default:return"interpolate"}}function rm(t,e){const i=im((n=t.default,r=e.default,void 0!==n?n:void 0!==r?r:void 0));var n,r;return void 0===i&&"resolvedImage"===e.type?"":i}function om(t,e,i){const n=lm(t,e),r=["get",t.property];if("categorical"===n&&"boolean"==typeof i[0][0]){const n=["case"];for(const t of i)n.push(["==",r,t[0]],t[1]);return n.push(rm(t,e)),n}if("categorical"===n){const n=["match",r];for(const t of i)am(n,t[0],t[1],!1);return n.push(rm(t,e)),n}if("interval"===n){const e=["step",["number",r]];for(const t of i)am(e,t[0],t[1],!0);return sm(e),void 0===t.default?e:["case",["==",["typeof",r],"number"],e,im(t.default)]}if("exponential"===n){const e=void 0!==t.base?t.base:1,n=[nm(t),1===e?["linear"]:["exponential",e],["number",r]];for(const t of i)am(n,t[0],t[1],!1);return void 0===t.default?n:["case",["==",["typeof",r],"number"],n,im(t.default)]}throw new Error(`Unknown property function type ${n}`)}function sm(t){"step"===t[0]&&3===t.length&&(t.push(0),t.push(t[3]))}function am(t,e,i,n){t.length>3&&e===t[t.length-2]||(n&&2===t.length||t.push(e),t.push(i))}function lm(t,e){return t.type?t.type:e.expression.interpolated?"exponential":"interval"}function um(t){const e=["concat"],i=/{([^{}]+)}/g;let n=0;for(let r=i.exec(t);null!==r;r=i.exec(t)){const o=t.slice(n,i.lastIndex-r[0].length);n=i.lastIndex,o.length>0&&e.push(o),e.push(["get",r[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}function hm(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(const e of t.slice(1))if(!hm(e)&&"boolean"!=typeof e)return!1;return!0;default:return!0}}const cm={type:"boolean",default:!1,transition:!1,"property-type":"data-driven",expression:{interpolated:!1,parameters:["zoom","feature"]}};function pm(t){if(null==t)return{filter:()=>!0,needGeometry:!1};hm(t)||(t=ym(t));const e=$g(t,cm);if("error"===e.result)throw new Error(e.value.map((t=>`${t.key}: ${t.message}`)).join(", "));return{filter:(t,i,n)=>e.value.evaluate(t,i,{},n),needGeometry:fm(t)}}function dm(t,e){return t<e?-1:t>e?1:0}function fm(t){if(!Array.isArray(t))return!1;if("within"===t[0])return!0;for(let e=1;e<t.length;e++)if(fm(t[e]))return!0;return!1}function ym(t){if(!t)return!0;const e=t[0];if(t.length<=1)return"any"!==e;var i;return"=="===e?gm(t[1],t[2],"=="):"!="===e?_m(gm(t[1],t[2],"==")):"<"===e||">"===e||"<="===e||">="===e?gm(t[1],t[2],e):"any"===e?(i=t.slice(1),["any"].concat(i.map(ym))):"all"===e?["all"].concat(t.slice(1).map(ym)):"none"===e?["all"].concat(t.slice(1).map(ym).map(_m)):"in"===e?mm(t[1],t.slice(2)):"!in"===e?_m(mm(t[1],t.slice(2))):"has"===e?vm(t[1]):"!has"===e?_m(vm(t[1])):"within"!==e||t}function gm(t,e,i){switch(t){case"$type":return[`filter-type-${i}`,e];case"$id":return[`filter-id-${i}`,e];default:return[`filter-${i}`,t,e]}}function mm(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((t=>typeof t!=typeof e[0]))?["filter-in-large",t,["literal",e.sort(dm)]]:["filter-in-small",t,["literal",e]]}}function vm(t){switch(t){case"$type":return!0;case"$id":return["filter-has-id"];default:return["filter-has",t]}}function _m(t){return["!",t]}var xm=["type","source","source-layer","minzoom","maxzoom","filter","layout"];function bm(t,e){const i={};for(const n in t)"ref"!==n&&(i[n]=t[n]);return xm.forEach((t=>{t in e&&(i[t]=e[t])})),i}Gf((function(t,e){var i=function(){var t=function(t,e,i,n){for(i=i||{},n=t.length;n--;i[t[n]]=e);return i},e=[1,12],i=[1,13],n=[1,9],r=[1,10],o=[1,11],s=[1,14],a=[1,15],l=[14,18,22,24],u=[18,22],h=[22,24],c={trace:function(){},yy:{},symbols_:{error:2,JSONString:3,STRING:4,JSONNumber:5,NUMBER:6,JSONNullLiteral:7,NULL:8,JSONBooleanLiteral:9,TRUE:10,FALSE:11,JSONText:12,JSONValue:13,EOF:14,JSONObject:15,JSONArray:16,"{":17,"}":18,JSONMemberList:19,JSONMember:20,":":21,",":22,"[":23,"]":24,JSONElementList:25,$accept:0,$end:1},terminals_:{2:"error",4:"STRING",6:"NUMBER",8:"NULL",10:"TRUE",11:"FALSE",14:"EOF",17:"{",18:"}",21:":",22:",",23:"[",24:"]"},productions_:[0,[3,1],[5,1],[7,1],[9,1],[9,1],[12,2],[13,1],[13,1],[13,1],[13,1],[13,1],[13,1],[15,2],[15,3],[20,3],[19,1],[19,3],[16,2],[16,3],[25,1],[25,3]],performAction:function(t,e,i,n,r,o,s){var a=o.length-1;switch(r){case 1:this.$=new String(t.replace(/\\(\\|")/g,"$1").replace(/\\n/g,"\n").replace(/\\r/g,"\r").replace(/\\t/g,"\t").replace(/\\v/g,"\v").replace(/\\f/g,"\f").replace(/\\b/g,"\b")),this.$.__line__=this._$.first_line;break;case 2:this.$=new Number(t),this.$.__line__=this._$.first_line;break;case 3:this.$=null;break;case 4:this.$=new Boolean(!0),this.$.__line__=this._$.first_line;break;case 5:this.$=new Boolean(!1),this.$.__line__=this._$.first_line;break;case 6:return this.$=o[a-1];case 13:this.$={},Object.defineProperty(this.$,"__line__",{value:this._$.first_line,enumerable:!1});break;case 14:case 19:this.$=o[a-1],Object.defineProperty(this.$,"__line__",{value:this._$.first_line,enumerable:!1});break;case 15:this.$=[o[a-2],o[a]];break;case 16:this.$={},this.$[o[a][0]]=o[a][1];break;case 17:this.$=o[a-2],o[a-2][o[a][0]]=o[a][1];break;case 18:this.$=[],Object.defineProperty(this.$,"__line__",{value:this._$.first_line,enumerable:!1});break;case 20:this.$=[o[a]];break;case 21:this.$=o[a-2],o[a-2].push(o[a])}},table:[{3:5,4:e,5:6,6:i,7:3,8:n,9:4,10:r,11:o,12:1,13:2,15:7,16:8,17:s,23:a},{1:[3]},{14:[1,16]},t(l,[2,7]),t(l,[2,8]),t(l,[2,9]),t(l,[2,10]),t(l,[2,11]),t(l,[2,12]),t(l,[2,3]),t(l,[2,4]),t(l,[2,5]),t([14,18,21,22,24],[2,1]),t(l,[2,2]),{3:20,4:e,18:[1,17],19:18,20:19},{3:5,4:e,5:6,6:i,7:3,8:n,9:4,10:r,11:o,13:23,15:7,16:8,17:s,23:a,24:[1,21],25:22},{1:[2,6]},t(l,[2,13]),{18:[1,24],22:[1,25]},t(u,[2,16]),{21:[1,26]},t(l,[2,18]),{22:[1,28],24:[1,27]},t(h,[2,20]),t(l,[2,14]),{3:20,4:e,20:29},{3:5,4:e,5:6,6:i,7:3,8:n,9:4,10:r,11:o,13:30,15:7,16:8,17:s,23:a},t(l,[2,19]),{3:5,4:e,5:6,6:i,7:3,8:n,9:4,10:r,11:o,13:31,15:7,16:8,17:s,23:a},t(u,[2,17]),t(u,[2,15]),t(h,[2,21])],defaultActions:{16:[2,6]},parseError:function(t,e){if(!e.recoverable)throw new Error(t);this.trace(t)},parse:function(t){var e=this,i=[0],n=[null],r=[],o=this.table,s="",a=0,l=0,u=2,h=1,c=r.slice.call(arguments,1),p=Object.create(this.lexer),d={yy:{}};for(var f in this.yy)Object.prototype.hasOwnProperty.call(this.yy,f)&&(d.yy[f]=this.yy[f]);p.setInput(t,d.yy),d.yy.lexer=p,d.yy.parser=this,void 0===p.yylloc&&(p.yylloc={});var y=p.yylloc;r.push(y);var g=p.options&&p.options.ranges;function m(){var t;return"number"!=typeof(t=p.lex()||h)&&(t=e.symbols_[t]||t),t}"function"==typeof d.yy.parseError?this.parseError=d.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;for(var v,_,x,b,w,S,C,T,E={};;){if(_=i[i.length-1],this.defaultActions[_]?x=this.defaultActions[_]:(null==v&&(v=m()),x=o[_]&&o[_][v]),void 0===x||!x.length||!x[0]){var k="";for(w in T=[],o[_])this.terminals_[w]&&w>u&&T.push("'"+this.terminals_[w]+"'");k=p.showPosition?"Parse error on line "+(a+1)+":\n"+p.showPosition()+"\nExpecting "+T.join(", ")+", got '"+(this.terminals_[v]||v)+"'":"Parse error on line "+(a+1)+": Unexpected "+(v==h?"end of input":"'"+(this.terminals_[v]||v)+"'"),this.parseError(k,{text:p.match,token:this.terminals_[v]||v,line:p.yylineno,loc:y,expected:T})}if(x[0]instanceof Array&&x.length>1)throw new Error("Parse Error: multiple actions possible at state: "+_+", token: "+v);switch(x[0]){case 1:i.push(v),n.push(p.yytext),r.push(p.yylloc),i.push(x[1]),v=null,l=p.yyleng,s=p.yytext,a=p.yylineno,y=p.yylloc;break;case 2:if(S=this.productions_[x[1]][1],E.$=n[n.length-S],E._$={first_line:r[r.length-(S||1)].first_line,last_line:r[r.length-1].last_line,first_column:r[r.length-(S||1)].first_column,last_column:r[r.length-1].last_column},g&&(E._$.range=[r[r.length-(S||1)].range[0],r[r.length-1].range[1]]),void 0!==(b=this.performAction.apply(E,[s,l,a,d.yy,x[1],n,r].concat(c))))return b;S&&(i=i.slice(0,-1*S*2),n=n.slice(0,-1*S),r=r.slice(0,-1*S)),i.push(this.productions_[x[1]][0]),n.push(E.$),r.push(E._$),C=o[i[i.length-2]][i[i.length-1]],i.push(C);break;case 3:return!0}}return!0}},p={EOF:1,parseError:function(t,e){if(!this.yy.parser)throw new Error(t);this.yy.parser.parseError(t,e)},setInput:function(t,e){return this.yy=e||this.yy||{},this._input=t,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},input:function(){var t=this._input[0];return this.yytext+=t,this.yyleng++,this.offset++,this.match+=t,this.matched+=t,t.match(/(?:\r\n?|\n).*/g)?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),t},unput:function(t){var e=t.length,i=t.split(/(?:\r\n?|\n)/g);this._input=t+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-e),this.offset-=e;var n=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),i.length-1&&(this.yylineno-=i.length-1);var r=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:i?(i.length===n.length?this.yylloc.first_column:0)+n[n.length-i.length].length-i[0].length:this.yylloc.first_column-e},this.options.ranges&&(this.yylloc.range=[r[0],r[0]+this.yyleng-e]),this.yyleng=this.yytext.length,this},more:function(){return this._more=!0,this},reject:function(){return this.options.backtrack_lexer?(this._backtrack=!0,this):this.parseError("Lexical error on line "+(this.yylineno+1)+". You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})},less:function(t){this.unput(this.match.slice(t))},pastInput:function(){var t=this.matched.substr(0,this.matched.length-this.match.length);return(t.length>20?"...":"")+t.substr(-20).replace(/\n/g,"")},upcomingInput:function(){var t=this.match;return t.length<20&&(t+=this._input.substr(0,20-t.length)),(t.substr(0,20)+(t.length>20?"...":"")).replace(/\n/g,"")},showPosition:function(){var t=this.pastInput(),e=new Array(t.length+1).join("-");return t+this.upcomingInput()+"\n"+e+"^"},test_match:function(t,e){var i,n,r;if(this.options.backtrack_lexer&&(r={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(r.yylloc.range=this.yylloc.range.slice(0))),(n=t[0].match(/(?:\r\n?|\n).*/g))&&(this.yylineno+=n.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:n?n[n.length-1].length-n[n.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+t[0].length},this.yytext+=t[0],this.match+=t[0],this.matches=t,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(t[0].length),this.matched+=t[0],i=this.performAction.call(this,this.yy,this,e,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),i)return i;if(this._backtrack){for(var o in r)this[o]=r[o];return!1}return!1},next:function(){if(this.done)return this.EOF;var t,e,i,n;this._input||(this.done=!0),this._more||(this.yytext="",this.match="");for(var r=this._currentRules(),o=0;o<r.length;o++)if((i=this._input.match(this.rules[r[o]]))&&(!e||i[0].length>e[0].length)){if(e=i,n=o,this.options.backtrack_lexer){if(!1!==(t=this.test_match(i,r[o])))return t;if(this._backtrack){e=!1;continue}return!1}if(!this.options.flex)break}return e?!1!==(t=this.test_match(e,r[n]))&&t:""===this._input?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+". Unrecognized text.\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})},lex:function(){var t=this.next();return t||this.lex()},begin:function(t){this.conditionStack.push(t)},popState:function(){return this.conditionStack.length-1>0?this.conditionStack.pop():this.conditionStack[0]},_currentRules:function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},topState:function(t){return(t=this.conditionStack.length-1-Math.abs(t||0))>=0?this.conditionStack[t]:"INITIAL"},pushState:function(t){this.begin(t)},stateStackSize:function(){return this.conditionStack.length},options:{},performAction:function(t,e,i,n){switch(i){case 0:break;case 1:return 6;case 2:return e.yytext=e.yytext.substr(1,e.yyleng-2),4;case 3:return 17;case 4:return 18;case 5:return 23;case 6:return 24;case 7:return 22;case 8:return 21;case 9:return 10;case 10:return 11;case 11:return 8;case 12:return 14;case 13:return"INVALID"}},rules:[/^(?:\s+)/,/^(?:(-?([0-9]|[1-9][0-9]+))(\.[0-9]+)?([eE][-+]?[0-9]+)?\b)/,/^(?:"(?:\\[\\"bfnrt/]|\\u[a-fA-F0-9]{4}|[^\\\0-\x09\x0a-\x1f"])*")/,/^(?:\{)/,/^(?:\})/,/^(?:\[)/,/^(?:\])/,/^(?:,)/,/^(?::)/,/^(?:true\b)/,/^(?:false\b)/,/^(?:null\b)/,/^(?:$)/,/^(?:.)/],conditions:{INITIAL:{rules:[0,1,2,3,4,5,6,7,8,9,10,11,12,13],inclusive:!0}}};function d(){this.yy={}}return c.lexer=p,d.prototype=c,c.Parser=d,new d}();e.parser=i,e.Parser=i.Parser,e.parse=function(){return i.parse.apply(i,arguments)}}));const wm=Hg,Sm=tm,Cm=function(t,e){let i=t.stops;if(!i)return function(t,e){const i=["get",t.property];if(void 0===t.default)return"string"===e.type?["string",i]:i;if("enum"===e.type)return["match",i,Object.keys(e.values),i,t.default];{const n=["color"===e.type?"to-color":e.type,i,im(t.default)];return"array"===e.type&&n.splice(1,0,e.value,e.length||null),n}}(t,e);const n=i&&"object"==typeof i[0][0],r=n||void 0!==t.property,o=n||!r;return i=i.map((t=>!r&&e.tokens&&"string"==typeof t[1]?[t[0],um(t[1])]:[t[0],im(t[1])])),n?function(t,e,i){const n={},r={},o=[];for(let s=0;s<i.length;s++){const e=i[s],a=e[0].zoom;void 0===n[a]&&(n[a]={zoom:a,type:t.type,property:t.property,default:t.default},r[a]=[],o.push(a)),r[a].push([e[0].value,e[1]])}if("exponential"===lm({},e)){const i=[nm(t),["linear"],["zoom"]];for(const t of o){am(i,t,om(n[t],e,r[t]),!1)}return i}{const t=["step",["zoom"]];for(const i of o){am(t,i,om(n[i],e,r[i]),!0)}return sm(t),t}}(t,e,i):o?function(t,e,i,n=["zoom"]){const r=lm(t,e);let o,s=!1;if("interval"===r)o=["step",n],s=!0;else{if("exponential"!==r)throw new Error(`Unknown zoom function type "${r}"`);{const e=void 0!==t.base?t.base:1;o=[nm(t),1===e?["linear"]:["exponential",e],n]}}for(const a of i)am(o,a[0],a[1],s);return sm(o),o}(t,e,i):om(t,e,i)},Tm=Yg;function Em(t){return t*Math.PI/180}var km=function(){for(var t=[],e=78271.51696402048;t.length<=24;e/=2)t.push(e);return t}();function Pm(t,e){if("undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope&&"undefined"!=typeof OffscreenCanvas)return new OffscreenCanvas(t,e);var i=document.createElement("canvas");return i.width=t,i.height=e,i}var Om,Rm=Array(256).join(" ");function Im(t,e){if(e>=.05){for(var i="",n=t.split("\n"),r=Rm.slice(0,Math.round(e/.1)),o=0,s=n.length;o<s;++o)o>0&&(i+="\n"),i+=n[o].split("").join(r);return i}return t}function Fm(){return Om||(Om=Pm(1,1).getContext("2d")),Om}function jm(t,e){return Fm().measureText(t).width+(t.length-1)*e}var Mm={};function Am(t,e,i,n){if(-1!==t.indexOf("\n")){for(var r=t.split("\n"),o=[],s=0,a=r.length;s<a;++s)o.push(Am(r[s],e,i,n));return o.join("\n")}var l=i+","+e+","+t+","+n,u=Mm[l];if(!u){var h=t.split(" ");if(h.length>1){var c=Fm();c.font=e;var p=c.measureText("M").width*i,d="";for(o=[],s=0,a=h.length;s<a;++s){var f=h[s],y=d+(d?" ":"")+f;jm(y,n)<=p?d=y:(d&&o.push(d),d=f)}d&&o.push(d);for(s=0,a=o.length;s<a&&a>1;++s){var g=o[s];if(jm(g,n)<.35*p){var m=s>0?jm(o[s-1],n):1/0,v=s<a-1?jm(o[s+1],n):1/0;o.splice(s,1),a-=1,m<v?(o[s-1]+=" "+g,s-=1):o[s]=g+" "+o[s]}}for(s=0,a=o.length-1;s<a;++s){var _=o[s],x=o[s+1];if(jm(_,n)>.7*p&&jm(x,n)<.6*p){var b=_.split(" "),w=b.pop();jm(w,n)<.2*p&&(o[s]=b.join(" "),o[s+1]=w+" "+x),a-=1}}u=o.join("\n")}else u=t;u=Im(u,n),Mm[l]=u}return u}Br&&qt(Br,jt,(function(){Mm={}}));var Lm,Dm,zm=Tm,Gm=Cm,Nm=wm,Bm=Sm,Wm={Point:1,MultiPoint:1,LineString:2,MultiLineString:2,Polygon:3,MultiPolygon:3},qm={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]},Vm={},Um={zoom:0},Xm={};function Km(t,e,i,n,r){var o=t.id;Xm[o]||(Xm[o]={});var s=Xm[o];if(!s[i]){var a=(t[e]||Vm)[i],l=Df[e+"_"+t.type][i];void 0===a&&(a=l.default);var u=Nm(a);if(!u&&zm(a)&&(a=Gm(a,l),u=!0),u){var h=function(t,e){var i=Bm(t,e);if("error"===i.result)throw new Error(i.value.map((function(t){return t.key+": "+t.message})).join(", "));return i.value}(a,l);s[i]=h.evaluate.bind(h)}else"color"==l.type&&(a=uy.parse(a)),s[i]=function(){return a}}return Um.zoom=n,s[i](Um,r)}var Ym={};function Zm(t,e){if(t){if(0===t.a||0===e)return;var i=t.a;return e=void 0===e?1:e,"rgba("+Math.round(255*t.r/i)+","+Math.round(255*t.g/i)+","+Math.round(255*t.b/i)+","+i*e+")"}return t}var Hm=/^([^]*)\{(.*)\}([^]*)$/;function $m(t,e){var i;do{if(i=t.match(Hm)){var n=e[i[2]]||"";t=i[1]+n+i[3]}}while(i);return t}function Jm(t,e,i,n,r,o,s){if(void 0===n&&(n=km),"string"==typeof e&&(e=JSON.parse(e)),8!=e.version)throw new Error("glStyle version 8 required.");var a,l;if(o)if("undefined"!=typeof Image){var u=new Image;u.crossOrigin="anonymous",u.onload=function(){a=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&&(a=t.data.image,l=[a.width,a.height])}))}for(var c,p=function(t){t=t.slice();const e=Object.create(null);for(let i=0;i<t.length;i++)e[t[i].id]=t[i];for(let i=0;i<t.length;i++)"ref"in t[i]&&(t[i]=bm(t[i],e[t[i].ref]));return t}(e.layers),d={},f=[],y=0,g=p.length;y<g;++y){var m=p[y],v=m.id;if("string"==typeof i&&m.source==i||-1!==i.indexOf(v)){var _=m["source-layer"];if(!c){c=m.source;var x=e.sources[c];if(!x)throw new Error('Source "'+c+'" is not defined');var b=x.type;if("vector"!==b&&"geojson"!==b)throw new Error('Source "'+c+'" is not of type "vector" or "geojson", but "'+b+'"')}var w=d[_];w||(w=[],d[_]=w),w.push({layer:m,index:y}),f.push(v)}delete Xm[v],delete Ym[v]}var S=new Za,C=new Pa,T={},E={},k=[],P=function(t,e){var i=t.getProperties(),o=d[i.layer];if(o){var u=n.indexOf(e);-1==u&&(u=function(t,e){for(var i=0,n=e.length;i<n;++i)if(e[i]<t&&i+1<n){var r=e[i]/e[i+1];return i+Math.log(e[i]/t)/Math.log(r)}return n-1}(e,n));for(var h=Wm[t.getGeometry().getType()],c={properties:i,type:h},p=-1,f=function(n,d){var f=o[n],y=f.layer,g=y.id,m=y.layout||Vm,v=y.paint||Vm;if("none"===m.visibility||"minzoom"in y&&u<y.minzoom||"maxzoom"in y&&u>=y.maxzoom)return"continue";var _=y.filter;if(!_||function(t,e,i,n){return t in Ym||(Ym[t]=pm(e).filter),Um.zoom=n,Ym[t](Um,i)}(g,_,c,u)){var x=void 0,b=void 0,w=void 0,P=void 0,O=void 0,R=void 0,I=f.index;if(3==h&&("fill"==y.type||"fill-extrusion"==y.type))if(b=Km(y,"paint",y.type+"-opacity",u,c),y.type+"-pattern"in v){var F=Km(y,"paint",y.type+"-pattern",u,c);if(F){var j="string"==typeof F?$m(F,i):F.toString();if(a&&r&&r[j]){++p,(R=k[p])&&R.getFill()&&!R.getStroke()&&!R.getText()||(R=new sl({fill:new Pa}),k[p]=R),w=R.getFill(),R.setZIndex(I);var M=E[lt=j+"."+b];if(!M)(ct=(ht=Pm((ut=r[j]).width,ut.height)).getContext("2d")).globalAlpha=b,ct.drawImage(a,ut.x,ut.y,ut.width,ut.height,0,0,ut.width,ut.height),M=ct.createPattern(ht,"repeat"),E[lt]=M;w.setColor(M)}}}else(x=Zm(Km(y,"paint",y.type+"-color",u,c),b))&&(y.type+"-outline-color"in v&&(O=Zm(Km(y,"paint",y.type+"-outline-color",u,c),b)),O||(O=x),++p,(R=k[p])&&R.getFill()&&R.getStroke()&&!R.getText()||(R=new sl({fill:new Pa,stroke:new Za}),k[p]=R),(w=R.getFill()).setColor(x),(P=R.getStroke()).setColor(O),P.setWidth(1),R.setZIndex(I));if(1!=h&&"line"==y.type){x=!("line-pattern"in v)&&"line-color"in v?Zm(Km(y,"paint","line-color",u,c),Km(y,"paint","line-opacity",u,c)):void 0;var A=Km(y,"paint","line-width",u,c);x&&A>0&&(++p,(R=k[p])&&R.getStroke()&&!R.getFill()&&!R.getText()||(R=new sl({stroke:new Za}),k[p]=R),(P=R.getStroke()).setLineCap(Km(y,"layout","line-cap",u,c)),P.setLineJoin(Km(y,"layout","line-join",u,c)),P.setMiterLimit(Km(y,"layout","line-miter-limit",u,c)),P.setColor(x),P.setWidth(A),P.setLineDash(v["line-dasharray"]?Km(y,"paint","line-dasharray",u,c).map((function(t){return t*A})):null),R.setZIndex(I))}var L=!1,D=null,z=0,G=void 0,N=void 0,B=void 0;if((1==h||2==h)&&"icon-image"in m){var W=Km(y,"layout","icon-image",u,c);if(W){G="string"==typeof W?$m(W,i):W.toString();var q=void 0;if(a&&r&&r[G]){var V=Km(y,"layout","icon-rotation-alignment",u,c);if(2==h){var U=t.getGeometry();if(U.getFlatMidpoint||U.getFlatMidpoints){var X=U.getExtent();if(Math.sqrt(Math.max(Math.pow((X[2]-X[0])/e,2),Math.pow((X[3]-X[1])/e,2)))>150){var K="MultiLineString"===U.getType()?U.getFlatMidpoints():U.getFlatMidpoint();if(Dm||(Dm=new Fl("Point",Lm=[NaN,NaN],[],{},null)),q=Dm,Lm[0]=K[0],Lm[1]=K[1],"line"===(It=Km(y,"layout","symbol-placement",u,c))&&"map"===V)for(var Y=U.getStride(),Z=U.getFlatCoordinates(),H=0,$=Z.length-Y;H<$;H+=Y){var J=Z[H],Q=Z[H+1],tt=Z[H+Y],et=Z[H+Y+1],it=Math.min(J,tt),nt=Math.min(Q,et),rt=Math.max(J,tt),ot=Math.max(Q,et);if(K[0]>=it&&K[0]<=rt&&K[1]>=nt&&K[1]<=ot){z=Math.atan2(Q-et,tt-J);break}}}}}if(2!==h||q){var st=Km(y,"layout","icon-size",u,c),at=void 0!==v["icon-color"]?Km(y,"paint","icon-color",u,c):null;if(!at||0!==at.a){var lt=G+"."+st;if(null!==at&&(lt+="."+at),!(N=T[lt])){var ut=r[G];if(null!==at){var ht,ct;(ct=(ht=Pm(ut.width,ut.height)).getContext("2d")).drawImage(a,ut.x,ut.y,ut.width,ut.height,0,0,ut.width,ut.height);for(var pt=ct.getImageData(0,0,ht.width,ht.height),dt=0,ft=pt.data.length;dt<ft;dt+=4){var yt=at.a;0!==yt&&(pt.data[dt]=255*at.r/yt,pt.data[dt+1]=255*at.g/yt,pt.data[dt+2]=255*at.b/yt),pt.data[dt+3]=yt}ct.putImageData(pt,0,0),N=new Ya({img:ht,imgSize:[ht.width,ht.height],scale:st/ut.pixelRatio}),T[lt]=N}else N=new Ya({img:a,imgSize:l,size:[ut.width,ut.height],offset:[ut.x,ut.y],rotateWithView:"map"===V,scale:st/ut.pixelRatio}),T[lt]=N}}N&&(++p,(R=k[p])&&R.getImage()&&!R.getFill()&&!R.getStroke()||(R=new sl,k[p]=R),R.setGeometry(q),N.setRotation(z+Em(Km(y,"layout","icon-rotate",u,c))),N.setOpacity(Km(y,"paint","icon-opacity",u,c)),N.setAnchor(qm[Km(y,"layout","icon-anchor",u,c)]),R.setImage(N),D=R.getText(),R.setText(void 0),R.setZIndex(I),L=!0,B=!1)}else B=!0}}}if(1==h&&"circle-radius"in v){++p,(R=k[p])&&R.getImage()&&!R.getFill()&&!R.getStroke()||(R=new sl,k[p]=R);var gt=Km(y,"paint","circle-radius",u,c),mt=Zm(Km(y,"paint","circle-stroke-color",u,c),Km(y,"paint","circle-stroke-opacity",u,c)),vt=Zm(Km(y,"paint","circle-color",u,c),Km(y,"paint","circle-opacity",u,c)),_t=Km(y,"paint","circle-stroke-width",u,c),xt=gt+"."+mt+"."+vt+"."+_t;(N=T[xt])||(N=new tl({radius:gt,stroke:mt&&_t>0?new Za({width:_t,color:mt}):void 0,fill:vt?new Pa({color:vt}):void 0}),T[xt]=N),R.setImage(N),D=R.getText(),R.setText(void 0),R.setGeometry(void 0),R.setZIndex(I),L=!0}var bt=void 0;if("text-field"in m)bt=$m(Km(y,"layout","text-field",u,c).toString(),i).trim(),b=Km(y,"paint","text-opacity",u,c);if(bt&&b&&!B){L||(++p,(R=k[p])&&R.getText()&&!R.getFill()&&!R.getStroke()||(R=new sl,k[p]=R),R.setImage(void 0),R.setGeometry(void 0)),R.getText()||R.setText(D||new ul({padding:[2,2,2,2]})),D=R.getText();var wt=Math.round(Km(y,"layout","text-size",u,c)),St=Km(y,"layout","text-font",u,c),Ct=Km(y,"layout","text-line-height",u,c),Tt=function(t,e,i){var n=vd[t];if(!n){Array.isArray(t)||(t=[t]);for(var r=400,o="normal",s=[],a=0,l=t.length;a<l;++a){var u=t[a].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()):md.test(h)&&(h=h.replace(md,""),o=u[u.length-1].replace(h,"")),gd)if(h==c||h==c.replace("-","")||h==c.replace("-"," ")){r=gd[c],u.pop();break}"number"==typeof h&&(r=h);var p=u.join(" ").replace("Klokantech Noto Sans","Noto Sans");-1!==p.indexOf(" ")&&(p='"'+p+'"'),s.push(p)}n=vd[t]=[o,r,s]}return n[0]+" "+n[1]+" "+e+"px"+(i?"/"+i:"")+" "+n[2]}(s?s(St):St,wt,Ct),Et=m["text-transform"];"uppercase"==Et?bt=bt.toUpperCase():"lowercase"==Et&&(bt=bt.toLowerCase());var kt=Km(y,"layout","text-max-width",u,c),Pt=Km(y,"layout","text-letter-spacing",u,c),Ot=2==h?Im(bt,Pt):Am(bt,Tt,kt,Pt);D.setText(Ot),D.setFont(Tt),D.setRotation(Em(Km(y,"layout","text-rotate",u,c)));var Rt=Km(y,"layout","text-anchor",u,c),It=L||1==h?"point":Km(y,"layout","symbol-placement",u,c);D.setPlacement(It);var Ft=Km(y,"paint","text-halo-width",u,c),jt=Km(y,"layout","text-offset",u,c),Mt=Km(y,"paint","text-translate",u,c),At=0,Lt=0;if("point"==It){var Dt="center";-1!==Rt.indexOf("left")?(Dt="left",Lt=Ft):-1!==Rt.indexOf("right")&&(Dt="right",Lt=-Ft),D.setTextAlign(Dt);var zt=Km(y,"layout","text-rotation-alignment",u,c);D.setRotateWithView("map"==zt)}else D.setMaxAngle(Em(Km(y,"layout","text-max-angle",u,c))*bt.length/Ot.length),D.setTextAlign(),D.setRotateWithView(!1);var Gt="middle";0==Rt.indexOf("bottom")?(Gt="bottom",At=-Ft-.5*(Ct-1)*wt):0==Rt.indexOf("top")&&(Gt="top",At=Ft+.5*(Ct-1)*wt),D.setTextBaseline(Gt),D.setOffsetX(jt[0]*wt+Lt+Mt[0]),D.setOffsetY(jt[1]*wt+At+Mt[1]),C.setColor(Zm(Km(y,"paint","text-color",u,c),b)),D.setFill(C);var Nt=Zm(Km(y,"paint","text-halo-color",u,c),b);if(Nt){S.setColor(Nt),Ft*=2;var Bt=.5*wt;S.setWidth(Ft<=Bt?Ft:Bt),D.setStroke(S)}else D.setStroke(void 0);var Wt=Km(y,"layout","text-padding",u,c),qt=D.getPadding();Wt!==qt[0]&&(qt[0]=Wt,qt[1]=Wt,qt[2]=Wt,qt[3]=Wt),R.setZIndex(I)}}},y=0,g=o.length;y<g;++y)f(y);return p>-1?(k.length=p+1,k):void 0}};return t.setStyle(P),t.set("mapbox-source",c),t.set("mapbox-layers",f),P}var Qm,tv=Object.freeze,ev=Object.defineProperty,iv=Object.getOwnPropertyDescriptor,nv=(t,e,i,n)=>{for(var r,o=n>1?void 0:n?iv(e,i):e,s=t.length-1;s>=0;s--)(r=t[s])&&(o=(n?r(e,i,o):r(o))||o);return n&&o&&ev(e,i,o),o};let rv=class extends ht{constructor(){super(...arguments),this.latitude=51.507351,this.longitude=-.127758,this.zoom=10,this.minZoom=7,this.maxZoom=22,this.drawMode=!1,this.drawGeojsonData={type:"Feature",geometry:{}},this.drawGeojsonDataBuffer=100,this.drawPointer="crosshair",this.showFeaturesAtPoint=!1,this.clickFeatures=!1,this.featureColor="#0000ff",this.featureFill=!1,this.featureBuffer=40,this.geojsonData={type:"FeatureCollection",features:[]},this.geojsonColor="#ff0000",this.geojsonFill=!1,this.geojsonBuffer=12,this.disableVectorTiles=!1,this.osVectorTilesApiKey="",this.osFeaturesApiKey="",this.osCopyright=`© Crown copyright and database rights ${(new Date).getFullYear()} OS (0)100024857`,this.hideResetControl=!1,this.staticMode=!1,this.areaUnit="m2",this.showScale=!1,this.useScaleBarStyle=!1,this.dispatch=(t,e)=>this.dispatchEvent(new CustomEvent(t,{detail:e}))}firstUpdated(){var t;const e=null==(t=this.shadowRoot)?void 0:t.querySelector("#map"),i=!this.disableVectorTiles&&Boolean(this.osVectorTilesApiKey),n=(r=this.osCopyright,o=this.osVectorTilesApiKey,new yd({source:o?new xd({url:"https://api.os.uk/maps/raster/v1/zxy/Light_3857/{z}/{x}/{y}.png?key="+o,attributions:[r],attributionsCollapsible:!1,maxZoom:20}):new Sd({attributions:[wd]})}));var r,o;const s=function(t,e){let i=new fp({declutter:!0,source:new Yp({format:new zl,url:"https://api.os.uk/maps/vector/v1/vts/tile/{z}/{y}/{x}.pbf?srs=3857&key="+e,attributions:[t],attributionsCollapsible:!1})});return e&&fetch("https://api.os.uk/maps/vector/v1/vts/resources/styles?srs=3857&key="+e).then((t=>t.json())).then((t=>Jm(i,t,"esri"))).catch((t=>console.log(t))),i}(this.osCopyright,this.osVectorTilesApiKey),a=new $p({target:e,layers:[i?s:n],view:new zs({projection:"EPSG:3857",extent:(u=[-10.76418,49.528423,1.9134116,61.331151],h="EPSG:4326",c="EPSG:3857",kn(u,nr(h,c),void 0,p)),minZoom:this.minZoom,maxZoom:this.maxZoom,center:tr([this.longitude,this.latitude]),zoom:this.zoom,enableRotation:!1}),controls:$s({attribution:!0,zoom:!this.staticMode}).extend(this.showScale?[(l=this.useScaleBarStyle,new Hs({units:"metric",bar:l,steps:4,text:!0,minWidth:140}))]:[]),interactions:$c({doubleClickZoom:!this.staticMode,dragPan:!this.staticMode,mouseWheelZoom:!this.staticMode})});var l,u,h,c,p;const d=(f=this.drawPointer,new Lc({source:Ld,type:"Polygon",style:new sl({stroke:Id,fill:Fd,image:"crosshair"===f?jd:Md})}));var f;const y=function(t){return new Xc({source:Ld,style:new sl({image:"crosshair"===t?jd:Md})})}(this.drawPointer),g=document.createElement("button");g.innerHTML="↻",g.title="Reset map view";g.addEventListener("click",(()=>{this.showFeaturesAtPoint?Ff(a,Af,this.featureBuffer):_.getFeatures().length>0?Ff(a,_,this.geojsonBuffer):(a.getView().setCenter(tr([this.longitude,this.latitude])),a.getView().setZoom(this.zoom)),this.drawMode&&(Ld.clear(),a.addInteraction(d),a.addInteraction(zd))}),!1);const m=document.createElement("div");m.className="reset-control ol-unselectable ol-control",m.appendChild(g);var v=new ge({element:m});this.hideResetControl||a.addControl(v),a.on("pointerdrag",(()=>{a.getViewport().style.cursor="grabbing"})),a.on("pointermove",(()=>{a.getViewport().style.cursor="grab"}));const _=new Ec;if("FeatureCollection"===this.geojsonData.type){let t=(new ka).readFeatures(this.geojsonData,{featureProjection:"EPSG:3857"});_.addFeatures(t)}else if("Feature"===this.geojsonData.type){let t=(new ka).readFeature(this.geojsonData,{featureProjection:"EPSG:3857"});_.addFeature(t)}const x=new uc({source:_,style:new sl({stroke:new Za({color:this.geojsonColor,width:3}),fill:new Pa({color:this.geojsonFill?jf(this.geojsonColor,.2):jf(this.geojsonColor,0)})})});if(a.addLayer(x),_.getFeatures().length>0){Ff(a,_,this.geojsonBuffer);const t=_.getFeatures()[0].getGeometry();t&&this.dispatch("geojsonDataArea",If(t,this.areaUnit))}if(this.drawMode){const t=Object.keys(this.drawGeojsonData.geometry).length>0;if(t){let t=(new ka).readFeature(this.drawGeojsonData,{featureProjection:"EPSG:3857"});Ld.addFeature(t),Ff(a,Ld,this.drawGeojsonDataBuffer)}else Ld.clear();a.addLayer(Dd),t||a.addInteraction(d),a.addInteraction(y),a.addInteraction(zd),Ld.on("change",(()=>{const t=Ld.getFeatures();if(t.length>0){const i=(e=t,"string"==typeof e?e[e.length-1]||"":e[e.length-1]).getGeometry();this.dispatch("geojsonChange",(new ka).writeFeaturesObject(t,{featureProjection:"EPSG:3857"})),i&&this.dispatch("areaChange",If(i,this.areaUnit)),a.removeInteraction(d)}var e}))}if(this.drawMode&&Boolean(this.osVectorTilesApiKey)&&!this.disableVectorTiles&&(a.addLayer(kd),Dd.setZIndex(1001),a.on("moveend",(()=>{const t=a.getView().getZoom();t&&t<20?Ed.clear():setTimeout((()=>{Ed.clear();const t=a.getView().calculateExtent(a.getSize());Pd(s,t)}),200)}))),this.showFeaturesAtPoint&&Boolean(this.osFeaturesApiKey)){Lf(tr([this.longitude,this.latitude]),this.osFeaturesApiKey),this.clickFeatures&&a.on("singleclick",(t=>{Lf(t.coordinate,this.osFeaturesApiKey)}));const t=(b=this.featureColor,w=this.featureFill,new uc({source:Af,style:new sl({stroke:new Za({width:3,color:b}),fill:new Pa({color:jf(b,w?.2:0)})})}));a.addLayer(t),Af.on("change",(()=>{if("ready"===Af.getState()&&Af.getFeatures().length>0){Ff(a,Af,this.featureBuffer),this.dispatch("featuresGeojsonChange",(new ka).writeFeaturesObject(Af.getFeatures(),{featureProjection:"EPSG:3857"}));const t=Af.getFeatures()[0].getGeometry();t&&this.dispatch("featuresAreaChange",If(t,this.areaUnit))}}))}var b,w;setTimeout((()=>{window.dispatchEvent(new Event("resize")),e.style.opacity="1",this.dispatch("ready")}),500)}render(){return q(Qm||(Qm=tv(ev(t=['<script src="https://cdn.polyfill.io/v2/polyfill.min.js"><\/script>\n <link rel="stylesheet" href="https://cdn.skypack.dev/ol@^6.6.1/ol.css" />\n <div id="map" tabindex="0" />'],"raw",{value:tv(e||t.slice())}))));var t,e}};var ov;rv.styles=((t,...e)=>{const i=1===t.length?t[0]:e.reduce(((e,i,n)=>e+(t=>{if(t instanceof c)return t.cssText;if("number"==typeof t)return t;throw Error("Value passed to 'css' function must be a 'css' function result: "+t+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(i)+t[n+1]),t[0]);return d(i)})`
|
42
42
|
:host {
|
43
43
|
display: block;
|
44
44
|
width: 800px;
|
@@ -72,4 +72,4 @@ var tm=function(t,e){this.next=null,this.key=t,this.data=e,this.left=null,this.r
|
|
72
72
|
z-index: 100;
|
73
73
|
background: white;
|
74
74
|
}
|
75
|
-
`,
|
75
|
+
`,nv([pt({type:Number})],rv.prototype,"latitude",2),nv([pt({type:Number})],rv.prototype,"longitude",2),nv([pt({type:Number})],rv.prototype,"zoom",2),nv([pt({type:Number})],rv.prototype,"minZoom",2),nv([pt({type:Number})],rv.prototype,"maxZoom",2),nv([pt({type:Boolean})],rv.prototype,"drawMode",2),nv([pt({type:Object})],rv.prototype,"drawGeojsonData",2),nv([pt({type:Number})],rv.prototype,"drawGeojsonDataBuffer",2),nv([pt({type:String})],rv.prototype,"drawPointer",2),nv([pt({type:Boolean})],rv.prototype,"showFeaturesAtPoint",2),nv([pt({type:Boolean})],rv.prototype,"clickFeatures",2),nv([pt({type:String})],rv.prototype,"featureColor",2),nv([pt({type:Boolean})],rv.prototype,"featureFill",2),nv([pt({type:Number})],rv.prototype,"featureBuffer",2),nv([pt({type:Object})],rv.prototype,"geojsonData",2),nv([pt({type:String})],rv.prototype,"geojsonColor",2),nv([pt({type:Boolean})],rv.prototype,"geojsonFill",2),nv([pt({type:Number})],rv.prototype,"geojsonBuffer",2),nv([pt({type:Boolean})],rv.prototype,"disableVectorTiles",2),nv([pt({type:String})],rv.prototype,"osVectorTilesApiKey",2),nv([pt({type:String})],rv.prototype,"osFeaturesApiKey",2),nv([pt({type:String})],rv.prototype,"osCopyright",2),nv([pt({type:Boolean})],rv.prototype,"hideResetControl",2),nv([pt({type:Boolean})],rv.prototype,"staticMode",2),nv([pt({type:String})],rv.prototype,"areaUnit",2),nv([pt({type:Boolean})],rv.prototype,"showScale",2),nv([pt({type:Boolean})],rv.prototype,"useScaleBarStyle",2),rv=nv([(ov="my-map",t=>{return"function"==typeof t?(e=ov,i=t,window.customElements.define(e,i),i):((t,e)=>{const{kind:i,elements:n}=e;return{kind:i,elements:n,finisher(e){window.customElements.define(t,e)}}})(ov,t);var e,i})],rv);export{rv as MyMap};
|