@opensystemslab/map 0.4.8 → 0.5.1
Sign up to get free protection for your applications and to get access to all the features.
@@ -14,7 +14,7 @@ var __defProp=Object.defineProperty,__defProps=Object.defineProperties,__getOwnP
|
|
14
14
|
* Copyright 2017 Google LLC
|
15
15
|
* SPDX-License-Identifier: BSD-3-Clause
|
16
16
|
*/
|
17
|
-
var v,y,_,b;m.finalized=!0,m.elementProperties=new Map,m.elementStyles=[],m.shadowRootOptions={mode:"open"},null===(p=(u=globalThis).reactiveElementPlatformSupport)||void 0===p||p.call(u,{ReactiveElement:m}),(null!==(d=(h=globalThis).reactiveElementVersions)&&void 0!==d?d:h.reactiveElementVersions=[]).push("1.0.0-rc.2");const x=globalThis.trustedTypes,k=x?x.createPolicy("lit-html",{createHTML:t=>t}):void 0,w=`lit$${(Math.random()+"").slice(9)}$`,S="?"+w,C=`<${S}>`,z=document,T=(t="")=>z.createComment(t),E=t=>null===t||"object"!=typeof t&&"function"!=typeof t,P=Array.isArray,O=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,j=/-->/g,R=/>/g,I=/>|[ \n\r](?:([^\s"'>=/]+)([ \n\r]*=[ \n\r]*(?:[^ \n\r"'`<>=]|("|')|))|$)/g,F=/'/g,M=/"/g,A=/^(?:script|style|textarea)$/i,D=(q=1,(t,...e)=>({_$litType$:q,strings:t,values:e})),L=Symbol.for("lit-noChange"),G=Symbol.for("lit-nothing"),N=new WeakMap,B=z.createTreeWalker(z,129,null,!1);var q,W,V,U,X,K,Y;class Z{constructor({strings:t,_$litType$:e},i){let o;this.parts=[];let n=0,r=0;const a=t.length-1,s=this.parts,[l,u]=((t,e)=>{const i=t.length-1,o=[];let n,r=2===e?"<svg>":"",a=O;for(let l=0;l<i;l++){const e=t[l];let i,s,u=-1,p=0;for(;p<e.length&&(a.lastIndex=p,s=a.exec(e),null!==s);)p=a.lastIndex,a===O?"!--"===s[1]?a=j:void 0!==s[1]?a=R:void 0!==s[2]?(A.test(s[2])&&(n=RegExp("</"+s[2],"g")),a=I):void 0!==s[3]&&(a=I):a===I?">"===s[0]?(a=null!=n?n:O,u=-1):void 0===s[1]?u=-2:(u=a.lastIndex-s[2].length,i=s[1],a=void 0===s[3]?I:'"'===s[3]?M:F):a===M||a===F?a=I:a===j||a===R?a=O:(a=I,n=void 0);const d=a===I&&t[l+1].startsWith("/>")?" ":"";r+=a===O?e+C:u>=0?(o.push(i),e.slice(0,u)+"$lit$"+e.slice(u)+w+d):e+w+(-2===u?(o.push(void 0),l):d)}const s=r+(t[i]||"<?>")+(2===e?"</svg>":"");return[void 0!==k?k.createHTML(s):s,o]})(t,e);if(this.el=Z.createElement(l,i),B.currentNode=this.el.content,2===e){const t=this.el.content,e=t.firstChild;e.remove(),t.append(...e.childNodes)}for(;null!==(o=B.nextNode())&&s.length<a;){if(1===o.nodeType){if(o.hasAttributes()){const t=[];for(const e of o.getAttributeNames())if(e.endsWith("$lit$")||e.startsWith(w)){const i=u[r++];if(t.push(e),void 0!==i){const t=o.getAttribute(i.toLowerCase()+"$lit$").split(w),e=/([.?@])?(.*)/.exec(i);s.push({type:1,index:n,name:e[2],strings:t,ctor:"."===e[1]?tt:"?"===e[1]?et:"@"===e[1]?it:Q})}else s.push({type:6,index:n})}for(const e of t)o.removeAttribute(e)}if(A.test(o.tagName)){const t=o.textContent.split(w),e=t.length-1;if(e>0){o.textContent=x?x.emptyScript:"";for(let i=0;i<e;i++)o.append(t[i],T()),B.nextNode(),s.push({type:2,index:++n});o.append(t[e],T())}}}else if(8===o.nodeType)if(o.data===S)s.push({type:2,index:n});else{let t=-1;for(;-1!==(t=o.data.indexOf(w,t+1));)s.push({type:7,index:n}),t+=w.length-1}n++}}static createElement(t,e){const i=z.createElement("template");return i.innerHTML=t,i}}function
|
17
|
+
var v,y,_,b;m.finalized=!0,m.elementProperties=new Map,m.elementStyles=[],m.shadowRootOptions={mode:"open"},null===(p=(u=globalThis).reactiveElementPlatformSupport)||void 0===p||p.call(u,{ReactiveElement:m}),(null!==(d=(h=globalThis).reactiveElementVersions)&&void 0!==d?d:h.reactiveElementVersions=[]).push("1.0.0-rc.2");const x=globalThis.trustedTypes,k=x?x.createPolicy("lit-html",{createHTML:t=>t}):void 0,w=`lit$${(Math.random()+"").slice(9)}$`,S="?"+w,C=`<${S}>`,z=document,T=(t="")=>z.createComment(t),E=t=>null===t||"object"!=typeof t&&"function"!=typeof t,P=Array.isArray,O=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,j=/-->/g,R=/>/g,I=/>|[ \n\r](?:([^\s"'>=/]+)([ \n\r]*=[ \n\r]*(?:[^ \n\r"'`<>=]|("|')|))|$)/g,F=/'/g,M=/"/g,A=/^(?:script|style|textarea)$/i,D=(q=1,(t,...e)=>({_$litType$:q,strings:t,values:e})),L=Symbol.for("lit-noChange"),G=Symbol.for("lit-nothing"),N=new WeakMap,B=z.createTreeWalker(z,129,null,!1);var q,W,V,U,X,K,Y;class Z{constructor({strings:t,_$litType$:e},i){let o;this.parts=[];let n=0,r=0;const a=t.length-1,s=this.parts,[l,u]=((t,e)=>{const i=t.length-1,o=[];let n,r=2===e?"<svg>":"",a=O;for(let l=0;l<i;l++){const e=t[l];let i,s,u=-1,p=0;for(;p<e.length&&(a.lastIndex=p,s=a.exec(e),null!==s);)p=a.lastIndex,a===O?"!--"===s[1]?a=j:void 0!==s[1]?a=R:void 0!==s[2]?(A.test(s[2])&&(n=RegExp("</"+s[2],"g")),a=I):void 0!==s[3]&&(a=I):a===I?">"===s[0]?(a=null!=n?n:O,u=-1):void 0===s[1]?u=-2:(u=a.lastIndex-s[2].length,i=s[1],a=void 0===s[3]?I:'"'===s[3]?M:F):a===M||a===F?a=I:a===j||a===R?a=O:(a=I,n=void 0);const d=a===I&&t[l+1].startsWith("/>")?" ":"";r+=a===O?e+C:u>=0?(o.push(i),e.slice(0,u)+"$lit$"+e.slice(u)+w+d):e+w+(-2===u?(o.push(void 0),l):d)}const s=r+(t[i]||"<?>")+(2===e?"</svg>":"");return[void 0!==k?k.createHTML(s):s,o]})(t,e);if(this.el=Z.createElement(l,i),B.currentNode=this.el.content,2===e){const t=this.el.content,e=t.firstChild;e.remove(),t.append(...e.childNodes)}for(;null!==(o=B.nextNode())&&s.length<a;){if(1===o.nodeType){if(o.hasAttributes()){const t=[];for(const e of o.getAttributeNames())if(e.endsWith("$lit$")||e.startsWith(w)){const i=u[r++];if(t.push(e),void 0!==i){const t=o.getAttribute(i.toLowerCase()+"$lit$").split(w),e=/([.?@])?(.*)/.exec(i);s.push({type:1,index:n,name:e[2],strings:t,ctor:"."===e[1]?tt:"?"===e[1]?et:"@"===e[1]?it:Q})}else s.push({type:6,index:n})}for(const e of t)o.removeAttribute(e)}if(A.test(o.tagName)){const t=o.textContent.split(w),e=t.length-1;if(e>0){o.textContent=x?x.emptyScript:"";for(let i=0;i<e;i++)o.append(t[i],T()),B.nextNode(),s.push({type:2,index:++n});o.append(t[e],T())}}}else if(8===o.nodeType)if(o.data===S)s.push({type:2,index:n});else{let t=-1;for(;-1!==(t=o.data.indexOf(w,t+1));)s.push({type:7,index:n}),t+=w.length-1}n++}}static createElement(t,e){const i=z.createElement("template");return i.innerHTML=t,i}}function $(t,e,i=t,o){var n,r,a,s;if(e===L)return e;let l=void 0!==o?null===(n=i.Σi)||void 0===n?void 0:n[o]:i.Σo;const u=E(e)?void 0:e._$litDirective$;return(null==l?void 0:l.constructor)!==u&&(null===(r=null==l?void 0:l.O)||void 0===r||r.call(l,!1),void 0===u?l=void 0:(l=new u(t),l.T(t,i,o)),void 0!==o?(null!==(a=(s=i).Σi)&&void 0!==a?a:s.Σi=[])[o]=l:i.Σo=l),void 0!==l&&(e=$(t,l.S(t,e.values),l,o)),e}class H{constructor(t,e){this.l=[],this.N=void 0,this.D=t,this.M=e}u(t){var e;const{el:{content:i},parts:o}=this.D,n=(null!==(e=null==t?void 0:t.creationScope)&&void 0!==e?e:z).importNode(i,!0);B.currentNode=n;let r=B.nextNode(),a=0,s=0,l=o[0];for(;void 0!==l;){if(a===l.index){let e;2===l.type?e=new J(r,r.nextSibling,this,t):1===l.type?e=new l.ctor(r,l.name,l.strings,this,t):6===l.type&&(e=new ot(r,this,t)),this.l.push(e),l=o[++s]}a!==(null==l?void 0:l.index)&&(r=B.nextNode(),a++)}return n}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 J{constructor(t,e,i,o){this.type=2,this.N=void 0,this.A=t,this.B=e,this.M=i,this.options=o}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=$(this,t,e),E(t)?t===G||null==t||""===t?(this.H!==G&&this.R(),this.H=G):t!==this.H&&t!==L&&this.m(t):void 0!==t._$litType$?this._(t):void 0!==t.nodeType?this.$(t):(t=>{var e;return P(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.$(z.createTextNode(t)),this.H=t}_(t){var e;const{values:i,_$litType$:o}=t,n="number"==typeof o?this.C(t):(void 0===o.el&&(o.el=Z.createElement(o.h,this.options)),o);if((null===(e=this.H)||void 0===e?void 0:e.D)===n)this.H.v(i);else{const t=new H(n,this),e=t.u(this.options);t.v(i),this.$(e),this.H=t}}C(t){let e=N.get(t.strings);return void 0===e&&N.set(t.strings,e=new Z(t)),e}g(t){P(this.H)||(this.H=[],this.R());const e=this.H;let i,o=0;for(const n of t)o===e.length?e.push(i=new J(this.k(T()),this.k(T()),this,this.options)):i=e[o],i.I(n),o++;o<e.length&&(this.R(i&&i.B.nextSibling,o),e.length=o)}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 Q{constructor(t,e,i,o,n){this.type=1,this.H=G,this.N=void 0,this.V=void 0,this.element=t,this.name=e,this.M=o,this.options=n,i.length>2||""!==i[0]||""!==i[1]?(this.H=Array(i.length-1).fill(G),this.strings=i):this.H=G}get tagName(){return this.element.tagName}I(t,e=this,i,o){const n=this.strings;let r=!1;if(void 0===n)t=$(this,t,e,0),r=!E(t)||t!==this.H&&t!==L,r&&(this.H=t);else{const o=t;let a,s;for(t=n[0],a=0;a<n.length-1;a++)s=$(this,o[i+a],e,a),s===L&&(s=this.H[a]),r||(r=!E(s)||s!==this.H[a]),s===G?t=G:t!==G&&(t+=(null!=s?s:"")+n[a+1]),this.H[a]=s}r&&!o&&this.W(t)}W(t){t===G?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,null!=t?t:"")}}class tt extends Q{constructor(){super(...arguments),this.type=3}W(t){this.element[this.name]=t===G?void 0:t}}class et extends Q{constructor(){super(...arguments),this.type=4}W(t){t&&t!==G?this.element.setAttribute(this.name,""):this.element.removeAttribute(this.name)}}class it extends Q{constructor(){super(...arguments),this.type=5}I(t,e=this){var i;if((t=null!==(i=$(this,t,e,0))&&void 0!==i?i:G)===L)return;const o=this.H,n=t===G&&o!==G||t.capture!==o.capture||t.once!==o.once||t.passive!==o.passive,r=t!==G&&(o===G||n);n&&this.element.removeEventListener(this.name,this,o),r&&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 ot{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){$(this,t)}}null===(y=(v=globalThis).litHtmlPlatformSupport)||void 0===y||y.call(v,Z,J),(null!==(_=(b=globalThis).litHtmlVersions)&&void 0!==_?_:b.litHtmlVersions=[]).push("2.0.0-rc.3"),(null!==(W=(Y=globalThis).litElementVersions)&&void 0!==W?W:Y.litElementVersions=[]).push("3.0.0-rc.2");class nt extends m{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 o,n;const r=null!==(o=null==i?void 0:i.renderBefore)&&void 0!==o?o:e;let a=r._$litPart$;if(void 0===a){const t=null!==(n=null==i?void 0:i.renderBefore)&&void 0!==n?n:null;r._$litPart$=a=new J(e.insertBefore(T(),t),t,void 0,i)}return a.I(t),a})(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 L}}nt.finalized=!0,nt._$litElement$=!0,null===(U=(V=globalThis).litElementHydrateSupport)||void 0===U||U.call(V,{LitElement:nt}),null===(K=(X=globalThis).litElementPlatformSupport)||void 0===K||K.call(X,{LitElement:nt});
|
18
18
|
/**
|
19
19
|
* @license
|
20
20
|
* Copyright 2017 Google LLC
|
@@ -30,11 +30,11 @@ const rt=t=>e=>{return"function"==typeof e?(i=t,o=e,window.customElements.define
|
|
30
30
|
* @license
|
31
31
|
* Copyright 2017 Google LLC
|
32
32
|
* SPDX-License-Identifier: BSD-3-Clause
|
33
|
-
*/function lt(t){return st(__spreadProps(__spreadValues({},t),{state:!0,attribute:!1}))}var ut=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}(),pt="propertychange",dt=function(){function t(){this.disposed=!1}return t.prototype.dispose=function(){this.disposed||(this.disposed=!0,this.disposeInternal())},t.prototype.disposeInternal=function(){},t}();function ht(t,e){return t>e?1:t<e?-1:0}function ct(t,e,i){var o=t.length;if(t[0]<=e)return 0;if(e<=t[o-1])return o-1;var n=void 0;if(i>0){for(n=1;n<o;++n)if(t[n]<e)return n-1}else if(i<0){for(n=1;n<o;++n)if(t[n]<=e)return n}else for(n=1;n<o;++n){if(t[n]==e)return n;if(t[n]<e)return"function"==typeof i?i(e,t[n-1],t[n])>0?n-1:n:t[n-1]-e<e-t[n]?n-1:n}return o-1}function ft(t,e,i){for(;e<i;){var o=t[e];t[e]=t[i],t[i]=o,++e,--i}}function gt(t,e){for(var i=Array.isArray(e)?e:[e],o=i.length,n=0;n<o;n++)t[t.length]=i[n]}function mt(t,e){var i=t.length;if(i!==e.length)return!1;for(var o=0;o<i;o++)if(t[o]!==e[o])return!1;return!0}function vt(){return!0}function yt(){return!1}function _t(){}var bt="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),o=1,n=arguments.length;o<n;++o){var r=arguments[o];if(null!=r)for(var a in r)r.hasOwnProperty(a)&&(i[a]=r[a])}return i};function xt(t){for(var e in t)delete t[e]}var kt="function"==typeof Object.values?Object.values:function(t){var e=[];for(var i in t)e.push(t[i]);return e};function wt(t){var e;for(e in t)return!1;return!e}var St,Ct=(St=function(t,e){return(St=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}St(t,e),t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)}),zt=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 Ct(e,t),e.prototype.addEventListener=function(t,e){if(t&&e){var i=this.listeners_||(this.listeners_={}),o=i[t]||(i[t]=[]);-1===o.indexOf(e)&&o.push(e)}},e.prototype.dispatchEvent=function(t){var e="string"==typeof t?new ut(t):t,i=e.type;e.target||(e.target=this.eventTarget_||this);var o,n=this.listeners_&&this.listeners_[i];if(n){var r=this.dispatching_||(this.dispatching_={}),a=this.pendingRemovals_||(this.pendingRemovals_={});i in r||(r[i]=0,a[i]=0),++r[i];for(var s=0,l=n.length;s<l;++s)if(!1===(o="handleEvent"in n[s]?n[s].handleEvent(e):n[s].call(this,e))||e.propagationStopped){o=!1;break}if(--r[i],0===r[i]){var u=a[i];for(delete a[i];u--;)this.removeEventListener(i,_t);delete r[i]}return o}},e.prototype.disposeInternal=function(){this.listeners_&&xt(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 o=i.indexOf(e);-1!==o&&(this.pendingRemovals_&&t in this.pendingRemovals_?(i[o]=_t,++this.pendingRemovals_[t]):(i.splice(o,1),0===i.length&&delete this.listeners_[t]))}},e}(dt),Tt="change",Et="error",Pt="clear",Ot="contextmenu",jt="click",Rt="dblclick",It="keydown",Ft="keypress",Mt="load",At="resize",Dt="touchmove",Lt="wheel";function Gt(t,e,i,o,n){if(o&&o!==t&&(i=i.bind(o)),n){var r=i;i=function(){t.removeEventListener(e,i),r.apply(this,arguments)}}var a={target:t,type:e,listener:i};return t.addEventListener(e,i),a}function Nt(t,e,i,o){return Gt(t,e,i,o,!0)}function Bt(t){t&&t.target&&(t.target.removeEventListener(t.type,t.listener),xt(t))}var qt=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 o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}(),Wt=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 qt(e,t),e.prototype.changed=function(){++this.revision_,this.dispatchEvent(Tt)},e.prototype.getRevision=function(){return this.revision_},e.prototype.onInternal=function(t,e){if(Array.isArray(t)){for(var i=t.length,o=new Array(i),n=0;n<i;++n)o[n]=Gt(this,t[n],e);return o}return Gt(this,t,e)},e.prototype.onceInternal=function(t,e){var i;if(Array.isArray(t)){var o=t.length;i=new Array(o);for(var n=0;n<o;++n)i[n]=Nt(this,t[n],e)}else i=Nt(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)Bt(t[e]);else Bt(t)}(i);else if(Array.isArray(t))for(var o=0,n=t.length;o<n;++o)this.removeEventListener(t[o],e);else this.removeEventListener(t,e)},e}(zt);Wt.prototype.on,Wt.prototype.once,Wt.prototype.un;var Vt=Wt;function Ut(){return function(){throw new Error("Unimplemented abstract method.")}()}var Xt=0;function Kt(t){return t.ol_uid||(t.ol_uid=String(++Xt))}var Yt=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 o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}(),Zt=function(t){function e(e,i,o){var n=t.call(this,e)||this;return n.key=i,n.oldValue=o,n}return Yt(e,t),e}(ut),Ht=function(t){function e(e){var i=t.call(this)||this;return i.on,i.once,i.un,Kt(i),i.values_=null,void 0!==e&&i.setProperties(e),i}return Yt(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_&&bt({},this.values_)||{}},e.prototype.hasProperties=function(){return!!this.values_},e.prototype.notify=function(t,e){var i;i="change:"+t,this.dispatchEvent(new Zt(i,t,e)),i=pt,this.dispatchEvent(new Zt(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 o=this.values_||(this.values_={});if(i)o[t]=e;else{var n=o[t];o[t]=e,n!==e&&this.notify(t,n)}},e.prototype.setProperties=function(t,e){for(var i in t)this.set(i,t[i],e)},e.prototype.applyProperties=function(t){t.values_&&bt(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],wt(this.values_)&&(this.values_=null),e||this.notify(t,i)}},e}(Vt),$t="postrender",Jt="movestart",Qt="moveend",te="undefined"!=typeof navigator&&void 0!==navigator.userAgent?navigator.userAgent.toLowerCase():"",ee=-1!==te.indexOf("firefox");-1!==te.indexOf("safari")&&te.indexOf("chrom");var ie=-1!==te.indexOf("webkit")&&-1==te.indexOf("edge"),oe=-1!==te.indexOf("macintosh"),ne="undefined"!=typeof devicePixelRatio?devicePixelRatio:1,re="undefined"!=typeof WorkerGlobalScope&&"undefined"!=typeof OffscreenCanvas&&self instanceof WorkerGlobalScope,ae="undefined"!=typeof Image&&Image.prototype.decode,se=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 le(t,e,i,o){var n;return i&&i.length?n=i.shift():re?n=new OffscreenCanvas(t||300,e||300):(n=document.createElement("canvas")).style.all="unset",t&&(n.width=t),e&&(n.height=e),n.getContext("2d",o)}function ue(t,e){var i=e.parentNode;i&&i.replaceChild(t,e)}function pe(t){return t&&t.parentNode?t.parentNode.removeChild(t):null}var de=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 o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}(),he=function(t){function e(e){var i=t.call(this)||this,o=e.element;return!o||e.target||o.style.pointerEvents||(o.style.pointerEvents="auto"),i.element=o||null,i.target_=null,i.map_=null,i.listenerKeys=[],e.render&&(i.render=e.render),e.target&&i.setTarget(e.target),i}return de(e,t),e.prototype.disposeInternal=function(){pe(this.element),t.prototype.disposeInternal.call(this)},e.prototype.getMap=function(){return this.map_},e.prototype.setMap=function(t){this.map_&&pe(this.element);for(var e=0,i=this.listenerKeys.length;e<i;++e)Bt(this.listenerKeys[e]);(this.listenerKeys.length=0,this.map_=t,this.map_)&&((this.target_?this.target_:t.getOverlayContainerStopEvent()).appendChild(this.element),this.render!==_t&&this.listenerKeys.push(Gt(t,$t,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}(Ht),ce="ol-hidden",fe="ol-unselectable",ge="ol-control",me="ol-collapsed",ve=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"),ye=["style","variant","weight","size","lineHeight","family"],_e=function(t){var e=t.match(ve);if(!e)return null;for(var i={lineHeight:"normal",size:"1.2em",style:"normal",weight:"normal",variant:"normal"},o=0,n=ye.length;o<n;++o){var r=e[o+1];void 0!==r&&(i[ye[o]]=r)}return i.families=i.family.split(/,\s?/),i};function be(t){return 1===t?"":String(Math.round(100*t)/100)}var xe="opacity",ke="visible",we="extent",Se="zIndex",Ce="maxResolution",ze="minResolution",Te="maxZoom",Ee="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 o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}(),je=function(t){function e(e){var i=this,o="Assertion failed. See https://openlayers.org/en/"+("v"+"6.9.0".split("-")[0])+"/doc/errors/#"+e+" for details.";return(i=t.call(this,o)||this).code=e,i.name="AssertionError",i.message=o,i}return Oe(e,t),e}(Error);function Re(t,e){if(!t)throw new je(e)}function Ie(t,e,i){return Math.min(Math.max(t,e),i)}var Fe="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,o,n,r){var a=n-i,s=r-o;if(0!==a||0!==s){var l=((t-i)*a+(e-o)*s)/(a*a+s*s);l>1?(i=n,o=r):l>0&&(i+=a*l,o+=s*l)}return De(t,e,i,o)}function De(t,e,i,o){var n=i-t,r=o-e;return n*n+r*r}function Le(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 o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}(),qe=function(t){function e(e){var i=t.call(this)||this;i.on,i.once,i.un;var o=bt({},e);return"object"==typeof e.properties&&(delete o.properties,bt(o,e.properties)),o[xe]=void 0!==e.opacity?e.opacity:1,Re("number"==typeof o[xe],64),o[ke]=void 0===e.visible||e.visible,o[Se]=e.zIndex,o[Ce]=void 0!==e.maxResolution?e.maxResolution:1/0,o[ze]=void 0!==e.minResolution?e.minResolution:0,o[Ee]=void 0!==e.minZoom?e.minZoom:-1/0,o[Te]=void 0!==e.maxZoom?e.maxZoom:1/0,i.className_=void 0!==o.className?e.className:"ol-layer",delete o.className,i.setProperties(o),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=Ie(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 Ut()},e.prototype.getLayerStatesArray=function(t){return Ut()},e.prototype.getExtent=function(){return this.get(we)},e.prototype.getMaxResolution=function(){return this.get(Ce)},e.prototype.getMinResolution=function(){return this.get(ze)},e.prototype.getMinZoom=function(){return this.get(Ee)},e.prototype.getMaxZoom=function(){return this.get(Te)},e.prototype.getOpacity=function(){return this.get(xe)},e.prototype.getSourceState=function(){return Ut()},e.prototype.getVisible=function(){return this.get(ke)},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(ze,t)},e.prototype.setMaxZoom=function(t){this.set(Te,t)},e.prototype.setMinZoom=function(t){this.set(Ee,t)},e.prototype.setOpacity=function(t){Re("number"==typeof t,64),this.set(xe,t)},e.prototype.setVisible=function(t){this.set(ke,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}(Ht),We="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 o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}();function $e(t,e){if(!t.visible)return!1;var i=e.resolution;if(i<t.minResolution||i>=t.maxResolution)return!1;var o=e.zoom;return o>t.minZoom&&o<=t.maxZoom}var Je=function(t){function e(e){var i=this,o=bt({},e);delete o.source,(i=t.call(this,o)||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 n=e.source?e.source:null;return i.setSource(n),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(Pe)||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_&&(Bt(this.sourceChangeKey_),this.sourceChangeKey_=null);var t=this.getSource();t&&(this.sourceChangeKey_=Gt(t,Tt,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_&&(Bt(this.mapPrecomposeKey_),this.mapPrecomposeKey_=null),t||this.changed(),this.mapRenderKey_&&(Bt(this.mapRenderKey_),this.mapRenderKey_=null),t&&(this.mapPrecomposeKey_=Gt(t,Ue,(function(t){var e=t.frameState.layerStatesArray,i=this.getLayerState(!1);Re(!e.some((function(t){return t.layer===i.layer})),67),e.push(i)}),this),this.mapRenderKey_=Gt(this,Tt,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.renderer_&&(this.renderer_.dispose(),delete this.renderer_),this.setSource(null),t.prototype.disposeInternal.call(this)},e}(qe),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 o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}(),ti=function(t){function e(e){var i=this,o=e||{};(i=t.call(this,{element:document.createElement("div"),render:o.render,target:o.target})||this).ulElement_=document.createElement("ul"),i.collapsed_=void 0===o.collapsed||o.collapsed,i.userCollapsed_=i.collapsed_,i.overrideCollapsible_=void 0!==o.collapsible,i.collapsible_=void 0===o.collapsible||o.collapsible,i.collapsible_||(i.collapsed_=!1);var n=void 0!==o.className?o.className:"ol-attribution",r=void 0!==o.tipLabel?o.tipLabel:"Attributions",a=void 0!==o.expandClassName?o.expandClassName:n+"-expand",s=void 0!==o.collapseLabel?o.collapseLabel:"›",l=void 0!==o.collapseClassName?o.collapseClassName:n+"-collpase";"string"==typeof s?(i.collapseLabel_=document.createElement("span"),i.collapseLabel_.textContent=s,i.collapseLabel_.className=l):i.collapseLabel_=s;var u=void 0!==o.label?o.label:"i";"string"==typeof u?(i.label_=document.createElement("span"),i.label_.textContent=u,i.label_.className=a):i.label_=u;var p=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=r,i.toggleButton_.appendChild(p),i.toggleButton_.addEventListener(jt,i.handleClick_.bind(i),!1);var d=n+" "+"ol-unselectable "+ge+(i.collapsed_&&i.collapsible_?" ol-collapsed":"")+(i.collapsible_?"":" ol-uncollapsible"),h=i.element;return h.className=d,h.appendChild(i.toggleButton_),h.appendChild(i.ulElement_),i.renderedAttributions_=[],i.renderedVisible_=!0,i}return Qe(e,t),e.prototype.collectSourceAttributions_=function(t){for(var e={},i=[],o=!0,n=t.layerStatesArray,r=0,a=n.length;r<a;++r){var s=n[r];if($e(s,t.viewState)){var l=s.layer.getSource();if(l){var u=l.getAttributions();if(u){var p=u(t);if(p)if(o=o&&!1!==l.getAttributionsCollapsible(),Array.isArray(p))for(var d=0,h=p.length;d<h;++d)p[d]in e||(i.push(p[d]),e[p[d]]=!0);else p in e||(i.push(p),e[p]=!0)}}}}return this.overrideCollapsible_||this.setCollapsible(o),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),!mt(e,this.renderedAttributions_)){!function(t){for(;t.lastChild;)t.removeChild(t.lastChild)}(this.ulElement_);for(var o=0,n=e.length;o<n;++o){var r=document.createElement("li");r.innerHTML=e[o],this.ulElement_.appendChild(r)}this.renderedAttributions_=e}}else this.renderedVisible_&&(this.element.style.display="none",this.renderedVisible_=!1)},e.prototype.handleClick_=function(t){t.preventDefault(),this.handleToggle_(),this.userCollapsed_=this.collapsed_},e.prototype.handleToggle_=function(){this.element.classList.toggle(me),this.collapsed_?ue(this.collapseLabel_,this.label_):ue(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}(he),ei="add",ii="remove",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 o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}(),ni="length",ri=function(t){function e(e,i,o){var n=t.call(this,e)||this;return n.element=i,n.index=o,n}return oi(e,t),e}(ut),ai=function(t){function e(e,i){var o=t.call(this)||this;o.on,o.once,o.un;var n=i||{};if(o.unique_=!!n.unique,o.array_=e||[],o.unique_)for(var r=0,a=o.array_.length;r<a;++r)o.assertUnique_(o.array_[r],r);return o.updateLength_(),o}return oi(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,o=e.length;i<o;++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(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,o=e.length;i<o;++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(ii,e,t)),e},e.prototype.setAt=function(t,e){var i=this.getLength();if(t<i){this.unique_&&this.assertUnique_(e,t);var o=this.array_[t];this.array_[t]=e,this.dispatchEvent(new ri(ii,o,t)),this.dispatchEvent(new ri(ei,e,t))}else{for(var n=i;n<t;++n)this.insertAt(n,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,o=this.array_.length;i<o;++i)if(this.array_[i]===t&&i!==e)throw new je(58)},e}(Ht);function si(t){return Math.pow(t,3)}function li(t){return 1-si(1-t)}function ui(t){return 3*t*t-2*t*t*t}function pi(t){return t}var 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 o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}(),hi=function(t){function e(e){var i=this,o=e||{};i=t.call(this,{element:document.createElement("div"),render:o.render,target:o.target})||this;var n=void 0!==o.className?o.className:"ol-rotate",r=void 0!==o.label?o.label:"⇧",a=void 0!==o.compassClassName?o.compassClassName:"ol-compass";i.label_=null,"string"==typeof r?(i.label_=document.createElement("span"),i.label_.className=a,i.label_.textContent=r):(i.label_=r,i.label_.classList.add(a));var s=o.tipLabel?o.tipLabel:"Reset rotation",l=document.createElement("button");l.className=n+"-reset",l.setAttribute("type","button"),l.title=s,l.appendChild(i.label_),l.addEventListener(jt,i.handleClick_.bind(i),!1);var u=n+" "+"ol-unselectable "+ge,p=i.element;return p.className=u,p.appendChild(l),i.callResetNorth_=o.resetNorth?o.resetNorth:void 0,i.duration_=void 0!==o.duration?o.duration:250,i.autoHide_=void 0===o.autoHide||o.autoHide,i.rotation_=void 0,i.autoHide_&&i.element.classList.add(ce),i}return di(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 o="rotate("+i+"rad)";if(this.autoHide_){var n=this.element.classList.contains(ce);n||0!==i?n&&0!==i&&this.element.classList.remove(ce):this.element.classList.add(ce)}this.label_.style.transform=o}this.rotation_=i}},e}(he),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 o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}(),fi=function(t){function e(e){var i=this,o=e||{};i=t.call(this,{element:document.createElement("div"),target:o.target})||this;var n=void 0!==o.className?o.className:"ol-zoom",r=void 0!==o.delta?o.delta:1,a=void 0!==o.zoomInClassName?o.zoomInClassName:n+"-in",s=void 0!==o.zoomOutClassName?o.zoomOutClassName:n+"-out",l=void 0!==o.zoomInLabel?o.zoomInLabel:"+",u=void 0!==o.zoomOutLabel?o.zoomOutLabel:"–",p=void 0!==o.zoomInTipLabel?o.zoomInTipLabel:"Zoom in",d=void 0!==o.zoomOutTipLabel?o.zoomOutTipLabel:"Zoom out",h=document.createElement("button");h.className=a,h.setAttribute("type","button"),h.title=p,h.appendChild("string"==typeof l?document.createTextNode(l):l),h.addEventListener(jt,i.handleClick_.bind(i,r),!1);var c=document.createElement("button");c.className=s,c.setAttribute("type","button"),c.title=d,c.appendChild("string"==typeof u?document.createTextNode(u):u),c.addEventListener(jt,i.handleClick_.bind(i,-r),!1);var f=n+" "+"ol-unselectable "+ge,g=i.element;return g.className=f,g.appendChild(h),g.appendChild(c),i.duration_=void 0!==o.duration?o.duration:250,i}return ci(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 o=e.getConstrainedZoom(i+t);this.duration_>0?(e.getAnimating()&&e.cancelAnimations(),e.animate({zoom:o,duration:this.duration_,easing:li})):e.setZoom(o)}}},e}(he),gi="pointermove",mi="pointerdown",vi={RADIANS:"radians",DEGREES:"degrees",FEET:"ft",METERS:"m",PIXELS:"pixels",TILE_PIXELS:"tile-pixels",USFEET:"us-ft"},yi={};yi[vi.RADIANS]=6370997/(2*Math.PI),yi[vi.DEGREES]=2*Math.PI*6370997/360,yi[vi.FEET]=.3048,yi[vi.METERS]=1,yi[vi.USFEET]=1200/3937;var _i=vi,bi=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_||yi[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 o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}(),ki=6378137,wi=Math.PI*ki,Si=[-wi,-wi,wi,wi],Ci=[-180,-85,180,85],zi=ki*Math.log(Math.tan(Math.PI/2)),Ti=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/Fe(e[1]/ki)}})||this}return xi(e,t),e}(bi),Ei=[new Ti("EPSG:3857"),new Ti("EPSG:102100"),new Ti("EPSG:102113"),new Ti("EPSG:900913"),new Ti("http://www.opengis.net/def/crs/EPSG/0/3857"),new Ti("http://www.opengis.net/gml/srs/epsg.xml#3857")];function Pi(t,e,i){var o=t.length,n=i>1?i:2,r=e;void 0===r&&(r=n>2?t.slice():new Array(o));for(var a=0;a<o;a+=n){r[a]=wi*t[a]/180;var s=ki*Math.log(Math.tan(Math.PI*(+t[a+1]+90)/360));s>zi?s=zi:s<-zi&&(s=-zi),r[a+1]=s}return r}function Oi(t,e,i){var o=t.length,n=i>1?i:2,r=e;void 0===r&&(r=n>2?t.slice():new Array(o));for(var a=0;a<o;a+=n)r[a]=180*t[a]/wi,r[a+1]=360*Math.atan(Math.exp(t[a+1]/ki))/Math.PI-90;return r}var ji=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 o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}(),Ri=[-180,-90,180,90],Ii=6378137*Math.PI/180,Fi=function(t){function e(e,i){return t.call(this,{code:e,units:_i.DEGREES,extent:Ri,axisOrientation:i,global:!0,metersPerUnit:Ii,worldExtent:Ri})||this}return ji(e,t),e}(bi),Mi=[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/def/crs/OGC/1.3/CRS84","neu"),new Fi("http://www.opengis.net/gml/srs/epsg.xml#4326","neu"),new Fi("http://www.opengis.net/def/crs/EPSG/0/4326","neu")],Ai={};var Di={};function Li(t,e,i){var o=t.getCode(),n=e.getCode();o in Di||(Di[o]={}),Di[o][n]=i}var Gi="bottom-left",Ni="bottom-right",Bi="top-left",qi="top-right",Wi=0,Vi=1,Ui=2,Xi=4,Ki=8,Yi=16;function Zi(t){for(var e=oo(),i=0,o=t.length;i<o;++i)po(e,t[i]);return e}function Hi(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 $i(t,e){return e?(e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e):t.slice()}function Ji(t,e,i){var o,n;return(o=e<t[0]?t[0]-e:t[2]<e?e-t[2]:0)*o+(n=i<t[1]?t[1]-i:t[3]<i?i-t[3]:0)*n}function Qi(t,e){return eo(t,e[0],e[1])}function to(t,e){return t[0]<=e[0]&&e[2]<=t[2]&&t[1]<=e[1]&&e[3]<=t[3]}function eo(t,e,i){return t[0]<=e&&e<=t[2]&&t[1]<=i&&i<=t[3]}function io(t,e){var i=t[0],o=t[1],n=t[2],r=t[3],a=e[0],s=e[1],l=Wi;return a<i?l|=Yi:a>n&&(l|=Xi),s<o?l|=Ki:s>r&&(l|=Ui),l===Wi&&(l=Vi),l}function oo(){return[1/0,1/0,-1/0,-1/0]}function no(t,e,i,o,n){return n?(n[0]=t,n[1]=e,n[2]=i,n[3]=o,n):[t,e,i,o]}function ro(t){return no(1/0,1/0,-1/0,-1/0,t)}function ao(t,e){var i=t[0],o=t[1];return no(i,o,i,o,e)}function so(t,e,i,o,n){return ho(ro(n),t,e,i,o)}function lo(t,e){return t[0]==e[0]&&t[2]==e[2]&&t[1]==e[1]&&t[3]==e[3]}function uo(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 po(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 ho(t,e,i,o,n){for(;i<o;i+=n)co(t,e[i],e[i+1]);return t}function co(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 fo(t,e){var i;return(i=e(mo(t)))||(i=e(vo(t)))||(i=e(So(t)))?i:(i=e(wo(t)))||!1}function go(t){var e=0;return To(t)||(e=Co(t)*xo(t)),e}function mo(t){return[t[0],t[1]]}function vo(t){return[t[2],t[1]]}function yo(t){return[(t[0]+t[2])/2,(t[1]+t[3])/2]}function _o(t,e){var i;return e===Gi?i=mo(t):e===Ni?i=vo(t):e===Bi?i=wo(t):e===qi?i=So(t):Re(!1,13),i}function bo(t,e,i,o,n){var r=e*o[0]/2,a=e*o[1]/2,s=Math.cos(i),l=Math.sin(i),u=r*s,p=r*l,d=a*s,h=a*l,c=t[0],f=t[1],g=c-u+h,m=c-u-h,v=c+u-h,y=c+u+h,_=f-p-d,b=f-p+d,x=f+p+d,k=f+p-d;return no(Math.min(g,m,v,y),Math.min(_,b,x,k),Math.max(g,m,v,y),Math.max(_,b,x,k),n)}function xo(t){return t[3]-t[1]}function ko(t,e,i){var o=i||[1/0,1/0,-1/0,-1/0];return zo(t,e)?(t[0]>e[0]?o[0]=t[0]:o[0]=e[0],t[1]>e[1]?o[1]=t[1]:o[1]=e[1],t[2]<e[2]?o[2]=t[2]:o[2]=e[2],t[3]<e[3]?o[3]=t[3]:o[3]=e[3]):ro(o),o}function wo(t){return[t[0],t[3]]}function So(t){return[t[2],t[3]]}function Co(t){return t[2]-t[0]}function zo(t,e){return t[0]<=e[2]&&t[2]>=e[0]&&t[1]<=e[3]&&t[3]>=e[1]}function To(t){return t[2]<t[0]||t[3]<t[1]}function Eo(t,e,i,o){var n=[];if(o>1)for(var r=t[2]-t[0],a=t[3]-t[1],s=0;s<o;++s)n.push(t[0]+r*s/o,t[1],t[2],t[1]+a*s/o,t[2]-r*s/o,t[3],t[0],t[3]-a*s/o);else n=[t[0],t[1],t[2],t[1],t[2],t[3],t[0],t[3]];e(n,n,2);for(var l=[],u=[],p=(s=0,n.length);s<p;s+=2)l.push(n[s]),u.push(n[s+1]);return function(t,e,i){return no(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 Po="Point",Oo="LineString",jo="LinearRing",Ro="Polygon",Io="MultiPoint",Fo="MultiLineString",Mo="MultiPolygon",Ao="GeometryCollection",Do="Circle",Lo=6371008.8;function Go(t,e,i){var o=i||Lo,n=Le(t[1]),r=Le(e[1]),a=(r-n)/2,s=Le(e[0]-t[0])/2,l=Math.sin(a)*Math.sin(a)+Math.sin(s)*Math.sin(s)*Math.cos(n)*Math.cos(r);return 2*o*Math.atan2(Math.sqrt(l),Math.sqrt(1-l))}function No(t,e){for(var i=0,o=t.length,n=t[o-1][0],r=t[o-1][1],a=0;a<o;a++){var s=t[a][0],l=t[a][1];i+=Le(s-n)*(2+Math.sin(Le(r))+Math.sin(Le(l))),n=s,r=l}return i*e*e/2}function Bo(t,e){var i=e||{},o=i.radius||Lo,n=i.projection||"EPSG:3857",r=t.getType();r!==Ao&&(t=t.clone().transform(n,"EPSG:4326"));var a,s,l,u,p,d,h=0;switch(r){case Po:case Io:case Oo:case Fo:case jo:break;case Ro:for(a=t.getCoordinates(),h=Math.abs(No(a[0],o)),l=1,u=a.length;l<u;++l)h-=Math.abs(No(a[l],o));break;case Mo:for(l=0,u=(a=t.getCoordinates()).length;l<u;++l)for(s=a[l],h+=Math.abs(No(s[0],o)),p=1,d=s.length;p<d;++p)h-=Math.abs(No(s[p],o));break;case Ao:var c=t.getGeometries();for(l=0,u=c.length;l<u;++l)h+=Bo(c[l],e);break;default:throw new Error("Unsupported geometry type: "+r)}return h}function qo(t,e){var i,o,n=t[0],r=t[1],a=e[0],s=e[1],l=a[0],u=a[1],p=s[0],d=s[1],h=p-l,c=d-u,f=0===h&&0===c?0:(h*(n-l)+c*(r-u))/(h*h+c*c||0);return f<=0?(i=l,o=u):f>=1?(i=p,o=d):(i=l+f*h,o=u+f*c),[i,o]}function Wo(t,e){for(var i=!0,o=t.length-1;o>=0;--o)if(t[o]!=e[o]){i=!1;break}return i}function Vo(t,e){var i=Math.cos(e),o=Math.sin(e),n=t[0]*i-t[1]*o,r=t[1]*i+t[0]*o;return t[0]=n,t[1]=r,t}function Uo(t,e){var i=t[0]-e[0],o=t[1]-e[1];return i*i+o*o}function Xo(t,e){return Math.sqrt(Uo(t,e))}function Ko(t,e){return Uo(t,qo(t,e))}function Yo(t,e){if(e.canWrapX()){var i=Co(e.getExtent()),o=function(t,e,i){var o=e.getExtent(),n=0;if(e.canWrapX()&&(t[0]<o[0]||t[0]>o[2])){var r=i||Co(o);n=Math.floor((t[0]-o[0])/r)}return n}(t,e,i);o&&(t[0]-=o*i)}return t}function Zo(t,e,i){var o;if(void 0!==e){for(var n=0,r=t.length;n<r;++n)e[n]=t[n];o=e}else o=t.slice();return o}function Ho(t,e,i){if(void 0!==e&&t!==e){for(var o=0,n=t.length;o<n;++o)e[o]=t[o];t=e}return t}function $o(t){!function(t,e){Ai[t]=e}(t.getCode(),t),Li(t,t,Zo)}function Jo(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 Qo(t,e,i,o){var n,r=(t=Jo(t)).getPointResolutionFunc();if(r){if(n=r(e,i),o&&o!==t.getUnits())(s=t.getMetersPerUnit())&&(n=n*s/yi[o])}else{var a=t.getUnits();if(a==_i.DEGREES&&!o||o==_i.DEGREES)n=e;else{var s,l=rn(t,Jo("EPSG:4326"));if(l===Ho&&a!==_i.DEGREES)n=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];n=(Go((u=l(u,u,2)).slice(0,2),u.slice(2,4))+Go(u.slice(4,6),u.slice(6,8)))/2}void 0!==(s=o?yi[o]:t.getMetersPerUnit())&&(n/=s)}}return n}function tn(t){!function(t){t.forEach($o)}(t),t.forEach((function(e){t.forEach((function(t){e!==t&&Li(e,t,Zo)}))}))}function en(t,e){return t?"string"==typeof t?Jo(t):t:Jo(e)}function on(t,e){return sn(t,"EPSG:4326",void 0!==e?e:"EPSG:3857")}function nn(t,e){if(t===e)return!0;var i=t.getUnits()===e.getUnits();return(t.getCode()===e.getCode()||rn(t,e)===Zo)&&i}function rn(t,e){var i=function(t,e){var i;return t in Di&&e in Di[t]&&(i=Di[t][e]),i}(t.getCode(),e.getCode());return i||(i=Ho),i}function an(t,e){return rn(Jo(t),Jo(e))}function sn(t,e,i){return an(e,i)(t,void 0,t.length)}var ln,un,pn;function dn(t,e){return t}function hn(t,e){return t}function cn(t,e){return t}function fn(t,e){return t}tn(Ei),tn(Mi),ln=Ei,un=Pi,pn=Oi,Mi.forEach((function(t){ln.forEach((function(e){Li(t,e,un),Li(e,t,pn)}))}));var gn,mn=new Array(6);function vn(t){return _n(t,1,0,0,1,0,0)}function yn(t,e){var i=t[0],o=t[1],n=t[2],r=t[3],a=t[4],s=t[5],l=e[0],u=e[1],p=e[2],d=e[3],h=e[4],c=e[5];return t[0]=i*l+n*u,t[1]=o*l+r*u,t[2]=i*p+n*d,t[3]=o*p+r*d,t[4]=i*h+n*c+a,t[5]=o*h+r*c+s,t}function _n(t,e,i,o,n,r,a){return t[0]=e,t[1]=i,t[2]=o,t[3]=n,t[4]=r,t[5]=a,t}function bn(t,e){var i=e[0],o=e[1];return e[0]=t[0]*i+t[2]*o+t[4],e[1]=t[1]*i+t[3]*o+t[5],e}function xn(t,e,i){return yn(t,_n(mn,e,0,0,i,0,0))}function kn(t,e,i,o,n,r,a,s){var l=Math.sin(r),u=Math.cos(r);return t[0]=o*u,t[1]=n*l,t[2]=-o*l,t[3]=n*u,t[4]=a*o*u-s*o*l+e,t[5]=a*n*l+s*n*u+i,t}function wn(t,e){var i,o=(i=e)[0]*i[3]-i[1]*i[2];Re(0!==o,32);var n=e[0],r=e[1],a=e[2],s=e[3],l=e[4],u=e[5];return t[0]=s/o,t[1]=-r/o,t[2]=-a/o,t[3]=n/o,t[4]=(a*u-s*l)/o,t[5]=-(n*u-r*l)/o,t}function Sn(t){var e="matrix("+t.join(", ")+")";if(re)return e;var i=gn||(gn=document.createElement("div"));return i.style.transform=e,i.style.transform}var Cn=/^#([a-f0-9]{3}|[a-f0-9]{4}(?:[a-f0-9]{2}){0,2})$/i,zn=/^([a-z]*)$|^hsla?\(.*\)$/i;function Tn(t){return"string"==typeof t?t:In(t)}var En,Pn,On=(En={},Pn=0,function(t){var e;if(En.hasOwnProperty(t))e=En[t];else{if(Pn>=1024){var i=0;for(var o in En)0==(3&i++)&&(delete En[o],--Pn)}e=function(t){var e,i,o,n,r;if(zn.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)),Cn.exec(t)){var a=t.length-1,s=void 0;s=a<=4?1:2;var l=4===a||8===a;e=parseInt(t.substr(1+0*s,s),16),i=parseInt(t.substr(1+1*s,s),16),o=parseInt(t.substr(1+2*s,s),16),n=l?parseInt(t.substr(1+3*s,s),16):255,1==s&&(e=(e<<4)+e,i=(i<<4)+i,o=(o<<4)+o,l&&(n=(n<<4)+n)),r=[e,i,o,n/255]}else 0==t.indexOf("rgba(")?Rn(r=t.slice(5,-1).split(",").map(Number)):0==t.indexOf("rgb(")?((r=t.slice(4,-1).split(",").map(Number)).push(1),Rn(r)):Re(!1,14);return r}(t),En[t]=e,++Pn}return e});function jn(t){return Array.isArray(t)?t:On(t)}function Rn(t){return t[0]=Ie(t[0]+.5|0,0,255),t[1]=Ie(t[1]+.5|0,0,255),t[2]=Ie(t[2]+.5|0,0,255),t[3]=Ie(t[3],0,1),t}function In(t){var e=t[0];e!=(0|e)&&(e=e+.5|0);var i=t[1];i!=(0|i)&&(i=i+.5|0);var o=t[2];return o!=(0|o)&&(o=o+.5|0),"rgba("+e+","+i+","+o+","+(void 0===t[3]?1:t[3])+")"}function Fn(t,e,i){return e+":"+t+":"+(i?Tn(i):"null")}var Mn=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 o=Fn(t,e,i);return o in this.cache_?this.cache_[o]:null},t.prototype.set=function(t,e,i,o){var n=Fn(t,e,i);this.cache_[n]=o,++this.cacheSize_},t.prototype.setSize=function(t){this.maxCacheSize_=t,this.expire()},t}()),An=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 o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}();function Dn(t,e){Mn.expire()}var Ln=function(t){function e(e){var i=t.call(this)||this;return i.map_=e,i}return An(e,t),e.prototype.dispatchRenderEvent=function(t,e){Ut()},e.prototype.calculateMatrices2D=function(t){var e=t.viewState,i=t.coordinateToPixelTransform,o=t.pixelToCoordinateTransform;kn(i,t.size[0]/2,t.size[1]/2,1/e.resolution,-1/e.resolution,-e.rotation,-e.center[0],-e.center[1]),wn(o,i)},e.prototype.forEachFeatureAtCoordinate=function(t,e,i,o,n,r,a,s){var l,u=e.viewState;function p(t,e,i,o){return n.call(r,e,t?i:null,o)}var d=u.projection,h=Yo(t.slice(),d),c=[[0,0]];if(d.canWrapX()&&o){var f=Co(d.getExtent());c.push([-f,0],[f,0])}for(var g=e.layerStatesArray,m=g.length,v=[],y=[],_=0;_<c.length;_++)for(var b=m-1;b>=0;--b){var x=g[b],k=x.layer;if(k.hasRenderer()&&$e(x,u)&&a.call(s,k)){var w=k.getRenderer(),S=k.getSource();if(w&&S){var C=S.getWrapX()?h:t,z=p.bind(null,x.managed);y[0]=C[0]+c[_][0],y[1]=C[1]+c[_][1],l=w.forEachFeatureAtCoordinate(y,e,i,z,v)}if(l)return l}}if(0!==v.length){var T=1/v.length;return v.forEach((function(t,e){return t.distanceSq+=e*T})),v.sort((function(t,e){return t.distanceSq-e.distanceSq})),v.some((function(t){return l=t.callback(t.feature,t.layer,t.geometry)})),l}},e.prototype.forEachLayerAtPixel=function(t,e,i,o,n){return Ut()},e.prototype.hasFeatureAtCoordinate=function(t,e,i,o,n,r){return void 0!==this.forEachFeatureAtCoordinate(t,e,i,o,vt,this,n,r)},e.prototype.getMap=function(){return this.map_},e.prototype.renderFrame=function(t){Ut()},e.prototype.scheduleExpireIconCache=function(t){Mn.canExpireCache()&&t.postRenderFunctions.push(Dn)},e}(dt),Gn=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 o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}(),Nn=function(t){function e(e,i,o,n){var r=t.call(this,e)||this;return r.inversePixelTransform=i,r.frameState=o,r.context=n,r}return Gn(e,t),e}(ut),Bn="10px sans-serif",qn="#000",Wn="round",Vn=[],Un="round",Xn="#000",Kn="center",Yn="middle",Zn=[0,0,0,0],Hn=new Ht,$n=new zt;$n.setSize=function(){console.warn("labelCache is deprecated.")};var Jn,Qn,tr=null,er={},ir=function(){var t,e,i="32px ",o=["monospace","serif"],n=o.length,r="wmytzilWMYTZIL@#/&?$%10";function a(t,a,s){for(var l=!0,u=0;u<n;++u){var p=o[u];if(e=rr(t+" "+a+" "+i+p,r),s!=p){var d=rr(t+" "+a+" "+i+s+","+p,r);l=l&&d!=e}}return!!l}function s(){for(var e=!0,i=Hn.getKeys(),o=0,n=i.length;o<n;++o){var r=i[o];Hn.get(r)<100&&(a.apply(this,r.split("\n"))?(xt(er),tr=null,Jn=void 0,Hn.set(r,100)):(Hn.set(r,Hn.get(r)+1,!0),e=!1))}e&&(clearInterval(t),t=void 0)}return function(e){var i=_e(e);if(i)for(var o=i.families,n=0,r=o.length;n<r;++n){var l=o[n],u=i.style+"\n"+i.weight+"\n"+l;void 0===Hn.get(u)&&(Hn.set(u,100,!0),a(i.style,i.weight,l)||(Hn.set(u,0,!0),void 0===t&&(t=setInterval(s,32))))}}}(),or=function(t){var e=er[t];if(null==e){if(re){var i=_e(t),o=nr(t,"Žg");e=(isNaN(Number(i.lineHeight))?1.2:Number(i.lineHeight))*(o.actualBoundingBoxAscent+o.actualBoundingBoxDescent)}else Qn||((Qn=document.createElement("div")).innerHTML="M",Qn.style.minHeight="0",Qn.style.maxHeight="none",Qn.style.height="auto",Qn.style.padding="0",Qn.style.border="none",Qn.style.position="absolute",Qn.style.display="block",Qn.style.left="-99999px"),Qn.style.font=t,document.body.appendChild(Qn),e=Qn.offsetHeight,document.body.removeChild(Qn);er[t]=e}return e};function nr(t,e){return tr||(tr=le(1,1)),t!=Jn&&(tr.font=t,Jn=tr.font),tr.measureText(e)}function rr(t,e){return nr(t,e).width}function ar(t,e,i){if(e in i)return i[e];var o=rr(t,e);return i[e]=o,o}function sr(t,e,i,o,n,r,a,s,l,u,p){t.save(),1!==i&&(t.globalAlpha*=i),e&&t.setTransform.apply(t,e),o.contextInstructions?(t.translate(l,u),t.scale(p[0],p[1]),function(t,e){for(var i=t.contextInstructions,o=0,n=i.length;o<n;o+=2)Array.isArray(i[o+1])?e[i[o]].apply(e,i[o+1]):e[i[o]]=i[o+1]}(o,t)):p[0]<0||p[1]<0?(t.translate(l,u),t.scale(p[0],p[1]),t.drawImage(o,n,r,a,s,0,0,a,s)):t.drawImage(o,n,r,a,s,l,u,a*p[0],s*p[1]),t.restore()}var 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 o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}(),ur=function(t){function e(e){var i=t.call(this,e)||this;i.fontChangeListenerKey_=Gt(Hn,pt,e.redrawText.bind(e)),i.element_=document.createElement("div");var o=i.element_.style;o.position="absolute",o.width="100%",o.height="100%",o.zIndex="0",i.element_.className="ol-unselectable ol-layers";var n=e.getViewport();return n.insertBefore(i.element_,n.firstChild||null),i.children_=[],i.renderedVisible_=!0,i}return lr(e,t),e.prototype.dispatchRenderEvent=function(t,e){var i=this.getMap();if(i.hasListener(t)){var o=new Nn(t,void 0,e);i.dispatchEvent(o)}},e.prototype.disposeInternal=function(){Bt(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 o=[],n=null,r=0,a=e.length;r<a;++r){var s=e[r];if(t.layerIndex=r,$e(s,i)&&(s.sourceState==Ze||s.sourceState==Ye)){var l=s.layer,u=l.render(t,n);u&&(u!==n&&(this.children_.push(u),n=u),"getDeclutter"in l&&o.push(l))}}for(r=o.length-1;r>=0;--r)o[r].renderDeclutter(t);!function(t,e){for(var i=t.childNodes,o=0;;++o){var n=i[o],r=e[o];if(!n&&!r)break;n!==r&&(n?r?t.insertBefore(r,n):(t.removeChild(n),--o):t.appendChild(r))}}(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,o,n){for(var r=e.viewState,a=e.layerStatesArray,s=a.length-1;s>=0;--s){var l=a[s],u=l.layer;if(u.hasRenderer()&&$e(l,r)&&n(u)){var p=u.getRenderer().getDataAtPixel(t,e,i);if(p){var d=o(u,p);if(d)return d}}}},e}(Ln),pr="layergroup",dr="size",hr="target",cr="view",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 o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}(),gr="layers",mr=function(t){function e(e){var i=this,o=e||{},n=bt({},o);delete n.layers;var r=o.layers;return(i=t.call(this,n)||this).on,i.once,i.un,i.layersListenerKeys_=[],i.listenerKeys_={},i.addChangeListener(gr,i.handleLayersChanged_),r?Array.isArray(r)?r=new ai(r.slice(),{unique:!0}):Re("function"==typeof r.getArray,43):r=new ai(void 0,{unique:!0}),i.setLayers(r),i}return fr(e,t),e.prototype.handleLayerChange_=function(){this.changed()},e.prototype.handleLayersChanged_=function(){this.layersListenerKeys_.forEach(Bt),this.layersListenerKeys_.length=0;var t=this.getLayers();for(var e in this.layersListenerKeys_.push(Gt(t,ei,this.handleLayersAdd_,this),Gt(t,ii,this.handleLayersRemove_,this)),this.listenerKeys_)this.listenerKeys_[e].forEach(Bt);xt(this.listenerKeys_);for(var i=t.getArray(),o=0,n=i.length;o<n;o++){var r=i[o];this.listenerKeys_[Kt(r)]=[Gt(r,pt,this.handleLayerChange_,this),Gt(r,Tt,this.handleLayerChange_,this)]}this.changed()},e.prototype.handleLayersAdd_=function(t){var e=t.element;this.listenerKeys_[Kt(e)]=[Gt(e,pt,this.handleLayerChange_,this),Gt(e,Tt,this.handleLayerChange_,this)],this.changed()},e.prototype.handleLayersRemove_=function(t){var e=Kt(t.element);this.listenerKeys_[e].forEach(Bt),delete this.listenerKeys_[e],this.changed()},e.prototype.getLayers=function(){return this.get(gr)},e.prototype.setLayers=function(t){this.set(gr,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 o=this.getLayerState(),n=o.zIndex;t||void 0!==o.zIndex||(n=0);for(var r=i,a=e.length;r<a;r++){var s=e[r];s.opacity*=o.opacity,s.visible=s.visible&&o.visible,s.maxResolution=Math.min(s.maxResolution,o.maxResolution),s.minResolution=Math.max(s.minResolution,o.minResolution),s.minZoom=Math.max(s.minZoom,o.minZoom),s.maxZoom=Math.min(s.maxZoom,o.maxZoom),void 0!==o.extent&&(void 0!==s.extent?s.extent=ko(s.extent,o.extent):s.extent=o.extent),void 0===s.zIndex&&(s.zIndex=n)}return e},e.prototype.getSourceState=function(){return Ze},e}(qe),vr=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 o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}(),yr=function(t){function e(e,i,o){var n=t.call(this,e)||this;return n.map=i,n.frameState=void 0!==o?o:null,n}return vr(e,t),e}(ut),_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 o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}(),br=function(t){function e(e,i,o,n,r){var a=t.call(this,e,i,r)||this;return a.originalEvent=o,a.pixel_=null,a.coordinate_=null,a.dragging=void 0!==n&&n,a}return _r(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}(yr),xr={SINGLECLICK:"singleclick",CLICK:jt,DBLCLICK:Rt,POINTERDRAG:"pointerdrag",POINTERMOVE:"pointermove",POINTERDOWN:"pointerdown",POINTERUP:"pointerup",POINTEROVER:"pointerover",POINTEROUT:"pointerout",POINTERENTER:"pointerenter",POINTERLEAVE:"pointerleave",POINTERCANCEL:"pointercancel"},kr=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 o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}(),wr=function(t){function e(e,i){var o=t.call(this,e)||this;o.map_=e,o.clickTimeoutId_,o.emulateClicks_=!1,o.dragging_=!1,o.dragListenerKeys_=[],o.moveTolerance_=void 0===i?1:i,o.down_=null;var n=o.map_.getViewport();return o.activePointers_=0,o.trackedTouches_={},o.element_=n,o.pointerdownListenerKey_=Gt(n,mi,o.handlePointerDown_,o),o.originalPointerMoveEvent_,o.relayedListenerKey_=Gt(n,gi,o.relayEvent_,o),o.boundHandleTouchMove_=o.handleTouchMove_.bind(o),o.element_.addEventListener(Dt,o.boundHandleTouchMove_,!!se&&{passive:!1}),o}return kr(e,t),e.prototype.emulateClick_=function(t){var e=new br(xr.CLICK,this.map_,t);this.dispatchEvent(e),void 0!==this.clickTimeoutId_?(clearTimeout(this.clickTimeoutId_),this.clickTimeoutId_=void 0,e=new br(xr.DBLCLICK,this.map_,t),this.dispatchEvent(e)):this.clickTimeoutId_=setTimeout(function(){this.clickTimeoutId_=void 0;var e=new br(xr.SINGLECLICK,this.map_,t);this.dispatchEvent(e)}.bind(this),250)},e.prototype.updateActivePointers_=function(t){var e=t;e.type==xr.POINTERUP||e.type==xr.POINTERCANCEL?delete this.trackedTouches_[e.pointerId]:e.type==xr.POINTERDOWN&&(this.trackedTouches_[e.pointerId]=!0),this.activePointers_=Object.keys(this.trackedTouches_).length},e.prototype.handlePointerUp_=function(t){this.updateActivePointers_(t);var e=new br(xr.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(Bt),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 br(xr.POINTERDOWN,this.map_,t);for(var i in this.dispatchEvent(e),this.down_={},t){var o=t[i];this.down_[i]="function"==typeof o?_t:o}if(0===this.dragListenerKeys_.length){var n=this.map_.getOwnerDocument();this.dragListenerKeys_.push(Gt(n,xr.POINTERMOVE,this.handlePointerMove_,this),Gt(n,xr.POINTERUP,this.handlePointerUp_,this),Gt(this.element_,xr.POINTERCANCEL,this.handlePointerUp_,this)),this.element_.getRootNode&&this.element_.getRootNode()!==n&&this.dragListenerKeys_.push(Gt(this.element_.getRootNode(),xr.POINTERUP,this.handlePointerUp_,this))}},e.prototype.handlePointerMove_=function(t){if(this.isMoving_(t)){this.dragging_=!0;var e=new br(xr.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 br(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_&&(Bt(this.relayedListenerKey_),this.relayedListenerKey_=null),this.element_.removeEventListener(Dt,this.boundHandleTouchMove_),this.pointerdownListenerKey_&&(Bt(this.pointerdownListenerKey_),this.pointerdownListenerKey_=null),this.dragListenerKeys_.forEach(Bt),this.dragListenerKeys_.length=0,this.element_=null,t.prototype.disposeInternal.call(this)},e}(zt),Sr=1/0,Cr=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,xt(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 o=this.keyFunction_(i);return delete this.queuedElements_[o],i},t.prototype.enqueue=function(t){Re(!(this.keyFunction_(t)in this.queuedElements_),31);var e=this.priorityFunction_(t);return e!=Sr&&(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_,o=e.length,n=e[t],r=i[t],a=t;t<o>>1;){var s=this.getLeftChildIndex_(t),l=this.getRightChildIndex_(t),u=l<o&&i[l]<i[s]?l:s;e[t]=e[u],i[t]=i[u],t=u}e[t]=n,i[t]=r,this.siftDown_(a,t)},t.prototype.siftDown_=function(t,e){for(var i=this.elements_,o=this.priorities_,n=i[e],r=o[e];e>t;){var a=this.getParentIndex_(e);if(!(o[a]>r))break;i[e]=i[a],o[e]=o[a],e=a}i[e]=n,o[e]=r},t.prototype.reprioritize=function(){var t,e,i,o=this.priorityFunction_,n=this.elements_,r=this.priorities_,a=0,s=n.length;for(e=0;e<s;++e)(i=o(t=n[e]))==Sr?delete this.queuedElements_[this.keyFunction_(t)]:(r[a]=i,n[a++]=t);n.length=a,r.length=a,this.heapify_()},t}(),zr=0,Tr=1,Er=2,Pr=3,Or=4,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 o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}(),Rr=function(t){function e(e,i){var o=t.call(this,(function(t){return e.apply(null,t)}),(function(t){return t[0].getKey()}))||this;return o.boundHandleTileChange_=o.handleTileChange.bind(o),o.tileChangeCallback_=i,o.tilesLoading_=0,o.tilesLoadingKeys_={},o}return jr(e,t),e.prototype.enqueue=function(e){var i=t.prototype.enqueue.call(this,e);i&&e[0].addEventListener(Tt,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===Er||i===Pr||i===Or){e.removeEventListener(Tt,this.boundHandleTileChange_);var o=e.getKey();o in this.tilesLoadingKeys_&&(delete this.tilesLoadingKeys_[o],--this.tilesLoading_),this.tileChangeCallback_()}},e.prototype.loadMoreTiles=function(t,e){for(var i,o,n=0;this.tilesLoading_<t&&n<e&&this.getCount()>0;)o=(i=this.dequeue()[0]).getKey(),i.getState()!==zr||o in this.tilesLoadingKeys_||(this.tilesLoadingKeys_[o]=!0,++this.tilesLoading_,++n,i.load())},e}(Cr);var Ir=0,Fr=1,Mr="center",Ar="resolution",Dr="rotation",Lr=256;function Gr(t,e,i){return function(o,n,r,a,s){if(o){var l=e?0:r[0]*n,u=e?0:r[1]*n,p=s?s[0]:0,d=s?s[1]:0,h=t[0]+l/2+p,c=t[2]-l/2+p,f=t[1]+u/2+d,g=t[3]-u/2+d;h>c&&(c=h=(c+h)/2),f>g&&(g=f=(g+f)/2);var m=Ie(o[0],h,c),v=Ie(o[1],f,g),y=30*n;return a&&i&&(m+=-y*Math.log(1+Math.max(0,h-o[0])/y)+y*Math.log(1+Math.max(0,o[0]-c)/y),v+=-y*Math.log(1+Math.max(0,f-o[1])/y)+y*Math.log(1+Math.max(0,o[1]-g)/y)),[m,v]}}}function Nr(t){return t}function Br(t,e,i,o){var n=Co(e)/i[0],r=xo(e)/i[1];return o?Math.min(t,Math.max(n,r)):Math.min(t,Math.min(n,r))}function qr(t,e,i){var o=Math.min(t,e);return o*=Math.log(1+50*Math.max(0,t/e-1))/50+1,i&&(o=Math.max(o,i),o/=Math.log(1+50*Math.max(0,i/t-1))/50+1),Ie(o,i/2,2*e)}function Wr(t,e,i,o,n){return function(r,a,s,l){if(void 0!==r){var u=o?Br(t,o,s,n):t;return(void 0===i||i)&&l?qr(r,u,e):Ie(r,e,u)}}}function Vr(t){return void 0!==t?0:void 0}function Ur(t){return void 0!==t?t:void 0}var Xr="XY",Kr="XYZ",Yr="XYM",Zr="XYZM";function Hr(t,e,i,o,n,r){for(var a=r||[],s=0,l=e;l<i;l+=o){var u=t[l],p=t[l+1];a[s++]=n[0]*u+n[2]*p+n[4],a[s++]=n[1]*u+n[3]*p+n[5]}return r&&a.length!=s&&(a.length=s),a}function $r(t,e,i,o,n,r,a){for(var s=a||[],l=Math.cos(n),u=Math.sin(n),p=r[0],d=r[1],h=0,c=e;c<i;c+=o){var f=t[c]-p,g=t[c+1]-d;s[h++]=p+f*l-g*u,s[h++]=d+f*u+g*l;for(var m=c+2;m<c+o;++m)s[h++]=t[m]}return a&&s.length!=h&&(s.length=h),s}function Jr(t,e,i,o,n,r,a){for(var s=a||[],l=0,u=e;u<i;u+=o){s[l++]=t[u]+n,s[l++]=t[u+1]+r;for(var p=u+2;p<u+o;++p)s[l++]=t[p]}return a&&s.length!=l&&(s.length=l),s}var Qr=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 o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}(),ta=[1,0,0,1,0,0],ea=function(t){function e(){var e,i,o,n,r,a=t.call(this)||this;return a.extent_=[1/0,1/0,-1/0,-1/0],a.extentRevision_=-1,a.simplifiedGeometryMaxMinSquaredTolerance=0,a.simplifiedGeometryRevision=0,a.simplifyTransformedInternal=(e=function(t,e,i){if(!i)return this.getSimplifiedGeometry(e);var o=this.clone();return o.applyTransform(i),o.getSimplifiedGeometry(e)},r=!1,function(){var t=Array.prototype.slice.call(arguments);return r&&this===n&&mt(t,o)||(r=!0,n=this,o=t,i=e.apply(this,arguments)),i}),a}return Qr(e,t),e.prototype.simplifyTransformed=function(t,e){return this.simplifyTransformedInternal(this.getRevision(),t,e)},e.prototype.clone=function(){return Ut()},e.prototype.closestPointXY=function(t,e,i,o){return Ut()},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 Ut()},e.prototype.getExtent=function(t){if(this.extentRevision_!=this.getRevision()){var e=this.computeExtent(this.extent_);(isNaN(e[0])||isNaN(e[1]))&&ro(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){Ut()},e.prototype.scale=function(t,e,i){Ut()},e.prototype.simplify=function(t){return this.getSimplifiedGeometry(t*t)},e.prototype.getSimplifiedGeometry=function(t){return Ut()},e.prototype.getType=function(){return Ut()},e.prototype.applyTransform=function(t){Ut()},e.prototype.intersectsExtent=function(t){return Ut()},e.prototype.translate=function(t,e){Ut()},e.prototype.transform=function(t,e){var i=Jo(t),o=i.getUnits()==_i.TILE_PIXELS?function(t,o,n){var r=i.getExtent(),a=i.getWorldExtent(),s=xo(a)/xo(r);return kn(ta,a[0],a[3],s,-s,0,0,0),Hr(t,0,t.length,n,ta,o),an(i,e)(t,o,n)}:an(i,e);return this.applyTransform(o),this},e}(Ht),ia=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 o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}();function oa(t){var e;return t==Xr?e=2:t==Kr||t==Yr?e=3:t==Zr&&(e=4),e}var na=function(t){function e(){var e=t.call(this)||this;return e.layout=Xr,e.stride=2,e.flatCoordinates=null,e}return ia(e,t),e.prototype.computeExtent=function(t){return so(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,t)},e.prototype.getCoordinates=function(){return Ut()},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=oa(t),this.layout=t,this.flatCoordinates=e},e.prototype.setCoordinates=function(t,e){Ut()},e.prototype.setLayout=function(t,e,i){var o;if(t)o=oa(t);else{for(var n=0;n<i;++n){if(0===e.length)return this.layout=Xr,void(this.stride=2);e=e[0]}t=function(t){var e;2==t?e=Xr:3==t?e=Kr:4==t&&(e=Zr);return e}(o=e.length)}this.layout=t,this.stride=o},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 o=this.getStride();$r(i,0,i.length,o,t,e,i),this.changed()}},e.prototype.scale=function(t,e,i){var o=e;void 0===o&&(o=t);var n=i;n||(n=yo(this.getExtent()));var r=this.getFlatCoordinates();if(r){var a=this.getStride();!function(t,e,i,o,n,r,a,s){for(var l=s||[],u=a[0],p=a[1],d=0,h=e;h<i;h+=o){var c=t[h]-u,f=t[h+1]-p;l[d++]=u+n*c,l[d++]=p+r*f;for(var g=h+2;g<h+o;++g)l[d++]=t[g]}s&&l.length!=d&&(l.length=d)}(r,0,r.length,a,t,o,n,r),this.changed()}},e.prototype.translate=function(t,e){var i=this.getFlatCoordinates();if(i){var o=this.getStride();Jr(i,0,i.length,o,t,e,i),this.changed()}},e}(ea);function ra(t,e,i,o,n,r,a){var s,l=t[e],u=t[e+1],p=t[i]-l,d=t[i+1]-u;if(0===p&&0===d)s=e;else{var h=((n-l)*p+(r-u)*d)/(p*p+d*d);if(h>1)s=i;else{if(h>0){for(var c=0;c<o;++c)a[c]=Ne(t[e+c],t[i+c],h);return void(a.length=o)}s=e}}for(c=0;c<o;++c)a[c]=t[s+c];a.length=o}function aa(t,e,i,o,n){var r=t[e],a=t[e+1];for(e+=o;e<i;e+=o){var s=t[e],l=t[e+1],u=De(r,a,s,l);u>n&&(n=u),r=s,a=l}return n}function sa(t,e,i,o,n){for(var r=0,a=i.length;r<a;++r){var s=i[r];n=aa(t,e,s,o,n),e=s}return n}function la(t,e,i,o,n,r,a,s,l,u,p){if(e==i)return u;var d,h;if(0===n){if((h=De(a,s,t[e],t[e+1]))<u){for(d=0;d<o;++d)l[d]=t[e+d];return l.length=o,h}return u}for(var c=p||[NaN,NaN],f=e+o;f<i;)if(ra(t,f-o,f,o,a,s,c),(h=De(a,s,c[0],c[1]))<u){for(u=h,d=0;d<o;++d)l[d]=c[d];l.length=o,f+=o}else f+=o*Math.max((Math.sqrt(h)-Math.sqrt(u))/n|0,1);if(r&&(ra(t,i-o,e,o,a,s,c),(h=De(a,s,c[0],c[1]))<u)){for(u=h,d=0;d<o;++d)l[d]=c[d];l.length=o}return u}function ua(t,e,i,o,n,r,a,s,l,u,p){for(var d=p||[NaN,NaN],h=0,c=i.length;h<c;++h){var f=i[h];u=la(t,e,f,o,n,r,a,s,l,u,d),e=f}return u}function pa(t,e,i,o){for(var n=0,r=i.length;n<r;++n)t[e++]=i[n];return e}function da(t,e,i,o){for(var n=0,r=i.length;n<r;++n)for(var a=i[n],s=0;s<o;++s)t[e++]=a[s];return e}function ha(t,e,i,o,n){for(var r=n||[],a=0,s=0,l=i.length;s<l;++s){var u=da(t,e,i[s],o);r[a++]=u,e=u}return r.length=a,r}function ca(t,e,i,o,n,r,a){var s=(i-e)/o;if(s<3){for(;e<i;e+=o)r[a++]=t[e],r[a++]=t[e+1];return a}var l=new Array(s);l[0]=1,l[s-1]=1;for(var u=[e,i-o],p=0;u.length>0;){for(var d=u.pop(),h=u.pop(),c=0,f=t[h],g=t[h+1],m=t[d],v=t[d+1],y=h+o;y<d;y+=o){var _=Ae(t[y],t[y+1],f,g,m,v);_>c&&(p=y,c=_)}c>n&&(l[(p-e)/o]=1,h+o<p&&u.push(h,p),p+o<d&&u.push(p,d))}for(y=0;y<s;++y)l[y]&&(r[a++]=t[e+y*o],r[a++]=t[e+y*o+1]);return a}function fa(t,e){return e*Math.round(t/e)}function ga(t,e,i,o,n,r,a){if(e==i)return a;var s,l,u=fa(t[e],n),p=fa(t[e+1],n);e+=o,r[a++]=u,r[a++]=p;do{if(s=fa(t[e],n),l=fa(t[e+1],n),(e+=o)==i)return r[a++]=s,r[a++]=l,a}while(s==u&&l==p);for(;e<i;){var d=fa(t[e],n),h=fa(t[e+1],n);if(e+=o,d!=s||h!=l){var c=s-u,f=l-p,g=d-u,m=h-p;c*m==f*g&&(c<0&&g<c||c==g||c>0&&g>c)&&(f<0&&m<f||f==m||f>0&&m>f)?(s=d,l=h):(r[a++]=s,r[a++]=l,u=s,p=l,s=d,l=h)}}return r[a++]=s,r[a++]=l,a}function ma(t,e,i,o,n,r,a,s){for(var l=0,u=i.length;l<u;++l){var p=i[l];a=ga(t,e,p,o,n,r,a),s.push(a),e=p}return a}function va(t,e,i,o,n){for(var r=void 0!==n?n:[],a=0,s=e;s<i;s+=o)r[a++]=t.slice(s,s+o);return r.length=a,r}function ya(t,e,i,o,n){for(var r=void 0!==n?n:[],a=0,s=0,l=i.length;s<l;++s){var u=i[s];r[a++]=va(t,e,u,o,r[a]),e=u}return r.length=a,r}function _a(t,e,i,o,n){for(var r=void 0!==n?n:[],a=0,s=0,l=i.length;s<l;++s){var u=i[s];r[a++]=ya(t,e,u,o,r[a]),e=u[u.length-1]}return r.length=a,r}function ba(t,e,i,o){for(var n=0,r=t[i-o],a=t[i-o+1];e<i;e+=o){var s=t[e],l=t[e+1];n+=a*s-r*l,r=s,a=l}return n/2}function xa(t,e,i,o){for(var n=0,r=0,a=i.length;r<a;++r){var s=i[r];n+=ba(t,e,s,o),e=s}return n}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 o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}(),wa=function(t){function e(e,i){var o=t.call(this)||this;return o.maxDelta_=-1,o.maxDeltaRevision_=-1,void 0===i||Array.isArray(e[0])?o.setCoordinates(e,i):o.setFlatCoordinates(i,e),o}return ka(e,t),e.prototype.clone=function(){return new e(this.flatCoordinates.slice(),this.layout)},e.prototype.closestPointXY=function(t,e,i,o){return o<Ji(this.getExtent(),t,e)?o:(this.maxDeltaRevision_!=this.getRevision()&&(this.maxDelta_=Math.sqrt(aa(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,0)),this.maxDeltaRevision_=this.getRevision()),la(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,this.maxDelta_,!0,t,e,i,o))},e.prototype.getArea=function(){return ba(this.flatCoordinates,0,this.flatCoordinates.length,this.stride)},e.prototype.getCoordinates=function(){return va(this.flatCoordinates,0,this.flatCoordinates.length,this.stride)},e.prototype.getSimplifiedGeometryInternal=function(t){var i=[];return i.length=ca(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,t,i,0),new e(i,Xr)},e.prototype.getType=function(){return jo},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=da(this.flatCoordinates,0,t,this.stride),this.changed()},e}(na),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 o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}(),Ca=function(t){function e(e,i){var o=t.call(this)||this;return o.setCoordinates(e,i),o}return Sa(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,o){var n=this.flatCoordinates,r=De(t,e,n[0],n[1]);if(r<o){for(var a=this.stride,s=0;s<a;++s)i[s]=n[s];return i.length=a,r}return o},e.prototype.getCoordinates=function(){return this.flatCoordinates?this.flatCoordinates.slice():[]},e.prototype.computeExtent=function(t){return ao(this.flatCoordinates,t)},e.prototype.getType=function(){return Po},e.prototype.intersectsExtent=function(t){return eo(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=pa(this.flatCoordinates,0,t,this.stride),this.changed()},e}(na);function za(t,e,i,o,n){return!fo(n,(function(n){return!Ta(t,e,i,o,n[0],n[1])}))}function Ta(t,e,i,o,n,r){for(var a=0,s=t[i-o],l=t[i-o+1];e<i;e+=o){var u=t[e],p=t[e+1];l<=r?p>r&&(u-s)*(r-l)-(n-s)*(p-l)>0&&a++:p<=r&&(u-s)*(r-l)-(n-s)*(p-l)<0&&a--,s=u,l=p}return 0!==a}function Ea(t,e,i,o,n,r){if(0===i.length)return!1;if(!Ta(t,e,i[0],o,n,r))return!1;for(var a=1,s=i.length;a<s;++a)if(Ta(t,i[a-1],i[a],o,n,r))return!1;return!0}function Pa(t,e,i,o,n,r,a){for(var s,l,u,p,d,h,c,f=n[r+1],g=[],m=0,v=i.length;m<v;++m){var y=i[m];for(p=t[y-o],h=t[y-o+1],s=e;s<y;s+=o)d=t[s],c=t[s+1],(f<=h&&c<=f||h<=f&&f<=c)&&(u=(f-h)/(c-h)*(d-p)+p,g.push(u)),p=d,h=c}var _=NaN,b=-1/0;for(g.sort(ht),p=g[0],s=1,l=g.length;s<l;++s){d=g[s];var x=Math.abs(d-p);x>b&&Ea(t,e,i,o,u=(p+d)/2,f)&&(_=u,b=x),p=d}return isNaN(_)&&(_=n[r]),a?(a.push(_,f,b),a):[_,f,b]}function Oa(t,e,i,o,n){for(var r=[],a=0,s=i.length;a<s;++a){var l=i[a];r=Pa(t,e,l,o,n,2*a,r),e=l[l.length-1]}return r}function ja(t,e,i,o,n){var r;for(e+=o;e<i;e+=o)if(r=n(t.slice(e-o,e),t.slice(e,e+o)))return r;return!1}function Ra(t,e,i,o,n){var r=ho([1/0,1/0,-1/0,-1/0],t,e,i,o);return!!zo(n,r)&&(!!to(n,r)||(r[0]>=n[0]&&r[2]<=n[2]||(r[1]>=n[1]&&r[3]<=n[3]||ja(t,e,i,o,(function(t,e){return function(t,e,i){var o=!1,n=io(t,e),r=io(t,i);if(n===Vi||r===Vi)o=!0;else{var a=t[0],s=t[1],l=t[2],u=t[3],p=e[0],d=e[1],h=i[0],c=i[1],f=(c-d)/(h-p),g=void 0,m=void 0;r&Ui&&!(n&Ui)&&(o=(g=h-(c-u)/f)>=a&&g<=l),o||!(r&Xi)||n&Xi||(o=(m=c-(h-l)*f)>=s&&m<=u),o||!(r&Ki)||n&Ki||(o=(g=h-(c-s)/f)>=a&&g<=l),o||!(r&Yi)||n&Yi||(o=(m=c-(h-a)*f)>=s&&m<=u)}return o}(n,t,e)})))))}function Ia(t,e,i,o,n){if(!function(t,e,i,o,n){return!!(Ra(t,e,i,o,n)||Ta(t,e,i,o,n[0],n[1])||Ta(t,e,i,o,n[0],n[3])||Ta(t,e,i,o,n[2],n[1])||Ta(t,e,i,o,n[2],n[3]))}(t,e,i[0],o,n))return!1;if(1===i.length)return!0;for(var r=1,a=i.length;r<a;++r)if(za(t,i[r-1],i[r],o,n)&&!Ra(t,i[r-1],i[r],o,n))return!1;return!0}function Fa(t,e,i,o){for(;e<i-o;){for(var n=0;n<o;++n){var r=t[e+n];t[e+n]=t[i-o+n],t[i-o+n]=r}e+=o,i-=o}}function Ma(t,e,i,o){for(var n=0,r=t[i-o],a=t[i-o+1];e<i;e+=o){var s=t[e],l=t[e+1];n+=(s-r)*(l+a),r=s,a=l}return 0===n?void 0:n>0}function Aa(t,e,i,o,n){for(var r=void 0!==n&&n,a=0,s=i.length;a<s;++a){var l=i[a],u=Ma(t,e,l,o);if(0===a){if(r&&u||!r&&!u)return!1}else if(r&&!u||!r&&u)return!1;e=l}return!0}function Da(t,e,i,o,n){for(var r=void 0!==n&&n,a=0,s=i.length;a<s;++a){var l=i[a],u=Ma(t,e,l,o);(0===a?r&&u||!r&&!u:r&&!u||!r&&u)&&Fa(t,e,l,o),e=l}return e}function La(t,e,i,o,n){for(var r=0,a=i.length;r<a;++r)e=Da(t,e,i[r],o,n);return e}var 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 o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}(),Na=function(t){function e(e,i,o){var n=t.call(this)||this;return n.ends_=[],n.flatInteriorPointRevision_=-1,n.flatInteriorPoint_=null,n.maxDelta_=-1,n.maxDeltaRevision_=-1,n.orientedRevision_=-1,n.orientedFlatCoordinates_=null,void 0!==i&&o?(n.setFlatCoordinates(i,e),n.ends_=o):n.setCoordinates(e,i),n}return Ga(e,t),e.prototype.appendLinearRing=function(t){this.flatCoordinates?gt(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,o){return o<Ji(this.getExtent(),t,e)?o:(this.maxDeltaRevision_!=this.getRevision()&&(this.maxDelta_=Math.sqrt(sa(this.flatCoordinates,0,this.ends_,this.stride,0)),this.maxDeltaRevision_=this.getRevision()),ua(this.flatCoordinates,0,this.ends_,this.stride,this.maxDelta_,!0,t,e,i,o))},e.prototype.containsXY=function(t,e){return Ea(this.getOrientedFlatCoordinates(),0,this.ends_,this.stride,t,e)},e.prototype.getArea=function(){return xa(this.getOrientedFlatCoordinates(),0,this.ends_,this.stride)},e.prototype.getCoordinates=function(t){var e;return void 0!==t?Da(e=this.getOrientedFlatCoordinates().slice(),0,this.ends_,this.stride,t):e=this.flatCoordinates,ya(e,0,this.ends_,this.stride)},e.prototype.getEnds=function(){return this.ends_},e.prototype.getFlatInteriorPoint=function(){if(this.flatInteriorPointRevision_!=this.getRevision()){var t=yo(this.getExtent());this.flatInteriorPoint_=Pa(this.getOrientedFlatCoordinates(),0,this.ends_,this.stride,t,0),this.flatInteriorPointRevision_=this.getRevision()}return this.flatInteriorPoint_},e.prototype.getInteriorPoint=function(){return new Ca(this.getFlatInteriorPoint(),Yr)},e.prototype.getLinearRingCount=function(){return this.ends_.length},e.prototype.getLinearRing=function(t){return t<0||this.ends_.length<=t?null:new wa(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_,o=[],n=0,r=0,a=i.length;r<a;++r){var s=i[r],l=new wa(e.slice(n,s),t);o.push(l),n=s}return o},e.prototype.getOrientedFlatCoordinates=function(){if(this.orientedRevision_!=this.getRevision()){var t=this.flatCoordinates;Aa(t,0,this.ends_,this.stride)?this.orientedFlatCoordinates_=t:(this.orientedFlatCoordinates_=t.slice(),this.orientedFlatCoordinates_.length=Da(this.orientedFlatCoordinates_,0,this.ends_,this.stride)),this.orientedRevision_=this.getRevision()}return this.orientedFlatCoordinates_},e.prototype.getSimplifiedGeometryInternal=function(t){var i=[],o=[];return i.length=ma(this.flatCoordinates,0,this.ends_,this.stride,Math.sqrt(t),i,0,o),new e(i,Xr,o)},e.prototype.getType=function(){return Ro},e.prototype.intersectsExtent=function(t){return Ia(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=ha(this.flatCoordinates,0,t,this.stride,this.ends_);this.flatCoordinates.length=0===i.length?0:i[i.length-1],this.changed()},e}(na),Ba=Na;function qa(t){var e=t[0],i=t[1],o=t[2],n=t[3],r=[e,i,e,n,o,n,o,i,e,i];return new Na(r,Xr,[r.length])}function Wa(t,e,i){for(var o=e||32,n=t.getStride(),r=t.getLayout(),a=t.getCenter(),s=n*(o+1),l=new Array(s),u=0;u<s;u+=n){l[u]=0,l[u+1]=0;for(var p=2;p<n;p++)l[u+p]=a[p]}var d=[l.length],h=new Na(l,r,d);return function(t,e,i,o){for(var n=t.getFlatCoordinates(),r=t.getStride(),a=n.length/r-1,s=o||0,l=0;l<=a;++l){var u=l*r,p=s+2*Ge(l,a)*Math.PI/a;n[u]=e[0]+i*Math.cos(p),n[u+1]=e[1]+i*Math.sin(p)}t.changed()}(h,a,t.getRadius(),i),h}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 o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}();function Ua(t,e){setTimeout((function(){t(e)}),0)}function Xa(t){return!(t.sourceCenter&&t.targetCenter&&!Wo(t.sourceCenter,t.targetCenter))&&(t.sourceResolution===t.targetResolution&&t.sourceRotation===t.targetRotation)}function Ka(t,e,i,o,n){var r=Math.cos(-n),a=Math.sin(-n),s=t[0]*r-t[1]*a,l=t[1]*r+t[0]*a;return[(s+=(e[0]/2-i[0])*o)*r-(l+=(i[1]-e[1]/2)*o)*(a=-a),l*r+s*a]}var Ya=function(t){function e(e){var i=t.call(this)||this;i.on,i.once,i.un;var o=bt({},e);return i.hints_=[0,0],i.animations_=[],i.updateAnimationKey_,i.projection_=en(o.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,o.center&&(o.center=hn(o.center,i.projection_)),o.extent&&(o.extent=fn(o.extent,i.projection_)),i.applyOptions_(o),i}return Va(e,t),e.prototype.applyOptions_=function(t){var e=function(t){var e,i,o,n=28,r=2,a=void 0!==t.minZoom?t.minZoom:0,s=void 0!==t.maxZoom?t.maxZoom:n,l=void 0!==t.zoomFactor?t.zoomFactor:r,u=void 0!==t.multiWorld&&t.multiWorld,p=void 0===t.smoothResolutionConstraint||t.smoothResolutionConstraint,d=void 0!==t.showFullExtent&&t.showFullExtent,h=en(t.projection,"EPSG:3857"),c=h.getExtent(),f=t.constrainOnlyCenter,g=t.extent;u||g||!h.isGlobal()||(f=!1,g=c);if(void 0!==t.resolutions){var m=t.resolutions;i=m[a],o=void 0!==m[s]?m[s]:m[m.length-1],e=t.constrainResolution?function(t,e,i,o){return function(n,r,a,s){if(void 0!==n){var l=t[0],u=t[t.length-1],p=i?Br(l,i,a,o):l;if(s)return void 0===e||e?qr(n,p,u):Ie(n,u,p);var d=Math.min(p,n),h=Math.floor(ct(t,d,r));return t[h]>p&&h<t.length-1?t[h+1]:t[h]}}}(m,p,!f&&g,d):Wr(i,o,p,!f&&g,d)}else{var v=(c?Math.max(Co(c),xo(c)):360*yi[_i.DEGREES]/h.getMetersPerUnit())/Lr/Math.pow(r,0),y=v/Math.pow(r,n-0);void 0!==(i=t.maxResolution)?a=0:i=v/Math.pow(l,a),void 0===(o=t.minResolution)&&(o=void 0!==t.maxZoom?void 0!==t.maxResolution?i/Math.pow(l,s):v/Math.pow(l,s):y),s=a+Math.floor(Math.log(i/o)/Math.log(l)),o=i/Math.pow(l,s-a),e=t.constrainResolution?function(t,e,i,o,n,r){return function(a,s,l,u){if(void 0!==a){var p=n?Br(e,n,l,r):e,d=void 0!==i?i:0;if(u)return void 0===o||o?qr(a,p,d):Ie(a,d,p);var h=Math.ceil(Math.log(e/p)/Math.log(t)-1e-9),c=-s*(.5-1e-9)+.5,f=Math.min(p,a),g=Math.floor(Math.log(e/f)/Math.log(t)+c),m=Math.max(h,g);return Ie(e/Math.pow(t,m),d,p)}}}(l,i,o,p,!f&&g,d):Wr(i,o,p,!f&&g,d)}return{constraint:e,maxResolution:i,minResolution:o,minZoom:a,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 Gr(t.extent,t.constrainOnlyCenter,e)}var i=en(t.projection,"EPSG:3857");if(!0!==t.multiWorld&&i.isGlobal()){var o=i.getExtent().slice();return o[0]=-1/0,o[2]=1/0,Gr(o,!1,!1)}return Nr}(t),o=e.constraint,n=function(t){if(void 0===t.enableRotation||t.enableRotation){var e=t.constrainRotation;return void 0===e||!0===e?(r=n||Le(5),function(t,e){return e?t:void 0!==t?Math.abs(t)<=r?0:t:void 0}):!1===e?Ur:"number"==typeof e?(i=e,o=2*Math.PI/i,function(t,e){return e?t:void 0!==t?t=Math.floor(t/o+.5)*o:void 0}):Ur}return Vr;var i,o;var n,r}(t);this.constraints_={center:i,resolution:o,rotation:n},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 o=t||[0,0,0,0];e=e||[0,0,0,0];var n=this.getResolution(),r=n/2*(o[3]-e[3]+e[1]-o[1]),a=n/2*(o[0]-e[0]+e[2]-o[2]);this.setCenterInternal([i[0]+r,i[1]-a])}},enumerable:!1,configurable:!0}),e.prototype.getUpdatedOptions_=function(t){var e=bt({},this.options_);return void 0!==e.resolution?e.resolution=this.getResolution():e.zoom=this.getZoom(),e.center=this.getCenterInternal(),e.rotation=this.getRotation(),bt({},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 o=arguments[i];o.center&&((o=bt({},o)).center=hn(o.center,this.getProjection())),o.anchor&&((o=bt({},o)).anchor=hn(o.anchor,this.getProjection())),e[i]=o}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 o=0;o<i&&!this.isDef();++o){var n=arguments[o];n.center&&this.setCenterInternal(n.center),void 0!==n.zoom?this.setZoom(n.zoom):n.resolution&&this.setResolution(n.resolution),void 0!==n.rotation&&this.setRotation(n.rotation)}if(o!==i){for(var r=Date.now(),a=this.targetCenter_.slice(),s=this.targetResolution_,l=this.targetRotation_,u=[];o<i;++o){var p=arguments[o],d={start:r,complete:!1,anchor:p.anchor,duration:void 0!==p.duration?p.duration:1e3,easing:p.easing||ui,callback:e};if(p.center&&(d.sourceCenter=a,d.targetCenter=p.center.slice(),a=d.targetCenter),void 0!==p.zoom?(d.sourceResolution=s,d.targetResolution=this.getResolutionForZoom(p.zoom),s=d.targetResolution):p.resolution&&(d.sourceResolution=s,d.targetResolution=p.resolution,s=d.targetResolution),void 0!==p.rotation){d.sourceRotation=l;var h=Ge(p.rotation-l+Math.PI,2*Math.PI)-Math.PI;d.targetRotation=l+h,l=d.targetRotation}Xa(d)?d.complete=!0:r+=d.duration,u.push(d)}this.animations_.push(u),this.setHint(Ir,1),this.updateAnimations_()}else e&&Ua(e,!0)},e.prototype.getAnimating=function(){return this.hints_[Ir]>0},e.prototype.getInteracting=function(){return this.hints_[Fr]>0},e.prototype.cancelAnimations=function(){var t;this.setHint(Ir,-this.hints_[Ir]);for(var e=0,i=this.animations_.length;e<i;++e){var o=this.animations_[e];if(o[0].callback&&Ua(o[0].callback,!1),!t)for(var n=0,r=o.length;n<r;++n){var a=o[n];if(!a.complete){t=a.anchor;break}}}this.animations_.length=0,this.cancelAnchor_=t,this.nextCenter_=null,this.nextResolution_=NaN,this.nextRotation_=NaN},e.prototype.updateAnimations_=function(){if(void 0!==this.updateAnimationKey_&&(cancelAnimationFrame(this.updateAnimationKey_),this.updateAnimationKey_=void 0),this.getAnimating()){for(var t=Date.now(),e=!1,i=this.animations_.length-1;i>=0;--i){for(var o=this.animations_[i],n=!0,r=0,a=o.length;r<a;++r){var s=o[r];if(!s.complete){var l=t-s.start,u=s.duration>0?l/s.duration:1;u>=1?(s.complete=!0,u=1):n=!1;var p=s.easing(u);if(s.sourceCenter){var d=s.sourceCenter[0],h=s.sourceCenter[1],c=s.targetCenter[0],f=s.targetCenter[1];this.nextCenter_=s.targetCenter;var g=d+p*(c-d),m=h+p*(f-h);this.targetCenter_=[g,m]}if(s.sourceResolution&&s.targetResolution){var v=1===p?s.targetResolution:s.sourceResolution+p*(s.targetResolution-s.sourceResolution);if(s.anchor){var y=this.getViewportSize_(this.getRotation()),_=this.constraints_.resolution(v,0,y,!0);this.targetCenter_=this.calculateCenterZoom(_,s.anchor)}this.nextResolution_=s.targetResolution,this.targetResolution_=v,this.applyTargetState_(!0)}if(void 0!==s.sourceRotation&&void 0!==s.targetRotation){var b=1===p?Ge(s.targetRotation+Math.PI,2*Math.PI)-Math.PI:s.sourceRotation+p*(s.targetRotation-s.sourceRotation);if(s.anchor){var x=this.constraints_.rotation(b,!0);this.targetCenter_=this.calculateCenterRotate(x,s.anchor)}this.nextRotation_=s.targetRotation,this.targetRotation_=b}if(this.applyTargetState_(!0),e=!0,!s.complete)break}}if(n){this.animations_[i]=null,this.setHint(Ir,-1),this.nextCenter_=null,this.nextResolution_=NaN,this.nextRotation_=NaN;var k=o[0].callback;k&&Ua(k,!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,o,n,r=this.getCenterInternal();return void 0!==r&&(Vo(i=[r[0]-e[0],r[1]-e[1]],t-this.getRotation()),n=e,(o=i)[0]+=+n[0],o[1]+=+n[1]),i},e.prototype.calculateCenterZoom=function(t,e){var i,o=this.getCenterInternal(),n=this.getResolution();void 0!==o&&void 0!==n&&(i=[e[0]-t*(e[0]-o[0])/n,e[1]-t*(e[1]-o[1])/n]);return i},e.prototype.getViewportSize_=function(t){var e=this.viewportSize_;if(t){var i=e[0],o=e[1];return[Math.abs(i*Math.cos(t))+Math.abs(o*Math.sin(t)),Math.abs(i*Math.sin(t))+Math.abs(o*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?dn(t,this.getProjection()):t},e.prototype.getCenterInternal=function(){return this.get(Mr)},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 cn(this.calculateExtentInternal(t),this.getProjection())},e.prototype.calculateExtentInternal=function(t){var e=t||this.getViewportSizeMinusPadding_(),i=this.getCenterInternal();Re(i,1);var o=this.getResolution();Re(void 0!==o,2);var n=this.getRotation();return Re(void 0!==n,3),bo(i,o,n,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(Ar)},e.prototype.getResolutions=function(){return this.resolutions_},e.prototype.getResolutionForExtent=function(t,e){return this.getResolutionForExtentInternal(fn(t,this.getProjection()),e)},e.prototype.getResolutionForExtentInternal=function(t,e){var i=e||this.getViewportSizeMinusPadding_(),o=Co(t)/i[0],n=xo(t)/i[1];return Math.max(o,n)},e.prototype.getResolutionForValueFunction=function(t){var e=t||2,i=this.getConstrainedResolution(this.maxResolution_),o=this.minResolution_,n=Math.log(i/o)/Math.log(e);return function(t){return i/Math.pow(e,t*n)}},e.prototype.getRotation=function(){return this.get(Dr)},e.prototype.getValueForResolutionFunction=function(t){var e=Math.log(t||2),i=this.getConstrainedResolution(this.maxResolution_),o=this.minResolution_,n=Math.log(i/o)/e;return function(t){return Math.log(i/t)/e/n}},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(),o=this.getCenterInternal(),n=this.padding_;if(n){var r=this.getViewportSizeMinusPadding_();o=Ka(o,this.getViewportSize_(),[r[0]/2+n[3],r[1]/2+n[0]],e,i)}return{center:o.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,o=this.minZoom_||0;if(this.resolutions_){var n=ct(this.resolutions_,t,1);o=n,e=this.resolutions_[n],i=n==this.resolutions_.length-1?2:e/this.resolutions_[n+1]}else e=this.maxResolution_,i=this.zoomFactor_;return o+Math.log(e/t)/Math.log(i)},e.prototype.getResolutionForZoom=function(t){if(this.resolutions_){if(this.resolutions_.length<=1)return 0;var e=Ie(Math.floor(t),0,this.resolutions_.length-2),i=this.resolutions_[e]/this.resolutions_[e+1];return this.resolutions_[e]/Math.pow(i,Ie(t-e,0,1))}return this.maxResolution_/Math.pow(this.zoomFactor_,t-this.minZoom_)},e.prototype.fit=function(t,e){var i;if(Re(Array.isArray(t)||"function"==typeof t.getSimplifiedGeometry,24),Array.isArray(t))Re(!To(t),25),i=qa(o=fn(t,this.getProjection()));else if(t.getType()===Do){var o;(i=qa(o=fn(t.getExtent(),this.getProjection()))).rotate(this.getRotation(),yo(o))}else{i=t}this.fitInternal(i,e)},e.prototype.rotatedExtentForGeometry=function(t){for(var e=this.getRotation(),i=Math.cos(e),o=Math.sin(-e),n=t.getFlatCoordinates(),r=t.getStride(),a=1/0,s=1/0,l=-1/0,u=-1/0,p=0,d=n.length;p<d;p+=r){var h=n[p]*i-n[p+1]*o,c=n[p]*o+n[p+1]*i;a=Math.min(a,h),s=Math.min(s,c),l=Math.max(l,h),u=Math.max(u,c)}return[a,s,l,u]},e.prototype.fitInternal=function(t,e){var i=e||{},o=i.size;o||(o=this.getViewportSizeMinusPadding_());var n,r=void 0!==i.padding?i.padding:[0,0,0,0],a=void 0!==i.nearest&&i.nearest;n=void 0!==i.minResolution?i.minResolution:void 0!==i.maxZoom?this.getResolutionForZoom(i.maxZoom):0;var s=this.rotatedExtentForGeometry(t),l=this.getResolutionForExtentInternal(s,[o[0]-r[1]-r[3],o[1]-r[0]-r[2]]);l=isNaN(l)?n:Math.max(l,n),l=this.getConstrainedResolution(l,a?0:1);var u=this.getRotation(),p=Math.sin(u),d=Math.cos(u),h=yo(s);h[0]+=(r[1]-r[3])/2*l,h[1]+=(r[0]-r[2])/2*l;var c=h[0]*d-h[1]*p,f=h[1]*d+h[0]*p,g=this.getConstrainedCenter([c,f],l),m=i.callback?i.callback:_t;void 0!==i.duration?this.animateInternal({resolution:l,center:g,duration:i.duration,easing:i.easing},m):(this.targetResolution_=l,this.targetCenter_=g,this.applyTargetState_(!1,!0),Ua(m,!0))},e.prototype.centerOn=function(t,e,i){this.centerOnInternal(hn(t,this.getProjection()),e,i)},e.prototype.centerOnInternal=function(t,e,i){this.setCenterInternal(Ka(t,e,i,this.getResolution(),this.getRotation()))},e.prototype.calculateCenterShift=function(t,e,i,o){var n,r=this.padding_;if(r&&t){var a=this.getViewportSizeMinusPadding_(-i),s=Ka(t,o,[a[0]/2+r[3],a[1]/2+r[0]],e,i);n=[t[0]-s[0],t[1]-s[1]]}return n},e.prototype.isDef=function(){return!!this.getCenterInternal()&&void 0!==this.getResolution()},e.prototype.adjustCenter=function(t){var e=dn(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&&hn(e,this.getProjection());this.adjustResolutionInternal(t,i)},e.prototype.adjustResolutionInternal=function(t,e){var i=this.getAnimating()||this.getInteracting(),o=this.getViewportSize_(this.getRotation()),n=this.constraints_.resolution(this.targetResolution_*t,0,o,i);e&&(this.targetCenter_=this.calculateCenterZoom(n,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=hn(e,this.getProjection())),this.adjustRotationInternal(t,e)},e.prototype.adjustRotationInternal=function(t,e){var i=this.getAnimating()||this.getInteracting(),o=this.constraints_.rotation(this.targetRotation_+t,i);e&&(this.targetCenter_=this.calculateCenterRotate(o,e)),this.targetRotation_+=t,this.applyTargetState_()},e.prototype.setCenter=function(t){this.setCenterInternal(hn(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,o=this.constraints_.rotation(this.targetRotation_,i),n=this.getViewportSize_(o),r=this.constraints_.resolution(this.targetResolution_,0,n,i),a=this.constraints_.center(this.targetCenter_,r,n,i,this.calculateCenterShift(this.targetCenter_,r,o,n));this.get(Dr)!==o&&this.set(Dr,o),this.get(Ar)!==r&&this.set(Ar,r),this.get(Mr)&&Wo(this.get(Mr),a)||this.set(Mr,a),this.getAnimating()&&!t&&this.cancelAnimations(),this.cancelAnchor_=void 0},e.prototype.resolveConstraints=function(t,e,i){var o=void 0!==t?t:200,n=e||0,r=this.constraints_.rotation(this.targetRotation_),a=this.getViewportSize_(r),s=this.constraints_.resolution(this.targetResolution_,n,a),l=this.constraints_.center(this.targetCenter_,s,a,!1,this.calculateCenterShift(this.targetCenter_,s,r,a));if(0===o&&!this.cancelAnchor_)return this.targetResolution_=s,this.targetRotation_=r,this.targetCenter_=l,void this.applyTargetState_();var u=i||(0===o?this.cancelAnchor_:void 0);this.cancelAnchor_=void 0,this.getResolution()===s&&this.getRotation()===r&&this.getCenterInternal()&&Wo(this.getCenterInternal(),l)||(this.getAnimating()&&this.cancelAnimations(),this.animateInternal({rotation:r,center:l,resolution:s,duration:o,easing:li,anchor:u}))},e.prototype.beginInteraction=function(){this.resolveConstraints(0),this.setHint(Fr,1)},e.prototype.endInteraction=function(t,e,i){var o=i&&hn(i,this.getProjection());this.endInteractionInternal(t,e,o)},e.prototype.endInteractionInternal=function(t,e,i){this.setHint(Fr,-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,o=this.getViewportSize_(this.getRotation());return this.constraints_.resolution(t,i,o)},e}(Ht);function Za(t){return t[0]>0&&t[1]>0}function Ha(t,e){return Array.isArray(t)?t:(void 0===e?e=[t,t]:(e[0]=t,e[1]=t),e)}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 o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}();var Ja=function(t){function e(e){var i=t.call(this)||this;i.on,i.once,i.un;var o=function(t){var e=null;void 0!==t.keyboardEventTarget&&(e="string"==typeof t.keyboardEventTarget?document.getElementById(t.keyboardEventTarget):t.keyboardEventTarget);var i,o,n,r={},a=t.layers&&"function"==typeof t.layers.getLayers?t.layers:new mr({layers:t.layers});r[pr]=a,r[hr]=t.target,r[cr]=t.view instanceof Ya?t.view:new Ya,void 0!==t.controls&&(Array.isArray(t.controls)?i=new ai(t.controls.slice()):(Re("function"==typeof t.controls.getArray,47),i=t.controls));void 0!==t.interactions&&(Array.isArray(t.interactions)?o=new ai(t.interactions.slice()):(Re("function"==typeof t.interactions.getArray,48),o=t.interactions));void 0!==t.overlays?Array.isArray(t.overlays)?n=new ai(t.overlays.slice()):(Re("function"==typeof t.overlays.getArray,49),n=t.overlays):n=new ai;return{controls:i,interactions:o,keyboardEventTarget:e,overlays:n,values:r}}(e);i.boundHandleBrowserEvent_=i.handleBrowserEvent.bind(i),i.maxTilesLoading_=void 0!==e.maxTilesLoading?e.maxTilesLoading:16,i.pixelRatio_=void 0!==e.pixelRatio?e.pixelRatio:ne,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_=o.keyboardEventTarget,i.keyHandlerKeys_=null,i.controls=o.controls||new ai,i.interactions=o.interactions||new ai,i.overlays_=o.overlays,i.overlayIdIndex_={},i.renderer_=null,i.handleResize_,i.postRenderFunctions_=[],i.tileQueue_=new Rr(i.getTilePriority.bind(i),i.handleTileChange_.bind(i)),i.addChangeListener(pr,i.handleLayerGroupChanged_),i.addChangeListener(cr,i.handleViewChanged_),i.addChangeListener(dr,i.handleSizeChanged_),i.addChangeListener(hr,i.handleTargetChanged_),i.setProperties(o.values);var n=i;return!e.view||e.view instanceof Ya||e.view.then((function(t){n.setView(new Ya(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 $a(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 o=this.getCoordinateFromPixelInternal(t),n=void 0!==(i=void 0!==i?i:{}).hitTolerance?i.hitTolerance:0,r=void 0!==i.layerFilter?i.layerFilter:vt,a=!1!==i.checkWrapped;return this.renderer_.forEachFeatureAtCoordinate(o,this.frameState_,n,a,e,null,r,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 o=i||{},n=void 0!==o.hitTolerance?o.hitTolerance:0,r=o.layerFilter||vt;return this.renderer_.forEachLayerAtPixel(t,this.frameState_,n,e,r)}},e.prototype.hasFeatureAtPixel=function(t,e){if(!this.frameState_)return!1;var i=this.getCoordinateFromPixelInternal(t),o=void 0!==(e=void 0!==e?e:{}).layerFilter?e.layerFilter:vt,n=void 0!==e.hitTolerance?e.hitTolerance:0,r=!1!==e.checkWrapped;return this.renderer_.hasFeatureAtCoordinate(i,this.frameState_,n,r,o,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(hr)},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 dn(this.getCoordinateFromPixelInternal(t),this.getView().getProjection())},e.prototype.getCoordinateFromPixelInternal=function(t){var e=this.frameState_;return e?bn(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(pr)},e.prototype.setLayers=function(t){var e=this.getLayerGroup();if(t instanceof ai)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 o=t[e].layer.getSource();if(o&&o.loading)return!0}return!1},e.prototype.getPixelFromCoordinate=function(t){var e=hn(t,this.getView().getProjection());return this.getPixelFromCoordinateInternal(e)},e.prototype.getPixelFromCoordinateInternal=function(t){var e=this.frameState_;return e?bn(e.coordinateToPixelTransform,t.slice(0,2)):null},e.prototype.getRenderer=function(){return this.renderer_},e.prototype.getSize=function(){return this.get(dr)},e.prototype.getView=function(){return this.get(cr)},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,o){return function(t,e,i,o,n){if(!t||!(i in t.wantedTiles))return Sr;if(!t.wantedTiles[i][e.getKey()])return Sr;var r=t.viewState.center,a=o[0]-r[0],s=o[1]-r[1];return 65536*Math.log(n)+Math.sqrt(a*a+s*s)/n}(this.frameState_,t,e,i,o)},e.prototype.handleBrowserEvent=function(t,e){var i=e||t.type,o=new br(i,this,t);this.handleMapBrowserEvent(o)},e.prototype.handleMapBrowserEvent=function(t){if(this.frameState_){var e=t.originalEvent,i=e.type;if(i===mi||i===Lt||i===It){var o=this.getOwnerDocument(),n=this.viewport_.getRootNode?this.viewport_.getRootNode():o,r=e.target;if(this.overlayContainerStopEvent_.contains(r)||!(n===o?o.documentElement:n).contains(r))return}if(t.frameState=this.frameState_,!1!==this.dispatchEvent(t))for(var a=this.getInteractions().getArray().slice(),s=a.length-1;s>=0;s--){var l=a[s];if(l.getMap()===this&&l.getActive()&&this.getTargetElement())if(!l.handleEvent(t)||t.propagationStopped)break}}},e.prototype.handlePostRender=function(){var t=this.frameState_,e=this.tileQueue_;if(!e.isEmpty()){var i=this.maxTilesLoading_,o=i;if(t){var n=t.viewHints;if(n[Ir]||n[Fr]){var r=Date.now()-t.time>8;i=r?0:8,o=r?0:2}}e.getTilesLoading()<i&&(e.reprioritize(),e.loadMoreTiles(i,o))}!t||!this.hasListener(Ke)||t.animate||this.tileQueue_.getTilesLoading()||this.getLoading()||this.renderer_.dispatchRenderEvent(Ke,t);for(var a=this.postRenderFunctions_,s=0,l=a.length;s<l;++s)a[s](this,t);a.length=0},e.prototype.handleSizeChanged_=function(){this.getView()&&!this.getView().getAnimating()&&this.getView().resolveConstraints(0),this.render()},e.prototype.handleTargetChanged_=function(){var t;if(this.getTarget()&&(t=this.getTargetElement()),this.mapBrowserEventHandler_){for(var e=0,i=this.keyHandlerKeys_.length;e<i;++e)Bt(this.keyHandlerKeys_[e]);this.keyHandlerKeys_=null,this.viewport_.removeEventListener(Ot,this.boundHandleBrowserEvent_),this.viewport_.removeEventListener(Lt,this.boundHandleBrowserEvent_),void 0!==this.handleResize_&&(removeEventListener(At,this.handleResize_,!1),this.handleResize_=void 0),this.mapBrowserEventHandler_.dispose(),this.mapBrowserEventHandler_=null,pe(this.viewport_)}if(t){for(var o in t.appendChild(this.viewport_),this.renderer_||(this.renderer_=this.createRenderer()),this.mapBrowserEventHandler_=new wr(this,this.moveTolerance_),xr)this.mapBrowserEventHandler_.addEventListener(xr[o],this.handleMapBrowserEvent.bind(this));this.viewport_.addEventListener(Ot,this.boundHandleBrowserEvent_,!1),this.viewport_.addEventListener(Lt,this.boundHandleBrowserEvent_,!!se&&{passive:!1});var n=this.keyboardEventTarget_?this.keyboardEventTarget_:t;this.keyHandlerKeys_=[Gt(n,It,this.handleBrowserEvent,this),Gt(n,Ft,this.handleBrowserEvent,this)],this.handleResize_||(this.handleResize_=this.updateSize.bind(this),window.addEventListener(At,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_&&(Bt(this.viewPropertyListenerKey_),this.viewPropertyListenerKey_=null),this.viewChangeListenerKey_&&(Bt(this.viewChangeListenerKey_),this.viewChangeListenerKey_=null);var t=this.getView();t&&(this.updateViewportSize_(),this.viewPropertyListenerKey_=Gt(t,pt,this.handleViewPropertyChanged_,this),this.viewChangeListenerKey_=Gt(t,Tt,this.handleViewPropertyChanged_,this),t.resolveConstraints(0)),this.render()},e.prototype.handleLayerGroupChanged_=function(){this.layerGroupPropertyListenerKeys_&&(this.layerGroupPropertyListenerKeys_.forEach(Bt),this.layerGroupPropertyListenerKeys_=null);var t=this.getLayerGroup();t&&(this.layerGroupPropertyListenerKeys_=[Gt(t,pt,this.render,this),Gt(t,Tt,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 o=t[e].layer;o.hasRenderer()&&o.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(),o=this.getView(),n=this.frameState_,r=null;if(void 0!==i&&Za(i)&&o&&o.isDef()){var a=o.getHints(this.frameState_?this.frameState_.viewHints:void 0),s=o.getState();if(r={animate:!1,coordinateToPixelTransform:this.coordinateToPixelTransform_,declutterTree:null,extent:bo(s.center,s.resolution,s.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:s,viewHints:a,wantedTiles:{}},s.nextCenter&&s.nextResolution){var l=isNaN(s.nextRotation)?s.rotation:s.nextRotation;r.nextExtent=bo(s.nextCenter,s.nextResolution,l,i)}}if(this.frameState_=r,this.renderer_.renderFrame(r),r){if(r.animate&&this.render(),Array.prototype.push.apply(this.postRenderFunctions_,r.postRenderFunctions),n)(!this.previousExtent_||!To(this.previousExtent_)&&!lo(r.extent,this.previousExtent_))&&(this.dispatchEvent(new yr(Jt,this,n)),this.previousExtent_=ro(this.previousExtent_));this.previousExtent_&&!r.viewHints[Ir]&&!r.viewHints[Fr]&&!lo(r.extent,this.previousExtent_)&&(this.dispatchEvent(new yr(Qt,this,r)),$i(r.extent,this.previousExtent_))}this.dispatchEvent(new yr($t,this,r)),this.postRenderTimeoutHandle_||(this.postRenderTimeoutHandle_=setTimeout((function(){e.postRenderTimeoutHandle_=void 0,e.handlePostRender()}),0))},e.prototype.setLayerGroup=function(t){this.set(pr,t)},e.prototype.setSize=function(t){this.set(dr,t)},e.prototype.setTarget=function(t){this.set(hr,t)},e.prototype.setView=function(t){if(!t||t instanceof Ya)this.set(cr,t);else{this.set(cr,new Ya);var e=this;t.then((function(t){e.setView(new Ya(t))}))}},e.prototype.updateSize=function(){var t=this.getTargetElement(),e=void 0;if(t){var i=getComputedStyle(t),o=t.offsetWidth-parseFloat(i.borderLeftWidth)-parseFloat(i.paddingLeft)-parseFloat(i.paddingRight)-parseFloat(i.borderRightWidth),n=t.offsetHeight-parseFloat(i.borderTopWidth)-parseFloat(i.paddingTop)-parseFloat(i.paddingBottom)-parseFloat(i.borderBottomWidth);isNaN(o)||isNaN(n)||!Za(e=[o,n])&&(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}(Ht),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 o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}(),ts="units",es="degrees",is="imperial",os="nautical",ns="metric",rs="us",as=[1,2,5],ss=25.4/.28,ls=function(t){function e(e){var i=this,o=e||{},n=void 0!==o.className?o.className:o.bar?"ol-scale-bar":"ol-scale-line";return(i=t.call(this,{element:document.createElement("div"),render:o.render,target:o.target})||this).on,i.once,i.un,i.innerElement_=document.createElement("div"),i.innerElement_.className=n+"-inner",i.element.className=n+" "+fe,i.element.appendChild(i.innerElement_),i.viewState_=null,i.minWidth_=void 0!==o.minWidth?o.minWidth:64,i.renderedVisible_=!1,i.renderedWidth_=void 0,i.renderedHTML_="",i.addChangeListener(ts,i.handleUnitsChanged_),i.setUnits(o.units||ns),i.scaleBar_=o.bar||!1,i.scaleBarSteps_=o.steps||4,i.scaleBarText_=o.text||!1,i.dpi_=o.dpi||void 0,i}return Qa(e,t),e.prototype.getUnits=function(){return this.get(ts)},e.prototype.handleUnitsChanged_=function(){this.updateElement_()},e.prototype.setUnits=function(t){this.set(ts,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,o=this.getUnits(),n=o==es?_i.DEGREES:_i.METERS,r=Qo(i,t.resolution,e,n),a=this.minWidth_*(this.dpi_||ss)/ss,s=a*r,l="";if(o==es){var u=yi[_i.DEGREES];(s*=u)<u/60?(l="″",r*=3600):s<u?(l="′",r*=60):l="°"}else o==is?s<.9144?(l="in",r/=.0254):s<1609.344?(l="ft",r/=.3048):(l="mi",r/=1609.344):o==os?(r/=1852,l="nm"):o==ns?s<.001?(l="μm",r*=1e6):s<1?(l="mm",r*=1e3):s<1e3?l="m":(l="km",r/=1e3):o==rs?s<.9144?(l="in",r*=39.37):s<1609.344?(l="ft",r/=.30480061):(l="mi",r/=1609.3472):Re(!1,33);for(var p,d,h,c,f=3*Math.floor(Math.log(a*r)/Math.log(10));;){h=Math.floor(f/3);var g=Math.pow(10,h);if(p=as[(f%3+3)%3]*g,d=Math.round(p/r),isNaN(d))return this.element.style.display="none",void(this.renderedVisible_=!1);if(d>=a)break;++f}c=this.scaleBar_?this.createScaleBar(d,p,l):p.toFixed(h<0?-h:0)+" "+l,this.renderedHTML_!=c&&(this.innerElement_.innerHTML=c,this.renderedHTML_=c),this.renderedWidth_!=d&&(this.innerElement_.style.width=d+"px",this.renderedWidth_=d),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 o="1 : "+Math.round(this.getScaleForResolution()).toLocaleString(),n=[],r=t/this.scaleBarSteps_,a="#ffffff",s=0;s<this.scaleBarSteps_;s++)0===s&&n.push(this.createMarker("absolute",s)),n.push('<div><div class="ol-scale-singlebar" style="width: '+r+"px;background-color: "+a+';"></div>'+this.createMarker("relative",s)+(s%2==0||2===this.scaleBarSteps_?this.createStepText(s,t,!1,e,i):"")+"</div>"),s===this.scaleBarSteps_-1&&n.push(this.createStepText(s+1,t,!0,e,i)),a="#ffffff"===a?"#000000":"#ffffff";return'<div style="display: flex;">'+(this.scaleBarText_?'<div class="ol-scale-text" style="width: '+t+'px;">'+o+"</div>":"")+n.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,o,n){var r=(0===t?0:Math.round(o/this.scaleBarSteps_*t*100)/100)+(0===t?"":" "+n);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")+';">'+r+"</div>"},e.prototype.getScaleForResolution=function(){var t=Qo(this.viewState_.projection,this.viewState_.resolution,this.viewState_.center),e=this.dpi_||ss,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}(he);function us(t){var e=t||{},i=new ai;return(void 0===e.zoom||e.zoom)&&i.push(new fi(e.zoomOptions)),(void 0===e.rotate||e.rotate)&&i.push(new hi(e.rotateOptions)),(void 0===e.attribution||e.attribution)&&i.push(new ti(e.attributionOptions)),i}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 o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}();var ds=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 o=e;i.setGeometry(o)}else{var n=e;i.setProperties(n)}return i}return ps(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 o=this.getStyle();return o&&t.setStyle(o),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_&&(Bt(this.geometryChangeKey_),this.geometryChangeKey_=null);var t=this.getGeometry();t&&(this.geometryChangeKey_=Gt(t,Tt,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:(Re("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}(Ht),hs=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 o=e.dataProjection?Jo(e.dataProjection):this.readProjection(t);e.extent&&o&&o.getUnits()===_i.TILE_PIXELS&&(o=Jo(o)).setWorldExtent(e.extent),i={dataProjection:o,featureProjection:e.featureProjection}}return this.adaptOptions(i)},t.prototype.adaptOptions=function(t){return bt({dataProjection:this.dataProjection,featureProjection:this.defaultFeatureProjection},t)},t.prototype.getType=function(){return Ut()},t.prototype.readFeature=function(t,e){return Ut()},t.prototype.readFeatures=function(t,e){return Ut()},t.prototype.readGeometry=function(t,e){return Ut()},t.prototype.readProjection=function(t){return Ut()},t.prototype.writeFeature=function(t,e){return Ut()},t.prototype.writeFeatures=function(t,e){return Ut()},t.prototype.writeGeometry=function(t,e){return Ut()},t}();function cs(t,e,i){var o,n=i?Jo(i.featureProjection):null,r=i?Jo(i.dataProjection):null;if(o=n&&r&&!nn(n,r)?(e?t.clone():t).transform(e?n:r,e?r:n):t,e&&i&&void 0!==i.decimals){var a=Math.pow(10,i.decimals);o===t&&(o=t.clone()),o.applyTransform((function(t){for(var e=0,i=t.length;e<i;++e)t[e]=Math.round(t[e]*a)/a;return t}))}return o}var fs="arraybuffer",gs="json",ms="text",vs="xml",ys=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 o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}();function _s(t){if("string"==typeof t){var e=JSON.parse(t);return e||null}return null!==t?t:null}var bs=function(t){function e(){return t.call(this)||this}return ys(e,t),e.prototype.getType=function(){return gs},e.prototype.readFeature=function(t,e){return this.readFeatureFromObject(_s(t),this.getReadOptions(t,e))},e.prototype.readFeatures=function(t,e){return this.readFeaturesFromObject(_s(t),this.getReadOptions(t,e))},e.prototype.readFeatureFromObject=function(t,e){return Ut()},e.prototype.readFeaturesFromObject=function(t,e){return Ut()},e.prototype.readGeometry=function(t,e){return this.readGeometryFromObject(_s(t),this.getReadOptions(t,e))},e.prototype.readGeometryFromObject=function(t,e){return Ut()},e.prototype.readProjection=function(t){return this.readProjectionFromObject(_s(t))},e.prototype.readProjectionFromObject=function(t){return Ut()},e.prototype.writeFeature=function(t,e){return JSON.stringify(this.writeFeatureObject(t,e))},e.prototype.writeFeatureObject=function(t,e){return Ut()},e.prototype.writeFeatures=function(t,e){return JSON.stringify(this.writeFeaturesObject(t,e))},e.prototype.writeFeaturesObject=function(t,e){return Ut()},e.prototype.writeGeometry=function(t,e){return JSON.stringify(this.writeGeometryObject(t,e))},e.prototype.writeGeometryObject=function(t,e){return Ut()},e}(hs);function xs(t,e,i,o,n,r,a){var s,l,u=(i-e)/o;if(1===u)s=e;else if(2===u)s=e,l=n;else if(0!==u){for(var p=t[e],d=t[e+1],h=0,c=[0],f=e+o;f<i;f+=o){var g=t[f],m=t[f+1];h+=Math.sqrt((g-p)*(g-p)+(m-d)*(m-d)),c.push(h),p=g,d=m}var v=n*h,y=function(t,e,i){for(var o,n,r=i||ht,a=0,s=t.length,l=!1;a<s;)(n=+r(t[o=a+(s-a>>1)],e))<0?a=o+1:(s=o,l=!n);return l?a:~a}(c,v);y<0?(l=(v-c[-y-2])/(c[-y-1]-c[-y-2]),s=e+(-y-2)*o):s=e+y*o}var _=a>1?a:2,b=r||new Array(_);for(f=0;f<_;++f)b[f]=void 0===s?NaN:void 0===l?t[s+f]:Ne(t[s+f],t[s+o+f],l);return b}function ks(t,e,i,o,n,r){if(i==e)return null;var a;if(n<t[e+o-1])return r?((a=t.slice(e,e+o))[o-1]=n,a):null;if(t[i-1]<n)return r?((a=t.slice(i-o,i))[o-1]=n,a):null;if(n==t[e+o-1])return t.slice(e,e+o);for(var s=e/o,l=i/o;s<l;){var u=s+l>>1;n<t[(u+1)*o-1]?l=u:s=u+1}var p=t[s*o-1];if(n==p)return t.slice((s-1)*o,(s-1)*o+o);var d=(n-p)/(t[(s+1)*o-1]-p);a=[];for(var h=0;h<o-1;++h)a.push(Ne(t[(s-1)*o+h],t[s*o+h],d));return a.push(n),a}function ws(t,e,i,o){for(var n=t[e],r=t[e+1],a=0,s=e+o;s<i;s+=o){var l=t[s],u=t[s+1];a+=Math.sqrt((l-n)*(l-n)+(u-r)*(u-r)),n=l,r=u}return a}var Ss=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 o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}(),Cs=function(t){function e(e,i){var o=t.call(this)||this;return o.flatMidpoint_=null,o.flatMidpointRevision_=-1,o.maxDelta_=-1,o.maxDeltaRevision_=-1,void 0===i||Array.isArray(e[0])?o.setCoordinates(e,i):o.setFlatCoordinates(i,e),o}return Ss(e,t),e.prototype.appendCoordinate=function(t){this.flatCoordinates?gt(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,o){return o<Ji(this.getExtent(),t,e)?o:(this.maxDeltaRevision_!=this.getRevision()&&(this.maxDelta_=Math.sqrt(aa(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,0)),this.maxDeltaRevision_=this.getRevision()),la(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,this.maxDelta_,!1,t,e,i,o))},e.prototype.forEachSegment=function(t){return ja(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,t)},e.prototype.getCoordinateAtM=function(t,e){if(this.layout!=Yr&&this.layout!=Zr)return null;var i=void 0!==e&&e;return ks(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,t,i)},e.prototype.getCoordinates=function(){return va(this.flatCoordinates,0,this.flatCoordinates.length,this.stride)},e.prototype.getCoordinateAt=function(t,e){return xs(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,t,e,this.stride)},e.prototype.getLength=function(){return ws(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=ca(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,t,i,0),new e(i,Xr)},e.prototype.getType=function(){return Oo},e.prototype.intersectsExtent=function(t){return Ra(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=da(this.flatCoordinates,0,t,this.stride),this.changed()},e}(na),zs=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 o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}(),Ts=function(t){function e(e,i,o){var n=t.call(this)||this;if(n.ends_=[],n.maxDelta_=-1,n.maxDeltaRevision_=-1,Array.isArray(e[0]))n.setCoordinates(e,i);else if(void 0!==i&&o)n.setFlatCoordinates(i,e),n.ends_=o;else{for(var r=n.getLayout(),a=e,s=[],l=[],u=0,p=a.length;u<p;++u){var d=a[u];0===u&&(r=d.getLayout()),gt(s,d.getFlatCoordinates()),l.push(s.length)}n.setFlatCoordinates(r,s),n.ends_=l}return n}return zs(e,t),e.prototype.appendLineString=function(t){this.flatCoordinates?gt(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,o){return o<Ji(this.getExtent(),t,e)?o:(this.maxDeltaRevision_!=this.getRevision()&&(this.maxDelta_=Math.sqrt(sa(this.flatCoordinates,0,this.ends_,this.stride,0)),this.maxDeltaRevision_=this.getRevision()),ua(this.flatCoordinates,0,this.ends_,this.stride,this.maxDelta_,!1,t,e,i,o))},e.prototype.getCoordinateAtM=function(t,e,i){if(this.layout!=Yr&&this.layout!=Zr||0===this.flatCoordinates.length)return null;var o=void 0!==e&&e,n=void 0!==i&&i;return function(t,e,i,o,n,r,a){if(a)return ks(t,e,i[i.length-1],o,n,r);var s;if(n<t[o-1])return r?((s=t.slice(0,o))[o-1]=n,s):null;if(t[t.length-1]<n)return r?((s=t.slice(t.length-o))[o-1]=n,s):null;for(var l=0,u=i.length;l<u;++l){var p=i[l];if(e!=p){if(n<t[e+o-1])return null;if(n<=t[p-1])return ks(t,e,p,o,n,!1);e=p}}return null}(this.flatCoordinates,0,this.ends_,this.stride,t,o,n)},e.prototype.getCoordinates=function(){return ya(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 Cs(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,o=[],n=0,r=0,a=e.length;r<a;++r){var s=e[r],l=new Cs(t.slice(n,s),i);o.push(l),n=s}return o},e.prototype.getFlatMidpoints=function(){for(var t=[],e=this.flatCoordinates,i=0,o=this.ends_,n=this.stride,r=0,a=o.length;r<a;++r){var s=o[r];gt(t,xs(e,i,s,n,.5)),i=s}return t},e.prototype.getSimplifiedGeometryInternal=function(t){var i=[],o=[];return i.length=function(t,e,i,o,n,r,a,s){for(var l=0,u=i.length;l<u;++l){var p=i[l];a=ca(t,e,p,o,n,r,a),s.push(a),e=p}return a}(this.flatCoordinates,0,this.ends_,this.stride,t,i,0,o),new e(i,Xr,o)},e.prototype.getType=function(){return Fo},e.prototype.intersectsExtent=function(t){return function(t,e,i,o,n){for(var r=0,a=i.length;r<a;++r){if(Ra(t,e,i[r],o,n))return!0;e=i[r]}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=ha(this.flatCoordinates,0,t,this.stride,this.ends_);this.flatCoordinates.length=0===i.length?0:i[i.length-1],this.changed()},e}(na),Es=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 o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}(),Ps=function(t){function e(e,i){var o=t.call(this)||this;return i&&!Array.isArray(e[0])?o.setFlatCoordinates(i,e):o.setCoordinates(e,i),o}return Es(e,t),e.prototype.appendPoint=function(t){this.flatCoordinates?gt(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,o){if(o<Ji(this.getExtent(),t,e))return o;for(var n=this.flatCoordinates,r=this.stride,a=0,s=n.length;a<s;a+=r){var l=De(t,e,n[a],n[a+1]);if(l<o){o=l;for(var u=0;u<r;++u)i[u]=n[a+u];i.length=r}}return o},e.prototype.getCoordinates=function(){return va(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 Ca(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,o=[],n=0,r=t.length;n<r;n+=i){var a=new Ca(t.slice(n,n+i),e);o.push(a)}return o},e.prototype.getType=function(){return Io},e.prototype.intersectsExtent=function(t){for(var e=this.flatCoordinates,i=this.stride,o=0,n=e.length;o<n;o+=i){if(eo(t,e[o],e[o+1]))return!0}return!1},e.prototype.setCoordinates=function(t,e){this.setLayout(e,t,1),this.flatCoordinates||(this.flatCoordinates=[]),this.flatCoordinates.length=da(this.flatCoordinates,0,t,this.stride),this.changed()},e}(na);function Os(t,e,i,o){for(var n=[],r=[1/0,1/0,-1/0,-1/0],a=0,s=i.length;a<s;++a){var l=i[a];r=so(t,e,l[0],o),n.push((r[0]+r[2])/2,(r[1]+r[3])/2),e=l[l.length-1]}return n}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 o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}(),Rs=function(t){function e(e,i,o){var n=t.call(this)||this;if(n.endss_=[],n.flatInteriorPointsRevision_=-1,n.flatInteriorPoints_=null,n.maxDelta_=-1,n.maxDeltaRevision_=-1,n.orientedRevision_=-1,n.orientedFlatCoordinates_=null,!o&&!Array.isArray(e[0])){for(var r=n.getLayout(),a=e,s=[],l=[],u=0,p=a.length;u<p;++u){var d=a[u];0===u&&(r=d.getLayout());for(var h=s.length,c=d.getEnds(),f=0,g=c.length;f<g;++f)c[f]+=h;gt(s,d.getFlatCoordinates()),l.push(c)}i=r,e=s,o=l}return void 0!==i&&o?(n.setFlatCoordinates(i,e),n.endss_=o):n.setCoordinates(e,i),n}return js(e,t),e.prototype.appendPolygon=function(t){var e;if(this.flatCoordinates){var i=this.flatCoordinates.length;gt(this.flatCoordinates,t.getFlatCoordinates());for(var o=0,n=(e=t.getEnds().slice()).length;o<n;++o)e[o]+=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),o=0;o<t;++o)i[o]=this.endss_[o].slice();var n=new e(this.flatCoordinates.slice(),this.layout,i);return n.applyProperties(this),n},e.prototype.closestPointXY=function(t,e,i,o){return o<Ji(this.getExtent(),t,e)?o:(this.maxDeltaRevision_!=this.getRevision()&&(this.maxDelta_=Math.sqrt(function(t,e,i,o,n){for(var r=0,a=i.length;r<a;++r){var s=i[r];n=sa(t,e,s,o,n),e=s[s.length-1]}return n}(this.flatCoordinates,0,this.endss_,this.stride,0)),this.maxDeltaRevision_=this.getRevision()),function(t,e,i,o,n,r,a,s,l,u,p){for(var d=p||[NaN,NaN],h=0,c=i.length;h<c;++h){var f=i[h];u=ua(t,e,f,o,n,r,a,s,l,u,d),e=f[f.length-1]}return u}(this.getOrientedFlatCoordinates(),0,this.endss_,this.stride,this.maxDelta_,!0,t,e,i,o))},e.prototype.containsXY=function(t,e){return function(t,e,i,o,n,r){if(0===i.length)return!1;for(var a=0,s=i.length;a<s;++a){var l=i[a];if(Ea(t,e,l,o,n,r))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,o){for(var n=0,r=0,a=i.length;r<a;++r){var s=i[r];n+=xa(t,e,s,o),e=s[s.length-1]}return n}(this.getOrientedFlatCoordinates(),0,this.endss_,this.stride)},e.prototype.getCoordinates=function(t){var e;return void 0!==t?La(e=this.getOrientedFlatCoordinates().slice(),0,this.endss_,this.stride,t):e=this.flatCoordinates,_a(e,0,this.endss_,this.stride)},e.prototype.getEndss=function(){return this.endss_},e.prototype.getFlatInteriorPoints=function(){if(this.flatInteriorPointsRevision_!=this.getRevision()){var t=Os(this.flatCoordinates,0,this.endss_,this.stride);this.flatInteriorPoints_=Oa(this.getOrientedFlatCoordinates(),0,this.endss_,this.stride,t),this.flatInteriorPointsRevision_=this.getRevision()}return this.flatInteriorPoints_},e.prototype.getInteriorPoints=function(){return new Ps(this.getFlatInteriorPoints().slice(),Yr)},e.prototype.getOrientedFlatCoordinates=function(){if(this.orientedRevision_!=this.getRevision()){var t=this.flatCoordinates;!function(t,e,i,o,n){for(var r=0,a=i.length;r<a;++r){var s=i[r];if(!Aa(t,e,s,o,n))return!1;s.length&&(e=s[s.length-1])}return!0}(t,0,this.endss_,this.stride)?(this.orientedFlatCoordinates_=t.slice(),this.orientedFlatCoordinates_.length=La(this.orientedFlatCoordinates_,0,this.endss_,this.stride)):this.orientedFlatCoordinates_=t,this.orientedRevision_=this.getRevision()}return this.orientedFlatCoordinates_},e.prototype.getSimplifiedGeometryInternal=function(t){var i=[],o=[];return i.length=function(t,e,i,o,n,r,a,s){for(var l=0,u=i.length;l<u;++l){var p=i[l],d=[];a=ma(t,e,p,o,n,r,a,d),s.push(d),e=p[p.length-1]}return a}(this.flatCoordinates,0,this.endss_,this.stride,Math.sqrt(t),i,0,o),new e(i,Xr,o)},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 o=this.endss_[t].slice(),n=o[o.length-1];if(0!==e)for(var r=0,a=o.length;r<a;++r)o[r]-=e;return new Ba(this.flatCoordinates.slice(e,n),this.layout,o)},e.prototype.getPolygons=function(){for(var t=this.layout,e=this.flatCoordinates,i=this.endss_,o=[],n=0,r=0,a=i.length;r<a;++r){var s=i[r].slice(),l=s[s.length-1];if(0!==n)for(var u=0,p=s.length;u<p;++u)s[u]-=n;var d=new Ba(e.slice(n,l),t,s);o.push(d),n=l}return o},e.prototype.getType=function(){return Mo},e.prototype.intersectsExtent=function(t){return function(t,e,i,o,n){for(var r=0,a=i.length;r<a;++r){var s=i[r];if(Ia(t,e,s,o,n))return!0;e=s[s.length-1]}return!1}(this.getOrientedFlatCoordinates(),0,this.endss_,this.stride,t)},e.prototype.setCoordinates=function(t,e){this.setLayout(e,t,3),this.flatCoordinates||(this.flatCoordinates=[]);var i=function(t,e,i,o,n){for(var r=n||[],a=0,s=0,l=i.length;s<l;++s){var u=ha(t,e,i[s],o,r[a]);r[a++]=u,e=u[u.length-1]}return r.length=a,r}(this.flatCoordinates,0,t,this.stride,this.endss_);if(0===i.length)this.flatCoordinates.length=0;else{var o=i[i.length-1];this.flatCoordinates.length=0===o.length?0:o[o.length-1]}this.changed()},e}(na),Is=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 o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}();function Fs(t){for(var e=[],i=0,o=t.length;i<o;++i)e.push(t[i].clone());return e}var Ms=function(t){function e(e){var i=t.call(this)||this;return i.geometries_=e||null,i.changeEventsKeys_=[],i.listenGeometriesChange_(),i}return Is(e,t),e.prototype.unlistenGeometriesChange_=function(){this.changeEventsKeys_.forEach(Bt),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(Gt(this.geometries_[t],Tt,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,o){if(o<Ji(this.getExtent(),t,e))return o;for(var n=this.geometries_,r=0,a=n.length;r<a;++r)o=n[r].closestPointXY(t,e,i,o);return o},e.prototype.containsXY=function(t,e){for(var i=this.geometries_,o=0,n=i.length;o<n;++o)if(i[o].containsXY(t,e))return!0;return!1},e.prototype.computeExtent=function(t){ro(t);for(var e=this.geometries_,i=0,o=e.length;i<o;++i)uo(t,e[i].getExtent());return t},e.prototype.getGeometries=function(){return Fs(this.geometries_)},e.prototype.getGeometriesArray=function(){return this.geometries_},e.prototype.getGeometriesArrayRecursive=function(){for(var t=[],e=this.geometries_,i=0,o=e.length;i<o;++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=[],o=this.geometries_,n=!1,r=0,a=o.length;r<a;++r){var s=o[r],l=s.getSimplifiedGeometry(t);i.push(l),l!==s&&(n=!0)}if(n){var u=new e(null);return u.setGeometriesArray(i),u}return this.simplifiedGeometryMaxMinSquaredTolerance=t,this},e.prototype.getType=function(){return Ao},e.prototype.intersectsExtent=function(t){for(var e=this.geometries_,i=0,o=e.length;i<o;++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_,o=0,n=i.length;o<n;++o)i[o].rotate(t,e);this.changed()},e.prototype.scale=function(t,e,i){var o=i;o||(o=yo(this.getExtent()));for(var n=this.geometries_,r=0,a=n.length;r<a;++r)n[r].scale(t,e,o);this.changed()},e.prototype.setGeometries=function(t){this.setGeometriesArray(Fs(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,o=e.length;i<o;++i)e[i].applyTransform(t);this.changed()},e.prototype.translate=function(t,e){for(var i=this.geometries_,o=0,n=i.length;o<n;++o)i[o].translate(t,e);this.changed()},e.prototype.disposeInternal=function(){this.unlistenGeometriesChange_(),t.prototype.disposeInternal.call(this)},e}(ea),As=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 o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}();function Ds(t,e){if(!t)return null;var i;switch(t.type){case Po:i=function(t){return new Ca(t.coordinates)}(t);break;case Oo:i=function(t){return new Cs(t.coordinates)}(t);break;case Ro:i=function(t){return new Ba(t.coordinates)}(t);break;case Io:i=function(t){return new Ps(t.coordinates)}(t);break;case Fo:i=function(t){return new Ts(t.coordinates)}(t);break;case Mo:i=function(t){return new Rs(t.coordinates)}(t);break;case Ao:i=function(t,e){var i=t.geometries.map((function(t){return Ds(t,e)}));return new Ms(i)}(t);break;default:throw new Error("Unsupported GeoJSON type: "+t.type)}return cs(i,!1,e)}function Ls(t,e){var i,o=(t=cs(t,!0,e)).getType();switch(o){case Po:i=function(t,e){return{type:"Point",coordinates:t.getCoordinates()}}(t);break;case Oo:i=function(t,e){return{type:"LineString",coordinates:t.getCoordinates()}}(t);break;case Ro:i=function(t,e){var i;e&&(i=e.rightHanded);return{type:"Polygon",coordinates:t.getCoordinates(i)}}(t,e);break;case Io:i=function(t,e){return{type:"MultiPoint",coordinates:t.getCoordinates()}}(t);break;case Fo:i=function(t,e){return{type:"MultiLineString",coordinates:t.getCoordinates()}}(t);break;case Mo:i=function(t,e){var i;e&&(i=e.rightHanded);return{type:"MultiPolygon",coordinates:t.getCoordinates(i)}}(t,e);break;case Ao:i=function(t,e){return{type:"GeometryCollection",geometries:t.getGeometriesArray().map((function(t){var i=bt({},e);return delete i.featureProjection,Ls(t,i)}))}}(t,e);break;case Do:i={type:"GeometryCollection",geometries:[]};break;default:throw new Error("Unsupported geometry type: "+o)}return i}var Gs=function(t){function e(e){var i=this,o=e||{};return(i=t.call(this)||this).dataProjection=Jo(o.dataProjection?o.dataProjection:"EPSG:4326"),o.featureProjection&&(i.defaultFeatureProjection=Jo(o.featureProjection)),i.geometryName_=o.geometryName,i.extractGeometryName_=o.extractGeometryName,i.supportedMediaTypes=["application/geo+json","application/vnd.geo+json"],i}return As(e,t),e.prototype.readFeatureFromObject=function(t,e){var i=null,o=Ds((i="Feature"===t.type?t:{type:"Feature",geometry:t,properties:null}).geometry,e),n=new ds;return this.geometryName_?n.setGeometryName(this.geometryName_):this.extractGeometryName_&&"geometry_name"in i!==void 0&&n.setGeometryName(i.geometry_name),n.setGeometry(o),"id"in i&&n.setId(i.id),i.properties&&n.setProperties(i.properties,!0),n},e.prototype.readFeaturesFromObject=function(t,e){var i=null;if("FeatureCollection"===t.type){i=[];for(var o=t.features,n=0,r=o.length;n<r;++n)i.push(this.readFeatureFromObject(o[n],e))}else i=[this.readFeatureFromObject(t,e)];return i},e.prototype.readGeometryFromObject=function(t,e){return Ds(t,e)},e.prototype.readProjectionFromObject=function(t){var e,i=t.crs;return i?"name"==i.type?e=Jo(i.properties.name):"EPSG"===i.type?e=Jo("EPSG:"+i.properties.code):Re(!1,36):e=this.dataProjection,e},e.prototype.writeFeatureObject=function(t,e){e=this.adaptOptions(e);var i={type:"Feature",geometry:null,properties:null},o=t.getId();if(void 0!==o&&(i.id=o),!t.hasProperties())return i;var n=t.getProperties(),r=t.getGeometry();return r&&(i.geometry=Ls(r,e),delete n[t.getGeometryName()]),wt(n)||(i.properties=n),i},e.prototype.writeFeaturesObject=function(t,e){e=this.adaptOptions(e);for(var i=[],o=0,n=t.length;o<n;++o)i.push(this.writeFeatureObject(t[o],e));return{type:"FeatureCollection",features:i}},e.prototype.writeGeometryObject=function(t,e){return Ls(t,this.adaptOptions(e))},e}(bs),Ns=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}(),Bs="fraction",qs="pixels",Ws="bottom-left",Vs="bottom-right",Us="top-left",Xs="top-right",Ks=0,Ys=1,Zs=2,Hs=3,$s=function(){function t(t){this.opacity_=t.opacity,this.rotateWithView_=t.rotateWithView,this.rotation_=t.rotation,this.scale_=t.scale,this.scaleArray_=Ha(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 Ut()},t.prototype.getImage=function(t){return Ut()},t.prototype.getHitDetectionImage=function(){return Ut()},t.prototype.getPixelRatio=function(t){return 1},t.prototype.getImageState=function(){return Ut()},t.prototype.getImageSize=function(){return Ut()},t.prototype.getOrigin=function(){return Ut()},t.prototype.getSize=function(){return Ut()},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_=Ha(t)},t.prototype.listenImageChange=function(t){Ut()},t.prototype.load=function(){Ut()},t.prototype.unlistenImageChange=function(t){Ut()},t}(),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 o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}(),Qs=function(t){function e(e,i,o,n){var r=t.call(this)||this;return r.extent=e,r.pixelRatio_=o,r.resolution=i,r.state=n,r}return Js(e,t),e.prototype.changed=function(){this.dispatchEvent(Tt)},e.prototype.getExtent=function(){return this.extent},e.prototype.getImage=function(){return Ut()},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(){Ut()},e}(zt),tl=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 o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}();function el(t,e,i){var o=t;if(o.src&&ae){var n=o.decode(),r=!0;return n.then((function(){r&&e()})).catch((function(t){r&&("EncodingError"===t.name&&"Invalid image type."===t.message?e():i())})),function(){r=!1}}var a=[Nt(o,Mt,e),Nt(o,Et,i)];return function(){a.forEach(Bt)}}!function(t){function e(e,i,o,n,r,a){var s=t.call(this,e,i,o,Ks)||this;return s.src_=n,s.image_=new Image,null!==r&&(s.image_.crossOrigin=r),s.unlisten_=null,s.state=Ks,s.imageLoadFunction_=a,s}tl(e,t),e.prototype.getImage=function(){return this.image_},e.prototype.handleImageError_=function(){this.state=Hs,this.unlistenImage_(),this.changed()},e.prototype.handleImageLoad_=function(){void 0===this.resolution&&(this.resolution=xo(this.extent)/this.image_.height),this.state=Zs,this.unlistenImage_(),this.changed()},e.prototype.load=function(){this.state!=Ks&&this.state!=Hs||(this.state=Ys,this.changed(),this.imageLoadFunction_(this,this.src_),this.unlisten_=el(this.image_,this.handleImageLoad_.bind(this),this.handleImageError_.bind(this)))},e.prototype.setImage=function(t){this.image_=t,this.resolution=xo(this.extent)/this.image_.height},e.prototype.unlistenImage_=function(){this.unlisten_&&(this.unlisten_(),this.unlisten_=null)}}(Qs);var 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 o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}(),ol=null,nl=function(t){function e(e,i,o,n,r,a){var s=t.call(this)||this;return s.hitDetectionImage_=null,s.image_=e||new Image,null!==n&&(s.image_.crossOrigin=n),s.canvas_={},s.color_=a,s.unlisten_=null,s.imageState_=r,s.size_=o,s.src_=i,s.tainted_,s}return il(e,t),e.prototype.isTainted_=function(){if(void 0===this.tainted_&&this.imageState_===Zs){ol||(ol=le(1,1)),ol.drawImage(this.image_,0,0);try{ol.getImageData(0,0,1,1),this.tainted_=!1}catch(t){ol=null,this.tainted_=!0}}return!0===this.tainted_},e.prototype.dispatchChangeEvent_=function(){this.dispatchEvent(Tt)},e.prototype.handleImageError_=function(){this.imageState_=Hs,this.unlistenImage_(),this.dispatchChangeEvent_()},e.prototype.handleImageLoad_=function(){this.imageState_=Zs,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=le(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_==Ks){this.imageState_=Ys;try{this.image_.src=this.src_}catch(t){this.handleImageError_()}this.unlisten_=el(this.image_,this.handleImageLoad_.bind(this),this.handleImageError_.bind(this))}},e.prototype.replaceColor_=function(t){if(this.color_&&!this.canvas_[t]&&this.imageState_===Zs){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=Tn(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 o=i.getImageData(0,0,e.width,e.height),n=o.data,r=this.color_[0]/255,a=this.color_[1]/255,s=this.color_[2]/255,l=this.color_[3],u=0,p=n.length;u<p;u+=4)n[u]*=r,n[u+1]*=a,n[u+2]*=s,n[u+3]*=l;i.putImageData(o,0,0)}}},e.prototype.unlistenImage_=function(){this.unlisten_&&(this.unlisten_(),this.unlisten_=null)},e}(zt);var rl=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 o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}(),al=function(t){function e(e){var i=this,o=e||{},n=void 0!==o.opacity?o.opacity:1,r=void 0!==o.rotation?o.rotation:0,a=void 0!==o.scale?o.scale:1,s=void 0!==o.rotateWithView&&o.rotateWithView;(i=t.call(this,{opacity:n,rotation:r,scale:a,displacement:void 0!==o.displacement?o.displacement:[0,0],rotateWithView:s})||this).anchor_=void 0!==o.anchor?o.anchor:[.5,.5],i.normalizedAnchor_=null,i.anchorOrigin_=void 0!==o.anchorOrigin?o.anchorOrigin:Us,i.anchorXUnits_=void 0!==o.anchorXUnits?o.anchorXUnits:Bs,i.anchorYUnits_=void 0!==o.anchorYUnits?o.anchorYUnits:Bs,i.crossOrigin_=void 0!==o.crossOrigin?o.crossOrigin:null;var l=void 0!==o.img?o.img:null,u=void 0!==o.imgSize?o.imgSize:null,p=o.src;Re(!(void 0!==p&&l),4),Re(!l||l&&u,5),void 0!==p&&0!==p.length||!l||(p=l.src||Kt(l)),Re(void 0!==p&&p.length>0,6);var d=void 0!==o.src?Ks:Zs;return i.color_=void 0!==o.color?jn(o.color):null,i.iconImage_=function(t,e,i,o,n,r){var a=Mn.get(e,o,r);return a||(a=new nl(t,e,i,o,n,r),Mn.set(e,o,r,a)),a}(l,p,u,i.crossOrigin_,d,i.color_),i.offset_=void 0!==o.offset?o.offset:[0,0],i.offsetOrigin_=void 0!==o.offsetOrigin?o.offsetOrigin:Us,i.origin_=null,i.size_=void 0!==o.size?o.size:null,i}return rl(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_==Bs||this.anchorYUnits_==Bs){if(!e)return null;t=this.anchor_.slice(),this.anchorXUnits_==Bs&&(t[0]*=e[0]),this.anchorYUnits_==Bs&&(t[1]*=e[1])}if(this.anchorOrigin_!=Us){if(!e)return null;t===this.anchor_&&(t=this.anchor_.slice()),this.anchorOrigin_!=Xs&&this.anchorOrigin_!=Vs||(t[0]=-t[0]+e[0]),this.anchorOrigin_!=Ws&&this.anchorOrigin_!=Vs||(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_!=Us){var e=this.getSize(),i=this.iconImage_.getSize();if(!e||!i)return null;t=t.slice(),this.offsetOrigin_!=Xs&&this.offsetOrigin_!=Vs||(t[0]=i[0]-e[0]-t[0]),this.offsetOrigin_!=Ws&&this.offsetOrigin_!=Vs||(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(Tt,t)},e.prototype.load=function(){this.iconImage_.load()},e.prototype.unlistenImageChange=function(t){this.iconImage_.removeEventListener(Tt,t)},e}($s),sl=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 ll(t){return Array.isArray(t)?In(t):t}var 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 o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}(),pl=function(t){function e(e){var i=this,o=void 0!==e.rotateWithView&&e.rotateWithView;return(i=t.call(this,{opacity:1,rotateWithView:o,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 ul(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_,o=le(i.size*t,i.size*t);this.draw_(i,o,t),e=o.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 Zs},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 o=this.radius_,n=void 0===this.radius2_?o:this.radius2_;if(o<n){var r=o;o=n,n=r}var a=void 0===this.radius2_?this.points_:2*this.points_,s=2*Math.PI/a,l=n*Math.sin(s),u=o-Math.sqrt(n*n-l*l),p=Math.sqrt(l*l+u*u),d=p/l;if("miter"===t&&d<=i)return d*e;var h=e/2/d,c=e/2*(u/p),f=Math.sqrt((o+h)*(o+h)+c*c)-o;if(void 0===this.radius2_||"bevel"===t)return 2*f;var g=o*Math.sin(s),m=n-Math.sqrt(o*o-g*g),v=Math.sqrt(g*g+m*m)/g;if(v<=i){var y=v*e/2-n-o;return 2*Math.max(f,y)}return 2*f},e.prototype.createRenderOptions=function(){var t,e=Un,i=0,o=null,n=0,r=0;this.stroke_&&(null===(t=this.stroke_.getColor())&&(t=Xn),t=ll(t),void 0===(r=this.stroke_.getWidth())&&(r=1),o=this.stroke_.getLineDash(),n=this.stroke_.getLineDashOffset(),void 0===(e=this.stroke_.getLineJoin())&&(e=Un),void 0===(i=this.stroke_.getMiterLimit())&&(i=10));var a=this.calculateLineJoinSize_(e,r,i),s=Math.max(this.radius_,this.radius2_||0);return{strokeStyle:t,strokeWidth:r,size:Math.ceil(2*s+a),lineDash:o,lineDashOffset:n,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 o=this.fill_.getColor();null===o&&(o=qn),e.fillStyle=ll(o),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=jn(e)),null===e?i=1:Array.isArray(e)&&(i=4===e.length?e[3]:1),0===i){var o=le(t.size,t.size);this.hitDetectionCanvas_=o.canvas,this.drawHitDetectionCanvas_(t,o)}}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 o=void 0===this.radius2_?i:this.radius2_;void 0!==this.radius2_&&(e*=2);for(var n=this.angle_-Math.PI/2,r=2*Math.PI/e,a=0;a<e;a++){var s=n+a*r,l=a%2==0?i:o;t.lineTo(l*Math.cos(s),l*Math.sin(s))}t.closePath()}},e.prototype.drawHitDetectionCanvas_=function(t,e){e.translate(t.size/2,t.size/2),this.createPath_(e),e.fillStyle=qn,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}($s),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 o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}(),hl=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 dl(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}(pl),cl=function(){function t(t){var e=t||{};this.geometry_=null,this.geometryFunction_=vl,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_=vl,this.geometry_=t},t.prototype.setZIndex=function(t){this.zIndex_=t},t}();var fl=null;function gl(t,e){if(!fl){var i=new Ns({color:"rgba(255,255,255,0.4)"}),o=new sl({color:"#3399CC",width:1.25});fl=[new cl({image:new hl({fill:i,stroke:o,radius:5}),fill:i,stroke:o})]}return fl}function ml(){var t={},e=[255,255,255,1],i=[0,153,255,1];return t[Ro]=[new cl({fill:new Ns({color:[255,255,255,.5]})})],t[Mo]=t[Ro],t[Oo]=[new cl({stroke:new sl({color:e,width:5})}),new cl({stroke:new sl({color:i,width:3})})],t[Fo]=t[Oo],t[Do]=t[Ro].concat(t[Oo]),t[Po]=[new cl({image:new hl({radius:6,fill:new Ns({color:i}),stroke:new sl({color:e,width:1.5})}),zIndex:1/0})],t[Io]=t[Po],t[Ao]=t[Ro].concat(t[Oo],t[Po]),t}function vl(t){return t.getGeometry()}var yl=cl,_l="point",bl="line",xl=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_=Ha(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 Ns({color:"#333"}),this.maxAngle_=void 0!==e.maxAngle?e.maxAngle:Math.PI/4,this.placement_=void 0!==e.placement?e.placement:_l,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_=Ha(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}();function kl(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var wl={
|
33
|
+
*/function lt(t){return st(__spreadProps(__spreadValues({},t),{state:!0,attribute:!1}))}var ut=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}(),pt="propertychange",dt=function(){function t(){this.disposed=!1}return t.prototype.dispose=function(){this.disposed||(this.disposed=!0,this.disposeInternal())},t.prototype.disposeInternal=function(){},t}();function ht(t,e){return t>e?1:t<e?-1:0}function ct(t,e,i){var o=t.length;if(t[0]<=e)return 0;if(e<=t[o-1])return o-1;var n=void 0;if(i>0){for(n=1;n<o;++n)if(t[n]<e)return n-1}else if(i<0){for(n=1;n<o;++n)if(t[n]<=e)return n}else for(n=1;n<o;++n){if(t[n]==e)return n;if(t[n]<e)return"function"==typeof i?i(e,t[n-1],t[n])>0?n-1:n:t[n-1]-e<e-t[n]?n-1:n}return o-1}function ft(t,e,i){for(;e<i;){var o=t[e];t[e]=t[i],t[i]=o,++e,--i}}function gt(t,e){for(var i=Array.isArray(e)?e:[e],o=i.length,n=0;n<o;n++)t[t.length]=i[n]}function mt(t,e){var i=t.length;if(i!==e.length)return!1;for(var o=0;o<i;o++)if(t[o]!==e[o])return!1;return!0}function vt(){return!0}function yt(){return!1}function _t(){}var bt="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),o=1,n=arguments.length;o<n;++o){var r=arguments[o];if(null!=r)for(var a in r)r.hasOwnProperty(a)&&(i[a]=r[a])}return i};function xt(t){for(var e in t)delete t[e]}var kt="function"==typeof Object.values?Object.values:function(t){var e=[];for(var i in t)e.push(t[i]);return e};function wt(t){var e;for(e in t)return!1;return!e}var St,Ct=(St=function(t,e){return(St=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}St(t,e),t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)}),zt=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 Ct(e,t),e.prototype.addEventListener=function(t,e){if(t&&e){var i=this.listeners_||(this.listeners_={}),o=i[t]||(i[t]=[]);-1===o.indexOf(e)&&o.push(e)}},e.prototype.dispatchEvent=function(t){var e="string"==typeof t?new ut(t):t,i=e.type;e.target||(e.target=this.eventTarget_||this);var o,n=this.listeners_&&this.listeners_[i];if(n){var r=this.dispatching_||(this.dispatching_={}),a=this.pendingRemovals_||(this.pendingRemovals_={});i in r||(r[i]=0,a[i]=0),++r[i];for(var s=0,l=n.length;s<l;++s)if(!1===(o="handleEvent"in n[s]?n[s].handleEvent(e):n[s].call(this,e))||e.propagationStopped){o=!1;break}if(--r[i],0===r[i]){var u=a[i];for(delete a[i];u--;)this.removeEventListener(i,_t);delete r[i]}return o}},e.prototype.disposeInternal=function(){this.listeners_&&xt(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 o=i.indexOf(e);-1!==o&&(this.pendingRemovals_&&t in this.pendingRemovals_?(i[o]=_t,++this.pendingRemovals_[t]):(i.splice(o,1),0===i.length&&delete this.listeners_[t]))}},e}(dt),Tt="change",Et="error",Pt="clear",Ot="contextmenu",jt="click",Rt="dblclick",It="keydown",Ft="keypress",Mt="load",At="resize",Dt="touchmove",Lt="wheel";function Gt(t,e,i,o,n){if(o&&o!==t&&(i=i.bind(o)),n){var r=i;i=function(){t.removeEventListener(e,i),r.apply(this,arguments)}}var a={target:t,type:e,listener:i};return t.addEventListener(e,i),a}function Nt(t,e,i,o){return Gt(t,e,i,o,!0)}function Bt(t){t&&t.target&&(t.target.removeEventListener(t.type,t.listener),xt(t))}var qt=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 o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}(),Wt=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 qt(e,t),e.prototype.changed=function(){++this.revision_,this.dispatchEvent(Tt)},e.prototype.getRevision=function(){return this.revision_},e.prototype.onInternal=function(t,e){if(Array.isArray(t)){for(var i=t.length,o=new Array(i),n=0;n<i;++n)o[n]=Gt(this,t[n],e);return o}return Gt(this,t,e)},e.prototype.onceInternal=function(t,e){var i;if(Array.isArray(t)){var o=t.length;i=new Array(o);for(var n=0;n<o;++n)i[n]=Nt(this,t[n],e)}else i=Nt(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)Bt(t[e]);else Bt(t)}(i);else if(Array.isArray(t))for(var o=0,n=t.length;o<n;++o)this.removeEventListener(t[o],e);else this.removeEventListener(t,e)},e}(zt);Wt.prototype.on,Wt.prototype.once,Wt.prototype.un;var Vt=Wt;function Ut(){return function(){throw new Error("Unimplemented abstract method.")}()}var Xt=0;function Kt(t){return t.ol_uid||(t.ol_uid=String(++Xt))}var Yt=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 o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}(),Zt=function(t){function e(e,i,o){var n=t.call(this,e)||this;return n.key=i,n.oldValue=o,n}return Yt(e,t),e}(ut),$t=function(t){function e(e){var i=t.call(this)||this;return i.on,i.once,i.un,Kt(i),i.values_=null,void 0!==e&&i.setProperties(e),i}return Yt(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_&&bt({},this.values_)||{}},e.prototype.hasProperties=function(){return!!this.values_},e.prototype.notify=function(t,e){var i;i="change:"+t,this.dispatchEvent(new Zt(i,t,e)),i=pt,this.dispatchEvent(new Zt(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 o=this.values_||(this.values_={});if(i)o[t]=e;else{var n=o[t];o[t]=e,n!==e&&this.notify(t,n)}},e.prototype.setProperties=function(t,e){for(var i in t)this.set(i,t[i],e)},e.prototype.applyProperties=function(t){t.values_&&bt(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],wt(this.values_)&&(this.values_=null),e||this.notify(t,i)}},e}(Vt),Ht="postrender",Jt="movestart",Qt="moveend",te="undefined"!=typeof navigator&&void 0!==navigator.userAgent?navigator.userAgent.toLowerCase():"",ee=-1!==te.indexOf("firefox");-1!==te.indexOf("safari")&&te.indexOf("chrom");var ie=-1!==te.indexOf("webkit")&&-1==te.indexOf("edge"),oe=-1!==te.indexOf("macintosh"),ne="undefined"!=typeof devicePixelRatio?devicePixelRatio:1,re="undefined"!=typeof WorkerGlobalScope&&"undefined"!=typeof OffscreenCanvas&&self instanceof WorkerGlobalScope,ae="undefined"!=typeof Image&&Image.prototype.decode,se=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 le(t,e,i,o){var n;return i&&i.length?n=i.shift():re?n=new OffscreenCanvas(t||300,e||300):(n=document.createElement("canvas")).style.all="unset",t&&(n.width=t),e&&(n.height=e),n.getContext("2d",o)}function ue(t,e){var i=e.parentNode;i&&i.replaceChild(t,e)}function pe(t){return t&&t.parentNode?t.parentNode.removeChild(t):null}var de=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 o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}(),he=function(t){function e(e){var i=t.call(this)||this,o=e.element;return!o||e.target||o.style.pointerEvents||(o.style.pointerEvents="auto"),i.element=o||null,i.target_=null,i.map_=null,i.listenerKeys=[],e.render&&(i.render=e.render),e.target&&i.setTarget(e.target),i}return de(e,t),e.prototype.disposeInternal=function(){pe(this.element),t.prototype.disposeInternal.call(this)},e.prototype.getMap=function(){return this.map_},e.prototype.setMap=function(t){this.map_&&pe(this.element);for(var e=0,i=this.listenerKeys.length;e<i;++e)Bt(this.listenerKeys[e]);(this.listenerKeys.length=0,this.map_=t,this.map_)&&((this.target_?this.target_:t.getOverlayContainerStopEvent()).appendChild(this.element),this.render!==_t&&this.listenerKeys.push(Gt(t,Ht,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}($t),ce="ol-hidden",fe="ol-unselectable",ge="ol-control",me="ol-collapsed",ve=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"),ye=["style","variant","weight","size","lineHeight","family"],_e=function(t){var e=t.match(ve);if(!e)return null;for(var i={lineHeight:"normal",size:"1.2em",style:"normal",weight:"normal",variant:"normal"},o=0,n=ye.length;o<n;++o){var r=e[o+1];void 0!==r&&(i[ye[o]]=r)}return i.families=i.family.split(/,\s?/),i};function be(t){return 1===t?"":String(Math.round(100*t)/100)}var xe="opacity",ke="visible",we="extent",Se="zIndex",Ce="maxResolution",ze="minResolution",Te="maxZoom",Ee="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 o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}(),je=function(t){function e(e){var i=this,o="Assertion failed. See https://openlayers.org/en/"+("v"+"6.9.0".split("-")[0])+"/doc/errors/#"+e+" for details.";return(i=t.call(this,o)||this).code=e,i.name="AssertionError",i.message=o,i}return Oe(e,t),e}(Error);function Re(t,e){if(!t)throw new je(e)}function Ie(t,e,i){return Math.min(Math.max(t,e),i)}var Fe="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,o,n,r){var a=n-i,s=r-o;if(0!==a||0!==s){var l=((t-i)*a+(e-o)*s)/(a*a+s*s);l>1?(i=n,o=r):l>0&&(i+=a*l,o+=s*l)}return De(t,e,i,o)}function De(t,e,i,o){var n=i-t,r=o-e;return n*n+r*r}function Le(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 o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}(),qe=function(t){function e(e){var i=t.call(this)||this;i.on,i.once,i.un;var o=bt({},e);return"object"==typeof e.properties&&(delete o.properties,bt(o,e.properties)),o[xe]=void 0!==e.opacity?e.opacity:1,Re("number"==typeof o[xe],64),o[ke]=void 0===e.visible||e.visible,o[Se]=e.zIndex,o[Ce]=void 0!==e.maxResolution?e.maxResolution:1/0,o[ze]=void 0!==e.minResolution?e.minResolution:0,o[Ee]=void 0!==e.minZoom?e.minZoom:-1/0,o[Te]=void 0!==e.maxZoom?e.maxZoom:1/0,i.className_=void 0!==o.className?e.className:"ol-layer",delete o.className,i.setProperties(o),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=Ie(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 Ut()},e.prototype.getLayerStatesArray=function(t){return Ut()},e.prototype.getExtent=function(){return this.get(we)},e.prototype.getMaxResolution=function(){return this.get(Ce)},e.prototype.getMinResolution=function(){return this.get(ze)},e.prototype.getMinZoom=function(){return this.get(Ee)},e.prototype.getMaxZoom=function(){return this.get(Te)},e.prototype.getOpacity=function(){return this.get(xe)},e.prototype.getSourceState=function(){return Ut()},e.prototype.getVisible=function(){return this.get(ke)},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(ze,t)},e.prototype.setMaxZoom=function(t){this.set(Te,t)},e.prototype.setMinZoom=function(t){this.set(Ee,t)},e.prototype.setOpacity=function(t){Re("number"==typeof t,64),this.set(xe,t)},e.prototype.setVisible=function(t){this.set(ke,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}($t),We="prerender",Ve="postrender",Ue="precompose",Xe="postcompose",Ke="rendercomplete",Ye="undefined",Ze="ready",$e=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 o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}();function He(t,e){if(!t.visible)return!1;var i=e.resolution;if(i<t.minResolution||i>=t.maxResolution)return!1;var o=e.zoom;return o>t.minZoom&&o<=t.maxZoom}var Je=function(t){function e(e){var i=this,o=bt({},e);delete o.source,(i=t.call(this,o)||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 n=e.source?e.source:null;return i.setSource(n),i}return $e(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():Ye},e.prototype.handleSourceChange_=function(){this.changed()},e.prototype.handleSourcePropertyChange_=function(){this.sourceChangeKey_&&(Bt(this.sourceChangeKey_),this.sourceChangeKey_=null);var t=this.getSource();t&&(this.sourceChangeKey_=Gt(t,Tt,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_&&(Bt(this.mapPrecomposeKey_),this.mapPrecomposeKey_=null),t||this.changed(),this.mapRenderKey_&&(Bt(this.mapRenderKey_),this.mapRenderKey_=null),t&&(this.mapPrecomposeKey_=Gt(t,Ue,(function(t){var e=t.frameState.layerStatesArray,i=this.getLayerState(!1);Re(!e.some((function(t){return t.layer===i.layer})),67),e.push(i)}),this),this.mapRenderKey_=Gt(this,Tt,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.renderer_&&(this.renderer_.dispose(),delete this.renderer_),this.setSource(null),t.prototype.disposeInternal.call(this)},e}(qe),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 o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}(),ti=function(t){function e(e){var i=this,o=e||{};(i=t.call(this,{element:document.createElement("div"),render:o.render,target:o.target})||this).ulElement_=document.createElement("ul"),i.collapsed_=void 0===o.collapsed||o.collapsed,i.userCollapsed_=i.collapsed_,i.overrideCollapsible_=void 0!==o.collapsible,i.collapsible_=void 0===o.collapsible||o.collapsible,i.collapsible_||(i.collapsed_=!1);var n=void 0!==o.className?o.className:"ol-attribution",r=void 0!==o.tipLabel?o.tipLabel:"Attributions",a=void 0!==o.expandClassName?o.expandClassName:n+"-expand",s=void 0!==o.collapseLabel?o.collapseLabel:"›",l=void 0!==o.collapseClassName?o.collapseClassName:n+"-collpase";"string"==typeof s?(i.collapseLabel_=document.createElement("span"),i.collapseLabel_.textContent=s,i.collapseLabel_.className=l):i.collapseLabel_=s;var u=void 0!==o.label?o.label:"i";"string"==typeof u?(i.label_=document.createElement("span"),i.label_.textContent=u,i.label_.className=a):i.label_=u;var p=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=r,i.toggleButton_.appendChild(p),i.toggleButton_.addEventListener(jt,i.handleClick_.bind(i),!1);var d=n+" "+"ol-unselectable "+ge+(i.collapsed_&&i.collapsible_?" ol-collapsed":"")+(i.collapsible_?"":" ol-uncollapsible"),h=i.element;return h.className=d,h.appendChild(i.toggleButton_),h.appendChild(i.ulElement_),i.renderedAttributions_=[],i.renderedVisible_=!0,i}return Qe(e,t),e.prototype.collectSourceAttributions_=function(t){for(var e={},i=[],o=!0,n=t.layerStatesArray,r=0,a=n.length;r<a;++r){var s=n[r];if(He(s,t.viewState)){var l=s.layer.getSource();if(l){var u=l.getAttributions();if(u){var p=u(t);if(p)if(o=o&&!1!==l.getAttributionsCollapsible(),Array.isArray(p))for(var d=0,h=p.length;d<h;++d)p[d]in e||(i.push(p[d]),e[p[d]]=!0);else p in e||(i.push(p),e[p]=!0)}}}}return this.overrideCollapsible_||this.setCollapsible(o),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),!mt(e,this.renderedAttributions_)){!function(t){for(;t.lastChild;)t.removeChild(t.lastChild)}(this.ulElement_);for(var o=0,n=e.length;o<n;++o){var r=document.createElement("li");r.innerHTML=e[o],this.ulElement_.appendChild(r)}this.renderedAttributions_=e}}else this.renderedVisible_&&(this.element.style.display="none",this.renderedVisible_=!1)},e.prototype.handleClick_=function(t){t.preventDefault(),this.handleToggle_(),this.userCollapsed_=this.collapsed_},e.prototype.handleToggle_=function(){this.element.classList.toggle(me),this.collapsed_?ue(this.collapseLabel_,this.label_):ue(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}(he),ei="add",ii="remove",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 o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}(),ni="length",ri=function(t){function e(e,i,o){var n=t.call(this,e)||this;return n.element=i,n.index=o,n}return oi(e,t),e}(ut),ai=function(t){function e(e,i){var o=t.call(this)||this;o.on,o.once,o.un;var n=i||{};if(o.unique_=!!n.unique,o.array_=e||[],o.unique_)for(var r=0,a=o.array_.length;r<a;++r)o.assertUnique_(o.array_[r],r);return o.updateLength_(),o}return oi(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,o=e.length;i<o;++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(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,o=e.length;i<o;++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(ii,e,t)),e},e.prototype.setAt=function(t,e){var i=this.getLength();if(t<i){this.unique_&&this.assertUnique_(e,t);var o=this.array_[t];this.array_[t]=e,this.dispatchEvent(new ri(ii,o,t)),this.dispatchEvent(new ri(ei,e,t))}else{for(var n=i;n<t;++n)this.insertAt(n,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,o=this.array_.length;i<o;++i)if(this.array_[i]===t&&i!==e)throw new je(58)},e}($t);function si(t){return Math.pow(t,3)}function li(t){return 1-si(1-t)}function ui(t){return 3*t*t-2*t*t*t}function pi(t){return t}var 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 o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}(),hi=function(t){function e(e){var i=this,o=e||{};i=t.call(this,{element:document.createElement("div"),render:o.render,target:o.target})||this;var n=void 0!==o.className?o.className:"ol-rotate",r=void 0!==o.label?o.label:"⇧",a=void 0!==o.compassClassName?o.compassClassName:"ol-compass";i.label_=null,"string"==typeof r?(i.label_=document.createElement("span"),i.label_.className=a,i.label_.textContent=r):(i.label_=r,i.label_.classList.add(a));var s=o.tipLabel?o.tipLabel:"Reset rotation",l=document.createElement("button");l.className=n+"-reset",l.setAttribute("type","button"),l.title=s,l.appendChild(i.label_),l.addEventListener(jt,i.handleClick_.bind(i),!1);var u=n+" "+"ol-unselectable "+ge,p=i.element;return p.className=u,p.appendChild(l),i.callResetNorth_=o.resetNorth?o.resetNorth:void 0,i.duration_=void 0!==o.duration?o.duration:250,i.autoHide_=void 0===o.autoHide||o.autoHide,i.rotation_=void 0,i.autoHide_&&i.element.classList.add(ce),i}return di(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 o="rotate("+i+"rad)";if(this.autoHide_){var n=this.element.classList.contains(ce);n||0!==i?n&&0!==i&&this.element.classList.remove(ce):this.element.classList.add(ce)}this.label_.style.transform=o}this.rotation_=i}},e}(he),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 o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}(),fi=function(t){function e(e){var i=this,o=e||{};i=t.call(this,{element:document.createElement("div"),target:o.target})||this;var n=void 0!==o.className?o.className:"ol-zoom",r=void 0!==o.delta?o.delta:1,a=void 0!==o.zoomInClassName?o.zoomInClassName:n+"-in",s=void 0!==o.zoomOutClassName?o.zoomOutClassName:n+"-out",l=void 0!==o.zoomInLabel?o.zoomInLabel:"+",u=void 0!==o.zoomOutLabel?o.zoomOutLabel:"–",p=void 0!==o.zoomInTipLabel?o.zoomInTipLabel:"Zoom in",d=void 0!==o.zoomOutTipLabel?o.zoomOutTipLabel:"Zoom out",h=document.createElement("button");h.className=a,h.setAttribute("type","button"),h.title=p,h.appendChild("string"==typeof l?document.createTextNode(l):l),h.addEventListener(jt,i.handleClick_.bind(i,r),!1);var c=document.createElement("button");c.className=s,c.setAttribute("type","button"),c.title=d,c.appendChild("string"==typeof u?document.createTextNode(u):u),c.addEventListener(jt,i.handleClick_.bind(i,-r),!1);var f=n+" "+"ol-unselectable "+ge,g=i.element;return g.className=f,g.appendChild(h),g.appendChild(c),i.duration_=void 0!==o.duration?o.duration:250,i}return ci(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 o=e.getConstrainedZoom(i+t);this.duration_>0?(e.getAnimating()&&e.cancelAnimations(),e.animate({zoom:o,duration:this.duration_,easing:li})):e.setZoom(o)}}},e}(he),gi="pointermove",mi="pointerdown",vi={RADIANS:"radians",DEGREES:"degrees",FEET:"ft",METERS:"m",PIXELS:"pixels",TILE_PIXELS:"tile-pixels",USFEET:"us-ft"},yi={};yi[vi.RADIANS]=6370997/(2*Math.PI),yi[vi.DEGREES]=2*Math.PI*6370997/360,yi[vi.FEET]=.3048,yi[vi.METERS]=1,yi[vi.USFEET]=1200/3937;var _i=vi,bi=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_||yi[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 o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}(),ki=6378137,wi=Math.PI*ki,Si=[-wi,-wi,wi,wi],Ci=[-180,-85,180,85],zi=ki*Math.log(Math.tan(Math.PI/2)),Ti=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/Fe(e[1]/ki)}})||this}return xi(e,t),e}(bi),Ei=[new Ti("EPSG:3857"),new Ti("EPSG:102100"),new Ti("EPSG:102113"),new Ti("EPSG:900913"),new Ti("http://www.opengis.net/def/crs/EPSG/0/3857"),new Ti("http://www.opengis.net/gml/srs/epsg.xml#3857")];function Pi(t,e,i){var o=t.length,n=i>1?i:2,r=e;void 0===r&&(r=n>2?t.slice():new Array(o));for(var a=0;a<o;a+=n){r[a]=wi*t[a]/180;var s=ki*Math.log(Math.tan(Math.PI*(+t[a+1]+90)/360));s>zi?s=zi:s<-zi&&(s=-zi),r[a+1]=s}return r}function Oi(t,e,i){var o=t.length,n=i>1?i:2,r=e;void 0===r&&(r=n>2?t.slice():new Array(o));for(var a=0;a<o;a+=n)r[a]=180*t[a]/wi,r[a+1]=360*Math.atan(Math.exp(t[a+1]/ki))/Math.PI-90;return r}var ji=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 o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}(),Ri=[-180,-90,180,90],Ii=6378137*Math.PI/180,Fi=function(t){function e(e,i){return t.call(this,{code:e,units:_i.DEGREES,extent:Ri,axisOrientation:i,global:!0,metersPerUnit:Ii,worldExtent:Ri})||this}return ji(e,t),e}(bi),Mi=[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/def/crs/OGC/1.3/CRS84","neu"),new Fi("http://www.opengis.net/gml/srs/epsg.xml#4326","neu"),new Fi("http://www.opengis.net/def/crs/EPSG/0/4326","neu")],Ai={};var Di={};function Li(t,e,i){var o=t.getCode(),n=e.getCode();o in Di||(Di[o]={}),Di[o][n]=i}var Gi="bottom-left",Ni="bottom-right",Bi="top-left",qi="top-right",Wi=0,Vi=1,Ui=2,Xi=4,Ki=8,Yi=16;function Zi(t){for(var e=oo(),i=0,o=t.length;i<o;++i)po(e,t[i]);return e}function $i(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 Ji(t,e,i){var o,n;return(o=e<t[0]?t[0]-e:t[2]<e?e-t[2]:0)*o+(n=i<t[1]?t[1]-i:t[3]<i?i-t[3]:0)*n}function Qi(t,e){return eo(t,e[0],e[1])}function to(t,e){return t[0]<=e[0]&&e[2]<=t[2]&&t[1]<=e[1]&&e[3]<=t[3]}function eo(t,e,i){return t[0]<=e&&e<=t[2]&&t[1]<=i&&i<=t[3]}function io(t,e){var i=t[0],o=t[1],n=t[2],r=t[3],a=e[0],s=e[1],l=Wi;return a<i?l|=Yi:a>n&&(l|=Xi),s<o?l|=Ki:s>r&&(l|=Ui),l===Wi&&(l=Vi),l}function oo(){return[1/0,1/0,-1/0,-1/0]}function no(t,e,i,o,n){return n?(n[0]=t,n[1]=e,n[2]=i,n[3]=o,n):[t,e,i,o]}function ro(t){return no(1/0,1/0,-1/0,-1/0,t)}function ao(t,e){var i=t[0],o=t[1];return no(i,o,i,o,e)}function so(t,e,i,o,n){return ho(ro(n),t,e,i,o)}function lo(t,e){return t[0]==e[0]&&t[2]==e[2]&&t[1]==e[1]&&t[3]==e[3]}function uo(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 po(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 ho(t,e,i,o,n){for(;i<o;i+=n)co(t,e[i],e[i+1]);return t}function co(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 fo(t,e){var i;return(i=e(mo(t)))||(i=e(vo(t)))||(i=e(So(t)))?i:(i=e(wo(t)))||!1}function go(t){var e=0;return To(t)||(e=Co(t)*xo(t)),e}function mo(t){return[t[0],t[1]]}function vo(t){return[t[2],t[1]]}function yo(t){return[(t[0]+t[2])/2,(t[1]+t[3])/2]}function _o(t,e){var i;return e===Gi?i=mo(t):e===Ni?i=vo(t):e===Bi?i=wo(t):e===qi?i=So(t):Re(!1,13),i}function bo(t,e,i,o,n){var r=e*o[0]/2,a=e*o[1]/2,s=Math.cos(i),l=Math.sin(i),u=r*s,p=r*l,d=a*s,h=a*l,c=t[0],f=t[1],g=c-u+h,m=c-u-h,v=c+u-h,y=c+u+h,_=f-p-d,b=f-p+d,x=f+p+d,k=f+p-d;return no(Math.min(g,m,v,y),Math.min(_,b,x,k),Math.max(g,m,v,y),Math.max(_,b,x,k),n)}function xo(t){return t[3]-t[1]}function ko(t,e,i){var o=i||[1/0,1/0,-1/0,-1/0];return zo(t,e)?(t[0]>e[0]?o[0]=t[0]:o[0]=e[0],t[1]>e[1]?o[1]=t[1]:o[1]=e[1],t[2]<e[2]?o[2]=t[2]:o[2]=e[2],t[3]<e[3]?o[3]=t[3]:o[3]=e[3]):ro(o),o}function wo(t){return[t[0],t[3]]}function So(t){return[t[2],t[3]]}function Co(t){return t[2]-t[0]}function zo(t,e){return t[0]<=e[2]&&t[2]>=e[0]&&t[1]<=e[3]&&t[3]>=e[1]}function To(t){return t[2]<t[0]||t[3]<t[1]}function Eo(t,e,i,o){var n=[];if(o>1)for(var r=t[2]-t[0],a=t[3]-t[1],s=0;s<o;++s)n.push(t[0]+r*s/o,t[1],t[2],t[1]+a*s/o,t[2]-r*s/o,t[3],t[0],t[3]-a*s/o);else n=[t[0],t[1],t[2],t[1],t[2],t[3],t[0],t[3]];e(n,n,2);for(var l=[],u=[],p=(s=0,n.length);s<p;s+=2)l.push(n[s]),u.push(n[s+1]);return function(t,e,i){return no(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 Po="Point",Oo="LineString",jo="LinearRing",Ro="Polygon",Io="MultiPoint",Fo="MultiLineString",Mo="MultiPolygon",Ao="GeometryCollection",Do="Circle",Lo=6371008.8;function Go(t,e,i){var o=i||Lo,n=Le(t[1]),r=Le(e[1]),a=(r-n)/2,s=Le(e[0]-t[0])/2,l=Math.sin(a)*Math.sin(a)+Math.sin(s)*Math.sin(s)*Math.cos(n)*Math.cos(r);return 2*o*Math.atan2(Math.sqrt(l),Math.sqrt(1-l))}function No(t,e){for(var i=0,o=t.length,n=t[o-1][0],r=t[o-1][1],a=0;a<o;a++){var s=t[a][0],l=t[a][1];i+=Le(s-n)*(2+Math.sin(Le(r))+Math.sin(Le(l))),n=s,r=l}return i*e*e/2}function Bo(t,e){var i=e||{},o=i.radius||Lo,n=i.projection||"EPSG:3857",r=t.getType();r!==Ao&&(t=t.clone().transform(n,"EPSG:4326"));var a,s,l,u,p,d,h=0;switch(r){case Po:case Io:case Oo:case Fo:case jo:break;case Ro:for(a=t.getCoordinates(),h=Math.abs(No(a[0],o)),l=1,u=a.length;l<u;++l)h-=Math.abs(No(a[l],o));break;case Mo:for(l=0,u=(a=t.getCoordinates()).length;l<u;++l)for(s=a[l],h+=Math.abs(No(s[0],o)),p=1,d=s.length;p<d;++p)h-=Math.abs(No(s[p],o));break;case Ao:var c=t.getGeometries();for(l=0,u=c.length;l<u;++l)h+=Bo(c[l],e);break;default:throw new Error("Unsupported geometry type: "+r)}return h}function qo(t,e){var i,o,n=t[0],r=t[1],a=e[0],s=e[1],l=a[0],u=a[1],p=s[0],d=s[1],h=p-l,c=d-u,f=0===h&&0===c?0:(h*(n-l)+c*(r-u))/(h*h+c*c||0);return f<=0?(i=l,o=u):f>=1?(i=p,o=d):(i=l+f*h,o=u+f*c),[i,o]}function Wo(t,e){for(var i=!0,o=t.length-1;o>=0;--o)if(t[o]!=e[o]){i=!1;break}return i}function Vo(t,e){var i=Math.cos(e),o=Math.sin(e),n=t[0]*i-t[1]*o,r=t[1]*i+t[0]*o;return t[0]=n,t[1]=r,t}function Uo(t,e){var i=t[0]-e[0],o=t[1]-e[1];return i*i+o*o}function Xo(t,e){return Math.sqrt(Uo(t,e))}function Ko(t,e){return Uo(t,qo(t,e))}function Yo(t,e){if(e.canWrapX()){var i=Co(e.getExtent()),o=function(t,e,i){var o=e.getExtent(),n=0;if(e.canWrapX()&&(t[0]<o[0]||t[0]>o[2])){var r=i||Co(o);n=Math.floor((t[0]-o[0])/r)}return n}(t,e,i);o&&(t[0]-=o*i)}return t}function Zo(t,e,i){var o;if(void 0!==e){for(var n=0,r=t.length;n<r;++n)e[n]=t[n];o=e}else o=t.slice();return o}function $o(t,e,i){if(void 0!==e&&t!==e){for(var o=0,n=t.length;o<n;++o)e[o]=t[o];t=e}return t}function Ho(t){!function(t,e){Ai[t]=e}(t.getCode(),t),Li(t,t,Zo)}function Jo(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 Qo(t,e,i,o){var n,r=(t=Jo(t)).getPointResolutionFunc();if(r){if(n=r(e,i),o&&o!==t.getUnits())(s=t.getMetersPerUnit())&&(n=n*s/yi[o])}else{var a=t.getUnits();if(a==_i.DEGREES&&!o||o==_i.DEGREES)n=e;else{var s,l=rn(t,Jo("EPSG:4326"));if(l===$o&&a!==_i.DEGREES)n=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];n=(Go((u=l(u,u,2)).slice(0,2),u.slice(2,4))+Go(u.slice(4,6),u.slice(6,8)))/2}void 0!==(s=o?yi[o]:t.getMetersPerUnit())&&(n/=s)}}return n}function tn(t){!function(t){t.forEach(Ho)}(t),t.forEach((function(e){t.forEach((function(t){e!==t&&Li(e,t,Zo)}))}))}function en(t,e){return t?"string"==typeof t?Jo(t):t:Jo(e)}function on(t,e){return sn(t,"EPSG:4326",void 0!==e?e:"EPSG:3857")}function nn(t,e){if(t===e)return!0;var i=t.getUnits()===e.getUnits();return(t.getCode()===e.getCode()||rn(t,e)===Zo)&&i}function rn(t,e){var i=function(t,e){var i;return t in Di&&e in Di[t]&&(i=Di[t][e]),i}(t.getCode(),e.getCode());return i||(i=$o),i}function an(t,e){return rn(Jo(t),Jo(e))}function sn(t,e,i){return an(e,i)(t,void 0,t.length)}var ln,un,pn;function dn(t,e){return t}function hn(t,e){return t}function cn(t,e){return t}function fn(t,e){return t}tn(Ei),tn(Mi),ln=Ei,un=Pi,pn=Oi,Mi.forEach((function(t){ln.forEach((function(e){Li(t,e,un),Li(e,t,pn)}))}));var gn,mn=new Array(6);function vn(t){return _n(t,1,0,0,1,0,0)}function yn(t,e){var i=t[0],o=t[1],n=t[2],r=t[3],a=t[4],s=t[5],l=e[0],u=e[1],p=e[2],d=e[3],h=e[4],c=e[5];return t[0]=i*l+n*u,t[1]=o*l+r*u,t[2]=i*p+n*d,t[3]=o*p+r*d,t[4]=i*h+n*c+a,t[5]=o*h+r*c+s,t}function _n(t,e,i,o,n,r,a){return t[0]=e,t[1]=i,t[2]=o,t[3]=n,t[4]=r,t[5]=a,t}function bn(t,e){var i=e[0],o=e[1];return e[0]=t[0]*i+t[2]*o+t[4],e[1]=t[1]*i+t[3]*o+t[5],e}function xn(t,e,i){return yn(t,_n(mn,e,0,0,i,0,0))}function kn(t,e,i,o,n,r,a,s){var l=Math.sin(r),u=Math.cos(r);return t[0]=o*u,t[1]=n*l,t[2]=-o*l,t[3]=n*u,t[4]=a*o*u-s*o*l+e,t[5]=a*n*l+s*n*u+i,t}function wn(t,e){var i,o=(i=e)[0]*i[3]-i[1]*i[2];Re(0!==o,32);var n=e[0],r=e[1],a=e[2],s=e[3],l=e[4],u=e[5];return t[0]=s/o,t[1]=-r/o,t[2]=-a/o,t[3]=n/o,t[4]=(a*u-s*l)/o,t[5]=-(n*u-r*l)/o,t}function Sn(t){var e="matrix("+t.join(", ")+")";if(re)return e;var i=gn||(gn=document.createElement("div"));return i.style.transform=e,i.style.transform}var Cn=/^#([a-f0-9]{3}|[a-f0-9]{4}(?:[a-f0-9]{2}){0,2})$/i,zn=/^([a-z]*)$|^hsla?\(.*\)$/i;function Tn(t){return"string"==typeof t?t:In(t)}var En,Pn,On=(En={},Pn=0,function(t){var e;if(En.hasOwnProperty(t))e=En[t];else{if(Pn>=1024){var i=0;for(var o in En)0==(3&i++)&&(delete En[o],--Pn)}e=function(t){var e,i,o,n,r;if(zn.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)),Cn.exec(t)){var a=t.length-1,s=void 0;s=a<=4?1:2;var l=4===a||8===a;e=parseInt(t.substr(1+0*s,s),16),i=parseInt(t.substr(1+1*s,s),16),o=parseInt(t.substr(1+2*s,s),16),n=l?parseInt(t.substr(1+3*s,s),16):255,1==s&&(e=(e<<4)+e,i=(i<<4)+i,o=(o<<4)+o,l&&(n=(n<<4)+n)),r=[e,i,o,n/255]}else 0==t.indexOf("rgba(")?Rn(r=t.slice(5,-1).split(",").map(Number)):0==t.indexOf("rgb(")?((r=t.slice(4,-1).split(",").map(Number)).push(1),Rn(r)):Re(!1,14);return r}(t),En[t]=e,++Pn}return e});function jn(t){return Array.isArray(t)?t:On(t)}function Rn(t){return t[0]=Ie(t[0]+.5|0,0,255),t[1]=Ie(t[1]+.5|0,0,255),t[2]=Ie(t[2]+.5|0,0,255),t[3]=Ie(t[3],0,1),t}function In(t){var e=t[0];e!=(0|e)&&(e=e+.5|0);var i=t[1];i!=(0|i)&&(i=i+.5|0);var o=t[2];return o!=(0|o)&&(o=o+.5|0),"rgba("+e+","+i+","+o+","+(void 0===t[3]?1:t[3])+")"}function Fn(t,e,i){return e+":"+t+":"+(i?Tn(i):"null")}var Mn=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 o=Fn(t,e,i);return o in this.cache_?this.cache_[o]:null},t.prototype.set=function(t,e,i,o){var n=Fn(t,e,i);this.cache_[n]=o,++this.cacheSize_},t.prototype.setSize=function(t){this.maxCacheSize_=t,this.expire()},t}()),An=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 o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}();function Dn(t,e){Mn.expire()}var Ln=function(t){function e(e){var i=t.call(this)||this;return i.map_=e,i}return An(e,t),e.prototype.dispatchRenderEvent=function(t,e){Ut()},e.prototype.calculateMatrices2D=function(t){var e=t.viewState,i=t.coordinateToPixelTransform,o=t.pixelToCoordinateTransform;kn(i,t.size[0]/2,t.size[1]/2,1/e.resolution,-1/e.resolution,-e.rotation,-e.center[0],-e.center[1]),wn(o,i)},e.prototype.forEachFeatureAtCoordinate=function(t,e,i,o,n,r,a,s){var l,u=e.viewState;function p(t,e,i,o){return n.call(r,e,t?i:null,o)}var d=u.projection,h=Yo(t.slice(),d),c=[[0,0]];if(d.canWrapX()&&o){var f=Co(d.getExtent());c.push([-f,0],[f,0])}for(var g=e.layerStatesArray,m=g.length,v=[],y=[],_=0;_<c.length;_++)for(var b=m-1;b>=0;--b){var x=g[b],k=x.layer;if(k.hasRenderer()&&He(x,u)&&a.call(s,k)){var w=k.getRenderer(),S=k.getSource();if(w&&S){var C=S.getWrapX()?h:t,z=p.bind(null,x.managed);y[0]=C[0]+c[_][0],y[1]=C[1]+c[_][1],l=w.forEachFeatureAtCoordinate(y,e,i,z,v)}if(l)return l}}if(0!==v.length){var T=1/v.length;return v.forEach((function(t,e){return t.distanceSq+=e*T})),v.sort((function(t,e){return t.distanceSq-e.distanceSq})),v.some((function(t){return l=t.callback(t.feature,t.layer,t.geometry)})),l}},e.prototype.forEachLayerAtPixel=function(t,e,i,o,n){return Ut()},e.prototype.hasFeatureAtCoordinate=function(t,e,i,o,n,r){return void 0!==this.forEachFeatureAtCoordinate(t,e,i,o,vt,this,n,r)},e.prototype.getMap=function(){return this.map_},e.prototype.renderFrame=function(t){Ut()},e.prototype.scheduleExpireIconCache=function(t){Mn.canExpireCache()&&t.postRenderFunctions.push(Dn)},e}(dt),Gn=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 o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}(),Nn=function(t){function e(e,i,o,n){var r=t.call(this,e)||this;return r.inversePixelTransform=i,r.frameState=o,r.context=n,r}return Gn(e,t),e}(ut),Bn="10px sans-serif",qn="#000",Wn="round",Vn=[],Un="round",Xn="#000",Kn="center",Yn="middle",Zn=[0,0,0,0],$n=new $t,Hn=new zt;Hn.setSize=function(){console.warn("labelCache is deprecated.")};var Jn,Qn,tr=null,er={},ir=function(){var t,e,i="32px ",o=["monospace","serif"],n=o.length,r="wmytzilWMYTZIL@#/&?$%10";function a(t,a,s){for(var l=!0,u=0;u<n;++u){var p=o[u];if(e=rr(t+" "+a+" "+i+p,r),s!=p){var d=rr(t+" "+a+" "+i+s+","+p,r);l=l&&d!=e}}return!!l}function s(){for(var e=!0,i=$n.getKeys(),o=0,n=i.length;o<n;++o){var r=i[o];$n.get(r)<100&&(a.apply(this,r.split("\n"))?(xt(er),tr=null,Jn=void 0,$n.set(r,100)):($n.set(r,$n.get(r)+1,!0),e=!1))}e&&(clearInterval(t),t=void 0)}return function(e){var i=_e(e);if(i)for(var o=i.families,n=0,r=o.length;n<r;++n){var l=o[n],u=i.style+"\n"+i.weight+"\n"+l;void 0===$n.get(u)&&($n.set(u,100,!0),a(i.style,i.weight,l)||($n.set(u,0,!0),void 0===t&&(t=setInterval(s,32))))}}}(),or=function(t){var e=er[t];if(null==e){if(re){var i=_e(t),o=nr(t,"Žg");e=(isNaN(Number(i.lineHeight))?1.2:Number(i.lineHeight))*(o.actualBoundingBoxAscent+o.actualBoundingBoxDescent)}else Qn||((Qn=document.createElement("div")).innerHTML="M",Qn.style.minHeight="0",Qn.style.maxHeight="none",Qn.style.height="auto",Qn.style.padding="0",Qn.style.border="none",Qn.style.position="absolute",Qn.style.display="block",Qn.style.left="-99999px"),Qn.style.font=t,document.body.appendChild(Qn),e=Qn.offsetHeight,document.body.removeChild(Qn);er[t]=e}return e};function nr(t,e){return tr||(tr=le(1,1)),t!=Jn&&(tr.font=t,Jn=tr.font),tr.measureText(e)}function rr(t,e){return nr(t,e).width}function ar(t,e,i){if(e in i)return i[e];var o=rr(t,e);return i[e]=o,o}function sr(t,e,i,o,n,r,a,s,l,u,p){t.save(),1!==i&&(t.globalAlpha*=i),e&&t.setTransform.apply(t,e),o.contextInstructions?(t.translate(l,u),t.scale(p[0],p[1]),function(t,e){for(var i=t.contextInstructions,o=0,n=i.length;o<n;o+=2)Array.isArray(i[o+1])?e[i[o]].apply(e,i[o+1]):e[i[o]]=i[o+1]}(o,t)):p[0]<0||p[1]<0?(t.translate(l,u),t.scale(p[0],p[1]),t.drawImage(o,n,r,a,s,0,0,a,s)):t.drawImage(o,n,r,a,s,l,u,a*p[0],s*p[1]),t.restore()}var 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 o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}(),ur=function(t){function e(e){var i=t.call(this,e)||this;i.fontChangeListenerKey_=Gt($n,pt,e.redrawText.bind(e)),i.element_=document.createElement("div");var o=i.element_.style;o.position="absolute",o.width="100%",o.height="100%",o.zIndex="0",i.element_.className="ol-unselectable ol-layers";var n=e.getViewport();return n.insertBefore(i.element_,n.firstChild||null),i.children_=[],i.renderedVisible_=!0,i}return lr(e,t),e.prototype.dispatchRenderEvent=function(t,e){var i=this.getMap();if(i.hasListener(t)){var o=new Nn(t,void 0,e);i.dispatchEvent(o)}},e.prototype.disposeInternal=function(){Bt(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 o=[],n=null,r=0,a=e.length;r<a;++r){var s=e[r];if(t.layerIndex=r,He(s,i)&&(s.sourceState==Ze||s.sourceState==Ye)){var l=s.layer,u=l.render(t,n);u&&(u!==n&&(this.children_.push(u),n=u),"getDeclutter"in l&&o.push(l))}}for(r=o.length-1;r>=0;--r)o[r].renderDeclutter(t);!function(t,e){for(var i=t.childNodes,o=0;;++o){var n=i[o],r=e[o];if(!n&&!r)break;n!==r&&(n?r?t.insertBefore(r,n):(t.removeChild(n),--o):t.appendChild(r))}}(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,o,n){for(var r=e.viewState,a=e.layerStatesArray,s=a.length-1;s>=0;--s){var l=a[s],u=l.layer;if(u.hasRenderer()&&He(l,r)&&n(u)){var p=u.getRenderer().getDataAtPixel(t,e,i);if(p){var d=o(u,p);if(d)return d}}}},e}(Ln),pr="layergroup",dr="size",hr="target",cr="view",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 o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}(),gr="layers",mr=function(t){function e(e){var i=this,o=e||{},n=bt({},o);delete n.layers;var r=o.layers;return(i=t.call(this,n)||this).on,i.once,i.un,i.layersListenerKeys_=[],i.listenerKeys_={},i.addChangeListener(gr,i.handleLayersChanged_),r?Array.isArray(r)?r=new ai(r.slice(),{unique:!0}):Re("function"==typeof r.getArray,43):r=new ai(void 0,{unique:!0}),i.setLayers(r),i}return fr(e,t),e.prototype.handleLayerChange_=function(){this.changed()},e.prototype.handleLayersChanged_=function(){this.layersListenerKeys_.forEach(Bt),this.layersListenerKeys_.length=0;var t=this.getLayers();for(var e in this.layersListenerKeys_.push(Gt(t,ei,this.handleLayersAdd_,this),Gt(t,ii,this.handleLayersRemove_,this)),this.listenerKeys_)this.listenerKeys_[e].forEach(Bt);xt(this.listenerKeys_);for(var i=t.getArray(),o=0,n=i.length;o<n;o++){var r=i[o];this.listenerKeys_[Kt(r)]=[Gt(r,pt,this.handleLayerChange_,this),Gt(r,Tt,this.handleLayerChange_,this)]}this.changed()},e.prototype.handleLayersAdd_=function(t){var e=t.element;this.listenerKeys_[Kt(e)]=[Gt(e,pt,this.handleLayerChange_,this),Gt(e,Tt,this.handleLayerChange_,this)],this.changed()},e.prototype.handleLayersRemove_=function(t){var e=Kt(t.element);this.listenerKeys_[e].forEach(Bt),delete this.listenerKeys_[e],this.changed()},e.prototype.getLayers=function(){return this.get(gr)},e.prototype.setLayers=function(t){this.set(gr,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 o=this.getLayerState(),n=o.zIndex;t||void 0!==o.zIndex||(n=0);for(var r=i,a=e.length;r<a;r++){var s=e[r];s.opacity*=o.opacity,s.visible=s.visible&&o.visible,s.maxResolution=Math.min(s.maxResolution,o.maxResolution),s.minResolution=Math.max(s.minResolution,o.minResolution),s.minZoom=Math.max(s.minZoom,o.minZoom),s.maxZoom=Math.min(s.maxZoom,o.maxZoom),void 0!==o.extent&&(void 0!==s.extent?s.extent=ko(s.extent,o.extent):s.extent=o.extent),void 0===s.zIndex&&(s.zIndex=n)}return e},e.prototype.getSourceState=function(){return Ze},e}(qe),vr=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 o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}(),yr=function(t){function e(e,i,o){var n=t.call(this,e)||this;return n.map=i,n.frameState=void 0!==o?o:null,n}return vr(e,t),e}(ut),_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 o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}(),br=function(t){function e(e,i,o,n,r){var a=t.call(this,e,i,r)||this;return a.originalEvent=o,a.pixel_=null,a.coordinate_=null,a.dragging=void 0!==n&&n,a}return _r(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}(yr),xr={SINGLECLICK:"singleclick",CLICK:jt,DBLCLICK:Rt,POINTERDRAG:"pointerdrag",POINTERMOVE:"pointermove",POINTERDOWN:"pointerdown",POINTERUP:"pointerup",POINTEROVER:"pointerover",POINTEROUT:"pointerout",POINTERENTER:"pointerenter",POINTERLEAVE:"pointerleave",POINTERCANCEL:"pointercancel"},kr=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 o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}(),wr=function(t){function e(e,i){var o=t.call(this,e)||this;o.map_=e,o.clickTimeoutId_,o.emulateClicks_=!1,o.dragging_=!1,o.dragListenerKeys_=[],o.moveTolerance_=void 0===i?1:i,o.down_=null;var n=o.map_.getViewport();return o.activePointers_=0,o.trackedTouches_={},o.element_=n,o.pointerdownListenerKey_=Gt(n,mi,o.handlePointerDown_,o),o.originalPointerMoveEvent_,o.relayedListenerKey_=Gt(n,gi,o.relayEvent_,o),o.boundHandleTouchMove_=o.handleTouchMove_.bind(o),o.element_.addEventListener(Dt,o.boundHandleTouchMove_,!!se&&{passive:!1}),o}return kr(e,t),e.prototype.emulateClick_=function(t){var e=new br(xr.CLICK,this.map_,t);this.dispatchEvent(e),void 0!==this.clickTimeoutId_?(clearTimeout(this.clickTimeoutId_),this.clickTimeoutId_=void 0,e=new br(xr.DBLCLICK,this.map_,t),this.dispatchEvent(e)):this.clickTimeoutId_=setTimeout(function(){this.clickTimeoutId_=void 0;var e=new br(xr.SINGLECLICK,this.map_,t);this.dispatchEvent(e)}.bind(this),250)},e.prototype.updateActivePointers_=function(t){var e=t;e.type==xr.POINTERUP||e.type==xr.POINTERCANCEL?delete this.trackedTouches_[e.pointerId]:e.type==xr.POINTERDOWN&&(this.trackedTouches_[e.pointerId]=!0),this.activePointers_=Object.keys(this.trackedTouches_).length},e.prototype.handlePointerUp_=function(t){this.updateActivePointers_(t);var e=new br(xr.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(Bt),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 br(xr.POINTERDOWN,this.map_,t);for(var i in this.dispatchEvent(e),this.down_={},t){var o=t[i];this.down_[i]="function"==typeof o?_t:o}if(0===this.dragListenerKeys_.length){var n=this.map_.getOwnerDocument();this.dragListenerKeys_.push(Gt(n,xr.POINTERMOVE,this.handlePointerMove_,this),Gt(n,xr.POINTERUP,this.handlePointerUp_,this),Gt(this.element_,xr.POINTERCANCEL,this.handlePointerUp_,this)),this.element_.getRootNode&&this.element_.getRootNode()!==n&&this.dragListenerKeys_.push(Gt(this.element_.getRootNode(),xr.POINTERUP,this.handlePointerUp_,this))}},e.prototype.handlePointerMove_=function(t){if(this.isMoving_(t)){this.dragging_=!0;var e=new br(xr.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 br(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_&&(Bt(this.relayedListenerKey_),this.relayedListenerKey_=null),this.element_.removeEventListener(Dt,this.boundHandleTouchMove_),this.pointerdownListenerKey_&&(Bt(this.pointerdownListenerKey_),this.pointerdownListenerKey_=null),this.dragListenerKeys_.forEach(Bt),this.dragListenerKeys_.length=0,this.element_=null,t.prototype.disposeInternal.call(this)},e}(zt),Sr=1/0,Cr=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,xt(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 o=this.keyFunction_(i);return delete this.queuedElements_[o],i},t.prototype.enqueue=function(t){Re(!(this.keyFunction_(t)in this.queuedElements_),31);var e=this.priorityFunction_(t);return e!=Sr&&(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_,o=e.length,n=e[t],r=i[t],a=t;t<o>>1;){var s=this.getLeftChildIndex_(t),l=this.getRightChildIndex_(t),u=l<o&&i[l]<i[s]?l:s;e[t]=e[u],i[t]=i[u],t=u}e[t]=n,i[t]=r,this.siftDown_(a,t)},t.prototype.siftDown_=function(t,e){for(var i=this.elements_,o=this.priorities_,n=i[e],r=o[e];e>t;){var a=this.getParentIndex_(e);if(!(o[a]>r))break;i[e]=i[a],o[e]=o[a],e=a}i[e]=n,o[e]=r},t.prototype.reprioritize=function(){var t,e,i,o=this.priorityFunction_,n=this.elements_,r=this.priorities_,a=0,s=n.length;for(e=0;e<s;++e)(i=o(t=n[e]))==Sr?delete this.queuedElements_[this.keyFunction_(t)]:(r[a]=i,n[a++]=t);n.length=a,r.length=a,this.heapify_()},t}(),zr=0,Tr=1,Er=2,Pr=3,Or=4,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 o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}(),Rr=function(t){function e(e,i){var o=t.call(this,(function(t){return e.apply(null,t)}),(function(t){return t[0].getKey()}))||this;return o.boundHandleTileChange_=o.handleTileChange.bind(o),o.tileChangeCallback_=i,o.tilesLoading_=0,o.tilesLoadingKeys_={},o}return jr(e,t),e.prototype.enqueue=function(e){var i=t.prototype.enqueue.call(this,e);i&&e[0].addEventListener(Tt,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===Er||i===Pr||i===Or){e.removeEventListener(Tt,this.boundHandleTileChange_);var o=e.getKey();o in this.tilesLoadingKeys_&&(delete this.tilesLoadingKeys_[o],--this.tilesLoading_),this.tileChangeCallback_()}},e.prototype.loadMoreTiles=function(t,e){for(var i,o,n=0;this.tilesLoading_<t&&n<e&&this.getCount()>0;)o=(i=this.dequeue()[0]).getKey(),i.getState()!==zr||o in this.tilesLoadingKeys_||(this.tilesLoadingKeys_[o]=!0,++this.tilesLoading_,++n,i.load())},e}(Cr);var Ir=0,Fr=1,Mr="center",Ar="resolution",Dr="rotation",Lr=256;function Gr(t,e,i){return function(o,n,r,a,s){if(o){var l=e?0:r[0]*n,u=e?0:r[1]*n,p=s?s[0]:0,d=s?s[1]:0,h=t[0]+l/2+p,c=t[2]-l/2+p,f=t[1]+u/2+d,g=t[3]-u/2+d;h>c&&(c=h=(c+h)/2),f>g&&(g=f=(g+f)/2);var m=Ie(o[0],h,c),v=Ie(o[1],f,g),y=30*n;return a&&i&&(m+=-y*Math.log(1+Math.max(0,h-o[0])/y)+y*Math.log(1+Math.max(0,o[0]-c)/y),v+=-y*Math.log(1+Math.max(0,f-o[1])/y)+y*Math.log(1+Math.max(0,o[1]-g)/y)),[m,v]}}}function Nr(t){return t}function Br(t,e,i,o){var n=Co(e)/i[0],r=xo(e)/i[1];return o?Math.min(t,Math.max(n,r)):Math.min(t,Math.min(n,r))}function qr(t,e,i){var o=Math.min(t,e);return o*=Math.log(1+50*Math.max(0,t/e-1))/50+1,i&&(o=Math.max(o,i),o/=Math.log(1+50*Math.max(0,i/t-1))/50+1),Ie(o,i/2,2*e)}function Wr(t,e,i,o,n){return function(r,a,s,l){if(void 0!==r){var u=o?Br(t,o,s,n):t;return(void 0===i||i)&&l?qr(r,u,e):Ie(r,e,u)}}}function Vr(t){return void 0!==t?0:void 0}function Ur(t){return void 0!==t?t:void 0}var Xr="XY",Kr="XYZ",Yr="XYM",Zr="XYZM";function $r(t,e,i,o,n,r){for(var a=r||[],s=0,l=e;l<i;l+=o){var u=t[l],p=t[l+1];a[s++]=n[0]*u+n[2]*p+n[4],a[s++]=n[1]*u+n[3]*p+n[5]}return r&&a.length!=s&&(a.length=s),a}function Hr(t,e,i,o,n,r,a){for(var s=a||[],l=Math.cos(n),u=Math.sin(n),p=r[0],d=r[1],h=0,c=e;c<i;c+=o){var f=t[c]-p,g=t[c+1]-d;s[h++]=p+f*l-g*u,s[h++]=d+f*u+g*l;for(var m=c+2;m<c+o;++m)s[h++]=t[m]}return a&&s.length!=h&&(s.length=h),s}function Jr(t,e,i,o,n,r,a){for(var s=a||[],l=0,u=e;u<i;u+=o){s[l++]=t[u]+n,s[l++]=t[u+1]+r;for(var p=u+2;p<u+o;++p)s[l++]=t[p]}return a&&s.length!=l&&(s.length=l),s}var Qr=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 o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}(),ta=[1,0,0,1,0,0],ea=function(t){function e(){var e,i,o,n,r,a=t.call(this)||this;return a.extent_=[1/0,1/0,-1/0,-1/0],a.extentRevision_=-1,a.simplifiedGeometryMaxMinSquaredTolerance=0,a.simplifiedGeometryRevision=0,a.simplifyTransformedInternal=(e=function(t,e,i){if(!i)return this.getSimplifiedGeometry(e);var o=this.clone();return o.applyTransform(i),o.getSimplifiedGeometry(e)},r=!1,function(){var t=Array.prototype.slice.call(arguments);return r&&this===n&&mt(t,o)||(r=!0,n=this,o=t,i=e.apply(this,arguments)),i}),a}return Qr(e,t),e.prototype.simplifyTransformed=function(t,e){return this.simplifyTransformedInternal(this.getRevision(),t,e)},e.prototype.clone=function(){return Ut()},e.prototype.closestPointXY=function(t,e,i,o){return Ut()},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 Ut()},e.prototype.getExtent=function(t){if(this.extentRevision_!=this.getRevision()){var e=this.computeExtent(this.extent_);(isNaN(e[0])||isNaN(e[1]))&&ro(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){Ut()},e.prototype.scale=function(t,e,i){Ut()},e.prototype.simplify=function(t){return this.getSimplifiedGeometry(t*t)},e.prototype.getSimplifiedGeometry=function(t){return Ut()},e.prototype.getType=function(){return Ut()},e.prototype.applyTransform=function(t){Ut()},e.prototype.intersectsExtent=function(t){return Ut()},e.prototype.translate=function(t,e){Ut()},e.prototype.transform=function(t,e){var i=Jo(t),o=i.getUnits()==_i.TILE_PIXELS?function(t,o,n){var r=i.getExtent(),a=i.getWorldExtent(),s=xo(a)/xo(r);return kn(ta,a[0],a[3],s,-s,0,0,0),$r(t,0,t.length,n,ta,o),an(i,e)(t,o,n)}:an(i,e);return this.applyTransform(o),this},e}($t),ia=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 o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}();function oa(t){var e;return t==Xr?e=2:t==Kr||t==Yr?e=3:t==Zr&&(e=4),e}var na=function(t){function e(){var e=t.call(this)||this;return e.layout=Xr,e.stride=2,e.flatCoordinates=null,e}return ia(e,t),e.prototype.computeExtent=function(t){return so(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,t)},e.prototype.getCoordinates=function(){return Ut()},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=oa(t),this.layout=t,this.flatCoordinates=e},e.prototype.setCoordinates=function(t,e){Ut()},e.prototype.setLayout=function(t,e,i){var o;if(t)o=oa(t);else{for(var n=0;n<i;++n){if(0===e.length)return this.layout=Xr,void(this.stride=2);e=e[0]}t=function(t){var e;2==t?e=Xr:3==t?e=Kr:4==t&&(e=Zr);return e}(o=e.length)}this.layout=t,this.stride=o},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 o=this.getStride();Hr(i,0,i.length,o,t,e,i),this.changed()}},e.prototype.scale=function(t,e,i){var o=e;void 0===o&&(o=t);var n=i;n||(n=yo(this.getExtent()));var r=this.getFlatCoordinates();if(r){var a=this.getStride();!function(t,e,i,o,n,r,a,s){for(var l=s||[],u=a[0],p=a[1],d=0,h=e;h<i;h+=o){var c=t[h]-u,f=t[h+1]-p;l[d++]=u+n*c,l[d++]=p+r*f;for(var g=h+2;g<h+o;++g)l[d++]=t[g]}s&&l.length!=d&&(l.length=d)}(r,0,r.length,a,t,o,n,r),this.changed()}},e.prototype.translate=function(t,e){var i=this.getFlatCoordinates();if(i){var o=this.getStride();Jr(i,0,i.length,o,t,e,i),this.changed()}},e}(ea);function ra(t,e,i,o,n,r,a){var s,l=t[e],u=t[e+1],p=t[i]-l,d=t[i+1]-u;if(0===p&&0===d)s=e;else{var h=((n-l)*p+(r-u)*d)/(p*p+d*d);if(h>1)s=i;else{if(h>0){for(var c=0;c<o;++c)a[c]=Ne(t[e+c],t[i+c],h);return void(a.length=o)}s=e}}for(c=0;c<o;++c)a[c]=t[s+c];a.length=o}function aa(t,e,i,o,n){var r=t[e],a=t[e+1];for(e+=o;e<i;e+=o){var s=t[e],l=t[e+1],u=De(r,a,s,l);u>n&&(n=u),r=s,a=l}return n}function sa(t,e,i,o,n){for(var r=0,a=i.length;r<a;++r){var s=i[r];n=aa(t,e,s,o,n),e=s}return n}function la(t,e,i,o,n,r,a,s,l,u,p){if(e==i)return u;var d,h;if(0===n){if((h=De(a,s,t[e],t[e+1]))<u){for(d=0;d<o;++d)l[d]=t[e+d];return l.length=o,h}return u}for(var c=p||[NaN,NaN],f=e+o;f<i;)if(ra(t,f-o,f,o,a,s,c),(h=De(a,s,c[0],c[1]))<u){for(u=h,d=0;d<o;++d)l[d]=c[d];l.length=o,f+=o}else f+=o*Math.max((Math.sqrt(h)-Math.sqrt(u))/n|0,1);if(r&&(ra(t,i-o,e,o,a,s,c),(h=De(a,s,c[0],c[1]))<u)){for(u=h,d=0;d<o;++d)l[d]=c[d];l.length=o}return u}function ua(t,e,i,o,n,r,a,s,l,u,p){for(var d=p||[NaN,NaN],h=0,c=i.length;h<c;++h){var f=i[h];u=la(t,e,f,o,n,r,a,s,l,u,d),e=f}return u}function pa(t,e,i,o){for(var n=0,r=i.length;n<r;++n)t[e++]=i[n];return e}function da(t,e,i,o){for(var n=0,r=i.length;n<r;++n)for(var a=i[n],s=0;s<o;++s)t[e++]=a[s];return e}function ha(t,e,i,o,n){for(var r=n||[],a=0,s=0,l=i.length;s<l;++s){var u=da(t,e,i[s],o);r[a++]=u,e=u}return r.length=a,r}function ca(t,e,i,o,n,r,a){var s=(i-e)/o;if(s<3){for(;e<i;e+=o)r[a++]=t[e],r[a++]=t[e+1];return a}var l=new Array(s);l[0]=1,l[s-1]=1;for(var u=[e,i-o],p=0;u.length>0;){for(var d=u.pop(),h=u.pop(),c=0,f=t[h],g=t[h+1],m=t[d],v=t[d+1],y=h+o;y<d;y+=o){var _=Ae(t[y],t[y+1],f,g,m,v);_>c&&(p=y,c=_)}c>n&&(l[(p-e)/o]=1,h+o<p&&u.push(h,p),p+o<d&&u.push(p,d))}for(y=0;y<s;++y)l[y]&&(r[a++]=t[e+y*o],r[a++]=t[e+y*o+1]);return a}function fa(t,e){return e*Math.round(t/e)}function ga(t,e,i,o,n,r,a){if(e==i)return a;var s,l,u=fa(t[e],n),p=fa(t[e+1],n);e+=o,r[a++]=u,r[a++]=p;do{if(s=fa(t[e],n),l=fa(t[e+1],n),(e+=o)==i)return r[a++]=s,r[a++]=l,a}while(s==u&&l==p);for(;e<i;){var d=fa(t[e],n),h=fa(t[e+1],n);if(e+=o,d!=s||h!=l){var c=s-u,f=l-p,g=d-u,m=h-p;c*m==f*g&&(c<0&&g<c||c==g||c>0&&g>c)&&(f<0&&m<f||f==m||f>0&&m>f)?(s=d,l=h):(r[a++]=s,r[a++]=l,u=s,p=l,s=d,l=h)}}return r[a++]=s,r[a++]=l,a}function ma(t,e,i,o,n,r,a,s){for(var l=0,u=i.length;l<u;++l){var p=i[l];a=ga(t,e,p,o,n,r,a),s.push(a),e=p}return a}function va(t,e,i,o,n){for(var r=void 0!==n?n:[],a=0,s=e;s<i;s+=o)r[a++]=t.slice(s,s+o);return r.length=a,r}function ya(t,e,i,o,n){for(var r=void 0!==n?n:[],a=0,s=0,l=i.length;s<l;++s){var u=i[s];r[a++]=va(t,e,u,o,r[a]),e=u}return r.length=a,r}function _a(t,e,i,o,n){for(var r=void 0!==n?n:[],a=0,s=0,l=i.length;s<l;++s){var u=i[s];r[a++]=ya(t,e,u,o,r[a]),e=u[u.length-1]}return r.length=a,r}function ba(t,e,i,o){for(var n=0,r=t[i-o],a=t[i-o+1];e<i;e+=o){var s=t[e],l=t[e+1];n+=a*s-r*l,r=s,a=l}return n/2}function xa(t,e,i,o){for(var n=0,r=0,a=i.length;r<a;++r){var s=i[r];n+=ba(t,e,s,o),e=s}return n}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 o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}(),wa=function(t){function e(e,i){var o=t.call(this)||this;return o.maxDelta_=-1,o.maxDeltaRevision_=-1,void 0===i||Array.isArray(e[0])?o.setCoordinates(e,i):o.setFlatCoordinates(i,e),o}return ka(e,t),e.prototype.clone=function(){return new e(this.flatCoordinates.slice(),this.layout)},e.prototype.closestPointXY=function(t,e,i,o){return o<Ji(this.getExtent(),t,e)?o:(this.maxDeltaRevision_!=this.getRevision()&&(this.maxDelta_=Math.sqrt(aa(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,0)),this.maxDeltaRevision_=this.getRevision()),la(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,this.maxDelta_,!0,t,e,i,o))},e.prototype.getArea=function(){return ba(this.flatCoordinates,0,this.flatCoordinates.length,this.stride)},e.prototype.getCoordinates=function(){return va(this.flatCoordinates,0,this.flatCoordinates.length,this.stride)},e.prototype.getSimplifiedGeometryInternal=function(t){var i=[];return i.length=ca(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,t,i,0),new e(i,Xr)},e.prototype.getType=function(){return jo},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=da(this.flatCoordinates,0,t,this.stride),this.changed()},e}(na),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 o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}(),Ca=function(t){function e(e,i){var o=t.call(this)||this;return o.setCoordinates(e,i),o}return Sa(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,o){var n=this.flatCoordinates,r=De(t,e,n[0],n[1]);if(r<o){for(var a=this.stride,s=0;s<a;++s)i[s]=n[s];return i.length=a,r}return o},e.prototype.getCoordinates=function(){return this.flatCoordinates?this.flatCoordinates.slice():[]},e.prototype.computeExtent=function(t){return ao(this.flatCoordinates,t)},e.prototype.getType=function(){return Po},e.prototype.intersectsExtent=function(t){return eo(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=pa(this.flatCoordinates,0,t,this.stride),this.changed()},e}(na);function za(t,e,i,o,n){return!fo(n,(function(n){return!Ta(t,e,i,o,n[0],n[1])}))}function Ta(t,e,i,o,n,r){for(var a=0,s=t[i-o],l=t[i-o+1];e<i;e+=o){var u=t[e],p=t[e+1];l<=r?p>r&&(u-s)*(r-l)-(n-s)*(p-l)>0&&a++:p<=r&&(u-s)*(r-l)-(n-s)*(p-l)<0&&a--,s=u,l=p}return 0!==a}function Ea(t,e,i,o,n,r){if(0===i.length)return!1;if(!Ta(t,e,i[0],o,n,r))return!1;for(var a=1,s=i.length;a<s;++a)if(Ta(t,i[a-1],i[a],o,n,r))return!1;return!0}function Pa(t,e,i,o,n,r,a){for(var s,l,u,p,d,h,c,f=n[r+1],g=[],m=0,v=i.length;m<v;++m){var y=i[m];for(p=t[y-o],h=t[y-o+1],s=e;s<y;s+=o)d=t[s],c=t[s+1],(f<=h&&c<=f||h<=f&&f<=c)&&(u=(f-h)/(c-h)*(d-p)+p,g.push(u)),p=d,h=c}var _=NaN,b=-1/0;for(g.sort(ht),p=g[0],s=1,l=g.length;s<l;++s){d=g[s];var x=Math.abs(d-p);x>b&&Ea(t,e,i,o,u=(p+d)/2,f)&&(_=u,b=x),p=d}return isNaN(_)&&(_=n[r]),a?(a.push(_,f,b),a):[_,f,b]}function Oa(t,e,i,o,n){for(var r=[],a=0,s=i.length;a<s;++a){var l=i[a];r=Pa(t,e,l,o,n,2*a,r),e=l[l.length-1]}return r}function ja(t,e,i,o,n){var r;for(e+=o;e<i;e+=o)if(r=n(t.slice(e-o,e),t.slice(e,e+o)))return r;return!1}function Ra(t,e,i,o,n){var r=ho([1/0,1/0,-1/0,-1/0],t,e,i,o);return!!zo(n,r)&&(!!to(n,r)||(r[0]>=n[0]&&r[2]<=n[2]||(r[1]>=n[1]&&r[3]<=n[3]||ja(t,e,i,o,(function(t,e){return function(t,e,i){var o=!1,n=io(t,e),r=io(t,i);if(n===Vi||r===Vi)o=!0;else{var a=t[0],s=t[1],l=t[2],u=t[3],p=e[0],d=e[1],h=i[0],c=i[1],f=(c-d)/(h-p),g=void 0,m=void 0;r&Ui&&!(n&Ui)&&(o=(g=h-(c-u)/f)>=a&&g<=l),o||!(r&Xi)||n&Xi||(o=(m=c-(h-l)*f)>=s&&m<=u),o||!(r&Ki)||n&Ki||(o=(g=h-(c-s)/f)>=a&&g<=l),o||!(r&Yi)||n&Yi||(o=(m=c-(h-a)*f)>=s&&m<=u)}return o}(n,t,e)})))))}function Ia(t,e,i,o,n){if(!function(t,e,i,o,n){return!!(Ra(t,e,i,o,n)||Ta(t,e,i,o,n[0],n[1])||Ta(t,e,i,o,n[0],n[3])||Ta(t,e,i,o,n[2],n[1])||Ta(t,e,i,o,n[2],n[3]))}(t,e,i[0],o,n))return!1;if(1===i.length)return!0;for(var r=1,a=i.length;r<a;++r)if(za(t,i[r-1],i[r],o,n)&&!Ra(t,i[r-1],i[r],o,n))return!1;return!0}function Fa(t,e,i,o){for(;e<i-o;){for(var n=0;n<o;++n){var r=t[e+n];t[e+n]=t[i-o+n],t[i-o+n]=r}e+=o,i-=o}}function Ma(t,e,i,o){for(var n=0,r=t[i-o],a=t[i-o+1];e<i;e+=o){var s=t[e],l=t[e+1];n+=(s-r)*(l+a),r=s,a=l}return 0===n?void 0:n>0}function Aa(t,e,i,o,n){for(var r=void 0!==n&&n,a=0,s=i.length;a<s;++a){var l=i[a],u=Ma(t,e,l,o);if(0===a){if(r&&u||!r&&!u)return!1}else if(r&&!u||!r&&u)return!1;e=l}return!0}function Da(t,e,i,o,n){for(var r=void 0!==n&&n,a=0,s=i.length;a<s;++a){var l=i[a],u=Ma(t,e,l,o);(0===a?r&&u||!r&&!u:r&&!u||!r&&u)&&Fa(t,e,l,o),e=l}return e}function La(t,e,i,o,n){for(var r=0,a=i.length;r<a;++r)e=Da(t,e,i[r],o,n);return e}var 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 o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}(),Na=function(t){function e(e,i,o){var n=t.call(this)||this;return n.ends_=[],n.flatInteriorPointRevision_=-1,n.flatInteriorPoint_=null,n.maxDelta_=-1,n.maxDeltaRevision_=-1,n.orientedRevision_=-1,n.orientedFlatCoordinates_=null,void 0!==i&&o?(n.setFlatCoordinates(i,e),n.ends_=o):n.setCoordinates(e,i),n}return Ga(e,t),e.prototype.appendLinearRing=function(t){this.flatCoordinates?gt(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,o){return o<Ji(this.getExtent(),t,e)?o:(this.maxDeltaRevision_!=this.getRevision()&&(this.maxDelta_=Math.sqrt(sa(this.flatCoordinates,0,this.ends_,this.stride,0)),this.maxDeltaRevision_=this.getRevision()),ua(this.flatCoordinates,0,this.ends_,this.stride,this.maxDelta_,!0,t,e,i,o))},e.prototype.containsXY=function(t,e){return Ea(this.getOrientedFlatCoordinates(),0,this.ends_,this.stride,t,e)},e.prototype.getArea=function(){return xa(this.getOrientedFlatCoordinates(),0,this.ends_,this.stride)},e.prototype.getCoordinates=function(t){var e;return void 0!==t?Da(e=this.getOrientedFlatCoordinates().slice(),0,this.ends_,this.stride,t):e=this.flatCoordinates,ya(e,0,this.ends_,this.stride)},e.prototype.getEnds=function(){return this.ends_},e.prototype.getFlatInteriorPoint=function(){if(this.flatInteriorPointRevision_!=this.getRevision()){var t=yo(this.getExtent());this.flatInteriorPoint_=Pa(this.getOrientedFlatCoordinates(),0,this.ends_,this.stride,t,0),this.flatInteriorPointRevision_=this.getRevision()}return this.flatInteriorPoint_},e.prototype.getInteriorPoint=function(){return new Ca(this.getFlatInteriorPoint(),Yr)},e.prototype.getLinearRingCount=function(){return this.ends_.length},e.prototype.getLinearRing=function(t){return t<0||this.ends_.length<=t?null:new wa(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_,o=[],n=0,r=0,a=i.length;r<a;++r){var s=i[r],l=new wa(e.slice(n,s),t);o.push(l),n=s}return o},e.prototype.getOrientedFlatCoordinates=function(){if(this.orientedRevision_!=this.getRevision()){var t=this.flatCoordinates;Aa(t,0,this.ends_,this.stride)?this.orientedFlatCoordinates_=t:(this.orientedFlatCoordinates_=t.slice(),this.orientedFlatCoordinates_.length=Da(this.orientedFlatCoordinates_,0,this.ends_,this.stride)),this.orientedRevision_=this.getRevision()}return this.orientedFlatCoordinates_},e.prototype.getSimplifiedGeometryInternal=function(t){var i=[],o=[];return i.length=ma(this.flatCoordinates,0,this.ends_,this.stride,Math.sqrt(t),i,0,o),new e(i,Xr,o)},e.prototype.getType=function(){return Ro},e.prototype.intersectsExtent=function(t){return Ia(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=ha(this.flatCoordinates,0,t,this.stride,this.ends_);this.flatCoordinates.length=0===i.length?0:i[i.length-1],this.changed()},e}(na),Ba=Na;function qa(t){var e=t[0],i=t[1],o=t[2],n=t[3],r=[e,i,e,n,o,n,o,i,e,i];return new Na(r,Xr,[r.length])}function Wa(t,e,i){for(var o=e||32,n=t.getStride(),r=t.getLayout(),a=t.getCenter(),s=n*(o+1),l=new Array(s),u=0;u<s;u+=n){l[u]=0,l[u+1]=0;for(var p=2;p<n;p++)l[u+p]=a[p]}var d=[l.length],h=new Na(l,r,d);return function(t,e,i,o){for(var n=t.getFlatCoordinates(),r=t.getStride(),a=n.length/r-1,s=o||0,l=0;l<=a;++l){var u=l*r,p=s+2*Ge(l,a)*Math.PI/a;n[u]=e[0]+i*Math.cos(p),n[u+1]=e[1]+i*Math.sin(p)}t.changed()}(h,a,t.getRadius(),i),h}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 o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}();function Ua(t,e){setTimeout((function(){t(e)}),0)}function Xa(t){return!(t.sourceCenter&&t.targetCenter&&!Wo(t.sourceCenter,t.targetCenter))&&(t.sourceResolution===t.targetResolution&&t.sourceRotation===t.targetRotation)}function Ka(t,e,i,o,n){var r=Math.cos(-n),a=Math.sin(-n),s=t[0]*r-t[1]*a,l=t[1]*r+t[0]*a;return[(s+=(e[0]/2-i[0])*o)*r-(l+=(i[1]-e[1]/2)*o)*(a=-a),l*r+s*a]}var Ya=function(t){function e(e){var i=t.call(this)||this;i.on,i.once,i.un;var o=bt({},e);return i.hints_=[0,0],i.animations_=[],i.updateAnimationKey_,i.projection_=en(o.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,o.center&&(o.center=hn(o.center,i.projection_)),o.extent&&(o.extent=fn(o.extent,i.projection_)),i.applyOptions_(o),i}return Va(e,t),e.prototype.applyOptions_=function(t){var e=function(t){var e,i,o,n=28,r=2,a=void 0!==t.minZoom?t.minZoom:0,s=void 0!==t.maxZoom?t.maxZoom:n,l=void 0!==t.zoomFactor?t.zoomFactor:r,u=void 0!==t.multiWorld&&t.multiWorld,p=void 0===t.smoothResolutionConstraint||t.smoothResolutionConstraint,d=void 0!==t.showFullExtent&&t.showFullExtent,h=en(t.projection,"EPSG:3857"),c=h.getExtent(),f=t.constrainOnlyCenter,g=t.extent;u||g||!h.isGlobal()||(f=!1,g=c);if(void 0!==t.resolutions){var m=t.resolutions;i=m[a],o=void 0!==m[s]?m[s]:m[m.length-1],e=t.constrainResolution?function(t,e,i,o){return function(n,r,a,s){if(void 0!==n){var l=t[0],u=t[t.length-1],p=i?Br(l,i,a,o):l;if(s)return void 0===e||e?qr(n,p,u):Ie(n,u,p);var d=Math.min(p,n),h=Math.floor(ct(t,d,r));return t[h]>p&&h<t.length-1?t[h+1]:t[h]}}}(m,p,!f&&g,d):Wr(i,o,p,!f&&g,d)}else{var v=(c?Math.max(Co(c),xo(c)):360*yi[_i.DEGREES]/h.getMetersPerUnit())/Lr/Math.pow(r,0),y=v/Math.pow(r,n-0);void 0!==(i=t.maxResolution)?a=0:i=v/Math.pow(l,a),void 0===(o=t.minResolution)&&(o=void 0!==t.maxZoom?void 0!==t.maxResolution?i/Math.pow(l,s):v/Math.pow(l,s):y),s=a+Math.floor(Math.log(i/o)/Math.log(l)),o=i/Math.pow(l,s-a),e=t.constrainResolution?function(t,e,i,o,n,r){return function(a,s,l,u){if(void 0!==a){var p=n?Br(e,n,l,r):e,d=void 0!==i?i:0;if(u)return void 0===o||o?qr(a,p,d):Ie(a,d,p);var h=Math.ceil(Math.log(e/p)/Math.log(t)-1e-9),c=-s*(.5-1e-9)+.5,f=Math.min(p,a),g=Math.floor(Math.log(e/f)/Math.log(t)+c),m=Math.max(h,g);return Ie(e/Math.pow(t,m),d,p)}}}(l,i,o,p,!f&&g,d):Wr(i,o,p,!f&&g,d)}return{constraint:e,maxResolution:i,minResolution:o,minZoom:a,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 Gr(t.extent,t.constrainOnlyCenter,e)}var i=en(t.projection,"EPSG:3857");if(!0!==t.multiWorld&&i.isGlobal()){var o=i.getExtent().slice();return o[0]=-1/0,o[2]=1/0,Gr(o,!1,!1)}return Nr}(t),o=e.constraint,n=function(t){if(void 0===t.enableRotation||t.enableRotation){var e=t.constrainRotation;return void 0===e||!0===e?(r=n||Le(5),function(t,e){return e?t:void 0!==t?Math.abs(t)<=r?0:t:void 0}):!1===e?Ur:"number"==typeof e?(i=e,o=2*Math.PI/i,function(t,e){return e?t:void 0!==t?t=Math.floor(t/o+.5)*o:void 0}):Ur}return Vr;var i,o;var n,r}(t);this.constraints_={center:i,resolution:o,rotation:n},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 o=t||[0,0,0,0];e=e||[0,0,0,0];var n=this.getResolution(),r=n/2*(o[3]-e[3]+e[1]-o[1]),a=n/2*(o[0]-e[0]+e[2]-o[2]);this.setCenterInternal([i[0]+r,i[1]-a])}},enumerable:!1,configurable:!0}),e.prototype.getUpdatedOptions_=function(t){var e=bt({},this.options_);return void 0!==e.resolution?e.resolution=this.getResolution():e.zoom=this.getZoom(),e.center=this.getCenterInternal(),e.rotation=this.getRotation(),bt({},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 o=arguments[i];o.center&&((o=bt({},o)).center=hn(o.center,this.getProjection())),o.anchor&&((o=bt({},o)).anchor=hn(o.anchor,this.getProjection())),e[i]=o}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 o=0;o<i&&!this.isDef();++o){var n=arguments[o];n.center&&this.setCenterInternal(n.center),void 0!==n.zoom?this.setZoom(n.zoom):n.resolution&&this.setResolution(n.resolution),void 0!==n.rotation&&this.setRotation(n.rotation)}if(o!==i){for(var r=Date.now(),a=this.targetCenter_.slice(),s=this.targetResolution_,l=this.targetRotation_,u=[];o<i;++o){var p=arguments[o],d={start:r,complete:!1,anchor:p.anchor,duration:void 0!==p.duration?p.duration:1e3,easing:p.easing||ui,callback:e};if(p.center&&(d.sourceCenter=a,d.targetCenter=p.center.slice(),a=d.targetCenter),void 0!==p.zoom?(d.sourceResolution=s,d.targetResolution=this.getResolutionForZoom(p.zoom),s=d.targetResolution):p.resolution&&(d.sourceResolution=s,d.targetResolution=p.resolution,s=d.targetResolution),void 0!==p.rotation){d.sourceRotation=l;var h=Ge(p.rotation-l+Math.PI,2*Math.PI)-Math.PI;d.targetRotation=l+h,l=d.targetRotation}Xa(d)?d.complete=!0:r+=d.duration,u.push(d)}this.animations_.push(u),this.setHint(Ir,1),this.updateAnimations_()}else e&&Ua(e,!0)},e.prototype.getAnimating=function(){return this.hints_[Ir]>0},e.prototype.getInteracting=function(){return this.hints_[Fr]>0},e.prototype.cancelAnimations=function(){var t;this.setHint(Ir,-this.hints_[Ir]);for(var e=0,i=this.animations_.length;e<i;++e){var o=this.animations_[e];if(o[0].callback&&Ua(o[0].callback,!1),!t)for(var n=0,r=o.length;n<r;++n){var a=o[n];if(!a.complete){t=a.anchor;break}}}this.animations_.length=0,this.cancelAnchor_=t,this.nextCenter_=null,this.nextResolution_=NaN,this.nextRotation_=NaN},e.prototype.updateAnimations_=function(){if(void 0!==this.updateAnimationKey_&&(cancelAnimationFrame(this.updateAnimationKey_),this.updateAnimationKey_=void 0),this.getAnimating()){for(var t=Date.now(),e=!1,i=this.animations_.length-1;i>=0;--i){for(var o=this.animations_[i],n=!0,r=0,a=o.length;r<a;++r){var s=o[r];if(!s.complete){var l=t-s.start,u=s.duration>0?l/s.duration:1;u>=1?(s.complete=!0,u=1):n=!1;var p=s.easing(u);if(s.sourceCenter){var d=s.sourceCenter[0],h=s.sourceCenter[1],c=s.targetCenter[0],f=s.targetCenter[1];this.nextCenter_=s.targetCenter;var g=d+p*(c-d),m=h+p*(f-h);this.targetCenter_=[g,m]}if(s.sourceResolution&&s.targetResolution){var v=1===p?s.targetResolution:s.sourceResolution+p*(s.targetResolution-s.sourceResolution);if(s.anchor){var y=this.getViewportSize_(this.getRotation()),_=this.constraints_.resolution(v,0,y,!0);this.targetCenter_=this.calculateCenterZoom(_,s.anchor)}this.nextResolution_=s.targetResolution,this.targetResolution_=v,this.applyTargetState_(!0)}if(void 0!==s.sourceRotation&&void 0!==s.targetRotation){var b=1===p?Ge(s.targetRotation+Math.PI,2*Math.PI)-Math.PI:s.sourceRotation+p*(s.targetRotation-s.sourceRotation);if(s.anchor){var x=this.constraints_.rotation(b,!0);this.targetCenter_=this.calculateCenterRotate(x,s.anchor)}this.nextRotation_=s.targetRotation,this.targetRotation_=b}if(this.applyTargetState_(!0),e=!0,!s.complete)break}}if(n){this.animations_[i]=null,this.setHint(Ir,-1),this.nextCenter_=null,this.nextResolution_=NaN,this.nextRotation_=NaN;var k=o[0].callback;k&&Ua(k,!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,o,n,r=this.getCenterInternal();return void 0!==r&&(Vo(i=[r[0]-e[0],r[1]-e[1]],t-this.getRotation()),n=e,(o=i)[0]+=+n[0],o[1]+=+n[1]),i},e.prototype.calculateCenterZoom=function(t,e){var i,o=this.getCenterInternal(),n=this.getResolution();void 0!==o&&void 0!==n&&(i=[e[0]-t*(e[0]-o[0])/n,e[1]-t*(e[1]-o[1])/n]);return i},e.prototype.getViewportSize_=function(t){var e=this.viewportSize_;if(t){var i=e[0],o=e[1];return[Math.abs(i*Math.cos(t))+Math.abs(o*Math.sin(t)),Math.abs(i*Math.sin(t))+Math.abs(o*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?dn(t,this.getProjection()):t},e.prototype.getCenterInternal=function(){return this.get(Mr)},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 cn(this.calculateExtentInternal(t),this.getProjection())},e.prototype.calculateExtentInternal=function(t){var e=t||this.getViewportSizeMinusPadding_(),i=this.getCenterInternal();Re(i,1);var o=this.getResolution();Re(void 0!==o,2);var n=this.getRotation();return Re(void 0!==n,3),bo(i,o,n,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(Ar)},e.prototype.getResolutions=function(){return this.resolutions_},e.prototype.getResolutionForExtent=function(t,e){return this.getResolutionForExtentInternal(fn(t,this.getProjection()),e)},e.prototype.getResolutionForExtentInternal=function(t,e){var i=e||this.getViewportSizeMinusPadding_(),o=Co(t)/i[0],n=xo(t)/i[1];return Math.max(o,n)},e.prototype.getResolutionForValueFunction=function(t){var e=t||2,i=this.getConstrainedResolution(this.maxResolution_),o=this.minResolution_,n=Math.log(i/o)/Math.log(e);return function(t){return i/Math.pow(e,t*n)}},e.prototype.getRotation=function(){return this.get(Dr)},e.prototype.getValueForResolutionFunction=function(t){var e=Math.log(t||2),i=this.getConstrainedResolution(this.maxResolution_),o=this.minResolution_,n=Math.log(i/o)/e;return function(t){return Math.log(i/t)/e/n}},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(),o=this.getCenterInternal(),n=this.padding_;if(n){var r=this.getViewportSizeMinusPadding_();o=Ka(o,this.getViewportSize_(),[r[0]/2+n[3],r[1]/2+n[0]],e,i)}return{center:o.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,o=this.minZoom_||0;if(this.resolutions_){var n=ct(this.resolutions_,t,1);o=n,e=this.resolutions_[n],i=n==this.resolutions_.length-1?2:e/this.resolutions_[n+1]}else e=this.maxResolution_,i=this.zoomFactor_;return o+Math.log(e/t)/Math.log(i)},e.prototype.getResolutionForZoom=function(t){if(this.resolutions_){if(this.resolutions_.length<=1)return 0;var e=Ie(Math.floor(t),0,this.resolutions_.length-2),i=this.resolutions_[e]/this.resolutions_[e+1];return this.resolutions_[e]/Math.pow(i,Ie(t-e,0,1))}return this.maxResolution_/Math.pow(this.zoomFactor_,t-this.minZoom_)},e.prototype.fit=function(t,e){var i;if(Re(Array.isArray(t)||"function"==typeof t.getSimplifiedGeometry,24),Array.isArray(t))Re(!To(t),25),i=qa(o=fn(t,this.getProjection()));else if(t.getType()===Do){var o;(i=qa(o=fn(t.getExtent(),this.getProjection()))).rotate(this.getRotation(),yo(o))}else{i=t}this.fitInternal(i,e)},e.prototype.rotatedExtentForGeometry=function(t){for(var e=this.getRotation(),i=Math.cos(e),o=Math.sin(-e),n=t.getFlatCoordinates(),r=t.getStride(),a=1/0,s=1/0,l=-1/0,u=-1/0,p=0,d=n.length;p<d;p+=r){var h=n[p]*i-n[p+1]*o,c=n[p]*o+n[p+1]*i;a=Math.min(a,h),s=Math.min(s,c),l=Math.max(l,h),u=Math.max(u,c)}return[a,s,l,u]},e.prototype.fitInternal=function(t,e){var i=e||{},o=i.size;o||(o=this.getViewportSizeMinusPadding_());var n,r=void 0!==i.padding?i.padding:[0,0,0,0],a=void 0!==i.nearest&&i.nearest;n=void 0!==i.minResolution?i.minResolution:void 0!==i.maxZoom?this.getResolutionForZoom(i.maxZoom):0;var s=this.rotatedExtentForGeometry(t),l=this.getResolutionForExtentInternal(s,[o[0]-r[1]-r[3],o[1]-r[0]-r[2]]);l=isNaN(l)?n:Math.max(l,n),l=this.getConstrainedResolution(l,a?0:1);var u=this.getRotation(),p=Math.sin(u),d=Math.cos(u),h=yo(s);h[0]+=(r[1]-r[3])/2*l,h[1]+=(r[0]-r[2])/2*l;var c=h[0]*d-h[1]*p,f=h[1]*d+h[0]*p,g=this.getConstrainedCenter([c,f],l),m=i.callback?i.callback:_t;void 0!==i.duration?this.animateInternal({resolution:l,center:g,duration:i.duration,easing:i.easing},m):(this.targetResolution_=l,this.targetCenter_=g,this.applyTargetState_(!1,!0),Ua(m,!0))},e.prototype.centerOn=function(t,e,i){this.centerOnInternal(hn(t,this.getProjection()),e,i)},e.prototype.centerOnInternal=function(t,e,i){this.setCenterInternal(Ka(t,e,i,this.getResolution(),this.getRotation()))},e.prototype.calculateCenterShift=function(t,e,i,o){var n,r=this.padding_;if(r&&t){var a=this.getViewportSizeMinusPadding_(-i),s=Ka(t,o,[a[0]/2+r[3],a[1]/2+r[0]],e,i);n=[t[0]-s[0],t[1]-s[1]]}return n},e.prototype.isDef=function(){return!!this.getCenterInternal()&&void 0!==this.getResolution()},e.prototype.adjustCenter=function(t){var e=dn(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&&hn(e,this.getProjection());this.adjustResolutionInternal(t,i)},e.prototype.adjustResolutionInternal=function(t,e){var i=this.getAnimating()||this.getInteracting(),o=this.getViewportSize_(this.getRotation()),n=this.constraints_.resolution(this.targetResolution_*t,0,o,i);e&&(this.targetCenter_=this.calculateCenterZoom(n,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=hn(e,this.getProjection())),this.adjustRotationInternal(t,e)},e.prototype.adjustRotationInternal=function(t,e){var i=this.getAnimating()||this.getInteracting(),o=this.constraints_.rotation(this.targetRotation_+t,i);e&&(this.targetCenter_=this.calculateCenterRotate(o,e)),this.targetRotation_+=t,this.applyTargetState_()},e.prototype.setCenter=function(t){this.setCenterInternal(hn(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,o=this.constraints_.rotation(this.targetRotation_,i),n=this.getViewportSize_(o),r=this.constraints_.resolution(this.targetResolution_,0,n,i),a=this.constraints_.center(this.targetCenter_,r,n,i,this.calculateCenterShift(this.targetCenter_,r,o,n));this.get(Dr)!==o&&this.set(Dr,o),this.get(Ar)!==r&&this.set(Ar,r),this.get(Mr)&&Wo(this.get(Mr),a)||this.set(Mr,a),this.getAnimating()&&!t&&this.cancelAnimations(),this.cancelAnchor_=void 0},e.prototype.resolveConstraints=function(t,e,i){var o=void 0!==t?t:200,n=e||0,r=this.constraints_.rotation(this.targetRotation_),a=this.getViewportSize_(r),s=this.constraints_.resolution(this.targetResolution_,n,a),l=this.constraints_.center(this.targetCenter_,s,a,!1,this.calculateCenterShift(this.targetCenter_,s,r,a));if(0===o&&!this.cancelAnchor_)return this.targetResolution_=s,this.targetRotation_=r,this.targetCenter_=l,void this.applyTargetState_();var u=i||(0===o?this.cancelAnchor_:void 0);this.cancelAnchor_=void 0,this.getResolution()===s&&this.getRotation()===r&&this.getCenterInternal()&&Wo(this.getCenterInternal(),l)||(this.getAnimating()&&this.cancelAnimations(),this.animateInternal({rotation:r,center:l,resolution:s,duration:o,easing:li,anchor:u}))},e.prototype.beginInteraction=function(){this.resolveConstraints(0),this.setHint(Fr,1)},e.prototype.endInteraction=function(t,e,i){var o=i&&hn(i,this.getProjection());this.endInteractionInternal(t,e,o)},e.prototype.endInteractionInternal=function(t,e,i){this.setHint(Fr,-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,o=this.getViewportSize_(this.getRotation());return this.constraints_.resolution(t,i,o)},e}($t);function Za(t){return t[0]>0&&t[1]>0}function $a(t,e){return Array.isArray(t)?t:(void 0===e?e=[t,t]:(e[0]=t,e[1]=t),e)}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 o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}();var Ja=function(t){function e(e){var i=t.call(this)||this;i.on,i.once,i.un;var o=function(t){var e=null;void 0!==t.keyboardEventTarget&&(e="string"==typeof t.keyboardEventTarget?document.getElementById(t.keyboardEventTarget):t.keyboardEventTarget);var i,o,n,r={},a=t.layers&&"function"==typeof t.layers.getLayers?t.layers:new mr({layers:t.layers});r[pr]=a,r[hr]=t.target,r[cr]=t.view instanceof Ya?t.view:new Ya,void 0!==t.controls&&(Array.isArray(t.controls)?i=new ai(t.controls.slice()):(Re("function"==typeof t.controls.getArray,47),i=t.controls));void 0!==t.interactions&&(Array.isArray(t.interactions)?o=new ai(t.interactions.slice()):(Re("function"==typeof t.interactions.getArray,48),o=t.interactions));void 0!==t.overlays?Array.isArray(t.overlays)?n=new ai(t.overlays.slice()):(Re("function"==typeof t.overlays.getArray,49),n=t.overlays):n=new ai;return{controls:i,interactions:o,keyboardEventTarget:e,overlays:n,values:r}}(e);i.boundHandleBrowserEvent_=i.handleBrowserEvent.bind(i),i.maxTilesLoading_=void 0!==e.maxTilesLoading?e.maxTilesLoading:16,i.pixelRatio_=void 0!==e.pixelRatio?e.pixelRatio:ne,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_=o.keyboardEventTarget,i.keyHandlerKeys_=null,i.controls=o.controls||new ai,i.interactions=o.interactions||new ai,i.overlays_=o.overlays,i.overlayIdIndex_={},i.renderer_=null,i.handleResize_,i.postRenderFunctions_=[],i.tileQueue_=new Rr(i.getTilePriority.bind(i),i.handleTileChange_.bind(i)),i.addChangeListener(pr,i.handleLayerGroupChanged_),i.addChangeListener(cr,i.handleViewChanged_),i.addChangeListener(dr,i.handleSizeChanged_),i.addChangeListener(hr,i.handleTargetChanged_),i.setProperties(o.values);var n=i;return!e.view||e.view instanceof Ya||e.view.then((function(t){n.setView(new Ya(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 Ha(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 o=this.getCoordinateFromPixelInternal(t),n=void 0!==(i=void 0!==i?i:{}).hitTolerance?i.hitTolerance:0,r=void 0!==i.layerFilter?i.layerFilter:vt,a=!1!==i.checkWrapped;return this.renderer_.forEachFeatureAtCoordinate(o,this.frameState_,n,a,e,null,r,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 o=i||{},n=void 0!==o.hitTolerance?o.hitTolerance:0,r=o.layerFilter||vt;return this.renderer_.forEachLayerAtPixel(t,this.frameState_,n,e,r)}},e.prototype.hasFeatureAtPixel=function(t,e){if(!this.frameState_)return!1;var i=this.getCoordinateFromPixelInternal(t),o=void 0!==(e=void 0!==e?e:{}).layerFilter?e.layerFilter:vt,n=void 0!==e.hitTolerance?e.hitTolerance:0,r=!1!==e.checkWrapped;return this.renderer_.hasFeatureAtCoordinate(i,this.frameState_,n,r,o,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(hr)},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 dn(this.getCoordinateFromPixelInternal(t),this.getView().getProjection())},e.prototype.getCoordinateFromPixelInternal=function(t){var e=this.frameState_;return e?bn(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(pr)},e.prototype.setLayers=function(t){var e=this.getLayerGroup();if(t instanceof ai)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 o=t[e].layer.getSource();if(o&&o.loading)return!0}return!1},e.prototype.getPixelFromCoordinate=function(t){var e=hn(t,this.getView().getProjection());return this.getPixelFromCoordinateInternal(e)},e.prototype.getPixelFromCoordinateInternal=function(t){var e=this.frameState_;return e?bn(e.coordinateToPixelTransform,t.slice(0,2)):null},e.prototype.getRenderer=function(){return this.renderer_},e.prototype.getSize=function(){return this.get(dr)},e.prototype.getView=function(){return this.get(cr)},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,o){return function(t,e,i,o,n){if(!t||!(i in t.wantedTiles))return Sr;if(!t.wantedTiles[i][e.getKey()])return Sr;var r=t.viewState.center,a=o[0]-r[0],s=o[1]-r[1];return 65536*Math.log(n)+Math.sqrt(a*a+s*s)/n}(this.frameState_,t,e,i,o)},e.prototype.handleBrowserEvent=function(t,e){var i=e||t.type,o=new br(i,this,t);this.handleMapBrowserEvent(o)},e.prototype.handleMapBrowserEvent=function(t){if(this.frameState_){var e=t.originalEvent,i=e.type;if(i===mi||i===Lt||i===It){var o=this.getOwnerDocument(),n=this.viewport_.getRootNode?this.viewport_.getRootNode():o,r=e.target;if(this.overlayContainerStopEvent_.contains(r)||!(n===o?o.documentElement:n).contains(r))return}if(t.frameState=this.frameState_,!1!==this.dispatchEvent(t))for(var a=this.getInteractions().getArray().slice(),s=a.length-1;s>=0;s--){var l=a[s];if(l.getMap()===this&&l.getActive()&&this.getTargetElement())if(!l.handleEvent(t)||t.propagationStopped)break}}},e.prototype.handlePostRender=function(){var t=this.frameState_,e=this.tileQueue_;if(!e.isEmpty()){var i=this.maxTilesLoading_,o=i;if(t){var n=t.viewHints;if(n[Ir]||n[Fr]){var r=Date.now()-t.time>8;i=r?0:8,o=r?0:2}}e.getTilesLoading()<i&&(e.reprioritize(),e.loadMoreTiles(i,o))}!t||!this.hasListener(Ke)||t.animate||this.tileQueue_.getTilesLoading()||this.getLoading()||this.renderer_.dispatchRenderEvent(Ke,t);for(var a=this.postRenderFunctions_,s=0,l=a.length;s<l;++s)a[s](this,t);a.length=0},e.prototype.handleSizeChanged_=function(){this.getView()&&!this.getView().getAnimating()&&this.getView().resolveConstraints(0),this.render()},e.prototype.handleTargetChanged_=function(){var t;if(this.getTarget()&&(t=this.getTargetElement()),this.mapBrowserEventHandler_){for(var e=0,i=this.keyHandlerKeys_.length;e<i;++e)Bt(this.keyHandlerKeys_[e]);this.keyHandlerKeys_=null,this.viewport_.removeEventListener(Ot,this.boundHandleBrowserEvent_),this.viewport_.removeEventListener(Lt,this.boundHandleBrowserEvent_),void 0!==this.handleResize_&&(removeEventListener(At,this.handleResize_,!1),this.handleResize_=void 0),this.mapBrowserEventHandler_.dispose(),this.mapBrowserEventHandler_=null,pe(this.viewport_)}if(t){for(var o in t.appendChild(this.viewport_),this.renderer_||(this.renderer_=this.createRenderer()),this.mapBrowserEventHandler_=new wr(this,this.moveTolerance_),xr)this.mapBrowserEventHandler_.addEventListener(xr[o],this.handleMapBrowserEvent.bind(this));this.viewport_.addEventListener(Ot,this.boundHandleBrowserEvent_,!1),this.viewport_.addEventListener(Lt,this.boundHandleBrowserEvent_,!!se&&{passive:!1});var n=this.keyboardEventTarget_?this.keyboardEventTarget_:t;this.keyHandlerKeys_=[Gt(n,It,this.handleBrowserEvent,this),Gt(n,Ft,this.handleBrowserEvent,this)],this.handleResize_||(this.handleResize_=this.updateSize.bind(this),window.addEventListener(At,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_&&(Bt(this.viewPropertyListenerKey_),this.viewPropertyListenerKey_=null),this.viewChangeListenerKey_&&(Bt(this.viewChangeListenerKey_),this.viewChangeListenerKey_=null);var t=this.getView();t&&(this.updateViewportSize_(),this.viewPropertyListenerKey_=Gt(t,pt,this.handleViewPropertyChanged_,this),this.viewChangeListenerKey_=Gt(t,Tt,this.handleViewPropertyChanged_,this),t.resolveConstraints(0)),this.render()},e.prototype.handleLayerGroupChanged_=function(){this.layerGroupPropertyListenerKeys_&&(this.layerGroupPropertyListenerKeys_.forEach(Bt),this.layerGroupPropertyListenerKeys_=null);var t=this.getLayerGroup();t&&(this.layerGroupPropertyListenerKeys_=[Gt(t,pt,this.render,this),Gt(t,Tt,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 o=t[e].layer;o.hasRenderer()&&o.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(),o=this.getView(),n=this.frameState_,r=null;if(void 0!==i&&Za(i)&&o&&o.isDef()){var a=o.getHints(this.frameState_?this.frameState_.viewHints:void 0),s=o.getState();if(r={animate:!1,coordinateToPixelTransform:this.coordinateToPixelTransform_,declutterTree:null,extent:bo(s.center,s.resolution,s.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:s,viewHints:a,wantedTiles:{}},s.nextCenter&&s.nextResolution){var l=isNaN(s.nextRotation)?s.rotation:s.nextRotation;r.nextExtent=bo(s.nextCenter,s.nextResolution,l,i)}}if(this.frameState_=r,this.renderer_.renderFrame(r),r){if(r.animate&&this.render(),Array.prototype.push.apply(this.postRenderFunctions_,r.postRenderFunctions),n)(!this.previousExtent_||!To(this.previousExtent_)&&!lo(r.extent,this.previousExtent_))&&(this.dispatchEvent(new yr(Jt,this,n)),this.previousExtent_=ro(this.previousExtent_));this.previousExtent_&&!r.viewHints[Ir]&&!r.viewHints[Fr]&&!lo(r.extent,this.previousExtent_)&&(this.dispatchEvent(new yr(Qt,this,r)),Hi(r.extent,this.previousExtent_))}this.dispatchEvent(new yr(Ht,this,r)),this.postRenderTimeoutHandle_||(this.postRenderTimeoutHandle_=setTimeout((function(){e.postRenderTimeoutHandle_=void 0,e.handlePostRender()}),0))},e.prototype.setLayerGroup=function(t){this.set(pr,t)},e.prototype.setSize=function(t){this.set(dr,t)},e.prototype.setTarget=function(t){this.set(hr,t)},e.prototype.setView=function(t){if(!t||t instanceof Ya)this.set(cr,t);else{this.set(cr,new Ya);var e=this;t.then((function(t){e.setView(new Ya(t))}))}},e.prototype.updateSize=function(){var t=this.getTargetElement(),e=void 0;if(t){var i=getComputedStyle(t),o=t.offsetWidth-parseFloat(i.borderLeftWidth)-parseFloat(i.paddingLeft)-parseFloat(i.paddingRight)-parseFloat(i.borderRightWidth),n=t.offsetHeight-parseFloat(i.borderTopWidth)-parseFloat(i.paddingTop)-parseFloat(i.paddingBottom)-parseFloat(i.borderBottomWidth);isNaN(o)||isNaN(n)||!Za(e=[o,n])&&(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}($t),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 o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}(),ts="units",es="degrees",is="imperial",os="nautical",ns="metric",rs="us",as=[1,2,5],ss=25.4/.28,ls=function(t){function e(e){var i=this,o=e||{},n=void 0!==o.className?o.className:o.bar?"ol-scale-bar":"ol-scale-line";return(i=t.call(this,{element:document.createElement("div"),render:o.render,target:o.target})||this).on,i.once,i.un,i.innerElement_=document.createElement("div"),i.innerElement_.className=n+"-inner",i.element.className=n+" "+fe,i.element.appendChild(i.innerElement_),i.viewState_=null,i.minWidth_=void 0!==o.minWidth?o.minWidth:64,i.renderedVisible_=!1,i.renderedWidth_=void 0,i.renderedHTML_="",i.addChangeListener(ts,i.handleUnitsChanged_),i.setUnits(o.units||ns),i.scaleBar_=o.bar||!1,i.scaleBarSteps_=o.steps||4,i.scaleBarText_=o.text||!1,i.dpi_=o.dpi||void 0,i}return Qa(e,t),e.prototype.getUnits=function(){return this.get(ts)},e.prototype.handleUnitsChanged_=function(){this.updateElement_()},e.prototype.setUnits=function(t){this.set(ts,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,o=this.getUnits(),n=o==es?_i.DEGREES:_i.METERS,r=Qo(i,t.resolution,e,n),a=this.minWidth_*(this.dpi_||ss)/ss,s=a*r,l="";if(o==es){var u=yi[_i.DEGREES];(s*=u)<u/60?(l="″",r*=3600):s<u?(l="′",r*=60):l="°"}else o==is?s<.9144?(l="in",r/=.0254):s<1609.344?(l="ft",r/=.3048):(l="mi",r/=1609.344):o==os?(r/=1852,l="nm"):o==ns?s<.001?(l="μm",r*=1e6):s<1?(l="mm",r*=1e3):s<1e3?l="m":(l="km",r/=1e3):o==rs?s<.9144?(l="in",r*=39.37):s<1609.344?(l="ft",r/=.30480061):(l="mi",r/=1609.3472):Re(!1,33);for(var p,d,h,c,f=3*Math.floor(Math.log(a*r)/Math.log(10));;){h=Math.floor(f/3);var g=Math.pow(10,h);if(p=as[(f%3+3)%3]*g,d=Math.round(p/r),isNaN(d))return this.element.style.display="none",void(this.renderedVisible_=!1);if(d>=a)break;++f}c=this.scaleBar_?this.createScaleBar(d,p,l):p.toFixed(h<0?-h:0)+" "+l,this.renderedHTML_!=c&&(this.innerElement_.innerHTML=c,this.renderedHTML_=c),this.renderedWidth_!=d&&(this.innerElement_.style.width=d+"px",this.renderedWidth_=d),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 o="1 : "+Math.round(this.getScaleForResolution()).toLocaleString(),n=[],r=t/this.scaleBarSteps_,a="#ffffff",s=0;s<this.scaleBarSteps_;s++)0===s&&n.push(this.createMarker("absolute",s)),n.push('<div><div class="ol-scale-singlebar" style="width: '+r+"px;background-color: "+a+';"></div>'+this.createMarker("relative",s)+(s%2==0||2===this.scaleBarSteps_?this.createStepText(s,t,!1,e,i):"")+"</div>"),s===this.scaleBarSteps_-1&&n.push(this.createStepText(s+1,t,!0,e,i)),a="#ffffff"===a?"#000000":"#ffffff";return'<div style="display: flex;">'+(this.scaleBarText_?'<div class="ol-scale-text" style="width: '+t+'px;">'+o+"</div>":"")+n.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,o,n){var r=(0===t?0:Math.round(o/this.scaleBarSteps_*t*100)/100)+(0===t?"":" "+n);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")+';">'+r+"</div>"},e.prototype.getScaleForResolution=function(){var t=Qo(this.viewState_.projection,this.viewState_.resolution,this.viewState_.center),e=this.dpi_||ss,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}(he);function us(t){var e=t||{},i=new ai;return(void 0===e.zoom||e.zoom)&&i.push(new fi(e.zoomOptions)),(void 0===e.rotate||e.rotate)&&i.push(new hi(e.rotateOptions)),(void 0===e.attribution||e.attribution)&&i.push(new ti(e.attributionOptions)),i}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 o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}();var ds=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 o=e;i.setGeometry(o)}else{var n=e;i.setProperties(n)}return i}return ps(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 o=this.getStyle();return o&&t.setStyle(o),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_&&(Bt(this.geometryChangeKey_),this.geometryChangeKey_=null);var t=this.getGeometry();t&&(this.geometryChangeKey_=Gt(t,Tt,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:(Re("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}($t),hs=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 o=e.dataProjection?Jo(e.dataProjection):this.readProjection(t);e.extent&&o&&o.getUnits()===_i.TILE_PIXELS&&(o=Jo(o)).setWorldExtent(e.extent),i={dataProjection:o,featureProjection:e.featureProjection}}return this.adaptOptions(i)},t.prototype.adaptOptions=function(t){return bt({dataProjection:this.dataProjection,featureProjection:this.defaultFeatureProjection},t)},t.prototype.getType=function(){return Ut()},t.prototype.readFeature=function(t,e){return Ut()},t.prototype.readFeatures=function(t,e){return Ut()},t.prototype.readGeometry=function(t,e){return Ut()},t.prototype.readProjection=function(t){return Ut()},t.prototype.writeFeature=function(t,e){return Ut()},t.prototype.writeFeatures=function(t,e){return Ut()},t.prototype.writeGeometry=function(t,e){return Ut()},t}();function cs(t,e,i){var o,n=i?Jo(i.featureProjection):null,r=i?Jo(i.dataProjection):null;if(o=n&&r&&!nn(n,r)?(e?t.clone():t).transform(e?n:r,e?r:n):t,e&&i&&void 0!==i.decimals){var a=Math.pow(10,i.decimals);o===t&&(o=t.clone()),o.applyTransform((function(t){for(var e=0,i=t.length;e<i;++e)t[e]=Math.round(t[e]*a)/a;return t}))}return o}var fs="arraybuffer",gs="json",ms="text",vs="xml",ys=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 o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}();function _s(t){if("string"==typeof t){var e=JSON.parse(t);return e||null}return null!==t?t:null}var bs=function(t){function e(){return t.call(this)||this}return ys(e,t),e.prototype.getType=function(){return gs},e.prototype.readFeature=function(t,e){return this.readFeatureFromObject(_s(t),this.getReadOptions(t,e))},e.prototype.readFeatures=function(t,e){return this.readFeaturesFromObject(_s(t),this.getReadOptions(t,e))},e.prototype.readFeatureFromObject=function(t,e){return Ut()},e.prototype.readFeaturesFromObject=function(t,e){return Ut()},e.prototype.readGeometry=function(t,e){return this.readGeometryFromObject(_s(t),this.getReadOptions(t,e))},e.prototype.readGeometryFromObject=function(t,e){return Ut()},e.prototype.readProjection=function(t){return this.readProjectionFromObject(_s(t))},e.prototype.readProjectionFromObject=function(t){return Ut()},e.prototype.writeFeature=function(t,e){return JSON.stringify(this.writeFeatureObject(t,e))},e.prototype.writeFeatureObject=function(t,e){return Ut()},e.prototype.writeFeatures=function(t,e){return JSON.stringify(this.writeFeaturesObject(t,e))},e.prototype.writeFeaturesObject=function(t,e){return Ut()},e.prototype.writeGeometry=function(t,e){return JSON.stringify(this.writeGeometryObject(t,e))},e.prototype.writeGeometryObject=function(t,e){return Ut()},e}(hs);function xs(t,e,i,o,n,r,a){var s,l,u=(i-e)/o;if(1===u)s=e;else if(2===u)s=e,l=n;else if(0!==u){for(var p=t[e],d=t[e+1],h=0,c=[0],f=e+o;f<i;f+=o){var g=t[f],m=t[f+1];h+=Math.sqrt((g-p)*(g-p)+(m-d)*(m-d)),c.push(h),p=g,d=m}var v=n*h,y=function(t,e,i){for(var o,n,r=i||ht,a=0,s=t.length,l=!1;a<s;)(n=+r(t[o=a+(s-a>>1)],e))<0?a=o+1:(s=o,l=!n);return l?a:~a}(c,v);y<0?(l=(v-c[-y-2])/(c[-y-1]-c[-y-2]),s=e+(-y-2)*o):s=e+y*o}var _=a>1?a:2,b=r||new Array(_);for(f=0;f<_;++f)b[f]=void 0===s?NaN:void 0===l?t[s+f]:Ne(t[s+f],t[s+o+f],l);return b}function ks(t,e,i,o,n,r){if(i==e)return null;var a;if(n<t[e+o-1])return r?((a=t.slice(e,e+o))[o-1]=n,a):null;if(t[i-1]<n)return r?((a=t.slice(i-o,i))[o-1]=n,a):null;if(n==t[e+o-1])return t.slice(e,e+o);for(var s=e/o,l=i/o;s<l;){var u=s+l>>1;n<t[(u+1)*o-1]?l=u:s=u+1}var p=t[s*o-1];if(n==p)return t.slice((s-1)*o,(s-1)*o+o);var d=(n-p)/(t[(s+1)*o-1]-p);a=[];for(var h=0;h<o-1;++h)a.push(Ne(t[(s-1)*o+h],t[s*o+h],d));return a.push(n),a}function ws(t,e,i,o){for(var n=t[e],r=t[e+1],a=0,s=e+o;s<i;s+=o){var l=t[s],u=t[s+1];a+=Math.sqrt((l-n)*(l-n)+(u-r)*(u-r)),n=l,r=u}return a}var Ss=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 o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}(),Cs=function(t){function e(e,i){var o=t.call(this)||this;return o.flatMidpoint_=null,o.flatMidpointRevision_=-1,o.maxDelta_=-1,o.maxDeltaRevision_=-1,void 0===i||Array.isArray(e[0])?o.setCoordinates(e,i):o.setFlatCoordinates(i,e),o}return Ss(e,t),e.prototype.appendCoordinate=function(t){this.flatCoordinates?gt(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,o){return o<Ji(this.getExtent(),t,e)?o:(this.maxDeltaRevision_!=this.getRevision()&&(this.maxDelta_=Math.sqrt(aa(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,0)),this.maxDeltaRevision_=this.getRevision()),la(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,this.maxDelta_,!1,t,e,i,o))},e.prototype.forEachSegment=function(t){return ja(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,t)},e.prototype.getCoordinateAtM=function(t,e){if(this.layout!=Yr&&this.layout!=Zr)return null;var i=void 0!==e&&e;return ks(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,t,i)},e.prototype.getCoordinates=function(){return va(this.flatCoordinates,0,this.flatCoordinates.length,this.stride)},e.prototype.getCoordinateAt=function(t,e){return xs(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,t,e,this.stride)},e.prototype.getLength=function(){return ws(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=ca(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,t,i,0),new e(i,Xr)},e.prototype.getType=function(){return Oo},e.prototype.intersectsExtent=function(t){return Ra(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=da(this.flatCoordinates,0,t,this.stride),this.changed()},e}(na),zs=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 o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}(),Ts=function(t){function e(e,i,o){var n=t.call(this)||this;if(n.ends_=[],n.maxDelta_=-1,n.maxDeltaRevision_=-1,Array.isArray(e[0]))n.setCoordinates(e,i);else if(void 0!==i&&o)n.setFlatCoordinates(i,e),n.ends_=o;else{for(var r=n.getLayout(),a=e,s=[],l=[],u=0,p=a.length;u<p;++u){var d=a[u];0===u&&(r=d.getLayout()),gt(s,d.getFlatCoordinates()),l.push(s.length)}n.setFlatCoordinates(r,s),n.ends_=l}return n}return zs(e,t),e.prototype.appendLineString=function(t){this.flatCoordinates?gt(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,o){return o<Ji(this.getExtent(),t,e)?o:(this.maxDeltaRevision_!=this.getRevision()&&(this.maxDelta_=Math.sqrt(sa(this.flatCoordinates,0,this.ends_,this.stride,0)),this.maxDeltaRevision_=this.getRevision()),ua(this.flatCoordinates,0,this.ends_,this.stride,this.maxDelta_,!1,t,e,i,o))},e.prototype.getCoordinateAtM=function(t,e,i){if(this.layout!=Yr&&this.layout!=Zr||0===this.flatCoordinates.length)return null;var o=void 0!==e&&e,n=void 0!==i&&i;return function(t,e,i,o,n,r,a){if(a)return ks(t,e,i[i.length-1],o,n,r);var s;if(n<t[o-1])return r?((s=t.slice(0,o))[o-1]=n,s):null;if(t[t.length-1]<n)return r?((s=t.slice(t.length-o))[o-1]=n,s):null;for(var l=0,u=i.length;l<u;++l){var p=i[l];if(e!=p){if(n<t[e+o-1])return null;if(n<=t[p-1])return ks(t,e,p,o,n,!1);e=p}}return null}(this.flatCoordinates,0,this.ends_,this.stride,t,o,n)},e.prototype.getCoordinates=function(){return ya(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 Cs(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,o=[],n=0,r=0,a=e.length;r<a;++r){var s=e[r],l=new Cs(t.slice(n,s),i);o.push(l),n=s}return o},e.prototype.getFlatMidpoints=function(){for(var t=[],e=this.flatCoordinates,i=0,o=this.ends_,n=this.stride,r=0,a=o.length;r<a;++r){var s=o[r];gt(t,xs(e,i,s,n,.5)),i=s}return t},e.prototype.getSimplifiedGeometryInternal=function(t){var i=[],o=[];return i.length=function(t,e,i,o,n,r,a,s){for(var l=0,u=i.length;l<u;++l){var p=i[l];a=ca(t,e,p,o,n,r,a),s.push(a),e=p}return a}(this.flatCoordinates,0,this.ends_,this.stride,t,i,0,o),new e(i,Xr,o)},e.prototype.getType=function(){return Fo},e.prototype.intersectsExtent=function(t){return function(t,e,i,o,n){for(var r=0,a=i.length;r<a;++r){if(Ra(t,e,i[r],o,n))return!0;e=i[r]}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=ha(this.flatCoordinates,0,t,this.stride,this.ends_);this.flatCoordinates.length=0===i.length?0:i[i.length-1],this.changed()},e}(na),Es=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 o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}(),Ps=function(t){function e(e,i){var o=t.call(this)||this;return i&&!Array.isArray(e[0])?o.setFlatCoordinates(i,e):o.setCoordinates(e,i),o}return Es(e,t),e.prototype.appendPoint=function(t){this.flatCoordinates?gt(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,o){if(o<Ji(this.getExtent(),t,e))return o;for(var n=this.flatCoordinates,r=this.stride,a=0,s=n.length;a<s;a+=r){var l=De(t,e,n[a],n[a+1]);if(l<o){o=l;for(var u=0;u<r;++u)i[u]=n[a+u];i.length=r}}return o},e.prototype.getCoordinates=function(){return va(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 Ca(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,o=[],n=0,r=t.length;n<r;n+=i){var a=new Ca(t.slice(n,n+i),e);o.push(a)}return o},e.prototype.getType=function(){return Io},e.prototype.intersectsExtent=function(t){for(var e=this.flatCoordinates,i=this.stride,o=0,n=e.length;o<n;o+=i){if(eo(t,e[o],e[o+1]))return!0}return!1},e.prototype.setCoordinates=function(t,e){this.setLayout(e,t,1),this.flatCoordinates||(this.flatCoordinates=[]),this.flatCoordinates.length=da(this.flatCoordinates,0,t,this.stride),this.changed()},e}(na);function Os(t,e,i,o){for(var n=[],r=[1/0,1/0,-1/0,-1/0],a=0,s=i.length;a<s;++a){var l=i[a];r=so(t,e,l[0],o),n.push((r[0]+r[2])/2,(r[1]+r[3])/2),e=l[l.length-1]}return n}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 o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}(),Rs=function(t){function e(e,i,o){var n=t.call(this)||this;if(n.endss_=[],n.flatInteriorPointsRevision_=-1,n.flatInteriorPoints_=null,n.maxDelta_=-1,n.maxDeltaRevision_=-1,n.orientedRevision_=-1,n.orientedFlatCoordinates_=null,!o&&!Array.isArray(e[0])){for(var r=n.getLayout(),a=e,s=[],l=[],u=0,p=a.length;u<p;++u){var d=a[u];0===u&&(r=d.getLayout());for(var h=s.length,c=d.getEnds(),f=0,g=c.length;f<g;++f)c[f]+=h;gt(s,d.getFlatCoordinates()),l.push(c)}i=r,e=s,o=l}return void 0!==i&&o?(n.setFlatCoordinates(i,e),n.endss_=o):n.setCoordinates(e,i),n}return js(e,t),e.prototype.appendPolygon=function(t){var e;if(this.flatCoordinates){var i=this.flatCoordinates.length;gt(this.flatCoordinates,t.getFlatCoordinates());for(var o=0,n=(e=t.getEnds().slice()).length;o<n;++o)e[o]+=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),o=0;o<t;++o)i[o]=this.endss_[o].slice();var n=new e(this.flatCoordinates.slice(),this.layout,i);return n.applyProperties(this),n},e.prototype.closestPointXY=function(t,e,i,o){return o<Ji(this.getExtent(),t,e)?o:(this.maxDeltaRevision_!=this.getRevision()&&(this.maxDelta_=Math.sqrt(function(t,e,i,o,n){for(var r=0,a=i.length;r<a;++r){var s=i[r];n=sa(t,e,s,o,n),e=s[s.length-1]}return n}(this.flatCoordinates,0,this.endss_,this.stride,0)),this.maxDeltaRevision_=this.getRevision()),function(t,e,i,o,n,r,a,s,l,u,p){for(var d=p||[NaN,NaN],h=0,c=i.length;h<c;++h){var f=i[h];u=ua(t,e,f,o,n,r,a,s,l,u,d),e=f[f.length-1]}return u}(this.getOrientedFlatCoordinates(),0,this.endss_,this.stride,this.maxDelta_,!0,t,e,i,o))},e.prototype.containsXY=function(t,e){return function(t,e,i,o,n,r){if(0===i.length)return!1;for(var a=0,s=i.length;a<s;++a){var l=i[a];if(Ea(t,e,l,o,n,r))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,o){for(var n=0,r=0,a=i.length;r<a;++r){var s=i[r];n+=xa(t,e,s,o),e=s[s.length-1]}return n}(this.getOrientedFlatCoordinates(),0,this.endss_,this.stride)},e.prototype.getCoordinates=function(t){var e;return void 0!==t?La(e=this.getOrientedFlatCoordinates().slice(),0,this.endss_,this.stride,t):e=this.flatCoordinates,_a(e,0,this.endss_,this.stride)},e.prototype.getEndss=function(){return this.endss_},e.prototype.getFlatInteriorPoints=function(){if(this.flatInteriorPointsRevision_!=this.getRevision()){var t=Os(this.flatCoordinates,0,this.endss_,this.stride);this.flatInteriorPoints_=Oa(this.getOrientedFlatCoordinates(),0,this.endss_,this.stride,t),this.flatInteriorPointsRevision_=this.getRevision()}return this.flatInteriorPoints_},e.prototype.getInteriorPoints=function(){return new Ps(this.getFlatInteriorPoints().slice(),Yr)},e.prototype.getOrientedFlatCoordinates=function(){if(this.orientedRevision_!=this.getRevision()){var t=this.flatCoordinates;!function(t,e,i,o,n){for(var r=0,a=i.length;r<a;++r){var s=i[r];if(!Aa(t,e,s,o,n))return!1;s.length&&(e=s[s.length-1])}return!0}(t,0,this.endss_,this.stride)?(this.orientedFlatCoordinates_=t.slice(),this.orientedFlatCoordinates_.length=La(this.orientedFlatCoordinates_,0,this.endss_,this.stride)):this.orientedFlatCoordinates_=t,this.orientedRevision_=this.getRevision()}return this.orientedFlatCoordinates_},e.prototype.getSimplifiedGeometryInternal=function(t){var i=[],o=[];return i.length=function(t,e,i,o,n,r,a,s){for(var l=0,u=i.length;l<u;++l){var p=i[l],d=[];a=ma(t,e,p,o,n,r,a,d),s.push(d),e=p[p.length-1]}return a}(this.flatCoordinates,0,this.endss_,this.stride,Math.sqrt(t),i,0,o),new e(i,Xr,o)},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 o=this.endss_[t].slice(),n=o[o.length-1];if(0!==e)for(var r=0,a=o.length;r<a;++r)o[r]-=e;return new Ba(this.flatCoordinates.slice(e,n),this.layout,o)},e.prototype.getPolygons=function(){for(var t=this.layout,e=this.flatCoordinates,i=this.endss_,o=[],n=0,r=0,a=i.length;r<a;++r){var s=i[r].slice(),l=s[s.length-1];if(0!==n)for(var u=0,p=s.length;u<p;++u)s[u]-=n;var d=new Ba(e.slice(n,l),t,s);o.push(d),n=l}return o},e.prototype.getType=function(){return Mo},e.prototype.intersectsExtent=function(t){return function(t,e,i,o,n){for(var r=0,a=i.length;r<a;++r){var s=i[r];if(Ia(t,e,s,o,n))return!0;e=s[s.length-1]}return!1}(this.getOrientedFlatCoordinates(),0,this.endss_,this.stride,t)},e.prototype.setCoordinates=function(t,e){this.setLayout(e,t,3),this.flatCoordinates||(this.flatCoordinates=[]);var i=function(t,e,i,o,n){for(var r=n||[],a=0,s=0,l=i.length;s<l;++s){var u=ha(t,e,i[s],o,r[a]);r[a++]=u,e=u[u.length-1]}return r.length=a,r}(this.flatCoordinates,0,t,this.stride,this.endss_);if(0===i.length)this.flatCoordinates.length=0;else{var o=i[i.length-1];this.flatCoordinates.length=0===o.length?0:o[o.length-1]}this.changed()},e}(na),Is=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 o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}();function Fs(t){for(var e=[],i=0,o=t.length;i<o;++i)e.push(t[i].clone());return e}var Ms=function(t){function e(e){var i=t.call(this)||this;return i.geometries_=e||null,i.changeEventsKeys_=[],i.listenGeometriesChange_(),i}return Is(e,t),e.prototype.unlistenGeometriesChange_=function(){this.changeEventsKeys_.forEach(Bt),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(Gt(this.geometries_[t],Tt,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,o){if(o<Ji(this.getExtent(),t,e))return o;for(var n=this.geometries_,r=0,a=n.length;r<a;++r)o=n[r].closestPointXY(t,e,i,o);return o},e.prototype.containsXY=function(t,e){for(var i=this.geometries_,o=0,n=i.length;o<n;++o)if(i[o].containsXY(t,e))return!0;return!1},e.prototype.computeExtent=function(t){ro(t);for(var e=this.geometries_,i=0,o=e.length;i<o;++i)uo(t,e[i].getExtent());return t},e.prototype.getGeometries=function(){return Fs(this.geometries_)},e.prototype.getGeometriesArray=function(){return this.geometries_},e.prototype.getGeometriesArrayRecursive=function(){for(var t=[],e=this.geometries_,i=0,o=e.length;i<o;++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=[],o=this.geometries_,n=!1,r=0,a=o.length;r<a;++r){var s=o[r],l=s.getSimplifiedGeometry(t);i.push(l),l!==s&&(n=!0)}if(n){var u=new e(null);return u.setGeometriesArray(i),u}return this.simplifiedGeometryMaxMinSquaredTolerance=t,this},e.prototype.getType=function(){return Ao},e.prototype.intersectsExtent=function(t){for(var e=this.geometries_,i=0,o=e.length;i<o;++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_,o=0,n=i.length;o<n;++o)i[o].rotate(t,e);this.changed()},e.prototype.scale=function(t,e,i){var o=i;o||(o=yo(this.getExtent()));for(var n=this.geometries_,r=0,a=n.length;r<a;++r)n[r].scale(t,e,o);this.changed()},e.prototype.setGeometries=function(t){this.setGeometriesArray(Fs(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,o=e.length;i<o;++i)e[i].applyTransform(t);this.changed()},e.prototype.translate=function(t,e){for(var i=this.geometries_,o=0,n=i.length;o<n;++o)i[o].translate(t,e);this.changed()},e.prototype.disposeInternal=function(){this.unlistenGeometriesChange_(),t.prototype.disposeInternal.call(this)},e}(ea),As=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 o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}();function Ds(t,e){if(!t)return null;var i;switch(t.type){case Po:i=function(t){return new Ca(t.coordinates)}(t);break;case Oo:i=function(t){return new Cs(t.coordinates)}(t);break;case Ro:i=function(t){return new Ba(t.coordinates)}(t);break;case Io:i=function(t){return new Ps(t.coordinates)}(t);break;case Fo:i=function(t){return new Ts(t.coordinates)}(t);break;case Mo:i=function(t){return new Rs(t.coordinates)}(t);break;case Ao:i=function(t,e){var i=t.geometries.map((function(t){return Ds(t,e)}));return new Ms(i)}(t);break;default:throw new Error("Unsupported GeoJSON type: "+t.type)}return cs(i,!1,e)}function Ls(t,e){var i,o=(t=cs(t,!0,e)).getType();switch(o){case Po:i=function(t,e){return{type:"Point",coordinates:t.getCoordinates()}}(t);break;case Oo:i=function(t,e){return{type:"LineString",coordinates:t.getCoordinates()}}(t);break;case Ro:i=function(t,e){var i;e&&(i=e.rightHanded);return{type:"Polygon",coordinates:t.getCoordinates(i)}}(t,e);break;case Io:i=function(t,e){return{type:"MultiPoint",coordinates:t.getCoordinates()}}(t);break;case Fo:i=function(t,e){return{type:"MultiLineString",coordinates:t.getCoordinates()}}(t);break;case Mo:i=function(t,e){var i;e&&(i=e.rightHanded);return{type:"MultiPolygon",coordinates:t.getCoordinates(i)}}(t,e);break;case Ao:i=function(t,e){return{type:"GeometryCollection",geometries:t.getGeometriesArray().map((function(t){var i=bt({},e);return delete i.featureProjection,Ls(t,i)}))}}(t,e);break;case Do:i={type:"GeometryCollection",geometries:[]};break;default:throw new Error("Unsupported geometry type: "+o)}return i}var Gs=function(t){function e(e){var i=this,o=e||{};return(i=t.call(this)||this).dataProjection=Jo(o.dataProjection?o.dataProjection:"EPSG:4326"),o.featureProjection&&(i.defaultFeatureProjection=Jo(o.featureProjection)),i.geometryName_=o.geometryName,i.extractGeometryName_=o.extractGeometryName,i.supportedMediaTypes=["application/geo+json","application/vnd.geo+json"],i}return As(e,t),e.prototype.readFeatureFromObject=function(t,e){var i=null,o=Ds((i="Feature"===t.type?t:{type:"Feature",geometry:t,properties:null}).geometry,e),n=new ds;return this.geometryName_?n.setGeometryName(this.geometryName_):this.extractGeometryName_&&"geometry_name"in i!==void 0&&n.setGeometryName(i.geometry_name),n.setGeometry(o),"id"in i&&n.setId(i.id),i.properties&&n.setProperties(i.properties,!0),n},e.prototype.readFeaturesFromObject=function(t,e){var i=null;if("FeatureCollection"===t.type){i=[];for(var o=t.features,n=0,r=o.length;n<r;++n)i.push(this.readFeatureFromObject(o[n],e))}else i=[this.readFeatureFromObject(t,e)];return i},e.prototype.readGeometryFromObject=function(t,e){return Ds(t,e)},e.prototype.readProjectionFromObject=function(t){var e,i=t.crs;return i?"name"==i.type?e=Jo(i.properties.name):"EPSG"===i.type?e=Jo("EPSG:"+i.properties.code):Re(!1,36):e=this.dataProjection,e},e.prototype.writeFeatureObject=function(t,e){e=this.adaptOptions(e);var i={type:"Feature",geometry:null,properties:null},o=t.getId();if(void 0!==o&&(i.id=o),!t.hasProperties())return i;var n=t.getProperties(),r=t.getGeometry();return r&&(i.geometry=Ls(r,e),delete n[t.getGeometryName()]),wt(n)||(i.properties=n),i},e.prototype.writeFeaturesObject=function(t,e){e=this.adaptOptions(e);for(var i=[],o=0,n=t.length;o<n;++o)i.push(this.writeFeatureObject(t[o],e));return{type:"FeatureCollection",features:i}},e.prototype.writeGeometryObject=function(t,e){return Ls(t,this.adaptOptions(e))},e}(bs),Ns=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}(),Bs="fraction",qs="pixels",Ws="bottom-left",Vs="bottom-right",Us="top-left",Xs="top-right",Ks=0,Ys=1,Zs=2,$s=3,Hs=function(){function t(t){this.opacity_=t.opacity,this.rotateWithView_=t.rotateWithView,this.rotation_=t.rotation,this.scale_=t.scale,this.scaleArray_=$a(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 Ut()},t.prototype.getImage=function(t){return Ut()},t.prototype.getHitDetectionImage=function(){return Ut()},t.prototype.getPixelRatio=function(t){return 1},t.prototype.getImageState=function(){return Ut()},t.prototype.getImageSize=function(){return Ut()},t.prototype.getOrigin=function(){return Ut()},t.prototype.getSize=function(){return Ut()},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_=$a(t)},t.prototype.listenImageChange=function(t){Ut()},t.prototype.load=function(){Ut()},t.prototype.unlistenImageChange=function(t){Ut()},t}(),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 o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}(),Qs=function(t){function e(e,i,o,n){var r=t.call(this)||this;return r.extent=e,r.pixelRatio_=o,r.resolution=i,r.state=n,r}return Js(e,t),e.prototype.changed=function(){this.dispatchEvent(Tt)},e.prototype.getExtent=function(){return this.extent},e.prototype.getImage=function(){return Ut()},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(){Ut()},e}(zt),tl=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 o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}();function el(t,e,i){var o=t;if(o.src&&ae){var n=o.decode(),r=!0;return n.then((function(){r&&e()})).catch((function(t){r&&("EncodingError"===t.name&&"Invalid image type."===t.message?e():i())})),function(){r=!1}}var a=[Nt(o,Mt,e),Nt(o,Et,i)];return function(){a.forEach(Bt)}}!function(t){function e(e,i,o,n,r,a){var s=t.call(this,e,i,o,Ks)||this;return s.src_=n,s.image_=new Image,null!==r&&(s.image_.crossOrigin=r),s.unlisten_=null,s.state=Ks,s.imageLoadFunction_=a,s}tl(e,t),e.prototype.getImage=function(){return this.image_},e.prototype.handleImageError_=function(){this.state=$s,this.unlistenImage_(),this.changed()},e.prototype.handleImageLoad_=function(){void 0===this.resolution&&(this.resolution=xo(this.extent)/this.image_.height),this.state=Zs,this.unlistenImage_(),this.changed()},e.prototype.load=function(){this.state!=Ks&&this.state!=$s||(this.state=Ys,this.changed(),this.imageLoadFunction_(this,this.src_),this.unlisten_=el(this.image_,this.handleImageLoad_.bind(this),this.handleImageError_.bind(this)))},e.prototype.setImage=function(t){this.image_=t,this.resolution=xo(this.extent)/this.image_.height},e.prototype.unlistenImage_=function(){this.unlisten_&&(this.unlisten_(),this.unlisten_=null)}}(Qs);var 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 o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}(),ol=null,nl=function(t){function e(e,i,o,n,r,a){var s=t.call(this)||this;return s.hitDetectionImage_=null,s.image_=e||new Image,null!==n&&(s.image_.crossOrigin=n),s.canvas_={},s.color_=a,s.unlisten_=null,s.imageState_=r,s.size_=o,s.src_=i,s.tainted_,s}return il(e,t),e.prototype.isTainted_=function(){if(void 0===this.tainted_&&this.imageState_===Zs){ol||(ol=le(1,1)),ol.drawImage(this.image_,0,0);try{ol.getImageData(0,0,1,1),this.tainted_=!1}catch(t){ol=null,this.tainted_=!0}}return!0===this.tainted_},e.prototype.dispatchChangeEvent_=function(){this.dispatchEvent(Tt)},e.prototype.handleImageError_=function(){this.imageState_=$s,this.unlistenImage_(),this.dispatchChangeEvent_()},e.prototype.handleImageLoad_=function(){this.imageState_=Zs,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=le(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_==Ks){this.imageState_=Ys;try{this.image_.src=this.src_}catch(t){this.handleImageError_()}this.unlisten_=el(this.image_,this.handleImageLoad_.bind(this),this.handleImageError_.bind(this))}},e.prototype.replaceColor_=function(t){if(this.color_&&!this.canvas_[t]&&this.imageState_===Zs){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=Tn(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 o=i.getImageData(0,0,e.width,e.height),n=o.data,r=this.color_[0]/255,a=this.color_[1]/255,s=this.color_[2]/255,l=this.color_[3],u=0,p=n.length;u<p;u+=4)n[u]*=r,n[u+1]*=a,n[u+2]*=s,n[u+3]*=l;i.putImageData(o,0,0)}}},e.prototype.unlistenImage_=function(){this.unlisten_&&(this.unlisten_(),this.unlisten_=null)},e}(zt);var rl=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 o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}(),al=function(t){function e(e){var i=this,o=e||{},n=void 0!==o.opacity?o.opacity:1,r=void 0!==o.rotation?o.rotation:0,a=void 0!==o.scale?o.scale:1,s=void 0!==o.rotateWithView&&o.rotateWithView;(i=t.call(this,{opacity:n,rotation:r,scale:a,displacement:void 0!==o.displacement?o.displacement:[0,0],rotateWithView:s})||this).anchor_=void 0!==o.anchor?o.anchor:[.5,.5],i.normalizedAnchor_=null,i.anchorOrigin_=void 0!==o.anchorOrigin?o.anchorOrigin:Us,i.anchorXUnits_=void 0!==o.anchorXUnits?o.anchorXUnits:Bs,i.anchorYUnits_=void 0!==o.anchorYUnits?o.anchorYUnits:Bs,i.crossOrigin_=void 0!==o.crossOrigin?o.crossOrigin:null;var l=void 0!==o.img?o.img:null,u=void 0!==o.imgSize?o.imgSize:null,p=o.src;Re(!(void 0!==p&&l),4),Re(!l||l&&u,5),void 0!==p&&0!==p.length||!l||(p=l.src||Kt(l)),Re(void 0!==p&&p.length>0,6);var d=void 0!==o.src?Ks:Zs;return i.color_=void 0!==o.color?jn(o.color):null,i.iconImage_=function(t,e,i,o,n,r){var a=Mn.get(e,o,r);return a||(a=new nl(t,e,i,o,n,r),Mn.set(e,o,r,a)),a}(l,p,u,i.crossOrigin_,d,i.color_),i.offset_=void 0!==o.offset?o.offset:[0,0],i.offsetOrigin_=void 0!==o.offsetOrigin?o.offsetOrigin:Us,i.origin_=null,i.size_=void 0!==o.size?o.size:null,i}return rl(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_==Bs||this.anchorYUnits_==Bs){if(!e)return null;t=this.anchor_.slice(),this.anchorXUnits_==Bs&&(t[0]*=e[0]),this.anchorYUnits_==Bs&&(t[1]*=e[1])}if(this.anchorOrigin_!=Us){if(!e)return null;t===this.anchor_&&(t=this.anchor_.slice()),this.anchorOrigin_!=Xs&&this.anchorOrigin_!=Vs||(t[0]=-t[0]+e[0]),this.anchorOrigin_!=Ws&&this.anchorOrigin_!=Vs||(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_!=Us){var e=this.getSize(),i=this.iconImage_.getSize();if(!e||!i)return null;t=t.slice(),this.offsetOrigin_!=Xs&&this.offsetOrigin_!=Vs||(t[0]=i[0]-e[0]-t[0]),this.offsetOrigin_!=Ws&&this.offsetOrigin_!=Vs||(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(Tt,t)},e.prototype.load=function(){this.iconImage_.load()},e.prototype.unlistenImageChange=function(t){this.iconImage_.removeEventListener(Tt,t)},e}(Hs),sl=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 ll(t){return Array.isArray(t)?In(t):t}var 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 o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}(),pl=function(t){function e(e){var i=this,o=void 0!==e.rotateWithView&&e.rotateWithView;return(i=t.call(this,{opacity:1,rotateWithView:o,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 ul(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_,o=le(i.size*t,i.size*t);this.draw_(i,o,t),e=o.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 Zs},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 o=this.radius_,n=void 0===this.radius2_?o:this.radius2_;if(o<n){var r=o;o=n,n=r}var a=void 0===this.radius2_?this.points_:2*this.points_,s=2*Math.PI/a,l=n*Math.sin(s),u=o-Math.sqrt(n*n-l*l),p=Math.sqrt(l*l+u*u),d=p/l;if("miter"===t&&d<=i)return d*e;var h=e/2/d,c=e/2*(u/p),f=Math.sqrt((o+h)*(o+h)+c*c)-o;if(void 0===this.radius2_||"bevel"===t)return 2*f;var g=o*Math.sin(s),m=n-Math.sqrt(o*o-g*g),v=Math.sqrt(g*g+m*m)/g;if(v<=i){var y=v*e/2-n-o;return 2*Math.max(f,y)}return 2*f},e.prototype.createRenderOptions=function(){var t,e=Un,i=0,o=null,n=0,r=0;this.stroke_&&(null===(t=this.stroke_.getColor())&&(t=Xn),t=ll(t),void 0===(r=this.stroke_.getWidth())&&(r=1),o=this.stroke_.getLineDash(),n=this.stroke_.getLineDashOffset(),void 0===(e=this.stroke_.getLineJoin())&&(e=Un),void 0===(i=this.stroke_.getMiterLimit())&&(i=10));var a=this.calculateLineJoinSize_(e,r,i),s=Math.max(this.radius_,this.radius2_||0);return{strokeStyle:t,strokeWidth:r,size:Math.ceil(2*s+a),lineDash:o,lineDashOffset:n,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 o=this.fill_.getColor();null===o&&(o=qn),e.fillStyle=ll(o),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=jn(e)),null===e?i=1:Array.isArray(e)&&(i=4===e.length?e[3]:1),0===i){var o=le(t.size,t.size);this.hitDetectionCanvas_=o.canvas,this.drawHitDetectionCanvas_(t,o)}}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 o=void 0===this.radius2_?i:this.radius2_;void 0!==this.radius2_&&(e*=2);for(var n=this.angle_-Math.PI/2,r=2*Math.PI/e,a=0;a<e;a++){var s=n+a*r,l=a%2==0?i:o;t.lineTo(l*Math.cos(s),l*Math.sin(s))}t.closePath()}},e.prototype.drawHitDetectionCanvas_=function(t,e){e.translate(t.size/2,t.size/2),this.createPath_(e),e.fillStyle=qn,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}(Hs),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 o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}(),hl=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 dl(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}(pl),cl=function(){function t(t){var e=t||{};this.geometry_=null,this.geometryFunction_=vl,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_=vl,this.geometry_=t},t.prototype.setZIndex=function(t){this.zIndex_=t},t}();var fl=null;function gl(t,e){if(!fl){var i=new Ns({color:"rgba(255,255,255,0.4)"}),o=new sl({color:"#3399CC",width:1.25});fl=[new cl({image:new hl({fill:i,stroke:o,radius:5}),fill:i,stroke:o})]}return fl}function ml(){var t={},e=[255,255,255,1],i=[0,153,255,1];return t[Ro]=[new cl({fill:new Ns({color:[255,255,255,.5]})})],t[Mo]=t[Ro],t[Oo]=[new cl({stroke:new sl({color:e,width:5})}),new cl({stroke:new sl({color:i,width:3})})],t[Fo]=t[Oo],t[Do]=t[Ro].concat(t[Oo]),t[Po]=[new cl({image:new hl({radius:6,fill:new Ns({color:i}),stroke:new sl({color:e,width:1.5})}),zIndex:1/0})],t[Io]=t[Po],t[Ao]=t[Ro].concat(t[Oo],t[Po]),t}function vl(t){return t.getGeometry()}var yl=cl,_l="point",bl="line",xl=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_=$a(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 Ns({color:"#333"}),this.maxAngle_=void 0!==e.maxAngle?e.maxAngle:Math.PI/4,this.placement_=void 0!==e.placement?e.placement:_l,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_=$a(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}();function kl(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var wl={
|
34
34
|
/*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh <https://feross.org/opensource> */
|
35
|
-
read:function(t,e,i,o,n){var r,a,s=8*n-o-1,l=(1<<s)-1,u=l>>1,p=-7,d=i?n-1:0,h=i?-1:1,c=t[e+d];for(d+=h,r=c&(1<<-p)-1,c>>=-p,p+=s;p>0;r=256*r+t[e+d],d+=h,p-=8);for(a=r&(1<<-p)-1,r>>=-p,p+=o;p>0;a=256*a+t[e+d],d+=h,p-=8);if(0===r)r=1-u;else{if(r===l)return a?NaN:1/0*(c?-1:1);a+=Math.pow(2,o),r-=u}return(c?-1:1)*a*Math.pow(2,r-o)},write:function(t,e,i,o,n,r){var a,s,l,u=8*r-n-1,p=(1<<u)-1,d=p>>1,h=23===n?Math.pow(2,-24)-Math.pow(2,-77):0,c=o?0:r-1,f=o?1:-1,g=e<0||0===e&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(s=isNaN(e)?1:0,a=p):(a=Math.floor(Math.log(e)/Math.LN2),e*(l=Math.pow(2,-a))<1&&(a--,l*=2),(e+=a+d>=1?h/l:h*Math.pow(2,1-d))*l>=2&&(a++,l/=2),a+d>=p?(s=0,a=p):a+d>=1?(s=(e*l-1)*Math.pow(2,n),a+=d):(s=e*Math.pow(2,d-1)*Math.pow(2,n),a=0));n>=8;t[i+c]=255&s,c+=f,s/=256,n-=8);for(a=a<<n|s,u+=n;u>0;t[i+c]=255&a,c+=f,a/=256,u-=8);t[i+c-f]|=128*g}},Sl=zl,Cl=wl;function zl(t){this.buf=ArrayBuffer.isView&&ArrayBuffer.isView(t)?t:new Uint8Array(t||0),this.pos=0,this.type=0,this.length=this.buf.length}zl.Varint=0,zl.Fixed64=1,zl.Bytes=2,zl.Fixed32=5;var Tl=4294967296,El=1/Tl,Pl="undefined"==typeof TextDecoder?null:new TextDecoder("utf8");function Ol(t){return t.type===zl.Bytes?t.readVarint()+t.pos:t.pos+1}function jl(t,e,i){return i?4294967296*e+(t>>>0):4294967296*(e>>>0)+(t>>>0)}function Rl(t,e,i){var o=e<=16383?1:e<=2097151?2:e<=268435455?3:Math.floor(Math.log(e)/(7*Math.LN2));i.realloc(o);for(var n=i.pos-1;n>=t;n--)i.buf[n+o]=i.buf[n]}function Il(t,e){for(var i=0;i<t.length;i++)e.writeVarint(t[i])}function Fl(t,e){for(var i=0;i<t.length;i++)e.writeSVarint(t[i])}function Ml(t,e){for(var i=0;i<t.length;i++)e.writeFloat(t[i])}function Al(t,e){for(var i=0;i<t.length;i++)e.writeDouble(t[i])}function Dl(t,e){for(var i=0;i<t.length;i++)e.writeBoolean(t[i])}function Ll(t,e){for(var i=0;i<t.length;i++)e.writeFixed32(t[i])}function Gl(t,e){for(var i=0;i<t.length;i++)e.writeSFixed32(t[i])}function Nl(t,e){for(var i=0;i<t.length;i++)e.writeFixed64(t[i])}function Bl(t,e){for(var i=0;i<t.length;i++)e.writeSFixed64(t[i])}function ql(t,e){return(t[e]|t[e+1]<<8|t[e+2]<<16)+16777216*t[e+3]}function Wl(t,e,i){t[i]=e,t[i+1]=e>>>8,t[i+2]=e>>>16,t[i+3]=e>>>24}function Vl(t,e){return(t[e]|t[e+1]<<8|t[e+2]<<16)+(t[e+3]<<24)}zl.prototype={destroy:function(){this.buf=null},readFields:function(t,e,i){for(i=i||this.length;this.pos<i;){var o=this.readVarint(),n=o>>3,r=this.pos;this.type=7&o,t(n,e,this),this.pos===r&&this.skip(o)}return e},readMessage:function(t,e){return this.readFields(t,e,this.readVarint()+this.pos)},readFixed32:function(){var t=ql(this.buf,this.pos);return this.pos+=4,t},readSFixed32:function(){var t=Vl(this.buf,this.pos);return this.pos+=4,t},readFixed64:function(){var t=ql(this.buf,this.pos)+ql(this.buf,this.pos+4)*Tl;return this.pos+=8,t},readSFixed64:function(){var t=ql(this.buf,this.pos)+Vl(this.buf,this.pos+4)*Tl;return this.pos+=8,t},readFloat:function(){var t=Cl.read(this.buf,this.pos,!0,23,4);return this.pos+=4,t},readDouble:function(){var t=Cl.read(this.buf,this.pos,!0,52,8);return this.pos+=8,t},readVarint:function(t){var e,i,o=this.buf;return e=127&(i=o[this.pos++]),i<128?e:(e|=(127&(i=o[this.pos++]))<<7,i<128?e:(e|=(127&(i=o[this.pos++]))<<14,i<128?e:(e|=(127&(i=o[this.pos++]))<<21,i<128?e:function(t,e,i){var o,n,r=i.buf;if(n=r[i.pos++],o=(112&n)>>4,n<128)return jl(t,o,e);if(n=r[i.pos++],o|=(127&n)<<3,n<128)return jl(t,o,e);if(n=r[i.pos++],o|=(127&n)<<10,n<128)return jl(t,o,e);if(n=r[i.pos++],o|=(127&n)<<17,n<128)return jl(t,o,e);if(n=r[i.pos++],o|=(127&n)<<24,n<128)return jl(t,o,e);if(n=r[i.pos++],o|=(1&n)<<31,n<128)return jl(t,o,e);throw new Error("Expected varint not more than 10 bytes")}(e|=(15&(i=o[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 o="",n=e;for(;n<i;){var r,a,s,l=t[n],u=null,p=l>239?4:l>223?3:l>191?2:1;if(n+p>i)break;1===p?l<128&&(u=l):2===p?128==(192&(r=t[n+1]))&&(u=(31&l)<<6|63&r)<=127&&(u=null):3===p?(r=t[n+1],a=t[n+2],128==(192&r)&&128==(192&a)&&((u=(15&l)<<12|(63&r)<<6|63&a)<=2047||u>=55296&&u<=57343)&&(u=null)):4===p&&(r=t[n+1],a=t[n+2],s=t[n+3],128==(192&r)&&128==(192&a)&&128==(192&s)&&((u=(15&l)<<18|(63&r)<<12|(63&a)<<6|63&s)<=65535||u>=1114112)&&(u=null)),null===u?(u=65533,p=1):u>65535&&(u-=65536,o+=String.fromCharCode(u>>>10&1023|55296),u=56320|1023&u),o+=String.fromCharCode(u),n+=p}return o}(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!==zl.Bytes)return t.push(this.readVarint(e));var i=Ol(this);for(t=t||[];this.pos<i;)t.push(this.readVarint(e));return t},readPackedSVarint:function(t){if(this.type!==zl.Bytes)return t.push(this.readSVarint());var e=Ol(this);for(t=t||[];this.pos<e;)t.push(this.readSVarint());return t},readPackedBoolean:function(t){if(this.type!==zl.Bytes)return t.push(this.readBoolean());var e=Ol(this);for(t=t||[];this.pos<e;)t.push(this.readBoolean());return t},readPackedFloat:function(t){if(this.type!==zl.Bytes)return t.push(this.readFloat());var e=Ol(this);for(t=t||[];this.pos<e;)t.push(this.readFloat());return t},readPackedDouble:function(t){if(this.type!==zl.Bytes)return t.push(this.readDouble());var e=Ol(this);for(t=t||[];this.pos<e;)t.push(this.readDouble());return t},readPackedFixed32:function(t){if(this.type!==zl.Bytes)return t.push(this.readFixed32());var e=Ol(this);for(t=t||[];this.pos<e;)t.push(this.readFixed32());return t},readPackedSFixed32:function(t){if(this.type!==zl.Bytes)return t.push(this.readSFixed32());var e=Ol(this);for(t=t||[];this.pos<e;)t.push(this.readSFixed32());return t},readPackedFixed64:function(t){if(this.type!==zl.Bytes)return t.push(this.readFixed64());var e=Ol(this);for(t=t||[];this.pos<e;)t.push(this.readFixed64());return t},readPackedSFixed64:function(t){if(this.type!==zl.Bytes)return t.push(this.readSFixed64());var e=Ol(this);for(t=t||[];this.pos<e;)t.push(this.readSFixed64());return t},skip:function(t){var e=7&t;if(e===zl.Varint)for(;this.buf[this.pos++]>127;);else if(e===zl.Bytes)this.pos=this.readVarint()+this.pos;else if(e===zl.Fixed32)this.pos+=4;else{if(e!==zl.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),Wl(this.buf,t,this.pos),this.pos+=4},writeSFixed32:function(t){this.realloc(4),Wl(this.buf,t,this.pos),this.pos+=4},writeFixed64:function(t){this.realloc(8),Wl(this.buf,-1&t,this.pos),Wl(this.buf,Math.floor(t*El),this.pos+4),this.pos+=8},writeSFixed64:function(t){this.realloc(8),Wl(this.buf,-1&t,this.pos),Wl(this.buf,Math.floor(t*El),this.pos+4),this.pos+=8},writeVarint:function(t){(t=+t||0)>268435455||t<0?function(t,e){var i,o;t>=0?(i=t%4294967296|0,o=t/4294967296|0):(o=~(-t/4294967296),4294967295^(i=~(-t%4294967296))?i=i+1|0:(i=0,o=o+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}(o,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 o,n,r=0;r<e.length;r++){if((o=e.charCodeAt(r))>55295&&o<57344){if(!n){o>56319||r+1===e.length?(t[i++]=239,t[i++]=191,t[i++]=189):n=o;continue}if(o<56320){t[i++]=239,t[i++]=191,t[i++]=189,n=o;continue}o=n-55296<<10|o-56320|65536,n=null}else n&&(t[i++]=239,t[i++]=191,t[i++]=189,n=null);o<128?t[i++]=o:(o<2048?t[i++]=o>>6|192:(o<65536?t[i++]=o>>12|224:(t[i++]=o>>18|240,t[i++]=o>>12&63|128),t[i++]=o>>6&63|128),t[i++]=63&o|128)}return i}(this.buf,t,this.pos);var i=this.pos-e;i>=128&&Rl(e,i,this),this.pos=e-1,this.writeVarint(i),this.pos+=i},writeFloat:function(t){this.realloc(4),Cl.write(this.buf,t,this.pos,!0,23,4),this.pos+=4},writeDouble:function(t){this.realloc(8),Cl.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 o=this.pos-i;o>=128&&Rl(i,o,this),this.pos=i-1,this.writeVarint(o),this.pos+=o},writeMessage:function(t,e,i){this.writeTag(t,zl.Bytes),this.writeRawMessage(e,i)},writePackedVarint:function(t,e){e.length&&this.writeMessage(t,Il,e)},writePackedSVarint:function(t,e){e.length&&this.writeMessage(t,Fl,e)},writePackedBoolean:function(t,e){e.length&&this.writeMessage(t,Dl,e)},writePackedFloat:function(t,e){e.length&&this.writeMessage(t,Ml,e)},writePackedDouble:function(t,e){e.length&&this.writeMessage(t,Al,e)},writePackedFixed32:function(t,e){e.length&&this.writeMessage(t,Ll,e)},writePackedSFixed32:function(t,e){e.length&&this.writeMessage(t,Gl,e)},writePackedFixed64:function(t,e){e.length&&this.writeMessage(t,Nl,e)},writePackedSFixed64:function(t,e){e.length&&this.writeMessage(t,Bl,e)},writeBytesField:function(t,e){this.writeTag(t,zl.Bytes),this.writeBytes(e)},writeFixed32Field:function(t,e){this.writeTag(t,zl.Fixed32),this.writeFixed32(e)},writeSFixed32Field:function(t,e){this.writeTag(t,zl.Fixed32),this.writeSFixed32(e)},writeFixed64Field:function(t,e){this.writeTag(t,zl.Fixed64),this.writeFixed64(e)},writeSFixed64Field:function(t,e){this.writeTag(t,zl.Fixed64),this.writeSFixed64(e)},writeVarintField:function(t,e){this.writeTag(t,zl.Varint),this.writeVarint(e)},writeSVarintField:function(t,e){this.writeTag(t,zl.Varint),this.writeSVarint(e)},writeStringField:function(t,e){this.writeTag(t,zl.Bytes),this.writeString(e)},writeFloatField:function(t,e){this.writeTag(t,zl.Fixed32),this.writeFloat(e)},writeDoubleField:function(t,e){this.writeTag(t,zl.Fixed64),this.writeDouble(e)},writeBooleanField:function(t,e){this.writeVarintField(t,Boolean(e))}};var Ul=[1,0,0,1,0,0],Xl=function(){function t(t,e,i,o,n){this.extent_,this.id_=n,this.type_=t,this.flatCoordinates_=e,this.flatInteriorPoints_=null,this.flatMidpoints_=null,this.ends_=i,this.properties_=o}return t.prototype.get=function(t){return this.properties_[t]},t.prototype.getExtent=function(){return this.extent_||(this.extent_=this.type_===Po?ao(this.flatCoordinates_):so(this.flatCoordinates_,0,this.flatCoordinates_.length,2)),this.extent_},t.prototype.getFlatInteriorPoint=function(){if(!this.flatInteriorPoints_){var t=yo(this.getExtent());this.flatInteriorPoints_=Pa(this.flatCoordinates_,0,this.ends_,2,t,0)}return this.flatInteriorPoints_},t.prototype.getFlatInteriorPoints=function(){if(!this.flatInteriorPoints_){var t=Os(this.flatCoordinates_,0,this.ends_,2);this.flatInteriorPoints_=Oa(this.flatCoordinates_,0,this.ends_,2,t)}return this.flatInteriorPoints_},t.prototype.getFlatMidpoint=function(){return this.flatMidpoints_||(this.flatMidpoints_=xs(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_,o=0,n=i.length;o<n;++o){var r=i[o],a=xs(t,e,r,2,.5);gt(this.flatMidpoints_,a),e=r}}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=Jo(t)).getExtent(),i=t.getWorldExtent();if(e&&i){var o=xo(i)/xo(e);kn(Ul,i[0],i[3],o,-o,0,0,0),Hr(this.flatCoordinates_,0,this.flatCoordinates_.length,2,Ul,this.flatCoordinates_)}},t.prototype.getEnds=function(){return this.ends_},t}();Xl.prototype.getEndss=Xl.prototype.getEnds,Xl.prototype.getFlatCoordinates=Xl.prototype.getOrientedFlatCoordinates;var Kl=Xl,Yl=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 o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}();function Zl(t,e,i){if(3===t){var o={keys:[],values:[],features:[]},n=i.readVarint()+i.pos;i.readFields(Hl,o,n),o.length=o.features.length,o.length&&(e[o.name]=o)}}function Hl(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 o=null,n=i.readVarint()+i.pos;i.pos<n;)o=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(o)}}function $l(t,e,i){if(1==t)e.id=i.readVarint();else if(2==t)for(var o=i.readVarint()+i.pos;i.pos<o;){var n=e.layer.keys[i.readVarint()],r=e.layer.values[i.readVarint()];e.properties[n]=r}else 3==t?e.type=i.readVarint():4==t&&(e.geometry=i.pos)}function Jl(t,e,i){t.pos=e.features[i];var o=t.readVarint()+t.pos,n={layer:e,type:0,properties:{}};return t.readFields($l,n,o),n}var Ql=function(t){function e(e){var i=t.call(this)||this,o=e||{};return i.dataProjection=new bi({code:"",units:_i.TILE_PIXELS}),i.featureClass_=o.featureClass?o.featureClass:Kl,i.geometryName_=o.geometryName,i.layerName_=o.layerName?o.layerName:"layer",i.layers_=o.layers?o.layers:null,i.idProperty_=o.idProperty,i.supportedMediaTypes=["application/vnd.mapbox-vector-tile","application/x-protobuf"],i}return Yl(e,t),e.prototype.readRawGeometry_=function(t,e,i,o){t.pos=e.geometry;for(var n=t.readVarint()+t.pos,r=1,a=0,s=0,l=0,u=0,p=0;t.pos<n;){if(!a){var d=t.readVarint();r=7&d,a=d>>3}a--,1===r||2===r?(s+=t.readSVarint(),l+=t.readSVarint(),1===r&&u>p&&(o.push(u),p=u),i.push(s,l),u+=2):7===r?u>p&&(i.push(i[p],i[p+1]),u+=2):Re(!1,59)}u>p&&(o.push(u),p=u)},e.prototype.createFeature_=function(t,e,i){var o,n=e.type;if(0===n)return null;var r,a=e.properties;this.idProperty_?(r=a[this.idProperty_],delete a[this.idProperty_]):r=e.id,a[this.layerName_]=e.layer.name;var s=[],l=[];this.readRawGeometry_(t,e,s,l);var u=function(t,e){var i;1===t?i=1===e?Po:Io:2===t?i=1===e?Oo:Fo:3===t&&(i=Ro);return i}(n,l.length);if(this.featureClass_===Kl)(o=new this.featureClass_(u,s,l,a,r)).transform(i.dataProjection);else{var p=void 0;if(u==Ro){for(var d=[],h=0,c=0,f=0,g=l.length;f<g;++f){var m=l[f];if(Ma(s,h,m,2)){if(0===d.length)continue;d[d.length-1].push(l[c])}else d.push(l.slice(c,f+1));c=f+1,h=m}p=d.length>1?new Rs(s,Xr,d):new Ba(s,Xr,l)}else p=u===Po?new Ca(s,Xr):u===Oo?new Cs(s,Xr):u===Ro?new Ba(s,Xr,l):u===Io?new Ps(s,Xr):u===Fo?new Ts(s,Xr,l):null;o=new(0,this.featureClass_),this.geometryName_&&o.setGeometryName(this.geometryName_);var v=cs(p,!1,i);o.setGeometry(v),o.setId(r),o.setProperties(a,!0)}return o},e.prototype.getType=function(){return fs},e.prototype.readFeatures=function(t,e){var i=this.layers_,o=this.adaptOptions(e),n=Jo(o.dataProjection);n.setWorldExtent(o.extent),o.dataProjection=n;var r=new Sl(t),a=r.readFields(Zl,{}),s=[];for(var l in a)if(!i||-1!=i.indexOf(l)){var u=a[l],p=u?[0,0,u.extent,u.extent]:null;n.setExtent(p);for(var d=0,h=u.length;d<h;++d){var c=Jl(r,u,d);s.push(this.createFeature_(r,c,o))}}return s},e.prototype.readProjection=function(t){return this.dataProjection},e.prototype.setLayers=function(t){this.layers_=t},e}(hs),tu="active",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 o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}();function iu(t,e,i,o){var n=t.getZoom();if(void 0!==n){var r=t.getConstrainedZoom(n+e),a=t.getResolutionForZoom(r);t.getAnimating()&&t.cancelAnimations(),t.animate({resolution:a,anchor:i,duration:void 0!==o?o:250,easing:li})}}var ou=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 eu(e,t),e.prototype.getActive=function(){return this.get(tu)},e.prototype.getMap=function(){return this.map_},e.prototype.handleEvent=function(t){return!0},e.prototype.setActive=function(t){this.set(tu,t)},e.prototype.setMap=function(t){this.map_=t},e}(Ht),nu=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 o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}(),ru=function(t){function e(e){var i=t.call(this)||this,o=e||{};return i.delta_=o.delta?o.delta:1,i.duration_=void 0!==o.duration?o.duration:250,i}return nu(e,t),e.prototype.handleEvent=function(t){var e=!1;if(t.type==xr.DBLCLICK){var i=t.originalEvent,o=t.map,n=t.coordinate,r=i.shiftKey?-this.delta_:this.delta_;iu(o.getView(),r,n,this.duration_),i.preventDefault(),e=!0}return!e},e}(ou),au=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 o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}();function su(t){for(var e=t.length,i=0,o=0,n=0;n<e;n++)i+=t[n].clientX,o+=t[n].clientY;return[i/e,o/e]}var lu=function(t){function e(e){var i=this,o=e||{};return i=t.call(this,o)||this,o.handleDownEvent&&(i.handleDownEvent=o.handleDownEvent),o.handleDragEvent&&(i.handleDragEvent=o.handleDragEvent),o.handleMoveEvent&&(i.handleMoveEvent=o.handleMoveEvent),o.handleUpEvent&&(i.handleUpEvent=o.handleUpEvent),o.stopDown&&(i.stopDown=o.stopDown),i.handlingDownUpSequence=!1,i.trackedPointers_={},i.targetPointers=[],i}return au(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==xr.POINTERDRAG)this.handleDragEvent(t),t.originalEvent.preventDefault();else if(t.type==xr.POINTERUP){var i=this.handleUpEvent(t);this.handlingDownUpSequence=i&&this.targetPointers.length>0}}else if(t.type==xr.POINTERDOWN){var o=this.handleDownEvent(t);this.handlingDownUpSequence=o,e=this.stopDown(o)}else t.type==xr.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===xr.POINTERDOWN||e===xr.POINTERDRAG||e===xr.POINTERUP}(t)){var e=t.originalEvent,i=e.pointerId.toString();t.type==xr.POINTERUP?delete this.trackedPointers_[i]:(t.type==xr.POINTERDOWN||i in this.trackedPointers_)&&(this.trackedPointers_[i]=e),this.targetPointers=kt(this.trackedPointers_)}},e}(ou);function uu(t){var e=arguments;return function(t){for(var i=!0,o=0,n=e.length;o<n&&(i=i&&e[o](t));++o);return i}}var pu=function(t){var e=t.originalEvent;return e.altKey&&!(e.metaKey||e.ctrlKey)&&e.shiftKey},du=function(t){return!t.map.getTargetElement().hasAttribute("tabindex")||function(t){return t.target.getTargetElement().contains(document.activeElement)}(t)},hu=vt,cu=function(t){var e=t.originalEvent;return 0==e.button&&!(ie&&oe&&e.ctrlKey)},fu=function(t){var e=t.originalEvent;return!e.altKey&&!(e.metaKey||e.ctrlKey)&&!e.shiftKey},gu=function(t){var e=t.originalEvent;return!e.altKey&&!(e.metaKey||e.ctrlKey)&&e.shiftKey},mu=function(t){var e=t.originalEvent.target.tagName;return"INPUT"!==e&&"SELECT"!==e&&"TEXTAREA"!==e},vu=function(t){var e=t.originalEvent;return Re(void 0!==e,56),"mouse"==e.pointerType},yu=function(t){var e=t.originalEvent;return Re(void 0!==e,56),e.isPrimary&&0===e.button},_u=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 o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}(),bu=function(t){function e(e){var i=t.call(this,{stopDown:yt})||this,o=e||{};i.kinetic_=o.kinetic,i.lastCentroid=null,i.lastPointersCount_,i.panning_=!1;var n=o.condition?o.condition:uu(fu,yu);return i.condition_=o.onFocusOnly?uu(du,n):n,i.noKinetic_=!1,i}return _u(e,t),e.prototype.handleDragEvent=function(t){this.panning_||(this.panning_=!0,this.getMap().getView().beginInteraction());var e,i,o=this.targetPointers,n=su(o);if(o.length==this.lastPointersCount_){if(this.kinetic_&&this.kinetic_.update(n[0],n[1]),this.lastCentroid){var r=[this.lastCentroid[0]-n[0],n[1]-this.lastCentroid[1]],a=t.map.getView();e=r,i=a.getResolution(),e[0]*=i,e[1]*=i,Vo(r,a.getRotation()),a.adjustCenterInternal(r)}}else this.kinetic_&&this.kinetic_.begin();this.lastCentroid=n,this.lastPointersCount_=o.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 o=this.kinetic_.getDistance(),n=this.kinetic_.getAngle(),r=i.getCenterInternal(),a=e.getPixelFromCoordinateInternal(r),s=e.getCoordinateFromPixelInternal([a[0]-o*Math.cos(n),a[1]-o*Math.sin(n)]);i.animateInternal({center:i.getConstrainedCenter(s),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}(lu),xu=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 o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}(),ku=function(t){function e(e){var i=this,o=e||{};return(i=t.call(this,{stopDown:yt})||this).condition_=o.condition?o.condition:pu,i.lastAngle_=void 0,i.duration_=void 0!==o.duration?o.duration:250,i}return xu(e,t),e.prototype.handleDragEvent=function(t){if(vu(t)){var e=t.map,i=e.getView();if(i.getConstraints().rotation!==Vr){var o=e.getSize(),n=t.pixel,r=Math.atan2(o[1]/2-n[1],n[0]-o[0]/2);if(void 0!==this.lastAngle_){var a=r-this.lastAngle_;i.adjustRotationInternal(-a)}this.lastAngle_=r}}},e.prototype.handleUpEvent=function(t){return!vu(t)||(t.map.getView().endInteraction(this.duration_),!1)},e.prototype.handleDownEvent=function(t){return!!vu(t)&&(!(!cu(t)||!this.condition_(t))&&(t.map.getView().beginInteraction(),this.lastAngle_=void 0,!0))},e}(lu),wu=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 o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}(),Su=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 wu(e,t),e.prototype.disposeInternal=function(){this.setMap(null)},e.prototype.render_=function(){var t=this.startPixel_,e=this.endPixel_,i="px",o=this.element_.style;o.left=Math.min(t[0],e[0])+i,o.top=Math.min(t[1],e[1])+i,o.width=Math.abs(e[0]-t[0])+i,o.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 Ba([i])},e.prototype.getGeometry=function(){return this.geometry_},e}(dt),Cu=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 o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}(),zu="boxstart",Tu="boxdrag",Eu="boxend",Pu="boxcancel",Ou=function(t){function e(e,i,o){var n=t.call(this,e)||this;return n.coordinate=i,n.mapBrowserEvent=o,n}return Cu(e,t),e}(ut),ju=function(t){function e(e){var i=t.call(this)||this;i.on,i.once,i.un;var o=e||{};return i.box_=new Su(o.className||"ol-dragbox"),i.minArea_=void 0!==o.minArea?o.minArea:64,o.onBoxEnd&&(i.onBoxEnd=o.onBoxEnd),i.startPixel_=null,i.condition_=o.condition?o.condition:cu,i.boxEndCondition_=o.boxEndCondition?o.boxEndCondition:i.defaultBoxEndCondition,i}return Cu(e,t),e.prototype.defaultBoxEndCondition=function(t,e,i){var o=i[0]-e[0],n=i[1]-e[1];return o*o+n*n>=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 Ou(Tu,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 Ou(e?Eu: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 Ou(zu,t.coordinate,t)),!0)},e.prototype.onBoxEnd=function(t){},e}(lu),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 o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}(),Iu=function(t){function e(e){var i=this,o=e||{},n=o.condition?o.condition:gu;return(i=t.call(this,{condition:n,className:o.className||"ol-dragzoom",minArea:o.minArea})||this).duration_=void 0!==o.duration?o.duration:200,i.out_=void 0!==o.out&&o.out,i}return Ru(e,t),e.prototype.onBoxEnd=function(t){var e=this.getMap().getView(),i=this.getGeometry();if(this.out_){var o=e.rotatedExtentForGeometry(i),n=e.getResolutionForExtentInternal(o),r=e.getResolution()/n;(i=i.clone()).scale(r*r)}e.fitInternal(i,{duration:this.duration_,easing:li})},e}(ju),Fu=37,Mu=38,Au=39,Du=40,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 o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}(),Gu=function(t){function e(e){var i=t.call(this)||this,o=e||{};return i.defaultCondition_=function(t){return fu(t)&&mu(t)},i.condition_=void 0!==o.condition?o.condition:i.defaultCondition_,i.duration_=void 0!==o.duration?o.duration:100,i.pixelDelta_=void 0!==o.pixelDelta?o.pixelDelta:128,i}return Lu(e,t),e.prototype.handleEvent=function(t){var e=!1;if(t.type==It){var i=t.originalEvent,o=i.keyCode;if(this.condition_(t)&&(o==Du||o==Fu||o==Au||o==Mu)){var n=t.map.getView(),r=n.getResolution()*this.pixelDelta_,a=0,s=0;o==Du?s=-r:o==Fu?a=-r:o==Au?a=r:s=r;var l=[a,s];Vo(l,n.getRotation()),function(t,e,i){var o=t.getCenterInternal();if(o){var n=[o[0]+e[0],o[1]+e[1]];t.animateInternal({duration:void 0!==i?i:250,easing:pi,center:t.getConstrainedCenter(n)})}}(n,l,this.duration_),i.preventDefault(),e=!0}}return!e},e}(ou),Nu=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 o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}(),Bu=function(t){function e(e){var i=t.call(this)||this,o=e||{};return i.condition_=o.condition?o.condition:mu,i.delta_=o.delta?o.delta:1,i.duration_=void 0!==o.duration?o.duration:100,i}return Nu(e,t),e.prototype.handleEvent=function(t){var e=!1;if(t.type==It||t.type==Ft){var i=t.originalEvent,o=i.charCode;if(this.condition_(t)&&(o=="+".charCodeAt(0)||o=="-".charCodeAt(0))){var n=t.map,r=o=="+".charCodeAt(0)?this.delta_:-this.delta_;iu(n.getView(),r,void 0,this.duration_),i.preventDefault(),e=!0}}return!e},e}(ou),qu=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 o=this.points_[e+2]-this.points_[i+2];if(o<1e3/60)return!1;var n=this.points_[e]-this.points_[i],r=this.points_[e+1]-this.points_[i+1];return this.angle_=Math.atan2(r,n),this.initialVelocity_=Math.sqrt(n*n+r*r)/o,this.initialVelocity_>this.minVelocity_},t.prototype.getDistance=function(){return(this.minVelocity_-this.initialVelocity_)/this.decay_},t.prototype.getAngle=function(){return this.angle_},t}(),Wu=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 o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}(),Vu="trackpad",Uu="wheel",Xu=function(t){function e(e){var i=this,o=e||{};(i=t.call(this,o)||this).totalDelta_=0,i.lastDelta_=0,i.maxDelta_=void 0!==o.maxDelta?o.maxDelta:1,i.duration_=void 0!==o.duration?o.duration:250,i.timeout_=void 0!==o.timeout?o.timeout:80,i.useAnchor_=void 0===o.useAnchor||o.useAnchor,i.constrainResolution_=void 0!==o.constrainResolution&&o.constrainResolution;var n=o.condition?o.condition:hu;return i.condition_=o.onFocusOnly?uu(du,n):n,i.lastAnchor_=null,i.startTime_=void 0,i.timeoutId_,i.mode_=void 0,i.trackpadEventGap_=400,i.trackpadTimeoutId_,i.deltaPerZoom_=300,i}return Wu(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!==Lt)return!0;var e,i=t.map,o=t.originalEvent;if(o.preventDefault(),this.useAnchor_&&(this.lastAnchor_=t.coordinate),t.type==Lt&&(e=o.deltaY,ee&&o.deltaMode===WheelEvent.DOM_DELTA_PIXEL&&(e/=ne),o.deltaMode===WheelEvent.DOM_DELTA_LINE&&(e*=40)),0===e)return!1;this.lastDelta_=e;var n=Date.now();void 0===this.startTime_&&(this.startTime_=n),(!this.mode_||n-this.startTime_>this.trackpadEventGap_)&&(this.mode_=Math.abs(e)<4?Vu:Uu);var r=i.getView();if(this.mode_===Vu&&!r.getConstrainResolution()&&!this.constrainResolution_)return this.trackpadTimeoutId_?clearTimeout(this.trackpadTimeoutId_):(r.getAnimating()&&r.cancelAnimations(),r.beginInteraction()),this.trackpadTimeoutId_=setTimeout(this.endInteraction_.bind(this),this.timeout_),r.adjustZoom(-e/this.deltaPerZoom_,this.lastAnchor_),this.startTime_=n,!1;this.totalDelta_+=e;var a=Math.max(this.timeout_-(n-this.startTime_),0);return clearTimeout(this.timeoutId_),this.timeoutId_=setTimeout(this.handleWheelZoom_.bind(this,i),a),!1},e.prototype.handleWheelZoom_=function(t){var e=t.getView();e.getAnimating()&&e.cancelAnimations();var i=-Ie(this.totalDelta_,-this.maxDelta_*this.deltaPerZoom_,this.maxDelta_*this.deltaPerZoom_)/this.deltaPerZoom_;(e.getConstrainResolution()||this.constrainResolution_)&&(i=i?i>0?1:-1:0),iu(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}(ou),Ku=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 o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}(),Yu=function(t){function e(e){var i=this,o=e||{},n=o;return n.stopDown||(n.stopDown=yt),(i=t.call(this,n)||this).anchor_=null,i.lastAngle_=void 0,i.rotating_=!1,i.rotationDelta_=0,i.threshold_=void 0!==o.threshold?o.threshold:.3,i.duration_=void 0!==o.duration?o.duration:250,i}return Ku(e,t),e.prototype.handleDragEvent=function(t){var e=0,i=this.targetPointers[0],o=this.targetPointers[1],n=Math.atan2(o.clientY-i.clientY,o.clientX-i.clientX);if(void 0!==this.lastAngle_){var r=n-this.lastAngle_;this.rotationDelta_+=r,!this.rotating_&&Math.abs(this.rotationDelta_)>this.threshold_&&(this.rotating_=!0),e=r}this.lastAngle_=n;var a=t.map,s=a.getView();if(s.getConstraints().rotation!==Vr){var l=a.getViewport().getBoundingClientRect(),u=su(this.targetPointers);u[0]-=l.left,u[1]-=l.top,this.anchor_=a.getCoordinateFromPixelInternal(u),this.rotating_&&(a.render(),s.adjustRotationInternal(e,this.anchor_))}},e.prototype.handleUpEvent=function(t){return!(this.targetPointers.length<2)||(t.map.getView().endInteraction(this.duration_),!1)},e.prototype.handleDownEvent=function(t){if(this.targetPointers.length>=2){var e=t.map;return this.anchor_=null,this.lastAngle_=void 0,this.rotating_=!1,this.rotationDelta_=0,this.handlingDownUpSequence||e.getView().beginInteraction(),!0}return!1},e}(lu),Zu=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 o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}(),Hu=function(t){function e(e){var i=this,o=e||{},n=o;return n.stopDown||(n.stopDown=yt),(i=t.call(this,n)||this).anchor_=null,i.duration_=void 0!==o.duration?o.duration:400,i.lastDistance_=void 0,i.lastScaleDelta_=1,i}return Zu(e,t),e.prototype.handleDragEvent=function(t){var e=1,i=this.targetPointers[0],o=this.targetPointers[1],n=i.clientX-o.clientX,r=i.clientY-o.clientY,a=Math.sqrt(n*n+r*r);void 0!==this.lastDistance_&&(e=this.lastDistance_/a),this.lastDistance_=a;var s=t.map,l=s.getView();1!=e&&(this.lastScaleDelta_=e);var u=s.getViewport().getBoundingClientRect(),p=su(this.targetPointers);p[0]-=u.left,p[1]-=u.top,this.anchor_=s.getCoordinateFromPixelInternal(p),s.render(),l.adjustResolutionInternal(e,this.anchor_)},e.prototype.handleUpEvent=function(t){if(this.targetPointers.length<2){var e=t.map.getView(),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}(lu),$u=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 o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}(),Ju=function(t){function e(e,i,o){var n=t.call(this)||this;if(void 0!==o&&void 0===i)n.setFlatCoordinates(o,e);else{var r=i||0;n.setCenterAndRadius(e,r,o)}return n}return $u(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,o){var n=this.flatCoordinates,r=t-n[0],a=e-n[1],s=r*r+a*a;if(s<o){if(0===s)for(var l=0;l<this.stride;++l)i[l]=n[l];else{var u=this.getRadius()/Math.sqrt(s);i[0]=n[0]+u*r,i[1]=n[1]+u*a;for(l=2;l<this.stride;++l)i[l]=n[l]}return i.length=this.stride,s}return o},e.prototype.containsXY=function(t,e){var i=this.flatCoordinates,o=t-i[0],n=e-i[1];return o*o+n*n<=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 no(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 Do},e.prototype.intersectsExtent=function(t){if(zo(t,this.getExtent())){var e=this.getCenter();return t[0]<=e[0]&&t[2]>=e[0]||(t[1]<=e[1]&&t[3]>=e[1]||fo(t,this.intersectsCoordinate.bind(this)))}return!1},e.prototype.setCenter=function(t){var e=this.stride,i=this.flatCoordinates[e]-this.flatCoordinates[0],o=t.slice();o[e]=o[0]+i;for(var n=1;n<e;++n)o[e+n]=t[n];this.setFlatCoordinates(this.layout,o),this.changed()},e.prototype.setCenterAndRadius=function(t,e,i){this.setLayout(i,t,0),this.flatCoordinates||(this.flatCoordinates=[]);var o=this.flatCoordinates,n=pa(o,0,t,this.stride);o[n++]=o[0]+e;for(var r=1,a=this.stride;r<a;++r)o[n++]=o[r];o.length=n,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(),o=this.getStride();this.setCenter($r(i,0,i.length,o,t,e,i)),this.changed()},e.prototype.translate=function(t,e){var i=this.getCenter(),o=this.getStride();this.setCenter(Jr(i,0,i.length,o,t,e,i)),this.changed()},e}(na);Ju.prototype.transform;var Qu=Ju;function tp(t,e,i,o,n){ep(t,e,i||0,o||t.length-1,n||op)}function ep(t,e,i,o,n){for(;o>i;){if(o-i>600){var r=o-i+1,a=e-i+1,s=Math.log(r),l=.5*Math.exp(2*s/3),u=.5*Math.sqrt(s*l*(r-l)/r)*(a-r/2<0?-1:1);ep(t,e,Math.max(i,Math.floor(e-a*l/r+u)),Math.min(o,Math.floor(e+(r-a)*l/r+u)),n)}var p=t[e],d=i,h=o;for(ip(t,i,e),n(t[o],p)>0&&ip(t,i,o);d<h;){for(ip(t,d,h),d++,h--;n(t[d],p)<0;)d++;for(;n(t[h],p)>0;)h--}0===n(t[i],p)?ip(t,i,h):ip(t,++h,o),h<=e&&(i=h+1),e<=h&&(o=h-1)}}function ip(t,e,i){var o=t[e];t[e]=t[i],t[i]=o}function op(t,e){return t<e?-1:t>e?1:0}class np{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(!gp(t,e))return i;const o=this.toBBox,n=[];for(;e;){for(let r=0;r<e.children.length;r++){const a=e.children[r],s=e.leaf?o(a):a;gp(t,s)&&(e.leaf?i.push(a):fp(t,s)?this._all(a,i):n.push(a))}e=n.pop()}return i}collides(t){let e=this.data;if(!gp(t,e))return!1;const i=[];for(;e;){for(let o=0;o<e.children.length;o++){const n=e.children[o],r=e.leaf?this.toBBox(n):n;if(gp(t,r)){if(e.leaf||fp(t,r))return!0;i.push(n)}}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=mp([]),this}remove(t,e){if(!t)return this;let i=this.data;const o=this.toBBox(t),n=[],r=[];let a,s,l;for(;i||n.length;){if(i||(i=n.pop(),s=n[n.length-1],a=r.pop(),l=!0),i.leaf){const o=rp(t,i.children,e);if(-1!==o)return i.children.splice(o,1),n.push(i),this._condense(n),this}l||i.leaf||!fp(i,o)?s?(a++,i=s.children[a],l=!1):i=null:(n.push(i),r.push(a),a=0,s=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,o){const n=i-e+1;let r,a=this._maxEntries;if(n<=a)return r=mp(t.slice(e,i+1)),ap(r,this.toBBox),r;o||(o=Math.ceil(Math.log(n)/Math.log(a)),a=Math.ceil(n/Math.pow(a,o-1))),r=mp([]),r.leaf=!1,r.height=o;const s=Math.ceil(n/a),l=s*Math.ceil(Math.sqrt(a));vp(t,e,i,l,this.compareMinX);for(let u=e;u<=i;u+=l){const e=Math.min(u+l-1,i);vp(t,u,e,s,this.compareMinY);for(let i=u;i<=e;i+=s){const n=Math.min(i+s-1,e);r.children.push(this._build(t,i,n,o-1))}}return ap(r,this.toBBox),r}_chooseSubtree(t,e,i,o){for(;o.push(e),!e.leaf&&o.length-1!==i;){let i,o=1/0,a=1/0;for(let s=0;s<e.children.length;s++){const l=e.children[s],u=dp(l),p=(n=t,r=l,(Math.max(r.maxX,n.maxX)-Math.min(r.minX,n.minX))*(Math.max(r.maxY,n.maxY)-Math.min(r.minY,n.minY))-u);p<a?(a=p,o=u<o?u:o,i=l):p===a&&u<o&&(o=u,i=l)}e=i||e.children[0]}var n,r;return e}_insert(t,e,i){const o=i?t:this.toBBox(t),n=[],r=this._chooseSubtree(o,this.data,e,n);for(r.children.push(t),lp(r,o);e>=0&&n[e].children.length>this._maxEntries;)this._split(n,e),e--;this._adjustParentBBoxes(o,n,e)}_split(t,e){const i=t[e],o=i.children.length,n=this._minEntries;this._chooseSplitAxis(i,n,o);const r=this._chooseSplitIndex(i,n,o),a=mp(i.children.splice(r,i.children.length-r));a.height=i.height,a.leaf=i.leaf,ap(i,this.toBBox),ap(a,this.toBBox),e?t[e-1].children.push(a):this._splitRoot(i,a)}_splitRoot(t,e){this.data=mp([t,e]),this.data.height=t.height+1,this.data.leaf=!1,ap(this.data,this.toBBox)}_chooseSplitIndex(t,e,i){let o,n=1/0,r=1/0;for(let a=e;a<=i-e;a++){const e=sp(t,0,a,this.toBBox),s=sp(t,a,i,this.toBBox),l=cp(e,s),u=dp(e)+dp(s);l<n?(n=l,o=a,r=u<r?u:r):l===n&&u<r&&(r=u,o=a)}return o||i-e}_chooseSplitAxis(t,e,i){const o=t.leaf?this.compareMinX:up,n=t.leaf?this.compareMinY:pp;this._allDistMargin(t,e,i,o)<this._allDistMargin(t,e,i,n)&&t.children.sort(o)}_allDistMargin(t,e,i,o){t.children.sort(o);const n=this.toBBox,r=sp(t,0,e,n),a=sp(t,i-e,i,n);let s=hp(r)+hp(a);for(let l=e;l<i-e;l++){const e=t.children[l];lp(r,t.leaf?n(e):e),s+=hp(r)}for(let l=i-e-1;l>=e;l--){const e=t.children[l];lp(a,t.leaf?n(e):e),s+=hp(a)}return s}_adjustParentBBoxes(t,e,i){for(let o=i;o>=0;o--)lp(e[o],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():ap(t[i],this.toBBox)}}function rp(t,e,i){if(!i)return e.indexOf(t);for(let o=0;o<e.length;o++)if(i(t,e[o]))return o;return-1}function ap(t,e){sp(t,0,t.children.length,e,t)}function sp(t,e,i,o,n){n||(n=mp(null)),n.minX=1/0,n.minY=1/0,n.maxX=-1/0,n.maxY=-1/0;for(let r=e;r<i;r++){const e=t.children[r];lp(n,t.leaf?o(e):e)}return n}function lp(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 up(t,e){return t.minX-e.minX}function pp(t,e){return t.minY-e.minY}function dp(t){return(t.maxX-t.minX)*(t.maxY-t.minY)}function hp(t){return t.maxX-t.minX+(t.maxY-t.minY)}function cp(t,e){const i=Math.max(t.minX,e.minX),o=Math.max(t.minY,e.minY),n=Math.min(t.maxX,e.maxX),r=Math.min(t.maxY,e.maxY);return Math.max(0,n-i)*Math.max(0,r-o)}function fp(t,e){return t.minX<=e.minX&&t.minY<=e.minY&&e.maxX<=t.maxX&&e.maxY<=t.maxY}function gp(t,e){return e.minX<=t.maxX&&e.minY<=t.maxY&&e.maxX>=t.minX&&e.maxY>=t.minY}function mp(t){return{children:t,height:1,leaf:!0,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}}function vp(t,e,i,o,n){const r=[e,i];for(;r.length;){if((i=r.pop())-(e=r.pop())<=o)continue;const a=e+Math.ceil((i-e)/o/2)*o;tp(t,a,e,i,n),r.push(e,a,a,i)}}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 o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}(),_p="renderOrder",bp=function(t){function e(e){var i=this,o=e||{},n=bt({},o);return delete n.style,delete n.renderBuffer,delete n.updateWhileAnimating,delete n.updateWhileInteracting,(i=t.call(this,n)||this).declutter_=void 0!==o.declutter&&o.declutter,i.renderBuffer_=void 0!==o.renderBuffer?o.renderBuffer:100,i.style_=null,i.styleFunction_=void 0,i.setStyle(o.style),i.updateWhileAnimating_=void 0!==o.updateWhileAnimating&&o.updateWhileAnimating,i.updateWhileInteracting_=void 0!==o.updateWhileInteracting&&o.updateWhileInteracting,i}return yp(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(_p)},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 np(9)),this.getRenderer().renderDeclutter(t)},e.prototype.setRenderOrder=function(t){this.set(_p,t)},e.prototype.setStyle=function(t){this.style_=void 0!==t?t:gl,this.styleFunction_=null===t?void 0:function(t){var e;if("function"==typeof t)e=t;else{var i;Array.isArray(t)?i=t:(Re("function"==typeof t.getZIndex,41),i=[t]),e=function(){return i}}return e}(this.style_),this.changed()},e}(Je),xp={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},kp=[xp.FILL],wp=[xp.STROKE],Sp=[xp.BEGIN_PATH],Cp=[xp.CLOSE_PATH],zp=xp,Tp=function(){function t(){}return t.prototype.drawCustom=function(t,e,i,o){},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}(),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 o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}(),Pp=function(t){function e(e,i,o,n){var r=t.call(this)||this;return r.tolerance=e,r.maxExtent=i,r.pixelRatio=n,r.maxLineWidth=0,r.resolution=o,r.beginGeometryInstruction1_=null,r.beginGeometryInstruction2_=null,r.bufferedMaxExtent_=null,r.instructions=[],r.coordinates=[],r.tmpCoordinate_=[],r.hitDetectionInstructions=[],r.state={},r}return Ep(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(),o=this.tmpCoordinate_,n=this.coordinates,r=n.length,a=0,s=t.length;a<s;a+=e)o[0]=t[a],o[1]=t[a+1],Qi(i,o)&&(n[r++]=o[0],n[r++]=o[1]);return r},e.prototype.appendFlatLineCoordinates=function(t,e,i,o,n,r){var a=this.coordinates,s=a.length,l=this.getBufferedMaxExtent();r&&(e+=o);var u,p,d,h=t[e],c=t[e+1],f=this.tmpCoordinate_,g=!0;for(u=e+o;u<i;u+=o)f[0]=t[u],f[1]=t[u+1],(d=io(l,f))!==p?(g&&(a[s++]=h,a[s++]=c,g=!1),a[s++]=f[0],a[s++]=f[1]):d===Vi?(a[s++]=f[0],a[s++]=f[1],g=!1):g=!0,h=f[0],c=f[1],p=d;return(n&&g||u===e+o)&&(a[s++]=h,a[s++]=c),s},e.prototype.drawCustomCoordinates_=function(t,e,i,o,n){for(var r=0,a=i.length;r<a;++r){var s=i[r],l=this.appendFlatLineCoordinates(t,e,s,o,!1,!1);n.push(l),e=s}return e},e.prototype.drawCustom=function(t,e,i,o){this.beginGeometry(t,e);var n,r,a,s,l,u=t.getType(),p=t.getStride(),d=this.coordinates.length;switch(u){case Mo:n=t.getOrientedFlatCoordinates(),s=[];var h=t.getEndss();l=0;for(var c=0,f=h.length;c<f;++c){var g=[];l=this.drawCustomCoordinates_(n,l,h[c],p,g),s.push(g)}this.instructions.push([zp.CUSTOM,d,s,t,i,_a]),this.hitDetectionInstructions.push([zp.CUSTOM,d,s,t,o||i,_a]);break;case Ro:case Fo:a=[],n=u==Ro?t.getOrientedFlatCoordinates():t.getFlatCoordinates(),l=this.drawCustomCoordinates_(n,0,t.getEnds(),p,a),this.instructions.push([zp.CUSTOM,d,a,t,i,ya]),this.hitDetectionInstructions.push([zp.CUSTOM,d,a,t,o||i,ya]);break;case Oo:case Do:n=t.getFlatCoordinates(),r=this.appendFlatLineCoordinates(n,0,n.length,p,!1,!1),this.instructions.push([zp.CUSTOM,d,r,t,i,va]),this.hitDetectionInstructions.push([zp.CUSTOM,d,r,t,o||i,va]);break;case Io:n=t.getFlatCoordinates(),(r=this.appendFlatPointCoordinates(n,p))>d&&(this.instructions.push([zp.CUSTOM,d,r,t,i,va]),this.hitDetectionInstructions.push([zp.CUSTOM,d,r,t,o||i,va]));break;case Po:n=t.getFlatCoordinates(),this.coordinates.push(n[0],n[1]),r=this.coordinates.length,this.instructions.push([zp.CUSTOM,d,r,t,i]),this.hitDetectionInstructions.push([zp.CUSTOM,d,r,t,o||i])}this.endGeometry(e)},e.prototype.beginGeometry=function(t,e){this.beginGeometryInstruction1_=[zp.BEGIN_GEOMETRY,e,0,t],this.instructions.push(this.beginGeometryInstruction1_),this.beginGeometryInstruction2_=[zp.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,o,n=e.length,r=-1;for(t=0;t<n;++t)(o=(i=e[t])[0])==zp.END_GEOMETRY?r=t:o==zp.BEGIN_GEOMETRY&&(i[2]=t,ft(this.hitDetectionInstructions,r,t),r=-1)},e.prototype.setFillStrokeStyle=function(t,e){var i=this.state;if(t){var o=t.getColor();i.fillStyle=ll(o||qn)}else i.fillStyle=void 0;if(e){var n=e.getColor();i.strokeStyle=ll(n||Xn);var r=e.getLineCap();i.lineCap=void 0!==r?r:Wn;var a=e.getLineDash();i.lineDash=a?a.slice():Vn;var s=e.getLineDashOffset();i.lineDashOffset=s||0;var l=e.getLineJoin();i.lineJoin=void 0!==l?l:Un;var u=e.getWidth();i.lineWidth=void 0!==u?u:1;var p=e.getMiterLimit();i.miterLimit=void 0!==p?p: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=[zp.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[zp.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,o=t.lineCap,n=t.lineDash,r=t.lineDashOffset,a=t.lineJoin,s=t.lineWidth,l=t.miterLimit;(t.currentStrokeStyle!=i||t.currentLineCap!=o||n!=t.currentLineDash&&!mt(t.currentLineDash,n)||t.currentLineDashOffset!=r||t.currentLineJoin!=a||t.currentLineWidth!=s||t.currentMiterLimit!=l)&&(void 0!==i&&e.call(this,t),t.currentStrokeStyle=i,t.currentLineCap=o,t.currentLineDash=n,t.currentLineDashOffset=r,t.currentLineJoin=a,t.currentLineWidth=s,t.currentMiterLimit=l)},e.prototype.endGeometry=function(t){this.beginGeometryInstruction1_[2]=this.instructions.length,this.beginGeometryInstruction1_=null,this.beginGeometryInstruction2_[2]=this.hitDetectionInstructions.length,this.beginGeometryInstruction2_=null;var e=[zp.END_GEOMETRY,t];this.instructions.push(e),this.hitDetectionInstructions.push(e)},e.prototype.getBufferedMaxExtent=function(){if(!this.bufferedMaxExtent_&&(this.bufferedMaxExtent_=$i(this.maxExtent),this.maxLineWidth>0)){var t=this.resolution*(this.maxLineWidth+1)/2;Hi(this.bufferedMaxExtent_,t,this.bufferedMaxExtent_)}return this.bufferedMaxExtent_},e}(Tp),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 o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}(),jp=function(t){function e(e,i,o,n){var r=t.call(this,e,i,o,n)||this;return r.hitDetectionImage_=null,r.image_=null,r.imagePixelRatio_=void 0,r.anchorX_=void 0,r.anchorY_=void 0,r.height_=void 0,r.opacity_=void 0,r.originX_=void 0,r.originY_=void 0,r.rotateWithView_=void 0,r.rotation_=void 0,r.scale_=void 0,r.width_=void 0,r.declutterImageWithText_=void 0,r}return Op(e,t),e.prototype.drawPoint=function(t,e){if(this.image_){this.beginGeometry(t,e);var i=t.getFlatCoordinates(),o=t.getStride(),n=this.coordinates.length,r=this.appendFlatPointCoordinates(i,o);this.instructions.push([zp.DRAW_IMAGE,n,r,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([zp.DRAW_IMAGE,n,r,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(),o=t.getStride(),n=this.coordinates.length,r=this.appendFlatPointCoordinates(i,o);this.instructions.push([zp.DRAW_IMAGE,n,r,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([zp.DRAW_IMAGE,n,r,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(),o=t.getSize(),n=t.getHitDetectionImage(),r=t.getImage(this.pixelRatio),a=t.getOrigin();this.imagePixelRatio_=t.getPixelRatio(this.pixelRatio),this.anchorX_=i[0],this.anchorY_=i[1],this.hitDetectionImage_=n,this.image_=r,this.height_=o[1],this.opacity_=t.getOpacity(),this.originX_=a[0]*this.imagePixelRatio_,this.originY_=a[1]*this.imagePixelRatio_,this.rotateWithView_=t.getRotateWithView(),this.rotation_=t.getRotation(),this.scale_=t.getScaleArray(),this.width_=o[0],this.declutterImageWithText_=e},e}(Pp),Rp=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 o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}(),Ip=function(t){function e(e,i,o,n){return t.call(this,e,i,o,n)||this}return Rp(e,t),e.prototype.drawFlatCoordinates_=function(t,e,i,o){var n=this.coordinates.length,r=this.appendFlatLineCoordinates(t,e,i,o,!1,!1),a=[zp.MOVE_TO_LINE_TO,n,r];return this.instructions.push(a),this.hitDetectionInstructions.push(a),i},e.prototype.drawLineString=function(t,e){var i=this.state,o=i.strokeStyle,n=i.lineWidth;if(void 0!==o&&void 0!==n){this.updateStrokeStyle(i,this.applyStroke),this.beginGeometry(t,e),this.hitDetectionInstructions.push([zp.SET_STROKE_STYLE,i.strokeStyle,i.lineWidth,i.lineCap,i.lineJoin,i.miterLimit,Vn,0],Sp);var r=t.getFlatCoordinates(),a=t.getStride();this.drawFlatCoordinates_(r,0,r.length,a),this.hitDetectionInstructions.push(wp),this.endGeometry(e)}},e.prototype.drawMultiLineString=function(t,e){var i=this.state,o=i.strokeStyle,n=i.lineWidth;if(void 0!==o&&void 0!==n){this.updateStrokeStyle(i,this.applyStroke),this.beginGeometry(t,e),this.hitDetectionInstructions.push([zp.SET_STROKE_STYLE,i.strokeStyle,i.lineWidth,i.lineCap,i.lineJoin,i.miterLimit,i.lineDash,i.lineDashOffset],Sp);for(var r=t.getEnds(),a=t.getFlatCoordinates(),s=t.getStride(),l=0,u=0,p=r.length;u<p;++u)l=this.drawFlatCoordinates_(a,l,r[u],s);this.hitDetectionInstructions.push(wp),this.endGeometry(e)}},e.prototype.finish=function(){var e=this.state;return null!=e.lastStroke&&e.lastStroke!=this.coordinates.length&&this.instructions.push(wp),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(wp),e.lastStroke=this.coordinates.length),e.lastStroke=0,t.prototype.applyStroke.call(this,e),this.instructions.push(Sp)},e}(Pp),Fp=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 o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}(),Mp=function(t){function e(e,i,o,n){return t.call(this,e,i,o,n)||this}return Fp(e,t),e.prototype.drawFlatCoordinatess_=function(t,e,i,o){var n=this.state,r=void 0!==n.fillStyle,a=void 0!==n.strokeStyle,s=i.length;this.instructions.push(Sp),this.hitDetectionInstructions.push(Sp);for(var l=0;l<s;++l){var u=i[l],p=this.coordinates.length,d=this.appendFlatLineCoordinates(t,e,u,o,!0,!a),h=[zp.MOVE_TO_LINE_TO,p,d];this.instructions.push(h),this.hitDetectionInstructions.push(h),a&&(this.instructions.push(Cp),this.hitDetectionInstructions.push(Cp)),e=u}return r&&(this.instructions.push(kp),this.hitDetectionInstructions.push(kp)),a&&(this.instructions.push(wp),this.hitDetectionInstructions.push(wp)),e},e.prototype.drawCircle=function(t,e){var i=this.state,o=i.fillStyle,n=i.strokeStyle;if(void 0!==o||void 0!==n){this.setFillStrokeStyles_(),this.beginGeometry(t,e),void 0!==i.fillStyle&&this.hitDetectionInstructions.push([zp.SET_FILL_STYLE,qn]),void 0!==i.strokeStyle&&this.hitDetectionInstructions.push([zp.SET_STROKE_STYLE,i.strokeStyle,i.lineWidth,i.lineCap,i.lineJoin,i.miterLimit,i.lineDash,i.lineDashOffset]);var r=t.getFlatCoordinates(),a=t.getStride(),s=this.coordinates.length;this.appendFlatLineCoordinates(r,0,r.length,a,!1,!1);var l=[zp.CIRCLE,s];this.instructions.push(Sp,l),this.hitDetectionInstructions.push(Sp,l),void 0!==i.fillStyle&&(this.instructions.push(kp),this.hitDetectionInstructions.push(kp)),void 0!==i.strokeStyle&&(this.instructions.push(wp),this.hitDetectionInstructions.push(wp)),this.endGeometry(e)}},e.prototype.drawPolygon=function(t,e){var i=this.state,o=i.fillStyle,n=i.strokeStyle;if(void 0!==o||void 0!==n){this.setFillStrokeStyles_(),this.beginGeometry(t,e),void 0!==i.fillStyle&&this.hitDetectionInstructions.push([zp.SET_FILL_STYLE,qn]),void 0!==i.strokeStyle&&this.hitDetectionInstructions.push([zp.SET_STROKE_STYLE,i.strokeStyle,i.lineWidth,i.lineCap,i.lineJoin,i.miterLimit,i.lineDash,i.lineDashOffset]);var r=t.getEnds(),a=t.getOrientedFlatCoordinates(),s=t.getStride();this.drawFlatCoordinatess_(a,0,r,s),this.endGeometry(e)}},e.prototype.drawMultiPolygon=function(t,e){var i=this.state,o=i.fillStyle,n=i.strokeStyle;if(void 0!==o||void 0!==n){this.setFillStrokeStyles_(),this.beginGeometry(t,e),void 0!==i.fillStyle&&this.hitDetectionInstructions.push([zp.SET_FILL_STYLE,qn]),void 0!==i.strokeStyle&&this.hitDetectionInstructions.push([zp.SET_STROKE_STYLE,i.strokeStyle,i.lineWidth,i.lineCap,i.lineJoin,i.miterLimit,i.lineDash,i.lineDashOffset]);for(var r=t.getEndss(),a=t.getOrientedFlatCoordinates(),s=t.getStride(),l=0,u=0,p=r.length;u<p;++u)l=this.drawFlatCoordinatess_(a,l,r[u],s);this.endGeometry(e)}},e.prototype.finish=function(){this.reverseHitDetectionInstructions(),this.state=null;var e=this.tolerance;if(0!==e)for(var i=this.coordinates,o=0,n=i.length;o<n;++o)i[o]=fa(i[o],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}(Pp);function Ap(t,e,i,o,n){var r,a,s,l,u,p,d,h,c,f=i,g=i,m=0,v=0,y=i;for(r=i;r<o;r+=n){var _=e[r],b=e[r+1];void 0!==l&&(h=_-l,c=b-u,s=Math.sqrt(h*h+c*c),void 0!==p&&(v+=a,Math.acos((p*h+d*c)/(a*s))>t&&(v>m&&(m=v,f=y,g=r),v=0,y=r-n)),a=s,p=h,d=c),l=_,u=b}return(v+=s)>m?[y,r]:[f,g]}var 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 o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}(),Lp={left:0,end:0,center:.5,right:1,start:1,top:0,middle:.5,hanging:.2,alphabetic:.8,ideographic:.8,bottom:1},Gp={Circle:Mp,Default:Pp,Image:jp,LineString:Ip,Polygon:Mp,Text:function(t){function e(e,i,o,n){var r=t.call(this,e,i,o,n)||this;return r.labels_=null,r.text_="",r.textOffsetX_=0,r.textOffsetY_=0,r.textRotateWithView_=void 0,r.textRotation_=0,r.textFillState_=null,r.fillStates={},r.textStrokeState_=null,r.strokeStates={},r.textState_={},r.textStates={},r.textKey_="",r.fillKey_="",r.strokeKey_="",r.declutterImageWithText_=void 0,r}return Dp(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_,o=this.textStrokeState_,n=this.textState_;if(""!==this.text_&&n&&(i||o)){var r=this.coordinates,a=r.length,s=t.getType(),l=null,u=t.getStride();if(n.placement!==bl||s!=Oo&&s!=Fo&&s!=Ro&&s!=Mo){var p=n.overflow?null:[];switch(s){case Po:case Io:l=t.getFlatCoordinates();break;case Oo:l=t.getFlatMidpoint();break;case Do:l=t.getCenter();break;case Fo:l=t.getFlatMidpoints(),u=2;break;case Ro:l=t.getFlatInteriorPoint(),n.overflow||p.push(l[2]/this.resolution),u=3;break;case Mo:var d=t.getFlatInteriorPoints();l=[];for(k=0,w=d.length;k<w;k+=3)n.overflow||p.push(d[k+2]/this.resolution),l.push(d[k],d[k+1]);if(0===l.length)return;u=2}if((O=this.appendFlatPointCoordinates(l,u))===a)return;if(p&&(O-a)/2!=l.length/u){var h=a/2;p=p.filter((function(t,e){var i=r[2*(h+e)]===l[e*u]&&r[2*(h+e)+1]===l[e*u+1];return i||--h,i}))}this.saveTextStates_(),(n.backgroundFill||n.backgroundStroke)&&(this.setFillStrokeStyle(n.backgroundFill,n.backgroundStroke),n.backgroundFill&&(this.updateFillStyle(this.state,this.createFill),this.hitDetectionInstructions.push(this.createFill(this.state))),n.backgroundStroke&&(this.updateStrokeStyle(this.state,this.applyStroke),this.hitDetectionInstructions.push(this.createStroke(this.state)))),this.beginGeometry(t,e);var c=n.padding;if(c!=Zn&&(n.scale[0]<0||n.scale[1]<0)){var f=n.padding[0],g=n.padding[1],m=n.padding[2],v=n.padding[3];n.scale[0]<0&&(g=-g,v=-v),n.scale[1]<0&&(f=-f,m=-m),c=[f,g,m,v]}var y=this.pixelRatio;this.instructions.push([zp.DRAW_IMAGE,a,O,null,NaN,NaN,NaN,1,0,0,this.textRotateWithView_,this.textRotation_,[1,1],NaN,this.declutterImageWithText_,c==Zn?Zn:c.map((function(t){return t*y})),!!n.backgroundFill,!!n.backgroundStroke,this.text_,this.textKey_,this.strokeKey_,this.fillKey_,this.textOffsetX_,this.textOffsetY_,p]);var _=1/y;this.hitDetectionInstructions.push([zp.DRAW_IMAGE,a,O,null,NaN,NaN,NaN,1,0,0,this.textRotateWithView_,this.textRotation_,[_,_],NaN,this.declutterImageWithText_,c,!!n.backgroundFill,!!n.backgroundStroke,this.text_,this.textKey_,this.strokeKey_,this.fillKey_,this.textOffsetX_,this.textOffsetY_,p]),this.endGeometry(e)}else{if(!zo(this.getBufferedMaxExtent(),t.getExtent()))return;var b=void 0;if(l=t.getFlatCoordinates(),s==Oo)b=[l.length];else if(s==Fo)b=t.getEnds();else if(s==Ro)b=t.getEnds().slice(0,1);else if(s==Mo){var x=t.getEndss();b=[];for(var k=0,w=x.length;k<w;++k)b.push(x[k][0])}this.beginGeometry(t,e);for(var S=n.textAlign,C=0,z=void 0,T=0,E=b.length;T<E;++T){if(null==S){var P=Ap(n.maxAngle,l,C,b[T],u);C=P[0],z=P[1]}else z=b[T];for(var k=C;k<z;k+=u)r.push(l[k],l[k+1]);var O=r.length;C=b[T],this.drawChars_(a,O),a=O}this.endGeometry(e)}}},e.prototype.saveTextStates_=function(){var t=this.textStrokeState_,e=this.textState_,i=this.textFillState_,o=this.strokeKey_;t&&(o in this.strokeStates||(this.strokeStates[o]={strokeStyle:t.strokeStyle,lineCap:t.lineCap,lineDashOffset:t.lineDashOffset,lineWidth:t.lineWidth,lineJoin:t.lineJoin,miterLimit:t.miterLimit,lineDash:t.lineDash}));var n=this.textKey_;n in this.textStates||(this.textStates[n]={font:e.font,textAlign:e.textAlign||Kn,textBaseline:e.textBaseline||Yn,scale:e.scale});var r=this.fillKey_;i&&(r in this.fillStates||(this.fillStates[r]={fillStyle:i.fillStyle}))},e.prototype.drawChars_=function(t,e){var i=this.textStrokeState_,o=this.textState_,n=this.strokeKey_,r=this.textKey_,a=this.fillKey_;this.saveTextStates_();var s=this.pixelRatio,l=Lp[o.textBaseline],u=this.textOffsetY_*s,p=this.text_,d=i?i.lineWidth*Math.abs(o.scale[0])/2:0;this.instructions.push([zp.DRAW_CHARS,t,e,l,o.overflow,a,o.maxAngle,s,u,n,d*s,p,r,1]),this.hitDetectionInstructions.push([zp.DRAW_CHARS,t,e,l,o.overflow,a,o.maxAngle,1,u,n,d,p,r,1/s])},e.prototype.setTextStyle=function(t,e){var i,o,n;if(t){var r=t.getFill();r?((o=this.textFillState_)||(o={},this.textFillState_=o),o.fillStyle=ll(r.getColor()||qn)):(o=null,this.textFillState_=o);var a=t.getStroke();if(a){(n=this.textStrokeState_)||(n={},this.textStrokeState_=n);var s=a.getLineDash(),l=a.getLineDashOffset(),u=a.getWidth(),p=a.getMiterLimit();n.lineCap=a.getLineCap()||Wn,n.lineDash=s?s.slice():Vn,n.lineDashOffset=void 0===l?0:l,n.lineJoin=a.getLineJoin()||Un,n.lineWidth=void 0===u?1:u,n.miterLimit=void 0===p?10:p,n.strokeStyle=ll(a.getColor()||Xn)}else n=null,this.textStrokeState_=n;i=this.textState_;var d=t.getFont()||Bn;ir(d);var h=t.getScaleArray();i.overflow=t.getOverflow(),i.font=d,i.maxAngle=t.getMaxAngle(),i.placement=t.getPlacement(),i.textAlign=t.getTextAlign(),i.textBaseline=t.getTextBaseline()||Yn,i.backgroundFill=t.getBackgroundFill(),i.backgroundStroke=t.getBackgroundStroke(),i.padding=t.getPadding()||Zn,i.scale=void 0===h?[1,1]:h;var c=t.getOffsetX(),f=t.getOffsetY(),g=t.getRotateWithView(),m=t.getRotation();this.text_=t.getText()||"",this.textOffsetX_=void 0===c?0:c,this.textOffsetY_=void 0===f?0:f,this.textRotateWithView_=void 0!==g&&g,this.textRotation_=void 0===m?0:m,this.strokeKey_=n?("string"==typeof n.strokeStyle?n.strokeStyle:Kt(n.strokeStyle))+n.lineCap+n.lineDashOffset+"|"+n.lineWidth+n.lineJoin+n.miterLimit+"["+n.lineDash.join()+"]":"",this.textKey_=i.font+i.scale+(i.textAlign||"?")+(i.textBaseline||"?"),this.fillKey_=o?"string"==typeof o.fillStyle?o.fillStyle:"|"+Kt(o.fillStyle):""}else this.text_="";this.declutterImageWithText_=e},e}(Pp)},Np=function(){function t(t,e,i,o){this.tolerance_=t,this.maxExtent_=e,this.pixelRatio_=o,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 o in i){var n=i[o].finish();t[e][o]=n}}return t},t.prototype.getBuilder=function(t,e){var i=void 0!==t?t.toString():"0",o=this.buildersByZIndex_[i];void 0===o&&(o={},this.buildersByZIndex_[i]=o);var n=o[e];void 0===n&&(n=new(0,Gp[e])(this.tolerance_,this.maxExtent_,this.resolution_,this.pixelRatio_),o[e]=n);return n},t}(),Bp=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 o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}(),qp=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 Bp(e,t),e.prototype.getFeatures=function(t){return Ut()},e.prototype.prepareFrame=function(t){return Ut()},e.prototype.renderFrame=function(t,e){return Ut()},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(o,n){var r=this.loadedTileCallback.bind(this,i,o);return t.forEachLoadedTile(e,o,n,r)}.bind(this)},e.prototype.forEachFeatureAtCoordinate=function(t,e,i,o,n){},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()===Zs&&this.renderIfReadyAndVisible()},e.prototype.loadImage=function(t){var e=t.getState();return e!=Zs&&e!=Hs&&t.addEventListener(Tt,this.boundHandleImageChange_),e==Ks&&(t.load(),e=t.getState()),e==Zs},e.prototype.renderIfReadyAndVisible=function(){var t=this.getLayer();t.getVisible()&&t.getSourceState()==Ze&&t.changed()},e}(Vt),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 o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}(),Vp=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 Wp(e,t),e.prototype.useContainer=function(t,e,i){var o,n,r=this.getLayer().getClassName();t&&t.style.opacity===be(i)&&t.className===r&&((s=t.firstElementChild)instanceof HTMLCanvasElement&&(n=s.getContext("2d")));if(n&&n.canvas.style.transform===e?(this.container=t,this.context=n,this.containerReused=!0):this.containerReused&&(this.container=null,this.context=null,this.containerReused=!1),!this.container){(o=document.createElement("div")).className=r;var a=o.style;a.position="absolute",a.width="100%",a.height="100%";var s=(n=le()).canvas;o.appendChild(s),(a=s.style).position="absolute",a.left="0",a.transformOrigin="top left",this.container=o,this.context=n}},e.prototype.clipUnrotated=function(t,e,i){var o=wo(i),n=So(i),r=vo(i),a=mo(i);bn(e.coordinateToPixelTransform,o),bn(e.coordinateToPixelTransform,n),bn(e.coordinateToPixelTransform,r),bn(e.coordinateToPixelTransform,a);var s=this.inversePixelTransform;bn(s,o),bn(s,n),bn(s,r),bn(s,a),t.save(),t.beginPath(),t.moveTo(Math.round(o[0]),Math.round(o[1])),t.lineTo(Math.round(n[0]),Math.round(n[1])),t.lineTo(Math.round(r[0]),Math.round(r[1])),t.lineTo(Math.round(a[0]),Math.round(a[1])),t.clip()},e.prototype.dispatchRenderEvent_=function(t,e,i){var o=this.getLayer();if(o.hasListener(t)){var n=new Nn(t,this.inversePixelTransform,i,e);o.dispatchEvent(n)}},e.prototype.preRender=function(t,e){this.dispatchRenderEvent_(We,t,e)},e.prototype.postRender=function(t,e){this.dispatchRenderEvent_(Ve,t,e)},e.prototype.getRenderTransform=function(t,e,i,o,n,r,a){var s=n/2,l=r/2,u=o/e,p=-u,d=-t[0]+a,h=-t[1];return kn(this.tempTransform,s,l,u,p,-i,d,h)},e.prototype.getDataAtPixel=function(t,e,i){var o,n=bn(this.inversePixelTransform,t.slice()),r=this.context,a=this.getLayer().getExtent();if(a&&!Qi(a,bn(e.pixelToCoordinateTransform,t.slice())))return null;try{var s=Math.round(n[0]),l=Math.round(n[1]),u=document.createElement("canvas"),p=u.getContext("2d");u.width=1,u.height=1,p.clearRect(0,0,1,1),p.drawImage(r.canvas,s,l,1,1,0,0,1,1),o=p.getImageData(0,0,1,1).data}catch(d){return"SecurityError"===d.name?new Uint8Array:o}return 0===o[3]?null:o},e}(qp),Up="Circle",Xp="Default",Kp="Image",Yp="LineString",Zp="Polygon",Hp="Text";function $p(t,e,i,o,n,r,a,s,l,u,p,d){var h=t[e],c=t[e+1],f=0,g=0,m=0,v=0;function y(){f=h,g=c,h=t[e+=o],c=t[e+1],v+=m,m=Math.sqrt((h-f)*(h-f)+(c-g)*(c-g))}do{y()}while(e<i-o&&v+m<r);for(var _=0===m?0:(r-v)/m,b=Ne(f,h,_),x=Ne(g,c,_),k=e-o,w=v,S=r+s*l(u,n,p);e<i-o&&v+m<S;)y();var C,z=Ne(f,h,_=0===m?0:(S-v)/m),T=Ne(g,c,_);if(d){var E=[b,x,z,T];$r(E,0,4,2,d,E,E),C=E[0]>E[2]}else C=b>z;var P,O=Math.PI,j=[],R=k+o===e;if(m=0,v=w,h=t[e=k],c=t[e+1],R){y(),P=Math.atan2(c-g,h-f),C&&(P+=P>0?-O:O);var I=(z+b)/2,F=(T+x)/2;return j[0]=[I,F,(S-r)/2,P,n],j}for(var M=0,A=n.length;M<A;){y();var D=Math.atan2(c-g,h-f);if(C&&(D+=D>0?-O:O),void 0!==P){var L=D-P;if(L+=L>O?-2*O:L<-O?2*O:0,Math.abs(L)>a)return null}P=D;for(var G=M,N=0;M<A;++M){var B=s*l(u,n[C?A-M-1:M],p);if(e+o<i&&v+m<r+N+B/2)break;N+=B}if(M!==G){var q=C?n.substring(A-G,A-M):n.substring(G,M);I=Ne(f,h,_=0===m?0:(r+N/2-v)/m),F=Ne(g,c,_);j.push([I,F,N/2,D,q]),r+=N}}return j}var Jp=[1/0,1/0,-1/0,-1/0],Qp=[],td=[],ed=[],id=[];function od(t){return t[3].declutterBox}var nd=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 rd(t,e){return"start"!==e&&"end"!==e||nd.test(t)||(e="start"===e?"left":"right"),Lp[e]}var ad=function(){function t(t,e,i,o){this.overlaps=i,this.pixelRatio=e,this.resolution=t,this.alignFill_,this.instructions=o.instructions,this.coordinates=o.coordinates,this.coordinateCache_={},this.renderedTransform_=[1,0,0,1,0,0],this.hitDetectionInstructions=o.hitDetectionInstructions,this.pixelCoordinates_=null,this.viewRotation_=0,this.fillStates=o.fillStates||{},this.strokeStates=o.strokeStates||{},this.textStates=o.textStates||{},this.widths_={},this.labels_={}}return t.prototype.createLabel=function(t,e,i,o){var n=t+e+i+o;if(this.labels_[n])return this.labels_[n];var r=o?this.strokeStates[o]:null,a=i?this.fillStates[i]:null,s=this.textStates[e],l=this.pixelRatio,u=[s.scale[0]*l,s.scale[1]*l],p=rd(t,s.textAlign||Kn),d=o&&r.lineWidth?r.lineWidth:0,h=t.split("\n"),c=h.length,f=[],g=function(t,e,i){for(var o=e.length,n=0,r=0;r<o;++r){var a=rr(t,e[r]);n=Math.max(n,a),i.push(a)}return n}(s.font,h,f),m=or(s.font),v=g+d,y=[],_=(v+2)*u[0],b=(m*c+d)*u[1],x={width:_<0?Math.floor(_):Math.ceil(_),height:b<0?Math.floor(b):Math.ceil(b),contextInstructions:y};(1==u[0]&&1==u[1]||y.push("scale",u),y.push("font",s.font),o)&&(y.push("strokeStyle",r.strokeStyle),y.push("lineWidth",d),y.push("lineCap",r.lineCap),y.push("lineJoin",r.lineJoin),y.push("miterLimit",r.miterLimit),(re?OffscreenCanvasRenderingContext2D:CanvasRenderingContext2D).prototype.setLineDash&&(y.push("setLineDash",[r.lineDash]),y.push("lineDashOffset",r.lineDashOffset)));i&&y.push("fillStyle",a.fillStyle),y.push("textBaseline","middle"),y.push("textAlign","center");var k,w=.5-p,S=p*v+w*d;if(o)for(k=0;k<c;++k)y.push("strokeText",[h[k],S+w*f[k],.5*(d+m)+k*m]);if(i)for(k=0;k<c;++k)y.push("fillText",[h[k],S+w*f[k],.5*(d+m)+k*m]);return this.labels_[n]=x,x},t.prototype.replayTextBackground_=function(t,e,i,o,n,r,a){t.beginPath(),t.moveTo.apply(t,e),t.lineTo.apply(t,i),t.lineTo.apply(t,o),t.lineTo.apply(t,n),t.lineTo.apply(t,e),r&&(this.alignFill_=r[2],this.fill_(t)),a&&(this.setStrokeStyle_(t,a),t.stroke())},t.prototype.calculateImageOrLabelDimensions_=function(t,e,i,o,n,r,a,s,l,u,p,d,h,c,f,g){var m,v=i-(a*=d[0]),y=o-(s*=d[1]),_=n+l>t?t-l:n,b=r+u>e?e-u:r,x=c[3]+_*d[0]+c[1],k=c[0]+b*d[1]+c[2],w=v-c[3],S=y-c[0];return(f||0!==p)&&(Qp[0]=w,id[0]=w,Qp[1]=S,td[1]=S,td[0]=w+x,ed[0]=td[0],ed[1]=S+k,id[1]=ed[1]),0!==p?(bn(m=kn([1,0,0,1,0,0],i,o,1,1,p,-i,-o),Qp),bn(m,td),bn(m,ed),bn(m,id),no(Math.min(Qp[0],td[0],ed[0],id[0]),Math.min(Qp[1],td[1],ed[1],id[1]),Math.max(Qp[0],td[0],ed[0],id[0]),Math.max(Qp[1],td[1],ed[1],id[1]),Jp)):no(Math.min(w,w+x),Math.min(S,S+k),Math.max(w,w+x),Math.max(S,S+k),Jp),h&&(v=Math.round(v),y=Math.round(y)),{drawImageX:v,drawImageY:y,drawImageW:_,drawImageH:b,originX:l,originY:u,declutterBox:{minX:Jp[0],minY:Jp[1],maxX:Jp[2],maxY:Jp[3],value:g},canvasTransform:m,scale:d}},t.prototype.replayImageOrLabel_=function(t,e,i,o,n,r,a){var s=!(!r&&!a),l=o.declutterBox,u=t.canvas,p=a?a[2]*o.scale[0]/2:0;return l.minX-p<=u.width/e&&l.maxX+p>=0&&l.minY-p<=u.height/e&&l.maxY+p>=0&&(s&&this.replayTextBackground_(t,Qp,td,ed,id,r,a),sr(t,o.canvasTransform,n,i,o.originX,o.originY,o.drawImageW,o.drawImageH,o.drawImageX,o.drawImageY,o.scale)),!0},t.prototype.fill_=function(t){if(this.alignFill_){var e=bn(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,o){var n=this.textStates[e],r=this.createLabel(t,e,o,i),a=this.strokeStates[i],s=this.pixelRatio,l=rd(t,n.textAlign||Kn),u=Lp[n.textBaseline||Yn],p=a&&a.lineWidth?a.lineWidth:0;return{label:r,anchorX:l*(r.width/s-2*n.scale[0])+2*(.5-l)*p,anchorY:u*r.height/s+2*(.5-u)*p}},t.prototype.execute_=function(t,e,i,o,n,r,a,s){var l;this.pixelCoordinates_&&mt(i,this.renderedTransform_)?l=this.pixelCoordinates_:(this.pixelCoordinates_||(this.pixelCoordinates_=[]),l=Hr(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,p,d,h,c,f,g,m,v,y,_,b,x,k,w,S,C=0,z=o.length,T=0,E=0,P=0,O=null,j=null,R=this.coordinateCache_,I=this.viewRotation_,F=Math.round(1e12*Math.atan2(-i[1],i[0]))/1e12,M={context:t,pixelRatio:this.pixelRatio,resolution:this.resolution,rotation:I},A=this.instructions!=o||this.overlaps?0:200;C<z;){var D=o[C];switch(D[0]){case zp.BEGIN_GEOMETRY:x=D[1],S=D[3],x.getGeometry()?void 0===a||zo(a,S.getExtent())?++C:C=D[2]+1:C=D[2];break;case zp.BEGIN_PATH:E>A&&(this.fill_(t),E=0),P>A&&(t.stroke(),P=0),E||P||(t.beginPath(),h=NaN,c=NaN),++C;break;case zp.CIRCLE:var L=l[T=D[1]],G=l[T+1],N=l[T+2]-L,B=l[T+3]-G,q=Math.sqrt(N*N+B*B);t.moveTo(L+q,G),t.arc(L,G,q,0,2*Math.PI,!0),++C;break;case zp.CLOSE_PATH:t.closePath(),++C;break;case zp.CUSTOM:T=D[1],u=D[2];var W=D[3],V=D[4],U=6==D.length?D[5]:void 0;M.geometry=W,M.feature=x,C in R||(R[C]=[]);var X=R[C];U?U(l,T,u,2,X):(X[0]=l[T],X[1]=l[T+1],X.length=2),V(X,M),++C;break;case zp.DRAW_IMAGE:T=D[1],u=D[2],m=D[3],p=D[4],d=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(!m&&D.length>=19){v=D[18],y=D[19],_=D[20],b=D[21];var it=this.drawLabelWithPointPlacement_(v,y,_,b);m=it.label,D[3]=m;var ot=D[22];p=(it.anchorX-ot)*this.pixelRatio,D[4]=p;var nt=D[23];d=(it.anchorY-nt)*this.pixelRatio,D[5]=d,K=m.height,D[6]=K,tt=m.width,D[13]=tt}var rt=void 0;D.length>24&&(rt=D[24]);var at=void 0,st=void 0,lt=void 0;D.length>16?(at=D[15],st=D[16],lt=D[17]):(at=Zn,st=!1,lt=!1),$&&F?J+=I:$||F||(J-=I);for(var ut=0;T<u;T+=2)if(!(rt&&rt[ut++]<tt/this.pixelRatio)){var pt=[t,e,m,Lt=this.calculateImageOrLabelDimensions_(m.width,m.height,l[T],l[T+1],tt,K,p,d,Z,H,J,Q,n,at,st||lt,x),Y,st?O:null,lt?j:null],dt=void 0,ht=void 0;if(s&&et){var ct=u-T;if(!et[ct]){et[ct]=pt;continue}if(dt=et[ct],delete et[ct],ht=od(dt),s.collides(ht))continue}s&&s.collides(Lt.declutterBox)||(dt&&(s&&s.insert(ht),this.replayImageOrLabel_.apply(this,dt)),s&&s.insert(Lt.declutterBox),this.replayImageOrLabel_.apply(this,pt))}++C;break;case zp.DRAW_CHARS:var ft=D[1],gt=D[2],vt=D[3],yt=D[4];b=D[5];var _t=D[6],bt=D[7],xt=D[8];_=D[9];var kt=D[10];v=D[11],y=D[12];var wt=[D[13],D[13]],St=this.textStates[y],Ct=St.font,zt=[St.scale[0]*bt,St.scale[1]*bt],Tt=void 0;Ct in this.widths_?Tt=this.widths_[Ct]:(Tt={},this.widths_[Ct]=Tt);var Et=ws(l,ft,gt,2),Pt=Math.abs(zt[0])*ar(Ct,v,Tt);if(yt||Pt<=Et){var Ot=this.textStates[y].textAlign,jt=$p(l,ft,gt,2,v,(Et-Pt)*Lp[Ot],_t,Math.abs(zt[0]),ar,Ct,Tt,F?0:this.viewRotation_);t:if(jt){var Rt=[],It=void 0,Ft=void 0,Mt=void 0,At=void 0,Dt=void 0;if(_)for(It=0,Ft=jt.length;It<Ft;++It){Mt=(Dt=jt[It])[4],At=this.createLabel(Mt,y,"",_),p=Dt[2]+(zt[0]<0?-kt:kt),d=vt*At.height+2*(.5-vt)*kt*zt[1]/zt[0]-xt;var Lt=this.calculateImageOrLabelDimensions_(At.width,At.height,Dt[0],Dt[1],At.width,At.height,p,d,0,0,Dt[3],wt,!1,Zn,!1,x);if(s&&s.collides(Lt.declutterBox))break t;Rt.push([t,e,At,Lt,1,null,null])}if(b)for(It=0,Ft=jt.length;It<Ft;++It){Mt=(Dt=jt[It])[4],At=this.createLabel(Mt,y,b,""),p=Dt[2],d=vt*At.height-xt;Lt=this.calculateImageOrLabelDimensions_(At.width,At.height,Dt[0],Dt[1],At.width,At.height,p,d,0,0,Dt[3],wt,!1,Zn,!1,x);if(s&&s.collides(Lt.declutterBox))break t;Rt.push([t,e,At,Lt,1,null,null])}s&&s.load(Rt.map(od));for(var Gt=0,Nt=Rt.length;Gt<Nt;++Gt)this.replayImageOrLabel_.apply(this,Rt[Gt])}}++C;break;case zp.END_GEOMETRY:if(void 0!==r){var Bt=r(x=D[1],S);if(Bt)return Bt}++C;break;case zp.FILL:A?E++:this.fill_(t),++C;break;case zp.MOVE_TO_LINE_TO:for(T=D[1],u=D[2],k=l[T],g=(w=l[T+1])+.5|0,(f=k+.5|0)===h&&g===c||(t.moveTo(k,w),h=f,c=g),T+=2;T<u;T+=2)f=(k=l[T])+.5|0,g=(w=l[T+1])+.5|0,T!=u-2&&f===h&&g===c||(t.lineTo(k,w),h=f,c=g);++C;break;case zp.SET_FILL_STYLE:O=D,this.alignFill_=D[2],E&&(this.fill_(t),E=0,P&&(t.stroke(),P=0)),t.fillStyle=D[1],++C;break;case zp.SET_STROKE_STYLE:j=D,P&&(t.stroke(),P=0),this.setStrokeStyle_(t,D),++C;break;case zp.STROKE:A?P++:t.stroke(),++C;break;default:++C}}E&&this.fill_(t),P&&t.stroke()},t.prototype.execute=function(t,e,i,o,n,r){this.viewRotation_=o,this.execute_(t,e,i,this.instructions,n,void 0,void 0,r)},t.prototype.executeHitDetection=function(t,e,i,o,n){return this.viewRotation_=i,this.execute_(t,1,e,this.hitDetectionInstructions,!0,o,n)},t}(),sd=[Zp,Up,Yp,Kp,Hp,Xp],ld=function(){function t(t,e,i,o,n,r){this.maxExtent_=t,this.overlaps_=o,this.pixelRatio_=i,this.resolution_=e,this.renderBuffer_=r,this.executorsByZIndex_={},this.hitDetectionContext_=null,this.hitDetectionTransform_=[1,0,0,1,0,0],this.createExecutors_(n)}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 o=t[e];for(var n in o){var r=o[n];i[n]=new ad(this.resolution_,this.pixelRatio_,this.overlaps_,r)}}},t.prototype.hasExecutors=function(t){for(var e in this.executorsByZIndex_)for(var i=this.executorsByZIndex_[e],o=0,n=t.length;o<n;++o)if(t[o]in i)return!0;return!1},t.prototype.forEachFeatureAtCoordinate=function(t,e,i,o,n,r){var a=2*(o=Math.round(o))+1,s=kn(this.hitDetectionTransform_,o+.5,o+.5,1/e,-1/e,-i,-t[0],-t[1]),l=!this.hitDetectionContext_;l&&(this.hitDetectionContext_=le(a,a));var u,p=this.hitDetectionContext_;p.canvas.width!==a||p.canvas.height!==a?(p.canvas.width=a,p.canvas.height=a):l||p.clearRect(0,0,a,a),void 0!==this.renderBuffer_&&(po(u=[1/0,1/0,-1/0,-1/0],t),Hi(u,e*(this.renderBuffer_+o),u));var d,h=function(t){if(void 0!==ud[t])return ud[t];for(var e=2*t+1,i=t*t,o=new Array(i+1),n=0;n<=t;++n)for(var r=0;r<=t;++r){var a=n*n+r*r;if(a>i)break;var s=o[a];s||(s=[],o[a]=s),s.push(4*((t+n)*e+(t+r))+3),n>0&&s.push(4*((t-n)*e+(t+r))+3),r>0&&(s.push(4*((t+n)*e+(t-r))+3),n>0&&s.push(4*((t-n)*e+(t-r))+3))}for(var l=[],u=(n=0,o.length);n<u;++n)o[n]&&l.push.apply(l,o[n]);return ud[t]=l,l}(o);function c(t,e){for(var i=p.getImageData(0,0,a,a).data,s=0,l=h.length;s<l;s++)if(i[h[s]]>0){if(!r||d!==Kp&&d!==Hp||-1!==r.indexOf(t)){var u=(h[s]-3)/4,c=o-u%a,f=o-(u/a|0),g=n(t,e,c*c+f*f);if(g)return g}p.clearRect(0,0,a,a);break}}var f,g,m,v,y,_=Object.keys(this.executorsByZIndex_).map(Number);for(_.sort(ht),f=_.length-1;f>=0;--f){var b=_[f].toString();for(m=this.executorsByZIndex_[b],g=sd.length-1;g>=0;--g)if(void 0!==(v=m[d=sd[g]])&&(y=v.executeHitDetection(p,s,i,c,u)))return y}},t.prototype.getClipCoords=function(t){var e=this.maxExtent_;if(!e)return null;var i=e[0],o=e[1],n=e[2],r=e[3],a=[i,o,i,r,n,r,n,o];return Hr(a,0,8,2,t,a),a},t.prototype.isEmpty=function(){return wt(this.executorsByZIndex_)},t.prototype.execute=function(t,e,i,o,n,r,a){var s=Object.keys(this.executorsByZIndex_).map(Number);s.sort(ht),this.maxExtent_&&(t.save(),this.clip(t,i));var l,u,p,d,h,c,f=r||sd;for(a&&s.reverse(),l=0,u=s.length;l<u;++l){var g=s[l].toString();for(h=this.executorsByZIndex_[g],p=0,d=f.length;p<d;++p){void 0!==(c=h[f[p]])&&c.execute(t,e,i,o,n,a)}}this.maxExtent_&&t.restore()},t}(),ud={};var pd=ld,dd=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 o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}(),hd=function(t){function e(e,i,o,n,r,a,s){var l=t.call(this)||this;return l.context_=e,l.pixelRatio_=i,l.extent_=o,l.transform_=n,l.viewRotation_=r,l.squaredTolerance_=a,l.userTransform_=s,l.contextFillState_=null,l.contextStrokeState_=null,l.contextTextState_=null,l.fillState_=null,l.strokeState_=null,l.image_=null,l.imageAnchorX_=0,l.imageAnchorY_=0,l.imageHeight_=0,l.imageOpacity_=0,l.imageOriginX_=0,l.imageOriginY_=0,l.imageRotateWithView_=!1,l.imageRotation_=0,l.imageScale_=[0,0],l.imageWidth_=0,l.text_="",l.textOffsetX_=0,l.textOffsetY_=0,l.textRotateWithView_=!1,l.textRotation_=0,l.textScale_=[0,0],l.textFillState_=null,l.textStrokeState_=null,l.textState_=null,l.pixelCoordinates_=[],l.tmpLocalTransform_=[1,0,0,1,0,0],l}return dd(e,t),e.prototype.drawImages_=function(t,e,i,o){if(this.image_){var n=Hr(t,e,i,o,this.transform_,this.pixelCoordinates_),r=this.context_,a=this.tmpLocalTransform_,s=r.globalAlpha;1!=this.imageOpacity_&&(r.globalAlpha=s*this.imageOpacity_);var l=this.imageRotation_;this.imageRotateWithView_&&(l+=this.viewRotation_);for(var u=0,p=n.length;u<p;u+=2){var d=n[u]-this.imageAnchorX_,h=n[u+1]-this.imageAnchorY_;if(0!==l||1!=this.imageScale_[0]||1!=this.imageScale_[1]){var c=d+this.imageAnchorX_,f=h+this.imageAnchorY_;kn(a,c,f,1,1,l,-c,-f),r.setTransform.apply(r,a),r.translate(c,f),r.scale(this.imageScale_[0],this.imageScale_[1]),r.drawImage(this.image_,this.imageOriginX_,this.imageOriginY_,this.imageWidth_,this.imageHeight_,-this.imageAnchorX_,-this.imageAnchorY_,this.imageWidth_,this.imageHeight_),r.setTransform(1,0,0,1,0,0)}else r.drawImage(this.image_,this.imageOriginX_,this.imageOriginY_,this.imageWidth_,this.imageHeight_,d,h,this.imageWidth_,this.imageHeight_)}1!=this.imageOpacity_&&(r.globalAlpha=s)}},e.prototype.drawText_=function(t,e,i,o){if(this.textState_&&""!==this.text_){this.textFillState_&&this.setContextFillState_(this.textFillState_),this.textStrokeState_&&this.setContextStrokeState_(this.textStrokeState_),this.setContextTextState_(this.textState_);var n=Hr(t,e,i,o,this.transform_,this.pixelCoordinates_),r=this.context_,a=this.textRotation_;for(this.textRotateWithView_&&(a+=this.viewRotation_);e<i;e+=o){var s=n[e]+this.textOffsetX_,l=n[e+1]+this.textOffsetY_;if(0!==a||1!=this.textScale_[0]||1!=this.textScale_[1]){var u=kn(this.tmpLocalTransform_,s,l,1,1,a,-s,-l);r.setTransform.apply(r,u),r.translate(s,l),r.scale(this.textScale_[0],this.textScale_[1]),this.textStrokeState_&&r.strokeText(this.text_,0,0),this.textFillState_&&r.fillText(this.text_,0,0),r.setTransform(1,0,0,1,0,0)}else this.textStrokeState_&&r.strokeText(this.text_,s,l),this.textFillState_&&r.fillText(this.text_,s,l)}}},e.prototype.moveToLineTo_=function(t,e,i,o,n){var r=this.context_,a=Hr(t,e,i,o,this.transform_,this.pixelCoordinates_);r.moveTo(a[0],a[1]);var s=a.length;n&&(s-=2);for(var l=2;l<s;l+=2)r.lineTo(a[l],a[l+1]);return n&&r.closePath(),i},e.prototype.drawRings_=function(t,e,i,o){for(var n=0,r=i.length;n<r;++n)e=this.moveToLineTo_(t,e,i[n],o,!0);return e},e.prototype.drawCircle=function(t){if(zo(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 o=t.getFlatCoordinates();if(o){var n=t.getStride();return Hr(o,0,o.length,n,e,i)}return null}(t,this.transform_,this.pixelCoordinates_),i=e[2]-e[0],o=e[3]-e[1],n=Math.sqrt(i*i+o*o),r=this.context_;r.beginPath(),r.arc(e[0],e[1],n,0,2*Math.PI),this.fillState_&&r.fill(),this.strokeState_&&r.stroke()}""!==this.text_&&this.drawText_(t.getCenter(),0,2,2)}},e.prototype.setStyle=function(t){this.setFillStrokeStyle(t.getFill(),t.getStroke()),this.setImageStyle(t.getImage()),this.setTextStyle(t.getText())},e.prototype.setTransform=function(t){this.transform_=t},e.prototype.drawGeometry=function(t){switch(t.getType()){case Po:this.drawPoint(t);break;case Oo:this.drawLineString(t);break;case Ro:this.drawPolygon(t);break;case Io:this.drawMultiPoint(t);break;case Fo:this.drawMultiLineString(t);break;case Mo:this.drawMultiPolygon(t);break;case Ao:this.drawGeometryCollection(t);break;case Do:this.drawCircle(t)}},e.prototype.drawFeature=function(t,e){var i=e.getGeometryFunction()(t);i&&zo(this.extent_,i.getExtent())&&(this.setStyle(e),this.drawGeometry(i))},e.prototype.drawGeometryCollection=function(t){for(var e=t.getGeometriesArray(),i=0,o=e.length;i<o;++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_)),zo(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 o=t.getFlatMidpoint();this.drawText_(o,0,2,2)}}},e.prototype.drawMultiLineString=function(t){this.squaredTolerance_&&(t=t.simplifyTransformed(this.squaredTolerance_,this.userTransform_));var e=t.getExtent();if(zo(this.extent_,e)){if(this.strokeState_){this.setContextStrokeState_(this.strokeState_);var i=this.context_,o=t.getFlatCoordinates(),n=0,r=t.getEnds(),a=t.getStride();i.beginPath();for(var s=0,l=r.length;s<l;++s)n=this.moveToLineTo_(o,n,r[s],a,!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_)),zo(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_)),zo(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(),o=0,n=t.getEndss(),r=t.getStride();e.beginPath();for(var a=0,s=n.length;a<s;++a){var l=n[a];o=this.drawRings_(i,o,l,r)}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&&(mt(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_,o=t.textAlign?t.textAlign:Kn;i?(i.font!=t.font&&(i.font=t.font,e.font=t.font),i.textAlign!=o&&(i.textAlign=o,e.textAlign=o),i.textBaseline!=t.textBaseline&&(i.textBaseline=t.textBaseline,e.textBaseline=t.textBaseline)):(e.font=t.font,e.textAlign=o,e.textBaseline=t.textBaseline,this.contextTextState_={font:t.font,textAlign:o,textBaseline:t.textBaseline})},e.prototype.setFillStrokeStyle=function(t,e){var i=this;if(t){var o=t.getColor();this.fillState_={fillStyle:ll(o||qn)}}else this.fillState_=null;if(e){var n=e.getColor(),r=e.getLineCap(),a=e.getLineDash(),s=e.getLineDashOffset(),l=e.getLineJoin(),u=e.getWidth(),p=e.getMiterLimit(),d=a||Vn;this.strokeState_={lineCap:void 0!==r?r:Wn,lineDash:1===this.pixelRatio_?d:d.map((function(t){return t*i.pixelRatio_})),lineDashOffset:(s||0)*this.pixelRatio_,lineJoin:void 0!==l?l:Un,lineWidth:(void 0!==u?u:1)*this.pixelRatio_,miterLimit:void 0!==p?p:10,strokeStyle:ll(n||Xn)}}else this.strokeState_=null},e.prototype.setImageStyle=function(t){var e;if(t&&(e=t.getSize())){var i=t.getAnchor(),o=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_=o[0],this.imageOriginY_=o[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:ll(i||qn)}}else this.textFillState_=null;var o=t.getStroke();if(o){var n=o.getColor(),r=o.getLineCap(),a=o.getLineDash(),s=o.getLineDashOffset(),l=o.getLineJoin(),u=o.getWidth(),p=o.getMiterLimit();this.textStrokeState_={lineCap:void 0!==r?r:Wn,lineDash:a||Vn,lineDashOffset:s||0,lineJoin:void 0!==l?l:Un,lineWidth:void 0!==u?u:1,miterLimit:void 0!==p?p:10,strokeStyle:ll(n||Xn)}}else this.textStrokeState_=null;var d=t.getFont(),h=t.getOffsetX(),c=t.getOffsetY(),f=t.getRotateWithView(),g=t.getRotation(),m=t.getScaleArray(),v=t.getText(),y=t.getTextAlign(),_=t.getTextBaseline();this.textState_={font:void 0!==d?d:Bn,textAlign:void 0!==y?y:Kn,textBaseline:void 0!==_?_:Yn},this.text_=void 0!==v?v:"",this.textOffsetX_=void 0!==h?this.pixelRatio_*h:0,this.textOffsetY_=void 0!==c?this.pixelRatio_*c:0,this.textRotateWithView_=void 0!==f&&f,this.textRotation_=void 0!==g?g:0,this.textScale_=[this.pixelRatio_*m[0],this.pixelRatio_*m[1]]}else this.text_=""},e}(Tp),cd=.5;function fd(t,e,i,o,n,r,a){var s=le(t[0]*cd,t[1]*cd);s.imageSmoothingEnabled=!1;for(var l=s.canvas,u=new hd(s,cd,n,null,a),p=i.length,d=Math.floor(16777215/p),h={},c=1;c<=p;++c){var f=i[c-1],g=f.getStyleFunction()||o;if(o){var m=g(f,r);if(m){Array.isArray(m)||(m=[m]);for(var v="#"+("000000"+(c*d).toString(16)).slice(-6),y=0,_=m.length;y<_;++y){var b=m[y],x=b.getGeometryFunction()(f);if(x&&zo(n,x.getExtent())){var k=b.clone(),w=k.getFill();w&&w.setColor(v);var S=k.getStroke();S&&(S.setColor(v),S.setLineDash(null)),k.setText(void 0);var C=b.getImage();if(C&&0!==C.getOpacity()){var z=C.getImageSize();if(!z)continue;var T=le(z[0],z[1],void 0,{alpha:!1}),E=T.canvas;T.fillStyle=v,T.fillRect(0,0,E.width,E.height),k.setImage(new al({img:E,imgSize:z,anchor:C.getAnchor(),anchorXUnits:qs,anchorYUnits:qs,offset:C.getOrigin(),opacity:1,size:C.getSize(),scale:C.getScale(),rotation:C.getRotation(),rotateWithView:C.getRotateWithView()}))}var P=k.getZIndex()||0;(R=h[P])||(R={},h[P]=R,R[Ro]=[],R[Do]=[],R[Oo]=[],R[Po]=[]),R[x.getType().replace("Multi","")].push(x,k)}}}}}for(var O=Object.keys(h).map(Number).sort(ht),j=(c=0,O.length);c<j;++c){var R=h[O[c]];for(var I in R){var F=R[I];for(y=0,_=F.length;y<_;y+=2){u.setStyle(F[y+1]);for(var M=0,A=e.length;M<A;++M)u.setTransform(e[M]),u.drawGeometry(F[y])}}}return s.getImageData(0,0,l.width,l.height)}function gd(t,e,i){var o=[];if(i){var n=Math.floor(Math.round(t[0])*cd),r=Math.floor(Math.round(t[1])*cd),a=4*(Ie(n,0,i.width-1)+Ie(r,0,i.height-1)*i.width),s=i.data[a],l=i.data[a+1],u=i.data[a+2]+256*(l+256*s),p=Math.floor(16777215/e.length);u&&u%p==0&&o.push(e[u/p-1])}return o}var md={Point:function(t,e,i,o,n){var r,a=i.getImage(),s=i.getText();n&&(t=n,r=a&&s&&s.getText()?{}:void 0);if(a){if(a.getImageState()!=Zs)return;var l=t.getBuilder(i.getZIndex(),Kp);l.setImageStyle(a,r),l.drawPoint(e,o)}if(s&&s.getText()){var u=t.getBuilder(i.getZIndex(),Hp);u.setTextStyle(s,r),u.drawText(e,o)}},LineString:function(t,e,i,o,n){var r=i.getStroke();if(r){var a=t.getBuilder(i.getZIndex(),Yp);a.setFillStrokeStyle(null,r),a.drawLineString(e,o)}var s=i.getText();if(s&&s.getText()){var l=(n||t).getBuilder(i.getZIndex(),Hp);l.setTextStyle(s),l.drawText(e,o)}},Polygon:function(t,e,i,o,n){var r=i.getFill(),a=i.getStroke();if(r||a){var s=t.getBuilder(i.getZIndex(),Zp);s.setFillStrokeStyle(r,a),s.drawPolygon(e,o)}var l=i.getText();if(l&&l.getText()){var u=(n||t).getBuilder(i.getZIndex(),Hp);u.setTextStyle(l),u.drawText(e,o)}},MultiPoint:function(t,e,i,o,n){var r,a=i.getImage(),s=i.getText();n&&(t=n,r=a&&s&&s.getText()?{}:void 0);if(a){if(a.getImageState()!=Zs)return;var l=t.getBuilder(i.getZIndex(),Kp);l.setImageStyle(a,r),l.drawMultiPoint(e,o)}if(s&&s.getText()){var u=(n||t).getBuilder(i.getZIndex(),Hp);u.setTextStyle(s,r),u.drawText(e,o)}},MultiLineString:function(t,e,i,o,n){var r=i.getStroke();if(r){var a=t.getBuilder(i.getZIndex(),Yp);a.setFillStrokeStyle(null,r),a.drawMultiLineString(e,o)}var s=i.getText();if(s&&s.getText()){var l=(n||t).getBuilder(i.getZIndex(),Hp);l.setTextStyle(s),l.drawText(e,o)}},MultiPolygon:function(t,e,i,o,n){var r=i.getFill(),a=i.getStroke();if(a||r){var s=t.getBuilder(i.getZIndex(),Zp);s.setFillStrokeStyle(r,a),s.drawMultiPolygon(e,o)}var l=i.getText();if(l&&l.getText()){var u=(n||t).getBuilder(i.getZIndex(),Hp);u.setTextStyle(l),u.drawText(e,o)}},GeometryCollection:function(t,e,i,o,n){var r,a,s=e.getGeometriesArray();for(r=0,a=s.length;r<a;++r){(0,md[s[r].getType()])(t,s[r],i,o,n)}},Circle:function(t,e,i,o,n){var r=i.getFill(),a=i.getStroke();if(r||a){var s=t.getBuilder(i.getZIndex(),Up);s.setFillStrokeStyle(r,a),s.drawCircle(e,o)}var l=i.getText();if(l&&l.getText()){var u=(n||t).getBuilder(i.getZIndex(),Hp);u.setTextStyle(l),u.drawText(e,o)}}};function vd(t,e){return parseInt(Kt(t),10)-parseInt(Kt(e),10)}function yd(t,e){var i=_d(t,e);return i*i}function _d(t,e){return.5*t/e}function bd(t,e,i,o,n,r,a){var s=!1,l=i.getImage();if(l){var u=l.getImageState();u==Zs||u==Hs?l.unlistenImageChange(n):(u==Ks&&l.load(),u=l.getImageState(),l.listenImageChange(n),s=!0)}return function(t,e,i,o,n,r){var a=i.getGeometryFunction()(e);if(!a)return;var s=a.simplifyTransformed(o,n);if(i.getRenderer())xd(t,s,i,e);else{(0,md[s.getType()])(t,s,i,e,r)}}(t,e,i,o,r,a),s}function xd(t,e,i,o){if(e.getType()!=Ao)t.getBuilder(i.getZIndex(),Xp).drawCustom(e,o,i.getRenderer(),i.getHitDetectionRenderer());else for(var n=e.getGeometries(),r=0,a=n.length;r<a;++r)xd(t,n[r],i,o)}var kd=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 o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}(),wd=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 kd(e,t),e.prototype.useContainer=function(e,i,o){o<1&&(e=null),t.prototype.useContainer.call(this,e,i,o)},e.prototype.renderWorlds=function(t,e,i){var o=e.extent,n=e.viewState,r=n.center,a=n.resolution,s=n.projection,l=n.rotation,u=s.getExtent(),p=this.getLayer().getSource(),d=e.pixelRatio,h=e.viewHints,c=!(h[Ir]||h[Fr]),f=this.context,g=Math.round(e.size[0]*d),m=Math.round(e.size[1]*d),v=p.getWrapX()&&s.canWrapX(),y=v?Co(u):null,_=v?Math.ceil((o[2]-u[2])/y)+1:1,b=v?Math.floor((o[0]-u[0])/y):0;do{var x=this.getRenderTransform(r,a,l,d,g,m,b*y);t.execute(f,1,x,l,c,void 0,i)}while(++b<_)},e.prototype.renderDeclutter=function(t){this.declutterExecutorGroup&&this.renderWorlds(this.declutterExecutorGroup,t,t.declutterTree)},e.prototype.renderFrame=function(t,e){var i=t.pixelRatio,o=t.layerStatesArray[t.layerIndex];!function(t,e,i){_n(t,e,0,0,i,0,0)}(this.pixelTransform,1/i,1/i),wn(this.inversePixelTransform,this.pixelTransform);var n=Sn(this.pixelTransform);this.useContainer(e,n,o.opacity);var r=this.context,a=r.canvas,s=this.replayGroup_,l=this.declutterExecutorGroup;if((!s||s.isEmpty())&&(!l||l.isEmpty()))return null;var u=Math.round(t.size[0]*i),p=Math.round(t.size[1]*i);a.width!=u||a.height!=p?(a.width=u,a.height=p,a.style.transform!==n&&(a.style.transform=n)):this.containerReused||r.clearRect(0,0,u,p),this.preRender(r,t);var d=t.viewState;d.projection;var h=!1,c=!0;if(o.extent&&this.clipping){var f=fn(o.extent);(h=(c=zo(f,t.extent))&&!to(f,t.extent))&&this.clipUnrotated(r,t,f)}c&&this.renderWorlds(s,t),h&&r.restore(),this.postRender(r,t);var g=be(o.opacity),m=this.container;return g!==m.style.opacity&&(m.style.opacity=g),this.renderedRotation_!==d.rotation&&(this.renderedRotation_=d.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];bn(this.pixelTransform,i);var o=this.renderedCenter_,n=this.renderedResolution_,r=this.renderedRotation_,a=this.renderedProjection_,s=this.wrappedRenderedExtent_,l=this.getLayer(),u=[],p=i[0]*cd,d=i[1]*cd;u.push(this.getRenderTransform(o,n,r,cd,p,d,0).slice());var h=l.getSource(),c=a.getExtent();if(h.getWrapX()&&a.canWrapX()&&!to(c,s)){for(var f=s[0],g=Co(c),m=0,v=void 0;f<c[0];)v=g*--m,u.push(this.getRenderTransform(o,n,r,cd,p,d,v).slice()),f+=g;for(m=0,f=s[2];f>c[2];)v=g*++m,u.push(this.getRenderTransform(o,n,r,cd,p,d,v).slice()),f-=g}this.hitDetectionImageData_=fd(i,u,this.renderedFeatures_,l.getStyleFunction(),s,n,r)}e(gd(t,this.renderedFeatures_,this.hitDetectionImageData_))}.bind(this))},e.prototype.forEachFeatureAtCoordinate=function(t,e,i,o,n){var r=this;if(this.replayGroup_){var a,s=e.viewState.resolution,l=e.viewState.rotation,u=this.getLayer(),p={},d=function(t,e,i){var r=Kt(t),a=p[r];if(a){if(!0!==a&&i<a.distanceSq){if(0===i)return p[r]=!0,n.splice(n.lastIndexOf(a),1),o(t,u,e);a.geometry=e,a.distanceSq=i}}else{if(0===i)return p[r]=!0,o(t,u,e);n.push(p[r]={feature:t,layer:u,geometry:e,distanceSq:i,callback:o})}},h=[this.replayGroup_];return this.declutterExecutorGroup&&h.push(this.declutterExecutorGroup),h.some((function(o){return a=o.forEachFeatureAtCoordinate(t,s,l,i,d,o===r.declutterExecutorGroup?e.declutterTree.all().map((function(t){return t.value})):null)})),a}},e.prototype.handleFontsChanged=function(){var t=this.getLayer();t.getVisible()&&this.replayGroup_&&t.changed()},e.prototype.handleStyleImageChange_=function(t){this.renderIfReadyAndVisible()},e.prototype.prepareFrame=function(t){var e=this.getLayer(),i=e.getSource();if(!i)return!1;var o=t.viewHints[Ir],n=t.viewHints[Fr],r=e.getUpdateWhileAnimating(),a=e.getUpdateWhileInteracting();if(!this.dirty_&&!r&&o||!a&&n)return this.animatingOrInteracting_=!0,!0;this.animatingOrInteracting_=!1;var s=t.extent,l=t.viewState,u=l.projection,p=l.resolution,d=t.pixelRatio,h=e.getRevision(),c=e.getRenderBuffer(),f=e.getRenderOrder();void 0===f&&(f=vd);var g=l.center.slice(),m=Hi(s,c*p),v=m.slice(),y=[m.slice()],_=u.getExtent();if(i.getWrapX()&&u.canWrapX()&&!to(_,t.extent)){var b=Co(_),x=Math.max(Co(m)/2,b);m[0]=_[0]-x,m[2]=_[2]+x,Yo(g,u);var k=function(t,e){var i=e.getExtent(),o=yo(t);if(e.canWrapX()&&(o[0]<i[0]||o[0]>=i[2])){var n=Co(i),r=Math.floor((o[0]-i[0])/n)*n;t[0]-=r,t[2]-=r}return t}(y[0],u);k[0]<_[0]&&k[2]<_[2]?y.push([k[0]+b,k[1],k[2]+b,k[3]]):k[0]>_[0]&&k[2]>_[2]&&y.push([k[0]-b,k[1],k[2]-b,k[3]])}if(!this.dirty_&&this.renderedResolution_==p&&this.renderedRevision_==h&&this.renderedRenderOrder_==f&&to(this.wrappedRenderedExtent_,m))return mt(this.renderedExtent_,v)||(this.hitDetectionImageData_=null,this.renderedExtent_=v),this.renderedCenter_=g,this.replayGroupChanged=!1,!0;this.replayGroup_=null,this.dirty_=!1;var w,S=new Np(_d(p,d),m,p,d);this.getLayer().getDeclutter()&&(w=new Np(_d(p,d),m,p,d));for(var C=0,z=y.length;C<z;++C)i.loadFeatures(y[C],p,u);var T=yd(p,d),E=function(t){var i,o=t.getStyleFunction()||e.getStyleFunction();if(o&&(i=o(t,p)),i){var n=this.renderFeature(t,T,i,S,undefined,w);this.dirty_=this.dirty_||n}}.bind(this),P=cn(m),O=i.getFeaturesInExtent(P);f&&O.sort(f);for(C=0,z=O.length;C<z;++C)E(O[C]);this.renderedFeatures_=O;var j=S.finish(),R=new pd(m,p,d,i.getOverlaps(),j,e.getRenderBuffer());return w&&(this.declutterExecutorGroup=new pd(m,p,d,i.getOverlaps(),w.finish(),e.getRenderBuffer())),this.renderedResolution_=p,this.renderedRevision_=h,this.renderedRenderOrder_=f,this.renderedExtent_=v,this.wrappedRenderedExtent_=m,this.renderedCenter_=g,this.renderedProjection_=u,this.replayGroup_=R,this.hitDetectionImageData_=null,this.replayGroupChanged=!0,!0},e.prototype.renderFeature=function(t,e,i,o,n,r){if(!i)return!1;var a=!1;if(Array.isArray(i))for(var s=0,l=i.length;s<l;++s)a=bd(o,t,i[s],e,this.boundHandleStyleImageChange_,n,r)||a;else a=bd(o,t,i,e,this.boundHandleStyleImageChange_,n,r);return a},e}(Vp),Sd=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 o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}(),Cd=function(t){function e(e){return t.call(this,e)||this}return Sd(e,t),e.prototype.createRenderer=function(){return new wd(this)},e}(bp),zd=function(){function t(t){this.rbush_=new np(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_[Kt(e)]=i},t.prototype.load=function(t,e){for(var i=new Array(e.length),o=0,n=e.length;o<n;o++){var r=t[o],a=e[o],s={minX:r[0],minY:r[1],maxX:r[2],maxY:r[3],value:a};i[o]=s,this.items_[Kt(a)]=s}this.rbush_.load(i)},t.prototype.remove=function(t){var e=Kt(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_[Kt(e)];lo([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,o=0,n=t.length;o<n;o++)if(i=e(t[o]))return i;return i},t.prototype.isEmpty=function(){return wt(this.items_)},t.prototype.clear=function(){this.rbush_.clear(),this.items_={}},t.prototype.getExtent=function(t){var e=this.rbush_.toJSON();return no(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}(),Td=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 o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}();function Ed(t){return t?Array.isArray(t)?function(e){return t}:"function"==typeof t?t:function(e){return[t]}:null}var Pd=function(t){function e(e){var i=t.call(this)||this;i.projection=Jo(e.projection),i.attributions_=Ed(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 o=i;return i.viewPromise_=new Promise((function(t,e){o.viewResolver=t,o.viewRejector=e})),i}return Td(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 Ut()},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_=Ed(t),this.changed()},e.prototype.setState=function(t){this.state_=t,this.changed()},e}(Ht),Od="addfeature",jd="changefeature",Rd="clear",Id="removefeature",Fd="featuresloadstart",Md="featuresloadend",Ad="featuresloaderror";function Dd(t,e){return[[-1/0,-1/0,1/0,1/0]]}function Ld(t,e,i,o,n,r,a){var s=new XMLHttpRequest;s.open("GET","function"==typeof t?t(i,o,n):t,!0),e.getType()==fs&&(s.responseType="arraybuffer"),s.withCredentials=false,s.onload=function(t){if(!s.status||s.status>=200&&s.status<300){var o=e.getType(),l=void 0;o==gs||o==ms?l=s.responseText:o==vs?(l=s.responseXML)||(l=(new DOMParser).parseFromString(s.responseText,"application/xml")):o==fs&&(l=s.response),l?r(e.readFeatures(l,{extent:i,featureProjection:n}),e.readProjection(l)):a()}else a()},s.onerror=a,s.send()}function Gd(t,e){return function(i,o,n,r,a){var s=this;Ld(t,e,i,o,n,(function(t,e){s.addFeatures(t),void 0!==r&&r(t)}),a||_t)}}var Nd=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 o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}(),Bd=function(t){function e(e,i,o){var n=t.call(this,e)||this;return n.feature=i,n.features=o,n}return Nd(e,t),e}(ut),qd=function(t){function e(e){var i=this,o=e||{};(i=t.call(this,{attributions:o.attributions,projection:void 0,state:Ze,wrapX:void 0===o.wrapX||o.wrapX})||this).on,i.once,i.un,i.loader_=_t,i.format_=o.format,i.overlaps_=void 0===o.overlaps||o.overlaps,i.url_=o.url,void 0!==o.loader?i.loader_=o.loader:void 0!==i.url_&&(Re(i.format_,7),i.loader_=Gd(i.url_,i.format_)),i.strategy_=void 0!==o.strategy?o.strategy:Dd;var n,r,a=void 0===o.useSpatialIndex||o.useSpatialIndex;return i.featuresRtree_=a?new zd:null,i.loadedExtentsRtree_=new zd,i.loadingExtentsCount_=0,i.nullGeometryFeatures_={},i.idIndex_={},i.uidIndex_={},i.featureChangeKeys_={},i.featuresCollection_=null,Array.isArray(o.features)?r=o.features:o.features&&(r=(n=o.features).getArray()),a||void 0!==n||(n=new ai(r)),void 0!==r&&i.addFeaturesInternal(r),void 0!==n&&i.bindFeaturesCollection_(n),i}return Nd(e,t),e.prototype.addFeature=function(t){this.addFeatureInternal(t),this.changed()},e.prototype.addFeatureInternal=function(t){var e=Kt(t);if(this.addToIndex_(e,t)){this.setupChangeEvents_(e,t);var i=t.getGeometry();if(i){var o=i.getExtent();this.featuresRtree_&&this.featuresRtree_.insert(o,t)}else this.nullGeometryFeatures_[e]=t;this.dispatchEvent(new Bd(Od,t))}else this.featuresCollection_&&this.featuresCollection_.remove(t)},e.prototype.setupChangeEvents_=function(t,e){this.featureChangeKeys_[t]=[Gt(e,Tt,this.handleFeatureChange_,this),Gt(e,pt,this.handleFeatureChange_,this)]},e.prototype.addToIndex_=function(t,e){var i=!0,o=e.getId();return void 0!==o&&(o.toString()in this.idIndex_?i=!1:this.idIndex_[o.toString()]=e),i&&(Re(!(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=[],o=[],n=0,r=t.length;n<r;n++){var a=Kt(l=t[n]);this.addToIndex_(a,l)&&i.push(l)}n=0;for(var s=i.length;n<s;n++){var l;a=Kt(l=i[n]);this.setupChangeEvents_(a,l);var u=l.getGeometry();if(u){var p=u.getExtent();e.push(p),o.push(l)}else this.nullGeometryFeatures_[a]=l}this.featuresRtree_&&this.featuresRtree_.load(e,o);n=0;for(var d=i.length;n<d;n++)this.dispatchEvent(new Bd(Od,i[n]))},e.prototype.bindFeaturesCollection_=function(t){var e=!1;this.addEventListener(Od,(function(i){e||(e=!0,t.push(i.feature),e=!1)})),this.addEventListener(Id,(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(Bt)}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 o=new Bd(Rd);this.dispatchEvent(o),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 o=e(i);if(o)return o}}))},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(),wt(this.nullGeometryFeatures_)||gt(t,kt(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],o=t[1],n=null,r=[NaN,NaN],a=1/0,s=[-1/0,-1/0,1/0,1/0],l=e||vt;return this.featuresRtree_.forEachInExtent(s,(function(t){if(l(t)){var e=t.getGeometry(),u=a;if((a=e.closestPointXY(i,o,r,a))<u){n=t;var p=Math.sqrt(a);s[0]=i-p,s[1]=o-p,s[2]=i+p,s[3]=o+p}}})),n},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=Kt(e),o=e.getGeometry();if(o){var n=o.getExtent();i in this.nullGeometryFeatures_?(delete this.nullGeometryFeatures_[i],this.featuresRtree_&&this.featuresRtree_.insert(n,e)):this.featuresRtree_&&this.featuresRtree_.update(n,e)}else i in this.nullGeometryFeatures_||(this.featuresRtree_&&this.featuresRtree_.remove(e),this.nullGeometryFeatures_[i]=e);var r=e.getId();if(void 0!==r){var a=r.toString();this.idIndex_[a]!==e&&(this.removeFromIdIndex_(e),this.idIndex_[a]=e)}else this.removeFromIdIndex_(e),this.uidIndex_[i]=e;this.changed(),this.dispatchEvent(new Bd(jd,e))},e.prototype.hasFeature=function(t){var e=t.getId();return void 0!==e?e in this.idIndex_:Kt(t)in this.uidIndex_},e.prototype.isEmpty=function(){return this.featuresRtree_.isEmpty()&&wt(this.nullGeometryFeatures_)},e.prototype.loadFeatures=function(t,e,i){for(var o=this.loadedExtentsRtree_,n=this.strategy_(t,e,i),r=function(t,r){var s=n[t];o.forEachInExtent(s,(function(t){return to(t.extent,s)}))||(++a.loadingExtentsCount_,a.dispatchEvent(new Bd(Fd)),a.loader_.call(a,s,e,i,function(t){--this.loadingExtentsCount_,this.dispatchEvent(new Bd(Md,void 0,t))}.bind(a),function(){--this.loadingExtentsCount_,this.dispatchEvent(new Bd(Ad))}.bind(a)),o.insert(s,{extent:s.slice()}))},a=this,s=0,l=n.length;s<l;++s)r(s);this.loading=!(this.loader_.length<4)&&this.loadingExtentsCount_>0},e.prototype.refresh=function(){this.clear(!0),this.loadedExtentsRtree_.clear(),t.prototype.refresh.call(this)},e.prototype.removeLoadedExtent=function(t){var e,i=this.loadedExtentsRtree_;i.forEachInExtent(t,(function(i){if(lo(i.extent,t))return e=i,!0})),e&&i.remove(e)},e.prototype.removeFeature=function(t){var e=Kt(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=Kt(t);this.featureChangeKeys_[e].forEach(Bt),delete this.featureChangeKeys_[e];var i=t.getId();void 0!==i&&delete this.idIndex_[i.toString()],delete this.uidIndex_[e],this.dispatchEvent(new Bd(Id,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){Re(this.format_,7),this.url_=t,this.setLoader(Gd(t,this.format_))},e}(Pd),Wd=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 o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}(),Vd="Point",Ud="LineString",Xd="Polygon",Kd="Circle",Yd="drawstart",Zd="drawend",Hd="drawabort",$d=function(t){function e(e,i){var o=t.call(this,e)||this;return o.feature=i,o}return Wd(e,t),e}(ut);var Jd=function(t){function e(e){var i=this,o=e;o.stopDown||(o.stopDown=yt),(i=t.call(this,o)||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 Po:case Io:return Vd;case Oo:case Fo:return Ud;case Ro:case Mo:return Xd;case Do:return Kd;default:throw new Error("Invalid type: "+t)}}(i.type_),i.stopClick_=!!e.stopClick,i.minPoints_=e.minPoints?e.minPoints:i.mode_===Xd?3:2,i.maxPoints_=i.mode_===Kd?2:e.maxPoints?e.maxPoints:1/0,i.finishCondition_=e.finishCondition?e.finishCondition:vt;var n,r=e.geometryFunction;if(!r){var a,s=i.mode_;if(s===Kd)r=function(t,e,i){var o=e||new Qu([NaN,NaN]),n=hn(t[0]),r=Uo(n,hn(t[t.length-1]));return o.setCenterAndRadius(n,Math.sqrt(r)),o};else s===Vd?a=Ca:s===Ud?a=Cs:s===Xd&&(a=Ba),r=function(t,e,i){return e?s===Xd?t[0].length?e.setCoordinates([t[0].concat([t[0][0]])]):e.setCoordinates([]):e.setCoordinates(t):e=new a(t),e}}return i.geometryFunction_=r,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 Cd({source:new qd({useSpatialIndex:!1,wrapX:!!e.wrapX&&e.wrapX}),style:e.style?e.style:(n=ml(),function(t,e){return n[t.getGeometry().getType()]}),updateWhileInteracting:!0}),i.geometryName_=e.geometryName,i.condition_=e.condition?e.condition:fu,i.freehandCondition_,e.freehand?i.freehandCondition_=hu:i.freehandCondition_=e.freehandCondition?e.freehandCondition:gu,i.addChangeListener(tu,i.updateState_),i}return Wd(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===Ot&&e.originalEvent.preventDefault(),this.freehand_=this.mode_!==Vd&&this.freehandCondition_(e);var i=e.type===xr.POINTERMOVE,o=!0;!this.freehand_&&this.lastDragTime_&&e.type===xr.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===xr.POINTERDRAG&&null!==this.sketchFeature_?(this.addToDrawing_(e.coordinate),o=!1):this.freehand_&&e.type===xr.POINTERDOWN?o=!1:i&&this.getPointerCount()<2?(o=e.type===xr.POINTERMOVE)&&this.freehand_?(this.handlePointerMove_(e),this.shouldHandle_&&e.originalEvent.preventDefault()):("mouse"===e.originalEvent.pointerType||e.type===xr.POINTERDRAG&&void 0===this.downTimeout_)&&this.handlePointerMove_(e):e.type===xr.DBLCLICK&&(o=!1),t.prototype.handleEvent.call(this,e)&&o},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 br(xr.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_!==Vd||(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,o=e[0]-i[0],n=e[1]-i[1],r=o*o+n*n;if(this.shouldHandle_=this.freehand_?r>this.squaredClickTolerance_:r<=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,o=[this.finishCoordinate_],n=this.mode_;if(n===Vd)e=!0;else if(n===Kd)e=2===this.sketchCoords_.length;else if(n===Ud)i=this.sketchCoords_.length>this.minPoints_;else if(n===Xd){var r=this.sketchCoords_;i=r[0].length>this.minPoints_,o=[r[0][0],r[0][r[0].length-2]]}if(i)for(var a=this.getMap(),s=0,l=o.length;s<l;s++){var u=o[s],p=a.getPixelFromCoordinate(u),d=t[0]-p[0],h=t[1]-p[1],c=this.freehand_?1:this.snapTolerance_;if(e=Math.sqrt(d*d+h*h)<=c){this.finishCoordinate_=u;break}}}return e},e.prototype.createOrUpdateSketchPoint_=function(t){this.sketchPoint_?this.sketchPoint_.getGeometry().setCoordinates(t):(this.sketchPoint_=new ds(new Ca(t)),this.updateSketchFeatures_())},e.prototype.createOrUpdateCustomSketchLine_=function(t){this.sketchLine_||(this.sketchLine_=new ds);var e=t.getLinearRing(0),i=this.sketchLine_.getGeometry();i?(i.setFlatCoordinates(e.getLayout(),e.getFlatCoordinates()),i.changed()):(i=new Cs(e.getFlatCoordinates(),e.getLayout()),this.sketchLine_.setGeometry(i))},e.prototype.startDrawing_=function(t){var e=this.getMap().getView().getProjection();this.finishCoordinate_=t,this.mode_===Vd?this.sketchCoords_=t.slice():this.mode_===Xd?(this.sketchCoords_=[[t.slice(),t.slice()]],this.sketchLineCoords_=this.sketchCoords_[0]):this.sketchCoords_=[t.slice(),t.slice()],this.sketchLineCoords_&&(this.sketchLine_=new ds(new Cs(this.sketchLineCoords_)));var i=this.geometryFunction_(this.sketchCoords_,void 0,e);this.sketchFeature_=new ds,this.geometryName_&&this.sketchFeature_.setGeometryName(this.geometryName_),this.sketchFeature_.setGeometry(i),this.updateSketchFeatures_(),this.dispatchEvent(new $d(Yd,this.sketchFeature_))},e.prototype.modifyDrawing_=function(t){var e,i,o=this.getMap(),n=this.sketchFeature_.getGeometry(),r=o.getView().getProjection();(this.mode_===Vd?i=this.sketchCoords_:this.mode_===Xd?(i=(e=this.sketchCoords_[0])[e.length-1],this.atFinish_(o.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_,n,r),this.sketchPoint_)&&this.sketchPoint_.getGeometry().setCoordinates(t);if(n.getType()===Ro&&this.mode_!==Xd)this.createOrUpdateCustomSketchLine_(n);else if(this.sketchLineCoords_){this.sketchLine_.getGeometry().setCoordinates(this.sketchLineCoords_)}this.updateSketchFeatures_()},e.prototype.addToDrawing_=function(t){var e,i,o=this.sketchFeature_.getGeometry(),n=this.getMap().getView().getProjection(),r=this.mode_;r===Ud||r===Kd?(this.finishCoordinate_=t.slice(),(i=this.sketchCoords_).length>=this.maxPoints_&&(this.freehand_?i.pop():e=!0),i.push(t.slice()),this.geometryFunction_(i,o,n)):r===Xd&&((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_,o,n)),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(),o=this.mode_;if(o===Ud||o===Kd){if((t=this.sketchCoords_).splice(-2,1),t.length>=2){this.finishCoordinate_=t[t.length-2].slice();var n=this.finishCoordinate_.slice();t[t.length-1]=n,this.createOrUpdateSketchPoint_(n)}this.geometryFunction_(t,e,i),e.getType()===Ro&&this.sketchLine_&&this.createOrUpdateCustomSketchLine_(e)}else if(o===Xd){(t=this.sketchCoords_[0]).splice(-2,1);var r=this.sketchLine_.getGeometry();if(t.length>=2){n=t[t.length-2].slice();t[t.length-1]=n,this.createOrUpdateSketchPoint_(n)}r.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(),o=this.getMap().getView().getProjection();this.mode_===Ud?(e.pop(),this.geometryFunction_(e,i,o)):this.mode_===Xd&&(e[0].pop(),this.geometryFunction_(e,i,o),e=i.getCoordinates()),this.type_===Io?t.setGeometry(new Ps([e])):this.type_===Fo?t.setGeometry(new Ts([e])):this.type_===Mo&&t.setGeometry(new Rs([e])),this.dispatchEvent(new $d(Zd,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 $d(Hd,t))},e.prototype.appendCoordinates=function(t){var e,i=this.mode_,o=!this.sketchFeature_;if(o&&this.startDrawing_(t[0]),i===Ud||i===Kd)e=this.sketchCoords_;else{if(i!==Xd)return;e=this.sketchCoords_&&this.sketchCoords_.length?this.sketchCoords_[0]:[]}o&&e.shift(),e.pop();for(var n=0;n<t.length;n++)this.addToDrawing_(t[n]);var r=t[t.length-1];this.addToDrawing_(r),this.modifyDrawing_(r)},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 ds(new Ca(i)),this.updateSketchFeatures_(),this.dispatchEvent(new $d(Yd,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}(lu),Qd=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 o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}(),th=[0,0,0,0],eh=[],ih="modifystart",oh="modifyend",nh=function(t){function e(e,i,o){var n=t.call(this,e)||this;return n.features=i,n.mapBrowserEvent=o,n}return Qd(e,t),e}(ut);function rh(t,e){return t.index-e.index}function ah(t,e,i){var o=e.geometry;if(o.getType()===Do){var n=o;if(1===e.index){null;var r=Uo(n.getCenter(),hn(t)),a=Math.sqrt(r)-n.getRadius();return a*a}}var s=hn(t);return eh[0]=hn(e.segment[0]),eh[1]=hn(e.segment[1]),Ko(s,eh)}function sh(t,e,i){var o=e.geometry;if(o.getType()===Do&&1===e.index){var n=o;return dn(n.getClosestPoint(hn(t)))}var r=hn(t);return eh[0]=hn(e.segment[0]),eh[1]=hn(e.segment[1]),dn(qo(r,eh))}var lh=function(t){function e(e){var i,o,n=t.call(this,e)||this;if(n.on,n.once,n.un,n.boundHandleFeatureChange_=n.handleFeatureChange_.bind(n),n.condition_=e.condition?e.condition:yu,n.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==xr.SINGLECLICK}(t)},n.deleteCondition_=e.deleteCondition?e.deleteCondition:n.defaultDeleteCondition_,n.insertVertexCondition_=e.insertVertexCondition?e.insertVertexCondition:hu,n.vertexFeature_=null,n.vertexSegments_=null,n.lastPixel_=[0,0],n.ignoreNextSingleClick_=!1,n.featuresBeingModified_=null,n.rBush_=new zd,n.pixelTolerance_=void 0!==e.pixelTolerance?e.pixelTolerance:10,n.snappedToVertex_=!1,n.changingFeature_=!1,n.dragSegments_=[],n.overlay_=new Cd({source:new qd({useSpatialIndex:!1,wrapX:!!e.wrapX}),style:e.style?e.style:(i=ml(),function(t,e){return i[Po]}),updateWhileAnimating:!0,updateWhileInteracting:!0}),n.SEGMENT_WRITERS_={Point:n.writePointGeometry_.bind(n),LineString:n.writeLineStringGeometry_.bind(n),LinearRing:n.writeLineStringGeometry_.bind(n),Polygon:n.writePolygonGeometry_.bind(n),MultiPoint:n.writeMultiPointGeometry_.bind(n),MultiLineString:n.writeMultiLineStringGeometry_.bind(n),MultiPolygon:n.writeMultiPolygonGeometry_.bind(n),Circle:n.writeCircleGeometry_.bind(n),GeometryCollection:n.writeGeometryCollectionGeometry_.bind(n)},n.source_=null,n.hitDetection_=null,e.features?o=e.features:e.source&&(n.source_=e.source,o=new ai(n.source_.getFeatures()),n.source_.addEventListener(Od,n.handleSourceAdd_.bind(n)),n.source_.addEventListener(Id,n.handleSourceRemove_.bind(n))),!o)throw new Error("The modify interaction requires features, a source or a layer");return e.hitDetection&&(n.hitDetection_=e.hitDetection),n.features_=o,n.features_.forEach(n.addFeature_.bind(n)),n.features_.addEventListener(ei,n.handleFeatureAdd_.bind(n)),n.features_.addEventListener(ii,n.handleFeatureRemove_.bind(n)),n.lastPointerEvent_=null,n.delta_=[0,0],n.snapToPointer_=void 0===e.snapToPointer?!n.hitDetection_:e.snapToPointer,n}return Qd(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 o=this.getMap();o&&o.isRendered()&&this.getActive()&&this.handlePointerAtPixel_(this.lastPixel_,o),t.addEventListener(Tt,this.boundHandleFeatureChange_)},e.prototype.willModifyFeatures_=function(t,e){if(!this.featuresBeingModified_){this.featuresBeingModified_=new ai;for(var i=this.featuresBeingModified_.getArray(),o=0,n=e.length;o<n;++o)for(var r=e[o],a=0,s=r.length;a<s;++a){var l=r[a].feature;l&&-1===i.indexOf(l)&&this.featuresBeingModified_.push(l)}0===this.featuresBeingModified_.getLength()?this.featuresBeingModified_=null:this.dispatchEvent(new nh(ih,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(Tt,this.boundHandleFeatureChange_)},e.prototype.removeFeatureSegmentData_=function(t){var e=this.rBush_,i=[];e.forEach((function(e){t===e.feature&&i.push(e)}));for(var o=i.length-1;o>=0;--o){for(var n=i[o],r=this.dragSegments_.length-1;r>=0;--r)this.dragSegments_[r][0]===n&&this.dragSegments_.splice(r,1);e.remove(n)}},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(),o={feature:t,geometry:e,segment:[i,i]};this.rBush_.insert(e.getExtent(),o)},e.prototype.writeMultiPointGeometry_=function(t,e){for(var i=e.getCoordinates(),o=0,n=i.length;o<n;++o){var r=i[o],a={feature:t,geometry:e,depth:[o],index:o,segment:[r,r]};this.rBush_.insert(e.getExtent(),a)}},e.prototype.writeLineStringGeometry_=function(t,e){for(var i=e.getCoordinates(),o=0,n=i.length-1;o<n;++o){var r=i.slice(o,o+2),a={feature:t,geometry:e,index:o,segment:r};this.rBush_.insert(Zi(r),a)}},e.prototype.writeMultiLineStringGeometry_=function(t,e){for(var i=e.getCoordinates(),o=0,n=i.length;o<n;++o)for(var r=i[o],a=0,s=r.length-1;a<s;++a){var l=r.slice(a,a+2),u={feature:t,geometry:e,depth:[o],index:a,segment:l};this.rBush_.insert(Zi(l),u)}},e.prototype.writePolygonGeometry_=function(t,e){for(var i=e.getCoordinates(),o=0,n=i.length;o<n;++o)for(var r=i[o],a=0,s=r.length-1;a<s;++a){var l=r.slice(a,a+2),u={feature:t,geometry:e,depth:[o],index:a,segment:l};this.rBush_.insert(Zi(l),u)}},e.prototype.writeMultiPolygonGeometry_=function(t,e){for(var i=e.getCoordinates(),o=0,n=i.length;o<n;++o)for(var r=i[o],a=0,s=r.length;a<s;++a)for(var l=r[a],u=0,p=l.length-1;u<p;++u){var d=l.slice(u,u+2),h={feature:t,geometry:e,depth:[a,o],index:u,segment:d};this.rBush_.insert(Zi(d),h)}},e.prototype.writeCircleGeometry_=function(t,e){var i=e.getCenter(),o={feature:t,geometry:e,index:0,segment:[i,i]},n={feature:t,geometry:e,index:1,segment:[i,i]},r=[o,n];o.featureSegments=r,n.featureSegments=r,this.rBush_.insert(ao(i),o);var a=e;this.rBush_.insert(a.getExtent(),n)},e.prototype.writeGeometryCollectionGeometry_=function(t,e){for(var i=e.getGeometriesArray(),o=0;o<i.length;++o){var n=i[o];(0,this.SEGMENT_WRITERS_[n.getType()])(t,n)}},e.prototype.createOrUpdateVertexFeature_=function(t,e,i){var o=this.vertexFeature_;o?o.getGeometry().setCoordinates(t):(o=new ds(new Ca(t)),this.vertexFeature_=o,this.overlay_.getSource().addFeature(o));return o.set("features",e),o.set("geometries",i),o},e.prototype.handleEvent=function(e){return!e.originalEvent||(this.lastPointerEvent_=e,e.map.getView().getInteracting()||e.type!=xr.POINTERMOVE||this.handlingDownUpSequence||this.handlePointerMove_(e),this.vertexFeature_&&this.deleteCondition_(e)&&(i=!(e.type!=xr.SINGLECLICK||!this.ignoreNextSingleClick_)||this.removePoint()),e.type==xr.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=[],o=[],n=0,r=this.dragSegments_.length;n<r;++n){var a=this.dragSegments_[n],s=a[0],l=s.feature;-1===i.indexOf(l)&&i.push(l);var u=s.geometry;-1===o.indexOf(u)&&o.push(u);for(var p=s.depth,d=void 0,h=s.segment,c=a[1];e.length<u.getStride();)e.push(h[c][e.length]);switch(u.getType()){case Po:d=e,h[0]=e,h[1]=e;break;case Io:(d=u.getCoordinates())[s.index]=e,h[0]=e,h[1]=e;break;case Oo:(d=u.getCoordinates())[s.index+c]=e,h[c]=e;break;case Fo:case Ro:(d=u.getCoordinates())[p[0]][s.index+c]=e,h[c]=e;break;case Mo:(d=u.getCoordinates())[p[1]][p[0]][s.index+c]=e,h[c]=e;break;case Do:if(h[0]=e,h[1]=e,0===s.index)this.changingFeature_=!0,u.setCenter(e),this.changingFeature_=!1;else{this.changingFeature_=!0;t.map.getView().getProjection();var f=Xo(hn(u.getCenter()),hn(e));u.setRadius(f),this.changingFeature_=!1}}d&&this.setGeometryCoordinates_(u,d)}this.createOrUpdateVertexFeature_(e,i,o)},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 o=t.map.getView().getProjection(),n=[],r=i.getGeometry().getCoordinates(),a=Zi([r]),s=this.rBush_.getInExtent(a),l={};s.sort(rh);for(var u=0,p=s.length;u<p;++u){var d=s[u],h=d.segment,c=Kt(d.geometry),f=d.depth;if(f&&(c+="-"+f.join("-")),l[c]||(l[c]=new Array(2)),d.geometry.getType()!==Do||1!==d.index)if(!Wo(h[0],r)||l[c][0])if(!Wo(h[1],r)||l[c][1])Kt(h)in this.vertexSegments_&&!l[c][0]&&!l[c][1]&&this.insertVertexCondition_(t)&&n.push(d);else{if((d.geometry.getType()===Oo||d.geometry.getType()===Fo)&&l[c][0]&&0===l[c][0].index)continue;this.dragSegments_.push([d,1]),l[c][1]=d}else this.dragSegments_.push([d,0]),l[c][0]=d;else Wo(sh(e,d,o),r)&&!l[c][0]&&(this.dragSegments_.push([d,0]),l[c][0]=d)}n.length&&this.willModifyFeatures_(t,[n]);for(var g=n.length-1;g>=0;--g)this.insertVertex_(n[g],r)}return!!this.vertexFeature_},e.prototype.handleUpEvent=function(t){for(var e=this.dragSegments_.length-1;e>=0;--e){var i=this.dragSegments_[e][0],o=i.geometry;if(o.getType()===Do){var n=o.getCenter(),r=i.featureSegments[0],a=i.featureSegments[1];r.segment[0]=n,r.segment[1]=n,a.segment[0]=n,a.segment[1]=n,this.rBush_.update(ao(n),r);var s=o;this.rBush_.update(s.getExtent(),a)}else this.rBush_.update(Zi(i.segment),i)}return this.featuresBeingModified_&&(this.dispatchEvent(new nh(oh,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 o,n,r=this,a=i||e.getCoordinateFromPixel(t),s=e.getView().getProjection();if(this.hitDetection_){var l="object"==typeof this.hitDetection_?function(t){return t===r.hitDetection_}:void 0;e.forEachFeatureAtPixel(t,(function(t,e,i){if((i=i||t.getGeometry()).getType()===Po&&(s=r.features_.getArray(),l=t,s.indexOf(l)>=0)){n=i;var a=i.getFlatCoordinates().slice(0,2);o=[{feature:t,geometry:i,segment:[a,a]}]}var s,l;return!0}),{layerFilter:l})}if(!o){var u=cn(Hi(fn(ao(a,th)),e.getView().getResolution()*this.pixelTolerance_,th));o=this.rBush_.getInExtent(u)}if(o&&o.length>0){var p=o.sort((function(t,e){return ah(a,t,s)-ah(a,e,s)}))[0],d=p.segment,h=sh(a,p,s),c=e.getPixelFromCoordinate(h),f=Xo(t,c);if(n||f<=this.pixelTolerance_){var g={};if(g[Kt(d)]=!0,this.snapToPointer_||(this.delta_[0]=h[0]-a[0],this.delta_[1]=h[1]-a[1]),p.geometry.getType()===Do&&1===p.index)this.snappedToVertex_=!0,this.createOrUpdateVertexFeature_(h,[p.feature],[p.geometry]);else{var m=e.getPixelFromCoordinate(d[0]),v=e.getPixelFromCoordinate(d[1]),y=Uo(c,m),_=Uo(c,v);f=Math.sqrt(Math.min(y,_)),this.snappedToVertex_=f<=this.pixelTolerance_,this.snappedToVertex_&&(h=y>_?d[1]:d[0]),this.createOrUpdateVertexFeature_(h,[p.feature],[p.geometry]);var b={};b[Kt(p.geometry)]=!0;for(var x=1,k=o.length;x<k;++x){var w=o[x].segment;if(!(Wo(d[0],w[0])&&Wo(d[1],w[1])||Wo(d[0],w[1])&&Wo(d[1],w[0])))break;var S=Kt(o[x].geometry);S in b||(b[S]=!0,g[Kt(w)]=!0)}}return void(this.vertexSegments_=g)}}this.vertexFeature_&&(this.overlay_.getSource().removeFeature(this.vertexFeature_),this.vertexFeature_=null)},e.prototype.insertVertex_=function(t,e){for(var i,o=t.segment,n=t.feature,r=t.geometry,a=t.depth,s=t.index;e.length<r.getStride();)e.push(0);switch(r.getType()){case Fo:case Ro:(i=r.getCoordinates())[a[0]].splice(s+1,0,e);break;case Mo:(i=r.getCoordinates())[a[1]][a[0]].splice(s+1,0,e);break;case Oo:(i=r.getCoordinates()).splice(s+1,0,e);break;default:return}this.setGeometryCoordinates_(r,i);var l=this.rBush_;l.remove(t),this.updateSegmentIndices_(r,s,a,1);var u={segment:[o[0],e],feature:n,geometry:r,depth:a,index:s};l.insert(Zi(u.segment),u),this.dragSegments_.push([u,1]);var p={segment:[e,o[1]],feature:n,geometry:r,depth:a,index:s+1};l.insert(Zi(p.segment),p),this.dragSegments_.push([p,0]),this.ignoreNextSingleClick_=!0},e.prototype.removePoint=function(){if(this.lastPointerEvent_&&this.lastPointerEvent_.type!=xr.POINTERDRAG){var t=this.lastPointerEvent_;this.willModifyFeatures_(t,this.dragSegments_);var e=this.removeVertex_();return this.dispatchEvent(new nh(oh,this.featuresBeingModified_,t)),this.featuresBeingModified_=null,e}return!1},e.prototype.removeVertex_=function(){var t,e,i,o,n,r,a,s,l,u,p,d=this.dragSegments_,h={},c=!1;for(n=d.length-1;n>=0;--n)p=Kt((u=(i=d[n])[0]).feature),u.depth&&(p+="-"+u.depth.join("-")),p in h||(h[p]={}),0===i[1]?(h[p].right=u,h[p].index=u.index):1==i[1]&&(h[p].left=u,h[p].index=u.index+1);for(p in h){switch(l=h[p].right,a=h[p].left,(s=(r=h[p].index)-1)<0&&(s=0),t=e=(o=(u=void 0!==a?a:l).geometry).getCoordinates(),c=!1,o.getType()){case Fo:e[u.depth[0]].length>2&&(e[u.depth[0]].splice(r,1),c=!0);break;case Oo:e.length>2&&(e.splice(r,1),c=!0);break;case Mo:t=t[u.depth[1]];case Ro:(t=t[u.depth[0]]).length>4&&(r==t.length-1&&(r=0),t.splice(r,1),c=!0,0===r&&(t.pop(),t.push(t[0]),s=t.length-1))}if(c){this.setGeometryCoordinates_(o,e);var f=[];if(void 0!==a&&(this.rBush_.remove(a),f.push(a.segment[0])),void 0!==l&&(this.rBush_.remove(l),f.push(l.segment[1])),void 0!==a&&void 0!==l){var g={depth:u.depth,feature:u.feature,geometry:u.geometry,index:s,segment:f};this.rBush_.insert(Zi(g.segment),g)}this.updateSegmentIndices_(o,r,u.depth,-1),this.vertexFeature_&&(this.overlay_.getSource().removeFeature(this.vertexFeature_),this.vertexFeature_=null),d.length=0}}return c},e.prototype.setGeometryCoordinates_=function(t,e){this.changingFeature_=!0,t.setCoordinates(e),this.changingFeature_=!1},e.prototype.updateSegmentIndices_=function(t,e,i,o){this.rBush_.forEachInExtent(t.getExtent(),(function(n){n.geometry===t&&(void 0===i||void 0===n.depth||mt(n.depth,i))&&n.index>e&&(n.index+=o)}))},e}(lu),uh=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 o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}();function ph(t){return t.feature?t.feature:t.element?t.element:void 0}var dh=[],hh=function(t){function e(e){var i=this,o=e||{},n=o;return n.handleDownEvent||(n.handleDownEvent=vt),n.stopDown||(n.stopDown=yt),(i=t.call(this,n)||this).source_=o.source?o.source:null,i.vertex_=void 0===o.vertex||o.vertex,i.edge_=void 0===o.edge||o.edge,i.features_=o.features?o.features:null,i.featuresListenerKeys_=[],i.featureChangeListenerKeys_={},i.indexedFeaturesExtents_={},i.pendingFeatures_={},i.pixelTolerance_=void 0!==o.pixelTolerance?o.pixelTolerance:10,i.rBush_=new zd,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 uh(e,t),e.prototype.addFeature=function(t,e){var i=void 0===e||e,o=Kt(t),n=t.getGeometry();if(n){var r=this.SEGMENT_WRITERS_[n.getType()];r&&(this.indexedFeaturesExtents_[o]=n.getExtent([1/0,1/0,-1/0,-1/0]),r(t,n))}i&&(this.featureChangeListenerKeys_[o]=Gt(t,Tt,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=ph(t);this.addFeature(e)},e.prototype.handleFeatureRemove_=function(t){var e=ph(t);this.removeFeature(e)},e.prototype.handleFeatureChange_=function(t){var e=t.target;if(this.handlingDownUpSequence){var i=Kt(e);i in this.pendingFeatures_||(this.pendingFeatures_[i]=e)}else this.updateFeature_(e)},e.prototype.handleUpEvent=function(t){var e=kt(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,o=Kt(t),n=this.indexedFeaturesExtents_[o];if(n){var r=this.rBush_,a=[];r.forEachInExtent(n,(function(e){t===e.feature&&a.push(e)}));for(var s=a.length-1;s>=0;--s)r.remove(a[s])}i&&(Bt(this.featureChangeListenerKeys_[o]),delete this.featureChangeListenerKeys_[o])},e.prototype.setMap=function(e){var i=this.getMap(),o=this.featuresListenerKeys_,n=this.getFeatures_();i&&(o.forEach(Bt),o.length=0,n.forEach(this.forEachFeatureRemove_.bind(this))),t.prototype.setMap.call(this,e),e&&(this.features_?o.push(Gt(this.features_,ei,this.handleFeatureAdd_,this),Gt(this.features_,ii,this.handleFeatureRemove_,this)):this.source_&&o.push(Gt(this.source_,Od,this.handleFeatureAdd_,this),Gt(this.source_,Id,this.handleFeatureRemove_,this)),n.forEach(this.forEachFeatureAdd_.bind(this)))},e.prototype.snapTo=function(t,e,i){var o=Zi([i.getCoordinateFromPixel([t[0]-this.pixelTolerance_,t[1]+this.pixelTolerance_]),i.getCoordinateFromPixel([t[0]+this.pixelTolerance_,t[1]-this.pixelTolerance_])]),n=this.rBush_.getInExtent(o);this.vertex_&&!this.edge_&&(n=n.filter((function(t){return t.feature.getGeometry().getType()!==Do})));var r=!1,a=null,s=null;if(0===n.length)return{snapped:r,vertex:a,vertexPixel:s};i.getView().getProjection();for(var l,u=hn(e),p=1/0,d=0;d<n.length;++d){var h=n[d];dh[0]=hn(h.segment[0]),dh[1]=hn(h.segment[1]);var c=Ko(u,dh);c<p&&(l=h,p=c)}var f=l.segment;if(this.vertex_&&!this.edge_){var g=i.getPixelFromCoordinate(f[0]),m=i.getPixelFromCoordinate(f[1]),v=Uo(t,g),y=Uo(t,m);Math.sqrt(Math.min(v,y))<=this.pixelTolerance_&&(r=!0,a=v>y?f[1]:f[0],s=i.getPixelFromCoordinate(a))}else if(this.edge_){var _=l.feature.getGeometry().getType()===Do;if(_){var b=l.feature.getGeometry();null,a=dn(function(t,e){var i=e.getRadius(),o=e.getCenter(),n=o[0],r=o[1],a=t[0]-n,s=t[1]-r;0===a&&0===s&&(a=1);var l=Math.sqrt(a*a+s*s);return[n+i*a/l,r+i*s/l]}(u,b))}else dh[0]=hn(f[0]),dh[1]=hn(f[1]),a=dn(qo(u,dh));if(Xo(t,s=i.getPixelFromCoordinate(a))<=this.pixelTolerance_&&(r=!0,this.vertex_&&!_)){g=i.getPixelFromCoordinate(f[0]),m=i.getPixelFromCoordinate(f[1]),v=Uo(s,g),y=Uo(s,m);Math.sqrt(Math.min(v,y))<=this.pixelTolerance_&&(a=v>y?f[1]:f[0],s=i.getPixelFromCoordinate(a))}}return r&&(s=[Math.round(s[0]),Math.round(s[1])]),{snapped:r,vertex:a,vertexPixel:s}},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=Wa(e).getCoordinates()[0],o=0,n=i.length-1;o<n;++o){var r=i.slice(o,o+2),a={feature:t,segment:r};this.rBush_.insert(Zi(r),a)}},e.prototype.writeGeometryCollectionGeometry_=function(t,e){for(var i=e.getGeometriesArray(),o=0;o<i.length;++o){var n=this.SEGMENT_WRITERS_[i[o].getType()];n&&n(t,i[o])}},e.prototype.writeLineStringGeometry_=function(t,e){for(var i=e.getCoordinates(),o=0,n=i.length-1;o<n;++o){var r=i.slice(o,o+2),a={feature:t,segment:r};this.rBush_.insert(Zi(r),a)}},e.prototype.writeMultiLineStringGeometry_=function(t,e){for(var i=e.getCoordinates(),o=0,n=i.length;o<n;++o)for(var r=i[o],a=0,s=r.length-1;a<s;++a){var l=r.slice(a,a+2),u={feature:t,segment:l};this.rBush_.insert(Zi(l),u)}},e.prototype.writeMultiPointGeometry_=function(t,e){for(var i=e.getCoordinates(),o=0,n=i.length;o<n;++o){var r=i[o],a={feature:t,segment:[r,r]};this.rBush_.insert(e.getExtent(),a)}},e.prototype.writeMultiPolygonGeometry_=function(t,e){for(var i=e.getCoordinates(),o=0,n=i.length;o<n;++o)for(var r=i[o],a=0,s=r.length;a<s;++a)for(var l=r[a],u=0,p=l.length-1;u<p;++u){var d=l.slice(u,u+2),h={feature:t,segment:d};this.rBush_.insert(Zi(d),h)}},e.prototype.writePointGeometry_=function(t,e){var i=e.getCoordinates(),o={feature:t,segment:[i,i]};this.rBush_.insert(e.getExtent(),o)},e.prototype.writePolygonGeometry_=function(t,e){for(var i=e.getCoordinates(),o=0,n=i.length;o<n;++o)for(var r=i[o],a=0,s=r.length-1;a<s;++a){var l=r.slice(a,a+2),u={feature:t,segment:l};this.rBush_.insert(Zi(l),u)}},e}(lu);function ch(t){var e=t||{},i=new ai,o=new qu(-.005,.05,100);return(void 0===e.altShiftDragRotate||e.altShiftDragRotate)&&i.push(new ku),(void 0===e.doubleClickZoom||e.doubleClickZoom)&&i.push(new ru({delta:e.zoomDelta,duration:e.zoomDuration})),(void 0===e.dragPan||e.dragPan)&&i.push(new bu({onFocusOnly:e.onFocusOnly,kinetic:o})),(void 0===e.pinchRotate||e.pinchRotate)&&i.push(new Yu),(void 0===e.pinchZoom||e.pinchZoom)&&i.push(new Hu({duration:e.zoomDuration})),(void 0===e.keyboard||e.keyboard)&&(i.push(new Gu),i.push(new Bu({delta:e.zoomDelta,duration:e.zoomDuration}))),(void 0===e.mouseWheelZoom||e.mouseWheelZoom)&&i.push(new Xu({onFocusOnly:e.onFocusOnly,duration:e.zoomDuration})),(void 0===e.shiftDragZoom||e.shiftDragZoom)&&i.push(new Iu({duration:e.zoomDuration})),i}var fh=function(){function t(t,e,i,o){this.minX=t,this.maxX=e,this.minY=i,this.maxY=o}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 gh(t,e,i,o,n){return void 0!==n?(n.minX=t,n.maxX=e,n.minY=i,n.maxY=o,n):new fh(t,e,i,o)}var mh=fh,vh=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 o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}(),yh=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 mh(0,0,0,0),i}return vh(e,t),e.prototype.isDrawableTile=function(t){var e=this.getLayer(),i=t.getState(),o=e.getUseInterimTilesOnError();return i==Er||i==Or||i==Pr&&!o},e.prototype.getTile=function(t,e,i,o){var n=o.pixelRatio,r=o.viewState.projection,a=this.getLayer(),s=a.getSource().getTile(t,e,i,n,r);return s.getState()==Pr&&(a.getUseInterimTilesOnError()?a.getPreload()>0&&(this.newTiles_=!0):s.setState(Er)),this.isDrawableTile(s)||(s=s.getInterimTile()),s},e.prototype.loadedTileCallback=function(e,i,o){return!!this.isDrawableTile(o)&&t.prototype.loadedTileCallback.call(this,e,i,o)},e.prototype.prepareFrame=function(t){return!!this.getLayer().getSource()},e.prototype.renderFrame=function(t,e){var i=t.layerStatesArray[t.layerIndex],o=t.viewState,n=o.projection,r=o.resolution,a=o.center,s=o.rotation,l=t.pixelRatio,u=this.getLayer(),p=u.getSource(),d=p.getRevision(),h=p.getTileGridForProjection(n),c=h.getZForResolution(r,p.zDirection),f=h.getResolution(c),g=t.extent,m=i.extent&&fn(i.extent);m&&(g=ko(g,fn(i.extent)));var v=p.getTilePixelRatio(l),y=Math.round(t.size[0]*v),_=Math.round(t.size[1]*v);if(s){var b=Math.round(Math.sqrt(y*y+_*_));y=b,_=b}var x=f*y/2/v,k=f*_/2/v,w=[a[0]-x,a[1]-k,a[0]+x,a[1]+k],S=h.getTileRangeForExtentAndZ(g,c),C={};C[c]={};var z=this.createLoadedTileFinder(p,n,C),T=this.tmpExtent,E=this.tmpTileRange_;this.newTiles_=!1;for(var P=S.minX;P<=S.maxX;++P)for(var O=S.minY;O<=S.maxY;++O){var j=this.getTile(c,P,O,t);if(this.isDrawableTile(j)){var R=Kt(this);if(j.getState()==Er){C[c][j.tileCoord.toString()]=j;var I=j.inTransition(R);this.newTiles_||!I&&-1!==this.renderedTiles.indexOf(j)||(this.newTiles_=!0)}if(1===j.getAlpha(R,t.time))continue}var F=h.getTileCoordChildTileRange(j.tileCoord,E,T),M=!1;F&&(M=z(c+1,F)),M||h.forEachTileCoordParentTileRange(j.tileCoord,z,E,T)}var A=f/r;kn(this.pixelTransform,t.size[0]/2,t.size[1]/2,1/v,1/v,s,-y/2,-_/2);var D=Sn(this.pixelTransform);this.useContainer(e,D,i.opacity);var L=this.context,G=L.canvas;wn(this.inversePixelTransform,this.pixelTransform),kn(this.tempTransform,y/2,_/2,A,A,0,-y/2,-_/2),G.width!=y||G.height!=_?(G.width=y,G.height=_):this.containerReused||L.clearRect(0,0,y,_),m&&this.clipUnrotated(L,t,m),bt(L,p.getContextOptions()),this.preRender(L,t),this.renderedTiles.length=0;var N,B,q,W=Object.keys(C).map(Number);W.sort(ht),1!==i.opacity||this.containerReused&&!p.getOpaque(t.viewState.projection)?(N=[],B=[]):W=W.reverse();for(var V=W.length-1;V>=0;--V){var U=W[V],X=p.getTilePixelSize(U,l,n),K=h.getResolution(U)/f,Y=X[0]*K*A,Z=X[1]*K*A,H=h.getTileCoordForCoordAndZ(wo(w),U),$=h.getTileCoordExtent(H),J=bn(this.tempTransform,[v*($[0]-w[0])/f,v*(w[3]-$[3])/f]),Q=v*p.getGutterForProjection(n),tt=C[U];for(var et in tt){var it=(j=tt[et]).tileCoord,ot=H[1]-it[1],nt=Math.round(J[0]-(ot-1)*Y),rt=H[2]-it[2],at=Math.round(J[1]-(rt-1)*Z),st=nt-(P=Math.round(J[0]-ot*Y)),lt=at-(O=Math.round(J[1]-rt*Z)),ut=c===U;if(!(I=ut&&1!==j.getAlpha(Kt(this),t.time)))if(N){L.save(),q=[P,O,P+st,O,P+st,O+lt,P,O+lt];for(var pt=0,dt=N.length;pt<dt;++pt)if(c!==U&&U<B[pt]){var ct=N[pt];L.beginPath(),L.moveTo(q[0],q[1]),L.lineTo(q[2],q[3]),L.lineTo(q[4],q[5]),L.lineTo(q[6],q[7]),L.moveTo(ct[6],ct[7]),L.lineTo(ct[4],ct[5]),L.lineTo(ct[2],ct[3]),L.lineTo(ct[0],ct[1]),L.clip()}N.push(q),B.push(U)}else L.clearRect(P,O,st,lt);this.drawTileImage(j,t,P,O,st,lt,Q,ut),N&&!I?(L.restore(),this.renderedTiles.unshift(j)):this.renderedTiles.push(j),this.updateUsedTiles(t.usedTiles,p,j)}}this.renderedRevision=d,this.renderedResolution=f,this.extentChanged=!this.renderedExtent_||!lo(this.renderedExtent_,w),this.renderedExtent_=w,this.renderedPixelRatio=l,this.renderedProjection=n,this.manageTilePyramid(t,p,h,l,n,g,c,u.getPreload()),this.scheduleExpireCache(t,p),this.postRender(L,t),i.extent&&L.restore(),D!==G.style.transform&&(G.style.transform=D);var ft=be(i.opacity),gt=this.container;return ft!==gt.style.opacity&&(gt.style.opacity=ft),this.container},e.prototype.drawTileImage=function(t,e,i,o,n,r,a,s){var l=this.getTileImage(t);if(l){var u=Kt(this),p=s?t.getAlpha(u,e.time):1,d=p!==this.context.globalAlpha;d&&(this.context.save(),this.context.globalAlpha=p),this.context.drawImage(l,a,a,l.width-2*a,l.height-2*a,i,o,n,r),d&&this.context.restore(),1!==p?e.animate=!0:s&&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 o=Kt(t);o in i.usedTiles&&t.expireCache(i.viewState.projection,i.usedTiles[o])}.bind(null,e);t.postRenderFunctions.push(i)}},e.prototype.updateUsedTiles=function(t,e,i){var o=Kt(e);o in t||(t[o]={}),t[o][i.getKey()]=!0},e.prototype.manageTilePyramid=function(t,e,i,o,n,r,a,s,l){var u=Kt(e);u in t.wantedTiles||(t.wantedTiles[u]={});var p,d,h,c,f,g,m=t.wantedTiles[u],v=t.tileQueue,y=0;for(g=i.getMinZoom();g<=a;++g)for(d=i.getTileRangeForExtentAndZ(r,g,d),h=i.getResolution(g),c=d.minX;c<=d.maxX;++c)for(f=d.minY;f<=d.maxY;++f)a-g<=s?(++y,(p=e.getTile(g,c,f,o,n)).getState()==zr&&(m[p.getKey()]=!0,v.isKeyQueued(p.getKey())||v.enqueue([p,u,i.getTileCoordCenter(p.tileCoord),h])),void 0!==l&&l(p)):e.useTile(g,c,f,n);e.updateCacheSize(y,n)},e}(Vp);yh.prototype.getLayer;var _h=yh,bh="image",xh="hybrid",kh="vector",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 o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}(),Sh={image:[Zp,Up,Yp,Kp,Hp],hybrid:[Zp,Yp],vector:[]},Ch={hybrid:[Kp,Hp,Xp],vector:[Zp,Up,Yp,Kp,Hp,Xp]},zh=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 wh(e,t),e.prototype.prepareTile=function(t,e,i){var o,n=t.getState();return n!==Er&&n!==Pr||(this.updateExecutorGroup_(t,e,i),this.tileImageNeedsRender_(t)&&(o=!0)),o},e.prototype.getTile=function(e,i,o,n){var r=n.pixelRatio,a=n.viewState,s=a.resolution,l=a.projection,u=this.getLayer(),p=u.getSource().getTile(e,i,o,r,l),d=n.viewHints,h=!(d[Ir]||d[Fr]);return!h&&p.wantedResolution||(p.wantedResolution=s),this.prepareTile(p,r,l)&&(h||Date.now()-n.time<8)&&u.getRenderMode()!==kh&&this.renderTileImage_(p,n),t.prototype.getTile.call(this,e,i,o,n)},e.prototype.isDrawableTile=function(e){var i=this.getLayer();return t.prototype.isDrawableTile.call(this,e)&&(i.getRenderMode()===kh?Kt(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 o=this.getLayer(),n=o.getRevision(),r=o.getRenderOrder()||null,a=t.wantedResolution,s=t.getReplayState(o);if(s.dirty||s.renderedResolution!==a||s.renderedRevision!=n||s.renderedRenderOrder!=r){var l=o.getSource(),u=o.getDeclutter(),p=l.getTileGrid(),d=l.getTileGridForProjection(i).getTileCoordExtent(t.wrappedTileCoord),h=l.getSourceTiles(e,i,t),c=Kt(o);delete t.hitDetectionImageData[c],t.executorGroups[c]=[],u&&(t.declutterExecutorGroups[c]=[]);for(var f=function(i,n){var f=h[i];if(f.getState()!=Er)return"continue";var m=f.tileCoord,v=p.getTileCoordExtent(m),y=ko(d,v),_=Hi(y,o.getRenderBuffer()*a,g.tmpExtent),b=lo(v,y)?null:_;s.dirty=!1;var x=new Np(0,_,a,e),k=u?new Np(0,y,a,e):void 0,w=yd(a,e),S=function(t){var e,i=t.getStyleFunction()||o.getStyleFunction();if(i&&(e=i(t,a)),e){var n=this.renderFeature(t,w,e,x,k);this.dirty_=this.dirty_||n,s.dirty=s.dirty||n}},C=f.getFeatures();r&&r!==s.renderedRenderOrder&&C.sort(r);for(var z=0,T=C.length;z<T;++z){var E=C[z];b&&!zo(b,E.getGeometry().getExtent())||S.call(g,E)}var P=x.finish(),O=o.getRenderMode()!==kh&&u&&1===h.length?null:y,j=new pd(O,a,e,l.getOverlaps(),P,o.getRenderBuffer());if(t.executorGroups[c].push(j),k){var R=new pd(null,a,e,l.getOverlaps(),k.finish(),o.getRenderBuffer());t.declutterExecutorGroups[c].push(R)}},g=this,m=0,v=h.length;m<v;++m)f(m);s.renderedRevision=n,s.renderedRenderOrder=r,s.renderedResolution=a}},e.prototype.forEachFeatureAtCoordinate=function(t,e,i,o,n){var r=e.viewState.resolution,a=e.viewState.rotation;i=null==i?0:i;var s=this.getLayer(),l=s.getSource().getTileGridForProjection(e.viewState.projection),u=Zi([t]);Hi(u,r*i,u);for(var p,d={},h=function(t,e,i){var r=t.getId();void 0===r&&(r=Kt(t));var a=d[r];if(a){if(!0!==a&&i<a.distanceSq){if(0===i)return d[r]=!0,n.splice(n.lastIndexOf(a),1),o(t,s,e);a.geometry=e,a.distanceSq=i}}else{if(0===i)return d[r]=!0,o(t,s,e);n.push(d[r]={feature:t,layer:s,geometry:e,distanceSq:i,callback:o})}},c=this.renderedTiles,f=function(o,n){var d=c[o];if(!zo(l.getTileCoordExtent(d.wrappedTileCoord),u))return"continue";var f=Kt(s),g=[d.executorGroups[f]],m=d.declutterExecutorGroups[f];m&&g.push(m),g.some((function(o){for(var n=o===m?e.declutterTree.all().map((function(t){return t.value})):null,s=0,l=o.length;s<l;++s){var u=o[s];if(p=u.forEachFeatureAtCoordinate(t,r,a,i,h,n))return!0}}))},g=0,m=c.length;!p&&g<m;++g)f(g);return p},e.prototype.getFeatures=function(t){return new Promise(function(e,i){for(var o,n=this.getLayer(),r=Kt(n),a=n.getSource(),s=this.renderedProjection,l=s.getExtent(),u=this.renderedResolution,p=a.getTileGridForProjection(s),d=bn(this.renderedPixelToCoordinateTransform_,t.slice()),h=p.getTileCoordForCoordAndResolution(d,u),c=0,f=this.renderedTiles.length;c<f;++c)if(h.toString()===this.renderedTiles[c].tileCoord.toString()){if((o=this.renderedTiles[c]).getState()===Er){var g=p.getTileCoordExtent(o.tileCoord);a.getWrapX()&&s.canWrapX()&&!to(l,g)&&Yo(d,s);break}o=void 0}if(!o||o.loadingSourceTiles>0)e([]);else{var m=wo(p.getTileCoordExtent(o.wrappedTileCoord)),v=[(d[0]-m[0])/u,(m[1]-d[1])/u],y=o.getSourceTiles().reduce((function(t,e){return t.concat(e.getFeatures())}),[]),_=o.hitDetectionImageData[r];if(!_&&!this.animatingOrInteracting_){var b=Ha(p.getTileSize(p.getZForResolution(u))),x=this.renderedRotation_;_=fd(b,[this.getRenderTransform(p.getTileCoordCenter(o.wrappedTileCoord),u,0,cd,b[0]*cd,b[1]*cd,0)],y,n.getStyleFunction(),p.getTileCoordExtent(o.wrappedTileCoord),o.getReplayState(n).renderedResolution,x),o.hitDetectionImageData[r]=_}e(gd(v,y,_))}}.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 o=t.viewHints,n=!(o[Ir]||o[Fr]),r=this.renderedTiles,a=0,s=r.length;a<s;++a){var l=r[a],u=l.declutterExecutorGroups[Kt(this.getLayer())];if(u)for(var p=u.length-1;p>=0;--p)u[p].execute(this.context,1,this.getTileRenderTransform(l,t),t.viewState.rotation,n,void 0,t.declutterTree)}e.globalAlpha=i},e.prototype.getTileRenderTransform=function(t,e){var i=e.pixelRatio,o=e.viewState,n=o.center,r=o.resolution,a=o.rotation,s=e.size,l=Math.round(s[0]*i),u=Math.round(s[1]*i),p=this.getLayer().getSource().getTileGridForProjection(e.viewState.projection),d=t.tileCoord,h=p.getTileCoordExtent(t.wrappedTileCoord),c=p.getTileCoordExtent(d,this.tmpExtent)[0]-h[0];return yn(xn(this.inversePixelTransform.slice(),1/i,1/i),this.getRenderTransform(n,r,a,i,l,u,c))},e.prototype.renderFrame=function(e,i){var o=e.viewHints,n=!(o[Ir]||o[Fr]);t.prototype.renderFrame.call(this,e,i),this.renderedPixelToCoordinateTransform_=e.pixelToCoordinateTransform.slice(),this.renderedRotation_=e.viewState.rotation;var r=this.getLayer(),a=r.getRenderMode(),s=this.context,l=s.globalAlpha;s.globalAlpha=r.getOpacity();for(var u=Ch[a],p=e.viewState.rotation,d=this.renderedTiles,h=[],c=[],f=d.length-1;f>=0;--f)for(var g=d[f],m=this.getTileRenderTransform(g,e),v=g.executorGroups[Kt(r)],y=!1,_=0,b=v.length;_<b;++_){var x=v[_];if(x.hasExecutors(u)){var k=g.tileCoord[0],w=void 0;if(!y&&(w=x.getClipCoords(m))){s.save();for(var S=0,C=h.length;S<C;++S){var z=h[S];k<c[S]&&(s.beginPath(),s.moveTo(w[0],w[1]),s.lineTo(w[2],w[3]),s.lineTo(w[4],w[5]),s.lineTo(w[6],w[7]),s.moveTo(z[6],z[7]),s.lineTo(z[4],z[5]),s.lineTo(z[2],z[3]),s.lineTo(z[0],z[1]),s.clip())}}x.execute(s,1,m,p,n,u),!y&&w&&(s.restore(),h.push(w),c.push(k),y=!0)}}return s.globalAlpha=l,this.container},e.prototype.renderFeature=function(t,e,i,o,n){if(!i)return!1;var r=!1;if(Array.isArray(i))for(var a=0,s=i.length;a<s;++a)r=bd(o,t,i[a],e,this.boundHandleStyleImageChange_,void 0,n)||r;else r=bd(o,t,i,e,this.boundHandleStyleImageChange_,void 0,n);return r},e.prototype.tileImageNeedsRender_=function(t){var e=this.getLayer();if(e.getRenderMode()===kh)return!1;var i=t.getReplayState(e),o=e.getRevision(),n=t.wantedResolution;return i.renderedTileResolution!==n||i.renderedTileRevision!==o},e.prototype.renderTileImage_=function(t,e){var i=this.getLayer(),o=t.getReplayState(i),n=i.getRevision(),r=t.executorGroups[Kt(i)];o.renderedTileRevision=n;var a=t.wrappedTileCoord,s=a[0],l=i.getSource(),u=e.pixelRatio,p=e.viewState.projection,d=l.getTileGridForProjection(p),h=d.getResolution(t.tileCoord[0]),c=e.pixelRatio/t.wantedResolution*h,f=d.getResolution(s),g=t.getContext(i);u=Math.round(Math.max(u,c/u));var m=l.getTilePixelSize(s,u,p);g.canvas.width=m[0],g.canvas.height=m[1];var v=u/c;if(1!==v){var y=vn(this.tmpTransform_);xn(y,v,v),g.setTransform.apply(g,y)}var _=d.getTileCoordExtent(a,this.tmpExtent),b=c/f,x=vn(this.tmpTransform_);xn(x,b,-b),function(t,e,i){yn(t,_n(mn,1,0,0,1,e,i))}(x,-_[0],-_[3]);for(var k=0,w=r.length;k<w;++k){r[k].execute(g,v,x,0,!0,Sh[i.getRenderMode()])}o.renderedTileResolution=t.wantedResolution},e}(_h),Th="preload",Eh="useInterimTilesOnError",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 o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}(),Oh=function(t){function e(e){var i=this,o=e||{},n=bt({},o);delete n.preload,delete n.useInterimTilesOnError,(i=t.call(this,n)||this).on,i.once,i.un,o.renderMode===bh&&(console.warn('renderMode: "image" is deprecated. Option ignored.'),o.renderMode=void 0);var r=o.renderMode||xh;return Re(r==xh||r==kh,28),i.renderMode_=r,i.setPreload(o.preload?o.preload:0),i.setUseInterimTilesOnError(void 0===o.useInterimTilesOnError||o.useInterimTilesOnError),i}return Ph(e,t),e.prototype.createRenderer=function(){return new zh(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(Th)},e.prototype.getUseInterimTilesOnError=function(){return this.get(Eh)},e.prototype.setPreload=function(t){this.set(Th,t)},e.prototype.setUseInterimTilesOnError=function(t){this.set(Eh,t)},e}(bp),jh=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 o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}(),Rh=function(t){function e(e,i,o){var n=t.call(this)||this,r=o||{};return n.tileCoord=e,n.state=i,n.interimTile=null,n.key="",n.transition_=void 0===r.transition?250:r.transition,n.transitionStarts_={},n}return jh(e,t),e.prototype.changed=function(){this.dispatchEvent(Tt)},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()==Er)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()==Er){t.interimTile=null;break}t.getState()==Tr?e=t:t.getState()==zr?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!==Pr&&this.state>t)throw new Error("Tile load sequence violation");this.state=t,this.changed()},e.prototype.load=function(){Ut()},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 o=e-i+1e3/60;return o>=this.transition_?1:si(o/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}(zt),Ih=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 o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}(),Fh=function(t){function e(e,i,o,n,r,a){var s=t.call(this,e,i,a)||this;return s.extent=null,s.format_=n,s.features_=null,s.loader_,s.projection=null,s.resolution,s.tileLoadFunction_=r,s.url_=o,s.key=o,s}return Ih(e,t),e.prototype.getFormat=function(){return this.format_},e.prototype.getFeatures=function(){return this.features_},e.prototype.load=function(){this.state==zr&&(this.setState(Tr),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(Pr)},e.prototype.setFeatures=function(t){this.features_=t,this.setState(Er)},e.prototype.setLoader=function(t){this.loader_=t},e}(Rh),Mh=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 Re(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 Re(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){Re(!(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 Ah(t,e,i,o){return void 0!==o?(o[0]=t,o[1]=e,o[2]=i,o):[t,e,i]}function Dh(t,e,i){return t+"/"+e+"/"+i}function Lh(t){return Dh(t[0],t[1],t[2])}function Gh(t){return t.split("/").map(Number)}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 o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}(),Bh=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return Nh(e,t),e.prototype.expireCache=function(t){for(;this.canExpireCache();){if(this.peekLast().getKey()in t)break;this.pop().release()}},e.prototype.pruneExceptNewestZ=function(){if(0!==this.getCount()){var t=Gh(this.peekFirstKey())[0];this.forEach(function(e){e.tileCoord[0]!==t&&(this.remove(Lh(e.tileCoord)),e.release())}.bind(this))}},e}(Mh),qh="tileloadstart",Wh="tileloadend",Vh="tileloaderror",Uh=[0,0,0],Xh=function(){function t(t){var e,i,o,n;if(this.minZoom=void 0!==t.minZoom?t.minZoom:0,this.resolutions_=t.resolutions,Re((e=this.resolutions_,i=!0,o=function(t,e){return e-t}||ht,e.every((function(t,n){if(0===n)return!0;var r=o(e[n-1],t);return!(r>0||i&&0===r)}))),17),!t.origins)for(var r=0,a=this.resolutions_.length-1;r<a;++r)if(n){if(this.resolutions_[r]/this.resolutions_[r+1]!==n){n=void 0;break}}else n=this.resolutions_[r]/this.resolutions_[r+1];this.zoomFactor_=n,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,Re(this.origins_.length==this.resolutions_.length,20));var s=t.extent;void 0===s||this.origin_||this.origins_||(this.origin_=wo(s)),Re(!this.origin_&&this.origins_||this.origin_&&!this.origins_,18),this.tileSizes_=null,void 0!==t.tileSizes&&(this.tileSizes_=t.tileSizes,Re(this.tileSizes_.length==this.resolutions_.length,19)),this.tileSize_=void 0!==t.tileSize?t.tileSize:this.tileSizes_?null:Lr,Re(!this.tileSize_&&this.tileSizes_||this.tileSize_&&!this.tileSizes_,22),this.extent_=void 0!==s?s: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 mh(Math.min(0,t[0]),Math.max(t[0]-1,-1),Math.min(0,t[1]),Math.max(t[1]-1,-1));if(s){var o=this.getTileRangeForExtentAndZ(s,e);i.minX=Math.max(o.minX,i.minX),i.maxX=Math.min(o.maxX,i.maxX),i.minY=Math.max(o.minY,i.minY),i.maxY=Math.min(o.maxY,i.maxY)}return i}),this):s&&this.calculateTileRanges_(s)}return t.prototype.forEachTileCoord=function(t,e,i){for(var o=this.getTileRangeForExtentAndZ(t,e),n=o.minX,r=o.maxX;n<=r;++n)for(var a=o.minY,s=o.maxY;a<=s;++a)i([e,n,a])},t.prototype.forEachTileCoordParentTileRange=function(t,e,i,o){var n,r,a=null,s=t[0]-1;for(2===this.zoomFactor_?(n=t[1],r=t[2]):a=this.getTileCoordExtent(t,o);s>=this.minZoom;){if(e(s,2===this.zoomFactor_?gh(n=Math.floor(n/2),n,r=Math.floor(r/2),r,i):this.getTileRangeForExtentAndZ(a,s,i)))return!0;--s}return!1},t.prototype.getExtent=function(){return this.extent_},t.prototype.getMaxZoom=function(){return this.maxZoom},t.prototype.getMinZoom=function(){return this.minZoom},t.prototype.getOrigin=function(t){return this.origin_?this.origin_:this.origins_[t]},t.prototype.getResolution=function(t){return this.resolutions_[t]},t.prototype.getResolutions=function(){return this.resolutions_},t.prototype.getTileCoordChildTileRange=function(t,e,i){if(t[0]<this.maxZoom){if(2===this.zoomFactor_){var o=2*t[1],n=2*t[2];return gh(o,o+1,n,n+1,e)}var r=this.getTileCoordExtent(t,i||this.tmpExtent_);return this.getTileRangeForExtentAndZ(r,t[0]+1,e)}return null},t.prototype.getTileRangeForTileCoordAndZ=function(t,e,i){if(e>this.maxZoom||e<this.minZoom)return null;var o=t[0],n=t[1],r=t[2];if(e===o)return gh(n,r,n,r,i);if(this.zoomFactor_){var a=Math.pow(this.zoomFactor_,e-o),s=Math.floor(n*a),l=Math.floor(r*a);return e<o?gh(s,s,l,l,i):gh(s,Math.floor(a*(n+1))-1,l,Math.floor(a*(r+1))-1,i)}var u=this.getTileCoordExtent(t,this.tmpExtent_);return this.getTileRangeForExtentAndZ(u,e,i)},t.prototype.getTileRangeExtent=function(t,e,i){var o=this.getOrigin(t),n=this.getResolution(t),r=Ha(this.getTileSize(t),this.tmpSize_),a=o[0]+e.minX*r[0]*n,s=o[0]+(e.maxX+1)*r[0]*n;return no(a,o[1]+e.minY*r[1]*n,s,o[1]+(e.maxY+1)*r[1]*n,i)},t.prototype.getTileRangeForExtentAndZ=function(t,e,i){var o=Uh;this.getTileCoordForXYAndZ_(t[0],t[3],e,!1,o);var n=o[1],r=o[2];return this.getTileCoordForXYAndZ_(t[2],t[1],e,!0,o),gh(n,o[1],r,o[2],i)},t.prototype.getTileCoordCenter=function(t){var e=this.getOrigin(t[0]),i=this.getResolution(t[0]),o=Ha(this.getTileSize(t[0]),this.tmpSize_);return[e[0]+(t[1]+.5)*o[0]*i,e[1]-(t[2]+.5)*o[1]*i]},t.prototype.getTileCoordExtent=function(t,e){var i=this.getOrigin(t[0]),o=this.getResolution(t[0]),n=Ha(this.getTileSize(t[0]),this.tmpSize_),r=i[0]+t[1]*n[0]*o,a=i[1]-(t[2]+1)*n[1]*o;return no(r,a,r+n[0]*o,a+n[1]*o,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,o,n){var r=this.getZForResolution(i),a=i/this.getResolution(r),s=this.getOrigin(r),l=Ha(this.getTileSize(r),this.tmpSize_),u=o?.5:0,p=o?.5:0,d=Math.floor((t-s[0])/i+u),h=Math.floor((s[1]-e)/i+p),c=a*d/l[0],f=a*h/l[1];return o?(c=Math.ceil(c)-1,f=Math.ceil(f)-1):(c=Math.floor(c),f=Math.floor(f)),Ah(r,c,f,n)},t.prototype.getTileCoordForXYAndZ_=function(t,e,i,o,n){var r=this.getOrigin(i),a=this.getResolution(i),s=Ha(this.getTileSize(i),this.tmpSize_),l=o?.5:0,u=o?.5:0,p=Math.floor((t-r[0])/a+l),d=Math.floor((r[1]-e)/a+u),h=p/s[0],c=d/s[1];return o?(h=Math.ceil(h)-1,c=Math.ceil(c)-1):(h=Math.floor(h),c=Math.floor(c)),Ah(i,h,c,n)},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 Ie(ct(this.resolutions_,t,e||0),this.minZoom,this.maxZoom)},t.prototype.calculateTileRanges_=function(t){for(var e=this.resolutions_.length,i=new Array(e),o=this.minZoom;o<e;++o)i[o]=this.getTileRangeForExtentAndZ(t,o);this.fullTileRanges_=i},t}();function Kh(t){var e=t.getDefaultTileGrid();return e||(e=Hh(t),t.setDefaultTileGrid(e)),e}function Yh(t){var e=t||{},i=e.extent||Jo("EPSG:3857").getExtent(),o={extent:i,minZoom:e.minZoom,tileSize:e.tileSize,resolutions:Zh(i,e.maxZoom,e.tileSize,e.maxResolution)};return new Xh(o)}function Zh(t,e,i,o){for(var n=void 0!==e?e:42,r=xo(t),a=Co(t),s=Ha(void 0!==i?i:Lr),l=o>0?o:Math.max(a/s[0],r/s[1]),u=n+1,p=new Array(u),d=0;d<u;++d)p[d]=l/Math.pow(2,d);return p}function Hh(t,e,i,o){return function(t,e,i,o){var n=void 0!==o?o:Bi,r=Zh(t,e,i);return new Xh({extent:t,origin:_o(t,n),resolutions:r,tileSize:i})}($h(t),e,i,o)}function $h(t){var e=(t=Jo(t)).getExtent();if(!e){var i=180*yi[_i.DEGREES]/t.getMetersPerUnit();e=no(-i,-i,i,i)}return e}var Jh=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 o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}(),Qh=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 o=e.tileGrid;return o&&Ha(o.getTileSize(o.getMinZoom()),[256,256]),i.tileCache=new Bh(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 Jh(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,o){var n=this.getTileCacheForProjection(t);if(!n)return!1;for(var r,a,s,l=!0,u=i.minX;u<=i.maxX;++u)for(var p=i.minY;p<=i.maxY;++p)a=Dh(e,u,p),s=!1,n.containsKey(a)&&(s=(r=n.get(a)).getState()===Er)&&(s=!1!==o(r)),s||(l=!1);return l},e.prototype.getGutterForProjection=function(t){return 0},e.prototype.getKey=function(){return this.key_},e.prototype.setKey=function(t){this.key_!==t&&(this.key_=t,this.changed())},e.prototype.getOpaque=function(t){return this.opaque_},e.prototype.getResolutions=function(){return this.tileGrid.getResolutions()},e.prototype.getTile=function(t,e,i,o,n){return Ut()},e.prototype.getTileGrid=function(){return this.tileGrid},e.prototype.getTileGridForProjection=function(t){return this.tileGrid?this.tileGrid:Kh(t)},e.prototype.getTileCacheForProjection=function(t){return Re(nn(this.getProjection(),t),68),this.tileCache},e.prototype.getTilePixelRatio=function(t){return this.tilePixelRatio_},e.prototype.getTilePixelSize=function(t,e,i){var o,n,r,a=this.getTileGridForProjection(i),s=this.getTilePixelRatio(e),l=Ha(a.getTileSize(t),this.tmpSize);return 1==s?l:(o=l,n=s,void 0===(r=this.tmpSize)&&(r=[0,0]),r[0]=o[0]*n+.5|0,r[1]=o[1]*n+.5|0,r)},e.prototype.getTileCoordForTileUrlFunction=function(t,e){var i=void 0!==e?e:this.getProjection(),o=this.getTileGridForProjection(i);return this.getWrapX()&&i.isGlobal()&&(t=function(t,e,i){var o=e[0],n=t.getTileCoordCenter(e),r=$h(i);if(Qi(r,n))return e;var a=Co(r),s=Math.ceil((r[0]-n[0])/a);return n[0]+=a*s,t.getTileCoordForCoordAndZ(n,o)}(o,t,i)),function(t,e){var i=t[0],o=t[1],n=t[2];if(e.getMinZoom()>i||i>e.getMaxZoom())return!1;var r=e.getFullTileRange(i);return!r||r.containsXY(o,n)}(t,o)?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,o){},e}(Pd),tc=function(t){function e(e,i){var o=t.call(this,e)||this;return o.tile=i,o}return Jh(e,t),e}(ut),ec=Qh;function ic(t,e){var i=/\{z\}/g,o=/\{x\}/g,n=/\{y\}/g,r=/\{-y\}/g;return function(a,s,l){return a?t.replace(i,a[0].toString()).replace(o,a[1].toString()).replace(n,a[2].toString()).replace(r,(function(){var t=a[0],i=e.getFullTileRange(t);return Re(i,55),(i.getHeight()-a[2]-1).toString()})):void 0}}function oc(t,e){for(var i=t.length,o=new Array(i),n=0;n<i;++n)o[n]=ic(t[n],e);return function(t){if(1===t.length)return t[0];return function(e,i,o){if(e){var n=Ge(function(t){return(t[1]<<t[0])+t[2]}(e),t.length);return t[n](e,i,o)}}}(o)}var nc=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 o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}(),rc=function(t){function e(i){var o=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 o.generateTileUrlFunction_=o.tileUrlFunction===e.prototype.tileUrlFunction,o.tileLoadFunction=i.tileLoadFunction,i.tileUrlFunction&&(o.tileUrlFunction=i.tileUrlFunction),o.urls=null,i.urls?o.setUrls(i.urls):i.url&&o.setUrl(i.url),o.tileLoadingKeys_={},o}return nc(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,o=Kt(i),n=i.getState();n==Tr?(this.tileLoadingKeys_[o]=!0,e=qh):o in this.tileLoadingKeys_&&(delete this.tileLoadingKeys_[o],e=n==Pr?Vh:n==Er?Wh:void 0),null!=e&&this.dispatchEvent(new tc(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 o=i[1].charCodeAt(0),n=i[2].charCodeAt(0),r=void 0;for(r=o;r<=n;++r)e.push(t.replace(i[0],String.fromCharCode(r)));return e}if(i=/\{(\d+)-(\d+)\}/.exec(t)){for(var a=parseInt(i[2],10),s=parseInt(i[1],10);s<=a;s++)e.push(t.replace(i[0],s.toString()));return e}return e.push(t),e}(t);this.urls=e,this.setUrls(e)},e.prototype.setUrls=function(t){this.urls=t;var e=t.join("\n");this.generateTileUrlFunction_?this.setTileUrlFunction(oc(t,this.tileGrid),e):this.setKey(e)},e.prototype.tileUrlFunction=function(t,e,i){},e.prototype.useTile=function(t,e,i){var o=Dh(t,e,i);this.tileCache.containsKey(o)&&this.tileCache.get(o)},e}(ec),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 o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}(),sc=[],lc=function(t){function e(e,i,o,n){var r=t.call(this,e,i,{transition:0})||this;return r.context_={},r.executorGroups={},r.declutterExecutorGroups={},r.loadingSourceTiles=0,r.hitDetectionImageData={},r.replayState_={},r.sourceTiles=[],r.errorTileKeys={},r.wantedResolution,r.getSourceTiles=n.bind(void 0,r),r.wrappedTileCoord=o,r}return ac(e,t),e.prototype.getContext=function(t){var e=Kt(t);return e in this.context_||(this.context_[e]=le(1,1,sc)),this.context_[e]},e.prototype.hasContext=function(t){return Kt(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=Kt(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_)sc.push(this.context_[e].canvas),delete this.context_[e];t.prototype.release.call(this)},e}(Rh),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 o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}(),pc=function(t){function e(e){var i=this,o=e.projection||"EPSG:3857",n=e.extent||$h(o),r=e.tileGrid||Yh({extent:n,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:o,state:e.state,tileGrid:r,tileLoadFunction:e.tileLoadFunction?e.tileLoadFunction:dc,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 Bh(i.tileCache.highWaterMark),i.overlaps_=null==e.overlaps||e.overlaps,i.tileClass=e.tileClass?e.tileClass:Fh,i.tileGrids_={},i}return uc(e,t),e.prototype.getFeaturesInExtent=function(t){var e=[],i=this.tileCache;if(0===i.getCount())return e;var o=Gh(i.peekFirstKey())[0],n=this.tileGrid;return i.forEach((function(i){if(i.tileCoord[0]===o&&i.getState()===Er)for(var r=i.getSourceTiles(),a=0,s=r.length;a<s;++a){var l=r[a],u=l.tileCoord;if(zo(t,n.getTileCoordExtent(u))){var p=l.getFeatures();if(p)for(var d=0,h=p.length;d<h;++d){var c=p[d],f=c.getGeometry();zo(t,f.getExtent())&&e.push(c)}}}})),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 o=this.getTileCacheForProjection(e),n=Object.keys(i).reduce((function(t,e){var i,n,r=Dh((n=(i=e).substring(i.lastIndexOf("/")+1,i.length).split(",").map(Number))[0],n[1],n[2]);if(o.containsKey(r))for(var a=o.get(r).sourceTiles,s=0,l=a.length;s<l;++s)t[a[s].getKey()]=!0;return t}),{});t.prototype.expireCache.call(this,e,i),this.sourceTileCache.expireCache(n)},e.prototype.getSourceTiles=function(t,e,i){var o=this;if(i.getState()===zr){i.setState(Tr);var n=i.wrappedTileCoord,r=this.getTileGridForProjection(e),a=r.getTileCoordExtent(n),s=n[0],l=r.getResolution(s);Hi(a,-l,a);var u=this.tileGrid,p=u.getExtent();p&&ko(a,p,a);var d=u.getZForResolution(l,1);u.forEachTileCoord(a,d,(function(n){var r=o.tileUrlFunction(n,t,e),a=o.sourceTileCache.containsKey(r)?o.sourceTileCache.get(r):new o.tileClass(n,r?zr:Or,r,o.format_,o.tileLoadFunction);i.sourceTiles.push(a);var s=a.getState();if(s<Er){var l=function(t){o.handleTileChange(t);var e=a.getState();if(e===Er||e===Pr){var n=a.getKey();n in i.errorTileKeys?a.getState()===Er&&delete i.errorTileKeys[n]:i.loadingSourceTiles--,e===Pr?i.errorTileKeys[n]=!0:a.removeEventListener(Tt,l),0===i.loadingSourceTiles&&i.setState(wt(i.errorTileKeys)?Er:Pr)}};a.addEventListener(Tt,l),i.loadingSourceTiles++}s===zr&&(a.extent=u.getTileCoordExtent(n),a.projection=e,a.resolution=u.getResolution(n[0]),o.sourceTileCache.set(r,a),a.load())})),i.loadingSourceTiles||i.setState(i.sourceTiles.some((function(t){return t.getState()===Pr}))?Pr:Er)}return i.sourceTiles},e.prototype.getTile=function(t,e,i,o,n){var r,a=Dh(t,e,i),s=this.getKey();if(this.tileCache.containsKey(a)&&(r=this.tileCache.get(a)).key===s)return r;var l=[t,e,i],u=this.getTileCoordForTileUrlFunction(l,n),p=this.getTileGrid().getExtent(),d=this.getTileGridForProjection(n);if(u&&p){var h=d.getTileCoordExtent(u);Hi(h,-d.getResolution(t),h),zo(p,h)||(u=null)}var c=!0;if(null!==u){var f=this.tileGrid,g=d.getResolution(t),m=f.getZForResolution(g,1),v=d.getTileCoordExtent(u);Hi(v,-g,v),f.forEachTileCoord(v,m,function(t){c=c&&!this.tileUrlFunction(t,o,n)}.bind(this))}var y=new lc(l,c?Or:zr,u,this.getSourceTiles.bind(this,o,n));return y.key=s,r?(y.interimTile=r,y.refreshInterimChain(),this.tileCache.replace(a,y)):this.tileCache.set(a,y),y},e.prototype.getTileGridForProjection=function(t){var e=t.getCode(),i=this.tileGrids_[e];if(!i){var o=this.tileGrid;i=Hh(t,void 0,o?o.getTileSize(o.getMinZoom()):void 0),this.tileGrids_[e]=i}return i},e.prototype.getTilePixelRatio=function(t){return t},e.prototype.getTilePixelSize=function(t,e,i){var o=Ha(this.getTileGridForProjection(i).getTileSize(t),this.tmpSize);return[Math.round(o[0]*e),Math.round(o[1]*e)]},e.prototype.updateCacheSize=function(e,i){t.prototype.updateCacheSize.call(this,2*e,i),this.sourceTileCache.highWaterMark=this.getTileCacheForProjection(i).highWaterMark},e}(rc);function dc(t,e){t.setLoader((function(i,o,n){Ld(e,t.getFormat(),i,o,n,t.onLoad.bind(t),t.onError.bind(t))}))}var hc=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 o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}(),cc=function(t){function e(e){return(e=bt({},e)).controls||(e.controls=us()),e.interactions||(e.interactions=ch({onFocusOnly:!0})),t.call(this,e)||this}return hc(e,t),e.prototype.createRenderer=function(){return new ur(this)},e}(Ja),fc=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 o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}();var gc,mc=function(t){function e(e,i,o,n,r,a){var s=t.call(this,e,i,a)||this;return s.crossOrigin_=n,s.src_=o,s.key=o,s.image_=new Image,null!==n&&(s.image_.crossOrigin=n),s.unlisten_=null,s.tileLoadFunction_=r,s}return fc(e,t),e.prototype.getImage=function(){return this.image_},e.prototype.setImage=function(t){this.image_=t,this.state=Er,this.unlistenImage_(),this.changed()},e.prototype.handleImageError_=function(){var t;this.state=Pr,this.unlistenImage_(),this.image_=((t=le(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=Er:this.state=Or,this.unlistenImage_(),this.changed()},e.prototype.load=function(){this.state==Pr&&(this.state=zr,this.image_=new Image,null!==this.crossOrigin_&&(this.image_.crossOrigin=this.crossOrigin_)),this.state==zr&&(this.state=Tr,this.changed(),this.tileLoadFunction_(this,this.src_),this.unlisten_=el(this.image_,this.handleImageLoad_.bind(this),this.handleImageError_.bind(this)))},e.prototype.unlistenImage_=function(){this.unlisten_&&(this.unlisten_(),this.unlisten_=null)},e}(Rh),vc=function(){function t(t,e,i,o,n,r){this.sourceProj_=t,this.targetProj_=e;var a={},s=an(this.targetProj_,this.sourceProj_);this.transformInv_=function(t){var e=t[0]+"/"+t[1];return a[e]||(a[e]=s(t)),a[e]},this.maxSourceExtent_=o,this.errorThresholdSquared_=n*n,this.triangles_=[],this.wrapsXInSource_=!1,this.canWrapXInSource_=this.sourceProj_.canWrapX()&&!!o&&!!this.sourceProj_.getExtent()&&Co(o)==Co(this.sourceProj_.getExtent()),this.sourceWorldWidth_=this.sourceProj_.getExtent()?Co(this.sourceProj_.getExtent()):null,this.targetWorldWidth_=this.targetProj_.getExtent()?Co(this.targetProj_.getExtent()):null;var l=wo(i),u=So(i),p=vo(i),d=mo(i),h=this.transformInv_(l),c=this.transformInv_(u),f=this.transformInv_(p),g=this.transformInv_(d),m=10+(r?Math.max(0,Math.ceil(Me(go(i)/(r*r*256*256)))):0);if(this.addQuad_(l,u,p,d,h,c,f,g,m),this.wrapsXInSource_){var v=1/0;this.triangles_.forEach((function(t,e,i){v=Math.min(v,t.source[0][0],t.source[1][0],t.source[2][0])})),this.triangles_.forEach(function(t){if(Math.max(t.source[0][0],t.source[1][0],t.source[2][0])-v>this.sourceWorldWidth_/2){var e=[[t.source[0][0],t.source[0][1]],[t.source[1][0],t.source[1][1]],[t.source[2][0],t.source[2][1]]];e[0][0]-v>this.sourceWorldWidth_/2&&(e[0][0]-=this.sourceWorldWidth_),e[1][0]-v>this.sourceWorldWidth_/2&&(e[1][0]-=this.sourceWorldWidth_),e[2][0]-v>this.sourceWorldWidth_/2&&(e[2][0]-=this.sourceWorldWidth_);var 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))}a={}}return t.prototype.addTriangle_=function(t,e,i,o,n,r){this.triangles_.push({source:[o,n,r],target:[t,e,i]})},t.prototype.addQuad_=function(t,e,i,o,n,r,a,s,l){var u=Zi([n,r,a,s]),p=this.sourceWorldWidth_?Co(u)/this.sourceWorldWidth_:null,d=this.sourceWorldWidth_,h=this.sourceProj_.canWrapX()&&p>.5&&p<1,c=!1;if(l>0){if(this.targetProj_.isGlobal()&&this.targetWorldWidth_)c=Co(Zi([t,e,i,o]))/this.targetWorldWidth_>.25||c;!h&&this.sourceProj_.isGlobal()&&p&&(c=p>.25||c)}if(!(!c&&this.maxSourceExtent_&&isFinite(u[0])&&isFinite(u[1])&&isFinite(u[2])&&isFinite(u[3]))||zo(u,this.maxSourceExtent_)){var f=0;if(!(c||isFinite(n[0])&&isFinite(n[1])&&isFinite(r[0])&&isFinite(r[1])&&isFinite(a[0])&&isFinite(a[1])&&isFinite(s[0])&&isFinite(s[1])))if(l>0)c=!0;else if(1!=(f=(isFinite(n[0])&&isFinite(n[1])?0:8)+(isFinite(r[0])&&isFinite(r[1])?0:4)+(isFinite(a[0])&&isFinite(a[1])?0:2)+(isFinite(s[0])&&isFinite(s[1])?0:1))&&2!=f&&4!=f&&8!=f)return;if(l>0){if(!c){var g=[(t[0]+i[0])/2,(t[1]+i[1])/2],m=this.transformInv_(g),v=void 0;if(h)v=(Ge(n[0],d)+Ge(a[0],d))/2-Ge(m[0],d);else v=(n[0]+a[0])/2-m[0];var y=(n[1]+a[1])/2-m[1];c=v*v+y*y>this.errorThresholdSquared_}if(c){if(Math.abs(t[0]-i[0])<=Math.abs(t[1]-i[1])){var _=[(e[0]+i[0])/2,(e[1]+i[1])/2],b=this.transformInv_(_),x=[(o[0]+t[0])/2,(o[1]+t[1])/2],k=this.transformInv_(x);this.addQuad_(t,e,_,x,n,r,b,k,l-1),this.addQuad_(x,_,i,o,k,b,a,s,l-1)}else{var w=[(t[0]+e[0])/2,(t[1]+e[1])/2],S=this.transformInv_(w),C=[(i[0]+o[0])/2,(i[1]+o[1])/2],z=this.transformInv_(C);this.addQuad_(t,w,C,o,n,S,z,s,l-1),this.addQuad_(w,e,i,C,S,r,a,z,l-1)}return}}if(h){if(!this.canWrapXInSource_)return;this.wrapsXInSource_=!0}0==(11&f)&&this.addTriangle_(t,i,o,n,a,s),0==(14&f)&&this.addTriangle_(t,i,e,n,a,r),f&&(0==(13&f)&&this.addTriangle_(e,o,t,r,s,n),0==(7&f)&&this.addTriangle_(e,o,i,r,s,a))}},t.prototype.calculateSourceExtent=function(){var t=[1/0,1/0,-1/0,-1/0];return this.triangles_.forEach((function(e,i,o){var n=e.source;po(t,n[0]),po(t,n[1]),po(t,n[2])})),t},t.prototype.getTriangles=function(){return this.triangles_},t}(),yc={imageSmoothingEnabled:!1,msImageSmoothingEnabled:!1};function _c(t,e,i,o,n){t.beginPath(),t.moveTo(0,0),t.lineTo(e,i),t.lineTo(o,n),t.closePath(),t.save(),t.clip(),t.fillRect(0,0,Math.max(e,o)+1,Math.max(i,n)),t.restore()}function bc(t,e){return Math.abs(t[4*e]-210)>2||Math.abs(t[4*e+3]-191.25)>2}function xc(t,e,i,o){var n=sn(i,e,t),r=Qo(e,o,i),a=e.getMetersPerUnit();void 0!==a&&(r*=a);var s=t.getMetersPerUnit();void 0!==s&&(r/=s);var l=t.getExtent();if(!l||Qi(l,n)){var u=Qo(t,r,n)/r;isFinite(u)&&u>0&&(r/=u)}return r}function kc(t,e,i,o,n,r,a,s,l,u,p,d){var h=le(Math.round(i*t),Math.round(i*e));if(bt(h,d),0===l.length)return h.canvas;function c(t){return Math.round(t*i)/i}h.scale(i,i),h.globalCompositeOperation="lighter";var f=[1/0,1/0,-1/0,-1/0];l.forEach((function(t,e,i){uo(f,t.extent)}));var g=Co(f),m=xo(f),v=le(Math.round(i*g/o),Math.round(i*m/o));bt(v,d);var y=i/o;l.forEach((function(t,e,i){var o=t.extent[0]-f[0],n=-(t.extent[3]-f[3]),r=Co(t.extent),a=xo(t.extent);t.image.width>0&&t.image.height>0&&v.drawImage(t.image,u,u,t.image.width-2*u,t.image.height-2*u,o*y,n*y,r*y,a*y)}));var _=wo(a);return s.getTriangles().forEach((function(t,e,n){var a=t.source,s=t.target,l=a[0][0],u=a[0][1],p=a[1][0],g=a[1][1],m=a[2][0],y=a[2][1],b=c((s[0][0]-_[0])/r),x=c(-(s[0][1]-_[1])/r),k=c((s[1][0]-_[0])/r),w=c(-(s[1][1]-_[1])/r),S=c((s[2][0]-_[0])/r),C=c(-(s[2][1]-_[1])/r),z=l,T=u;l=0,u=0;var E=function(t){for(var e=t.length,i=0;i<e;i++){for(var o=i,n=Math.abs(t[i][i]),r=i+1;r<e;r++){var a=Math.abs(t[r][i]);a>n&&(n=a,o=r)}if(0===n)return null;var s=t[o];t[o]=t[i],t[i]=s;for(var l=i+1;l<e;l++)for(var u=-t[l][i]/t[i][i],p=i;p<e+1;p++)i==p?t[l][p]=0:t[l][p]+=u*t[i][p]}for(var d=new Array(e),h=e-1;h>=0;h--){d[h]=t[h][e]/t[h][h];for(var c=h-1;c>=0;c--)t[c][e]-=t[c][h]*d[h]}return d}([[p-=z,g-=T,0,0,k-b],[m-=z,y-=T,0,0,S-b],[0,0,p,g,w-x],[0,0,m,y,C-x]]);if(E){if(h.save(),h.beginPath(),function(){if(void 0===gc){var t=document.createElement("canvas").getContext("2d");t.globalCompositeOperation="lighter",t.fillStyle="rgba(210, 0, 0, 0.75)",_c(t,4,5,4,0),_c(t,4,5,0,5);var e=t.getImageData(0,0,3,3).data;gc=bc(e,0)||bc(e,4)||bc(e,8)}return gc}()||d===yc){h.moveTo(k,w);for(var P=b-k,O=x-w,j=0;j<4;j++)h.lineTo(k+c((j+1)*P/4),w+c(j*O/3)),3!=j&&h.lineTo(k+c((j+1)*P/4),w+c((j+1)*O/3));h.lineTo(S,C)}else h.moveTo(k,w),h.lineTo(b,x),h.lineTo(S,C);h.clip(),h.transform(E[0],E[2],E[1],E[3],b,x),h.translate(f[0]-z,f[3]-T),h.scale(o/i,-o/i),h.drawImage(v.canvas,0,0),h.restore()}})),p&&(h.save(),h.globalCompositeOperation="source-over",h.strokeStyle="black",h.lineWidth=1,s.getTriangles().forEach((function(t,e,i){var o=t.target,n=(o[0][0]-_[0])/r,a=-(o[0][1]-_[1])/r,s=(o[1][0]-_[0])/r,l=-(o[1][1]-_[1])/r,u=(o[2][0]-_[0])/r,p=-(o[2][1]-_[1])/r;h.beginPath(),h.moveTo(s,l),h.lineTo(n,a),h.lineTo(u,p),h.closePath(),h.stroke()})),h.restore()),h.canvas}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 o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}(),Sc=function(t){function e(e,i,o,n,r,a,s,l,u,p,d,h){var c=t.call(this,r,zr)||this;c.renderEdges_=void 0!==d&&d,c.contextOptions_=h,c.pixelRatio_=s,c.gutter_=l,c.canvas_=null,c.sourceTileGrid_=i,c.targetTileGrid_=n,c.wrappedTileCoord_=a||r,c.sourceTiles_=[],c.sourcesListenerKeys_=null,c.sourceZ_=0;var f=n.getTileCoordExtent(c.wrappedTileCoord_),g=c.targetTileGrid_.getExtent(),m=c.sourceTileGrid_.getExtent(),v=g?ko(f,g):f;if(0===go(v))return c.state=Or,c;var y=e.getExtent();y&&(m=m?ko(m,y):y);var _=n.getResolution(c.wrappedTileCoord_[0]),b=function(t,e,i,o){var n=yo(i),r=xc(t,e,n,o);return(!isFinite(r)||r<=0)&&fo(i,(function(i){return r=xc(t,e,i,o),isFinite(r)&&r>0})),r}(e,o,v,_);if(!isFinite(b)||b<=0)return c.state=Or,c;var x=void 0!==p?p:.5;if(c.triangulation_=new vc(e,o,v,m,b*x,_),0===c.triangulation_.getTriangles().length)return c.state=Or,c;c.sourceZ_=i.getZForResolution(b);var k=c.triangulation_.calculateSourceExtent();if(m&&(e.canWrapX()?(k[1]=Ie(k[1],m[1],m[3]),k[3]=Ie(k[3],m[1],m[3])):k=ko(k,m)),go(k)){for(var w=i.getTileRangeForExtentAndZ(k,c.sourceZ_),S=w.minX;S<=w.maxX;S++)for(var C=w.minY;C<=w.maxY;C++){var z=u(c.sourceZ_,S,C,s);z&&c.sourceTiles_.push(z)}0===c.sourceTiles_.length&&(c.state=Or)}else c.state=Or;return c}return wc(e,t),e.prototype.getImage=function(){return this.canvas_},e.prototype.reproject_=function(){var t=[];if(this.sourceTiles_.forEach(function(e,i,o){e&&e.getState()==Er&&t.push({extent:this.sourceTileGrid_.getTileCoordExtent(e.tileCoord),image:e.getImage()})}.bind(this)),this.sourceTiles_.length=0,0===t.length)this.state=Pr;else{var e=this.wrappedTileCoord_[0],i=this.targetTileGrid_.getTileSize(e),o="number"==typeof i?i:i[0],n="number"==typeof i?i:i[1],r=this.targetTileGrid_.getResolution(e),a=this.sourceTileGrid_.getResolution(this.sourceZ_),s=this.targetTileGrid_.getTileCoordExtent(this.wrappedTileCoord_);this.canvas_=kc(o,n,this.pixelRatio_,a,this.sourceTileGrid_.getExtent(),r,s,this.triangulation_,t,this.gutter_,this.renderEdges_,this.contextOptions_),this.state=Er}this.changed()},e.prototype.load=function(){if(this.state==zr){this.state=Tr,this.changed();var t=0;this.sourcesListenerKeys_=[],this.sourceTiles_.forEach(function(e,i,o){var n=e.getState();if(n==zr||n==Tr){t++;var r=Gt(e,Tt,(function(i){var o=e.getState();o!=Er&&o!=Pr&&o!=Or||(Bt(r),0===--t&&(this.unlistenSources_(),this.reproject_()))}),this);this.sourcesListenerKeys_.push(r)}}.bind(this)),0===t?setTimeout(this.reproject_.bind(this),0):this.sourceTiles_.forEach((function(t,e,i){t.getState()==zr&&t.load()}))}},e.prototype.unlistenSources_=function(){this.sourcesListenerKeys_.forEach(Bt),this.sourcesListenerKeys_=null},e}(Rh),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 o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}();function zc(t,e){t.getImage().src=e}var Tc=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:zc,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:mc,i.tileCacheForProjection={},i.tileGridForProjection={},i.reprojectionErrorThreshold_=e.reprojectionErrorThreshold,i.contextOptions_=!1===e.imageSmoothing?yc:void 0,i.renderReprojectionEdges_=!1,i}return Cc(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 o in this.tileCache.expireCache(this.tileCache==i?e:{}),this.tileCacheForProjection){var n=this.tileCacheForProjection[o];n.expireCache(n==i?e:{})}},e.prototype.getContextOptions=function(){return this.contextOptions_},e.prototype.getGutterForProjection=function(t){return this.getProjection()&&t&&!nn(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&&!nn(this.getProjection(),e))&&t.prototype.getOpaque.call(this,e)},e.prototype.getTileGridForProjection=function(t){var e=this.getProjection();if(!this.tileGrid||e&&!nn(e,t)){var i=Kt(t);return i in this.tileGridForProjection||(this.tileGridForProjection[i]=Kh(t)),this.tileGridForProjection[i]}return this.tileGrid},e.prototype.getTileCacheForProjection=function(t){var e=this.getProjection();if(!e||nn(e,t))return this.tileCache;var i=Kt(t);return i in this.tileCacheForProjection||(this.tileCacheForProjection[i]=new Bh(this.tileCache.highWaterMark)),this.tileCacheForProjection[i]},e.prototype.createTile_=function(t,e,i,o,n,r){var a=[t,e,i],s=this.getTileCoordForTileUrlFunction(a,n),l=s?this.tileUrlFunction(s,o,n):void 0,u=new this.tileClass(a,void 0!==l?zr:Or,void 0!==l?l:"",this.crossOrigin,this.tileLoadFunction,this.tileOptions);return u.key=r,u.addEventListener(Tt,this.handleTileChange.bind(this)),u},e.prototype.getTile=function(t,e,i,o,n){var r=this.getProjection();if(r&&n&&!nn(r,n)){var a=this.getTileCacheForProjection(n),s=[t,e,i],l=void 0,u=Lh(s);a.containsKey(u)&&(l=a.get(u));var p=this.getKey();if(l&&l.key==p)return l;var d=this.getTileGridForProjection(r),h=this.getTileGridForProjection(n),c=this.getTileCoordForTileUrlFunction(s,n),f=new Sc(r,d,n,h,s,c,this.getTilePixelRatio(o),this.getGutter(),function(t,e,i,o){return this.getTileInternal(t,e,i,o,r)}.bind(this),this.reprojectionErrorThreshold_,this.renderReprojectionEdges_,this.contextOptions_);return f.key=p,l?(f.interimTile=l,f.refreshInterimChain(),a.replace(u,f)):a.set(u,f),f}return this.getTileInternal(t,e,i,o,r||n)},e.prototype.getTileInternal=function(t,e,i,o,n){var r=null,a=Dh(t,e,i),s=this.getKey();if(this.tileCache.containsKey(a)){if((r=this.tileCache.get(a)).key!=s){var l=r;r=this.createTile_(t,e,i,o,n,s),l.getState()==zr?r.interimTile=l.interimTile:r.interimTile=l,r.refreshInterimChain(),this.tileCache.replace(a,r)}}else r=this.createTile_(t,e,i,o,n,s),this.tileCache.set(a,r);return r},e.prototype.setRenderReprojectionEdges=function(t){if(this.renderReprojectionEdges_!=t){for(var e in this.renderReprojectionEdges_=t,this.tileCacheForProjection)this.tileCacheForProjection[e].clear();this.changed()}},e.prototype.setTileGridForProjection=function(t,e){var i=Jo(t);if(i){var o=Kt(i);o in this.tileGridForProjection||(this.tileGridForProjection[o]=e)}},e}(rc),Ec=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 o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}(),Pc=function(t){function e(e){var i=this,o=e||{},n=bt({},o);return delete n.preload,delete n.useInterimTilesOnError,(i=t.call(this,n)||this).on,i.once,i.un,i.setPreload(void 0!==o.preload?o.preload:0),i.setUseInterimTilesOnError(void 0===o.useInterimTilesOnError||o.useInterimTilesOnError),i}return Ec(e,t),e.prototype.getPreload=function(){return this.get(Th)},e.prototype.setPreload=function(t){this.set(Th,t)},e.prototype.getUseInterimTilesOnError=function(){return this.get(Eh)},e.prototype.setUseInterimTilesOnError=function(t){this.set(Eh,t)},e}(Je),Oc=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 o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}(),jc=function(t){function e(e){return t.call(this,e)||this}return Oc(e,t),e.prototype.createRenderer=function(){return new _h(this)},e}(Pc),Rc={$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}},projection:{type:"projection",doc:"The projection the map should be rendered in. Suported projections are Albers, Equal Earth, Equirectangular (WGS84), Lambert conformal conic, Mercator, Natural Earth, and Winkel Tripel. Terrain, fog, sky and CustomLayerInterface are not supported for projections other than mercator.",example:{name:"albers",center:[-154,50],parallels:[55,65]}},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:'An 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. The `["pitch"]` and `["distance-from-center"]` expressions are supported only for filter expressions on the symbol layer.'},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. SDF images are not supported in formatted text and will be ignored.","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_symbol:{type:"boolean",doc:'Expression which determines whether or not to display a symbol. Symbols support dynamic filtering, meaning this expression can use the `["pitch"]` and `["distance-from-center"]` expressions to reference the current state of the view.',default:!1,transition:!1,"property-type":"data-driven",expression:{interpolated:!1,parameters:["zoom","feature","pitch","distance-from-center"]}},filter_fill:{type:"boolean",doc:'Expression which determines whether or not to display a polygon. Fill layer does NOT support dynamic filtering, meaning this expression can NOT use the `["pitch"]` and `["distance-from-center"]` expressions to reference the current state of the view.',default:!1,transition:!1,"property-type":"data-driven",expression:{interpolated:!1,parameters:["zoom","feature"]}},filter_line:{type:"boolean",doc:'Expression which determines whether or not to display a Polygon or LineString. Line layer does NOT support dynamic filtering, meaning this expression can NOT use the `["pitch"]` and `["distance-from-center"]` expressions to reference the current state of the view.',default:!1,transition:!1,"property-type":"data-driven",expression:{interpolated:!1,parameters:["zoom","feature"]}},filter_circle:{type:"boolean",doc:'Expression which determines whether or not to display a circle. Circle layer does NOT support dynamic filtering, meaning this expression can NOT use the `["pitch"]` and `["distance-from-center"]` expressions to reference the current state of the view.',default:!1,transition:!1,"property-type":"data-driven",expression:{interpolated:!1,parameters:["zoom","feature"]}},"filter_fill-extrusion":{type:"boolean",doc:'Expression which determines whether or not to display a Polygon. Fill-extrusion layer does NOT support dynamic filtering, meaning this expression can NOT use the `["pitch"]` and `["distance-from-center"]` expressions to reference the current state of the view.',default:!1,transition:!1,"property-type":"data-driven",expression:{interpolated:!1,parameters:["zoom","feature"]}},filter_heatmap:{type:"boolean",doc:'Expression used to determine whether a point is being displayed or not. Heatmap layer does NOT support dynamic filtering, meaning this expression can NOT use the `["pitch"]` and `["distance-from-center"]` expressions to reference the current state of the view.',default:!1,transition:!1,"property-type":"data-driven",expression:{interpolated:!1,parameters:["zoom","feature"]}},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 valid value is obtained. Invalid values are `null` and [`'image'`](#types-image) expressions that are unavailable in the style. If all values are invalid, `coalesce` returns the first value listed.",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 a [`ResolvedImage`](/mapbox-gl-js/style-spec/types/#resolvedimage) for use in [`icon-image`](/mapbox-gl-js/style-spec/layers/#layout-symbol-icon-image), `*-pattern` entries, and as a section in the [`'format'`](#types-format) expression. A [`'coalesce'`](#coalesce) expression containing `image` expressions will evaluate to the first listed image that 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`](#types-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`](#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. If the input is an [`\'image\'`](#types-image) expression, `\'to-string\'` returns the image name. 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:"Returns 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:'Returns 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:"Returns 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:"Returns 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:'Returns 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:"Camera","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},pitch:{doc:'Returns the current pitch in degrees. `["pitch"]` may only be used in the `filter` expression for a `symbol` layer.',group:"Camera","sdk-support":{"basic functionality":{js:"2.6.0"}}},"distance-from-center":{doc:'Returns the distance of a `symbol` instance from the center of the map. The distance is measured in pixels divided by the height of the map container. It measures 0 at the center, decreases towards the camera and increase away from the camera. For example, if the height of the map is 1000px, a value of -1 means 1000px away from the center towards the camera, and a value of 1 means a distance of 1000px away from the camera from the center. `["distance-from-center"]` may only be used in the `filter` expression for a `symbol` layer.',group:"Camera","sdk-support":{"basic functionality":{js:"2.6.0"}}},"heatmap-density":{doc:"Returns 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:"Returns 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:"Returns 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:"Returns 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"}}}},projection:{name:{type:"enum",values:{albers:{doc:"An Albers equal-area projection centered on the continental United States. You can configure the projection for a different region by setting `center` and `parallels` properties. You may want to set max bounds to constrain the map to the relevant region."},equalEarth:{doc:"An Equal Earth projection."},equirectangular:{doc:"An Equirectangular projection. This projection is very similar to the Plate Carrée projection."},lambertConformalConic:{doc:"A Lambert conformal conic projection. You can configure the projection for a region by setting `center` and `parallels` properties. You may want to set max bounds to constrain the map to the relevant region."},mercator:{doc:"The Mercator projection is the default projection."},naturalEarth:{doc:"A Natural Earth projection."},winkelTripel:{doc:"A Winkel Tripel projection."}},default:"mercator",doc:"The name of the projection to be used for rendering the map.",required:!0,"sdk-support":{"basic functionality":{js:"2.6.0"}}},center:{type:"array",length:2,value:"number","property-type":"data-constant",transition:!1,doc:"The reference longitude and latitude of the projection. `center` takes the form of [lng, lat]. This property is only configurable for conic projections (Albers and Lambert Conformal Conic). All other projections are centered on [0, 0].",example:[-96,37.5],requires:[{name:["albers","lambertConformalConic"]}],"sdk-support":{"basic functionality":{js:"2.6.0"}}},parallels:{type:"array",length:2,value:"number","property-type":"data-constant",transition:!1,doc:"The standard parallels of the projection, denoting the desired latitude range with minimal distortion. `parallels` takes the form of [lat0, lat1]. This property is only configurable for conic projections (Albers and Lambert Conformal Conic).",example:[29.5,45.5],requires:[{name:["albers","lambertConformalConic"]}],"sdk-support":{"basic functionality":{js:"2.6.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-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. `queryRenderedFeatures` on heatmap layers will return points within this radius.","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](/help/troubleshooting/using-recolorable-images-in-mapbox-maps/).",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](/help/troubleshooting/using-recolorable-images-in-mapbox-maps/).",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."}}},Ic="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function Fc(t){var e={exports:{}};return t(e,e.exports),e.exports}function Mc(t,e){return Object.prototype.hasOwnProperty.call(t,e)}
|
35
|
+
read:function(t,e,i,o,n){var r,a,s=8*n-o-1,l=(1<<s)-1,u=l>>1,p=-7,d=i?n-1:0,h=i?-1:1,c=t[e+d];for(d+=h,r=c&(1<<-p)-1,c>>=-p,p+=s;p>0;r=256*r+t[e+d],d+=h,p-=8);for(a=r&(1<<-p)-1,r>>=-p,p+=o;p>0;a=256*a+t[e+d],d+=h,p-=8);if(0===r)r=1-u;else{if(r===l)return a?NaN:1/0*(c?-1:1);a+=Math.pow(2,o),r-=u}return(c?-1:1)*a*Math.pow(2,r-o)},write:function(t,e,i,o,n,r){var a,s,l,u=8*r-n-1,p=(1<<u)-1,d=p>>1,h=23===n?Math.pow(2,-24)-Math.pow(2,-77):0,c=o?0:r-1,f=o?1:-1,g=e<0||0===e&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(s=isNaN(e)?1:0,a=p):(a=Math.floor(Math.log(e)/Math.LN2),e*(l=Math.pow(2,-a))<1&&(a--,l*=2),(e+=a+d>=1?h/l:h*Math.pow(2,1-d))*l>=2&&(a++,l/=2),a+d>=p?(s=0,a=p):a+d>=1?(s=(e*l-1)*Math.pow(2,n),a+=d):(s=e*Math.pow(2,d-1)*Math.pow(2,n),a=0));n>=8;t[i+c]=255&s,c+=f,s/=256,n-=8);for(a=a<<n|s,u+=n;u>0;t[i+c]=255&a,c+=f,a/=256,u-=8);t[i+c-f]|=128*g}},Sl=zl,Cl=wl;function zl(t){this.buf=ArrayBuffer.isView&&ArrayBuffer.isView(t)?t:new Uint8Array(t||0),this.pos=0,this.type=0,this.length=this.buf.length}zl.Varint=0,zl.Fixed64=1,zl.Bytes=2,zl.Fixed32=5;var Tl=4294967296,El=1/Tl,Pl="undefined"==typeof TextDecoder?null:new TextDecoder("utf8");function Ol(t){return t.type===zl.Bytes?t.readVarint()+t.pos:t.pos+1}function jl(t,e,i){return i?4294967296*e+(t>>>0):4294967296*(e>>>0)+(t>>>0)}function Rl(t,e,i){var o=e<=16383?1:e<=2097151?2:e<=268435455?3:Math.floor(Math.log(e)/(7*Math.LN2));i.realloc(o);for(var n=i.pos-1;n>=t;n--)i.buf[n+o]=i.buf[n]}function Il(t,e){for(var i=0;i<t.length;i++)e.writeVarint(t[i])}function Fl(t,e){for(var i=0;i<t.length;i++)e.writeSVarint(t[i])}function Ml(t,e){for(var i=0;i<t.length;i++)e.writeFloat(t[i])}function Al(t,e){for(var i=0;i<t.length;i++)e.writeDouble(t[i])}function Dl(t,e){for(var i=0;i<t.length;i++)e.writeBoolean(t[i])}function Ll(t,e){for(var i=0;i<t.length;i++)e.writeFixed32(t[i])}function Gl(t,e){for(var i=0;i<t.length;i++)e.writeSFixed32(t[i])}function Nl(t,e){for(var i=0;i<t.length;i++)e.writeFixed64(t[i])}function Bl(t,e){for(var i=0;i<t.length;i++)e.writeSFixed64(t[i])}function ql(t,e){return(t[e]|t[e+1]<<8|t[e+2]<<16)+16777216*t[e+3]}function Wl(t,e,i){t[i]=e,t[i+1]=e>>>8,t[i+2]=e>>>16,t[i+3]=e>>>24}function Vl(t,e){return(t[e]|t[e+1]<<8|t[e+2]<<16)+(t[e+3]<<24)}zl.prototype={destroy:function(){this.buf=null},readFields:function(t,e,i){for(i=i||this.length;this.pos<i;){var o=this.readVarint(),n=o>>3,r=this.pos;this.type=7&o,t(n,e,this),this.pos===r&&this.skip(o)}return e},readMessage:function(t,e){return this.readFields(t,e,this.readVarint()+this.pos)},readFixed32:function(){var t=ql(this.buf,this.pos);return this.pos+=4,t},readSFixed32:function(){var t=Vl(this.buf,this.pos);return this.pos+=4,t},readFixed64:function(){var t=ql(this.buf,this.pos)+ql(this.buf,this.pos+4)*Tl;return this.pos+=8,t},readSFixed64:function(){var t=ql(this.buf,this.pos)+Vl(this.buf,this.pos+4)*Tl;return this.pos+=8,t},readFloat:function(){var t=Cl.read(this.buf,this.pos,!0,23,4);return this.pos+=4,t},readDouble:function(){var t=Cl.read(this.buf,this.pos,!0,52,8);return this.pos+=8,t},readVarint:function(t){var e,i,o=this.buf;return e=127&(i=o[this.pos++]),i<128?e:(e|=(127&(i=o[this.pos++]))<<7,i<128?e:(e|=(127&(i=o[this.pos++]))<<14,i<128?e:(e|=(127&(i=o[this.pos++]))<<21,i<128?e:function(t,e,i){var o,n,r=i.buf;if(n=r[i.pos++],o=(112&n)>>4,n<128)return jl(t,o,e);if(n=r[i.pos++],o|=(127&n)<<3,n<128)return jl(t,o,e);if(n=r[i.pos++],o|=(127&n)<<10,n<128)return jl(t,o,e);if(n=r[i.pos++],o|=(127&n)<<17,n<128)return jl(t,o,e);if(n=r[i.pos++],o|=(127&n)<<24,n<128)return jl(t,o,e);if(n=r[i.pos++],o|=(1&n)<<31,n<128)return jl(t,o,e);throw new Error("Expected varint not more than 10 bytes")}(e|=(15&(i=o[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 o="",n=e;for(;n<i;){var r,a,s,l=t[n],u=null,p=l>239?4:l>223?3:l>191?2:1;if(n+p>i)break;1===p?l<128&&(u=l):2===p?128==(192&(r=t[n+1]))&&(u=(31&l)<<6|63&r)<=127&&(u=null):3===p?(r=t[n+1],a=t[n+2],128==(192&r)&&128==(192&a)&&((u=(15&l)<<12|(63&r)<<6|63&a)<=2047||u>=55296&&u<=57343)&&(u=null)):4===p&&(r=t[n+1],a=t[n+2],s=t[n+3],128==(192&r)&&128==(192&a)&&128==(192&s)&&((u=(15&l)<<18|(63&r)<<12|(63&a)<<6|63&s)<=65535||u>=1114112)&&(u=null)),null===u?(u=65533,p=1):u>65535&&(u-=65536,o+=String.fromCharCode(u>>>10&1023|55296),u=56320|1023&u),o+=String.fromCharCode(u),n+=p}return o}(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!==zl.Bytes)return t.push(this.readVarint(e));var i=Ol(this);for(t=t||[];this.pos<i;)t.push(this.readVarint(e));return t},readPackedSVarint:function(t){if(this.type!==zl.Bytes)return t.push(this.readSVarint());var e=Ol(this);for(t=t||[];this.pos<e;)t.push(this.readSVarint());return t},readPackedBoolean:function(t){if(this.type!==zl.Bytes)return t.push(this.readBoolean());var e=Ol(this);for(t=t||[];this.pos<e;)t.push(this.readBoolean());return t},readPackedFloat:function(t){if(this.type!==zl.Bytes)return t.push(this.readFloat());var e=Ol(this);for(t=t||[];this.pos<e;)t.push(this.readFloat());return t},readPackedDouble:function(t){if(this.type!==zl.Bytes)return t.push(this.readDouble());var e=Ol(this);for(t=t||[];this.pos<e;)t.push(this.readDouble());return t},readPackedFixed32:function(t){if(this.type!==zl.Bytes)return t.push(this.readFixed32());var e=Ol(this);for(t=t||[];this.pos<e;)t.push(this.readFixed32());return t},readPackedSFixed32:function(t){if(this.type!==zl.Bytes)return t.push(this.readSFixed32());var e=Ol(this);for(t=t||[];this.pos<e;)t.push(this.readSFixed32());return t},readPackedFixed64:function(t){if(this.type!==zl.Bytes)return t.push(this.readFixed64());var e=Ol(this);for(t=t||[];this.pos<e;)t.push(this.readFixed64());return t},readPackedSFixed64:function(t){if(this.type!==zl.Bytes)return t.push(this.readSFixed64());var e=Ol(this);for(t=t||[];this.pos<e;)t.push(this.readSFixed64());return t},skip:function(t){var e=7&t;if(e===zl.Varint)for(;this.buf[this.pos++]>127;);else if(e===zl.Bytes)this.pos=this.readVarint()+this.pos;else if(e===zl.Fixed32)this.pos+=4;else{if(e!==zl.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),Wl(this.buf,t,this.pos),this.pos+=4},writeSFixed32:function(t){this.realloc(4),Wl(this.buf,t,this.pos),this.pos+=4},writeFixed64:function(t){this.realloc(8),Wl(this.buf,-1&t,this.pos),Wl(this.buf,Math.floor(t*El),this.pos+4),this.pos+=8},writeSFixed64:function(t){this.realloc(8),Wl(this.buf,-1&t,this.pos),Wl(this.buf,Math.floor(t*El),this.pos+4),this.pos+=8},writeVarint:function(t){(t=+t||0)>268435455||t<0?function(t,e){var i,o;t>=0?(i=t%4294967296|0,o=t/4294967296|0):(o=~(-t/4294967296),4294967295^(i=~(-t%4294967296))?i=i+1|0:(i=0,o=o+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}(o,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 o,n,r=0;r<e.length;r++){if((o=e.charCodeAt(r))>55295&&o<57344){if(!n){o>56319||r+1===e.length?(t[i++]=239,t[i++]=191,t[i++]=189):n=o;continue}if(o<56320){t[i++]=239,t[i++]=191,t[i++]=189,n=o;continue}o=n-55296<<10|o-56320|65536,n=null}else n&&(t[i++]=239,t[i++]=191,t[i++]=189,n=null);o<128?t[i++]=o:(o<2048?t[i++]=o>>6|192:(o<65536?t[i++]=o>>12|224:(t[i++]=o>>18|240,t[i++]=o>>12&63|128),t[i++]=o>>6&63|128),t[i++]=63&o|128)}return i}(this.buf,t,this.pos);var i=this.pos-e;i>=128&&Rl(e,i,this),this.pos=e-1,this.writeVarint(i),this.pos+=i},writeFloat:function(t){this.realloc(4),Cl.write(this.buf,t,this.pos,!0,23,4),this.pos+=4},writeDouble:function(t){this.realloc(8),Cl.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 o=this.pos-i;o>=128&&Rl(i,o,this),this.pos=i-1,this.writeVarint(o),this.pos+=o},writeMessage:function(t,e,i){this.writeTag(t,zl.Bytes),this.writeRawMessage(e,i)},writePackedVarint:function(t,e){e.length&&this.writeMessage(t,Il,e)},writePackedSVarint:function(t,e){e.length&&this.writeMessage(t,Fl,e)},writePackedBoolean:function(t,e){e.length&&this.writeMessage(t,Dl,e)},writePackedFloat:function(t,e){e.length&&this.writeMessage(t,Ml,e)},writePackedDouble:function(t,e){e.length&&this.writeMessage(t,Al,e)},writePackedFixed32:function(t,e){e.length&&this.writeMessage(t,Ll,e)},writePackedSFixed32:function(t,e){e.length&&this.writeMessage(t,Gl,e)},writePackedFixed64:function(t,e){e.length&&this.writeMessage(t,Nl,e)},writePackedSFixed64:function(t,e){e.length&&this.writeMessage(t,Bl,e)},writeBytesField:function(t,e){this.writeTag(t,zl.Bytes),this.writeBytes(e)},writeFixed32Field:function(t,e){this.writeTag(t,zl.Fixed32),this.writeFixed32(e)},writeSFixed32Field:function(t,e){this.writeTag(t,zl.Fixed32),this.writeSFixed32(e)},writeFixed64Field:function(t,e){this.writeTag(t,zl.Fixed64),this.writeFixed64(e)},writeSFixed64Field:function(t,e){this.writeTag(t,zl.Fixed64),this.writeSFixed64(e)},writeVarintField:function(t,e){this.writeTag(t,zl.Varint),this.writeVarint(e)},writeSVarintField:function(t,e){this.writeTag(t,zl.Varint),this.writeSVarint(e)},writeStringField:function(t,e){this.writeTag(t,zl.Bytes),this.writeString(e)},writeFloatField:function(t,e){this.writeTag(t,zl.Fixed32),this.writeFloat(e)},writeDoubleField:function(t,e){this.writeTag(t,zl.Fixed64),this.writeDouble(e)},writeBooleanField:function(t,e){this.writeVarintField(t,Boolean(e))}};var Ul=[1,0,0,1,0,0],Xl=function(){function t(t,e,i,o,n){this.extent_,this.id_=n,this.type_=t,this.flatCoordinates_=e,this.flatInteriorPoints_=null,this.flatMidpoints_=null,this.ends_=i,this.properties_=o}return t.prototype.get=function(t){return this.properties_[t]},t.prototype.getExtent=function(){return this.extent_||(this.extent_=this.type_===Po?ao(this.flatCoordinates_):so(this.flatCoordinates_,0,this.flatCoordinates_.length,2)),this.extent_},t.prototype.getFlatInteriorPoint=function(){if(!this.flatInteriorPoints_){var t=yo(this.getExtent());this.flatInteriorPoints_=Pa(this.flatCoordinates_,0,this.ends_,2,t,0)}return this.flatInteriorPoints_},t.prototype.getFlatInteriorPoints=function(){if(!this.flatInteriorPoints_){var t=Os(this.flatCoordinates_,0,this.ends_,2);this.flatInteriorPoints_=Oa(this.flatCoordinates_,0,this.ends_,2,t)}return this.flatInteriorPoints_},t.prototype.getFlatMidpoint=function(){return this.flatMidpoints_||(this.flatMidpoints_=xs(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_,o=0,n=i.length;o<n;++o){var r=i[o],a=xs(t,e,r,2,.5);gt(this.flatMidpoints_,a),e=r}}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=Jo(t)).getExtent(),i=t.getWorldExtent();if(e&&i){var o=xo(i)/xo(e);kn(Ul,i[0],i[3],o,-o,0,0,0),$r(this.flatCoordinates_,0,this.flatCoordinates_.length,2,Ul,this.flatCoordinates_)}},t.prototype.getEnds=function(){return this.ends_},t}();Xl.prototype.getEndss=Xl.prototype.getEnds,Xl.prototype.getFlatCoordinates=Xl.prototype.getOrientedFlatCoordinates;var Kl=Xl,Yl=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 o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}();function Zl(t,e,i){if(3===t){var o={keys:[],values:[],features:[]},n=i.readVarint()+i.pos;i.readFields($l,o,n),o.length=o.features.length,o.length&&(e[o.name]=o)}}function $l(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 o=null,n=i.readVarint()+i.pos;i.pos<n;)o=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(o)}}function Hl(t,e,i){if(1==t)e.id=i.readVarint();else if(2==t)for(var o=i.readVarint()+i.pos;i.pos<o;){var n=e.layer.keys[i.readVarint()],r=e.layer.values[i.readVarint()];e.properties[n]=r}else 3==t?e.type=i.readVarint():4==t&&(e.geometry=i.pos)}function Jl(t,e,i){t.pos=e.features[i];var o=t.readVarint()+t.pos,n={layer:e,type:0,properties:{}};return t.readFields(Hl,n,o),n}var Ql=function(t){function e(e){var i=t.call(this)||this,o=e||{};return i.dataProjection=new bi({code:"",units:_i.TILE_PIXELS}),i.featureClass_=o.featureClass?o.featureClass:Kl,i.geometryName_=o.geometryName,i.layerName_=o.layerName?o.layerName:"layer",i.layers_=o.layers?o.layers:null,i.idProperty_=o.idProperty,i.supportedMediaTypes=["application/vnd.mapbox-vector-tile","application/x-protobuf"],i}return Yl(e,t),e.prototype.readRawGeometry_=function(t,e,i,o){t.pos=e.geometry;for(var n=t.readVarint()+t.pos,r=1,a=0,s=0,l=0,u=0,p=0;t.pos<n;){if(!a){var d=t.readVarint();r=7&d,a=d>>3}a--,1===r||2===r?(s+=t.readSVarint(),l+=t.readSVarint(),1===r&&u>p&&(o.push(u),p=u),i.push(s,l),u+=2):7===r?u>p&&(i.push(i[p],i[p+1]),u+=2):Re(!1,59)}u>p&&(o.push(u),p=u)},e.prototype.createFeature_=function(t,e,i){var o,n=e.type;if(0===n)return null;var r,a=e.properties;this.idProperty_?(r=a[this.idProperty_],delete a[this.idProperty_]):r=e.id,a[this.layerName_]=e.layer.name;var s=[],l=[];this.readRawGeometry_(t,e,s,l);var u=function(t,e){var i;1===t?i=1===e?Po:Io:2===t?i=1===e?Oo:Fo:3===t&&(i=Ro);return i}(n,l.length);if(this.featureClass_===Kl)(o=new this.featureClass_(u,s,l,a,r)).transform(i.dataProjection);else{var p=void 0;if(u==Ro){for(var d=[],h=0,c=0,f=0,g=l.length;f<g;++f){var m=l[f];if(Ma(s,h,m,2)){if(0===d.length)continue;d[d.length-1].push(l[c])}else d.push(l.slice(c,f+1));c=f+1,h=m}p=d.length>1?new Rs(s,Xr,d):new Ba(s,Xr,l)}else p=u===Po?new Ca(s,Xr):u===Oo?new Cs(s,Xr):u===Ro?new Ba(s,Xr,l):u===Io?new Ps(s,Xr):u===Fo?new Ts(s,Xr,l):null;o=new(0,this.featureClass_),this.geometryName_&&o.setGeometryName(this.geometryName_);var v=cs(p,!1,i);o.setGeometry(v),o.setId(r),o.setProperties(a,!0)}return o},e.prototype.getType=function(){return fs},e.prototype.readFeatures=function(t,e){var i=this.layers_,o=this.adaptOptions(e),n=Jo(o.dataProjection);n.setWorldExtent(o.extent),o.dataProjection=n;var r=new Sl(t),a=r.readFields(Zl,{}),s=[];for(var l in a)if(!i||-1!=i.indexOf(l)){var u=a[l],p=u?[0,0,u.extent,u.extent]:null;n.setExtent(p);for(var d=0,h=u.length;d<h;++d){var c=Jl(r,u,d);s.push(this.createFeature_(r,c,o))}}return s},e.prototype.readProjection=function(t){return this.dataProjection},e.prototype.setLayers=function(t){this.layers_=t},e}(hs),tu="active",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 o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}();function iu(t,e,i,o){var n=t.getZoom();if(void 0!==n){var r=t.getConstrainedZoom(n+e),a=t.getResolutionForZoom(r);t.getAnimating()&&t.cancelAnimations(),t.animate({resolution:a,anchor:i,duration:void 0!==o?o:250,easing:li})}}var ou=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 eu(e,t),e.prototype.getActive=function(){return this.get(tu)},e.prototype.getMap=function(){return this.map_},e.prototype.handleEvent=function(t){return!0},e.prototype.setActive=function(t){this.set(tu,t)},e.prototype.setMap=function(t){this.map_=t},e}($t),nu=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 o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}(),ru=function(t){function e(e){var i=t.call(this)||this,o=e||{};return i.delta_=o.delta?o.delta:1,i.duration_=void 0!==o.duration?o.duration:250,i}return nu(e,t),e.prototype.handleEvent=function(t){var e=!1;if(t.type==xr.DBLCLICK){var i=t.originalEvent,o=t.map,n=t.coordinate,r=i.shiftKey?-this.delta_:this.delta_;iu(o.getView(),r,n,this.duration_),i.preventDefault(),e=!0}return!e},e}(ou),au=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 o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}();function su(t){for(var e=t.length,i=0,o=0,n=0;n<e;n++)i+=t[n].clientX,o+=t[n].clientY;return[i/e,o/e]}var lu=function(t){function e(e){var i=this,o=e||{};return i=t.call(this,o)||this,o.handleDownEvent&&(i.handleDownEvent=o.handleDownEvent),o.handleDragEvent&&(i.handleDragEvent=o.handleDragEvent),o.handleMoveEvent&&(i.handleMoveEvent=o.handleMoveEvent),o.handleUpEvent&&(i.handleUpEvent=o.handleUpEvent),o.stopDown&&(i.stopDown=o.stopDown),i.handlingDownUpSequence=!1,i.trackedPointers_={},i.targetPointers=[],i}return au(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==xr.POINTERDRAG)this.handleDragEvent(t),t.originalEvent.preventDefault();else if(t.type==xr.POINTERUP){var i=this.handleUpEvent(t);this.handlingDownUpSequence=i&&this.targetPointers.length>0}}else if(t.type==xr.POINTERDOWN){var o=this.handleDownEvent(t);this.handlingDownUpSequence=o,e=this.stopDown(o)}else t.type==xr.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===xr.POINTERDOWN||e===xr.POINTERDRAG||e===xr.POINTERUP}(t)){var e=t.originalEvent,i=e.pointerId.toString();t.type==xr.POINTERUP?delete this.trackedPointers_[i]:(t.type==xr.POINTERDOWN||i in this.trackedPointers_)&&(this.trackedPointers_[i]=e),this.targetPointers=kt(this.trackedPointers_)}},e}(ou);function uu(t){var e=arguments;return function(t){for(var i=!0,o=0,n=e.length;o<n&&(i=i&&e[o](t));++o);return i}}var pu=function(t){var e=t.originalEvent;return e.altKey&&!(e.metaKey||e.ctrlKey)&&e.shiftKey},du=function(t){return!t.map.getTargetElement().hasAttribute("tabindex")||function(t){return t.target.getTargetElement().contains(document.activeElement)}(t)},hu=vt,cu=function(t){var e=t.originalEvent;return 0==e.button&&!(ie&&oe&&e.ctrlKey)},fu=function(t){var e=t.originalEvent;return!e.altKey&&!(e.metaKey||e.ctrlKey)&&!e.shiftKey},gu=function(t){var e=t.originalEvent;return!e.altKey&&!(e.metaKey||e.ctrlKey)&&e.shiftKey},mu=function(t){var e=t.originalEvent.target.tagName;return"INPUT"!==e&&"SELECT"!==e&&"TEXTAREA"!==e},vu=function(t){var e=t.originalEvent;return Re(void 0!==e,56),"mouse"==e.pointerType},yu=function(t){var e=t.originalEvent;return Re(void 0!==e,56),e.isPrimary&&0===e.button},_u=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 o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}(),bu=function(t){function e(e){var i=t.call(this,{stopDown:yt})||this,o=e||{};i.kinetic_=o.kinetic,i.lastCentroid=null,i.lastPointersCount_,i.panning_=!1;var n=o.condition?o.condition:uu(fu,yu);return i.condition_=o.onFocusOnly?uu(du,n):n,i.noKinetic_=!1,i}return _u(e,t),e.prototype.handleDragEvent=function(t){this.panning_||(this.panning_=!0,this.getMap().getView().beginInteraction());var e,i,o=this.targetPointers,n=su(o);if(o.length==this.lastPointersCount_){if(this.kinetic_&&this.kinetic_.update(n[0],n[1]),this.lastCentroid){var r=[this.lastCentroid[0]-n[0],n[1]-this.lastCentroid[1]],a=t.map.getView();e=r,i=a.getResolution(),e[0]*=i,e[1]*=i,Vo(r,a.getRotation()),a.adjustCenterInternal(r)}}else this.kinetic_&&this.kinetic_.begin();this.lastCentroid=n,this.lastPointersCount_=o.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 o=this.kinetic_.getDistance(),n=this.kinetic_.getAngle(),r=i.getCenterInternal(),a=e.getPixelFromCoordinateInternal(r),s=e.getCoordinateFromPixelInternal([a[0]-o*Math.cos(n),a[1]-o*Math.sin(n)]);i.animateInternal({center:i.getConstrainedCenter(s),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}(lu),xu=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 o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}(),ku=function(t){function e(e){var i=this,o=e||{};return(i=t.call(this,{stopDown:yt})||this).condition_=o.condition?o.condition:pu,i.lastAngle_=void 0,i.duration_=void 0!==o.duration?o.duration:250,i}return xu(e,t),e.prototype.handleDragEvent=function(t){if(vu(t)){var e=t.map,i=e.getView();if(i.getConstraints().rotation!==Vr){var o=e.getSize(),n=t.pixel,r=Math.atan2(o[1]/2-n[1],n[0]-o[0]/2);if(void 0!==this.lastAngle_){var a=r-this.lastAngle_;i.adjustRotationInternal(-a)}this.lastAngle_=r}}},e.prototype.handleUpEvent=function(t){return!vu(t)||(t.map.getView().endInteraction(this.duration_),!1)},e.prototype.handleDownEvent=function(t){return!!vu(t)&&(!(!cu(t)||!this.condition_(t))&&(t.map.getView().beginInteraction(),this.lastAngle_=void 0,!0))},e}(lu),wu=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 o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}(),Su=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 wu(e,t),e.prototype.disposeInternal=function(){this.setMap(null)},e.prototype.render_=function(){var t=this.startPixel_,e=this.endPixel_,i="px",o=this.element_.style;o.left=Math.min(t[0],e[0])+i,o.top=Math.min(t[1],e[1])+i,o.width=Math.abs(e[0]-t[0])+i,o.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 Ba([i])},e.prototype.getGeometry=function(){return this.geometry_},e}(dt),Cu=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 o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}(),zu="boxstart",Tu="boxdrag",Eu="boxend",Pu="boxcancel",Ou=function(t){function e(e,i,o){var n=t.call(this,e)||this;return n.coordinate=i,n.mapBrowserEvent=o,n}return Cu(e,t),e}(ut),ju=function(t){function e(e){var i=t.call(this)||this;i.on,i.once,i.un;var o=e||{};return i.box_=new Su(o.className||"ol-dragbox"),i.minArea_=void 0!==o.minArea?o.minArea:64,o.onBoxEnd&&(i.onBoxEnd=o.onBoxEnd),i.startPixel_=null,i.condition_=o.condition?o.condition:cu,i.boxEndCondition_=o.boxEndCondition?o.boxEndCondition:i.defaultBoxEndCondition,i}return Cu(e,t),e.prototype.defaultBoxEndCondition=function(t,e,i){var o=i[0]-e[0],n=i[1]-e[1];return o*o+n*n>=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 Ou(Tu,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 Ou(e?Eu: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 Ou(zu,t.coordinate,t)),!0)},e.prototype.onBoxEnd=function(t){},e}(lu),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 o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}(),Iu=function(t){function e(e){var i=this,o=e||{},n=o.condition?o.condition:gu;return(i=t.call(this,{condition:n,className:o.className||"ol-dragzoom",minArea:o.minArea})||this).duration_=void 0!==o.duration?o.duration:200,i.out_=void 0!==o.out&&o.out,i}return Ru(e,t),e.prototype.onBoxEnd=function(t){var e=this.getMap().getView(),i=this.getGeometry();if(this.out_){var o=e.rotatedExtentForGeometry(i),n=e.getResolutionForExtentInternal(o),r=e.getResolution()/n;(i=i.clone()).scale(r*r)}e.fitInternal(i,{duration:this.duration_,easing:li})},e}(ju),Fu=37,Mu=38,Au=39,Du=40,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 o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}(),Gu=function(t){function e(e){var i=t.call(this)||this,o=e||{};return i.defaultCondition_=function(t){return fu(t)&&mu(t)},i.condition_=void 0!==o.condition?o.condition:i.defaultCondition_,i.duration_=void 0!==o.duration?o.duration:100,i.pixelDelta_=void 0!==o.pixelDelta?o.pixelDelta:128,i}return Lu(e,t),e.prototype.handleEvent=function(t){var e=!1;if(t.type==It){var i=t.originalEvent,o=i.keyCode;if(this.condition_(t)&&(o==Du||o==Fu||o==Au||o==Mu)){var n=t.map.getView(),r=n.getResolution()*this.pixelDelta_,a=0,s=0;o==Du?s=-r:o==Fu?a=-r:o==Au?a=r:s=r;var l=[a,s];Vo(l,n.getRotation()),function(t,e,i){var o=t.getCenterInternal();if(o){var n=[o[0]+e[0],o[1]+e[1]];t.animateInternal({duration:void 0!==i?i:250,easing:pi,center:t.getConstrainedCenter(n)})}}(n,l,this.duration_),i.preventDefault(),e=!0}}return!e},e}(ou),Nu=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 o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}(),Bu=function(t){function e(e){var i=t.call(this)||this,o=e||{};return i.condition_=o.condition?o.condition:mu,i.delta_=o.delta?o.delta:1,i.duration_=void 0!==o.duration?o.duration:100,i}return Nu(e,t),e.prototype.handleEvent=function(t){var e=!1;if(t.type==It||t.type==Ft){var i=t.originalEvent,o=i.charCode;if(this.condition_(t)&&(o=="+".charCodeAt(0)||o=="-".charCodeAt(0))){var n=t.map,r=o=="+".charCodeAt(0)?this.delta_:-this.delta_;iu(n.getView(),r,void 0,this.duration_),i.preventDefault(),e=!0}}return!e},e}(ou),qu=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 o=this.points_[e+2]-this.points_[i+2];if(o<1e3/60)return!1;var n=this.points_[e]-this.points_[i],r=this.points_[e+1]-this.points_[i+1];return this.angle_=Math.atan2(r,n),this.initialVelocity_=Math.sqrt(n*n+r*r)/o,this.initialVelocity_>this.minVelocity_},t.prototype.getDistance=function(){return(this.minVelocity_-this.initialVelocity_)/this.decay_},t.prototype.getAngle=function(){return this.angle_},t}(),Wu=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 o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}(),Vu="trackpad",Uu="wheel",Xu=function(t){function e(e){var i=this,o=e||{};(i=t.call(this,o)||this).totalDelta_=0,i.lastDelta_=0,i.maxDelta_=void 0!==o.maxDelta?o.maxDelta:1,i.duration_=void 0!==o.duration?o.duration:250,i.timeout_=void 0!==o.timeout?o.timeout:80,i.useAnchor_=void 0===o.useAnchor||o.useAnchor,i.constrainResolution_=void 0!==o.constrainResolution&&o.constrainResolution;var n=o.condition?o.condition:hu;return i.condition_=o.onFocusOnly?uu(du,n):n,i.lastAnchor_=null,i.startTime_=void 0,i.timeoutId_,i.mode_=void 0,i.trackpadEventGap_=400,i.trackpadTimeoutId_,i.deltaPerZoom_=300,i}return Wu(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!==Lt)return!0;var e,i=t.map,o=t.originalEvent;if(o.preventDefault(),this.useAnchor_&&(this.lastAnchor_=t.coordinate),t.type==Lt&&(e=o.deltaY,ee&&o.deltaMode===WheelEvent.DOM_DELTA_PIXEL&&(e/=ne),o.deltaMode===WheelEvent.DOM_DELTA_LINE&&(e*=40)),0===e)return!1;this.lastDelta_=e;var n=Date.now();void 0===this.startTime_&&(this.startTime_=n),(!this.mode_||n-this.startTime_>this.trackpadEventGap_)&&(this.mode_=Math.abs(e)<4?Vu:Uu);var r=i.getView();if(this.mode_===Vu&&!r.getConstrainResolution()&&!this.constrainResolution_)return this.trackpadTimeoutId_?clearTimeout(this.trackpadTimeoutId_):(r.getAnimating()&&r.cancelAnimations(),r.beginInteraction()),this.trackpadTimeoutId_=setTimeout(this.endInteraction_.bind(this),this.timeout_),r.adjustZoom(-e/this.deltaPerZoom_,this.lastAnchor_),this.startTime_=n,!1;this.totalDelta_+=e;var a=Math.max(this.timeout_-(n-this.startTime_),0);return clearTimeout(this.timeoutId_),this.timeoutId_=setTimeout(this.handleWheelZoom_.bind(this,i),a),!1},e.prototype.handleWheelZoom_=function(t){var e=t.getView();e.getAnimating()&&e.cancelAnimations();var i=-Ie(this.totalDelta_,-this.maxDelta_*this.deltaPerZoom_,this.maxDelta_*this.deltaPerZoom_)/this.deltaPerZoom_;(e.getConstrainResolution()||this.constrainResolution_)&&(i=i?i>0?1:-1:0),iu(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}(ou),Ku=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 o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}(),Yu=function(t){function e(e){var i=this,o=e||{},n=o;return n.stopDown||(n.stopDown=yt),(i=t.call(this,n)||this).anchor_=null,i.lastAngle_=void 0,i.rotating_=!1,i.rotationDelta_=0,i.threshold_=void 0!==o.threshold?o.threshold:.3,i.duration_=void 0!==o.duration?o.duration:250,i}return Ku(e,t),e.prototype.handleDragEvent=function(t){var e=0,i=this.targetPointers[0],o=this.targetPointers[1],n=Math.atan2(o.clientY-i.clientY,o.clientX-i.clientX);if(void 0!==this.lastAngle_){var r=n-this.lastAngle_;this.rotationDelta_+=r,!this.rotating_&&Math.abs(this.rotationDelta_)>this.threshold_&&(this.rotating_=!0),e=r}this.lastAngle_=n;var a=t.map,s=a.getView();if(s.getConstraints().rotation!==Vr){var l=a.getViewport().getBoundingClientRect(),u=su(this.targetPointers);u[0]-=l.left,u[1]-=l.top,this.anchor_=a.getCoordinateFromPixelInternal(u),this.rotating_&&(a.render(),s.adjustRotationInternal(e,this.anchor_))}},e.prototype.handleUpEvent=function(t){return!(this.targetPointers.length<2)||(t.map.getView().endInteraction(this.duration_),!1)},e.prototype.handleDownEvent=function(t){if(this.targetPointers.length>=2){var e=t.map;return this.anchor_=null,this.lastAngle_=void 0,this.rotating_=!1,this.rotationDelta_=0,this.handlingDownUpSequence||e.getView().beginInteraction(),!0}return!1},e}(lu),Zu=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 o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}(),$u=function(t){function e(e){var i=this,o=e||{},n=o;return n.stopDown||(n.stopDown=yt),(i=t.call(this,n)||this).anchor_=null,i.duration_=void 0!==o.duration?o.duration:400,i.lastDistance_=void 0,i.lastScaleDelta_=1,i}return Zu(e,t),e.prototype.handleDragEvent=function(t){var e=1,i=this.targetPointers[0],o=this.targetPointers[1],n=i.clientX-o.clientX,r=i.clientY-o.clientY,a=Math.sqrt(n*n+r*r);void 0!==this.lastDistance_&&(e=this.lastDistance_/a),this.lastDistance_=a;var s=t.map,l=s.getView();1!=e&&(this.lastScaleDelta_=e);var u=s.getViewport().getBoundingClientRect(),p=su(this.targetPointers);p[0]-=u.left,p[1]-=u.top,this.anchor_=s.getCoordinateFromPixelInternal(p),s.render(),l.adjustResolutionInternal(e,this.anchor_)},e.prototype.handleUpEvent=function(t){if(this.targetPointers.length<2){var e=t.map.getView(),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}(lu),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 o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}(),Ju=function(t){function e(e,i,o){var n=t.call(this)||this;if(void 0!==o&&void 0===i)n.setFlatCoordinates(o,e);else{var r=i||0;n.setCenterAndRadius(e,r,o)}return n}return Hu(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,o){var n=this.flatCoordinates,r=t-n[0],a=e-n[1],s=r*r+a*a;if(s<o){if(0===s)for(var l=0;l<this.stride;++l)i[l]=n[l];else{var u=this.getRadius()/Math.sqrt(s);i[0]=n[0]+u*r,i[1]=n[1]+u*a;for(l=2;l<this.stride;++l)i[l]=n[l]}return i.length=this.stride,s}return o},e.prototype.containsXY=function(t,e){var i=this.flatCoordinates,o=t-i[0],n=e-i[1];return o*o+n*n<=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 no(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 Do},e.prototype.intersectsExtent=function(t){if(zo(t,this.getExtent())){var e=this.getCenter();return t[0]<=e[0]&&t[2]>=e[0]||(t[1]<=e[1]&&t[3]>=e[1]||fo(t,this.intersectsCoordinate.bind(this)))}return!1},e.prototype.setCenter=function(t){var e=this.stride,i=this.flatCoordinates[e]-this.flatCoordinates[0],o=t.slice();o[e]=o[0]+i;for(var n=1;n<e;++n)o[e+n]=t[n];this.setFlatCoordinates(this.layout,o),this.changed()},e.prototype.setCenterAndRadius=function(t,e,i){this.setLayout(i,t,0),this.flatCoordinates||(this.flatCoordinates=[]);var o=this.flatCoordinates,n=pa(o,0,t,this.stride);o[n++]=o[0]+e;for(var r=1,a=this.stride;r<a;++r)o[n++]=o[r];o.length=n,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(),o=this.getStride();this.setCenter(Hr(i,0,i.length,o,t,e,i)),this.changed()},e.prototype.translate=function(t,e){var i=this.getCenter(),o=this.getStride();this.setCenter(Jr(i,0,i.length,o,t,e,i)),this.changed()},e}(na);Ju.prototype.transform;var Qu=Ju;function tp(t,e,i,o,n){ep(t,e,i||0,o||t.length-1,n||op)}function ep(t,e,i,o,n){for(;o>i;){if(o-i>600){var r=o-i+1,a=e-i+1,s=Math.log(r),l=.5*Math.exp(2*s/3),u=.5*Math.sqrt(s*l*(r-l)/r)*(a-r/2<0?-1:1);ep(t,e,Math.max(i,Math.floor(e-a*l/r+u)),Math.min(o,Math.floor(e+(r-a)*l/r+u)),n)}var p=t[e],d=i,h=o;for(ip(t,i,e),n(t[o],p)>0&&ip(t,i,o);d<h;){for(ip(t,d,h),d++,h--;n(t[d],p)<0;)d++;for(;n(t[h],p)>0;)h--}0===n(t[i],p)?ip(t,i,h):ip(t,++h,o),h<=e&&(i=h+1),e<=h&&(o=h-1)}}function ip(t,e,i){var o=t[e];t[e]=t[i],t[i]=o}function op(t,e){return t<e?-1:t>e?1:0}class np{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(!gp(t,e))return i;const o=this.toBBox,n=[];for(;e;){for(let r=0;r<e.children.length;r++){const a=e.children[r],s=e.leaf?o(a):a;gp(t,s)&&(e.leaf?i.push(a):fp(t,s)?this._all(a,i):n.push(a))}e=n.pop()}return i}collides(t){let e=this.data;if(!gp(t,e))return!1;const i=[];for(;e;){for(let o=0;o<e.children.length;o++){const n=e.children[o],r=e.leaf?this.toBBox(n):n;if(gp(t,r)){if(e.leaf||fp(t,r))return!0;i.push(n)}}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=mp([]),this}remove(t,e){if(!t)return this;let i=this.data;const o=this.toBBox(t),n=[],r=[];let a,s,l;for(;i||n.length;){if(i||(i=n.pop(),s=n[n.length-1],a=r.pop(),l=!0),i.leaf){const o=rp(t,i.children,e);if(-1!==o)return i.children.splice(o,1),n.push(i),this._condense(n),this}l||i.leaf||!fp(i,o)?s?(a++,i=s.children[a],l=!1):i=null:(n.push(i),r.push(a),a=0,s=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,o){const n=i-e+1;let r,a=this._maxEntries;if(n<=a)return r=mp(t.slice(e,i+1)),ap(r,this.toBBox),r;o||(o=Math.ceil(Math.log(n)/Math.log(a)),a=Math.ceil(n/Math.pow(a,o-1))),r=mp([]),r.leaf=!1,r.height=o;const s=Math.ceil(n/a),l=s*Math.ceil(Math.sqrt(a));vp(t,e,i,l,this.compareMinX);for(let u=e;u<=i;u+=l){const e=Math.min(u+l-1,i);vp(t,u,e,s,this.compareMinY);for(let i=u;i<=e;i+=s){const n=Math.min(i+s-1,e);r.children.push(this._build(t,i,n,o-1))}}return ap(r,this.toBBox),r}_chooseSubtree(t,e,i,o){for(;o.push(e),!e.leaf&&o.length-1!==i;){let i,o=1/0,a=1/0;for(let s=0;s<e.children.length;s++){const l=e.children[s],u=dp(l),p=(n=t,r=l,(Math.max(r.maxX,n.maxX)-Math.min(r.minX,n.minX))*(Math.max(r.maxY,n.maxY)-Math.min(r.minY,n.minY))-u);p<a?(a=p,o=u<o?u:o,i=l):p===a&&u<o&&(o=u,i=l)}e=i||e.children[0]}var n,r;return e}_insert(t,e,i){const o=i?t:this.toBBox(t),n=[],r=this._chooseSubtree(o,this.data,e,n);for(r.children.push(t),lp(r,o);e>=0&&n[e].children.length>this._maxEntries;)this._split(n,e),e--;this._adjustParentBBoxes(o,n,e)}_split(t,e){const i=t[e],o=i.children.length,n=this._minEntries;this._chooseSplitAxis(i,n,o);const r=this._chooseSplitIndex(i,n,o),a=mp(i.children.splice(r,i.children.length-r));a.height=i.height,a.leaf=i.leaf,ap(i,this.toBBox),ap(a,this.toBBox),e?t[e-1].children.push(a):this._splitRoot(i,a)}_splitRoot(t,e){this.data=mp([t,e]),this.data.height=t.height+1,this.data.leaf=!1,ap(this.data,this.toBBox)}_chooseSplitIndex(t,e,i){let o,n=1/0,r=1/0;for(let a=e;a<=i-e;a++){const e=sp(t,0,a,this.toBBox),s=sp(t,a,i,this.toBBox),l=cp(e,s),u=dp(e)+dp(s);l<n?(n=l,o=a,r=u<r?u:r):l===n&&u<r&&(r=u,o=a)}return o||i-e}_chooseSplitAxis(t,e,i){const o=t.leaf?this.compareMinX:up,n=t.leaf?this.compareMinY:pp;this._allDistMargin(t,e,i,o)<this._allDistMargin(t,e,i,n)&&t.children.sort(o)}_allDistMargin(t,e,i,o){t.children.sort(o);const n=this.toBBox,r=sp(t,0,e,n),a=sp(t,i-e,i,n);let s=hp(r)+hp(a);for(let l=e;l<i-e;l++){const e=t.children[l];lp(r,t.leaf?n(e):e),s+=hp(r)}for(let l=i-e-1;l>=e;l--){const e=t.children[l];lp(a,t.leaf?n(e):e),s+=hp(a)}return s}_adjustParentBBoxes(t,e,i){for(let o=i;o>=0;o--)lp(e[o],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():ap(t[i],this.toBBox)}}function rp(t,e,i){if(!i)return e.indexOf(t);for(let o=0;o<e.length;o++)if(i(t,e[o]))return o;return-1}function ap(t,e){sp(t,0,t.children.length,e,t)}function sp(t,e,i,o,n){n||(n=mp(null)),n.minX=1/0,n.minY=1/0,n.maxX=-1/0,n.maxY=-1/0;for(let r=e;r<i;r++){const e=t.children[r];lp(n,t.leaf?o(e):e)}return n}function lp(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 up(t,e){return t.minX-e.minX}function pp(t,e){return t.minY-e.minY}function dp(t){return(t.maxX-t.minX)*(t.maxY-t.minY)}function hp(t){return t.maxX-t.minX+(t.maxY-t.minY)}function cp(t,e){const i=Math.max(t.minX,e.minX),o=Math.max(t.minY,e.minY),n=Math.min(t.maxX,e.maxX),r=Math.min(t.maxY,e.maxY);return Math.max(0,n-i)*Math.max(0,r-o)}function fp(t,e){return t.minX<=e.minX&&t.minY<=e.minY&&e.maxX<=t.maxX&&e.maxY<=t.maxY}function gp(t,e){return e.minX<=t.maxX&&e.minY<=t.maxY&&e.maxX>=t.minX&&e.maxY>=t.minY}function mp(t){return{children:t,height:1,leaf:!0,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}}function vp(t,e,i,o,n){const r=[e,i];for(;r.length;){if((i=r.pop())-(e=r.pop())<=o)continue;const a=e+Math.ceil((i-e)/o/2)*o;tp(t,a,e,i,n),r.push(e,a,a,i)}}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 o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}(),_p="renderOrder",bp=function(t){function e(e){var i=this,o=e||{},n=bt({},o);return delete n.style,delete n.renderBuffer,delete n.updateWhileAnimating,delete n.updateWhileInteracting,(i=t.call(this,n)||this).declutter_=void 0!==o.declutter&&o.declutter,i.renderBuffer_=void 0!==o.renderBuffer?o.renderBuffer:100,i.style_=null,i.styleFunction_=void 0,i.setStyle(o.style),i.updateWhileAnimating_=void 0!==o.updateWhileAnimating&&o.updateWhileAnimating,i.updateWhileInteracting_=void 0!==o.updateWhileInteracting&&o.updateWhileInteracting,i}return yp(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(_p)},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 np(9)),this.getRenderer().renderDeclutter(t)},e.prototype.setRenderOrder=function(t){this.set(_p,t)},e.prototype.setStyle=function(t){this.style_=void 0!==t?t:gl,this.styleFunction_=null===t?void 0:function(t){var e;if("function"==typeof t)e=t;else{var i;Array.isArray(t)?i=t:(Re("function"==typeof t.getZIndex,41),i=[t]),e=function(){return i}}return e}(this.style_),this.changed()},e}(Je),xp={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},kp=[xp.FILL],wp=[xp.STROKE],Sp=[xp.BEGIN_PATH],Cp=[xp.CLOSE_PATH],zp=xp,Tp=function(){function t(){}return t.prototype.drawCustom=function(t,e,i,o){},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}(),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 o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}(),Pp=function(t){function e(e,i,o,n){var r=t.call(this)||this;return r.tolerance=e,r.maxExtent=i,r.pixelRatio=n,r.maxLineWidth=0,r.resolution=o,r.beginGeometryInstruction1_=null,r.beginGeometryInstruction2_=null,r.bufferedMaxExtent_=null,r.instructions=[],r.coordinates=[],r.tmpCoordinate_=[],r.hitDetectionInstructions=[],r.state={},r}return Ep(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(),o=this.tmpCoordinate_,n=this.coordinates,r=n.length,a=0,s=t.length;a<s;a+=e)o[0]=t[a],o[1]=t[a+1],Qi(i,o)&&(n[r++]=o[0],n[r++]=o[1]);return r},e.prototype.appendFlatLineCoordinates=function(t,e,i,o,n,r){var a=this.coordinates,s=a.length,l=this.getBufferedMaxExtent();r&&(e+=o);var u,p,d,h=t[e],c=t[e+1],f=this.tmpCoordinate_,g=!0;for(u=e+o;u<i;u+=o)f[0]=t[u],f[1]=t[u+1],(d=io(l,f))!==p?(g&&(a[s++]=h,a[s++]=c,g=!1),a[s++]=f[0],a[s++]=f[1]):d===Vi?(a[s++]=f[0],a[s++]=f[1],g=!1):g=!0,h=f[0],c=f[1],p=d;return(n&&g||u===e+o)&&(a[s++]=h,a[s++]=c),s},e.prototype.drawCustomCoordinates_=function(t,e,i,o,n){for(var r=0,a=i.length;r<a;++r){var s=i[r],l=this.appendFlatLineCoordinates(t,e,s,o,!1,!1);n.push(l),e=s}return e},e.prototype.drawCustom=function(t,e,i,o){this.beginGeometry(t,e);var n,r,a,s,l,u=t.getType(),p=t.getStride(),d=this.coordinates.length;switch(u){case Mo:n=t.getOrientedFlatCoordinates(),s=[];var h=t.getEndss();l=0;for(var c=0,f=h.length;c<f;++c){var g=[];l=this.drawCustomCoordinates_(n,l,h[c],p,g),s.push(g)}this.instructions.push([zp.CUSTOM,d,s,t,i,_a]),this.hitDetectionInstructions.push([zp.CUSTOM,d,s,t,o||i,_a]);break;case Ro:case Fo:a=[],n=u==Ro?t.getOrientedFlatCoordinates():t.getFlatCoordinates(),l=this.drawCustomCoordinates_(n,0,t.getEnds(),p,a),this.instructions.push([zp.CUSTOM,d,a,t,i,ya]),this.hitDetectionInstructions.push([zp.CUSTOM,d,a,t,o||i,ya]);break;case Oo:case Do:n=t.getFlatCoordinates(),r=this.appendFlatLineCoordinates(n,0,n.length,p,!1,!1),this.instructions.push([zp.CUSTOM,d,r,t,i,va]),this.hitDetectionInstructions.push([zp.CUSTOM,d,r,t,o||i,va]);break;case Io:n=t.getFlatCoordinates(),(r=this.appendFlatPointCoordinates(n,p))>d&&(this.instructions.push([zp.CUSTOM,d,r,t,i,va]),this.hitDetectionInstructions.push([zp.CUSTOM,d,r,t,o||i,va]));break;case Po:n=t.getFlatCoordinates(),this.coordinates.push(n[0],n[1]),r=this.coordinates.length,this.instructions.push([zp.CUSTOM,d,r,t,i]),this.hitDetectionInstructions.push([zp.CUSTOM,d,r,t,o||i])}this.endGeometry(e)},e.prototype.beginGeometry=function(t,e){this.beginGeometryInstruction1_=[zp.BEGIN_GEOMETRY,e,0,t],this.instructions.push(this.beginGeometryInstruction1_),this.beginGeometryInstruction2_=[zp.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,o,n=e.length,r=-1;for(t=0;t<n;++t)(o=(i=e[t])[0])==zp.END_GEOMETRY?r=t:o==zp.BEGIN_GEOMETRY&&(i[2]=t,ft(this.hitDetectionInstructions,r,t),r=-1)},e.prototype.setFillStrokeStyle=function(t,e){var i=this.state;if(t){var o=t.getColor();i.fillStyle=ll(o||qn)}else i.fillStyle=void 0;if(e){var n=e.getColor();i.strokeStyle=ll(n||Xn);var r=e.getLineCap();i.lineCap=void 0!==r?r:Wn;var a=e.getLineDash();i.lineDash=a?a.slice():Vn;var s=e.getLineDashOffset();i.lineDashOffset=s||0;var l=e.getLineJoin();i.lineJoin=void 0!==l?l:Un;var u=e.getWidth();i.lineWidth=void 0!==u?u:1;var p=e.getMiterLimit();i.miterLimit=void 0!==p?p: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=[zp.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[zp.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,o=t.lineCap,n=t.lineDash,r=t.lineDashOffset,a=t.lineJoin,s=t.lineWidth,l=t.miterLimit;(t.currentStrokeStyle!=i||t.currentLineCap!=o||n!=t.currentLineDash&&!mt(t.currentLineDash,n)||t.currentLineDashOffset!=r||t.currentLineJoin!=a||t.currentLineWidth!=s||t.currentMiterLimit!=l)&&(void 0!==i&&e.call(this,t),t.currentStrokeStyle=i,t.currentLineCap=o,t.currentLineDash=n,t.currentLineDashOffset=r,t.currentLineJoin=a,t.currentLineWidth=s,t.currentMiterLimit=l)},e.prototype.endGeometry=function(t){this.beginGeometryInstruction1_[2]=this.instructions.length,this.beginGeometryInstruction1_=null,this.beginGeometryInstruction2_[2]=this.hitDetectionInstructions.length,this.beginGeometryInstruction2_=null;var e=[zp.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;$i(this.bufferedMaxExtent_,t,this.bufferedMaxExtent_)}return this.bufferedMaxExtent_},e}(Tp),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 o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}(),jp=function(t){function e(e,i,o,n){var r=t.call(this,e,i,o,n)||this;return r.hitDetectionImage_=null,r.image_=null,r.imagePixelRatio_=void 0,r.anchorX_=void 0,r.anchorY_=void 0,r.height_=void 0,r.opacity_=void 0,r.originX_=void 0,r.originY_=void 0,r.rotateWithView_=void 0,r.rotation_=void 0,r.scale_=void 0,r.width_=void 0,r.declutterImageWithText_=void 0,r}return Op(e,t),e.prototype.drawPoint=function(t,e){if(this.image_){this.beginGeometry(t,e);var i=t.getFlatCoordinates(),o=t.getStride(),n=this.coordinates.length,r=this.appendFlatPointCoordinates(i,o);this.instructions.push([zp.DRAW_IMAGE,n,r,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([zp.DRAW_IMAGE,n,r,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(),o=t.getStride(),n=this.coordinates.length,r=this.appendFlatPointCoordinates(i,o);this.instructions.push([zp.DRAW_IMAGE,n,r,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([zp.DRAW_IMAGE,n,r,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(),o=t.getSize(),n=t.getHitDetectionImage(),r=t.getImage(this.pixelRatio),a=t.getOrigin();this.imagePixelRatio_=t.getPixelRatio(this.pixelRatio),this.anchorX_=i[0],this.anchorY_=i[1],this.hitDetectionImage_=n,this.image_=r,this.height_=o[1],this.opacity_=t.getOpacity(),this.originX_=a[0]*this.imagePixelRatio_,this.originY_=a[1]*this.imagePixelRatio_,this.rotateWithView_=t.getRotateWithView(),this.rotation_=t.getRotation(),this.scale_=t.getScaleArray(),this.width_=o[0],this.declutterImageWithText_=e},e}(Pp),Rp=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 o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}(),Ip=function(t){function e(e,i,o,n){return t.call(this,e,i,o,n)||this}return Rp(e,t),e.prototype.drawFlatCoordinates_=function(t,e,i,o){var n=this.coordinates.length,r=this.appendFlatLineCoordinates(t,e,i,o,!1,!1),a=[zp.MOVE_TO_LINE_TO,n,r];return this.instructions.push(a),this.hitDetectionInstructions.push(a),i},e.prototype.drawLineString=function(t,e){var i=this.state,o=i.strokeStyle,n=i.lineWidth;if(void 0!==o&&void 0!==n){this.updateStrokeStyle(i,this.applyStroke),this.beginGeometry(t,e),this.hitDetectionInstructions.push([zp.SET_STROKE_STYLE,i.strokeStyle,i.lineWidth,i.lineCap,i.lineJoin,i.miterLimit,Vn,0],Sp);var r=t.getFlatCoordinates(),a=t.getStride();this.drawFlatCoordinates_(r,0,r.length,a),this.hitDetectionInstructions.push(wp),this.endGeometry(e)}},e.prototype.drawMultiLineString=function(t,e){var i=this.state,o=i.strokeStyle,n=i.lineWidth;if(void 0!==o&&void 0!==n){this.updateStrokeStyle(i,this.applyStroke),this.beginGeometry(t,e),this.hitDetectionInstructions.push([zp.SET_STROKE_STYLE,i.strokeStyle,i.lineWidth,i.lineCap,i.lineJoin,i.miterLimit,i.lineDash,i.lineDashOffset],Sp);for(var r=t.getEnds(),a=t.getFlatCoordinates(),s=t.getStride(),l=0,u=0,p=r.length;u<p;++u)l=this.drawFlatCoordinates_(a,l,r[u],s);this.hitDetectionInstructions.push(wp),this.endGeometry(e)}},e.prototype.finish=function(){var e=this.state;return null!=e.lastStroke&&e.lastStroke!=this.coordinates.length&&this.instructions.push(wp),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(wp),e.lastStroke=this.coordinates.length),e.lastStroke=0,t.prototype.applyStroke.call(this,e),this.instructions.push(Sp)},e}(Pp),Fp=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 o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}(),Mp=function(t){function e(e,i,o,n){return t.call(this,e,i,o,n)||this}return Fp(e,t),e.prototype.drawFlatCoordinatess_=function(t,e,i,o){var n=this.state,r=void 0!==n.fillStyle,a=void 0!==n.strokeStyle,s=i.length;this.instructions.push(Sp),this.hitDetectionInstructions.push(Sp);for(var l=0;l<s;++l){var u=i[l],p=this.coordinates.length,d=this.appendFlatLineCoordinates(t,e,u,o,!0,!a),h=[zp.MOVE_TO_LINE_TO,p,d];this.instructions.push(h),this.hitDetectionInstructions.push(h),a&&(this.instructions.push(Cp),this.hitDetectionInstructions.push(Cp)),e=u}return r&&(this.instructions.push(kp),this.hitDetectionInstructions.push(kp)),a&&(this.instructions.push(wp),this.hitDetectionInstructions.push(wp)),e},e.prototype.drawCircle=function(t,e){var i=this.state,o=i.fillStyle,n=i.strokeStyle;if(void 0!==o||void 0!==n){this.setFillStrokeStyles_(),this.beginGeometry(t,e),void 0!==i.fillStyle&&this.hitDetectionInstructions.push([zp.SET_FILL_STYLE,qn]),void 0!==i.strokeStyle&&this.hitDetectionInstructions.push([zp.SET_STROKE_STYLE,i.strokeStyle,i.lineWidth,i.lineCap,i.lineJoin,i.miterLimit,i.lineDash,i.lineDashOffset]);var r=t.getFlatCoordinates(),a=t.getStride(),s=this.coordinates.length;this.appendFlatLineCoordinates(r,0,r.length,a,!1,!1);var l=[zp.CIRCLE,s];this.instructions.push(Sp,l),this.hitDetectionInstructions.push(Sp,l),void 0!==i.fillStyle&&(this.instructions.push(kp),this.hitDetectionInstructions.push(kp)),void 0!==i.strokeStyle&&(this.instructions.push(wp),this.hitDetectionInstructions.push(wp)),this.endGeometry(e)}},e.prototype.drawPolygon=function(t,e){var i=this.state,o=i.fillStyle,n=i.strokeStyle;if(void 0!==o||void 0!==n){this.setFillStrokeStyles_(),this.beginGeometry(t,e),void 0!==i.fillStyle&&this.hitDetectionInstructions.push([zp.SET_FILL_STYLE,qn]),void 0!==i.strokeStyle&&this.hitDetectionInstructions.push([zp.SET_STROKE_STYLE,i.strokeStyle,i.lineWidth,i.lineCap,i.lineJoin,i.miterLimit,i.lineDash,i.lineDashOffset]);var r=t.getEnds(),a=t.getOrientedFlatCoordinates(),s=t.getStride();this.drawFlatCoordinatess_(a,0,r,s),this.endGeometry(e)}},e.prototype.drawMultiPolygon=function(t,e){var i=this.state,o=i.fillStyle,n=i.strokeStyle;if(void 0!==o||void 0!==n){this.setFillStrokeStyles_(),this.beginGeometry(t,e),void 0!==i.fillStyle&&this.hitDetectionInstructions.push([zp.SET_FILL_STYLE,qn]),void 0!==i.strokeStyle&&this.hitDetectionInstructions.push([zp.SET_STROKE_STYLE,i.strokeStyle,i.lineWidth,i.lineCap,i.lineJoin,i.miterLimit,i.lineDash,i.lineDashOffset]);for(var r=t.getEndss(),a=t.getOrientedFlatCoordinates(),s=t.getStride(),l=0,u=0,p=r.length;u<p;++u)l=this.drawFlatCoordinatess_(a,l,r[u],s);this.endGeometry(e)}},e.prototype.finish=function(){this.reverseHitDetectionInstructions(),this.state=null;var e=this.tolerance;if(0!==e)for(var i=this.coordinates,o=0,n=i.length;o<n;++o)i[o]=fa(i[o],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}(Pp);function Ap(t,e,i,o,n){var r,a,s,l,u,p,d,h,c,f=i,g=i,m=0,v=0,y=i;for(r=i;r<o;r+=n){var _=e[r],b=e[r+1];void 0!==l&&(h=_-l,c=b-u,s=Math.sqrt(h*h+c*c),void 0!==p&&(v+=a,Math.acos((p*h+d*c)/(a*s))>t&&(v>m&&(m=v,f=y,g=r),v=0,y=r-n)),a=s,p=h,d=c),l=_,u=b}return(v+=s)>m?[y,r]:[f,g]}var 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 o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}(),Lp={left:0,end:0,center:.5,right:1,start:1,top:0,middle:.5,hanging:.2,alphabetic:.8,ideographic:.8,bottom:1},Gp={Circle:Mp,Default:Pp,Image:jp,LineString:Ip,Polygon:Mp,Text:function(t){function e(e,i,o,n){var r=t.call(this,e,i,o,n)||this;return r.labels_=null,r.text_="",r.textOffsetX_=0,r.textOffsetY_=0,r.textRotateWithView_=void 0,r.textRotation_=0,r.textFillState_=null,r.fillStates={},r.textStrokeState_=null,r.strokeStates={},r.textState_={},r.textStates={},r.textKey_="",r.fillKey_="",r.strokeKey_="",r.declutterImageWithText_=void 0,r}return Dp(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_,o=this.textStrokeState_,n=this.textState_;if(""!==this.text_&&n&&(i||o)){var r=this.coordinates,a=r.length,s=t.getType(),l=null,u=t.getStride();if(n.placement!==bl||s!=Oo&&s!=Fo&&s!=Ro&&s!=Mo){var p=n.overflow?null:[];switch(s){case Po:case Io:l=t.getFlatCoordinates();break;case Oo:l=t.getFlatMidpoint();break;case Do:l=t.getCenter();break;case Fo:l=t.getFlatMidpoints(),u=2;break;case Ro:l=t.getFlatInteriorPoint(),n.overflow||p.push(l[2]/this.resolution),u=3;break;case Mo:var d=t.getFlatInteriorPoints();l=[];for(k=0,w=d.length;k<w;k+=3)n.overflow||p.push(d[k+2]/this.resolution),l.push(d[k],d[k+1]);if(0===l.length)return;u=2}if((O=this.appendFlatPointCoordinates(l,u))===a)return;if(p&&(O-a)/2!=l.length/u){var h=a/2;p=p.filter((function(t,e){var i=r[2*(h+e)]===l[e*u]&&r[2*(h+e)+1]===l[e*u+1];return i||--h,i}))}this.saveTextStates_(),(n.backgroundFill||n.backgroundStroke)&&(this.setFillStrokeStyle(n.backgroundFill,n.backgroundStroke),n.backgroundFill&&(this.updateFillStyle(this.state,this.createFill),this.hitDetectionInstructions.push(this.createFill(this.state))),n.backgroundStroke&&(this.updateStrokeStyle(this.state,this.applyStroke),this.hitDetectionInstructions.push(this.createStroke(this.state)))),this.beginGeometry(t,e);var c=n.padding;if(c!=Zn&&(n.scale[0]<0||n.scale[1]<0)){var f=n.padding[0],g=n.padding[1],m=n.padding[2],v=n.padding[3];n.scale[0]<0&&(g=-g,v=-v),n.scale[1]<0&&(f=-f,m=-m),c=[f,g,m,v]}var y=this.pixelRatio;this.instructions.push([zp.DRAW_IMAGE,a,O,null,NaN,NaN,NaN,1,0,0,this.textRotateWithView_,this.textRotation_,[1,1],NaN,this.declutterImageWithText_,c==Zn?Zn:c.map((function(t){return t*y})),!!n.backgroundFill,!!n.backgroundStroke,this.text_,this.textKey_,this.strokeKey_,this.fillKey_,this.textOffsetX_,this.textOffsetY_,p]);var _=1/y;this.hitDetectionInstructions.push([zp.DRAW_IMAGE,a,O,null,NaN,NaN,NaN,1,0,0,this.textRotateWithView_,this.textRotation_,[_,_],NaN,this.declutterImageWithText_,c,!!n.backgroundFill,!!n.backgroundStroke,this.text_,this.textKey_,this.strokeKey_,this.fillKey_,this.textOffsetX_,this.textOffsetY_,p]),this.endGeometry(e)}else{if(!zo(this.getBufferedMaxExtent(),t.getExtent()))return;var b=void 0;if(l=t.getFlatCoordinates(),s==Oo)b=[l.length];else if(s==Fo)b=t.getEnds();else if(s==Ro)b=t.getEnds().slice(0,1);else if(s==Mo){var x=t.getEndss();b=[];for(var k=0,w=x.length;k<w;++k)b.push(x[k][0])}this.beginGeometry(t,e);for(var S=n.textAlign,C=0,z=void 0,T=0,E=b.length;T<E;++T){if(null==S){var P=Ap(n.maxAngle,l,C,b[T],u);C=P[0],z=P[1]}else z=b[T];for(var k=C;k<z;k+=u)r.push(l[k],l[k+1]);var O=r.length;C=b[T],this.drawChars_(a,O),a=O}this.endGeometry(e)}}},e.prototype.saveTextStates_=function(){var t=this.textStrokeState_,e=this.textState_,i=this.textFillState_,o=this.strokeKey_;t&&(o in this.strokeStates||(this.strokeStates[o]={strokeStyle:t.strokeStyle,lineCap:t.lineCap,lineDashOffset:t.lineDashOffset,lineWidth:t.lineWidth,lineJoin:t.lineJoin,miterLimit:t.miterLimit,lineDash:t.lineDash}));var n=this.textKey_;n in this.textStates||(this.textStates[n]={font:e.font,textAlign:e.textAlign||Kn,textBaseline:e.textBaseline||Yn,scale:e.scale});var r=this.fillKey_;i&&(r in this.fillStates||(this.fillStates[r]={fillStyle:i.fillStyle}))},e.prototype.drawChars_=function(t,e){var i=this.textStrokeState_,o=this.textState_,n=this.strokeKey_,r=this.textKey_,a=this.fillKey_;this.saveTextStates_();var s=this.pixelRatio,l=Lp[o.textBaseline],u=this.textOffsetY_*s,p=this.text_,d=i?i.lineWidth*Math.abs(o.scale[0])/2:0;this.instructions.push([zp.DRAW_CHARS,t,e,l,o.overflow,a,o.maxAngle,s,u,n,d*s,p,r,1]),this.hitDetectionInstructions.push([zp.DRAW_CHARS,t,e,l,o.overflow,a,o.maxAngle,1,u,n,d,p,r,1/s])},e.prototype.setTextStyle=function(t,e){var i,o,n;if(t){var r=t.getFill();r?((o=this.textFillState_)||(o={},this.textFillState_=o),o.fillStyle=ll(r.getColor()||qn)):(o=null,this.textFillState_=o);var a=t.getStroke();if(a){(n=this.textStrokeState_)||(n={},this.textStrokeState_=n);var s=a.getLineDash(),l=a.getLineDashOffset(),u=a.getWidth(),p=a.getMiterLimit();n.lineCap=a.getLineCap()||Wn,n.lineDash=s?s.slice():Vn,n.lineDashOffset=void 0===l?0:l,n.lineJoin=a.getLineJoin()||Un,n.lineWidth=void 0===u?1:u,n.miterLimit=void 0===p?10:p,n.strokeStyle=ll(a.getColor()||Xn)}else n=null,this.textStrokeState_=n;i=this.textState_;var d=t.getFont()||Bn;ir(d);var h=t.getScaleArray();i.overflow=t.getOverflow(),i.font=d,i.maxAngle=t.getMaxAngle(),i.placement=t.getPlacement(),i.textAlign=t.getTextAlign(),i.textBaseline=t.getTextBaseline()||Yn,i.backgroundFill=t.getBackgroundFill(),i.backgroundStroke=t.getBackgroundStroke(),i.padding=t.getPadding()||Zn,i.scale=void 0===h?[1,1]:h;var c=t.getOffsetX(),f=t.getOffsetY(),g=t.getRotateWithView(),m=t.getRotation();this.text_=t.getText()||"",this.textOffsetX_=void 0===c?0:c,this.textOffsetY_=void 0===f?0:f,this.textRotateWithView_=void 0!==g&&g,this.textRotation_=void 0===m?0:m,this.strokeKey_=n?("string"==typeof n.strokeStyle?n.strokeStyle:Kt(n.strokeStyle))+n.lineCap+n.lineDashOffset+"|"+n.lineWidth+n.lineJoin+n.miterLimit+"["+n.lineDash.join()+"]":"",this.textKey_=i.font+i.scale+(i.textAlign||"?")+(i.textBaseline||"?"),this.fillKey_=o?"string"==typeof o.fillStyle?o.fillStyle:"|"+Kt(o.fillStyle):""}else this.text_="";this.declutterImageWithText_=e},e}(Pp)},Np=function(){function t(t,e,i,o){this.tolerance_=t,this.maxExtent_=e,this.pixelRatio_=o,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 o in i){var n=i[o].finish();t[e][o]=n}}return t},t.prototype.getBuilder=function(t,e){var i=void 0!==t?t.toString():"0",o=this.buildersByZIndex_[i];void 0===o&&(o={},this.buildersByZIndex_[i]=o);var n=o[e];void 0===n&&(n=new(0,Gp[e])(this.tolerance_,this.maxExtent_,this.resolution_,this.pixelRatio_),o[e]=n);return n},t}(),Bp=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 o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}(),qp=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 Bp(e,t),e.prototype.getFeatures=function(t){return Ut()},e.prototype.prepareFrame=function(t){return Ut()},e.prototype.renderFrame=function(t,e){return Ut()},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(o,n){var r=this.loadedTileCallback.bind(this,i,o);return t.forEachLoadedTile(e,o,n,r)}.bind(this)},e.prototype.forEachFeatureAtCoordinate=function(t,e,i,o,n){},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()===Zs&&this.renderIfReadyAndVisible()},e.prototype.loadImage=function(t){var e=t.getState();return e!=Zs&&e!=$s&&t.addEventListener(Tt,this.boundHandleImageChange_),e==Ks&&(t.load(),e=t.getState()),e==Zs},e.prototype.renderIfReadyAndVisible=function(){var t=this.getLayer();t.getVisible()&&t.getSourceState()==Ze&&t.changed()},e}(Vt),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 o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}(),Vp=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 Wp(e,t),e.prototype.useContainer=function(t,e,i){var o,n,r=this.getLayer().getClassName();t&&t.style.opacity===be(i)&&t.className===r&&((s=t.firstElementChild)instanceof HTMLCanvasElement&&(n=s.getContext("2d")));if(n&&n.canvas.style.transform===e?(this.container=t,this.context=n,this.containerReused=!0):this.containerReused&&(this.container=null,this.context=null,this.containerReused=!1),!this.container){(o=document.createElement("div")).className=r;var a=o.style;a.position="absolute",a.width="100%",a.height="100%";var s=(n=le()).canvas;o.appendChild(s),(a=s.style).position="absolute",a.left="0",a.transformOrigin="top left",this.container=o,this.context=n}},e.prototype.clipUnrotated=function(t,e,i){var o=wo(i),n=So(i),r=vo(i),a=mo(i);bn(e.coordinateToPixelTransform,o),bn(e.coordinateToPixelTransform,n),bn(e.coordinateToPixelTransform,r),bn(e.coordinateToPixelTransform,a);var s=this.inversePixelTransform;bn(s,o),bn(s,n),bn(s,r),bn(s,a),t.save(),t.beginPath(),t.moveTo(Math.round(o[0]),Math.round(o[1])),t.lineTo(Math.round(n[0]),Math.round(n[1])),t.lineTo(Math.round(r[0]),Math.round(r[1])),t.lineTo(Math.round(a[0]),Math.round(a[1])),t.clip()},e.prototype.dispatchRenderEvent_=function(t,e,i){var o=this.getLayer();if(o.hasListener(t)){var n=new Nn(t,this.inversePixelTransform,i,e);o.dispatchEvent(n)}},e.prototype.preRender=function(t,e){this.dispatchRenderEvent_(We,t,e)},e.prototype.postRender=function(t,e){this.dispatchRenderEvent_(Ve,t,e)},e.prototype.getRenderTransform=function(t,e,i,o,n,r,a){var s=n/2,l=r/2,u=o/e,p=-u,d=-t[0]+a,h=-t[1];return kn(this.tempTransform,s,l,u,p,-i,d,h)},e.prototype.getDataAtPixel=function(t,e,i){var o,n=bn(this.inversePixelTransform,t.slice()),r=this.context,a=this.getLayer().getExtent();if(a&&!Qi(a,bn(e.pixelToCoordinateTransform,t.slice())))return null;try{var s=Math.round(n[0]),l=Math.round(n[1]),u=document.createElement("canvas"),p=u.getContext("2d");u.width=1,u.height=1,p.clearRect(0,0,1,1),p.drawImage(r.canvas,s,l,1,1,0,0,1,1),o=p.getImageData(0,0,1,1).data}catch(d){return"SecurityError"===d.name?new Uint8Array:o}return 0===o[3]?null:o},e}(qp),Up="Circle",Xp="Default",Kp="Image",Yp="LineString",Zp="Polygon",$p="Text";function Hp(t,e,i,o,n,r,a,s,l,u,p,d){var h=t[e],c=t[e+1],f=0,g=0,m=0,v=0;function y(){f=h,g=c,h=t[e+=o],c=t[e+1],v+=m,m=Math.sqrt((h-f)*(h-f)+(c-g)*(c-g))}do{y()}while(e<i-o&&v+m<r);for(var _=0===m?0:(r-v)/m,b=Ne(f,h,_),x=Ne(g,c,_),k=e-o,w=v,S=r+s*l(u,n,p);e<i-o&&v+m<S;)y();var C,z=Ne(f,h,_=0===m?0:(S-v)/m),T=Ne(g,c,_);if(d){var E=[b,x,z,T];Hr(E,0,4,2,d,E,E),C=E[0]>E[2]}else C=b>z;var P,O=Math.PI,j=[],R=k+o===e;if(m=0,v=w,h=t[e=k],c=t[e+1],R){y(),P=Math.atan2(c-g,h-f),C&&(P+=P>0?-O:O);var I=(z+b)/2,F=(T+x)/2;return j[0]=[I,F,(S-r)/2,P,n],j}for(var M=0,A=n.length;M<A;){y();var D=Math.atan2(c-g,h-f);if(C&&(D+=D>0?-O:O),void 0!==P){var L=D-P;if(L+=L>O?-2*O:L<-O?2*O:0,Math.abs(L)>a)return null}P=D;for(var G=M,N=0;M<A;++M){var B=s*l(u,n[C?A-M-1:M],p);if(e+o<i&&v+m<r+N+B/2)break;N+=B}if(M!==G){var q=C?n.substring(A-G,A-M):n.substring(G,M);I=Ne(f,h,_=0===m?0:(r+N/2-v)/m),F=Ne(g,c,_);j.push([I,F,N/2,D,q]),r+=N}}return j}var Jp=[1/0,1/0,-1/0,-1/0],Qp=[],td=[],ed=[],id=[];function od(t){return t[3].declutterBox}var nd=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 rd(t,e){return"start"!==e&&"end"!==e||nd.test(t)||(e="start"===e?"left":"right"),Lp[e]}var ad=function(){function t(t,e,i,o){this.overlaps=i,this.pixelRatio=e,this.resolution=t,this.alignFill_,this.instructions=o.instructions,this.coordinates=o.coordinates,this.coordinateCache_={},this.renderedTransform_=[1,0,0,1,0,0],this.hitDetectionInstructions=o.hitDetectionInstructions,this.pixelCoordinates_=null,this.viewRotation_=0,this.fillStates=o.fillStates||{},this.strokeStates=o.strokeStates||{},this.textStates=o.textStates||{},this.widths_={},this.labels_={}}return t.prototype.createLabel=function(t,e,i,o){var n=t+e+i+o;if(this.labels_[n])return this.labels_[n];var r=o?this.strokeStates[o]:null,a=i?this.fillStates[i]:null,s=this.textStates[e],l=this.pixelRatio,u=[s.scale[0]*l,s.scale[1]*l],p=rd(t,s.textAlign||Kn),d=o&&r.lineWidth?r.lineWidth:0,h=t.split("\n"),c=h.length,f=[],g=function(t,e,i){for(var o=e.length,n=0,r=0;r<o;++r){var a=rr(t,e[r]);n=Math.max(n,a),i.push(a)}return n}(s.font,h,f),m=or(s.font),v=g+d,y=[],_=(v+2)*u[0],b=(m*c+d)*u[1],x={width:_<0?Math.floor(_):Math.ceil(_),height:b<0?Math.floor(b):Math.ceil(b),contextInstructions:y};(1==u[0]&&1==u[1]||y.push("scale",u),y.push("font",s.font),o)&&(y.push("strokeStyle",r.strokeStyle),y.push("lineWidth",d),y.push("lineCap",r.lineCap),y.push("lineJoin",r.lineJoin),y.push("miterLimit",r.miterLimit),(re?OffscreenCanvasRenderingContext2D:CanvasRenderingContext2D).prototype.setLineDash&&(y.push("setLineDash",[r.lineDash]),y.push("lineDashOffset",r.lineDashOffset)));i&&y.push("fillStyle",a.fillStyle),y.push("textBaseline","middle"),y.push("textAlign","center");var k,w=.5-p,S=p*v+w*d;if(o)for(k=0;k<c;++k)y.push("strokeText",[h[k],S+w*f[k],.5*(d+m)+k*m]);if(i)for(k=0;k<c;++k)y.push("fillText",[h[k],S+w*f[k],.5*(d+m)+k*m]);return this.labels_[n]=x,x},t.prototype.replayTextBackground_=function(t,e,i,o,n,r,a){t.beginPath(),t.moveTo.apply(t,e),t.lineTo.apply(t,i),t.lineTo.apply(t,o),t.lineTo.apply(t,n),t.lineTo.apply(t,e),r&&(this.alignFill_=r[2],this.fill_(t)),a&&(this.setStrokeStyle_(t,a),t.stroke())},t.prototype.calculateImageOrLabelDimensions_=function(t,e,i,o,n,r,a,s,l,u,p,d,h,c,f,g){var m,v=i-(a*=d[0]),y=o-(s*=d[1]),_=n+l>t?t-l:n,b=r+u>e?e-u:r,x=c[3]+_*d[0]+c[1],k=c[0]+b*d[1]+c[2],w=v-c[3],S=y-c[0];return(f||0!==p)&&(Qp[0]=w,id[0]=w,Qp[1]=S,td[1]=S,td[0]=w+x,ed[0]=td[0],ed[1]=S+k,id[1]=ed[1]),0!==p?(bn(m=kn([1,0,0,1,0,0],i,o,1,1,p,-i,-o),Qp),bn(m,td),bn(m,ed),bn(m,id),no(Math.min(Qp[0],td[0],ed[0],id[0]),Math.min(Qp[1],td[1],ed[1],id[1]),Math.max(Qp[0],td[0],ed[0],id[0]),Math.max(Qp[1],td[1],ed[1],id[1]),Jp)):no(Math.min(w,w+x),Math.min(S,S+k),Math.max(w,w+x),Math.max(S,S+k),Jp),h&&(v=Math.round(v),y=Math.round(y)),{drawImageX:v,drawImageY:y,drawImageW:_,drawImageH:b,originX:l,originY:u,declutterBox:{minX:Jp[0],minY:Jp[1],maxX:Jp[2],maxY:Jp[3],value:g},canvasTransform:m,scale:d}},t.prototype.replayImageOrLabel_=function(t,e,i,o,n,r,a){var s=!(!r&&!a),l=o.declutterBox,u=t.canvas,p=a?a[2]*o.scale[0]/2:0;return l.minX-p<=u.width/e&&l.maxX+p>=0&&l.minY-p<=u.height/e&&l.maxY+p>=0&&(s&&this.replayTextBackground_(t,Qp,td,ed,id,r,a),sr(t,o.canvasTransform,n,i,o.originX,o.originY,o.drawImageW,o.drawImageH,o.drawImageX,o.drawImageY,o.scale)),!0},t.prototype.fill_=function(t){if(this.alignFill_){var e=bn(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,o){var n=this.textStates[e],r=this.createLabel(t,e,o,i),a=this.strokeStates[i],s=this.pixelRatio,l=rd(t,n.textAlign||Kn),u=Lp[n.textBaseline||Yn],p=a&&a.lineWidth?a.lineWidth:0;return{label:r,anchorX:l*(r.width/s-2*n.scale[0])+2*(.5-l)*p,anchorY:u*r.height/s+2*(.5-u)*p}},t.prototype.execute_=function(t,e,i,o,n,r,a,s){var l;this.pixelCoordinates_&&mt(i,this.renderedTransform_)?l=this.pixelCoordinates_:(this.pixelCoordinates_||(this.pixelCoordinates_=[]),l=$r(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,p,d,h,c,f,g,m,v,y,_,b,x,k,w,S,C=0,z=o.length,T=0,E=0,P=0,O=null,j=null,R=this.coordinateCache_,I=this.viewRotation_,F=Math.round(1e12*Math.atan2(-i[1],i[0]))/1e12,M={context:t,pixelRatio:this.pixelRatio,resolution:this.resolution,rotation:I},A=this.instructions!=o||this.overlaps?0:200;C<z;){var D=o[C];switch(D[0]){case zp.BEGIN_GEOMETRY:x=D[1],S=D[3],x.getGeometry()?void 0===a||zo(a,S.getExtent())?++C:C=D[2]+1:C=D[2];break;case zp.BEGIN_PATH:E>A&&(this.fill_(t),E=0),P>A&&(t.stroke(),P=0),E||P||(t.beginPath(),h=NaN,c=NaN),++C;break;case zp.CIRCLE:var L=l[T=D[1]],G=l[T+1],N=l[T+2]-L,B=l[T+3]-G,q=Math.sqrt(N*N+B*B);t.moveTo(L+q,G),t.arc(L,G,q,0,2*Math.PI,!0),++C;break;case zp.CLOSE_PATH:t.closePath(),++C;break;case zp.CUSTOM:T=D[1],u=D[2];var W=D[3],V=D[4],U=6==D.length?D[5]:void 0;M.geometry=W,M.feature=x,C in R||(R[C]=[]);var X=R[C];U?U(l,T,u,2,X):(X[0]=l[T],X[1]=l[T+1],X.length=2),V(X,M),++C;break;case zp.DRAW_IMAGE:T=D[1],u=D[2],m=D[3],p=D[4],d=D[5];var K=D[6],Y=D[7],Z=D[8],$=D[9],H=D[10],J=D[11],Q=D[12],tt=D[13],et=D[14];if(!m&&D.length>=19){v=D[18],y=D[19],_=D[20],b=D[21];var it=this.drawLabelWithPointPlacement_(v,y,_,b);m=it.label,D[3]=m;var ot=D[22];p=(it.anchorX-ot)*this.pixelRatio,D[4]=p;var nt=D[23];d=(it.anchorY-nt)*this.pixelRatio,D[5]=d,K=m.height,D[6]=K,tt=m.width,D[13]=tt}var rt=void 0;D.length>24&&(rt=D[24]);var at=void 0,st=void 0,lt=void 0;D.length>16?(at=D[15],st=D[16],lt=D[17]):(at=Zn,st=!1,lt=!1),H&&F?J+=I:H||F||(J-=I);for(var ut=0;T<u;T+=2)if(!(rt&&rt[ut++]<tt/this.pixelRatio)){var pt=[t,e,m,Lt=this.calculateImageOrLabelDimensions_(m.width,m.height,l[T],l[T+1],tt,K,p,d,Z,$,J,Q,n,at,st||lt,x),Y,st?O:null,lt?j:null],dt=void 0,ht=void 0;if(s&&et){var ct=u-T;if(!et[ct]){et[ct]=pt;continue}if(dt=et[ct],delete et[ct],ht=od(dt),s.collides(ht))continue}s&&s.collides(Lt.declutterBox)||(dt&&(s&&s.insert(ht),this.replayImageOrLabel_.apply(this,dt)),s&&s.insert(Lt.declutterBox),this.replayImageOrLabel_.apply(this,pt))}++C;break;case zp.DRAW_CHARS:var ft=D[1],gt=D[2],vt=D[3],yt=D[4];b=D[5];var _t=D[6],bt=D[7],xt=D[8];_=D[9];var kt=D[10];v=D[11],y=D[12];var wt=[D[13],D[13]],St=this.textStates[y],Ct=St.font,zt=[St.scale[0]*bt,St.scale[1]*bt],Tt=void 0;Ct in this.widths_?Tt=this.widths_[Ct]:(Tt={},this.widths_[Ct]=Tt);var Et=ws(l,ft,gt,2),Pt=Math.abs(zt[0])*ar(Ct,v,Tt);if(yt||Pt<=Et){var Ot=this.textStates[y].textAlign,jt=Hp(l,ft,gt,2,v,(Et-Pt)*Lp[Ot],_t,Math.abs(zt[0]),ar,Ct,Tt,F?0:this.viewRotation_);t:if(jt){var Rt=[],It=void 0,Ft=void 0,Mt=void 0,At=void 0,Dt=void 0;if(_)for(It=0,Ft=jt.length;It<Ft;++It){Mt=(Dt=jt[It])[4],At=this.createLabel(Mt,y,"",_),p=Dt[2]+(zt[0]<0?-kt:kt),d=vt*At.height+2*(.5-vt)*kt*zt[1]/zt[0]-xt;var Lt=this.calculateImageOrLabelDimensions_(At.width,At.height,Dt[0],Dt[1],At.width,At.height,p,d,0,0,Dt[3],wt,!1,Zn,!1,x);if(s&&s.collides(Lt.declutterBox))break t;Rt.push([t,e,At,Lt,1,null,null])}if(b)for(It=0,Ft=jt.length;It<Ft;++It){Mt=(Dt=jt[It])[4],At=this.createLabel(Mt,y,b,""),p=Dt[2],d=vt*At.height-xt;Lt=this.calculateImageOrLabelDimensions_(At.width,At.height,Dt[0],Dt[1],At.width,At.height,p,d,0,0,Dt[3],wt,!1,Zn,!1,x);if(s&&s.collides(Lt.declutterBox))break t;Rt.push([t,e,At,Lt,1,null,null])}s&&s.load(Rt.map(od));for(var Gt=0,Nt=Rt.length;Gt<Nt;++Gt)this.replayImageOrLabel_.apply(this,Rt[Gt])}}++C;break;case zp.END_GEOMETRY:if(void 0!==r){var Bt=r(x=D[1],S);if(Bt)return Bt}++C;break;case zp.FILL:A?E++:this.fill_(t),++C;break;case zp.MOVE_TO_LINE_TO:for(T=D[1],u=D[2],k=l[T],g=(w=l[T+1])+.5|0,(f=k+.5|0)===h&&g===c||(t.moveTo(k,w),h=f,c=g),T+=2;T<u;T+=2)f=(k=l[T])+.5|0,g=(w=l[T+1])+.5|0,T!=u-2&&f===h&&g===c||(t.lineTo(k,w),h=f,c=g);++C;break;case zp.SET_FILL_STYLE:O=D,this.alignFill_=D[2],E&&(this.fill_(t),E=0,P&&(t.stroke(),P=0)),t.fillStyle=D[1],++C;break;case zp.SET_STROKE_STYLE:j=D,P&&(t.stroke(),P=0),this.setStrokeStyle_(t,D),++C;break;case zp.STROKE:A?P++:t.stroke(),++C;break;default:++C}}E&&this.fill_(t),P&&t.stroke()},t.prototype.execute=function(t,e,i,o,n,r){this.viewRotation_=o,this.execute_(t,e,i,this.instructions,n,void 0,void 0,r)},t.prototype.executeHitDetection=function(t,e,i,o,n){return this.viewRotation_=i,this.execute_(t,1,e,this.hitDetectionInstructions,!0,o,n)},t}(),sd=[Zp,Up,Yp,Kp,$p,Xp],ld=function(){function t(t,e,i,o,n,r){this.maxExtent_=t,this.overlaps_=o,this.pixelRatio_=i,this.resolution_=e,this.renderBuffer_=r,this.executorsByZIndex_={},this.hitDetectionContext_=null,this.hitDetectionTransform_=[1,0,0,1,0,0],this.createExecutors_(n)}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 o=t[e];for(var n in o){var r=o[n];i[n]=new ad(this.resolution_,this.pixelRatio_,this.overlaps_,r)}}},t.prototype.hasExecutors=function(t){for(var e in this.executorsByZIndex_)for(var i=this.executorsByZIndex_[e],o=0,n=t.length;o<n;++o)if(t[o]in i)return!0;return!1},t.prototype.forEachFeatureAtCoordinate=function(t,e,i,o,n,r){var a=2*(o=Math.round(o))+1,s=kn(this.hitDetectionTransform_,o+.5,o+.5,1/e,-1/e,-i,-t[0],-t[1]),l=!this.hitDetectionContext_;l&&(this.hitDetectionContext_=le(a,a));var u,p=this.hitDetectionContext_;p.canvas.width!==a||p.canvas.height!==a?(p.canvas.width=a,p.canvas.height=a):l||p.clearRect(0,0,a,a),void 0!==this.renderBuffer_&&(po(u=[1/0,1/0,-1/0,-1/0],t),$i(u,e*(this.renderBuffer_+o),u));var d,h=function(t){if(void 0!==ud[t])return ud[t];for(var e=2*t+1,i=t*t,o=new Array(i+1),n=0;n<=t;++n)for(var r=0;r<=t;++r){var a=n*n+r*r;if(a>i)break;var s=o[a];s||(s=[],o[a]=s),s.push(4*((t+n)*e+(t+r))+3),n>0&&s.push(4*((t-n)*e+(t+r))+3),r>0&&(s.push(4*((t+n)*e+(t-r))+3),n>0&&s.push(4*((t-n)*e+(t-r))+3))}for(var l=[],u=(n=0,o.length);n<u;++n)o[n]&&l.push.apply(l,o[n]);return ud[t]=l,l}(o);function c(t,e){for(var i=p.getImageData(0,0,a,a).data,s=0,l=h.length;s<l;s++)if(i[h[s]]>0){if(!r||d!==Kp&&d!==$p||-1!==r.indexOf(t)){var u=(h[s]-3)/4,c=o-u%a,f=o-(u/a|0),g=n(t,e,c*c+f*f);if(g)return g}p.clearRect(0,0,a,a);break}}var f,g,m,v,y,_=Object.keys(this.executorsByZIndex_).map(Number);for(_.sort(ht),f=_.length-1;f>=0;--f){var b=_[f].toString();for(m=this.executorsByZIndex_[b],g=sd.length-1;g>=0;--g)if(void 0!==(v=m[d=sd[g]])&&(y=v.executeHitDetection(p,s,i,c,u)))return y}},t.prototype.getClipCoords=function(t){var e=this.maxExtent_;if(!e)return null;var i=e[0],o=e[1],n=e[2],r=e[3],a=[i,o,i,r,n,r,n,o];return $r(a,0,8,2,t,a),a},t.prototype.isEmpty=function(){return wt(this.executorsByZIndex_)},t.prototype.execute=function(t,e,i,o,n,r,a){var s=Object.keys(this.executorsByZIndex_).map(Number);s.sort(ht),this.maxExtent_&&(t.save(),this.clip(t,i));var l,u,p,d,h,c,f=r||sd;for(a&&s.reverse(),l=0,u=s.length;l<u;++l){var g=s[l].toString();for(h=this.executorsByZIndex_[g],p=0,d=f.length;p<d;++p){void 0!==(c=h[f[p]])&&c.execute(t,e,i,o,n,a)}}this.maxExtent_&&t.restore()},t}(),ud={};var pd=ld,dd=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 o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}(),hd=function(t){function e(e,i,o,n,r,a,s){var l=t.call(this)||this;return l.context_=e,l.pixelRatio_=i,l.extent_=o,l.transform_=n,l.viewRotation_=r,l.squaredTolerance_=a,l.userTransform_=s,l.contextFillState_=null,l.contextStrokeState_=null,l.contextTextState_=null,l.fillState_=null,l.strokeState_=null,l.image_=null,l.imageAnchorX_=0,l.imageAnchorY_=0,l.imageHeight_=0,l.imageOpacity_=0,l.imageOriginX_=0,l.imageOriginY_=0,l.imageRotateWithView_=!1,l.imageRotation_=0,l.imageScale_=[0,0],l.imageWidth_=0,l.text_="",l.textOffsetX_=0,l.textOffsetY_=0,l.textRotateWithView_=!1,l.textRotation_=0,l.textScale_=[0,0],l.textFillState_=null,l.textStrokeState_=null,l.textState_=null,l.pixelCoordinates_=[],l.tmpLocalTransform_=[1,0,0,1,0,0],l}return dd(e,t),e.prototype.drawImages_=function(t,e,i,o){if(this.image_){var n=$r(t,e,i,o,this.transform_,this.pixelCoordinates_),r=this.context_,a=this.tmpLocalTransform_,s=r.globalAlpha;1!=this.imageOpacity_&&(r.globalAlpha=s*this.imageOpacity_);var l=this.imageRotation_;this.imageRotateWithView_&&(l+=this.viewRotation_);for(var u=0,p=n.length;u<p;u+=2){var d=n[u]-this.imageAnchorX_,h=n[u+1]-this.imageAnchorY_;if(0!==l||1!=this.imageScale_[0]||1!=this.imageScale_[1]){var c=d+this.imageAnchorX_,f=h+this.imageAnchorY_;kn(a,c,f,1,1,l,-c,-f),r.setTransform.apply(r,a),r.translate(c,f),r.scale(this.imageScale_[0],this.imageScale_[1]),r.drawImage(this.image_,this.imageOriginX_,this.imageOriginY_,this.imageWidth_,this.imageHeight_,-this.imageAnchorX_,-this.imageAnchorY_,this.imageWidth_,this.imageHeight_),r.setTransform(1,0,0,1,0,0)}else r.drawImage(this.image_,this.imageOriginX_,this.imageOriginY_,this.imageWidth_,this.imageHeight_,d,h,this.imageWidth_,this.imageHeight_)}1!=this.imageOpacity_&&(r.globalAlpha=s)}},e.prototype.drawText_=function(t,e,i,o){if(this.textState_&&""!==this.text_){this.textFillState_&&this.setContextFillState_(this.textFillState_),this.textStrokeState_&&this.setContextStrokeState_(this.textStrokeState_),this.setContextTextState_(this.textState_);var n=$r(t,e,i,o,this.transform_,this.pixelCoordinates_),r=this.context_,a=this.textRotation_;for(this.textRotateWithView_&&(a+=this.viewRotation_);e<i;e+=o){var s=n[e]+this.textOffsetX_,l=n[e+1]+this.textOffsetY_;if(0!==a||1!=this.textScale_[0]||1!=this.textScale_[1]){var u=kn(this.tmpLocalTransform_,s,l,1,1,a,-s,-l);r.setTransform.apply(r,u),r.translate(s,l),r.scale(this.textScale_[0],this.textScale_[1]),this.textStrokeState_&&r.strokeText(this.text_,0,0),this.textFillState_&&r.fillText(this.text_,0,0),r.setTransform(1,0,0,1,0,0)}else this.textStrokeState_&&r.strokeText(this.text_,s,l),this.textFillState_&&r.fillText(this.text_,s,l)}}},e.prototype.moveToLineTo_=function(t,e,i,o,n){var r=this.context_,a=$r(t,e,i,o,this.transform_,this.pixelCoordinates_);r.moveTo(a[0],a[1]);var s=a.length;n&&(s-=2);for(var l=2;l<s;l+=2)r.lineTo(a[l],a[l+1]);return n&&r.closePath(),i},e.prototype.drawRings_=function(t,e,i,o){for(var n=0,r=i.length;n<r;++n)e=this.moveToLineTo_(t,e,i[n],o,!0);return e},e.prototype.drawCircle=function(t){if(zo(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 o=t.getFlatCoordinates();if(o){var n=t.getStride();return $r(o,0,o.length,n,e,i)}return null}(t,this.transform_,this.pixelCoordinates_),i=e[2]-e[0],o=e[3]-e[1],n=Math.sqrt(i*i+o*o),r=this.context_;r.beginPath(),r.arc(e[0],e[1],n,0,2*Math.PI),this.fillState_&&r.fill(),this.strokeState_&&r.stroke()}""!==this.text_&&this.drawText_(t.getCenter(),0,2,2)}},e.prototype.setStyle=function(t){this.setFillStrokeStyle(t.getFill(),t.getStroke()),this.setImageStyle(t.getImage()),this.setTextStyle(t.getText())},e.prototype.setTransform=function(t){this.transform_=t},e.prototype.drawGeometry=function(t){switch(t.getType()){case Po:this.drawPoint(t);break;case Oo:this.drawLineString(t);break;case Ro:this.drawPolygon(t);break;case Io:this.drawMultiPoint(t);break;case Fo:this.drawMultiLineString(t);break;case Mo:this.drawMultiPolygon(t);break;case Ao:this.drawGeometryCollection(t);break;case Do:this.drawCircle(t)}},e.prototype.drawFeature=function(t,e){var i=e.getGeometryFunction()(t);i&&zo(this.extent_,i.getExtent())&&(this.setStyle(e),this.drawGeometry(i))},e.prototype.drawGeometryCollection=function(t){for(var e=t.getGeometriesArray(),i=0,o=e.length;i<o;++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_)),zo(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 o=t.getFlatMidpoint();this.drawText_(o,0,2,2)}}},e.prototype.drawMultiLineString=function(t){this.squaredTolerance_&&(t=t.simplifyTransformed(this.squaredTolerance_,this.userTransform_));var e=t.getExtent();if(zo(this.extent_,e)){if(this.strokeState_){this.setContextStrokeState_(this.strokeState_);var i=this.context_,o=t.getFlatCoordinates(),n=0,r=t.getEnds(),a=t.getStride();i.beginPath();for(var s=0,l=r.length;s<l;++s)n=this.moveToLineTo_(o,n,r[s],a,!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_)),zo(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_)),zo(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(),o=0,n=t.getEndss(),r=t.getStride();e.beginPath();for(var a=0,s=n.length;a<s;++a){var l=n[a];o=this.drawRings_(i,o,l,r)}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&&(mt(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_,o=t.textAlign?t.textAlign:Kn;i?(i.font!=t.font&&(i.font=t.font,e.font=t.font),i.textAlign!=o&&(i.textAlign=o,e.textAlign=o),i.textBaseline!=t.textBaseline&&(i.textBaseline=t.textBaseline,e.textBaseline=t.textBaseline)):(e.font=t.font,e.textAlign=o,e.textBaseline=t.textBaseline,this.contextTextState_={font:t.font,textAlign:o,textBaseline:t.textBaseline})},e.prototype.setFillStrokeStyle=function(t,e){var i=this;if(t){var o=t.getColor();this.fillState_={fillStyle:ll(o||qn)}}else this.fillState_=null;if(e){var n=e.getColor(),r=e.getLineCap(),a=e.getLineDash(),s=e.getLineDashOffset(),l=e.getLineJoin(),u=e.getWidth(),p=e.getMiterLimit(),d=a||Vn;this.strokeState_={lineCap:void 0!==r?r:Wn,lineDash:1===this.pixelRatio_?d:d.map((function(t){return t*i.pixelRatio_})),lineDashOffset:(s||0)*this.pixelRatio_,lineJoin:void 0!==l?l:Un,lineWidth:(void 0!==u?u:1)*this.pixelRatio_,miterLimit:void 0!==p?p:10,strokeStyle:ll(n||Xn)}}else this.strokeState_=null},e.prototype.setImageStyle=function(t){var e;if(t&&(e=t.getSize())){var i=t.getAnchor(),o=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_=o[0],this.imageOriginY_=o[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:ll(i||qn)}}else this.textFillState_=null;var o=t.getStroke();if(o){var n=o.getColor(),r=o.getLineCap(),a=o.getLineDash(),s=o.getLineDashOffset(),l=o.getLineJoin(),u=o.getWidth(),p=o.getMiterLimit();this.textStrokeState_={lineCap:void 0!==r?r:Wn,lineDash:a||Vn,lineDashOffset:s||0,lineJoin:void 0!==l?l:Un,lineWidth:void 0!==u?u:1,miterLimit:void 0!==p?p:10,strokeStyle:ll(n||Xn)}}else this.textStrokeState_=null;var d=t.getFont(),h=t.getOffsetX(),c=t.getOffsetY(),f=t.getRotateWithView(),g=t.getRotation(),m=t.getScaleArray(),v=t.getText(),y=t.getTextAlign(),_=t.getTextBaseline();this.textState_={font:void 0!==d?d:Bn,textAlign:void 0!==y?y:Kn,textBaseline:void 0!==_?_:Yn},this.text_=void 0!==v?v:"",this.textOffsetX_=void 0!==h?this.pixelRatio_*h:0,this.textOffsetY_=void 0!==c?this.pixelRatio_*c:0,this.textRotateWithView_=void 0!==f&&f,this.textRotation_=void 0!==g?g:0,this.textScale_=[this.pixelRatio_*m[0],this.pixelRatio_*m[1]]}else this.text_=""},e}(Tp),cd=.5;function fd(t,e,i,o,n,r,a){var s=le(t[0]*cd,t[1]*cd);s.imageSmoothingEnabled=!1;for(var l=s.canvas,u=new hd(s,cd,n,null,a),p=i.length,d=Math.floor(16777215/p),h={},c=1;c<=p;++c){var f=i[c-1],g=f.getStyleFunction()||o;if(o){var m=g(f,r);if(m){Array.isArray(m)||(m=[m]);for(var v="#"+("000000"+(c*d).toString(16)).slice(-6),y=0,_=m.length;y<_;++y){var b=m[y],x=b.getGeometryFunction()(f);if(x&&zo(n,x.getExtent())){var k=b.clone(),w=k.getFill();w&&w.setColor(v);var S=k.getStroke();S&&(S.setColor(v),S.setLineDash(null)),k.setText(void 0);var C=b.getImage();if(C&&0!==C.getOpacity()){var z=C.getImageSize();if(!z)continue;var T=le(z[0],z[1],void 0,{alpha:!1}),E=T.canvas;T.fillStyle=v,T.fillRect(0,0,E.width,E.height),k.setImage(new al({img:E,imgSize:z,anchor:C.getAnchor(),anchorXUnits:qs,anchorYUnits:qs,offset:C.getOrigin(),opacity:1,size:C.getSize(),scale:C.getScale(),rotation:C.getRotation(),rotateWithView:C.getRotateWithView()}))}var P=k.getZIndex()||0;(R=h[P])||(R={},h[P]=R,R[Ro]=[],R[Do]=[],R[Oo]=[],R[Po]=[]),R[x.getType().replace("Multi","")].push(x,k)}}}}}for(var O=Object.keys(h).map(Number).sort(ht),j=(c=0,O.length);c<j;++c){var R=h[O[c]];for(var I in R){var F=R[I];for(y=0,_=F.length;y<_;y+=2){u.setStyle(F[y+1]);for(var M=0,A=e.length;M<A;++M)u.setTransform(e[M]),u.drawGeometry(F[y])}}}return s.getImageData(0,0,l.width,l.height)}function gd(t,e,i){var o=[];if(i){var n=Math.floor(Math.round(t[0])*cd),r=Math.floor(Math.round(t[1])*cd),a=4*(Ie(n,0,i.width-1)+Ie(r,0,i.height-1)*i.width),s=i.data[a],l=i.data[a+1],u=i.data[a+2]+256*(l+256*s),p=Math.floor(16777215/e.length);u&&u%p==0&&o.push(e[u/p-1])}return o}var md={Point:function(t,e,i,o,n){var r,a=i.getImage(),s=i.getText();n&&(t=n,r=a&&s&&s.getText()?{}:void 0);if(a){if(a.getImageState()!=Zs)return;var l=t.getBuilder(i.getZIndex(),Kp);l.setImageStyle(a,r),l.drawPoint(e,o)}if(s&&s.getText()){var u=t.getBuilder(i.getZIndex(),$p);u.setTextStyle(s,r),u.drawText(e,o)}},LineString:function(t,e,i,o,n){var r=i.getStroke();if(r){var a=t.getBuilder(i.getZIndex(),Yp);a.setFillStrokeStyle(null,r),a.drawLineString(e,o)}var s=i.getText();if(s&&s.getText()){var l=(n||t).getBuilder(i.getZIndex(),$p);l.setTextStyle(s),l.drawText(e,o)}},Polygon:function(t,e,i,o,n){var r=i.getFill(),a=i.getStroke();if(r||a){var s=t.getBuilder(i.getZIndex(),Zp);s.setFillStrokeStyle(r,a),s.drawPolygon(e,o)}var l=i.getText();if(l&&l.getText()){var u=(n||t).getBuilder(i.getZIndex(),$p);u.setTextStyle(l),u.drawText(e,o)}},MultiPoint:function(t,e,i,o,n){var r,a=i.getImage(),s=i.getText();n&&(t=n,r=a&&s&&s.getText()?{}:void 0);if(a){if(a.getImageState()!=Zs)return;var l=t.getBuilder(i.getZIndex(),Kp);l.setImageStyle(a,r),l.drawMultiPoint(e,o)}if(s&&s.getText()){var u=(n||t).getBuilder(i.getZIndex(),$p);u.setTextStyle(s,r),u.drawText(e,o)}},MultiLineString:function(t,e,i,o,n){var r=i.getStroke();if(r){var a=t.getBuilder(i.getZIndex(),Yp);a.setFillStrokeStyle(null,r),a.drawMultiLineString(e,o)}var s=i.getText();if(s&&s.getText()){var l=(n||t).getBuilder(i.getZIndex(),$p);l.setTextStyle(s),l.drawText(e,o)}},MultiPolygon:function(t,e,i,o,n){var r=i.getFill(),a=i.getStroke();if(a||r){var s=t.getBuilder(i.getZIndex(),Zp);s.setFillStrokeStyle(r,a),s.drawMultiPolygon(e,o)}var l=i.getText();if(l&&l.getText()){var u=(n||t).getBuilder(i.getZIndex(),$p);u.setTextStyle(l),u.drawText(e,o)}},GeometryCollection:function(t,e,i,o,n){var r,a,s=e.getGeometriesArray();for(r=0,a=s.length;r<a;++r){(0,md[s[r].getType()])(t,s[r],i,o,n)}},Circle:function(t,e,i,o,n){var r=i.getFill(),a=i.getStroke();if(r||a){var s=t.getBuilder(i.getZIndex(),Up);s.setFillStrokeStyle(r,a),s.drawCircle(e,o)}var l=i.getText();if(l&&l.getText()){var u=(n||t).getBuilder(i.getZIndex(),$p);u.setTextStyle(l),u.drawText(e,o)}}};function vd(t,e){return parseInt(Kt(t),10)-parseInt(Kt(e),10)}function yd(t,e){var i=_d(t,e);return i*i}function _d(t,e){return.5*t/e}function bd(t,e,i,o,n,r,a){var s=!1,l=i.getImage();if(l){var u=l.getImageState();u==Zs||u==$s?l.unlistenImageChange(n):(u==Ks&&l.load(),u=l.getImageState(),l.listenImageChange(n),s=!0)}return function(t,e,i,o,n,r){var a=i.getGeometryFunction()(e);if(!a)return;var s=a.simplifyTransformed(o,n);if(i.getRenderer())xd(t,s,i,e);else{(0,md[s.getType()])(t,s,i,e,r)}}(t,e,i,o,r,a),s}function xd(t,e,i,o){if(e.getType()!=Ao)t.getBuilder(i.getZIndex(),Xp).drawCustom(e,o,i.getRenderer(),i.getHitDetectionRenderer());else for(var n=e.getGeometries(),r=0,a=n.length;r<a;++r)xd(t,n[r],i,o)}var kd=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 o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}(),wd=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 kd(e,t),e.prototype.useContainer=function(e,i,o){o<1&&(e=null),t.prototype.useContainer.call(this,e,i,o)},e.prototype.renderWorlds=function(t,e,i){var o=e.extent,n=e.viewState,r=n.center,a=n.resolution,s=n.projection,l=n.rotation,u=s.getExtent(),p=this.getLayer().getSource(),d=e.pixelRatio,h=e.viewHints,c=!(h[Ir]||h[Fr]),f=this.context,g=Math.round(e.size[0]*d),m=Math.round(e.size[1]*d),v=p.getWrapX()&&s.canWrapX(),y=v?Co(u):null,_=v?Math.ceil((o[2]-u[2])/y)+1:1,b=v?Math.floor((o[0]-u[0])/y):0;do{var x=this.getRenderTransform(r,a,l,d,g,m,b*y);t.execute(f,1,x,l,c,void 0,i)}while(++b<_)},e.prototype.renderDeclutter=function(t){this.declutterExecutorGroup&&this.renderWorlds(this.declutterExecutorGroup,t,t.declutterTree)},e.prototype.renderFrame=function(t,e){var i=t.pixelRatio,o=t.layerStatesArray[t.layerIndex];!function(t,e,i){_n(t,e,0,0,i,0,0)}(this.pixelTransform,1/i,1/i),wn(this.inversePixelTransform,this.pixelTransform);var n=Sn(this.pixelTransform);this.useContainer(e,n,o.opacity);var r=this.context,a=r.canvas,s=this.replayGroup_,l=this.declutterExecutorGroup;if((!s||s.isEmpty())&&(!l||l.isEmpty()))return null;var u=Math.round(t.size[0]*i),p=Math.round(t.size[1]*i);a.width!=u||a.height!=p?(a.width=u,a.height=p,a.style.transform!==n&&(a.style.transform=n)):this.containerReused||r.clearRect(0,0,u,p),this.preRender(r,t);var d=t.viewState;d.projection;var h=!1,c=!0;if(o.extent&&this.clipping){var f=fn(o.extent);(h=(c=zo(f,t.extent))&&!to(f,t.extent))&&this.clipUnrotated(r,t,f)}c&&this.renderWorlds(s,t),h&&r.restore(),this.postRender(r,t);var g=be(o.opacity),m=this.container;return g!==m.style.opacity&&(m.style.opacity=g),this.renderedRotation_!==d.rotation&&(this.renderedRotation_=d.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];bn(this.pixelTransform,i);var o=this.renderedCenter_,n=this.renderedResolution_,r=this.renderedRotation_,a=this.renderedProjection_,s=this.wrappedRenderedExtent_,l=this.getLayer(),u=[],p=i[0]*cd,d=i[1]*cd;u.push(this.getRenderTransform(o,n,r,cd,p,d,0).slice());var h=l.getSource(),c=a.getExtent();if(h.getWrapX()&&a.canWrapX()&&!to(c,s)){for(var f=s[0],g=Co(c),m=0,v=void 0;f<c[0];)v=g*--m,u.push(this.getRenderTransform(o,n,r,cd,p,d,v).slice()),f+=g;for(m=0,f=s[2];f>c[2];)v=g*++m,u.push(this.getRenderTransform(o,n,r,cd,p,d,v).slice()),f-=g}this.hitDetectionImageData_=fd(i,u,this.renderedFeatures_,l.getStyleFunction(),s,n,r)}e(gd(t,this.renderedFeatures_,this.hitDetectionImageData_))}.bind(this))},e.prototype.forEachFeatureAtCoordinate=function(t,e,i,o,n){var r=this;if(this.replayGroup_){var a,s=e.viewState.resolution,l=e.viewState.rotation,u=this.getLayer(),p={},d=function(t,e,i){var r=Kt(t),a=p[r];if(a){if(!0!==a&&i<a.distanceSq){if(0===i)return p[r]=!0,n.splice(n.lastIndexOf(a),1),o(t,u,e);a.geometry=e,a.distanceSq=i}}else{if(0===i)return p[r]=!0,o(t,u,e);n.push(p[r]={feature:t,layer:u,geometry:e,distanceSq:i,callback:o})}},h=[this.replayGroup_];return this.declutterExecutorGroup&&h.push(this.declutterExecutorGroup),h.some((function(o){return a=o.forEachFeatureAtCoordinate(t,s,l,i,d,o===r.declutterExecutorGroup?e.declutterTree.all().map((function(t){return t.value})):null)})),a}},e.prototype.handleFontsChanged=function(){var t=this.getLayer();t.getVisible()&&this.replayGroup_&&t.changed()},e.prototype.handleStyleImageChange_=function(t){this.renderIfReadyAndVisible()},e.prototype.prepareFrame=function(t){var e=this.getLayer(),i=e.getSource();if(!i)return!1;var o=t.viewHints[Ir],n=t.viewHints[Fr],r=e.getUpdateWhileAnimating(),a=e.getUpdateWhileInteracting();if(!this.dirty_&&!r&&o||!a&&n)return this.animatingOrInteracting_=!0,!0;this.animatingOrInteracting_=!1;var s=t.extent,l=t.viewState,u=l.projection,p=l.resolution,d=t.pixelRatio,h=e.getRevision(),c=e.getRenderBuffer(),f=e.getRenderOrder();void 0===f&&(f=vd);var g=l.center.slice(),m=$i(s,c*p),v=m.slice(),y=[m.slice()],_=u.getExtent();if(i.getWrapX()&&u.canWrapX()&&!to(_,t.extent)){var b=Co(_),x=Math.max(Co(m)/2,b);m[0]=_[0]-x,m[2]=_[2]+x,Yo(g,u);var k=function(t,e){var i=e.getExtent(),o=yo(t);if(e.canWrapX()&&(o[0]<i[0]||o[0]>=i[2])){var n=Co(i),r=Math.floor((o[0]-i[0])/n)*n;t[0]-=r,t[2]-=r}return t}(y[0],u);k[0]<_[0]&&k[2]<_[2]?y.push([k[0]+b,k[1],k[2]+b,k[3]]):k[0]>_[0]&&k[2]>_[2]&&y.push([k[0]-b,k[1],k[2]-b,k[3]])}if(!this.dirty_&&this.renderedResolution_==p&&this.renderedRevision_==h&&this.renderedRenderOrder_==f&&to(this.wrappedRenderedExtent_,m))return mt(this.renderedExtent_,v)||(this.hitDetectionImageData_=null,this.renderedExtent_=v),this.renderedCenter_=g,this.replayGroupChanged=!1,!0;this.replayGroup_=null,this.dirty_=!1;var w,S=new Np(_d(p,d),m,p,d);this.getLayer().getDeclutter()&&(w=new Np(_d(p,d),m,p,d));for(var C=0,z=y.length;C<z;++C)i.loadFeatures(y[C],p,u);var T=yd(p,d),E=function(t){var i,o=t.getStyleFunction()||e.getStyleFunction();if(o&&(i=o(t,p)),i){var n=this.renderFeature(t,T,i,S,undefined,w);this.dirty_=this.dirty_||n}}.bind(this),P=cn(m),O=i.getFeaturesInExtent(P);f&&O.sort(f);for(C=0,z=O.length;C<z;++C)E(O[C]);this.renderedFeatures_=O;var j=S.finish(),R=new pd(m,p,d,i.getOverlaps(),j,e.getRenderBuffer());return w&&(this.declutterExecutorGroup=new pd(m,p,d,i.getOverlaps(),w.finish(),e.getRenderBuffer())),this.renderedResolution_=p,this.renderedRevision_=h,this.renderedRenderOrder_=f,this.renderedExtent_=v,this.wrappedRenderedExtent_=m,this.renderedCenter_=g,this.renderedProjection_=u,this.replayGroup_=R,this.hitDetectionImageData_=null,this.replayGroupChanged=!0,!0},e.prototype.renderFeature=function(t,e,i,o,n,r){if(!i)return!1;var a=!1;if(Array.isArray(i))for(var s=0,l=i.length;s<l;++s)a=bd(o,t,i[s],e,this.boundHandleStyleImageChange_,n,r)||a;else a=bd(o,t,i,e,this.boundHandleStyleImageChange_,n,r);return a},e}(Vp),Sd=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 o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}(),Cd=function(t){function e(e){return t.call(this,e)||this}return Sd(e,t),e.prototype.createRenderer=function(){return new wd(this)},e}(bp),zd=function(){function t(t){this.rbush_=new np(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_[Kt(e)]=i},t.prototype.load=function(t,e){for(var i=new Array(e.length),o=0,n=e.length;o<n;o++){var r=t[o],a=e[o],s={minX:r[0],minY:r[1],maxX:r[2],maxY:r[3],value:a};i[o]=s,this.items_[Kt(a)]=s}this.rbush_.load(i)},t.prototype.remove=function(t){var e=Kt(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_[Kt(e)];lo([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,o=0,n=t.length;o<n;o++)if(i=e(t[o]))return i;return i},t.prototype.isEmpty=function(){return wt(this.items_)},t.prototype.clear=function(){this.rbush_.clear(),this.items_={}},t.prototype.getExtent=function(t){var e=this.rbush_.toJSON();return no(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}(),Td=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 o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}();function Ed(t){return t?Array.isArray(t)?function(e){return t}:"function"==typeof t?t:function(e){return[t]}:null}var Pd=function(t){function e(e){var i=t.call(this)||this;i.projection=Jo(e.projection),i.attributions_=Ed(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 o=i;return i.viewPromise_=new Promise((function(t,e){o.viewResolver=t,o.viewRejector=e})),i}return Td(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 Ut()},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_=Ed(t),this.changed()},e.prototype.setState=function(t){this.state_=t,this.changed()},e}($t),Od="addfeature",jd="changefeature",Rd="clear",Id="removefeature",Fd="featuresloadstart",Md="featuresloadend",Ad="featuresloaderror";function Dd(t,e){return[[-1/0,-1/0,1/0,1/0]]}function Ld(t,e,i,o,n,r,a){var s=new XMLHttpRequest;s.open("GET","function"==typeof t?t(i,o,n):t,!0),e.getType()==fs&&(s.responseType="arraybuffer"),s.withCredentials=false,s.onload=function(t){if(!s.status||s.status>=200&&s.status<300){var o=e.getType(),l=void 0;o==gs||o==ms?l=s.responseText:o==vs?(l=s.responseXML)||(l=(new DOMParser).parseFromString(s.responseText,"application/xml")):o==fs&&(l=s.response),l?r(e.readFeatures(l,{extent:i,featureProjection:n}),e.readProjection(l)):a()}else a()},s.onerror=a,s.send()}function Gd(t,e){return function(i,o,n,r,a){var s=this;Ld(t,e,i,o,n,(function(t,e){s.addFeatures(t),void 0!==r&&r(t)}),a||_t)}}var Nd=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 o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}(),Bd=function(t){function e(e,i,o){var n=t.call(this,e)||this;return n.feature=i,n.features=o,n}return Nd(e,t),e}(ut),qd=function(t){function e(e){var i=this,o=e||{};(i=t.call(this,{attributions:o.attributions,projection:void 0,state:Ze,wrapX:void 0===o.wrapX||o.wrapX})||this).on,i.once,i.un,i.loader_=_t,i.format_=o.format,i.overlaps_=void 0===o.overlaps||o.overlaps,i.url_=o.url,void 0!==o.loader?i.loader_=o.loader:void 0!==i.url_&&(Re(i.format_,7),i.loader_=Gd(i.url_,i.format_)),i.strategy_=void 0!==o.strategy?o.strategy:Dd;var n,r,a=void 0===o.useSpatialIndex||o.useSpatialIndex;return i.featuresRtree_=a?new zd:null,i.loadedExtentsRtree_=new zd,i.loadingExtentsCount_=0,i.nullGeometryFeatures_={},i.idIndex_={},i.uidIndex_={},i.featureChangeKeys_={},i.featuresCollection_=null,Array.isArray(o.features)?r=o.features:o.features&&(r=(n=o.features).getArray()),a||void 0!==n||(n=new ai(r)),void 0!==r&&i.addFeaturesInternal(r),void 0!==n&&i.bindFeaturesCollection_(n),i}return Nd(e,t),e.prototype.addFeature=function(t){this.addFeatureInternal(t),this.changed()},e.prototype.addFeatureInternal=function(t){var e=Kt(t);if(this.addToIndex_(e,t)){this.setupChangeEvents_(e,t);var i=t.getGeometry();if(i){var o=i.getExtent();this.featuresRtree_&&this.featuresRtree_.insert(o,t)}else this.nullGeometryFeatures_[e]=t;this.dispatchEvent(new Bd(Od,t))}else this.featuresCollection_&&this.featuresCollection_.remove(t)},e.prototype.setupChangeEvents_=function(t,e){this.featureChangeKeys_[t]=[Gt(e,Tt,this.handleFeatureChange_,this),Gt(e,pt,this.handleFeatureChange_,this)]},e.prototype.addToIndex_=function(t,e){var i=!0,o=e.getId();return void 0!==o&&(o.toString()in this.idIndex_?i=!1:this.idIndex_[o.toString()]=e),i&&(Re(!(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=[],o=[],n=0,r=t.length;n<r;n++){var a=Kt(l=t[n]);this.addToIndex_(a,l)&&i.push(l)}n=0;for(var s=i.length;n<s;n++){var l;a=Kt(l=i[n]);this.setupChangeEvents_(a,l);var u=l.getGeometry();if(u){var p=u.getExtent();e.push(p),o.push(l)}else this.nullGeometryFeatures_[a]=l}this.featuresRtree_&&this.featuresRtree_.load(e,o);n=0;for(var d=i.length;n<d;n++)this.dispatchEvent(new Bd(Od,i[n]))},e.prototype.bindFeaturesCollection_=function(t){var e=!1;this.addEventListener(Od,(function(i){e||(e=!0,t.push(i.feature),e=!1)})),this.addEventListener(Id,(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(Bt)}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 o=new Bd(Rd);this.dispatchEvent(o),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 o=e(i);if(o)return o}}))},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(),wt(this.nullGeometryFeatures_)||gt(t,kt(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],o=t[1],n=null,r=[NaN,NaN],a=1/0,s=[-1/0,-1/0,1/0,1/0],l=e||vt;return this.featuresRtree_.forEachInExtent(s,(function(t){if(l(t)){var e=t.getGeometry(),u=a;if((a=e.closestPointXY(i,o,r,a))<u){n=t;var p=Math.sqrt(a);s[0]=i-p,s[1]=o-p,s[2]=i+p,s[3]=o+p}}})),n},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=Kt(e),o=e.getGeometry();if(o){var n=o.getExtent();i in this.nullGeometryFeatures_?(delete this.nullGeometryFeatures_[i],this.featuresRtree_&&this.featuresRtree_.insert(n,e)):this.featuresRtree_&&this.featuresRtree_.update(n,e)}else i in this.nullGeometryFeatures_||(this.featuresRtree_&&this.featuresRtree_.remove(e),this.nullGeometryFeatures_[i]=e);var r=e.getId();if(void 0!==r){var a=r.toString();this.idIndex_[a]!==e&&(this.removeFromIdIndex_(e),this.idIndex_[a]=e)}else this.removeFromIdIndex_(e),this.uidIndex_[i]=e;this.changed(),this.dispatchEvent(new Bd(jd,e))},e.prototype.hasFeature=function(t){var e=t.getId();return void 0!==e?e in this.idIndex_:Kt(t)in this.uidIndex_},e.prototype.isEmpty=function(){return this.featuresRtree_.isEmpty()&&wt(this.nullGeometryFeatures_)},e.prototype.loadFeatures=function(t,e,i){for(var o=this.loadedExtentsRtree_,n=this.strategy_(t,e,i),r=function(t,r){var s=n[t];o.forEachInExtent(s,(function(t){return to(t.extent,s)}))||(++a.loadingExtentsCount_,a.dispatchEvent(new Bd(Fd)),a.loader_.call(a,s,e,i,function(t){--this.loadingExtentsCount_,this.dispatchEvent(new Bd(Md,void 0,t))}.bind(a),function(){--this.loadingExtentsCount_,this.dispatchEvent(new Bd(Ad))}.bind(a)),o.insert(s,{extent:s.slice()}))},a=this,s=0,l=n.length;s<l;++s)r(s);this.loading=!(this.loader_.length<4)&&this.loadingExtentsCount_>0},e.prototype.refresh=function(){this.clear(!0),this.loadedExtentsRtree_.clear(),t.prototype.refresh.call(this)},e.prototype.removeLoadedExtent=function(t){var e,i=this.loadedExtentsRtree_;i.forEachInExtent(t,(function(i){if(lo(i.extent,t))return e=i,!0})),e&&i.remove(e)},e.prototype.removeFeature=function(t){var e=Kt(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=Kt(t);this.featureChangeKeys_[e].forEach(Bt),delete this.featureChangeKeys_[e];var i=t.getId();void 0!==i&&delete this.idIndex_[i.toString()],delete this.uidIndex_[e],this.dispatchEvent(new Bd(Id,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){Re(this.format_,7),this.url_=t,this.setLoader(Gd(t,this.format_))},e}(Pd),Wd=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 o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}(),Vd="Point",Ud="LineString",Xd="Polygon",Kd="Circle",Yd="drawstart",Zd="drawend",$d="drawabort",Hd=function(t){function e(e,i){var o=t.call(this,e)||this;return o.feature=i,o}return Wd(e,t),e}(ut);var Jd=function(t){function e(e){var i=this,o=e;o.stopDown||(o.stopDown=yt),(i=t.call(this,o)||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 Po:case Io:return Vd;case Oo:case Fo:return Ud;case Ro:case Mo:return Xd;case Do:return Kd;default:throw new Error("Invalid type: "+t)}}(i.type_),i.stopClick_=!!e.stopClick,i.minPoints_=e.minPoints?e.minPoints:i.mode_===Xd?3:2,i.maxPoints_=i.mode_===Kd?2:e.maxPoints?e.maxPoints:1/0,i.finishCondition_=e.finishCondition?e.finishCondition:vt;var n,r=e.geometryFunction;if(!r){var a,s=i.mode_;if(s===Kd)r=function(t,e,i){var o=e||new Qu([NaN,NaN]),n=hn(t[0]),r=Uo(n,hn(t[t.length-1]));return o.setCenterAndRadius(n,Math.sqrt(r)),o};else s===Vd?a=Ca:s===Ud?a=Cs:s===Xd&&(a=Ba),r=function(t,e,i){return e?s===Xd?t[0].length?e.setCoordinates([t[0].concat([t[0][0]])]):e.setCoordinates([]):e.setCoordinates(t):e=new a(t),e}}return i.geometryFunction_=r,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 Cd({source:new qd({useSpatialIndex:!1,wrapX:!!e.wrapX&&e.wrapX}),style:e.style?e.style:(n=ml(),function(t,e){return n[t.getGeometry().getType()]}),updateWhileInteracting:!0}),i.geometryName_=e.geometryName,i.condition_=e.condition?e.condition:fu,i.freehandCondition_,e.freehand?i.freehandCondition_=hu:i.freehandCondition_=e.freehandCondition?e.freehandCondition:gu,i.addChangeListener(tu,i.updateState_),i}return Wd(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===Ot&&e.originalEvent.preventDefault(),this.freehand_=this.mode_!==Vd&&this.freehandCondition_(e);var i=e.type===xr.POINTERMOVE,o=!0;!this.freehand_&&this.lastDragTime_&&e.type===xr.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===xr.POINTERDRAG&&null!==this.sketchFeature_?(this.addToDrawing_(e.coordinate),o=!1):this.freehand_&&e.type===xr.POINTERDOWN?o=!1:i&&this.getPointerCount()<2?(o=e.type===xr.POINTERMOVE)&&this.freehand_?(this.handlePointerMove_(e),this.shouldHandle_&&e.originalEvent.preventDefault()):("mouse"===e.originalEvent.pointerType||e.type===xr.POINTERDRAG&&void 0===this.downTimeout_)&&this.handlePointerMove_(e):e.type===xr.DBLCLICK&&(o=!1),t.prototype.handleEvent.call(this,e)&&o},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 br(xr.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_!==Vd||(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,o=e[0]-i[0],n=e[1]-i[1],r=o*o+n*n;if(this.shouldHandle_=this.freehand_?r>this.squaredClickTolerance_:r<=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,o=[this.finishCoordinate_],n=this.mode_;if(n===Vd)e=!0;else if(n===Kd)e=2===this.sketchCoords_.length;else if(n===Ud)i=this.sketchCoords_.length>this.minPoints_;else if(n===Xd){var r=this.sketchCoords_;i=r[0].length>this.minPoints_,o=[r[0][0],r[0][r[0].length-2]]}if(i)for(var a=this.getMap(),s=0,l=o.length;s<l;s++){var u=o[s],p=a.getPixelFromCoordinate(u),d=t[0]-p[0],h=t[1]-p[1],c=this.freehand_?1:this.snapTolerance_;if(e=Math.sqrt(d*d+h*h)<=c){this.finishCoordinate_=u;break}}}return e},e.prototype.createOrUpdateSketchPoint_=function(t){this.sketchPoint_?this.sketchPoint_.getGeometry().setCoordinates(t):(this.sketchPoint_=new ds(new Ca(t)),this.updateSketchFeatures_())},e.prototype.createOrUpdateCustomSketchLine_=function(t){this.sketchLine_||(this.sketchLine_=new ds);var e=t.getLinearRing(0),i=this.sketchLine_.getGeometry();i?(i.setFlatCoordinates(e.getLayout(),e.getFlatCoordinates()),i.changed()):(i=new Cs(e.getFlatCoordinates(),e.getLayout()),this.sketchLine_.setGeometry(i))},e.prototype.startDrawing_=function(t){var e=this.getMap().getView().getProjection();this.finishCoordinate_=t,this.mode_===Vd?this.sketchCoords_=t.slice():this.mode_===Xd?(this.sketchCoords_=[[t.slice(),t.slice()]],this.sketchLineCoords_=this.sketchCoords_[0]):this.sketchCoords_=[t.slice(),t.slice()],this.sketchLineCoords_&&(this.sketchLine_=new ds(new Cs(this.sketchLineCoords_)));var i=this.geometryFunction_(this.sketchCoords_,void 0,e);this.sketchFeature_=new ds,this.geometryName_&&this.sketchFeature_.setGeometryName(this.geometryName_),this.sketchFeature_.setGeometry(i),this.updateSketchFeatures_(),this.dispatchEvent(new Hd(Yd,this.sketchFeature_))},e.prototype.modifyDrawing_=function(t){var e,i,o=this.getMap(),n=this.sketchFeature_.getGeometry(),r=o.getView().getProjection();(this.mode_===Vd?i=this.sketchCoords_:this.mode_===Xd?(i=(e=this.sketchCoords_[0])[e.length-1],this.atFinish_(o.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_,n,r),this.sketchPoint_)&&this.sketchPoint_.getGeometry().setCoordinates(t);if(n.getType()===Ro&&this.mode_!==Xd)this.createOrUpdateCustomSketchLine_(n);else if(this.sketchLineCoords_){this.sketchLine_.getGeometry().setCoordinates(this.sketchLineCoords_)}this.updateSketchFeatures_()},e.prototype.addToDrawing_=function(t){var e,i,o=this.sketchFeature_.getGeometry(),n=this.getMap().getView().getProjection(),r=this.mode_;r===Ud||r===Kd?(this.finishCoordinate_=t.slice(),(i=this.sketchCoords_).length>=this.maxPoints_&&(this.freehand_?i.pop():e=!0),i.push(t.slice()),this.geometryFunction_(i,o,n)):r===Xd&&((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_,o,n)),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(),o=this.mode_;if(o===Ud||o===Kd){if((t=this.sketchCoords_).splice(-2,1),t.length>=2){this.finishCoordinate_=t[t.length-2].slice();var n=this.finishCoordinate_.slice();t[t.length-1]=n,this.createOrUpdateSketchPoint_(n)}this.geometryFunction_(t,e,i),e.getType()===Ro&&this.sketchLine_&&this.createOrUpdateCustomSketchLine_(e)}else if(o===Xd){(t=this.sketchCoords_[0]).splice(-2,1);var r=this.sketchLine_.getGeometry();if(t.length>=2){n=t[t.length-2].slice();t[t.length-1]=n,this.createOrUpdateSketchPoint_(n)}r.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(),o=this.getMap().getView().getProjection();this.mode_===Ud?(e.pop(),this.geometryFunction_(e,i,o)):this.mode_===Xd&&(e[0].pop(),this.geometryFunction_(e,i,o),e=i.getCoordinates()),this.type_===Io?t.setGeometry(new Ps([e])):this.type_===Fo?t.setGeometry(new Ts([e])):this.type_===Mo&&t.setGeometry(new Rs([e])),this.dispatchEvent(new Hd(Zd,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 Hd($d,t))},e.prototype.appendCoordinates=function(t){var e,i=this.mode_,o=!this.sketchFeature_;if(o&&this.startDrawing_(t[0]),i===Ud||i===Kd)e=this.sketchCoords_;else{if(i!==Xd)return;e=this.sketchCoords_&&this.sketchCoords_.length?this.sketchCoords_[0]:[]}o&&e.shift(),e.pop();for(var n=0;n<t.length;n++)this.addToDrawing_(t[n]);var r=t[t.length-1];this.addToDrawing_(r),this.modifyDrawing_(r)},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 ds(new Ca(i)),this.updateSketchFeatures_(),this.dispatchEvent(new Hd(Yd,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}(lu),Qd=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 o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}(),th=[0,0,0,0],eh=[],ih="modifystart",oh="modifyend",nh=function(t){function e(e,i,o){var n=t.call(this,e)||this;return n.features=i,n.mapBrowserEvent=o,n}return Qd(e,t),e}(ut);function rh(t,e){return t.index-e.index}function ah(t,e,i){var o=e.geometry;if(o.getType()===Do){var n=o;if(1===e.index){null;var r=Uo(n.getCenter(),hn(t)),a=Math.sqrt(r)-n.getRadius();return a*a}}var s=hn(t);return eh[0]=hn(e.segment[0]),eh[1]=hn(e.segment[1]),Ko(s,eh)}function sh(t,e,i){var o=e.geometry;if(o.getType()===Do&&1===e.index){var n=o;return dn(n.getClosestPoint(hn(t)))}var r=hn(t);return eh[0]=hn(e.segment[0]),eh[1]=hn(e.segment[1]),dn(qo(r,eh))}var lh=function(t){function e(e){var i,o,n=t.call(this,e)||this;if(n.on,n.once,n.un,n.boundHandleFeatureChange_=n.handleFeatureChange_.bind(n),n.condition_=e.condition?e.condition:yu,n.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==xr.SINGLECLICK}(t)},n.deleteCondition_=e.deleteCondition?e.deleteCondition:n.defaultDeleteCondition_,n.insertVertexCondition_=e.insertVertexCondition?e.insertVertexCondition:hu,n.vertexFeature_=null,n.vertexSegments_=null,n.lastPixel_=[0,0],n.ignoreNextSingleClick_=!1,n.featuresBeingModified_=null,n.rBush_=new zd,n.pixelTolerance_=void 0!==e.pixelTolerance?e.pixelTolerance:10,n.snappedToVertex_=!1,n.changingFeature_=!1,n.dragSegments_=[],n.overlay_=new Cd({source:new qd({useSpatialIndex:!1,wrapX:!!e.wrapX}),style:e.style?e.style:(i=ml(),function(t,e){return i[Po]}),updateWhileAnimating:!0,updateWhileInteracting:!0}),n.SEGMENT_WRITERS_={Point:n.writePointGeometry_.bind(n),LineString:n.writeLineStringGeometry_.bind(n),LinearRing:n.writeLineStringGeometry_.bind(n),Polygon:n.writePolygonGeometry_.bind(n),MultiPoint:n.writeMultiPointGeometry_.bind(n),MultiLineString:n.writeMultiLineStringGeometry_.bind(n),MultiPolygon:n.writeMultiPolygonGeometry_.bind(n),Circle:n.writeCircleGeometry_.bind(n),GeometryCollection:n.writeGeometryCollectionGeometry_.bind(n)},n.source_=null,n.hitDetection_=null,e.features?o=e.features:e.source&&(n.source_=e.source,o=new ai(n.source_.getFeatures()),n.source_.addEventListener(Od,n.handleSourceAdd_.bind(n)),n.source_.addEventListener(Id,n.handleSourceRemove_.bind(n))),!o)throw new Error("The modify interaction requires features, a source or a layer");return e.hitDetection&&(n.hitDetection_=e.hitDetection),n.features_=o,n.features_.forEach(n.addFeature_.bind(n)),n.features_.addEventListener(ei,n.handleFeatureAdd_.bind(n)),n.features_.addEventListener(ii,n.handleFeatureRemove_.bind(n)),n.lastPointerEvent_=null,n.delta_=[0,0],n.snapToPointer_=void 0===e.snapToPointer?!n.hitDetection_:e.snapToPointer,n}return Qd(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 o=this.getMap();o&&o.isRendered()&&this.getActive()&&this.handlePointerAtPixel_(this.lastPixel_,o),t.addEventListener(Tt,this.boundHandleFeatureChange_)},e.prototype.willModifyFeatures_=function(t,e){if(!this.featuresBeingModified_){this.featuresBeingModified_=new ai;for(var i=this.featuresBeingModified_.getArray(),o=0,n=e.length;o<n;++o)for(var r=e[o],a=0,s=r.length;a<s;++a){var l=r[a].feature;l&&-1===i.indexOf(l)&&this.featuresBeingModified_.push(l)}0===this.featuresBeingModified_.getLength()?this.featuresBeingModified_=null:this.dispatchEvent(new nh(ih,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(Tt,this.boundHandleFeatureChange_)},e.prototype.removeFeatureSegmentData_=function(t){var e=this.rBush_,i=[];e.forEach((function(e){t===e.feature&&i.push(e)}));for(var o=i.length-1;o>=0;--o){for(var n=i[o],r=this.dragSegments_.length-1;r>=0;--r)this.dragSegments_[r][0]===n&&this.dragSegments_.splice(r,1);e.remove(n)}},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(),o={feature:t,geometry:e,segment:[i,i]};this.rBush_.insert(e.getExtent(),o)},e.prototype.writeMultiPointGeometry_=function(t,e){for(var i=e.getCoordinates(),o=0,n=i.length;o<n;++o){var r=i[o],a={feature:t,geometry:e,depth:[o],index:o,segment:[r,r]};this.rBush_.insert(e.getExtent(),a)}},e.prototype.writeLineStringGeometry_=function(t,e){for(var i=e.getCoordinates(),o=0,n=i.length-1;o<n;++o){var r=i.slice(o,o+2),a={feature:t,geometry:e,index:o,segment:r};this.rBush_.insert(Zi(r),a)}},e.prototype.writeMultiLineStringGeometry_=function(t,e){for(var i=e.getCoordinates(),o=0,n=i.length;o<n;++o)for(var r=i[o],a=0,s=r.length-1;a<s;++a){var l=r.slice(a,a+2),u={feature:t,geometry:e,depth:[o],index:a,segment:l};this.rBush_.insert(Zi(l),u)}},e.prototype.writePolygonGeometry_=function(t,e){for(var i=e.getCoordinates(),o=0,n=i.length;o<n;++o)for(var r=i[o],a=0,s=r.length-1;a<s;++a){var l=r.slice(a,a+2),u={feature:t,geometry:e,depth:[o],index:a,segment:l};this.rBush_.insert(Zi(l),u)}},e.prototype.writeMultiPolygonGeometry_=function(t,e){for(var i=e.getCoordinates(),o=0,n=i.length;o<n;++o)for(var r=i[o],a=0,s=r.length;a<s;++a)for(var l=r[a],u=0,p=l.length-1;u<p;++u){var d=l.slice(u,u+2),h={feature:t,geometry:e,depth:[a,o],index:u,segment:d};this.rBush_.insert(Zi(d),h)}},e.prototype.writeCircleGeometry_=function(t,e){var i=e.getCenter(),o={feature:t,geometry:e,index:0,segment:[i,i]},n={feature:t,geometry:e,index:1,segment:[i,i]},r=[o,n];o.featureSegments=r,n.featureSegments=r,this.rBush_.insert(ao(i),o);var a=e;this.rBush_.insert(a.getExtent(),n)},e.prototype.writeGeometryCollectionGeometry_=function(t,e){for(var i=e.getGeometriesArray(),o=0;o<i.length;++o){var n=i[o];(0,this.SEGMENT_WRITERS_[n.getType()])(t,n)}},e.prototype.createOrUpdateVertexFeature_=function(t,e,i){var o=this.vertexFeature_;o?o.getGeometry().setCoordinates(t):(o=new ds(new Ca(t)),this.vertexFeature_=o,this.overlay_.getSource().addFeature(o));return o.set("features",e),o.set("geometries",i),o},e.prototype.handleEvent=function(e){return!e.originalEvent||(this.lastPointerEvent_=e,e.map.getView().getInteracting()||e.type!=xr.POINTERMOVE||this.handlingDownUpSequence||this.handlePointerMove_(e),this.vertexFeature_&&this.deleteCondition_(e)&&(i=!(e.type!=xr.SINGLECLICK||!this.ignoreNextSingleClick_)||this.removePoint()),e.type==xr.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=[],o=[],n=0,r=this.dragSegments_.length;n<r;++n){var a=this.dragSegments_[n],s=a[0],l=s.feature;-1===i.indexOf(l)&&i.push(l);var u=s.geometry;-1===o.indexOf(u)&&o.push(u);for(var p=s.depth,d=void 0,h=s.segment,c=a[1];e.length<u.getStride();)e.push(h[c][e.length]);switch(u.getType()){case Po:d=e,h[0]=e,h[1]=e;break;case Io:(d=u.getCoordinates())[s.index]=e,h[0]=e,h[1]=e;break;case Oo:(d=u.getCoordinates())[s.index+c]=e,h[c]=e;break;case Fo:case Ro:(d=u.getCoordinates())[p[0]][s.index+c]=e,h[c]=e;break;case Mo:(d=u.getCoordinates())[p[1]][p[0]][s.index+c]=e,h[c]=e;break;case Do:if(h[0]=e,h[1]=e,0===s.index)this.changingFeature_=!0,u.setCenter(e),this.changingFeature_=!1;else{this.changingFeature_=!0;t.map.getView().getProjection();var f=Xo(hn(u.getCenter()),hn(e));u.setRadius(f),this.changingFeature_=!1}}d&&this.setGeometryCoordinates_(u,d)}this.createOrUpdateVertexFeature_(e,i,o)},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 o=t.map.getView().getProjection(),n=[],r=i.getGeometry().getCoordinates(),a=Zi([r]),s=this.rBush_.getInExtent(a),l={};s.sort(rh);for(var u=0,p=s.length;u<p;++u){var d=s[u],h=d.segment,c=Kt(d.geometry),f=d.depth;if(f&&(c+="-"+f.join("-")),l[c]||(l[c]=new Array(2)),d.geometry.getType()!==Do||1!==d.index)if(!Wo(h[0],r)||l[c][0])if(!Wo(h[1],r)||l[c][1])Kt(h)in this.vertexSegments_&&!l[c][0]&&!l[c][1]&&this.insertVertexCondition_(t)&&n.push(d);else{if((d.geometry.getType()===Oo||d.geometry.getType()===Fo)&&l[c][0]&&0===l[c][0].index)continue;this.dragSegments_.push([d,1]),l[c][1]=d}else this.dragSegments_.push([d,0]),l[c][0]=d;else Wo(sh(e,d,o),r)&&!l[c][0]&&(this.dragSegments_.push([d,0]),l[c][0]=d)}n.length&&this.willModifyFeatures_(t,[n]);for(var g=n.length-1;g>=0;--g)this.insertVertex_(n[g],r)}return!!this.vertexFeature_},e.prototype.handleUpEvent=function(t){for(var e=this.dragSegments_.length-1;e>=0;--e){var i=this.dragSegments_[e][0],o=i.geometry;if(o.getType()===Do){var n=o.getCenter(),r=i.featureSegments[0],a=i.featureSegments[1];r.segment[0]=n,r.segment[1]=n,a.segment[0]=n,a.segment[1]=n,this.rBush_.update(ao(n),r);var s=o;this.rBush_.update(s.getExtent(),a)}else this.rBush_.update(Zi(i.segment),i)}return this.featuresBeingModified_&&(this.dispatchEvent(new nh(oh,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 o,n,r=this,a=i||e.getCoordinateFromPixel(t),s=e.getView().getProjection();if(this.hitDetection_){var l="object"==typeof this.hitDetection_?function(t){return t===r.hitDetection_}:void 0;e.forEachFeatureAtPixel(t,(function(t,e,i){if((i=i||t.getGeometry()).getType()===Po&&(s=r.features_.getArray(),l=t,s.indexOf(l)>=0)){n=i;var a=i.getFlatCoordinates().slice(0,2);o=[{feature:t,geometry:i,segment:[a,a]}]}var s,l;return!0}),{layerFilter:l})}if(!o){var u=cn($i(fn(ao(a,th)),e.getView().getResolution()*this.pixelTolerance_,th));o=this.rBush_.getInExtent(u)}if(o&&o.length>0){var p=o.sort((function(t,e){return ah(a,t,s)-ah(a,e,s)}))[0],d=p.segment,h=sh(a,p,s),c=e.getPixelFromCoordinate(h),f=Xo(t,c);if(n||f<=this.pixelTolerance_){var g={};if(g[Kt(d)]=!0,this.snapToPointer_||(this.delta_[0]=h[0]-a[0],this.delta_[1]=h[1]-a[1]),p.geometry.getType()===Do&&1===p.index)this.snappedToVertex_=!0,this.createOrUpdateVertexFeature_(h,[p.feature],[p.geometry]);else{var m=e.getPixelFromCoordinate(d[0]),v=e.getPixelFromCoordinate(d[1]),y=Uo(c,m),_=Uo(c,v);f=Math.sqrt(Math.min(y,_)),this.snappedToVertex_=f<=this.pixelTolerance_,this.snappedToVertex_&&(h=y>_?d[1]:d[0]),this.createOrUpdateVertexFeature_(h,[p.feature],[p.geometry]);var b={};b[Kt(p.geometry)]=!0;for(var x=1,k=o.length;x<k;++x){var w=o[x].segment;if(!(Wo(d[0],w[0])&&Wo(d[1],w[1])||Wo(d[0],w[1])&&Wo(d[1],w[0])))break;var S=Kt(o[x].geometry);S in b||(b[S]=!0,g[Kt(w)]=!0)}}return void(this.vertexSegments_=g)}}this.vertexFeature_&&(this.overlay_.getSource().removeFeature(this.vertexFeature_),this.vertexFeature_=null)},e.prototype.insertVertex_=function(t,e){for(var i,o=t.segment,n=t.feature,r=t.geometry,a=t.depth,s=t.index;e.length<r.getStride();)e.push(0);switch(r.getType()){case Fo:case Ro:(i=r.getCoordinates())[a[0]].splice(s+1,0,e);break;case Mo:(i=r.getCoordinates())[a[1]][a[0]].splice(s+1,0,e);break;case Oo:(i=r.getCoordinates()).splice(s+1,0,e);break;default:return}this.setGeometryCoordinates_(r,i);var l=this.rBush_;l.remove(t),this.updateSegmentIndices_(r,s,a,1);var u={segment:[o[0],e],feature:n,geometry:r,depth:a,index:s};l.insert(Zi(u.segment),u),this.dragSegments_.push([u,1]);var p={segment:[e,o[1]],feature:n,geometry:r,depth:a,index:s+1};l.insert(Zi(p.segment),p),this.dragSegments_.push([p,0]),this.ignoreNextSingleClick_=!0},e.prototype.removePoint=function(){if(this.lastPointerEvent_&&this.lastPointerEvent_.type!=xr.POINTERDRAG){var t=this.lastPointerEvent_;this.willModifyFeatures_(t,this.dragSegments_);var e=this.removeVertex_();return this.dispatchEvent(new nh(oh,this.featuresBeingModified_,t)),this.featuresBeingModified_=null,e}return!1},e.prototype.removeVertex_=function(){var t,e,i,o,n,r,a,s,l,u,p,d=this.dragSegments_,h={},c=!1;for(n=d.length-1;n>=0;--n)p=Kt((u=(i=d[n])[0]).feature),u.depth&&(p+="-"+u.depth.join("-")),p in h||(h[p]={}),0===i[1]?(h[p].right=u,h[p].index=u.index):1==i[1]&&(h[p].left=u,h[p].index=u.index+1);for(p in h){switch(l=h[p].right,a=h[p].left,(s=(r=h[p].index)-1)<0&&(s=0),t=e=(o=(u=void 0!==a?a:l).geometry).getCoordinates(),c=!1,o.getType()){case Fo:e[u.depth[0]].length>2&&(e[u.depth[0]].splice(r,1),c=!0);break;case Oo:e.length>2&&(e.splice(r,1),c=!0);break;case Mo:t=t[u.depth[1]];case Ro:(t=t[u.depth[0]]).length>4&&(r==t.length-1&&(r=0),t.splice(r,1),c=!0,0===r&&(t.pop(),t.push(t[0]),s=t.length-1))}if(c){this.setGeometryCoordinates_(o,e);var f=[];if(void 0!==a&&(this.rBush_.remove(a),f.push(a.segment[0])),void 0!==l&&(this.rBush_.remove(l),f.push(l.segment[1])),void 0!==a&&void 0!==l){var g={depth:u.depth,feature:u.feature,geometry:u.geometry,index:s,segment:f};this.rBush_.insert(Zi(g.segment),g)}this.updateSegmentIndices_(o,r,u.depth,-1),this.vertexFeature_&&(this.overlay_.getSource().removeFeature(this.vertexFeature_),this.vertexFeature_=null),d.length=0}}return c},e.prototype.setGeometryCoordinates_=function(t,e){this.changingFeature_=!0,t.setCoordinates(e),this.changingFeature_=!1},e.prototype.updateSegmentIndices_=function(t,e,i,o){this.rBush_.forEachInExtent(t.getExtent(),(function(n){n.geometry===t&&(void 0===i||void 0===n.depth||mt(n.depth,i))&&n.index>e&&(n.index+=o)}))},e}(lu),uh=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 o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}();function ph(t){return t.feature?t.feature:t.element?t.element:void 0}var dh=[],hh=function(t){function e(e){var i=this,o=e||{},n=o;return n.handleDownEvent||(n.handleDownEvent=vt),n.stopDown||(n.stopDown=yt),(i=t.call(this,n)||this).source_=o.source?o.source:null,i.vertex_=void 0===o.vertex||o.vertex,i.edge_=void 0===o.edge||o.edge,i.features_=o.features?o.features:null,i.featuresListenerKeys_=[],i.featureChangeListenerKeys_={},i.indexedFeaturesExtents_={},i.pendingFeatures_={},i.pixelTolerance_=void 0!==o.pixelTolerance?o.pixelTolerance:10,i.rBush_=new zd,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 uh(e,t),e.prototype.addFeature=function(t,e){var i=void 0===e||e,o=Kt(t),n=t.getGeometry();if(n){var r=this.SEGMENT_WRITERS_[n.getType()];r&&(this.indexedFeaturesExtents_[o]=n.getExtent([1/0,1/0,-1/0,-1/0]),r(t,n))}i&&(this.featureChangeListenerKeys_[o]=Gt(t,Tt,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=ph(t);this.addFeature(e)},e.prototype.handleFeatureRemove_=function(t){var e=ph(t);this.removeFeature(e)},e.prototype.handleFeatureChange_=function(t){var e=t.target;if(this.handlingDownUpSequence){var i=Kt(e);i in this.pendingFeatures_||(this.pendingFeatures_[i]=e)}else this.updateFeature_(e)},e.prototype.handleUpEvent=function(t){var e=kt(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,o=Kt(t),n=this.indexedFeaturesExtents_[o];if(n){var r=this.rBush_,a=[];r.forEachInExtent(n,(function(e){t===e.feature&&a.push(e)}));for(var s=a.length-1;s>=0;--s)r.remove(a[s])}i&&(Bt(this.featureChangeListenerKeys_[o]),delete this.featureChangeListenerKeys_[o])},e.prototype.setMap=function(e){var i=this.getMap(),o=this.featuresListenerKeys_,n=this.getFeatures_();i&&(o.forEach(Bt),o.length=0,n.forEach(this.forEachFeatureRemove_.bind(this))),t.prototype.setMap.call(this,e),e&&(this.features_?o.push(Gt(this.features_,ei,this.handleFeatureAdd_,this),Gt(this.features_,ii,this.handleFeatureRemove_,this)):this.source_&&o.push(Gt(this.source_,Od,this.handleFeatureAdd_,this),Gt(this.source_,Id,this.handleFeatureRemove_,this)),n.forEach(this.forEachFeatureAdd_.bind(this)))},e.prototype.snapTo=function(t,e,i){var o=Zi([i.getCoordinateFromPixel([t[0]-this.pixelTolerance_,t[1]+this.pixelTolerance_]),i.getCoordinateFromPixel([t[0]+this.pixelTolerance_,t[1]-this.pixelTolerance_])]),n=this.rBush_.getInExtent(o);this.vertex_&&!this.edge_&&(n=n.filter((function(t){return t.feature.getGeometry().getType()!==Do})));var r=!1,a=null,s=null;if(0===n.length)return{snapped:r,vertex:a,vertexPixel:s};i.getView().getProjection();for(var l,u=hn(e),p=1/0,d=0;d<n.length;++d){var h=n[d];dh[0]=hn(h.segment[0]),dh[1]=hn(h.segment[1]);var c=Ko(u,dh);c<p&&(l=h,p=c)}var f=l.segment;if(this.vertex_&&!this.edge_){var g=i.getPixelFromCoordinate(f[0]),m=i.getPixelFromCoordinate(f[1]),v=Uo(t,g),y=Uo(t,m);Math.sqrt(Math.min(v,y))<=this.pixelTolerance_&&(r=!0,a=v>y?f[1]:f[0],s=i.getPixelFromCoordinate(a))}else if(this.edge_){var _=l.feature.getGeometry().getType()===Do;if(_){var b=l.feature.getGeometry();null,a=dn(function(t,e){var i=e.getRadius(),o=e.getCenter(),n=o[0],r=o[1],a=t[0]-n,s=t[1]-r;0===a&&0===s&&(a=1);var l=Math.sqrt(a*a+s*s);return[n+i*a/l,r+i*s/l]}(u,b))}else dh[0]=hn(f[0]),dh[1]=hn(f[1]),a=dn(qo(u,dh));if(Xo(t,s=i.getPixelFromCoordinate(a))<=this.pixelTolerance_&&(r=!0,this.vertex_&&!_)){g=i.getPixelFromCoordinate(f[0]),m=i.getPixelFromCoordinate(f[1]),v=Uo(s,g),y=Uo(s,m);Math.sqrt(Math.min(v,y))<=this.pixelTolerance_&&(a=v>y?f[1]:f[0],s=i.getPixelFromCoordinate(a))}}return r&&(s=[Math.round(s[0]),Math.round(s[1])]),{snapped:r,vertex:a,vertexPixel:s}},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=Wa(e).getCoordinates()[0],o=0,n=i.length-1;o<n;++o){var r=i.slice(o,o+2),a={feature:t,segment:r};this.rBush_.insert(Zi(r),a)}},e.prototype.writeGeometryCollectionGeometry_=function(t,e){for(var i=e.getGeometriesArray(),o=0;o<i.length;++o){var n=this.SEGMENT_WRITERS_[i[o].getType()];n&&n(t,i[o])}},e.prototype.writeLineStringGeometry_=function(t,e){for(var i=e.getCoordinates(),o=0,n=i.length-1;o<n;++o){var r=i.slice(o,o+2),a={feature:t,segment:r};this.rBush_.insert(Zi(r),a)}},e.prototype.writeMultiLineStringGeometry_=function(t,e){for(var i=e.getCoordinates(),o=0,n=i.length;o<n;++o)for(var r=i[o],a=0,s=r.length-1;a<s;++a){var l=r.slice(a,a+2),u={feature:t,segment:l};this.rBush_.insert(Zi(l),u)}},e.prototype.writeMultiPointGeometry_=function(t,e){for(var i=e.getCoordinates(),o=0,n=i.length;o<n;++o){var r=i[o],a={feature:t,segment:[r,r]};this.rBush_.insert(e.getExtent(),a)}},e.prototype.writeMultiPolygonGeometry_=function(t,e){for(var i=e.getCoordinates(),o=0,n=i.length;o<n;++o)for(var r=i[o],a=0,s=r.length;a<s;++a)for(var l=r[a],u=0,p=l.length-1;u<p;++u){var d=l.slice(u,u+2),h={feature:t,segment:d};this.rBush_.insert(Zi(d),h)}},e.prototype.writePointGeometry_=function(t,e){var i=e.getCoordinates(),o={feature:t,segment:[i,i]};this.rBush_.insert(e.getExtent(),o)},e.prototype.writePolygonGeometry_=function(t,e){for(var i=e.getCoordinates(),o=0,n=i.length;o<n;++o)for(var r=i[o],a=0,s=r.length-1;a<s;++a){var l=r.slice(a,a+2),u={feature:t,segment:l};this.rBush_.insert(Zi(l),u)}},e}(lu);function ch(t){var e=t||{},i=new ai,o=new qu(-.005,.05,100);return(void 0===e.altShiftDragRotate||e.altShiftDragRotate)&&i.push(new ku),(void 0===e.doubleClickZoom||e.doubleClickZoom)&&i.push(new ru({delta:e.zoomDelta,duration:e.zoomDuration})),(void 0===e.dragPan||e.dragPan)&&i.push(new bu({onFocusOnly:e.onFocusOnly,kinetic:o})),(void 0===e.pinchRotate||e.pinchRotate)&&i.push(new Yu),(void 0===e.pinchZoom||e.pinchZoom)&&i.push(new $u({duration:e.zoomDuration})),(void 0===e.keyboard||e.keyboard)&&(i.push(new Gu),i.push(new Bu({delta:e.zoomDelta,duration:e.zoomDuration}))),(void 0===e.mouseWheelZoom||e.mouseWheelZoom)&&i.push(new Xu({onFocusOnly:e.onFocusOnly,duration:e.zoomDuration})),(void 0===e.shiftDragZoom||e.shiftDragZoom)&&i.push(new Iu({duration:e.zoomDuration})),i}var fh=function(){function t(t,e,i,o){this.minX=t,this.maxX=e,this.minY=i,this.maxY=o}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 gh(t,e,i,o,n){return void 0!==n?(n.minX=t,n.maxX=e,n.minY=i,n.maxY=o,n):new fh(t,e,i,o)}var mh=fh,vh=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 o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}(),yh=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 mh(0,0,0,0),i}return vh(e,t),e.prototype.isDrawableTile=function(t){var e=this.getLayer(),i=t.getState(),o=e.getUseInterimTilesOnError();return i==Er||i==Or||i==Pr&&!o},e.prototype.getTile=function(t,e,i,o){var n=o.pixelRatio,r=o.viewState.projection,a=this.getLayer(),s=a.getSource().getTile(t,e,i,n,r);return s.getState()==Pr&&(a.getUseInterimTilesOnError()?a.getPreload()>0&&(this.newTiles_=!0):s.setState(Er)),this.isDrawableTile(s)||(s=s.getInterimTile()),s},e.prototype.loadedTileCallback=function(e,i,o){return!!this.isDrawableTile(o)&&t.prototype.loadedTileCallback.call(this,e,i,o)},e.prototype.prepareFrame=function(t){return!!this.getLayer().getSource()},e.prototype.renderFrame=function(t,e){var i=t.layerStatesArray[t.layerIndex],o=t.viewState,n=o.projection,r=o.resolution,a=o.center,s=o.rotation,l=t.pixelRatio,u=this.getLayer(),p=u.getSource(),d=p.getRevision(),h=p.getTileGridForProjection(n),c=h.getZForResolution(r,p.zDirection),f=h.getResolution(c),g=t.extent,m=i.extent&&fn(i.extent);m&&(g=ko(g,fn(i.extent)));var v=p.getTilePixelRatio(l),y=Math.round(t.size[0]*v),_=Math.round(t.size[1]*v);if(s){var b=Math.round(Math.sqrt(y*y+_*_));y=b,_=b}var x=f*y/2/v,k=f*_/2/v,w=[a[0]-x,a[1]-k,a[0]+x,a[1]+k],S=h.getTileRangeForExtentAndZ(g,c),C={};C[c]={};var z=this.createLoadedTileFinder(p,n,C),T=this.tmpExtent,E=this.tmpTileRange_;this.newTiles_=!1;for(var P=S.minX;P<=S.maxX;++P)for(var O=S.minY;O<=S.maxY;++O){var j=this.getTile(c,P,O,t);if(this.isDrawableTile(j)){var R=Kt(this);if(j.getState()==Er){C[c][j.tileCoord.toString()]=j;var I=j.inTransition(R);this.newTiles_||!I&&-1!==this.renderedTiles.indexOf(j)||(this.newTiles_=!0)}if(1===j.getAlpha(R,t.time))continue}var F=h.getTileCoordChildTileRange(j.tileCoord,E,T),M=!1;F&&(M=z(c+1,F)),M||h.forEachTileCoordParentTileRange(j.tileCoord,z,E,T)}var A=f/r;kn(this.pixelTransform,t.size[0]/2,t.size[1]/2,1/v,1/v,s,-y/2,-_/2);var D=Sn(this.pixelTransform);this.useContainer(e,D,i.opacity);var L=this.context,G=L.canvas;wn(this.inversePixelTransform,this.pixelTransform),kn(this.tempTransform,y/2,_/2,A,A,0,-y/2,-_/2),G.width!=y||G.height!=_?(G.width=y,G.height=_):this.containerReused||L.clearRect(0,0,y,_),m&&this.clipUnrotated(L,t,m),bt(L,p.getContextOptions()),this.preRender(L,t),this.renderedTiles.length=0;var N,B,q,W=Object.keys(C).map(Number);W.sort(ht),1!==i.opacity||this.containerReused&&!p.getOpaque(t.viewState.projection)?(N=[],B=[]):W=W.reverse();for(var V=W.length-1;V>=0;--V){var U=W[V],X=p.getTilePixelSize(U,l,n),K=h.getResolution(U)/f,Y=X[0]*K*A,Z=X[1]*K*A,$=h.getTileCoordForCoordAndZ(wo(w),U),H=h.getTileCoordExtent($),J=bn(this.tempTransform,[v*(H[0]-w[0])/f,v*(w[3]-H[3])/f]),Q=v*p.getGutterForProjection(n),tt=C[U];for(var et in tt){var it=(j=tt[et]).tileCoord,ot=$[1]-it[1],nt=Math.round(J[0]-(ot-1)*Y),rt=$[2]-it[2],at=Math.round(J[1]-(rt-1)*Z),st=nt-(P=Math.round(J[0]-ot*Y)),lt=at-(O=Math.round(J[1]-rt*Z)),ut=c===U;if(!(I=ut&&1!==j.getAlpha(Kt(this),t.time)))if(N){L.save(),q=[P,O,P+st,O,P+st,O+lt,P,O+lt];for(var pt=0,dt=N.length;pt<dt;++pt)if(c!==U&&U<B[pt]){var ct=N[pt];L.beginPath(),L.moveTo(q[0],q[1]),L.lineTo(q[2],q[3]),L.lineTo(q[4],q[5]),L.lineTo(q[6],q[7]),L.moveTo(ct[6],ct[7]),L.lineTo(ct[4],ct[5]),L.lineTo(ct[2],ct[3]),L.lineTo(ct[0],ct[1]),L.clip()}N.push(q),B.push(U)}else L.clearRect(P,O,st,lt);this.drawTileImage(j,t,P,O,st,lt,Q,ut),N&&!I?(L.restore(),this.renderedTiles.unshift(j)):this.renderedTiles.push(j),this.updateUsedTiles(t.usedTiles,p,j)}}this.renderedRevision=d,this.renderedResolution=f,this.extentChanged=!this.renderedExtent_||!lo(this.renderedExtent_,w),this.renderedExtent_=w,this.renderedPixelRatio=l,this.renderedProjection=n,this.manageTilePyramid(t,p,h,l,n,g,c,u.getPreload()),this.scheduleExpireCache(t,p),this.postRender(L,t),i.extent&&L.restore(),D!==G.style.transform&&(G.style.transform=D);var ft=be(i.opacity),gt=this.container;return ft!==gt.style.opacity&&(gt.style.opacity=ft),this.container},e.prototype.drawTileImage=function(t,e,i,o,n,r,a,s){var l=this.getTileImage(t);if(l){var u=Kt(this),p=s?t.getAlpha(u,e.time):1,d=p!==this.context.globalAlpha;d&&(this.context.save(),this.context.globalAlpha=p),this.context.drawImage(l,a,a,l.width-2*a,l.height-2*a,i,o,n,r),d&&this.context.restore(),1!==p?e.animate=!0:s&&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 o=Kt(t);o in i.usedTiles&&t.expireCache(i.viewState.projection,i.usedTiles[o])}.bind(null,e);t.postRenderFunctions.push(i)}},e.prototype.updateUsedTiles=function(t,e,i){var o=Kt(e);o in t||(t[o]={}),t[o][i.getKey()]=!0},e.prototype.manageTilePyramid=function(t,e,i,o,n,r,a,s,l){var u=Kt(e);u in t.wantedTiles||(t.wantedTiles[u]={});var p,d,h,c,f,g,m=t.wantedTiles[u],v=t.tileQueue,y=0;for(g=i.getMinZoom();g<=a;++g)for(d=i.getTileRangeForExtentAndZ(r,g,d),h=i.getResolution(g),c=d.minX;c<=d.maxX;++c)for(f=d.minY;f<=d.maxY;++f)a-g<=s?(++y,(p=e.getTile(g,c,f,o,n)).getState()==zr&&(m[p.getKey()]=!0,v.isKeyQueued(p.getKey())||v.enqueue([p,u,i.getTileCoordCenter(p.tileCoord),h])),void 0!==l&&l(p)):e.useTile(g,c,f,n);e.updateCacheSize(y,n)},e}(Vp);yh.prototype.getLayer;var _h=yh,bh="image",xh="hybrid",kh="vector",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 o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}(),Sh={image:[Zp,Up,Yp,Kp,$p],hybrid:[Zp,Yp],vector:[]},Ch={hybrid:[Kp,$p,Xp],vector:[Zp,Up,Yp,Kp,$p,Xp]},zh=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 wh(e,t),e.prototype.prepareTile=function(t,e,i){var o,n=t.getState();return n!==Er&&n!==Pr||(this.updateExecutorGroup_(t,e,i),this.tileImageNeedsRender_(t)&&(o=!0)),o},e.prototype.getTile=function(e,i,o,n){var r=n.pixelRatio,a=n.viewState,s=a.resolution,l=a.projection,u=this.getLayer(),p=u.getSource().getTile(e,i,o,r,l),d=n.viewHints,h=!(d[Ir]||d[Fr]);return!h&&p.wantedResolution||(p.wantedResolution=s),this.prepareTile(p,r,l)&&(h||Date.now()-n.time<8)&&u.getRenderMode()!==kh&&this.renderTileImage_(p,n),t.prototype.getTile.call(this,e,i,o,n)},e.prototype.isDrawableTile=function(e){var i=this.getLayer();return t.prototype.isDrawableTile.call(this,e)&&(i.getRenderMode()===kh?Kt(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 o=this.getLayer(),n=o.getRevision(),r=o.getRenderOrder()||null,a=t.wantedResolution,s=t.getReplayState(o);if(s.dirty||s.renderedResolution!==a||s.renderedRevision!=n||s.renderedRenderOrder!=r){var l=o.getSource(),u=o.getDeclutter(),p=l.getTileGrid(),d=l.getTileGridForProjection(i).getTileCoordExtent(t.wrappedTileCoord),h=l.getSourceTiles(e,i,t),c=Kt(o);delete t.hitDetectionImageData[c],t.executorGroups[c]=[],u&&(t.declutterExecutorGroups[c]=[]);for(var f=function(i,n){var f=h[i];if(f.getState()!=Er)return"continue";var m=f.tileCoord,v=p.getTileCoordExtent(m),y=ko(d,v),_=$i(y,o.getRenderBuffer()*a,g.tmpExtent),b=lo(v,y)?null:_;s.dirty=!1;var x=new Np(0,_,a,e),k=u?new Np(0,y,a,e):void 0,w=yd(a,e),S=function(t){var e,i=t.getStyleFunction()||o.getStyleFunction();if(i&&(e=i(t,a)),e){var n=this.renderFeature(t,w,e,x,k);this.dirty_=this.dirty_||n,s.dirty=s.dirty||n}},C=f.getFeatures();r&&r!==s.renderedRenderOrder&&C.sort(r);for(var z=0,T=C.length;z<T;++z){var E=C[z];b&&!zo(b,E.getGeometry().getExtent())||S.call(g,E)}var P=x.finish(),O=o.getRenderMode()!==kh&&u&&1===h.length?null:y,j=new pd(O,a,e,l.getOverlaps(),P,o.getRenderBuffer());if(t.executorGroups[c].push(j),k){var R=new pd(null,a,e,l.getOverlaps(),k.finish(),o.getRenderBuffer());t.declutterExecutorGroups[c].push(R)}},g=this,m=0,v=h.length;m<v;++m)f(m);s.renderedRevision=n,s.renderedRenderOrder=r,s.renderedResolution=a}},e.prototype.forEachFeatureAtCoordinate=function(t,e,i,o,n){var r=e.viewState.resolution,a=e.viewState.rotation;i=null==i?0:i;var s=this.getLayer(),l=s.getSource().getTileGridForProjection(e.viewState.projection),u=Zi([t]);$i(u,r*i,u);for(var p,d={},h=function(t,e,i){var r=t.getId();void 0===r&&(r=Kt(t));var a=d[r];if(a){if(!0!==a&&i<a.distanceSq){if(0===i)return d[r]=!0,n.splice(n.lastIndexOf(a),1),o(t,s,e);a.geometry=e,a.distanceSq=i}}else{if(0===i)return d[r]=!0,o(t,s,e);n.push(d[r]={feature:t,layer:s,geometry:e,distanceSq:i,callback:o})}},c=this.renderedTiles,f=function(o,n){var d=c[o];if(!zo(l.getTileCoordExtent(d.wrappedTileCoord),u))return"continue";var f=Kt(s),g=[d.executorGroups[f]],m=d.declutterExecutorGroups[f];m&&g.push(m),g.some((function(o){for(var n=o===m?e.declutterTree.all().map((function(t){return t.value})):null,s=0,l=o.length;s<l;++s){var u=o[s];if(p=u.forEachFeatureAtCoordinate(t,r,a,i,h,n))return!0}}))},g=0,m=c.length;!p&&g<m;++g)f(g);return p},e.prototype.getFeatures=function(t){return new Promise(function(e,i){for(var o,n=this.getLayer(),r=Kt(n),a=n.getSource(),s=this.renderedProjection,l=s.getExtent(),u=this.renderedResolution,p=a.getTileGridForProjection(s),d=bn(this.renderedPixelToCoordinateTransform_,t.slice()),h=p.getTileCoordForCoordAndResolution(d,u),c=0,f=this.renderedTiles.length;c<f;++c)if(h.toString()===this.renderedTiles[c].tileCoord.toString()){if((o=this.renderedTiles[c]).getState()===Er){var g=p.getTileCoordExtent(o.tileCoord);a.getWrapX()&&s.canWrapX()&&!to(l,g)&&Yo(d,s);break}o=void 0}if(!o||o.loadingSourceTiles>0)e([]);else{var m=wo(p.getTileCoordExtent(o.wrappedTileCoord)),v=[(d[0]-m[0])/u,(m[1]-d[1])/u],y=o.getSourceTiles().reduce((function(t,e){return t.concat(e.getFeatures())}),[]),_=o.hitDetectionImageData[r];if(!_&&!this.animatingOrInteracting_){var b=$a(p.getTileSize(p.getZForResolution(u))),x=this.renderedRotation_;_=fd(b,[this.getRenderTransform(p.getTileCoordCenter(o.wrappedTileCoord),u,0,cd,b[0]*cd,b[1]*cd,0)],y,n.getStyleFunction(),p.getTileCoordExtent(o.wrappedTileCoord),o.getReplayState(n).renderedResolution,x),o.hitDetectionImageData[r]=_}e(gd(v,y,_))}}.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 o=t.viewHints,n=!(o[Ir]||o[Fr]),r=this.renderedTiles,a=0,s=r.length;a<s;++a){var l=r[a],u=l.declutterExecutorGroups[Kt(this.getLayer())];if(u)for(var p=u.length-1;p>=0;--p)u[p].execute(this.context,1,this.getTileRenderTransform(l,t),t.viewState.rotation,n,void 0,t.declutterTree)}e.globalAlpha=i},e.prototype.getTileRenderTransform=function(t,e){var i=e.pixelRatio,o=e.viewState,n=o.center,r=o.resolution,a=o.rotation,s=e.size,l=Math.round(s[0]*i),u=Math.round(s[1]*i),p=this.getLayer().getSource().getTileGridForProjection(e.viewState.projection),d=t.tileCoord,h=p.getTileCoordExtent(t.wrappedTileCoord),c=p.getTileCoordExtent(d,this.tmpExtent)[0]-h[0];return yn(xn(this.inversePixelTransform.slice(),1/i,1/i),this.getRenderTransform(n,r,a,i,l,u,c))},e.prototype.renderFrame=function(e,i){var o=e.viewHints,n=!(o[Ir]||o[Fr]);t.prototype.renderFrame.call(this,e,i),this.renderedPixelToCoordinateTransform_=e.pixelToCoordinateTransform.slice(),this.renderedRotation_=e.viewState.rotation;var r=this.getLayer(),a=r.getRenderMode(),s=this.context,l=s.globalAlpha;s.globalAlpha=r.getOpacity();for(var u=Ch[a],p=e.viewState.rotation,d=this.renderedTiles,h=[],c=[],f=d.length-1;f>=0;--f)for(var g=d[f],m=this.getTileRenderTransform(g,e),v=g.executorGroups[Kt(r)],y=!1,_=0,b=v.length;_<b;++_){var x=v[_];if(x.hasExecutors(u)){var k=g.tileCoord[0],w=void 0;if(!y&&(w=x.getClipCoords(m))){s.save();for(var S=0,C=h.length;S<C;++S){var z=h[S];k<c[S]&&(s.beginPath(),s.moveTo(w[0],w[1]),s.lineTo(w[2],w[3]),s.lineTo(w[4],w[5]),s.lineTo(w[6],w[7]),s.moveTo(z[6],z[7]),s.lineTo(z[4],z[5]),s.lineTo(z[2],z[3]),s.lineTo(z[0],z[1]),s.clip())}}x.execute(s,1,m,p,n,u),!y&&w&&(s.restore(),h.push(w),c.push(k),y=!0)}}return s.globalAlpha=l,this.container},e.prototype.renderFeature=function(t,e,i,o,n){if(!i)return!1;var r=!1;if(Array.isArray(i))for(var a=0,s=i.length;a<s;++a)r=bd(o,t,i[a],e,this.boundHandleStyleImageChange_,void 0,n)||r;else r=bd(o,t,i,e,this.boundHandleStyleImageChange_,void 0,n);return r},e.prototype.tileImageNeedsRender_=function(t){var e=this.getLayer();if(e.getRenderMode()===kh)return!1;var i=t.getReplayState(e),o=e.getRevision(),n=t.wantedResolution;return i.renderedTileResolution!==n||i.renderedTileRevision!==o},e.prototype.renderTileImage_=function(t,e){var i=this.getLayer(),o=t.getReplayState(i),n=i.getRevision(),r=t.executorGroups[Kt(i)];o.renderedTileRevision=n;var a=t.wrappedTileCoord,s=a[0],l=i.getSource(),u=e.pixelRatio,p=e.viewState.projection,d=l.getTileGridForProjection(p),h=d.getResolution(t.tileCoord[0]),c=e.pixelRatio/t.wantedResolution*h,f=d.getResolution(s),g=t.getContext(i);u=Math.round(Math.max(u,c/u));var m=l.getTilePixelSize(s,u,p);g.canvas.width=m[0],g.canvas.height=m[1];var v=u/c;if(1!==v){var y=vn(this.tmpTransform_);xn(y,v,v),g.setTransform.apply(g,y)}var _=d.getTileCoordExtent(a,this.tmpExtent),b=c/f,x=vn(this.tmpTransform_);xn(x,b,-b),function(t,e,i){yn(t,_n(mn,1,0,0,1,e,i))}(x,-_[0],-_[3]);for(var k=0,w=r.length;k<w;++k){r[k].execute(g,v,x,0,!0,Sh[i.getRenderMode()])}o.renderedTileResolution=t.wantedResolution},e}(_h),Th="preload",Eh="useInterimTilesOnError",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 o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}(),Oh=function(t){function e(e){var i=this,o=e||{},n=bt({},o);delete n.preload,delete n.useInterimTilesOnError,(i=t.call(this,n)||this).on,i.once,i.un,o.renderMode===bh&&(console.warn('renderMode: "image" is deprecated. Option ignored.'),o.renderMode=void 0);var r=o.renderMode||xh;return Re(r==xh||r==kh,28),i.renderMode_=r,i.setPreload(o.preload?o.preload:0),i.setUseInterimTilesOnError(void 0===o.useInterimTilesOnError||o.useInterimTilesOnError),i}return Ph(e,t),e.prototype.createRenderer=function(){return new zh(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(Th)},e.prototype.getUseInterimTilesOnError=function(){return this.get(Eh)},e.prototype.setPreload=function(t){this.set(Th,t)},e.prototype.setUseInterimTilesOnError=function(t){this.set(Eh,t)},e}(bp),jh=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 o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}(),Rh=function(t){function e(e,i,o){var n=t.call(this)||this,r=o||{};return n.tileCoord=e,n.state=i,n.interimTile=null,n.key="",n.transition_=void 0===r.transition?250:r.transition,n.transitionStarts_={},n}return jh(e,t),e.prototype.changed=function(){this.dispatchEvent(Tt)},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()==Er)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()==Er){t.interimTile=null;break}t.getState()==Tr?e=t:t.getState()==zr?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!==Pr&&this.state>t)throw new Error("Tile load sequence violation");this.state=t,this.changed()},e.prototype.load=function(){Ut()},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 o=e-i+1e3/60;return o>=this.transition_?1:si(o/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}(zt),Ih=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 o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}(),Fh=function(t){function e(e,i,o,n,r,a){var s=t.call(this,e,i,a)||this;return s.extent=null,s.format_=n,s.features_=null,s.loader_,s.projection=null,s.resolution,s.tileLoadFunction_=r,s.url_=o,s.key=o,s}return Ih(e,t),e.prototype.getFormat=function(){return this.format_},e.prototype.getFeatures=function(){return this.features_},e.prototype.load=function(){this.state==zr&&(this.setState(Tr),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(Pr)},e.prototype.setFeatures=function(t){this.features_=t,this.setState(Er)},e.prototype.setLoader=function(t){this.loader_=t},e}(Rh),Mh=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 Re(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 Re(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){Re(!(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 Ah(t,e,i,o){return void 0!==o?(o[0]=t,o[1]=e,o[2]=i,o):[t,e,i]}function Dh(t,e,i){return t+"/"+e+"/"+i}function Lh(t){return Dh(t[0],t[1],t[2])}function Gh(t){return t.split("/").map(Number)}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 o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}(),Bh=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return Nh(e,t),e.prototype.expireCache=function(t){for(;this.canExpireCache();){if(this.peekLast().getKey()in t)break;this.pop().release()}},e.prototype.pruneExceptNewestZ=function(){if(0!==this.getCount()){var t=Gh(this.peekFirstKey())[0];this.forEach(function(e){e.tileCoord[0]!==t&&(this.remove(Lh(e.tileCoord)),e.release())}.bind(this))}},e}(Mh),qh="tileloadstart",Wh="tileloadend",Vh="tileloaderror",Uh=[0,0,0],Xh=function(){function t(t){var e,i,o,n;if(this.minZoom=void 0!==t.minZoom?t.minZoom:0,this.resolutions_=t.resolutions,Re((e=this.resolutions_,i=!0,o=function(t,e){return e-t}||ht,e.every((function(t,n){if(0===n)return!0;var r=o(e[n-1],t);return!(r>0||i&&0===r)}))),17),!t.origins)for(var r=0,a=this.resolutions_.length-1;r<a;++r)if(n){if(this.resolutions_[r]/this.resolutions_[r+1]!==n){n=void 0;break}}else n=this.resolutions_[r]/this.resolutions_[r+1];this.zoomFactor_=n,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,Re(this.origins_.length==this.resolutions_.length,20));var s=t.extent;void 0===s||this.origin_||this.origins_||(this.origin_=wo(s)),Re(!this.origin_&&this.origins_||this.origin_&&!this.origins_,18),this.tileSizes_=null,void 0!==t.tileSizes&&(this.tileSizes_=t.tileSizes,Re(this.tileSizes_.length==this.resolutions_.length,19)),this.tileSize_=void 0!==t.tileSize?t.tileSize:this.tileSizes_?null:Lr,Re(!this.tileSize_&&this.tileSizes_||this.tileSize_&&!this.tileSizes_,22),this.extent_=void 0!==s?s: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 mh(Math.min(0,t[0]),Math.max(t[0]-1,-1),Math.min(0,t[1]),Math.max(t[1]-1,-1));if(s){var o=this.getTileRangeForExtentAndZ(s,e);i.minX=Math.max(o.minX,i.minX),i.maxX=Math.min(o.maxX,i.maxX),i.minY=Math.max(o.minY,i.minY),i.maxY=Math.min(o.maxY,i.maxY)}return i}),this):s&&this.calculateTileRanges_(s)}return t.prototype.forEachTileCoord=function(t,e,i){for(var o=this.getTileRangeForExtentAndZ(t,e),n=o.minX,r=o.maxX;n<=r;++n)for(var a=o.minY,s=o.maxY;a<=s;++a)i([e,n,a])},t.prototype.forEachTileCoordParentTileRange=function(t,e,i,o){var n,r,a=null,s=t[0]-1;for(2===this.zoomFactor_?(n=t[1],r=t[2]):a=this.getTileCoordExtent(t,o);s>=this.minZoom;){if(e(s,2===this.zoomFactor_?gh(n=Math.floor(n/2),n,r=Math.floor(r/2),r,i):this.getTileRangeForExtentAndZ(a,s,i)))return!0;--s}return!1},t.prototype.getExtent=function(){return this.extent_},t.prototype.getMaxZoom=function(){return this.maxZoom},t.prototype.getMinZoom=function(){return this.minZoom},t.prototype.getOrigin=function(t){return this.origin_?this.origin_:this.origins_[t]},t.prototype.getResolution=function(t){return this.resolutions_[t]},t.prototype.getResolutions=function(){return this.resolutions_},t.prototype.getTileCoordChildTileRange=function(t,e,i){if(t[0]<this.maxZoom){if(2===this.zoomFactor_){var o=2*t[1],n=2*t[2];return gh(o,o+1,n,n+1,e)}var r=this.getTileCoordExtent(t,i||this.tmpExtent_);return this.getTileRangeForExtentAndZ(r,t[0]+1,e)}return null},t.prototype.getTileRangeForTileCoordAndZ=function(t,e,i){if(e>this.maxZoom||e<this.minZoom)return null;var o=t[0],n=t[1],r=t[2];if(e===o)return gh(n,r,n,r,i);if(this.zoomFactor_){var a=Math.pow(this.zoomFactor_,e-o),s=Math.floor(n*a),l=Math.floor(r*a);return e<o?gh(s,s,l,l,i):gh(s,Math.floor(a*(n+1))-1,l,Math.floor(a*(r+1))-1,i)}var u=this.getTileCoordExtent(t,this.tmpExtent_);return this.getTileRangeForExtentAndZ(u,e,i)},t.prototype.getTileRangeExtent=function(t,e,i){var o=this.getOrigin(t),n=this.getResolution(t),r=$a(this.getTileSize(t),this.tmpSize_),a=o[0]+e.minX*r[0]*n,s=o[0]+(e.maxX+1)*r[0]*n;return no(a,o[1]+e.minY*r[1]*n,s,o[1]+(e.maxY+1)*r[1]*n,i)},t.prototype.getTileRangeForExtentAndZ=function(t,e,i){var o=Uh;this.getTileCoordForXYAndZ_(t[0],t[3],e,!1,o);var n=o[1],r=o[2];return this.getTileCoordForXYAndZ_(t[2],t[1],e,!0,o),gh(n,o[1],r,o[2],i)},t.prototype.getTileCoordCenter=function(t){var e=this.getOrigin(t[0]),i=this.getResolution(t[0]),o=$a(this.getTileSize(t[0]),this.tmpSize_);return[e[0]+(t[1]+.5)*o[0]*i,e[1]-(t[2]+.5)*o[1]*i]},t.prototype.getTileCoordExtent=function(t,e){var i=this.getOrigin(t[0]),o=this.getResolution(t[0]),n=$a(this.getTileSize(t[0]),this.tmpSize_),r=i[0]+t[1]*n[0]*o,a=i[1]-(t[2]+1)*n[1]*o;return no(r,a,r+n[0]*o,a+n[1]*o,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,o,n){var r=this.getZForResolution(i),a=i/this.getResolution(r),s=this.getOrigin(r),l=$a(this.getTileSize(r),this.tmpSize_),u=o?.5:0,p=o?.5:0,d=Math.floor((t-s[0])/i+u),h=Math.floor((s[1]-e)/i+p),c=a*d/l[0],f=a*h/l[1];return o?(c=Math.ceil(c)-1,f=Math.ceil(f)-1):(c=Math.floor(c),f=Math.floor(f)),Ah(r,c,f,n)},t.prototype.getTileCoordForXYAndZ_=function(t,e,i,o,n){var r=this.getOrigin(i),a=this.getResolution(i),s=$a(this.getTileSize(i),this.tmpSize_),l=o?.5:0,u=o?.5:0,p=Math.floor((t-r[0])/a+l),d=Math.floor((r[1]-e)/a+u),h=p/s[0],c=d/s[1];return o?(h=Math.ceil(h)-1,c=Math.ceil(c)-1):(h=Math.floor(h),c=Math.floor(c)),Ah(i,h,c,n)},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 Ie(ct(this.resolutions_,t,e||0),this.minZoom,this.maxZoom)},t.prototype.calculateTileRanges_=function(t){for(var e=this.resolutions_.length,i=new Array(e),o=this.minZoom;o<e;++o)i[o]=this.getTileRangeForExtentAndZ(t,o);this.fullTileRanges_=i},t}();function Kh(t){var e=t.getDefaultTileGrid();return e||(e=$h(t),t.setDefaultTileGrid(e)),e}function Yh(t){var e=t||{},i=e.extent||Jo("EPSG:3857").getExtent(),o={extent:i,minZoom:e.minZoom,tileSize:e.tileSize,resolutions:Zh(i,e.maxZoom,e.tileSize,e.maxResolution)};return new Xh(o)}function Zh(t,e,i,o){for(var n=void 0!==e?e:42,r=xo(t),a=Co(t),s=$a(void 0!==i?i:Lr),l=o>0?o:Math.max(a/s[0],r/s[1]),u=n+1,p=new Array(u),d=0;d<u;++d)p[d]=l/Math.pow(2,d);return p}function $h(t,e,i,o){return function(t,e,i,o){var n=void 0!==o?o:Bi,r=Zh(t,e,i);return new Xh({extent:t,origin:_o(t,n),resolutions:r,tileSize:i})}(Hh(t),e,i,o)}function Hh(t){var e=(t=Jo(t)).getExtent();if(!e){var i=180*yi[_i.DEGREES]/t.getMetersPerUnit();e=no(-i,-i,i,i)}return e}var Jh=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 o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}(),Qh=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 o=e.tileGrid;return o&&$a(o.getTileSize(o.getMinZoom()),[256,256]),i.tileCache=new Bh(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 Jh(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,o){var n=this.getTileCacheForProjection(t);if(!n)return!1;for(var r,a,s,l=!0,u=i.minX;u<=i.maxX;++u)for(var p=i.minY;p<=i.maxY;++p)a=Dh(e,u,p),s=!1,n.containsKey(a)&&(s=(r=n.get(a)).getState()===Er)&&(s=!1!==o(r)),s||(l=!1);return l},e.prototype.getGutterForProjection=function(t){return 0},e.prototype.getKey=function(){return this.key_},e.prototype.setKey=function(t){this.key_!==t&&(this.key_=t,this.changed())},e.prototype.getOpaque=function(t){return this.opaque_},e.prototype.getResolutions=function(){return this.tileGrid.getResolutions()},e.prototype.getTile=function(t,e,i,o,n){return Ut()},e.prototype.getTileGrid=function(){return this.tileGrid},e.prototype.getTileGridForProjection=function(t){return this.tileGrid?this.tileGrid:Kh(t)},e.prototype.getTileCacheForProjection=function(t){return Re(nn(this.getProjection(),t),68),this.tileCache},e.prototype.getTilePixelRatio=function(t){return this.tilePixelRatio_},e.prototype.getTilePixelSize=function(t,e,i){var o,n,r,a=this.getTileGridForProjection(i),s=this.getTilePixelRatio(e),l=$a(a.getTileSize(t),this.tmpSize);return 1==s?l:(o=l,n=s,void 0===(r=this.tmpSize)&&(r=[0,0]),r[0]=o[0]*n+.5|0,r[1]=o[1]*n+.5|0,r)},e.prototype.getTileCoordForTileUrlFunction=function(t,e){var i=void 0!==e?e:this.getProjection(),o=this.getTileGridForProjection(i);return this.getWrapX()&&i.isGlobal()&&(t=function(t,e,i){var o=e[0],n=t.getTileCoordCenter(e),r=Hh(i);if(Qi(r,n))return e;var a=Co(r),s=Math.ceil((r[0]-n[0])/a);return n[0]+=a*s,t.getTileCoordForCoordAndZ(n,o)}(o,t,i)),function(t,e){var i=t[0],o=t[1],n=t[2];if(e.getMinZoom()>i||i>e.getMaxZoom())return!1;var r=e.getFullTileRange(i);return!r||r.containsXY(o,n)}(t,o)?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,o){},e}(Pd),tc=function(t){function e(e,i){var o=t.call(this,e)||this;return o.tile=i,o}return Jh(e,t),e}(ut),ec=Qh;function ic(t,e){var i=/\{z\}/g,o=/\{x\}/g,n=/\{y\}/g,r=/\{-y\}/g;return function(a,s,l){return a?t.replace(i,a[0].toString()).replace(o,a[1].toString()).replace(n,a[2].toString()).replace(r,(function(){var t=a[0],i=e.getFullTileRange(t);return Re(i,55),(i.getHeight()-a[2]-1).toString()})):void 0}}function oc(t,e){for(var i=t.length,o=new Array(i),n=0;n<i;++n)o[n]=ic(t[n],e);return function(t){if(1===t.length)return t[0];return function(e,i,o){if(e){var n=Ge(function(t){return(t[1]<<t[0])+t[2]}(e),t.length);return t[n](e,i,o)}}}(o)}var nc=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 o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}(),rc=function(t){function e(i){var o=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 o.generateTileUrlFunction_=o.tileUrlFunction===e.prototype.tileUrlFunction,o.tileLoadFunction=i.tileLoadFunction,i.tileUrlFunction&&(o.tileUrlFunction=i.tileUrlFunction),o.urls=null,i.urls?o.setUrls(i.urls):i.url&&o.setUrl(i.url),o.tileLoadingKeys_={},o}return nc(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,o=Kt(i),n=i.getState();n==Tr?(this.tileLoadingKeys_[o]=!0,e=qh):o in this.tileLoadingKeys_&&(delete this.tileLoadingKeys_[o],e=n==Pr?Vh:n==Er?Wh:void 0),null!=e&&this.dispatchEvent(new tc(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 o=i[1].charCodeAt(0),n=i[2].charCodeAt(0),r=void 0;for(r=o;r<=n;++r)e.push(t.replace(i[0],String.fromCharCode(r)));return e}if(i=/\{(\d+)-(\d+)\}/.exec(t)){for(var a=parseInt(i[2],10),s=parseInt(i[1],10);s<=a;s++)e.push(t.replace(i[0],s.toString()));return e}return e.push(t),e}(t);this.urls=e,this.setUrls(e)},e.prototype.setUrls=function(t){this.urls=t;var e=t.join("\n");this.generateTileUrlFunction_?this.setTileUrlFunction(oc(t,this.tileGrid),e):this.setKey(e)},e.prototype.tileUrlFunction=function(t,e,i){},e.prototype.useTile=function(t,e,i){var o=Dh(t,e,i);this.tileCache.containsKey(o)&&this.tileCache.get(o)},e}(ec),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 o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}(),sc=[],lc=function(t){function e(e,i,o,n){var r=t.call(this,e,i,{transition:0})||this;return r.context_={},r.executorGroups={},r.declutterExecutorGroups={},r.loadingSourceTiles=0,r.hitDetectionImageData={},r.replayState_={},r.sourceTiles=[],r.errorTileKeys={},r.wantedResolution,r.getSourceTiles=n.bind(void 0,r),r.wrappedTileCoord=o,r}return ac(e,t),e.prototype.getContext=function(t){var e=Kt(t);return e in this.context_||(this.context_[e]=le(1,1,sc)),this.context_[e]},e.prototype.hasContext=function(t){return Kt(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=Kt(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_)sc.push(this.context_[e].canvas),delete this.context_[e];t.prototype.release.call(this)},e}(Rh),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 o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}(),pc=function(t){function e(e){var i=this,o=e.projection||"EPSG:3857",n=e.extent||Hh(o),r=e.tileGrid||Yh({extent:n,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:o,state:e.state,tileGrid:r,tileLoadFunction:e.tileLoadFunction?e.tileLoadFunction:dc,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 Bh(i.tileCache.highWaterMark),i.overlaps_=null==e.overlaps||e.overlaps,i.tileClass=e.tileClass?e.tileClass:Fh,i.tileGrids_={},i}return uc(e,t),e.prototype.getFeaturesInExtent=function(t){var e=[],i=this.tileCache;if(0===i.getCount())return e;var o=Gh(i.peekFirstKey())[0],n=this.tileGrid;return i.forEach((function(i){if(i.tileCoord[0]===o&&i.getState()===Er)for(var r=i.getSourceTiles(),a=0,s=r.length;a<s;++a){var l=r[a],u=l.tileCoord;if(zo(t,n.getTileCoordExtent(u))){var p=l.getFeatures();if(p)for(var d=0,h=p.length;d<h;++d){var c=p[d],f=c.getGeometry();zo(t,f.getExtent())&&e.push(c)}}}})),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 o=this.getTileCacheForProjection(e),n=Object.keys(i).reduce((function(t,e){var i,n,r=Dh((n=(i=e).substring(i.lastIndexOf("/")+1,i.length).split(",").map(Number))[0],n[1],n[2]);if(o.containsKey(r))for(var a=o.get(r).sourceTiles,s=0,l=a.length;s<l;++s)t[a[s].getKey()]=!0;return t}),{});t.prototype.expireCache.call(this,e,i),this.sourceTileCache.expireCache(n)},e.prototype.getSourceTiles=function(t,e,i){var o=this;if(i.getState()===zr){i.setState(Tr);var n=i.wrappedTileCoord,r=this.getTileGridForProjection(e),a=r.getTileCoordExtent(n),s=n[0],l=r.getResolution(s);$i(a,-l,a);var u=this.tileGrid,p=u.getExtent();p&&ko(a,p,a);var d=u.getZForResolution(l,1);u.forEachTileCoord(a,d,(function(n){var r=o.tileUrlFunction(n,t,e),a=o.sourceTileCache.containsKey(r)?o.sourceTileCache.get(r):new o.tileClass(n,r?zr:Or,r,o.format_,o.tileLoadFunction);i.sourceTiles.push(a);var s=a.getState();if(s<Er){var l=function(t){o.handleTileChange(t);var e=a.getState();if(e===Er||e===Pr){var n=a.getKey();n in i.errorTileKeys?a.getState()===Er&&delete i.errorTileKeys[n]:i.loadingSourceTiles--,e===Pr?i.errorTileKeys[n]=!0:a.removeEventListener(Tt,l),0===i.loadingSourceTiles&&i.setState(wt(i.errorTileKeys)?Er:Pr)}};a.addEventListener(Tt,l),i.loadingSourceTiles++}s===zr&&(a.extent=u.getTileCoordExtent(n),a.projection=e,a.resolution=u.getResolution(n[0]),o.sourceTileCache.set(r,a),a.load())})),i.loadingSourceTiles||i.setState(i.sourceTiles.some((function(t){return t.getState()===Pr}))?Pr:Er)}return i.sourceTiles},e.prototype.getTile=function(t,e,i,o,n){var r,a=Dh(t,e,i),s=this.getKey();if(this.tileCache.containsKey(a)&&(r=this.tileCache.get(a)).key===s)return r;var l=[t,e,i],u=this.getTileCoordForTileUrlFunction(l,n),p=this.getTileGrid().getExtent(),d=this.getTileGridForProjection(n);if(u&&p){var h=d.getTileCoordExtent(u);$i(h,-d.getResolution(t),h),zo(p,h)||(u=null)}var c=!0;if(null!==u){var f=this.tileGrid,g=d.getResolution(t),m=f.getZForResolution(g,1),v=d.getTileCoordExtent(u);$i(v,-g,v),f.forEachTileCoord(v,m,function(t){c=c&&!this.tileUrlFunction(t,o,n)}.bind(this))}var y=new lc(l,c?Or:zr,u,this.getSourceTiles.bind(this,o,n));return y.key=s,r?(y.interimTile=r,y.refreshInterimChain(),this.tileCache.replace(a,y)):this.tileCache.set(a,y),y},e.prototype.getTileGridForProjection=function(t){var e=t.getCode(),i=this.tileGrids_[e];if(!i){var o=this.tileGrid;i=$h(t,void 0,o?o.getTileSize(o.getMinZoom()):void 0),this.tileGrids_[e]=i}return i},e.prototype.getTilePixelRatio=function(t){return t},e.prototype.getTilePixelSize=function(t,e,i){var o=$a(this.getTileGridForProjection(i).getTileSize(t),this.tmpSize);return[Math.round(o[0]*e),Math.round(o[1]*e)]},e.prototype.updateCacheSize=function(e,i){t.prototype.updateCacheSize.call(this,2*e,i),this.sourceTileCache.highWaterMark=this.getTileCacheForProjection(i).highWaterMark},e}(rc);function dc(t,e){t.setLoader((function(i,o,n){Ld(e,t.getFormat(),i,o,n,t.onLoad.bind(t),t.onError.bind(t))}))}var hc=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 o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}(),cc=function(t){function e(e){return(e=bt({},e)).controls||(e.controls=us()),e.interactions||(e.interactions=ch({onFocusOnly:!0})),t.call(this,e)||this}return hc(e,t),e.prototype.createRenderer=function(){return new ur(this)},e}(Ja),fc=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 o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}();var gc,mc=function(t){function e(e,i,o,n,r,a){var s=t.call(this,e,i,a)||this;return s.crossOrigin_=n,s.src_=o,s.key=o,s.image_=new Image,null!==n&&(s.image_.crossOrigin=n),s.unlisten_=null,s.tileLoadFunction_=r,s}return fc(e,t),e.prototype.getImage=function(){return this.image_},e.prototype.setImage=function(t){this.image_=t,this.state=Er,this.unlistenImage_(),this.changed()},e.prototype.handleImageError_=function(){var t;this.state=Pr,this.unlistenImage_(),this.image_=((t=le(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=Er:this.state=Or,this.unlistenImage_(),this.changed()},e.prototype.load=function(){this.state==Pr&&(this.state=zr,this.image_=new Image,null!==this.crossOrigin_&&(this.image_.crossOrigin=this.crossOrigin_)),this.state==zr&&(this.state=Tr,this.changed(),this.tileLoadFunction_(this,this.src_),this.unlisten_=el(this.image_,this.handleImageLoad_.bind(this),this.handleImageError_.bind(this)))},e.prototype.unlistenImage_=function(){this.unlisten_&&(this.unlisten_(),this.unlisten_=null)},e}(Rh),vc=function(){function t(t,e,i,o,n,r){this.sourceProj_=t,this.targetProj_=e;var a={},s=an(this.targetProj_,this.sourceProj_);this.transformInv_=function(t){var e=t[0]+"/"+t[1];return a[e]||(a[e]=s(t)),a[e]},this.maxSourceExtent_=o,this.errorThresholdSquared_=n*n,this.triangles_=[],this.wrapsXInSource_=!1,this.canWrapXInSource_=this.sourceProj_.canWrapX()&&!!o&&!!this.sourceProj_.getExtent()&&Co(o)==Co(this.sourceProj_.getExtent()),this.sourceWorldWidth_=this.sourceProj_.getExtent()?Co(this.sourceProj_.getExtent()):null,this.targetWorldWidth_=this.targetProj_.getExtent()?Co(this.targetProj_.getExtent()):null;var l=wo(i),u=So(i),p=vo(i),d=mo(i),h=this.transformInv_(l),c=this.transformInv_(u),f=this.transformInv_(p),g=this.transformInv_(d),m=10+(r?Math.max(0,Math.ceil(Me(go(i)/(r*r*256*256)))):0);if(this.addQuad_(l,u,p,d,h,c,f,g,m),this.wrapsXInSource_){var v=1/0;this.triangles_.forEach((function(t,e,i){v=Math.min(v,t.source[0][0],t.source[1][0],t.source[2][0])})),this.triangles_.forEach(function(t){if(Math.max(t.source[0][0],t.source[1][0],t.source[2][0])-v>this.sourceWorldWidth_/2){var e=[[t.source[0][0],t.source[0][1]],[t.source[1][0],t.source[1][1]],[t.source[2][0],t.source[2][1]]];e[0][0]-v>this.sourceWorldWidth_/2&&(e[0][0]-=this.sourceWorldWidth_),e[1][0]-v>this.sourceWorldWidth_/2&&(e[1][0]-=this.sourceWorldWidth_),e[2][0]-v>this.sourceWorldWidth_/2&&(e[2][0]-=this.sourceWorldWidth_);var 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))}a={}}return t.prototype.addTriangle_=function(t,e,i,o,n,r){this.triangles_.push({source:[o,n,r],target:[t,e,i]})},t.prototype.addQuad_=function(t,e,i,o,n,r,a,s,l){var u=Zi([n,r,a,s]),p=this.sourceWorldWidth_?Co(u)/this.sourceWorldWidth_:null,d=this.sourceWorldWidth_,h=this.sourceProj_.canWrapX()&&p>.5&&p<1,c=!1;if(l>0){if(this.targetProj_.isGlobal()&&this.targetWorldWidth_)c=Co(Zi([t,e,i,o]))/this.targetWorldWidth_>.25||c;!h&&this.sourceProj_.isGlobal()&&p&&(c=p>.25||c)}if(!(!c&&this.maxSourceExtent_&&isFinite(u[0])&&isFinite(u[1])&&isFinite(u[2])&&isFinite(u[3]))||zo(u,this.maxSourceExtent_)){var f=0;if(!(c||isFinite(n[0])&&isFinite(n[1])&&isFinite(r[0])&&isFinite(r[1])&&isFinite(a[0])&&isFinite(a[1])&&isFinite(s[0])&&isFinite(s[1])))if(l>0)c=!0;else if(1!=(f=(isFinite(n[0])&&isFinite(n[1])?0:8)+(isFinite(r[0])&&isFinite(r[1])?0:4)+(isFinite(a[0])&&isFinite(a[1])?0:2)+(isFinite(s[0])&&isFinite(s[1])?0:1))&&2!=f&&4!=f&&8!=f)return;if(l>0){if(!c){var g=[(t[0]+i[0])/2,(t[1]+i[1])/2],m=this.transformInv_(g),v=void 0;if(h)v=(Ge(n[0],d)+Ge(a[0],d))/2-Ge(m[0],d);else v=(n[0]+a[0])/2-m[0];var y=(n[1]+a[1])/2-m[1];c=v*v+y*y>this.errorThresholdSquared_}if(c){if(Math.abs(t[0]-i[0])<=Math.abs(t[1]-i[1])){var _=[(e[0]+i[0])/2,(e[1]+i[1])/2],b=this.transformInv_(_),x=[(o[0]+t[0])/2,(o[1]+t[1])/2],k=this.transformInv_(x);this.addQuad_(t,e,_,x,n,r,b,k,l-1),this.addQuad_(x,_,i,o,k,b,a,s,l-1)}else{var w=[(t[0]+e[0])/2,(t[1]+e[1])/2],S=this.transformInv_(w),C=[(i[0]+o[0])/2,(i[1]+o[1])/2],z=this.transformInv_(C);this.addQuad_(t,w,C,o,n,S,z,s,l-1),this.addQuad_(w,e,i,C,S,r,a,z,l-1)}return}}if(h){if(!this.canWrapXInSource_)return;this.wrapsXInSource_=!0}0==(11&f)&&this.addTriangle_(t,i,o,n,a,s),0==(14&f)&&this.addTriangle_(t,i,e,n,a,r),f&&(0==(13&f)&&this.addTriangle_(e,o,t,r,s,n),0==(7&f)&&this.addTriangle_(e,o,i,r,s,a))}},t.prototype.calculateSourceExtent=function(){var t=[1/0,1/0,-1/0,-1/0];return this.triangles_.forEach((function(e,i,o){var n=e.source;po(t,n[0]),po(t,n[1]),po(t,n[2])})),t},t.prototype.getTriangles=function(){return this.triangles_},t}(),yc={imageSmoothingEnabled:!1,msImageSmoothingEnabled:!1};function _c(t,e,i,o,n){t.beginPath(),t.moveTo(0,0),t.lineTo(e,i),t.lineTo(o,n),t.closePath(),t.save(),t.clip(),t.fillRect(0,0,Math.max(e,o)+1,Math.max(i,n)),t.restore()}function bc(t,e){return Math.abs(t[4*e]-210)>2||Math.abs(t[4*e+3]-191.25)>2}function xc(t,e,i,o){var n=sn(i,e,t),r=Qo(e,o,i),a=e.getMetersPerUnit();void 0!==a&&(r*=a);var s=t.getMetersPerUnit();void 0!==s&&(r/=s);var l=t.getExtent();if(!l||Qi(l,n)){var u=Qo(t,r,n)/r;isFinite(u)&&u>0&&(r/=u)}return r}function kc(t,e,i,o,n,r,a,s,l,u,p,d){var h=le(Math.round(i*t),Math.round(i*e));if(bt(h,d),0===l.length)return h.canvas;function c(t){return Math.round(t*i)/i}h.scale(i,i),h.globalCompositeOperation="lighter";var f=[1/0,1/0,-1/0,-1/0];l.forEach((function(t,e,i){uo(f,t.extent)}));var g=Co(f),m=xo(f),v=le(Math.round(i*g/o),Math.round(i*m/o));bt(v,d);var y=i/o;l.forEach((function(t,e,i){var o=t.extent[0]-f[0],n=-(t.extent[3]-f[3]),r=Co(t.extent),a=xo(t.extent);t.image.width>0&&t.image.height>0&&v.drawImage(t.image,u,u,t.image.width-2*u,t.image.height-2*u,o*y,n*y,r*y,a*y)}));var _=wo(a);return s.getTriangles().forEach((function(t,e,n){var a=t.source,s=t.target,l=a[0][0],u=a[0][1],p=a[1][0],g=a[1][1],m=a[2][0],y=a[2][1],b=c((s[0][0]-_[0])/r),x=c(-(s[0][1]-_[1])/r),k=c((s[1][0]-_[0])/r),w=c(-(s[1][1]-_[1])/r),S=c((s[2][0]-_[0])/r),C=c(-(s[2][1]-_[1])/r),z=l,T=u;l=0,u=0;var E=function(t){for(var e=t.length,i=0;i<e;i++){for(var o=i,n=Math.abs(t[i][i]),r=i+1;r<e;r++){var a=Math.abs(t[r][i]);a>n&&(n=a,o=r)}if(0===n)return null;var s=t[o];t[o]=t[i],t[i]=s;for(var l=i+1;l<e;l++)for(var u=-t[l][i]/t[i][i],p=i;p<e+1;p++)i==p?t[l][p]=0:t[l][p]+=u*t[i][p]}for(var d=new Array(e),h=e-1;h>=0;h--){d[h]=t[h][e]/t[h][h];for(var c=h-1;c>=0;c--)t[c][e]-=t[c][h]*d[h]}return d}([[p-=z,g-=T,0,0,k-b],[m-=z,y-=T,0,0,S-b],[0,0,p,g,w-x],[0,0,m,y,C-x]]);if(E){if(h.save(),h.beginPath(),function(){if(void 0===gc){var t=document.createElement("canvas").getContext("2d");t.globalCompositeOperation="lighter",t.fillStyle="rgba(210, 0, 0, 0.75)",_c(t,4,5,4,0),_c(t,4,5,0,5);var e=t.getImageData(0,0,3,3).data;gc=bc(e,0)||bc(e,4)||bc(e,8)}return gc}()||d===yc){h.moveTo(k,w);for(var P=b-k,O=x-w,j=0;j<4;j++)h.lineTo(k+c((j+1)*P/4),w+c(j*O/3)),3!=j&&h.lineTo(k+c((j+1)*P/4),w+c((j+1)*O/3));h.lineTo(S,C)}else h.moveTo(k,w),h.lineTo(b,x),h.lineTo(S,C);h.clip(),h.transform(E[0],E[2],E[1],E[3],b,x),h.translate(f[0]-z,f[3]-T),h.scale(o/i,-o/i),h.drawImage(v.canvas,0,0),h.restore()}})),p&&(h.save(),h.globalCompositeOperation="source-over",h.strokeStyle="black",h.lineWidth=1,s.getTriangles().forEach((function(t,e,i){var o=t.target,n=(o[0][0]-_[0])/r,a=-(o[0][1]-_[1])/r,s=(o[1][0]-_[0])/r,l=-(o[1][1]-_[1])/r,u=(o[2][0]-_[0])/r,p=-(o[2][1]-_[1])/r;h.beginPath(),h.moveTo(s,l),h.lineTo(n,a),h.lineTo(u,p),h.closePath(),h.stroke()})),h.restore()),h.canvas}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 o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}(),Sc=function(t){function e(e,i,o,n,r,a,s,l,u,p,d,h){var c=t.call(this,r,zr)||this;c.renderEdges_=void 0!==d&&d,c.contextOptions_=h,c.pixelRatio_=s,c.gutter_=l,c.canvas_=null,c.sourceTileGrid_=i,c.targetTileGrid_=n,c.wrappedTileCoord_=a||r,c.sourceTiles_=[],c.sourcesListenerKeys_=null,c.sourceZ_=0;var f=n.getTileCoordExtent(c.wrappedTileCoord_),g=c.targetTileGrid_.getExtent(),m=c.sourceTileGrid_.getExtent(),v=g?ko(f,g):f;if(0===go(v))return c.state=Or,c;var y=e.getExtent();y&&(m=m?ko(m,y):y);var _=n.getResolution(c.wrappedTileCoord_[0]),b=function(t,e,i,o){var n=yo(i),r=xc(t,e,n,o);return(!isFinite(r)||r<=0)&&fo(i,(function(i){return r=xc(t,e,i,o),isFinite(r)&&r>0})),r}(e,o,v,_);if(!isFinite(b)||b<=0)return c.state=Or,c;var x=void 0!==p?p:.5;if(c.triangulation_=new vc(e,o,v,m,b*x,_),0===c.triangulation_.getTriangles().length)return c.state=Or,c;c.sourceZ_=i.getZForResolution(b);var k=c.triangulation_.calculateSourceExtent();if(m&&(e.canWrapX()?(k[1]=Ie(k[1],m[1],m[3]),k[3]=Ie(k[3],m[1],m[3])):k=ko(k,m)),go(k)){for(var w=i.getTileRangeForExtentAndZ(k,c.sourceZ_),S=w.minX;S<=w.maxX;S++)for(var C=w.minY;C<=w.maxY;C++){var z=u(c.sourceZ_,S,C,s);z&&c.sourceTiles_.push(z)}0===c.sourceTiles_.length&&(c.state=Or)}else c.state=Or;return c}return wc(e,t),e.prototype.getImage=function(){return this.canvas_},e.prototype.reproject_=function(){var t=[];if(this.sourceTiles_.forEach(function(e,i,o){e&&e.getState()==Er&&t.push({extent:this.sourceTileGrid_.getTileCoordExtent(e.tileCoord),image:e.getImage()})}.bind(this)),this.sourceTiles_.length=0,0===t.length)this.state=Pr;else{var e=this.wrappedTileCoord_[0],i=this.targetTileGrid_.getTileSize(e),o="number"==typeof i?i:i[0],n="number"==typeof i?i:i[1],r=this.targetTileGrid_.getResolution(e),a=this.sourceTileGrid_.getResolution(this.sourceZ_),s=this.targetTileGrid_.getTileCoordExtent(this.wrappedTileCoord_);this.canvas_=kc(o,n,this.pixelRatio_,a,this.sourceTileGrid_.getExtent(),r,s,this.triangulation_,t,this.gutter_,this.renderEdges_,this.contextOptions_),this.state=Er}this.changed()},e.prototype.load=function(){if(this.state==zr){this.state=Tr,this.changed();var t=0;this.sourcesListenerKeys_=[],this.sourceTiles_.forEach(function(e,i,o){var n=e.getState();if(n==zr||n==Tr){t++;var r=Gt(e,Tt,(function(i){var o=e.getState();o!=Er&&o!=Pr&&o!=Or||(Bt(r),0===--t&&(this.unlistenSources_(),this.reproject_()))}),this);this.sourcesListenerKeys_.push(r)}}.bind(this)),0===t?setTimeout(this.reproject_.bind(this),0):this.sourceTiles_.forEach((function(t,e,i){t.getState()==zr&&t.load()}))}},e.prototype.unlistenSources_=function(){this.sourcesListenerKeys_.forEach(Bt),this.sourcesListenerKeys_=null},e}(Rh),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 o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}();function zc(t,e){t.getImage().src=e}var Tc=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:zc,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:mc,i.tileCacheForProjection={},i.tileGridForProjection={},i.reprojectionErrorThreshold_=e.reprojectionErrorThreshold,i.contextOptions_=!1===e.imageSmoothing?yc:void 0,i.renderReprojectionEdges_=!1,i}return Cc(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 o in this.tileCache.expireCache(this.tileCache==i?e:{}),this.tileCacheForProjection){var n=this.tileCacheForProjection[o];n.expireCache(n==i?e:{})}},e.prototype.getContextOptions=function(){return this.contextOptions_},e.prototype.getGutterForProjection=function(t){return this.getProjection()&&t&&!nn(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&&!nn(this.getProjection(),e))&&t.prototype.getOpaque.call(this,e)},e.prototype.getTileGridForProjection=function(t){var e=this.getProjection();if(!this.tileGrid||e&&!nn(e,t)){var i=Kt(t);return i in this.tileGridForProjection||(this.tileGridForProjection[i]=Kh(t)),this.tileGridForProjection[i]}return this.tileGrid},e.prototype.getTileCacheForProjection=function(t){var e=this.getProjection();if(!e||nn(e,t))return this.tileCache;var i=Kt(t);return i in this.tileCacheForProjection||(this.tileCacheForProjection[i]=new Bh(this.tileCache.highWaterMark)),this.tileCacheForProjection[i]},e.prototype.createTile_=function(t,e,i,o,n,r){var a=[t,e,i],s=this.getTileCoordForTileUrlFunction(a,n),l=s?this.tileUrlFunction(s,o,n):void 0,u=new this.tileClass(a,void 0!==l?zr:Or,void 0!==l?l:"",this.crossOrigin,this.tileLoadFunction,this.tileOptions);return u.key=r,u.addEventListener(Tt,this.handleTileChange.bind(this)),u},e.prototype.getTile=function(t,e,i,o,n){var r=this.getProjection();if(r&&n&&!nn(r,n)){var a=this.getTileCacheForProjection(n),s=[t,e,i],l=void 0,u=Lh(s);a.containsKey(u)&&(l=a.get(u));var p=this.getKey();if(l&&l.key==p)return l;var d=this.getTileGridForProjection(r),h=this.getTileGridForProjection(n),c=this.getTileCoordForTileUrlFunction(s,n),f=new Sc(r,d,n,h,s,c,this.getTilePixelRatio(o),this.getGutter(),function(t,e,i,o){return this.getTileInternal(t,e,i,o,r)}.bind(this),this.reprojectionErrorThreshold_,this.renderReprojectionEdges_,this.contextOptions_);return f.key=p,l?(f.interimTile=l,f.refreshInterimChain(),a.replace(u,f)):a.set(u,f),f}return this.getTileInternal(t,e,i,o,r||n)},e.prototype.getTileInternal=function(t,e,i,o,n){var r=null,a=Dh(t,e,i),s=this.getKey();if(this.tileCache.containsKey(a)){if((r=this.tileCache.get(a)).key!=s){var l=r;r=this.createTile_(t,e,i,o,n,s),l.getState()==zr?r.interimTile=l.interimTile:r.interimTile=l,r.refreshInterimChain(),this.tileCache.replace(a,r)}}else r=this.createTile_(t,e,i,o,n,s),this.tileCache.set(a,r);return r},e.prototype.setRenderReprojectionEdges=function(t){if(this.renderReprojectionEdges_!=t){for(var e in this.renderReprojectionEdges_=t,this.tileCacheForProjection)this.tileCacheForProjection[e].clear();this.changed()}},e.prototype.setTileGridForProjection=function(t,e){var i=Jo(t);if(i){var o=Kt(i);o in this.tileGridForProjection||(this.tileGridForProjection[o]=e)}},e}(rc),Ec=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 o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}(),Pc=function(t){function e(e){var i=this,o=e||{},n=bt({},o);return delete n.preload,delete n.useInterimTilesOnError,(i=t.call(this,n)||this).on,i.once,i.un,i.setPreload(void 0!==o.preload?o.preload:0),i.setUseInterimTilesOnError(void 0===o.useInterimTilesOnError||o.useInterimTilesOnError),i}return Ec(e,t),e.prototype.getPreload=function(){return this.get(Th)},e.prototype.setPreload=function(t){this.set(Th,t)},e.prototype.getUseInterimTilesOnError=function(){return this.get(Eh)},e.prototype.setUseInterimTilesOnError=function(t){this.set(Eh,t)},e}(Je),Oc=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 o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}(),jc=function(t){function e(e){return t.call(this,e)||this}return Oc(e,t),e.prototype.createRenderer=function(){return new _h(this)},e}(Pc),Rc={$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}},projection:{type:"projection",doc:"The projection the map should be rendered in. Suported projections are Albers, Equal Earth, Equirectangular (WGS84), Lambert conformal conic, Mercator, Natural Earth, and Winkel Tripel. Terrain, fog, sky and CustomLayerInterface are not supported for projections other than mercator.",example:{name:"albers",center:[-154,50],parallels:[55,65]}},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:'An 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. The `["pitch"]` and `["distance-from-center"]` expressions are supported only for filter expressions on the symbol layer.'},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. SDF images are not supported in formatted text and will be ignored.","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_symbol:{type:"boolean",doc:'Expression which determines whether or not to display a symbol. Symbols support dynamic filtering, meaning this expression can use the `["pitch"]` and `["distance-from-center"]` expressions to reference the current state of the view.',default:!1,transition:!1,"property-type":"data-driven",expression:{interpolated:!1,parameters:["zoom","feature","pitch","distance-from-center"]}},filter_fill:{type:"boolean",doc:'Expression which determines whether or not to display a polygon. Fill layer does NOT support dynamic filtering, meaning this expression can NOT use the `["pitch"]` and `["distance-from-center"]` expressions to reference the current state of the view.',default:!1,transition:!1,"property-type":"data-driven",expression:{interpolated:!1,parameters:["zoom","feature"]}},filter_line:{type:"boolean",doc:'Expression which determines whether or not to display a Polygon or LineString. Line layer does NOT support dynamic filtering, meaning this expression can NOT use the `["pitch"]` and `["distance-from-center"]` expressions to reference the current state of the view.',default:!1,transition:!1,"property-type":"data-driven",expression:{interpolated:!1,parameters:["zoom","feature"]}},filter_circle:{type:"boolean",doc:'Expression which determines whether or not to display a circle. Circle layer does NOT support dynamic filtering, meaning this expression can NOT use the `["pitch"]` and `["distance-from-center"]` expressions to reference the current state of the view.',default:!1,transition:!1,"property-type":"data-driven",expression:{interpolated:!1,parameters:["zoom","feature"]}},"filter_fill-extrusion":{type:"boolean",doc:'Expression which determines whether or not to display a Polygon. Fill-extrusion layer does NOT support dynamic filtering, meaning this expression can NOT use the `["pitch"]` and `["distance-from-center"]` expressions to reference the current state of the view.',default:!1,transition:!1,"property-type":"data-driven",expression:{interpolated:!1,parameters:["zoom","feature"]}},filter_heatmap:{type:"boolean",doc:'Expression used to determine whether a point is being displayed or not. Heatmap layer does NOT support dynamic filtering, meaning this expression can NOT use the `["pitch"]` and `["distance-from-center"]` expressions to reference the current state of the view.',default:!1,transition:!1,"property-type":"data-driven",expression:{interpolated:!1,parameters:["zoom","feature"]}},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 valid value is obtained. Invalid values are `null` and [`'image'`](#types-image) expressions that are unavailable in the style. If all values are invalid, `coalesce` returns the first value listed.",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 a [`ResolvedImage`](/mapbox-gl-js/style-spec/types/#resolvedimage) for use in [`icon-image`](/mapbox-gl-js/style-spec/layers/#layout-symbol-icon-image), `*-pattern` entries, and as a section in the [`'format'`](#types-format) expression. A [`'coalesce'`](#coalesce) expression containing `image` expressions will evaluate to the first listed image that 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`](#types-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`](#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. If the input is an [`\'image\'`](#types-image) expression, `\'to-string\'` returns the image name. 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:"Returns 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:'Returns 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:"Returns 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:"Returns 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:'Returns 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:"Camera","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},pitch:{doc:'Returns the current pitch in degrees. `["pitch"]` may only be used in the `filter` expression for a `symbol` layer.',group:"Camera","sdk-support":{"basic functionality":{js:"2.6.0"}}},"distance-from-center":{doc:'Returns the distance of a `symbol` instance from the center of the map. The distance is measured in pixels divided by the height of the map container. It measures 0 at the center, decreases towards the camera and increase away from the camera. For example, if the height of the map is 1000px, a value of -1 means 1000px away from the center towards the camera, and a value of 1 means a distance of 1000px away from the camera from the center. `["distance-from-center"]` may only be used in the `filter` expression for a `symbol` layer.',group:"Camera","sdk-support":{"basic functionality":{js:"2.6.0"}}},"heatmap-density":{doc:"Returns 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:"Returns 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:"Returns 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:"Returns 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"}}}},projection:{name:{type:"enum",values:{albers:{doc:"An Albers equal-area projection centered on the continental United States. You can configure the projection for a different region by setting `center` and `parallels` properties. You may want to set max bounds to constrain the map to the relevant region."},equalEarth:{doc:"An Equal Earth projection."},equirectangular:{doc:"An Equirectangular projection. This projection is very similar to the Plate Carrée projection."},lambertConformalConic:{doc:"A Lambert conformal conic projection. You can configure the projection for a region by setting `center` and `parallels` properties. You may want to set max bounds to constrain the map to the relevant region."},mercator:{doc:"The Mercator projection is the default projection."},naturalEarth:{doc:"A Natural Earth projection."},winkelTripel:{doc:"A Winkel Tripel projection."}},default:"mercator",doc:"The name of the projection to be used for rendering the map.",required:!0,"sdk-support":{"basic functionality":{js:"2.6.0"}}},center:{type:"array",length:2,value:"number","property-type":"data-constant",transition:!1,doc:"The reference longitude and latitude of the projection. `center` takes the form of [lng, lat]. This property is only configurable for conic projections (Albers and Lambert Conformal Conic). All other projections are centered on [0, 0].",example:[-96,37.5],requires:[{name:["albers","lambertConformalConic"]}],"sdk-support":{"basic functionality":{js:"2.6.0"}}},parallels:{type:"array",length:2,value:"number","property-type":"data-constant",transition:!1,doc:"The standard parallels of the projection, denoting the desired latitude range with minimal distortion. `parallels` takes the form of [lat0, lat1]. This property is only configurable for conic projections (Albers and Lambert Conformal Conic).",example:[29.5,45.5],requires:[{name:["albers","lambertConformalConic"]}],"sdk-support":{"basic functionality":{js:"2.6.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-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. `queryRenderedFeatures` on heatmap layers will return points within this radius.","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](/help/troubleshooting/using-recolorable-images-in-mapbox-maps/).",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](/help/troubleshooting/using-recolorable-images-in-mapbox-maps/).",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."}}},Ic="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function Fc(t){var e={exports:{}};return t(e,e.exports),e.exports}function Mc(t,e){return Object.prototype.hasOwnProperty.call(t,e)}
|
36
36
|
/*! https://mths.be/punycode v1.3.2 by @mathias */
|
37
|
-
Fc((function(t,e){!function(i){var o=e&&!e.nodeType&&e,n=t&&!t.nodeType&&t,r="object"==typeof Ic&&Ic;r.global!==r&&r.window!==r&&r.self!==r||(i=r);var a,s,l=2147483647,u=36,p=/^xn--/,d=/[^\x20-\x7E]/,h=/[\x2E\u3002\uFF0E\uFF61]/g,c={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,g=String.fromCharCode;function m(t){throw RangeError(c[t])}function v(t,e){for(var i=t.length,o=[];i--;)o[i]=e(t[i]);return o}function y(t,e){var i=t.split("@"),o="";return i.length>1&&(o=i[0]+"@",t=i[1]),o+v((t=t.replace(h,".")).split("."),e).join(".")}function _(t){for(var e,i,o=[],n=0,r=t.length;n<r;)(e=t.charCodeAt(n++))>=55296&&e<=56319&&n<r?56320==(64512&(i=t.charCodeAt(n++)))?o.push(((1023&e)<<10)+(1023&i)+65536):(o.push(e),n--):o.push(e);return o}function b(t){return v(t,(function(t){var e="";return t>65535&&(e+=g((t-=65536)>>>10&1023|55296),t=56320|1023&t),e+=g(t)})).join("")}function x(t,e){return t+22+75*(t<26)-((0!=e)<<5)}function k(t,e,i){var o=0;for(t=i?f(t/700):t>>1,t+=f(t/e);t>455;o+=u)t=f(t/35);return f(o+36*t/(t+38))}function w(t){var e,i,o,n,r,a,s,p,d,h,c,g=[],v=t.length,y=0,_=128,x=72;for((i=t.lastIndexOf("-"))<0&&(i=0),o=0;o<i;++o)t.charCodeAt(o)>=128&&m("not-basic"),g.push(t.charCodeAt(o));for(n=i>0?i+1:0;n<v;){for(r=y,a=1,s=u;n>=v&&m("invalid-input"),((p=(c=t.charCodeAt(n++))-48<10?c-22:c-65<26?c-65:c-97<26?c-97:u)>=u||p>f((l-y)/a))&&m("overflow"),y+=p*a,!(p<(d=s<=x?1:s>=x+26?26:s-x));s+=u)a>f(l/(h=u-d))&&m("overflow"),a*=h;x=k(y-r,e=g.length+1,0==r),f(y/e)>l-_&&m("overflow"),_+=f(y/e),y%=e,g.splice(y++,0,_)}return b(g)}function S(t){var e,i,o,n,r,a,s,p,d,h,c,v,y,b,w,S=[];for(v=(t=_(t)).length,e=128,i=0,r=72,a=0;a<v;++a)(c=t[a])<128&&S.push(g(c));for(o=n=S.length,n&&S.push("-");o<v;){for(s=l,a=0;a<v;++a)(c=t[a])>=e&&c<s&&(s=c);for(s-e>f((l-i)/(y=o+1))&&m("overflow"),i+=(s-e)*y,e=s,a=0;a<v;++a)if((c=t[a])<e&&++i>l&&m("overflow"),c==e){for(p=i,d=u;!(p<(h=d<=r?1:d>=r+26?26:d-r));d+=u)w=p-h,b=u-h,S.push(g(x(h+w%b,0))),p=f(w/b);S.push(g(x(p,0))),r=k(i,y,o==n),i=0,++o}++i,++e}return S.join("")}if(a={version:"1.3.2",ucs2:{decode:_,encode:b},decode:w,encode:S,toASCII:function(t){return y(t,(function(t){return d.test(t)?"xn--"+S(t):t}))},toUnicode:function(t){return y(t,(function(t){return p.test(t)?w(t.slice(4).toLowerCase()):t}))}},o&&n)if(t.exports==o)n.exports=a;else for(s in a)a.hasOwnProperty(s)&&(o[s]=a[s]);else i.punycode=a}(Ic)}));var Ac=function(t,e,i,o){e=e||"&",i=i||"=";var n={};if("string"!=typeof t||0===t.length)return n;var r=/\+/g;t=t.split(e);var a=1e3;o&&"number"==typeof o.maxKeys&&(a=o.maxKeys);var s=t.length;a>0&&s>a&&(s=a);for(var l=0;l<s;++l){var u,p,d,h,c=t[l].replace(r,"%20"),f=c.indexOf(i);f>=0?(u=c.substr(0,f),p=c.substr(f+1)):(u=c,p=""),d=decodeURIComponent(u),h=decodeURIComponent(p),Mc(n,d)?Array.isArray(n[d])?n[d].push(h):n[d]=[n[d],h]:n[d]=h}return n},Dc=function(t){switch(typeof t){case"string":return t;case"boolean":return t?"true":"false";case"number":return isFinite(t)?t:"";default:return""}},Lc=function(t,e,i,o){return e=e||"&",i=i||"=",null===t&&(t=void 0),"object"==typeof t?Object.keys(t).map((function(o){var n=encodeURIComponent(Dc(o))+i;return Array.isArray(t[o])?t[o].map((function(t){return n+encodeURIComponent(Dc(t))})).join(e):n+encodeURIComponent(Dc(t[o]))})).join(e):o?encodeURIComponent(Dc(o))+i+encodeURIComponent(Dc(t)):""};Fc((function(t,e){e.decode=e.parse=Ac,e.encode=e.stringify=Lc}));class Gc extends Error{constructor(t,e){super(e),this.message=e,this.key=t}}class Nc{constructor(t,e=[]){this.parent=t,this.bindings={};for(const[i,o]of e)this.bindings[i]=o}concat(t){return new Nc(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 Bc={kind:"null"},qc={kind:"number"},Wc={kind:"string"},Vc={kind:"boolean"},Uc={kind:"color"},Xc={kind:"object"},Kc={kind:"value"},Yc={kind:"collator"},Zc={kind:"formatted"},Hc={kind:"resolvedImage"};function $c(t,e){return{kind:"array",itemType:t,N:e}}function Jc(t){if("array"===t.kind){const e=Jc(t.itemType);return"number"==typeof t.N?`array<${e}, ${t.N}>`:"value"===t.itemType.kind?"array":`array<${e}>`}return t.kind}const Qc=[Bc,qc,Wc,Vc,Uc,Zc,Xc,$c(Kc),Hc];function tf(t,e){if("error"===e.kind)return null;if("array"===t.kind){if("array"===e.kind&&(0===e.N&&"value"===e.itemType.kind||!tf(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 Qc)if(!tf(t,e))return null}return`Expected ${Jc(t)} but found ${Jc(e)} instead.`}function ef(t,e){return e.some((e=>e.kind===t.kind))}function of(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 nf=Fc((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 o(t){return(t=Math.round(t))<0?0:t>255?255:t}function n(t){return t<0?0:t>1?1:t}function r(t){return"%"===t[t.length-1]?o(parseFloat(t)/100*255):o(parseInt(t))}function a(t){return"%"===t[t.length-1]?n(parseFloat(t)/100):n(parseFloat(t))}function s(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,n=t.replace(/ /g,"").toLowerCase();if(n in i)return i[n].slice();if("#"===n[0])return 4===n.length?(e=parseInt(n.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===n.length&&(e=parseInt(n.substr(1),16))>=0&&e<=16777215?[(16711680&e)>>16,(65280&e)>>8,255&e,1]:null;var l=n.indexOf("("),u=n.indexOf(")");if(-1!==l&&u+1===n.length){var p=n.substr(0,l),d=n.substr(l+1,u-(l+1)).split(","),h=1;switch(p){case"rgba":if(4!==d.length)return null;h=a(d.pop());case"rgb":return 3!==d.length?null:[r(d[0]),r(d[1]),r(d[2]),h];case"hsla":if(4!==d.length)return null;h=a(d.pop());case"hsl":if(3!==d.length)return null;var c=(parseFloat(d[0])%360+360)%360/360,f=a(d[1]),g=a(d[2]),m=g<=.5?g*(f+1):g+f-g*f,v=2*g-m;return[o(255*s(v,m,c+1/3)),o(255*s(v,m,c)),o(255*s(v,m,c-1/3)),h];default:return null}}return null}}catch(l){}}));class rf{constructor(t,e,i,o=1){this.r=t,this.g=e,this.b=i,this.a=o}static parse(t){if(!t)return;if(t instanceof rf)return t;if("string"!=typeof t)return;const e=nf.parseCSSColor(t);return e?new rf(e[0]/255*e[3],e[1]/255*e[3],e[2]/255*e[3],e[3]):void 0}toString(){const[t,e,i,o]=this.toArray();return`rgba(${Math.round(t)},${Math.round(e)},${Math.round(i)},${o})`}toArray(){const{r:t,g:e,b:i,a:o}=this;return 0===o?[0,0,0,0]:[255*t/o,255*e/o,255*i/o,o]}}rf.black=new rf(0,0,0,1),rf.white=new rf(1,1,1,1),rf.transparent=new rf(0,0,0,0),rf.red=new rf(1,0,0,1),rf.blue=new rf(0,0,1,1);class af{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 sf{constructor(t,e,i,o,n){this.text=t,this.image=e,this.scale=i,this.fontStack=o,this.textColor=n}}class lf{constructor(t){this.sections=t}static fromString(t){return new lf([new sf(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 lf?t:lf.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 uf{constructor(t){this.name=t.name,this.available=t.available}toString(){return this.name}static fromString(t){return t?new uf({name:t,available:!1}):null}serialize(){return["image",this.name]}}function pf(t,e,i,o){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 o?[t,e,i,o]:[t,e,i]).join(", ")}]: 'r', 'g', and 'b' must be between 0 and 255.`}return void 0===o||"number"==typeof o&&o>=0&&o<=1?null:`Invalid rgba value [${[t,e,i,o].join(", ")}]: 'a' must be between 0 and 1.`}function df(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 rf)return!0;if(t instanceof af)return!0;if(t instanceof lf)return!0;if(t instanceof uf)return!0;if(Array.isArray(t)){for(const e of t)if(!df(e))return!1;return!0}if("object"==typeof t){for(const e in t)if(!df(t[e]))return!1;return!0}return!1}function hf(t){if(null===t)return Bc;if("string"==typeof t)return Wc;if("boolean"==typeof t)return Vc;if("number"==typeof t)return qc;if(t instanceof rf)return Uc;if(t instanceof af)return Yc;if(t instanceof lf)return Zc;if(t instanceof uf)return Hc;if(Array.isArray(t)){const e=t.length;let i;for(const o of t){const t=hf(o);if(i){if(i===t)continue;i=Kc;break}i=t}return $c(i||Kc,e)}return Xc}function cf(t){const e=typeof t;return null===t?"":"string"===e||"number"===e||"boolean"===e?String(t):t instanceof rf||t instanceof lf||t instanceof uf?t.toString():JSON.stringify(t)}class ff{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(!df(t[1]))return e.error("invalid value");const i=t[1];let o=hf(i);const n=e.expectedType;return"array"!==o.kind||0!==o.N||!n||"array"!==n.kind||"number"==typeof n.N&&0!==n.N||(o=n),new ff(o,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 rf?["rgba"].concat(this.value.toArray()):this.value instanceof lf?this.value.serialize():this.value}}class gf{constructor(t){this.name="ExpressionEvaluationError",this.message=t}toJSON(){return this.message}}const mf={string:Wc,number:qc,boolean:Vc,object:Xc};class vf{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,o=1;const n=t[0];if("array"===n){let n,r;if(t.length>2){const i=t[1];if("string"!=typeof i||!(i in mf)||"object"===i)return e.error('The item type argument of "array" must be one of string, number, boolean',1);n=mf[i],o++}else n=Kc;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);r=t[2],o++}i=$c(n,r)}else i=mf[n];const r=[];for(;o<t.length;o++){const i=e.parse(t[o],o,Kc);if(!i)return null;r.push(i)}return new vf(i,r)}evaluate(t){for(let e=0;e<this.args.length;e++){const i=this.args[e].evaluate(t);if(!tf(this.type,hf(i)))return i;if(e===this.args.length-1)throw new gf(`Expected value to be of type ${Jc(this.type)}, but found ${Jc(hf(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 o=t.N;("number"==typeof o||this.args.length>1)&&e.push(o)}}return e.concat(this.args.map((t=>t.serialize())))}}class yf{constructor(t){this.type=Zc,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 o=[];let n=!1;for(let r=1;r<=t.length-1;++r){const i=t[r];if(n&&"object"==typeof i&&!Array.isArray(i)){n=!1;let t=null;if(i["font-scale"]&&(t=e.parse(i["font-scale"],1,qc),!t))return null;let r=null;if(i["text-font"]&&(r=e.parse(i["text-font"],1,$c(Wc)),!r))return null;let a=null;if(i["text-color"]&&(a=e.parse(i["text-color"],1,Uc),!a))return null;const s=o[o.length-1];s.scale=t,s.font=r,s.textColor=a}else{const i=e.parse(t[r],1,Kc);if(!i)return null;const a=i.type.kind;if("string"!==a&&"value"!==a&&"null"!==a&&"resolvedImage"!==a)return e.error("Formatted text type must be 'string', 'value', 'image' or 'null'.");n=!0,o.push({content:i,scale:null,font:null,textColor:null})}}return new yf(o)}evaluate(t){return new lf(this.sections.map((e=>{const i=e.content.evaluate(t);return hf(i)===Hc?new sf("",i,null,null,null):new sf(cf(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 _f{constructor(t){this.type=Hc,this.input=t}static parse(t,e){if(2!==t.length)return e.error("Expected two arguments.");const i=e.parse(t[1],1,Wc);return i?new _f(i):e.error("No image name provided.")}evaluate(t){const e=this.input.evaluate(t),i=uf.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 bf={"to-boolean":Vc,"to-color":Uc,"to-number":qc,"to-string":Wc};class xf{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 o=bf[i],n=[];for(let r=1;r<t.length;r++){const i=e.parse(t[r],r,Kc);if(!i)return null;n.push(i)}return new xf(o,n)}evaluate(t){if("boolean"===this.type.kind)return Boolean(this.args[0].evaluate(t));if("color"===this.type.kind){let e,i;for(const o of this.args){if(e=o.evaluate(t),i=null,e instanceof rf)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.`:pf(e[0],e[1],e[2],e[3]),!i))return new rf(e[0]/255,e[1]/255,e[2]/255,e[3])}throw new gf(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 o=Number(e);if(!isNaN(o))return o}throw new gf(`Could not convert ${JSON.stringify(e)} to number.`)}return"formatted"===this.type.kind?lf.fromString(cf(this.args[0].evaluate(t))):"resolvedImage"===this.type.kind?uf.fromString(cf(this.args[0].evaluate(t))):cf(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 yf([{content:this.args[0],scale:null,font:null,textColor:null}]).serialize();if("resolvedImage"===this.type.kind)return new _f(this.args[0]).serialize();const t=[`to-${this.type.kind}`];return this.eachChild((e=>{t.push(e.serialize())})),t}}const kf=["Unknown","Point","LineString","Polygon"];class wf{constructor(){this.globals=null,this.feature=null,this.featureState=null,this.formattedSection=null,this._parseColorCache={},this.availableImages=null,this.canonical=null,this.featureTileCoord=null,this.featureDistanceData=null}id(){return this.feature&&"id"in this.feature?this.feature.id:null}geometryType(){return this.feature?"number"==typeof this.feature.type?kf[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||{}}distanceFromCenter(){if(this.featureTileCoord&&this.featureDistanceData){const t=this.featureDistanceData.center,e=this.featureDistanceData.scale,{x:i,y:o}=this.featureTileCoord,n=i*e-t[0],r=o*e-t[1];return this.featureDistanceData.bearing[0]*n+this.featureDistanceData.bearing[1]*r}return 0}parseColor(t){let e=this._parseColorCache[t];return e||(e=this._parseColorCache[t]=rf.parse(t)),e}}class Sf{constructor(t,e,i,o){this.name=t,this.type=e,this._evaluate=i,this.args=o}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],o=Sf.definitions[i];if(!o)return e.error(`Unknown expression "${i}". If you wanted a literal array, use ["literal", [...]].`,0);const n=Array.isArray(o)?o[0]:o.type,r=Array.isArray(o)?[[o[1],o[2]]]:o.overloads,a=r.filter((([e])=>!Array.isArray(e)||e.length===t.length-1));let s=null;for(const[l,u]of a){s=new Yf(e.registry,e.path,null,e.scope);const o=[];let r=!1;for(let e=1;e<t.length;e++){const i=t[e],n=Array.isArray(l)?l[e-1]:l.type,a=s.parse(i,1+o.length,n);if(!a){r=!0;break}o.push(a)}if(!r)if(Array.isArray(l)&&l.length!==o.length)s.error(`Expected ${l.length} arguments, but found ${o.length} instead.`);else{for(let t=0;t<o.length;t++){const e=Array.isArray(l)?l[t]:l.type,i=o[t];s.concat(t+1).checkSubtype(e,i.type)}if(0===s.errors.length)return new Sf(i,n,u,o)}}if(1===a.length)e.errors.push(...s.errors);else{const i=(a.length?a:r).map((([t])=>{return e=t,Array.isArray(e)?`(${e.map(Jc).join(", ")})`:`(${Jc(e.type)}...)`;var e})).join(" | "),o=[];for(let n=1;n<t.length;n++){const i=e.parse(t[n],1+o.length);if(!i)return null;o.push(Jc(i.type))}e.error(`Expected arguments of type ${i}, but found (${o.join(", ")}) instead.`)}return null}static register(t,e){Sf.definitions=e;for(const i in e)t[i]=Sf}}class Cf{constructor(t,e,i){this.type=Yc,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 o=e.parse(void 0!==i["case-sensitive"]&&i["case-sensitive"],1,Vc);if(!o)return null;const n=e.parse(void 0!==i["diacritic-sensitive"]&&i["diacritic-sensitive"],1,Vc);if(!n)return null;let r=null;return i.locale&&(r=e.parse(i.locale,1,Wc),!r)?null:new Cf(o,n,r)}evaluate(t){return new af(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]}}const zf=8192;function Tf(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 Ef(t,e){return!(t[0]<=e[0])&&(!(t[2]>=e[2])&&(!(t[1]<=e[1])&&!(t[3]>=e[3])))}function Pf(t,e){const i=(180+t[0])/360;const o=(n=t[1],(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+n*Math.PI/360)))/360);var n;const r=Math.pow(2,e.z);return[Math.round(i*r*zf),Math.round(o*r*zf)]}function Of(t,e,i){const o=t[0]-e[0],n=t[1]-e[1],r=t[0]-i[0],a=t[1]-i[1];return o*a-r*n==0&&o*r<=0&&n*a<=0}function jf(t,e){let i=!1;for(let a=0,s=e.length;a<s;a++){const s=e[a];for(let e=0,a=s.length;e<a-1;e++){if(Of(t,s[e],s[e+1]))return!1;o=t,n=s[e],r=s[e+1],n[1]>o[1]!=r[1]>o[1]&&o[0]<(r[0]-n[0])*(o[1]-n[1])/(r[1]-n[1])+n[0]&&(i=!i)}}var o,n,r;return i}function Rf(t,e){for(let i=0;i<e.length;i++)if(jf(t,e[i]))return!0;return!1}function If(t,e,i,o){const n=t[0]-i[0],r=t[1]-i[1],a=e[0]-i[0],s=e[1]-i[1],l=o[0]-i[0],u=o[1]-i[1],p=n*u-l*r,d=a*u-l*s;return p>0&&d<0||p<0&&d>0}function Ff(t,e,i,o){const n=[e[0]-t[0],e[1]-t[1]],r=[o[0]-i[0],o[1]-i[1]];return 0!=(a=r)[0]*(s=n)[1]-a[1]*s[0]&&!(!If(t,e,i,o)||!If(i,o,t,e));var a,s}function Mf(t,e,i){for(const o of i)for(let i=0;i<o.length-1;++i)if(Ff(t,e,o[i],o[i+1]))return!0;return!1}function Af(t,e){for(let i=0;i<t.length;++i)if(!jf(t[i],e))return!1;for(let i=0;i<t.length-1;++i)if(Mf(t[i],t[i+1],e))return!1;return!0}function Df(t,e){for(let i=0;i<e.length;i++)if(Af(t,e[i]))return!0;return!1}function Lf(t,e,i){const o=[];for(let n=0;n<t.length;n++){const r=[];for(let o=0;o<t[n].length;o++){const a=Pf(t[n][o],i);Tf(e,a),r.push(a)}o.push(r)}return o}function Gf(t,e,i){const o=[];for(let n=0;n<t.length;n++){const r=Lf(t[n],e,i);o.push(r)}return o}function Nf(t,e,i,o){if(t[0]<i[0]||t[0]>i[2]){const e=.5*o;let n=t[0]-i[0]>e?-o:i[0]-t[0]>e?o:0;0===n&&(n=t[0]-i[2]>e?-o:i[2]-t[0]>e?o:0),t[0]+=n}Tf(e,t)}function Bf(t,e,i,o){const n=Math.pow(2,o.z)*zf,r=[o.x*zf,o.y*zf],a=[];for(const s of t)for(const t of s){const o=[t.x+r[0],t.y+r[1]];Nf(o,e,i,n),a.push(o)}return a}function qf(t,e,i,o){const n=Math.pow(2,o.z)*zf,r=[o.x*zf,o.y*zf],a=[];for(const l of t){const t=[];for(const i of l){const o=[i.x+r[0],i.y+r[1]];Tf(e,o),t.push(o)}a.push(t)}if(e[2]-e[0]<=n/2){(s=e)[0]=s[1]=1/0,s[2]=s[3]=-1/0;for(const t of a)for(const o of t)Nf(o,e,i,n)}var s;return a}class Wf{constructor(t,e){this.type=Vc,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(df(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 Wf(e,e.features[t].geometry)}else if("Feature"===e.type){const t=e.geometry.type;if("Polygon"===t||"MultiPolygon"===t)return new Wf(e,e.geometry)}else if("Polygon"===e.type||"MultiPolygon"===e.type)return new Wf(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],o=[1/0,1/0,-1/0,-1/0],n=t.canonicalID();if("Polygon"===e.type){const r=Lf(e.coordinates,o,n),a=Bf(t.geometry(),i,o,n);if(!Ef(i,o))return!1;for(const t of a)if(!jf(t,r))return!1}if("MultiPolygon"===e.type){const r=Gf(e.coordinates,o,n),a=Bf(t.geometry(),i,o,n);if(!Ef(i,o))return!1;for(const t of a)if(!Rf(t,r))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],o=[1/0,1/0,-1/0,-1/0],n=t.canonicalID();if("Polygon"===e.type){const r=Lf(e.coordinates,o,n),a=qf(t.geometry(),i,o,n);if(!Ef(i,o))return!1;for(const t of a)if(!Af(t,r))return!1}if("MultiPolygon"===e.type){const r=Gf(e.coordinates,o,n),a=qf(t.geometry(),i,o,n);if(!Ef(i,o))return!1;for(const t of a)if(!Df(t,r))return!1}return!0}(t,this.geometries)}return!1}eachChild(){}outputDefined(){return!0}serialize(){return["within",this.geojson]}}function Vf(t){if(t instanceof Sf){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 Wf)return!1;let e=!0;return t.eachChild((t=>{e&&!Vf(t)&&(e=!1)})),e}function Uf(t){if(t instanceof Sf&&"feature-state"===t.name)return!1;let e=!0;return t.eachChild((t=>{e&&!Uf(t)&&(e=!1)})),e}function Xf(t,e){if(t instanceof Sf&&e.indexOf(t.name)>=0)return!1;let i=!0;return t.eachChild((t=>{i&&!Xf(t,e)&&(i=!1)})),i}class Kf{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 Kf(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 Yf{constructor(t,e=[],i,o=new Nc,n=[]){this.registry=t,this.path=e,this.key=e.map((t=>`[${t}]`)).join(""),this.scope=o,this.errors=n,this.expectedType=i}parse(t,e,i,o,n={}){return e?this.concat(e,i,o)._parse(t,n):this._parse(t,n)}_parse(t,e){function i(t,e,i){return"assert"===i?new vf(e,[t]):"coerce"===i?new xf(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 n=t[0];if("string"!=typeof n)return this.error(`Expression name must be a string, but found ${typeof n} instead. If you wanted a literal array, use ["literal", [...]].`,0),null;const r=this.registry[n];if(r){let n=r.parse(t,this);if(!n)return null;if(this.expectedType){const t=this.expectedType,o=n.type;if("string"!==t.kind&&"number"!==t.kind&&"boolean"!==t.kind&&"object"!==t.kind&&"array"!==t.kind||"value"!==o.kind)if("color"!==t.kind&&"formatted"!==t.kind&&"resolvedImage"!==t.kind||"value"!==o.kind&&"string"!==o.kind){if(this.checkSubtype(t,o))return null}else n=i(n,t,e.typeAnnotation||"coerce");else n=i(n,t,e.typeAnnotation||"assert")}if(!(n instanceof ff)&&"resolvedImage"!==n.type.kind&&Zf(n)){const t=new wf;try{n=new ff(n.type,n.evaluate(t))}catch(o){return this.error(o.message),null}}return n}return this.error(`Unknown expression "${n}". If you wanted a literal array, use ["literal", [...]].`,0)}return void 0===t?this.error("'undefined' value invalid. Use null instead."):"object"==typeof t?this.error('Bare objects invalid. Use ["literal", {...}] instead.'):this.error(`Expected an array, but found ${typeof t} instead.`)}concat(t,e,i){const o="number"==typeof t?this.path.concat(t):this.path,n=i?this.scope.concat(i):this.scope;return new Yf(this.registry,o,e||null,n,this.errors)}error(t,...e){const i=`${this.key}${e.map((t=>`[${t}]`)).join("")}`;this.errors.push(new Gc(i,t))}checkSubtype(t,e){const i=tf(t,e);return i&&this.error(i),i}}function Zf(t){if(t instanceof Kf)return Zf(t.boundExpression);if(t instanceof Sf&&"error"===t.name)return!1;if(t instanceof Cf)return!1;if(t instanceof Wf)return!1;const e=t instanceof xf||t instanceof vf;let i=!0;return t.eachChild((t=>{i=e?i&&Zf(t):i&&t instanceof ff})),!!i&&(Vf(t)&&Xf(t,["zoom","heatmap-density","line-progress","sky-radial-progress","accumulated","is-supported-script","pitch","distance-from-center"]))}function Hf(t,e){const i=t.length-1;let o,n,r=0,a=i,s=0;for(;r<=a;)if(s=Math.floor((r+a)/2),o=t[s],n=t[s+1],o<=e){if(s===i||e<n)return s;r=s+1}else{if(!(o>e))throw new gf("Input is not a number.");a=s-1}return 0}class $f{constructor(t,e,i){this.type=t,this.input=e,this.labels=[],this.outputs=[];for(const[o,n]of i)this.labels.push(o),this.outputs.push(n)}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,qc);if(!i)return null;const o=[];let n=null;e.expectedType&&"value"!==e.expectedType.kind&&(n=e.expectedType);for(let r=1;r<t.length;r+=2){const i=1===r?-1/0:t[r],a=t[r+1],s=r,l=r+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.',s);if(o.length&&o[o.length-1][0]>=i)return e.error('Input/output pairs for "step" expressions must be arranged with input values in strictly ascending order.',s);const u=e.parse(a,l,n);if(!u)return null;n=n||u.type,o.push([i,u])}return new $f(n,i,o)}evaluate(t){const e=this.labels,i=this.outputs;if(1===e.length)return i[0].evaluate(t);const o=this.input.evaluate(t);if(o<=e[0])return i[0].evaluate(t);const n=e.length;if(o>=e[n-1])return i[n-1].evaluate(t);return i[Hf(e,o)].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 Jf=Qf;function Qf(t,e,i,o){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*(o-e)-this.cy,this.ay=1-this.cy-this.by,this.p1x=t,this.p1y=o,this.p2x=i,this.p2y=o}function tg(t,e,i){return t*(1-i)+e*i}Qf.prototype.sampleCurveX=function(t){return((this.ax*t+this.bx)*t+this.cx)*t},Qf.prototype.sampleCurveY=function(t){return((this.ay*t+this.by)*t+this.cy)*t},Qf.prototype.sampleCurveDerivativeX=function(t){return(3*this.ax*t+2*this.bx)*t+this.cx},Qf.prototype.solveCurveX=function(t,e){var i,o,n,r,a;for(void 0===e&&(e=1e-6),n=t,a=0;a<8;a++){if(r=this.sampleCurveX(n)-t,Math.abs(r)<e)return n;var s=this.sampleCurveDerivativeX(n);if(Math.abs(s)<1e-6)break;n-=r/s}if((n=t)<(i=0))return i;if(n>(o=1))return o;for(;i<o;){if(r=this.sampleCurveX(n),Math.abs(r-t)<e)return n;t>r?i=n:o=n,n=.5*(o-i)+i}return n},Qf.prototype.solve=function(t,e){return this.sampleCurveY(this.solveCurveX(t,e))};var eg=Object.freeze({__proto__:null,number:tg,color:function(t,e,i){return new rf(tg(t.r,e.r,i),tg(t.g,e.g,i),tg(t.b,e.b,i),tg(t.a,e.a,i))},array:function(t,e,i){return t.map(((t,o)=>tg(t,e[o],i)))}});const ig=.95047,og=1.08883,ng=4/29,rg=6/29,ag=3*rg*rg,sg=Math.PI/180,lg=180/Math.PI;function ug(t){return t>.008856451679035631?Math.pow(t,1/3):t/ag+ng}function pg(t){return t>rg?t*t*t:ag*(t-ng)}function dg(t){return 255*(t<=.0031308?12.92*t:1.055*Math.pow(t,1/2.4)-.055)}function hg(t){return(t/=255)<=.04045?t/12.92:Math.pow((t+.055)/1.055,2.4)}function cg(t){const e=hg(t.r),i=hg(t.g),o=hg(t.b),n=ug((.4124564*e+.3575761*i+.1804375*o)/ig),r=ug((.2126729*e+.7151522*i+.072175*o)/1);return{l:116*r-16,a:500*(n-r),b:200*(r-ug((.0193339*e+.119192*i+.9503041*o)/og)),alpha:t.a}}function fg(t){let e=(t.l+16)/116,i=isNaN(t.a)?e:e+t.a/500,o=isNaN(t.b)?e:e-t.b/200;return e=1*pg(e),i=ig*pg(i),o=og*pg(o),new rf(dg(3.2404542*i-1.5371385*e-.4985314*o),dg(-.969266*i+1.8760108*e+.041556*o),dg(.0556434*i-.2040259*e+1.0572252*o),t.alpha)}function gg(t,e,i){const o=e-t;return t+i*(o>180||o<-180?o-360*Math.round(o/360):o)}const mg={forward:cg,reverse:fg,interpolate:function(t,e,i){return{l:tg(t.l,e.l,i),a:tg(t.a,e.a,i),b:tg(t.b,e.b,i),alpha:tg(t.alpha,e.alpha,i)}}},vg={forward:function(t){const{l:e,a:i,b:o}=cg(t),n=Math.atan2(o,i)*lg;return{h:n<0?n+360:n,c:Math.sqrt(i*i+o*o),l:e,alpha:t.a}},reverse:function(t){const e=t.h*sg,i=t.c;return fg({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:tg(t.c,e.c,i),l:tg(t.l,e.l,i),alpha:tg(t.alpha,e.alpha,i)}}};class yg{constructor(t,e,i,o,n){this.type=t,this.operator=e,this.interpolation=i,this.input=o,this.labels=[],this.outputs=[];for(const[r,a]of n)this.labels.push(r),this.outputs.push(a)}static interpolationFactor(t,e,i,o){let n=0;if("exponential"===t.name)n=_g(e,t.base,i,o);else if("linear"===t.name)n=_g(e,1,i,o);else if("cubic-bezier"===t.name){const r=t.controlPoints;n=new Jf(r[0],r[1],r[2],r[3]).solve(_g(e,1,i,o))}return n}static parse(t,e){let[i,o,n,...r]=t;if(!Array.isArray(o)||0===o.length)return e.error("Expected an interpolation type expression.",1);if("linear"===o[0])o={name:"linear"};else if("exponential"===o[0]){const t=o[1];if("number"!=typeof t)return e.error("Exponential interpolation requires a numeric base.",1,1);o={name:"exponential",base:t}}else{if("cubic-bezier"!==o[0])return e.error(`Unknown interpolation type ${String(o[0])}`,1,0);{const t=o.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);o={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(n=e.parse(n,2,qc),!n)return null;const a=[];let s=null;"interpolate-hcl"===i||"interpolate-lab"===i?s=Uc:e.expectedType&&"value"!==e.expectedType.kind&&(s=e.expectedType);for(let l=0;l<r.length;l+=2){const t=r[l],i=r[l+1],o=l+3,n=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.',o);if(a.length&&a[a.length-1][0]>=t)return e.error('Input/output pairs for "interpolate" expressions must be arranged with input values in strictly ascending order.',o);const u=e.parse(i,n,s);if(!u)return null;s=s||u.type,a.push([t,u])}return"number"===s.kind||"color"===s.kind||"array"===s.kind&&"number"===s.itemType.kind&&"number"==typeof s.N?new yg(s,i,o,n,a):e.error(`Type ${Jc(s)} is not interpolatable.`)}evaluate(t){const e=this.labels,i=this.outputs;if(1===e.length)return i[0].evaluate(t);const o=this.input.evaluate(t);if(o<=e[0])return i[0].evaluate(t);const n=e.length;if(o>=e[n-1])return i[n-1].evaluate(t);const r=Hf(e,o),a=e[r],s=e[r+1],l=yg.interpolationFactor(this.interpolation,o,a,s),u=i[r].evaluate(t),p=i[r+1].evaluate(t);return"interpolate"===this.operator?eg[this.type.kind.toLowerCase()](u,p,l):"interpolate-hcl"===this.operator?vg.reverse(vg.interpolate(vg.forward(u),vg.forward(p),l)):mg.reverse(mg.interpolate(mg.forward(u),mg.forward(p),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 _g(t,e,i,o){const n=o-i,r=t-i;return 0===n?0:1===e?r/n:(Math.pow(e,r)-1)/(Math.pow(e,n)-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 o=e.expectedType;o&&"value"!==o.kind&&(i=o);const n=[];for(const a of t.slice(1)){const t=e.parse(a,1+n.length,i,void 0,{typeAnnotation:"omit"});if(!t)return null;i=i||t.type,n.push(t)}const r=o&&n.some((t=>tf(o,t.type)));return new bg(r?Kc:i,n)}evaluate(t){let e,i=null,o=0;for(const n of this.args)if(o++,i=n.evaluate(t),i&&i instanceof uf&&!i.available&&(e||(e=i.name),i=null,o===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 xg{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 n=1;n<t.length-1;n+=2){const o=t[n];if("string"!=typeof o)return e.error(`Expected string, but found ${typeof o} instead.`,n);if(/[^a-zA-Z0-9_]/.test(o))return e.error("Variable names must contain only alphanumeric characters or '_'.",n);const r=e.parse(t[n+1],n+1);if(!r)return null;i.push([o,r])}const o=e.parse(t[t.length-1],t.length-1,e.expectedType,i);return o?new xg(i,o):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 kg{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,qc),o=e.parse(t[2],2,$c(e.expectedType||Kc));if(!i||!o)return null;const n=o.type;return new kg(n.itemType,i,o)}evaluate(t){const e=this.index.evaluate(t),i=this.input.evaluate(t);if(e<0)throw new gf(`Array index out of bounds: ${e} < 0.`);if(e>=i.length)throw new gf(`Array index out of bounds: ${e} > ${i.length-1}.`);if(e!==Math.floor(e))throw new gf(`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 wg{constructor(t,e){this.type=Vc,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,Kc),o=e.parse(t[2],2,Kc);return i&&o?ef(i.type,[Vc,Wc,qc,Bc,Kc])?new wg(i,o):e.error(`Expected first argument to be of type boolean, string, number or null, but found ${Jc(i.type)} instead`):null}evaluate(t){const e=this.needle.evaluate(t),i=this.haystack.evaluate(t);if(!i)return!1;if(!of(e,["boolean","string","number","null"]))throw new gf(`Expected first argument to be of type boolean, string, number or null, but found ${Jc(hf(e))} instead.`);if(!of(i,["string","array"]))throw new gf(`Expected second argument to be of type array or string, but found ${Jc(hf(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 Sg{constructor(t,e,i){this.type=qc,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,Kc),o=e.parse(t[2],2,Kc);if(!i||!o)return null;if(!ef(i.type,[Vc,Wc,qc,Bc,Kc]))return e.error(`Expected first argument to be of type boolean, string, number or null, but found ${Jc(i.type)} instead`);if(4===t.length){const n=e.parse(t[3],3,qc);return n?new Sg(i,o,n):null}return new Sg(i,o)}evaluate(t){const e=this.needle.evaluate(t),i=this.haystack.evaluate(t);if(!of(e,["boolean","string","number","null"]))throw new gf(`Expected first argument to be of type boolean, string, number or null, but found ${Jc(hf(e))} instead.`);if(!of(i,["string","array"]))throw new gf(`Expected second argument to be of type array or string, but found ${Jc(hf(i))} instead.`);if(this.fromIndex){const o=this.fromIndex.evaluate(t);return i.indexOf(e,o)}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 Cg{constructor(t,e,i,o,n,r){this.inputType=t,this.type=e,this.input=i,this.cases=o,this.outputs=n,this.otherwise=r}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,o;e.expectedType&&"value"!==e.expectedType.kind&&(o=e.expectedType);const n={},r=[];for(let l=2;l<t.length-1;l+=2){let a=t[l];const s=t[l+1];Array.isArray(a)||(a=[a]);const u=e.concat(l);if(0===a.length)return u.error("Expected at least one branch label.");for(const t of a){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,hf(t)))return null}else i=hf(t);if(void 0!==n[String(t)])return u.error("Branch labels must be unique.");n[String(t)]=r.length}const p=e.parse(s,l,o);if(!p)return null;o=o||p.type,r.push(p)}const a=e.parse(t[1],1,Kc);if(!a)return null;const s=e.parse(t[t.length-1],t.length-1,o);return s?"value"!==a.type.kind&&e.concat(1).checkSubtype(i,a.type)?null:new Cg(i,o,a,n,r,s):null}evaluate(t){const e=this.input.evaluate(t);return(hf(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=[],o={};for(const r of e){const t=o[this.cases[r]];void 0===t?(o[this.cases[r]]=i.length,i.push([this.cases[r],[r]])):i[t][1].push(r)}const n=t=>"number"===this.inputType.kind?Number(t):t;for(const[r,a]of i)1===a.length?t.push(n(a[0])):t.push(a.map(n)),t.push(this.outputs[r].serialize());return t.push(this.otherwise.serialize()),t}}class zg{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 o=[];for(let r=1;r<t.length-1;r+=2){const n=e.parse(t[r],r,Vc);if(!n)return null;const a=e.parse(t[r+1],r+1,i);if(!a)return null;o.push([n,a]),i=i||a.type}const n=e.parse(t[t.length-1],t.length-1,i);return n?new zg(i,o,n):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 Tg{constructor(t,e,i,o){this.type=t,this.input=e,this.beginIndex=i,this.endIndex=o}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,Kc),o=e.parse(t[2],2,qc);if(!i||!o)return null;if(!ef(i.type,[$c(Kc),Wc,Kc]))return e.error(`Expected first argument to be of type array or string, but found ${Jc(i.type)} instead`);if(4===t.length){const n=e.parse(t[3],3,qc);return n?new Tg(i.type,i,o,n):null}return new Tg(i.type,i,o)}evaluate(t){const e=this.input.evaluate(t),i=this.beginIndex.evaluate(t);if(!of(e,["string","array"]))throw new gf(`Expected first argument to be of type array or string, but found ${Jc(hf(e))} instead.`);if(this.endIndex){const o=this.endIndex.evaluate(t);return e.slice(i,o)}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 Eg(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 Pg(t,e,i,o){return 0===o.compare(e,i)}function Og(t,e,i){const o="=="!==t&&"!="!==t;return class n{constructor(t,e,i){this.type=Vc,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 r=e.parse(t[1],1,Kc);if(!r)return null;if(!Eg(i,r.type))return e.concat(1).error(`"${i}" comparisons are not supported for type '${Jc(r.type)}'.`);let a=e.parse(t[2],2,Kc);if(!a)return null;if(!Eg(i,a.type))return e.concat(2).error(`"${i}" comparisons are not supported for type '${Jc(a.type)}'.`);if(r.type.kind!==a.type.kind&&"value"!==r.type.kind&&"value"!==a.type.kind)return e.error(`Cannot compare types '${Jc(r.type)}' and '${Jc(a.type)}'.`);o&&("value"===r.type.kind&&"value"!==a.type.kind?r=new vf(a.type,[r]):"value"!==r.type.kind&&"value"===a.type.kind&&(a=new vf(r.type,[a])));let s=null;if(4===t.length){if("string"!==r.type.kind&&"string"!==a.type.kind&&"value"!==r.type.kind&&"value"!==a.type.kind)return e.error("Cannot use collator to compare non-string types.");if(s=e.parse(t[3],3,Yc),!s)return null}return new n(r,a,s)}evaluate(n){const r=this.lhs.evaluate(n),a=this.rhs.evaluate(n);if(o&&this.hasUntypedArgument){const e=hf(r),i=hf(a);if(e.kind!==i.kind||"string"!==e.kind&&"number"!==e.kind)throw new gf(`Expected arguments for "${t}" to be (string, string) or (number, number), but found (${e.kind}, ${i.kind}) instead.`)}if(this.collator&&!o&&this.hasUntypedArgument){const t=hf(r),i=hf(a);if("string"!==t.kind||"string"!==i.kind)return e(n,r,a)}return this.collator?i(n,r,a,this.collator.evaluate(n)):e(n,r,a)}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 jg=Og("==",(function(t,e,i){return e===i}),Pg),Rg=Og("!=",(function(t,e,i){return e!==i}),(function(t,e,i,o){return!Pg(0,e,i,o)})),Ig=Og("<",(function(t,e,i){return e<i}),(function(t,e,i,o){return o.compare(e,i)<0})),Fg=Og(">",(function(t,e,i){return e>i}),(function(t,e,i,o){return o.compare(e,i)>0})),Mg=Og("<=",(function(t,e,i){return e<=i}),(function(t,e,i,o){return o.compare(e,i)<=0})),Ag=Og(">=",(function(t,e,i){return e>=i}),(function(t,e,i,o){return o.compare(e,i)>=0}));class Dg{constructor(t,e,i,o,n){this.type=Wc,this.number=t,this.locale=e,this.currency=i,this.minFractionDigits=o,this.maxFractionDigits=n}static parse(t,e){if(3!==t.length)return e.error("Expected two arguments.");const i=e.parse(t[1],1,qc);if(!i)return null;const o=t[2];if("object"!=typeof o||Array.isArray(o))return e.error("NumberFormat options argument must be an object.");let n=null;if(o.locale&&(n=e.parse(o.locale,1,Wc),!n))return null;let r=null;if(o.currency&&(r=e.parse(o.currency,1,Wc),!r))return null;let a=null;if(o["min-fraction-digits"]&&(a=e.parse(o["min-fraction-digits"],1,qc),!a))return null;let s=null;return o["max-fraction-digits"]&&(s=e.parse(o["max-fraction-digits"],1,qc),!s)?null:new Dg(i,n,r,a,s)}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 Lg{constructor(t){this.type=qc,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 ${Jc(i.type)} instead.`):new Lg(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 gf(`Expected value to be of type string or array, but found ${Jc(hf(e))} instead.`)}eachChild(t){t(this.input)}outputDefined(){return!1}serialize(){const t=["length"];return this.eachChild((e=>{t.push(e.serialize())})),t}}const Gg={"==":jg,"!=":Rg,">":Fg,"<":Ig,">=":Ag,"<=":Mg,array:vf,at:kg,boolean:vf,case:zg,coalesce:bg,collator:Cf,format:yf,image:_f,in:wg,"index-of":Sg,interpolate:yg,"interpolate-hcl":yg,"interpolate-lab":yg,length:Lg,let:xg,literal:ff,match:Cg,number:vf,"number-format":Dg,object:vf,slice:Tg,step:$f,string:vf,"to-boolean":xf,"to-color":xf,"to-number":xf,"to-string":xf,var:Kf,within:Wf};function Ng(t,[e,i,o,n]){e=e.evaluate(t),i=i.evaluate(t),o=o.evaluate(t);const r=n?n.evaluate(t):1,a=pf(e,i,o,r);if(a)throw new gf(a);return new rf(e/255*r,i/255*r,o/255*r,r)}function Bg(t,e){return t in e}function qg(t,e){const i=e[t];return void 0===i?null:i}function Wg(t){return{type:t}}function Vg(t){return{result:"success",value:t}}function Ug(t){return{result:"error",value:t}}function Xg(t){return!!t.expression&&t.expression.interpolated}function Kg(t){return"object"==typeof t&&null!==t&&!Array.isArray(t)}Sf.register(Gg,{error:[{kind:"error"},[Wc],(t,[e])=>{throw new gf(e.evaluate(t))}],typeof:[Wc,[Kc],(t,[e])=>Jc(hf(e.evaluate(t)))],"to-rgba":[$c(qc,4),[Uc],(t,[e])=>e.evaluate(t).toArray()],rgb:[Uc,[qc,qc,qc],Ng],rgba:[Uc,[qc,qc,qc,qc],Ng],has:{type:Vc,overloads:[[[Wc],(t,[e])=>Bg(e.evaluate(t),t.properties())],[[Wc,Xc],(t,[e,i])=>Bg(e.evaluate(t),i.evaluate(t))]]},get:{type:Kc,overloads:[[[Wc],(t,[e])=>qg(e.evaluate(t),t.properties())],[[Wc,Xc],(t,[e,i])=>qg(e.evaluate(t),i.evaluate(t))]]},"feature-state":[Kc,[Wc],(t,[e])=>qg(e.evaluate(t),t.featureState||{})],properties:[Xc,[],t=>t.properties()],"geometry-type":[Wc,[],t=>t.geometryType()],id:[Kc,[],t=>t.id()],zoom:[qc,[],t=>t.globals.zoom],pitch:[qc,[],t=>t.globals.pitch||0],"distance-from-center":[qc,[],t=>t.distanceFromCenter()],"heatmap-density":[qc,[],t=>t.globals.heatmapDensity||0],"line-progress":[qc,[],t=>t.globals.lineProgress||0],"sky-radial-progress":[qc,[],t=>t.globals.skyRadialProgress||0],accumulated:[Kc,[],t=>void 0===t.globals.accumulated?null:t.globals.accumulated],"+":[qc,Wg(qc),(t,e)=>{let i=0;for(const o of e)i+=o.evaluate(t);return i}],"*":[qc,Wg(qc),(t,e)=>{let i=1;for(const o of e)i*=o.evaluate(t);return i}],"-":{type:qc,overloads:[[[qc,qc],(t,[e,i])=>e.evaluate(t)-i.evaluate(t)],[[qc],(t,[e])=>-e.evaluate(t)]]},"/":[qc,[qc,qc],(t,[e,i])=>e.evaluate(t)/i.evaluate(t)],"%":[qc,[qc,qc],(t,[e,i])=>e.evaluate(t)%i.evaluate(t)],ln2:[qc,[],()=>Math.LN2],pi:[qc,[],()=>Math.PI],e:[qc,[],()=>Math.E],"^":[qc,[qc,qc],(t,[e,i])=>Math.pow(e.evaluate(t),i.evaluate(t))],sqrt:[qc,[qc],(t,[e])=>Math.sqrt(e.evaluate(t))],log10:[qc,[qc],(t,[e])=>Math.log(e.evaluate(t))/Math.LN10],ln:[qc,[qc],(t,[e])=>Math.log(e.evaluate(t))],log2:[qc,[qc],(t,[e])=>Math.log(e.evaluate(t))/Math.LN2],sin:[qc,[qc],(t,[e])=>Math.sin(e.evaluate(t))],cos:[qc,[qc],(t,[e])=>Math.cos(e.evaluate(t))],tan:[qc,[qc],(t,[e])=>Math.tan(e.evaluate(t))],asin:[qc,[qc],(t,[e])=>Math.asin(e.evaluate(t))],acos:[qc,[qc],(t,[e])=>Math.acos(e.evaluate(t))],atan:[qc,[qc],(t,[e])=>Math.atan(e.evaluate(t))],min:[qc,Wg(qc),(t,e)=>Math.min(...e.map((e=>e.evaluate(t))))],max:[qc,Wg(qc),(t,e)=>Math.max(...e.map((e=>e.evaluate(t))))],abs:[qc,[qc],(t,[e])=>Math.abs(e.evaluate(t))],round:[qc,[qc],(t,[e])=>{const i=e.evaluate(t);return i<0?-Math.round(-i):Math.round(i)}],floor:[qc,[qc],(t,[e])=>Math.floor(e.evaluate(t))],ceil:[qc,[qc],(t,[e])=>Math.ceil(e.evaluate(t))],"filter-==":[Vc,[Wc,Kc],(t,[e,i])=>t.properties()[e.value]===i.value],"filter-id-==":[Vc,[Kc],(t,[e])=>t.id()===e.value],"filter-type-==":[Vc,[Wc],(t,[e])=>t.geometryType()===e.value],"filter-<":[Vc,[Wc,Kc],(t,[e,i])=>{const o=t.properties()[e.value],n=i.value;return typeof o==typeof n&&o<n}],"filter-id-<":[Vc,[Kc],(t,[e])=>{const i=t.id(),o=e.value;return typeof i==typeof o&&i<o}],"filter->":[Vc,[Wc,Kc],(t,[e,i])=>{const o=t.properties()[e.value],n=i.value;return typeof o==typeof n&&o>n}],"filter-id->":[Vc,[Kc],(t,[e])=>{const i=t.id(),o=e.value;return typeof i==typeof o&&i>o}],"filter-<=":[Vc,[Wc,Kc],(t,[e,i])=>{const o=t.properties()[e.value],n=i.value;return typeof o==typeof n&&o<=n}],"filter-id-<=":[Vc,[Kc],(t,[e])=>{const i=t.id(),o=e.value;return typeof i==typeof o&&i<=o}],"filter->=":[Vc,[Wc,Kc],(t,[e,i])=>{const o=t.properties()[e.value],n=i.value;return typeof o==typeof n&&o>=n}],"filter-id->=":[Vc,[Kc],(t,[e])=>{const i=t.id(),o=e.value;return typeof i==typeof o&&i>=o}],"filter-has":[Vc,[Kc],(t,[e])=>e.value in t.properties()],"filter-has-id":[Vc,[],t=>null!==t.id()&&void 0!==t.id()],"filter-type-in":[Vc,[$c(Wc)],(t,[e])=>e.value.indexOf(t.geometryType())>=0],"filter-id-in":[Vc,[$c(Kc)],(t,[e])=>e.value.indexOf(t.id())>=0],"filter-in-small":[Vc,[Wc,$c(Kc)],(t,[e,i])=>i.value.indexOf(t.properties()[e.value])>=0],"filter-in-large":[Vc,[Wc,$c(Kc)],(t,[e,i])=>function(t,e,i,o){for(;i<=o;){const n=i+o>>1;if(e[n]===t)return!0;e[n]>t?o=n-1:i=n+1}return!1}(t.properties()[e.value],i.value,0,i.value.length-1)],all:{type:Vc,overloads:[[[Vc,Vc],(t,[e,i])=>e.evaluate(t)&&i.evaluate(t)],[Wg(Vc),(t,e)=>{for(const i of e)if(!i.evaluate(t))return!1;return!0}]]},any:{type:Vc,overloads:[[[Vc,Vc],(t,[e,i])=>e.evaluate(t)||i.evaluate(t)],[Wg(Vc),(t,e)=>{for(const i of e)if(i.evaluate(t))return!0;return!1}]]},"!":[Vc,[Vc],(t,[e])=>!e.evaluate(t)],"is-supported-script":[Vc,[Wc],(t,[e])=>{const i=t.globals&&t.globals.isSupportedScript;return!i||i(e.evaluate(t))}],upcase:[Wc,[Wc],(t,[e])=>e.evaluate(t).toUpperCase()],downcase:[Wc,[Wc],(t,[e])=>e.evaluate(t).toLowerCase()],concat:[Wc,Wg(Kc),(t,e)=>e.map((e=>cf(e.evaluate(t)))).join("")],"resolved-locale":[Wc,[Yc],(t,[e])=>e.evaluate(t).resolvedLocale()]});class Yg{constructor(t,e){var i;this.expression=t,this._warningHistory={},this._evaluator=new wf,this._defaultValue=e?"color"===(i=e).type&&Kg(i.default)?new rf(0,0,0,0):"color"===i.type?rf.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,o,n,r,a,s){return this._evaluator.globals=t,this._evaluator.feature=e,this._evaluator.featureState=i,this._evaluator.canonical=o,this._evaluator.availableImages=n||null,this._evaluator.formattedSection=r,this._evaluator.featureTileCoord=a||null,this._evaluator.featureDistanceData=s||null,this.expression.evaluate(this._evaluator)}evaluate(t,e,i,o,n,r,a,s){this._evaluator.globals=t,this._evaluator.feature=e||null,this._evaluator.featureState=i||null,this._evaluator.canonical=o,this._evaluator.availableImages=n||null,this._evaluator.formattedSection=r||null,this._evaluator.featureTileCoord=a||null,this._evaluator.featureDistanceData=s||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 gf(`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(l){return this._warningHistory[l.message]||(this._warningHistory[l.message]=!0,"undefined"!=typeof console&&console.warn(l.message)),this._defaultValue}}}function Zg(t){return Array.isArray(t)&&t.length>0&&"string"==typeof t[0]&&t[0]in Gg}function Hg(t,e){const i=new Yf(Gg,[],e?function(t){const e={color:Uc,string:Wc,number:qc,enum:Wc,boolean:Vc,formatted:Zc,resolvedImage:Hc};if("array"===t.type)return $c(e[t.value]||Kc,t.length);return e[t.type]}(e):void 0),o=i.parse(t,void 0,void 0,void 0,e&&"string"===e.type?{typeAnnotation:"coerce"}:void 0);return o?Vg(new Yg(o,e)):Ug(i.errors)}class $g{constructor(t,e){this.kind=t,this._styleExpression=e,this.isStateDependent="constant"!==t&&!Uf(e.expression)}evaluateWithoutErrorHandling(t,e,i,o,n,r){return this._styleExpression.evaluateWithoutErrorHandling(t,e,i,o,n,r)}evaluate(t,e,i,o,n,r){return this._styleExpression.evaluate(t,e,i,o,n,r)}}class Jg{constructor(t,e,i,o){this.kind=t,this.zoomStops=i,this._styleExpression=e,this.isStateDependent="camera"!==t&&!Uf(e.expression),this.interpolationType=o}evaluateWithoutErrorHandling(t,e,i,o,n,r){return this._styleExpression.evaluateWithoutErrorHandling(t,e,i,o,n,r)}evaluate(t,e,i,o,n,r){return this._styleExpression.evaluate(t,e,i,o,n,r)}interpolationFactor(t,e,i){return this.interpolationType?yg.interpolationFactor(this.interpolationType,t,e,i):0}}function Qg(t,e){if("error"===(t=Hg(t,e)).result)return t;const i=t.value.expression,o=Vf(i);if(!o&&("data-driven"!==(n=e)["property-type"]&&"cross-faded-data-driven"!==n["property-type"]))return Ug([new Gc("","data expressions not supported")]);var n;const r=Xf(i,["zoom","pitch","distance-from-center"]);if(!r&&!function(t){return!!t.expression&&t.expression.parameters.indexOf("zoom")>-1}(e))return Ug([new Gc("","zoom expressions not supported")]);const a=tm(i);if(!a&&!r)return Ug([new Gc("",'"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression.')]);if(a instanceof Gc)return Ug([a]);if(a instanceof yg&&!Xg(e))return Ug([new Gc("",'"interpolate" expressions cannot be used with this property')]);if(!a)return Vg(new $g(o?"constant":"source",t.value));const s=a instanceof yg?a.interpolation:void 0;return Vg(new Jg(o?"camera":"composite",t.value,a.labels,s))}function tm(t){let e=null;if(t instanceof xg)e=tm(t.result);else if(t instanceof bg){for(const i of t.args)if(e=tm(i),e)break}else(t instanceof $f||t instanceof yg)&&t.input instanceof Sf&&"zoom"===t.input.name&&(e=t);return e instanceof Gc||t.eachChild((t=>{const i=tm(t);i instanceof Gc?e=i:!e&&i?e=new Gc("",'"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression.'):e&&i&&e!==i&&(e=new Gc("",'Only one zoom-based "step" or "interpolate" subexpression may be used in an expression.'))})),e}function em(t){return"object"==typeof t?["literal",t]:t}function im(t){switch(t.colorSpace){case"hcl":return"interpolate-hcl";case"lab":return"interpolate-lab";default:return"interpolate"}}function om(t,e){const i=em((o=t.default,n=e.default,void 0!==o?o:void 0!==n?n:void 0));var o,n;return void 0===i&&"resolvedImage"===e.type?"":i}function nm(t,e,i){const o=sm(t,e),n=["get",t.property];if("categorical"===o&&"boolean"==typeof i[0][0]){const o=["case"];for(const t of i)o.push(["==",n,t[0]],t[1]);return o.push(om(t,e)),o}if("categorical"===o){const o=["match",n];for(const t of i)am(o,t[0],t[1],!1);return o.push(om(t,e)),o}if("interval"===o){const e=["step",["number",n]];for(const t of i)am(e,t[0],t[1],!0);return rm(e),void 0===t.default?e:["case",["==",["typeof",n],"number"],e,em(t.default)]}if("exponential"===o){const e=void 0!==t.base?t.base:1,o=[im(t),1===e?["linear"]:["exponential",e],["number",n]];for(const t of i)am(o,t[0],t[1],!1);return void 0===t.default?o:["case",["==",["typeof",n],"number"],o,em(t.default)]}throw new Error(`Unknown property function type ${o}`)}function rm(t){"step"===t[0]&&3===t.length&&(t.push(0),t.push(t[3]))}function am(t,e,i,o){t.length>3&&e===t[t.length-2]||(o&&2===t.length||t.push(e),t.push(i))}function sm(t,e){return t.type?t.type:e.expression.interpolated?"exponential":"interval"}function lm(t){const e=["concat"],i=/{([^{}]+)}/g;let o=0;for(let n=i.exec(t);null!==n;n=i.exec(t)){const r=t.slice(o,i.lastIndex-n[0].length);o=i.lastIndex,r.length>0&&e.push(r),e.push(["get",n[1]])}if(1===e.length)return t;if(o<t.length)e.push(t.slice(o));else if(2===e.length)return["to-string",e[1]];return e}function um(t){if(Array.isArray(t))return t.map(um);if(t instanceof Object&&!(t instanceof Number||t instanceof String||t instanceof Boolean)){const e={};for(const i in t)e[i]=um(t[i]);return e}return function(t){return t instanceof Number||t instanceof String||t instanceof Boolean?t.valueOf():t}(t)}function pm(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(!pm(e)&&"boolean"!=typeof e)return!1;return!0;default:return!0}}function dm(t,e="fill"){if(null==t)return{filter:()=>!0,needGeometry:!1,needFeature:!1};pm(t)||(t=ym(t));const i=t;let o=!0;try{o=function(t){if(!fm(t))return t;let e=um(t);return cm(e),e=hm(e),e}(i)}catch(u){console.warn(`Failed to extract static filter. Filter will continue working, but at higher memory usage and slower framerate.\nThis is most likely a bug, please report this via https://github.com/mapbox/mapbox-gl-js/issues/new?assignees=&labels=&template=Bug_report.md\nand paste the contents of this message in the report.\nThank you!\nFilter Expression:\n${JSON.stringify(i,null,2)}\n `)}const n=Rc[`filter_${e}`],r=Hg(o,n);let a=null;if("error"===r.result)throw new Error(r.value.map((t=>`${t.key}: ${t.message}`)).join(", "));a=(t,e,i)=>r.value.evaluate(t,e,{},i);let s=null,l=null;if(o!==i){const t=Hg(i,n);if("error"===t.result)throw new Error(t.value.map((t=>`${t.key}: ${t.message}`)).join(", "));s=(e,i,o,n,r)=>t.value.evaluate(e,i,{},o,void 0,void 0,n,r),l=!Vf(t.value.expression)}a=a;return{filter:a,dynamicFilter:s||void 0,needGeometry:vm(o),needFeature:!!l}}function hm(t){if(!Array.isArray(t))return t;const e=function(t){if(gm.has(t[0]))for(let e=1;e<t.length;e++){if(fm(t[e]))return!0}return t}(t);return!0===e?e:e.map((t=>hm(t)))}function cm(t){let e=!1;const i=[];if("case"===t[0]){for(let o=1;o<t.length-1;o+=2)e=e||fm(t[o]),i.push(t[o+1]);i.push(t[t.length-1])}else if("match"===t[0]){e=e||fm(t[1]);for(let e=2;e<t.length-1;e+=2)i.push(t[e+1]);i.push(t[t.length-1])}else if("step"===t[0]){e=e||fm(t[1]);for(let e=1;e<t.length-1;e+=2)i.push(t[e+1])}e&&(t.length=0,t.push("any",...i));for(let o=1;o<t.length;o++)cm(t[o])}function fm(t){if(!Array.isArray(t))return!1;if("pitch"===(e=t[0])||"distance-from-center"===e)return!0;var e;for(let i=1;i<t.length;i++){if(fm(t[i]))return!0}return!1}const gm=new Set(["in","==","!=",">",">=","<","<=","to-boolean"]);function mm(t,e){return t<e?-1:t>e?1:0}function vm(t){if(!Array.isArray(t))return!1;if("within"===t[0])return!0;for(let e=1;e<t.length;e++)if(vm(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?_m(t[1],t[2],"=="):"!="===e?km(_m(t[1],t[2],"==")):"<"===e||">"===e||"<="===e||">="===e?_m(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(km)):"in"===e?bm(t[1],t.slice(2)):"!in"===e?km(bm(t[1],t.slice(2))):"has"===e?xm(t[1]):"!has"===e?km(xm(t[1])):"within"!==e||t}function _m(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 bm(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(mm)]]:["filter-in-small",t,["literal",e]]}}function xm(t){switch(t){case"$type":return!0;case"$id":return["filter-has-id"];default:return["filter-has",t]}}function km(t){return["!",t]}var wm=["type","source","source-layer","minzoom","maxzoom","filter","layout"];function Sm(t,e){const i={};for(const o in t)"ref"!==o&&(i[o]=t[o]);return wm.forEach((t=>{t in e&&(i[t]=e[t])})),i}Fc((function(t,e){var i=function(){var t=function(t,e,i,o){for(i=i||{},o=t.length;o--;i[t[o]]=e);return i},e=[1,12],i=[1,13],o=[1,9],n=[1,10],r=[1,11],a=[1,14],s=[1,15],l=[14,18,22,24],u=[18,22],p=[22,24],d={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,o,n,r,a){var s=r.length-1;switch(n){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.$=r[s-1];case 13:this.$={},Object.defineProperty(this.$,"__line__",{value:this._$.first_line,enumerable:!1});break;case 14:case 19:this.$=r[s-1],Object.defineProperty(this.$,"__line__",{value:this._$.first_line,enumerable:!1});break;case 15:this.$=[r[s-2],r[s]];break;case 16:this.$={},this.$[r[s][0]]=r[s][1];break;case 17:this.$=r[s-2],r[s-2][r[s][0]]=r[s][1];break;case 18:this.$=[],Object.defineProperty(this.$,"__line__",{value:this._$.first_line,enumerable:!1});break;case 20:this.$=[r[s]];break;case 21:this.$=r[s-2],r[s-2].push(r[s])}},table:[{3:5,4:e,5:6,6:i,7:3,8:o,9:4,10:n,11:r,12:1,13:2,15:7,16:8,17:a,23:s},{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:o,9:4,10:n,11:r,13:23,15:7,16:8,17:a,23:s,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(p,[2,20]),t(l,[2,14]),{3:20,4:e,20:29},{3:5,4:e,5:6,6:i,7:3,8:o,9:4,10:n,11:r,13:30,15:7,16:8,17:a,23:s},t(l,[2,19]),{3:5,4:e,5:6,6:i,7:3,8:o,9:4,10:n,11:r,13:31,15:7,16:8,17:a,23:s},t(u,[2,17]),t(u,[2,15]),t(p,[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],o=[null],n=[],r=this.table,a="",s=0,l=0,u=2,p=1,d=n.slice.call(arguments,1),h=Object.create(this.lexer),c={yy:{}};for(var f in this.yy)Object.prototype.hasOwnProperty.call(this.yy,f)&&(c.yy[f]=this.yy[f]);h.setInput(t,c.yy),c.yy.lexer=h,c.yy.parser=this,void 0===h.yylloc&&(h.yylloc={});var g=h.yylloc;n.push(g);var m=h.options&&h.options.ranges;function v(){var t;return"number"!=typeof(t=h.lex()||p)&&(t=e.symbols_[t]||t),t}"function"==typeof c.yy.parseError?this.parseError=c.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;for(var y,_,b,x,k,w,S,C,z={};;){if(_=i[i.length-1],this.defaultActions[_]?b=this.defaultActions[_]:(null==y&&(y=v()),b=r[_]&&r[_][y]),void 0===b||!b.length||!b[0]){var T="";for(k in C=[],r[_])this.terminals_[k]&&k>u&&C.push("'"+this.terminals_[k]+"'");T=h.showPosition?"Parse error on line "+(s+1)+":\n"+h.showPosition()+"\nExpecting "+C.join(", ")+", got '"+(this.terminals_[y]||y)+"'":"Parse error on line "+(s+1)+": Unexpected "+(y==p?"end of input":"'"+(this.terminals_[y]||y)+"'"),this.parseError(T,{text:h.match,token:this.terminals_[y]||y,line:h.yylineno,loc:g,expected:C})}if(b[0]instanceof Array&&b.length>1)throw new Error("Parse Error: multiple actions possible at state: "+_+", token: "+y);switch(b[0]){case 1:i.push(y),o.push(h.yytext),n.push(h.yylloc),i.push(b[1]),y=null,l=h.yyleng,a=h.yytext,s=h.yylineno,g=h.yylloc;break;case 2:if(w=this.productions_[b[1]][1],z.$=o[o.length-w],z._$={first_line:n[n.length-(w||1)].first_line,last_line:n[n.length-1].last_line,first_column:n[n.length-(w||1)].first_column,last_column:n[n.length-1].last_column},m&&(z._$.range=[n[n.length-(w||1)].range[0],n[n.length-1].range[1]]),void 0!==(x=this.performAction.apply(z,[a,l,s,c.yy,b[1],o,n].concat(d))))return x;w&&(i=i.slice(0,-1*w*2),o=o.slice(0,-1*w),n=n.slice(0,-1*w)),i.push(this.productions_[b[1]][0]),o.push(z.$),n.push(z._$),S=r[i[i.length-2]][i[i.length-1]],i.push(S);break;case 3:return!0}}return!0}},h={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 o=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 n=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===o.length?this.yylloc.first_column:0)+o[o.length-i.length].length-i[0].length:this.yylloc.first_column-e},this.options.ranges&&(this.yylloc.range=[n[0],n[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,o,n;if(this.options.backtrack_lexer&&(n={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&&(n.yylloc.range=this.yylloc.range.slice(0))),(o=t[0].match(/(?:\r\n?|\n).*/g))&&(this.yylineno+=o.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:o?o[o.length-1].length-o[o.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 r in n)this[r]=n[r];return!1}return!1},next:function(){if(this.done)return this.EOF;var t,e,i,o;this._input||(this.done=!0),this._more||(this.yytext="",this.match="");for(var n=this._currentRules(),r=0;r<n.length;r++)if((i=this._input.match(this.rules[n[r]]))&&(!e||i[0].length>e[0].length)){if(e=i,o=r,this.options.backtrack_lexer){if(!1!==(t=this.test_match(i,n[r])))return t;if(this._backtrack){e=!1;continue}return!1}if(!this.options.flex)break}return e?!1!==(t=this.test_match(e,n[o]))&&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,o){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 c(){this.yy={}}return d.lexer=h,c.prototype=d,d.Parser=c,new c}();e.parser=i,e.Parser=i.Parser,e.parse=function(){return i.parse.apply(i,arguments)}}));const Cm=Zg,zm=Qg,Tm=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 o=["color"===e.type?"to-color":e.type,i,em(t.default)];return"array"===e.type&&o.splice(1,0,e.value,e.length||null),o}}(t,e);const o=i&&"object"==typeof i[0][0],n=o||void 0!==t.property,r=o||!n;return i=i.map((t=>!n&&e.tokens&&"string"==typeof t[1]?[t[0],lm(t[1])]:[t[0],em(t[1])])),o?function(t,e,i){const o={},n={},r=[];for(let a=0;a<i.length;a++){const e=i[a],s=e[0].zoom;void 0===o[s]&&(o[s]={zoom:s,type:t.type,property:t.property,default:t.default},n[s]=[],r.push(s)),n[s].push([e[0].value,e[1]])}if("exponential"===sm({},e)){const i=[im(t),["linear"],["zoom"]];for(const t of r){am(i,t,nm(o[t],e,n[t]),!1)}return i}{const t=["step",["zoom"]];for(const i of r){am(t,i,nm(o[i],e,n[i]),!0)}return rm(t),t}}(t,e,i):r?function(t,e,i,o=["zoom"]){const n=sm(t,e);let r,a=!1;if("interval"===n)r=["step",o],a=!0;else{if("exponential"!==n)throw new Error(`Unknown zoom function type "${n}"`);{const e=void 0!==t.base?t.base:1;r=[im(t),1===e?["linear"]:["exponential",e],o]}}for(const s of i)am(r,s[0],s[1],a);return rm(r),r}(t,e,i):nm(t,e,i)},Em=Kg;var Pm=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 o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}(),Om=function(t){function e(e){var i=e||{},o=void 0!==i.projection?i.projection:"EPSG:3857",n=void 0!==i.tileGrid?i.tileGrid:Yh({extent:$h(o),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:o,reprojectionErrorThreshold:i.reprojectionErrorThreshold,tileGrid:n,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 Pm(e,t),e}(Tc),jm=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 o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}(),Rm='© <a href="https://www.openstreetmap.org/copyright" target="_blank">OpenStreetMap</a> contributors.',Im=function(t){function e(e){var i,o=e||{};i=void 0!==o.attributions?o.attributions:[Rm];var n=void 0!==o.crossOrigin?o.crossOrigin:"anonymous",r=void 0!==o.url?o.url:"https://{a-c}.tile.openstreetmap.org/{z}/{x}/{y}.png";return t.call(this,{attributions:i,attributionsCollapsible:!1,cacheSize:o.cacheSize,crossOrigin:n,imageSmoothing:o.imageSmoothing,maxZoom:void 0!==o.maxZoom?o.maxZoom:19,opaque:void 0===o.opaque||o.opaque,reprojectionErrorThreshold:o.reprojectionErrorThreshold,tileLoadFunction:o.tileLoadFunction,transition:o.transition,url:r,wrapX:o.wrapX,zDirection:o.zDirection})||this}return jm(e,t),e}(Om);const Fm=Array.isArray;function Mm(t,e){if(1===arguments.length)return e=>Mm(t,e);if(t<1)throw new Error("First argument to splitEvery must be a positive integer");const i=[];let o=0;for(;o<e.length;)i.push(e.slice(o,o+=t));return i}(function t(e,i=[]){return(...o)=>{return(n=[...i,...o]).length>=e.length?e(...n):t(e,n);var n}})((function(t,e,i){if(!Fm(i))throw new TypeError("reduce: list must be array or iterable");let o=0;const n=i.length;for(;o<n;)e=t(e,i[o],o,i),o++;return e}))((function t(e,i){return 1===arguments.length?i=>t(e,i):e*i}),1);const Am=new qd({features:[],wrapX:!1}),Dm=new Cd({source:Am,style:new yl({image:new hl({radius:3,fill:new Ns({color:"grey"})})})});function Lm(t,e){return Mm(2,t&&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)=>{Am.addFeature(new ds({geometry:new Ca(t),i:e}))}))}const Gm={color:"#ff0000",width:3},Nm=new sl(Gm),Bm=new sl(__spreadProps(__spreadValues({},Gm),{lineDash:[2,8]})),qm=new Ns({color:"rgba(255, 0, 0, 0.1)"}),Wm=new pl({stroke:new sl({color:"red",width:2}),points:4,radius1:15,radius2:1}),Vm=new hl({radius:6,fill:new Ns({color:"#ff0000"})}),Um=new yl({image:new pl({fill:new Ns({color:"#fff"}),stroke:new sl({color:"#ff0000",width:2}),points:4,radius:5,angle:Math.PI/4}),geometry:function(t){const e=t.getGeometry();if(e instanceof Ba){const t=e.getCoordinates()[0];return new Ps(t)}}}),Xm=new qd,Km=new Cd({source:Xm,style:[new yl({fill:qm,stroke:Nm}),Um]});const Ym=new hh({source:Am,pixelTolerance:15});
|
37
|
+
Fc((function(t,e){!function(i){var o=e&&!e.nodeType&&e,n=t&&!t.nodeType&&t,r="object"==typeof Ic&&Ic;r.global!==r&&r.window!==r&&r.self!==r||(i=r);var a,s,l=2147483647,u=36,p=/^xn--/,d=/[^\x20-\x7E]/,h=/[\x2E\u3002\uFF0E\uFF61]/g,c={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,g=String.fromCharCode;function m(t){throw RangeError(c[t])}function v(t,e){for(var i=t.length,o=[];i--;)o[i]=e(t[i]);return o}function y(t,e){var i=t.split("@"),o="";return i.length>1&&(o=i[0]+"@",t=i[1]),o+v((t=t.replace(h,".")).split("."),e).join(".")}function _(t){for(var e,i,o=[],n=0,r=t.length;n<r;)(e=t.charCodeAt(n++))>=55296&&e<=56319&&n<r?56320==(64512&(i=t.charCodeAt(n++)))?o.push(((1023&e)<<10)+(1023&i)+65536):(o.push(e),n--):o.push(e);return o}function b(t){return v(t,(function(t){var e="";return t>65535&&(e+=g((t-=65536)>>>10&1023|55296),t=56320|1023&t),e+=g(t)})).join("")}function x(t,e){return t+22+75*(t<26)-((0!=e)<<5)}function k(t,e,i){var o=0;for(t=i?f(t/700):t>>1,t+=f(t/e);t>455;o+=u)t=f(t/35);return f(o+36*t/(t+38))}function w(t){var e,i,o,n,r,a,s,p,d,h,c,g=[],v=t.length,y=0,_=128,x=72;for((i=t.lastIndexOf("-"))<0&&(i=0),o=0;o<i;++o)t.charCodeAt(o)>=128&&m("not-basic"),g.push(t.charCodeAt(o));for(n=i>0?i+1:0;n<v;){for(r=y,a=1,s=u;n>=v&&m("invalid-input"),((p=(c=t.charCodeAt(n++))-48<10?c-22:c-65<26?c-65:c-97<26?c-97:u)>=u||p>f((l-y)/a))&&m("overflow"),y+=p*a,!(p<(d=s<=x?1:s>=x+26?26:s-x));s+=u)a>f(l/(h=u-d))&&m("overflow"),a*=h;x=k(y-r,e=g.length+1,0==r),f(y/e)>l-_&&m("overflow"),_+=f(y/e),y%=e,g.splice(y++,0,_)}return b(g)}function S(t){var e,i,o,n,r,a,s,p,d,h,c,v,y,b,w,S=[];for(v=(t=_(t)).length,e=128,i=0,r=72,a=0;a<v;++a)(c=t[a])<128&&S.push(g(c));for(o=n=S.length,n&&S.push("-");o<v;){for(s=l,a=0;a<v;++a)(c=t[a])>=e&&c<s&&(s=c);for(s-e>f((l-i)/(y=o+1))&&m("overflow"),i+=(s-e)*y,e=s,a=0;a<v;++a)if((c=t[a])<e&&++i>l&&m("overflow"),c==e){for(p=i,d=u;!(p<(h=d<=r?1:d>=r+26?26:d-r));d+=u)w=p-h,b=u-h,S.push(g(x(h+w%b,0))),p=f(w/b);S.push(g(x(p,0))),r=k(i,y,o==n),i=0,++o}++i,++e}return S.join("")}if(a={version:"1.3.2",ucs2:{decode:_,encode:b},decode:w,encode:S,toASCII:function(t){return y(t,(function(t){return d.test(t)?"xn--"+S(t):t}))},toUnicode:function(t){return y(t,(function(t){return p.test(t)?w(t.slice(4).toLowerCase()):t}))}},o&&n)if(t.exports==o)n.exports=a;else for(s in a)a.hasOwnProperty(s)&&(o[s]=a[s]);else i.punycode=a}(Ic)}));var Ac=function(t,e,i,o){e=e||"&",i=i||"=";var n={};if("string"!=typeof t||0===t.length)return n;var r=/\+/g;t=t.split(e);var a=1e3;o&&"number"==typeof o.maxKeys&&(a=o.maxKeys);var s=t.length;a>0&&s>a&&(s=a);for(var l=0;l<s;++l){var u,p,d,h,c=t[l].replace(r,"%20"),f=c.indexOf(i);f>=0?(u=c.substr(0,f),p=c.substr(f+1)):(u=c,p=""),d=decodeURIComponent(u),h=decodeURIComponent(p),Mc(n,d)?Array.isArray(n[d])?n[d].push(h):n[d]=[n[d],h]:n[d]=h}return n},Dc=function(t){switch(typeof t){case"string":return t;case"boolean":return t?"true":"false";case"number":return isFinite(t)?t:"";default:return""}},Lc=function(t,e,i,o){return e=e||"&",i=i||"=",null===t&&(t=void 0),"object"==typeof t?Object.keys(t).map((function(o){var n=encodeURIComponent(Dc(o))+i;return Array.isArray(t[o])?t[o].map((function(t){return n+encodeURIComponent(Dc(t))})).join(e):n+encodeURIComponent(Dc(t[o]))})).join(e):o?encodeURIComponent(Dc(o))+i+encodeURIComponent(Dc(t)):""};Fc((function(t,e){e.decode=e.parse=Ac,e.encode=e.stringify=Lc}));class Gc extends Error{constructor(t,e){super(e),this.message=e,this.key=t}}class Nc{constructor(t,e=[]){this.parent=t,this.bindings={};for(const[i,o]of e)this.bindings[i]=o}concat(t){return new Nc(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 Bc={kind:"null"},qc={kind:"number"},Wc={kind:"string"},Vc={kind:"boolean"},Uc={kind:"color"},Xc={kind:"object"},Kc={kind:"value"},Yc={kind:"collator"},Zc={kind:"formatted"},$c={kind:"resolvedImage"};function Hc(t,e){return{kind:"array",itemType:t,N:e}}function Jc(t){if("array"===t.kind){const e=Jc(t.itemType);return"number"==typeof t.N?`array<${e}, ${t.N}>`:"value"===t.itemType.kind?"array":`array<${e}>`}return t.kind}const Qc=[Bc,qc,Wc,Vc,Uc,Zc,Xc,Hc(Kc),$c];function tf(t,e){if("error"===e.kind)return null;if("array"===t.kind){if("array"===e.kind&&(0===e.N&&"value"===e.itemType.kind||!tf(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 Qc)if(!tf(t,e))return null}return`Expected ${Jc(t)} but found ${Jc(e)} instead.`}function ef(t,e){return e.some((e=>e.kind===t.kind))}function of(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 nf=Fc((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 o(t){return(t=Math.round(t))<0?0:t>255?255:t}function n(t){return t<0?0:t>1?1:t}function r(t){return"%"===t[t.length-1]?o(parseFloat(t)/100*255):o(parseInt(t))}function a(t){return"%"===t[t.length-1]?n(parseFloat(t)/100):n(parseFloat(t))}function s(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,n=t.replace(/ /g,"").toLowerCase();if(n in i)return i[n].slice();if("#"===n[0])return 4===n.length?(e=parseInt(n.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===n.length&&(e=parseInt(n.substr(1),16))>=0&&e<=16777215?[(16711680&e)>>16,(65280&e)>>8,255&e,1]:null;var l=n.indexOf("("),u=n.indexOf(")");if(-1!==l&&u+1===n.length){var p=n.substr(0,l),d=n.substr(l+1,u-(l+1)).split(","),h=1;switch(p){case"rgba":if(4!==d.length)return null;h=a(d.pop());case"rgb":return 3!==d.length?null:[r(d[0]),r(d[1]),r(d[2]),h];case"hsla":if(4!==d.length)return null;h=a(d.pop());case"hsl":if(3!==d.length)return null;var c=(parseFloat(d[0])%360+360)%360/360,f=a(d[1]),g=a(d[2]),m=g<=.5?g*(f+1):g+f-g*f,v=2*g-m;return[o(255*s(v,m,c+1/3)),o(255*s(v,m,c)),o(255*s(v,m,c-1/3)),h];default:return null}}return null}}catch(l){}}));class rf{constructor(t,e,i,o=1){this.r=t,this.g=e,this.b=i,this.a=o}static parse(t){if(!t)return;if(t instanceof rf)return t;if("string"!=typeof t)return;const e=nf.parseCSSColor(t);return e?new rf(e[0]/255*e[3],e[1]/255*e[3],e[2]/255*e[3],e[3]):void 0}toString(){const[t,e,i,o]=this.toArray();return`rgba(${Math.round(t)},${Math.round(e)},${Math.round(i)},${o})`}toArray(){const{r:t,g:e,b:i,a:o}=this;return 0===o?[0,0,0,0]:[255*t/o,255*e/o,255*i/o,o]}}rf.black=new rf(0,0,0,1),rf.white=new rf(1,1,1,1),rf.transparent=new rf(0,0,0,0),rf.red=new rf(1,0,0,1),rf.blue=new rf(0,0,1,1);class af{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 sf{constructor(t,e,i,o,n){this.text=t,this.image=e,this.scale=i,this.fontStack=o,this.textColor=n}}class lf{constructor(t){this.sections=t}static fromString(t){return new lf([new sf(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 lf?t:lf.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 uf{constructor(t){this.name=t.name,this.available=t.available}toString(){return this.name}static fromString(t){return t?new uf({name:t,available:!1}):null}serialize(){return["image",this.name]}}function pf(t,e,i,o){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 o?[t,e,i,o]:[t,e,i]).join(", ")}]: 'r', 'g', and 'b' must be between 0 and 255.`}return void 0===o||"number"==typeof o&&o>=0&&o<=1?null:`Invalid rgba value [${[t,e,i,o].join(", ")}]: 'a' must be between 0 and 1.`}function df(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 rf)return!0;if(t instanceof af)return!0;if(t instanceof lf)return!0;if(t instanceof uf)return!0;if(Array.isArray(t)){for(const e of t)if(!df(e))return!1;return!0}if("object"==typeof t){for(const e in t)if(!df(t[e]))return!1;return!0}return!1}function hf(t){if(null===t)return Bc;if("string"==typeof t)return Wc;if("boolean"==typeof t)return Vc;if("number"==typeof t)return qc;if(t instanceof rf)return Uc;if(t instanceof af)return Yc;if(t instanceof lf)return Zc;if(t instanceof uf)return $c;if(Array.isArray(t)){const e=t.length;let i;for(const o of t){const t=hf(o);if(i){if(i===t)continue;i=Kc;break}i=t}return Hc(i||Kc,e)}return Xc}function cf(t){const e=typeof t;return null===t?"":"string"===e||"number"===e||"boolean"===e?String(t):t instanceof rf||t instanceof lf||t instanceof uf?t.toString():JSON.stringify(t)}class ff{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(!df(t[1]))return e.error("invalid value");const i=t[1];let o=hf(i);const n=e.expectedType;return"array"!==o.kind||0!==o.N||!n||"array"!==n.kind||"number"==typeof n.N&&0!==n.N||(o=n),new ff(o,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 rf?["rgba"].concat(this.value.toArray()):this.value instanceof lf?this.value.serialize():this.value}}class gf{constructor(t){this.name="ExpressionEvaluationError",this.message=t}toJSON(){return this.message}}const mf={string:Wc,number:qc,boolean:Vc,object:Xc};class vf{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,o=1;const n=t[0];if("array"===n){let n,r;if(t.length>2){const i=t[1];if("string"!=typeof i||!(i in mf)||"object"===i)return e.error('The item type argument of "array" must be one of string, number, boolean',1);n=mf[i],o++}else n=Kc;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);r=t[2],o++}i=Hc(n,r)}else i=mf[n];const r=[];for(;o<t.length;o++){const i=e.parse(t[o],o,Kc);if(!i)return null;r.push(i)}return new vf(i,r)}evaluate(t){for(let e=0;e<this.args.length;e++){const i=this.args[e].evaluate(t);if(!tf(this.type,hf(i)))return i;if(e===this.args.length-1)throw new gf(`Expected value to be of type ${Jc(this.type)}, but found ${Jc(hf(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 o=t.N;("number"==typeof o||this.args.length>1)&&e.push(o)}}return e.concat(this.args.map((t=>t.serialize())))}}class yf{constructor(t){this.type=Zc,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 o=[];let n=!1;for(let r=1;r<=t.length-1;++r){const i=t[r];if(n&&"object"==typeof i&&!Array.isArray(i)){n=!1;let t=null;if(i["font-scale"]&&(t=e.parse(i["font-scale"],1,qc),!t))return null;let r=null;if(i["text-font"]&&(r=e.parse(i["text-font"],1,Hc(Wc)),!r))return null;let a=null;if(i["text-color"]&&(a=e.parse(i["text-color"],1,Uc),!a))return null;const s=o[o.length-1];s.scale=t,s.font=r,s.textColor=a}else{const i=e.parse(t[r],1,Kc);if(!i)return null;const a=i.type.kind;if("string"!==a&&"value"!==a&&"null"!==a&&"resolvedImage"!==a)return e.error("Formatted text type must be 'string', 'value', 'image' or 'null'.");n=!0,o.push({content:i,scale:null,font:null,textColor:null})}}return new yf(o)}evaluate(t){return new lf(this.sections.map((e=>{const i=e.content.evaluate(t);return hf(i)===$c?new sf("",i,null,null,null):new sf(cf(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 _f{constructor(t){this.type=$c,this.input=t}static parse(t,e){if(2!==t.length)return e.error("Expected two arguments.");const i=e.parse(t[1],1,Wc);return i?new _f(i):e.error("No image name provided.")}evaluate(t){const e=this.input.evaluate(t),i=uf.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 bf={"to-boolean":Vc,"to-color":Uc,"to-number":qc,"to-string":Wc};class xf{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 o=bf[i],n=[];for(let r=1;r<t.length;r++){const i=e.parse(t[r],r,Kc);if(!i)return null;n.push(i)}return new xf(o,n)}evaluate(t){if("boolean"===this.type.kind)return Boolean(this.args[0].evaluate(t));if("color"===this.type.kind){let e,i;for(const o of this.args){if(e=o.evaluate(t),i=null,e instanceof rf)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.`:pf(e[0],e[1],e[2],e[3]),!i))return new rf(e[0]/255,e[1]/255,e[2]/255,e[3])}throw new gf(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 o=Number(e);if(!isNaN(o))return o}throw new gf(`Could not convert ${JSON.stringify(e)} to number.`)}return"formatted"===this.type.kind?lf.fromString(cf(this.args[0].evaluate(t))):"resolvedImage"===this.type.kind?uf.fromString(cf(this.args[0].evaluate(t))):cf(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 yf([{content:this.args[0],scale:null,font:null,textColor:null}]).serialize();if("resolvedImage"===this.type.kind)return new _f(this.args[0]).serialize();const t=[`to-${this.type.kind}`];return this.eachChild((e=>{t.push(e.serialize())})),t}}const kf=["Unknown","Point","LineString","Polygon"];class wf{constructor(){this.globals=null,this.feature=null,this.featureState=null,this.formattedSection=null,this._parseColorCache={},this.availableImages=null,this.canonical=null,this.featureTileCoord=null,this.featureDistanceData=null}id(){return this.feature&&"id"in this.feature?this.feature.id:null}geometryType(){return this.feature?"number"==typeof this.feature.type?kf[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||{}}distanceFromCenter(){if(this.featureTileCoord&&this.featureDistanceData){const t=this.featureDistanceData.center,e=this.featureDistanceData.scale,{x:i,y:o}=this.featureTileCoord,n=i*e-t[0],r=o*e-t[1];return this.featureDistanceData.bearing[0]*n+this.featureDistanceData.bearing[1]*r}return 0}parseColor(t){let e=this._parseColorCache[t];return e||(e=this._parseColorCache[t]=rf.parse(t)),e}}class Sf{constructor(t,e,i,o){this.name=t,this.type=e,this._evaluate=i,this.args=o}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],o=Sf.definitions[i];if(!o)return e.error(`Unknown expression "${i}". If you wanted a literal array, use ["literal", [...]].`,0);const n=Array.isArray(o)?o[0]:o.type,r=Array.isArray(o)?[[o[1],o[2]]]:o.overloads,a=r.filter((([e])=>!Array.isArray(e)||e.length===t.length-1));let s=null;for(const[l,u]of a){s=new Yf(e.registry,e.path,null,e.scope);const o=[];let r=!1;for(let e=1;e<t.length;e++){const i=t[e],n=Array.isArray(l)?l[e-1]:l.type,a=s.parse(i,1+o.length,n);if(!a){r=!0;break}o.push(a)}if(!r)if(Array.isArray(l)&&l.length!==o.length)s.error(`Expected ${l.length} arguments, but found ${o.length} instead.`);else{for(let t=0;t<o.length;t++){const e=Array.isArray(l)?l[t]:l.type,i=o[t];s.concat(t+1).checkSubtype(e,i.type)}if(0===s.errors.length)return new Sf(i,n,u,o)}}if(1===a.length)e.errors.push(...s.errors);else{const i=(a.length?a:r).map((([t])=>{return e=t,Array.isArray(e)?`(${e.map(Jc).join(", ")})`:`(${Jc(e.type)}...)`;var e})).join(" | "),o=[];for(let n=1;n<t.length;n++){const i=e.parse(t[n],1+o.length);if(!i)return null;o.push(Jc(i.type))}e.error(`Expected arguments of type ${i}, but found (${o.join(", ")}) instead.`)}return null}static register(t,e){Sf.definitions=e;for(const i in e)t[i]=Sf}}class Cf{constructor(t,e,i){this.type=Yc,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 o=e.parse(void 0!==i["case-sensitive"]&&i["case-sensitive"],1,Vc);if(!o)return null;const n=e.parse(void 0!==i["diacritic-sensitive"]&&i["diacritic-sensitive"],1,Vc);if(!n)return null;let r=null;return i.locale&&(r=e.parse(i.locale,1,Wc),!r)?null:new Cf(o,n,r)}evaluate(t){return new af(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]}}const zf=8192;function Tf(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 Ef(t,e){return!(t[0]<=e[0])&&(!(t[2]>=e[2])&&(!(t[1]<=e[1])&&!(t[3]>=e[3])))}function Pf(t,e){const i=(180+t[0])/360;const o=(n=t[1],(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+n*Math.PI/360)))/360);var n;const r=Math.pow(2,e.z);return[Math.round(i*r*zf),Math.round(o*r*zf)]}function Of(t,e,i){const o=t[0]-e[0],n=t[1]-e[1],r=t[0]-i[0],a=t[1]-i[1];return o*a-r*n==0&&o*r<=0&&n*a<=0}function jf(t,e){let i=!1;for(let a=0,s=e.length;a<s;a++){const s=e[a];for(let e=0,a=s.length;e<a-1;e++){if(Of(t,s[e],s[e+1]))return!1;o=t,n=s[e],r=s[e+1],n[1]>o[1]!=r[1]>o[1]&&o[0]<(r[0]-n[0])*(o[1]-n[1])/(r[1]-n[1])+n[0]&&(i=!i)}}var o,n,r;return i}function Rf(t,e){for(let i=0;i<e.length;i++)if(jf(t,e[i]))return!0;return!1}function If(t,e,i,o){const n=t[0]-i[0],r=t[1]-i[1],a=e[0]-i[0],s=e[1]-i[1],l=o[0]-i[0],u=o[1]-i[1],p=n*u-l*r,d=a*u-l*s;return p>0&&d<0||p<0&&d>0}function Ff(t,e,i,o){const n=[e[0]-t[0],e[1]-t[1]],r=[o[0]-i[0],o[1]-i[1]];return 0!=(a=r)[0]*(s=n)[1]-a[1]*s[0]&&!(!If(t,e,i,o)||!If(i,o,t,e));var a,s}function Mf(t,e,i){for(const o of i)for(let i=0;i<o.length-1;++i)if(Ff(t,e,o[i],o[i+1]))return!0;return!1}function Af(t,e){for(let i=0;i<t.length;++i)if(!jf(t[i],e))return!1;for(let i=0;i<t.length-1;++i)if(Mf(t[i],t[i+1],e))return!1;return!0}function Df(t,e){for(let i=0;i<e.length;i++)if(Af(t,e[i]))return!0;return!1}function Lf(t,e,i){const o=[];for(let n=0;n<t.length;n++){const r=[];for(let o=0;o<t[n].length;o++){const a=Pf(t[n][o],i);Tf(e,a),r.push(a)}o.push(r)}return o}function Gf(t,e,i){const o=[];for(let n=0;n<t.length;n++){const r=Lf(t[n],e,i);o.push(r)}return o}function Nf(t,e,i,o){if(t[0]<i[0]||t[0]>i[2]){const e=.5*o;let n=t[0]-i[0]>e?-o:i[0]-t[0]>e?o:0;0===n&&(n=t[0]-i[2]>e?-o:i[2]-t[0]>e?o:0),t[0]+=n}Tf(e,t)}function Bf(t,e,i,o){const n=Math.pow(2,o.z)*zf,r=[o.x*zf,o.y*zf],a=[];for(const s of t)for(const t of s){const o=[t.x+r[0],t.y+r[1]];Nf(o,e,i,n),a.push(o)}return a}function qf(t,e,i,o){const n=Math.pow(2,o.z)*zf,r=[o.x*zf,o.y*zf],a=[];for(const l of t){const t=[];for(const i of l){const o=[i.x+r[0],i.y+r[1]];Tf(e,o),t.push(o)}a.push(t)}if(e[2]-e[0]<=n/2){(s=e)[0]=s[1]=1/0,s[2]=s[3]=-1/0;for(const t of a)for(const o of t)Nf(o,e,i,n)}var s;return a}class Wf{constructor(t,e){this.type=Vc,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(df(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 Wf(e,e.features[t].geometry)}else if("Feature"===e.type){const t=e.geometry.type;if("Polygon"===t||"MultiPolygon"===t)return new Wf(e,e.geometry)}else if("Polygon"===e.type||"MultiPolygon"===e.type)return new Wf(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],o=[1/0,1/0,-1/0,-1/0],n=t.canonicalID();if("Polygon"===e.type){const r=Lf(e.coordinates,o,n),a=Bf(t.geometry(),i,o,n);if(!Ef(i,o))return!1;for(const t of a)if(!jf(t,r))return!1}if("MultiPolygon"===e.type){const r=Gf(e.coordinates,o,n),a=Bf(t.geometry(),i,o,n);if(!Ef(i,o))return!1;for(const t of a)if(!Rf(t,r))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],o=[1/0,1/0,-1/0,-1/0],n=t.canonicalID();if("Polygon"===e.type){const r=Lf(e.coordinates,o,n),a=qf(t.geometry(),i,o,n);if(!Ef(i,o))return!1;for(const t of a)if(!Af(t,r))return!1}if("MultiPolygon"===e.type){const r=Gf(e.coordinates,o,n),a=qf(t.geometry(),i,o,n);if(!Ef(i,o))return!1;for(const t of a)if(!Df(t,r))return!1}return!0}(t,this.geometries)}return!1}eachChild(){}outputDefined(){return!0}serialize(){return["within",this.geojson]}}function Vf(t){if(t instanceof Sf){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 Wf)return!1;let e=!0;return t.eachChild((t=>{e&&!Vf(t)&&(e=!1)})),e}function Uf(t){if(t instanceof Sf&&"feature-state"===t.name)return!1;let e=!0;return t.eachChild((t=>{e&&!Uf(t)&&(e=!1)})),e}function Xf(t,e){if(t instanceof Sf&&e.indexOf(t.name)>=0)return!1;let i=!0;return t.eachChild((t=>{i&&!Xf(t,e)&&(i=!1)})),i}class Kf{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 Kf(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 Yf{constructor(t,e=[],i,o=new Nc,n=[]){this.registry=t,this.path=e,this.key=e.map((t=>`[${t}]`)).join(""),this.scope=o,this.errors=n,this.expectedType=i}parse(t,e,i,o,n={}){return e?this.concat(e,i,o)._parse(t,n):this._parse(t,n)}_parse(t,e){function i(t,e,i){return"assert"===i?new vf(e,[t]):"coerce"===i?new xf(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 n=t[0];if("string"!=typeof n)return this.error(`Expression name must be a string, but found ${typeof n} instead. If you wanted a literal array, use ["literal", [...]].`,0),null;const r=this.registry[n];if(r){let n=r.parse(t,this);if(!n)return null;if(this.expectedType){const t=this.expectedType,o=n.type;if("string"!==t.kind&&"number"!==t.kind&&"boolean"!==t.kind&&"object"!==t.kind&&"array"!==t.kind||"value"!==o.kind)if("color"!==t.kind&&"formatted"!==t.kind&&"resolvedImage"!==t.kind||"value"!==o.kind&&"string"!==o.kind){if(this.checkSubtype(t,o))return null}else n=i(n,t,e.typeAnnotation||"coerce");else n=i(n,t,e.typeAnnotation||"assert")}if(!(n instanceof ff)&&"resolvedImage"!==n.type.kind&&Zf(n)){const t=new wf;try{n=new ff(n.type,n.evaluate(t))}catch(o){return this.error(o.message),null}}return n}return this.error(`Unknown expression "${n}". If you wanted a literal array, use ["literal", [...]].`,0)}return void 0===t?this.error("'undefined' value invalid. Use null instead."):"object"==typeof t?this.error('Bare objects invalid. Use ["literal", {...}] instead.'):this.error(`Expected an array, but found ${typeof t} instead.`)}concat(t,e,i){const o="number"==typeof t?this.path.concat(t):this.path,n=i?this.scope.concat(i):this.scope;return new Yf(this.registry,o,e||null,n,this.errors)}error(t,...e){const i=`${this.key}${e.map((t=>`[${t}]`)).join("")}`;this.errors.push(new Gc(i,t))}checkSubtype(t,e){const i=tf(t,e);return i&&this.error(i),i}}function Zf(t){if(t instanceof Kf)return Zf(t.boundExpression);if(t instanceof Sf&&"error"===t.name)return!1;if(t instanceof Cf)return!1;if(t instanceof Wf)return!1;const e=t instanceof xf||t instanceof vf;let i=!0;return t.eachChild((t=>{i=e?i&&Zf(t):i&&t instanceof ff})),!!i&&(Vf(t)&&Xf(t,["zoom","heatmap-density","line-progress","sky-radial-progress","accumulated","is-supported-script","pitch","distance-from-center"]))}function $f(t,e){const i=t.length-1;let o,n,r=0,a=i,s=0;for(;r<=a;)if(s=Math.floor((r+a)/2),o=t[s],n=t[s+1],o<=e){if(s===i||e<n)return s;r=s+1}else{if(!(o>e))throw new gf("Input is not a number.");a=s-1}return 0}class Hf{constructor(t,e,i){this.type=t,this.input=e,this.labels=[],this.outputs=[];for(const[o,n]of i)this.labels.push(o),this.outputs.push(n)}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,qc);if(!i)return null;const o=[];let n=null;e.expectedType&&"value"!==e.expectedType.kind&&(n=e.expectedType);for(let r=1;r<t.length;r+=2){const i=1===r?-1/0:t[r],a=t[r+1],s=r,l=r+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.',s);if(o.length&&o[o.length-1][0]>=i)return e.error('Input/output pairs for "step" expressions must be arranged with input values in strictly ascending order.',s);const u=e.parse(a,l,n);if(!u)return null;n=n||u.type,o.push([i,u])}return new Hf(n,i,o)}evaluate(t){const e=this.labels,i=this.outputs;if(1===e.length)return i[0].evaluate(t);const o=this.input.evaluate(t);if(o<=e[0])return i[0].evaluate(t);const n=e.length;if(o>=e[n-1])return i[n-1].evaluate(t);return i[$f(e,o)].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 Jf=Qf;function Qf(t,e,i,o){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*(o-e)-this.cy,this.ay=1-this.cy-this.by,this.p1x=t,this.p1y=o,this.p2x=i,this.p2y=o}function tg(t,e,i){return t*(1-i)+e*i}Qf.prototype.sampleCurveX=function(t){return((this.ax*t+this.bx)*t+this.cx)*t},Qf.prototype.sampleCurveY=function(t){return((this.ay*t+this.by)*t+this.cy)*t},Qf.prototype.sampleCurveDerivativeX=function(t){return(3*this.ax*t+2*this.bx)*t+this.cx},Qf.prototype.solveCurveX=function(t,e){var i,o,n,r,a;for(void 0===e&&(e=1e-6),n=t,a=0;a<8;a++){if(r=this.sampleCurveX(n)-t,Math.abs(r)<e)return n;var s=this.sampleCurveDerivativeX(n);if(Math.abs(s)<1e-6)break;n-=r/s}if((n=t)<(i=0))return i;if(n>(o=1))return o;for(;i<o;){if(r=this.sampleCurveX(n),Math.abs(r-t)<e)return n;t>r?i=n:o=n,n=.5*(o-i)+i}return n},Qf.prototype.solve=function(t,e){return this.sampleCurveY(this.solveCurveX(t,e))};var eg=Object.freeze({__proto__:null,number:tg,color:function(t,e,i){return new rf(tg(t.r,e.r,i),tg(t.g,e.g,i),tg(t.b,e.b,i),tg(t.a,e.a,i))},array:function(t,e,i){return t.map(((t,o)=>tg(t,e[o],i)))}});const ig=.95047,og=1.08883,ng=4/29,rg=6/29,ag=3*rg*rg,sg=Math.PI/180,lg=180/Math.PI;function ug(t){return t>.008856451679035631?Math.pow(t,1/3):t/ag+ng}function pg(t){return t>rg?t*t*t:ag*(t-ng)}function dg(t){return 255*(t<=.0031308?12.92*t:1.055*Math.pow(t,1/2.4)-.055)}function hg(t){return(t/=255)<=.04045?t/12.92:Math.pow((t+.055)/1.055,2.4)}function cg(t){const e=hg(t.r),i=hg(t.g),o=hg(t.b),n=ug((.4124564*e+.3575761*i+.1804375*o)/ig),r=ug((.2126729*e+.7151522*i+.072175*o)/1);return{l:116*r-16,a:500*(n-r),b:200*(r-ug((.0193339*e+.119192*i+.9503041*o)/og)),alpha:t.a}}function fg(t){let e=(t.l+16)/116,i=isNaN(t.a)?e:e+t.a/500,o=isNaN(t.b)?e:e-t.b/200;return e=1*pg(e),i=ig*pg(i),o=og*pg(o),new rf(dg(3.2404542*i-1.5371385*e-.4985314*o),dg(-.969266*i+1.8760108*e+.041556*o),dg(.0556434*i-.2040259*e+1.0572252*o),t.alpha)}function gg(t,e,i){const o=e-t;return t+i*(o>180||o<-180?o-360*Math.round(o/360):o)}const mg={forward:cg,reverse:fg,interpolate:function(t,e,i){return{l:tg(t.l,e.l,i),a:tg(t.a,e.a,i),b:tg(t.b,e.b,i),alpha:tg(t.alpha,e.alpha,i)}}},vg={forward:function(t){const{l:e,a:i,b:o}=cg(t),n=Math.atan2(o,i)*lg;return{h:n<0?n+360:n,c:Math.sqrt(i*i+o*o),l:e,alpha:t.a}},reverse:function(t){const e=t.h*sg,i=t.c;return fg({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:tg(t.c,e.c,i),l:tg(t.l,e.l,i),alpha:tg(t.alpha,e.alpha,i)}}};class yg{constructor(t,e,i,o,n){this.type=t,this.operator=e,this.interpolation=i,this.input=o,this.labels=[],this.outputs=[];for(const[r,a]of n)this.labels.push(r),this.outputs.push(a)}static interpolationFactor(t,e,i,o){let n=0;if("exponential"===t.name)n=_g(e,t.base,i,o);else if("linear"===t.name)n=_g(e,1,i,o);else if("cubic-bezier"===t.name){const r=t.controlPoints;n=new Jf(r[0],r[1],r[2],r[3]).solve(_g(e,1,i,o))}return n}static parse(t,e){let[i,o,n,...r]=t;if(!Array.isArray(o)||0===o.length)return e.error("Expected an interpolation type expression.",1);if("linear"===o[0])o={name:"linear"};else if("exponential"===o[0]){const t=o[1];if("number"!=typeof t)return e.error("Exponential interpolation requires a numeric base.",1,1);o={name:"exponential",base:t}}else{if("cubic-bezier"!==o[0])return e.error(`Unknown interpolation type ${String(o[0])}`,1,0);{const t=o.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);o={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(n=e.parse(n,2,qc),!n)return null;const a=[];let s=null;"interpolate-hcl"===i||"interpolate-lab"===i?s=Uc:e.expectedType&&"value"!==e.expectedType.kind&&(s=e.expectedType);for(let l=0;l<r.length;l+=2){const t=r[l],i=r[l+1],o=l+3,n=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.',o);if(a.length&&a[a.length-1][0]>=t)return e.error('Input/output pairs for "interpolate" expressions must be arranged with input values in strictly ascending order.',o);const u=e.parse(i,n,s);if(!u)return null;s=s||u.type,a.push([t,u])}return"number"===s.kind||"color"===s.kind||"array"===s.kind&&"number"===s.itemType.kind&&"number"==typeof s.N?new yg(s,i,o,n,a):e.error(`Type ${Jc(s)} is not interpolatable.`)}evaluate(t){const e=this.labels,i=this.outputs;if(1===e.length)return i[0].evaluate(t);const o=this.input.evaluate(t);if(o<=e[0])return i[0].evaluate(t);const n=e.length;if(o>=e[n-1])return i[n-1].evaluate(t);const r=$f(e,o),a=e[r],s=e[r+1],l=yg.interpolationFactor(this.interpolation,o,a,s),u=i[r].evaluate(t),p=i[r+1].evaluate(t);return"interpolate"===this.operator?eg[this.type.kind.toLowerCase()](u,p,l):"interpolate-hcl"===this.operator?vg.reverse(vg.interpolate(vg.forward(u),vg.forward(p),l)):mg.reverse(mg.interpolate(mg.forward(u),mg.forward(p),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 _g(t,e,i,o){const n=o-i,r=t-i;return 0===n?0:1===e?r/n:(Math.pow(e,r)-1)/(Math.pow(e,n)-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 o=e.expectedType;o&&"value"!==o.kind&&(i=o);const n=[];for(const a of t.slice(1)){const t=e.parse(a,1+n.length,i,void 0,{typeAnnotation:"omit"});if(!t)return null;i=i||t.type,n.push(t)}const r=o&&n.some((t=>tf(o,t.type)));return new bg(r?Kc:i,n)}evaluate(t){let e,i=null,o=0;for(const n of this.args)if(o++,i=n.evaluate(t),i&&i instanceof uf&&!i.available&&(e||(e=i.name),i=null,o===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 xg{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 n=1;n<t.length-1;n+=2){const o=t[n];if("string"!=typeof o)return e.error(`Expected string, but found ${typeof o} instead.`,n);if(/[^a-zA-Z0-9_]/.test(o))return e.error("Variable names must contain only alphanumeric characters or '_'.",n);const r=e.parse(t[n+1],n+1);if(!r)return null;i.push([o,r])}const o=e.parse(t[t.length-1],t.length-1,e.expectedType,i);return o?new xg(i,o):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 kg{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,qc),o=e.parse(t[2],2,Hc(e.expectedType||Kc));if(!i||!o)return null;const n=o.type;return new kg(n.itemType,i,o)}evaluate(t){const e=this.index.evaluate(t),i=this.input.evaluate(t);if(e<0)throw new gf(`Array index out of bounds: ${e} < 0.`);if(e>=i.length)throw new gf(`Array index out of bounds: ${e} > ${i.length-1}.`);if(e!==Math.floor(e))throw new gf(`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 wg{constructor(t,e){this.type=Vc,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,Kc),o=e.parse(t[2],2,Kc);return i&&o?ef(i.type,[Vc,Wc,qc,Bc,Kc])?new wg(i,o):e.error(`Expected first argument to be of type boolean, string, number or null, but found ${Jc(i.type)} instead`):null}evaluate(t){const e=this.needle.evaluate(t),i=this.haystack.evaluate(t);if(!i)return!1;if(!of(e,["boolean","string","number","null"]))throw new gf(`Expected first argument to be of type boolean, string, number or null, but found ${Jc(hf(e))} instead.`);if(!of(i,["string","array"]))throw new gf(`Expected second argument to be of type array or string, but found ${Jc(hf(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 Sg{constructor(t,e,i){this.type=qc,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,Kc),o=e.parse(t[2],2,Kc);if(!i||!o)return null;if(!ef(i.type,[Vc,Wc,qc,Bc,Kc]))return e.error(`Expected first argument to be of type boolean, string, number or null, but found ${Jc(i.type)} instead`);if(4===t.length){const n=e.parse(t[3],3,qc);return n?new Sg(i,o,n):null}return new Sg(i,o)}evaluate(t){const e=this.needle.evaluate(t),i=this.haystack.evaluate(t);if(!of(e,["boolean","string","number","null"]))throw new gf(`Expected first argument to be of type boolean, string, number or null, but found ${Jc(hf(e))} instead.`);if(!of(i,["string","array"]))throw new gf(`Expected second argument to be of type array or string, but found ${Jc(hf(i))} instead.`);if(this.fromIndex){const o=this.fromIndex.evaluate(t);return i.indexOf(e,o)}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 Cg{constructor(t,e,i,o,n,r){this.inputType=t,this.type=e,this.input=i,this.cases=o,this.outputs=n,this.otherwise=r}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,o;e.expectedType&&"value"!==e.expectedType.kind&&(o=e.expectedType);const n={},r=[];for(let l=2;l<t.length-1;l+=2){let a=t[l];const s=t[l+1];Array.isArray(a)||(a=[a]);const u=e.concat(l);if(0===a.length)return u.error("Expected at least one branch label.");for(const t of a){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,hf(t)))return null}else i=hf(t);if(void 0!==n[String(t)])return u.error("Branch labels must be unique.");n[String(t)]=r.length}const p=e.parse(s,l,o);if(!p)return null;o=o||p.type,r.push(p)}const a=e.parse(t[1],1,Kc);if(!a)return null;const s=e.parse(t[t.length-1],t.length-1,o);return s?"value"!==a.type.kind&&e.concat(1).checkSubtype(i,a.type)?null:new Cg(i,o,a,n,r,s):null}evaluate(t){const e=this.input.evaluate(t);return(hf(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=[],o={};for(const r of e){const t=o[this.cases[r]];void 0===t?(o[this.cases[r]]=i.length,i.push([this.cases[r],[r]])):i[t][1].push(r)}const n=t=>"number"===this.inputType.kind?Number(t):t;for(const[r,a]of i)1===a.length?t.push(n(a[0])):t.push(a.map(n)),t.push(this.outputs[r].serialize());return t.push(this.otherwise.serialize()),t}}class zg{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 o=[];for(let r=1;r<t.length-1;r+=2){const n=e.parse(t[r],r,Vc);if(!n)return null;const a=e.parse(t[r+1],r+1,i);if(!a)return null;o.push([n,a]),i=i||a.type}const n=e.parse(t[t.length-1],t.length-1,i);return n?new zg(i,o,n):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 Tg{constructor(t,e,i,o){this.type=t,this.input=e,this.beginIndex=i,this.endIndex=o}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,Kc),o=e.parse(t[2],2,qc);if(!i||!o)return null;if(!ef(i.type,[Hc(Kc),Wc,Kc]))return e.error(`Expected first argument to be of type array or string, but found ${Jc(i.type)} instead`);if(4===t.length){const n=e.parse(t[3],3,qc);return n?new Tg(i.type,i,o,n):null}return new Tg(i.type,i,o)}evaluate(t){const e=this.input.evaluate(t),i=this.beginIndex.evaluate(t);if(!of(e,["string","array"]))throw new gf(`Expected first argument to be of type array or string, but found ${Jc(hf(e))} instead.`);if(this.endIndex){const o=this.endIndex.evaluate(t);return e.slice(i,o)}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 Eg(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 Pg(t,e,i,o){return 0===o.compare(e,i)}function Og(t,e,i){const o="=="!==t&&"!="!==t;return class n{constructor(t,e,i){this.type=Vc,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 r=e.parse(t[1],1,Kc);if(!r)return null;if(!Eg(i,r.type))return e.concat(1).error(`"${i}" comparisons are not supported for type '${Jc(r.type)}'.`);let a=e.parse(t[2],2,Kc);if(!a)return null;if(!Eg(i,a.type))return e.concat(2).error(`"${i}" comparisons are not supported for type '${Jc(a.type)}'.`);if(r.type.kind!==a.type.kind&&"value"!==r.type.kind&&"value"!==a.type.kind)return e.error(`Cannot compare types '${Jc(r.type)}' and '${Jc(a.type)}'.`);o&&("value"===r.type.kind&&"value"!==a.type.kind?r=new vf(a.type,[r]):"value"!==r.type.kind&&"value"===a.type.kind&&(a=new vf(r.type,[a])));let s=null;if(4===t.length){if("string"!==r.type.kind&&"string"!==a.type.kind&&"value"!==r.type.kind&&"value"!==a.type.kind)return e.error("Cannot use collator to compare non-string types.");if(s=e.parse(t[3],3,Yc),!s)return null}return new n(r,a,s)}evaluate(n){const r=this.lhs.evaluate(n),a=this.rhs.evaluate(n);if(o&&this.hasUntypedArgument){const e=hf(r),i=hf(a);if(e.kind!==i.kind||"string"!==e.kind&&"number"!==e.kind)throw new gf(`Expected arguments for "${t}" to be (string, string) or (number, number), but found (${e.kind}, ${i.kind}) instead.`)}if(this.collator&&!o&&this.hasUntypedArgument){const t=hf(r),i=hf(a);if("string"!==t.kind||"string"!==i.kind)return e(n,r,a)}return this.collator?i(n,r,a,this.collator.evaluate(n)):e(n,r,a)}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 jg=Og("==",(function(t,e,i){return e===i}),Pg),Rg=Og("!=",(function(t,e,i){return e!==i}),(function(t,e,i,o){return!Pg(0,e,i,o)})),Ig=Og("<",(function(t,e,i){return e<i}),(function(t,e,i,o){return o.compare(e,i)<0})),Fg=Og(">",(function(t,e,i){return e>i}),(function(t,e,i,o){return o.compare(e,i)>0})),Mg=Og("<=",(function(t,e,i){return e<=i}),(function(t,e,i,o){return o.compare(e,i)<=0})),Ag=Og(">=",(function(t,e,i){return e>=i}),(function(t,e,i,o){return o.compare(e,i)>=0}));class Dg{constructor(t,e,i,o,n){this.type=Wc,this.number=t,this.locale=e,this.currency=i,this.minFractionDigits=o,this.maxFractionDigits=n}static parse(t,e){if(3!==t.length)return e.error("Expected two arguments.");const i=e.parse(t[1],1,qc);if(!i)return null;const o=t[2];if("object"!=typeof o||Array.isArray(o))return e.error("NumberFormat options argument must be an object.");let n=null;if(o.locale&&(n=e.parse(o.locale,1,Wc),!n))return null;let r=null;if(o.currency&&(r=e.parse(o.currency,1,Wc),!r))return null;let a=null;if(o["min-fraction-digits"]&&(a=e.parse(o["min-fraction-digits"],1,qc),!a))return null;let s=null;return o["max-fraction-digits"]&&(s=e.parse(o["max-fraction-digits"],1,qc),!s)?null:new Dg(i,n,r,a,s)}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 Lg{constructor(t){this.type=qc,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 ${Jc(i.type)} instead.`):new Lg(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 gf(`Expected value to be of type string or array, but found ${Jc(hf(e))} instead.`)}eachChild(t){t(this.input)}outputDefined(){return!1}serialize(){const t=["length"];return this.eachChild((e=>{t.push(e.serialize())})),t}}const Gg={"==":jg,"!=":Rg,">":Fg,"<":Ig,">=":Ag,"<=":Mg,array:vf,at:kg,boolean:vf,case:zg,coalesce:bg,collator:Cf,format:yf,image:_f,in:wg,"index-of":Sg,interpolate:yg,"interpolate-hcl":yg,"interpolate-lab":yg,length:Lg,let:xg,literal:ff,match:Cg,number:vf,"number-format":Dg,object:vf,slice:Tg,step:Hf,string:vf,"to-boolean":xf,"to-color":xf,"to-number":xf,"to-string":xf,var:Kf,within:Wf};function Ng(t,[e,i,o,n]){e=e.evaluate(t),i=i.evaluate(t),o=o.evaluate(t);const r=n?n.evaluate(t):1,a=pf(e,i,o,r);if(a)throw new gf(a);return new rf(e/255*r,i/255*r,o/255*r,r)}function Bg(t,e){return t in e}function qg(t,e){const i=e[t];return void 0===i?null:i}function Wg(t){return{type:t}}function Vg(t){return{result:"success",value:t}}function Ug(t){return{result:"error",value:t}}function Xg(t){return!!t.expression&&t.expression.interpolated}function Kg(t){return"object"==typeof t&&null!==t&&!Array.isArray(t)}Sf.register(Gg,{error:[{kind:"error"},[Wc],(t,[e])=>{throw new gf(e.evaluate(t))}],typeof:[Wc,[Kc],(t,[e])=>Jc(hf(e.evaluate(t)))],"to-rgba":[Hc(qc,4),[Uc],(t,[e])=>e.evaluate(t).toArray()],rgb:[Uc,[qc,qc,qc],Ng],rgba:[Uc,[qc,qc,qc,qc],Ng],has:{type:Vc,overloads:[[[Wc],(t,[e])=>Bg(e.evaluate(t),t.properties())],[[Wc,Xc],(t,[e,i])=>Bg(e.evaluate(t),i.evaluate(t))]]},get:{type:Kc,overloads:[[[Wc],(t,[e])=>qg(e.evaluate(t),t.properties())],[[Wc,Xc],(t,[e,i])=>qg(e.evaluate(t),i.evaluate(t))]]},"feature-state":[Kc,[Wc],(t,[e])=>qg(e.evaluate(t),t.featureState||{})],properties:[Xc,[],t=>t.properties()],"geometry-type":[Wc,[],t=>t.geometryType()],id:[Kc,[],t=>t.id()],zoom:[qc,[],t=>t.globals.zoom],pitch:[qc,[],t=>t.globals.pitch||0],"distance-from-center":[qc,[],t=>t.distanceFromCenter()],"heatmap-density":[qc,[],t=>t.globals.heatmapDensity||0],"line-progress":[qc,[],t=>t.globals.lineProgress||0],"sky-radial-progress":[qc,[],t=>t.globals.skyRadialProgress||0],accumulated:[Kc,[],t=>void 0===t.globals.accumulated?null:t.globals.accumulated],"+":[qc,Wg(qc),(t,e)=>{let i=0;for(const o of e)i+=o.evaluate(t);return i}],"*":[qc,Wg(qc),(t,e)=>{let i=1;for(const o of e)i*=o.evaluate(t);return i}],"-":{type:qc,overloads:[[[qc,qc],(t,[e,i])=>e.evaluate(t)-i.evaluate(t)],[[qc],(t,[e])=>-e.evaluate(t)]]},"/":[qc,[qc,qc],(t,[e,i])=>e.evaluate(t)/i.evaluate(t)],"%":[qc,[qc,qc],(t,[e,i])=>e.evaluate(t)%i.evaluate(t)],ln2:[qc,[],()=>Math.LN2],pi:[qc,[],()=>Math.PI],e:[qc,[],()=>Math.E],"^":[qc,[qc,qc],(t,[e,i])=>Math.pow(e.evaluate(t),i.evaluate(t))],sqrt:[qc,[qc],(t,[e])=>Math.sqrt(e.evaluate(t))],log10:[qc,[qc],(t,[e])=>Math.log(e.evaluate(t))/Math.LN10],ln:[qc,[qc],(t,[e])=>Math.log(e.evaluate(t))],log2:[qc,[qc],(t,[e])=>Math.log(e.evaluate(t))/Math.LN2],sin:[qc,[qc],(t,[e])=>Math.sin(e.evaluate(t))],cos:[qc,[qc],(t,[e])=>Math.cos(e.evaluate(t))],tan:[qc,[qc],(t,[e])=>Math.tan(e.evaluate(t))],asin:[qc,[qc],(t,[e])=>Math.asin(e.evaluate(t))],acos:[qc,[qc],(t,[e])=>Math.acos(e.evaluate(t))],atan:[qc,[qc],(t,[e])=>Math.atan(e.evaluate(t))],min:[qc,Wg(qc),(t,e)=>Math.min(...e.map((e=>e.evaluate(t))))],max:[qc,Wg(qc),(t,e)=>Math.max(...e.map((e=>e.evaluate(t))))],abs:[qc,[qc],(t,[e])=>Math.abs(e.evaluate(t))],round:[qc,[qc],(t,[e])=>{const i=e.evaluate(t);return i<0?-Math.round(-i):Math.round(i)}],floor:[qc,[qc],(t,[e])=>Math.floor(e.evaluate(t))],ceil:[qc,[qc],(t,[e])=>Math.ceil(e.evaluate(t))],"filter-==":[Vc,[Wc,Kc],(t,[e,i])=>t.properties()[e.value]===i.value],"filter-id-==":[Vc,[Kc],(t,[e])=>t.id()===e.value],"filter-type-==":[Vc,[Wc],(t,[e])=>t.geometryType()===e.value],"filter-<":[Vc,[Wc,Kc],(t,[e,i])=>{const o=t.properties()[e.value],n=i.value;return typeof o==typeof n&&o<n}],"filter-id-<":[Vc,[Kc],(t,[e])=>{const i=t.id(),o=e.value;return typeof i==typeof o&&i<o}],"filter->":[Vc,[Wc,Kc],(t,[e,i])=>{const o=t.properties()[e.value],n=i.value;return typeof o==typeof n&&o>n}],"filter-id->":[Vc,[Kc],(t,[e])=>{const i=t.id(),o=e.value;return typeof i==typeof o&&i>o}],"filter-<=":[Vc,[Wc,Kc],(t,[e,i])=>{const o=t.properties()[e.value],n=i.value;return typeof o==typeof n&&o<=n}],"filter-id-<=":[Vc,[Kc],(t,[e])=>{const i=t.id(),o=e.value;return typeof i==typeof o&&i<=o}],"filter->=":[Vc,[Wc,Kc],(t,[e,i])=>{const o=t.properties()[e.value],n=i.value;return typeof o==typeof n&&o>=n}],"filter-id->=":[Vc,[Kc],(t,[e])=>{const i=t.id(),o=e.value;return typeof i==typeof o&&i>=o}],"filter-has":[Vc,[Kc],(t,[e])=>e.value in t.properties()],"filter-has-id":[Vc,[],t=>null!==t.id()&&void 0!==t.id()],"filter-type-in":[Vc,[Hc(Wc)],(t,[e])=>e.value.indexOf(t.geometryType())>=0],"filter-id-in":[Vc,[Hc(Kc)],(t,[e])=>e.value.indexOf(t.id())>=0],"filter-in-small":[Vc,[Wc,Hc(Kc)],(t,[e,i])=>i.value.indexOf(t.properties()[e.value])>=0],"filter-in-large":[Vc,[Wc,Hc(Kc)],(t,[e,i])=>function(t,e,i,o){for(;i<=o;){const n=i+o>>1;if(e[n]===t)return!0;e[n]>t?o=n-1:i=n+1}return!1}(t.properties()[e.value],i.value,0,i.value.length-1)],all:{type:Vc,overloads:[[[Vc,Vc],(t,[e,i])=>e.evaluate(t)&&i.evaluate(t)],[Wg(Vc),(t,e)=>{for(const i of e)if(!i.evaluate(t))return!1;return!0}]]},any:{type:Vc,overloads:[[[Vc,Vc],(t,[e,i])=>e.evaluate(t)||i.evaluate(t)],[Wg(Vc),(t,e)=>{for(const i of e)if(i.evaluate(t))return!0;return!1}]]},"!":[Vc,[Vc],(t,[e])=>!e.evaluate(t)],"is-supported-script":[Vc,[Wc],(t,[e])=>{const i=t.globals&&t.globals.isSupportedScript;return!i||i(e.evaluate(t))}],upcase:[Wc,[Wc],(t,[e])=>e.evaluate(t).toUpperCase()],downcase:[Wc,[Wc],(t,[e])=>e.evaluate(t).toLowerCase()],concat:[Wc,Wg(Kc),(t,e)=>e.map((e=>cf(e.evaluate(t)))).join("")],"resolved-locale":[Wc,[Yc],(t,[e])=>e.evaluate(t).resolvedLocale()]});class Yg{constructor(t,e){var i;this.expression=t,this._warningHistory={},this._evaluator=new wf,this._defaultValue=e?"color"===(i=e).type&&Kg(i.default)?new rf(0,0,0,0):"color"===i.type?rf.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,o,n,r,a,s){return this._evaluator.globals=t,this._evaluator.feature=e,this._evaluator.featureState=i,this._evaluator.canonical=o,this._evaluator.availableImages=n||null,this._evaluator.formattedSection=r,this._evaluator.featureTileCoord=a||null,this._evaluator.featureDistanceData=s||null,this.expression.evaluate(this._evaluator)}evaluate(t,e,i,o,n,r,a,s){this._evaluator.globals=t,this._evaluator.feature=e||null,this._evaluator.featureState=i||null,this._evaluator.canonical=o,this._evaluator.availableImages=n||null,this._evaluator.formattedSection=r||null,this._evaluator.featureTileCoord=a||null,this._evaluator.featureDistanceData=s||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 gf(`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(l){return this._warningHistory[l.message]||(this._warningHistory[l.message]=!0,"undefined"!=typeof console&&console.warn(l.message)),this._defaultValue}}}function Zg(t){return Array.isArray(t)&&t.length>0&&"string"==typeof t[0]&&t[0]in Gg}function $g(t,e){const i=new Yf(Gg,[],e?function(t){const e={color:Uc,string:Wc,number:qc,enum:Wc,boolean:Vc,formatted:Zc,resolvedImage:$c};if("array"===t.type)return Hc(e[t.value]||Kc,t.length);return e[t.type]}(e):void 0),o=i.parse(t,void 0,void 0,void 0,e&&"string"===e.type?{typeAnnotation:"coerce"}:void 0);return o?Vg(new Yg(o,e)):Ug(i.errors)}class Hg{constructor(t,e){this.kind=t,this._styleExpression=e,this.isStateDependent="constant"!==t&&!Uf(e.expression)}evaluateWithoutErrorHandling(t,e,i,o,n,r){return this._styleExpression.evaluateWithoutErrorHandling(t,e,i,o,n,r)}evaluate(t,e,i,o,n,r){return this._styleExpression.evaluate(t,e,i,o,n,r)}}class Jg{constructor(t,e,i,o){this.kind=t,this.zoomStops=i,this._styleExpression=e,this.isStateDependent="camera"!==t&&!Uf(e.expression),this.interpolationType=o}evaluateWithoutErrorHandling(t,e,i,o,n,r){return this._styleExpression.evaluateWithoutErrorHandling(t,e,i,o,n,r)}evaluate(t,e,i,o,n,r){return this._styleExpression.evaluate(t,e,i,o,n,r)}interpolationFactor(t,e,i){return this.interpolationType?yg.interpolationFactor(this.interpolationType,t,e,i):0}}function Qg(t,e){if("error"===(t=$g(t,e)).result)return t;const i=t.value.expression,o=Vf(i);if(!o&&("data-driven"!==(n=e)["property-type"]&&"cross-faded-data-driven"!==n["property-type"]))return Ug([new Gc("","data expressions not supported")]);var n;const r=Xf(i,["zoom","pitch","distance-from-center"]);if(!r&&!function(t){return!!t.expression&&t.expression.parameters.indexOf("zoom")>-1}(e))return Ug([new Gc("","zoom expressions not supported")]);const a=tm(i);if(!a&&!r)return Ug([new Gc("",'"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression.')]);if(a instanceof Gc)return Ug([a]);if(a instanceof yg&&!Xg(e))return Ug([new Gc("",'"interpolate" expressions cannot be used with this property')]);if(!a)return Vg(new Hg(o?"constant":"source",t.value));const s=a instanceof yg?a.interpolation:void 0;return Vg(new Jg(o?"camera":"composite",t.value,a.labels,s))}function tm(t){let e=null;if(t instanceof xg)e=tm(t.result);else if(t instanceof bg){for(const i of t.args)if(e=tm(i),e)break}else(t instanceof Hf||t instanceof yg)&&t.input instanceof Sf&&"zoom"===t.input.name&&(e=t);return e instanceof Gc||t.eachChild((t=>{const i=tm(t);i instanceof Gc?e=i:!e&&i?e=new Gc("",'"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression.'):e&&i&&e!==i&&(e=new Gc("",'Only one zoom-based "step" or "interpolate" subexpression may be used in an expression.'))})),e}function em(t){return"object"==typeof t?["literal",t]:t}function im(t){switch(t.colorSpace){case"hcl":return"interpolate-hcl";case"lab":return"interpolate-lab";default:return"interpolate"}}function om(t,e){const i=em((o=t.default,n=e.default,void 0!==o?o:void 0!==n?n:void 0));var o,n;return void 0===i&&"resolvedImage"===e.type?"":i}function nm(t,e,i){const o=sm(t,e),n=["get",t.property];if("categorical"===o&&"boolean"==typeof i[0][0]){const o=["case"];for(const t of i)o.push(["==",n,t[0]],t[1]);return o.push(om(t,e)),o}if("categorical"===o){const o=["match",n];for(const t of i)am(o,t[0],t[1],!1);return o.push(om(t,e)),o}if("interval"===o){const e=["step",["number",n]];for(const t of i)am(e,t[0],t[1],!0);return rm(e),void 0===t.default?e:["case",["==",["typeof",n],"number"],e,em(t.default)]}if("exponential"===o){const e=void 0!==t.base?t.base:1,o=[im(t),1===e?["linear"]:["exponential",e],["number",n]];for(const t of i)am(o,t[0],t[1],!1);return void 0===t.default?o:["case",["==",["typeof",n],"number"],o,em(t.default)]}throw new Error(`Unknown property function type ${o}`)}function rm(t){"step"===t[0]&&3===t.length&&(t.push(0),t.push(t[3]))}function am(t,e,i,o){t.length>3&&e===t[t.length-2]||(o&&2===t.length||t.push(e),t.push(i))}function sm(t,e){return t.type?t.type:e.expression.interpolated?"exponential":"interval"}function lm(t){const e=["concat"],i=/{([^{}]+)}/g;let o=0;for(let n=i.exec(t);null!==n;n=i.exec(t)){const r=t.slice(o,i.lastIndex-n[0].length);o=i.lastIndex,r.length>0&&e.push(r),e.push(["get",n[1]])}if(1===e.length)return t;if(o<t.length)e.push(t.slice(o));else if(2===e.length)return["to-string",e[1]];return e}function um(t){if(Array.isArray(t))return t.map(um);if(t instanceof Object&&!(t instanceof Number||t instanceof String||t instanceof Boolean)){const e={};for(const i in t)e[i]=um(t[i]);return e}return function(t){return t instanceof Number||t instanceof String||t instanceof Boolean?t.valueOf():t}(t)}function pm(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(!pm(e)&&"boolean"!=typeof e)return!1;return!0;default:return!0}}function dm(t,e="fill"){if(null==t)return{filter:()=>!0,needGeometry:!1,needFeature:!1};pm(t)||(t=ym(t));const i=t;let o=!0;try{o=function(t){if(!fm(t))return t;let e=um(t);return cm(e),e=hm(e),e}(i)}catch(u){console.warn(`Failed to extract static filter. Filter will continue working, but at higher memory usage and slower framerate.\nThis is most likely a bug, please report this via https://github.com/mapbox/mapbox-gl-js/issues/new?assignees=&labels=&template=Bug_report.md\nand paste the contents of this message in the report.\nThank you!\nFilter Expression:\n${JSON.stringify(i,null,2)}\n `)}const n=Rc[`filter_${e}`],r=$g(o,n);let a=null;if("error"===r.result)throw new Error(r.value.map((t=>`${t.key}: ${t.message}`)).join(", "));a=(t,e,i)=>r.value.evaluate(t,e,{},i);let s=null,l=null;if(o!==i){const t=$g(i,n);if("error"===t.result)throw new Error(t.value.map((t=>`${t.key}: ${t.message}`)).join(", "));s=(e,i,o,n,r)=>t.value.evaluate(e,i,{},o,void 0,void 0,n,r),l=!Vf(t.value.expression)}a=a;return{filter:a,dynamicFilter:s||void 0,needGeometry:vm(o),needFeature:!!l}}function hm(t){if(!Array.isArray(t))return t;const e=function(t){if(gm.has(t[0]))for(let e=1;e<t.length;e++){if(fm(t[e]))return!0}return t}(t);return!0===e?e:e.map((t=>hm(t)))}function cm(t){let e=!1;const i=[];if("case"===t[0]){for(let o=1;o<t.length-1;o+=2)e=e||fm(t[o]),i.push(t[o+1]);i.push(t[t.length-1])}else if("match"===t[0]){e=e||fm(t[1]);for(let e=2;e<t.length-1;e+=2)i.push(t[e+1]);i.push(t[t.length-1])}else if("step"===t[0]){e=e||fm(t[1]);for(let e=1;e<t.length-1;e+=2)i.push(t[e+1])}e&&(t.length=0,t.push("any",...i));for(let o=1;o<t.length;o++)cm(t[o])}function fm(t){if(!Array.isArray(t))return!1;if("pitch"===(e=t[0])||"distance-from-center"===e)return!0;var e;for(let i=1;i<t.length;i++){if(fm(t[i]))return!0}return!1}const gm=new Set(["in","==","!=",">",">=","<","<=","to-boolean"]);function mm(t,e){return t<e?-1:t>e?1:0}function vm(t){if(!Array.isArray(t))return!1;if("within"===t[0])return!0;for(let e=1;e<t.length;e++)if(vm(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?_m(t[1],t[2],"=="):"!="===e?km(_m(t[1],t[2],"==")):"<"===e||">"===e||"<="===e||">="===e?_m(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(km)):"in"===e?bm(t[1],t.slice(2)):"!in"===e?km(bm(t[1],t.slice(2))):"has"===e?xm(t[1]):"!has"===e?km(xm(t[1])):"within"!==e||t}function _m(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 bm(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(mm)]]:["filter-in-small",t,["literal",e]]}}function xm(t){switch(t){case"$type":return!0;case"$id":return["filter-has-id"];default:return["filter-has",t]}}function km(t){return["!",t]}var wm=["type","source","source-layer","minzoom","maxzoom","filter","layout"];function Sm(t,e){const i={};for(const o in t)"ref"!==o&&(i[o]=t[o]);return wm.forEach((t=>{t in e&&(i[t]=e[t])})),i}Fc((function(t,e){var i=function(){var t=function(t,e,i,o){for(i=i||{},o=t.length;o--;i[t[o]]=e);return i},e=[1,12],i=[1,13],o=[1,9],n=[1,10],r=[1,11],a=[1,14],s=[1,15],l=[14,18,22,24],u=[18,22],p=[22,24],d={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,o,n,r,a){var s=r.length-1;switch(n){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.$=r[s-1];case 13:this.$={},Object.defineProperty(this.$,"__line__",{value:this._$.first_line,enumerable:!1});break;case 14:case 19:this.$=r[s-1],Object.defineProperty(this.$,"__line__",{value:this._$.first_line,enumerable:!1});break;case 15:this.$=[r[s-2],r[s]];break;case 16:this.$={},this.$[r[s][0]]=r[s][1];break;case 17:this.$=r[s-2],r[s-2][r[s][0]]=r[s][1];break;case 18:this.$=[],Object.defineProperty(this.$,"__line__",{value:this._$.first_line,enumerable:!1});break;case 20:this.$=[r[s]];break;case 21:this.$=r[s-2],r[s-2].push(r[s])}},table:[{3:5,4:e,5:6,6:i,7:3,8:o,9:4,10:n,11:r,12:1,13:2,15:7,16:8,17:a,23:s},{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:o,9:4,10:n,11:r,13:23,15:7,16:8,17:a,23:s,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(p,[2,20]),t(l,[2,14]),{3:20,4:e,20:29},{3:5,4:e,5:6,6:i,7:3,8:o,9:4,10:n,11:r,13:30,15:7,16:8,17:a,23:s},t(l,[2,19]),{3:5,4:e,5:6,6:i,7:3,8:o,9:4,10:n,11:r,13:31,15:7,16:8,17:a,23:s},t(u,[2,17]),t(u,[2,15]),t(p,[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],o=[null],n=[],r=this.table,a="",s=0,l=0,u=2,p=1,d=n.slice.call(arguments,1),h=Object.create(this.lexer),c={yy:{}};for(var f in this.yy)Object.prototype.hasOwnProperty.call(this.yy,f)&&(c.yy[f]=this.yy[f]);h.setInput(t,c.yy),c.yy.lexer=h,c.yy.parser=this,void 0===h.yylloc&&(h.yylloc={});var g=h.yylloc;n.push(g);var m=h.options&&h.options.ranges;function v(){var t;return"number"!=typeof(t=h.lex()||p)&&(t=e.symbols_[t]||t),t}"function"==typeof c.yy.parseError?this.parseError=c.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;for(var y,_,b,x,k,w,S,C,z={};;){if(_=i[i.length-1],this.defaultActions[_]?b=this.defaultActions[_]:(null==y&&(y=v()),b=r[_]&&r[_][y]),void 0===b||!b.length||!b[0]){var T="";for(k in C=[],r[_])this.terminals_[k]&&k>u&&C.push("'"+this.terminals_[k]+"'");T=h.showPosition?"Parse error on line "+(s+1)+":\n"+h.showPosition()+"\nExpecting "+C.join(", ")+", got '"+(this.terminals_[y]||y)+"'":"Parse error on line "+(s+1)+": Unexpected "+(y==p?"end of input":"'"+(this.terminals_[y]||y)+"'"),this.parseError(T,{text:h.match,token:this.terminals_[y]||y,line:h.yylineno,loc:g,expected:C})}if(b[0]instanceof Array&&b.length>1)throw new Error("Parse Error: multiple actions possible at state: "+_+", token: "+y);switch(b[0]){case 1:i.push(y),o.push(h.yytext),n.push(h.yylloc),i.push(b[1]),y=null,l=h.yyleng,a=h.yytext,s=h.yylineno,g=h.yylloc;break;case 2:if(w=this.productions_[b[1]][1],z.$=o[o.length-w],z._$={first_line:n[n.length-(w||1)].first_line,last_line:n[n.length-1].last_line,first_column:n[n.length-(w||1)].first_column,last_column:n[n.length-1].last_column},m&&(z._$.range=[n[n.length-(w||1)].range[0],n[n.length-1].range[1]]),void 0!==(x=this.performAction.apply(z,[a,l,s,c.yy,b[1],o,n].concat(d))))return x;w&&(i=i.slice(0,-1*w*2),o=o.slice(0,-1*w),n=n.slice(0,-1*w)),i.push(this.productions_[b[1]][0]),o.push(z.$),n.push(z._$),S=r[i[i.length-2]][i[i.length-1]],i.push(S);break;case 3:return!0}}return!0}},h={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 o=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 n=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===o.length?this.yylloc.first_column:0)+o[o.length-i.length].length-i[0].length:this.yylloc.first_column-e},this.options.ranges&&(this.yylloc.range=[n[0],n[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,o,n;if(this.options.backtrack_lexer&&(n={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&&(n.yylloc.range=this.yylloc.range.slice(0))),(o=t[0].match(/(?:\r\n?|\n).*/g))&&(this.yylineno+=o.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:o?o[o.length-1].length-o[o.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 r in n)this[r]=n[r];return!1}return!1},next:function(){if(this.done)return this.EOF;var t,e,i,o;this._input||(this.done=!0),this._more||(this.yytext="",this.match="");for(var n=this._currentRules(),r=0;r<n.length;r++)if((i=this._input.match(this.rules[n[r]]))&&(!e||i[0].length>e[0].length)){if(e=i,o=r,this.options.backtrack_lexer){if(!1!==(t=this.test_match(i,n[r])))return t;if(this._backtrack){e=!1;continue}return!1}if(!this.options.flex)break}return e?!1!==(t=this.test_match(e,n[o]))&&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,o){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 c(){this.yy={}}return d.lexer=h,c.prototype=d,d.Parser=c,new c}();e.parser=i,e.Parser=i.Parser,e.parse=function(){return i.parse.apply(i,arguments)}}));const Cm=Zg,zm=Qg,Tm=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 o=["color"===e.type?"to-color":e.type,i,em(t.default)];return"array"===e.type&&o.splice(1,0,e.value,e.length||null),o}}(t,e);const o=i&&"object"==typeof i[0][0],n=o||void 0!==t.property,r=o||!n;return i=i.map((t=>!n&&e.tokens&&"string"==typeof t[1]?[t[0],lm(t[1])]:[t[0],em(t[1])])),o?function(t,e,i){const o={},n={},r=[];for(let a=0;a<i.length;a++){const e=i[a],s=e[0].zoom;void 0===o[s]&&(o[s]={zoom:s,type:t.type,property:t.property,default:t.default},n[s]=[],r.push(s)),n[s].push([e[0].value,e[1]])}if("exponential"===sm({},e)){const i=[im(t),["linear"],["zoom"]];for(const t of r){am(i,t,nm(o[t],e,n[t]),!1)}return i}{const t=["step",["zoom"]];for(const i of r){am(t,i,nm(o[i],e,n[i]),!0)}return rm(t),t}}(t,e,i):r?function(t,e,i,o=["zoom"]){const n=sm(t,e);let r,a=!1;if("interval"===n)r=["step",o],a=!0;else{if("exponential"!==n)throw new Error(`Unknown zoom function type "${n}"`);{const e=void 0!==t.base?t.base:1;r=[im(t),1===e?["linear"]:["exponential",e],o]}}for(const s of i)am(r,s[0],s[1],a);return rm(r),r}(t,e,i):nm(t,e,i)},Em=Kg;var Pm=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 o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}(),Om=function(t){function e(e){var i=e||{},o=void 0!==i.projection?i.projection:"EPSG:3857",n=void 0!==i.tileGrid?i.tileGrid:Yh({extent:Hh(o),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:o,reprojectionErrorThreshold:i.reprojectionErrorThreshold,tileGrid:n,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 Pm(e,t),e}(Tc),jm=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 o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}(),Rm='© <a href="https://www.openstreetmap.org/copyright" target="_blank">OpenStreetMap</a> contributors.',Im=function(t){function e(e){var i,o=e||{};i=void 0!==o.attributions?o.attributions:[Rm];var n=void 0!==o.crossOrigin?o.crossOrigin:"anonymous",r=void 0!==o.url?o.url:"https://{a-c}.tile.openstreetmap.org/{z}/{x}/{y}.png";return t.call(this,{attributions:i,attributionsCollapsible:!1,cacheSize:o.cacheSize,crossOrigin:n,imageSmoothing:o.imageSmoothing,maxZoom:void 0!==o.maxZoom?o.maxZoom:19,opaque:void 0===o.opaque||o.opaque,reprojectionErrorThreshold:o.reprojectionErrorThreshold,tileLoadFunction:o.tileLoadFunction,transition:o.transition,url:r,wrapX:o.wrapX,zDirection:o.zDirection})||this}return jm(e,t),e}(Om);const Fm=Array.isArray;function Mm(t,e){if(1===arguments.length)return e=>Mm(t,e);if(t<1)throw new Error("First argument to splitEvery must be a positive integer");const i=[];let o=0;for(;o<e.length;)i.push(e.slice(o,o+=t));return i}(function t(e,i=[]){return(...o)=>{return(n=[...i,...o]).length>=e.length?e(...n):t(e,n);var n}})((function(t,e,i){if(!Fm(i))throw new TypeError("reduce: list must be array or iterable");let o=0;const n=i.length;for(;o<n;)e=t(e,i[o],o,i),o++;return e}))((function t(e,i){return 1===arguments.length?i=>t(e,i):e*i}),1);const Am=new qd({features:[],wrapX:!1}),Dm=new Cd({source:Am,style:new yl({image:new hl({radius:3,fill:new Ns({color:"grey"})})})});function Lm(t,e){return Mm(2,t&&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)=>{Am.addFeature(new ds({geometry:new Ca(t),i:e}))}))}const Gm={color:"#ff0000",width:3},Nm=new sl(Gm),Bm=new sl(__spreadProps(__spreadValues({},Gm),{lineDash:[2,8]})),qm=new Ns({color:"rgba(255, 0, 0, 0.1)"}),Wm=new pl({stroke:new sl({color:"red",width:2}),points:4,radius1:15,radius2:1}),Vm=new hl({radius:6,fill:new Ns({color:"#ff0000"})}),Um=new yl({image:new pl({fill:new Ns({color:"#fff"}),stroke:new sl({color:"#ff0000",width:2}),points:4,radius:5,angle:Math.PI/4}),geometry:function(t){const e=t.getGeometry();if(e instanceof Ba){const t=e.getCoordinates()[0];return new Ps(t)}}}),Xm=new qd,Km=new Cd({source:Xm,style:[new yl({fill:qm,stroke:Nm}),Um]});const Ym=new hh({source:Am,pixelTolerance:15});
|
38
38
|
/**
|
39
39
|
* splaytree v3.1.0
|
40
40
|
* Fast Splay tree for Node and browser
|
@@ -43,7 +43,7 @@ Fc((function(t,e){!function(i){var o=e&&!e.nodeType&&e,n=t&&!t.nodeType&&t,r="ob
|
|
43
43
|
* @license MIT
|
44
44
|
* @preserve
|
45
45
|
*/
|
46
|
-
var Zm=function(t,e){this.next=null,this.key=t,this.data=e,this.left=null,this.right=null};function Hm(t,e){return t>e?1:t<e?-1:0}function $m(t,e,i){for(var o=new Zm(null,null),n=o,r=o;;){var a=i(t,e.key);if(a<0){if(null===e.left)break;if(i(t,e.left.key)<0){var s=e.left;if(e.left=s.right,s.right=e,null===(e=s).left)break}r.left=e,r=e,e=e.left}else{if(!(a>0))break;if(null===e.right)break;if(i(t,e.right.key)>0){s=e.right;if(e.right=s.left,s.left=e,null===(e=s).right)break}n.right=e,n=e,e=e.right}}return n.right=e.left,r.left=e.right,e.left=o.right,e.right=o.left,e}function Jm(t,e,i,o){var n=new Zm(t,e);if(null===i)return n.left=n.right=null,n;var r=o(t,(i=$m(t,i,o)).key);return r<0?(n.left=i.left,n.right=i,i.left=null):r>=0&&(n.right=i.right,n.left=i,i.right=null),n}function Qm(t,e,i){var o=null,n=null;if(e){var r=i((e=$m(t,e,i)).key,t);0===r?(o=e.left,n=e.right):r<0?(n=e.right,e.right=null,o=e):(o=e.left,e.left=null,n=e)}return{left:o,right:n}}function tv(t,e,i,o,n){if(t){o(e+(i?"└── ":"├── ")+n(t)+"\n");var r=e+(i?" ":"│ ");t.left&&tv(t.left,r,!1,o,n),t.right&&tv(t.right,r,!0,o,n)}}var ev=function(){function t(t){void 0===t&&(t=Hm),this._root=null,this._size=0,this._comparator=t}return t.prototype.insert=function(t,e){return this._size++,this._root=Jm(t,e,this._root,this._comparator)},t.prototype.add=function(t,e){var i=new Zm(t,e);null===this._root&&(i.left=i.right=null,this._size++,this._root=i);var o=this._comparator,n=$m(t,this._root,o),r=o(t,n.key);return 0===r?this._root=n:(r<0?(i.left=n.left,i.right=n,n.left=null):r>0&&(i.right=n.right,i.left=n,n.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 o;return null===e?null:0===i(t,(e=$m(t,e,i)).key)?(null===e.left?o=e.right:(o=$m(t,e.left,i)).right=e.right,this._size--,o):e},t.prototype.pop=function(){var t=this._root;if(t){for(;t.left;)t=t.left;return this._root=$m(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 o=i(t,e.key);if(0===o)return e;e=o<0?e.left:e.right}return null},t.prototype.find=function(t){return this._root&&(this._root=$m(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 o=i(t,e.key);if(0===o)return!0;e=o<0?e.left:e.right}return!1},t.prototype.forEach=function(t,e){for(var i=this._root,o=[],n=!1;!n;)null!==i?(o.push(i),i=i.left):0!==o.length?(i=o.pop(),t.call(e,i),i=i.right):n=!0;return this},t.prototype.range=function(t,e,i,o){for(var n=[],r=this._comparator,a=this._root;0!==n.length||a;)if(a)n.push(a),a=a.left;else{if(r((a=n.pop()).key,e)>0)break;if(r(a.key,t)>=0&&i.call(o,a))return this;a=a.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,o=0,n=[];!i;)if(e)n.push(e),e=e.left;else if(n.length>0){if(e=n.pop(),o===t)return e;o++,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 o=this._comparator;e;){var n=o(t.key,e.key);if(0===n)break;n<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 o=this._comparator;e;){var n=o(t.key,e.key);if(0===n)break;n<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=[],o=!1,n=new Zm(null,null),r=n;for(;!o;)e?(i.push(e),e=e.left):i.length>0?e=(e=r=r.next=i.pop()).right:o=!0;return r.next=null,n.next}(this._root)},t.prototype.load=function(t,e,i){void 0===e&&(e=[]),void 0===i&&(i=!1);var o=t.length,n=this._comparator;if(i&&nv(t,e,0,o-1,n),null===this._root)this._root=iv(t,e,0,o),this._size=o;else{var r=function(t,e,i){var o=new Zm(null,null),n=o,r=t,a=e;for(;null!==r&&null!==a;)i(r.key,a.key)<0?(n.next=r,r=r.next):(n.next=a,a=a.next),n=n.next;null!==r?n.next=r:null!==a&&(n.next=a);return o.next}(this.toList(),function(t,e){for(var i=new Zm(null,null),o=i,n=0;n<t.length;n++)o=o.next=new Zm(t[n],e[n]);return o.next=null,i.next}(t,e),n);o=this._size+o,this._root=ov({head:r},0,o)}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 tv(this._root,"",!0,(function(t){return e.push(t)}),t),e.join("")},t.prototype.update=function(t,e,i){var o=this._comparator,n=Qm(t,this._root,o),r=n.left,a=n.right;o(t,e)<0?a=Jm(e,i,a,o):r=Jm(e,i,r,o),this._root=function(t,e,i){return null===e?t:(null===t||((e=$m(t.key,e,i)).left=t),e)}(r,a,o)},t.prototype.split=function(t){return Qm(t,this._root,this._comparator)},t}();function iv(t,e,i,o){var n=o-i;if(n>0){var r=i+Math.floor(n/2),a=t[r],s=e[r],l=new Zm(a,s);return l.left=iv(t,e,i,r),l.right=iv(t,e,r+1,o),l}return null}function ov(t,e,i){var o=i-e;if(o>0){var n=e+Math.floor(o/2),r=ov(t,e,n),a=t.head;return a.left=r,t.head=t.head.next,a.right=ov(t,n+1,i),a}return null}function nv(t,e,i,o,n){if(!(i>=o)){for(var r=t[i+o>>1],a=i-1,s=o+1;;){do{a++}while(n(t[a],r)<0);do{s--}while(n(t[s],r)>0);if(a>=s)break;var l=t[a];t[a]=t[s],t[s]=l,l=e[a],e[a]=e[s],e[s]=l}nv(t,e,i,s,n),nv(t,e,s+1,o,n)}}function rv(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function av(t,e){for(var i=0;i<e.length;i++){var o=e[i];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(t,o.key,o)}}function sv(t,e,i){return e&&av(t.prototype,e),i&&av(t,i),t}var lv=function(t,e){return t.ll.x<=e.x&&e.x<=t.ur.x&&t.ll.y<=e.y&&e.y<=t.ur.y},uv=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,o=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:o,y:t.ur.y<e.ur.y?t.ur.y:e.ur.y}}},pv=Number.EPSILON;void 0===pv&&(pv=Math.pow(2,-52));var dv=pv*pv,hv=function(t,e){if(-pv<t&&t<pv&&-pv<e&&e<pv)return 0;var i=t-e;return i*i<dv*t*e?0:t<e?-1:1},cv=function(){function t(){rv(this,t),this.reset()}return sv(t,[{key:"reset",value:function(){this.xRounder=new fv,this.yRounder=new fv}},{key:"round",value:function(t,e){return{x:this.xRounder.round(t),y:this.yRounder.round(e)}}}]),t}(),fv=function(){function t(){rv(this,t),this.tree=new ev,this.round(0)}return sv(t,[{key:"round",value:function(t){var e=this.tree.add(t),i=this.tree.prev(e);if(null!==i&&0===hv(e.key,i.key))return this.tree.remove(t),i.key;var o=this.tree.next(e);return null!==o&&0===hv(e.key,o.key)?(this.tree.remove(t),o.key):t}}]),t}(),gv=new cv,mv=function(t,e){return t.x*e.y-t.y*e.x},vv=function(t,e){return t.x*e.x+t.y*e.y},yv=function(t,e,i){var o={x:e.x-t.x,y:e.y-t.y},n={x:i.x-t.x,y:i.y-t.y},r=mv(o,n);return hv(r,0)},_v=function(t){return Math.sqrt(vv(t,t))},bv=function(t,e,i){var o={x:e.x-t.x,y:e.y-t.y},n={x:i.x-t.x,y:i.y-t.y};return vv(n,o)/_v(n)/_v(o)},xv=function(t,e,i){return 0===e.y?null:{x:t.x+e.x/e.y*(i-t.y),y:i}},kv=function(t,e,i){return 0===e.x?null:{x:i,y:t.y+e.y/e.x*(i-t.x)}},wv=function(){function t(e,i){rv(this,t),void 0===e.events?e.events=[this]:e.events.push(this),this.point=e,this.isLeft=i}return sv(t,null,[{key:"compare",value:function(e,i){var o=t.comparePoints(e.point,i.point);return 0!==o?o:(e.point!==i.point&&e.link(i),e.isLeft!==i.isLeft?e.isLeft?1:-1:Cv.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}}]),sv(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,o=e.length;i<o;i++){var n=e[i];this.point.events.push(n),n.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 o=e+1;o<t;o++){var n=this.point.events[o];void 0===n.consumedBy&&(i.otherSE.point.events===n.otherSE.point.events&&i.segment.consume(n.segment))}}}},{key:"getAvailableLinkedEvents",value:function(){for(var t=[],e=0,i=this.point.events.length;e<i;e++){var o=this.point.events[e];o!==this&&!o.segment.ringOut&&o.segment.isInResult()&&t.push(o)}return t}},{key:"getLeftmostComparator",value:function(t){var e=this,i=new Map,o=function(o){var n,r,a,s,l,u=o.otherSE;i.set(o,{sine:(n=e.point,r=t.point,a=u.point,s={x:r.x-n.x,y:r.y-n.y},l={x:a.x-n.x,y:a.y-n.y},mv(l,s)/_v(l)/_v(s)),cosine:bv(e.point,t.point,u.point)})};return function(t,e){i.has(t)||o(t),i.has(e)||o(e);var n=i.get(t),r=n.sine,a=n.cosine,s=i.get(e),l=s.sine,u=s.cosine;return r>=0&&l>=0?a<u?1:a>u?-1:0:r<0&&l<0?a<u?-1:a>u?1:0:l<r?-1:l>r?1:0}}}]),t}(),Sv=0,Cv=function(){function t(e,i,o,n){rv(this,t),this.id=++Sv,this.leftSE=e,e.segment=this,e.otherSE=i,this.rightSE=i,i.segment=this,i.otherSE=e,this.rings=o,this.windings=n}return sv(t,null,[{key:"compare",value:function(t,e){var i=t.leftSE.point.x,o=e.leftSE.point.x,n=t.rightSE.point.x,r=e.rightSE.point.x;if(r<i)return 1;if(n<o)return-1;var a=t.leftSE.point.y,s=e.leftSE.point.y,l=t.rightSE.point.y,u=e.rightSE.point.y;if(i<o){if(s<a&&s<l)return 1;if(s>a&&s>l)return-1;var p=t.comparePoint(e.leftSE.point);if(p<0)return 1;if(p>0)return-1;var d=e.comparePoint(t.rightSE.point);return 0!==d?d:-1}if(i>o){if(a<s&&a<u)return-1;if(a>s&&a>u)return 1;var h=e.comparePoint(t.leftSE.point);if(0!==h)return h;var c=t.comparePoint(e.rightSE.point);return c<0?1:c>0?-1:1}if(a<s)return-1;if(a>s)return 1;if(n<r){var f=e.comparePoint(t.rightSE.point);if(0!==f)return f}if(n>r){var g=t.comparePoint(e.rightSE.point);if(g<0)return 1;if(g>0)return-1}if(n!==r){var m=l-a,v=n-i,y=u-s,_=r-o;if(m>v&&y<_)return 1;if(m<v&&y>_)return-1}return n>r?1:n<r||l<u?-1:l>u?1:t.id<e.id?-1:t.id>e.id?1:0}}]),sv(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,o=this.vector();if(e.x===i.x)return t.x===e.x?0:t.x<e.x?1:-1;var n=(t.y-e.y)/o.y,r=e.x+n*o.x;if(t.x===r)return 0;var a=(t.x-e.x)/o.x,s=e.y+a*o.y;return t.y===s?0:t.y<s?-1:1}},{key:"getIntersection",value:function(t){var e=this.bbox(),i=t.bbox(),o=uv(e,i);if(null===o)return null;var n=this.leftSE.point,r=this.rightSE.point,a=t.leftSE.point,s=t.rightSE.point,l=lv(e,a)&&0===this.comparePoint(a),u=lv(i,n)&&0===t.comparePoint(n),p=lv(e,s)&&0===this.comparePoint(s),d=lv(i,r)&&0===t.comparePoint(r);if(u&&l)return d&&!p?r:!d&&p?s:null;if(u)return p&&n.x===s.x&&n.y===s.y?null:n;if(l)return d&&r.x===a.x&&r.y===a.y?null:a;if(d&&p)return null;if(d)return r;if(p)return s;var h=function(t,e,i,o){if(0===e.x)return kv(i,o,t.x);if(0===o.x)return kv(t,e,i.x);if(0===e.y)return xv(i,o,t.y);if(0===o.y)return xv(t,e,i.y);var n=mv(e,o);if(0==n)return null;var r={x:i.x-t.x,y:i.y-t.y},a=mv(r,e)/n,s=mv(r,o)/n;return{x:(t.x+s*e.x+(i.x+a*o.x))/2,y:(t.y+s*e.y+(i.y+a*o.y))/2}}(n,this.vector(),a,t.vector());return null===h?null:lv(o,h)?gv.round(h.x,h.y):null}},{key:"split",value:function(e){var i=[],o=void 0!==e.events,n=new wv(e,!0),r=new wv(e,!1),a=this.rightSE;this.replaceRightSE(r),i.push(r),i.push(n);var s=new t(n,a,this.rings.slice(),this.windings.slice());return wv.comparePoints(s.leftSE.point,s.rightSE.point)>0&&s.swapEvents(),wv.comparePoints(this.leftSE.point,this.rightSE.point)>0&&this.swapEvents(),o&&(n.checkForConsuming(),r.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,o=e;i.consumedBy;)i=i.consumedBy;for(;o.consumedBy;)o=o.consumedBy;var n=t.compare(i,o);if(0!==n){if(n>0){var r=i;i=o,o=r}if(i.prev===o){var a=i;i=o,o=a}for(var s=0,l=o.rings.length;s<l;s++){var u=o.rings[s],p=o.windings[s],d=i.rings.indexOf(u);-1===d?(i.rings.push(u),i.windings.push(p)):i.windings[d]+=p}o.rings=null,o.windings=null,o.consumedBy=i,o.leftSE.consumedBy=i.leftSE,o.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,o=this._afterState.multiPolys,n=0,r=this.rings.length;n<r;n++){var a=this.rings[n],s=this.windings[n],l=e.indexOf(a);-1===l?(e.push(a),i.push(s)):i[l]+=s}for(var u=[],p=[],d=0,h=e.length;d<h;d++)if(0!==i[d]){var c=e[d],f=c.poly;if(-1===p.indexOf(f))if(c.isExterior)u.push(f);else{-1===p.indexOf(f)&&p.push(f);var g=u.indexOf(c.poly);-1!==g&&u.splice(g,1)}}for(var m=0,v=u.length;m<v;m++){var y=u[m].multiPoly;-1===o.indexOf(y)&&o.push(y)}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(Mv.type){case"union":var i=0===t.length,o=0===e.length;this._isInResult=i!==o;break;case"intersection":var n,r;t.length<e.length?(n=t.length,r=e.length):(n=e.length,r=t.length),this._isInResult=r===Mv.numMultiPolys&&n<r;break;case"xor":var a=Math.abs(t.length-e.length);this._isInResult=a%2==1;break;case"difference":var s=function(t){return 1===t.length&&t[0].isSubject};this._isInResult=s(t)!==s(e);break;default:throw new Error("Unrecognized operation type found ".concat(Mv.type))}return this._isInResult}}],[{key:"fromRing",value:function(e,i,o){var n,r,a,s=wv.comparePoints(e,i);if(s<0)n=e,r=i,a=1;else{if(!(s>0))throw new Error("Tried to create degenerate segment at [".concat(e.x,", ").concat(e.y,"]"));n=i,r=e,a=-1}return new t(new wv(n,!0),new wv(r,!1),[o],[a])}}]),t}(),zv=function(){function t(e,i,o){if(rv(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=o,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 n=gv.round(e[0][0],e[0][1]);this.bbox={ll:{x:n.x,y:n.y},ur:{x:n.x,y:n.y}};for(var r=n,a=1,s=e.length;a<s;a++){if("number"!=typeof e[a][0]||"number"!=typeof e[a][1])throw new Error("Input geometry is not a valid Polygon or MultiPolygon");var l=gv.round(e[a][0],e[a][1]);l.x===r.x&&l.y===r.y||(this.segments.push(Cv.fromRing(r,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),r=l)}n.x===r.x&&n.y===r.y||this.segments.push(Cv.fromRing(r,n,this))}return sv(t,[{key:"getSweepEvents",value:function(){for(var t=[],e=0,i=this.segments.length;e<i;e++){var o=this.segments[e];t.push(o.leftSE),t.push(o.rightSE)}return t}}]),t}(),Tv=function(){function t(e,i){if(rv(this,t),!Array.isArray(e))throw new Error("Input geometry is not a valid Polygon or MultiPolygon");this.exteriorRing=new zv(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 o=1,n=e.length;o<n;o++){var r=new zv(e[o],this,!1);r.bbox.ll.x<this.bbox.ll.x&&(this.bbox.ll.x=r.bbox.ll.x),r.bbox.ll.y<this.bbox.ll.y&&(this.bbox.ll.y=r.bbox.ll.y),r.bbox.ur.x>this.bbox.ur.x&&(this.bbox.ur.x=r.bbox.ur.x),r.bbox.ur.y>this.bbox.ur.y&&(this.bbox.ur.y=r.bbox.ur.y),this.interiorRings.push(r)}this.multiPoly=i}return sv(t,[{key:"getSweepEvents",value:function(){for(var t=this.exteriorRing.getSweepEvents(),e=0,i=this.interiorRings.length;e<i;e++)for(var o=this.interiorRings[e].getSweepEvents(),n=0,r=o.length;n<r;n++)t.push(o[n]);return t}}]),t}(),Ev=function(){function t(e,i){if(rv(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(a){}this.polys=[],this.bbox={ll:{x:Number.POSITIVE_INFINITY,y:Number.POSITIVE_INFINITY},ur:{x:Number.NEGATIVE_INFINITY,y:Number.NEGATIVE_INFINITY}};for(var o=0,n=e.length;o<n;o++){var r=new Tv(e[o],this);r.bbox.ll.x<this.bbox.ll.x&&(this.bbox.ll.x=r.bbox.ll.x),r.bbox.ll.y<this.bbox.ll.y&&(this.bbox.ll.y=r.bbox.ll.y),r.bbox.ur.x>this.bbox.ur.x&&(this.bbox.ur.x=r.bbox.ur.x),r.bbox.ur.y>this.bbox.ur.y&&(this.bbox.ur.y=r.bbox.ur.y),this.polys.push(r)}this.isSubject=i}return sv(t,[{key:"getSweepEvents",value:function(){for(var t=[],e=0,i=this.polys.length;e<i;e++)for(var o=this.polys[e].getSweepEvents(),n=0,r=o.length;n<r;n++)t.push(o[n]);return t}}]),t}(),Pv=function(){function t(e){rv(this,t),this.events=e;for(var i=0,o=e.length;i<o;i++)e[i].segment.ringOut=this;this.poly=null}return sv(t,null,[{key:"factory",value:function(e){for(var i=[],o=0,n=e.length;o<n;o++){var r=e[o];if(r.isInResult()&&!r.ringOut){for(var a=null,s=r.leftSE,l=r.rightSE,u=[s],p=s.point,d=[];a=s,s=l,u.push(s),s.point!==p;)for(;;){var h=s.getAvailableLinkedEvents();if(0===h.length){var c=u[0].point,f=u[u.length-1].point;throw new Error("Unable to complete output ring starting at [".concat(c.x,",")+" ".concat(c.y,"]. Last matching segment found ends at")+" [".concat(f.x,", ").concat(f.y,"]."))}if(1===h.length){l=h[0].otherSE;break}for(var g=null,m=0,v=d.length;m<v;m++)if(d[m].point===s.point){g=m;break}if(null===g){d.push({index:u.length,point:s.point});var y=s.getLeftmostComparator(a);l=h.sort(y)[0].otherSE;break}var _=d.splice(g)[0],b=u.splice(_.index);b.unshift(b[0].otherSE),i.push(new t(b.reverse()))}i.push(new t(u))}}return i}}]),sv(t,[{key:"getGeom",value:function(){for(var t=this.events[0].point,e=[t],i=1,o=this.events.length-1;i<o;i++){var n=this.events[i].point,r=this.events[i+1].point;0!==yv(n,t,r)&&(e.push(n),t=n)}if(1===e.length)return null;var a=e[0],s=e[1];0===yv(a,t,s)&&e.shift(),e.push(e[0]);for(var l=this.isExteriorRing()?1:-1,u=this.isExteriorRing()?0:e.length-1,p=this.isExteriorRing()?e.length:-1,d=[],h=u;h!=p;h+=l)d.push([e[h].x,e[h].y]);return d}},{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 o=this.events[e];wv.compare(t,o)>0&&(t=o)}for(var n=t.segment.prevInResult(),r=n?n.prevInResult():null;;){if(!n)return null;if(!r)return n.ringOut;if(r.ringOut!==n.ringOut)return r.ringOut.enclosingRing()!==n.ringOut?n.ringOut:n.ringOut.enclosingRing();n=r.prevInResult(),r=n?n.prevInResult():null}}}]),t}(),Ov=function(){function t(e){rv(this,t),this.exteriorRing=e,e.poly=this,this.interiorRings=[]}return sv(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 o=this.interiorRings[e].getGeom();null!==o&&t.push(o)}return t}}]),t}(),jv=function(){function t(e){rv(this,t),this.rings=e,this.polys=this._composePolys(e)}return sv(t,[{key:"getGeom",value:function(){for(var t=[],e=0,i=this.polys.length;e<i;e++){var o=this.polys[e].getGeom();null!==o&&t.push(o)}return t}},{key:"_composePolys",value:function(t){for(var e=[],i=0,o=t.length;i<o;i++){var n=t[i];if(!n.poly)if(n.isExteriorRing())e.push(new Ov(n));else{var r=n.enclosingRing();r.poly||e.push(new Ov(r)),r.poly.addInterior(n)}}return e}}]),t}(),Rv=function(){function t(e){var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Cv.compare;rv(this,t),this.queue=e,this.tree=new ev(i),this.segments=[]}return sv(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 o=t.isLeft?this.tree.insert(e):this.tree.find(e);if(!o)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 n=o,r=o,a=void 0,s=void 0;void 0===a;)null===(n=this.tree.prev(n))?a=null:void 0===n.key.consumedBy&&(a=n.key);for(;void 0===s;)null===(r=this.tree.next(r))?s=null:void 0===r.key.consumedBy&&(s=r.key);if(t.isLeft){var l=null;if(a){var u=a.getIntersection(e);if(null!==u&&(e.isAnEndpoint(u)||(l=u),!a.isAnEndpoint(u)))for(var p=this._splitSafely(a,u),d=0,h=p.length;d<h;d++)i.push(p[d])}var c=null;if(s){var f=s.getIntersection(e);if(null!==f&&(e.isAnEndpoint(f)||(c=f),!s.isAnEndpoint(f)))for(var g=this._splitSafely(s,f),m=0,v=g.length;m<v;m++)i.push(g[m])}if(null!==l||null!==c){var y=null;if(null===l)y=c;else if(null===c)y=l;else{y=wv.comparePoints(l,c)<=0?l:c}this.queue.remove(e.rightSE),i.push(e.rightSE);for(var _=e.split(y),b=0,x=_.length;b<x;b++)i.push(_[b])}i.length>0?(this.tree.remove(e),i.push(t)):(this.segments.push(e),e.prev=a)}else{if(a&&s){var k=a.getIntersection(s);if(null!==k){if(!a.isAnEndpoint(k))for(var w=this._splitSafely(a,k),S=0,C=w.length;S<C;S++)i.push(w[S]);if(!s.isAnEndpoint(k))for(var z=this._splitSafely(s,k),T=0,E=z.length;T<E;T++)i.push(z[T])}}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 o=t.split(e);return o.push(i),void 0===t.consumedBy&&this.tree.insert(t),o}}]),t}(),Iv="undefined"!=typeof process&&{}.POLYGON_CLIPPING_MAX_QUEUE_SIZE||1e6,Fv="undefined"!=typeof process&&{}.POLYGON_CLIPPING_MAX_SWEEPLINE_SEGMENTS||1e6,Mv=new(function(){function t(){rv(this,t)}return sv(t,[{key:"run",value:function(t,e,i){Mv.type=t,gv.reset();for(var o=[new Ev(e,!0)],n=0,r=i.length;n<r;n++)o.push(new Ev(i[n],!1));if(Mv.numMultiPolys=o.length,"difference"===Mv.type)for(var a=o[0],s=1;s<o.length;)null!==uv(o[s].bbox,a.bbox)?s++:o.splice(s,1);if("intersection"===Mv.type)for(var l=0,u=o.length;l<u;l++)for(var p=o[l],d=l+1,h=o.length;d<h;d++)if(null===uv(p.bbox,o[d].bbox))return[];for(var c=new ev(wv.compare),f=0,g=o.length;f<g;f++)for(var m=o[f].getSweepEvents(),v=0,y=m.length;v<y;v++)if(c.insert(m[v]),c.size>Iv)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 Rv(c),b=c.size,x=c.pop();x;){var k=x.key;if(c.size===b){var w=k.segment;throw new Error("Unable to pop() ".concat(k.isLeft?"left":"right"," SweepEvent ")+"[".concat(k.point.x,", ").concat(k.point.y,"] from segment #").concat(w.id," ")+"[".concat(w.leftSE.point.x,", ").concat(w.leftSE.point.y,"] -> ")+"[".concat(w.rightSE.point.x,", ").concat(w.rightSE.point.y,"] from queue. ")+"Please file a bug report.")}if(c.size>Iv)throw new Error("Infinite loop when passing sweep line over endpoints (queue size too big). Please file a bug report.");if(_.segments.length>Fv)throw new Error("Infinite loop when passing sweep line over endpoints (too many sweep line segments). Please file a bug report.");for(var S=_.process(k),C=0,z=S.length;C<z;C++){var T=S[C];void 0===T.consumedBy&&c.insert(T)}b=c.size,x=c.pop()}gv.reset();var E=Pv.factory(_.segments);return new jv(E).getGeom()}}]),t}()),Av=function(t){for(var e=arguments.length,i=new Array(e>1?e-1:0),o=1;o<e;o++)i[o-1]=arguments[o];return Mv.run("union",t,i)};function Dv(t,e,i){void 0===i&&(i={});var o={type:"Feature"};return(0===i.id||i.id)&&(o.id=i.id),i.bbox&&(o.bbox=i.bbox),o.properties=e||{},o.geometry=t,o}function Lv(t){return"Feature"===t.type?t.geometry:t}function Gv(t,e,i){void 0===i&&(i={});var o=Lv(t),n=Lv(e),r=Av(o.coordinates,n.coordinates);return 0===r.length?null:1===r.length?function(t,e,i){void 0===i&&(i={});for(var o=0,n=t;o<n.length;o++){var r=n[o];if(r.length<4)throw new Error("Each LinearRing of a Polygon must have 4 or more Positions.");for(var a=0;a<r[r.length-1].length;a++)if(r[r.length-1][a]!==r[0][a])throw new Error("First and last Position are not equivalent.")}return Dv({type:"Polygon",coordinates:t},e,i)}(r[0],i.properties):function(t,e,i){return void 0===i&&(i={}),Dv({type:"MultiPolygon",coordinates:t},e,i)}(r,i.properties)}function Nv(t,e){const i=Bo(t),o=Math.round(100*i)/100;let n;return"m2"===e?n=o+" m²":"ha"===e&&(n=o/1e4+" ha"),n}function Bv(t,e,i){const o=e.getExtent();return t.getView().fit(Hi(o,i))}function qv(t,e){const[i,o,n]=Array.from(jn(t));return Tn([i,o,n,e])}const Wv="https://api.os.uk/features/v1/wfs",Vv=new qd,Uv=new qd;function Xv(t,e,i){const o=`\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,a=sn(n,void 0!==r?r:"EPSG:3857","EPSG:4326"),s=a[0],(s<-180||s>180)&&(a[0]=Ge(s+180,360)-180),a).reverse().join(",")}</gml:coordinates>\n </gml:Point>\n </ogc:Contains>\n </ogc:Filter>\n `;var n,r,a,s;fetch(function(t){const e=Object.keys(t).map((e=>e+"="+encodeURI(t[e]))).join("&");return`${Wv}?${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:o,count:1})).then((t=>t.json())).then((t=>{if(!t.features.length)return;const e=t.features[0].properties,o=["TOID","DescriptiveGroup"];Object.keys(e).forEach((t=>o.includes(t)||delete e[t]));const n=new Gs,r=n.readFeatures(t,{featureProjection:"EPSG:3857"});i?r.forEach((t=>{const e=t.getProperties().TOID,i=Vv.getFeatureById(e);i?Vv.removeFeature(i):(t.setId(e),Vv.addFeature(t))})):(Vv.clear(),r.forEach((t=>{const e=t.getProperties().TOID;t.setId(e),Vv.addFeature(t)}))),Uv.clear(),Uv.addFeature(n.readFeature(Vv.getFeatures().reduce(((t,e)=>{const i=n.writeFeatureObject(e).geometry;return t?Gv(t,i):i}),null)))})).catch((t=>console.log(t)))}var Kv={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},Yv=" ",Zv=/(italic|oblique)$/i,Hv={},$v=function(t,e,i){var o=Hv[t];if(!o){Array.isArray(t)||(t=[t]);for(var n=400,r="normal",a=[],s=0,l=t.length;s<l;++s){var u=t[s].split(" "),p=u[u.length-1].toLowerCase();for(var d in"normal"==p||"italic"==p||"oblique"==p?(r=p,u.pop(),p=u[u.length-1].toLowerCase()):Zv.test(p)&&(p=p.replace(Zv,""),r=u[u.length-1].replace(p,"")),Kv){var h=u.length>1?u[u.length-2].toLowerCase():"";if(p==d||p==d.replace("-","")||h+"-"+p==d){n=Kv[d],u.pop(),h&&d.startsWith(h)&&u.pop();break}}"number"==typeof p&&(n=p);var c=u.join(Yv).replace("Klokantech Noto Sans","Noto Sans");-1!==c.indexOf(Yv)&&(c='"'+c+'"'),a.push(c)}o=Hv[t]=[r,n,a]}return o[0]+Yv+o[1]+Yv+e+"px"+(i?"/"+i:"")+Yv+o[2]};function Jv(t){return t*Math.PI/180}var Qv=function(){for(var t=[],e=78271.51696402048;t.length<=24;e/=2)t.push(e);return t}();function ty(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 ey,iy=Array(256).join(" ");function oy(t,e){if(e>=.05){for(var i="",o=t.split("\n"),n=iy.slice(0,Math.round(e/.1)),r=0,a=o.length;r<a;++r)r>0&&(i+="\n"),i+=o[r].split("").join(n);return i}return t}function ny(){return ey||(ey=ty(1,1).getContext("2d")),ey}function ry(t,e){return ny().measureText(t).width+(t.length-1)*e}var ay={};function sy(t,e,i,o){if(-1!==t.indexOf("\n")){for(var n=t.split("\n"),r=[],a=0,s=n.length;a<s;++a)r.push(sy(n[a],e,i,o));return r.join("\n")}var l=i+","+e+","+t+","+o,u=ay[l];if(!u){var p=t.split(" ");if(p.length>1){var d=ny();d.font=e;var h=d.measureText("M").width*i,c="";for(r=[],a=0,s=p.length;a<s;++a){var f=p[a],g=c+(c?" ":"")+f;ry(g,o)<=h?c=g:(c&&r.push(c),c=f)}c&&r.push(c);for(a=0,s=r.length;a<s&&s>1;++a){var m=r[a];if(ry(m,o)<.35*h){var v=a>0?ry(r[a-1],o):1/0,y=a<s-1?ry(r[a+1],o):1/0;r.splice(a,1),s-=1,v<y?(r[a-1]+=" "+m,a-=1):r[a]=m+" "+r[a]}}for(a=0,s=r.length-1;a<s;++a){var _=r[a],b=r[a+1];if(ry(_,o)>.7*h&&ry(b,o)<.6*h){var x=_.split(" "),k=x.pop();ry(k,o)<.2*h&&(r[a]=x.join(" "),r[a+1]=k+" "+b),s-=1}}u=r.join("\n")}else u=t;u=oy(u,o),ay[l]=u}return u}$n&&Gt($n,Pt,(function(){ay={}}));var ly,uy,py=Em,dy=Tm,hy=Cm,cy=zm,fy={Point:1,MultiPoint:1,LineString:2,MultiLineString:2,Polygon:3,MultiPolygon:3},gy={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]},my={},vy={zoom:0};function yy(t,e,i,o,n,r){var a=t.id;r||(r={},console.warn("No functionCache provided to getValue()")),r[a]||(r[a]={});var s=r[a];if(!s[i]){var l=(t[e]||my)[i],u=Rc["".concat(e,"_").concat(t.type)][i];void 0===l&&(l=u.default);var p=hy(l);if(!p&&py(l)&&(l=dy(l,u),p=!0),p){var d=function(t,e){var i=cy(t,e);if("error"===i.result)throw new Error(i.value.map((function(t){return"".concat(t.key,": ").concat(t.message)})).join(", "));return i.value}(l,u);s[i]=d.evaluate.bind(d)}else"color"==u.type&&(l=rf.parse(l)),s[i]=function(){return l}}return vy.zoom=o,s[i](vy,n)}function _y(t,e){if(t){if(0===t.a||0===e)return;var i=t.a;return e=void 0===e?1:e,0===i?"transparent":"rgba("+Math.round(255*t.r/i)+","+Math.round(255*t.g/i)+","+Math.round(255*t.b/i)+","+i*e+")"}return t}var by=/^([^]*)\{(.*)\}([^]*)$/;function xy(t,e){var i;do{if(i=t.match(by)){var o=e[i[2]]||"";t=i[1]+o+i[3]}}while(i);return t}function ky(t,e,i,o,n,r,a){if(void 0===o&&(o=Qv),"string"==typeof e&&(e=JSON.parse(e)),8!=e.version)throw new Error("glStyle version 8 required.");var s,l;if(r)if("undefined"!=typeof Image){var u=new Image;u.crossOrigin="anonymous",u.onload=function(){s=u,l=[u.width,u.height],t.changed(),u.onload=null},u.src=r}else if("undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope){var p=self;p.postMessage({action:"loadImage",src:r}),p.addEventListener("message",(function(t){"imageLoaded"===t.data.action&&t.data.src===r&&(s=t.data.image,l=[s.width,s.height])}))}for(var d,h=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]=Sm(t[i],e[t[i].ref]));return t}(e.layers),c={},f=[],g={},m={},v={},y={},_=0,b=h.length;_<b;++_){var x=h[_],k=x.id;if("string"==typeof i&&x.source==i||-1!==i.indexOf(k)){var w=x["source-layer"];if(!d){d=x.source;var S=e.sources[d];if(!S)throw new Error('Source "'.concat(d,'" is not defined'));var C=S.type;if("vector"!==C&&"geojson"!==C)throw new Error('Source "'.concat(d,'" is not of type "vector" or "geojson", but "').concat(C,'"'))}var z=c[w];z||(z=[],c[w]=z),z.push({layer:x,index:_}),f.push(k)}}var T=new sl,E=new Ns,P=[],O=function(t,e){var i=t.getProperties(),r=c[i.layer];if(r){var u=o.indexOf(e);-1==u&&(u=function(t,e){for(var i=0,o=e.length;i<o;++i)if(e[i]<t&&i+1<o){var n=e[i]/e[i+1];return i+Math.log(e[i]/t)/Math.log(n)}return o-1}(e,o));for(var p=fy[t.getGeometry().getType()],d={properties:i,type:p},h=-1,f=function(o,c){var f=r[o],_=f.layer,b=_.id,x=_.layout||my,k=_.paint||my;if("none"===x.visibility||"minzoom"in _&&u<_.minzoom||"maxzoom"in _&&u>=_.maxzoom)return"continue";var w=_.filter;if(!w||function(t,e,i,o,n){return n||console.warn("No filterCache provided to evaluateFilter()"),t in n||(n[t]=dm(e).filter),vy.zoom=o,n[t](vy,i)}(b,w,d,u,y)){var S=void 0,C=void 0,z=void 0,O=void 0,j=void 0,R=void 0,I=f.index;if(3==p&&("fill"==_.type||"fill-extrusion"==_.type))if(C=yy(_,"paint",_.type+"-opacity",u,d,v),_.type+"-pattern"in k){var F=yy(_,"paint",_.type+"-pattern",u,d,v);if(F){var M="string"==typeof F?xy(F,i):F.toString();if(s&&n&&n[M]){++h,(R=P[h])&&R.getFill()&&!R.getStroke()&&!R.getText()||(R=new yl({fill:new Ns}),P[h]=R),z=R.getFill(),R.setZIndex(I);var A=m[ct=M+"."+C];if(!A){var D=n[M],L=ty(D.width,D.height),G=L.getContext("2d");G.globalAlpha=C,G.drawImage(s,D.x,D.y,D.width,D.height,0,0,D.width,D.height),A=G.createPattern(L,"repeat"),m[ct]=A}z.setColor(A)}}}else S=_y(yy(_,"paint",_.type+"-color",u,d,v),C),_.type+"-outline-color"in k&&(j=_y(yy(_,"paint",_.type+"-outline-color",u,d,v),C)),j||(j=S),(S||j)&&(++h,(!(R=P[h])||S&&!R.getFill()||!S&&R.getFill()||j&&!R.getStroke()||!j&&R.getStroke()||R.getText())&&(R=new yl({fill:S?new Ns:void 0,stroke:j?new sl:void 0}),P[h]=R),S&&(z=R.getFill()).setColor(S),j&&((O=R.getStroke()).setColor(j),O.setWidth(.5)),R.setZIndex(I));if(1!=p&&"line"==_.type){S=!("line-pattern"in k)&&"line-color"in k?_y(yy(_,"paint","line-color",u,d,v),yy(_,"paint","line-opacity",u,d,v)):void 0;var N=yy(_,"paint","line-width",u,d,v);S&&N>0&&(++h,(R=P[h])&&R.getStroke()&&!R.getFill()&&!R.getText()||(R=new yl({stroke:new sl}),P[h]=R),(O=R.getStroke()).setLineCap(yy(_,"layout","line-cap",u,d,v)),O.setLineJoin(yy(_,"layout","line-join",u,d,v)),O.setMiterLimit(yy(_,"layout","line-miter-limit",u,d,v)),O.setColor(S),O.setWidth(N),O.setLineDash(k["line-dasharray"]?yy(_,"paint","line-dasharray",u,d,v).map((function(t){return t*N})):null),R.setZIndex(I))}var B=!1,q=null,W=0,V=void 0,U=void 0,X=void 0;if((1==p||2==p)&&"icon-image"in x){var K=yy(_,"layout","icon-image",u,d,v);if(K){V="string"==typeof K?xy(K,i):K.toString();var Y=void 0;if(s&&n&&n[V]){var Z=yy(_,"layout","icon-rotation-alignment",u,d,v);if(2==p){var H=t.getGeometry();if(H.getFlatMidpoint||H.getFlatMidpoints){var $=H.getExtent();if(Math.sqrt(Math.max(Math.pow(($[2]-$[0])/e,2),Math.pow(($[3]-$[1])/e,2)))>150){var J="MultiLineString"===H.getType()?H.getFlatMidpoints():H.getFlatMidpoint();if(uy||(uy=new Kl("Point",ly=[NaN,NaN],[],{},null)),Y=uy,ly[0]=J[0],ly[1]=J[1],"line"===(jt=yy(_,"layout","symbol-placement",u,d,v))&&"map"===Z)for(var Q=H.getStride(),tt=H.getFlatCoordinates(),et=0,it=tt.length-Q;et<it;et+=Q){var ot=tt[et],nt=tt[et+1],rt=tt[et+Q],at=tt[et+Q+1],st=Math.min(ot,rt),lt=Math.min(nt,at),ut=Math.max(ot,rt),pt=Math.max(nt,at);if(J[0]>=st&&J[0]<=ut&&J[1]>=lt&&J[1]<=pt){W=Math.atan2(nt-at,rt-ot);break}}}}}if(2!==p||Y){var dt=yy(_,"layout","icon-size",u,d,v),ht=void 0!==k["icon-color"]?yy(_,"paint","icon-color",u,d,v):null;if(!ht||0!==ht.a){var ct=V+"."+dt;if(null!==ht&&(ct+="."+ht),!(U=g[ct])){var ft=n[V];U=new al({color:ht?[255*ht.r,255*ht.g,255*ht.b,ht.a]:void 0,img:s,imgSize:l,size:[ft.width,ft.height],offset:[ft.x,ft.y],rotateWithView:"map"===Z,scale:dt/ft.pixelRatio,displacement:"icon-offset"in x?yy(_,"layout","icon-offset",u,d,v).map((function(t){return-t*ft.pixelRatio})):void 0}),g[ct]=U}}U&&(++h,(R=P[h])&&R.getImage()&&!R.getFill()&&!R.getStroke()||(R=new yl,P[h]=R),R.setGeometry(Y),U.setRotation(W+Jv(yy(_,"layout","icon-rotate",u,d,v))),U.setOpacity(yy(_,"paint","icon-opacity",u,d,v)),U.setAnchor(gy[yy(_,"layout","icon-anchor",u,d,v)]),R.setImage(U),q=R.getText(),R.setText(void 0),R.setZIndex(I),B=!0,X=!1)}else X=!0}}}if(1==p&&"circle"===_.type){++h,(R=P[h])&&R.getImage()&&!R.getFill()&&!R.getStroke()||(R=new yl,P[h]=R);var gt="circle-radius"in k?yy(_,"paint","circle-radius",u,d,v):5,mt=_y(yy(_,"paint","circle-stroke-color",u,d,v),yy(_,"paint","circle-stroke-opacity",u,d,v)),vt=_y(yy(_,"paint","circle-color",u,d,v),yy(_,"paint","circle-opacity",u,d,v)),yt=yy(_,"paint","circle-stroke-width",u,d,v),_t=gt+"."+mt+"."+vt+"."+yt;(U=g[_t])||(U=new hl({radius:gt,stroke:mt&&yt>0?new sl({width:yt,color:mt}):void 0,fill:vt?new Ns({color:vt}):void 0}),g[_t]=U),R.setImage(U),q=R.getText(),R.setText(void 0),R.setGeometry(void 0),R.setZIndex(I),B=!0}var bt,xt,kt,wt,St=void 0,Ct=void 0;if("text-field"in x){xt=Math.round(yy(_,"layout","text-size",u,d,v));var zt=yy(_,"layout","text-font",u,d,v);bt=yy(_,"layout","text-line-height",u,d,v),Ct=$v(a?a(zt):zt,xt,bt),kt=yy(_,"layout","text-letter-spacing",u,d,v),wt=yy(_,"layout","text-max-width",u,d,v);var Tt=yy(_,"layout","text-field",u,d,v);St="object"==typeof Tt&&Tt.sections?1===Tt.sections.length?Tt.toString():Tt.sections.reduce((function(t,e,i){var o=e.fontStack?e.fontStack.split(","):zt,n=$v(a?a(o):o,xt*(e.scale||1),bt),r=e.text;if("\n"===r)return t.push("\n",""),t;if(2!=p){for(var s=0,l=(r=sy(r,n,wt,kt).split("\n")).length;s<l;++s)s>0&&t.push("\n",""),t.push(r[s],n);return t}t.push(oy(r,kt),n)}),[]):xy(Tt,i).trim(),C=yy(_,"paint","text-opacity",u,d,v)}if(St&&C&&!X){B||(++h,(R=P[h])&&R.getText()&&!R.getFill()&&!R.getStroke()||(R=new yl,P[h]=R),R.setImage(void 0),R.setGeometry(void 0)),R.getText()||R.setText(q||new xl({padding:[2,2,2,2]})),q=R.getText();var Et=x["text-transform"];"uppercase"==Et?St=Array.isArray(St)?St.map((function(t,e){return e%2?t:t.toUpperCase()})):St.toUpperCase():"lowercase"==Et&&(St=Array.isArray(St)?St.map((function(t,e){return e%2?t:t.toLowerCase()})):St.toLowerCase());var Pt=Array.isArray(St)?St:2==p?oy(St,kt):sy(St,Ct,wt,kt);q.setText(Pt),q.setFont(Ct),q.setRotation(Jv(yy(_,"layout","text-rotate",u,d,v)));var Ot=yy(_,"layout","text-anchor",u,d,v),jt=B||1==p?"point":yy(_,"layout","symbol-placement",u,d,v);q.setPlacement(jt),q.setOverflow("point"===jt);var Rt=yy(_,"paint","text-halo-width",u,d,v),It=yy(_,"layout","text-offset",u,d,v),Ft=yy(_,"paint","text-translate",u,d,v),Mt=0,At=0;if("point"==jt){var Dt="center";-1!==Ot.indexOf("left")?(Dt="left",At=Rt):-1!==Ot.indexOf("right")&&(Dt="right",At=-Rt),q.setTextAlign(Dt);var Lt=yy(_,"layout","text-rotation-alignment",u,d,v);q.setRotateWithView("map"==Lt)}else q.setMaxAngle(Jv(yy(_,"layout","text-max-angle",u,d,v))*St.length/Pt.length),q.setTextAlign(),q.setRotateWithView(!1);var Gt="middle";0==Ot.indexOf("bottom")?(Gt="bottom",Mt=-Rt-.5*(bt-1)*xt):0==Ot.indexOf("top")&&(Gt="top",Mt=Rt+.5*(bt-1)*xt),q.setTextBaseline(Gt),q.setOffsetX(It[0]*xt+At+Ft[0]),q.setOffsetY(It[1]*xt+Mt+Ft[1]),E.setColor(_y(yy(_,"paint","text-color",u,d,v),C)),q.setFill(E);var Nt=_y(yy(_,"paint","text-halo-color",u,d,v),C);if(Nt){T.setColor(Nt),Rt*=2;var Bt=.5*xt;T.setWidth(Rt<=Bt?Rt:Bt),q.setStroke(T)}else q.setStroke(void 0);var qt=yy(_,"layout","text-padding",u,d,v),Wt=q.getPadding();qt!==Wt[0]&&(Wt[0]=qt,Wt[1]=qt,Wt[2]=qt,Wt[3]=qt),R.setZIndex(I)}}},_=0,b=r.length;_<b;++_)f(_);return h>-1?(P.length=h+1,P):void 0}};return t.setStyle(O),t.set("mapbox-source",d),t.set("mapbox-layers",f),O}s`.ol-box {
|
46
|
+
var Zm=function(t,e){this.next=null,this.key=t,this.data=e,this.left=null,this.right=null};function $m(t,e){return t>e?1:t<e?-1:0}function Hm(t,e,i){for(var o=new Zm(null,null),n=o,r=o;;){var a=i(t,e.key);if(a<0){if(null===e.left)break;if(i(t,e.left.key)<0){var s=e.left;if(e.left=s.right,s.right=e,null===(e=s).left)break}r.left=e,r=e,e=e.left}else{if(!(a>0))break;if(null===e.right)break;if(i(t,e.right.key)>0){s=e.right;if(e.right=s.left,s.left=e,null===(e=s).right)break}n.right=e,n=e,e=e.right}}return n.right=e.left,r.left=e.right,e.left=o.right,e.right=o.left,e}function Jm(t,e,i,o){var n=new Zm(t,e);if(null===i)return n.left=n.right=null,n;var r=o(t,(i=Hm(t,i,o)).key);return r<0?(n.left=i.left,n.right=i,i.left=null):r>=0&&(n.right=i.right,n.left=i,i.right=null),n}function Qm(t,e,i){var o=null,n=null;if(e){var r=i((e=Hm(t,e,i)).key,t);0===r?(o=e.left,n=e.right):r<0?(n=e.right,e.right=null,o=e):(o=e.left,e.left=null,n=e)}return{left:o,right:n}}function tv(t,e,i,o,n){if(t){o(e+(i?"└── ":"├── ")+n(t)+"\n");var r=e+(i?" ":"│ ");t.left&&tv(t.left,r,!1,o,n),t.right&&tv(t.right,r,!0,o,n)}}var ev=function(){function t(t){void 0===t&&(t=$m),this._root=null,this._size=0,this._comparator=t}return t.prototype.insert=function(t,e){return this._size++,this._root=Jm(t,e,this._root,this._comparator)},t.prototype.add=function(t,e){var i=new Zm(t,e);null===this._root&&(i.left=i.right=null,this._size++,this._root=i);var o=this._comparator,n=Hm(t,this._root,o),r=o(t,n.key);return 0===r?this._root=n:(r<0?(i.left=n.left,i.right=n,n.left=null):r>0&&(i.right=n.right,i.left=n,n.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 o;return null===e?null:0===i(t,(e=Hm(t,e,i)).key)?(null===e.left?o=e.right:(o=Hm(t,e.left,i)).right=e.right,this._size--,o):e},t.prototype.pop=function(){var t=this._root;if(t){for(;t.left;)t=t.left;return this._root=Hm(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 o=i(t,e.key);if(0===o)return e;e=o<0?e.left:e.right}return null},t.prototype.find=function(t){return this._root&&(this._root=Hm(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 o=i(t,e.key);if(0===o)return!0;e=o<0?e.left:e.right}return!1},t.prototype.forEach=function(t,e){for(var i=this._root,o=[],n=!1;!n;)null!==i?(o.push(i),i=i.left):0!==o.length?(i=o.pop(),t.call(e,i),i=i.right):n=!0;return this},t.prototype.range=function(t,e,i,o){for(var n=[],r=this._comparator,a=this._root;0!==n.length||a;)if(a)n.push(a),a=a.left;else{if(r((a=n.pop()).key,e)>0)break;if(r(a.key,t)>=0&&i.call(o,a))return this;a=a.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,o=0,n=[];!i;)if(e)n.push(e),e=e.left;else if(n.length>0){if(e=n.pop(),o===t)return e;o++,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 o=this._comparator;e;){var n=o(t.key,e.key);if(0===n)break;n<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 o=this._comparator;e;){var n=o(t.key,e.key);if(0===n)break;n<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=[],o=!1,n=new Zm(null,null),r=n;for(;!o;)e?(i.push(e),e=e.left):i.length>0?e=(e=r=r.next=i.pop()).right:o=!0;return r.next=null,n.next}(this._root)},t.prototype.load=function(t,e,i){void 0===e&&(e=[]),void 0===i&&(i=!1);var o=t.length,n=this._comparator;if(i&&nv(t,e,0,o-1,n),null===this._root)this._root=iv(t,e,0,o),this._size=o;else{var r=function(t,e,i){var o=new Zm(null,null),n=o,r=t,a=e;for(;null!==r&&null!==a;)i(r.key,a.key)<0?(n.next=r,r=r.next):(n.next=a,a=a.next),n=n.next;null!==r?n.next=r:null!==a&&(n.next=a);return o.next}(this.toList(),function(t,e){for(var i=new Zm(null,null),o=i,n=0;n<t.length;n++)o=o.next=new Zm(t[n],e[n]);return o.next=null,i.next}(t,e),n);o=this._size+o,this._root=ov({head:r},0,o)}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 tv(this._root,"",!0,(function(t){return e.push(t)}),t),e.join("")},t.prototype.update=function(t,e,i){var o=this._comparator,n=Qm(t,this._root,o),r=n.left,a=n.right;o(t,e)<0?a=Jm(e,i,a,o):r=Jm(e,i,r,o),this._root=function(t,e,i){return null===e?t:(null===t||((e=Hm(t.key,e,i)).left=t),e)}(r,a,o)},t.prototype.split=function(t){return Qm(t,this._root,this._comparator)},t}();function iv(t,e,i,o){var n=o-i;if(n>0){var r=i+Math.floor(n/2),a=t[r],s=e[r],l=new Zm(a,s);return l.left=iv(t,e,i,r),l.right=iv(t,e,r+1,o),l}return null}function ov(t,e,i){var o=i-e;if(o>0){var n=e+Math.floor(o/2),r=ov(t,e,n),a=t.head;return a.left=r,t.head=t.head.next,a.right=ov(t,n+1,i),a}return null}function nv(t,e,i,o,n){if(!(i>=o)){for(var r=t[i+o>>1],a=i-1,s=o+1;;){do{a++}while(n(t[a],r)<0);do{s--}while(n(t[s],r)>0);if(a>=s)break;var l=t[a];t[a]=t[s],t[s]=l,l=e[a],e[a]=e[s],e[s]=l}nv(t,e,i,s,n),nv(t,e,s+1,o,n)}}function rv(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function av(t,e){for(var i=0;i<e.length;i++){var o=e[i];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(t,o.key,o)}}function sv(t,e,i){return e&&av(t.prototype,e),i&&av(t,i),t}var lv=function(t,e){return t.ll.x<=e.x&&e.x<=t.ur.x&&t.ll.y<=e.y&&e.y<=t.ur.y},uv=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,o=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:o,y:t.ur.y<e.ur.y?t.ur.y:e.ur.y}}},pv=Number.EPSILON;void 0===pv&&(pv=Math.pow(2,-52));var dv=pv*pv,hv=function(t,e){if(-pv<t&&t<pv&&-pv<e&&e<pv)return 0;var i=t-e;return i*i<dv*t*e?0:t<e?-1:1},cv=function(){function t(){rv(this,t),this.reset()}return sv(t,[{key:"reset",value:function(){this.xRounder=new fv,this.yRounder=new fv}},{key:"round",value:function(t,e){return{x:this.xRounder.round(t),y:this.yRounder.round(e)}}}]),t}(),fv=function(){function t(){rv(this,t),this.tree=new ev,this.round(0)}return sv(t,[{key:"round",value:function(t){var e=this.tree.add(t),i=this.tree.prev(e);if(null!==i&&0===hv(e.key,i.key))return this.tree.remove(t),i.key;var o=this.tree.next(e);return null!==o&&0===hv(e.key,o.key)?(this.tree.remove(t),o.key):t}}]),t}(),gv=new cv,mv=function(t,e){return t.x*e.y-t.y*e.x},vv=function(t,e){return t.x*e.x+t.y*e.y},yv=function(t,e,i){var o={x:e.x-t.x,y:e.y-t.y},n={x:i.x-t.x,y:i.y-t.y},r=mv(o,n);return hv(r,0)},_v=function(t){return Math.sqrt(vv(t,t))},bv=function(t,e,i){var o={x:e.x-t.x,y:e.y-t.y},n={x:i.x-t.x,y:i.y-t.y};return vv(n,o)/_v(n)/_v(o)},xv=function(t,e,i){return 0===e.y?null:{x:t.x+e.x/e.y*(i-t.y),y:i}},kv=function(t,e,i){return 0===e.x?null:{x:i,y:t.y+e.y/e.x*(i-t.x)}},wv=function(){function t(e,i){rv(this,t),void 0===e.events?e.events=[this]:e.events.push(this),this.point=e,this.isLeft=i}return sv(t,null,[{key:"compare",value:function(e,i){var o=t.comparePoints(e.point,i.point);return 0!==o?o:(e.point!==i.point&&e.link(i),e.isLeft!==i.isLeft?e.isLeft?1:-1:Cv.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}}]),sv(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,o=e.length;i<o;i++){var n=e[i];this.point.events.push(n),n.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 o=e+1;o<t;o++){var n=this.point.events[o];void 0===n.consumedBy&&(i.otherSE.point.events===n.otherSE.point.events&&i.segment.consume(n.segment))}}}},{key:"getAvailableLinkedEvents",value:function(){for(var t=[],e=0,i=this.point.events.length;e<i;e++){var o=this.point.events[e];o!==this&&!o.segment.ringOut&&o.segment.isInResult()&&t.push(o)}return t}},{key:"getLeftmostComparator",value:function(t){var e=this,i=new Map,o=function(o){var n,r,a,s,l,u=o.otherSE;i.set(o,{sine:(n=e.point,r=t.point,a=u.point,s={x:r.x-n.x,y:r.y-n.y},l={x:a.x-n.x,y:a.y-n.y},mv(l,s)/_v(l)/_v(s)),cosine:bv(e.point,t.point,u.point)})};return function(t,e){i.has(t)||o(t),i.has(e)||o(e);var n=i.get(t),r=n.sine,a=n.cosine,s=i.get(e),l=s.sine,u=s.cosine;return r>=0&&l>=0?a<u?1:a>u?-1:0:r<0&&l<0?a<u?-1:a>u?1:0:l<r?-1:l>r?1:0}}}]),t}(),Sv=0,Cv=function(){function t(e,i,o,n){rv(this,t),this.id=++Sv,this.leftSE=e,e.segment=this,e.otherSE=i,this.rightSE=i,i.segment=this,i.otherSE=e,this.rings=o,this.windings=n}return sv(t,null,[{key:"compare",value:function(t,e){var i=t.leftSE.point.x,o=e.leftSE.point.x,n=t.rightSE.point.x,r=e.rightSE.point.x;if(r<i)return 1;if(n<o)return-1;var a=t.leftSE.point.y,s=e.leftSE.point.y,l=t.rightSE.point.y,u=e.rightSE.point.y;if(i<o){if(s<a&&s<l)return 1;if(s>a&&s>l)return-1;var p=t.comparePoint(e.leftSE.point);if(p<0)return 1;if(p>0)return-1;var d=e.comparePoint(t.rightSE.point);return 0!==d?d:-1}if(i>o){if(a<s&&a<u)return-1;if(a>s&&a>u)return 1;var h=e.comparePoint(t.leftSE.point);if(0!==h)return h;var c=t.comparePoint(e.rightSE.point);return c<0?1:c>0?-1:1}if(a<s)return-1;if(a>s)return 1;if(n<r){var f=e.comparePoint(t.rightSE.point);if(0!==f)return f}if(n>r){var g=t.comparePoint(e.rightSE.point);if(g<0)return 1;if(g>0)return-1}if(n!==r){var m=l-a,v=n-i,y=u-s,_=r-o;if(m>v&&y<_)return 1;if(m<v&&y>_)return-1}return n>r?1:n<r||l<u?-1:l>u?1:t.id<e.id?-1:t.id>e.id?1:0}}]),sv(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,o=this.vector();if(e.x===i.x)return t.x===e.x?0:t.x<e.x?1:-1;var n=(t.y-e.y)/o.y,r=e.x+n*o.x;if(t.x===r)return 0;var a=(t.x-e.x)/o.x,s=e.y+a*o.y;return t.y===s?0:t.y<s?-1:1}},{key:"getIntersection",value:function(t){var e=this.bbox(),i=t.bbox(),o=uv(e,i);if(null===o)return null;var n=this.leftSE.point,r=this.rightSE.point,a=t.leftSE.point,s=t.rightSE.point,l=lv(e,a)&&0===this.comparePoint(a),u=lv(i,n)&&0===t.comparePoint(n),p=lv(e,s)&&0===this.comparePoint(s),d=lv(i,r)&&0===t.comparePoint(r);if(u&&l)return d&&!p?r:!d&&p?s:null;if(u)return p&&n.x===s.x&&n.y===s.y?null:n;if(l)return d&&r.x===a.x&&r.y===a.y?null:a;if(d&&p)return null;if(d)return r;if(p)return s;var h=function(t,e,i,o){if(0===e.x)return kv(i,o,t.x);if(0===o.x)return kv(t,e,i.x);if(0===e.y)return xv(i,o,t.y);if(0===o.y)return xv(t,e,i.y);var n=mv(e,o);if(0==n)return null;var r={x:i.x-t.x,y:i.y-t.y},a=mv(r,e)/n,s=mv(r,o)/n;return{x:(t.x+s*e.x+(i.x+a*o.x))/2,y:(t.y+s*e.y+(i.y+a*o.y))/2}}(n,this.vector(),a,t.vector());return null===h?null:lv(o,h)?gv.round(h.x,h.y):null}},{key:"split",value:function(e){var i=[],o=void 0!==e.events,n=new wv(e,!0),r=new wv(e,!1),a=this.rightSE;this.replaceRightSE(r),i.push(r),i.push(n);var s=new t(n,a,this.rings.slice(),this.windings.slice());return wv.comparePoints(s.leftSE.point,s.rightSE.point)>0&&s.swapEvents(),wv.comparePoints(this.leftSE.point,this.rightSE.point)>0&&this.swapEvents(),o&&(n.checkForConsuming(),r.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,o=e;i.consumedBy;)i=i.consumedBy;for(;o.consumedBy;)o=o.consumedBy;var n=t.compare(i,o);if(0!==n){if(n>0){var r=i;i=o,o=r}if(i.prev===o){var a=i;i=o,o=a}for(var s=0,l=o.rings.length;s<l;s++){var u=o.rings[s],p=o.windings[s],d=i.rings.indexOf(u);-1===d?(i.rings.push(u),i.windings.push(p)):i.windings[d]+=p}o.rings=null,o.windings=null,o.consumedBy=i,o.leftSE.consumedBy=i.leftSE,o.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,o=this._afterState.multiPolys,n=0,r=this.rings.length;n<r;n++){var a=this.rings[n],s=this.windings[n],l=e.indexOf(a);-1===l?(e.push(a),i.push(s)):i[l]+=s}for(var u=[],p=[],d=0,h=e.length;d<h;d++)if(0!==i[d]){var c=e[d],f=c.poly;if(-1===p.indexOf(f))if(c.isExterior)u.push(f);else{-1===p.indexOf(f)&&p.push(f);var g=u.indexOf(c.poly);-1!==g&&u.splice(g,1)}}for(var m=0,v=u.length;m<v;m++){var y=u[m].multiPoly;-1===o.indexOf(y)&&o.push(y)}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(Mv.type){case"union":var i=0===t.length,o=0===e.length;this._isInResult=i!==o;break;case"intersection":var n,r;t.length<e.length?(n=t.length,r=e.length):(n=e.length,r=t.length),this._isInResult=r===Mv.numMultiPolys&&n<r;break;case"xor":var a=Math.abs(t.length-e.length);this._isInResult=a%2==1;break;case"difference":var s=function(t){return 1===t.length&&t[0].isSubject};this._isInResult=s(t)!==s(e);break;default:throw new Error("Unrecognized operation type found ".concat(Mv.type))}return this._isInResult}}],[{key:"fromRing",value:function(e,i,o){var n,r,a,s=wv.comparePoints(e,i);if(s<0)n=e,r=i,a=1;else{if(!(s>0))throw new Error("Tried to create degenerate segment at [".concat(e.x,", ").concat(e.y,"]"));n=i,r=e,a=-1}return new t(new wv(n,!0),new wv(r,!1),[o],[a])}}]),t}(),zv=function(){function t(e,i,o){if(rv(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=o,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 n=gv.round(e[0][0],e[0][1]);this.bbox={ll:{x:n.x,y:n.y},ur:{x:n.x,y:n.y}};for(var r=n,a=1,s=e.length;a<s;a++){if("number"!=typeof e[a][0]||"number"!=typeof e[a][1])throw new Error("Input geometry is not a valid Polygon or MultiPolygon");var l=gv.round(e[a][0],e[a][1]);l.x===r.x&&l.y===r.y||(this.segments.push(Cv.fromRing(r,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),r=l)}n.x===r.x&&n.y===r.y||this.segments.push(Cv.fromRing(r,n,this))}return sv(t,[{key:"getSweepEvents",value:function(){for(var t=[],e=0,i=this.segments.length;e<i;e++){var o=this.segments[e];t.push(o.leftSE),t.push(o.rightSE)}return t}}]),t}(),Tv=function(){function t(e,i){if(rv(this,t),!Array.isArray(e))throw new Error("Input geometry is not a valid Polygon or MultiPolygon");this.exteriorRing=new zv(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 o=1,n=e.length;o<n;o++){var r=new zv(e[o],this,!1);r.bbox.ll.x<this.bbox.ll.x&&(this.bbox.ll.x=r.bbox.ll.x),r.bbox.ll.y<this.bbox.ll.y&&(this.bbox.ll.y=r.bbox.ll.y),r.bbox.ur.x>this.bbox.ur.x&&(this.bbox.ur.x=r.bbox.ur.x),r.bbox.ur.y>this.bbox.ur.y&&(this.bbox.ur.y=r.bbox.ur.y),this.interiorRings.push(r)}this.multiPoly=i}return sv(t,[{key:"getSweepEvents",value:function(){for(var t=this.exteriorRing.getSweepEvents(),e=0,i=this.interiorRings.length;e<i;e++)for(var o=this.interiorRings[e].getSweepEvents(),n=0,r=o.length;n<r;n++)t.push(o[n]);return t}}]),t}(),Ev=function(){function t(e,i){if(rv(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(a){}this.polys=[],this.bbox={ll:{x:Number.POSITIVE_INFINITY,y:Number.POSITIVE_INFINITY},ur:{x:Number.NEGATIVE_INFINITY,y:Number.NEGATIVE_INFINITY}};for(var o=0,n=e.length;o<n;o++){var r=new Tv(e[o],this);r.bbox.ll.x<this.bbox.ll.x&&(this.bbox.ll.x=r.bbox.ll.x),r.bbox.ll.y<this.bbox.ll.y&&(this.bbox.ll.y=r.bbox.ll.y),r.bbox.ur.x>this.bbox.ur.x&&(this.bbox.ur.x=r.bbox.ur.x),r.bbox.ur.y>this.bbox.ur.y&&(this.bbox.ur.y=r.bbox.ur.y),this.polys.push(r)}this.isSubject=i}return sv(t,[{key:"getSweepEvents",value:function(){for(var t=[],e=0,i=this.polys.length;e<i;e++)for(var o=this.polys[e].getSweepEvents(),n=0,r=o.length;n<r;n++)t.push(o[n]);return t}}]),t}(),Pv=function(){function t(e){rv(this,t),this.events=e;for(var i=0,o=e.length;i<o;i++)e[i].segment.ringOut=this;this.poly=null}return sv(t,null,[{key:"factory",value:function(e){for(var i=[],o=0,n=e.length;o<n;o++){var r=e[o];if(r.isInResult()&&!r.ringOut){for(var a=null,s=r.leftSE,l=r.rightSE,u=[s],p=s.point,d=[];a=s,s=l,u.push(s),s.point!==p;)for(;;){var h=s.getAvailableLinkedEvents();if(0===h.length){var c=u[0].point,f=u[u.length-1].point;throw new Error("Unable to complete output ring starting at [".concat(c.x,",")+" ".concat(c.y,"]. Last matching segment found ends at")+" [".concat(f.x,", ").concat(f.y,"]."))}if(1===h.length){l=h[0].otherSE;break}for(var g=null,m=0,v=d.length;m<v;m++)if(d[m].point===s.point){g=m;break}if(null===g){d.push({index:u.length,point:s.point});var y=s.getLeftmostComparator(a);l=h.sort(y)[0].otherSE;break}var _=d.splice(g)[0],b=u.splice(_.index);b.unshift(b[0].otherSE),i.push(new t(b.reverse()))}i.push(new t(u))}}return i}}]),sv(t,[{key:"getGeom",value:function(){for(var t=this.events[0].point,e=[t],i=1,o=this.events.length-1;i<o;i++){var n=this.events[i].point,r=this.events[i+1].point;0!==yv(n,t,r)&&(e.push(n),t=n)}if(1===e.length)return null;var a=e[0],s=e[1];0===yv(a,t,s)&&e.shift(),e.push(e[0]);for(var l=this.isExteriorRing()?1:-1,u=this.isExteriorRing()?0:e.length-1,p=this.isExteriorRing()?e.length:-1,d=[],h=u;h!=p;h+=l)d.push([e[h].x,e[h].y]);return d}},{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 o=this.events[e];wv.compare(t,o)>0&&(t=o)}for(var n=t.segment.prevInResult(),r=n?n.prevInResult():null;;){if(!n)return null;if(!r)return n.ringOut;if(r.ringOut!==n.ringOut)return r.ringOut.enclosingRing()!==n.ringOut?n.ringOut:n.ringOut.enclosingRing();n=r.prevInResult(),r=n?n.prevInResult():null}}}]),t}(),Ov=function(){function t(e){rv(this,t),this.exteriorRing=e,e.poly=this,this.interiorRings=[]}return sv(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 o=this.interiorRings[e].getGeom();null!==o&&t.push(o)}return t}}]),t}(),jv=function(){function t(e){rv(this,t),this.rings=e,this.polys=this._composePolys(e)}return sv(t,[{key:"getGeom",value:function(){for(var t=[],e=0,i=this.polys.length;e<i;e++){var o=this.polys[e].getGeom();null!==o&&t.push(o)}return t}},{key:"_composePolys",value:function(t){for(var e=[],i=0,o=t.length;i<o;i++){var n=t[i];if(!n.poly)if(n.isExteriorRing())e.push(new Ov(n));else{var r=n.enclosingRing();r.poly||e.push(new Ov(r)),r.poly.addInterior(n)}}return e}}]),t}(),Rv=function(){function t(e){var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Cv.compare;rv(this,t),this.queue=e,this.tree=new ev(i),this.segments=[]}return sv(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 o=t.isLeft?this.tree.insert(e):this.tree.find(e);if(!o)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 n=o,r=o,a=void 0,s=void 0;void 0===a;)null===(n=this.tree.prev(n))?a=null:void 0===n.key.consumedBy&&(a=n.key);for(;void 0===s;)null===(r=this.tree.next(r))?s=null:void 0===r.key.consumedBy&&(s=r.key);if(t.isLeft){var l=null;if(a){var u=a.getIntersection(e);if(null!==u&&(e.isAnEndpoint(u)||(l=u),!a.isAnEndpoint(u)))for(var p=this._splitSafely(a,u),d=0,h=p.length;d<h;d++)i.push(p[d])}var c=null;if(s){var f=s.getIntersection(e);if(null!==f&&(e.isAnEndpoint(f)||(c=f),!s.isAnEndpoint(f)))for(var g=this._splitSafely(s,f),m=0,v=g.length;m<v;m++)i.push(g[m])}if(null!==l||null!==c){var y=null;if(null===l)y=c;else if(null===c)y=l;else{y=wv.comparePoints(l,c)<=0?l:c}this.queue.remove(e.rightSE),i.push(e.rightSE);for(var _=e.split(y),b=0,x=_.length;b<x;b++)i.push(_[b])}i.length>0?(this.tree.remove(e),i.push(t)):(this.segments.push(e),e.prev=a)}else{if(a&&s){var k=a.getIntersection(s);if(null!==k){if(!a.isAnEndpoint(k))for(var w=this._splitSafely(a,k),S=0,C=w.length;S<C;S++)i.push(w[S]);if(!s.isAnEndpoint(k))for(var z=this._splitSafely(s,k),T=0,E=z.length;T<E;T++)i.push(z[T])}}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 o=t.split(e);return o.push(i),void 0===t.consumedBy&&this.tree.insert(t),o}}]),t}(),Iv="undefined"!=typeof process&&{}.POLYGON_CLIPPING_MAX_QUEUE_SIZE||1e6,Fv="undefined"!=typeof process&&{}.POLYGON_CLIPPING_MAX_SWEEPLINE_SEGMENTS||1e6,Mv=new(function(){function t(){rv(this,t)}return sv(t,[{key:"run",value:function(t,e,i){Mv.type=t,gv.reset();for(var o=[new Ev(e,!0)],n=0,r=i.length;n<r;n++)o.push(new Ev(i[n],!1));if(Mv.numMultiPolys=o.length,"difference"===Mv.type)for(var a=o[0],s=1;s<o.length;)null!==uv(o[s].bbox,a.bbox)?s++:o.splice(s,1);if("intersection"===Mv.type)for(var l=0,u=o.length;l<u;l++)for(var p=o[l],d=l+1,h=o.length;d<h;d++)if(null===uv(p.bbox,o[d].bbox))return[];for(var c=new ev(wv.compare),f=0,g=o.length;f<g;f++)for(var m=o[f].getSweepEvents(),v=0,y=m.length;v<y;v++)if(c.insert(m[v]),c.size>Iv)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 Rv(c),b=c.size,x=c.pop();x;){var k=x.key;if(c.size===b){var w=k.segment;throw new Error("Unable to pop() ".concat(k.isLeft?"left":"right"," SweepEvent ")+"[".concat(k.point.x,", ").concat(k.point.y,"] from segment #").concat(w.id," ")+"[".concat(w.leftSE.point.x,", ").concat(w.leftSE.point.y,"] -> ")+"[".concat(w.rightSE.point.x,", ").concat(w.rightSE.point.y,"] from queue. ")+"Please file a bug report.")}if(c.size>Iv)throw new Error("Infinite loop when passing sweep line over endpoints (queue size too big). Please file a bug report.");if(_.segments.length>Fv)throw new Error("Infinite loop when passing sweep line over endpoints (too many sweep line segments). Please file a bug report.");for(var S=_.process(k),C=0,z=S.length;C<z;C++){var T=S[C];void 0===T.consumedBy&&c.insert(T)}b=c.size,x=c.pop()}gv.reset();var E=Pv.factory(_.segments);return new jv(E).getGeom()}}]),t}()),Av=function(t){for(var e=arguments.length,i=new Array(e>1?e-1:0),o=1;o<e;o++)i[o-1]=arguments[o];return Mv.run("union",t,i)};function Dv(t,e,i){void 0===i&&(i={});var o={type:"Feature"};return(0===i.id||i.id)&&(o.id=i.id),i.bbox&&(o.bbox=i.bbox),o.properties=e||{},o.geometry=t,o}function Lv(t){return"Feature"===t.type?t.geometry:t}function Gv(t,e,i){void 0===i&&(i={});var o=Lv(t),n=Lv(e),r=Av(o.coordinates,n.coordinates);return 0===r.length?null:1===r.length?function(t,e,i){void 0===i&&(i={});for(var o=0,n=t;o<n.length;o++){var r=n[o];if(r.length<4)throw new Error("Each LinearRing of a Polygon must have 4 or more Positions.");for(var a=0;a<r[r.length-1].length;a++)if(r[r.length-1][a]!==r[0][a])throw new Error("First and last Position are not equivalent.")}return Dv({type:"Polygon",coordinates:t},e,i)}(r[0],i.properties):function(t,e,i){return void 0===i&&(i={}),Dv({type:"MultiPolygon",coordinates:t},e,i)}(r,i.properties)}function Nv(t,e){const i=Bo(t),o=Math.round(100*i)/100;let n;return"m2"===e?n=o+" m²":"ha"===e&&(n=o/1e4+" ha"),n}function Bv(t,e,i){const o=e.getExtent();return t.getView().fit($i(o,i))}function qv(t,e){const[i,o,n]=Array.from(jn(t));return Tn([i,o,n,e])}const Wv="https://api.os.uk/features/v1/wfs",Vv=new qd,Uv=new qd;function Xv(t,e,i){const o=`\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,a=sn(n,void 0!==r?r:"EPSG:3857","EPSG:4326"),s=a[0],(s<-180||s>180)&&(a[0]=Ge(s+180,360)-180),a).reverse().join(",")}</gml:coordinates>\n </gml:Point>\n </ogc:Contains>\n </ogc:Filter>\n `;var n,r,a,s;fetch(function(t){const e=Object.keys(t).map((e=>e+"="+encodeURI(t[e]))).join("&");return`${Wv}?${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:o,count:1})).then((t=>t.json())).then((t=>{if(!t.features.length)return;const e=t.features[0].properties,o=["TOID","DescriptiveGroup"];Object.keys(e).forEach((t=>o.includes(t)||delete e[t]));const n=new Gs,r=n.readFeatures(t,{featureProjection:"EPSG:3857"});i?r.forEach((t=>{const e=t.getProperties().TOID,i=Vv.getFeatureById(e);i?Vv.removeFeature(i):(t.setId(e),Vv.addFeature(t))})):(Vv.clear(),r.forEach((t=>{const e=t.getProperties().TOID;t.setId(e),Vv.addFeature(t)}))),Uv.clear(),Uv.addFeature(n.readFeature(Vv.getFeatures().reduce(((t,e)=>{const i=n.writeFeatureObject(e).geometry;return t?Gv(t,i):i}),null)))})).catch((t=>console.log(t)))}var Kv={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},Yv=" ",Zv=/(italic|oblique)$/i,$v={},Hv=function(t,e,i){var o=$v[t];if(!o){Array.isArray(t)||(t=[t]);for(var n=400,r="normal",a=[],s=0,l=t.length;s<l;++s){var u=t[s].split(" "),p=u[u.length-1].toLowerCase();for(var d in"normal"==p||"italic"==p||"oblique"==p?(r=p,u.pop(),p=u[u.length-1].toLowerCase()):Zv.test(p)&&(p=p.replace(Zv,""),r=u[u.length-1].replace(p,"")),Kv){var h=u.length>1?u[u.length-2].toLowerCase():"";if(p==d||p==d.replace("-","")||h+"-"+p==d){n=Kv[d],u.pop(),h&&d.startsWith(h)&&u.pop();break}}"number"==typeof p&&(n=p);var c=u.join(Yv).replace("Klokantech Noto Sans","Noto Sans");-1!==c.indexOf(Yv)&&(c='"'+c+'"'),a.push(c)}o=$v[t]=[r,n,a]}return o[0]+Yv+o[1]+Yv+e+"px"+(i?"/"+i:"")+Yv+o[2]};function Jv(t){return t*Math.PI/180}var Qv=function(){for(var t=[],e=78271.51696402048;t.length<=24;e/=2)t.push(e);return t}();function ty(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 ey,iy=Array(256).join(" ");function oy(t,e){if(e>=.05){for(var i="",o=t.split("\n"),n=iy.slice(0,Math.round(e/.1)),r=0,a=o.length;r<a;++r)r>0&&(i+="\n"),i+=o[r].split("").join(n);return i}return t}function ny(){return ey||(ey=ty(1,1).getContext("2d")),ey}function ry(t,e){return ny().measureText(t).width+(t.length-1)*e}var ay={};function sy(t,e,i,o){if(-1!==t.indexOf("\n")){for(var n=t.split("\n"),r=[],a=0,s=n.length;a<s;++a)r.push(sy(n[a],e,i,o));return r.join("\n")}var l=i+","+e+","+t+","+o,u=ay[l];if(!u){var p=t.split(" ");if(p.length>1){var d=ny();d.font=e;var h=d.measureText("M").width*i,c="";for(r=[],a=0,s=p.length;a<s;++a){var f=p[a],g=c+(c?" ":"")+f;ry(g,o)<=h?c=g:(c&&r.push(c),c=f)}c&&r.push(c);for(a=0,s=r.length;a<s&&s>1;++a){var m=r[a];if(ry(m,o)<.35*h){var v=a>0?ry(r[a-1],o):1/0,y=a<s-1?ry(r[a+1],o):1/0;r.splice(a,1),s-=1,v<y?(r[a-1]+=" "+m,a-=1):r[a]=m+" "+r[a]}}for(a=0,s=r.length-1;a<s;++a){var _=r[a],b=r[a+1];if(ry(_,o)>.7*h&&ry(b,o)<.6*h){var x=_.split(" "),k=x.pop();ry(k,o)<.2*h&&(r[a]=x.join(" "),r[a+1]=k+" "+b),s-=1}}u=r.join("\n")}else u=t;u=oy(u,o),ay[l]=u}return u}Hn&&Gt(Hn,Pt,(function(){ay={}}));var ly,uy,py=Em,dy=Tm,hy=Cm,cy=zm,fy={Point:1,MultiPoint:1,LineString:2,MultiLineString:2,Polygon:3,MultiPolygon:3},gy={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]},my={},vy={zoom:0};function yy(t,e,i,o,n,r){var a=t.id;r||(r={},console.warn("No functionCache provided to getValue()")),r[a]||(r[a]={});var s=r[a];if(!s[i]){var l=(t[e]||my)[i],u=Rc["".concat(e,"_").concat(t.type)][i];void 0===l&&(l=u.default);var p=hy(l);if(!p&&py(l)&&(l=dy(l,u),p=!0),p){var d=function(t,e){var i=cy(t,e);if("error"===i.result)throw new Error(i.value.map((function(t){return"".concat(t.key,": ").concat(t.message)})).join(", "));return i.value}(l,u);s[i]=d.evaluate.bind(d)}else"color"==u.type&&(l=rf.parse(l)),s[i]=function(){return l}}return vy.zoom=o,s[i](vy,n)}function _y(t,e){if(t){if(0===t.a||0===e)return;var i=t.a;return e=void 0===e?1:e,0===i?"transparent":"rgba("+Math.round(255*t.r/i)+","+Math.round(255*t.g/i)+","+Math.round(255*t.b/i)+","+i*e+")"}return t}var by=/^([^]*)\{(.*)\}([^]*)$/;function xy(t,e){var i;do{if(i=t.match(by)){var o=e[i[2]]||"";t=i[1]+o+i[3]}}while(i);return t}function ky(t,e,i,o,n,r,a){if(void 0===o&&(o=Qv),"string"==typeof e&&(e=JSON.parse(e)),8!=e.version)throw new Error("glStyle version 8 required.");var s,l;if(r)if("undefined"!=typeof Image){var u=new Image;u.crossOrigin="anonymous",u.onload=function(){s=u,l=[u.width,u.height],t.changed(),u.onload=null},u.src=r}else if("undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope){var p=self;p.postMessage({action:"loadImage",src:r}),p.addEventListener("message",(function(t){"imageLoaded"===t.data.action&&t.data.src===r&&(s=t.data.image,l=[s.width,s.height])}))}for(var d,h=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]=Sm(t[i],e[t[i].ref]));return t}(e.layers),c={},f=[],g={},m={},v={},y={},_=0,b=h.length;_<b;++_){var x=h[_],k=x.id;if("string"==typeof i&&x.source==i||-1!==i.indexOf(k)){var w=x["source-layer"];if(!d){d=x.source;var S=e.sources[d];if(!S)throw new Error('Source "'.concat(d,'" is not defined'));var C=S.type;if("vector"!==C&&"geojson"!==C)throw new Error('Source "'.concat(d,'" is not of type "vector" or "geojson", but "').concat(C,'"'))}var z=c[w];z||(z=[],c[w]=z),z.push({layer:x,index:_}),f.push(k)}}var T=new sl,E=new Ns,P=[],O=function(t,e){var i=t.getProperties(),r=c[i.layer];if(r){var u=o.indexOf(e);-1==u&&(u=function(t,e){for(var i=0,o=e.length;i<o;++i)if(e[i]<t&&i+1<o){var n=e[i]/e[i+1];return i+Math.log(e[i]/t)/Math.log(n)}return o-1}(e,o));for(var p=fy[t.getGeometry().getType()],d={properties:i,type:p},h=-1,f=function(o,c){var f=r[o],_=f.layer,b=_.id,x=_.layout||my,k=_.paint||my;if("none"===x.visibility||"minzoom"in _&&u<_.minzoom||"maxzoom"in _&&u>=_.maxzoom)return"continue";var w=_.filter;if(!w||function(t,e,i,o,n){return n||console.warn("No filterCache provided to evaluateFilter()"),t in n||(n[t]=dm(e).filter),vy.zoom=o,n[t](vy,i)}(b,w,d,u,y)){var S=void 0,C=void 0,z=void 0,O=void 0,j=void 0,R=void 0,I=f.index;if(3==p&&("fill"==_.type||"fill-extrusion"==_.type))if(C=yy(_,"paint",_.type+"-opacity",u,d,v),_.type+"-pattern"in k){var F=yy(_,"paint",_.type+"-pattern",u,d,v);if(F){var M="string"==typeof F?xy(F,i):F.toString();if(s&&n&&n[M]){++h,(R=P[h])&&R.getFill()&&!R.getStroke()&&!R.getText()||(R=new yl({fill:new Ns}),P[h]=R),z=R.getFill(),R.setZIndex(I);var A=m[ct=M+"."+C];if(!A){var D=n[M],L=ty(D.width,D.height),G=L.getContext("2d");G.globalAlpha=C,G.drawImage(s,D.x,D.y,D.width,D.height,0,0,D.width,D.height),A=G.createPattern(L,"repeat"),m[ct]=A}z.setColor(A)}}}else S=_y(yy(_,"paint",_.type+"-color",u,d,v),C),_.type+"-outline-color"in k&&(j=_y(yy(_,"paint",_.type+"-outline-color",u,d,v),C)),j||(j=S),(S||j)&&(++h,(!(R=P[h])||S&&!R.getFill()||!S&&R.getFill()||j&&!R.getStroke()||!j&&R.getStroke()||R.getText())&&(R=new yl({fill:S?new Ns:void 0,stroke:j?new sl:void 0}),P[h]=R),S&&(z=R.getFill()).setColor(S),j&&((O=R.getStroke()).setColor(j),O.setWidth(.5)),R.setZIndex(I));if(1!=p&&"line"==_.type){S=!("line-pattern"in k)&&"line-color"in k?_y(yy(_,"paint","line-color",u,d,v),yy(_,"paint","line-opacity",u,d,v)):void 0;var N=yy(_,"paint","line-width",u,d,v);S&&N>0&&(++h,(R=P[h])&&R.getStroke()&&!R.getFill()&&!R.getText()||(R=new yl({stroke:new sl}),P[h]=R),(O=R.getStroke()).setLineCap(yy(_,"layout","line-cap",u,d,v)),O.setLineJoin(yy(_,"layout","line-join",u,d,v)),O.setMiterLimit(yy(_,"layout","line-miter-limit",u,d,v)),O.setColor(S),O.setWidth(N),O.setLineDash(k["line-dasharray"]?yy(_,"paint","line-dasharray",u,d,v).map((function(t){return t*N})):null),R.setZIndex(I))}var B=!1,q=null,W=0,V=void 0,U=void 0,X=void 0;if((1==p||2==p)&&"icon-image"in x){var K=yy(_,"layout","icon-image",u,d,v);if(K){V="string"==typeof K?xy(K,i):K.toString();var Y=void 0;if(s&&n&&n[V]){var Z=yy(_,"layout","icon-rotation-alignment",u,d,v);if(2==p){var $=t.getGeometry();if($.getFlatMidpoint||$.getFlatMidpoints){var H=$.getExtent();if(Math.sqrt(Math.max(Math.pow((H[2]-H[0])/e,2),Math.pow((H[3]-H[1])/e,2)))>150){var J="MultiLineString"===$.getType()?$.getFlatMidpoints():$.getFlatMidpoint();if(uy||(uy=new Kl("Point",ly=[NaN,NaN],[],{},null)),Y=uy,ly[0]=J[0],ly[1]=J[1],"line"===(jt=yy(_,"layout","symbol-placement",u,d,v))&&"map"===Z)for(var Q=$.getStride(),tt=$.getFlatCoordinates(),et=0,it=tt.length-Q;et<it;et+=Q){var ot=tt[et],nt=tt[et+1],rt=tt[et+Q],at=tt[et+Q+1],st=Math.min(ot,rt),lt=Math.min(nt,at),ut=Math.max(ot,rt),pt=Math.max(nt,at);if(J[0]>=st&&J[0]<=ut&&J[1]>=lt&&J[1]<=pt){W=Math.atan2(nt-at,rt-ot);break}}}}}if(2!==p||Y){var dt=yy(_,"layout","icon-size",u,d,v),ht=void 0!==k["icon-color"]?yy(_,"paint","icon-color",u,d,v):null;if(!ht||0!==ht.a){var ct=V+"."+dt;if(null!==ht&&(ct+="."+ht),!(U=g[ct])){var ft=n[V];U=new al({color:ht?[255*ht.r,255*ht.g,255*ht.b,ht.a]:void 0,img:s,imgSize:l,size:[ft.width,ft.height],offset:[ft.x,ft.y],rotateWithView:"map"===Z,scale:dt/ft.pixelRatio,displacement:"icon-offset"in x?yy(_,"layout","icon-offset",u,d,v).map((function(t){return-t*ft.pixelRatio})):void 0}),g[ct]=U}}U&&(++h,(R=P[h])&&R.getImage()&&!R.getFill()&&!R.getStroke()||(R=new yl,P[h]=R),R.setGeometry(Y),U.setRotation(W+Jv(yy(_,"layout","icon-rotate",u,d,v))),U.setOpacity(yy(_,"paint","icon-opacity",u,d,v)),U.setAnchor(gy[yy(_,"layout","icon-anchor",u,d,v)]),R.setImage(U),q=R.getText(),R.setText(void 0),R.setZIndex(I),B=!0,X=!1)}else X=!0}}}if(1==p&&"circle"===_.type){++h,(R=P[h])&&R.getImage()&&!R.getFill()&&!R.getStroke()||(R=new yl,P[h]=R);var gt="circle-radius"in k?yy(_,"paint","circle-radius",u,d,v):5,mt=_y(yy(_,"paint","circle-stroke-color",u,d,v),yy(_,"paint","circle-stroke-opacity",u,d,v)),vt=_y(yy(_,"paint","circle-color",u,d,v),yy(_,"paint","circle-opacity",u,d,v)),yt=yy(_,"paint","circle-stroke-width",u,d,v),_t=gt+"."+mt+"."+vt+"."+yt;(U=g[_t])||(U=new hl({radius:gt,stroke:mt&&yt>0?new sl({width:yt,color:mt}):void 0,fill:vt?new Ns({color:vt}):void 0}),g[_t]=U),R.setImage(U),q=R.getText(),R.setText(void 0),R.setGeometry(void 0),R.setZIndex(I),B=!0}var bt,xt,kt,wt,St=void 0,Ct=void 0;if("text-field"in x){xt=Math.round(yy(_,"layout","text-size",u,d,v));var zt=yy(_,"layout","text-font",u,d,v);bt=yy(_,"layout","text-line-height",u,d,v),Ct=Hv(a?a(zt):zt,xt,bt),kt=yy(_,"layout","text-letter-spacing",u,d,v),wt=yy(_,"layout","text-max-width",u,d,v);var Tt=yy(_,"layout","text-field",u,d,v);St="object"==typeof Tt&&Tt.sections?1===Tt.sections.length?Tt.toString():Tt.sections.reduce((function(t,e,i){var o=e.fontStack?e.fontStack.split(","):zt,n=Hv(a?a(o):o,xt*(e.scale||1),bt),r=e.text;if("\n"===r)return t.push("\n",""),t;if(2!=p){for(var s=0,l=(r=sy(r,n,wt,kt).split("\n")).length;s<l;++s)s>0&&t.push("\n",""),t.push(r[s],n);return t}t.push(oy(r,kt),n)}),[]):xy(Tt,i).trim(),C=yy(_,"paint","text-opacity",u,d,v)}if(St&&C&&!X){B||(++h,(R=P[h])&&R.getText()&&!R.getFill()&&!R.getStroke()||(R=new yl,P[h]=R),R.setImage(void 0),R.setGeometry(void 0)),R.getText()||R.setText(q||new xl({padding:[2,2,2,2]})),q=R.getText();var Et=x["text-transform"];"uppercase"==Et?St=Array.isArray(St)?St.map((function(t,e){return e%2?t:t.toUpperCase()})):St.toUpperCase():"lowercase"==Et&&(St=Array.isArray(St)?St.map((function(t,e){return e%2?t:t.toLowerCase()})):St.toLowerCase());var Pt=Array.isArray(St)?St:2==p?oy(St,kt):sy(St,Ct,wt,kt);q.setText(Pt),q.setFont(Ct),q.setRotation(Jv(yy(_,"layout","text-rotate",u,d,v)));var Ot=yy(_,"layout","text-anchor",u,d,v),jt=B||1==p?"point":yy(_,"layout","symbol-placement",u,d,v);q.setPlacement(jt),q.setOverflow("point"===jt);var Rt=yy(_,"paint","text-halo-width",u,d,v),It=yy(_,"layout","text-offset",u,d,v),Ft=yy(_,"paint","text-translate",u,d,v),Mt=0,At=0;if("point"==jt){var Dt="center";-1!==Ot.indexOf("left")?(Dt="left",At=Rt):-1!==Ot.indexOf("right")&&(Dt="right",At=-Rt),q.setTextAlign(Dt);var Lt=yy(_,"layout","text-rotation-alignment",u,d,v);q.setRotateWithView("map"==Lt)}else q.setMaxAngle(Jv(yy(_,"layout","text-max-angle",u,d,v))*St.length/Pt.length),q.setTextAlign(),q.setRotateWithView(!1);var Gt="middle";0==Ot.indexOf("bottom")?(Gt="bottom",Mt=-Rt-.5*(bt-1)*xt):0==Ot.indexOf("top")&&(Gt="top",Mt=Rt+.5*(bt-1)*xt),q.setTextBaseline(Gt),q.setOffsetX(It[0]*xt+At+Ft[0]),q.setOffsetY(It[1]*xt+Mt+Ft[1]),E.setColor(_y(yy(_,"paint","text-color",u,d,v),C)),q.setFill(E);var Nt=_y(yy(_,"paint","text-halo-color",u,d,v),C);if(Nt){T.setColor(Nt),Rt*=2;var Bt=.5*xt;T.setWidth(Rt<=Bt?Rt:Bt),q.setStroke(T)}else q.setStroke(void 0);var qt=yy(_,"layout","text-padding",u,d,v),Wt=q.getPadding();qt!==Wt[0]&&(Wt[0]=qt,Wt[1]=qt,Wt[2]=qt,Wt[3]=qt),R.setZIndex(I)}}},_=0,b=r.length;_<b;++_)f(_);return h>-1?(P.length=h+1,P):void 0}};return t.setStyle(O),t.set("mapbox-source",d),t.set("mapbox-layers",f),O}s`.ol-box {
|
47
47
|
box-sizing: border-box;
|
48
48
|
border-radius: 2px;
|
49
49
|
border: 1.5px solid rgb(179,197,219);
|
@@ -367,7 +367,7 @@ var Zm=function(t,e){this.next=null,this.key=t,this.data=e,this.left=null,this.r
|
|
367
367
|
left: 0;
|
368
368
|
z-index: 100;
|
369
369
|
background: white;
|
370
|
-
}`,Cy=Object.freeze,zy=Object.defineProperty,Ty=Object.getOwnPropertyDescriptor,Ey=(t,e,i,o)=>{for(var n,r=o>1?void 0:o?Ty(e,i):e,a=t.length-1;a>=0;a--)(n=t[a])&&(r=(o?n(e,i,r):n(r))||r);return o&&r&&zy(e,i,r),r};t.MyMap=class extends nt{constructor(){super(),this.id="map",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=this.renderRoot.querySelector(`#${this.id}`),i=!this.disableVectorTiles&&Boolean(this.osVectorTilesApiKey),o=(n=this.osCopyright,r=this.osVectorTilesApiKey,new jc({source:r?new Om({url:"https://api.os.uk/maps/raster/v1/zxy/Light_3857/{z}/{x}/{y}.png?key="+r,attributions:[n],attributionsCollapsible:!1,maxZoom:20}):new Im({attributions:[Rm]})}));var n,r;const a=function(t,e){let i=new Oh({declutter:!0,source:new pc({format:new Ql,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=>ky(i,t,"esri"))).catch((t=>console.log(t))),i}(this.osCopyright,this.osVectorTilesApiKey),s=new cc({target:e,layers:[i?a:o],view:new Ya({projection:"EPSG:3857",extent:(u=[-10.76418,49.528423,1.9134116,61.331151],p="EPSG:4326",d="EPSG:3857",Eo(u,an(p,d),void 0,h)),minZoom:this.minZoom,maxZoom:this.maxZoom,center:on([this.longitude,this.latitude]),zoom:this.zoom,enableRotation:!1}),controls:us({attribution:!0,zoom:!this.staticMode}).extend(this.showScale?[(l=this.useScaleBarStyle,new ls({units:"metric",bar:l,steps:4,text:!0,minWidth:140}))]:[]),interactions:ch({doubleClickZoom:!this.staticMode,dragPan:!this.staticMode,mouseWheelZoom:!this.staticMode})});var l,u,p,d,h;this.map=s;const c=(f=this.drawPointer,new Jd({source:Xm,type:"Polygon",style:new yl({stroke:Bm,fill:qm,image:"crosshair"===f?Wm:Vm})}));var f;const g=function(t){return new lh({source:Xm,style:new yl({image:"crosshair"===t?Wm:Vm})})}(this.drawPointer),m=document.createElement("button");m.innerHTML="↻",m.title="Reset map view";m.addEventListener("click",(()=>{this.showFeaturesAtPoint?Bv(s,Uv,this.featureBuffer):b.getFeatures().length>0?Bv(s,b,this.geojsonBuffer):(s.getView().setCenter(on([this.longitude,this.latitude])),s.getView().setZoom(this.zoom)),this.drawMode&&(Xm.clear(),this.dispatch("geojsonChange",{}),this.dispatch("areaChange",`0 ${"m2"===this.areaUnit?"m²":this.areaUnit}`),s.addInteraction(c),s.addInteraction(Ym))}),!1);const v=document.createElement("div");v.className="reset-control ol-unselectable ol-control",v.appendChild(m);var y=new he({element:v});this.hideResetControl||s.addControl(y);const _=null==(t=this.renderRoot)?void 0:t.querySelectorAll(".ol-control button");null==_||_.forEach((t=>t.setAttribute("aria-label",t.getAttribute("title")||""))),s.on("pointerdrag",(()=>{s.getViewport().style.cursor="grabbing"})),s.on("pointermove",(()=>{s.getViewport().style.cursor="grab"}));const b=new qd;if("FeatureCollection"===this.geojsonData.type){let t=(new Gs).readFeatures(this.geojsonData,{featureProjection:"EPSG:3857"});b.addFeatures(t)}else if("Feature"===this.geojsonData.type){let t=(new Gs).readFeature(this.geojsonData,{featureProjection:"EPSG:3857"});b.addFeature(t)}const x=new Cd({source:b,style:new yl({stroke:new sl({color:this.geojsonColor,width:3}),fill:new Ns({color:this.geojsonFill?qv(this.geojsonColor,.2):qv(this.geojsonColor,0)})})});if(s.addLayer(x),b.getFeatures().length>0){Bv(s,b,this.geojsonBuffer);const t=b.getFeatures()[0].getGeometry();t&&this.dispatch("geojsonDataArea",Nv(t,this.areaUnit))}if(this.drawMode){Xm.clear();const t=Object.keys(this.drawGeojsonData.geometry).length>0;if(t){let t=(new Gs).readFeature(this.drawGeojsonData,{featureProjection:"EPSG:3857"});Xm.addFeature(t),Bv(s,Xm,this.drawGeojsonDataBuffer)}s.addLayer(Km),t||s.addInteraction(c),s.addInteraction(g),s.addInteraction(Ym),Xm.on("change",(()=>{var t;const e=Xm.getFeatures();if(e.length>0){const o=null==(t="string"==typeof(i=e)?i[i.length-1]||"":i[i.length-1])?void 0:t.getGeometry();this.dispatch("geojsonChange",(new Gs).writeFeaturesObject(e,{featureProjection:"EPSG:3857"})),o&&this.dispatch("areaChange",Nv(o,this.areaUnit)),s.removeInteraction(c)}var i}))}if(this.drawMode&&Boolean(this.osVectorTilesApiKey)&&!this.disableVectorTiles){const t=20;if(s.addLayer(Dm),Km.setZIndex(1001),this.zoom<t){Am.clear();const t=s.getView().calculateExtent(s.getSize());Lm(a,t)}s.on("moveend",(()=>{const e=s.getView().getZoom();e&&e<t?Am.clear():setTimeout((()=>{Am.clear();const t=s.getView().calculateExtent(s.getSize());Lm(a,t)}),200)}))}if(this.showFeaturesAtPoint&&Boolean(this.osFeaturesApiKey)){Xv(on([this.longitude,this.latitude]),this.osFeaturesApiKey,!1),this.clickFeatures&&s.on("singleclick",(t=>{Xv(t.coordinate,this.osFeaturesApiKey,!0)}));const t=(k=this.featureColor,w=this.featureFill,new Cd({source:Uv,style:new yl({stroke:new sl({width:3,color:k}),fill:new Ns({color:qv(k,w?.2:0)})})}));s.addLayer(t),Uv.on("change",(()=>{if("ready"===Uv.getState()&&Uv.getFeatures().length>0){Bv(s,Uv,this.featureBuffer),this.dispatch("featuresGeojsonChange",(new Gs).writeFeaturesObject(Uv.getFeatures(),{featureProjection:"EPSG:3857"}));const t=Uv.getFeatures()[0].getGeometry();t&&this.dispatch("featuresAreaChange",Nv(t,this.areaUnit))}}))}var k,w;setTimeout((()=>{window.dispatchEvent(new Event("resize")),e.style.opacity="1",this.dispatch("ready")}),500)}render(){return D(wy||(wy=Cy(zy(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="','" class="map" tabindex="0" />'],"raw",{value:Cy(e||t.slice())}))),this.id);var t,e}disconnectedCallback(){var t;super.disconnectedCallback(),null==(t=this.map)||t.dispose()}},t.MyMap.styles=a(Sy),Ey([st({type:String})],t.MyMap.prototype,"id",2),Ey([st({type:Number})],t.MyMap.prototype,"latitude",2),Ey([st({type:Number})],t.MyMap.prototype,"longitude",2),Ey([st({type:Number})],t.MyMap.prototype,"zoom",2),Ey([st({type:Number})],t.MyMap.prototype,"minZoom",2),Ey([st({type:Number})],t.MyMap.prototype,"maxZoom",2),Ey([st({type:Boolean})],t.MyMap.prototype,"drawMode",2),Ey([st({type:Object})],t.MyMap.prototype,"drawGeojsonData",2),Ey([st({type:Number})],t.MyMap.prototype,"drawGeojsonDataBuffer",2),Ey([st({type:String})],t.MyMap.prototype,"drawPointer",2),Ey([st({type:Boolean})],t.MyMap.prototype,"showFeaturesAtPoint",2),Ey([st({type:Boolean})],t.MyMap.prototype,"clickFeatures",2),Ey([st({type:String})],t.MyMap.prototype,"featureColor",2),Ey([st({type:Boolean})],t.MyMap.prototype,"featureFill",2),Ey([st({type:Number})],t.MyMap.prototype,"featureBuffer",2),Ey([st({type:Object})],t.MyMap.prototype,"geojsonData",2),Ey([st({type:String})],t.MyMap.prototype,"geojsonColor",2),Ey([st({type:Boolean})],t.MyMap.prototype,"geojsonFill",2),Ey([st({type:Number})],t.MyMap.prototype,"geojsonBuffer",2),Ey([st({type:Boolean})],t.MyMap.prototype,"disableVectorTiles",2),Ey([st({type:String})],t.MyMap.prototype,"osVectorTilesApiKey",2),Ey([st({type:String})],t.MyMap.prototype,"osFeaturesApiKey",2),Ey([st({type:String})],t.MyMap.prototype,"osCopyright",2),Ey([st({type:Boolean})],t.MyMap.prototype,"hideResetControl",2),Ey([st({type:Boolean})],t.MyMap.prototype,"staticMode",2),Ey([st({type:String})],t.MyMap.prototype,"areaUnit",2),Ey([st({type:Boolean})],t.MyMap.prototype,"showScale",2),Ey([st({type:Boolean})],t.MyMap.prototype,"useScaleBarStyle",2),t.MyMap=Ey([rt("my-map")],t.MyMap);var Py,Oy={exports:{}};Py=Oy,function(t,e){Py.exports=e()}(window,(function(){return function(t){var e={};function i(o){if(e[o])return e[o].exports;var n=e[o]={i:o,l:!1,exports:{}};return t[o].call(n.exports,n,n.exports,i),n.l=!0,n.exports}return i.m=t,i.c=e,i.d=function(t,e,o){i.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:o})},i.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},i.t=function(t,e){if(1&e&&(t=i(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var o=Object.create(null);if(i.r(o),Object.defineProperty(o,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var n in t)i.d(o,n,function(e){return t[e]}.bind(null,n));return o},i.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return i.d(e,"a",e),e},i.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},i.p="/",i(i.s=37)}([function(t,e,i){var o=i(1),n=i(6),r=i(7),a=i(16),s=i(18),l="prototype",u=function(t,e,i){var p,d,h,c,f=t&u.F,g=t&u.G,m=t&u.S,v=t&u.P,y=t&u.B,_=g?o:m?o[e]||(o[e]={}):(o[e]||{})[l],b=g?n:n[e]||(n[e]={}),x=b[l]||(b[l]={});for(p in g&&(i=e),i)h=((d=!f&&_&&void 0!==_[p])?_:i)[p],c=y&&d?s(h,o):v&&"function"==typeof h?s(Function.call,h):h,_&&a(_,p,h,t&u.U),b[p]!=h&&r(b,p,c),v&&x[p]!=h&&(x[p]=h)};o.core=n,u.F=1,u.G=2,u.S=4,u.P=8,u.B=16,u.W=32,u.U=64,u.R=128,t.exports=u},function(t,e){var i=t.exports="undefined"!=typeof window&&window.Math==Math?window:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")();"number"==typeof __g&&(__g=i)},function(t,e){t.exports=function(t){return"object"==typeof t?null!==t:"function"==typeof t}},function(t,e,i){t.exports=!i(4)((function(){return 7!=Object.defineProperty({},"a",{get:function(){return 7}}).a}))},function(t,e){t.exports=function(t){try{return!!t()}catch(e){return!0}}},function(t,e,i){i.r(e),i.d(e,"h",(function(){return s})),i.d(e,"createElement",(function(){return s})),i.d(e,"cloneElement",(function(){return p})),i.d(e,"Component",(function(){return F})),i.d(e,"render",(function(){return M})),i.d(e,"rerender",(function(){return f})),i.d(e,"options",(function(){return n}));var o=function(){},n={},r=[],a=[];function s(t,e){var i,s,l,u,p=a;for(u=arguments.length;2<u--;)r.push(arguments[u]);for(e&&null!=e.children&&(r.length||r.push(e.children),delete e.children);r.length;)if((s=r.pop())&&void 0!==s.pop)for(u=s.length;u--;)r.push(s[u]);else"boolean"==typeof s&&(s=null),(l="function"!=typeof t)&&(null==s?s="":"number"==typeof s?s=String(s):"string"!=typeof s&&(l=!1)),l&&i?p[p.length-1]+=s:p===a?p=[s]:p.push(s),i=l;var d=new o;return d.nodeName=t,d.children=p,d.attributes=null==e?void 0:e,d.key=null==e?void 0:e.key,void 0!==n.vnode&&n.vnode(d),d}function l(t,e){for(var i in e)t[i]=e[i];return t}var u="function"==typeof Promise?Promise.resolve().then.bind(Promise.resolve()):setTimeout;function p(t,e){return s(t.nodeName,l(l({},t.attributes),e),2<arguments.length?[].slice.call(arguments,2):t.children)}var d=/acit|ex(?:s|g|n|p|$)|rph|ows|mnc|ntw|ine[ch]|zoo|^ord/i,h=[];function c(t){!t._dirty&&(t._dirty=!0)&&1==h.push(t)&&(n.debounceRendering||u)(f)}function f(){var t,e=h;for(h=[];t=e.pop();)t._dirty&&R(t)}function g(t,e){return t.normalizedNodeName===e||t.nodeName.toLowerCase()===e.toLowerCase()}function m(t){var e=l({},t.attributes);e.children=t.children;var i=t.nodeName.defaultProps;if(void 0!==i)for(var o in i)void 0===e[o]&&(e[o]=i[o]);return e}function v(t){var e=t.parentNode;e&&e.removeChild(t)}function y(t,e,i,o,n){if("className"===e&&(e="class"),"key"===e);else if("ref"===e)i&&i(null),o&&o(t);else if("class"!==e||n)if("style"===e){if(o&&"string"!=typeof o&&"string"!=typeof i||(t.style.cssText=o||""),o&&"object"==typeof o){if("string"!=typeof i)for(var r in i)r in o||(t.style[r]="");for(var r in o)t.style[r]="number"==typeof o[r]&&!1===d.test(r)?o[r]+"px":o[r]}}else if("dangerouslySetInnerHTML"===e)o&&(t.innerHTML=o.__html||"");else if("o"==e[0]&&"n"==e[1]){var a=e!==(e=e.replace(/Capture$/,""));e=e.toLowerCase().substring(2),o?i||t.addEventListener(e,_,a):t.removeEventListener(e,_,a),(t._listeners||(t._listeners={}))[e]=o}else if("list"!==e&&"type"!==e&&!n&&e in t){try{t[e]=null==o?"":o}catch(l){}null!=o&&!1!==o||"spellcheck"==e||t.removeAttribute(e)}else{var s=n&&e!==(e=e.replace(/^xlink:?/,""));null==o||!1===o?s?t.removeAttributeNS("http://www.w3.org/1999/xlink",e.toLowerCase()):t.removeAttribute(e):"function"!=typeof o&&(s?t.setAttributeNS("http://www.w3.org/1999/xlink",e.toLowerCase(),o):t.setAttribute(e,o))}else t.className=o||""}function _(t){return this._listeners[t.type](n.event&&n.event(t)||t)}var b=[],x=0,k=!1,w=!1;function S(){for(var t;t=b.pop();)n.afterMount&&n.afterMount(t),t.componentDidMount&&t.componentDidMount()}function C(t,e,i,o,n){var r=t,a=k;if(null!=e&&"boolean"!=typeof e||(e=""),"string"==typeof e||"number"==typeof e)return t&&void 0!==t.splitText&&t.parentNode&&(!t._component||n)?t.nodeValue!=e&&(t.nodeValue=e):(r=document.createTextNode(e),t&&(t.parentNode&&t.parentNode.replaceChild(r,t),z(t,!0))),r.__preactattr_=!0,r;var s,l,u=e.nodeName;if("function"==typeof u)return function(t,e,i,o){for(var n=t&&t._component,r=n,a=t,s=n&&t._componentConstructor===e.nodeName,l=s,u=m(e);n&&!l&&(n=n._parentComponent);)l=n.constructor===e.nodeName;return n&&l&&(!o||n._component)?(j(n,u,3,i,o),t=n.base):(r&&!s&&(I(r),t=a=null),n=P(e.nodeName,u,i),t&&!n.nextBase&&(n.nextBase=t,a=null),j(n,u,1,i,o),t=n.base,a&&t!==a&&(a._component=null,z(a,!1))),t}(t,e,i,o);if(k="svg"===u||"foreignObject"!==u&&k,u=String(u),(!t||!g(t,u))&&(s=u,(l=k?document.createElementNS("http://www.w3.org/2000/svg",s):document.createElement(s)).normalizedNodeName=s,r=l,t)){for(;t.firstChild;)r.appendChild(t.firstChild);t.parentNode&&t.parentNode.replaceChild(r,t),z(t,!0)}var p=r.firstChild,d=r.__preactattr_,h=e.children;if(null==d){d=r.__preactattr_={};for(var c=r.attributes,f=c.length;f--;)d[c[f].name]=c[f].value}return!w&&h&&1===h.length&&"string"==typeof h[0]&&null!=p&&void 0!==p.splitText&&null==p.nextSibling?p.nodeValue!=h[0]&&(p.nodeValue=h[0]):(h&&h.length||null!=p)&&function(t,e,i,o,n){var r,a,s,l,u,p,d,h,c=t.childNodes,f=[],m={},y=0,_=0,b=c.length,x=0,k=e?e.length:0;if(0!==b)for(var w=0;w<b;w++){var S=c[w],T=S.__preactattr_;null!=(E=k&&T?S._component?S._component.__key:T.key:null)?(y++,m[E]=S):(T||(void 0!==S.splitText?!n||S.nodeValue.trim():n))&&(f[x++]=S)}if(0!==k)for(w=0;w<k;w++){var E;if(u=null,null!=(E=(l=e[w]).key))y&&void 0!==m[E]&&(u=m[E],m[E]=void 0,y--);else if(_<x)for(r=_;r<x;r++)if(void 0!==f[r]&&(p=a=f[r],h=n,"string"==typeof(d=l)||"number"==typeof d?void 0!==p.splitText:"string"==typeof d.nodeName?!p._componentConstructor&&g(p,d.nodeName):h||p._componentConstructor===d.nodeName)){u=a,f[r]=void 0,r===x-1&&x--,r===_&&_++;break}u=C(u,l,i,o),s=c[w],u&&u!==t&&u!==s&&(null==s?t.appendChild(u):u===s.nextSibling?v(s):t.insertBefore(u,s))}if(y)for(var w in m)void 0!==m[w]&&z(m[w],!1);for(;_<=x;)void 0!==(u=f[x--])&&z(u,!1)}(r,h,i,o,w||null!=d.dangerouslySetInnerHTML),function(t,e,i){var o;for(o in i)e&&null!=e[o]||null==i[o]||y(t,o,i[o],i[o]=void 0,k);for(o in e)"children"===o||"innerHTML"===o||o in i&&e[o]===("value"===o||"checked"===o?t[o]:i[o])||y(t,o,i[o],i[o]=e[o],k)}(r,e.attributes,d),k=a,r}function z(t,e){var i=t._component;i?I(i):(null!=t.__preactattr_&&t.__preactattr_.ref&&t.__preactattr_.ref(null),!1!==e&&null!=t.__preactattr_||v(t),T(t))}function T(t){for(t=t.lastChild;t;){var e=t.previousSibling;z(t,!0),t=e}}var E=[];function P(t,e,i){var o,n=E.length;for(t.prototype&&t.prototype.render?(o=new t(e,i),F.call(o,e,i)):((o=new F(e,i)).constructor=t,o.render=O);n--;)if(E[n].constructor===t)return o.nextBase=E[n].nextBase,E.splice(n,1),o;return o}function O(t,e,i){return this.constructor(t,i)}function j(t,e,i,o,r){t._disable||(t._disable=!0,t.__ref=e.ref,t.__key=e.key,delete e.ref,delete e.key,void 0===t.constructor.getDerivedStateFromProps&&(!t.base||r?t.componentWillMount&&t.componentWillMount():t.componentWillReceiveProps&&t.componentWillReceiveProps(e,o)),o&&o!==t.context&&(t.prevContext||(t.prevContext=t.context),t.context=o),t.prevProps||(t.prevProps=t.props),t.props=e,t._disable=!1,0!==i&&(1!==i&&!1===n.syncComponentUpdates&&t.base?c(t):R(t,1,r)),t.__ref&&t.__ref(t))}function R(t,e,i,o){if(!t._disable){var r,a,s,u=t.props,p=t.state,d=t.context,h=t.prevProps||u,c=t.prevState||p,f=t.prevContext||d,g=t.base,v=t.nextBase,y=g||v,_=t._component,T=!1,E=f;if(t.constructor.getDerivedStateFromProps&&(p=l(l({},p),t.constructor.getDerivedStateFromProps(u,p)),t.state=p),g&&(t.props=h,t.state=c,t.context=f,2!==e&&t.shouldComponentUpdate&&!1===t.shouldComponentUpdate(u,p,d)?T=!0:t.componentWillUpdate&&t.componentWillUpdate(u,p,d),t.props=u,t.state=p,t.context=d),t.prevProps=t.prevState=t.prevContext=t.nextBase=null,t._dirty=!1,!T){r=t.render(u,p,d),t.getChildContext&&(d=l(l({},d),t.getChildContext())),g&&t.getSnapshotBeforeUpdate&&(E=t.getSnapshotBeforeUpdate(h,c));var O,F,M=r&&r.nodeName;if("function"==typeof M){var A=m(r);(a=_)&&a.constructor===M&&A.key==a.__key?j(a,A,1,d,!1):(O=a,t._component=a=P(M,A,d),a.nextBase=a.nextBase||v,a._parentComponent=t,j(a,A,0,d,!1),R(a,1,i,!0)),F=a.base}else s=y,(O=_)&&(s=t._component=null),(y||1===e)&&(s&&(s._component=null),F=function(t,e,i,o,n,r){x++||(k=null!=n&&void 0!==n.ownerSVGElement,w=null!=t&&!("__preactattr_"in t));var a=C(t,e,i,o,r);return n&&a.parentNode!==n&&n.appendChild(a),--x||(w=!1,r||S()),a}(s,r,d,i||!g,y&&y.parentNode,!0));if(y&&F!==y&&a!==_){var D=y.parentNode;D&&F!==D&&(D.replaceChild(F,y),O||(y._component=null,z(y,!1)))}if(O&&I(O),(t.base=F)&&!o){for(var L=t,G=t;G=G._parentComponent;)(L=G).base=F;F._component=L,F._componentConstructor=L.constructor}}for(!g||i?b.unshift(t):T||(t.componentDidUpdate&&t.componentDidUpdate(h,c,E),n.afterUpdate&&n.afterUpdate(t));t._renderCallbacks.length;)t._renderCallbacks.pop().call(t);x||o||S()}}function I(t){n.beforeUnmount&&n.beforeUnmount(t);var e=t.base;t._disable=!0,t.componentWillUnmount&&t.componentWillUnmount(),t.base=null;var i=t._component;i?I(i):e&&(e.__preactattr_&&e.__preactattr_.ref&&e.__preactattr_.ref(null),v(t.nextBase=e),E.push(t),T(e)),t.__ref&&t.__ref(null)}function F(t,e){this._dirty=!0,this.context=e,this.props=t,this.state=this.state||{},this._renderCallbacks=[]}function M(t,e,i){return function(t,e,i,o,n,r){x++||(k=null!=n&&void 0!==n.ownerSVGElement,w=null!=t&&!("__preactattr_"in t));var a=C(t,e,i,o,r);return n&&a.parentNode!==n&&n.appendChild(a),--x||(w=!1,r||S()),a}(i,t,{},!1,e,!1)}l(F.prototype,{setState:function(t,e){this.prevState||(this.prevState=this.state),this.state=l(l({},this.state),"function"==typeof t?t(this.state,this.props):t),e&&this._renderCallbacks.push(e),c(this)},forceUpdate:function(t){t&&this._renderCallbacks.push(t),R(this,2)},render:function(){}});var A={h:s,createElement:s,cloneElement:p,Component:F,render:M,rerender:f,options:n};e.default=A},function(t,e){var i=t.exports={version:"2.5.7"};"number"==typeof __e&&(__e=i)},function(t,e,i){var o=i(8),n=i(40);t.exports=i(3)?function(t,e,i){return o.f(t,e,n(1,i))}:function(t,e,i){return t[e]=i,t}},function(t,e,i){var o=i(9),n=i(38),r=i(39),a=Object.defineProperty;e.f=i(3)?Object.defineProperty:function(t,e,i){if(o(t),e=r(e,!0),o(i),n)try{return a(t,e,i)}catch(s){}if("get"in i||"set"in i)throw TypeError("Accessors not supported!");return"value"in i&&(t[e]=i.value),t}},function(t,e,i){var o=i(2);t.exports=function(t){if(!o(t))throw TypeError(t+" is not an object!");return t}},function(t,e){var i=0,o=Math.random();t.exports=function(t){return"Symbol(".concat(void 0===t?"":t,")_",(++i+o).toString(36))}},function(t,e,i){var o=i(22);t.exports=Object("z").propertyIsEnumerable(0)?Object:function(t){return"String"==o(t)?t.split(""):Object(t)}},function(t,e){t.exports=function(t){if(null==t)throw TypeError("Can't call method on "+t);return t}},function(t,e,i){var o=i(4);t.exports=function(t,e){return!!t&&o((function(){e?t.call(null,(function(){}),1):t.call(null)}))}},function(t,e,i){var o=i(0);o(o.S+o.F,"Object",{assign:i(41)})},function(t,e,i){var o=i(2),n=i(1).document,r=o(n)&&o(n.createElement);t.exports=function(t){return r?n.createElement(t):{}}},function(t,e,i){var o=i(1),n=i(7),r=i(17),a=i(10)("src"),s="toString",l=Function[s],u=(""+l).split(s);i(6).inspectSource=function(t){return l.call(t)},(t.exports=function(t,e,i,s){var l="function"==typeof i;l&&(r(i,"name")||n(i,"name",e)),t[e]!==i&&(l&&(r(i,a)||n(i,a,t[e]?""+t[e]:u.join(String(e)))),t===o?t[e]=i:s?t[e]?t[e]=i:n(t,e,i):(delete t[e],n(t,e,i)))})(Function.prototype,s,(function(){return"function"==typeof this&&this[a]||l.call(this)}))},function(t,e){var i={}.hasOwnProperty;t.exports=function(t,e){return i.call(t,e)}},function(t,e,i){var o=i(19);t.exports=function(t,e,i){if(o(t),void 0===e)return t;switch(i){case 1:return function(i){return t.call(e,i)};case 2:return function(i,o){return t.call(e,i,o)};case 3:return function(i,o,n){return t.call(e,i,o,n)}}return function(){return t.apply(e,arguments)}}},function(t,e){t.exports=function(t){if("function"!=typeof t)throw TypeError(t+" is not a function!");return t}},function(t,e,i){var o=i(42),n=i(28);t.exports=Object.keys||function(t){return o(t,n)}},function(t,e,i){var o=i(11),n=i(12);t.exports=function(t){return o(n(t))}},function(t,e){var i={}.toString;t.exports=function(t){return i.call(t).slice(8,-1)}},function(t,e,i){var o=i(21),n=i(24),r=i(43);t.exports=function(t){return function(e,i,a){var s,l=o(e),u=n(l.length),p=r(a,u);if(t&&i!=i){for(;p<u;)if((s=l[p++])!=s)return!0}else for(;p<u;p++)if((t||p in l)&&l[p]===i)return t||p||0;return!t&&-1}}},function(t,e,i){var o=i(25),n=Math.min;t.exports=function(t){return 0<t?n(o(t),9007199254740991):0}},function(t,e){var i=Math.ceil,o=Math.floor;t.exports=function(t){return isNaN(t=+t)?0:(0<t?o:i)(t)}},function(t,e,i){var o=i(27)("keys"),n=i(10);t.exports=function(t){return o[t]||(o[t]=n(t))}},function(t,e,i){var o=i(6),n=i(1),r="__core-js_shared__",a=n[r]||(n[r]={});(t.exports=function(t,e){return a[t]||(a[t]=void 0!==e?e:{})})("versions",[]).push({version:o.version,mode:i(44)?"pure":"global",copyright:"© 2018 Denis Pushkarev (zloirock.ru)"})},function(t,e){t.exports="constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf".split(",")},function(t,e,i){var o=i(12);t.exports=function(t){return Object(o(t))}},function(t,e,i){var o=i(8).f,n=Function.prototype,r=/^\s*function ([^ (]*)/;"name"in n||i(3)&&o(n,"name",{configurable:!0,get:function(){try{return(""+this).match(r)[1]}catch(t){return""}}})},function(t,e,i){var o=i(0),n=i(32)(1);o(o.P+o.F*!i(13)([].map,!0),"Array",{map:function(t){return n(this,t,arguments[1])}})},function(t,e,i){var o=i(18),n=i(11),r=i(29),a=i(24),s=i(47);t.exports=function(t,e){var i=1==t,l=2==t,u=3==t,p=4==t,d=6==t,h=5==t||d,c=e||s;return function(e,s,f){for(var g,m,v=r(e),y=n(v),_=o(s,f,3),b=a(y.length),x=0,k=i?c(e,b):l?c(e,0):void 0;x<b;x++)if((h||x in y)&&(m=_(g=y[x],x,v),t))if(i)k[x]=m;else if(m)switch(t){case 3:return!0;case 5:return g;case 6:return x;case 2:k.push(g)}else if(p)return!1;return d?-1:u||p?p:k}}},function(t,e,i){var o=i(22);t.exports=Array.isArray||function(t){return"Array"==o(t)}},function(t,e,i){var o=i(27)("wks"),n=i(10),r=i(1).Symbol,a="function"==typeof r;(t.exports=function(t){return o[t]||(o[t]=a&&r[t]||(a?r:n)("Symbol."+t))}).store=o},function(t,e,i){var o=i(0),n=i(23)(!1),r=[].indexOf,a=!!r&&1/[1].indexOf(1,-0)<0;o(o.P+o.F*(a||!i(13)(r)),"Array",{indexOf:function(t){return a?r.apply(this,arguments)||0:n(this,t,arguments[1])}})},function(t,e,i){var o=i(0);o(o.S,"Object",{create:i(52)})},function(t,e,i){e.__esModule=!0,e.default=void 0,i(14),i(30),i(31),i(35),i(49),i(50);var o,n=i(5),r=(o=i(51))&&o.__esModule?o:{default:o};function a(t){if(!t.element)throw new Error("element is not defined");if(!t.id)throw new Error("id is not defined");if(!t.source)throw new Error("source is not defined");Array.isArray(t.source)&&(t.source=s(t.source)),(0,n.render)((0,n.createElement)(r.default,t),t.element)}var s=function(t){return function(e,i){i(t.filter((function(t){return-1!==t.toLowerCase().indexOf(e.toLowerCase())})))}};a.enhanceSelectElement=function(t){if(!t.selectElement)throw new Error("selectElement is not defined");if(!t.source){var e=[].filter.call(t.selectElement.options,(function(e){return e.value||t.preserveNullOptions}));t.source=e.map((function(t){return t.textContent||t.innerText}))}if(t.onConfirm=t.onConfirm||function(e){var i=[].filter.call(t.selectElement.options,(function(t){return(t.textContent||t.innerText)===e}))[0];i&&(i.selected=!0)},t.selectElement.value||void 0===t.defaultValue){var i=t.selectElement.options[t.selectElement.options.selectedIndex];t.defaultValue=i.textContent||i.innerText}void 0===t.name&&(t.name=""),void 0===t.id&&(void 0===t.selectElement.id?t.id="":t.id=t.selectElement.id),void 0===t.autoselect&&(t.autoselect=!0);var o=document.createElement("div");t.selectElement.parentNode.insertBefore(o,t.selectElement),a(Object.assign({},t,{element:o})),t.selectElement.style.display="none",t.selectElement.id=t.selectElement.id+"-select"};var l=a;e.default=l},function(t,e,i){t.exports=!i(3)&&!i(4)((function(){return 7!=Object.defineProperty(i(15)("div"),"a",{get:function(){return 7}}).a}))},function(t,e,i){var o=i(2);t.exports=function(t,e){if(!o(t))return t;var i,n;if(e&&"function"==typeof(i=t.toString)&&!o(n=i.call(t)))return n;if("function"==typeof(i=t.valueOf)&&!o(n=i.call(t)))return n;if(!e&&"function"==typeof(i=t.toString)&&!o(n=i.call(t)))return n;throw TypeError("Can't convert object to primitive value")}},function(t,e){t.exports=function(t,e){return{enumerable:!(1&t),configurable:!(2&t),writable:!(4&t),value:e}}},function(t,e,i){var o=i(20),n=i(45),r=i(46),a=i(29),s=i(11),l=Object.assign;t.exports=!l||i(4)((function(){var t={},e={},i=Symbol(),o="abcdefghijklmnopqrst";return t[i]=7,o.split("").forEach((function(t){e[t]=t})),7!=l({},t)[i]||Object.keys(l({},e)).join("")!=o}))?function(t,e){for(var i=a(t),l=arguments.length,u=1,p=n.f,d=r.f;u<l;)for(var h,c=s(arguments[u++]),f=p?o(c).concat(p(c)):o(c),g=f.length,m=0;m<g;)d.call(c,h=f[m++])&&(i[h]=c[h]);return i}:l},function(t,e,i){var o=i(17),n=i(21),r=i(23)(!1),a=i(26)("IE_PROTO");t.exports=function(t,e){var i,s=n(t),l=0,u=[];for(i in s)i!=a&&o(s,i)&&u.push(i);for(;e.length>l;)o(s,i=e[l++])&&(~r(u,i)||u.push(i));return u}},function(t,e,i){var o=i(25),n=Math.max,r=Math.min;t.exports=function(t,e){return(t=o(t))<0?n(t+e,0):r(t,e)}},function(t,e){t.exports=!1},function(t,e){e.f=Object.getOwnPropertySymbols},function(t,e){e.f={}.propertyIsEnumerable},function(t,e,i){var o=i(48);t.exports=function(t,e){return new(o(t))(e)}},function(t,e,i){var o=i(2),n=i(33),r=i(34)("species");t.exports=function(t){var e;return n(t)&&("function"!=typeof(e=t.constructor)||e!==Array&&!n(e.prototype)||(e=void 0),o(e)&&null===(e=e[r])&&(e=void 0)),void 0===e?Array:e}},function(t,e,i){var o=i(0),n=i(32)(2);o(o.P+o.F*!i(13)([].filter,!0),"Array",{filter:function(t){return n(this,t,arguments[1])}})},function(t,e,i){var o=i(0);o(o.S,"Array",{isArray:i(33)})},function(t,e,i){e.__esModule=!0,e.default=void 0,i(14),i(36),i(30),i(31),i(35),i(55),i(58);var o=i(5),n=a(i(60)),r=a(i(61));function a(t){return t&&t.__esModule?t:{default:t}}function s(){return(s=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var i=arguments[e];for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(t[o]=i[o])}return t}).apply(this,arguments)}function l(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}var u={13:"enter",27:"escape",32:"space",38:"up",40:"down"};function p(){return"undefined"!=typeof navigator&&!(!navigator.userAgent.match(/(iPod|iPhone|iPad)/g)||!navigator.userAgent.match(/AppleWebKit/g))}var d=function(t){function e(e){var i;return(i=t.call(this,e)||this).elementReferences={},i.state={focused:null,hovered:null,menuOpen:!1,options:e.defaultValue?[e.defaultValue]:[],query:e.defaultValue,validChoiceMade:!1,selected:null,ariaHint:!0},i.handleComponentBlur=i.handleComponentBlur.bind(l(l(i))),i.handleKeyDown=i.handleKeyDown.bind(l(l(i))),i.handleUpArrow=i.handleUpArrow.bind(l(l(i))),i.handleDownArrow=i.handleDownArrow.bind(l(l(i))),i.handleEnter=i.handleEnter.bind(l(l(i))),i.handlePrintableKey=i.handlePrintableKey.bind(l(l(i))),i.handleListMouseLeave=i.handleListMouseLeave.bind(l(l(i))),i.handleOptionBlur=i.handleOptionBlur.bind(l(l(i))),i.handleOptionClick=i.handleOptionClick.bind(l(l(i))),i.handleOptionFocus=i.handleOptionFocus.bind(l(l(i))),i.handleOptionMouseDown=i.handleOptionMouseDown.bind(l(l(i))),i.handleOptionMouseEnter=i.handleOptionMouseEnter.bind(l(l(i))),i.handleInputBlur=i.handleInputBlur.bind(l(l(i))),i.handleInputChange=i.handleInputChange.bind(l(l(i))),i.handleInputFocus=i.handleInputFocus.bind(l(l(i))),i.pollInputElement=i.pollInputElement.bind(l(l(i))),i.getDirectInputChanges=i.getDirectInputChanges.bind(l(l(i))),i}var i,r;r=t,(i=e).prototype=Object.create(r.prototype),(i.prototype.constructor=i).__proto__=r;var a=e.prototype;return a.isQueryAnOption=function(t,e){var i=this;return-1!==e.map((function(t){return i.templateInputValue(t).toLowerCase()})).indexOf(t.toLowerCase())},a.componentDidMount=function(){this.pollInputElement()},a.componentWillUnmount=function(){clearTimeout(this.$pollInput)},a.pollInputElement=function(){var t=this;this.getDirectInputChanges(),this.$pollInput=setTimeout((function(){t.pollInputElement()}),100)},a.getDirectInputChanges=function(){var t=this.elementReferences[-1];t&&t.value!==this.state.query&&this.handleInputChange({target:{value:t.value}})},a.componentDidUpdate=function(t,e){var i=this.state.focused,o=null===i,n=e.focused!==i;n&&!o&&this.elementReferences[i].focus();var r=-1===i,a=n&&null===e.focused;if(r&&a){var s=this.elementReferences[i];s.setSelectionRange(0,s.value.length)}},a.hasAutoselect=function(){return!p()&&this.props.autoselect},a.templateInputValue=function(t){var e=this.props.templates&&this.props.templates.inputValue;return e?e(t):t},a.templateSuggestion=function(t){var e=this.props.templates&&this.props.templates.suggestion;return e?e(t):t},a.handleComponentBlur=function(t){var e,i=this.state,o=i.options,n=i.query,r=i.selected;this.props.confirmOnBlur?(e=t.query||n,this.props.onConfirm(o[r])):e=n,this.setState({focused:null,menuOpen:t.menuOpen||!1,query:e,selected:null,validChoiceMade:this.isQueryAnOption(e,o)})},a.handleListMouseLeave=function(t){this.setState({hovered:null})},a.handleOptionBlur=function(t,e){var i=this.state,o=i.focused,n=i.menuOpen,r=i.options,a=i.selected,s=null===t.relatedTarget,l=t.relatedTarget===this.elementReferences[-1],u=o!==e&&-1!==o;if(!u&&s||!u&&!l){var d=n&&p();this.handleComponentBlur({menuOpen:d,query:this.templateInputValue(r[a])})}},a.handleInputBlur=function(t){var e=this.state,i=e.focused,o=e.menuOpen,n=e.options,r=e.query,a=e.selected;if(-1===i){var s=o&&p(),l=p()?r:this.templateInputValue(n[a]);this.handleComponentBlur({menuOpen:s,query:l})}},a.handleInputChange=function(t){var e=this,i=this.props,o=i.minLength,n=i.source,r=i.showAllValues,a=this.hasAutoselect(),s=t.target.value,l=0===s.length,u=this.state.query.length!==s.length,p=s.length>=o;this.setState({query:s,ariaHint:l}),r||!l&&u&&p?n(s,(function(t){var i=0<t.length;e.setState({menuOpen:i,options:t,selected:a&&i?0:-1,validChoiceMade:!1})})):!l&&p||this.setState({menuOpen:!1,options:[]})},a.handleInputClick=function(t){this.handleInputChange(t)},a.handleInputFocus=function(t){var e=this.state,i=e.query,o=e.validChoiceMade,n=e.options,r=this.props.minLength,a=!o&&i.length>=r&&0<n.length;a?this.setState((function(t){var e=t.menuOpen;return{focused:-1,menuOpen:a||e,selected:-1}})):this.setState({focused:-1})},a.handleOptionFocus=function(t){this.setState({focused:t,hovered:null,selected:t})},a.handleOptionMouseEnter=function(t,e){p()||this.setState({hovered:e})},a.handleOptionClick=function(t,e){var i=this.state.options[e],o=this.templateInputValue(i);this.props.onConfirm(i),this.setState({focused:-1,hovered:null,menuOpen:!1,query:o,selected:-1,validChoiceMade:!0}),this.forceUpdate()},a.handleOptionMouseDown=function(t){t.preventDefault()},a.handleUpArrow=function(t){t.preventDefault();var e=this.state,i=e.menuOpen,o=e.selected;-1!==o&&i&&this.handleOptionFocus(o-1)},a.handleDownArrow=function(t){var e=this;if(t.preventDefault(),this.props.showAllValues&&!1===this.state.menuOpen)t.preventDefault(),this.props.source("",(function(t){e.setState({menuOpen:!0,options:t,selected:0,focused:0,hovered:null})}));else if(!0===this.state.menuOpen){var i=this.state,o=i.menuOpen,n=i.options,r=i.selected;r!==n.length-1&&o&&this.handleOptionFocus(r+1)}},a.handleSpace=function(t){var e=this;this.props.showAllValues&&!1===this.state.menuOpen&&""===this.state.query&&(t.preventDefault(),this.props.source("",(function(t){e.setState({menuOpen:!0,options:t})}))),-1!==this.state.focused&&(t.preventDefault(),this.handleOptionClick(t,this.state.focused))},a.handleEnter=function(t){this.state.menuOpen&&(t.preventDefault(),0<=this.state.selected&&this.handleOptionClick(t,this.state.selected))},a.handlePrintableKey=function(t){var e=this.elementReferences[-1];t.target===e||e.focus()},a.handleKeyDown=function(t){switch(u[t.keyCode]){case"up":this.handleUpArrow(t);break;case"down":this.handleDownArrow(t);break;case"space":this.handleSpace(t);break;case"enter":this.handleEnter(t);break;case"escape":this.handleComponentBlur({query:this.state.query});break;default:(47<(e=t.keyCode)&&e<58||32===e||8===e||64<e&&e<91||95<e&&e<112||185<e&&e<193||218<e&&e<223)&&this.handlePrintableKey(t)}var e},a.render=function(){var t,e=this,i=this.props,r=i.cssNamespace,a=i.displayMenu,l=i.id,u=i.minLength,d=i.name,h=i.placeholder,c=i.required,f=i.showAllValues,g=i.tNoResults,m=i.tStatusQueryTooShort,v=i.tStatusNoResults,y=i.tStatusSelectedOption,_=i.tStatusResults,b=i.tAssistiveHint,x=i.dropdownArrow,k=this.state,w=k.focused,S=k.hovered,C=k.menuOpen,z=k.options,T=k.query,E=k.selected,P=k.ariaHint,O=k.validChoiceMade,j=this.hasAutoselect(),R=-1===w,I=0===z.length,F=0!==T.length,M=T.length>=u,A=this.props.showNoOptionsFound&&R&&I&&F&&M,D=r+"__wrapper",L=r+"__input",G=null!==w?" "+L+"--focused":"",N=this.props.showAllValues?" "+L+"--show-all-values":" "+L+"--default",B=r+"__dropdown-arrow-down",q=-1!==w&&null!==w,W=r+"__menu",V=W+"--"+a,U=W+"--"+(C||A?"visible":"hidden"),X=r+"__option",K=r+"__hint",Y=this.templateInputValue(z[E]),Z=Y&&0===Y.toLowerCase().indexOf(T.toLowerCase())&&j?T+Y.substr(T.length):"",H=l+"__assistiveHint",$=P?{"aria-describedby":H}:null;return f&&"string"==typeof(t=x({className:B}))&&(t=(0,o.createElement)("div",{className:r+"__dropdown-arrow-down-wrapper",dangerouslySetInnerHTML:{__html:t}})),(0,o.createElement)("div",{className:D,onKeyDown:this.handleKeyDown},(0,o.createElement)(n.default,{id:l,length:z.length,queryLength:T.length,minQueryLength:u,selectedOption:this.templateInputValue(z[E]),selectedOptionIndex:E,validChoiceMade:O,isInFocus:null!==this.state.focused,tQueryTooShort:m,tNoResults:v,tSelectedOption:y,tResults:_}),Z&&(0,o.createElement)("span",null,(0,o.createElement)("input",{className:K,readonly:!0,tabIndex:"-1",value:Z})),(0,o.createElement)("input",s({"aria-expanded":C?"true":"false","aria-activedescendant":!!q&&l+"__option--"+w,"aria-owns":l+"__listbox","aria-autocomplete":this.hasAutoselect()?"both":"list"},$,{autoComplete:"off",className:""+L+G+N,id:l,onClick:function(t){return e.handleInputClick(t)},onBlur:this.handleInputBlur},{onInput:this.handleInputChange},{onFocus:this.handleInputFocus,name:d,placeholder:h,ref:function(t){e.elementReferences[-1]=t},type:"text",role:"combobox",required:c,value:T})),t,(0,o.createElement)("ul",{className:W+" "+V+" "+U,onMouseLeave:function(t){return e.handleListMouseLeave(t)},id:l+"__listbox",role:"listbox"},z.map((function(t,i){var n=(-1===w?E===i:w===i)&&null===S?" "+X+"--focused":"",r=i%2?" "+X+"--odd":"",a=p()?"<span id="+l+"__option-suffix--"+i+' style="border:0;clip:rect(0 0 0 0);height:1px;marginBottom:-1px;marginRight:-1px;overflow:hidden;padding:0;position:absolute;whiteSpace:nowrap;width:1px"> '+(i+1)+" of "+z.length+"</span>":"";return(0,o.createElement)("li",{"aria-selected":w===i?"true":"false",className:""+X+n+r,dangerouslySetInnerHTML:{__html:e.templateSuggestion(t)+a},id:l+"__option--"+i,key:i,onBlur:function(t){return e.handleOptionBlur(t,i)},onClick:function(t){return e.handleOptionClick(t,i)},onMouseDown:e.handleOptionMouseDown,onMouseEnter:function(t){return e.handleOptionMouseEnter(t,i)},ref:function(t){e.elementReferences[i]=t},role:"option",tabIndex:"-1","aria-posinset":i+1,"aria-setsize":z.length})})),A&&(0,o.createElement)("li",{className:X+" "+X+"--no-results"},g())),(0,o.createElement)("span",{id:H,style:{display:"none"}},b()))},e}(o.Component);(e.default=d).defaultProps={autoselect:!1,cssNamespace:"autocomplete",defaultValue:"",displayMenu:"inline",minLength:0,name:"input-autocomplete",placeholder:"",onConfirm:function(){},confirmOnBlur:!0,showNoOptionsFound:!0,showAllValues:!1,required:!1,tNoResults:function(){return"No results found"},tAssistiveHint:function(){return"When autocomplete results are available use up and down arrows to review and enter to select. Touch device users, explore by touch or with swipe gestures."},dropdownArrow:r.default}},function(t,e,i){var o=i(9),n=i(53),r=i(28),a=i(26)("IE_PROTO"),s=function(){},l="prototype",u=function(){var t,e=i(15)("iframe"),o=r.length;for(e.style.display="none",i(54).appendChild(e),e.src="javascript:",(t=e.contentWindow.document).open(),t.write("<script>document.F=Object<\/script>"),t.close(),u=t.F;o--;)delete u[l][r[o]];return u()};t.exports=Object.create||function(t,e){var i;return null!==t?(s[l]=o(t),i=new s,s[l]=null,i[a]=t):i=u(),void 0===e?i:n(i,e)}},function(t,e,i){var o=i(8),n=i(9),r=i(20);t.exports=i(3)?Object.defineProperties:function(t,e){n(t);for(var i,a=r(e),s=a.length,l=0;l<s;)o.f(t,i=a[l++],e[i]);return t}},function(t,e,i){var o=i(1).document;t.exports=o&&o.documentElement},function(t,e,i){var o=i(0);o(o.P,"Function",{bind:i(56)})},function(t,e,i){var o=i(19),n=i(2),r=i(57),a=[].slice,s={};t.exports=Function.bind||function(t){var e=o(this),i=a.call(arguments,1),l=function(){var o=i.concat(a.call(arguments));return this instanceof l?function(t,e,i){if(!(e in s)){for(var o=[],n=0;n<e;n++)o[n]="a["+n+"]";s[e]=Function("F,a","return new F("+o.join(",")+")")}return s[e](t,i)}(e,o.length,o):r(e,o,t)};return n(e.prototype)&&(l.prototype=e.prototype),l}},function(t,e){t.exports=function(t,e,i){var o=void 0===i;switch(e.length){case 0:return o?t():t.call(i);case 1:return o?t(e[0]):t.call(i,e[0]);case 2:return o?t(e[0],e[1]):t.call(i,e[0],e[1]);case 3:return o?t(e[0],e[1],e[2]):t.call(i,e[0],e[1],e[2]);case 4:return o?t(e[0],e[1],e[2],e[3]):t.call(i,e[0],e[1],e[2],e[3])}return t.apply(i,e)}},function(t,e,i){i(59)("match",1,(function(t,e,i){return[function(i){var o=t(this),n=null==i?void 0:i[e];return void 0!==n?n.call(i,o):new RegExp(i)[e](String(o))},i]}))},function(t,e,i){var o=i(7),n=i(16),r=i(4),a=i(12),s=i(34);t.exports=function(t,e,i){var l=s(t),u=i(a,l,""[t]),p=u[0],d=u[1];r((function(){var e={};return e[l]=function(){return 7},7!=""[t](e)}))&&(n(String.prototype,t,p),o(RegExp.prototype,l,2==e?function(t,e){return d.call(t,this,e)}:function(t){return d.call(t,this)}))}},function(t,e,i){e.__esModule=!0,e.default=void 0,i(36);var o=i(5),n=function(t){function e(){for(var e,i=arguments.length,o=new Array(i),n=0;n<i;n++)o[n]=arguments[n];return(e=t.call.apply(t,[this].concat(o))||this).state={bump:!1,debounced:!1},e}var i,n;n=t,(i=e).prototype=Object.create(n.prototype),(i.prototype.constructor=i).__proto__=n;var r=e.prototype;return r.componentWillMount=function(){var t=this;this.debounceStatusUpdate=function(t,e,i){var o;return function(){var n=this,r=arguments,a=function(){o=null,i||t.apply(n,r)},s=i&&!o;clearTimeout(o),o=setTimeout(a,e),s&&t.apply(n,r)}}((function(){if(!t.state.debounced){var e=!t.props.isInFocus||t.props.validChoiceMade;t.setState((function(t){return{bump:!t.bump,debounced:!0,silenced:e}}))}}),1400)},r.componentWillReceiveProps=function(t){t.queryLength,this.setState({debounced:!1})},r.render=function(){var t,e=this.props,i=e.id,n=e.length,r=e.queryLength,a=e.minQueryLength,s=e.selectedOption,l=e.selectedOptionIndex,u=e.tQueryTooShort,p=e.tNoResults,d=e.tSelectedOption,h=e.tResults,c=this.state,f=c.bump,g=c.debounced,m=c.silenced,v=r<a,y=0===n,_=s?d(s,n,l):"";return t=v?u(a):y?p():h(n,_),this.debounceStatusUpdate(),(0,o.createElement)("div",{style:{border:"0",clip:"rect(0 0 0 0)",height:"1px",marginBottom:"-1px",marginRight:"-1px",overflow:"hidden",padding:"0",position:"absolute",whiteSpace:"nowrap",width:"1px"}},(0,o.createElement)("div",{id:i+"__status--A",role:"status","aria-atomic":"true","aria-live":"polite"},!m&&g&&f?t:""),(0,o.createElement)("div",{id:i+"__status--B",role:"status","aria-atomic":"true","aria-live":"polite"},m||!g||f?"":t))},e}(o.Component);(e.default=n).defaultProps={tQueryTooShort:function(t){return"Type in "+t+" or more characters for results"},tNoResults:function(){return"No search results"},tSelectedOption:function(t,e,i){return t+" "+(i+1)+" of "+e+" is highlighted"},tResults:function(t,e){return t+" "+(1===t?"result":"results")+" "+(1===t?"is":"are")+" available. "+e}}},function(t,e,i){e.__esModule=!0,e.default=void 0;var o=i(5);e.default=function(t){var e=t.className;return(0,o.createElement)("svg",{version:"1.1",xmlns:"http://www.w3.org/2000/svg",className:e,focusable:"false"},(0,o.createElement)("g",{stroke:"none",fill:"none","fill-rule":"evenodd"},(0,o.createElement)("polygon",{fill:"#000000",points:"0 0 22 0 11 17"})))}}]).default}));var jy,Ry,Iy=kl(Oy.exports),Fy=s`@charset "UTF-8";
|
370
|
+
}`,Cy=Object.freeze,zy=Object.defineProperty,Ty=Object.getOwnPropertyDescriptor,Ey=(t,e,i,o)=>{for(var n,r=o>1?void 0:o?Ty(e,i):e,a=t.length-1;a>=0;a--)(n=t[a])&&(r=(o?n(e,i,r):n(r))||r);return o&&r&&zy(e,i,r),r};t.MyMap=class extends nt{constructor(){super(),this.id="map",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=this.renderRoot.querySelector(`#${this.id}`),i=!this.disableVectorTiles&&Boolean(this.osVectorTilesApiKey),o=(n=this.osCopyright,r=this.osVectorTilesApiKey,new jc({source:r?new Om({url:"https://api.os.uk/maps/raster/v1/zxy/Light_3857/{z}/{x}/{y}.png?key="+r,attributions:[n],attributionsCollapsible:!1,maxZoom:20}):new Im({attributions:[Rm]})}));var n,r;const a=function(t,e){let i=new Oh({declutter:!0,source:new pc({format:new Ql,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=>ky(i,t,"esri"))).catch((t=>console.log(t))),i}(this.osCopyright,this.osVectorTilesApiKey),s=new cc({target:e,layers:[i?a:o],view:new Ya({projection:"EPSG:3857",extent:(u=[-10.76418,49.528423,1.9134116,61.331151],p="EPSG:4326",d="EPSG:3857",Eo(u,an(p,d),void 0,h)),minZoom:this.minZoom,maxZoom:this.maxZoom,center:on([this.longitude,this.latitude]),zoom:this.zoom,enableRotation:!1}),controls:us({attribution:!0,zoom:!this.staticMode}).extend(this.showScale?[(l=this.useScaleBarStyle,new ls({units:"metric",bar:l,steps:4,text:!0,minWidth:140}))]:[]),interactions:ch({doubleClickZoom:!this.staticMode,dragPan:!this.staticMode,mouseWheelZoom:!this.staticMode})});var l,u,p,d,h;this.map=s;const c=(f=this.drawPointer,new Jd({source:Xm,type:"Polygon",style:new yl({stroke:Bm,fill:qm,image:"crosshair"===f?Wm:Vm})}));var f;const g=function(t){return new lh({source:Xm,style:new yl({image:"crosshair"===t?Wm:Vm})})}(this.drawPointer),m=document.createElement("button");m.innerHTML="↻",m.title="Reset map view";m.addEventListener("click",(()=>{this.showFeaturesAtPoint?Bv(s,Uv,this.featureBuffer):b.getFeatures().length>0?Bv(s,b,this.geojsonBuffer):(s.getView().setCenter(on([this.longitude,this.latitude])),s.getView().setZoom(this.zoom)),this.drawMode&&(Xm.clear(),this.dispatch("geojsonChange",{}),this.dispatch("areaChange",`0 ${"m2"===this.areaUnit?"m²":this.areaUnit}`),s.addInteraction(c),s.addInteraction(Ym))}),!1);const v=document.createElement("div");v.className="reset-control ol-unselectable ol-control",v.appendChild(m);var y=new he({element:v});this.hideResetControl||s.addControl(y);const _=null==(t=this.renderRoot)?void 0:t.querySelectorAll(".ol-control button");null==_||_.forEach((t=>t.setAttribute("aria-label",t.getAttribute("title")||""))),s.on("pointerdrag",(()=>{s.getViewport().style.cursor="grabbing"})),s.on("pointermove",(()=>{s.getViewport().style.cursor="grab"}));const b=new qd;if("FeatureCollection"===this.geojsonData.type){let t=(new Gs).readFeatures(this.geojsonData,{featureProjection:"EPSG:3857"});b.addFeatures(t)}else if("Feature"===this.geojsonData.type){let t=(new Gs).readFeature(this.geojsonData,{featureProjection:"EPSG:3857"});b.addFeature(t)}const x=new Cd({source:b,style:new yl({stroke:new sl({color:this.geojsonColor,width:3}),fill:new Ns({color:this.geojsonFill?qv(this.geojsonColor,.2):qv(this.geojsonColor,0)})})});if(s.addLayer(x),b.getFeatures().length>0){Bv(s,b,this.geojsonBuffer);const t=b.getFeatures()[0].getGeometry();t&&this.dispatch("geojsonDataArea",Nv(t,this.areaUnit))}if(this.drawMode){Xm.clear();const t=Object.keys(this.drawGeojsonData.geometry).length>0;if(t){let t=(new Gs).readFeature(this.drawGeojsonData,{featureProjection:"EPSG:3857"});Xm.addFeature(t),Bv(s,Xm,this.drawGeojsonDataBuffer)}s.addLayer(Km),t||s.addInteraction(c),s.addInteraction(g),s.addInteraction(Ym),Xm.on("change",(()=>{var t;const e=Xm.getFeatures();if(e.length>0){const o=null==(t="string"==typeof(i=e)?i[i.length-1]||"":i[i.length-1])?void 0:t.getGeometry();this.dispatch("geojsonChange",(new Gs).writeFeaturesObject(e,{featureProjection:"EPSG:3857"})),o&&this.dispatch("areaChange",Nv(o,this.areaUnit)),s.removeInteraction(c)}var i}))}if(this.drawMode&&Boolean(this.osVectorTilesApiKey)&&!this.disableVectorTiles){const t=20;if(s.addLayer(Dm),Km.setZIndex(1001),this.zoom<t){Am.clear();const t=s.getView().calculateExtent(s.getSize());Lm(a,t)}s.on("moveend",(()=>{const e=s.getView().getZoom();e&&e<t?Am.clear():setTimeout((()=>{Am.clear();const t=s.getView().calculateExtent(s.getSize());Lm(a,t)}),200)}))}if(this.showFeaturesAtPoint&&Boolean(this.osFeaturesApiKey)){Xv(on([this.longitude,this.latitude]),this.osFeaturesApiKey,!1),this.clickFeatures&&s.on("singleclick",(t=>{Xv(t.coordinate,this.osFeaturesApiKey,!0)}));const t=(k=this.featureColor,w=this.featureFill,new Cd({source:Uv,style:new yl({stroke:new sl({width:3,color:k}),fill:new Ns({color:qv(k,w?.2:0)})})}));s.addLayer(t),Uv.on("change",(()=>{if("ready"===Uv.getState()&&Uv.getFeatures().length>0){Bv(s,Uv,this.featureBuffer),this.dispatch("featuresGeojsonChange",(new Gs).writeFeaturesObject(Uv.getFeatures(),{featureProjection:"EPSG:3857"}));const t=Uv.getFeatures()[0].getGeometry();t&&this.dispatch("featuresAreaChange",Nv(t,this.areaUnit))}}))}var k,w;setTimeout((()=>{window.dispatchEvent(new Event("resize")),e.style.opacity="1",this.dispatch("ready")}),500)}render(){return D(wy||(wy=Cy(zy(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="','" class="map" tabindex="0" />'],"raw",{value:Cy(e||t.slice())}))),this.id);var t,e}disconnectedCallback(){var t;super.disconnectedCallback(),null==(t=this.map)||t.dispose()}},t.MyMap.styles=a(Sy),Ey([st({type:String})],t.MyMap.prototype,"id",2),Ey([st({type:Number})],t.MyMap.prototype,"latitude",2),Ey([st({type:Number})],t.MyMap.prototype,"longitude",2),Ey([st({type:Number})],t.MyMap.prototype,"zoom",2),Ey([st({type:Number})],t.MyMap.prototype,"minZoom",2),Ey([st({type:Number})],t.MyMap.prototype,"maxZoom",2),Ey([st({type:Boolean})],t.MyMap.prototype,"drawMode",2),Ey([st({type:Object})],t.MyMap.prototype,"drawGeojsonData",2),Ey([st({type:Number})],t.MyMap.prototype,"drawGeojsonDataBuffer",2),Ey([st({type:String})],t.MyMap.prototype,"drawPointer",2),Ey([st({type:Boolean})],t.MyMap.prototype,"showFeaturesAtPoint",2),Ey([st({type:Boolean})],t.MyMap.prototype,"clickFeatures",2),Ey([st({type:String})],t.MyMap.prototype,"featureColor",2),Ey([st({type:Boolean})],t.MyMap.prototype,"featureFill",2),Ey([st({type:Number})],t.MyMap.prototype,"featureBuffer",2),Ey([st({type:Object})],t.MyMap.prototype,"geojsonData",2),Ey([st({type:String})],t.MyMap.prototype,"geojsonColor",2),Ey([st({type:Boolean})],t.MyMap.prototype,"geojsonFill",2),Ey([st({type:Number})],t.MyMap.prototype,"geojsonBuffer",2),Ey([st({type:Boolean})],t.MyMap.prototype,"disableVectorTiles",2),Ey([st({type:String})],t.MyMap.prototype,"osVectorTilesApiKey",2),Ey([st({type:String})],t.MyMap.prototype,"osFeaturesApiKey",2),Ey([st({type:String})],t.MyMap.prototype,"osCopyright",2),Ey([st({type:Boolean})],t.MyMap.prototype,"hideResetControl",2),Ey([st({type:Boolean})],t.MyMap.prototype,"staticMode",2),Ey([st({type:String})],t.MyMap.prototype,"areaUnit",2),Ey([st({type:Boolean})],t.MyMap.prototype,"showScale",2),Ey([st({type:Boolean})],t.MyMap.prototype,"useScaleBarStyle",2),t.MyMap=Ey([rt("my-map")],t.MyMap);var Py,Oy={exports:{}};Py=Oy,function(t,e){Py.exports=e()}(window,(function(){return function(t){var e={};function i(o){if(e[o])return e[o].exports;var n=e[o]={i:o,l:!1,exports:{}};return t[o].call(n.exports,n,n.exports,i),n.l=!0,n.exports}return i.m=t,i.c=e,i.d=function(t,e,o){i.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:o})},i.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},i.t=function(t,e){if(1&e&&(t=i(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var o=Object.create(null);if(i.r(o),Object.defineProperty(o,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var n in t)i.d(o,n,function(e){return t[e]}.bind(null,n));return o},i.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return i.d(e,"a",e),e},i.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},i.p="/",i(i.s=37)}([function(t,e,i){var o=i(1),n=i(6),r=i(7),a=i(16),s=i(18),l="prototype",u=function(t,e,i){var p,d,h,c,f=t&u.F,g=t&u.G,m=t&u.S,v=t&u.P,y=t&u.B,_=g?o:m?o[e]||(o[e]={}):(o[e]||{})[l],b=g?n:n[e]||(n[e]={}),x=b[l]||(b[l]={});for(p in g&&(i=e),i)h=((d=!f&&_&&void 0!==_[p])?_:i)[p],c=y&&d?s(h,o):v&&"function"==typeof h?s(Function.call,h):h,_&&a(_,p,h,t&u.U),b[p]!=h&&r(b,p,c),v&&x[p]!=h&&(x[p]=h)};o.core=n,u.F=1,u.G=2,u.S=4,u.P=8,u.B=16,u.W=32,u.U=64,u.R=128,t.exports=u},function(t,e){var i=t.exports="undefined"!=typeof window&&window.Math==Math?window:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")();"number"==typeof __g&&(__g=i)},function(t,e){t.exports=function(t){return"object"==typeof t?null!==t:"function"==typeof t}},function(t,e,i){t.exports=!i(4)((function(){return 7!=Object.defineProperty({},"a",{get:function(){return 7}}).a}))},function(t,e){t.exports=function(t){try{return!!t()}catch(e){return!0}}},function(t,e,i){i.r(e),i.d(e,"h",(function(){return s})),i.d(e,"createElement",(function(){return s})),i.d(e,"cloneElement",(function(){return p})),i.d(e,"Component",(function(){return F})),i.d(e,"render",(function(){return M})),i.d(e,"rerender",(function(){return f})),i.d(e,"options",(function(){return n}));var o=function(){},n={},r=[],a=[];function s(t,e){var i,s,l,u,p=a;for(u=arguments.length;2<u--;)r.push(arguments[u]);for(e&&null!=e.children&&(r.length||r.push(e.children),delete e.children);r.length;)if((s=r.pop())&&void 0!==s.pop)for(u=s.length;u--;)r.push(s[u]);else"boolean"==typeof s&&(s=null),(l="function"!=typeof t)&&(null==s?s="":"number"==typeof s?s=String(s):"string"!=typeof s&&(l=!1)),l&&i?p[p.length-1]+=s:p===a?p=[s]:p.push(s),i=l;var d=new o;return d.nodeName=t,d.children=p,d.attributes=null==e?void 0:e,d.key=null==e?void 0:e.key,void 0!==n.vnode&&n.vnode(d),d}function l(t,e){for(var i in e)t[i]=e[i];return t}var u="function"==typeof Promise?Promise.resolve().then.bind(Promise.resolve()):setTimeout;function p(t,e){return s(t.nodeName,l(l({},t.attributes),e),2<arguments.length?[].slice.call(arguments,2):t.children)}var d=/acit|ex(?:s|g|n|p|$)|rph|ows|mnc|ntw|ine[ch]|zoo|^ord/i,h=[];function c(t){!t._dirty&&(t._dirty=!0)&&1==h.push(t)&&(n.debounceRendering||u)(f)}function f(){var t,e=h;for(h=[];t=e.pop();)t._dirty&&R(t)}function g(t,e){return t.normalizedNodeName===e||t.nodeName.toLowerCase()===e.toLowerCase()}function m(t){var e=l({},t.attributes);e.children=t.children;var i=t.nodeName.defaultProps;if(void 0!==i)for(var o in i)void 0===e[o]&&(e[o]=i[o]);return e}function v(t){var e=t.parentNode;e&&e.removeChild(t)}function y(t,e,i,o,n){if("className"===e&&(e="class"),"key"===e);else if("ref"===e)i&&i(null),o&&o(t);else if("class"!==e||n)if("style"===e){if(o&&"string"!=typeof o&&"string"!=typeof i||(t.style.cssText=o||""),o&&"object"==typeof o){if("string"!=typeof i)for(var r in i)r in o||(t.style[r]="");for(var r in o)t.style[r]="number"==typeof o[r]&&!1===d.test(r)?o[r]+"px":o[r]}}else if("dangerouslySetInnerHTML"===e)o&&(t.innerHTML=o.__html||"");else if("o"==e[0]&&"n"==e[1]){var a=e!==(e=e.replace(/Capture$/,""));e=e.toLowerCase().substring(2),o?i||t.addEventListener(e,_,a):t.removeEventListener(e,_,a),(t._listeners||(t._listeners={}))[e]=o}else if("list"!==e&&"type"!==e&&!n&&e in t){try{t[e]=null==o?"":o}catch(l){}null!=o&&!1!==o||"spellcheck"==e||t.removeAttribute(e)}else{var s=n&&e!==(e=e.replace(/^xlink:?/,""));null==o||!1===o?s?t.removeAttributeNS("http://www.w3.org/1999/xlink",e.toLowerCase()):t.removeAttribute(e):"function"!=typeof o&&(s?t.setAttributeNS("http://www.w3.org/1999/xlink",e.toLowerCase(),o):t.setAttribute(e,o))}else t.className=o||""}function _(t){return this._listeners[t.type](n.event&&n.event(t)||t)}var b=[],x=0,k=!1,w=!1;function S(){for(var t;t=b.pop();)n.afterMount&&n.afterMount(t),t.componentDidMount&&t.componentDidMount()}function C(t,e,i,o,n){var r=t,a=k;if(null!=e&&"boolean"!=typeof e||(e=""),"string"==typeof e||"number"==typeof e)return t&&void 0!==t.splitText&&t.parentNode&&(!t._component||n)?t.nodeValue!=e&&(t.nodeValue=e):(r=document.createTextNode(e),t&&(t.parentNode&&t.parentNode.replaceChild(r,t),z(t,!0))),r.__preactattr_=!0,r;var s,l,u=e.nodeName;if("function"==typeof u)return function(t,e,i,o){for(var n=t&&t._component,r=n,a=t,s=n&&t._componentConstructor===e.nodeName,l=s,u=m(e);n&&!l&&(n=n._parentComponent);)l=n.constructor===e.nodeName;return n&&l&&(!o||n._component)?(j(n,u,3,i,o),t=n.base):(r&&!s&&(I(r),t=a=null),n=P(e.nodeName,u,i),t&&!n.nextBase&&(n.nextBase=t,a=null),j(n,u,1,i,o),t=n.base,a&&t!==a&&(a._component=null,z(a,!1))),t}(t,e,i,o);if(k="svg"===u||"foreignObject"!==u&&k,u=String(u),(!t||!g(t,u))&&(s=u,(l=k?document.createElementNS("http://www.w3.org/2000/svg",s):document.createElement(s)).normalizedNodeName=s,r=l,t)){for(;t.firstChild;)r.appendChild(t.firstChild);t.parentNode&&t.parentNode.replaceChild(r,t),z(t,!0)}var p=r.firstChild,d=r.__preactattr_,h=e.children;if(null==d){d=r.__preactattr_={};for(var c=r.attributes,f=c.length;f--;)d[c[f].name]=c[f].value}return!w&&h&&1===h.length&&"string"==typeof h[0]&&null!=p&&void 0!==p.splitText&&null==p.nextSibling?p.nodeValue!=h[0]&&(p.nodeValue=h[0]):(h&&h.length||null!=p)&&function(t,e,i,o,n){var r,a,s,l,u,p,d,h,c=t.childNodes,f=[],m={},y=0,_=0,b=c.length,x=0,k=e?e.length:0;if(0!==b)for(var w=0;w<b;w++){var S=c[w],T=S.__preactattr_;null!=(E=k&&T?S._component?S._component.__key:T.key:null)?(y++,m[E]=S):(T||(void 0!==S.splitText?!n||S.nodeValue.trim():n))&&(f[x++]=S)}if(0!==k)for(w=0;w<k;w++){var E;if(u=null,null!=(E=(l=e[w]).key))y&&void 0!==m[E]&&(u=m[E],m[E]=void 0,y--);else if(_<x)for(r=_;r<x;r++)if(void 0!==f[r]&&(p=a=f[r],h=n,"string"==typeof(d=l)||"number"==typeof d?void 0!==p.splitText:"string"==typeof d.nodeName?!p._componentConstructor&&g(p,d.nodeName):h||p._componentConstructor===d.nodeName)){u=a,f[r]=void 0,r===x-1&&x--,r===_&&_++;break}u=C(u,l,i,o),s=c[w],u&&u!==t&&u!==s&&(null==s?t.appendChild(u):u===s.nextSibling?v(s):t.insertBefore(u,s))}if(y)for(var w in m)void 0!==m[w]&&z(m[w],!1);for(;_<=x;)void 0!==(u=f[x--])&&z(u,!1)}(r,h,i,o,w||null!=d.dangerouslySetInnerHTML),function(t,e,i){var o;for(o in i)e&&null!=e[o]||null==i[o]||y(t,o,i[o],i[o]=void 0,k);for(o in e)"children"===o||"innerHTML"===o||o in i&&e[o]===("value"===o||"checked"===o?t[o]:i[o])||y(t,o,i[o],i[o]=e[o],k)}(r,e.attributes,d),k=a,r}function z(t,e){var i=t._component;i?I(i):(null!=t.__preactattr_&&t.__preactattr_.ref&&t.__preactattr_.ref(null),!1!==e&&null!=t.__preactattr_||v(t),T(t))}function T(t){for(t=t.lastChild;t;){var e=t.previousSibling;z(t,!0),t=e}}var E=[];function P(t,e,i){var o,n=E.length;for(t.prototype&&t.prototype.render?(o=new t(e,i),F.call(o,e,i)):((o=new F(e,i)).constructor=t,o.render=O);n--;)if(E[n].constructor===t)return o.nextBase=E[n].nextBase,E.splice(n,1),o;return o}function O(t,e,i){return this.constructor(t,i)}function j(t,e,i,o,r){t._disable||(t._disable=!0,t.__ref=e.ref,t.__key=e.key,delete e.ref,delete e.key,void 0===t.constructor.getDerivedStateFromProps&&(!t.base||r?t.componentWillMount&&t.componentWillMount():t.componentWillReceiveProps&&t.componentWillReceiveProps(e,o)),o&&o!==t.context&&(t.prevContext||(t.prevContext=t.context),t.context=o),t.prevProps||(t.prevProps=t.props),t.props=e,t._disable=!1,0!==i&&(1!==i&&!1===n.syncComponentUpdates&&t.base?c(t):R(t,1,r)),t.__ref&&t.__ref(t))}function R(t,e,i,o){if(!t._disable){var r,a,s,u=t.props,p=t.state,d=t.context,h=t.prevProps||u,c=t.prevState||p,f=t.prevContext||d,g=t.base,v=t.nextBase,y=g||v,_=t._component,T=!1,E=f;if(t.constructor.getDerivedStateFromProps&&(p=l(l({},p),t.constructor.getDerivedStateFromProps(u,p)),t.state=p),g&&(t.props=h,t.state=c,t.context=f,2!==e&&t.shouldComponentUpdate&&!1===t.shouldComponentUpdate(u,p,d)?T=!0:t.componentWillUpdate&&t.componentWillUpdate(u,p,d),t.props=u,t.state=p,t.context=d),t.prevProps=t.prevState=t.prevContext=t.nextBase=null,t._dirty=!1,!T){r=t.render(u,p,d),t.getChildContext&&(d=l(l({},d),t.getChildContext())),g&&t.getSnapshotBeforeUpdate&&(E=t.getSnapshotBeforeUpdate(h,c));var O,F,M=r&&r.nodeName;if("function"==typeof M){var A=m(r);(a=_)&&a.constructor===M&&A.key==a.__key?j(a,A,1,d,!1):(O=a,t._component=a=P(M,A,d),a.nextBase=a.nextBase||v,a._parentComponent=t,j(a,A,0,d,!1),R(a,1,i,!0)),F=a.base}else s=y,(O=_)&&(s=t._component=null),(y||1===e)&&(s&&(s._component=null),F=function(t,e,i,o,n,r){x++||(k=null!=n&&void 0!==n.ownerSVGElement,w=null!=t&&!("__preactattr_"in t));var a=C(t,e,i,o,r);return n&&a.parentNode!==n&&n.appendChild(a),--x||(w=!1,r||S()),a}(s,r,d,i||!g,y&&y.parentNode,!0));if(y&&F!==y&&a!==_){var D=y.parentNode;D&&F!==D&&(D.replaceChild(F,y),O||(y._component=null,z(y,!1)))}if(O&&I(O),(t.base=F)&&!o){for(var L=t,G=t;G=G._parentComponent;)(L=G).base=F;F._component=L,F._componentConstructor=L.constructor}}for(!g||i?b.unshift(t):T||(t.componentDidUpdate&&t.componentDidUpdate(h,c,E),n.afterUpdate&&n.afterUpdate(t));t._renderCallbacks.length;)t._renderCallbacks.pop().call(t);x||o||S()}}function I(t){n.beforeUnmount&&n.beforeUnmount(t);var e=t.base;t._disable=!0,t.componentWillUnmount&&t.componentWillUnmount(),t.base=null;var i=t._component;i?I(i):e&&(e.__preactattr_&&e.__preactattr_.ref&&e.__preactattr_.ref(null),v(t.nextBase=e),E.push(t),T(e)),t.__ref&&t.__ref(null)}function F(t,e){this._dirty=!0,this.context=e,this.props=t,this.state=this.state||{},this._renderCallbacks=[]}function M(t,e,i){return function(t,e,i,o,n,r){x++||(k=null!=n&&void 0!==n.ownerSVGElement,w=null!=t&&!("__preactattr_"in t));var a=C(t,e,i,o,r);return n&&a.parentNode!==n&&n.appendChild(a),--x||(w=!1,r||S()),a}(i,t,{},!1,e,!1)}l(F.prototype,{setState:function(t,e){this.prevState||(this.prevState=this.state),this.state=l(l({},this.state),"function"==typeof t?t(this.state,this.props):t),e&&this._renderCallbacks.push(e),c(this)},forceUpdate:function(t){t&&this._renderCallbacks.push(t),R(this,2)},render:function(){}});var A={h:s,createElement:s,cloneElement:p,Component:F,render:M,rerender:f,options:n};e.default=A},function(t,e){var i=t.exports={version:"2.5.7"};"number"==typeof __e&&(__e=i)},function(t,e,i){var o=i(8),n=i(40);t.exports=i(3)?function(t,e,i){return o.f(t,e,n(1,i))}:function(t,e,i){return t[e]=i,t}},function(t,e,i){var o=i(9),n=i(38),r=i(39),a=Object.defineProperty;e.f=i(3)?Object.defineProperty:function(t,e,i){if(o(t),e=r(e,!0),o(i),n)try{return a(t,e,i)}catch(s){}if("get"in i||"set"in i)throw TypeError("Accessors not supported!");return"value"in i&&(t[e]=i.value),t}},function(t,e,i){var o=i(2);t.exports=function(t){if(!o(t))throw TypeError(t+" is not an object!");return t}},function(t,e){var i=0,o=Math.random();t.exports=function(t){return"Symbol(".concat(void 0===t?"":t,")_",(++i+o).toString(36))}},function(t,e,i){var o=i(22);t.exports=Object("z").propertyIsEnumerable(0)?Object:function(t){return"String"==o(t)?t.split(""):Object(t)}},function(t,e){t.exports=function(t){if(null==t)throw TypeError("Can't call method on "+t);return t}},function(t,e,i){var o=i(4);t.exports=function(t,e){return!!t&&o((function(){e?t.call(null,(function(){}),1):t.call(null)}))}},function(t,e,i){var o=i(0);o(o.S+o.F,"Object",{assign:i(41)})},function(t,e,i){var o=i(2),n=i(1).document,r=o(n)&&o(n.createElement);t.exports=function(t){return r?n.createElement(t):{}}},function(t,e,i){var o=i(1),n=i(7),r=i(17),a=i(10)("src"),s="toString",l=Function[s],u=(""+l).split(s);i(6).inspectSource=function(t){return l.call(t)},(t.exports=function(t,e,i,s){var l="function"==typeof i;l&&(r(i,"name")||n(i,"name",e)),t[e]!==i&&(l&&(r(i,a)||n(i,a,t[e]?""+t[e]:u.join(String(e)))),t===o?t[e]=i:s?t[e]?t[e]=i:n(t,e,i):(delete t[e],n(t,e,i)))})(Function.prototype,s,(function(){return"function"==typeof this&&this[a]||l.call(this)}))},function(t,e){var i={}.hasOwnProperty;t.exports=function(t,e){return i.call(t,e)}},function(t,e,i){var o=i(19);t.exports=function(t,e,i){if(o(t),void 0===e)return t;switch(i){case 1:return function(i){return t.call(e,i)};case 2:return function(i,o){return t.call(e,i,o)};case 3:return function(i,o,n){return t.call(e,i,o,n)}}return function(){return t.apply(e,arguments)}}},function(t,e){t.exports=function(t){if("function"!=typeof t)throw TypeError(t+" is not a function!");return t}},function(t,e,i){var o=i(42),n=i(28);t.exports=Object.keys||function(t){return o(t,n)}},function(t,e,i){var o=i(11),n=i(12);t.exports=function(t){return o(n(t))}},function(t,e){var i={}.toString;t.exports=function(t){return i.call(t).slice(8,-1)}},function(t,e,i){var o=i(21),n=i(24),r=i(43);t.exports=function(t){return function(e,i,a){var s,l=o(e),u=n(l.length),p=r(a,u);if(t&&i!=i){for(;p<u;)if((s=l[p++])!=s)return!0}else for(;p<u;p++)if((t||p in l)&&l[p]===i)return t||p||0;return!t&&-1}}},function(t,e,i){var o=i(25),n=Math.min;t.exports=function(t){return 0<t?n(o(t),9007199254740991):0}},function(t,e){var i=Math.ceil,o=Math.floor;t.exports=function(t){return isNaN(t=+t)?0:(0<t?o:i)(t)}},function(t,e,i){var o=i(27)("keys"),n=i(10);t.exports=function(t){return o[t]||(o[t]=n(t))}},function(t,e,i){var o=i(6),n=i(1),r="__core-js_shared__",a=n[r]||(n[r]={});(t.exports=function(t,e){return a[t]||(a[t]=void 0!==e?e:{})})("versions",[]).push({version:o.version,mode:i(44)?"pure":"global",copyright:"© 2018 Denis Pushkarev (zloirock.ru)"})},function(t,e){t.exports="constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf".split(",")},function(t,e,i){var o=i(12);t.exports=function(t){return Object(o(t))}},function(t,e,i){var o=i(8).f,n=Function.prototype,r=/^\s*function ([^ (]*)/;"name"in n||i(3)&&o(n,"name",{configurable:!0,get:function(){try{return(""+this).match(r)[1]}catch(t){return""}}})},function(t,e,i){var o=i(0),n=i(32)(1);o(o.P+o.F*!i(13)([].map,!0),"Array",{map:function(t){return n(this,t,arguments[1])}})},function(t,e,i){var o=i(18),n=i(11),r=i(29),a=i(24),s=i(47);t.exports=function(t,e){var i=1==t,l=2==t,u=3==t,p=4==t,d=6==t,h=5==t||d,c=e||s;return function(e,s,f){for(var g,m,v=r(e),y=n(v),_=o(s,f,3),b=a(y.length),x=0,k=i?c(e,b):l?c(e,0):void 0;x<b;x++)if((h||x in y)&&(m=_(g=y[x],x,v),t))if(i)k[x]=m;else if(m)switch(t){case 3:return!0;case 5:return g;case 6:return x;case 2:k.push(g)}else if(p)return!1;return d?-1:u||p?p:k}}},function(t,e,i){var o=i(22);t.exports=Array.isArray||function(t){return"Array"==o(t)}},function(t,e,i){var o=i(27)("wks"),n=i(10),r=i(1).Symbol,a="function"==typeof r;(t.exports=function(t){return o[t]||(o[t]=a&&r[t]||(a?r:n)("Symbol."+t))}).store=o},function(t,e,i){var o=i(0),n=i(23)(!1),r=[].indexOf,a=!!r&&1/[1].indexOf(1,-0)<0;o(o.P+o.F*(a||!i(13)(r)),"Array",{indexOf:function(t){return a?r.apply(this,arguments)||0:n(this,t,arguments[1])}})},function(t,e,i){var o=i(0);o(o.S,"Object",{create:i(52)})},function(t,e,i){e.__esModule=!0,e.default=void 0,i(14),i(30),i(31),i(35),i(49),i(50);var o,n=i(5),r=(o=i(51))&&o.__esModule?o:{default:o};function a(t){if(!t.element)throw new Error("element is not defined");if(!t.id)throw new Error("id is not defined");if(!t.source)throw new Error("source is not defined");Array.isArray(t.source)&&(t.source=s(t.source)),(0,n.render)((0,n.createElement)(r.default,t),t.element)}var s=function(t){return function(e,i){i(t.filter((function(t){return-1!==t.toLowerCase().indexOf(e.toLowerCase())})))}};a.enhanceSelectElement=function(t){if(!t.selectElement)throw new Error("selectElement is not defined");if(!t.source){var e=[].filter.call(t.selectElement.options,(function(e){return e.value||t.preserveNullOptions}));t.source=e.map((function(t){return t.textContent||t.innerText}))}if(t.onConfirm=t.onConfirm||function(e){var i=[].filter.call(t.selectElement.options,(function(t){return(t.textContent||t.innerText)===e}))[0];i&&(i.selected=!0)},t.selectElement.value||void 0===t.defaultValue){var i=t.selectElement.options[t.selectElement.options.selectedIndex];t.defaultValue=i.textContent||i.innerText}void 0===t.name&&(t.name=""),void 0===t.id&&(void 0===t.selectElement.id?t.id="":t.id=t.selectElement.id),void 0===t.autoselect&&(t.autoselect=!0);var o=document.createElement("div");t.selectElement.parentNode.insertBefore(o,t.selectElement),a(Object.assign({},t,{element:o})),t.selectElement.style.display="none",t.selectElement.id=t.selectElement.id+"-select"};var l=a;e.default=l},function(t,e,i){t.exports=!i(3)&&!i(4)((function(){return 7!=Object.defineProperty(i(15)("div"),"a",{get:function(){return 7}}).a}))},function(t,e,i){var o=i(2);t.exports=function(t,e){if(!o(t))return t;var i,n;if(e&&"function"==typeof(i=t.toString)&&!o(n=i.call(t)))return n;if("function"==typeof(i=t.valueOf)&&!o(n=i.call(t)))return n;if(!e&&"function"==typeof(i=t.toString)&&!o(n=i.call(t)))return n;throw TypeError("Can't convert object to primitive value")}},function(t,e){t.exports=function(t,e){return{enumerable:!(1&t),configurable:!(2&t),writable:!(4&t),value:e}}},function(t,e,i){var o=i(20),n=i(45),r=i(46),a=i(29),s=i(11),l=Object.assign;t.exports=!l||i(4)((function(){var t={},e={},i=Symbol(),o="abcdefghijklmnopqrst";return t[i]=7,o.split("").forEach((function(t){e[t]=t})),7!=l({},t)[i]||Object.keys(l({},e)).join("")!=o}))?function(t,e){for(var i=a(t),l=arguments.length,u=1,p=n.f,d=r.f;u<l;)for(var h,c=s(arguments[u++]),f=p?o(c).concat(p(c)):o(c),g=f.length,m=0;m<g;)d.call(c,h=f[m++])&&(i[h]=c[h]);return i}:l},function(t,e,i){var o=i(17),n=i(21),r=i(23)(!1),a=i(26)("IE_PROTO");t.exports=function(t,e){var i,s=n(t),l=0,u=[];for(i in s)i!=a&&o(s,i)&&u.push(i);for(;e.length>l;)o(s,i=e[l++])&&(~r(u,i)||u.push(i));return u}},function(t,e,i){var o=i(25),n=Math.max,r=Math.min;t.exports=function(t,e){return(t=o(t))<0?n(t+e,0):r(t,e)}},function(t,e){t.exports=!1},function(t,e){e.f=Object.getOwnPropertySymbols},function(t,e){e.f={}.propertyIsEnumerable},function(t,e,i){var o=i(48);t.exports=function(t,e){return new(o(t))(e)}},function(t,e,i){var o=i(2),n=i(33),r=i(34)("species");t.exports=function(t){var e;return n(t)&&("function"!=typeof(e=t.constructor)||e!==Array&&!n(e.prototype)||(e=void 0),o(e)&&null===(e=e[r])&&(e=void 0)),void 0===e?Array:e}},function(t,e,i){var o=i(0),n=i(32)(2);o(o.P+o.F*!i(13)([].filter,!0),"Array",{filter:function(t){return n(this,t,arguments[1])}})},function(t,e,i){var o=i(0);o(o.S,"Array",{isArray:i(33)})},function(t,e,i){e.__esModule=!0,e.default=void 0,i(14),i(36),i(30),i(31),i(35),i(55),i(58);var o=i(5),n=a(i(60)),r=a(i(61));function a(t){return t&&t.__esModule?t:{default:t}}function s(){return(s=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var i=arguments[e];for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(t[o]=i[o])}return t}).apply(this,arguments)}function l(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}var u={13:"enter",27:"escape",32:"space",38:"up",40:"down"};function p(){return"undefined"!=typeof navigator&&!(!navigator.userAgent.match(/(iPod|iPhone|iPad)/g)||!navigator.userAgent.match(/AppleWebKit/g))}var d=function(t){function e(e){var i;return(i=t.call(this,e)||this).elementReferences={},i.state={focused:null,hovered:null,menuOpen:!1,options:e.defaultValue?[e.defaultValue]:[],query:e.defaultValue,validChoiceMade:!1,selected:null,ariaHint:!0},i.handleComponentBlur=i.handleComponentBlur.bind(l(l(i))),i.handleKeyDown=i.handleKeyDown.bind(l(l(i))),i.handleUpArrow=i.handleUpArrow.bind(l(l(i))),i.handleDownArrow=i.handleDownArrow.bind(l(l(i))),i.handleEnter=i.handleEnter.bind(l(l(i))),i.handlePrintableKey=i.handlePrintableKey.bind(l(l(i))),i.handleListMouseLeave=i.handleListMouseLeave.bind(l(l(i))),i.handleOptionBlur=i.handleOptionBlur.bind(l(l(i))),i.handleOptionClick=i.handleOptionClick.bind(l(l(i))),i.handleOptionFocus=i.handleOptionFocus.bind(l(l(i))),i.handleOptionMouseDown=i.handleOptionMouseDown.bind(l(l(i))),i.handleOptionMouseEnter=i.handleOptionMouseEnter.bind(l(l(i))),i.handleInputBlur=i.handleInputBlur.bind(l(l(i))),i.handleInputChange=i.handleInputChange.bind(l(l(i))),i.handleInputFocus=i.handleInputFocus.bind(l(l(i))),i.pollInputElement=i.pollInputElement.bind(l(l(i))),i.getDirectInputChanges=i.getDirectInputChanges.bind(l(l(i))),i}var i,r;r=t,(i=e).prototype=Object.create(r.prototype),(i.prototype.constructor=i).__proto__=r;var a=e.prototype;return a.isQueryAnOption=function(t,e){var i=this;return-1!==e.map((function(t){return i.templateInputValue(t).toLowerCase()})).indexOf(t.toLowerCase())},a.componentDidMount=function(){this.pollInputElement()},a.componentWillUnmount=function(){clearTimeout(this.$pollInput)},a.pollInputElement=function(){var t=this;this.getDirectInputChanges(),this.$pollInput=setTimeout((function(){t.pollInputElement()}),100)},a.getDirectInputChanges=function(){var t=this.elementReferences[-1];t&&t.value!==this.state.query&&this.handleInputChange({target:{value:t.value}})},a.componentDidUpdate=function(t,e){var i=this.state.focused,o=null===i,n=e.focused!==i;n&&!o&&this.elementReferences[i].focus();var r=-1===i,a=n&&null===e.focused;if(r&&a){var s=this.elementReferences[i];s.setSelectionRange(0,s.value.length)}},a.hasAutoselect=function(){return!p()&&this.props.autoselect},a.templateInputValue=function(t){var e=this.props.templates&&this.props.templates.inputValue;return e?e(t):t},a.templateSuggestion=function(t){var e=this.props.templates&&this.props.templates.suggestion;return e?e(t):t},a.handleComponentBlur=function(t){var e,i=this.state,o=i.options,n=i.query,r=i.selected;this.props.confirmOnBlur?(e=t.query||n,this.props.onConfirm(o[r])):e=n,this.setState({focused:null,menuOpen:t.menuOpen||!1,query:e,selected:null,validChoiceMade:this.isQueryAnOption(e,o)})},a.handleListMouseLeave=function(t){this.setState({hovered:null})},a.handleOptionBlur=function(t,e){var i=this.state,o=i.focused,n=i.menuOpen,r=i.options,a=i.selected,s=null===t.relatedTarget,l=t.relatedTarget===this.elementReferences[-1],u=o!==e&&-1!==o;if(!u&&s||!u&&!l){var d=n&&p();this.handleComponentBlur({menuOpen:d,query:this.templateInputValue(r[a])})}},a.handleInputBlur=function(t){var e=this.state,i=e.focused,o=e.menuOpen,n=e.options,r=e.query,a=e.selected;if(-1===i){var s=o&&p(),l=p()?r:this.templateInputValue(n[a]);this.handleComponentBlur({menuOpen:s,query:l})}},a.handleInputChange=function(t){var e=this,i=this.props,o=i.minLength,n=i.source,r=i.showAllValues,a=this.hasAutoselect(),s=t.target.value,l=0===s.length,u=this.state.query.length!==s.length,p=s.length>=o;this.setState({query:s,ariaHint:l}),r||!l&&u&&p?n(s,(function(t){var i=0<t.length;e.setState({menuOpen:i,options:t,selected:a&&i?0:-1,validChoiceMade:!1})})):!l&&p||this.setState({menuOpen:!1,options:[]})},a.handleInputClick=function(t){this.handleInputChange(t)},a.handleInputFocus=function(t){var e=this.state,i=e.query,o=e.validChoiceMade,n=e.options,r=this.props.minLength,a=!o&&i.length>=r&&0<n.length;a?this.setState((function(t){var e=t.menuOpen;return{focused:-1,menuOpen:a||e,selected:-1}})):this.setState({focused:-1})},a.handleOptionFocus=function(t){this.setState({focused:t,hovered:null,selected:t})},a.handleOptionMouseEnter=function(t,e){p()||this.setState({hovered:e})},a.handleOptionClick=function(t,e){var i=this.state.options[e],o=this.templateInputValue(i);this.props.onConfirm(i),this.setState({focused:-1,hovered:null,menuOpen:!1,query:o,selected:-1,validChoiceMade:!0}),this.forceUpdate()},a.handleOptionMouseDown=function(t){t.preventDefault()},a.handleUpArrow=function(t){t.preventDefault();var e=this.state,i=e.menuOpen,o=e.selected;-1!==o&&i&&this.handleOptionFocus(o-1)},a.handleDownArrow=function(t){var e=this;if(t.preventDefault(),this.props.showAllValues&&!1===this.state.menuOpen)t.preventDefault(),this.props.source("",(function(t){e.setState({menuOpen:!0,options:t,selected:0,focused:0,hovered:null})}));else if(!0===this.state.menuOpen){var i=this.state,o=i.menuOpen,n=i.options,r=i.selected;r!==n.length-1&&o&&this.handleOptionFocus(r+1)}},a.handleSpace=function(t){var e=this;this.props.showAllValues&&!1===this.state.menuOpen&&""===this.state.query&&(t.preventDefault(),this.props.source("",(function(t){e.setState({menuOpen:!0,options:t})}))),-1!==this.state.focused&&(t.preventDefault(),this.handleOptionClick(t,this.state.focused))},a.handleEnter=function(t){this.state.menuOpen&&(t.preventDefault(),0<=this.state.selected&&this.handleOptionClick(t,this.state.selected))},a.handlePrintableKey=function(t){var e=this.elementReferences[-1];t.target===e||e.focus()},a.handleKeyDown=function(t){switch(u[t.keyCode]){case"up":this.handleUpArrow(t);break;case"down":this.handleDownArrow(t);break;case"space":this.handleSpace(t);break;case"enter":this.handleEnter(t);break;case"escape":this.handleComponentBlur({query:this.state.query});break;default:(47<(e=t.keyCode)&&e<58||32===e||8===e||64<e&&e<91||95<e&&e<112||185<e&&e<193||218<e&&e<223)&&this.handlePrintableKey(t)}var e},a.render=function(){var t,e=this,i=this.props,r=i.cssNamespace,a=i.displayMenu,l=i.id,u=i.minLength,d=i.name,h=i.placeholder,c=i.required,f=i.showAllValues,g=i.tNoResults,m=i.tStatusQueryTooShort,v=i.tStatusNoResults,y=i.tStatusSelectedOption,_=i.tStatusResults,b=i.tAssistiveHint,x=i.dropdownArrow,k=this.state,w=k.focused,S=k.hovered,C=k.menuOpen,z=k.options,T=k.query,E=k.selected,P=k.ariaHint,O=k.validChoiceMade,j=this.hasAutoselect(),R=-1===w,I=0===z.length,F=0!==T.length,M=T.length>=u,A=this.props.showNoOptionsFound&&R&&I&&F&&M,D=r+"__wrapper",L=r+"__input",G=null!==w?" "+L+"--focused":"",N=this.props.showAllValues?" "+L+"--show-all-values":" "+L+"--default",B=r+"__dropdown-arrow-down",q=-1!==w&&null!==w,W=r+"__menu",V=W+"--"+a,U=W+"--"+(C||A?"visible":"hidden"),X=r+"__option",K=r+"__hint",Y=this.templateInputValue(z[E]),Z=Y&&0===Y.toLowerCase().indexOf(T.toLowerCase())&&j?T+Y.substr(T.length):"",$=l+"__assistiveHint",H=P?{"aria-describedby":$}:null;return f&&"string"==typeof(t=x({className:B}))&&(t=(0,o.createElement)("div",{className:r+"__dropdown-arrow-down-wrapper",dangerouslySetInnerHTML:{__html:t}})),(0,o.createElement)("div",{className:D,onKeyDown:this.handleKeyDown},(0,o.createElement)(n.default,{id:l,length:z.length,queryLength:T.length,minQueryLength:u,selectedOption:this.templateInputValue(z[E]),selectedOptionIndex:E,validChoiceMade:O,isInFocus:null!==this.state.focused,tQueryTooShort:m,tNoResults:v,tSelectedOption:y,tResults:_}),Z&&(0,o.createElement)("span",null,(0,o.createElement)("input",{className:K,readonly:!0,tabIndex:"-1",value:Z})),(0,o.createElement)("input",s({"aria-expanded":C?"true":"false","aria-activedescendant":!!q&&l+"__option--"+w,"aria-owns":l+"__listbox","aria-autocomplete":this.hasAutoselect()?"both":"list"},H,{autoComplete:"off",className:""+L+G+N,id:l,onClick:function(t){return e.handleInputClick(t)},onBlur:this.handleInputBlur},{onInput:this.handleInputChange},{onFocus:this.handleInputFocus,name:d,placeholder:h,ref:function(t){e.elementReferences[-1]=t},type:"text",role:"combobox",required:c,value:T})),t,(0,o.createElement)("ul",{className:W+" "+V+" "+U,onMouseLeave:function(t){return e.handleListMouseLeave(t)},id:l+"__listbox",role:"listbox"},z.map((function(t,i){var n=(-1===w?E===i:w===i)&&null===S?" "+X+"--focused":"",r=i%2?" "+X+"--odd":"",a=p()?"<span id="+l+"__option-suffix--"+i+' style="border:0;clip:rect(0 0 0 0);height:1px;marginBottom:-1px;marginRight:-1px;overflow:hidden;padding:0;position:absolute;whiteSpace:nowrap;width:1px"> '+(i+1)+" of "+z.length+"</span>":"";return(0,o.createElement)("li",{"aria-selected":w===i?"true":"false",className:""+X+n+r,dangerouslySetInnerHTML:{__html:e.templateSuggestion(t)+a},id:l+"__option--"+i,key:i,onBlur:function(t){return e.handleOptionBlur(t,i)},onClick:function(t){return e.handleOptionClick(t,i)},onMouseDown:e.handleOptionMouseDown,onMouseEnter:function(t){return e.handleOptionMouseEnter(t,i)},ref:function(t){e.elementReferences[i]=t},role:"option",tabIndex:"-1","aria-posinset":i+1,"aria-setsize":z.length})})),A&&(0,o.createElement)("li",{className:X+" "+X+"--no-results"},g())),(0,o.createElement)("span",{id:$,style:{display:"none"}},b()))},e}(o.Component);(e.default=d).defaultProps={autoselect:!1,cssNamespace:"autocomplete",defaultValue:"",displayMenu:"inline",minLength:0,name:"input-autocomplete",placeholder:"",onConfirm:function(){},confirmOnBlur:!0,showNoOptionsFound:!0,showAllValues:!1,required:!1,tNoResults:function(){return"No results found"},tAssistiveHint:function(){return"When autocomplete results are available use up and down arrows to review and enter to select. Touch device users, explore by touch or with swipe gestures."},dropdownArrow:r.default}},function(t,e,i){var o=i(9),n=i(53),r=i(28),a=i(26)("IE_PROTO"),s=function(){},l="prototype",u=function(){var t,e=i(15)("iframe"),o=r.length;for(e.style.display="none",i(54).appendChild(e),e.src="javascript:",(t=e.contentWindow.document).open(),t.write("<script>document.F=Object<\/script>"),t.close(),u=t.F;o--;)delete u[l][r[o]];return u()};t.exports=Object.create||function(t,e){var i;return null!==t?(s[l]=o(t),i=new s,s[l]=null,i[a]=t):i=u(),void 0===e?i:n(i,e)}},function(t,e,i){var o=i(8),n=i(9),r=i(20);t.exports=i(3)?Object.defineProperties:function(t,e){n(t);for(var i,a=r(e),s=a.length,l=0;l<s;)o.f(t,i=a[l++],e[i]);return t}},function(t,e,i){var o=i(1).document;t.exports=o&&o.documentElement},function(t,e,i){var o=i(0);o(o.P,"Function",{bind:i(56)})},function(t,e,i){var o=i(19),n=i(2),r=i(57),a=[].slice,s={};t.exports=Function.bind||function(t){var e=o(this),i=a.call(arguments,1),l=function(){var o=i.concat(a.call(arguments));return this instanceof l?function(t,e,i){if(!(e in s)){for(var o=[],n=0;n<e;n++)o[n]="a["+n+"]";s[e]=Function("F,a","return new F("+o.join(",")+")")}return s[e](t,i)}(e,o.length,o):r(e,o,t)};return n(e.prototype)&&(l.prototype=e.prototype),l}},function(t,e){t.exports=function(t,e,i){var o=void 0===i;switch(e.length){case 0:return o?t():t.call(i);case 1:return o?t(e[0]):t.call(i,e[0]);case 2:return o?t(e[0],e[1]):t.call(i,e[0],e[1]);case 3:return o?t(e[0],e[1],e[2]):t.call(i,e[0],e[1],e[2]);case 4:return o?t(e[0],e[1],e[2],e[3]):t.call(i,e[0],e[1],e[2],e[3])}return t.apply(i,e)}},function(t,e,i){i(59)("match",1,(function(t,e,i){return[function(i){var o=t(this),n=null==i?void 0:i[e];return void 0!==n?n.call(i,o):new RegExp(i)[e](String(o))},i]}))},function(t,e,i){var o=i(7),n=i(16),r=i(4),a=i(12),s=i(34);t.exports=function(t,e,i){var l=s(t),u=i(a,l,""[t]),p=u[0],d=u[1];r((function(){var e={};return e[l]=function(){return 7},7!=""[t](e)}))&&(n(String.prototype,t,p),o(RegExp.prototype,l,2==e?function(t,e){return d.call(t,this,e)}:function(t){return d.call(t,this)}))}},function(t,e,i){e.__esModule=!0,e.default=void 0,i(36);var o=i(5),n=function(t){function e(){for(var e,i=arguments.length,o=new Array(i),n=0;n<i;n++)o[n]=arguments[n];return(e=t.call.apply(t,[this].concat(o))||this).state={bump:!1,debounced:!1},e}var i,n;n=t,(i=e).prototype=Object.create(n.prototype),(i.prototype.constructor=i).__proto__=n;var r=e.prototype;return r.componentWillMount=function(){var t=this;this.debounceStatusUpdate=function(t,e,i){var o;return function(){var n=this,r=arguments,a=function(){o=null,i||t.apply(n,r)},s=i&&!o;clearTimeout(o),o=setTimeout(a,e),s&&t.apply(n,r)}}((function(){if(!t.state.debounced){var e=!t.props.isInFocus||t.props.validChoiceMade;t.setState((function(t){return{bump:!t.bump,debounced:!0,silenced:e}}))}}),1400)},r.componentWillReceiveProps=function(t){t.queryLength,this.setState({debounced:!1})},r.render=function(){var t,e=this.props,i=e.id,n=e.length,r=e.queryLength,a=e.minQueryLength,s=e.selectedOption,l=e.selectedOptionIndex,u=e.tQueryTooShort,p=e.tNoResults,d=e.tSelectedOption,h=e.tResults,c=this.state,f=c.bump,g=c.debounced,m=c.silenced,v=r<a,y=0===n,_=s?d(s,n,l):"";return t=v?u(a):y?p():h(n,_),this.debounceStatusUpdate(),(0,o.createElement)("div",{style:{border:"0",clip:"rect(0 0 0 0)",height:"1px",marginBottom:"-1px",marginRight:"-1px",overflow:"hidden",padding:"0",position:"absolute",whiteSpace:"nowrap",width:"1px"}},(0,o.createElement)("div",{id:i+"__status--A",role:"status","aria-atomic":"true","aria-live":"polite"},!m&&g&&f?t:""),(0,o.createElement)("div",{id:i+"__status--B",role:"status","aria-atomic":"true","aria-live":"polite"},m||!g||f?"":t))},e}(o.Component);(e.default=n).defaultProps={tQueryTooShort:function(t){return"Type in "+t+" or more characters for results"},tNoResults:function(){return"No search results"},tSelectedOption:function(t,e,i){return t+" "+(i+1)+" of "+e+" is highlighted"},tResults:function(t,e){return t+" "+(1===t?"result":"results")+" "+(1===t?"is":"are")+" available. "+e}}},function(t,e,i){e.__esModule=!0,e.default=void 0;var o=i(5);e.default=function(t){var e=t.className;return(0,o.createElement)("svg",{version:"1.1",xmlns:"http://www.w3.org/2000/svg",className:e,focusable:"false"},(0,o.createElement)("g",{stroke:"none",fill:"none","fill-rule":"evenodd"},(0,o.createElement)("polygon",{fill:"#000000",points:"0 0 22 0 11 17"})))}}]).default}));var jy,Ry,Iy=kl(Oy.exports),Fy=s`@charset "UTF-8";
|
371
371
|
.govuk-link {
|
372
372
|
font-family: "GDS Transport", arial, sans-serif;
|
373
373
|
-webkit-font-smoothing: antialiased;
|
@@ -6519,10 +6519,34 @@ x:-moz-any-link {
|
|
6519
6519
|
width: 25% !important;
|
6520
6520
|
}
|
6521
6521
|
}
|
6522
|
-
|
6523
|
-
|
6524
|
-
|
6525
|
-
|
6522
|
+
:host .govuk-label {
|
6523
|
+
font-family: var(--autocomplete__font-family, "GDS Transport", arial, sans-serif);
|
6524
|
+
}
|
6525
|
+
:host .autocomplete__input {
|
6526
|
+
font-family: var(--autocomplete__font-family, "GDS Transport", arial, sans-serif);
|
6527
|
+
font-size: var(--autocomplete__input__font-size, 19px);
|
6528
|
+
height: var(--autocomplete__input__height, 35px);
|
6529
|
+
padding: var(--autocomplete__input__padding, 5px 34px 5px 5px);
|
6530
|
+
z-index: calc(var(--autocomplete__dropdown-arrow-down__z-index, 1) + 1);
|
6531
|
+
}
|
6532
|
+
:host .autocomplete__dropdown-arrow-down {
|
6533
|
+
z-index: var(--autocomplete__dropdown-arrow-down__z-index, 1);
|
6534
|
+
top: calc((var(--autocomplete__input__height, 35px) - 17px) / 2);
|
6535
|
+
}
|
6536
|
+
:host .autocomplete__option {
|
6537
|
+
font-family: var(--autocomplete__font-family, "GDS Transport", arial, sans-serif);
|
6538
|
+
font-size: var(--autocomplete__input__font-size, 19px);
|
6539
|
+
padding: var(--autocomplete__option__padding, 5px);
|
6540
|
+
border-bottom: var(--autocomplete__option__border-bottom, solid 1px #b1b4b6);
|
6541
|
+
}
|
6542
|
+
:host .autocomplete__option--focused,
|
6543
|
+
:host .autocomplete__option:hover, .autocomplete__option--focused :host .autocomplete__option:hover {
|
6544
|
+
border-color: var(--autocomplete__option__hover-border-color, #1d70b8);
|
6545
|
+
background-color: var(--autocomplete__option__hover-background-color, #1d70b8);
|
6546
|
+
}
|
6547
|
+
:host .autocomplete__menu {
|
6548
|
+
max-height: var(--autocomplete__menu__max-height, 342px);
|
6549
|
+
}`,My=Object.freeze,Ay=Object.defineProperty,Dy=Object.getOwnPropertyDescriptor,Ly=(t,e,i,o)=>{for(var n,r=o>1?void 0:o?Dy(e,i):e,a=t.length-1;a>=0;a--)(n=t[a])&&(r=(o?n(e,i,r):n(r))||r);return o&&r&&Ay(e,i,r),r},Gy=(t,e)=>My(Ay(t,"raw",{value:My(e||t.slice())}));t.AddressAutocomplete=class extends nt{constructor(){super(...arguments),this.id="autocomplete",this.postcode="SE5 0HU",this.label="Select an address",this.initialAddress="",this.osPlacesApiKey="",this.arrowStyle="default",this._totalAddresses=void 0,this._addressesInPostcode=[],this._options=[],this._selectedAddress=null,this._osError=void 0,this.dispatch=(t,e)=>this.dispatchEvent(new CustomEvent(t,{detail:e}))}connectedCallback(){super.connectedCallback(),this._fetchData()}disconnectedCallback(){super.disconnectedCallback()}getLightDropdownArrow(){return'<svg class="autocomplete__dropdown-arrow-down" style="height: 17px;" viewBox="0 0 512 512" ><path d="M256,298.3L256,298.3L256,298.3l174.2-167.2c4.3-4.2,11.4-4.1,15.8,0.2l30.6,29.9c4.4,4.3,4.5,11.3,0.2,15.5L264.1,380.9 c-2.2,2.2-5.2,3.2-8.1,3c-3,0.1-5.9-0.9-8.1-3L35.2,176.7c-4.3-4.2-4.2-11.2,0.2-15.5L66,131.3c4.4-4.3,11.5-4.4,15.8-0.2L256,298.3 z"/></svg>'}firstUpdated(){Iy({element:this.renderRoot.querySelector(`#${this.id}-container`),id:this.id,required:!0,source:this._options,defaultValue:this.initialAddress,showAllValues:!0,displayMenu:"overlay",dropdownArrow:"light"===this.arrowStyle?this.getLightDropdownArrow:void 0,tNoResults:()=>"No addresses found",onConfirm:t=>{this._selectedAddress=this._addressesInPostcode.filter((e=>e.LPI.ADDRESS.split(`, ${e.LPI.ADMINISTRATIVE_AREA}`)[0]===t))[0],this._selectedAddress&&this.dispatch("addressSelection",{address:this._selectedAddress})}})}async _fetchData(t=0,e=[]){const i={postcode:this.postcode,dataset:"LPI",maxResults:"100",output_srs:"EPSG:4326",lr:"EN",key:this.osPlacesApiKey},o=`https://api.os.uk/search/places/v1/postcode?${new URLSearchParams(i)}`;await fetch(o+`&offset=${t}`).then((t=>t.json())).then((t=>{var i,o,n;(t.error||t.fault)&&(this._osError=(null==(i=t.error)?void 0:i.message)||(null==(o=t.fault)?void 0:o.faultstring)||"Something went wrong"),this._totalAddresses=null==(n=t.header)?void 0:n.totalresults;const r=e.concat(t.results||[]);if(this._addressesInPostcode=r,this.dispatch("ready",{postcode:this.postcode,status:`fetched ${this._addressesInPostcode.length}/${this._totalAddresses} addresses`}),t.results){t.results.filter((t=>"APPROVED"===t.LPI.LPI_LOGICAL_STATUS_CODE_DESCRIPTION)).map((t=>{this._options.push(t.LPI.ADDRESS.split(`, ${t.LPI.ADMINISTRATIVE_AREA}`)[0])}));const e=new Intl.Collator([],{numeric:!0});this._options.sort(((t,i)=>e.compare(t,i)))}this._totalAddresses&&this._totalAddresses>this._addressesInPostcode.length&&this._fetchData(this._addressesInPostcode.length,this._addressesInPostcode)})).catch((t=>console.log(t)))}render(){let t;return this.osPlacesApiKey?this._osError?t=this._osError:0===this._totalAddresses&&(t=`No addresses found in postcode ${this.postcode}`):t="Missing OS Places API key",t?D(jy||(jy=Gy(['<script src="https://cdn.polyfill.io/v2/polyfill.min.js"><\/script>\n <div class="govuk-warning-text" role="status">\n <span class="govuk-warning-text__icon" aria-hidden="true">!</span>\n <strong class="govuk-warning-text__text">\n <span class="govuk-warning-text__assistive">Warning</span>\n ',"\n </strong>\n </div>"])),t):D(Ry||(Ry=Gy(['<script src="https://cdn.polyfill.io/v2/polyfill.min.js"><\/script>\n <link\n rel="stylesheet"\n href="https://cdn.jsdelivr.net/npm/accessible-autocomplete@2.0.4/dist/accessible-autocomplete.min.css"\n />\n <label class="govuk-label" htmlFor=',">",'</label>\n <div\n id="','-container"\n role="status"\n spellcheck="false"\n ></div>'])),this.id,this.label,this.id)}},t.AddressAutocomplete.styles=a(Fy),Ly([st({type:String})],t.AddressAutocomplete.prototype,"id",2),Ly([st({type:String})],t.AddressAutocomplete.prototype,"postcode",2),Ly([st({type:String})],t.AddressAutocomplete.prototype,"label",2),Ly([st({type:String})],t.AddressAutocomplete.prototype,"initialAddress",2),Ly([st({type:String})],t.AddressAutocomplete.prototype,"osPlacesApiKey",2),Ly([st({type:String})],t.AddressAutocomplete.prototype,"arrowStyle",2),Ly([lt()],t.AddressAutocomplete.prototype,"_totalAddresses",2),Ly([lt()],t.AddressAutocomplete.prototype,"_addressesInPostcode",2),Ly([lt()],t.AddressAutocomplete.prototype,"_options",2),Ly([lt()],t.AddressAutocomplete.prototype,"_selectedAddress",2),Ly([lt()],t.AddressAutocomplete.prototype,"_osError",2),t.AddressAutocomplete=Ly([rt("address-autocomplete")],t.AddressAutocomplete);var Ny,By=function(){return(By=Object.assign||function(t){for(var e,i=1,o=arguments.length;i<o;i++)for(var n in e=arguments[i])Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t}).apply(this,arguments)},qy=/^([a-z]{1,2}\d)([a-z])$/i,Wy=/[a-z]{2}$/i,Vy=/\d[a-z]{2}$/i,Uy=/^[a-z]{1,2}\d[a-z\d]?\s*\d[a-z]{2}$/i,Xy=/^[a-z]{1,2}/i,Ky={valid:!1,postcode:null,incode:null,outcode:null,area:null,district:null,subDistrict:null,sector:null,unit:null},Yy=function(t){return null===t?null:t[0]},Zy=/\s+/gi,$y=function(t){return t.replace(Zy,"").toUpperCase()},Hy=function(t,e){return $y(t).match(e)},Jy=function(t){return null!==t.match(Uy)},Qy=function(t){var e=t_(t);if(null===e)return null;var i=e_(t);return null===i?null:e+" "+i},t_=function(t){return Jy(t)?$y(t).replace(Vy,""):null},e_=function(t){if(!Jy(t))return null;var e=Hy(t,Vy);return Yy(e)},i_=function(t){if(!Jy(t))return null;var e=Hy(t,Xy);return Yy(e)},o_=function(t){var e=t_(t);if(null===e)return null;var i=e_(t);return null===i?null:e+" "+i[0]},n_=function(t){if(!Jy(t))return null;var e=Hy(t,Wy);return Yy(e)},r_=function(t){var e=t_(t);if(null===e)return null;var i=e.match(qy);return null===i?e:i[1]},a_=function(t){var e=t_(t);return null===e||null===e.match(qy)?null:e},s_=s`@charset "UTF-8";
|
6526
6550
|
.govuk-link {
|
6527
6551
|
font-family: "GDS Transport", arial, sans-serif;
|
6528
6552
|
-webkit-font-smoothing: antialiased;
|
@@ -12679,4 +12703,4 @@ x:-moz-any-link {
|
|
12679
12703
|
</label>
|
12680
12704
|
</h1>`:D`<label class="govuk-label" htmlFor=${this.id}
|
12681
12705
|
>${this.label}</label
|
12682
|
-
>`}render(){return D(Ny||(Ny=l_(u_(t=['<script src="https://cdn.polyfill.io/v2/polyfill.min.js"><\/script>\n <div class="govuk-form-group">\n ','\n <div id="postcode-hint" class="govuk-hint">',"</div>\n <span\n id=",'\n class="govuk-error-message"\n style="display:none"\n role="status"\n >\n <span class="govuk-visually-hidden">Error:</span>','\n </span>\n <input\n class="govuk-input govuk-input--width-10"\n id=','\n name="postcode"\n type="text"\n autocomplete="postal-code"\n spellcheck="false"\n aria-describedby="postcode-hint ','"\n .value=',"\n @input=","\n @blur=","\n @keyup=","\n />\n </div>
|
12706
|
+
>`}render(){return D(Ny||(Ny=l_(u_(t=['<script src="https://cdn.polyfill.io/v2/polyfill.min.js"><\/script>\n <div class="govuk-form-group">\n ','\n <div id="postcode-hint" class="govuk-hint">',"</div>\n <span\n id=",'\n class="govuk-error-message"\n style="display:none"\n role="status"\n >\n <span class="govuk-visually-hidden">Error:</span>','\n </span>\n <input\n class="govuk-input govuk-input--width-10"\n id=','\n name="postcode"\n type="text"\n autocomplete="postal-code"\n spellcheck="false"\n aria-describedby="postcode-hint ','"\n .value=',"\n @input=","\n @blur=","\n @keyup=",'\n tabindex="0"\n />\n </div>'],"raw",{value:l_(e||t.slice())}))),this._makeLabel(),this.hintText,this.errorId,this.errorMessage,this.id,this.errorId,this._postcode,this._onInputChange,this._onBlur,this._onKeyUp);var t,e}},t.PostcodeSearch.styles=a(s_),d_([st({type:String})],t.PostcodeSearch.prototype,"id",2),d_([st({type:String})],t.PostcodeSearch.prototype,"errorId",2),d_([st({type:String})],t.PostcodeSearch.prototype,"label",2),d_([st({type:String})],t.PostcodeSearch.prototype,"hintText",2),d_([st({type:String})],t.PostcodeSearch.prototype,"errorMessage",2),d_([st({type:Boolean})],t.PostcodeSearch.prototype,"onlyQuestionOnPage",2),d_([lt()],t.PostcodeSearch.prototype,"_postcode",2),d_([lt()],t.PostcodeSearch.prototype,"_sanitizedPostcode",2),d_([lt()],t.PostcodeSearch.prototype,"_showPostcodeError",2),t.PostcodeSearch=d_([rt("postcode-search")],t.PostcodeSearch),Object.defineProperty(t,"__esModule",{value:!0}),t[Symbol.toStringTag]="Module"}));
|