@mapvx/web-components 0.0.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (34) hide show
  1. package/LICENSE +17 -0
  2. package/README.md +118 -0
  3. package/dist/cjs/accessibility-DWoi6we_.cjs +1 -0
  4. package/dist/cjs/back_arrow-Cb1GjmUe.cjs +1 -0
  5. package/dist/cjs/consume-21nhePJt.cjs +11 -0
  6. package/dist/cjs/custom-map-BL0kilso.cjs +7 -0
  7. package/dist/cjs/floor-selector-Cz_c7JJ0.cjs +19 -0
  8. package/dist/cjs/icon-destination-point-C8Bl9rvO.cjs +1 -0
  9. package/dist/cjs/icon-origin-point-B0FLE42C.cjs +1 -0
  10. package/dist/cjs/index.cjs +1 -0
  11. package/dist/cjs/lazy-load-CPuIj6DF.cjs +60 -0
  12. package/dist/cjs/map-view-with-modal.cjs +13 -0
  13. package/dist/cjs/maplibre-gl-P-Xd6Hdn.cjs +1 -0
  14. package/dist/cjs/qr-modal-aISu7Wx-.cjs +15 -0
  15. package/dist/cjs/repeat_icon-DBYc7GBB.cjs +1 -0
  16. package/dist/cjs/route-options-dkKqmEfw.cjs +69 -0
  17. package/dist/cjs/route-view-totems.cjs +32 -0
  18. package/dist/cjs/walking-CDbgxjU4.cjs +1 -0
  19. package/dist/es/assets/accessibility-Cnj-vwGM.js +3 -0
  20. package/dist/es/assets/back_arrow-CUOAm8Zc.js +3 -0
  21. package/dist/es/assets/components-B7xPEQ89.js +3626 -0
  22. package/dist/es/assets/icon-destination-point-DY-ha1KN.js +3 -0
  23. package/dist/es/assets/icon-origin-point-v4_9Pmls.js +3 -0
  24. package/dist/es/assets/map-view-with-modal-CVtICvdT.js +137 -0
  25. package/dist/es/assets/maplibre-gl-KgJ_zm92.js +3 -0
  26. package/dist/es/assets/repeat_icon-CY61-fSZ.js +3 -0
  27. package/dist/es/assets/route-view-totems-DsANsRxr.js +373 -0
  28. package/dist/es/assets/utils-BXXPDum1.js +12476 -0
  29. package/dist/es/assets/walking-BmgeFukv.js +3 -0
  30. package/dist/es/index.js +2 -0
  31. package/dist/es/route-view-totems.js +2 -0
  32. package/dist/iife/map-view-with-modal.js +87 -0
  33. package/dist/iife/route-view-totems.js +212 -0
  34. package/package.json +91 -0
@@ -0,0 +1,87 @@
1
+ var MapVXMapViewWithModal=function(t){"use strict";
2
+ /**
3
+ * @license
4
+ * Copyright 2019 Google LLC
5
+ * SPDX-License-Identifier: BSD-3-Clause
6
+ */const e=globalThis,i=e.ShadowRoot&&(void 0===e.ShadyCSS||e.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,r=Symbol(),n=new WeakMap;let o=class{constructor(t,e,i){if(this._$cssResult$=!0,i!==r)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=t,this.t=e}get styleSheet(){let t=this.o;const e=this.t;if(i&&void 0===t){const i=void 0!==e&&1===e.length;i&&(t=n.get(e)),void 0===t&&((this.o=t=new CSSStyleSheet).replaceSync(this.cssText),i&&n.set(e,t))}return t}toString(){return this.cssText}};const a=t=>new o("string"==typeof t?t:t+"",void 0,r),s=(t,...e)=>{const i=1===t.length?t[0]:e.reduce(((e,i,r)=>e+(t=>{if(!0===t._$cssResult$)return t.cssText;if("number"==typeof t)return t;throw Error("Value passed to 'css' function must be a 'css' function result: "+t+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(i)+t[r+1]),t[0]);return new o(i,t,r)},l=i?t=>t:t=>t instanceof CSSStyleSheet?(t=>{let e="";for(const i of t.cssRules)e+=i.cssText;return a(e)})(t):t
7
+ /**
8
+ * @license
9
+ * Copyright 2017 Google LLC
10
+ * SPDX-License-Identifier: BSD-3-Clause
11
+ */,{is:c,defineProperty:u,getOwnPropertyDescriptor:h,getOwnPropertyNames:d,getOwnPropertySymbols:p,getPrototypeOf:f}=Object,m=globalThis,g=m.trustedTypes,y=g?g.emptyScript:"",_=m.reactiveElementPolyfillSupport,v=(t,e)=>t,b={toAttribute(t,e){switch(e){case Boolean:t=t?y:null;break;case Object:case Array:t=null==t?t:JSON.stringify(t)}return t},fromAttribute(t,e){let i=t;switch(e){case Boolean:i=null!==t;break;case Number:i=null===t?null:Number(t);break;case Object:case Array:try{i=JSON.parse(t)}catch(t){i=null}}return i}},x=(t,e)=>!c(t,e),w={attribute:!0,type:String,converter:b,reflect:!1,useDefault:!1,hasChanged:x};Symbol.metadata??=Symbol("metadata"),m.litPropertyMetadata??=new WeakMap;let k=class extends HTMLElement{static addInitializer(t){this._$Ei(),(this.l??=[]).push(t)}static get observedAttributes(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}static createProperty(t,e=w){if(e.state&&(e.attribute=!1),this._$Ei(),this.prototype.hasOwnProperty(t)&&((e=Object.create(e)).wrapped=!0),this.elementProperties.set(t,e),!e.noAccessor){const i=Symbol(),r=this.getPropertyDescriptor(t,i,e);void 0!==r&&u(this.prototype,t,r)}}static getPropertyDescriptor(t,e,i){const{get:r,set:n}=h(this.prototype,t)??{get(){return this[e]},set(t){this[e]=t}};return{get:r,set(e){const o=r?.call(this);n?.call(this,e),this.requestUpdate(t,o,i)},configurable:!0,enumerable:!0}}static getPropertyOptions(t){return this.elementProperties.get(t)??w}static _$Ei(){if(this.hasOwnProperty(v("elementProperties")))return;const t=f(this);t.finalize(),void 0!==t.l&&(this.l=[...t.l]),this.elementProperties=new Map(t.elementProperties)}static finalize(){if(this.hasOwnProperty(v("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(v("properties"))){const t=this.properties,e=[...d(t),...p(t)];for(const i of e)this.createProperty(i,t[i])}const t=this[Symbol.metadata];if(null!==t){const e=litPropertyMetadata.get(t);if(void 0!==e)for(const[t,i]of e)this.elementProperties.set(t,i)}this._$Eh=new Map;for(const[e,i]of this.elementProperties){const t=this._$Eu(e,i);void 0!==t&&this._$Eh.set(t,e)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(t){const e=[];if(Array.isArray(t)){const i=new Set(t.flat(1/0).reverse());for(const t of i)e.unshift(l(t))}else void 0!==t&&e.push(l(t));return e}static _$Eu(t,e){const i=e.attribute;return!1===i?void 0:"string"==typeof i?i:"string"==typeof t?t.toLowerCase():void 0}constructor(){super(),this._$Ep=void 0,this.isUpdatePending=!1,this.hasUpdated=!1,this._$Em=null,this._$Ev()}_$Ev(){this._$ES=new Promise((t=>this.enableUpdating=t)),this._$AL=new Map,this._$E_(),this.requestUpdate(),this.constructor.l?.forEach((t=>t(this)))}addController(t){(this._$EO??=new Set).add(t),void 0!==this.renderRoot&&this.isConnected&&t.hostConnected?.()}removeController(t){this._$EO?.delete(t)}_$E_(){const t=new Map,e=this.constructor.elementProperties;for(const i of e.keys())this.hasOwnProperty(i)&&(t.set(i,this[i]),delete this[i]);t.size>0&&(this._$Ep=t)}createRenderRoot(){const t=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return((t,r)=>{if(i)t.adoptedStyleSheets=r.map((t=>t instanceof CSSStyleSheet?t:t.styleSheet));else for(const i of r){const r=document.createElement("style"),n=e.litNonce;void 0!==n&&r.setAttribute("nonce",n),r.textContent=i.cssText,t.appendChild(r)}})(t,this.constructor.elementStyles),t}connectedCallback(){this.renderRoot??=this.createRenderRoot(),this.enableUpdating(!0),this._$EO?.forEach((t=>t.hostConnected?.()))}enableUpdating(t){}disconnectedCallback(){this._$EO?.forEach((t=>t.hostDisconnected?.()))}attributeChangedCallback(t,e,i){this._$AK(t,i)}_$ET(t,e){const i=this.constructor.elementProperties.get(t),r=this.constructor._$Eu(t,i);if(void 0!==r&&!0===i.reflect){const n=(void 0!==i.converter?.toAttribute?i.converter:b).toAttribute(e,i.type);this._$Em=t,null==n?this.removeAttribute(r):this.setAttribute(r,n),this._$Em=null}}_$AK(t,e){const i=this.constructor,r=i._$Eh.get(t);if(void 0!==r&&this._$Em!==r){const t=i.getPropertyOptions(r),n="function"==typeof t.converter?{fromAttribute:t.converter}:void 0!==t.converter?.fromAttribute?t.converter:b;this._$Em=r,this[r]=n.fromAttribute(e,t.type)??this._$Ej?.get(r)??null,this._$Em=null}}requestUpdate(t,e,i){if(void 0!==t){const r=this.constructor,n=this[t];if(i??=r.getPropertyOptions(t),!((i.hasChanged??x)(n,e)||i.useDefault&&i.reflect&&n===this._$Ej?.get(t)&&!this.hasAttribute(r._$Eu(t,i))))return;this.C(t,e,i)}!1===this.isUpdatePending&&(this._$ES=this._$EP())}C(t,e,{useDefault:i,reflect:r,wrapped:n},o){i&&!(this._$Ej??=new Map).has(t)&&(this._$Ej.set(t,o??e??this[t]),!0!==n||void 0!==o)||(this._$AL.has(t)||(this.hasUpdated||i||(e=void 0),this._$AL.set(t,e)),!0===r&&this._$Em!==t&&(this._$Eq??=new Set).add(t))}async _$EP(){this.isUpdatePending=!0;try{await this._$ES}catch(t){Promise.reject(t)}const t=this.scheduleUpdate();return null!=t&&await t,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){if(!this.isUpdatePending)return;if(!this.hasUpdated){if(this.renderRoot??=this.createRenderRoot(),this._$Ep){for(const[t,e]of this._$Ep)this[t]=e;this._$Ep=void 0}const t=this.constructor.elementProperties;if(t.size>0)for(const[e,i]of t){const{wrapped:t}=i,r=this[e];!0!==t||this._$AL.has(e)||void 0===r||this.C(e,void 0,i,r)}}let t=!1;const e=this._$AL;try{t=this.shouldUpdate(e),t?(this.willUpdate(e),this._$EO?.forEach((t=>t.hostUpdate?.())),this.update(e)):this._$EM()}catch(e){throw t=!1,this._$EM(),e}t&&this._$AE(e)}willUpdate(t){}_$AE(t){this._$EO?.forEach((t=>t.hostUpdated?.())),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(t)),this.updated(t)}_$EM(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$ES}shouldUpdate(t){return!0}update(t){this._$Eq&&=this._$Eq.forEach((t=>this._$ET(t,this[t]))),this._$EM()}updated(t){}firstUpdated(t){}};k.elementStyles=[],k.shadowRootOptions={mode:"open"},k[v("elementProperties")]=new Map,k[v("finalized")]=new Map,_?.({ReactiveElement:k}),(m.reactiveElementVersions??=[]).push("2.1.0");
12
+ /**
13
+ * @license
14
+ * Copyright 2017 Google LLC
15
+ * SPDX-License-Identifier: BSD-3-Clause
16
+ */
17
+ const E=globalThis,S=E.trustedTypes,I=S?S.createPolicy("lit-html",{createHTML:t=>t}):void 0,C="$lit$",T=`lit$${Math.random().toFixed(9).slice(2)}$`,A="?"+T,P=`<${A}>`,M=document,L=()=>M.createComment(""),z=t=>null===t||"object"!=typeof t&&"function"!=typeof t,D=Array.isArray,R="[ \t\n\f\r]",O=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,F=/-->/g,B=/>/g,N=RegExp(`>|${R}(?:([^\\s"'>=/]+)(${R}*=${R}*(?:[^ \t\n\f\r"'\`<>=]|("|')|))|$)`,"g"),j=/'/g,V=/"/g,U=/^(?:script|style|textarea|title)$/i,q=(t=>(e,...i)=>({_$litType$:t,strings:e,values:i}))(1),$=Symbol.for("lit-noChange"),G=Symbol.for("lit-nothing"),H=new WeakMap,Z=M.createTreeWalker(M,129);function W(t,e){if(!D(t)||!t.hasOwnProperty("raw"))throw Error("invalid template strings array");return void 0!==I?I.createHTML(e):e}const X=(t,e)=>{const i=t.length-1,r=[];let n,o=2===e?"<svg>":3===e?"<math>":"",a=O;for(let s=0;s<i;s++){const e=t[s];let i,l,c=-1,u=0;for(;u<e.length&&(a.lastIndex=u,l=a.exec(e),null!==l);)u=a.lastIndex,a===O?"!--"===l[1]?a=F:void 0!==l[1]?a=B:void 0!==l[2]?(U.test(l[2])&&(n=RegExp("</"+l[2],"g")),a=N):void 0!==l[3]&&(a=N):a===N?">"===l[0]?(a=n??O,c=-1):void 0===l[1]?c=-2:(c=a.lastIndex-l[2].length,i=l[1],a=void 0===l[3]?N:'"'===l[3]?V:j):a===V||a===j?a=N:a===F||a===B?a=O:(a=N,n=void 0);const h=a===N&&t[s+1].startsWith("/>")?" ":"";o+=a===O?e+P:c>=0?(r.push(i),e.slice(0,c)+C+e.slice(c)+T+h):e+T+(-2===c?s:h)}return[W(t,o+(t[i]||"<?>")+(2===e?"</svg>":3===e?"</math>":"")),r]};class J{constructor({strings:t,_$litType$:e},i){let r;this.parts=[];let n=0,o=0;const a=t.length-1,s=this.parts,[l,c]=X(t,e);if(this.el=J.createElement(l,i),Z.currentNode=this.el.content,2===e||3===e){const t=this.el.content.firstChild;t.replaceWith(...t.childNodes)}for(;null!==(r=Z.nextNode())&&s.length<a;){if(1===r.nodeType){if(r.hasAttributes())for(const t of r.getAttributeNames())if(t.endsWith(C)){const e=c[o++],i=r.getAttribute(t).split(T),a=/([.?@])?(.*)/.exec(e);s.push({type:1,index:n,name:a[2],strings:i,ctor:"."===a[1]?et:"?"===a[1]?it:"@"===a[1]?rt:tt}),r.removeAttribute(t)}else t.startsWith(T)&&(s.push({type:6,index:n}),r.removeAttribute(t));if(U.test(r.tagName)){const t=r.textContent.split(T),e=t.length-1;if(e>0){r.textContent=S?S.emptyScript:"";for(let i=0;i<e;i++)r.append(t[i],L()),Z.nextNode(),s.push({type:2,index:++n});r.append(t[e],L())}}}else if(8===r.nodeType)if(r.data===A)s.push({type:2,index:n});else{let t=-1;for(;-1!==(t=r.data.indexOf(T,t+1));)s.push({type:7,index:n}),t+=T.length-1}n++}}static createElement(t,e){const i=M.createElement("template");return i.innerHTML=t,i}}function K(t,e,i=t,r){if(e===$)return e;let n=void 0!==r?i._$Co?.[r]:i._$Cl;const o=z(e)?void 0:e._$litDirective$;return n?.constructor!==o&&(n?._$AO?.(!1),void 0===o?n=void 0:(n=new o(t),n._$AT(t,i,r)),void 0!==r?(i._$Co??=[])[r]=n:i._$Cl=n),void 0!==n&&(e=K(t,n._$AS(t,e.values),n,r)),e}class Y{constructor(t,e){this._$AV=[],this._$AN=void 0,this._$AD=t,this._$AM=e}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}u(t){const{el:{content:e},parts:i}=this._$AD,r=(t?.creationScope??M).importNode(e,!0);Z.currentNode=r;let n=Z.nextNode(),o=0,a=0,s=i[0];for(;void 0!==s;){if(o===s.index){let e;2===s.type?e=new Q(n,n.nextSibling,this,t):1===s.type?e=new s.ctor(n,s.name,s.strings,this,t):6===s.type&&(e=new nt(n,this,t)),this._$AV.push(e),s=i[++a]}o!==s?.index&&(n=Z.nextNode(),o++)}return Z.currentNode=M,r}p(t){let e=0;for(const i of this._$AV)void 0!==i&&(void 0!==i.strings?(i._$AI(t,i,e),e+=i.strings.length-2):i._$AI(t[e])),e++}}class Q{get _$AU(){return this._$AM?._$AU??this._$Cv}constructor(t,e,i,r){this.type=2,this._$AH=G,this._$AN=void 0,this._$AA=t,this._$AB=e,this._$AM=i,this.options=r,this._$Cv=r?.isConnected??!0}get parentNode(){let t=this._$AA.parentNode;const e=this._$AM;return void 0!==e&&11===t?.nodeType&&(t=e.parentNode),t}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(t,e=this){t=K(this,t,e),z(t)?t===G||null==t||""===t?(this._$AH!==G&&this._$AR(),this._$AH=G):t!==this._$AH&&t!==$&&this._(t):void 0!==t._$litType$?this.$(t):void 0!==t.nodeType?this.T(t):(t=>D(t)||"function"==typeof t?.[Symbol.iterator])(t)?this.k(t):this._(t)}O(t){return this._$AA.parentNode.insertBefore(t,this._$AB)}T(t){this._$AH!==t&&(this._$AR(),this._$AH=this.O(t))}_(t){this._$AH!==G&&z(this._$AH)?this._$AA.nextSibling.data=t:this.T(M.createTextNode(t)),this._$AH=t}$(t){const{values:e,_$litType$:i}=t,r="number"==typeof i?this._$AC(t):(void 0===i.el&&(i.el=J.createElement(W(i.h,i.h[0]),this.options)),i);if(this._$AH?._$AD===r)this._$AH.p(e);else{const t=new Y(r,this),i=t.u(this.options);t.p(e),this.T(i),this._$AH=t}}_$AC(t){let e=H.get(t.strings);return void 0===e&&H.set(t.strings,e=new J(t)),e}k(t){D(this._$AH)||(this._$AH=[],this._$AR());const e=this._$AH;let i,r=0;for(const n of t)r===e.length?e.push(i=new Q(this.O(L()),this.O(L()),this,this.options)):i=e[r],i._$AI(n),r++;r<e.length&&(this._$AR(i&&i._$AB.nextSibling,r),e.length=r)}_$AR(t=this._$AA.nextSibling,e){for(this._$AP?.(!1,!0,e);t&&t!==this._$AB;){const e=t.nextSibling;t.remove(),t=e}}setConnected(t){void 0===this._$AM&&(this._$Cv=t,this._$AP?.(t))}}class tt{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(t,e,i,r,n){this.type=1,this._$AH=G,this._$AN=void 0,this.element=t,this.name=e,this._$AM=r,this.options=n,i.length>2||""!==i[0]||""!==i[1]?(this._$AH=Array(i.length-1).fill(new String),this.strings=i):this._$AH=G}_$AI(t,e=this,i,r){const n=this.strings;let o=!1;if(void 0===n)t=K(this,t,e,0),o=!z(t)||t!==this._$AH&&t!==$,o&&(this._$AH=t);else{const r=t;let a,s;for(t=n[0],a=0;a<n.length-1;a++)s=K(this,r[i+a],e,a),s===$&&(s=this._$AH[a]),o||=!z(s)||s!==this._$AH[a],s===G?t=G:t!==G&&(t+=(s??"")+n[a+1]),this._$AH[a]=s}o&&!r&&this.j(t)}j(t){t===G?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,t??"")}}class et extends tt{constructor(){super(...arguments),this.type=3}j(t){this.element[this.name]=t===G?void 0:t}}class it extends tt{constructor(){super(...arguments),this.type=4}j(t){this.element.toggleAttribute(this.name,!!t&&t!==G)}}class rt extends tt{constructor(t,e,i,r,n){super(t,e,i,r,n),this.type=5}_$AI(t,e=this){if((t=K(this,t,e,0)??G)===$)return;const i=this._$AH,r=t===G&&i!==G||t.capture!==i.capture||t.once!==i.once||t.passive!==i.passive,n=t!==G&&(i===G||r);r&&this.element.removeEventListener(this.name,this,i),n&&this.element.addEventListener(this.name,this,t),this._$AH=t}handleEvent(t){"function"==typeof this._$AH?this._$AH.call(this.options?.host??this.element,t):this._$AH.handleEvent(t)}}class nt{constructor(t,e,i){this.element=t,this.type=6,this._$AN=void 0,this._$AM=e,this.options=i}get _$AU(){return this._$AM._$AU}_$AI(t){K(this,t)}}const ot=E.litHtmlPolyfillSupport;ot?.(J,Q),(E.litHtmlVersions??=[]).push("3.3.0");const at=globalThis;
18
+ /**
19
+ * @license
20
+ * Copyright 2017 Google LLC
21
+ * SPDX-License-Identifier: BSD-3-Clause
22
+ */let st=class extends k{constructor(){super(...arguments),this.renderOptions={host:this},this._$Do=void 0}createRenderRoot(){const t=super.createRenderRoot();return this.renderOptions.renderBefore??=t.firstChild,t}update(t){const e=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(t),this._$Do=((t,e,i)=>{const r=i?.renderBefore??e;let n=r._$litPart$;if(void 0===n){const t=i?.renderBefore??null;r._$litPart$=n=new Q(e.insertBefore(L(),t),t,void 0,i??{})}return n._$AI(t),n})(e,this.renderRoot,this.renderOptions)}connectedCallback(){super.connectedCallback(),this._$Do?.setConnected(!0)}disconnectedCallback(){super.disconnectedCallback(),this._$Do?.setConnected(!1)}render(){return $}};st._$litElement$=!0,st.finalized=!0,at.litElementHydrateSupport?.({LitElement:st});const lt=at.litElementPolyfillSupport;lt?.({LitElement:st}),(at.litElementVersions??=[]).push("4.2.0");
23
+ /**
24
+ * @license
25
+ * Copyright 2017 Google LLC
26
+ * SPDX-License-Identifier: BSD-3-Clause
27
+ */
28
+ const ct=t=>(e,i)=>{void 0!==i?i.addInitializer((()=>{customElements.define(t,e)})):customElements.define(t,e)}
29
+ /**
30
+ * @license
31
+ * Copyright 2017 Google LLC
32
+ * SPDX-License-Identifier: BSD-3-Clause
33
+ */,ut={attribute:!0,type:String,converter:b,reflect:!1,hasChanged:x},ht=(t=ut,e,i)=>{const{kind:r,metadata:n}=i;let o=globalThis.litPropertyMetadata.get(n);if(void 0===o&&globalThis.litPropertyMetadata.set(n,o=new Map),"setter"===r&&((t=Object.create(t)).wrapped=!0),o.set(i.name,t),"accessor"===r){const{name:r}=i;return{set(i){const n=e.get.call(this);e.set.call(this,i),this.requestUpdate(r,n,t)},init(e){return void 0!==e&&this.C(r,void 0,t,e),e}}}if("setter"===r){const{name:r}=i;return function(i){const n=this[r];e.call(this,i),this.requestUpdate(r,n,t)}}throw Error("Unsupported decorator location: "+r)};function dt(t){return(e,i)=>"object"==typeof i?ht(t,e,i):((t,e,i)=>{const r=e.hasOwnProperty(i);return e.constructor.createProperty(i,t),r?Object.getOwnPropertyDescriptor(e,i):void 0})(t,e,i)}var pt,ft={exports:{}};var mt,gt=(pt||(pt=1,mt=ft,function(t,e){mt.exports=e()}(0,(()=>{return t={276:function(){!function(t){t.console||(t.console={});for(var e,i,r=t.console,n=function(){},o=["memory"],a="assert,clear,count,debug,dir,dirxml,error,exception,group,groupCollapsed,groupEnd,info,log,markTimeline,profile,profiles,profileEnd,show,table,time,timeEnd,timeline,timelineEnd,timeStamp,trace,warn".split(",");e=o.pop();)r[e]||(r[e]={});for(;i=a.pop();)r[i]||(r[i]=n)}("undefined"==typeof window?this:window)},180:function(t,e,i){var r,n,o;n=[i(124)],void 0===(o="function"==typeof(r=function(t){var e=/(^|@)\S+:\d+/,i=/^\s*at .*(\S+:\d+|\(native\))/m,r=/^(eval@)?(\[native code])?$/;return{parse:function(t){if(void 0!==t.stacktrace||void 0!==t["opera#sourceloc"])return this.parseOpera(t);if(t.stack&&t.stack.match(i))return this.parseV8OrIE(t);if(t.stack)return this.parseFFOrSafari(t);throw new Error("Cannot parse given Error object")},extractLocation:function(t){if(-1===t.indexOf(":"))return[t];var e=/(.+?)(?::(\d+))?(?::(\d+))?$/.exec(t.replace(/[()]/g,""));return[e[1],e[2]||void 0,e[3]||void 0]},parseV8OrIE:function(e){return e.stack.split("\n").filter((function(t){return!!t.match(i)}),this).map((function(e){e.indexOf("(eval ")>-1&&(e=e.replace(/eval code/g,"eval").replace(/(\(eval at [^()]*)|(\),.*$)/g,""));var i=e.replace(/^\s+/,"").replace(/\(eval code/g,"("),r=i.match(/ (\((.+):(\d+):(\d+)\)$)/),n=(i=r?i.replace(r[0],""):i).split(/\s+/).slice(1),o=this.extractLocation(r?r[1]:n.pop()),a=n.join(" ")||void 0,s=["eval","<anonymous>"].indexOf(o[0])>-1?void 0:o[0];return new t({functionName:a,fileName:s,lineNumber:o[1],columnNumber:o[2],source:e})}),this)},parseFFOrSafari:function(e){return e.stack.split("\n").filter((function(t){return!t.match(r)}),this).map((function(e){if(e.indexOf(" > eval")>-1&&(e=e.replace(/ line (\d+)(?: > eval line \d+)* > eval:\d+:\d+/g,":$1")),-1===e.indexOf("@")&&-1===e.indexOf(":"))return new t({functionName:e});var i=/((.*".+"[^@]*)?[^@]*)(?:@)/,r=e.match(i),n=r&&r[1]?r[1]:void 0,o=this.extractLocation(e.replace(i,""));return new t({functionName:n,fileName:o[0],lineNumber:o[1],columnNumber:o[2],source:e})}),this)},parseOpera:function(t){return!t.stacktrace||t.message.indexOf("\n")>-1&&t.message.split("\n").length>t.stacktrace.split("\n").length?this.parseOpera9(t):t.stack?this.parseOpera11(t):this.parseOpera10(t)},parseOpera9:function(e){for(var i=/Line (\d+).*script (?:in )?(\S+)/i,r=e.message.split("\n"),n=[],o=2,a=r.length;o<a;o+=2){var s=i.exec(r[o]);s&&n.push(new t({fileName:s[2],lineNumber:s[1],source:r[o]}))}return n},parseOpera10:function(e){for(var i=/Line (\d+).*script (?:in )?(\S+)(?:: In function (\S+))?$/i,r=e.stacktrace.split("\n"),n=[],o=0,a=r.length;o<a;o+=2){var s=i.exec(r[o]);s&&n.push(new t({functionName:s[3]||void 0,fileName:s[2],lineNumber:s[1],source:r[o]}))}return n},parseOpera11:function(i){return i.stack.split("\n").filter((function(t){return!!t.match(e)&&!t.match(/^Error created at/)}),this).map((function(e){var i,r=e.split("@"),n=this.extractLocation(r.pop()),o=r.shift()||"",a=o.replace(/<anonymous function(: (\w+))?>/,"$2").replace(/\([^)]*\)/g,"")||void 0;o.match(/\(([^)]*)\)/)&&(i=o.replace(/^[^(]+\(([^)]*)\)$/,"$1"));var s=void 0===i||"[arguments not available]"===i?void 0:i.split(",");return new t({functionName:a,args:s,fileName:n[0],lineNumber:n[1],columnNumber:n[2],source:e})}),this)}}})?r.apply(e,n):r)||(t.exports=o)},124:function(t,e){var i,r;void 0===(r="function"==typeof(i=function(){function t(t){return!isNaN(parseFloat(t))&&isFinite(t)}function e(t){return t.charAt(0).toUpperCase()+t.substring(1)}function i(t){return function(){return this[t]}}var r=["isConstructor","isEval","isNative","isToplevel"],n=["columnNumber","lineNumber"],o=["fileName","functionName","source"],a=r.concat(n,o,["args"],["evalOrigin"]);function s(t){if(t)for(var i=0;i<a.length;i++)void 0!==t[a[i]]&&this["set"+e(a[i])](t[a[i]])}s.prototype={getArgs:function(){return this.args},setArgs:function(t){if("[object Array]"!==Object.prototype.toString.call(t))throw new TypeError("Args must be an Array");this.args=t},getEvalOrigin:function(){return this.evalOrigin},setEvalOrigin:function(t){if(t instanceof s)this.evalOrigin=t;else{if(!(t instanceof Object))throw new TypeError("Eval Origin must be an Object or StackFrame");this.evalOrigin=new s(t)}},toString:function(){var t=this.getFileName()||"",e=this.getLineNumber()||"",i=this.getColumnNumber()||"",r=this.getFunctionName()||"";return this.getIsEval()?t?"[eval] ("+t+":"+e+":"+i+")":"[eval]:"+e+":"+i:r?r+" ("+t+":"+e+":"+i+")":t+":"+e+":"+i}},s.fromString=function(t){var e=t.indexOf("("),i=t.lastIndexOf(")"),r=t.substring(0,e),n=t.substring(e+1,i).split(","),o=t.substring(i+1);if(0===o.indexOf("@"))var a=/@(.+?)(?::(\d+))?(?::(\d+))?$/.exec(o,""),l=a[1],c=a[2],u=a[3];return new s({functionName:r,args:n||void 0,fileName:l,lineNumber:c||void 0,columnNumber:u||void 0})};for(var l=0;l<r.length;l++)s.prototype["get"+e(r[l])]=i(r[l]),s.prototype["set"+e(r[l])]=function(t){return function(e){this[t]=Boolean(e)}}(r[l]);for(var c=0;c<n.length;c++)s.prototype["get"+e(n[c])]=i(n[c]),s.prototype["set"+e(n[c])]=function(e){return function(i){if(!t(i))throw new TypeError(e+" must be a Number");this[e]=Number(i)}}(n[c]);for(var u=0;u<o.length;u++)s.prototype["get"+e(o[u])]=i(o[u]),s.prototype["set"+e(o[u])]=function(t){return function(e){this[t]=String(e)}}(o[u]);return s})?i.apply(e,[]):i)||(t.exports=r)},815:(t,e,i)=>{var r=i(702),n=i(817),o={hostname:"api.rollbar.com",path:"/api/1/item/",search:null,version:"1",protocol:"https:",port:443};function a(t,e,i,r,n){this.options=t,this.transport=e,this.url=i,this.truncation=r,this.jsonBackup=n,this.accessToken=t.accessToken,this.transportOptions=s(t,i)}function s(t,e){return n.getTransportFromOptions(t,o,e)}a.prototype.postItem=function(t,e){var i=n.transportOptions(this.transportOptions,"POST"),r=n.buildPayload(this.accessToken,t,this.jsonBackup),o=this;setTimeout((function(){o.transport.post(o.accessToken,i,r,e)}),0)},a.prototype.buildJsonPayload=function(t,e){var i,o=n.buildPayload(this.accessToken,t,this.jsonBackup);return(i=this.truncation?this.truncation.truncate(o):r.stringify(o)).error?(e&&e(i.error),null):i.value},a.prototype.postJsonPayload=function(t,e){var i=n.transportOptions(this.transportOptions,"POST");this.transport.postJsonPayload(this.accessToken,i,t,e)},a.prototype.configure=function(t){var e=this.oldOptions;return this.options=r.merge(e,t),this.transportOptions=s(this.options,this.url),void 0!==this.options.accessToken&&(this.accessToken=this.options.accessToken),this},t.exports=a},817:(t,e,i)=>{var r=i(702);t.exports={buildPayload:function(t,e,i){if(!r.isType(e.context,"string")){var n=r.stringify(e.context,i);n.error?e.context="Error: could not serialize 'context'":e.context=n.value||"",e.context.length>255&&(e.context=e.context.substr(0,255))}return{access_token:t,data:e}},getTransportFromOptions:function(t,e,i){var r=e.hostname,n=e.protocol,o=e.port,a=e.path,s=e.search,l=t.timeout,c=function(t){var e="undefined"!=typeof window&&window||"undefined"!=typeof self&&self,i=t.defaultTransport||"xhr";return void 0===e.fetch&&(i="xhr"),void 0===e.XMLHttpRequest&&(i="fetch"),i}(t),u=t.proxy;if(t.endpoint){var h=i.parse(t.endpoint);r=h.hostname,n=h.protocol,o=h.port,a=h.pathname,s=h.search}return{timeout:l,hostname:r,protocol:n,port:o,path:a,search:s,proxy:u,transport:c}},transportOptions:function(t,e){var i=t.protocol||"https:",r=t.port||("http:"===i?80:"https:"===i?443:void 0),n=t.hostname,o=t.path,a=t.timeout,s=t.transport;return t.search&&(o+=t.search),t.proxy&&(o=i+"//"+n+o,n=t.proxy.host||t.proxy.hostname,r=t.proxy.port,i=t.proxy.protocol||i),{timeout:a,protocol:i,hostname:n,path:o,port:r,method:e,transport:s}},appendPathToPath:function(t,e){var i=/\/$/.test(t),r=/^\//.test(e);return i&&r?e=e.substring(1):i||r||(e="/"+e),t+e}}},739:(t,e,i)=>{var r=i(343);"undefined"==typeof window||window._rollbarStartTime||(window._rollbarStartTime=(new Date).getTime()),t.exports=r},403:(t,e,i)=>{var r=i(562),n=i(702),o=i(815),a=i(802),s=i(349),l=i(477),c=i(509),u=i(860),h=i(417),d=i(172),p=i(61),f=i(303);function m(t,e){this.options=n.handleOptions(w,t,null,a),this.options._configuredOptions=t;var i=this.components.telemeter,s=this.components.instrumenter,f=this.components.polyfillJSON;this.wrapGlobals=this.components.wrapGlobals,this.scrub=this.components.scrub;var m=this.components.truncation,g=new l(m),y=new o(this.options,g,c,m);i&&(this.telemeter=new i(this.options)),this.client=e||new r(this.options,y,a,this.telemeter,"browser");var _=v(),b="undefined"!=typeof document&&document;this.isChrome=_.chrome&&_.chrome.runtime,this.anonymousErrorsPending=0,function(t,e,i){t.addTransform(u.handleDomException).addTransform(u.handleItemWithError).addTransform(u.ensureItemHasSomethingToSay).addTransform(u.addBaseInfo).addTransform(u.addRequestInfo(i)).addTransform(u.addClientInfo(i)).addTransform(u.addPluginInfo(i)).addTransform(u.addBody).addTransform(h.addMessageWithError).addTransform(h.addTelemetryData).addTransform(h.addConfigToPayload).addTransform(u.addScrubber(e.scrub)).addTransform(h.addPayloadOptions).addTransform(h.userTransform(a)).addTransform(h.addConfiguredOptions).addTransform(h.addDiagnosticKeys).addTransform(h.itemToPayload)}(this.client.notifier,this,_),this.client.queue.addPredicate(p.checkLevel).addPredicate(d.checkIgnore).addPredicate(p.userCheckIgnore(a)).addPredicate(p.urlIsNotBlockListed(a)).addPredicate(p.urlIsSafeListed(a)).addPredicate(p.messageIsIgnored(a)),this.setupUnhandledCapture(),s&&(this.instrumenter=new s(this.options,this.client.telemeter,this,_,b),this.instrumenter.instrument()),n.setupJSON(f),this.rollbar=this}var g=null;function y(t){var e="Rollbar is not initialized";a.error(e),t&&t(new Error(e))}function _(t){for(var e=0,i=t.length;e<i;++e)if(n.isFunction(t[e]))return t[e]}function v(){return"undefined"!=typeof window&&window||"undefined"!=typeof self&&self}m.init=function(t,e){return g?g.global(t).configure(t):g=new m(t,e)},m.prototype.components={},m.setComponents=function(t){m.prototype.components=t},m.prototype.global=function(t){return this.client.global(t),this},m.global=function(t){if(g)return g.global(t);y()},m.prototype.configure=function(t,e){var i=this.options,r={};return e&&(r={payload:e}),this.options=n.handleOptions(i,t,r,a),this.options._configuredOptions=n.handleOptions(i._configuredOptions,t,r),this.client.configure(this.options,e),this.instrumenter&&this.instrumenter.configure(this.options),this.setupUnhandledCapture(),this},m.configure=function(t,e){if(g)return g.configure(t,e);y()},m.prototype.lastError=function(){return this.client.lastError},m.lastError=function(){if(g)return g.lastError();y()},m.prototype.log=function(){var t=this._createItem(arguments),e=t.uuid;return this.client.log(t),{uuid:e}},m.log=function(){if(g)return g.log.apply(g,arguments);y(_(arguments))},m.prototype.debug=function(){var t=this._createItem(arguments),e=t.uuid;return this.client.debug(t),{uuid:e}},m.debug=function(){if(g)return g.debug.apply(g,arguments);y(_(arguments))},m.prototype.info=function(){var t=this._createItem(arguments),e=t.uuid;return this.client.info(t),{uuid:e}},m.info=function(){if(g)return g.info.apply(g,arguments);y(_(arguments))},m.prototype.warn=function(){var t=this._createItem(arguments),e=t.uuid;return this.client.warn(t),{uuid:e}},m.warn=function(){if(g)return g.warn.apply(g,arguments);y(_(arguments))},m.prototype.warning=function(){var t=this._createItem(arguments),e=t.uuid;return this.client.warning(t),{uuid:e}},m.warning=function(){if(g)return g.warning.apply(g,arguments);y(_(arguments))},m.prototype.error=function(){var t=this._createItem(arguments),e=t.uuid;return this.client.error(t),{uuid:e}},m.error=function(){if(g)return g.error.apply(g,arguments);y(_(arguments))},m.prototype.critical=function(){var t=this._createItem(arguments),e=t.uuid;return this.client.critical(t),{uuid:e}},m.critical=function(){if(g)return g.critical.apply(g,arguments);y(_(arguments))},m.prototype.buildJsonPayload=function(t){return this.client.buildJsonPayload(t)},m.buildJsonPayload=function(){if(g)return g.buildJsonPayload.apply(g,arguments);y()},m.prototype.sendJsonPayload=function(t){return this.client.sendJsonPayload(t)},m.sendJsonPayload=function(){if(g)return g.sendJsonPayload.apply(g,arguments);y()},m.prototype.setupUnhandledCapture=function(){var t=v();this.unhandledExceptionsInitialized||(this.options.captureUncaught||this.options.handleUncaughtExceptions)&&(s.captureUncaughtExceptions(t,this),this.wrapGlobals&&this.options.wrapGlobalEventHandlers&&this.wrapGlobals(t,this),this.unhandledExceptionsInitialized=!0),this.unhandledRejectionsInitialized||(this.options.captureUnhandledRejections||this.options.handleUnhandledRejections)&&(s.captureUnhandledRejections(t,this),this.unhandledRejectionsInitialized=!0)},m.prototype.handleUncaughtException=function(t,e,i,r,o,a){if(this.options.captureUncaught||this.options.handleUncaughtExceptions){if(this.options.inspectAnonymousErrors&&this.isChrome&&null===o&&""===e)return"anonymous";var s,l=n.makeUnhandledStackInfo(t,e,i,r,o,"onerror","uncaught exception",f);n.isError(o)?(s=this._createItem([t,o,a]))._unhandledStackInfo=l:n.isError(e)?(s=this._createItem([t,e,a]))._unhandledStackInfo=l:(s=this._createItem([t,a])).stackInfo=l,s.level=this.options.uncaughtErrorLevel,s._isUncaught=!0,this.client.log(s)}},m.prototype.handleAnonymousErrors=function(){if(this.options.inspectAnonymousErrors&&this.isChrome){var t=this;try{Error.prepareStackTrace=function(e,i){if(t.options.inspectAnonymousErrors&&t.anonymousErrorsPending){if(t.anonymousErrorsPending-=1,!e)return;e._isAnonymous=!0,t.handleUncaughtException(e.message,null,null,null,e)}return e.stack}}catch(t){this.options.inspectAnonymousErrors=!1,this.error("anonymous error handler failed",t)}}},m.prototype.handleUnhandledRejection=function(t,e){if(this.options.captureUnhandledRejections||this.options.handleUnhandledRejections){var i="unhandled rejection was null or undefined!";if(t)if(t.message)i=t.message;else{var r=n.stringify(t);r.value&&(i=r.value)}var o,a=t&&t._rollbarContext||e&&e._rollbarContext;n.isError(t)?o=this._createItem([i,t,a]):(o=this._createItem([i,t,a])).stackInfo=n.makeUnhandledStackInfo(i,"",0,0,null,"unhandledrejection","",f),o.level=this.options.uncaughtErrorLevel,o._isUncaught=!0,o._originalArgs=o._originalArgs||[],o._originalArgs.push(e),this.client.log(o)}},m.prototype.wrap=function(t,e,i){try{var r;if(r=n.isFunction(e)?e:function(){return e||{}},!n.isFunction(t))return t;if(t._isWrap)return t;if(!t._rollbar_wrapped&&(t._rollbar_wrapped=function(){i&&n.isFunction(i)&&i.apply(this,arguments);try{return t.apply(this,arguments)}catch(i){var e=i;throw e&&window._rollbarWrappedError!==e&&(n.isType(e,"string")&&(e=new String(e)),e._rollbarContext=r()||{},e._rollbarContext._wrappedSource=t.toString(),window._rollbarWrappedError=e),e}},t._rollbar_wrapped._isWrap=!0,t.hasOwnProperty))for(var o in t)t.hasOwnProperty(o)&&"_rollbar_wrapped"!==o&&(t._rollbar_wrapped[o]=t[o]);return t._rollbar_wrapped}catch(e){return t}},m.wrap=function(t,e){if(g)return g.wrap(t,e);y()},m.prototype.captureEvent=function(){var t=n.createTelemetryEvent(arguments);return this.client.captureEvent(t.type,t.metadata,t.level)},m.captureEvent=function(){if(g)return g.captureEvent.apply(g,arguments);y()},m.prototype.captureDomContentLoaded=function(t,e){return e||(e=new Date),this.client.captureDomContentLoaded(e)},m.prototype.captureLoad=function(t,e){return e||(e=new Date),this.client.captureLoad(e)},m.prototype.loadFull=function(){a.info("Unexpected Rollbar.loadFull() called on a Notifier instance. This can happen when Rollbar is loaded multiple times.")},m.prototype._createItem=function(t){return n.createItem(t,a,this)};var b=i(948),x=i(677),w={version:b.version,scrubFields:x.scrubFields,logLevel:b.logLevel,reportLevel:b.reportLevel,uncaughtErrorLevel:b.uncaughtErrorLevel,endpoint:b.endpoint,verbose:!1,enabled:!0,transmit:!0,sendConfig:!1,includeItemsInTelemetry:!0,captureIp:!0,inspectAnonymousErrors:!0,ignoreDuplicateErrors:!0,wrapGlobalEventHandlers:!1};t.exports=m},677:t=>{t.exports={scrubFields:["pw","pass","passwd","password","secret","confirm_password","confirmPassword","password_confirmation","passwordConfirmation","access_token","accessToken","X-Rollbar-Access-Token","secret_key","secretKey","secretToken","cc-number","card number","cardnumber","cardnum","ccnum","ccnumber","cc num","creditcardnumber","credit card number","newcreditcardnumber","new credit card","creditcardno","credit card no","card#","card #","cc-csc","cvc","cvc2","cvv2","ccv2","security code","card verification","name on credit card","name on card","nameoncard","cardholder","card holder","name des karteninhabers","ccname","card type","cardtype","cc type","cctype","payment type","expiration date","expirationdate","expdate","cc-exp","ccmonth","ccyear"]}},616:t=>{var e={ieVersion:function(){var t;if("undefined"==typeof document)return t;for(var e=3,i=document.createElement("div"),r=i.getElementsByTagName("i");i.innerHTML="\x3c!--[if gt IE "+ ++e+"]><i></i><![endif]--\x3e",r[0];);return e>4?e:t}};t.exports=e},300:t=>{function e(t){return(t.getAttribute("type")||"").toLowerCase()}function i(t){if(!t||!t.tagName)return"";var e=[t.tagName];t.id&&e.push("#"+t.id),t.classes&&e.push("."+t.classes.join("."));for(var i=0;i<t.attributes.length;i++)e.push("["+t.attributes[i].key+'="'+t.attributes[i].value+'"]');return e.join("")}function r(t){if(!t||!t.tagName)return null;var e,i,r,n,o={};o.tagName=t.tagName.toLowerCase(),t.id&&(o.id=t.id),(e=t.className)&&"string"==typeof e&&(o.classes=e.split(/\s+/));var a=["type","name","title","alt"];for(o.attributes=[],n=0;n<a.length;n++)i=a[n],(r=t.getAttribute(i))&&o.attributes.push({key:i,value:r});return o}t.exports={describeElement:r,descriptionToString:i,elementArrayToString:function(t){for(var e,r,n=[],o=0,a=t.length-1;a>=0;a--){if(e=i(t[a]),r=o+3*n.length+e.length,a<t.length-1&&r>=83){n.unshift("...");break}n.unshift(e),o+=e.length}return n.join(" > ")},treeToArray:function(t){for(var e,i=[],n=0;t&&n<5&&"html"!==(e=r(t)).tagName;n++)i.unshift(e),t=t.parentNode;return i},getElementFromEvent:function(t,e){return t.target?t.target:e&&e.elementFromPoint?e.elementFromPoint(t.clientX,t.clientY):void 0},isDescribedElement:function(t,i,r){if(t.tagName.toLowerCase()!==i.toLowerCase())return!1;if(!r)return!0;t=e(t);for(var n=0;n<r.length;n++)if(r[n]===t)return!0;return!1},getElementType:e}},349:t=>{t.exports={captureUncaughtExceptions:function(t,e,i){if(t){var r;if("function"==typeof e._rollbarOldOnError)r=e._rollbarOldOnError;else if(t.onerror){for(r=t.onerror;r._rollbarOldOnError;)r=r._rollbarOldOnError;e._rollbarOldOnError=r}e.handleAnonymousErrors();var n=function(){var i=Array.prototype.slice.call(arguments,0);!function(t,e,i,r){t._rollbarWrappedError&&(r[4]||(r[4]=t._rollbarWrappedError),r[5]||(r[5]=t._rollbarWrappedError._rollbarContext),t._rollbarWrappedError=null);var n=e.handleUncaughtException.apply(e,r);i&&i.apply(t,r),"anonymous"===n&&(e.anonymousErrorsPending+=1)}(t,e,r,i)};i&&(n._rollbarOldOnError=r),t.onerror=n}},captureUnhandledRejections:function(t,e,i){if(t){"function"==typeof t._rollbarURH&&t._rollbarURH.belongsToShim&&t.removeEventListener("unhandledrejection",t._rollbarURH);var r=function(t){var i,r,n;try{i=t.reason}catch(t){i=void 0}try{r=t.promise}catch(t){r="[unhandledrejection] error getting `promise` from event"}try{n=t.detail,!i&&n&&(i=n.reason,r=n.promise)}catch(t){}i||(i="[unhandledrejection] error getting `reason` from event"),e&&e.handleUnhandledRejection&&e.handleUnhandledRejection(i,r)};r.belongsToShim=i,t._rollbarURH=r,t.addEventListener("unhandledrejection",r)}}}},802:(t,e,i)=>{i(276);var r=i(616),n=i(702);t.exports={error:function(){var t=Array.prototype.slice.call(arguments,0);t.unshift("Rollbar:"),r.ieVersion()<=8?console.error(n.formatArgsAsString(t)):console.error.apply(console,t)},info:function(){var t=Array.prototype.slice.call(arguments,0);t.unshift("Rollbar:"),r.ieVersion()<=8?console.info(n.formatArgsAsString(t)):console.info.apply(console,t)},log:function(){var t=Array.prototype.slice.call(arguments,0);t.unshift("Rollbar:"),r.ieVersion()<=8?console.log(n.formatArgsAsString(t)):console.log.apply(console,t)}}},172:(t,e,i)=>{var r=i(702);t.exports={checkIgnore:function(t,e){return!r.get(e,"plugins.jquery.ignoreAjaxErrors")||!r.get(t,"body.message.extra.isAjax")}}},343:(t,e,i)=>{var r=i(403),n=i(773),o=i(568),a=i(876),s=i(965),l=i(369),c=i(473);r.setComponents({telemeter:n,instrumenter:o,polyfillJSON:a,wrapGlobals:s,scrub:l,truncation:c}),t.exports=r},568:(t,e,i)=>{var r=i(702),n=i(650),o=i(297),a=i(369),s=i(509),l=i(300),c={network:!0,networkResponseHeaders:!1,networkResponseBody:!1,networkRequestHeaders:!1,networkRequestBody:!1,networkErrorOnHttp5xx:!1,networkErrorOnHttp4xx:!1,networkErrorOnHttp0:!1,log:!0,dom:!0,navigation:!0,connectivity:!0,contentSecurityPolicy:!0,errorOnContentSecurityPolicy:!1};function u(t,e){for(var i;t[e].length;)(i=t[e].shift())[0][i[1]]=i[2]}function h(t,e,i,n,o){this.options=t;var a=t.autoInstrument;!1===t.enabled||!1===a?this.autoInstrument={}:(r.isType(a,"object")||(a=c),this.autoInstrument=r.merge(c,a)),this.scrubTelemetryInputs=!!t.scrubTelemetryInputs,this.telemetryScrubber=t.telemetryScrubber,this.defaultValueScrubber=function(t){for(var e=[],i=0;i<t.length;++i)e.push(new RegExp(t[i],"i"));return function(t){var i=function(t){if(!t||!t.attributes)return null;for(var e=t.attributes,i=0;i<e.length;++i)if("name"===e[i].key)return e[i].value;return null}(t);if(!i)return!1;for(var r=0;r<e.length;++r)if(e[r].test(i))return!0;return!1}}(t.scrubFields),this.telemeter=e,this.rollbar=i,this.diagnostic=i.client.notifier.diagnostic,this._window=n||{},this._document=o||{},this.replacements={network:[],log:[],navigation:[],connectivity:[]},this.eventRemovers={dom:[],connectivity:[],contentsecuritypolicy:[]},this._location=this._window.location,this._lastHref=this._location&&this._location.href}function d(t){return"undefined"!=typeof URL&&t instanceof URL}h.prototype.configure=function(t){this.options=r.merge(this.options,t);var e=t.autoInstrument,i=r.merge(this.autoInstrument);!1===t.enabled||!1===e?this.autoInstrument={}:(r.isType(e,"object")||(e=c),this.autoInstrument=r.merge(c,e)),this.instrument(i),void 0!==t.scrubTelemetryInputs&&(this.scrubTelemetryInputs=!!t.scrubTelemetryInputs),void 0!==t.telemetryScrubber&&(this.telemetryScrubber=t.telemetryScrubber)},h.prototype.instrument=function(t){!this.autoInstrument.network||t&&t.network?!this.autoInstrument.network&&t&&t.network&&this.deinstrumentNetwork():this.instrumentNetwork(),!this.autoInstrument.log||t&&t.log?!this.autoInstrument.log&&t&&t.log&&this.deinstrumentConsole():this.instrumentConsole(),!this.autoInstrument.dom||t&&t.dom?!this.autoInstrument.dom&&t&&t.dom&&this.deinstrumentDom():this.instrumentDom(),!this.autoInstrument.navigation||t&&t.navigation?!this.autoInstrument.navigation&&t&&t.navigation&&this.deinstrumentNavigation():this.instrumentNavigation(),!this.autoInstrument.connectivity||t&&t.connectivity?!this.autoInstrument.connectivity&&t&&t.connectivity&&this.deinstrumentConnectivity():this.instrumentConnectivity(),!this.autoInstrument.contentSecurityPolicy||t&&t.contentSecurityPolicy?!this.autoInstrument.contentSecurityPolicy&&t&&t.contentSecurityPolicy&&this.deinstrumentContentSecurityPolicy():this.instrumentContentSecurityPolicy()},h.prototype.deinstrumentNetwork=function(){u(this.replacements,"network")},h.prototype.instrumentNetwork=function(){var t=this;function e(e,i){e in i&&r.isFunction(i[e])&&o(i,e,(function(e){return t.rollbar.wrap(e)}))}if("XMLHttpRequest"in this._window){var i=this._window.XMLHttpRequest.prototype;o(i,"open",(function(t){return function(e,i){var n=d(i);return(r.isType(i,"string")||n)&&(i=n?i.toString():i,this.__rollbar_xhr?(this.__rollbar_xhr.method=e,this.__rollbar_xhr.url=i,this.__rollbar_xhr.status_code=null,this.__rollbar_xhr.start_time_ms=r.now(),this.__rollbar_xhr.end_time_ms=null):this.__rollbar_xhr={method:e,url:i,status_code:null,start_time_ms:r.now(),end_time_ms:null}),t.apply(this,arguments)}}),this.replacements,"network"),o(i,"setRequestHeader",(function(e){return function(i,n){return this.__rollbar_xhr||(this.__rollbar_xhr={}),r.isType(i,"string")&&r.isType(n,"string")&&(t.autoInstrument.networkRequestHeaders&&(this.__rollbar_xhr.request_headers||(this.__rollbar_xhr.request_headers={}),this.__rollbar_xhr.request_headers[i]=n),"content-type"===i.toLowerCase()&&(this.__rollbar_xhr.request_content_type=n)),e.apply(this,arguments)}}),this.replacements,"network"),o(i,"send",(function(i){return function(n){var a=this;function s(){if(a.__rollbar_xhr&&(null===a.__rollbar_xhr.status_code&&(a.__rollbar_xhr.status_code=0,t.autoInstrument.networkRequestBody&&(a.__rollbar_xhr.request=n),a.__rollbar_event=t.captureNetwork(a.__rollbar_xhr,"xhr",void 0)),a.readyState<2&&(a.__rollbar_xhr.start_time_ms=r.now()),a.readyState>3)){a.__rollbar_xhr.end_time_ms=r.now();var e=null;if(a.__rollbar_xhr.response_content_type=a.getResponseHeader("Content-Type"),t.autoInstrument.networkResponseHeaders){var i=t.autoInstrument.networkResponseHeaders;e={};try{var o,s;if(!0===i){var l=a.getAllResponseHeaders();if(l){var c,u,h=l.trim().split(/[\r\n]+/);for(s=0;s<h.length;s++)o=(c=h[s].split(": ")).shift(),u=c.join(": "),e[o]=u}}else for(s=0;s<i.length;s++)e[o=i[s]]=a.getResponseHeader(o)}catch(t){}}var d=null;if(t.autoInstrument.networkResponseBody)try{d=a.responseText}catch(t){}var p=null;(d||e)&&(p={},d&&(t.isJsonContentType(a.__rollbar_xhr.response_content_type)?p.body=t.scrubJson(d):p.body=d),e&&(p.headers=e)),p&&(a.__rollbar_xhr.response=p);try{var f=a.status;f=1223===f?204:f,a.__rollbar_xhr.status_code=f,a.__rollbar_event.level=t.telemeter.levelFromStatus(f),t.errorOnHttpStatus(a.__rollbar_xhr)}catch(t){}}}return e("onload",a),e("onerror",a),e("onprogress",a),"onreadystatechange"in a&&r.isFunction(a.onreadystatechange)?o(a,"onreadystatechange",(function(e){return t.rollbar.wrap(e,void 0,s)})):a.onreadystatechange=s,a.__rollbar_xhr&&t.trackHttpErrors()&&(a.__rollbar_xhr.stack=(new Error).stack),i.apply(this,arguments)}}),this.replacements,"network")}"fetch"in this._window&&o(this._window,"fetch",(function(e){return function(i,o){for(var a=new Array(arguments.length),s=0,l=a.length;s<l;s++)a[s]=arguments[s];var c,u=a[0],h="GET",p=d(u);r.isType(u,"string")||p?c=p?u.toString():u:u&&(c=u.url,u.method&&(h=u.method)),a[1]&&a[1].method&&(h=a[1].method);var f={method:h,url:c,status_code:null,start_time_ms:r.now(),end_time_ms:null};if(a[1]&&a[1].headers){var m=n(a[1].headers);f.request_content_type=m.get("Content-Type"),t.autoInstrument.networkRequestHeaders&&(f.request_headers=t.fetchHeaders(m,t.autoInstrument.networkRequestHeaders))}return t.autoInstrument.networkRequestBody&&(a[1]&&a[1].body?f.request=a[1].body:a[0]&&!r.isType(a[0],"string")&&a[0].body&&(f.request=a[0].body)),t.captureNetwork(f,"fetch",void 0),t.trackHttpErrors()&&(f.stack=(new Error).stack),e.apply(this,a).then((function(e){f.end_time_ms=r.now(),f.status_code=e.status,f.response_content_type=e.headers.get("Content-Type");var i=null;t.autoInstrument.networkResponseHeaders&&(i=t.fetchHeaders(e.headers,t.autoInstrument.networkResponseHeaders));var n=null;return t.autoInstrument.networkResponseBody&&"function"==typeof e.text&&(n=e.clone().text()),(i||n)&&(f.response={},n&&("function"==typeof n.then?n.then((function(e){e&&t.isJsonContentType(f.response_content_type)?f.response.body=t.scrubJson(e):f.response.body=e})):f.response.body=n),i&&(f.response.headers=i)),t.errorOnHttpStatus(f),e}))}}),this.replacements,"network")},h.prototype.captureNetwork=function(t,e,i){return t.request&&this.isJsonContentType(t.request_content_type)&&(t.request=this.scrubJson(t.request)),this.telemeter.captureNetwork(t,e,i)},h.prototype.isJsonContentType=function(t){return!!(t&&r.isType(t,"string")&&t.toLowerCase().includes("json"))},h.prototype.scrubJson=function(t){return JSON.stringify(a(JSON.parse(t),this.options.scrubFields))},h.prototype.fetchHeaders=function(t,e){var i={};try{var r;if(!0===e){if("function"==typeof t.entries)for(var n=t.entries(),o=n.next();!o.done;)i[o.value[0]]=o.value[1],o=n.next()}else for(r=0;r<e.length;r++){var a=e[r];i[a]=t.get(a)}}catch(t){}return i},h.prototype.trackHttpErrors=function(){return this.autoInstrument.networkErrorOnHttp5xx||this.autoInstrument.networkErrorOnHttp4xx||this.autoInstrument.networkErrorOnHttp0},h.prototype.errorOnHttpStatus=function(t){var e=t.status_code;if(e>=500&&this.autoInstrument.networkErrorOnHttp5xx||e>=400&&this.autoInstrument.networkErrorOnHttp4xx||0===e&&this.autoInstrument.networkErrorOnHttp0){var i=new Error("HTTP request failed with Status "+e);i.stack=t.stack,this.rollbar.error(i,{skipFrames:1})}},h.prototype.deinstrumentConsole=function(){if("console"in this._window&&this._window.console.log)for(var t;this.replacements.log.length;)t=this.replacements.log.shift(),this._window.console[t[0]]=t[1]},h.prototype.instrumentConsole=function(){if("console"in this._window&&this._window.console.log){var t=this,e=this._window.console,i=["debug","info","warn","error","log"];try{for(var n=0,o=i.length;n<o;n++)a(i[n])}catch(t){this.diagnostic.instrumentConsole={error:t.message}}}function a(i){var n=e[i],o=e,a="warn"===i?"warning":i;e[i]=function(){var e=Array.prototype.slice.call(arguments),i=r.formatArgsAsString(e);t.telemeter.captureLog(i,a),n&&Function.prototype.apply.call(n,o,e)},t.replacements.log.push([i,n])}},h.prototype.deinstrumentDom=function(){("addEventListener"in this._window||"attachEvent"in this._window)&&this.removeListeners("dom")},h.prototype.instrumentDom=function(){if("addEventListener"in this._window||"attachEvent"in this._window){var t=this.handleClick.bind(this),e=this.handleBlur.bind(this);this.addListener("dom",this._window,"click","onclick",t,!0),this.addListener("dom",this._window,"blur","onfocusout",e,!0)}},h.prototype.handleClick=function(t){try{var e=l.getElementFromEvent(t,this._document),i=e&&e.tagName,r=l.isDescribedElement(e,"a")||l.isDescribedElement(e,"button");i&&(r||l.isDescribedElement(e,"input",["button","submit"]))?this.captureDomEvent("click",e):l.isDescribedElement(e,"input",["checkbox","radio"])&&this.captureDomEvent("input",e,e.value,e.checked)}catch(t){}},h.prototype.handleBlur=function(t){try{var e=l.getElementFromEvent(t,this._document);e&&e.tagName&&(l.isDescribedElement(e,"textarea")?this.captureDomEvent("input",e,e.value):l.isDescribedElement(e,"select")&&e.options&&e.options.length?this.handleSelectInputChanged(e):l.isDescribedElement(e,"input")&&!l.isDescribedElement(e,"input",["button","submit","hidden","checkbox","radio"])&&this.captureDomEvent("input",e,e.value))}catch(t){}},h.prototype.handleSelectInputChanged=function(t){if(t.multiple)for(var e=0;e<t.options.length;e++)t.options[e].selected&&this.captureDomEvent("input",t,t.options[e].value);else t.selectedIndex>=0&&t.options[t.selectedIndex]&&this.captureDomEvent("input",t,t.options[t.selectedIndex].value)},h.prototype.captureDomEvent=function(t,e,i,r){if(void 0!==i)if(this.scrubTelemetryInputs||"password"===l.getElementType(e))i="[scrubbed]";else{var n=l.describeElement(e);this.telemetryScrubber?this.telemetryScrubber(n)&&(i="[scrubbed]"):this.defaultValueScrubber(n)&&(i="[scrubbed]")}var o=l.elementArrayToString(l.treeToArray(e));this.telemeter.captureDom(t,o,i,r)},h.prototype.deinstrumentNavigation=function(){var t=this._window.chrome;!(t&&t.app&&t.app.runtime)&&this._window.history&&this._window.history.pushState&&u(this.replacements,"navigation")},h.prototype.instrumentNavigation=function(){var t=this._window.chrome;if(!(t&&t.app&&t.app.runtime)&&this._window.history&&this._window.history.pushState){var e=this;o(this._window,"onpopstate",(function(t){return function(){var i=e._location.href;e.handleUrlChange(e._lastHref,i),t&&t.apply(this,arguments)}}),this.replacements,"navigation"),o(this._window.history,"pushState",(function(t){return function(){var i=arguments.length>2?arguments[2]:void 0;return i&&e.handleUrlChange(e._lastHref,i+""),t.apply(this,arguments)}}),this.replacements,"navigation")}},h.prototype.handleUrlChange=function(t,e){var i=s.parse(this._location.href),r=s.parse(e),n=s.parse(t);this._lastHref=e,i.protocol===r.protocol&&i.host===r.host&&(e=r.path+(r.hash||"")),i.protocol===n.protocol&&i.host===n.host&&(t=n.path+(n.hash||"")),this.telemeter.captureNavigation(t,e)},h.prototype.deinstrumentConnectivity=function(){("addEventListener"in this._window||"body"in this._document)&&(this._window.addEventListener?this.removeListeners("connectivity"):u(this.replacements,"connectivity"))},h.prototype.instrumentConnectivity=function(){if("addEventListener"in this._window||"body"in this._document)if(this._window.addEventListener)this.addListener("connectivity",this._window,"online",void 0,function(){this.telemeter.captureConnectivityChange("online")}.bind(this),!0),this.addListener("connectivity",this._window,"offline",void 0,function(){this.telemeter.captureConnectivityChange("offline")}.bind(this),!0);else{var t=this;o(this._document.body,"ononline",(function(e){return function(){t.telemeter.captureConnectivityChange("online"),e&&e.apply(this,arguments)}}),this.replacements,"connectivity"),o(this._document.body,"onoffline",(function(e){return function(){t.telemeter.captureConnectivityChange("offline"),e&&e.apply(this,arguments)}}),this.replacements,"connectivity")}},h.prototype.handleCspEvent=function(t){var e="Security Policy Violation: blockedURI: "+t.blockedURI+", violatedDirective: "+t.violatedDirective+", effectiveDirective: "+t.effectiveDirective+", ";t.sourceFile&&(e+="location: "+t.sourceFile+", line: "+t.lineNumber+", col: "+t.columnNumber+", "),e+="originalPolicy: "+t.originalPolicy,this.telemeter.captureLog(e,"error"),this.handleCspError(e)},h.prototype.handleCspError=function(t){this.autoInstrument.errorOnContentSecurityPolicy&&this.rollbar.error(t)},h.prototype.deinstrumentContentSecurityPolicy=function(){"addEventListener"in this._document&&this.removeListeners("contentsecuritypolicy")},h.prototype.instrumentContentSecurityPolicy=function(){if("addEventListener"in this._document){var t=this.handleCspEvent.bind(this);this.addListener("contentsecuritypolicy",this._document,"securitypolicyviolation",null,t,!1)}},h.prototype.addListener=function(t,e,i,r,n,o){e.addEventListener?(e.addEventListener(i,n,o),this.eventRemovers[t].push((function(){e.removeEventListener(i,n,o)}))):r&&(e.attachEvent(r,n),this.eventRemovers[t].push((function(){e.detachEvent(r,n)})))},h.prototype.removeListeners=function(t){for(;this.eventRemovers[t].length;)this.eventRemovers[t].shift()()},t.exports=h},860:(t,e,i)=>{var r=i(702),n=i(303),o=i(802);function a(t,e,i){var n=t.message,o=t.custom;n||(n="Item sent with null or missing arguments.");var a={body:n};o&&(a.extra=r.merge(o)),r.set(t,"data.body",{message:a}),i(null,t)}function s(t){var e=t.stackInfo.stack;return e&&0===e.length&&t._unhandledStackInfo&&t._unhandledStackInfo.stack&&(e=t._unhandledStackInfo.stack),e}function l(t,e,i){var o=t&&t.data.description,a=t&&t.custom,l=s(t),u=n.guessErrorClass(e.message),h={exception:{class:c(e,u[0],i),message:u[1]}};if(o&&(h.exception.description=o),l){var d,p,f,m,g,y,_,v;for(0===l.length&&(h.exception.stack=e.rawStack,h.exception.raw=String(e.rawException)),h.frames=[],_=0;_<l.length;++_)p={filename:(d=l[_]).url?r.sanitizeUrl(d.url):"(unknown)",lineno:d.line||null,method:d.func&&"?"!==d.func?d.func:"[anonymous]",colno:d.column},i.sendFrameUrl&&(p.url=d.url),p.method&&p.method.endsWith&&p.method.endsWith("_rollbar_wrapped")||(f=m=g=null,(y=d.context?d.context.length:0)&&(v=Math.floor(y/2),m=d.context.slice(0,v),f=d.context[v],g=d.context.slice(v)),f&&(p.code=f),(m||g)&&(p.context={},m&&m.length&&(p.context.pre=m),g&&g.length&&(p.context.post=g)),d.args&&(p.args=d.args),h.frames.push(p));h.frames.reverse(),a&&(h.extra=r.merge(a))}return h}function c(t,e,i){return t.name?t.name:i.guessErrorClass?e:"(unknown)"}t.exports={handleDomException:function(t,e,i){if(t.err&&"DOMException"===n.Stack(t.err).name){var r=new Error;r.name=t.err.name,r.message=t.err.message,r.stack=t.err.stack,r.nested=t.err,t.err=r}i(null,t)},handleItemWithError:function(t,e,i){if(t.data=t.data||{},t.err)try{t.stackInfo=t.err._savedStackTrace||n.parse(t.err,t.skipFrames),e.addErrorContext&&function(t){var e=[],i=t.err;for(e.push(i);i.nested||i.cause;)i=i.nested||i.cause,e.push(i);r.addErrorContext(t,e)}(t)}catch(e){o.error("Error while parsing the error object.",e);try{t.message=t.err.message||t.err.description||t.message||String(t.err)}catch(e){t.message=String(t.err)||String(e)}delete t.err}i(null,t)},ensureItemHasSomethingToSay:function(t,e,i){t.message||t.stackInfo||t.custom||i(new Error("No message, stack info, or custom data"),null),i(null,t)},addBaseInfo:function(t,e,i){var n=e.payload&&e.payload.environment||e.environment;t.data=r.merge(t.data,{environment:n,level:t.level,endpoint:e.endpoint,platform:"browser",framework:"browser-js",language:"javascript",server:{},uuid:t.uuid,notifier:{name:"rollbar-browser-js",version:e.version},custom:t.custom}),i(null,t)},addRequestInfo:function(t){return function(e,i,n){var o={};t&&t.location&&(o.url=t.location.href,o.query_string=t.location.search);var a="$remote_ip";i.captureIp?!0!==i.captureIp&&(a+="_anonymize"):a=null,a&&(o.user_ip=a),Object.keys(o).length>0&&r.set(e,"data.request",o),n(null,e)}},addClientInfo:function(t){return function(e,i,n){if(!t)return n(null,e);var o=t.navigator||{},a=t.screen||{};r.set(e,"data.client",{runtime_ms:e.timestamp-t._rollbarStartTime,timestamp:Math.round(e.timestamp/1e3),javascript:{browser:o.userAgent,language:o.language,cookie_enabled:o.cookieEnabled,screen:{width:a.width,height:a.height}}}),n(null,e)}},addPluginInfo:function(t){return function(e,i,n){if(!t||!t.navigator)return n(null,e);for(var o,a=[],s=t.navigator.plugins||[],l=0,c=s.length;l<c;++l)o=s[l],a.push({name:o.name,description:o.description});r.set(e,"data.client.javascript.plugins",a),n(null,e)}},addBody:function(t,e,i){t.stackInfo?t.stackInfo.traceChain?function(t,e,i){for(var n=t.stackInfo.traceChain,o=[],a=n.length,s=0;s<a;s++){var c=l(t,n[s],e);o.push(c)}r.set(t,"data.body",{trace_chain:o}),i(null,t)}(t,e,i):function(t,e,i){if(s(t)){var o=l(t,t.stackInfo,e);r.set(t,"data.body",{trace:o}),i(null,t)}else{var u=t.stackInfo,h=n.guessErrorClass(u.message),d=c(u,h[0],e),p=h[1];t.message=d+": "+p,a(t,0,i)}}(t,e,i):a(t,0,i)},addScrubber:function(t){return function(e,i,r){if(t){var n=i.scrubFields||[],o=i.scrubPaths||[];e.data=t(e.data,n,o)}r(null,e)}}}},477:(t,e,i)=>{var r=i(702),n=i(656),o=i(86);function a(t){this.truncation=t}a.prototype.get=function(t,e,i,n,o){n&&r.isFunction(n)||(n=function(){}),r.addParamsAndAccessTokenToPath(t,e,i);var a=r.formatUrl(e);this._makeZoneRequest(t,a,"GET",null,n,o,e.timeout,e.transport)},a.prototype.post=function(t,e,i,n,o){if(n&&r.isFunction(n)||(n=function(){}),!i)return n(new Error("Cannot send empty request"));var a;if((a=this.truncation?this.truncation.truncate(i):r.stringify(i)).error)return n(a.error);var s=a.value,l=r.formatUrl(e);this._makeZoneRequest(t,l,"POST",s,n,o,e.timeout,e.transport)},a.prototype.postJsonPayload=function(t,e,i,n,o){n&&r.isFunction(n)||(n=function(){});var a=r.formatUrl(e);this._makeZoneRequest(t,a,"POST",i,n,o,e.timeout,e.transport)},a.prototype._makeZoneRequest=function(){var t="undefined"!=typeof window&&window||void 0!==n&&n,e=t&&t.Zone&&t.Zone.current,i=Array.prototype.slice.call(arguments);if(e&&"angular"===e._name){var r=e._parent,n=this;r.run((function(){n._makeRequest.apply(void 0,i)}))}else this._makeRequest.apply(void 0,i)},a.prototype._makeRequest=function(t,e,i,r,a,s,l,c){if("undefined"!=typeof RollbarProxy)return function(t,e){(new RollbarProxy).sendJsonPayload(t,(function(t){}),(function(t){e(new Error(t))}))}(r,a);"fetch"===c?n(t,e,i,r,a,l):o(t,e,i,r,a,s,l)},t.exports=a},656:(t,e,i)=>{var r=i(802),n=i(702);t.exports=function(t,e,i,o,a,s){var l,c;n.isFiniteNumber(s)&&(l=new AbortController,c=setTimeout((function(){l.abort()}),s)),fetch(e,{method:i,headers:{"Content-Type":"application/json","X-Rollbar-Access-Token":t,signal:l&&l.signal},body:o}).then((function(t){return c&&clearTimeout(c),t.json()})).then((function(t){a(null,t)})).catch((function(t){r.error(t.message),a(t)}))}},86:(t,e,i)=>{var r=i(702),n=i(802);function o(t,e){var i=new Error(t);return i.code=e||"ENOTFOUND",i}t.exports=function(t,e,i,a,s,l,c){var u;if(!(u=l?l():function(){var t,e,i=[function(){return new XMLHttpRequest},function(){return new ActiveXObject("Msxml2.XMLHTTP")},function(){return new ActiveXObject("Msxml3.XMLHTTP")},function(){return new ActiveXObject("Microsoft.XMLHTTP")}],r=i.length;for(e=0;e<r;e++)try{t=i[e]();break}catch(t){}return t}()))return s(new Error("No way to send a request"));try{try{var h=function(){try{if(h&&4===u.readyState){h=void 0;var t=r.jsonParse(u.responseText);if((a=u)&&a.status&&200===a.status)return void s(t.error,t.value);if(function(t){return t&&r.isType(t.status,"number")&&t.status>=400&&t.status<600}(u)){if(403===u.status){var e=t.value&&t.value.message;n.error(e)}s(new Error(String(u.status)))}else s(o("XHR response had no status code (likely connection failure)"))}}catch(t){var i;i=t&&t.stack?t:new Error(t),s(i)}var a};u.open(i,e,!0),u.setRequestHeader&&(u.setRequestHeader("Content-Type","application/json"),u.setRequestHeader("X-Rollbar-Access-Token",t)),r.isFiniteNumber(c)&&(u.timeout=c),u.onreadystatechange=h,u.send(a)}catch(t){if("undefined"!=typeof XDomainRequest){if(!window||!window.location)return s(new Error("No window available during request, unknown environment"));"http:"===window.location.href.substring(0,5)&&"https"===e.substring(0,5)&&(e="http"+e.substring(5));var d=new XDomainRequest;d.onprogress=function(){},d.ontimeout=function(){s(o("Request timed out","ETIMEDOUT"))},d.onerror=function(){s(new Error("Error during request"))},d.onload=function(){var t=r.jsonParse(d.responseText);s(t.error,t.value)},d.open(i,e,!0),d.send(a)}else s(new Error("Cannot find a method to transport a request"))}}catch(t){s(t)}}},509:t=>{t.exports={parse:function(t){var e,i,r={protocol:null,auth:null,host:null,path:null,hash:null,href:t,hostname:null,port:null,pathname:null,search:null,query:null};if(-1!==(e=t.indexOf("//"))?(r.protocol=t.substring(0,e),i=e+2):i=0,-1!==(e=t.indexOf("@",i))&&(r.auth=t.substring(i,e),i=e+1),-1===(e=t.indexOf("/",i))){if(-1===(e=t.indexOf("?",i)))return-1===(e=t.indexOf("#",i))?r.host=t.substring(i):(r.host=t.substring(i,e),r.hash=t.substring(e)),r.hostname=r.host.split(":")[0],r.port=r.host.split(":")[1],r.port&&(r.port=parseInt(r.port,10)),r;r.host=t.substring(i,e),r.hostname=r.host.split(":")[0],r.port=r.host.split(":")[1],r.port&&(r.port=parseInt(r.port,10)),i=e}else r.host=t.substring(i,e),r.hostname=r.host.split(":")[0],r.port=r.host.split(":")[1],r.port&&(r.port=parseInt(r.port,10)),i=e;if(-1===(e=t.indexOf("#",i))?r.path=t.substring(i):(r.path=t.substring(i,e),r.hash=t.substring(e)),r.path){var n=r.path.split("?");r.pathname=n[0],r.query=n[1],r.search=r.query?"?"+r.query:null}return r}}},965:t=>{function e(t,e,i){if(e.hasOwnProperty&&e.hasOwnProperty("addEventListener")){for(var r=e.addEventListener;r._rollbarOldAdd&&r.belongsToShim;)r=r._rollbarOldAdd;var n=function(e,i,n){r.call(this,e,t.wrap(i),n)};n._rollbarOldAdd=r,n.belongsToShim=i,e.addEventListener=n;for(var o=e.removeEventListener;o._rollbarOldRemove&&o.belongsToShim;)o=o._rollbarOldRemove;var a=function(t,e,i){o.call(this,t,e&&e._rollbar_wrapped||e,i)};a._rollbarOldRemove=o,a.belongsToShim=i,e.removeEventListener=a}}t.exports=function(t,i,r){if(t){var n,o,a="EventTarget,Window,Node,ApplicationCache,AudioTrackList,ChannelMergerNode,CryptoOperation,EventSource,FileReader,HTMLUnknownElement,IDBDatabase,IDBRequest,IDBTransaction,KeyOperation,MediaController,MessagePort,ModalWindow,Notification,SVGElementInstance,Screen,TextTrack,TextTrackCue,TextTrackList,WebSocket,WebSocketWorker,Worker,XMLHttpRequest,XMLHttpRequestEventTarget,XMLHttpRequestUpload".split(",");for(n=0;n<a.length;++n)t[o=a[n]]&&t[o].prototype&&e(i,t[o].prototype,r)}}},948:t=>{t.exports={version:"2.26.4",endpoint:"api.rollbar.com/api/1/item/",logLevel:"debug",reportLevel:"debug",uncaughtErrorLevel:"error",maxItems:0,itemsPerMin:60}},303:(t,e,i)=>{var r=i(180),n=new RegExp("^(([a-zA-Z0-9-_$ ]*): *)?(Uncaught )?([a-zA-Z0-9-_$ ]*): ");function o(t){var e={};return e._stackFrame=t,e.url=t.fileName,e.line=t.lineNumber,e.func=t.functionName,e.column=t.columnNumber,e.args=t.args,e.context=null,e}function a(t,e){return{stack:function(){var i=[];e=e||0;try{i=r.parse(t)}catch(t){i=[]}for(var n=[],a=e;a<i.length;a++)n.push(new o(i[a]));return n}(),message:t.message,name:(i=t,n=i.name&&i.name.length&&i.name,a=i.constructor.name&&i.constructor.name.length&&i.constructor.name,n&&a?"Error"===n?a:n:n||a),rawStack:t.stack,rawException:t};var i,n,a}t.exports={guessFunctionName:function(){return"?"},guessErrorClass:function(t){if(!t||!t.match)return["Unknown error. There was no error message to display.",""];var e=t.match(n),i="(unknown)";return e&&(i=e[e.length-1],t=(t=t.replace((e[e.length-2]||"")+i+":","")).replace(/(^[\s]+|[\s]+$)/g,"")),[i,t]},gatherContext:function(){return null},parse:function(t,e){var i=t;if(i.nested||i.cause){for(var r=[];i;)r.push(new a(i,e)),i=i.nested||i.cause,e=0;return r[0].traceChain=r,r[0]}return new a(i,e)},Stack:a,Frame:o}},420:t=>{var e=Object.prototype.hasOwnProperty,i=Object.prototype.toString,r=function(t){if(!t||"[object Object]"!==i.call(t))return!1;var r,n=e.call(t,"constructor"),o=t.constructor&&t.constructor.prototype&&e.call(t.constructor.prototype,"isPrototypeOf");if(t.constructor&&!n&&!o)return!1;for(r in t);return void 0===r||e.call(t,r)};t.exports=function t(){var e,i,n,o,a,s={},l=null,c=arguments.length;for(e=0;e<c;e++)if(null!=(l=arguments[e]))for(a in l)i=s[a],s!==(n=l[a])&&(n&&r(n)?(o=i&&r(i)?i:{},s[a]=t(o,n)):void 0!==n&&(s[a]=n));return s}},314:(t,e,i)=>{var r=i(702);function n(t,e){this.queue=t,this.options=e,this.transforms=[],this.diagnostic={}}n.prototype.configure=function(t){this.queue&&this.queue.configure(t);var e=this.options;return this.options=r.merge(e,t),this},n.prototype.addTransform=function(t){return r.isFunction(t)&&this.transforms.push(t),this},n.prototype.log=function(t,e){if(e&&r.isFunction(e)||(e=function(){}),!this.options.enabled)return e(new Error("Rollbar is not enabled"));this.queue.addPendingItem(t);var i=t.err;this._applyTransforms(t,function(r,n){if(r)return this.queue.removePendingItem(t),e(r,null);this.queue.addItem(n,e,i,t)}.bind(this))},n.prototype._applyTransforms=function(t,e){var i=-1,r=this.transforms.length,n=this.transforms,o=this.options,a=function(t,s){t?e(t,null):++i!==r?n[i](s,o,a):e(null,s)};a(null,t)},t.exports=n},61:(t,e,i)=>{var r=i(702);function n(t,e,i){if(!t)return!i;var n,o,a=t.frames;if(!a||0===a.length)return!i;for(var s=e.length,l=a.length,c=0;c<l;c++){if(n=a[c].filename,!r.isType(n,"string"))return!i;for(var u=0;u<s;u++)if(o=e[u],new RegExp(o).test(n))return!0}return!1}function o(t,e,i,o){var a,s,l=!1;"blocklist"===i&&(l=!0);try{if(a=l?e.hostBlockList:e.hostSafeList,s=r.get(t,"body.trace_chain")||[r.get(t,"body.trace")],!a||0===a.length)return!l;if(0===s.length||!s[0])return!l;for(var c=s.length,u=0;u<c;u++)if(n(s[u],a,l))return!0}catch(t){l?e.hostBlockList=null:e.hostSafeList=null;var h=l?"hostBlockList":"hostSafeList";return o.error("Error while reading your configuration's "+h+" option. Removing custom "+h+".",t),!l}return!1}t.exports={checkLevel:function(t,e){var i=t.level,n=r.LEVELS[i]||0,o=e.reportLevel;return!(n<(r.LEVELS[o]||0))},userCheckIgnore:function(t){return function(e,i){var n=!!e._isUncaught;delete e._isUncaught;var o=e._originalArgs;delete e._originalArgs;try{r.isFunction(i.onSendCallback)&&i.onSendCallback(n,o,e)}catch(e){i.onSendCallback=null,t.error("Error while calling onSendCallback, removing",e)}try{if(r.isFunction(i.checkIgnore)&&i.checkIgnore(n,o,e))return!1}catch(e){i.checkIgnore=null,t.error("Error while calling custom checkIgnore(), removing",e)}return!0}},urlIsNotBlockListed:function(t){return function(e,i){return!o(e,i,"blocklist",t)}},urlIsSafeListed:function(t){return function(e,i){return o(e,i,"safelist",t)}},messageIsIgnored:function(t){return function(e,i){var n,o,a,s,l,c;try{if(!(a=i.ignoredMessages)||0===a.length)return!0;if(c=function(t){var e=t.body,i=[];if(e.trace_chain)for(var n=e.trace_chain,o=0;o<n.length;o++){var a=n[o];i.push(r.get(a,"exception.message"))}return e.trace&&i.push(r.get(e,"trace.exception.message")),e.message&&i.push(r.get(e,"message.body")),i}(e),0===c.length)return!0;for(s=a.length,n=0;n<s;n++)for(l=new RegExp(a[n],"gi"),o=0;o<c.length;o++)if(l.test(c[o]))return!1}catch(e){i.ignoredMessages=null,t.error("Error while reading your configuration's ignoredMessages option. Removing custom ignoredMessages.")}return!0}}}},358:(t,e,i)=>{var r=i(702);function n(t,e,i,r){this.rateLimiter=t,this.api=e,this.logger=i,this.options=r,this.predicates=[],this.pendingItems=[],this.pendingRequests=[],this.retryQueue=[],this.retryHandle=null,this.waitCallback=null,this.waitIntervalID=null}n.prototype.configure=function(t){this.api&&this.api.configure(t);var e=this.options;return this.options=r.merge(e,t),this},n.prototype.addPredicate=function(t){return r.isFunction(t)&&this.predicates.push(t),this},n.prototype.addPendingItem=function(t){this.pendingItems.push(t)},n.prototype.removePendingItem=function(t){var e=this.pendingItems.indexOf(t);-1!==e&&this.pendingItems.splice(e,1)},n.prototype.addItem=function(t,e,i,n){e&&r.isFunction(e)||(e=function(){});var o=this._applyPredicates(t);if(o.stop)return this.removePendingItem(n),void e(o.err);if(this._maybeLog(t,i),this.removePendingItem(n),this.options.transmit){this.pendingRequests.push(t);try{this._makeApiRequest(t,function(i,r){this._dequeuePendingRequest(t),e(i,r)}.bind(this))}catch(i){this._dequeuePendingRequest(t),e(i)}}else e(new Error("Transmit disabled"))},n.prototype.wait=function(t){r.isFunction(t)&&(this.waitCallback=t,this._maybeCallWait()||(this.waitIntervalID&&(this.waitIntervalID=clearInterval(this.waitIntervalID)),this.waitIntervalID=setInterval(function(){this._maybeCallWait()}.bind(this),500)))},n.prototype._applyPredicates=function(t){for(var e=null,i=0,r=this.predicates.length;i<r;i++)if(!(e=this.predicates[i](t,this.options))||void 0!==e.err)return{stop:!0,err:e.err};return{stop:!1,err:null}},n.prototype._makeApiRequest=function(t,e){var i=this.rateLimiter.shouldSend(t);i.shouldSend?this.api.postItem(t,function(i,r){i?this._maybeRetry(i,t,e):e(i,r)}.bind(this)):i.error?e(i.error):this.api.postItem(i.payload,e)};var o=["ECONNRESET","ENOTFOUND","ESOCKETTIMEDOUT","ETIMEDOUT","ECONNREFUSED","EHOSTUNREACH","EPIPE","EAI_AGAIN"];n.prototype._maybeRetry=function(t,e,i){var n=!1;if(this.options.retryInterval){for(var a=0,s=o.length;a<s;a++)if(t.code===o[a]){n=!0;break}n&&r.isFiniteNumber(this.options.maxRetries)&&(e.retries=e.retries?e.retries+1:1,e.retries>this.options.maxRetries&&(n=!1))}n?this._retryApiRequest(e,i):i(t)},n.prototype._retryApiRequest=function(t,e){this.retryQueue.push({item:t,callback:e}),this.retryHandle||(this.retryHandle=setInterval(function(){for(;this.retryQueue.length;){var t=this.retryQueue.shift();this._makeApiRequest(t.item,t.callback)}}.bind(this),this.options.retryInterval))},n.prototype._dequeuePendingRequest=function(t){var e=this.pendingRequests.indexOf(t);-1!==e&&(this.pendingRequests.splice(e,1),this._maybeCallWait())},n.prototype._maybeLog=function(t,e){if(this.logger&&this.options.verbose){var i=e;if(i=(i=i||r.get(t,"body.trace.exception.message"))||r.get(t,"body.trace_chain.0.exception.message"))return void this.logger.error(i);(i=r.get(t,"body.message.body"))&&this.logger.log(i)}},n.prototype._maybeCallWait=function(){return!(!r.isFunction(this.waitCallback)||0!==this.pendingItems.length||0!==this.pendingRequests.length||(this.waitIntervalID&&(this.waitIntervalID=clearInterval(this.waitIntervalID)),this.waitCallback(),0))},t.exports=n},790:(t,e,i)=>{var r=i(702);function n(t){this.startTime=r.now(),this.counter=0,this.perMinCounter=0,this.platform=null,this.platformOptions={},this.configureGlobal(t)}function o(t,e,i){return!t.ignoreRateLimit&&e>=1&&i>e}function a(t,e,i,r,n,o,a){var s=null;return i&&(i=new Error(i)),i||r||(s=function(t,e,i,r,n){var o={body:{message:{body:n?"item per minute limit reached, ignoring errors until timeout":"maxItems has been hit, ignoring errors until reset.",extra:{maxItems:i,itemsPerMinute:r}}},language:"javascript",environment:e.environment||e.payload&&e.payload.environment,notifier:{version:e.notifier&&e.notifier.version||e.version}};return"browser"===t?(o.platform="browser",o.framework="browser-js",o.notifier.name="rollbar-browser-js"):"server"===t?(o.framework=e.framework||"node-js",o.notifier.name=e.notifier.name):"react-native"===t&&(o.framework=e.framework||"react-native",o.notifier.name=e.notifier.name),o}(t,e,n,o,a)),{error:i,shouldSend:r,payload:s}}n.globalSettings={startTime:r.now(),maxItems:void 0,itemsPerMinute:void 0},n.prototype.configureGlobal=function(t){void 0!==t.startTime&&(n.globalSettings.startTime=t.startTime),void 0!==t.maxItems&&(n.globalSettings.maxItems=t.maxItems),void 0!==t.itemsPerMinute&&(n.globalSettings.itemsPerMinute=t.itemsPerMinute)},n.prototype.shouldSend=function(t,e){var i=(e=e||r.now())-this.startTime;(i<0||i>=6e4)&&(this.startTime=e,this.perMinCounter=0);var s=n.globalSettings.maxItems,l=n.globalSettings.itemsPerMinute;if(o(t,s,this.counter))return a(this.platform,this.platformOptions,s+" max items reached",!1);if(o(t,l,this.perMinCounter))return a(this.platform,this.platformOptions,l+" items per minute reached",!1);this.counter++,this.perMinCounter++;var c=!o(t,s,this.counter),u=c;return c=c&&!o(t,l,this.perMinCounter),a(this.platform,this.platformOptions,null,c,s,l,u)},n.prototype.setPlatformOptions=function(t,e){this.platform=t,this.platformOptions=e},t.exports=n},562:(t,e,i)=>{var r=i(790),n=i(358),o=i(314),a=i(702);function s(t,e,i,r,u){this.options=a.merge(t),this.logger=i,s.rateLimiter.configureGlobal(this.options),s.rateLimiter.setPlatformOptions(u,this.options),this.api=e,this.queue=new n(s.rateLimiter,e,i,this.options);var h=this.options.tracer||null;c(h)?(this.tracer=h,this.options.tracer="opentracing-tracer-enabled",this.options._configuredOptions.tracer="opentracing-tracer-enabled"):this.tracer=null,this.notifier=new o(this.queue,this.options),this.telemeter=r,l(t),this.lastError=null,this.lastErrorHash="none"}function l(t){t.stackTraceLimit&&(Error.stackTraceLimit=t.stackTraceLimit)}function c(t){if(!t)return!1;if(!t.scope||"function"!=typeof t.scope)return!1;var e=t.scope();return!(!e||!e.active||"function"!=typeof e.active)}s.rateLimiter=new r({maxItems:0,itemsPerMinute:60}),s.prototype.global=function(t){return s.rateLimiter.configureGlobal(t),this},s.prototype.configure=function(t,e){var i=this.options,r={};e&&(r={payload:e}),this.options=a.merge(i,t,r);var n=this.options.tracer||null;return c(n)?(this.tracer=n,this.options.tracer="opentracing-tracer-enabled",this.options._configuredOptions.tracer="opentracing-tracer-enabled"):this.tracer=null,this.notifier&&this.notifier.configure(this.options),this.telemeter&&this.telemeter.configure(this.options),l(t),this.global(this.options),c(t.tracer)&&(this.tracer=t.tracer),this},s.prototype.log=function(t){var e=this._defaultLogLevel();return this._log(e,t)},s.prototype.debug=function(t){this._log("debug",t)},s.prototype.info=function(t){this._log("info",t)},s.prototype.warn=function(t){this._log("warning",t)},s.prototype.warning=function(t){this._log("warning",t)},s.prototype.error=function(t){this._log("error",t)},s.prototype.critical=function(t){this._log("critical",t)},s.prototype.wait=function(t){this.queue.wait(t)},s.prototype.captureEvent=function(t,e,i){return this.telemeter&&this.telemeter.captureEvent(t,e,i)},s.prototype.captureDomContentLoaded=function(t){return this.telemeter&&this.telemeter.captureDomContentLoaded(t)},s.prototype.captureLoad=function(t){return this.telemeter&&this.telemeter.captureLoad(t)},s.prototype.buildJsonPayload=function(t){return this.api.buildJsonPayload(t)},s.prototype.sendJsonPayload=function(t){this.api.postJsonPayload(t)},s.prototype._log=function(t,e){var i;if(e.callback&&(i=e.callback,delete e.callback),this.options.ignoreDuplicateErrors&&this._sameAsLastError(e)){if(i){var r=new Error("ignored identical item");r.item=e,i(r)}}else try{this._addTracingInfo(e),e.level=e.level||t,this.telemeter&&this.telemeter._captureRollbarItem(e),e.telemetryEvents=this.telemeter&&this.telemeter.copyEvents()||[],this.notifier.log(e,i)}catch(t){i&&i(t),this.logger.error(t)}},s.prototype._defaultLogLevel=function(){return this.options.logLevel||"debug"},s.prototype._sameAsLastError=function(t){if(!t._isUncaught)return!1;var e=function(t){return(t.message||"")+"::"+((t.err||{}).stack||String(t.err))}(t);return this.lastErrorHash===e||(this.lastError=t.err,this.lastErrorHash=e,!1)},s.prototype._addTracingInfo=function(t){if(this.tracer){var e=this.tracer.scope().active();if(function(t){if(!t||!t.context||"function"!=typeof t.context)return!1;var e=t.context();return!!(e&&e.toSpanId&&e.toTraceId&&"function"==typeof e.toSpanId&&"function"==typeof e.toTraceId)}(e)){e.setTag("rollbar.error_uuid",t.uuid),e.setTag("rollbar.has_error",!0),e.setTag("error",!0),e.setTag("rollbar.item_url",`https://rollbar.com/item/uuid/?uuid=${t.uuid}`),e.setTag("rollbar.occurrence_url",`https://rollbar.com/occurrence/uuid/?uuid=${t.uuid}`);var i=e.context().toSpanId(),r=e.context().toTraceId();t.custom?(t.custom.opentracing_span_id=i,t.custom.opentracing_trace_id=r):t.custom={opentracing_span_id:i,opentracing_trace_id:r}}}},t.exports=s},369:(t,e,i)=>{var r=i(702),n=i(267);function o(t,e){var i=e.split("."),n=i.length-1;try{for(var o=0;o<=n;++o)o<n?t=t[i[o]]:t[i[o]]=r.redact()}catch(t){}}t.exports=function(t,e,i){if(e=e||[],i)for(var a=0;a<i.length;++a)o(t,i[a]);var s=function(t){for(var e,i=[],r=0;r<t.length;++r)e="^\\[?(%5[bB])?"+t[r]+"\\[?(%5[bB])?\\]?(%5[dD])?$",i.push(new RegExp(e,"i"));return i}(e),l=function(t){for(var e,i=[],r=0;r<t.length;++r)e="\\[?(%5[bB])?"+t[r]+"\\[?(%5[bB])?\\]?(%5[dD])?",i.push(new RegExp("("+e+"=)([^&\\n]+)","igm"));return i}(e);function c(t,e){return e+r.redact()}return n(t,(function t(e,i,o){var a=function(t,e){var i;for(i=0;i<s.length;++i)if(s[i].test(t)){e=r.redact();break}return e}(e,i);return a===i?r.isType(i,"object")||r.isType(i,"array")?n(i,t,o):function(t){var e;if(r.isType(t,"string"))for(e=0;e<l.length;++e)t=t.replace(l[e],c);return t}(a):a}))}},773:(t,e,i)=>{var r=i(702),n=100;function o(t){this.queue=[],this.options=r.merge(t);var e=this.options.maxTelemetryEvents||n;this.maxQueueSize=Math.max(0,Math.min(e,n))}function a(t,e){return e||{error:"error",manual:"info"}[t]||"info"}o.prototype.configure=function(t){var e=this.options;this.options=r.merge(e,t);var i=this.options.maxTelemetryEvents||n,o=Math.max(0,Math.min(i,n)),a=0;this.queue.length>o&&(a=this.queue.length-o),this.maxQueueSize=o,this.queue.splice(0,a)},o.prototype.copyEvents=function(){var t=Array.prototype.slice.call(this.queue,0);if(r.isFunction(this.options.filterTelemetry))try{for(var e=t.length;e--;)this.options.filterTelemetry(t[e])&&t.splice(e,1)}catch(t){this.options.filterTelemetry=null}return t},o.prototype.capture=function(t,e,i,n,o){var s={level:a(t,i),type:t,timestamp_ms:o||r.now(),body:e,source:"client"};n&&(s.uuid=n);try{if(r.isFunction(this.options.filterTelemetry)&&this.options.filterTelemetry(s))return!1}catch(t){this.options.filterTelemetry=null}return this.push(s),s},o.prototype.captureEvent=function(t,e,i,r){return this.capture(t,e,i,r)},o.prototype.captureError=function(t,e,i,r){var n={message:t.message||String(t)};return t.stack&&(n.stack=t.stack),this.capture("error",n,e,i,r)},o.prototype.captureLog=function(t,e,i,r){return this.capture("log",{message:t},e,i,r)},o.prototype.captureNetwork=function(t,e,i,r){e=e||"xhr",t.subtype=t.subtype||e,r&&(t.request=r);var n=this.levelFromStatus(t.status_code);return this.capture("network",t,n,i)},o.prototype.levelFromStatus=function(t){return t>=200&&t<400?"info":0===t||t>=400?"error":"info"},o.prototype.captureDom=function(t,e,i,r,n){var o={subtype:t,element:e};return void 0!==i&&(o.value=i),void 0!==r&&(o.checked=r),this.capture("dom",o,"info",n)},o.prototype.captureNavigation=function(t,e,i){return this.capture("navigation",{from:t,to:e},"info",i)},o.prototype.captureDomContentLoaded=function(t){return this.capture("navigation",{subtype:"DOMContentLoaded"},"info",void 0,t&&t.getTime())},o.prototype.captureLoad=function(t){return this.capture("navigation",{subtype:"load"},"info",void 0,t&&t.getTime())},o.prototype.captureConnectivityChange=function(t,e){return this.captureNetwork({change:t},"connectivity",e)},o.prototype._captureRollbarItem=function(t){if(this.options.includeItemsInTelemetry)return t.err?this.captureError(t.err,t.level,t.uuid,t.timestamp):t.message?this.captureLog(t.message,t.level,t.uuid,t.timestamp):t.custom?this.capture("log",t.custom,t.level,t.uuid,t.timestamp):void 0},o.prototype.push=function(t){this.queue.push(t),this.queue.length>this.maxQueueSize&&this.queue.shift()},t.exports=o},417:(t,e,i)=>{var r=i(702);function n(t,e){r.isFunction(t[e])&&(t[e]=t[e].toString())}t.exports={itemToPayload:function(t,e,i){var r=t.data;t._isUncaught&&(r._isUncaught=!0),t._originalArgs&&(r._originalArgs=t._originalArgs),i(null,r)},addPayloadOptions:function(t,e,i){var n=e.payload||{};n.body&&delete n.body,t.data=r.merge(t.data,n),i(null,t)},addTelemetryData:function(t,e,i){t.telemetryEvents&&r.set(t,"data.body.telemetry",t.telemetryEvents),i(null,t)},addMessageWithError:function(t,e,i){if(t.message){var n="data.body.trace_chain.0",o=r.get(t,n);if(o||(n="data.body.trace",o=r.get(t,n)),o){if(!o.exception||!o.exception.description)return r.set(t,n+".exception.description",t.message),void i(null,t);var a=r.get(t,n+".extra")||{},s=r.merge(a,{message:t.message});r.set(t,n+".extra",s)}i(null,t)}else i(null,t)},userTransform:function(t){return function(e,i,n){var o=r.merge(e),a=null;try{r.isFunction(i.transform)&&(a=i.transform(o.data,e))}catch(r){return i.transform=null,t.error("Error while calling custom transform() function. Removing custom transform().",r),void n(null,e)}r.isPromise(a)?a.then((function(t){t&&(o.data=t),n(null,o)}),(function(t){n(t,e)})):n(null,o)}},addConfigToPayload:function(t,e,i){if(!e.sendConfig)return i(null,t);var n=r.get(t,"data.custom")||{};n._rollbarConfig=e,t.data.custom=n,i(null,t)},addConfiguredOptions:function(t,e,i){var r=e._configuredOptions;n(r,"transform"),n(r,"checkIgnore"),n(r,"onSendCallback"),delete r.accessToken,t.data.notifier.configured_options=r,i(null,t)},addDiagnosticKeys:function(t,e,i){var n=r.merge(t.notifier.client.notifier.diagnostic,t.diagnostic);if(r.get(t,"err._isAnonymous")&&(n.is_anonymous=!0),t._isUncaught&&(n.is_uncaught=t._isUncaught),t.err)try{n.raw_error={message:t.err.message,name:t.err.name,constructor_name:t.err.constructor&&t.err.constructor.name,filename:t.err.fileName,line:t.err.lineNumber,column:t.err.columnNumber,stack:t.err.stack}}catch(t){n.raw_error={failed:String(t)}}t.data.notifier.diagnostic=r.merge(t.data.notifier.diagnostic,n),i(null,t)}}},473:(t,e,i)=>{var r=i(702),n=i(267);function o(t,e){return[t,r.stringify(t,e)]}function a(t,e){var i=t.length;return i>2*e?t.slice(0,e).concat(t.slice(i-e)):t}function s(t,e,i){i=void 0===i?30:i;var n,o=t.data.body;if(o.trace_chain)for(var s=o.trace_chain,l=0;l<s.length;l++)n=a(n=s[l].frames,i),s[l].frames=n;else o.trace&&(n=a(n=o.trace.frames,i),o.trace.frames=n);return[t,r.stringify(t,e)]}function l(t,e){return e&&e.length>t?e.slice(0,t-3).concat("..."):e}function c(t,e,i){return e=n(e,(function e(i,o,a){switch(r.typeName(o)){case"string":return l(t,o);case"object":case"array":return n(o,e,a);default:return o}})),[e,r.stringify(e,i)]}function u(t){return t.exception&&(delete t.exception.description,t.exception.message=l(255,t.exception.message)),t.frames=a(t.frames,1),t}function h(t,e){var i=t.data.body;if(i.trace_chain)for(var n=i.trace_chain,o=0;o<n.length;o++)n[o]=u(n[o]);else i.trace&&(i.trace=u(i.trace));return[t,r.stringify(t,e)]}function d(t,e){return r.maxByteSize(t)>e}t.exports={truncate:function(t,e,i){i=void 0===i?524288:i;for(var r,n,a,l=[o,s,c.bind(null,1024),c.bind(null,512),c.bind(null,256),h];r=l.shift();)if(t=(n=r(t,e))[0],(a=n[1]).error||!d(a.value,i))return a;return a},raw:o,truncateFrames:s,truncateStrings:c,maybeTruncateValue:l}},702:(t,e,i)=>{var r=i(420),n={};function o(t,e){return e===a(t)}function a(t){var e=typeof t;return"object"!==e?e:t?t instanceof Error?"error":{}.toString.call(t).match(/\s([a-zA-Z]+)/)[1].toLowerCase():"null"}function s(t){return o(t,"function")}function l(t){var e=Function.prototype.toString.call(Object.prototype.hasOwnProperty).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?"),i=RegExp("^"+e+"$");return c(t)&&i.test(t)}function c(t){var e=typeof t;return null!=t&&("object"==e||"function"==e)}function u(){var t=_();return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,(function(e){var i=(t+16*Math.random())%16|0;return t=Math.floor(t/16),("x"===e?i:7&i|8).toString(16)}))}var h={strictMode:!1,key:["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"],q:{name:"queryKey",parser:/(?:^|&)([^&=]*)=?([^&]*)/g},parser:{strict:/^(?:([^:\/?#]+):)?(?:\/\/((?:(([^:@]*)(?::([^:@]*))?)?@)?([^:\/?#]*)(?::(\d*))?))?((((?:[^?#\/]*\/)*)([^?#]*))(?:\?([^#]*))?(?:#(.*))?)/,loose:/^(?:(?![^:@]+:[^:@\/]*@)([^:\/?#.]+):)?(?:\/\/)?((?:(([^:@]*)(?::([^:@]*))?)?@)?([^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/}};function d(t,e){var i,r;try{i=n.stringify(t)}catch(n){if(e&&s(e))try{i=e(t)}catch(t){r=t}else r=n}return{error:r,value:i}}function p(t,e){return function(i,r){try{e(i,r)}catch(e){t.error(e)}}}function f(t){return function t(e,i){var r,n,s,l={};try{for(n in e)(r=e[n])&&(o(r,"object")||o(r,"array"))?i.includes(r)?l[n]="Removed circular reference: "+a(r):((s=i.slice()).push(r),l[n]=t(r,s)):l[n]=r}catch(t){l="Failed cloning custom data: "+t.message}return l}(t,[t])}var m=["log","network","dom","navigation","error","manual"],g=["critical","error","warning","info","debug"];function y(t,e){for(var i=0;i<t.length;++i)if(t[i]===e)return!0;return!1}function _(){return Date.now?+Date.now():+new Date}t.exports={addParamsAndAccessTokenToPath:function(t,e,i){(i=i||{}).access_token=t;var r,n=[];for(r in i)Object.prototype.hasOwnProperty.call(i,r)&&n.push([r,i[r]].join("="));var o="?"+n.sort().join("&");(e=e||{}).path=e.path||"";var a,s=e.path.indexOf("?"),l=e.path.indexOf("#");-1!==s&&(-1===l||l>s)?(a=e.path,e.path=a.substring(0,s)+o+"&"+a.substring(s+1)):-1!==l?(a=e.path,e.path=a.substring(0,l)+o+a.substring(l)):e.path=e.path+o},createItem:function(t,e,i,r,n){for(var o,s,l,c,h,d,m=[],g=[],y=0,v=t.length;y<v;++y){var b=a(d=t[y]);switch(g.push(b),b){case"undefined":break;case"string":o?m.push(d):o=d;break;case"function":c=p(e,d);break;case"date":m.push(d);break;case"error":case"domexception":case"exception":s?m.push(d):s=d;break;case"object":case"array":if(d instanceof Error||"undefined"!=typeof DOMException&&d instanceof DOMException){s?m.push(d):s=d;break}if(r&&"object"===b&&!h){for(var x=0,w=r.length;x<w;++x)if(void 0!==d[r[x]]){h=d;break}if(h)break}l?m.push(d):l=d;break;default:if(d instanceof Error||"undefined"!=typeof DOMException&&d instanceof DOMException){s?m.push(d):s=d;break}m.push(d)}}l&&(l=f(l)),m.length>0&&(l||(l=f({})),l.extraArgs=f(m));var k={message:o,err:s,custom:l,timestamp:_(),callback:c,notifier:i,diagnostic:{},uuid:u()};return function(t,e){e&&void 0!==e.level&&(t.level=e.level,delete e.level),e&&void 0!==e.skipFrames&&(t.skipFrames=e.skipFrames,delete e.skipFrames)}(k,l),r&&h&&(k.request=h),n&&(k.lambdaContext=n),k._originalArgs=t,k.diagnostic.original_arg_types=g,k},addErrorContext:function(t,e){var i=t.data.custom||{},n=!1;try{for(var o=0;o<e.length;++o)e[o].hasOwnProperty("rollbarContext")&&(i=r(i,f(e[o].rollbarContext)),n=!0);n&&(t.data.custom=i)}catch(e){t.diagnostic.error_context="Failed: "+e.message}},createTelemetryEvent:function(t){for(var e,i,r,n,o=0,s=t.length;o<s;++o)switch(a(n=t[o])){case"string":!e&&y(m,n)?e=n:!r&&y(g,n)&&(r=n);break;case"object":i=n}return{type:e||"manual",metadata:i||{},level:r}},filterIp:function(t,e){if(t&&t.user_ip&&!0!==e){var i=t.user_ip;if(e)try{var r;if(-1!==i.indexOf("."))(r=i.split(".")).pop(),r.push("0"),i=r.join(".");else if(-1!==i.indexOf(":")){if((r=i.split(":")).length>2){var n=r.slice(0,3),o=n[2].indexOf("/");-1!==o&&(n[2]=n[2].substring(0,o)),i=n.concat("0000:0000:0000:0000:0000").join(":")}}else i=null}catch(t){i=null}else i=null;t.user_ip=i}},formatArgsAsString:function(t){var e,i,r,n=[];for(e=0,i=t.length;e<i;++e){switch(a(r=t[e])){case"object":(r=(r=d(r)).error||r.value).length>500&&(r=r.substr(0,497)+"...");break;case"null":r="null";break;case"undefined":r="undefined";break;case"symbol":r=r.toString()}n.push(r)}return n.join(" ")},formatUrl:function(t,e){if(!(e=e||t.protocol)&&t.port&&(80===t.port?e="http:":443===t.port&&(e="https:")),e=e||"https:",!t.hostname)return null;var i=e+"//"+t.hostname;return t.port&&(i=i+":"+t.port),t.path&&(i+=t.path),i},get:function(t,e){if(t){var i=e.split("."),r=t;try{for(var n=0,o=i.length;n<o;++n)r=r[i[n]]}catch(t){r=void 0}return r}},handleOptions:function(t,e,i,n){var o=r(t,e,i);return o=function(t,e){return t.hostWhiteList&&!t.hostSafeList&&(t.hostSafeList=t.hostWhiteList,t.hostWhiteList=void 0,e&&e.log("hostWhiteList is deprecated. Use hostSafeList.")),t.hostBlackList&&!t.hostBlockList&&(t.hostBlockList=t.hostBlackList,t.hostBlackList=void 0,e&&e.log("hostBlackList is deprecated. Use hostBlockList.")),t}(o,n),!e||e.overwriteScrubFields||e.scrubFields&&(o.scrubFields=(t.scrubFields||[]).concat(e.scrubFields)),o},isError:function(t){return o(t,"error")||o(t,"exception")},isFiniteNumber:function(t){return Number.isFinite(t)},isFunction:s,isIterable:function(t){var e=a(t);return"object"===e||"array"===e},isNativeFunction:l,isObject:c,isString:function(t){return"string"==typeof t||t instanceof String},isType:o,isPromise:function(t){return c(t)&&o(t.then,"function")},jsonParse:function(t){var e,i;try{e=n.parse(t)}catch(t){i=t}return{error:i,value:e}},LEVELS:{debug:0,info:1,warning:2,error:3,critical:4},makeUnhandledStackInfo:function(t,e,i,r,n,o,a,s){var l={url:e||"",line:i,column:r};l.func=s.guessFunctionName(l.url,l.line),l.context=s.gatherContext(l.url,l.line);var c="undefined"!=typeof document&&document&&document.location&&document.location.href,u="undefined"!=typeof window&&window&&window.navigator&&window.navigator.userAgent;return{mode:o,message:n?String(n):t||a,url:c,stack:[l],useragent:u}},merge:r,now:_,redact:function(){return"********"},RollbarJSON:n,sanitizeUrl:function(t){var e=function(t){if(o(t,"string")){for(var e=h,i=e.parser[e.strictMode?"strict":"loose"].exec(t),r={},n=0,a=e.key.length;n<a;++n)r[e.key[n]]=i[n]||"";return r[e.q.name]={},r[e.key[12]].replace(e.q.parser,(function(t,i,n){i&&(r[e.q.name][i]=n)})),r}}(t);return e?(""===e.anchor&&(e.source=e.source.replace("#","")),t=e.source.replace("?"+e.query,"")):"(unknown)"},set:function(t,e,i){if(t){var r=e.split("."),n=r.length;if(!(n<1))if(1!==n)try{for(var o=t[r[0]]||{},a=o,s=1;s<n-1;++s)o[r[s]]=o[r[s]]||{},o=o[r[s]];o[r[n-1]]=i,t[r[0]]=a}catch(t){return}else t[r[0]]=i}},setupJSON:function(t){s(n.stringify)&&s(n.parse)||(o(JSON,"undefined")||(t?(l(JSON.stringify)&&(n.stringify=JSON.stringify),l(JSON.parse)&&(n.parse=JSON.parse)):(s(JSON.stringify)&&(n.stringify=JSON.stringify),s(JSON.parse)&&(n.parse=JSON.parse))),s(n.stringify)&&s(n.parse)||t&&t(n))},stringify:d,maxByteSize:function(t){for(var e=0,i=t.length,r=0;r<i;r++){var n=t.charCodeAt(r);n<128?e+=1:n<2048?e+=2:n<65536&&(e+=3)}return e},typeName:a,uuid4:u}},650:t=>{function e(t){return"string"!=typeof t&&(t=String(t)),t.toLowerCase()}function i(t){this.map={},t instanceof i?t.forEach((function(t,e){this.append(e,t)}),this):Array.isArray(t)?t.forEach((function(t){this.append(t[0],t[1])}),this):t&&Object.getOwnPropertyNames(t).forEach((function(e){this.append(e,t[e])}),this)}i.prototype.append=function(t,i){t=e(t),i=function(t){return"string"!=typeof t&&(t=String(t)),t}(i);var r=this.map[t];this.map[t]=r?r+", "+i:i},i.prototype.get=function(t){return t=e(t),this.has(t)?this.map[t]:null},i.prototype.has=function(t){return this.map.hasOwnProperty(e(t))},i.prototype.forEach=function(t,e){for(var i in this.map)this.map.hasOwnProperty(i)&&t.call(e,this.map[i],i,this)},i.prototype.entries=function(){var t=[];return this.forEach((function(e,i){t.push([i,e])})),function(t){return{next:function(){var e=t.shift();return{done:void 0===e,value:e}}}}(t)},t.exports=function(t){return"undefined"==typeof Headers?new i(t):new Headers(t)}},876:(t,e,i)=>{var r=i(708);t.exports=r},297:t=>{t.exports=function(t,e,i,r,n){var o=t[e];t[e]=i(o),r&&r[n].push([t,e,o])}},267:(t,e,i)=>{var r=i(702);t.exports=function(t,e,i){var n,o,a,s,l=r.isType(t,"object"),c=r.isType(t,"array"),u=[];if(i=i||{obj:[],mapped:[]},l){if(s=i.obj.indexOf(t),l&&-1!==s)return i.mapped[s]||i.obj[s];i.obj.push(t),s=i.obj.length-1}if(l)for(n in t)Object.prototype.hasOwnProperty.call(t,n)&&u.push(n);else if(c)for(a=0;a<t.length;++a)u.push(a);var h=l?{}:[],d=!0;for(a=0;a<u.length;++a)o=t[n=u[a]],h[n]=e(n,o,i),d=d&&h[n]===t[n];return l&&!d&&(i.mapped[s]=h),d?t:h}},708:t=>{t.exports=function(t){var e,i,r,n,o,a,s,l,c,u,h,d,p,f=/[\\"\u0000-\u001f\u007f-\u009f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g;function m(t){return t<10?"0"+t:t}function g(){return this.valueOf()}function y(t){return f.lastIndex=0,f.test(t)?'"'+t.replace(f,(function(t){var e=r[t];return"string"==typeof e?e:"\\u"+("0000"+t.charCodeAt(0).toString(16)).slice(-4)}))+'"':'"'+t+'"'}function _(t,r){var o,a,s,l,c,u=e,h=r[t];switch(h&&"object"==typeof h&&"function"==typeof h.toJSON&&(h=h.toJSON(t)),"function"==typeof n&&(h=n.call(r,t,h)),typeof h){case"string":return y(h);case"number":return isFinite(h)?String(h):"null";case"boolean":case"null":return String(h);case"object":if(!h)return"null";if(e+=i,c=[],"[object Array]"===Object.prototype.toString.apply(h)){for(l=h.length,o=0;o<l;o+=1)c[o]=_(o,h)||"null";return s=0===c.length?"[]":e?"[\n"+e+c.join(",\n"+e)+"\n"+u+"]":"["+c.join(",")+"]",e=u,s}if(n&&"object"==typeof n)for(l=n.length,o=0;o<l;o+=1)"string"==typeof n[o]&&(s=_(a=n[o],h))&&c.push(y(a)+(e?": ":":")+s);else for(a in h)Object.prototype.hasOwnProperty.call(h,a)&&(s=_(a,h))&&c.push(y(a)+(e?": ":":")+s);return s=0===c.length?"{}":e?"{\n"+e+c.join(",\n"+e)+"\n"+u+"}":"{"+c.join(",")+"}",e=u,s}}"function"!=typeof Date.prototype.toJSON&&(Date.prototype.toJSON=function(){return isFinite(this.valueOf())?this.getUTCFullYear()+"-"+m(this.getUTCMonth()+1)+"-"+m(this.getUTCDate())+"T"+m(this.getUTCHours())+":"+m(this.getUTCMinutes())+":"+m(this.getUTCSeconds())+"Z":null},Boolean.prototype.toJSON=g,Number.prototype.toJSON=g,String.prototype.toJSON=g),"function"!=typeof t.stringify&&(r={"\b":"\\b","\t":"\\t","\n":"\\n","\f":"\\f","\r":"\\r",'"':'\\"',"\\":"\\\\"},t.stringify=function(t,r,o){var a;if(e="",i="","number"==typeof o)for(a=0;a<o;a+=1)i+=" ";else"string"==typeof o&&(i=o);if(n=r,r&&"function"!=typeof r&&("object"!=typeof r||"number"!=typeof r.length))throw new Error("JSON.stringify");return _("",{"":t})}),"function"!=typeof t.parse&&(t.parse=(u={"\\":"\\",'"':'"',"/":"/",t:"\t",n:"\n",r:"\r",f:"\f",b:"\b"},h={go:function(){o="ok"},firstokey:function(){l=c,o="colon"},okey:function(){l=c,o="colon"},ovalue:function(){o="ocomma"},firstavalue:function(){o="acomma"},avalue:function(){o="acomma"}},d={go:function(){o="ok"},ovalue:function(){o="ocomma"},firstavalue:function(){o="acomma"},avalue:function(){o="acomma"}},p={"{":{go:function(){a.push({state:"ok"}),s={},o="firstokey"},ovalue:function(){a.push({container:s,state:"ocomma",key:l}),s={},o="firstokey"},firstavalue:function(){a.push({container:s,state:"acomma"}),s={},o="firstokey"},avalue:function(){a.push({container:s,state:"acomma"}),s={},o="firstokey"}},"}":{firstokey:function(){var t=a.pop();c=s,s=t.container,l=t.key,o=t.state},ocomma:function(){var t=a.pop();s[l]=c,c=s,s=t.container,l=t.key,o=t.state}},"[":{go:function(){a.push({state:"ok"}),s=[],o="firstavalue"},ovalue:function(){a.push({container:s,state:"ocomma",key:l}),s=[],o="firstavalue"},firstavalue:function(){a.push({container:s,state:"acomma"}),s=[],o="firstavalue"},avalue:function(){a.push({container:s,state:"acomma"}),s=[],o="firstavalue"}},"]":{firstavalue:function(){var t=a.pop();c=s,s=t.container,l=t.key,o=t.state},acomma:function(){var t=a.pop();s.push(c),c=s,s=t.container,l=t.key,o=t.state}},":":{colon:function(){if(Object.hasOwnProperty.call(s,l))throw new SyntaxError("Duplicate key '"+l+'"');o="ovalue"}},",":{ocomma:function(){s[l]=c,o="okey"},acomma:function(){s.push(c),o="avalue"}},true:{go:function(){c=!0,o="ok"},ovalue:function(){c=!0,o="ocomma"},firstavalue:function(){c=!0,o="acomma"},avalue:function(){c=!0,o="acomma"}},false:{go:function(){c=!1,o="ok"},ovalue:function(){c=!1,o="ocomma"},firstavalue:function(){c=!1,o="acomma"},avalue:function(){c=!1,o="acomma"}},null:{go:function(){c=null,o="ok"},ovalue:function(){c=null,o="ocomma"},firstavalue:function(){c=null,o="acomma"},avalue:function(){c=null,o="acomma"}}},function(t,e){var i,r,n=/^[\u0020\t\n\r]*(?:([,:\[\]{}]|true|false|null)|(-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?)|"((?:[^\r\n\t\\\"]|\\(?:["\\\/trnfb]|u[0-9a-fA-F]{4}))*)")/;o="go",a=[];try{for(;i=n.exec(t);)i[1]?p[i[1]][o]():i[2]?(c=+i[2],d[o]()):(r=i[3],c=r.replace(/\\(?:u(.{4})|([^u]))/g,(function(t,e,i){return e?String.fromCharCode(parseInt(e,16)):u[i]})),h[o]()),t=t.slice(i[0].length)}catch(t){o=t}if("ok"!==o||/[^\u0020\t\n\r]/.test(t))throw o instanceof SyntaxError?o:new SyntaxError("JSON");return"function"==typeof e?function t(i,r){var n,o,a=i[r];if(a&&"object"==typeof a)for(n in c)Object.prototype.hasOwnProperty.call(a,n)&&(void 0!==(o=t(a,n))?a[n]=o:delete a[n]);return e.call(i,r,a)}({"":c},""):c}))}}},e={},function i(r){var n=e[r];if(void 0!==n)return n.exports;var o=e[r]={exports:{}};return t[r].call(o.exports,o,o.exports,i),o.exports}(739);var t,e}))),ft.exports);class yt{static initialize(){yt.instance=new yt,yt.instance.rollbar=gt.init({accessToken:this.ACCESS_TOKEN,captureUncaught:!0,captureUnhandledRejections:!0,environment:this.ENVIRONMENT,payload:{environment:"route-view-totems"}})}static{this.ACCESS_TOKEN="1234567890"}static{this.ENVIRONMENT=process.env.NODE_ENV||"development"}static getInstance(){return yt.instance||yt.initialize(),yt.instance}error(t,e){this.rollbar?.error(t,e)}}
34
+ /**
35
+ * @license
36
+ * Copyright 2021 Google LLC
37
+ * SPDX-License-Identifier: BSD-3-Clause
38
+ */let _t=class extends Event{constructor(t,e,i,r){super("context-request",{bubbles:!0,composed:!0}),this.context=t,this.contextTarget=e,this.callback=i,this.subscribe=r??!1}};
39
+ /**
40
+ * @license
41
+ * Copyright 2021 Google LLC
42
+ * SPDX-License-Identifier: BSD-3-Clause
43
+ */
44
+ /**
45
+ * @license
46
+ * Copyright 2021 Google LLC
47
+ * SPDX-License-Identifier: BSD-3-Clause
48
+ */
49
+ let vt=class{constructor(t,e,i,r){if(this.subscribe=!1,this.provided=!1,this.value=void 0,this.t=(t,e)=>{this.unsubscribe&&(this.unsubscribe!==e&&(this.provided=!1,this.unsubscribe()),this.subscribe||this.unsubscribe()),this.value=t,this.host.requestUpdate(),this.provided&&!this.subscribe||(this.provided=!0,this.callback&&this.callback(t,e)),this.unsubscribe=e},this.host=t,void 0!==e.context){const t=e;this.context=t.context,this.callback=t.callback,this.subscribe=t.subscribe??!1}else this.context=e,this.callback=i,this.subscribe=r??!1;this.host.addController(this)}hostConnected(){this.dispatchRequest()}hostDisconnected(){this.unsubscribe&&(this.unsubscribe(),this.unsubscribe=void 0)}dispatchRequest(){this.host.dispatchEvent(new _t(this.context,this.host,this.t,this.subscribe))}};
50
+ /**
51
+ * @license
52
+ * Copyright 2021 Google LLC
53
+ * SPDX-License-Identifier: BSD-3-Clause
54
+ */class bt{get value(){return this.o}set value(t){this.setValue(t)}setValue(t,e=!1){const i=e||!Object.is(t,this.o);this.o=t,i&&this.updateObservers()}constructor(t){this.subscriptions=new Map,this.updateObservers=()=>{for(const[t,{disposer:e}]of this.subscriptions)t(this.o,e)},void 0!==t&&(this.value=t)}addCallback(t,e,i){if(!i)return void t(this.value);this.subscriptions.has(t)||this.subscriptions.set(t,{disposer:()=>{this.subscriptions.delete(t)},consumerHost:e});const{disposer:r}=this.subscriptions.get(t);t(this.value,r)}clearCallbacks(){this.subscriptions.clear()}}
55
+ /**
56
+ * @license
57
+ * Copyright 2021 Google LLC
58
+ * SPDX-License-Identifier: BSD-3-Clause
59
+ */class xt extends Event{constructor(t,e){super("context-provider",{bubbles:!0,composed:!0}),this.context=t,this.contextTarget=e}}class wt extends bt{constructor(t,e,i){super(void 0!==e.context?e.initialValue:i),this.onContextRequest=t=>{if(t.context!==this.context)return;const e=t.contextTarget??t.composedPath()[0];e!==this.host&&(t.stopPropagation(),this.addCallback(t.callback,e,t.subscribe))},this.onProviderRequest=t=>{if(t.context!==this.context)return;if((t.contextTarget??t.composedPath()[0])===this.host)return;const e=new Set;for(const[i,{consumerHost:r}]of this.subscriptions)e.has(i)||(e.add(i),r.dispatchEvent(new _t(this.context,r,i,!0)));t.stopPropagation()},this.host=t,void 0!==e.context?this.context=e.context:this.context=e,this.attachListeners(),this.host.addController?.(this)}attachListeners(){this.host.addEventListener("context-request",this.onContextRequest),this.host.addEventListener("context-provider",this.onProviderRequest)}hostConnected(){this.host.dispatchEvent(new xt(this.context,this.host))}}
60
+ /**
61
+ * @license
62
+ * Copyright 2022 Google LLC
63
+ * SPDX-License-Identifier: BSD-3-Clause
64
+ */var kt,Et={exports:{}};var St=(kt||(kt=1,function(t){var e;self,e=()=>(()=>{var t={773:function(t,e){!function(t){function e(t){return e="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},e(t)}function i(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function r(t,e,i){return Object.defineProperty(t,"prototype",{writable:!1}),t}var n={SESSIONS:"sessions",EVENTS:"events",VIEWS:"views",SCROLLS:"scrolls",CLICKS:"clicks",FORMS:"forms",CRASHES:"crashes",ATTRIBUTION:"attribution",USERS:"users",STAR_RATING:"star-rating",LOCATION:"location",APM:"apm",FEEDBACK:"feedback",REMOTE_CONFIG:"remote-config"},o={NPS:"[CLY]_nps",SURVEY:"[CLY]_survey",STAR_RATING:"[CLY]_star_rating",VIEW:"[CLY]_view",ORIENTATION:"[CLY]_orientation",ACTION:"[CLY]_action"},a=Object.values(o),s={ERROR:"[ERROR] ",WARNING:"[WARNING] ",INFO:"[INFO] ",DEBUG:"[DEBUG] ",VERBOSE:"[VERBOSE] "},l={DEVELOPER_SUPPLIED:0,SDK_GENERATED:1,TEMPORARY_ID:2,URL_PROVIDED:3},c={BEAT_INTERVAL:500,QUEUE_SIZE:1e3,FAIL_TIMEOUT_AMOUNT:60,INACTIVITY_TIME:20,SESSION_UPDATE:60,MAX_EVENT_BATCH:100,SESSION_COOKIE_TIMEOUT:30,MAX_KEY_LENGTH:128,MAX_VALUE_SIZE:256,MAX_SEGMENTATION_VALUES:100,MAX_BREADCRUMB_COUNT:100,MAX_STACKTRACE_LINES_PER_THREAD:30,MAX_STACKTRACE_LINE_LENGTH:200},u={BOOMERANG_SRC:"https://cdn.jsdelivr.net/npm/countly-sdk-web@latest/plugin/boomerang/boomerang.min.js",CLY_BOOMERANG_SRC:"https://cdn.jsdelivr.net/npm/countly-sdk-web@latest/plugin/boomerang/countly_boomerang.js"},h=Object.freeze({errorCount:"cly_hc_error_count",warningCount:"cly_hc_warning_count",statusCode:"cly_hc_status_code",errorMessage:"cly_hc_error_message"}),d="23.12.6",p="javascript_native_web",f=/^(((([^:\/#\?]+:)?(?:(\/\/)((?:(([^:@\/#\?]+)(?:\:([^:@\/#\?]+))?)@)?(([^:\/#\?\]\[]+|\[[^\/\]@#?]+\])(?:\:([0-9]+))?))?)?)?((\/?(?:[^\/\?#]+\/+)*)([^\?#]*)))?(\?[^#]+)?)(#.*)?/,m="undefined"!=typeof window,g=globalThis.Countly||{};function y(t){var e=[];if(void 0!==t.options)for(var i=0;i<t.options.length;i++)t.options[i].selected&&e.push(t.options[i].value);return e.join(", ")}function _(){var t="xxxxxxxx";return(t=b(t,"[x]"))+Date.now().toString()}function v(){var t="xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx";return t=b(t,"[xy]")}function b(t,e){var i=(new Date).getTime(),r=new RegExp(e,"g");return t.replace(r,(function(t){var e=(i+16*Math.random())%16|0;return("x"===t?e:3&e|8).toString(16)}))}function x(){return Math.floor((new Date).getTime()/1e3)}var w=0;function k(){var t=(new Date).getTime();return w>=t?w++:w=t,w}function E(t,e,i){if(e&&Object.keys(e).length){if(void 0!==e[t])return e[t]}else if(void 0!==g[t])return g[t];return i}function S(t,e,i){for(var r in g.i)g.i[r].tracking_crashes&&g.i[r].recordError(t,e,i)}function I(t){var e=[];for(var i in t)e.push(i+"="+encodeURIComponent(t[i]));return e.join("&")}function C(t){return"string"==typeof t&&"/"===t.substring(t.length-1)?t.substring(0,t.length-1):t}function T(t,e){for(var i,r={},n=0,o=e.length;n<o;n++)void 0!==t[i=e[n]]&&(r[i]=t[i]);return r}function A(t,e,i){if(i){for(var r,n=0,o=i.length;n<o;n++)void 0!==e[r=i[n]]&&(t[r]=e[r]);return t}}function P(t,e,i,r,n,o){var a={};if(t){if(Object.keys(t).length>r){var s={},l=0;for(var c in t)l<r&&(s[c]=t[c],l++);t=s}for(var u in t){var h=M(u,e,n,o),d=M(t[u],i,n,o);a[h]=d}}return a}function M(t,e,i,r){var n=t;return"number"==typeof t&&(t=t.toString()),"string"==typeof t&&t.length>e&&(n=t.substring(0,e),r(s.DEBUG,i+", Key: [ "+t+" ] is longer than accepted length. It will be truncated.")),n}function L(t,e){for(e=e.toUpperCase();t;){if(t.nodeName.toUpperCase()===e)return t;t=t.parentElement}}function z(t,e,i){m&&(null!=t?void 0!==t.addEventListener?t.addEventListener(e,i,!1):t.attachEvent("on"+e,i):W()&&console.warn("[WARNING] [Countly] add_event_listener, Can't bind ["+e+"] event to nonexisting element"))}function D(t){return t?void 0!==t.target?t.target:t.srcElement:window.event.srcElement}function R(t){if(t)return t;var e=navigator.userAgent;return e||(e=O()),e}function O(t){if(t)return t;var e="";return navigator.userAgentData&&(e=navigator.userAgentData.brands.map((function(t){return t.brand+":"+t.version})).join(),e+=navigator.userAgentData.mobile?" mobi ":" ",e+=navigator.userAgentData.platform),e}function F(t){var e;if(t)e=t;else{if(navigator.userAgentData&&navigator.userAgentData.mobile)return"phone";e=R()}e=e.toLowerCase();var i="desktop",r=/(mobi|ipod|phone|blackberry|opera mini|fennec|minimo|symbian|psp|nintendo ds|archos|skyfire|puffin|blazer|bolt|gobrowser|iris|maemo|semc|teashark|uzard)/;return/(ipad|tablet|(android(?!.*mobile))|(windows(?!.*phone)(.*touch))|kindle|playbook|silk|(puffin(?!.*(IP|AP|WP))))/.test(e)?i="tablet":r.test(e)&&(i="phone"),i}function B(t){var e=/(CountlySiteBot|nuhk|Googlebot|GoogleSecurityScanner|Yammybot|Openbot|Slurp|MSNBot|Ask Jeeves\/Teoma|ia_archiver|bingbot|Google Web Preview|Mediapartners-Google|AdsBot-Google|Baiduspider|Ezooms|YahooSeeker|AltaVista|AVSearch|Mercator|Scooter|InfoSeek|Ultraseek|Lycos|Wget|YandexBot|Yandex|YaDirectFetcher|SiteBot|Exabot|AhrefsBot|MJ12bot|TurnitinBot|magpie-crawler|Nutch Crawler|CMS Crawler|rogerbot|Domnutch|ssearch_bot|XoviBot|netseer|digincore|fr-crawler|wesee|AliasIO|contxbot|PingdomBot|BingPreview|HeadlessChrome|Lighthouse)/;if(t)return e.test(t);var i=e.test(R()),r=e.test(O());return i||r}function N(t){return void 0===t.pageY&&"number"==typeof t.clientX&&document.documentElement&&(t.pageX=t.clientX+document.body.scrollLeft+document.documentElement.scrollLeft,t.pageY=t.clientY+document.body.scrollTop+document.documentElement.scrollTop),t}function j(){var t=document;return Math.max(Math.max(t.body.scrollHeight,t.documentElement.scrollHeight),Math.max(t.body.offsetHeight,t.documentElement.offsetHeight),Math.max(t.body.clientHeight,t.documentElement.clientHeight))}function V(){var t=document;return Math.max(Math.max(t.body.scrollWidth,t.documentElement.scrollWidth),Math.max(t.body.offsetWidth,t.documentElement.offsetWidth),Math.max(t.body.clientWidth,t.documentElement.clientWidth))}function U(){var t=document;return Math.min(Math.min(t.body.clientHeight,t.documentElement.clientHeight),Math.min(t.body.offsetHeight,t.documentElement.offsetHeight),window.innerHeight)}function q(){return window.innerWidth>window.innerHeight?"landscape":"portrait"}function $(t,e,i,r,n,o){var a,s=document.createElement(t);s.setAttribute(e,i),s.setAttribute(r,n);var l=function(){a||o(),a=!0};o&&(s.onreadystatechange=l,s.onload=l),document.getElementsByTagName("head")[0].appendChild(s)}function G(t,e){$("script","type","text/javascript","src",t,e)}function H(t,e){$("link","rel","stylesheet","href",t,e)}function Z(){if(m){var t=document.getElementById("cly-loader");if(!t){var e="#cly-loader {height: 4px; width: 100%; position: absolute; z-index: 99999; overflow: hidden; background-color: #fff; top:0px; left:0px;}#cly-loader:before{display: block; position: absolute; content: ''; left: -200px; width: 200px; height: 4px; background-color: #2EB52B; animation: cly-loading 2s linear infinite;}@keyframes cly-loading { from {left: -200px; width: 30%;} 50% {width: 30%;} 70% {width: 70%;} 80% { left: 50%;} 95% {left: 120%;} to {left: 100%;}}",i=document.head||document.getElementsByTagName("head")[0],r=document.createElement("style");r.type="text/css",r.styleSheet?r.styleSheet.cssText=e:r.appendChild(document.createTextNode(e)),i.appendChild(r),(t=document.createElement("div")).setAttribute("id","cly-loader"),document.body.onload=function(){if(g.showLoaderProtection)W()&&console.warn("[WARNING] [Countly] showloader, Loader is already on");else try{document.body.appendChild(t)}catch(xt){W()&&console.error("[ERROR] [Countly] showLoader, Body is not loaded for loader to append: "+xt)}}}t.style.display="block"}}function W(){return!(!g||!g.debug||"undefined"==typeof console)}function X(){if(m){g.showLoaderProtection=!0;var t=document.getElementById("cly-loader");t&&(t.style.display="none")}}var J=r((function t(r){i(this,t);var u,b=this,w=!g.i,$=!1,J="/i",K="/o/sdk",Y=E("interval",r,c.BEAT_INTERVAL),Q=E("queue_size",r,c.QUEUE_SIZE),tt=[],et=[],it={},rt=[],nt={},ot=E("ignore_referrers",r,[]),at=null,st=!0,lt=0,ct=null,ut=0,ht=0,dt=0,pt=E("fail_timeout",r,c.FAIL_TIMEOUT_AMOUNT),ft=E("inactivity_time",r,c.INACTIVITY_TIME),mt=0,gt=E("session_update",r,c.SESSION_UPDATE),yt=E("max_events",r,c.MAX_EVENT_BATCH),_t=E("max_logs",r,null),vt=E("use_session_cookie",r,!0),bt=E("session_cookie_timeout",r,c.SESSION_COOKIE_TIMEOUT),wt=!0,kt=!1,Et=E("offline_mode",r,!1),St={},It=!0,Ct=x(),Tt=!0,At=null,Pt=l.SDK_GENERATED,Mt=!1,Lt=0,zt=!1,Dt=null,Rt=null,Ot=null,Ft=E("sdk_name",r,p),Bt=E("sdk_version",r,d);try{localStorage.setItem("cly_testLocal",!0),localStorage.removeItem("cly_testLocal")}catch(xt){ce(s.ERROR,"Local storage test failed, Halting local storage support: "+xt),Tt=!1}for(var Nt,jt={},Vt=0;Vt<g.features.length;Vt++)jt[g.features[Vt]]={};this.initialize=function(){if(this.serialize=E("serialize",r,g.serialize),this.deserialize=E("deserialize",r,g.deserialize),this.getViewName=E("getViewName",r,g.getViewName),this.getViewUrl=E("getViewUrl",r,g.getViewUrl),this.getSearchQuery=E("getSearchQuery",r,g.getSearchQuery),this.DeviceIdType=g.DeviceIdType,this.namespace=E("namespace",r,""),this.clearStoredId=E("clear_stored_id",r,!1),this.app_key=E("app_key",r,null),this.onload=E("onload",r,[]),this.utm=E("utm",r,{source:!0,medium:!0,campaign:!0,term:!0,content:!0}),this.ignore_prefetch=E("ignore_prefetch",r,!0),this.rcAutoOptinAb=E("rc_automatic_optin_for_ab",r,!0),this.useExplicitRcApi=E("use_explicit_rc_api",r,!1),this.debug=E("debug",r,!1),this.test_mode=E("test_mode",r,!1),this.test_mode_eq=E("test_mode_eq",r,!1),this.metrics=E("metrics",r,{}),this.headers=E("headers",r,{}),this.url=C(E("url",r,"")),this.app_version=E("app_version",r,"0.0"),this.country_code=E("country_code",r,null),this.city=E("city",r,null),this.ip_address=E("ip_address",r,null),this.ignore_bots=E("ignore_bots",r,!0),this.force_post=E("force_post",r,!1),this.remote_config=E("remote_config",r,!1),this.ignore_visitor=E("ignore_visitor",r,!1),this.require_consent=E("require_consent",r,!1),this.track_domains=m?E("track_domains",r,!0):void 0,this.storage=E("storage",r,"default"),this.enableOrientationTracking=m?E("enable_orientation_tracking",r,!0):void 0,this.maxKeyLength=E("max_key_length",r,c.MAX_KEY_LENGTH),this.maxValueSize=E("max_value_size",r,c.MAX_VALUE_SIZE),this.maxSegmentationValues=E("max_segmentation_values",r,c.MAX_SEGMENTATION_VALUES),this.maxBreadcrumbCount=E("max_breadcrumb_count",r,null),this.maxStackTraceLinesPerThread=E("max_stack_trace_lines_per_thread",r,c.MAX_STACKTRACE_LINES_PER_THREAD),this.maxStackTraceLineLength=E("max_stack_trace_line_length",r,c.MAX_STACKTRACE_LINE_LENGTH),this.heatmapWhitelist=E("heatmap_whitelist",r,[]),b.hcErrorCount=Ee(h.errorCount)||0,b.hcWarningCount=Ee(h.warningCount)||0,b.hcStatusCode=Ee(h.statusCode)||-1,b.hcErrorMessage=Ee(h.errorMessage)||"",_t&&!this.maxBreadcrumbCount?(this.maxBreadcrumbCount=_t,ce(s.WARNING,"initialize, 'maxCrashLogs' is deprecated. Use 'maxBreadcrumbCount' instead!")):_t||this.maxBreadcrumbCount||(this.maxBreadcrumbCount=100),"cookie"===this.storage&&(Tt=!1),this.rcAutoOptinAb||this.useExplicitRcApi||(ce(s.WARNING,"initialize, Auto opting is disabled, switching to explicit RC API"),this.useExplicitRcApi=!0),Array.isArray(ot)||(ot=[]),""===this.url&&(ce(s.ERROR,"initialize, Please provide server URL"),this.ignore_visitor=!0),Ee("cly_ignore")&&(this.ignore_visitor=!0),Ce(),tt=Ee("cly_queue")||[],et=Ee("cly_event")||[],it=Ee("cly_remote_configs")||{},this.clearStoredId&&(Ee("cly_id")&&!y&&(this.device_id=Ee("cly_id"),ce(s.DEBUG,"initialize, temporarily using the previous device ID to flush existing events"),(Pt=Ee("cly_id_type"))||(ce(s.DEBUG,"initialize, No device ID type info from the previous session, falling back to DEVELOPER_SUPPLIED, for event flushing"),Pt=l.DEVELOPER_SUPPLIED),Wt(),this.device_id=void 0,Pt=l.SDK_GENERATED),ce(s.INFO,"initialize, Clearing the device ID storage"),Ie("cly_id"),Ie("cly_id_type"),Ie("cly_session")),Zt(),m)if(window.name&&0===window.name.indexOf("cly:"))try{this.passed_data=JSON.parse(window.name.replace("cly:",""))}catch(x){ce(s.ERROR,"initialize, Could not parse name: "+window.name+", error: "+x)}else if(location.hash&&0===location.hash.indexOf("#cly:"))try{this.passed_data=JSON.parse(location.hash.replace("#cly:",""))}catch(x){ce(s.ERROR,"initialize, Could not parse hash: "+location.hash+", error: "+x)}if((this.passed_data&&this.passed_data.app_key&&this.passed_data.app_key===this.app_key||this.passed_data&&!this.passed_data.app_key&&w)&&this.passed_data.token&&this.passed_data.purpose){this.passed_data.token!==Ee("cly_old_token")&&(_e(this.passed_data.token),Se("cly_old_token",this.passed_data.token));var t=[];Array.isArray(this.heatmapWhitelist)?(this.heatmapWhitelist.push(this.url),t=this.heatmapWhitelist.map((function(t){return C(t)}))):t=[this.url],t.includes(this.passed_data.url)&&"heatmap"===this.passed_data.purpose&&(this.ignore_visitor=!0,Z(),G(this.passed_data.url+"/views/heatmap.js",X))}if(this.ignore_visitor)ce(s.WARNING,"initialize, ignore_visitor:["+this.ignore_visitor+"], this user will not be tracked");else{ce(s.DEBUG,Ft===p&&Bt===d?"initialize, SDK name:["+Ft+"], version:["+Bt+"]":"initialize, SDK name:["+Ft+"], version:["+Bt+"], default name:["+p+"] and default version:["+d+"]"),ce(s.DEBUG,"initialize, app_key:["+this.app_key+"], url:["+this.url+"]"),ce(s.DEBUG,"initialize, device_id:["+E("device_id",r,void 0)+"]"),ce(s.DEBUG,"initialize, require_consent is enabled:["+this.require_consent+"]");try{ce(s.DEBUG,"initialize, metric override:["+JSON.stringify(this.metrics)+"]"),ce(s.DEBUG,"initialize, header override:["+JSON.stringify(this.headers)+"]"),ce(s.DEBUG,"initialize, number of onload callbacks provided:["+this.onload.length+"]"),ce(s.DEBUG,"initialize, utm tags:["+JSON.stringify(this.utm)+"]"),ot&&ce(s.DEBUG,"initialize, referrers to ignore :["+JSON.stringify(ot)+"]")}catch(xt){ce(s.ERROR,"initialize, Could not stringify some config object values")}ce(s.DEBUG,"initialize, app_version:["+this.app_version+"]"),ce(s.DEBUG,"initialize, provided location info; country_code:["+this.country_code+"], city:["+this.city+"], ip_address:["+this.ip_address+"]"),""!==this.namespace&&ce(s.DEBUG,"initialize, namespace given:["+this.namespace+"]"),this.clearStoredId&&ce(s.DEBUG,"initialize, clearStoredId flag set to:["+this.clearStoredId+"]"),this.ignore_prefetch&&ce(s.DEBUG,"initialize, ignoring pre-fetching and pre-rendering from counting as real website visits :["+this.ignore_prefetch+"]"),this.test_mode&&ce(s.WARNING,"initialize, test_mode:["+this.test_mode+"], request queue won't be processed"),this.test_mode_eq&&ce(s.WARNING,"initialize, test_mode_eq:["+this.test_mode_eq+"], event queue won't be processed"),this.heatmapWhitelist&&ce(s.DEBUG,"initialize, heatmap whitelist:["+JSON.stringify(this.heatmapWhitelist)+"], these domains will be whitelisted"),"default"!==this.storage&&ce(s.DEBUG,"initialize, storage is set to:["+this.storage+"]"),this.ignore_bots&&ce(s.DEBUG,"initialize, ignore traffic from bots :["+this.ignore_bots+"]"),this.force_post&&ce(s.DEBUG,"initialize, forced post method for all requests:["+this.force_post+"]"),this.remote_config&&ce(s.DEBUG,"initialize, remote_config callback provided:["+!!this.remote_config+"]"),"boolean"==typeof this.rcAutoOptinAb&&ce(s.DEBUG,"initialize, automatic RC optin is enabled:["+this.rcAutoOptinAb+"]"),this.useExplicitRcApi||ce(s.WARNING,"initialize, will use legacy RC API. Consider enabling new API during init with use_explicit_rc_api flag"),this.track_domains&&ce(s.DEBUG,"initialize, tracking domain info:["+this.track_domains+"]"),this.enableOrientationTracking&&ce(s.DEBUG,"initialize, enableOrientationTracking:["+this.enableOrientationTracking+"]"),vt||ce(s.WARNING,"initialize, use_session_cookie is enabled:["+vt+"]"),Et&&ce(s.DEBUG,"initialize, offline_mode:["+Et+"], user info won't be send to the servers"),Et&&ce(s.DEBUG,"initialize, stored remote configs:["+JSON.stringify(it)+"]"),ce(s.DEBUG,"initialize, 'getViewName' callback override provided:["+(this.getViewName!==g.getViewName)+"]"),ce(s.DEBUG,"initialize, 'getSearchQuery' callback override provided:["+(this.getSearchQuery!==g.getSearchQuery)+"]"),this.maxKeyLength!==c.MAX_KEY_LENGTH&&ce(s.DEBUG,"initialize, maxKeyLength set to:["+this.maxKeyLength+"] characters"),this.maxValueSize!==c.MAX_VALUE_SIZE&&ce(s.DEBUG,"initialize, maxValueSize set to:["+this.maxValueSize+"] characters"),this.maxSegmentationValues!==c.MAX_SEGMENTATION_VALUES&&ce(s.DEBUG,"initialize, maxSegmentationValues set to:["+this.maxSegmentationValues+"] key/value pairs"),this.maxBreadcrumbCount!==c.MAX_BREADCRUMB_COUNT&&ce(s.DEBUG,"initialize, maxBreadcrumbCount for custom logs set to:["+this.maxBreadcrumbCount+"] entries"),this.maxStackTraceLinesPerThread!==c.MAX_STACKTRACE_LINES_PER_THREAD&&ce(s.DEBUG,"initialize, maxStackTraceLinesPerThread set to:["+this.maxStackTraceLinesPerThread+"] lines"),this.maxStackTraceLineLength!==c.MAX_STACKTRACE_LINE_LENGTH&&ce(s.DEBUG,"initialize, maxStackTraceLineLength set to:["+this.maxStackTraceLineLength+"] characters"),Y!==c.BEAT_INTERVAL&&ce(s.DEBUG,"initialize, interval for heartbeats set to:["+Y+"] milliseconds"),Q!==c.QUEUE_SIZE&&ce(s.DEBUG,"initialize, queue_size set to:["+Q+"] items max"),pt!==c.FAIL_TIMEOUT_AMOUNT&&ce(s.DEBUG,"initialize, fail_timeout set to:["+pt+"] seconds of wait time after a failed connection to server"),ft!==c.INACTIVITY_TIME&&ce(s.DEBUG,"initialize, inactivity_time set to:["+ft+"] minutes to consider a user as inactive after no observable action"),gt!==c.SESSION_UPDATE&&ce(s.DEBUG,"initialize, session_update set to:["+gt+"] seconds to check if extending a session is needed while the user is active"),yt!==c.MAX_EVENT_BATCH&&ce(s.DEBUG,"initialize, max_events set to:["+yt+"] events to send in one batch"),_t&&ce(s.WARNING,"initialize, max_logs set to:["+_t+"] breadcrumbs to store for crash logs max, deprecated "),bt!==c.SESSION_COOKIE_TIMEOUT&&ce(s.DEBUG,"initialize, session_cookie_timeout set to:["+bt+"] minutes to expire a cookies session");var e=null,i=b.getSearchQuery(),n=!1,o={};if(i){0===i.indexOf("?")&&(i=i.substring(1));for(var a=i.split("&"),u=0;u<a.length;u++){var f=a[u].split("=");"cly_id"===f[0]?Se("cly_cmp_id",f[1]):"cly_uid"===f[0]?Se("cly_cmp_uid",f[1]):"cly_device_id"===f[0]?e=f[1]:0===(f[0]+"").indexOf("utm_")&&this.utm[f[0].replace("utm_","")]&&(o[f[0].replace("utm_","")]=f[1],n=!0)}}var y="[CLY]_temp_id"===Ee("cly_id"),_=E("device_id",r,void 0);if("number"==typeof _&&(_=_.toString()),Ee("cly_id")&&!y?(this.device_id=Ee("cly_id"),ce(s.INFO,"initialize, Set the stored device ID"),(Pt=Ee("cly_id_type"))||(ce(s.INFO,"initialize, No device ID type info from the previous session, falling back to DEVELOPER_SUPPLIED"),Pt=l.DEVELOPER_SUPPLIED)):null!==e?(ce(s.INFO,"initialize, Device ID set by URL"),this.device_id=e,Pt=l.URL_PROVIDED):_?(ce(s.INFO,"initialize, Device ID set by developer"),this.device_id=_,r&&Object.keys(r).length?void 0!==r.device_id&&(Pt=l.DEVELOPER_SUPPLIED):void 0!==g.device_id&&(Pt=l.DEVELOPER_SUPPLIED)):Et||y?(this.device_id="[CLY]_temp_id",Pt=l.TEMPORARY_ID,Et&&y?ce(s.INFO,"initialize, Temp ID set, continuing offline mode from previous app session"):Et&&!y?ce(s.INFO,"initialize, Temp ID set, entering offline mode"):(Et=!0,ce(s.INFO,"initialize, Temp ID set, enabling offline mode"))):(ce(s.INFO,"initialize, Generating the device ID"),this.device_id=E("device_id",r,ne()),r&&Object.keys(r).length?void 0!==r.device_id&&(Pt=l.DEVELOPER_SUPPLIED):void 0!==g.device_id&&(Pt=l.DEVELOPER_SUPPLIED)),Se("cly_id",this.device_id),Se("cly_id_type",Pt),n){for(var v in Ot={},this.utm)o[v]?(this.userData.set("utm_"+v,o[v]),Ot[v]=o[v]):this.userData.unset("utm_"+v);this.userData.save()}Jt(),setTimeout((function(){g.noHeartBeat?ce(s.WARNING,"initialize, Heartbeat disabled. This is for testing purposes only!"):ie(),b.remote_config&&b.fetch_remote_config(b.remote_config)}),1),m&&document.documentElement.setAttribute("data-countly-useragent",R()),Te.sendInstantHCRequest(),ce(s.INFO,"initialize, Countly initialized")}},this.halt=function(){ce(s.WARNING,"halt, Resetting Countly"),g.i=void 0,g.q=[],g.noHeartBeat=void 0,w=!g.i,$=!1,J="/i",K="/o/sdk",Y=500,Q=1e3,tt=[],et=[],it={},rt=[],nt={},ot=[],at=null,st=!0,lt=0,ct=null,ut=0,ht=0,dt=0,pt=60,ft=20,mt=0,gt=60,yt=100,_t=null,vt=!0,bt=30,wt=!0,kt=!1,Et=!1,St={},It=!0,Ct=x(),Tt=!0,At=null,Pt=l.SDK_GENERATED,Mt=!1,Lt=0,zt=!1,Dt=null,Rt=null,Ot=null;try{localStorage.setItem("cly_testLocal",!0),localStorage.removeItem("cly_testLocal")}catch(xt){ce(s.ERROR,"halt, Local storage test failed, will fallback to cookies"),Tt=!1}g.features=[n.SESSIONS,n.EVENTS,n.VIEWS,n.SCROLLS,n.CLICKS,n.FORMS,n.CRASHES,n.ATTRIBUTION,n.USERS,n.STAR_RATING,n.LOCATION,n.APM,n.FEEDBACK,n.REMOTE_CONFIG],jt={};for(var t=0;t<g.features.length;t++)jt[g.features[t]]={};b.app_key=void 0,b.device_id=void 0,b.onload=void 0,b.utm=void 0,b.ignore_prefetch=void 0,b.debug=void 0,b.test_mode=void 0,b.test_mode_eq=void 0,b.metrics=void 0,b.headers=void 0,b.url=void 0,b.app_version=void 0,b.country_code=void 0,b.city=void 0,b.ip_address=void 0,b.ignore_bots=void 0,b.force_post=void 0,b.rcAutoOptinAb=void 0,b.useExplicitRcApi=void 0,b.remote_config=void 0,b.ignore_visitor=void 0,b.require_consent=void 0,b.track_domains=void 0,b.storage=void 0,b.enableOrientationTracking=void 0,b.maxKeyLength=void 0,b.maxValueSize=void 0,b.maxSegmentationValues=void 0,b.maxBreadcrumbCount=void 0,b.maxStackTraceLinesPerThread=void 0,b.maxStackTraceLineLength=void 0},this.group_features=function(t){if(ce(s.INFO,"group_features, Grouping features"),t)for(var e in t)jt[e]?ce(s.WARNING,"group_features, Feature name ["+e+"] is already reserved"):"string"==typeof t[e]?jt[e]={features:[t[e]]}:t[e]&&Array.isArray(t[e])&&t[e].length?jt[e]={features:t[e]}:ce(s.ERROR,"group_features, Incorrect feature list for ["+e+"] value: ["+t[e]+"]");else ce(s.ERROR,"group_features, Incorrect features:["+t+"]")},this.check_consent=function(t){return ce(s.INFO,"check_consent, Checking if consent is given for specific feature:["+t+"]"),this.require_consent?jt[t]?!(!jt[t]||!jt[t].optin):(ce(s.ERROR,"check_consent, No feature available for ["+t+"]"),!1):(ce(s.INFO,"check_consent, require_consent is off, no consent is necessary"),!0)},this.get_device_id_type=function(){var t;switch(ce(s.INFO,"check_device_id_type, Retrieving the current device id type.["+Pt+"]"),Pt){case l.SDK_GENERATED:t=b.DeviceIdType.SDK_GENERATED;break;case l.URL_PROVIDED:case l.DEVELOPER_SUPPLIED:t=b.DeviceIdType.DEVELOPER_SUPPLIED;break;case l.TEMPORARY_ID:t=b.DeviceIdType.TEMPORARY_ID;break;default:t=-1}return t},this.get_device_id=function(){return ce(s.INFO,"get_device_id, Retrieving the device id: ["+b.device_id+"]"),b.device_id},this.check_any_consent=function(){if(ce(s.INFO,"check_any_consent, Checking if any consent is given"),!this.require_consent)return ce(s.INFO,"check_any_consent, require_consent is off, no consent is necessary"),!0;for(var t in jt)if(jt[t]&&jt[t].optin)return!0;return ce(s.INFO,"check_any_consent, No consents given"),!1},this.add_consent=function(t){if(ce(s.INFO,"add_consent, Adding consent for ["+t+"]"),Array.isArray(t))for(var e=0;e<t.length;e++)this.add_consent(t[e]);else jt[t]?jt[t].features?(jt[t].optin=!0,this.add_consent(jt[t].features)):!0!==jt[t].optin&&(jt[t].optin=!0,Ut(),setTimeout((function(){t===n.SESSIONS&&St.begin_session?(b.begin_session.apply(b,St.begin_session),St.begin_session=null):t===n.VIEWS&&St.track_pageview&&(ct=null,b.track_pageview.apply(b,St.track_pageview),St.track_pageview=null)}),1)):ce(s.ERROR,"add_consent, No feature available for ["+t+"]")},this.remove_consent=function(t){ce(s.INFO,"remove_consent, Removing consent for ["+t+"]"),this.remove_consent_internal(t,!0)},this.remove_consent_internal=function(t,e){if(e=e||!1,Array.isArray(t))for(var i=0;i<t.length;i++)this.remove_consent_internal(t[i],e);else jt[t]?jt[t].features?this.remove_consent_internal(jt[t].features,e):(jt[t].optin=!1,e&&!1!==jt[t].optin&&Ut()):ce(s.WARNING,"remove_consent, No feature available for ["+t+"]")};var Ut=function(){Nt&&(clearTimeout(Nt),Nt=null),Nt=setTimeout((function(){for(var t={},e=0;e<g.features.length;e++)!0===jt[g.features[e]].optin?t[g.features[e]]=!0:t[g.features[e]]=!1;ee({consent:JSON.stringify(t)}),ce(s.DEBUG,"Consent update request has been sent to the queue.")}),1e3)};function qt(t,e){if(b.ignore_visitor)ce(s.ERROR,"Adding event failed. Possible bot or user opt out");else if(t.key){t.count||(t.count=1),a.includes(t.key)||(t.key=M(t.key,b.maxKeyLength,"add_cly_event",ce)),t.segmentation=P(t.segmentation,b.maxKeyLength,b.maxValueSize,b.maxSegmentationValues,"add_cly_event",ce);var i=T(t,["key","count","sum","dur","segmentation"]);i.timestamp=k();var r=new Date;i.hour=r.getHours(),i.dow=r.getDay(),i.id=e||_(),i.key===o.VIEW?i.pvid=Rt||"":i.cvid=Dt||"",et.push(i),Se("cly_event",et),ce(s.INFO,"With event ID: ["+i.id+"], successfully adding the last event:",i)}else ce(s.ERROR,"Adding event failed. Event must have a key property")}this.enable_offline_mode=function(){ce(s.INFO,"enable_offline_mode, Enabling offline mode"),this.remove_consent_internal(g.features,!1),Et=!0,this.device_id="[CLY]_temp_id",b.device_id=this.device_id,Pt=l.TEMPORARY_ID},this.disable_offline_mode=function(t){if(Et){ce(s.INFO,"disable_offline_mode, Disabling offline mode"),Et=!1,t&&this.device_id!==t?(this.device_id=t,b.device_id=this.device_id,Pt=l.DEVELOPER_SUPPLIED,Se("cly_id",this.device_id),Se("cly_id_type",l.DEVELOPER_SUPPLIED),ce(s.INFO,"disable_offline_mode, Changing id to: "+this.device_id)):(this.device_id=ne(),"[CLY]_temp_id"===this.device_id&&(this.device_id=v()),b.device_id=this.device_id,this.device_id!==Ee("cly_id")&&(Se("cly_id",this.device_id),Se("cly_id_type",l.SDK_GENERATED)));var e=!1;if(tt.length>0)for(var i=0;i<tt.length;i++)"[CLY]_temp_id"===tt[i].device_id&&(tt[i].device_id=this.device_id,e=!0);e&&Se("cly_queue",tt,!0)}else ce(s.WARNING,"disable_offline_mode, Countly was not in offline mode.")},this.begin_session=function(t,e){if(ce(s.INFO,"begin_session, Starting the session. There was an ongoing session: ["+$+"]"),t&&ce(s.INFO,"begin_session, Heartbeats are disabled"),e&&ce(s.INFO,"begin_session, Session starts irrespective of session cookie"),this.check_consent(n.SESSIONS)){if(!$){this.enableOrientationTracking&&(this.report_orientation(),z(window,"resize",(function(){b.report_orientation()}))),u=x(),$=!0,st=!t;var i=Ee("cly_session");if(ce(s.VERBOSE,"begin_session, Session state, forced: ["+e+"], useSessionCookie: ["+vt+"], seconds to expire: ["+(i-u)+"], expired: ["+(parseInt(i)<=x())+"] "),e||!vt||!i||parseInt(i)<=x()){ce(s.INFO,"begin_session, Session started"),null===At&&(At=!0);var r={begin_session:1};r.metrics=JSON.stringify(se()),ee(r)}Se("cly_session",x()+60*bt)}}else St.begin_session=arguments},this.session_duration=function(t){ce(s.INFO,"session_duration, Reporting session duration"),this.check_consent(n.SESSIONS)&&$&&(ce(s.INFO,"session_duration, Session extended: ",t),ee({session_duration:t}),Qt())},this.end_session=function(t,e){ce(s.INFO,"end_session, Ending the current session. There was an on going session:["+$+"]"),this.check_consent(n.SESSIONS)&&$&&(t=t||x()-u,Kt(),!vt||e?(ce(s.INFO,"end_session, Session ended"),ee({end_session:1,session_duration:t})):this.session_duration(t),$=!1)},this.change_id=function(t,e){if(ce(s.INFO,"change_id, Changing the ID"),e&&ce(s.INFO,"change_id, Will merge the IDs"),t&&"string"==typeof t&&0!==t.length){if(Et)return ce(s.WARNING,"change_id, Offline mode was on, initiating disabling sequence instead."),void this.disable_offline_mode(t);if(this.device_id!=t){e||(re(),Wt(),this.end_session(null,!0),nt={},this.remove_consent_internal(g.features,!1));var i=this.device_id;this.device_id=t,b.device_id=this.device_id,Pt=l.DEVELOPER_SUPPLIED,Se("cly_id",this.device_id),Se("cly_id_type",l.DEVELOPER_SUPPLIED),ce(s.INFO,"change_id, Changing ID from:["+i+"] to ["+t+"]"),e?ee({old_device_id:i}):this.begin_session(!st,!0),this.remote_config&&(Se("cly_remote_configs",it={}),this.fetch_remote_config(this.remote_config))}}else ce(s.ERROR,"change_id, The provided ID: ["+t+"] is not a valid ID")},this.add_event=function(t){ce(s.INFO,"add_event, Adding event: ",t);var e=!1;switch(t.key){case o.NPS:case o.SURVEY:e=this.check_consent(n.FEEDBACK);break;case o.STAR_RATING:e=this.check_consent(n.STAR_RATING);break;case o.VIEW:e=this.check_consent(n.VIEWS);break;case o.ORIENTATION:e=this.check_consent(n.USERS);break;case o.ACTION:e=this.check_consent(n.CLICKS)||this.check_consent(n.SCROLLS);break;default:e=this.check_consent(n.EVENTS)}e&&qt(t)},this.start_event=function(t){t&&"string"==typeof t?(ce(s.INFO,"start_event, Starting timed event with key: ["+t+"]"),t=M(t,b.maxKeyLength,"start_event",ce),nt[t]?ce(s.WARNING,"start_event, Timed event with key: ["+t+"] already started"):nt[t]=x()):ce(s.WARNING,"start_event, you have to provide a valid string key instead of: ["+t+"]")},this.cancel_event=function(t){return t&&"string"==typeof t?(ce(s.INFO,"cancel_event, Canceling timed event with key: ["+t+"]"),t=M(t,b.maxKeyLength,"cancel_event",ce),nt[t]?(delete nt[t],ce(s.INFO,"cancel_event, Timed event with key: ["+t+"] is canceled"),!0):(ce(s.WARNING,"cancel_event, Timed event with key: ["+t+"] was not found"),!1)):(ce(s.WARNING,"cancel_event, you have to provide a valid string key instead of: ["+t+"]"),!1)},this.end_event=function(t){t?(ce(s.INFO,"end_event, Ending timed event"),"string"==typeof t&&(t={key:t=M(t,b.maxKeyLength,"end_event",ce)}),t.key?nt[t.key]?(t.dur=x()-nt[t.key],this.add_event(t),delete nt[t.key]):ce(s.ERROR,"end_event, Timed event with key: ["+t.key+"] was not started"):ce(s.ERROR,"end_event, Timed event must have a key property")):ce(s.WARNING,"end_event, you have to provide a valid string key or event object instead of: ["+t+"]")},this.report_orientation=function(t){ce(s.INFO,"report_orientation, Reporting orientation"),this.check_consent(n.USERS)&&qt({key:o.ORIENTATION,segmentation:{mode:t||q()}})},this.report_conversion=function(t,e){ce(s.WARNING,"report_conversion, Deprecated function call! Use 'recordDirectAttribution' in place of this call. Call will be redirected now!"),this.recordDirectAttribution(t,e)},this.recordDirectAttribution=function(t,e){ce(s.INFO,"recordDirectAttribution, Recording the attribution for campaign ID: ["+t+"] and the user ID: ["+e+"]"),this.check_consent(n.ATTRIBUTION)&&(t=t||Ee("cly_cmp_id")||"cly_organic",ee((e=e||Ee("cly_cmp_uid"))?{campaign_id:t,campaign_user:e}:{campaign_id:t}))},this.user_details=function(t){if(ce(s.INFO,"user_details, Trying to add user details: ",t),this.check_consent(n.USERS)){re(),Wt(),ce(s.INFO,"user_details, flushed the event queue"),t.name=M(t.name,b.maxValueSize,"user_details",ce),t.username=M(t.username,b.maxValueSize,"user_details",ce),t.email=M(t.email,b.maxValueSize,"user_details",ce),t.organization=M(t.organization,b.maxValueSize,"user_details",ce),t.phone=M(t.phone,b.maxValueSize,"user_details",ce),t.picture=M(t.picture,4096,"user_details",ce),t.gender=M(t.gender,b.maxValueSize,"user_details",ce),t.byear=M(t.byear,b.maxValueSize,"user_details",ce),t.custom=P(t.custom,b.maxKeyLength,b.maxValueSize,b.maxSegmentationValues,"user_details",ce);var e=["name","username","email","organization","phone","picture","gender","byear","custom"];ee({user_details:JSON.stringify(T(t,e))})}};var $t={},Gt=function(t,e,i){b.check_consent(n.USERS)&&($t[t]||($t[t]={}),"$push"===i||"$pull"===i||"$addToSet"===i?($t[t][i]||($t[t][i]=[]),$t[t][i].push(e)):$t[t][i]=e)};function Ht(t,e,i,r,o){ce(s.INFO,"fetch_remote_config_explicit, Fetching sequence initiated");var a,l={method:"rc",av:b.app_version};t&&(l.keys=JSON.stringify(t)),e&&(l.omit_keys=JSON.stringify(e)),"legacy"===r&&(l.method="fetch_remote_config"),0===i&&(l.oi=0),1===i&&(l.oi=1),"function"==typeof o&&(a=o),b.check_consent(n.SESSIONS)&&(l.metrics=JSON.stringify(se())),b.check_consent(n.REMOTE_CONFIG)?(te(l),ue("fetch_remote_config_explicit",b.url+K,l,(function(t,e,i){if(!t){try{var r=JSON.parse(i);if(l.keys||l.omit_keys)for(var n in r)it[n]=r[n];else it=r;Se("cly_remote_configs",it)}catch(o){ce(s.ERROR,"fetch_remote_config_explicit, Had an issue while parsing the response: "+o)}a&&(ce(s.INFO,"fetch_remote_config_explicit, Callback function is provided"),a(t,it))}}),!0)):(ce(s.ERROR,"fetch_remote_config_explicit, Remote config requires explicit consent"),a&&a(new Error("Remote config requires explicit consent"),it))}function Zt(){ce(s.INFO,"checkIgnore, Checking if user or visit should be ignored"),b.ignore_prefetch&&m&&void 0!==document.visibilityState&&"prerender"===document.visibilityState&&(b.ignore_visitor=!0,ce(s.DEBUG,"checkIgnore, Ignoring visit due to prerendering")),b.ignore_bots&&B()&&(b.ignore_visitor=!0,ce(s.DEBUG,"checkIgnore, Ignoring visit due to bot"))}function Wt(){et.length>0&&(ce(s.DEBUG,"Flushing events"),ee({events:JSON.stringify(et)}),Se("cly_event",et=[]))}function Xt(t,e){if(m)if(document.getElementById("countly-feedback-sticker-"+t._id))ce(s.ERROR,"Widget with same ID exists");else try{var i=document.createElement("div");i.className="countly-iframe-wrapper",i.id="countly-iframe-wrapper-"+t._id;var r=document.createElement("span");r.className="countly-feedback-close-icon",r.id="countly-feedback-close-icon-"+t._id,r.innerText="x";var n=document.createElement("iframe");if(n.name="countly-feedback-iframe",n.id="countly-feedback-iframe",n.src=b.url+"/feedback?widget_id="+t._id+"&app_key="+b.app_key+"&device_id="+b.device_id+"&sdk_version="+Bt,document.body.appendChild(i),i.appendChild(r),i.appendChild(n),z(document.getElementById("countly-feedback-close-icon-"+t._id),"click",(function(){document.getElementById("countly-iframe-wrapper-"+t._id).style.display="none",document.getElementById("cfbg").style.display="none"})),e){var o=document.createElementNS("http://www.w3.org/2000/svg","svg");o.id="feedback-sticker-svg",o.setAttribute("aria-hidden","true"),o.setAttribute("data-prefix","far"),o.setAttribute("data-icon","grin"),o.setAttribute("class","svg-inline--fa fa-grin fa-w-16"),o.setAttribute("role","img"),o.setAttribute("xmlns","http://www.w3.org/2000/svg"),o.setAttribute("viewBox","0 0 496 512");var a=document.createElementNS("http://www.w3.org/2000/svg","path");a.id="smileyPathInStickerSvg",a.setAttribute("fill","white"),a.setAttribute("d","M248 8C111 8 0 119 0 256s111 248 248 248 248-111 248-248S385 8 248 8zm0 448c-110.3 0-200-89.7-200-200S137.7 56 248 56s200 89.7 200 200-89.7 200-200 200zm105.6-151.4c-25.9 8.3-64.4 13.1-105.6 13.1s-79.6-4.8-105.6-13.1c-9.9-3.1-19.4 5.4-17.7 15.3 7.9 47.1 71.3 80 123.3 80s115.3-32.9 123.3-80c1.6-9.8-7.7-18.4-17.7-15.3zM168 240c17.7 0 32-14.3 32-32s-14.3-32-32-32-32 14.3-32 32 14.3 32 32 32zm160 0c17.7 0 32-14.3 32-32s-14.3-32-32-32-32 14.3-32 32 14.3 32 32 32z");var l=document.createElement("span");l.innerText=t.trigger_button_text;var c=document.createElement("div");c.style.color=t.trigger_font_color.length<7?"#"+t.trigger_font_color:t.trigger_font_color,c.style.backgroundColor=t.trigger_bg_color.length<7?"#"+t.trigger_bg_color:t.trigger_bg_color,c.className="countly-feedback-sticker "+t.trigger_position+"-"+t.trigger_size,c.id="countly-feedback-sticker-"+t._id,o.appendChild(a),c.appendChild(o),c.appendChild(l),document.body.appendChild(c);var u=document.getElementById("smileyPathInStickerSvg");u&&(u.style.fill=t.trigger_font_color.length<7?"#"+t.trigger_font_color:t.trigger_font_color),z(document.getElementById("countly-feedback-sticker-"+t._id),"click",(function(){document.getElementById("countly-iframe-wrapper-"+t._id).style.display="block",document.getElementById("cfbg").style.display="block"}))}else document.getElementById("countly-iframe-wrapper-"+t._id).style.display="block",document.getElementById("cfbg").style.display="block"}catch(xt){ce(s.ERROR,"Somethings went wrong while element injecting process: "+xt)}else ce(s.WARNING,"processWidget, window object is not available. Not processing widget.")}function Jt(){var t;if(void 0!==b.onload&&b.onload.length>0){for(t=0;t<b.onload.length;t++)"function"==typeof b.onload[t]&&b.onload[t](b);b.onload=[]}}function Kt(){if(ct){var t={name:ct};b.check_consent(n.VIEWS)&&(qt({key:o.VIEW,dur:It?x()-ut:ht,segmentation:t},Dt),ct=null)}}function Yt(){return ct}function Qt(){if(vt){var t=Ee("cly_session");(!t||parseInt(t)<=x())&&($=!1,b.begin_session(!st)),Se("cly_session",x()+60*bt)}}function te(t){t.app_key=b.app_key,t.device_id=b.device_id,t.sdk_name=Ft,t.sdk_version=Bt,t.t=Pt,t.av=b.app_version;var e=ae();if(t.metrics){var i=JSON.parse(t.metrics);i._ua||(i._ua=e,t.metrics=JSON.stringify(i))}else t.metrics=JSON.stringify({_ua:e});b.check_consent(n.LOCATION)?(b.country_code&&(t.country_code=b.country_code),b.city&&(t.city=b.city),null!==b.ip_address&&(t.ip_address=b.ip_address)):t.location="",t.timestamp=k();var r=new Date;t.hour=r.getHours(),t.dow=r.getDay()}function ee(t){b.ignore_visitor?ce(s.WARNING,"User is opt_out will ignore the request: "+t):b.app_key&&b.device_id?(te(t),tt.length>Q&&tt.shift(),tt.push(t),Se("cly_queue",tt,!0)):ce(s.ERROR,"app_key or device_id is missing ",b.app_key,b.device_id)}function ie(){if(Jt(),b.ignore_visitor)return kt=!1,void ce(s.WARNING,"User opt_out, no heartbeat");if(kt=!0,w&&void 0!==g.q&&g.q.length>0&&re(),$&&st&&It){var t=x();t-u>gt&&(b.session_duration(t-u),u=t,b.hcErrorCount>0&&Se(h.errorCount,b.hcErrorCount),b.hcWarningCount>0&&Se(h.warningCount,b.hcWarningCount))}if(et.length>0&&!b.test_mode_eq){if(et.length<=yt)ee({events:JSON.stringify(et)}),et=[];else{var e=et.splice(0,yt);ee({events:JSON.stringify(e)})}Se("cly_event",et)}if(!Et&&tt.length>0&&wt&&x()>dt){wt=!1;var i=tt[0];i.rr=tt.length,ce(s.DEBUG,"Processing request",i),Se("cly_queue",tt,!0),b.test_mode||ue("send_request_queue",b.url+J,i,(function(t,e){t?dt=x()+pt:tt.shift(),Se("cly_queue",tt,!0),wt=!0}),!1)}setTimeout(ie,Y)}function re(){if(void 0!==g&&void 0!==g.i){var t=g.q;g.q=[];for(var e=0;e<t.length;e++){var i=t[e];if(ce(s.DEBUG,"Processing queued calls:"+i),"function"==typeof i)i();else if(Array.isArray(i)&&i.length>0){var r=b,n=0;try{g.i[i[n]]&&(r=g.i[i[n]],n++)}catch(a){ce(s.DEBUG,"No instance found for the provided key while processing async queue"),g.q.push(i);continue}if("function"==typeof r[i[n]])r[i[n]].apply(r,i.slice(n+1));else if(0===i[n].indexOf("userData.")){var o=i[n].replace("userData.","");"function"==typeof r.userData[o]&&r.userData[o].apply(r,i.slice(n+1))}else"function"==typeof g[i[n]]&&g[i[n]].apply(g,i.slice(n+1))}}}else ce(s.DEBUG,"Countly is not finished initialization yet, will process the queue after initialization is done")}function ne(){var t=Ee("cly_id");return t?(Pt=Ee("cly_id_type"),t):v()}function oe(t){return/[0-9a-fA-F]{8}\-[0-9a-fA-F]{4}\-4[0-9a-fA-F]{3}\-[0-9a-fA-F]{4}\-[0-9a-fA-F]{12}/.test(t)}function ae(){return b.metrics._ua||R()}function se(){var t=JSON.parse(JSON.stringify(b.metrics||{}));if(t._app_version=t._app_version||b.app_version,t._ua=t._ua||R(),m&&screen.width){var e=screen.width?parseInt(screen.width):0,i=screen.height?parseInt(screen.height):0;if(0!==e&&0!==i){if(navigator.platform&&/iPad|iPhone|iPod/.test(navigator.platform)&&window.devicePixelRatio)e=Math.round(e*window.devicePixelRatio),i=Math.round(i*window.devicePixelRatio);else if(90===Math.abs(window.orientation)){var r=e;e=i,i=r}t._resolution=t._resolution||e+"x"+i}}m&&window.devicePixelRatio&&(t._density=t._density||window.devicePixelRatio);var n=navigator.language||navigator.browserLanguage||navigator.systemLanguage||navigator.userLanguage;return void 0!==n&&(t._locale=t._locale||n),le()&&(t._store=t._store||document.referrer),ce(s.DEBUG,"Got metrics",t),t}function le(t){if(!m)return!1;var e=t||document.referrer,i=!1;if(void 0===e||0===e.length)ce(s.DEBUG,"Invalid referrer:["+e+"], ignoring.");else{var r=f.exec(e);if(r)if(r[11])if(r[11]===window.location.hostname)ce(s.DEBUG,"Referrer is current host:["+e+"], ignoring.");else if(ot&&ot.length){i=!0;for(var n=0;n<ot.length;n++)if(e.indexOf(ot[n])>=0){ce(s.DEBUG,"Referrer in ignore list:["+e+"], ignoring."),i=!1;break}}else ce(s.DEBUG,"Valid referrer:["+e+"]"),i=!0;else ce(s.DEBUG,"No path found in referrer:["+e+"], ignoring.");else ce(s.DEBUG,"Referrer is corrupt:["+e+"], ignoring.")}return i}function ce(t,i){if(b.debug&&"undefined"!=typeof console){arguments[2]&&"object"===e(arguments[2])&&(arguments[2]=JSON.stringify(arguments[2])),w||(i="["+b.app_key+"] "+i),t||(t=s.DEBUG);for(var r="",n=2;n<arguments.length;n++)r+=arguments[n];var o=t+"[Countly] "+i+r;t===s.ERROR?(console.error(o),Te.incrementErrorCount()):t===s.WARNING?(console.warn(o),Te.incrementWarningCount()):t===s.INFO?console.info(o):t===s.VERBOSE?console.log(o):console.debug(o)}}function ue(t,e,i,r,n){m?he(t,e,i,r,n):de(t,e,i,r,n)}function he(t,e,i,r,n){n=n||!1;try{ce(s.DEBUG,"Sending XML HTTP request");var o=new XMLHttpRequest,a=I(i=i||{}),l="GET";for(var c in(b.force_post||a.length>=2e3)&&(l="POST"),"GET"===l?o.open("GET",e+"?"+a,!0):(o.open("POST",e,!0),o.setRequestHeader("Content-type","application/x-www-form-urlencoded")),b.headers)o.setRequestHeader(c,b.headers[c]);o.onreadystatechange=function(){4===this.readyState&&(ce(s.DEBUG,t+" HTTP request completed with status code: ["+this.status+"] and response: ["+this.responseText+"]"),(n?fe(this.status,this.responseText):pe(this.status,this.responseText))?"function"==typeof r&&r(!1,i,this.responseText):(ce(s.ERROR,t+" Invalid response from server"),"send_request_queue"===t&&Te.saveRequestCounters(this.status,this.responseText),"function"==typeof r&&r(!0,i,this.status,this.responseText)))},"GET"===l?o.send():o.send(a)}catch(xt){ce(s.ERROR,t+" Something went wrong while making an XML HTTP request: "+xt),"function"==typeof r&&r(!0,i)}}function de(t,e,i,r,n){var o;n=n||!1;try{ce(s.DEBUG,"Sending Fetch request");var a="GET",l={"Content-type":"application/x-www-form-urlencoded"},c=null;for(var u in i=i||{},b.force_post||I(i).length>=2e3?(a="POST",c=I(i)):e+="?"+I(i),b.headers)l[u]=b.headers[u];fetch(e,{method:a,headers:l,body:c}).then((function(t){return(o=t).text()})).then((function(e){ce(s.DEBUG,t+" Fetch request completed wit status code: ["+o.status+"] and response: ["+e+"]"),(n?fe(o.status,e):pe(o.status,e))?"function"==typeof r&&r(!1,i,e):(ce(s.ERROR,t+" Invalid response from server"),"send_request_queue"===t&&Te.saveRequestCounters(o.status,e),"function"==typeof r&&r(!0,i,o.status,e))})).catch((function(e){ce(s.ERROR,t+" Failed Fetch request: "+e),"function"==typeof r&&r(!0,i)}))}catch(xt){ce(s.ERROR,t+" Something went wrong with the Fetch request attempt: "+xt),"function"==typeof r&&r(!0,i)}}function pe(t,e){if(!(t>=200&&t<300))return ce(s.ERROR,"Http response status code:["+t+"] is not within the expected range"),!1;try{var i=JSON.parse(e);return"[object Object]"!==Object.prototype.toString.call(i)?(ce(s.ERROR,"Http response is not JSON Object"),!1):!!i.result}catch(xt){return ce(s.ERROR,"Http response is not JSON: "+xt),!1}}function fe(t,e){if(!(t>=200&&t<300))return ce(s.ERROR,"Http response status code:["+t+"] is not within the expected range"),!1;try{var i=JSON.parse(e);return!("[object Object]"!==Object.prototype.toString.call(i)&&!Array.isArray(i)&&(ce(s.ERROR,"Http response is not JSON Object nor JSON Array"),1))}catch(xt){return ce(s.ERROR,"Http response is not JSON: "+xt),!1}}function me(){m?Lt=Math.max(Lt,window.scrollY,document.body.scrollTop,document.documentElement.scrollTop):ce(s.WARNING,"processScroll, window object is not available. Not processing scroll.")}function ge(){if(m){if(Mt){Mt=!1;var t=j(),e=V(),i=U();if(b.check_consent(n.SCROLLS)){var r={type:"scroll",y:Lt+i,width:e,height:t,view:b.getViewUrl()};r=P(r,b.maxKeyLength,b.maxValueSize,b.maxSegmentationValues,"processScrollView",ce),b.track_domains&&(r.domain=window.location.hostname),qt({key:o.ACTION,segmentation:r})}}}else ce(s.WARNING,"processScrollView, window object is not available. Not processing scroll view.")}function ye(){return Pt}function _e(t){Se("cly_token",t)}function ve(){var t=Ee("cly_token");return Ie("cly_token"),t}function be(){return et}function xe(){return tt}function we(t){for(var e=t+"=",i=document.cookie.split(";"),r=0,n=i.length;r<n;r++){for(var o=i[r];" "===o.charAt(0);)o=o.substring(1,o.length);if(0===o.indexOf(e))return o.substring(e.length,o.length)}return null}function ke(t,e,i){var r=new Date;r.setTime(r.getTime()+24*i*60*60*1e3);var n="; expires="+r.toGMTString();document.cookie=t+"="+e+n+"; path=/"}function Ee(t,i,r){var n;if("none"!==b.storage&&("object"===e(b.storage)||m))return r||(t=b.app_key+"/"+t,b.namespace&&(t=C(b.namespace)+"/"+t)),"object"===e(b.storage)&&"function"==typeof b.storage.getItem?(n=b.storage.getItem(t),t.endsWith("cly_id")?n:b.deserialize(n)):(void 0===i&&(i=Tt),i?n=localStorage.getItem(t):"localstorage"!==b.storage&&(n=we(t)),t.endsWith("cly_id")?n:b.deserialize(n));ce(s.DEBUG,"Storage is disabled. Value with key: ["+t+"] won't be retrieved")}function Se(t,i,r,n){if("none"===b.storage||"object"!==e(b.storage)&&!m)ce(s.DEBUG,"Storage is disabled. Value with key: "+t+" won't be stored");else if(n||(t=b.app_key+"/"+t,b.namespace&&(t=C(b.namespace)+"/"+t)),null!=i){if("object"===e(b.storage)&&"function"==typeof b.storage.setItem)return void b.storage.setItem(t,i);void 0===r&&(r=Tt),i=b.serialize(i),r?localStorage.setItem(t,i):"localstorage"!==b.storage&&ke(t,i,30)}}function Ie(t,i,r){"none"===b.storage||"object"!==e(b.storage)&&!m?ce(s.DEBUG,"Storage is disabled. Value with key: "+t+" won't be removed"):(r||(t=b.app_key+"/"+t,b.namespace&&(t=C(b.namespace)+"/"+t)),"object"!==e(b.storage)||"function"!=typeof b.storage.removeItem?(void 0===i&&(i=Tt),i?localStorage.removeItem(t):"localstorage"!==b.storage&&ke(t,"",-1)):b.storage.removeItem(t))}function Ce(){if(Ee(b.namespace+"cly_id",!1,!0)){Se("cly_id",Ee(b.namespace+"cly_id",!1,!0)),Se("cly_id_type",Ee(b.namespace+"cly_id_type",!1,!0)),Se("cly_event",Ee(b.namespace+"cly_event",!1,!0)),Se("cly_session",Ee(b.namespace+"cly_session",!1,!0));var t=Ee(b.namespace+"cly_queue",!1,!0);Array.isArray(t)&&Se("cly_queue",t=t.filter((function(t){return t.app_key===b.app_key}))),Ee(b.namespace+"cly_cmp_id",!1,!0)&&(Se("cly_cmp_id",Ee(b.namespace+"cly_cmp_id",!1,!0)),Se("cly_cmp_uid",Ee(b.namespace+"cly_cmp_uid",!1,!0))),Ee(b.namespace+"cly_ignore",!1,!0)&&Se("cly_ignore",Ee(b.namespace+"cly_ignore",!1,!0)),Ie("cly_id",!1,!0),Ie("cly_id_type",!1,!0),Ie("cly_event",!1,!0),Ie("cly_session",!1,!0),Ie("cly_queue",!1,!0),Ie("cly_cmp_id",!1,!0),Ie("cly_cmp_uid",!1,!0),Ie("cly_ignore",!1,!0)}}this.userData={set:function(t,e){ce(s.INFO,"[userData] set, Setting user's custom property value: ["+e+"] under the key: ["+t+"]"),t=M(t,b.maxKeyLength,"userData set",ce),e=M(e,b.maxValueSize,"userData set",ce),$t[t]=e},unset:function(t){ce(s.INFO,"[userData] unset, Resetting user's custom property with key: ["+t+"] "),$t[t]=""},set_once:function(t,e){ce(s.INFO,"[userData] set_once, Setting user's unique custom property value: ["+e+"] under the key: ["+t+"] "),t=M(t,b.maxKeyLength,"userData set_once",ce),e=M(e,b.maxValueSize,"userData set_once",ce),Gt(t,e,"$setOnce")},increment:function(t){ce(s.INFO,"[userData] increment, Increasing user's custom property value under the key: ["+t+"] by one"),t=M(t,b.maxKeyLength,"userData increment",ce),Gt(t,1,"$inc")},increment_by:function(t,e){ce(s.INFO,"[userData] increment_by, Increasing user's custom property value under the key: ["+t+"] by: ["+e+"]"),t=M(t,b.maxKeyLength,"userData increment_by",ce),e=M(e,b.maxValueSize,"userData increment_by",ce),Gt(t,e,"$inc")},multiply:function(t,e){ce(s.INFO,"[userData] multiply, Multiplying user's custom property value under the key: ["+t+"] by: ["+e+"]"),t=M(t,b.maxKeyLength,"userData multiply",ce),e=M(e,b.maxValueSize,"userData multiply",ce),Gt(t,e,"$mul")},max:function(t,e){ce(s.INFO,"[userData] max, Saving user's maximum custom property value compared to the value: ["+e+"] under the key: ["+t+"]"),t=M(t,b.maxKeyLength,"userData max",ce),e=M(e,b.maxValueSize,"userData max",ce),Gt(t,e,"$max")},min:function(t,e){ce(s.INFO,"[userData] min, Saving user's minimum custom property value compared to the value: ["+e+"] under the key: ["+t+"]"),t=M(t,b.maxKeyLength,"userData min",ce),e=M(e,b.maxValueSize,"userData min",ce),Gt(t,e,"$min")},push:function(t,e){ce(s.INFO,"[userData] push, Pushing a value: ["+e+"] under the key: ["+t+"] to user's custom property array"),t=M(t,b.maxKeyLength,"userData push",ce),e=M(e,b.maxValueSize,"userData push",ce),Gt(t,e,"$push")},push_unique:function(t,e){ce(s.INFO,"[userData] push_unique, Pushing a unique value: ["+e+"] under the key: ["+t+"] to user's custom property array"),t=M(t,b.maxKeyLength,"userData push_unique",ce),e=M(e,b.maxValueSize,"userData push_unique",ce),Gt(t,e,"$addToSet")},pull:function(t,e){ce(s.INFO,"[userData] pull, Removing the value: ["+e+"] under the key: ["+t+"] from user's custom property array"),Gt(t,e,"$pull")},save:function(){ce(s.INFO,"[userData] save, Saving changes to user's custom property"),b.check_consent(n.USERS)&&(re(),Wt(),ce(s.INFO,"user_details, flushed the event queue"),ee({user_details:JSON.stringify({custom:$t})})),$t={}}},this.report_trace=function(t){if(ce(s.INFO,"report_trace, Reporting performance trace"),this.check_consent(n.APM)){for(var e=["type","name","stz","etz","apm_metrics","apm_attr"],i=0;i<e.length;i++)if("apm_attr"!==e[i]&&void 0===t[e[i]])return void ce(s.WARNING,"report_trace, APM trace don't have the property: "+e[i]);t.name=M(t.name,b.maxKeyLength,"report_trace",ce),t.app_metrics=P(t.app_metrics,b.maxKeyLength,b.maxValueSize,b.maxSegmentationValues,"report_trace",ce);var r=T(t,e);r.timestamp=t.stz;var o=new Date;r.hour=o.getHours(),r.dow=o.getDay(),ee({apm:JSON.stringify(r)}),ce(s.INFO,"report_trace, Successfully adding APM trace: ",r)}},this.track_errors=function(t){m?(ce(s.INFO,"track_errors, Started tracking errors"),g.i[this.app_key].tracking_crashes=!0,window.cly_crashes||(window.cly_crashes=!0,at=t,window.onerror=function t(e,i,r,n,o){if(null!=o)S(o,!1);else{var a="";void 0!==e&&(a+=e+"\n"),void 0!==i&&(a+="at "+i),void 0!==r&&(a+=":"+r),void 0!==(n=n||window.event&&window.event.errorCharacter)&&(a+=":"+n),a+="\n";try{for(var l=[],c=t.caller;c;)l.push(c.name),c=c.caller;a+=l.join("\n")}catch(u){ce(s.ERROR,"track_errors, Call stack generation experienced a problem: "+u)}S(a,!1)}},window.addEventListener("unhandledrejection",(function(t){S(new Error("Unhandled rejection (reason: "+(t.reason&&t.reason.stack?t.reason.stack:t.reason)+")."),!0)})))):ce(s.WARNING,"track_errors, window object is not available. Not tracking errors.")},this.log_error=function(t,e){ce(s.INFO,"log_error, Logging errors"),this.recordError(t,!0,e)},this.add_log=function(t){if(ce(s.INFO,"add_log, Adding a new log of breadcrumbs: [ "+t+" ]"),this.check_consent(n.CRASHES)){for(t=M(t,b.maxValueSize,"add_log",ce);rt.length>=b.maxBreadcrumbCount;)rt.shift(),ce(s.WARNING,"add_log, Reached maximum crashLogs size. Will erase the oldest one.");rt.push(t)}},this.fetch_remote_config=function(t,e,i){var r=null,n=null,o=null;if(t&&(i||"function"!=typeof t?Array.isArray(t)&&(r=t):o=t),e&&(i||"function"!=typeof e?Array.isArray(e)&&(n=e):o=e),o||"function"!=typeof i||(o=i),this.useExplicitRcApi)return ce(s.INFO,"fetch_remote_config, Fetching remote config"),void Ht(r,n,this.rcAutoOptinAb?1:0,null,o);ce(s.WARNING,"fetch_remote_config, Fetching remote config, with legacy API"),Ht(r,n,null,"legacy",o)},this.enrollUserToAb=function(t){if(ce(s.INFO,"enrollUserToAb, Providing AB test keys to opt in for"),t&&Array.isArray(t)&&0!==t.length){var e={method:"ab",keys:JSON.stringify(t),av:b.app_version};te(e),ue("enrollUserToAb",this.url+K,e,(function(t,e,i){if(!t)try{var r=JSON.parse(i);ce(s.DEBUG,"enrollUserToAb, Parsed the response's result: ["+r.result+"]")}catch(n){ce(s.ERROR,"enrollUserToAb, Had an issue while parsing the response: "+n)}}),!0)}else ce(s.ERROR,"enrollUserToAb, No keys provided")},this.get_remote_config=function(t){return ce(s.INFO,"get_remote_config, Getting remote config from storage"),void 0!==t?it[t]:it},this.stop_time=function(){ce(s.INFO,"stop_time, Stopping tracking duration"),It&&(It=!1,lt=x()-u,ht=x()-ut)},this.start_time=function(){ce(s.INFO,"start_time, Starting tracking duration"),It||(It=!0,u=x()-lt,ut=x()-ht,ht=0,Qt())},this.track_sessions=function(){if(m){ce(s.INFO,"track_session, Starting tracking user session"),this.begin_session(),this.start_time(),z(window,"beforeunload",(function(){re(),Wt(),b.end_session()}));var t="hidden";z(window,"focus",e),z(window,"blur",e),z(window,"pageshow",e),z(window,"pagehide",e),"onfocusin"in document&&(z(window,"focusin",e),z(window,"focusout",e)),t in document?document.addEventListener("visibilitychange",e):"mozHidden"in document?(t="mozHidden",document.addEventListener("mozvisibilitychange",e)):"webkitHidden"in document?(t="webkitHidden",document.addEventListener("webkitvisibilitychange",e)):"msHidden"in document&&(t="msHidden",document.addEventListener("msvisibilitychange",e)),z(window,"mousemove",i),z(window,"click",i),z(window,"keydown",i),z(window,"scroll",i),setInterval((function(){++mt>=ft&&b.stop_time()}),6e4)}else ce(s.WARNING,"track_sessions, window object is not available. Not tracking sessions.");function e(){document[t]||!document.hasFocus()?b.stop_time():b.start_time()}function i(){mt>=ft&&b.start_time(),mt=0}},this.track_pageview=function(t,e,i){if(m||t)if(ce(s.INFO,"track_pageview, Tracking page views"),ce(s.VERBOSE,"track_pageview, last view is:["+ct+"], current view ID is:["+Dt+"], previous view ID is:["+Rt+"]"),ct&&zt&&(ce(s.DEBUG,"track_pageview, Scroll registry triggered"),ge(),Mt=!0,Lt=0),Kt(),Rt=Dt,Dt=_(),(t=M(t,b.maxKeyLength,"track_pageview",ce))&&Array.isArray(t)&&(e=t,t=null),t||(t=this.getViewName()),void 0!==t&&""!==t)if(null!==t){if(e&&e.length)for(var r=0;r<e.length;r++)try{if(new RegExp(e[r]).test(t))return void ce(s.INFO,"track_pageview, Ignoring the page: "+t)}catch(d){ce(s.ERROR,"track_pageview, Problem with finding ignore list item: "+e[r]+", error: "+d)}ct=t,ut=x(),ce(s.VERBOSE,"track_pageview, last view is assigned:["+ct+"], current view ID is:["+Dt+"], previous view ID is:["+Rt+"]");var a={name:t,visit:1,view:b.getViewUrl()};if(a=P(a,b.maxKeyLength,b.maxValueSize,b.maxSegmentationValues,"track_pageview",ce),this.track_domains&&(a.domain=window.location.hostname),vt)if($)At&&(At=!1,a.start=1);else{var l=Ee("cly_session");(!l||parseInt(l)<=x())&&(At=!1,a.start=1)}else if(m&&void 0!==document.referrer&&document.referrer.length){var c=f.exec(document.referrer);c&&c[11]&&c[11]!==window.location.hostname&&(a.start=1)}if(Ot&&Object.keys(Ot).length)for(var u in ce(s.INFO,"track_pageview, Adding fresh utm tags to segmentation:["+JSON.stringify(Ot)+"]"),Ot)void 0===a["utm_"+u]&&(a["utm_"+u]=Ot[u]);if(m&&le()&&(ce(s.INFO,"track_pageview, Adding referrer to segmentation:["+document.referrer+"]"),a.referrer=document.referrer),i)for(var h in i=P(i,b.maxKeyLength,b.maxValueSize,b.maxSegmentationValues,"track_pageview",ce))void 0===a[h]&&(a[h]=i[h]);this.check_consent(n.VIEWS)?qt({key:o.VIEW,segmentation:a},Dt):St.track_pageview=arguments}else ce(s.ERROR,"track_pageview, View name returned as null. Page view will be ignored.");else ce(s.ERROR,"track_pageview, No page name to track (it is either undefined or empty string). No page view can be tracked.");else ce(s.WARNING,"track_pageview, window object is not available. Not tracking page views is page is not provided.")},this.track_view=function(t,e,i){ce(s.INFO,"track_view, Initiating tracking page views"),this.track_pageview(t,e,i)},this.track_clicks=function(t){if(m){ce(s.INFO,"track_clicks, Starting to track clicks"),t&&ce(s.INFO,"track_clicks, Tracking the specified children:["+t+"]"),t=t||document;var e=!0;z(t,"click",i)}else ce(s.WARNING,"track_clicks, window object is not available. Not tracking clicks.");function i(t){if(e){if(e=!1,N(t),void 0!==t.pageX&&void 0!==t.pageY){var i=j(),r=V();if(b.check_consent(n.CLICKS)){var a={type:"click",x:t.pageX,y:t.pageY,width:r,height:i,view:b.getViewUrl()};a=P(a,b.maxKeyLength,b.maxValueSize,b.maxSegmentationValues,"processClick",ce),b.track_domains&&(a.domain=window.location.hostname),qt({key:o.ACTION,segmentation:a})}}setTimeout((function(){e=!0}),1e3)}}},this.track_scrolls=function(t){m?(ce(s.INFO,"track_scrolls, Starting to track scrolls"),t&&ce(s.INFO,"track_scrolls, Tracking the specified children"),t=t||window,Mt=!0,zt=!0,z(t,"scroll",me),z(t,"beforeunload",ge)):ce(s.WARNING,"track_scrolls, window object is not available. Not tracking scrolls.")},this.track_links=function(t){function e(t){var e=L(D(t),"a");e&&(N(t),b.check_consent(n.CLICKS)&&qt({key:"linkClick",segmentation:{href:e.href,text:e.innerText,id:e.id,view:b.getViewUrl()}}))}m?(ce(s.INFO,"track_links, Starting to track clicks to links"),t&&ce(s.INFO,"track_links, Tracking the specified children"),z(t=t||document,"click",e)):ce(s.WARNING,"track_links, window object is not available. Not tracking links.")},this.track_forms=function(t,e){function i(t){return t.name||t.id||t.type||t.nodeName}function r(t){var r,o=D(t),a={id:o.attributes.id&&o.attributes.id.nodeValue,name:o.attributes.name&&o.attributes.name.nodeValue,action:o.attributes.action&&o.attributes.action.nodeValue,method:o.attributes.method&&o.attributes.method.nodeValue,view:b.getViewUrl()};if(void 0!==o.elements){for(var s=0;s<o.elements.length;s++)(r=o.elements[s])&&"password"!==r.type&&-1===r.className.indexOf("cly_user_ignore")&&(void 0===a["input:"+i(r)]&&(a["input:"+i(r)]=[]),"select"===r.nodeName.toLowerCase()?void 0!==r.multiple?a["input:"+i(r)].push(y(r)):a["input:"+i(r)].push(r.options[r.selectedIndex].value):"input"===r.nodeName.toLowerCase()?void 0!==r.type?"checkbox"===r.type.toLowerCase()||"radio"===r.type.toLowerCase()?r.checked&&a["input:"+i(r)].push(r.value):("hidden"!==r.type.toLowerCase()||e)&&a["input:"+i(r)].push(r.value):a["input:"+i(r)].push(r.value):("textarea"===r.nodeName.toLowerCase()||void 0!==r.value)&&a["input:"+i(r)].push(r.value));for(var l in a)a[l]&&"function"==typeof a[l].join&&(a[l]=a[l].join(", "))}b.check_consent(n.FORMS)&&qt({key:"formSubmit",segmentation:a})}m?(ce(s.INFO,"track_forms, Starting to track form submissions. DOM object provided:["+!!t+"] Tracking hidden inputs :["+!!e+"]"),z(t=t||document,"submit",r)):ce(s.WARNING,"track_forms, window object is not available. Not tracking forms.")},this.collect_from_forms=function(t,e){function i(i){var r,n=D(i),o={},a=!1;if(void 0!==n.elements){var l,c,u={},h=t.getElementsByTagName("LABEL");for(l=0;l<h.length;l++)h[l].htmlFor&&""!==h[l].htmlFor&&(u[h[l].htmlFor]=h[l].innerText||h[l].textContent||h[l].innerHTML);for(l=0;l<n.elements.length;l++)if((r=n.elements[l])&&"password"!==r.type&&-1===r.className.indexOf("cly_user_ignore")){var d="";if("select"===r.nodeName.toLowerCase()?d=void 0!==r.multiple?y(r):r.options[r.selectedIndex].value:"input"===r.nodeName.toLowerCase()?(void 0===r.type||"checkbox"!==r.type.toLowerCase()&&"radio"!==r.type.toLowerCase()||r.checked)&&(d=r.value):("textarea"===r.nodeName.toLowerCase()||void 0!==r.value)&&(d=r.value),r.className&&-1!==r.className.indexOf("cly_user_")){var p=r.className.split(" ");for(c=0;c<p.length;c++)if(0===p[c].indexOf("cly_user_")){o[p[c].replace("cly_user_","")]=d,a=!0;break}}else r.type&&"email"===r.type.toLowerCase()||r.name&&-1!==r.name.toLowerCase().indexOf("email")||r.id&&-1!==r.id.toLowerCase().indexOf("email")||r.id&&u[r.id]&&-1!==u[r.id].toLowerCase().indexOf("email")||/[^@\s]+@[^@\s]+\.[^@\s]+/.test(d)?(o.email||(o.email=d),a=!0):r.name&&-1!==r.name.toLowerCase().indexOf("username")||r.id&&-1!==r.id.toLowerCase().indexOf("username")||r.id&&u[r.id]&&-1!==u[r.id].toLowerCase().indexOf("username")?(o.username||(o.username=d),a=!0):r.name&&(-1!==r.name.toLowerCase().indexOf("tel")||-1!==r.name.toLowerCase().indexOf("phone")||-1!==r.name.toLowerCase().indexOf("number"))||r.id&&(-1!==r.id.toLowerCase().indexOf("tel")||-1!==r.id.toLowerCase().indexOf("phone")||-1!==r.id.toLowerCase().indexOf("number"))||r.id&&u[r.id]&&(-1!==u[r.id].toLowerCase().indexOf("tel")||-1!==u[r.id].toLowerCase().indexOf("phone")||-1!==u[r.id].toLowerCase().indexOf("number"))?(o.phone||(o.phone=d),a=!0):r.name&&(-1!==r.name.toLowerCase().indexOf("org")||-1!==r.name.toLowerCase().indexOf("company"))||r.id&&(-1!==r.id.toLowerCase().indexOf("org")||-1!==r.id.toLowerCase().indexOf("company"))||r.id&&u[r.id]&&(-1!==u[r.id].toLowerCase().indexOf("org")||-1!==u[r.id].toLowerCase().indexOf("company"))?(o.organization||(o.organization=d),a=!0):(r.name&&-1!==r.name.toLowerCase().indexOf("name")||r.id&&-1!==r.id.toLowerCase().indexOf("name")||r.id&&u[r.id]&&-1!==u[r.id].toLowerCase().indexOf("name"))&&(o.name||(o.name=""),o.name+=d+" ",a=!0)}}a&&(ce(s.INFO,"collect_from_forms, Gathered user data",o),e?b.user_details({custom:o}):b.user_details(o))}m?(ce(s.INFO,"collect_from_forms, Starting to collect possible user data. DOM object provided:["+!!t+"] Submitting custom user property:["+!!e+"]"),z(t=t||document,"submit",i)):ce(s.WARNING,"collect_from_forms, window object is not available. Not collecting from forms.")},this.collect_from_facebook=function(t){m?"undefined"!=typeof FB&&FB&&FB.api?(ce(s.INFO,"collect_from_facebook, Starting to collect possible user data"),FB.api("/me",(function(e){var i={};if(e.name&&(i.name=e.name),e.email&&(i.email=e.email),"male"===e.gender?i.gender="M":"female"===e.gender&&(i.gender="F"),e.birthday){var r=e.birthday.split("/").pop();r&&4===r.length&&(i.byear=r)}if(e.work&&e.work[0]&&e.work[0].employer&&e.work[0].employer.name&&(i.organization=e.work[0].employer.name),t)for(var n in i.custom={},t){for(var o=t[n].split("."),a=e,s=0;s<o.length&&void 0!==(a=a[o[s]]);s++);void 0!==a&&(i.custom[n]=a)}b.user_details(i)}))):ce(s.ERROR,"collect_from_facebook, Facebook SDK is not available"):ce(s.WARNING,"collect_from_facebook, window object is not available. Not collecting from Facebook.")},this.opt_out=function(){ce(s.INFO,"opt_out, Opting out the user"),this.ignore_visitor=!0,Se("cly_ignore",!0)},this.opt_in=function(){ce(s.INFO,"opt_in, Opting in the user"),Se("cly_ignore",!1),this.ignore_visitor=!1,Zt(),this.ignore_visitor||kt||ie()},this.report_feedback=function(t){ce(s.WARNING,"report_feedback, Deprecated function call! Use 'recordRatingWidgetWithID' or 'reportFeedbackWidgetManually' in place of this call. Call will be redirected to 'recordRatingWidgetWithID' now!"),this.recordRatingWidgetWithID(t)},this.recordRatingWidgetWithID=function(t){if(ce(s.INFO,"recordRatingWidgetWithID, Providing information about user with ID: [ "+t.widget_id+" ]"),this.check_consent(n.STAR_RATING))if(t.widget_id)if(t.rating){var e=["widget_id","contactMe","platform","app_version","rating","email","comment"],i={key:o.STAR_RATING,count:1,segmentation:{}};i.segmentation=T(t,e),i.segmentation.app_version||(i.segmentation.app_version=this.metrics._app_version||this.app_version),i.segmentation.rating>5?(ce(s.WARNING,"recordRatingWidgetWithID, You have entered a rating higher than 5. Changing it back to 5 now."),i.segmentation.rating=5):i.segmentation.rating<1&&(ce(s.WARNING,"recordRatingWidgetWithID, You have entered a rating lower than 1. Changing it back to 1 now."),i.segmentation.rating=1),ce(s.INFO,"recordRatingWidgetWithID, Reporting Rating Widget: ",i),qt(i)}else ce(s.ERROR,"recordRatingWidgetWithID, Rating Widget must contain rating property");else ce(s.ERROR,"recordRatingWidgetWithID, Rating Widget must contain widget_id property")},this.reportFeedbackWidgetManually=function(t,e,i){if(this.check_consent(n.FEEDBACK))if(t&&e)if(t._id)if(Et)ce(s.ERROR,"reportFeedbackWidgetManually, Feedback Widgets can not be reported in offline mode");else{ce(s.INFO,"reportFeedbackWidgetManually, Providing information about user with, provided result of the widget with ID: [ "+t._id+" ] and type: ["+t.type+"]");var r,a=[],l=t.type;if("nps"===l){if(i){if(!i.rating)return void ce(s.ERROR,"reportFeedbackWidgetManually, Widget must contain rating property");i.rating=Math.round(i.rating),i.rating>10?(ce(s.WARNING,"reportFeedbackWidgetManually, You have entered a rating higher than 10. Changing it back to 10 now."),i.rating=10):i.rating<0&&(ce(s.WARNING,"reportFeedbackWidgetManually, You have entered a rating lower than 0. Changing it back to 0 now."),i.rating=0),a=["rating","comment"]}r=o.NPS}else if("survey"===l){if(i){if(Object.keys(i).length<1)return void ce(s.ERROR,"reportFeedbackWidgetManually, Widget should have answers to be reported");a=Object.keys(i)}r=o.SURVEY}else{if("rating"!==l)return void ce(s.ERROR,"reportFeedbackWidgetManually, Widget has an unacceptable type");if(i){if(!i.rating)return void ce(s.ERROR,"reportFeedbackWidgetManually, Widget must contain rating property");i.rating=Math.round(i.rating),i.rating>5?(ce(s.WARNING,"reportFeedbackWidgetManually, You have entered a rating higher than 5. Changing it back to 5 now."),i.rating=5):i.rating<1&&(ce(s.WARNING,"reportFeedbackWidgetManually, You have entered a rating lower than 1. Changing it back to 1 now."),i.rating=1),a=["rating","comment","email","contactMe"]}r=o.STAR_RATING}var c={key:r,count:1,segmentation:{widget_id:t._id,platform:this.platform,app_version:this.metrics._app_version||this.app_version}};null===i?c.segmentation.closed=1:c.segmentation=A(c.segmentation,i,a),ce(s.INFO,"reportFeedbackWidgetManually, Reporting "+l+": ",c),qt(c)}else ce(s.ERROR,"reportFeedbackWidgetManually, Feedback Widgets must contain _id property");else ce(s.ERROR,"reportFeedbackWidgetManually, Widget data and/or Widget object not provided. Aborting.")},this.show_feedback_popup=function(t){m?(ce(s.WARNING,"show_feedback_popup, Deprecated function call! Use 'presentRatingWidgetWithID' in place of this call. Call will be redirected now!"),this.presentRatingWidgetWithID(t)):ce(s.WARNING,"show_feedback_popup, window object is not available. Not showing feedback popup.")},this.presentRatingWidgetWithID=function(t){m?(ce(s.INFO,"presentRatingWidgetWithID, Showing rating widget popup for the widget with ID: [ "+t+" ]"),this.check_consent(n.STAR_RATING)&&(Et?ce(s.ERROR,"presentRatingWidgetWithID, Cannot show ratingWidget popup in offline mode"):ue("presentRatingWidgetWithID,",this.url+"/o/feedback/widget",{widget_id:t,av:b.app_version},(function(t,e,i){if(!t)try{Xt(JSON.parse(i),!1)}catch(r){ce(s.ERROR,"presentRatingWidgetWithID, JSON parse failed: "+r)}}),!0))):ce(s.WARNING,"presentRatingWidgetWithID, window object is not available. Not showing rating widget popup.")},this.initialize_feedback_popups=function(t){m?(ce(s.WARNING,"initialize_feedback_popups, Deprecated function call! Use 'initializeRatingWidgets' in place of this call. Call will be redirected now!"),this.initializeRatingWidgets(t)):ce(s.WARNING,"initialize_feedback_popups, window object is not available. Not initializing feedback popups.")},this.initializeRatingWidgets=function(t){if(m){if(ce(s.INFO,"initializeRatingWidgets, Initializing rating widget with provided widget IDs:[ "+t+"]"),this.check_consent(n.STAR_RATING)){t||(t=Ee("cly_fb_widgets"));for(var e=document.getElementsByClassName("countly-feedback-sticker");e.length>0;)e[0].remove();ue("initializeRatingWidgets,",this.url+"/o/feedback/multiple-widgets-by-id",{widgets:JSON.stringify(t),av:b.app_version},(function(t,e,i){if(!t)try{for(var r=JSON.parse(i),n=0;n<r.length;n++)if("true"===r[n].is_active&&r[n].target_devices[F()])if("string"==typeof r[n].hide_sticker&&(r[n].hide_sticker="true"===r[n].hide_sticker),"all"!==r[n].target_page||r[n].hide_sticker)for(var o=r[n].target_pages,a=0;a<o.length;a++){var l=o[a].substr(0,o[a].length-1)===window.location.pathname.substr(0,o[a].length-1),c=o[a]===window.location.pathname;(o[a].includes("*")&&l||c)&&!r[n].hide_sticker&&Xt(r[n],!0)}else Xt(r[n],!0)}catch(u){ce(s.ERROR,"initializeRatingWidgets, JSON parse error: "+u)}}),!0)}}else ce(s.WARNING,"initializeRatingWidgets, window object is not available. Not initializing rating widgets.")},this.enable_feedback=function(t){m?(ce(s.WARNING,"enable_feedback, Deprecated function call! Use 'enableRatingWidgets' in place of this call. Call will be redirected now!"),this.enableRatingWidgets(t)):ce(s.WARNING,"enable_feedback, window object is not available. Not enabling feedback.")},this.enableRatingWidgets=function(t){if(m){if(ce(s.INFO,"enableRatingWidgets, Enabling rating widget with params:",t),this.check_consent(n.STAR_RATING))if(Et)ce(s.ERROR,"enableRatingWidgets, Cannot enable rating widgets in offline mode");else{Se("cly_fb_widgets",t.popups||t.widgets),H(this.url+"/star-rating/stylesheets/countly-feedback-web.css");var e=t.popups||t.widgets;e.length>0?(document.body.insertAdjacentHTML("beforeend",'<div id="cfbg"></div>'),this.initializeRatingWidgets(e)):ce(s.ERROR,"enableRatingWidgets, You should provide at least one widget id as param. Read documentation for more detail. https://resources.count.ly/plugins/feedback")}}else ce(s.WARNING,"enableRatingWidgets, window object is not available. Not enabling rating widgets.")},this.get_available_feedback_widgets=function(t){ce(s.INFO,"get_available_feedback_widgets, Getting the feedback list, callback function is provided:["+!!t+"]"),this.check_consent(n.FEEDBACK)?Et?ce(s.ERROR,"get_available_feedback_widgets, Cannot enable feedback widgets in offline mode."):ue("get_available_feedback_widgets,",this.url+K,{method:n.FEEDBACK,device_id:this.device_id,app_key:this.app_key,av:b.app_version},(function(e,i,r){if(e)t&&t(null,e);else try{var n=JSON.parse(r).result||[];t&&t(n,null)}catch(o){ce(s.ERROR,"get_available_feedback_widgets, Error while parsing feedback widgets list: "+o),t&&t(null,o)}}),!1):t&&t(null,new Error("Consent for feedback not provided."))},this.getFeedbackWidgetData=function(t,e){if(t.type)if(ce(s.INFO,"getFeedbackWidgetData, Retrieving data for: ["+JSON.stringify(t)+"], callback function is provided:["+!!e+"]"),this.check_consent(n.FEEDBACK))if(Et)ce(s.ERROR,"getFeedbackWidgetData, Cannot enable feedback widgets in offline mode.");else{var i=this.url,r={widget_id:t._id,shown:1,sdk_version:Bt,sdk_name:Ft,platform:this.platform,app_version:this.app_version};if("nps"===t.type)i+="/o/surveys/nps/widget";else if("survey"===t.type)i+="/o/surveys/survey/widget";else{if("rating"!==t.type)return void ce(s.ERROR,"getFeedbackWidgetData, Unknown type info: ["+t.type+"]");i+="/o/surveys/rating/widget"}ue("getFeedbackWidgetData,",i,r,o,!0)}else e&&e(null,new Error("Consent for feedback not provided."));else ce(s.ERROR,"getFeedbackWidgetData, Expected the provided widget object to have a type but got: ["+JSON.stringify(t)+"], aborting.");function o(t,i,r){if(t)e&&e(null,t);else try{var n=JSON.parse(r);e&&e(n,null)}catch(o){ce(s.ERROR,"getFeedbackWidgetData, Error while parsing feedback widgets list: "+o),e&&e(null,o)}}},this.present_feedback_widget=function(t,i,r,o){if(m){if(ce(s.INFO,"present_feedback_widget, Presenting the feedback widget by appending to the element with ID: [ "+i+" ] and className: [ "+r+" ]"),this.check_consent(n.FEEDBACK))if(t&&"object"===e(t)&&!Array.isArray(t)){ce(s.INFO,"present_feedback_widget, Adding segmentation to feedback widgets:["+JSON.stringify(o)+"]"),o&&"object"===e(o)&&0!==Object.keys(o).length||(ce(s.DEBUG,"present_feedback_widget, Segmentation is not an object or empty"),o=null);try{var a=this.url;if("nps"===t.type)ce(s.DEBUG,"present_feedback_widget, Widget type: nps."),a+="/feedback/nps";else if("survey"===t.type)ce(s.DEBUG,"present_feedback_widget, Widget type: survey."),a+="/feedback/survey";else{if("rating"!==t.type)return void ce(s.ERROR,"present_feedback_widget, Feedback widget only accepts nps, rating and survey types.");ce(s.DEBUG,"present_feedback_widget, Widget type: rating."),a+="/feedback/rating"}var l,c=window.origin||window.location.origin;if("rating"===t.type?(ce(s.DEBUG,"present_feedback_widget, Loading css for rating widget."),l="ratings",H(this.url+"/star-rating/stylesheets/countly-feedback-web.css")):(ce(s.DEBUG,"present_feedback_widget, Loading css for survey or nps."),H(this.url+"/surveys/stylesheets/countly-surveys.css"),l="surveys"),a+="?widget_id="+t._id,a+="&app_key="+this.app_key,a+="&device_id="+this.device_id,a+="&sdk_name="+Ft,a+="&platform="+this.platform,a+="&app_version="+this.app_version,a+="&sdk_version="+Bt,o){var u={};u.sg=o,a+="&custom="+JSON.stringify(u)}a+="&origin="+c,a+="&widget_v=web";var h=document.createElement("iframe");h.src=a,h.name="countly-"+l+"-iframe",h.id="countly-"+l+"-iframe";var d=!1;h.onload=function(){d&&(document.getElementById("countly-"+l+"-wrapper-"+t._id).style.display="none",document.getElementById("csbg").style.display="none"),d=!0,ce(s.DEBUG,"present_feedback_widget, Loaded iframe.")};for(var p=document.getElementById("csbg");p;)p.remove(),p=document.getElementById("csbg"),ce(s.DEBUG,"present_feedback_widget, Removing past overlay.");for(var f=document.getElementsByClassName("countly-"+l+"-wrapper"),g=0;g<f.length;g++)f[g].remove(),ce(s.DEBUG,"present_feedback_widget, Removed a wrapper.");(f=document.createElement("div")).className="countly-"+l+"-wrapper",f.id="countly-"+l+"-wrapper-"+t._id,"survey"===t.type&&(f.className=f.className+" "+t.appearance.position);var y=document.body,_=!1;if(i&&(document.getElementById(i)?(y=document.getElementById(i),_=!0):ce(s.ERROR,"present_feedback_widget, Provided ID not found.")),_||r&&(document.getElementsByClassName(r)[0]?y=document.getElementsByClassName(r)[0]:ce(s.ERROR,"present_feedback_widget, Provided class not found.")),y.insertAdjacentHTML("beforeend",'<div id="csbg"></div>'),y.appendChild(f),"rating"===t.type){var v=document.createElement("div");v.className="countly-ratings-overlay",v.id="countly-ratings-overlay-"+t._id,f.appendChild(v),ce(s.DEBUG,"present_feedback_widget, appended the rating overlay to wrapper"),z(document.getElementById("countly-ratings-overlay-"+t._id),"click",(function(){document.getElementById("countly-ratings-wrapper-"+t._id).style.display="none"}))}if(f.appendChild(h),ce(s.DEBUG,"present_feedback_widget, Appended the iframe"),z(window,"message",(function(e){var i={};try{i=JSON.parse(e.data),ce(s.DEBUG,"present_feedback_widget, Parsed response message "+i)}catch(r){ce(s.ERROR,"present_feedback_widget, Error while parsing message body "+r)}i.close?(document.getElementById("countly-"+l+"-wrapper-"+t._id).style.display="none",document.getElementById("csbg").style.display="none"):ce(s.DEBUG,"present_feedback_widget, Closing signal not sent yet")})),"survey"===t.type){var b=!1;switch(t.showPolicy){case"afterPageLoad":"complete"===document.readyState?b||(b=!0,w(t)):z(document,"readystatechange",(function(e){"complete"===e.target.readyState&&(b||(b=!0,w(t)))}));break;case"afterConstantDelay":setTimeout((function(){b||(b=!0,w(t))}),1e4);break;case"onAbandon":"complete"===document.readyState?z(document,"mouseleave",(function(){b||(b=!0,w(t))})):z(document,"readystatechange",(function(e){"complete"===e.target.readyState&&z(document,"mouseleave",(function(){b||(b=!0,w(t))}))}));break;case"onScrollHalfwayDown":z(window,"scroll",(function(){b||Math.max(window.scrollY,document.body.scrollTop,document.documentElement.scrollTop)>=j()/2&&(b=!0,w(t))}));break;default:b||(b=!0,w(t))}}else if("nps"===t.type)document.getElementById("countly-"+l+"-wrapper-"+t._id).style.display="block",document.getElementById("csbg").style.display="block";else if("rating"===t.type){var x=!1;"complete"===document.readyState?x||(x=!0,k(t)):z(document,"readystatechange",(function(e){"complete"===e.target.readyState&&(x||(x=!0,k(t)))}))}}catch(xt){ce(s.ERROR,"present_feedback_widget, Something went wrong while presenting the widget: "+xt)}}else ce(s.ERROR,"present_feedback_widget, Please provide at least one feedback widget object.")}else ce(s.WARNING,"present_feedback_widget, window object is not available. Not presenting feedback widget.");function w(t){document.getElementById("countly-surveys-wrapper-"+t._id).style.display="block",document.getElementById("csbg").style.display="block"}function k(t){if(!t.appearance.hideS){ce(s.DEBUG,"present_feedback_widget, handling the sticker as it was not set to hidden");var e=document.createElement("div");e.innerText=t.appearance.text,e.style.color=t.appearance.text_color.length<7?"#"+t.appearance.text_color:t.appearance.text_color,e.style.backgroundColor=t.appearance.bg_color.length<7?"#"+t.appearance.bg_color:t.appearance.bg_color,e.className="countly-feedback-sticker "+t.appearance.position+"-"+t.appearance.size,e.id="countly-feedback-sticker-"+t._id,document.body.appendChild(e),z(document.getElementById("countly-feedback-sticker-"+t._id),"click",(function(){document.getElementById("countly-ratings-wrapper-"+t._id).style.display="flex",document.getElementById("csbg").style.display="block"}))}z(document.getElementById("countly-feedback-close-icon-"+t._id),"click",(function(){document.getElementById("countly-ratings-wrapper-"+t._id).style.display="none",document.getElementById("csbg").style.display="none"}))}},this.recordError=function(t,i,r){if(ce(s.INFO,"recordError, Recording error"),this.check_consent(n.CRASHES)&&t){r=r||at;var o="";if("object"===e(t)?void 0!==t.stack?o=t.stack:(void 0!==t.name&&(o+=t.name+":"),void 0!==t.message&&(o+=t.message+"\n"),void 0!==t.fileName&&(o+="in "+t.fileName+"\n"),void 0!==t.lineNumber&&(o+="on "+t.lineNumber),void 0!==t.columnNumber&&(o+=":"+t.columnNumber)):o=t+"",o.length>b.maxStackTraceLineLength*b.maxStackTraceLinesPerThread){ce(s.DEBUG,"record_error, Error stack is too long will be truncated");var a=o.split("\n");a.length>b.maxStackTraceLinesPerThread&&(a=a.splice(0,b.maxStackTraceLinesPerThread));for(var l=0,c=a.length;l<c;l++)a[l].length>b.maxStackTraceLineLength&&(a[l]=a[l].substring(0,b.maxStackTraceLineLength));o=a.join("\n")}i=!!i;var u=se(),h={_resolution:u._resolution,_error:o,_app_version:u._app_version,_run:x()-Ct,_not_os_specific:!0,_javascript:!0},d=navigator.battery||navigator.webkitBattery||navigator.mozBattery||navigator.msBattery;d&&(h._bat=Math.floor(100*d.level)),void 0!==navigator.onLine&&(h._online=!!navigator.onLine),m&&(h._background=!document.hasFocus()),rt.length>0&&(h._logs=rt.join("\n")),rt=[],h._nonfatal=i,h._view=this.getViewName(),void 0!==r&&(r=P(r,b.maxKeyLength,b.maxValueSize,b.maxSegmentationValues,"record_error",ce),h._custom=r);try{var p=document.createElement("canvas").getContext("experimental-webgl");h._opengl=p.getParameter(p.VERSION)}catch(g){ce(s.ERROR,"Could not get the experimental-webgl context: "+g)}var f={};f.crash=JSON.stringify(h),f.metrics=JSON.stringify({_ua:u._ua}),ee(f)}},this.onStorageChange=function(t,e){switch(ce(s.DEBUG,"onStorageChange, Applying storage changes for key:",t),ce(s.DEBUG,"onStorageChange, Applying storage changes for value:",e),t){case"cly_queue":tt=b.deserialize(e||"[]");break;case"cly_event":et=b.deserialize(e||"[]");break;case"cly_remote_configs":it=b.deserialize(e||"{}");break;case"cly_ignore":b.ignore_visitor=b.deserialize(e);break;case"cly_id":b.device_id=e;break;case"cly_id_type":Pt=b.deserialize(e)}},this._internals={store:Se,getDocWidth:V,getDocHeight:j,getViewportHeight:U,get_page_coord:N,get_event_target:D,add_event_listener:z,createNewObjectFromProperties:T,truncateObject:P,truncateSingleValue:M,stripTrailingSlash:C,prepareParams:I,sendXmlHttpRequest:he,isResponseValid:pe,getInternalDeviceIdType:ye,getMsTimestamp:k,getTimestamp:x,isResponseValidBroad:fe,secureRandom:_,log:ce,checkIfLoggingIsOn:W,getMetrics:se,getUA:ae,prepareRequest:te,generateUUID:v,sendEventsForced:Wt,isUUID:oe,isReferrerUsable:le,getId:ne,heartBeat:ie,toRequestQueue:ee,reportViewDuration:Kt,loadJS:G,loadCSS:H,getLastView:Yt,setToken:_e,getToken:ve,showLoader:Z,hideLoader:X,setValueInStorage:Se,getValueFromStorage:Ee,removeValueFromStorage:Ie,add_cly_events:qt,processScrollView:ge,processScroll:me,currentUserAgentString:R,currentUserAgentDataString:O,userAgentDeviceDetection:F,userAgentSearchBotDetection:B,getRequestQueue:xe,getEventQueue:be,sendFetchRequest:de,processAsyncQueue:re,makeNetworkRequest:ue,clearQueue:function(){tt=[],Se("cly_queue",[]),et=[],Se("cly_event",[])},getLocalQueues:function(){return{eventQ:et,requestQ:tt}}};var Te={};function Ae(){b.hcErrorCount++}function Pe(){b.hcWarningCount++}function Me(){b.hcErrorCount=0,b.hcWarningCount=0,b.hcStatusCode=-1,b.hcErrorMessage=""}function Le(t,e){b.hcStatusCode=t,b.hcErrorMessage=e,Se(h.statusCode,b.hcStatusCode),Se(h.errorMessage,b.hcErrorMessage)}function ze(){Te.resetCounters(),Se(h.errorCount,b.hcErrorCount),Se(h.warningCount,b.hcWarningCount),Se(h.statusCode,b.hcStatusCode),Se(h.errorMessage,b.hcErrorMessage)}function De(){var t=M(b.hcErrorMessage,1e3,"healthCheck",ce),e={el:b.hcErrorCount,wl:b.hcWarningCount,sc:b.hcStatusCode,em:JSON.stringify(t)},i={hc:JSON.stringify(e),metrics:JSON.stringify({_app_version:b.app_version})};te(i),ue("[healthCheck]",b.url+J,i,(function(t){t||Te.resetAndSaveCounters()}),!0)}Te.sendInstantHCRequest=De,Te.resetAndSaveCounters=ze,Te.incrementErrorCount=Ae,Te.incrementWarningCount=Pe,Te.resetCounters=Me,Te.saveRequestCounters=Le,this.initialize()})),K=!0;function Y(t){var e=document.createElement("script"),i=document.createElement("script");e.async=!0,i.async=!0,e.src=g.customSourceBoomerang||u.BOOMERANG_SRC,i.src=g.customSourceCountlyBoomerang||u.CLY_BOOMERANG_SRC,document.getElementsByTagName("head")[0].appendChild(e),document.getElementsByTagName("head")[0].appendChild(i);var r=!1,n=!1;e.onload=function(){r=!0},i.onload=function(){n=!0};var o=0,a=50,s=1500,l=setInterval((function(){if(o+=a,r&&n||o>=s){if(g.debug){var e="BoomerangJS loaded:["+r+"], countly_boomerang loaded:["+n+"].";r&&n?(e="[DEBUG] "+e,console.log(e)):(e="[WARNING] "+e+" Initializing without APM.",console.warn(e))}g.init(t),clearInterval(l)}}),a)}g.features=[n.APM,n.ATTRIBUTION,n.CLICKS,n.CRASHES,n.EVENTS,n.FEEDBACK,n.FORMS,n.LOCATION,n.REMOTE_CONFIG,n.SCROLLS,n.SESSIONS,n.STAR_RATING,n.USERS,n.VIEWS],g.q=g.q||[],g.onload=g.onload||[],g.CountlyClass=J,g.init=function(t){if(t=t||{},g.loadAPMScriptsAsync&&K)return K=!1,void Y(t);var e=t.app_key||g.app_key;if(!g.i||!g.i[e]){var i=new J(t);if(!g.i)for(var r in g.i={},i)g[r]=i[r];g.i[e]=i}return g.i[e]},g.serialize=function(t){return"object"===e(t)&&(t=JSON.stringify(t)),t},g.deserialize=function(t){if(""===t)return t;try{t=JSON.parse(t)}catch(xt){W()&&console.warn("[WARNING] [Countly] deserialize, Could not parse the file:["+t+"], error: "+xt)}return t},g.getViewName=function(){return m?window.location.pathname:"web_worker"},g.getViewUrl=function(){return m?window.location.pathname:"web_worker"},g.getSearchQuery=function(){if(m)return window.location.search},g.DeviceIdType={DEVELOPER_SUPPLIED:l.DEVELOPER_SUPPLIED,SDK_GENERATED:l.SDK_GENERATED,TEMPORARY_ID:l.TEMPORARY_ID},m&&window.addEventListener("storage",(function(t){var e=(t.key+"").split("/"),i=e.pop(),r=e.pop();g.i&&g.i[r]&&g.i[r].onStorageChange(i,t.newValue)})),t.default=g,Object.defineProperty(t,"__esModule",{value:!0})}(e)},443:function(t){
65
+ /**
66
+ * MapLibre GL JS
67
+ * @license 3-Clause BSD. Full text of license: https://github.com/maplibre/maplibre-gl-js/blob/v4.7.1/LICENSE.txt
68
+ */
69
+ t.exports=function(){var t={},e={};function i(i,r,n){if(e[i]=n,"index"===i){var o="var sharedModule = {}; ("+e.shared+")(sharedModule); ("+e.worker+")(sharedModule);",a={};return e.shared(a),e.index(t,a),"undefined"!=typeof window&&t.setWorkerUrl(window.URL.createObjectURL(new Blob([o],{type:"text/javascript"}))),t}}return i("shared",["exports"],(function(t){function e(t,e,i,r){return new(i||(i=Promise))((function(n,o){function a(t){try{l(r.next(t))}catch(t){o(t)}}function s(t){try{l(r.throw(t))}catch(t){o(t)}}function l(t){var e;t.done?n(t.value):(e=t.value,e instanceof i?e:new i((function(t){t(e)}))).then(a,s)}l((r=r.apply(t,e||[])).next())}))}function i(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}"function"==typeof SuppressedError&&SuppressedError;var r=n;function n(t,e){this.x=t,this.y=e}n.prototype={clone:function(){return new n(this.x,this.y)},add:function(t){return this.clone()._add(t)},sub:function(t){return this.clone()._sub(t)},multByPoint:function(t){return this.clone()._multByPoint(t)},divByPoint:function(t){return this.clone()._divByPoint(t)},mult:function(t){return this.clone()._mult(t)},div:function(t){return this.clone()._div(t)},rotate:function(t){return this.clone()._rotate(t)},rotateAround:function(t,e){return this.clone()._rotateAround(t,e)},matMult:function(t){return this.clone()._matMult(t)},unit:function(){return this.clone()._unit()},perp:function(){return this.clone()._perp()},round:function(){return this.clone()._round()},mag:function(){return Math.sqrt(this.x*this.x+this.y*this.y)},equals:function(t){return this.x===t.x&&this.y===t.y},dist:function(t){return Math.sqrt(this.distSqr(t))},distSqr:function(t){var e=t.x-this.x,i=t.y-this.y;return e*e+i*i},angle:function(){return Math.atan2(this.y,this.x)},angleTo:function(t){return Math.atan2(this.y-t.y,this.x-t.x)},angleWith:function(t){return this.angleWithSep(t.x,t.y)},angleWithSep:function(t,e){return Math.atan2(this.x*e-this.y*t,this.x*t+this.y*e)},_matMult:function(t){var e=t[2]*this.x+t[3]*this.y;return this.x=t[0]*this.x+t[1]*this.y,this.y=e,this},_add:function(t){return this.x+=t.x,this.y+=t.y,this},_sub:function(t){return this.x-=t.x,this.y-=t.y,this},_mult:function(t){return this.x*=t,this.y*=t,this},_div:function(t){return this.x/=t,this.y/=t,this},_multByPoint:function(t){return this.x*=t.x,this.y*=t.y,this},_divByPoint:function(t){return this.x/=t.x,this.y/=t.y,this},_unit:function(){return this._div(this.mag()),this},_perp:function(){var t=this.y;return this.y=this.x,this.x=-t,this},_rotate:function(t){var e=Math.cos(t),i=Math.sin(t),r=i*this.x+e*this.y;return this.x=e*this.x-i*this.y,this.y=r,this},_rotateAround:function(t,e){var i=Math.cos(t),r=Math.sin(t),n=e.y+r*(this.x-e.x)+i*(this.y-e.y);return this.x=e.x+i*(this.x-e.x)-r*(this.y-e.y),this.y=n,this},_round:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this}},n.convert=function(t){return t instanceof n?t:Array.isArray(t)?new n(t[0],t[1]):t};var o=i(r),a=s;function s(t,e,i,r){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*(r-e)-this.cy,this.ay=1-this.cy-this.by,this.p1x=t,this.p1y=e,this.p2x=i,this.p2y=r}s.prototype={sampleCurveX:function(t){return((this.ax*t+this.bx)*t+this.cx)*t},sampleCurveY:function(t){return((this.ay*t+this.by)*t+this.cy)*t},sampleCurveDerivativeX:function(t){return(3*this.ax*t+2*this.bx)*t+this.cx},solveCurveX:function(t,e){if(void 0===e&&(e=1e-6),t<0)return 0;if(t>1)return 1;for(var i=t,r=0;r<8;r++){var n=this.sampleCurveX(i)-t;if(Math.abs(n)<e)return i;var o=this.sampleCurveDerivativeX(i);if(Math.abs(o)<1e-6)break;i-=n/o}var a=0,s=1;for(i=t,r=0;r<20&&(n=this.sampleCurveX(i),!(Math.abs(n-t)<e));r++)t>n?a=i:s=i,i=.5*(s-a)+a;return i},solve:function(t,e){return this.sampleCurveY(this.solveCurveX(t,e))}};var l=i(a);let c,u;function h(){return null==c&&(c="undefined"!=typeof OffscreenCanvas&&new OffscreenCanvas(1,1).getContext("2d")&&"function"==typeof createImageBitmap),c}function d(){if(null==u&&(u=!1,h())){const t=5,e=new OffscreenCanvas(t,t).getContext("2d",{willReadFrequently:!0});if(e){for(let r=0;r<t*t;r++){const i=4*r;e.fillStyle=`rgb(${i},${i+1},${i+2})`,e.fillRect(r%t,Math.floor(r/t),1,1)}const i=e.getImageData(0,0,t,t).data;for(let e=0;e<t*t*4;e++)if(e%4!=3&&i[e]!==e){u=!0;break}}}return u||!1}function p(t,e,i,r){const n=new l(t,e,i,r);return t=>n.solve(t)}const f=p(.25,.1,.25,1);function m(t,e,i){return Math.min(i,Math.max(e,t))}function g(t,e,i){const r=i-e,n=((t-e)%r+r)%r+e;return n===e?i:n}function y(t,...e){for(const i of e)for(const e in i)t[e]=i[e];return t}let _=1;function v(t,e,i){const r={};for(const n in t)r[n]=e.call(this,t[n],n,t);return r}function b(t,e,i){const r={};for(const n in t)e.call(this,t[n],n,t)&&(r[n]=t[n]);return r}function x(t){return Array.isArray(t)?t.map(x):"object"==typeof t&&t?v(t,x):t}const w={};function k(t){w[t]||("undefined"!=typeof console&&console.warn(t),w[t]=!0)}function E(t,e,i){return(i.y-t.y)*(e.x-t.x)>(e.y-t.y)*(i.x-t.x)}function S(t){return"undefined"!=typeof WorkerGlobalScope&&void 0!==t&&t instanceof WorkerGlobalScope}let I=null;function C(t){return"undefined"!=typeof ImageBitmap&&t instanceof ImageBitmap}const T="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAC0lEQVQYV2NgAAIAAAUAAarVyFEAAAAASUVORK5CYII=";function A(t,i,r,n,o){return e(this,void 0,void 0,(function*(){if("undefined"==typeof VideoFrame)throw new Error("VideoFrame not supported");const e=new VideoFrame(t,{timestamp:0});try{const a=null==e?void 0:e.format;if(!a||!a.startsWith("BGR")&&!a.startsWith("RGB"))throw new Error(`Unrecognized format ${a}`);const s=a.startsWith("BGR"),l=new Uint8ClampedArray(n*o*4);if(yield e.copyTo(l,function(t,e,i,r,n){const o=4*Math.max(-e,0),a=(Math.max(0,i)-i)*r*4+o,s=4*r,l=Math.max(0,e),c=Math.max(0,i);return{rect:{x:l,y:c,width:Math.min(t.width,e+r)-l,height:Math.min(t.height,i+n)-c},layout:[{offset:a,stride:s}]}}(t,i,r,n,o)),s)for(let t=0;t<l.length;t+=4){const e=l[t];l[t]=l[t+2],l[t+2]=e}return l}finally{e.close()}}))}let P,M;const L="AbortError";function z(){return new Error(L)}const D={MAX_PARALLEL_IMAGE_REQUESTS:16,MAX_PARALLEL_IMAGE_REQUESTS_PER_FRAME:8,MAX_TILE_CACHE_ZOOM_LEVELS:5,REGISTERED_PROTOCOLS:{},WORKER_URL:""};function R(t){return D.REGISTERED_PROTOCOLS[t.substring(0,t.indexOf("://"))]}const O="global-dispatcher";class F extends Error{constructor(t,e,i,r){super(`AJAXError: ${e} (${t}): ${i}`),this.status=t,this.statusText=e,this.url=i,this.body=r}}const B=()=>S(self)?self.worker&&self.worker.referrer:("blob:"===window.location.protocol?window.parent:window).location.href,N=function(t,i){if(/:\/\//.test(t.url)&&!/^https?:|^file:/.test(t.url)){const e=R(t.url);if(e)return e(t,i);if(S(self)&&self.worker&&self.worker.actor)return self.worker.actor.sendAsync({type:"GR",data:t,targetMapId:O},i)}if(!(/^file:/.test(r=t.url)||/^file:/.test(B())&&!/^\w+:/.test(r))){if(fetch&&Request&&AbortController&&Object.prototype.hasOwnProperty.call(Request.prototype,"signal"))return function(t,i){return e(this,void 0,void 0,(function*(){const e=new Request(t.url,{method:t.method||"GET",body:t.body,credentials:t.credentials,headers:t.headers,cache:t.cache,referrer:B(),signal:i.signal});"json"!==t.type||e.headers.has("Accept")||e.headers.set("Accept","application/json");const r=yield fetch(e);if(!r.ok){const e=yield r.blob();throw new F(r.status,r.statusText,t.url,e)}let n;n="arrayBuffer"===t.type||"image"===t.type?r.arrayBuffer():"json"===t.type?r.json():r.text();const o=yield n;if(i.signal.aborted)throw z();return{data:o,cacheControl:r.headers.get("Cache-Control"),expires:r.headers.get("Expires")}}))}(t,i);if(S(self)&&self.worker&&self.worker.actor)return self.worker.actor.sendAsync({type:"GR",data:t,mustQueue:!0,targetMapId:O},i)}var r;return function(t,e){return new Promise(((i,r)=>{var n;const o=new XMLHttpRequest;o.open(t.method||"GET",t.url,!0),"arrayBuffer"!==t.type&&"image"!==t.type||(o.responseType="arraybuffer");for(const e in t.headers)o.setRequestHeader(e,t.headers[e]);"json"===t.type&&(o.responseType="text",(null===(n=t.headers)||void 0===n?void 0:n.Accept)||o.setRequestHeader("Accept","application/json")),o.withCredentials="include"===t.credentials,o.onerror=()=>{r(new Error(o.statusText))},o.onload=()=>{if(!e.signal.aborted)if((o.status>=200&&o.status<300||0===o.status)&&null!==o.response){let e=o.response;if("json"===t.type)try{e=JSON.parse(o.response)}catch(t){return void r(t)}i({data:e,cacheControl:o.getResponseHeader("Cache-Control"),expires:o.getResponseHeader("Expires")})}else{const e=new Blob([o.response],{type:o.getResponseHeader("Content-Type")});r(new F(o.status,o.statusText,t.url,e))}},e.signal.addEventListener("abort",(()=>{o.abort(),r(z())})),o.send(t.body)}))}(t,i)};function j(t){if(!t||t.indexOf("://")<=0||0===t.indexOf("data:image/")||0===t.indexOf("blob:"))return!0;const e=new URL(t),i=window.location;return e.protocol===i.protocol&&e.host===i.host}function V(t,e,i){i[t]&&-1!==i[t].indexOf(e)||(i[t]=i[t]||[],i[t].push(e))}function U(t,e,i){if(i&&i[t]){const r=i[t].indexOf(e);-1!==r&&i[t].splice(r,1)}}class q{constructor(t,e={}){y(this,e),this.type=t}}class $ extends q{constructor(t,e={}){super("error",y({error:t},e))}}class G{on(t,e){return this._listeners=this._listeners||{},V(t,e,this._listeners),this}off(t,e){return U(t,e,this._listeners),U(t,e,this._oneTimeListeners),this}once(t,e){return e?(this._oneTimeListeners=this._oneTimeListeners||{},V(t,e,this._oneTimeListeners),this):new Promise((e=>this.once(t,e)))}fire(t,e){"string"==typeof t&&(t=new q(t,e||{}));const i=t.type;if(this.listens(i)){t.target=this;const e=this._listeners&&this._listeners[i]?this._listeners[i].slice():[];for(const i of e)i.call(this,t);const r=this._oneTimeListeners&&this._oneTimeListeners[i]?this._oneTimeListeners[i].slice():[];for(const o of r)U(i,o,this._oneTimeListeners),o.call(this,t);const n=this._eventedParent;n&&(y(t,"function"==typeof this._eventedParentData?this._eventedParentData():this._eventedParentData),n.fire(t))}else t instanceof $&&console.error(t.error);return this}listens(t){return this._listeners&&this._listeners[t]&&this._listeners[t].length>0||this._oneTimeListeners&&this._oneTimeListeners[t]&&this._oneTimeListeners[t].length>0||this._eventedParent&&this._eventedParent.listens(t)}setEventedParent(t,e){return this._eventedParent=t,this._eventedParentData=e,this}}var H={$version:8,$root:{version:{required:!0,type:"enum",values:[8]},name:{type:"string"},metadata:{type:"*"},center:{type:"array",value:"number"},zoom:{type:"number"},bearing:{type:"number",default:0,period:360,units:"degrees"},pitch:{type:"number",default:0,units:"degrees"},light:{type:"light"},sky:{type:"sky"},projection:{type:"projection"},terrain:{type:"terrain"},sources:{required:!0,type:"sources"},sprite:{type:"sprite"},glyphs:{type:"string"},transition:{type:"transition"},layers:{required:!0,type:"array",value:"layer"}},sources:{"*":{type:"source"}},source:["source_vector","source_raster","source_raster_dem","source_geojson","source_video","source_image"],source_vector:{type:{required:!0,type:"enum",values:{vector:{}}},url:{type:"string"},tiles:{type:"array",value:"string"},bounds:{type:"array",value:"number",length:4,default:[-180,-85.051129,180,85.051129]},scheme:{type:"enum",values:{xyz:{},tms:{}},default:"xyz"},minzoom:{type:"number",default:0},maxzoom:{type:"number",default:22},attribution:{type:"string"},promoteId:{type:"promoteId"},volatile:{type:"boolean",default:!1},"*":{type:"*"}},source_raster:{type:{required:!0,type:"enum",values:{raster:{}}},url:{type:"string"},tiles:{type:"array",value:"string"},bounds:{type:"array",value:"number",length:4,default:[-180,-85.051129,180,85.051129]},minzoom:{type:"number",default:0},maxzoom:{type:"number",default:22},tileSize:{type:"number",default:512,units:"pixels"},scheme:{type:"enum",values:{xyz:{},tms:{}},default:"xyz"},attribution:{type:"string"},volatile:{type:"boolean",default:!1},"*":{type:"*"}},source_raster_dem:{type:{required:!0,type:"enum",values:{"raster-dem":{}}},url:{type:"string"},tiles:{type:"array",value:"string"},bounds:{type:"array",value:"number",length:4,default:[-180,-85.051129,180,85.051129]},minzoom:{type:"number",default:0},maxzoom:{type:"number",default:22},tileSize:{type:"number",default:512,units:"pixels"},attribution:{type:"string"},encoding:{type:"enum",values:{terrarium:{},mapbox:{},custom:{}},default:"mapbox"},redFactor:{type:"number",default:1},blueFactor:{type:"number",default:1},greenFactor:{type:"number",default:1},baseShift:{type:"number",default:0},volatile:{type:"boolean",default:!1},"*":{type:"*"}},source_geojson:{type:{required:!0,type:"enum",values:{geojson:{}}},data:{required:!0,type:"*"},maxzoom:{type:"number",default:18},attribution:{type:"string"},buffer:{type:"number",default:128,maximum:512,minimum:0},filter:{type:"*"},tolerance:{type:"number",default:.375},cluster:{type:"boolean",default:!1},clusterRadius:{type:"number",default:50,minimum:0},clusterMaxZoom:{type:"number"},clusterMinPoints:{type:"number"},clusterProperties:{type:"*"},lineMetrics:{type:"boolean",default:!1},generateId:{type:"boolean",default:!1},promoteId:{type:"promoteId"}},source_video:{type:{required:!0,type:"enum",values:{video:{}}},urls:{required:!0,type:"array",value:"string"},coordinates:{required:!0,type:"array",length:4,value:{type:"array",length:2,value:"number"}}},source_image:{type:{required:!0,type:"enum",values:{image:{}}},url:{required:!0,type:"string"},coordinates:{required:!0,type:"array",length:4,value:{type:"array",length:2,value:"number"}}},layer:{id:{type:"string",required:!0},type:{type:"enum",values:{fill:{},line:{},symbol:{},circle:{},heatmap:{},"fill-extrusion":{},raster:{},hillshade:{},background:{}},required:!0},metadata:{type:"*"},source:{type:"string"},"source-layer":{type:"string"},minzoom:{type:"number",minimum:0,maximum:24},maxzoom:{type:"number",minimum:0,maximum:24},filter:{type:"filter"},layout:{type:"layout"},paint:{type:"paint"}},layout:["layout_fill","layout_line","layout_circle","layout_heatmap","layout_fill-extrusion","layout_symbol","layout_raster","layout_hillshade","layout_background"],layout_background:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_fill:{"fill-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_circle:{"circle-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_heatmap:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},"layout_fill-extrusion":{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_line:{"line-cap":{type:"enum",values:{butt:{},round:{},square:{}},default:"butt",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"line-join":{type:"enum",values:{bevel:{},round:{},miter:{}},default:"miter",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"line-miter-limit":{type:"number",default:2,requires:[{"line-join":"miter"}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"line-round-limit":{type:"number",default:1.05,requires:[{"line-join":"round"}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"line-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_symbol:{"symbol-placement":{type:"enum",values:{point:{},line:{},"line-center":{}},default:"point",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"symbol-spacing":{type:"number",default:250,minimum:1,units:"pixels",requires:[{"symbol-placement":"line"}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"symbol-avoid-edges":{type:"boolean",default:!1,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"symbol-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"symbol-z-order":{type:"enum",values:{auto:{},"viewport-y":{},source:{}},default:"auto",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-allow-overlap":{type:"boolean",default:!1,requires:["icon-image",{"!":"icon-overlap"}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-overlap":{type:"enum",values:{never:{},always:{},cooperative:{}},requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-ignore-placement":{type:"boolean",default:!1,requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-optional":{type:"boolean",default:!1,requires:["icon-image","text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-rotation-alignment":{type:"enum",values:{map:{},viewport:{},auto:{}},default:"auto",requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-size":{type:"number",default:1,minimum:0,units:"factor of the original icon size",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-text-fit":{type:"enum",values:{none:{},width:{},height:{},both:{}},default:"none",requires:["icon-image","text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-text-fit-padding":{type:"array",value:"number",length:4,default:[0,0,0,0],units:"pixels",requires:["icon-image","text-field",{"icon-text-fit":["both","width","height"]}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"icon-image":{type:"resolvedImage",tokens:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-rotate":{type:"number",default:0,period:360,units:"degrees",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-padding":{type:"padding",default:[2],units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-keep-upright":{type:"boolean",default:!1,requires:["icon-image",{"icon-rotation-alignment":"map"},{"symbol-placement":["line","line-center"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-offset":{type:"array",value:"number",length:2,default:[0,0],requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-anchor":{type:"enum",values:{center:{},left:{},right:{},top:{},bottom:{},"top-left":{},"top-right":{},"bottom-left":{},"bottom-right":{}},default:"center",requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-pitch-alignment":{type:"enum",values:{map:{},viewport:{},auto:{}},default:"auto",requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-pitch-alignment":{type:"enum",values:{map:{},viewport:{},auto:{}},default:"auto",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-rotation-alignment":{type:"enum",values:{map:{},viewport:{},"viewport-glyph":{},auto:{}},default:"auto",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-field":{type:"formatted",default:"",tokens:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-font":{type:"array",value:"string",default:["Open Sans Regular","Arial Unicode MS Regular"],requires:["text-field"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-size":{type:"number",default:16,minimum:0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-max-width":{type:"number",default:10,minimum:0,units:"ems",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-line-height":{type:"number",default:1.2,units:"ems",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-letter-spacing":{type:"number",default:0,units:"ems",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-justify":{type:"enum",values:{auto:{},left:{},center:{},right:{}},default:"center",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-radial-offset":{type:"number",units:"ems",default:0,requires:["text-field"],"property-type":"data-driven",expression:{interpolated:!0,parameters:["zoom","feature"]}},"text-variable-anchor":{type:"array",value:"enum",values:{center:{},left:{},right:{},top:{},bottom:{},"top-left":{},"top-right":{},"bottom-left":{},"bottom-right":{}},requires:["text-field",{"symbol-placement":["point"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-variable-anchor-offset":{type:"variableAnchorOffsetCollection",requires:["text-field",{"symbol-placement":["point"]}],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-anchor":{type:"enum",values:{center:{},left:{},right:{},top:{},bottom:{},"top-left":{},"top-right":{},"bottom-left":{},"bottom-right":{}},default:"center",requires:["text-field",{"!":"text-variable-anchor"}],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-max-angle":{type:"number",default:45,units:"degrees",requires:["text-field",{"symbol-placement":["line","line-center"]}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-writing-mode":{type:"array",value:"enum",values:{horizontal:{},vertical:{}},requires:["text-field",{"symbol-placement":["point"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-rotate":{type:"number",default:0,period:360,units:"degrees",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-padding":{type:"number",default:2,minimum:0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-keep-upright":{type:"boolean",default:!0,requires:["text-field",{"text-rotation-alignment":"map"},{"symbol-placement":["line","line-center"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-transform":{type:"enum",values:{none:{},uppercase:{},lowercase:{}},default:"none",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-offset":{type:"array",value:"number",units:"ems",length:2,default:[0,0],requires:["text-field",{"!":"text-radial-offset"}],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-allow-overlap":{type:"boolean",default:!1,requires:["text-field",{"!":"text-overlap"}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-overlap":{type:"enum",values:{never:{},always:{},cooperative:{}},requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-ignore-placement":{type:"boolean",default:!1,requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-optional":{type:"boolean",default:!1,requires:["text-field","icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_raster:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_hillshade:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},filter:{type:"array",value:"*"},filter_operator:{type:"enum",values:{"==":{},"!=":{},">":{},">=":{},"<":{},"<=":{},in:{},"!in":{},all:{},any:{},none:{},has:{},"!has":{}}},geometry_type:{type:"enum",values:{Point:{},LineString:{},Polygon:{}}},function:{expression:{type:"expression"},stops:{type:"array",value:"function_stop"},base:{type:"number",default:1,minimum:0},property:{type:"string",default:"$zoom"},type:{type:"enum",values:{identity:{},exponential:{},interval:{},categorical:{}},default:"exponential"},colorSpace:{type:"enum",values:{rgb:{},lab:{},hcl:{}},default:"rgb"},default:{type:"*",required:!1}},function_stop:{type:"array",minimum:0,maximum:24,value:["number","color"],length:2},expression:{type:"array",value:"*",minimum:1},light:{anchor:{type:"enum",default:"viewport",values:{map:{},viewport:{}},"property-type":"data-constant",transition:!1,expression:{interpolated:!1,parameters:["zoom"]}},position:{type:"array",default:[1.15,210,30],length:3,value:"number","property-type":"data-constant",transition:!0,expression:{interpolated:!0,parameters:["zoom"]}},color:{type:"color","property-type":"data-constant",default:"#ffffff",expression:{interpolated:!0,parameters:["zoom"]},transition:!0},intensity:{type:"number","property-type":"data-constant",default:.5,minimum:0,maximum:1,expression:{interpolated:!0,parameters:["zoom"]},transition:!0}},sky:{"sky-color":{type:"color","property-type":"data-constant",default:"#88C6FC",expression:{interpolated:!0,parameters:["zoom"]},transition:!0},"horizon-color":{type:"color","property-type":"data-constant",default:"#ffffff",expression:{interpolated:!0,parameters:["zoom"]},transition:!0},"fog-color":{type:"color","property-type":"data-constant",default:"#ffffff",expression:{interpolated:!0,parameters:["zoom"]},transition:!0},"fog-ground-blend":{type:"number","property-type":"data-constant",default:.5,minimum:0,maximum:1,expression:{interpolated:!0,parameters:["zoom"]},transition:!0},"horizon-fog-blend":{type:"number","property-type":"data-constant",default:.8,minimum:0,maximum:1,expression:{interpolated:!0,parameters:["zoom"]},transition:!0},"sky-horizon-blend":{type:"number","property-type":"data-constant",default:.8,minimum:0,maximum:1,expression:{interpolated:!0,parameters:["zoom"]},transition:!0},"atmosphere-blend":{type:"number","property-type":"data-constant",default:.8,minimum:0,maximum:1,expression:{interpolated:!0,parameters:["zoom"]},transition:!0}},terrain:{source:{type:"string",required:!0},exaggeration:{type:"number",minimum:0,default:1}},projection:{type:{type:"enum",default:"mercator",values:{mercator:{},globe:{}}}},paint:["paint_fill","paint_line","paint_circle","paint_heatmap","paint_fill-extrusion","paint_symbol","paint_raster","paint_hillshade","paint_background"],paint_fill:{"fill-antialias":{type:"boolean",default:!0,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"fill-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"fill-pattern"}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-outline-color":{type:"color",transition:!0,requires:[{"!":"fill-pattern"},{"fill-antialias":!0}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"fill-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["fill-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"fill-pattern":{type:"resolvedImage",transition:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"cross-faded-data-driven"}},"paint_fill-extrusion":{"fill-extrusion-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"fill-extrusion-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"fill-extrusion-pattern"}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"fill-extrusion-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["fill-extrusion-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"fill-extrusion-pattern":{type:"resolvedImage",transition:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"cross-faded-data-driven"},"fill-extrusion-height":{type:"number",default:0,minimum:0,units:"meters",transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-base":{type:"number",default:0,minimum:0,units:"meters",transition:!0,requires:["fill-extrusion-height"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-vertical-gradient":{type:"boolean",default:!0,transition:!1,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"}},paint_line:{"line-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"line-pattern"}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"line-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["line-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"line-width":{type:"number",default:1,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-gap-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-offset":{type:"number",default:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-blur":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-dasharray":{type:"array",value:"number",minimum:0,transition:!0,units:"line widths",requires:[{"!":"line-pattern"}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"cross-faded"},"line-pattern":{type:"resolvedImage",transition:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"cross-faded-data-driven"},"line-gradient":{type:"color",transition:!1,requires:[{"!":"line-dasharray"},{"!":"line-pattern"},{source:"geojson",has:{lineMetrics:!0}}],expression:{interpolated:!0,parameters:["line-progress"]},"property-type":"color-ramp"}},paint_circle:{"circle-radius":{type:"number",default:5,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-color":{type:"color",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-blur":{type:"number",default:0,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"circle-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["circle-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"circle-pitch-scale":{type:"enum",values:{map:{},viewport:{}},default:"map",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"circle-pitch-alignment":{type:"enum",values:{map:{},viewport:{}},default:"viewport",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"circle-stroke-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-stroke-color":{type:"color",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-stroke-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"}},paint_heatmap:{"heatmap-radius":{type:"number",default:30,minimum:1,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"heatmap-weight":{type:"number",default:1,minimum:0,transition:!1,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"heatmap-intensity":{type:"number",default:1,minimum:0,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"heatmap-color":{type:"color",default:["interpolate",["linear"],["heatmap-density"],0,"rgba(0, 0, 255, 0)",.1,"royalblue",.3,"cyan",.5,"lime",.7,"yellow",1,"red"],transition:!1,expression:{interpolated:!0,parameters:["heatmap-density"]},"property-type":"color-ramp"},"heatmap-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},paint_symbol:{"icon-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-color":{type:"color",default:"#000000",transition:!0,requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-halo-color":{type:"color",default:"rgba(0, 0, 0, 0)",transition:!0,requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-halo-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-halo-blur":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"icon-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["icon-image","icon-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-color":{type:"color",default:"#000000",transition:!0,overridable:!0,requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-halo-color":{type:"color",default:"rgba(0, 0, 0, 0)",transition:!0,requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-halo-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-halo-blur":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["text-field","text-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"}},paint_raster:{"raster-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-hue-rotate":{type:"number",default:0,period:360,transition:!0,units:"degrees",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-brightness-min":{type:"number",default:0,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-brightness-max":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-saturation":{type:"number",default:0,minimum:-1,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-contrast":{type:"number",default:0,minimum:-1,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-resampling":{type:"enum",values:{linear:{},nearest:{}},default:"linear",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"raster-fade-duration":{type:"number",default:300,minimum:0,transition:!1,units:"milliseconds",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},paint_hillshade:{"hillshade-illumination-direction":{type:"number",default:335,minimum:0,maximum:359,transition:!1,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-illumination-anchor":{type:"enum",values:{map:{},viewport:{}},default:"viewport",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-exaggeration":{type:"number",default:.5,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-shadow-color":{type:"color",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-highlight-color":{type:"color",default:"#FFFFFF",transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-accent-color":{type:"color",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},paint_background:{"background-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"background-pattern"}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"background-pattern":{type:"resolvedImage",transition:!0,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"cross-faded"},"background-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},transition:{duration:{type:"number",default:300,minimum:0,units:"milliseconds"},delay:{type:"number",default:0,minimum:0,units:"milliseconds"}},"property-type":{"data-driven":{type:"property-type"},"cross-faded":{type:"property-type"},"cross-faded-data-driven":{type:"property-type"},"color-ramp":{type:"property-type"},"data-constant":{type:"property-type"},constant:{type:"property-type"}},promoteId:{"*":{type:"string"}}};const Z=["type","source","source-layer","minzoom","maxzoom","filter","layout"];function W(t,e){const i={};for(const r in t)"ref"!==r&&(i[r]=t[r]);return Z.forEach((t=>{t in e&&(i[t]=e[t])})),i}function X(t,e){if(Array.isArray(t)){if(!Array.isArray(e)||t.length!==e.length)return!1;for(let i=0;i<t.length;i++)if(!X(t[i],e[i]))return!1;return!0}if("object"==typeof t&&null!==t&&null!==e){if("object"!=typeof e)return!1;if(Object.keys(t).length!==Object.keys(e).length)return!1;for(const i in t)if(!X(t[i],e[i]))return!1;return!0}return t===e}function J(t,e){t.push(e)}function K(t,e,i){J(i,{command:"addSource",args:[t,e[t]]})}function Y(t,e,i){J(e,{command:"removeSource",args:[t]}),i[t]=!0}function Q(t,e,i,r){Y(t,i,r),K(t,e,i)}function tt(t,e,i){let r;for(r in t[i])if(Object.prototype.hasOwnProperty.call(t[i],r)&&"data"!==r&&!X(t[i][r],e[i][r]))return!1;for(r in e[i])if(Object.prototype.hasOwnProperty.call(e[i],r)&&"data"!==r&&!X(t[i][r],e[i][r]))return!1;return!0}function et(t,e,i,r,n,o){t=t||{},e=e||{};for(const a in t)Object.prototype.hasOwnProperty.call(t,a)&&(X(t[a],e[a])||i.push({command:o,args:[r,a,e[a],n]}));for(const a in e)Object.prototype.hasOwnProperty.call(e,a)&&!Object.prototype.hasOwnProperty.call(t,a)&&(X(t[a],e[a])||i.push({command:o,args:[r,a,e[a],n]}))}function it(t){return t.id}function rt(t,e){return t[e.id]=e,t}class nt{constructor(t,e,i,r){this.message=(t?`${t}: `:"")+i,r&&(this.identifier=r),null!=e&&e.__line__&&(this.line=e.__line__)}}function ot(t,...e){for(const i of e)for(const e in i)t[e]=i[e];return t}class at extends Error{constructor(t,e){super(e),this.message=e,this.key=t}}class st{constructor(t,e=[]){this.parent=t,this.bindings={};for(const[i,r]of e)this.bindings[i]=r}concat(t){return new st(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 lt={kind:"null"},ct={kind:"number"},ut={kind:"string"},ht={kind:"boolean"},dt={kind:"color"},pt={kind:"object"},ft={kind:"value"},mt={kind:"collator"},gt={kind:"formatted"},yt={kind:"padding"},_t={kind:"resolvedImage"},vt={kind:"variableAnchorOffsetCollection"};function bt(t,e){return{kind:"array",itemType:t,N:e}}function xt(t){if("array"===t.kind){const e=xt(t.itemType);return"number"==typeof t.N?`array<${e}, ${t.N}>`:"value"===t.itemType.kind?"array":`array<${e}>`}return t.kind}const wt=[lt,ct,ut,ht,dt,gt,pt,bt(ft),yt,_t,vt];function kt(t,e){if("error"===e.kind)return null;if("array"===t.kind){if("array"===e.kind&&(0===e.N&&"value"===e.itemType.kind||!kt(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 wt)if(!kt(t,e))return null}return`Expected ${xt(t)} but found ${xt(e)} instead.`}function Et(t,e){return e.some((e=>e.kind===t.kind))}function St(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))}function It(t,e){return"array"===t.kind&&"array"===e.kind?t.itemType.kind===e.itemType.kind&&"number"==typeof t.N:t.kind===e.kind}const Ct=.96422,Tt=.82521,At=4/29,Pt=6/29,Mt=3*Pt*Pt,Lt=Pt*Pt*Pt,zt=Math.PI/180,Dt=180/Math.PI;function Rt(t){return(t%=360)<0&&(t+=360),t}function Ot([t,e,i,r]){let n,o;const a=Bt((.2225045*(t=Ft(t))+.7168786*(e=Ft(e))+.0606169*(i=Ft(i)))/1);t===e&&e===i?n=o=a:(n=Bt((.4360747*t+.3850649*e+.1430804*i)/Ct),o=Bt((.0139322*t+.0971045*e+.7141733*i)/Tt));const s=116*a-16;return[s<0?0:s,500*(n-a),200*(a-o),r]}function Ft(t){return t<=.04045?t/12.92:Math.pow((t+.055)/1.055,2.4)}function Bt(t){return t>Lt?Math.pow(t,1/3):t/Mt+At}function Nt([t,e,i,r]){let n=(t+16)/116,o=isNaN(e)?n:n+e/500,a=isNaN(i)?n:n-i/200;return n=1*Vt(n),o=Ct*Vt(o),a=Tt*Vt(a),[jt(3.1338561*o-1.6168667*n-.4906146*a),jt(-.9787684*o+1.9161415*n+.033454*a),jt(.0719453*o-.2289914*n+1.4052427*a),r]}function jt(t){return(t=t<=.00304?12.92*t:1.055*Math.pow(t,1/2.4)-.055)<0?0:t>1?1:t}function Vt(t){return t>Pt?t*t*t:Mt*(t-At)}function Ut(t){return parseInt(t.padEnd(2,t),16)/255}function qt(t,e){return $t(e?t/100:t,0,1)}function $t(t,e,i){return Math.min(Math.max(e,t),i)}function Gt(t){return!t.some(Number.isNaN)}const Ht={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]};class Zt{constructor(t,e,i,r=1,n=!0){this.r=t,this.g=e,this.b=i,this.a=r,n||(this.r*=r,this.g*=r,this.b*=r,r||this.overwriteGetter("rgb",[t,e,i,r]))}static parse(t){if(t instanceof Zt)return t;if("string"!=typeof t)return;const e=function(t){if("transparent"===(t=t.toLowerCase().trim()))return[0,0,0,0];const e=Ht[t];if(e){const[t,i,r]=e;return[t/255,i/255,r/255,1]}if(t.startsWith("#")&&/^#(?:[0-9a-f]{3,4}|[0-9a-f]{6}|[0-9a-f]{8})$/.test(t)){const e=t.length<6?1:2;let i=1;return[Ut(t.slice(i,i+=e)),Ut(t.slice(i,i+=e)),Ut(t.slice(i,i+=e)),Ut(t.slice(i,i+e)||"ff")]}if(t.startsWith("rgb")){const e=t.match(/^rgba?\(\s*([\de.+-]+)(%)?(?:\s+|\s*(,)\s*)([\de.+-]+)(%)?(?:\s+|\s*(,)\s*)([\de.+-]+)(%)?(?:\s*([,\/])\s*([\de.+-]+)(%)?)?\s*\)$/);if(e){const[t,i,r,n,o,a,s,l,c,u,h,d]=e,p=[n||" ",s||" ",u].join("");if(" "===p||" /"===p||",,"===p||",,,"===p){const t=[r,a,c].join(""),e="%%%"===t?100:""===t?255:0;if(e){const t=[$t(+i/e,0,1),$t(+o/e,0,1),$t(+l/e,0,1),h?qt(+h,d):1];if(Gt(t))return t}}return}}const i=t.match(/^hsla?\(\s*([\de.+-]+)(?:deg)?(?:\s+|\s*(,)\s*)([\de.+-]+)%(?:\s+|\s*(,)\s*)([\de.+-]+)%(?:\s*([,\/])\s*([\de.+-]+)(%)?)?\s*\)$/);if(i){const[t,e,r,n,o,a,s,l,c]=i,u=[r||" ",o||" ",s].join("");if(" "===u||" /"===u||",,"===u||",,,"===u){const t=[+e,$t(+n,0,100),$t(+a,0,100),l?qt(+l,c):1];if(Gt(t))return function([t,e,i,r]){function n(r){const n=(r+t/30)%12,o=e*Math.min(i,1-i);return i-o*Math.max(-1,Math.min(n-3,9-n,1))}return t=Rt(t),e/=100,i/=100,[n(0),n(8),n(4),r]}(t)}}}(t);return e?new Zt(...e,!1):void 0}get rgb(){const{r:t,g:e,b:i,a:r}=this,n=r||1/0;return this.overwriteGetter("rgb",[t/n,e/n,i/n,r])}get hcl(){return this.overwriteGetter("hcl",function(t){const[e,i,r,n]=Ot(t),o=Math.sqrt(i*i+r*r);return[Math.round(1e4*o)?Rt(Math.atan2(r,i)*Dt):NaN,o,e,n]}(this.rgb))}get lab(){return this.overwriteGetter("lab",Ot(this.rgb))}overwriteGetter(t,e){return Object.defineProperty(this,t,{value:e}),e}toString(){const[t,e,i,r]=this.rgb;return`rgba(${[t,e,i].map((t=>Math.round(255*t))).join(",")},${r})`}}Zt.black=new Zt(0,0,0,1),Zt.white=new Zt(1,1,1,1),Zt.transparent=new Zt(0,0,0,0),Zt.red=new Zt(1,0,0,1);class Wt{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 Xt{constructor(t,e,i,r,n){this.text=t,this.image=e,this.scale=i,this.fontStack=r,this.textColor=n}}class Jt{constructor(t){this.sections=t}static fromString(t){return new Jt([new Xt(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 Jt?t:Jt.fromString(t)}toString(){return 0===this.sections.length?"":this.sections.map((t=>t.text)).join("")}}class Kt{constructor(t){this.values=t.slice()}static parse(t){if(t instanceof Kt)return t;if("number"==typeof t)return new Kt([t,t,t,t]);if(Array.isArray(t)&&!(t.length<1||t.length>4)){for(const e of t)if("number"!=typeof e)return;switch(t.length){case 1:t=[t[0],t[0],t[0],t[0]];break;case 2:t=[t[0],t[1],t[0],t[1]];break;case 3:t=[t[0],t[1],t[2],t[1]]}return new Kt(t)}}toString(){return JSON.stringify(this.values)}}const Yt=new Set(["center","left","right","top","bottom","top-left","top-right","bottom-left","bottom-right"]);class Qt{constructor(t){this.values=t.slice()}static parse(t){if(t instanceof Qt)return t;if(Array.isArray(t)&&!(t.length<1)&&t.length%2==0){for(let e=0;e<t.length;e+=2){const i=t[e],r=t[e+1];if("string"!=typeof i||!Yt.has(i))return;if(!Array.isArray(r)||2!==r.length||"number"!=typeof r[0]||"number"!=typeof r[1])return}return new Qt(t)}}toString(){return JSON.stringify(this.values)}}class te{constructor(t){this.name=t.name,this.available=t.available}toString(){return this.name}static fromString(t){return t?new te({name:t,available:!1}):null}}function ee(t,e,i,r){return"number"==typeof t&&t>=0&&t<=255&&"number"==typeof e&&e>=0&&e<=255&&"number"==typeof i&&i>=0&&i<=255?void 0===r||"number"==typeof r&&r>=0&&r<=1?null:`Invalid rgba value [${[t,e,i,r].join(", ")}]: 'a' must be between 0 and 1.`:`Invalid rgba value [${("number"==typeof r?[t,e,i,r]:[t,e,i]).join(", ")}]: 'r', 'g', and 'b' must be between 0 and 255.`}function ie(t){if(null===t||"string"==typeof t||"boolean"==typeof t||"number"==typeof t||t instanceof Zt||t instanceof Wt||t instanceof Jt||t instanceof Kt||t instanceof Qt||t instanceof te)return!0;if(Array.isArray(t)){for(const e of t)if(!ie(e))return!1;return!0}if("object"==typeof t){for(const e in t)if(!ie(t[e]))return!1;return!0}return!1}function re(t){if(null===t)return lt;if("string"==typeof t)return ut;if("boolean"==typeof t)return ht;if("number"==typeof t)return ct;if(t instanceof Zt)return dt;if(t instanceof Wt)return mt;if(t instanceof Jt)return gt;if(t instanceof Kt)return yt;if(t instanceof Qt)return vt;if(t instanceof te)return _t;if(Array.isArray(t)){const e=t.length;let i;for(const r of t){const t=re(r);if(i){if(i===t)continue;i=ft;break}i=t}return bt(i||ft,e)}return pt}function ne(t){const e=typeof t;return null===t?"":"string"===e||"number"===e||"boolean"===e?String(t):t instanceof Zt||t instanceof Jt||t instanceof Kt||t instanceof Qt||t instanceof te?t.toString():JSON.stringify(t)}class oe{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(!ie(t[1]))return e.error("invalid value");const i=t[1];let r=re(i);const n=e.expectedType;return"array"!==r.kind||0!==r.N||!n||"array"!==n.kind||"number"==typeof n.N&&0!==n.N||(r=n),new oe(r,i)}evaluate(){return this.value}eachChild(){}outputDefined(){return!0}}class ae{constructor(t){this.name="ExpressionEvaluationError",this.message=t}toJSON(){return this.message}}const se={string:ut,number:ct,boolean:ht,object:pt};class le{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,r=1;const n=t[0];if("array"===n){let n,o;if(t.length>2){const i=t[1];if("string"!=typeof i||!(i in se)||"object"===i)return e.error('The item type argument of "array" must be one of string, number, boolean',1);n=se[i],r++}else n=ft;if(t.length>3){if(null!==t[2]&&("number"!=typeof t[2]||t[2]<0||t[2]!==Math.floor(t[2])))return e.error('The length argument to "array" must be a positive integer literal',2);o=t[2],r++}i=bt(n,o)}else{if(!se[n])throw new Error(`Types doesn't contain name = ${n}`);i=se[n]}const o=[];for(;r<t.length;r++){const i=e.parse(t[r],r,ft);if(!i)return null;o.push(i)}return new le(i,o)}evaluate(t){for(let e=0;e<this.args.length;e++){const i=this.args[e].evaluate(t);if(!kt(this.type,re(i)))return i;if(e===this.args.length-1)throw new ae(`Expected value to be of type ${xt(this.type)}, but found ${xt(re(i))} instead.`)}throw new Error}eachChild(t){this.args.forEach(t)}outputDefined(){return this.args.every((t=>t.outputDefined()))}}const ce={"to-boolean":ht,"to-color":dt,"to-number":ct,"to-string":ut};class ue{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(!ce[i])throw new Error(`Can't parse ${i} as it is not part of the known types`);if(("to-boolean"===i||"to-string"===i)&&2!==t.length)return e.error("Expected one argument.");const r=ce[i],n=[];for(let o=1;o<t.length;o++){const i=e.parse(t[o],o,ft);if(!i)return null;n.push(i)}return new ue(r,n)}evaluate(t){switch(this.type.kind){case"boolean":return Boolean(this.args[0].evaluate(t));case"color":{let e,i;for(const r of this.args){if(e=r.evaluate(t),i=null,e instanceof Zt)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.`:ee(e[0],e[1],e[2],e[3]),!i))return new Zt(e[0]/255,e[1]/255,e[2]/255,e[3])}throw new ae(i||`Could not parse color from value '${"string"==typeof e?e:JSON.stringify(e)}'`)}case"padding":{let e;for(const i of this.args){e=i.evaluate(t);const r=Kt.parse(e);if(r)return r}throw new ae(`Could not parse padding from value '${"string"==typeof e?e:JSON.stringify(e)}'`)}case"variableAnchorOffsetCollection":{let e;for(const i of this.args){e=i.evaluate(t);const r=Qt.parse(e);if(r)return r}throw new ae(`Could not parse variableAnchorOffsetCollection from value '${"string"==typeof e?e:JSON.stringify(e)}'`)}case"number":{let e=null;for(const i of this.args){if(e=i.evaluate(t),null===e)return 0;const r=Number(e);if(!isNaN(r))return r}throw new ae(`Could not convert ${JSON.stringify(e)} to number.`)}case"formatted":return Jt.fromString(ne(this.args[0].evaluate(t)));case"resolvedImage":return te.fromString(ne(this.args[0].evaluate(t)));default:return ne(this.args[0].evaluate(t))}}eachChild(t){this.args.forEach(t)}outputDefined(){return this.args.every((t=>t.outputDefined()))}}const he=["Unknown","Point","LineString","Polygon"];class de{constructor(){this.globals=null,this.feature=null,this.featureState=null,this.formattedSection=null,this._parseColorCache={},this.availableImages=null,this.canonical=null}id(){return this.feature&&"id"in this.feature?this.feature.id:null}geometryType(){return this.feature?"number"==typeof this.feature.type?he[this.feature.type]:this.feature.type:null}geometry(){return this.feature&&"geometry"in this.feature?this.feature.geometry:null}canonicalID(){return this.canonical}properties(){return this.feature&&this.feature.properties||{}}parseColor(t){let e=this._parseColorCache[t];return e||(e=this._parseColorCache[t]=Zt.parse(t)),e}}class pe{constructor(t,e,i=[],r,n=new st,o=[]){this.registry=t,this.path=i,this.key=i.map((t=>`[${t}]`)).join(""),this.scope=n,this.errors=o,this.expectedType=r,this._isConstant=e}parse(t,e,i,r,n={}){return e?this.concat(e,i,r)._parse(t,n):this._parse(t,n)}_parse(t,e){function i(t,e,i){return"assert"===i?new le(e,[t]):"coerce"===i?new ue(e,[t]):t}if(null!==t&&"string"!=typeof t&&"boolean"!=typeof t&&"number"!=typeof t||(t=["literal",t]),Array.isArray(t)){if(0===t.length)return this.error('Expected an array with at least one element. If you wanted a literal array, use ["literal", []].');const r=t[0];if("string"!=typeof r)return this.error(`Expression name must be a string, but found ${typeof r} instead. If you wanted a literal array, use ["literal", [...]].`,0),null;const n=this.registry[r];if(n){let r=n.parse(t,this);if(!r)return null;if(this.expectedType){const t=this.expectedType,n=r.type;if("string"!==t.kind&&"number"!==t.kind&&"boolean"!==t.kind&&"object"!==t.kind&&"array"!==t.kind||"value"!==n.kind)if("color"!==t.kind&&"formatted"!==t.kind&&"resolvedImage"!==t.kind||"value"!==n.kind&&"string"!==n.kind)if("padding"!==t.kind||"value"!==n.kind&&"number"!==n.kind&&"array"!==n.kind)if("variableAnchorOffsetCollection"!==t.kind||"value"!==n.kind&&"array"!==n.kind){if(this.checkSubtype(t,n))return null}else r=i(r,t,e.typeAnnotation||"coerce");else r=i(r,t,e.typeAnnotation||"coerce");else r=i(r,t,e.typeAnnotation||"coerce");else r=i(r,t,e.typeAnnotation||"assert")}if(!(r instanceof oe)&&"resolvedImage"!==r.type.kind&&this._isConstant(r)){const e=new de;try{r=new oe(r.type,r.evaluate(e))}catch(t){return this.error(t.message),null}}return r}return this.error(`Unknown expression "${r}". If you wanted a literal array, use ["literal", [...]].`,0)}return this.error(void 0===t?"'undefined' value invalid. Use null instead.":"object"==typeof t?'Bare objects invalid. Use ["literal", {...}] instead.':`Expected an array, but found ${typeof t} instead.`)}concat(t,e,i){const r="number"==typeof t?this.path.concat(t):this.path,n=i?this.scope.concat(i):this.scope;return new pe(this.registry,this._isConstant,r,e||null,n,this.errors)}error(t,...e){const i=`${this.key}${e.map((t=>`[${t}]`)).join("")}`;this.errors.push(new at(i,t))}checkSubtype(t,e){const i=kt(t,e);return i&&this.error(i),i}}class fe{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 r=t[n];if("string"!=typeof r)return e.error(`Expected string, but found ${typeof r} instead.`,n);if(/[^a-zA-Z0-9_]/.test(r))return e.error("Variable names must contain only alphanumeric characters or '_'.",n);const o=e.parse(t[n+1],n+1);if(!o)return null;i.push([r,o])}const r=e.parse(t[t.length-1],t.length-1,e.expectedType,i);return r?new fe(i,r):null}outputDefined(){return this.result.outputDefined()}}class me{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 me(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}}class ge{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,ct),r=e.parse(t[2],2,bt(e.expectedType||ft));return i&&r?new ge(r.type.itemType,i,r):null}evaluate(t){const e=this.index.evaluate(t),i=this.input.evaluate(t);if(e<0)throw new ae(`Array index out of bounds: ${e} < 0.`);if(e>=i.length)throw new ae(`Array index out of bounds: ${e} > ${i.length-1}.`);if(e!==Math.floor(e))throw new ae(`Array index must be an integer, but found ${e} instead.`);return i[e]}eachChild(t){t(this.index),t(this.input)}outputDefined(){return!1}}class ye{constructor(t,e){this.type=ht,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,ft),r=e.parse(t[2],2,ft);return i&&r?Et(i.type,[ht,ut,ct,lt,ft])?new ye(i,r):e.error(`Expected first argument to be of type boolean, string, number or null, but found ${xt(i.type)} instead`):null}evaluate(t){const e=this.needle.evaluate(t),i=this.haystack.evaluate(t);if(!i)return!1;if(!St(e,["boolean","string","number","null"]))throw new ae(`Expected first argument to be of type boolean, string, number or null, but found ${xt(re(e))} instead.`);if(!St(i,["string","array"]))throw new ae(`Expected second argument to be of type array or string, but found ${xt(re(i))} instead.`);return i.indexOf(e)>=0}eachChild(t){t(this.needle),t(this.haystack)}outputDefined(){return!0}}class _e{constructor(t,e,i){this.type=ct,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,ft),r=e.parse(t[2],2,ft);if(!i||!r)return null;if(!Et(i.type,[ht,ut,ct,lt,ft]))return e.error(`Expected first argument to be of type boolean, string, number or null, but found ${xt(i.type)} instead`);if(4===t.length){const n=e.parse(t[3],3,ct);return n?new _e(i,r,n):null}return new _e(i,r)}evaluate(t){const e=this.needle.evaluate(t),i=this.haystack.evaluate(t);if(!St(e,["boolean","string","number","null"]))throw new ae(`Expected first argument to be of type boolean, string, number or null, but found ${xt(re(e))} instead.`);let r;if(this.fromIndex&&(r=this.fromIndex.evaluate(t)),St(i,["string"])){const t=i.indexOf(e,r);return-1===t?-1:[...i.slice(0,t)].length}if(St(i,["array"]))return i.indexOf(e,r);throw new ae(`Expected second argument to be of type array or string, but found ${xt(re(i))} instead.`)}eachChild(t){t(this.needle),t(this.haystack),this.fromIndex&&t(this.fromIndex)}outputDefined(){return!1}}class ve{constructor(t,e,i,r,n,o){this.inputType=t,this.type=e,this.input=i,this.cases=r,this.outputs=n,this.otherwise=o}static parse(t,e){if(t.length<5)return e.error(`Expected at least 4 arguments, but found only ${t.length-1}.`);if(t.length%2!=1)return e.error("Expected an even number of arguments.");let i,r;e.expectedType&&"value"!==e.expectedType.kind&&(r=e.expectedType);const n={},o=[];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 c=e.concat(l);if(0===a.length)return c.error("Expected at least one branch label.");for(const t of a){if("number"!=typeof t&&"string"!=typeof t)return c.error("Branch labels must be numbers or strings.");if("number"==typeof t&&Math.abs(t)>Number.MAX_SAFE_INTEGER)return c.error(`Branch labels must be integers no larger than ${Number.MAX_SAFE_INTEGER}.`);if("number"==typeof t&&Math.floor(t)!==t)return c.error("Numeric branch labels must be integer values.");if(i){if(c.checkSubtype(i,re(t)))return null}else i=re(t);if(void 0!==n[String(t)])return c.error("Branch labels must be unique.");n[String(t)]=o.length}const u=e.parse(s,l,r);if(!u)return null;r=r||u.type,o.push(u)}const a=e.parse(t[1],1,ft);if(!a)return null;const s=e.parse(t[t.length-1],t.length-1,r);return s?"value"!==a.type.kind&&e.concat(1).checkSubtype(i,a.type)?null:new ve(i,r,a,n,o,s):null}evaluate(t){const e=this.input.evaluate(t);return(re(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()}}class be{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 r=[];for(let o=1;o<t.length-1;o+=2){const n=e.parse(t[o],o,ht);if(!n)return null;const a=e.parse(t[o+1],o+1,i);if(!a)return null;r.push([n,a]),i=i||a.type}const n=e.parse(t[t.length-1],t.length-1,i);if(!n)return null;if(!i)throw new Error("Can't infer output type");return new be(i,r,n)}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()}}class xe{constructor(t,e,i,r){this.type=t,this.input=e,this.beginIndex=i,this.endIndex=r}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,ft),r=e.parse(t[2],2,ct);if(!i||!r)return null;if(!Et(i.type,[bt(ft),ut,ft]))return e.error(`Expected first argument to be of type array or string, but found ${xt(i.type)} instead`);if(4===t.length){const n=e.parse(t[3],3,ct);return n?new xe(i.type,i,r,n):null}return new xe(i.type,i,r)}evaluate(t){const e=this.input.evaluate(t),i=this.beginIndex.evaluate(t);let r;if(this.endIndex&&(r=this.endIndex.evaluate(t)),St(e,["string"]))return[...e].slice(i,r).join("");if(St(e,["array"]))return e.slice(i,r);throw new ae(`Expected first argument to be of type array or string, but found ${xt(re(e))} instead.`)}eachChild(t){t(this.input),t(this.beginIndex),this.endIndex&&t(this.endIndex)}outputDefined(){return!1}}function we(t,e){const i=t.length-1;let r,n,o=0,a=i,s=0;for(;o<=a;)if(s=Math.floor((o+a)/2),r=t[s],n=t[s+1],r<=e){if(s===i||e<n)return s;o=s+1}else{if(!(r>e))throw new ae("Input is not a number.");a=s-1}return 0}class ke{constructor(t,e,i){this.type=t,this.input=e,this.labels=[],this.outputs=[];for(const[r,n]of i)this.labels.push(r),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,ct);if(!i)return null;const r=[];let n=null;e.expectedType&&"value"!==e.expectedType.kind&&(n=e.expectedType);for(let o=1;o<t.length;o+=2){const i=1===o?-1/0:t[o],a=t[o+1],s=o,l=o+1;if("number"!=typeof i)return e.error('Input/output pairs for "step" expressions must be defined using literal numeric values (not computed expressions) for the input values.',s);if(r.length&&r[r.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 c=e.parse(a,l,n);if(!c)return null;n=n||c.type,r.push([i,c])}return new ke(n,i,r)}evaluate(t){const e=this.labels,i=this.outputs;if(1===e.length)return i[0].evaluate(t);const r=this.input.evaluate(t);if(r<=e[0])return i[0].evaluate(t);const n=e.length;return r>=e[n-1]?i[n-1].evaluate(t):i[we(e,r)].evaluate(t)}eachChild(t){t(this.input);for(const e of this.outputs)t(e)}outputDefined(){return this.outputs.every((t=>t.outputDefined()))}}function Ee(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var Se=Ie;function Ie(t,e,i,r){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*(r-e)-this.cy,this.ay=1-this.cy-this.by,this.p1x=t,this.p1y=e,this.p2x=i,this.p2y=r}Ie.prototype={sampleCurveX:function(t){return((this.ax*t+this.bx)*t+this.cx)*t},sampleCurveY:function(t){return((this.ay*t+this.by)*t+this.cy)*t},sampleCurveDerivativeX:function(t){return(3*this.ax*t+2*this.bx)*t+this.cx},solveCurveX:function(t,e){if(void 0===e&&(e=1e-6),t<0)return 0;if(t>1)return 1;for(var i=t,r=0;r<8;r++){var n=this.sampleCurveX(i)-t;if(Math.abs(n)<e)return i;var o=this.sampleCurveDerivativeX(i);if(Math.abs(o)<1e-6)break;i-=n/o}var a=0,s=1;for(i=t,r=0;r<20&&(n=this.sampleCurveX(i),!(Math.abs(n-t)<e));r++)t>n?a=i:s=i,i=.5*(s-a)+a;return i},solve:function(t,e){return this.sampleCurveY(this.solveCurveX(t,e))}};var Ce=Ee(Se);function Te(t,e,i){return t+i*(e-t)}function Ae(t,e,i){return t.map(((t,r)=>Te(t,e[r],i)))}const Pe={number:Te,color:function(t,e,i,r="rgb"){switch(r){case"rgb":{const[r,n,o,a]=Ae(t.rgb,e.rgb,i);return new Zt(r,n,o,a,!1)}case"hcl":{const[r,n,o,a]=t.hcl,[s,l,c,u]=e.hcl;let h,d;if(isNaN(r)||isNaN(s))isNaN(r)?isNaN(s)?h=NaN:(h=s,1!==o&&0!==o||(d=l)):(h=r,1!==c&&0!==c||(d=n));else{let t=s-r;s>r&&t>180?t-=360:s<r&&r-s>180&&(t+=360),h=r+i*t}const[p,f,m,g]=function([t,e,i,r]){return t=isNaN(t)?0:t*zt,Nt([i,Math.cos(t)*e,Math.sin(t)*e,r])}([h,null!=d?d:Te(n,l,i),Te(o,c,i),Te(a,u,i)]);return new Zt(p,f,m,g,!1)}case"lab":{const[r,n,o,a]=Nt(Ae(t.lab,e.lab,i));return new Zt(r,n,o,a,!1)}}},array:Ae,padding:function(t,e,i){return new Kt(Ae(t.values,e.values,i))},variableAnchorOffsetCollection:function(t,e,i){const r=t.values,n=e.values;if(r.length!==n.length)throw new ae(`Cannot interpolate values of different length. from: ${t.toString()}, to: ${e.toString()}`);const o=[];for(let a=0;a<r.length;a+=2){if(r[a]!==n[a])throw new ae(`Cannot interpolate values containing mismatched anchors. from[${a}]: ${r[a]}, to[${a}]: ${n[a]}`);o.push(r[a]);const[t,e]=r[a+1],[s,l]=n[a+1];o.push([Te(t,s,i),Te(e,l,i)])}return new Qt(o)}};class Me{constructor(t,e,i,r,n){this.type=t,this.operator=e,this.interpolation=i,this.input=r,this.labels=[],this.outputs=[];for(const[o,a]of n)this.labels.push(o),this.outputs.push(a)}static interpolationFactor(t,e,i,r){let n=0;if("exponential"===t.name)n=Le(e,t.base,i,r);else if("linear"===t.name)n=Le(e,1,i,r);else if("cubic-bezier"===t.name){const o=t.controlPoints;n=new Ce(o[0],o[1],o[2],o[3]).solve(Le(e,1,i,r))}return n}static parse(t,e){let[i,r,n,...o]=t;if(!Array.isArray(r)||0===r.length)return e.error("Expected an interpolation type expression.",1);if("linear"===r[0])r={name:"linear"};else if("exponential"===r[0]){const t=r[1];if("number"!=typeof t)return e.error("Exponential interpolation requires a numeric base.",1,1);r={name:"exponential",base:t}}else{if("cubic-bezier"!==r[0])return e.error(`Unknown interpolation type ${String(r[0])}`,1,0);{const t=r.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);r={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,ct),!n)return null;const a=[];let s=null;"interpolate-hcl"===i||"interpolate-lab"===i?s=dt:e.expectedType&&"value"!==e.expectedType.kind&&(s=e.expectedType);for(let l=0;l<o.length;l+=2){const t=o[l],i=o[l+1],r=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.',r);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.',r);const c=e.parse(i,n,s);if(!c)return null;s=s||c.type,a.push([t,c])}return It(s,ct)||It(s,dt)||It(s,yt)||It(s,vt)||It(s,bt(ct))?new Me(s,i,r,n,a):e.error(`Type ${xt(s)} is not interpolatable.`)}evaluate(t){const e=this.labels,i=this.outputs;if(1===e.length)return i[0].evaluate(t);const r=this.input.evaluate(t);if(r<=e[0])return i[0].evaluate(t);const n=e.length;if(r>=e[n-1])return i[n-1].evaluate(t);const o=we(e,r),a=Me.interpolationFactor(this.interpolation,r,e[o],e[o+1]),s=i[o].evaluate(t),l=i[o+1].evaluate(t);switch(this.operator){case"interpolate":return Pe[this.type.kind](s,l,a);case"interpolate-hcl":return Pe.color(s,l,a,"hcl");case"interpolate-lab":return Pe.color(s,l,a,"lab")}}eachChild(t){t(this.input);for(const e of this.outputs)t(e)}outputDefined(){return this.outputs.every((t=>t.outputDefined()))}}function Le(t,e,i,r){const n=r-i,o=t-i;return 0===n?0:1===e?o/n:(Math.pow(e,o)-1)/(Math.pow(e,n)-1)}class ze{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 r=e.expectedType;r&&"value"!==r.kind&&(i=r);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)}if(!i)throw new Error("No output type");const o=r&&n.some((t=>kt(r,t.type)));return new ze(o?ft:i,n)}evaluate(t){let e,i=null,r=0;for(const n of this.args)if(r++,i=n.evaluate(t),i&&i instanceof te&&!i.available&&(e||(e=i.name),i=null,r===this.args.length&&(i=e)),null!==i)break;return i}eachChild(t){this.args.forEach(t)}outputDefined(){return this.args.every((t=>t.outputDefined()))}}function De(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 Re(t,e,i,r){return 0===r.compare(e,i)}function Oe(t,e,i){const r="=="!==t&&"!="!==t;return class n{constructor(t,e,i){this.type=ht,this.lhs=t,this.rhs=e,this.collator=i,this.hasUntypedArgument="value"===t.type.kind||"value"===e.type.kind}static parse(t,e){if(3!==t.length&&4!==t.length)return e.error("Expected two or three arguments.");const i=t[0];let o=e.parse(t[1],1,ft);if(!o)return null;if(!De(i,o.type))return e.concat(1).error(`"${i}" comparisons are not supported for type '${xt(o.type)}'.`);let a=e.parse(t[2],2,ft);if(!a)return null;if(!De(i,a.type))return e.concat(2).error(`"${i}" comparisons are not supported for type '${xt(a.type)}'.`);if(o.type.kind!==a.type.kind&&"value"!==o.type.kind&&"value"!==a.type.kind)return e.error(`Cannot compare types '${xt(o.type)}' and '${xt(a.type)}'.`);r&&("value"===o.type.kind&&"value"!==a.type.kind?o=new le(a.type,[o]):"value"!==o.type.kind&&"value"===a.type.kind&&(a=new le(o.type,[a])));let s=null;if(4===t.length){if("string"!==o.type.kind&&"string"!==a.type.kind&&"value"!==o.type.kind&&"value"!==a.type.kind)return e.error("Cannot use collator to compare non-string types.");if(s=e.parse(t[3],3,mt),!s)return null}return new n(o,a,s)}evaluate(n){const o=this.lhs.evaluate(n),a=this.rhs.evaluate(n);if(r&&this.hasUntypedArgument){const e=re(o),i=re(a);if(e.kind!==i.kind||"string"!==e.kind&&"number"!==e.kind)throw new ae(`Expected arguments for "${t}" to be (string, string) or (number, number), but found (${e.kind}, ${i.kind}) instead.`)}if(this.collator&&!r&&this.hasUntypedArgument){const t=re(o),i=re(a);if("string"!==t.kind||"string"!==i.kind)return e(n,o,a)}return this.collator?i(n,o,a,this.collator.evaluate(n)):e(n,o,a)}eachChild(t){t(this.lhs),t(this.rhs),this.collator&&t(this.collator)}outputDefined(){return!0}}}const Fe=Oe("==",(function(t,e,i){return e===i}),Re),Be=Oe("!=",(function(t,e,i){return e!==i}),(function(t,e,i,r){return!Re(0,e,i,r)})),Ne=Oe("<",(function(t,e,i){return e<i}),(function(t,e,i,r){return r.compare(e,i)<0})),je=Oe(">",(function(t,e,i){return e>i}),(function(t,e,i,r){return r.compare(e,i)>0})),Ve=Oe("<=",(function(t,e,i){return e<=i}),(function(t,e,i,r){return r.compare(e,i)<=0})),Ue=Oe(">=",(function(t,e,i){return e>=i}),(function(t,e,i,r){return r.compare(e,i)>=0}));class qe{constructor(t,e,i){this.type=mt,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 r=e.parse(void 0!==i["case-sensitive"]&&i["case-sensitive"],1,ht);if(!r)return null;const n=e.parse(void 0!==i["diacritic-sensitive"]&&i["diacritic-sensitive"],1,ht);if(!n)return null;let o=null;return i.locale&&(o=e.parse(i.locale,1,ut),!o)?null:new qe(r,n,o)}evaluate(t){return new Wt(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}}class $e{constructor(t,e,i,r,n){this.type=ut,this.number=t,this.locale=e,this.currency=i,this.minFractionDigits=r,this.maxFractionDigits=n}static parse(t,e){if(3!==t.length)return e.error("Expected two arguments.");const i=e.parse(t[1],1,ct);if(!i)return null;const r=t[2];if("object"!=typeof r||Array.isArray(r))return e.error("NumberFormat options argument must be an object.");let n=null;if(r.locale&&(n=e.parse(r.locale,1,ut),!n))return null;let o=null;if(r.currency&&(o=e.parse(r.currency,1,ut),!o))return null;let a=null;if(r["min-fraction-digits"]&&(a=e.parse(r["min-fraction-digits"],1,ct),!a))return null;let s=null;return r["max-fraction-digits"]&&(s=e.parse(r["max-fraction-digits"],1,ct),!s)?null:new $e(i,n,o,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}}class Ge{constructor(t){this.type=gt,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 r=[];let n=!1;for(let o=1;o<=t.length-1;++o){const i=t[o];if(n&&"object"==typeof i&&!Array.isArray(i)){n=!1;let t=null;if(i["font-scale"]&&(t=e.parse(i["font-scale"],1,ct),!t))return null;let o=null;if(i["text-font"]&&(o=e.parse(i["text-font"],1,bt(ut)),!o))return null;let a=null;if(i["text-color"]&&(a=e.parse(i["text-color"],1,dt),!a))return null;const s=r[r.length-1];s.scale=t,s.font=o,s.textColor=a}else{const i=e.parse(t[o],1,ft);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,r.push({content:i,scale:null,font:null,textColor:null})}}return new Ge(r)}evaluate(t){return new Jt(this.sections.map((e=>{const i=e.content.evaluate(t);return re(i)===_t?new Xt("",i,null,null,null):new Xt(ne(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}}class He{constructor(t){this.type=_t,this.input=t}static parse(t,e){if(2!==t.length)return e.error("Expected two arguments.");const i=e.parse(t[1],1,ut);return i?new He(i):e.error("No image name provided.")}evaluate(t){const e=this.input.evaluate(t),i=te.fromString(e);return i&&t.availableImages&&(i.available=t.availableImages.indexOf(e)>-1),i}eachChild(t){t(this.input)}outputDefined(){return!1}}class Ze{constructor(t){this.type=ct,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 ${xt(i.type)} instead.`):new Ze(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 ae(`Expected value to be of type string or array, but found ${xt(re(e))} instead.`)}eachChild(t){t(this.input)}outputDefined(){return!1}}const We=8192;function Xe(t,e){const i=(180+t[0])/360,r=(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+t[1]*Math.PI/360)))/360,n=Math.pow(2,e.z);return[Math.round(i*n*We),Math.round(r*n*We)]}function Je(t,e){const i=Math.pow(2,e.z);return[(n=(t[0]/We+e.x)/i,360*n-180),(r=(t[1]/We+e.y)/i,360/Math.PI*Math.atan(Math.exp((180-360*r)*Math.PI/180))-90)];var r,n}function Ke(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 Ye(t,e){return!(t[0]<=e[0]||t[2]>=e[2]||t[1]<=e[1]||t[3]>=e[3])}function Qe(t,e,i){const r=t[0]-e[0],n=t[1]-e[1],o=t[0]-i[0],a=t[1]-i[1];return r*a-o*n==0&&r*o<=0&&n*a<=0}function ti(t,e,i,r){return 0!=(n=[r[0]-i[0],r[1]-i[1]])[0]*(o=[e[0]-t[0],e[1]-t[1]])[1]-n[1]*o[0]&&!(!ai(t,e,i,r)||!ai(i,r,t,e));var n,o}function ei(t,e,i){for(const r of i)for(let i=0;i<r.length-1;++i)if(ti(t,e,r[i],r[i+1]))return!0;return!1}function ii(t,e,i=!1){let r=!1;for(const s of e)for(let e=0;e<s.length-1;e++){if(Qe(t,s[e],s[e+1]))return i;(o=s[e])[1]>(n=t)[1]!=(a=s[e+1])[1]>n[1]&&n[0]<(a[0]-o[0])*(n[1]-o[1])/(a[1]-o[1])+o[0]&&(r=!r)}var n,o,a;return r}function ri(t,e){for(const i of e)if(ii(t,i))return!0;return!1}function ni(t,e){for(const i of t)if(!ii(i,e))return!1;for(let i=0;i<t.length-1;++i)if(ei(t[i],t[i+1],e))return!1;return!0}function oi(t,e){for(const i of e)if(ni(t,i))return!0;return!1}function ai(t,e,i,r){const n=r[0]-i[0],o=r[1]-i[1],a=(t[0]-i[0])*o-n*(t[1]-i[1]),s=(e[0]-i[0])*o-n*(e[1]-i[1]);return a>0&&s<0||a<0&&s>0}function si(t,e,i){const r=[];for(let n=0;n<t.length;n++){const o=[];for(let r=0;r<t[n].length;r++){const a=Xe(t[n][r],i);Ke(e,a),o.push(a)}r.push(o)}return r}function li(t,e,i){const r=[];for(let n=0;n<t.length;n++){const o=si(t[n],e,i);r.push(o)}return r}function ci(t,e,i,r){if(t[0]<i[0]||t[0]>i[2]){const e=.5*r;let n=t[0]-i[0]>e?-r:i[0]-t[0]>e?r:0;0===n&&(n=t[0]-i[2]>e?-r:i[2]-t[0]>e?r:0),t[0]+=n}Ke(e,t)}function ui(t,e,i,r){const n=Math.pow(2,r.z)*We,o=[r.x*We,r.y*We],a=[];for(const s of t)for(const t of s){const r=[t.x+o[0],t.y+o[1]];ci(r,e,i,n),a.push(r)}return a}function hi(t,e,i,r){const n=Math.pow(2,r.z)*We,o=[r.x*We,r.y*We],a=[];for(const l of t){const t=[];for(const i of l){const r=[i.x+o[0],i.y+o[1]];Ke(e,r),t.push(r)}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 r of t)ci(r,e,i,n)}var s;return a}class di{constructor(t,e){this.type=ht,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(ie(t[1])){const e=t[1];if("FeatureCollection"===e.type){const t=[];for(const i of e.features){const{type:e,coordinates:r}=i.geometry;"Polygon"===e&&t.push(r),"MultiPolygon"===e&&t.push(...r)}if(t.length)return new di(e,{type:"MultiPolygon",coordinates:t})}else if("Feature"===e.type){const t=e.geometry.type;if("Polygon"===t||"MultiPolygon"===t)return new di(e,e.geometry)}else if("Polygon"===e.type||"MultiPolygon"===e.type)return new di(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],r=[1/0,1/0,-1/0,-1/0],n=t.canonicalID();if("Polygon"===e.type){const o=si(e.coordinates,r,n),a=ui(t.geometry(),i,r,n);if(!Ye(i,r))return!1;for(const t of a)if(!ii(t,o))return!1}if("MultiPolygon"===e.type){const o=li(e.coordinates,r,n),a=ui(t.geometry(),i,r,n);if(!Ye(i,r))return!1;for(const t of a)if(!ri(t,o))return!1}return!0}(t,this.geometries);if("LineString"===t.geometryType())return function(t,e){const i=[1/0,1/0,-1/0,-1/0],r=[1/0,1/0,-1/0,-1/0],n=t.canonicalID();if("Polygon"===e.type){const o=si(e.coordinates,r,n),a=hi(t.geometry(),i,r,n);if(!Ye(i,r))return!1;for(const t of a)if(!ni(t,o))return!1}if("MultiPolygon"===e.type){const o=li(e.coordinates,r,n),a=hi(t.geometry(),i,r,n);if(!Ye(i,r))return!1;for(const t of a)if(!oi(t,o))return!1}return!0}(t,this.geometries)}return!1}eachChild(){}outputDefined(){return!0}}let pi=class{constructor(t=[],e=(t,e)=>t<e?-1:t>e?1:0){if(this.data=t,this.length=this.data.length,this.compare=e,this.length>0)for(let i=(this.length>>1)-1;i>=0;i--)this._down(i)}push(t){this.data.push(t),this._up(this.length++)}pop(){if(0===this.length)return;const t=this.data[0],e=this.data.pop();return--this.length>0&&(this.data[0]=e,this._down(0)),t}peek(){return this.data[0]}_up(t){const{data:e,compare:i}=this,r=e[t];for(;t>0;){const n=t-1>>1,o=e[n];if(i(r,o)>=0)break;e[t]=o,t=n}e[t]=r}_down(t){const{data:e,compare:i}=this,r=this.length>>1,n=e[t];for(;t<r;){let r=1+(t<<1);const o=r+1;if(o<this.length&&i(e[o],e[r])<0&&(r=o),i(e[r],n)>=0)break;e[t]=e[r],t=r}e[t]=n}};function fi(t,e,i,r,n){mi(t,e,i,r||t.length-1,n||yi)}function mi(t,e,i,r,n){for(;r>i;){if(r-i>600){var o=r-i+1,a=e-i+1,s=Math.log(o),l=.5*Math.exp(2*s/3),c=.5*Math.sqrt(s*l*(o-l)/o)*(a-o/2<0?-1:1);mi(t,e,Math.max(i,Math.floor(e-a*l/o+c)),Math.min(r,Math.floor(e+(o-a)*l/o+c)),n)}var u=t[e],h=i,d=r;for(gi(t,i,e),n(t[r],u)>0&&gi(t,i,r);h<d;){for(gi(t,h,d),h++,d--;n(t[h],u)<0;)h++;for(;n(t[d],u)>0;)d--}0===n(t[i],u)?gi(t,i,d):gi(t,++d,r),d<=e&&(i=d+1),e<=d&&(r=d-1)}}function gi(t,e,i){var r=t[e];t[e]=t[i],t[i]=r}function yi(t,e){return t<e?-1:t>e?1:0}function _i(t,e){if(t.length<=1)return[t];const i=[];let r,n;for(const o of t){const t=bi(o);0!==t&&(o.area=Math.abs(t),void 0===n&&(n=t<0),n===t<0?(r&&i.push(r),r=[o]):r.push(o))}if(r&&i.push(r),e>1)for(let o=0;o<i.length;o++)i[o].length<=e||(fi(i[o],e,1,i[o].length-1,vi),i[o]=i[o].slice(0,e));return i}function vi(t,e){return e.area-t.area}function bi(t){let e=0;for(let i,r,n=0,o=t.length,a=o-1;n<o;a=n++)i=t[n],r=t[a],e+=(r.x-i.x)*(i.y+r.y);return e}const xi=1/298.257223563,wi=xi*(2-xi),ki=Math.PI/180;class Ei{constructor(t){const e=6378.137*ki*1e3,i=Math.cos(t*ki),r=1/(1-wi*(1-i*i)),n=Math.sqrt(r);this.kx=e*n*i,this.ky=e*n*r*(1-wi)}distance(t,e){const i=this.wrap(t[0]-e[0])*this.kx,r=(t[1]-e[1])*this.ky;return Math.sqrt(i*i+r*r)}pointOnLine(t,e){let i,r,n,o,a=1/0;for(let s=0;s<t.length-1;s++){let l=t[s][0],c=t[s][1],u=this.wrap(t[s+1][0]-l)*this.kx,h=(t[s+1][1]-c)*this.ky,d=0;0===u&&0===h||(d=(this.wrap(e[0]-l)*this.kx*u+(e[1]-c)*this.ky*h)/(u*u+h*h),d>1?(l=t[s+1][0],c=t[s+1][1]):d>0&&(l+=u/this.kx*d,c+=h/this.ky*d)),u=this.wrap(e[0]-l)*this.kx,h=(e[1]-c)*this.ky;const p=u*u+h*h;p<a&&(a=p,i=l,r=c,n=s,o=d)}return{point:[i,r],index:n,t:Math.max(0,Math.min(1,o))}}wrap(t){for(;t<-180;)t+=360;for(;t>180;)t-=360;return t}}function Si(t,e){return e[0]-t[0]}function Ii(t){return t[1]-t[0]+1}function Ci(t,e){return t[1]>=t[0]&&t[1]<e}function Ti(t,e){if(t[0]>t[1])return[null,null];const i=Ii(t);if(e){if(2===i)return[t,null];const e=Math.floor(i/2);return[[t[0],t[0]+e],[t[0]+e,t[1]]]}if(1===i)return[t,null];const r=Math.floor(i/2)-1;return[[t[0],t[0]+r],[t[0]+r+1,t[1]]]}function Ai(t,e){if(!Ci(e,t.length))return[1/0,1/0,-1/0,-1/0];const i=[1/0,1/0,-1/0,-1/0];for(let r=e[0];r<=e[1];++r)Ke(i,t[r]);return i}function Pi(t){const e=[1/0,1/0,-1/0,-1/0];for(const i of t)for(const t of i)Ke(e,t);return e}function Mi(t){return t[0]!==-1/0&&t[1]!==-1/0&&t[2]!==1/0&&t[3]!==1/0}function Li(t,e,i){if(!Mi(t)||!Mi(e))return NaN;let r=0,n=0;return t[2]<e[0]&&(r=e[0]-t[2]),t[0]>e[2]&&(r=t[0]-e[2]),t[1]>e[3]&&(n=t[1]-e[3]),t[3]<e[1]&&(n=e[1]-t[3]),i.distance([0,0],[r,n])}function zi(t,e,i){const r=i.pointOnLine(e,t);return i.distance(t,r.point)}function Di(t,e,i,r,n){const o=Math.min(zi(t,[i,r],n),zi(e,[i,r],n)),a=Math.min(zi(i,[t,e],n),zi(r,[t,e],n));return Math.min(o,a)}function Ri(t,e,i,r,n){if(!Ci(e,t.length)||!Ci(r,i.length))return 1/0;let o=1/0;for(let a=e[0];a<e[1];++a){const e=t[a],s=t[a+1];for(let t=r[0];t<r[1];++t){const r=i[t],a=i[t+1];if(ti(e,s,r,a))return 0;o=Math.min(o,Di(e,s,r,a,n))}}return o}function Oi(t,e,i,r,n){if(!Ci(e,t.length)||!Ci(r,i.length))return NaN;let o=1/0;for(let a=e[0];a<=e[1];++a)for(let e=r[0];e<=r[1];++e)if(o=Math.min(o,n.distance(t[a],i[e])),0===o)return o;return o}function Fi(t,e,i){if(ii(t,e,!0))return 0;let r=1/0;for(const n of e){const e=n[0],o=n[n.length-1];if(e!==o&&(r=Math.min(r,zi(t,[o,e],i)),0===r))return r;const a=i.pointOnLine(n,t);if(r=Math.min(r,i.distance(t,a.point)),0===r)return r}return r}function Bi(t,e,i,r){if(!Ci(e,t.length))return NaN;for(let o=e[0];o<=e[1];++o)if(ii(t[o],i,!0))return 0;let n=1/0;for(let o=e[0];o<e[1];++o){const e=t[o],a=t[o+1];for(const t of i)for(let i=0,o=t.length,s=o-1;i<o;s=i++){const o=t[s],l=t[i];if(ti(e,a,o,l))return 0;n=Math.min(n,Di(e,a,o,l,r))}}return n}function Ni(t,e){for(const i of t)for(const t of i)if(ii(t,e,!0))return!0;return!1}function ji(t,e,i,r=1/0){const n=Pi(t),o=Pi(e);if(r!==1/0&&Li(n,o,i)>=r)return r;if(Ye(n,o)){if(Ni(t,e))return 0}else if(Ni(e,t))return 0;let a=1/0;for(const s of t)for(let t=0,r=s.length,n=r-1;t<r;n=t++){const r=s[n],o=s[t];for(const t of e)for(let e=0,n=t.length,s=n-1;e<n;s=e++){const n=t[s],l=t[e];if(ti(r,o,n,l))return 0;a=Math.min(a,Di(r,o,n,l,i))}}return a}function Vi(t,e,i,r,n,o){if(!o)return;const a=Li(Ai(r,o),n,i);a<e&&t.push([a,o,[0,0]])}function Ui(t,e,i,r,n,o,a){if(!o||!a)return;const s=Li(Ai(r,o),Ai(n,a),i);s<e&&t.push([s,o,a])}function qi(t,e,i,r,n=1/0){let o=Math.min(r.distance(t[0],i[0][0]),n);if(0===o)return o;const a=new pi([[0,[0,t.length-1],[0,0]]],Si),s=Pi(i);for(;a.length>0;){const n=a.pop();if(n[0]>=o)continue;const l=n[1],c=e?50:100;if(Ii(l)<=c){if(!Ci(l,t.length))return NaN;if(e){const e=Bi(t,l,i,r);if(isNaN(e)||0===e)return e;o=Math.min(o,e)}else for(let e=l[0];e<=l[1];++e){const n=Fi(t[e],i,r);if(o=Math.min(o,n),0===o)return 0}}else{const i=Ti(l,e);Vi(a,o,r,t,s,i[0]),Vi(a,o,r,t,s,i[1])}}return o}function $i(t,e,i,r,n,o=1/0){let a=Math.min(o,n.distance(t[0],i[0]));if(0===a)return a;const s=new pi([[0,[0,t.length-1],[0,i.length-1]]],Si);for(;s.length>0;){const o=s.pop();if(o[0]>=a)continue;const l=o[1],c=o[2],u=e?50:100,h=r?50:100;if(Ii(l)<=u&&Ii(c)<=h){if(!Ci(l,t.length)&&Ci(c,i.length))return NaN;let o;if(e&&r)o=Ri(t,l,i,c,n),a=Math.min(a,o);else if(e&&!r){const e=t.slice(l[0],l[1]+1);for(let t=c[0];t<=c[1];++t)if(o=zi(i[t],e,n),a=Math.min(a,o),0===a)return a}else if(!e&&r){const e=i.slice(c[0],c[1]+1);for(let i=l[0];i<=l[1];++i)if(o=zi(t[i],e,n),a=Math.min(a,o),0===a)return a}else o=Oi(t,l,i,c,n),a=Math.min(a,o)}else{const o=Ti(l,e),u=Ti(c,r);Ui(s,a,n,t,i,o[0],u[0]),Ui(s,a,n,t,i,o[0],u[1]),Ui(s,a,n,t,i,o[1],u[0]),Ui(s,a,n,t,i,o[1],u[1])}}return a}function Gi(t){return"MultiPolygon"===t.type?t.coordinates.map((t=>({type:"Polygon",coordinates:t}))):"MultiLineString"===t.type?t.coordinates.map((t=>({type:"LineString",coordinates:t}))):"MultiPoint"===t.type?t.coordinates.map((t=>({type:"Point",coordinates:t}))):[t]}class Hi{constructor(t,e){this.type=ct,this.geojson=t,this.geometries=e}static parse(t,e){if(2!==t.length)return e.error(`'distance' expression requires exactly one argument, but found ${t.length-1} instead.`);if(ie(t[1])){const e=t[1];if("FeatureCollection"===e.type)return new Hi(e,e.features.map((t=>Gi(t.geometry))).flat());if("Feature"===e.type)return new Hi(e,Gi(e.geometry));if("type"in e&&"coordinates"in e)return new Hi(e,Gi(e))}return e.error("'distance' 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=t.geometry(),r=i.flat().map((e=>Je([e.x,e.y],t.canonical)));if(0===i.length)return NaN;const n=new Ei(r[0][1]);let o=1/0;for(const a of e){switch(a.type){case"Point":o=Math.min(o,$i(r,!1,[a.coordinates],!1,n,o));break;case"LineString":o=Math.min(o,$i(r,!1,a.coordinates,!0,n,o));break;case"Polygon":o=Math.min(o,qi(r,!1,a.coordinates,n,o))}if(0===o)return o}return o}(t,this.geometries);if("LineString"===t.geometryType())return function(t,e){const i=t.geometry(),r=i.flat().map((e=>Je([e.x,e.y],t.canonical)));if(0===i.length)return NaN;const n=new Ei(r[0][1]);let o=1/0;for(const a of e){switch(a.type){case"Point":o=Math.min(o,$i(r,!0,[a.coordinates],!1,n,o));break;case"LineString":o=Math.min(o,$i(r,!0,a.coordinates,!0,n,o));break;case"Polygon":o=Math.min(o,qi(r,!0,a.coordinates,n,o))}if(0===o)return o}return o}(t,this.geometries);if("Polygon"===t.geometryType())return function(t,e){const i=t.geometry();if(0===i.length||0===i[0].length)return NaN;const r=_i(i,0).map((e=>e.map((e=>e.map((e=>Je([e.x,e.y],t.canonical))))))),n=new Ei(r[0][0][0][1]);let o=1/0;for(const a of e)for(const t of r){switch(a.type){case"Point":o=Math.min(o,qi([a.coordinates],!1,t,n,o));break;case"LineString":o=Math.min(o,qi(a.coordinates,!0,t,n,o));break;case"Polygon":o=Math.min(o,ji(t,a.coordinates,n,o))}if(0===o)return o}return o}(t,this.geometries)}return NaN}eachChild(){}outputDefined(){return!0}}const Zi={"==":Fe,"!=":Be,">":je,"<":Ne,">=":Ue,"<=":Ve,array:le,at:ge,boolean:le,case:be,coalesce:ze,collator:qe,format:Ge,image:He,in:ye,"index-of":_e,interpolate:Me,"interpolate-hcl":Me,"interpolate-lab":Me,length:Ze,let:fe,literal:oe,match:ve,number:le,"number-format":$e,object:le,slice:xe,step:ke,string:le,"to-boolean":ue,"to-color":ue,"to-number":ue,"to-string":ue,var:me,within:di,distance:Hi};class Wi{constructor(t,e,i,r){this.name=t,this.type=e,this._evaluate=i,this.args=r}evaluate(t){return this._evaluate(t,this.args)}eachChild(t){this.args.forEach(t)}outputDefined(){return!1}static parse(t,e){const i=t[0],r=Wi.definitions[i];if(!r)return e.error(`Unknown expression "${i}". If you wanted a literal array, use ["literal", [...]].`,0);const n=Array.isArray(r)?r[0]:r.type,o=Array.isArray(r)?[[r[1],r[2]]]:r.overloads,a=o.filter((([e])=>!Array.isArray(e)||e.length===t.length-1));let s=null;for(const[l,c]of a){s=new pe(e.registry,Qi,e.path,null,e.scope);const r=[];let o=!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+r.length,n);if(!a){o=!0;break}r.push(a)}if(!o)if(Array.isArray(l)&&l.length!==r.length)s.error(`Expected ${l.length} arguments, but found ${r.length} instead.`);else{for(let t=0;t<r.length;t++){const e=Array.isArray(l)?l[t]:l.type,i=r[t];s.concat(t+1).checkSubtype(e,i.type)}if(0===s.errors.length)return new Wi(i,n,c,r)}}if(1===a.length)e.errors.push(...s.errors);else{const i=(a.length?a:o).map((([t])=>{return e=t,Array.isArray(e)?`(${e.map(xt).join(", ")})`:`(${xt(e.type)}...)`;var e})).join(" | "),r=[];for(let n=1;n<t.length;n++){const i=e.parse(t[n],1+r.length);if(!i)return null;r.push(xt(i.type))}e.error(`Expected arguments of type ${i}, but found (${r.join(", ")}) instead.`)}return null}static register(t,e){Wi.definitions=e;for(const i in e)t[i]=Wi}}function Xi(t,[e,i,r,n]){e=e.evaluate(t),i=i.evaluate(t),r=r.evaluate(t);const o=n?n.evaluate(t):1,a=ee(e,i,r,o);if(a)throw new ae(a);return new Zt(e/255,i/255,r/255,o,!1)}function Ji(t,e){return t in e}function Ki(t,e){const i=e[t];return void 0===i?null:i}function Yi(t){return{type:t}}function Qi(t){if(t instanceof me)return Qi(t.boundExpression);if(t instanceof Wi&&"error"===t.name)return!1;if(t instanceof qe)return!1;if(t instanceof di)return!1;if(t instanceof Hi)return!1;const e=t instanceof ue||t instanceof le;let i=!0;return t.eachChild((t=>{i=e?i&&Qi(t):i&&t instanceof oe})),!!i&&tr(t)&&ir(t,["zoom","heatmap-density","line-progress","accumulated","is-supported-script"])}function tr(t){if(t instanceof Wi){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 di)return!1;if(t instanceof Hi)return!1;let e=!0;return t.eachChild((t=>{e&&!tr(t)&&(e=!1)})),e}function er(t){if(t instanceof Wi&&"feature-state"===t.name)return!1;let e=!0;return t.eachChild((t=>{e&&!er(t)&&(e=!1)})),e}function ir(t,e){if(t instanceof Wi&&e.indexOf(t.name)>=0)return!1;let i=!0;return t.eachChild((t=>{i&&!ir(t,e)&&(i=!1)})),i}function rr(t){return{result:"success",value:t}}function nr(t){return{result:"error",value:t}}function or(t){return"data-driven"===t["property-type"]||"cross-faded-data-driven"===t["property-type"]}function ar(t){return!!t.expression&&t.expression.parameters.indexOf("zoom")>-1}function sr(t){return!!t.expression&&t.expression.interpolated}function lr(t){return t instanceof Number?"number":t instanceof String?"string":t instanceof Boolean?"boolean":Array.isArray(t)?"array":null===t?"null":typeof t}function cr(t){return"object"==typeof t&&null!==t&&!Array.isArray(t)}function ur(t){return t}function hr(t,e){const i="color"===e.type,r=t.stops&&"object"==typeof t.stops[0][0],n=r||!(r||void 0!==t.property),o=t.type||(sr(e)?"exponential":"interval");if(i||"padding"===e.type){const r=i?Zt.parse:Kt.parse;(t=ot({},t)).stops&&(t.stops=t.stops.map((t=>[t[0],r(t[1])]))),t.default=r(t.default?t.default:e.default)}if(t.colorSpace&&"rgb"!==(a=t.colorSpace)&&"hcl"!==a&&"lab"!==a)throw new Error(`Unknown color space: "${t.colorSpace}"`);var a;let s,l,c;if("exponential"===o)s=mr;else if("interval"===o)s=fr;else if("categorical"===o){s=pr,l=Object.create(null);for(const e of t.stops)l[e[0]]=e[1];c=typeof t.stops[0][0]}else{if("identity"!==o)throw new Error(`Unknown function type "${o}"`);s=gr}if(r){const i={},r=[];for(let e=0;e<t.stops.length;e++){const n=t.stops[e],o=n[0].zoom;void 0===i[o]&&(i[o]={zoom:o,type:t.type,property:t.property,default:t.default,stops:[]},r.push(o)),i[o].stops.push([n[0].value,n[1]])}const n=[];for(const t of r)n.push([i[t].zoom,hr(i[t],e)]);const o={name:"linear"};return{kind:"composite",interpolationType:o,interpolationFactor:Me.interpolationFactor.bind(void 0,o),zoomStops:n.map((t=>t[0])),evaluate:({zoom:i},r)=>mr({stops:n,base:t.base},e,i).evaluate(i,r)}}if(n){const i="exponential"===o?{name:"exponential",base:void 0!==t.base?t.base:1}:null;return{kind:"camera",interpolationType:i,interpolationFactor:Me.interpolationFactor.bind(void 0,i),zoomStops:t.stops.map((t=>t[0])),evaluate:({zoom:i})=>s(t,e,i,l,c)}}return{kind:"source",evaluate(i,r){const n=r&&r.properties?r.properties[t.property]:void 0;return void 0===n?dr(t.default,e.default):s(t,e,n,l,c)}}}function dr(t,e,i){return void 0!==t?t:void 0!==e?e:void 0!==i?i:void 0}function pr(t,e,i,r,n){return dr(typeof i===n?r[i]:void 0,t.default,e.default)}function fr(t,e,i){if("number"!==lr(i))return dr(t.default,e.default);const r=t.stops.length;if(1===r)return t.stops[0][1];if(i<=t.stops[0][0])return t.stops[0][1];if(i>=t.stops[r-1][0])return t.stops[r-1][1];const n=we(t.stops.map((t=>t[0])),i);return t.stops[n][1]}function mr(t,e,i){const r=void 0!==t.base?t.base:1;if("number"!==lr(i))return dr(t.default,e.default);const n=t.stops.length;if(1===n)return t.stops[0][1];if(i<=t.stops[0][0])return t.stops[0][1];if(i>=t.stops[n-1][0])return t.stops[n-1][1];const o=we(t.stops.map((t=>t[0])),i),a=function(t,e,i,r){const n=r-i,o=t-i;return 0===n?0:1===e?o/n:(Math.pow(e,o)-1)/(Math.pow(e,n)-1)}(i,r,t.stops[o][0],t.stops[o+1][0]),s=t.stops[o][1],l=t.stops[o+1][1],c=Pe[e.type]||ur;return"function"==typeof s.evaluate?{evaluate(...e){const i=s.evaluate.apply(void 0,e),r=l.evaluate.apply(void 0,e);if(void 0!==i&&void 0!==r)return c(i,r,a,t.colorSpace)}}:c(s,l,a,t.colorSpace)}function gr(t,e,i){switch(e.type){case"color":i=Zt.parse(i);break;case"formatted":i=Jt.fromString(i.toString());break;case"resolvedImage":i=te.fromString(i.toString());break;case"padding":i=Kt.parse(i);break;default:lr(i)===e.type||"enum"===e.type&&e.values[i]||(i=void 0)}return dr(i,t.default,e.default)}Wi.register(Zi,{error:[{kind:"error"},[ut],(t,[e])=>{throw new ae(e.evaluate(t))}],typeof:[ut,[ft],(t,[e])=>xt(re(e.evaluate(t)))],"to-rgba":[bt(ct,4),[dt],(t,[e])=>{const[i,r,n,o]=e.evaluate(t).rgb;return[255*i,255*r,255*n,o]}],rgb:[dt,[ct,ct,ct],Xi],rgba:[dt,[ct,ct,ct,ct],Xi],has:{type:ht,overloads:[[[ut],(t,[e])=>Ji(e.evaluate(t),t.properties())],[[ut,pt],(t,[e,i])=>Ji(e.evaluate(t),i.evaluate(t))]]},get:{type:ft,overloads:[[[ut],(t,[e])=>Ki(e.evaluate(t),t.properties())],[[ut,pt],(t,[e,i])=>Ki(e.evaluate(t),i.evaluate(t))]]},"feature-state":[ft,[ut],(t,[e])=>Ki(e.evaluate(t),t.featureState||{})],properties:[pt,[],t=>t.properties()],"geometry-type":[ut,[],t=>t.geometryType()],id:[ft,[],t=>t.id()],zoom:[ct,[],t=>t.globals.zoom],"heatmap-density":[ct,[],t=>t.globals.heatmapDensity||0],"line-progress":[ct,[],t=>t.globals.lineProgress||0],accumulated:[ft,[],t=>void 0===t.globals.accumulated?null:t.globals.accumulated],"+":[ct,Yi(ct),(t,e)=>{let i=0;for(const r of e)i+=r.evaluate(t);return i}],"*":[ct,Yi(ct),(t,e)=>{let i=1;for(const r of e)i*=r.evaluate(t);return i}],"-":{type:ct,overloads:[[[ct,ct],(t,[e,i])=>e.evaluate(t)-i.evaluate(t)],[[ct],(t,[e])=>-e.evaluate(t)]]},"/":[ct,[ct,ct],(t,[e,i])=>e.evaluate(t)/i.evaluate(t)],"%":[ct,[ct,ct],(t,[e,i])=>e.evaluate(t)%i.evaluate(t)],ln2:[ct,[],()=>Math.LN2],pi:[ct,[],()=>Math.PI],e:[ct,[],()=>Math.E],"^":[ct,[ct,ct],(t,[e,i])=>Math.pow(e.evaluate(t),i.evaluate(t))],sqrt:[ct,[ct],(t,[e])=>Math.sqrt(e.evaluate(t))],log10:[ct,[ct],(t,[e])=>Math.log(e.evaluate(t))/Math.LN10],ln:[ct,[ct],(t,[e])=>Math.log(e.evaluate(t))],log2:[ct,[ct],(t,[e])=>Math.log(e.evaluate(t))/Math.LN2],sin:[ct,[ct],(t,[e])=>Math.sin(e.evaluate(t))],cos:[ct,[ct],(t,[e])=>Math.cos(e.evaluate(t))],tan:[ct,[ct],(t,[e])=>Math.tan(e.evaluate(t))],asin:[ct,[ct],(t,[e])=>Math.asin(e.evaluate(t))],acos:[ct,[ct],(t,[e])=>Math.acos(e.evaluate(t))],atan:[ct,[ct],(t,[e])=>Math.atan(e.evaluate(t))],min:[ct,Yi(ct),(t,e)=>Math.min(...e.map((e=>e.evaluate(t))))],max:[ct,Yi(ct),(t,e)=>Math.max(...e.map((e=>e.evaluate(t))))],abs:[ct,[ct],(t,[e])=>Math.abs(e.evaluate(t))],round:[ct,[ct],(t,[e])=>{const i=e.evaluate(t);return i<0?-Math.round(-i):Math.round(i)}],floor:[ct,[ct],(t,[e])=>Math.floor(e.evaluate(t))],ceil:[ct,[ct],(t,[e])=>Math.ceil(e.evaluate(t))],"filter-==":[ht,[ut,ft],(t,[e,i])=>t.properties()[e.value]===i.value],"filter-id-==":[ht,[ft],(t,[e])=>t.id()===e.value],"filter-type-==":[ht,[ut],(t,[e])=>t.geometryType()===e.value],"filter-<":[ht,[ut,ft],(t,[e,i])=>{const r=t.properties()[e.value],n=i.value;return typeof r==typeof n&&r<n}],"filter-id-<":[ht,[ft],(t,[e])=>{const i=t.id(),r=e.value;return typeof i==typeof r&&i<r}],"filter->":[ht,[ut,ft],(t,[e,i])=>{const r=t.properties()[e.value],n=i.value;return typeof r==typeof n&&r>n}],"filter-id->":[ht,[ft],(t,[e])=>{const i=t.id(),r=e.value;return typeof i==typeof r&&i>r}],"filter-<=":[ht,[ut,ft],(t,[e,i])=>{const r=t.properties()[e.value],n=i.value;return typeof r==typeof n&&r<=n}],"filter-id-<=":[ht,[ft],(t,[e])=>{const i=t.id(),r=e.value;return typeof i==typeof r&&i<=r}],"filter->=":[ht,[ut,ft],(t,[e,i])=>{const r=t.properties()[e.value],n=i.value;return typeof r==typeof n&&r>=n}],"filter-id->=":[ht,[ft],(t,[e])=>{const i=t.id(),r=e.value;return typeof i==typeof r&&i>=r}],"filter-has":[ht,[ft],(t,[e])=>e.value in t.properties()],"filter-has-id":[ht,[],t=>null!==t.id()&&void 0!==t.id()],"filter-type-in":[ht,[bt(ut)],(t,[e])=>e.value.indexOf(t.geometryType())>=0],"filter-id-in":[ht,[bt(ft)],(t,[e])=>e.value.indexOf(t.id())>=0],"filter-in-small":[ht,[ut,bt(ft)],(t,[e,i])=>i.value.indexOf(t.properties()[e.value])>=0],"filter-in-large":[ht,[ut,bt(ft)],(t,[e,i])=>function(t,e,i,r){for(;i<=r;){const n=i+r>>1;if(e[n]===t)return!0;e[n]>t?r=n-1:i=n+1}return!1}(t.properties()[e.value],i.value,0,i.value.length-1)],all:{type:ht,overloads:[[[ht,ht],(t,[e,i])=>e.evaluate(t)&&i.evaluate(t)],[Yi(ht),(t,e)=>{for(const i of e)if(!i.evaluate(t))return!1;return!0}]]},any:{type:ht,overloads:[[[ht,ht],(t,[e,i])=>e.evaluate(t)||i.evaluate(t)],[Yi(ht),(t,e)=>{for(const i of e)if(i.evaluate(t))return!0;return!1}]]},"!":[ht,[ht],(t,[e])=>!e.evaluate(t)],"is-supported-script":[ht,[ut],(t,[e])=>{const i=t.globals&&t.globals.isSupportedScript;return!i||i(e.evaluate(t))}],upcase:[ut,[ut],(t,[e])=>e.evaluate(t).toUpperCase()],downcase:[ut,[ut],(t,[e])=>e.evaluate(t).toLowerCase()],concat:[ut,Yi(ft),(t,e)=>e.map((e=>ne(e.evaluate(t)))).join("")],"resolved-locale":[ut,[mt],(t,[e])=>e.evaluate(t).resolvedLocale()]});class yr{constructor(t,e){var i;this.expression=t,this._warningHistory={},this._evaluator=new de,this._defaultValue=e?"color"===(i=e).type&&cr(i.default)?new Zt(0,0,0,0):"color"===i.type?Zt.parse(i.default)||null:"padding"===i.type?Kt.parse(i.default)||null:"variableAnchorOffsetCollection"===i.type?Qt.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,r,n,o){return this._evaluator.globals=t,this._evaluator.feature=e,this._evaluator.featureState=i,this._evaluator.canonical=r,this._evaluator.availableImages=n||null,this._evaluator.formattedSection=o,this.expression.evaluate(this._evaluator)}evaluate(t,e,i,r,n,o){this._evaluator.globals=t,this._evaluator.feature=e||null,this._evaluator.featureState=i||null,this._evaluator.canonical=r,this._evaluator.availableImages=n||null,this._evaluator.formattedSection=o||null;try{const t=this.expression.evaluate(this._evaluator);if(null==t||"number"==typeof t&&t!=t)return this._defaultValue;if(this._enumValues&&!(t in this._enumValues))throw new ae(`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(t){return this._warningHistory[t.message]||(this._warningHistory[t.message]=!0,"undefined"!=typeof console&&console.warn(t.message)),this._defaultValue}}}function _r(t){return Array.isArray(t)&&t.length>0&&"string"==typeof t[0]&&t[0]in Zi}function vr(t,e){const i=new pe(Zi,Qi,[],e?function(t){const e={color:dt,string:ut,number:ct,enum:ut,boolean:ht,formatted:gt,padding:yt,resolvedImage:_t,variableAnchorOffsetCollection:vt};return"array"===t.type?bt(e[t.value]||ft,t.length):e[t.type]}(e):void 0),r=i.parse(t,void 0,void 0,void 0,e&&"string"===e.type?{typeAnnotation:"coerce"}:void 0);return r?rr(new yr(r,e)):nr(i.errors)}class br{constructor(t,e){this.kind=t,this._styleExpression=e,this.isStateDependent="constant"!==t&&!er(e.expression)}evaluateWithoutErrorHandling(t,e,i,r,n,o){return this._styleExpression.evaluateWithoutErrorHandling(t,e,i,r,n,o)}evaluate(t,e,i,r,n,o){return this._styleExpression.evaluate(t,e,i,r,n,o)}}class xr{constructor(t,e,i,r){this.kind=t,this.zoomStops=i,this._styleExpression=e,this.isStateDependent="camera"!==t&&!er(e.expression),this.interpolationType=r}evaluateWithoutErrorHandling(t,e,i,r,n,o){return this._styleExpression.evaluateWithoutErrorHandling(t,e,i,r,n,o)}evaluate(t,e,i,r,n,o){return this._styleExpression.evaluate(t,e,i,r,n,o)}interpolationFactor(t,e,i){return this.interpolationType?Me.interpolationFactor(this.interpolationType,t,e,i):0}}function wr(t,e){const i=vr(t,e);if("error"===i.result)return i;const r=i.value.expression,n=tr(r);if(!n&&!or(e))return nr([new at("","data expressions not supported")]);const o=ir(r,["zoom"]);if(!o&&!ar(e))return nr([new at("","zoom expressions not supported")]);const a=Er(r);return a||o?a instanceof at?nr([a]):a instanceof Me&&!sr(e)?nr([new at("",'"interpolate" expressions cannot be used with this property')]):rr(a?new xr(n?"camera":"composite",i.value,a.labels,a instanceof Me?a.interpolation:void 0):new br(n?"constant":"source",i.value)):nr([new at("",'"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression.')])}class kr{constructor(t,e){this._parameters=t,this._specification=e,ot(this,hr(this._parameters,this._specification))}static deserialize(t){return new kr(t._parameters,t._specification)}static serialize(t){return{_parameters:t._parameters,_specification:t._specification}}}function Er(t){let e=null;if(t instanceof fe)e=Er(t.result);else if(t instanceof ze){for(const i of t.args)if(e=Er(i),e)break}else(t instanceof ke||t instanceof Me)&&t.input instanceof Wi&&"zoom"===t.input.name&&(e=t);return e instanceof at||t.eachChild((t=>{const i=Er(t);i instanceof at?e=i:!e&&i?e=new at("",'"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression.'):e&&i&&e!==i&&(e=new at("",'Only one zoom-based "step" or "interpolate" subexpression may be used in an expression.'))})),e}function Sr(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(!Sr(e)&&"boolean"!=typeof e)return!1;return!0;default:return!0}}const Ir={type:"boolean",default:!1,transition:!1,"property-type":"data-driven",expression:{interpolated:!1,parameters:["zoom","feature"]}};function Cr(t){if(null==t)return{filter:()=>!0,needGeometry:!1};Sr(t)||(t=Pr(t));const e=vr(t,Ir);if("error"===e.result)throw new Error(e.value.map((t=>`${t.key}: ${t.message}`)).join(", "));return{filter:(t,i,r)=>e.value.evaluate(t,i,{},r),needGeometry:Ar(t)}}function Tr(t,e){return t<e?-1:t>e?1:0}function Ar(t){if(!Array.isArray(t))return!1;if("within"===t[0]||"distance"===t[0])return!0;for(let e=1;e<t.length;e++)if(Ar(t[e]))return!0;return!1}function Pr(t){if(!t)return!0;const e=t[0];return t.length<=1?"any"!==e:"=="===e?Mr(t[1],t[2],"=="):"!="===e?Dr(Mr(t[1],t[2],"==")):"<"===e||">"===e||"<="===e||">="===e?Mr(t[1],t[2],e):"any"===e?(i=t.slice(1),["any"].concat(i.map(Pr))):"all"===e?["all"].concat(t.slice(1).map(Pr)):"none"===e?["all"].concat(t.slice(1).map(Pr).map(Dr)):"in"===e?Lr(t[1],t.slice(2)):"!in"===e?Dr(Lr(t[1],t.slice(2))):"has"===e?zr(t[1]):"!has"!==e||Dr(zr(t[1]));var i}function Mr(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 Lr(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(Tr)]]:["filter-in-small",t,["literal",e]]}}function zr(t){switch(t){case"$type":return!0;case"$id":return["filter-has-id"];default:return["filter-has",t]}}function Dr(t){return["!",t]}function Rr(t){const e=typeof t;if("number"===e||"boolean"===e||"string"===e||null==t)return JSON.stringify(t);if(Array.isArray(t)){let e="[";for(const i of t)e+=`${Rr(i)},`;return`${e}]`}const i=Object.keys(t).sort();let r="{";for(let n=0;n<i.length;n++)r+=`${JSON.stringify(i[n])}:${Rr(t[i[n]])},`;return`${r}}`}function Or(t){let e="";for(const i of Z)e+=`/${Rr(t[i])}`;return e}function Fr(t){const e=t.value;return e?[new nt(t.key,e,"constants have been deprecated as of v8")]:[]}function Br(t){return t instanceof Number||t instanceof String||t instanceof Boolean?t.valueOf():t}function Nr(t){if(Array.isArray(t))return t.map(Nr);if(t instanceof Object&&!(t instanceof Number||t instanceof String||t instanceof Boolean)){const e={};for(const i in t)e[i]=Nr(t[i]);return e}return Br(t)}function jr(t){const e=t.key,i=t.value,r=t.valueSpec||{},n=t.objectElementValidators||{},o=t.style,a=t.styleSpec,s=t.validateSpec;let l=[];const c=lr(i);if("object"!==c)return[new nt(e,i,`object expected, ${c} found`)];for(const u in i){const t=u.split(".")[0],c=r[t]||r["*"];let h;if(n[t])h=n[t];else if(r[t])h=s;else if(n["*"])h=n["*"];else{if(!r["*"]){l.push(new nt(e,i[u],`unknown property "${u}"`));continue}h=s}l=l.concat(h({key:(e?`${e}.`:e)+u,value:i[u],valueSpec:c,style:o,styleSpec:a,object:i,objectKey:u,validateSpec:s},i))}for(const u in r)n[u]||r[u].required&&void 0===r[u].default&&void 0===i[u]&&l.push(new nt(e,i,`missing required property "${u}"`));return l}function Vr(t){const e=t.value,i=t.valueSpec,r=t.style,n=t.styleSpec,o=t.key,a=t.arrayElementValidator||t.validateSpec;if("array"!==lr(e))return[new nt(o,e,`array expected, ${lr(e)} found`)];if(i.length&&e.length!==i.length)return[new nt(o,e,`array length ${i.length} expected, length ${e.length} found`)];if(i["min-length"]&&e.length<i["min-length"])return[new nt(o,e,`array length at least ${i["min-length"]} expected, length ${e.length} found`)];let s={type:i.value,values:i.values};n.$version<7&&(s.function=i.function),"object"===lr(i.value)&&(s=i.value);let l=[];for(let c=0;c<e.length;c++)l=l.concat(a({array:e,arrayIndex:c,value:e[c],valueSpec:s,validateSpec:t.validateSpec,style:r,styleSpec:n,key:`${o}[${c}]`}));return l}function Ur(t){const e=t.key,i=t.value,r=t.valueSpec;let n=lr(i);return"number"===n&&i!=i&&(n="NaN"),"number"!==n?[new nt(e,i,`number expected, ${n} found`)]:"minimum"in r&&i<r.minimum?[new nt(e,i,`${i} is less than the minimum value ${r.minimum}`)]:"maximum"in r&&i>r.maximum?[new nt(e,i,`${i} is greater than the maximum value ${r.maximum}`)]:[]}function qr(t){const e=t.valueSpec,i=Br(t.value.type);let r,n,o,a={};const s="categorical"!==i&&void 0===t.value.property,l=!s,c="array"===lr(t.value.stops)&&"array"===lr(t.value.stops[0])&&"object"===lr(t.value.stops[0][0]),u=jr({key:t.key,value:t.value,valueSpec:t.styleSpec.function,validateSpec:t.validateSpec,style:t.style,styleSpec:t.styleSpec,objectElementValidators:{stops:function(t){if("identity"===i)return[new nt(t.key,t.value,'identity function may not have a "stops" property')];let e=[];const r=t.value;return e=e.concat(Vr({key:t.key,value:r,valueSpec:t.valueSpec,validateSpec:t.validateSpec,style:t.style,styleSpec:t.styleSpec,arrayElementValidator:h})),"array"===lr(r)&&0===r.length&&e.push(new nt(t.key,r,"array must have at least one stop")),e},default:function(t){return t.validateSpec({key:t.key,value:t.value,valueSpec:e,validateSpec:t.validateSpec,style:t.style,styleSpec:t.styleSpec})}}});return"identity"===i&&s&&u.push(new nt(t.key,t.value,'missing required property "property"')),"identity"===i||t.value.stops||u.push(new nt(t.key,t.value,'missing required property "stops"')),"exponential"===i&&t.valueSpec.expression&&!sr(t.valueSpec)&&u.push(new nt(t.key,t.value,"exponential functions not supported")),t.styleSpec.$version>=8&&(l&&!or(t.valueSpec)?u.push(new nt(t.key,t.value,"property functions not supported")):s&&!ar(t.valueSpec)&&u.push(new nt(t.key,t.value,"zoom functions not supported"))),"categorical"!==i&&!c||void 0!==t.value.property||u.push(new nt(t.key,t.value,'"property" property is required')),u;function h(t){let i=[];const r=t.value,s=t.key;if("array"!==lr(r))return[new nt(s,r,`array expected, ${lr(r)} found`)];if(2!==r.length)return[new nt(s,r,`array length 2 expected, length ${r.length} found`)];if(c){if("object"!==lr(r[0]))return[new nt(s,r,`object expected, ${lr(r[0])} found`)];if(void 0===r[0].zoom)return[new nt(s,r,"object stop key must have zoom")];if(void 0===r[0].value)return[new nt(s,r,"object stop key must have value")];if(o&&o>Br(r[0].zoom))return[new nt(s,r[0].zoom,"stop zoom values must appear in ascending order")];Br(r[0].zoom)!==o&&(o=Br(r[0].zoom),n=void 0,a={}),i=i.concat(jr({key:`${s}[0]`,value:r[0],valueSpec:{zoom:{}},validateSpec:t.validateSpec,style:t.style,styleSpec:t.styleSpec,objectElementValidators:{zoom:Ur,value:d}}))}else i=i.concat(d({key:`${s}[0]`,value:r[0],validateSpec:t.validateSpec,style:t.style,styleSpec:t.styleSpec},r));return _r(Nr(r[1]))?i.concat([new nt(`${s}[1]`,r[1],"expressions are not allowed in function stops.")]):i.concat(t.validateSpec({key:`${s}[1]`,value:r[1],valueSpec:e,validateSpec:t.validateSpec,style:t.style,styleSpec:t.styleSpec}))}function d(t,o){const s=lr(t.value),l=Br(t.value),c=null!==t.value?t.value:o;if(r){if(s!==r)return[new nt(t.key,c,`${s} stop domain type must match previous stop domain type ${r}`)]}else r=s;if("number"!==s&&"string"!==s&&"boolean"!==s)return[new nt(t.key,c,"stop domain value must be a number, string, or boolean")];if("number"!==s&&"categorical"!==i){let r=`number expected, ${s} found`;return or(e)&&void 0===i&&(r+='\nIf you intended to use a categorical function, specify `"type": "categorical"`.'),[new nt(t.key,c,r)]}return"categorical"!==i||"number"!==s||isFinite(l)&&Math.floor(l)===l?"categorical"!==i&&"number"===s&&void 0!==n&&l<n?[new nt(t.key,c,"stop domain values must appear in ascending order")]:(n=l,"categorical"===i&&l in a?[new nt(t.key,c,"stop domain values must be unique")]:(a[l]=!0,[])):[new nt(t.key,c,`integer expected, found ${l}`)]}}function $r(t){const e=("property"===t.expressionContext?wr:vr)(Nr(t.value),t.valueSpec);if("error"===e.result)return e.value.map((e=>new nt(`${t.key}${e.key}`,t.value,e.message)));const i=e.value.expression||e.value._styleExpression.expression;if("property"===t.expressionContext&&"text-font"===t.propertyKey&&!i.outputDefined())return[new nt(t.key,t.value,`Invalid data expression for "${t.propertyKey}". Output values must be contained as literals within the expression.`)];if("property"===t.expressionContext&&"layout"===t.propertyType&&!er(i))return[new nt(t.key,t.value,'"feature-state" data expressions are not supported with layout properties.')];if("filter"===t.expressionContext&&!er(i))return[new nt(t.key,t.value,'"feature-state" data expressions are not supported with filters.')];if(t.expressionContext&&0===t.expressionContext.indexOf("cluster")){if(!ir(i,["zoom","feature-state"]))return[new nt(t.key,t.value,'"zoom" and "feature-state" expressions are not supported with cluster properties.')];if("cluster-initial"===t.expressionContext&&!tr(i))return[new nt(t.key,t.value,"Feature data expressions are not supported with initial expression part of cluster properties.")]}return[]}function Gr(t){const e=t.key,i=t.value,r=t.valueSpec,n=[];return Array.isArray(r.values)?-1===r.values.indexOf(Br(i))&&n.push(new nt(e,i,`expected one of [${r.values.join(", ")}], ${JSON.stringify(i)} found`)):-1===Object.keys(r.values).indexOf(Br(i))&&n.push(new nt(e,i,`expected one of [${Object.keys(r.values).join(", ")}], ${JSON.stringify(i)} found`)),n}function Hr(t){return Sr(Nr(t.value))?$r(ot({},t,{expressionContext:"filter",valueSpec:{value:"boolean"}})):Zr(t)}function Zr(t){const e=t.value,i=t.key;if("array"!==lr(e))return[new nt(i,e,`array expected, ${lr(e)} found`)];const r=t.styleSpec;let n,o=[];if(e.length<1)return[new nt(i,e,"filter array must have at least 1 element")];switch(o=o.concat(Gr({key:`${i}[0]`,value:e[0],valueSpec:r.filter_operator,style:t.style,styleSpec:t.styleSpec})),Br(e[0])){case"<":case"<=":case">":case">=":e.length>=2&&"$type"===Br(e[1])&&o.push(new nt(i,e,`"$type" cannot be use with operator "${e[0]}"`));case"==":case"!=":3!==e.length&&o.push(new nt(i,e,`filter array for operator "${e[0]}" must have 3 elements`));case"in":case"!in":e.length>=2&&(n=lr(e[1]),"string"!==n&&o.push(new nt(`${i}[1]`,e[1],`string expected, ${n} found`)));for(let a=2;a<e.length;a++)n=lr(e[a]),"$type"===Br(e[1])?o=o.concat(Gr({key:`${i}[${a}]`,value:e[a],valueSpec:r.geometry_type,style:t.style,styleSpec:t.styleSpec})):"string"!==n&&"number"!==n&&"boolean"!==n&&o.push(new nt(`${i}[${a}]`,e[a],`string, number, or boolean expected, ${n} found`));break;case"any":case"all":case"none":for(let r=1;r<e.length;r++)o=o.concat(Zr({key:`${i}[${r}]`,value:e[r],style:t.style,styleSpec:t.styleSpec}));break;case"has":case"!has":n=lr(e[1]),2!==e.length?o.push(new nt(i,e,`filter array for "${e[0]}" operator must have 2 elements`)):"string"!==n&&o.push(new nt(`${i}[1]`,e[1],`string expected, ${n} found`))}return o}function Wr(t,e){const i=t.key,r=t.validateSpec,n=t.style,o=t.styleSpec,a=t.value,s=t.objectKey,l=o[`${e}_${t.layerType}`];if(!l)return[];const c=s.match(/^(.*)-transition$/);if("paint"===e&&c&&l[c[1]]&&l[c[1]].transition)return r({key:i,value:a,valueSpec:o.transition,style:n,styleSpec:o});const u=t.valueSpec||l[s];if(!u)return[new nt(i,a,`unknown property "${s}"`)];let h;if("string"===lr(a)&&or(u)&&!u.tokens&&(h=/^{([^}]+)}$/.exec(a)))return[new nt(i,a,`"${s}" does not support interpolation syntax\nUse an identity property function instead: \`{ "type": "identity", "property": ${JSON.stringify(h[1])} }\`.`)];const d=[];return"symbol"===t.layerType&&("text-field"===s&&n&&!n.glyphs&&d.push(new nt(i,a,'use of "text-field" requires a style "glyphs" property')),"text-font"===s&&cr(Nr(a))&&"identity"===Br(a.type)&&d.push(new nt(i,a,'"text-font" does not support identity functions'))),d.concat(r({key:t.key,value:a,valueSpec:u,style:n,styleSpec:o,expressionContext:"property",propertyType:e,propertyKey:s}))}function Xr(t){return Wr(t,"paint")}function Jr(t){return Wr(t,"layout")}function Kr(t){let e=[];const i=t.value,r=t.key,n=t.style,o=t.styleSpec;i.type||i.ref||e.push(new nt(r,i,'either "type" or "ref" is required'));let a=Br(i.type);const s=Br(i.ref);if(i.id){const o=Br(i.id);for(let a=0;a<t.arrayIndex;a++){const t=n.layers[a];Br(t.id)===o&&e.push(new nt(r,i.id,`duplicate layer id "${i.id}", previously used at line ${t.id.__line__}`))}}if("ref"in i){let t;["type","source","source-layer","filter","layout"].forEach((t=>{t in i&&e.push(new nt(r,i[t],`"${t}" is prohibited for ref layers`))})),n.layers.forEach((e=>{Br(e.id)===s&&(t=e)})),t?t.ref?e.push(new nt(r,i.ref,"ref cannot reference another ref layer")):a=Br(t.type):e.push(new nt(r,i.ref,`ref layer "${s}" not found`))}else if("background"!==a)if(i.source){const t=n.sources&&n.sources[i.source],o=t&&Br(t.type);t?"vector"===o&&"raster"===a?e.push(new nt(r,i.source,`layer "${i.id}" requires a raster source`)):"raster-dem"!==o&&"hillshade"===a?e.push(new nt(r,i.source,`layer "${i.id}" requires a raster-dem source`)):"raster"===o&&"raster"!==a?e.push(new nt(r,i.source,`layer "${i.id}" requires a vector source`)):"vector"!==o||i["source-layer"]?"raster-dem"===o&&"hillshade"!==a?e.push(new nt(r,i.source,"raster-dem source can only be used with layer type 'hillshade'.")):"line"!==a||!i.paint||!i.paint["line-gradient"]||"geojson"===o&&t.lineMetrics||e.push(new nt(r,i,`layer "${i.id}" specifies a line-gradient, which requires a GeoJSON source with \`lineMetrics\` enabled.`)):e.push(new nt(r,i,`layer "${i.id}" must specify a "source-layer"`)):e.push(new nt(r,i.source,`source "${i.source}" not found`))}else e.push(new nt(r,i,'missing required property "source"'));return e=e.concat(jr({key:r,value:i,valueSpec:o.layer,style:t.style,styleSpec:t.styleSpec,validateSpec:t.validateSpec,objectElementValidators:{"*":()=>[],type:()=>t.validateSpec({key:`${r}.type`,value:i.type,valueSpec:o.layer.type,style:t.style,styleSpec:t.styleSpec,validateSpec:t.validateSpec,object:i,objectKey:"type"}),filter:Hr,layout:t=>jr({layer:i,key:t.key,value:t.value,style:t.style,styleSpec:t.styleSpec,validateSpec:t.validateSpec,objectElementValidators:{"*":t=>Jr(ot({layerType:a},t))}}),paint:t=>jr({layer:i,key:t.key,value:t.value,style:t.style,styleSpec:t.styleSpec,validateSpec:t.validateSpec,objectElementValidators:{"*":t=>Xr(ot({layerType:a},t))}})}})),e}function Yr(t){const e=t.value,i=t.key,r=lr(e);return"string"!==r?[new nt(i,e,`string expected, ${r} found`)]:[]}const Qr={promoteId:function({key:t,value:e}){if("string"===lr(e))return Yr({key:t,value:e});{const i=[];for(const r in e)i.push(...Yr({key:`${t}.${r}`,value:e[r]}));return i}}};function tn(t){const e=t.value,i=t.key,r=t.styleSpec,n=t.style,o=t.validateSpec;if(!e.type)return[new nt(i,e,'"type" is required')];const a=Br(e.type);let s;switch(a){case"vector":case"raster":return s=jr({key:i,value:e,valueSpec:r[`source_${a.replace("-","_")}`],style:t.style,styleSpec:r,objectElementValidators:Qr,validateSpec:o}),s;case"raster-dem":return s=function(t){var e;const i=null!==(e=t.sourceName)&&void 0!==e?e:"",r=t.value,n=t.styleSpec,o=n.source_raster_dem,a=t.style;let s=[];const l=lr(r);if(void 0===r)return s;if("object"!==l)return s.push(new nt("source_raster_dem",r,`object expected, ${l} found`)),s;const c="custom"===Br(r.encoding),u=["redFactor","greenFactor","blueFactor","baseShift"],h=t.value.encoding?`"${t.value.encoding}"`:"Default";for(const d in r)!c&&u.includes(d)?s.push(new nt(d,r[d],`In "${i}": "${d}" is only valid when "encoding" is set to "custom". ${h} encoding found`)):o[d]?s=s.concat(t.validateSpec({key:d,value:r[d],valueSpec:o[d],validateSpec:t.validateSpec,style:a,styleSpec:n})):s.push(new nt(d,r[d],`unknown property "${d}"`));return s}({sourceName:i,value:e,style:t.style,styleSpec:r,validateSpec:o}),s;case"geojson":if(s=jr({key:i,value:e,valueSpec:r.source_geojson,style:n,styleSpec:r,validateSpec:o,objectElementValidators:Qr}),e.cluster)for(const t in e.clusterProperties){const[r,n]=e.clusterProperties[t],o="string"==typeof r?[r,["accumulated"],["get",t]]:r;s.push(...$r({key:`${i}.${t}.map`,value:n,expressionContext:"cluster-map"})),s.push(...$r({key:`${i}.${t}.reduce`,value:o,expressionContext:"cluster-reduce"}))}return s;case"video":return jr({key:i,value:e,valueSpec:r.source_video,style:n,validateSpec:o,styleSpec:r});case"image":return jr({key:i,value:e,valueSpec:r.source_image,style:n,validateSpec:o,styleSpec:r});case"canvas":return[new nt(i,null,"Please use runtime APIs to add canvas sources, rather than including them in stylesheets.","source.canvas")];default:return Gr({key:`${i}.type`,value:e.type,valueSpec:{values:["vector","raster","raster-dem","geojson","video","image"]}})}}function en(t){const e=t.value,i=t.styleSpec,r=i.light,n=t.style;let o=[];const a=lr(e);if(void 0===e)return o;if("object"!==a)return o=o.concat([new nt("light",e,`object expected, ${a} found`)]),o;for(const s in e){const a=s.match(/^(.*)-transition$/);o=o.concat(a&&r[a[1]]&&r[a[1]].transition?t.validateSpec({key:s,value:e[s],valueSpec:i.transition,validateSpec:t.validateSpec,style:n,styleSpec:i}):r[s]?t.validateSpec({key:s,value:e[s],valueSpec:r[s],validateSpec:t.validateSpec,style:n,styleSpec:i}):[new nt(s,e[s],`unknown property "${s}"`)])}return o}function rn(t){const e=t.value,i=t.styleSpec,r=i.sky,n=t.style,o=lr(e);if(void 0===e)return[];if("object"!==o)return[new nt("sky",e,`object expected, ${o} found`)];let a=[];for(const s in e)a=a.concat(r[s]?t.validateSpec({key:s,value:e[s],valueSpec:r[s],style:n,styleSpec:i}):[new nt(s,e[s],`unknown property "${s}"`)]);return a}function nn(t){const e=t.value,i=t.styleSpec,r=i.terrain,n=t.style;let o=[];const a=lr(e);if(void 0===e)return o;if("object"!==a)return o=o.concat([new nt("terrain",e,`object expected, ${a} found`)]),o;for(const s in e)o=o.concat(r[s]?t.validateSpec({key:s,value:e[s],valueSpec:r[s],validateSpec:t.validateSpec,style:n,styleSpec:i}):[new nt(s,e[s],`unknown property "${s}"`)]);return o}function on(t){let e=[];const i=t.value,r=t.key;if(Array.isArray(i)){const n=[],o=[];for(const a in i)i[a].id&&n.includes(i[a].id)&&e.push(new nt(r,i,`all the sprites' ids must be unique, but ${i[a].id} is duplicated`)),n.push(i[a].id),i[a].url&&o.includes(i[a].url)&&e.push(new nt(r,i,`all the sprites' URLs must be unique, but ${i[a].url} is duplicated`)),o.push(i[a].url),e=e.concat(jr({key:`${r}[${a}]`,value:i[a],valueSpec:{id:{type:"string",required:!0},url:{type:"string",required:!0}},validateSpec:t.validateSpec}));return e}return Yr({key:r,value:i})}const an={"*":()=>[],array:Vr,boolean:function(t){const e=t.value,i=t.key,r=lr(e);return"boolean"!==r?[new nt(i,e,`boolean expected, ${r} found`)]:[]},number:Ur,color:function(t){const e=t.key,i=t.value,r=lr(i);return"string"!==r?[new nt(e,i,`color expected, ${r} found`)]:Zt.parse(String(i))?[]:[new nt(e,i,`color expected, "${i}" found`)]},constants:Fr,enum:Gr,filter:Hr,function:qr,layer:Kr,object:jr,source:tn,light:en,sky:rn,terrain:nn,projection:function(t){const e=t.value,i=t.styleSpec,r=i.projection,n=t.style,o=lr(e);if(void 0===e)return[];if("object"!==o)return[new nt("projection",e,`object expected, ${o} found`)];let a=[];for(const s in e)a=a.concat(r[s]?t.validateSpec({key:s,value:e[s],valueSpec:r[s],style:n,styleSpec:i}):[new nt(s,e[s],`unknown property "${s}"`)]);return a},string:Yr,formatted:function(t){return 0===Yr(t).length?[]:$r(t)},resolvedImage:function(t){return 0===Yr(t).length?[]:$r(t)},padding:function(t){const e=t.key,i=t.value;if("array"===lr(i)){if(i.length<1||i.length>4)return[new nt(e,i,`padding requires 1 to 4 values; ${i.length} values found`)];const r={type:"number"};let n=[];for(let o=0;o<i.length;o++)n=n.concat(t.validateSpec({key:`${e}[${o}]`,value:i[o],validateSpec:t.validateSpec,valueSpec:r}));return n}return Ur({key:e,value:i,valueSpec:{}})},variableAnchorOffsetCollection:function(t){const e=t.key,i=t.value,r=lr(i),n=t.styleSpec;if("array"!==r||i.length<1||i.length%2!=0)return[new nt(e,i,"variableAnchorOffsetCollection requires a non-empty array of even length")];let o=[];for(let a=0;a<i.length;a+=2)o=o.concat(Gr({key:`${e}[${a}]`,value:i[a],valueSpec:n.layout_symbol["text-anchor"]})),o=o.concat(Vr({key:`${e}[${a+1}]`,value:i[a+1],valueSpec:{length:2,value:"number"},validateSpec:t.validateSpec,style:t.style,styleSpec:n}));return o},sprite:on};function sn(t){const e=t.value,i=t.valueSpec,r=t.styleSpec;return t.validateSpec=sn,i.expression&&cr(Br(e))?qr(t):i.expression&&_r(Nr(e))?$r(t):i.type&&an[i.type]?an[i.type](t):jr(ot({},t,{valueSpec:i.type?r[i.type]:i}))}function ln(t){const e=t.value,i=t.key,r=Yr(t);return r.length||(-1===e.indexOf("{fontstack}")&&r.push(new nt(i,e,'"glyphs" url must include a "{fontstack}" token')),-1===e.indexOf("{range}")&&r.push(new nt(i,e,'"glyphs" url must include a "{range}" token'))),r}function cn(t,e=H){let i=[];return i=i.concat(sn({key:"",value:t,valueSpec:e.$root,styleSpec:e,style:t,validateSpec:sn,objectElementValidators:{glyphs:ln,"*":()=>[]}})),t.constants&&(i=i.concat(Fr({key:"constants",value:t.constants}))),hn(i)}function un(t){return function(e){return t({...e,validateSpec:sn})}}function hn(t){return[].concat(t).sort(((t,e)=>t.line-e.line))}function dn(t){return function(...e){return hn(t.apply(this,e))}}cn.source=dn(un(tn)),cn.sprite=dn(un(on)),cn.glyphs=dn(un(ln)),cn.light=dn(un(en)),cn.sky=dn(un(rn)),cn.terrain=dn(un(nn)),cn.layer=dn(un(Kr)),cn.filter=dn(un(Hr)),cn.paintProperty=dn(un(Xr)),cn.layoutProperty=dn(un(Jr));const pn=cn,fn=pn.light,mn=pn.sky,gn=pn.paintProperty,yn=pn.layoutProperty;function _n(t,e){let i=!1;if(e&&e.length)for(const r of e)t.fire(new $(new Error(r.message))),i=!0;return i}class vn{constructor(t,e,i){const r=this.cells=[];if(t instanceof ArrayBuffer){this.arrayBuffer=t;const n=new Int32Array(this.arrayBuffer);t=n[0],this.d=(e=n[1])+2*(i=n[2]);for(let t=0;t<this.d*this.d;t++){const e=n[3+t],i=n[3+t+1];r.push(e===i?null:n.subarray(e,i))}const o=n[3+r.length+1];this.keys=n.subarray(n[3+r.length],o),this.bboxes=n.subarray(o),this.insert=this._insertReadonly}else{this.d=e+2*i;for(let t=0;t<this.d*this.d;t++)r.push([]);this.keys=[],this.bboxes=[]}this.n=e,this.extent=t,this.padding=i,this.scale=e/t,this.uid=0;const n=i/e*t;this.min=-n,this.max=t+n}insert(t,e,i,r,n){this._forEachCell(e,i,r,n,this._insertCell,this.uid++,void 0,void 0),this.keys.push(t),this.bboxes.push(e),this.bboxes.push(i),this.bboxes.push(r),this.bboxes.push(n)}_insertReadonly(){throw new Error("Cannot insert into a GridIndex created from an ArrayBuffer.")}_insertCell(t,e,i,r,n,o){this.cells[n].push(o)}query(t,e,i,r,n){const o=this.min,a=this.max;if(t<=o&&e<=o&&a<=i&&a<=r&&!n)return Array.prototype.slice.call(this.keys);{const o=[];return this._forEachCell(t,e,i,r,this._queryCell,o,{},n),o}}_queryCell(t,e,i,r,n,o,a,s){const l=this.cells[n];if(null!==l){const n=this.keys,c=this.bboxes;for(let u=0;u<l.length;u++){const h=l[u];if(void 0===a[h]){const l=4*h;(s?s(c[l+0],c[l+1],c[l+2],c[l+3]):t<=c[l+2]&&e<=c[l+3]&&i>=c[l+0]&&r>=c[l+1])?(a[h]=!0,o.push(n[h])):a[h]=!1}}}}_forEachCell(t,e,i,r,n,o,a,s){const l=this._convertToCellCoord(t),c=this._convertToCellCoord(e),u=this._convertToCellCoord(i),h=this._convertToCellCoord(r);for(let d=l;d<=u;d++)for(let l=c;l<=h;l++){const c=this.d*l+d;if((!s||s(this._convertFromCellCoord(d),this._convertFromCellCoord(l),this._convertFromCellCoord(d+1),this._convertFromCellCoord(l+1)))&&n.call(this,t,e,i,r,c,o,a,s))return}}_convertFromCellCoord(t){return(t-this.padding)/this.scale}_convertToCellCoord(t){return Math.max(0,Math.min(this.d-1,Math.floor(t*this.scale)+this.padding))}toArrayBuffer(){if(this.arrayBuffer)return this.arrayBuffer;const t=this.cells,e=3+this.cells.length+1+1;let i=0;for(let o=0;o<this.cells.length;o++)i+=this.cells[o].length;const r=new Int32Array(e+i+this.keys.length+this.bboxes.length);r[0]=this.extent,r[1]=this.n,r[2]=this.padding;let n=e;for(let o=0;o<t.length;o++){const e=t[o];r[3+o]=n,r.set(e,n),n+=e.length}return r[3+t.length]=n,r.set(this.keys,n),n+=this.keys.length,r[3+t.length+1]=n,r.set(this.bboxes,n),n+=this.bboxes.length,r.buffer}static serialize(t,e){const i=t.toArrayBuffer();return e&&e.push(i),{buffer:i}}static deserialize(t){return new vn(t.buffer)}}const bn={};function xn(t,e,i={}){if(bn[t])throw new Error(`${t} is already registered.`);Object.defineProperty(e,"_classRegistryKey",{value:t,writeable:!1}),bn[t]={klass:e,omit:i.omit||[],shallow:i.shallow||[]}}xn("Object",Object),xn("TransferableGridIndex",vn),xn("Color",Zt),xn("Error",Error),xn("AJAXError",F),xn("ResolvedImage",te),xn("StylePropertyFunction",kr),xn("StyleExpression",yr,{omit:["_evaluator"]}),xn("ZoomDependentExpression",xr),xn("ZoomConstantExpression",br),xn("CompoundExpression",Wi,{omit:["_evaluate"]});for(const Nh in Zi)Zi[Nh]._classRegistryKey||xn(`Expression_${Nh}`,Zi[Nh]);function wn(t){return t&&"undefined"!=typeof ArrayBuffer&&(t instanceof ArrayBuffer||t.constructor&&"ArrayBuffer"===t.constructor.name)}function kn(t){return t.$name||t.constructor._classRegistryKey}function En(t){return!function(t){if(null===t||"object"!=typeof t)return!1;const e=kn(t);return!(!e||"Object"===e)}(t)&&(null==t||"boolean"==typeof t||"number"==typeof t||"string"==typeof t||t instanceof Boolean||t instanceof Number||t instanceof String||t instanceof Date||t instanceof RegExp||t instanceof Blob||t instanceof Error||wn(t)||C(t)||ArrayBuffer.isView(t)||t instanceof ImageData)}function Sn(t,e){if(En(t))return(wn(t)||C(t))&&e&&e.push(t),ArrayBuffer.isView(t)&&e&&e.push(t.buffer),t instanceof ImageData&&e&&e.push(t.data.buffer),t;if(Array.isArray(t)){const i=[];for(const r of t)i.push(Sn(r,e));return i}if("object"!=typeof t)throw new Error("can't serialize object of type "+typeof t);const i=kn(t);if(!i)throw new Error(`can't serialize object of unregistered class ${t.constructor.name}`);if(!bn[i])throw new Error(`${i} is not registered.`);const{klass:r}=bn[i],n=r.serialize?r.serialize(t,e):{};if(r.serialize){if(e&&n===e[e.length-1])throw new Error("statically serialized object won't survive transfer of $name property")}else{for(const r in t){if(!t.hasOwnProperty(r))continue;if(bn[i].omit.indexOf(r)>=0)continue;const o=t[r];n[r]=bn[i].shallow.indexOf(r)>=0?o:Sn(o,e)}t instanceof Error&&(n.message=t.message)}if(n.$name)throw new Error("$name property is reserved for worker serialization logic.");return"Object"!==i&&(n.$name=i),n}function In(t){if(En(t))return t;if(Array.isArray(t))return t.map(In);if("object"!=typeof t)throw new Error("can't deserialize object of type "+typeof t);const e=kn(t)||"Object";if(!bn[e])throw new Error(`can't deserialize unregistered class ${e}`);const{klass:i}=bn[e];if(!i)throw new Error(`can't deserialize unregistered class ${e}`);if(i.deserialize)return i.deserialize(t);const r=Object.create(i.prototype);for(const n of Object.keys(t)){if("$name"===n)continue;const i=t[n];r[n]=bn[e].shallow.indexOf(n)>=0?i:In(i)}return r}class Cn{constructor(){this.first=!0}update(t,e){const i=Math.floor(t);return this.first?(this.first=!1,this.lastIntegerZoom=i,this.lastIntegerZoomTime=0,this.lastZoom=t,this.lastFloorZoom=i,!0):(this.lastFloorZoom>i?(this.lastIntegerZoom=i+1,this.lastIntegerZoomTime=e):this.lastFloorZoom<i&&(this.lastIntegerZoom=i,this.lastIntegerZoomTime=e),t!==this.lastZoom&&(this.lastZoom=t,this.lastFloorZoom=i,!0))}}const Tn={"Latin-1 Supplement":t=>t>=128&&t<=255,"Hangul Jamo":t=>t>=4352&&t<=4607,Khmer:t=>t>=6016&&t<=6143,"General Punctuation":t=>t>=8192&&t<=8303,"Letterlike Symbols":t=>t>=8448&&t<=8527,"Number Forms":t=>t>=8528&&t<=8591,"Miscellaneous Technical":t=>t>=8960&&t<=9215,"Control Pictures":t=>t>=9216&&t<=9279,"Optical Character Recognition":t=>t>=9280&&t<=9311,"Enclosed Alphanumerics":t=>t>=9312&&t<=9471,"Geometric Shapes":t=>t>=9632&&t<=9727,"Miscellaneous Symbols":t=>t>=9728&&t<=9983,"Miscellaneous Symbols and Arrows":t=>t>=11008&&t<=11263,"Ideographic Description Characters":t=>t>=12272&&t<=12287,"CJK Symbols and Punctuation":t=>t>=12288&&t<=12351,Katakana:t=>t>=12448&&t<=12543,Kanbun:t=>t>=12688&&t<=12703,"CJK Strokes":t=>t>=12736&&t<=12783,"Enclosed CJK Letters and Months":t=>t>=12800&&t<=13055,"CJK Compatibility":t=>t>=13056&&t<=13311,"Yijing Hexagram Symbols":t=>t>=19904&&t<=19967,"Private Use Area":t=>t>=57344&&t<=63743,"Vertical Forms":t=>t>=65040&&t<=65055,"CJK Compatibility Forms":t=>t>=65072&&t<=65103,"Small Form Variants":t=>t>=65104&&t<=65135,"Halfwidth and Fullwidth Forms":t=>t>=65280&&t<=65519};function An(t){for(const e of t)if(Rn(e.charCodeAt(0)))return!0;return!1}function Pn(t){for(const e of t)if(!zn(e.charCodeAt(0)))return!1;return!0}function Mn(t){const e=t.map((t=>{try{return new RegExp(`\\p{sc=${t}}`,"u").source}catch(t){return null}})).filter((t=>t));return new RegExp(e.join("|"),"u")}const Ln=Mn(["Arab","Dupl","Mong","Ougr","Syrc"]);function zn(t){return!Ln.test(String.fromCodePoint(t))}const Dn=Mn(["Bopo","Hani","Hira","Kana","Kits","Nshu","Tang","Yiii"]);function Rn(t){return!(746!==t&&747!==t&&(t<4352||!(Tn["CJK Compatibility Forms"](t)&&!(t>=65097&&t<=65103)||Tn["CJK Compatibility"](t)||Tn["CJK Strokes"](t)||!(!Tn["CJK Symbols and Punctuation"](t)||t>=12296&&t<=12305||t>=12308&&t<=12319||12336===t)||Tn["Enclosed CJK Letters and Months"](t)||Tn["Ideographic Description Characters"](t)||Tn.Kanbun(t)||Tn.Katakana(t)&&12540!==t||!(!Tn["Halfwidth and Fullwidth Forms"](t)||65288===t||65289===t||65293===t||t>=65306&&t<=65310||65339===t||65341===t||65343===t||t>=65371&&t<=65503||65507===t||t>=65512&&t<=65519)||!(!Tn["Small Form Variants"](t)||t>=65112&&t<=65118||t>=65123&&t<=65126)||Tn["Vertical Forms"](t)||Tn["Yijing Hexagram Symbols"](t)||/\p{sc=Cans}/u.test(String.fromCodePoint(t))||/\p{sc=Hang}/u.test(String.fromCodePoint(t))||Dn.test(String.fromCodePoint(t)))))}function On(t){return!(Rn(t)||function(t){return!!(Tn["Latin-1 Supplement"](t)&&(167===t||169===t||174===t||177===t||188===t||189===t||190===t||215===t||247===t)||Tn["General Punctuation"](t)&&(8214===t||8224===t||8225===t||8240===t||8241===t||8251===t||8252===t||8258===t||8263===t||8264===t||8265===t||8273===t)||Tn["Letterlike Symbols"](t)||Tn["Number Forms"](t)||Tn["Miscellaneous Technical"](t)&&(t>=8960&&t<=8967||t>=8972&&t<=8991||t>=8996&&t<=9e3||9003===t||t>=9085&&t<=9114||t>=9150&&t<=9165||9167===t||t>=9169&&t<=9179||t>=9186&&t<=9215)||Tn["Control Pictures"](t)&&9251!==t||Tn["Optical Character Recognition"](t)||Tn["Enclosed Alphanumerics"](t)||Tn["Geometric Shapes"](t)||Tn["Miscellaneous Symbols"](t)&&!(t>=9754&&t<=9759)||Tn["Miscellaneous Symbols and Arrows"](t)&&(t>=11026&&t<=11055||t>=11088&&t<=11097||t>=11192&&t<=11243)||Tn["CJK Symbols and Punctuation"](t)||Tn.Katakana(t)||Tn["Private Use Area"](t)||Tn["CJK Compatibility Forms"](t)||Tn["Small Form Variants"](t)||Tn["Halfwidth and Fullwidth Forms"](t)||8734===t||8756===t||8757===t||t>=9984&&t<=10087||t>=10102&&t<=10131||65532===t||65533===t)}(t))}const Fn=Mn(["Adlm","Arab","Armi","Avst","Chrs","Cprt","Egyp","Elym","Gara","Hatr","Hebr","Hung","Khar","Lydi","Mand","Mani","Mend","Merc","Mero","Narb","Nbat","Nkoo","Orkh","Palm","Phli","Phlp","Phnx","Prti","Rohg","Samr","Sarb","Sogo","Syrc","Thaa","Todr","Yezi"]);function Bn(t){return Fn.test(String.fromCodePoint(t))}function Nn(t,e){return!(!e&&Bn(t)||t>=2304&&t<=3583||t>=3840&&t<=4255||Tn.Khmer(t))}function jn(t){for(const e of t)if(Bn(e.charCodeAt(0)))return!0;return!1}const Vn=new class{constructor(){this.applyArabicShaping=null,this.processBidirectionalText=null,this.processStyledBidirectionalText=null,this.pluginStatus="unavailable",this.pluginURL=null}setState(t){this.pluginStatus=t.pluginStatus,this.pluginURL=t.pluginURL}getState(){return{pluginStatus:this.pluginStatus,pluginURL:this.pluginURL}}setMethods(t){this.applyArabicShaping=t.applyArabicShaping,this.processBidirectionalText=t.processBidirectionalText,this.processStyledBidirectionalText=t.processStyledBidirectionalText}isParsed(){return null!=this.applyArabicShaping&&null!=this.processBidirectionalText&&null!=this.processStyledBidirectionalText}getPluginURL(){return this.pluginURL}getRTLTextPluginStatus(){return this.pluginStatus}};class Un{constructor(t,e){this.zoom=t,e?(this.now=e.now,this.fadeDuration=e.fadeDuration,this.zoomHistory=e.zoomHistory,this.transition=e.transition):(this.now=0,this.fadeDuration=0,this.zoomHistory=new Cn,this.transition={})}isSupportedScript(t){return function(t,e){for(const i of t)if(!Nn(i.charCodeAt(0),e))return!1;return!0}(t,"loaded"===Vn.getRTLTextPluginStatus())}crossFadingFactor(){return 0===this.fadeDuration?1:Math.min((this.now-this.zoomHistory.lastIntegerZoomTime)/this.fadeDuration,1)}getCrossfadeParameters(){const t=this.zoom,e=t-Math.floor(t),i=this.crossFadingFactor();return t>this.zoomHistory.lastIntegerZoom?{fromScale:2,toScale:1,t:e+(1-e)*i}:{fromScale:.5,toScale:1,t:1-(1-i)*e}}}class qn{constructor(t,e){this.property=t,this.value=e,this.expression=function(t,e){if(cr(t))return new kr(t,e);if(_r(t)){const i=wr(t,e);if("error"===i.result)throw new Error(i.value.map((t=>`${t.key}: ${t.message}`)).join(", "));return i.value}{let i=t;return"color"===e.type&&"string"==typeof t?i=Zt.parse(t):"padding"!==e.type||"number"!=typeof t&&!Array.isArray(t)?"variableAnchorOffsetCollection"===e.type&&Array.isArray(t)&&(i=Qt.parse(t)):i=Kt.parse(t),{kind:"constant",evaluate:()=>i}}}(void 0===e?t.specification.default:e,t.specification)}isDataDriven(){return"source"===this.expression.kind||"composite"===this.expression.kind}possiblyEvaluate(t,e,i){return this.property.possiblyEvaluate(this,t,e,i)}}class $n{constructor(t){this.property=t,this.value=new qn(t,void 0)}transitioned(t,e){return new Hn(this.property,this.value,e,y({},t.transition,this.transition),t.now)}untransitioned(){return new Hn(this.property,this.value,null,{},0)}}class Gn{constructor(t){this._properties=t,this._values=Object.create(t.defaultTransitionablePropertyValues)}getValue(t){return x(this._values[t].value.value)}setValue(t,e){Object.prototype.hasOwnProperty.call(this._values,t)||(this._values[t]=new $n(this._values[t].property)),this._values[t].value=new qn(this._values[t].property,null===e?void 0:x(e))}getTransition(t){return x(this._values[t].transition)}setTransition(t,e){Object.prototype.hasOwnProperty.call(this._values,t)||(this._values[t]=new $n(this._values[t].property)),this._values[t].transition=x(e)||void 0}serialize(){const t={};for(const e of Object.keys(this._values)){const i=this.getValue(e);void 0!==i&&(t[e]=i);const r=this.getTransition(e);void 0!==r&&(t[`${e}-transition`]=r)}return t}transitioned(t,e){const i=new Zn(this._properties);for(const r of Object.keys(this._values))i._values[r]=this._values[r].transitioned(t,e._values[r]);return i}untransitioned(){const t=new Zn(this._properties);for(const e of Object.keys(this._values))t._values[e]=this._values[e].untransitioned();return t}}class Hn{constructor(t,e,i,r,n){this.property=t,this.value=e,this.begin=n+r.delay||0,this.end=this.begin+r.duration||0,t.specification.transition&&(r.delay||r.duration)&&(this.prior=i)}possiblyEvaluate(t,e,i){const r=t.now||0,n=this.value.possiblyEvaluate(t,e,i),o=this.prior;if(o){if(r>this.end)return this.prior=null,n;if(this.value.isDataDriven())return this.prior=null,n;if(r<this.begin)return o.possiblyEvaluate(t,e,i);{const a=(r-this.begin)/(this.end-this.begin);return this.property.interpolate(o.possiblyEvaluate(t,e,i),n,function(t){if(t<=0)return 0;if(t>=1)return 1;const e=t*t,i=e*t;return 4*(t<.5?i:3*(t-e)+i-.75)}(a))}}return n}}class Zn{constructor(t){this._properties=t,this._values=Object.create(t.defaultTransitioningPropertyValues)}possiblyEvaluate(t,e,i){const r=new Jn(this._properties);for(const n of Object.keys(this._values))r._values[n]=this._values[n].possiblyEvaluate(t,e,i);return r}hasTransition(){for(const t of Object.keys(this._values))if(this._values[t].prior)return!0;return!1}}class Wn{constructor(t){this._properties=t,this._values=Object.create(t.defaultPropertyValues)}hasValue(t){return void 0!==this._values[t].value}getValue(t){return x(this._values[t].value)}setValue(t,e){this._values[t]=new qn(this._values[t].property,null===e?void 0:x(e))}serialize(){const t={};for(const e of Object.keys(this._values)){const i=this.getValue(e);void 0!==i&&(t[e]=i)}return t}possiblyEvaluate(t,e,i){const r=new Jn(this._properties);for(const n of Object.keys(this._values))r._values[n]=this._values[n].possiblyEvaluate(t,e,i);return r}}class Xn{constructor(t,e,i){this.property=t,this.value=e,this.parameters=i}isConstant(){return"constant"===this.value.kind}constantOr(t){return"constant"===this.value.kind?this.value.value:t}evaluate(t,e,i,r){return this.property.evaluate(this.value,this.parameters,t,e,i,r)}}class Jn{constructor(t){this._properties=t,this._values=Object.create(t.defaultPossiblyEvaluatedValues)}get(t){return this._values[t]}}class Kn{constructor(t){this.specification=t}possiblyEvaluate(t,e){if(t.isDataDriven())throw new Error("Value should not be data driven");return t.expression.evaluate(e)}interpolate(t,e,i){const r=Pe[this.specification.type];return r?r(t,e,i):t}}class Yn{constructor(t,e){this.specification=t,this.overrides=e}possiblyEvaluate(t,e,i,r){return new Xn(this,"constant"===t.expression.kind||"camera"===t.expression.kind?{kind:"constant",value:t.expression.evaluate(e,null,{},i,r)}:t.expression,e)}interpolate(t,e,i){if("constant"!==t.value.kind||"constant"!==e.value.kind)return t;if(void 0===t.value.value||void 0===e.value.value)return new Xn(this,{kind:"constant",value:void 0},t.parameters);const r=Pe[this.specification.type];if(r){const n=r(t.value.value,e.value.value,i);return new Xn(this,{kind:"constant",value:n},t.parameters)}return t}evaluate(t,e,i,r,n,o){return"constant"===t.kind?t.value:t.evaluate(e,i,r,n,o)}}class Qn extends Yn{possiblyEvaluate(t,e,i,r){if(void 0===t.value)return new Xn(this,{kind:"constant",value:void 0},e);if("constant"===t.expression.kind){const n=t.expression.evaluate(e,null,{},i,r),o="resolvedImage"===t.property.specification.type&&"string"!=typeof n?n.name:n,a=this._calculate(o,o,o,e);return new Xn(this,{kind:"constant",value:a},e)}if("camera"===t.expression.kind){const i=this._calculate(t.expression.evaluate({zoom:e.zoom-1}),t.expression.evaluate({zoom:e.zoom}),t.expression.evaluate({zoom:e.zoom+1}),e);return new Xn(this,{kind:"constant",value:i},e)}return new Xn(this,t.expression,e)}evaluate(t,e,i,r,n,o){if("source"===t.kind){const a=t.evaluate(e,i,r,n,o);return this._calculate(a,a,a,e)}return"composite"===t.kind?this._calculate(t.evaluate({zoom:Math.floor(e.zoom)-1},i,r),t.evaluate({zoom:Math.floor(e.zoom)},i,r),t.evaluate({zoom:Math.floor(e.zoom)+1},i,r),e):t.value}_calculate(t,e,i,r){return r.zoom>r.zoomHistory.lastIntegerZoom?{from:t,to:e}:{from:i,to:e}}interpolate(t){return t}}class to{constructor(t){this.specification=t}possiblyEvaluate(t,e,i,r){if(void 0!==t.value){if("constant"===t.expression.kind){const n=t.expression.evaluate(e,null,{},i,r);return this._calculate(n,n,n,e)}return this._calculate(t.expression.evaluate(new Un(Math.floor(e.zoom-1),e)),t.expression.evaluate(new Un(Math.floor(e.zoom),e)),t.expression.evaluate(new Un(Math.floor(e.zoom+1),e)),e)}}_calculate(t,e,i,r){return r.zoom>r.zoomHistory.lastIntegerZoom?{from:t,to:e}:{from:i,to:e}}interpolate(t){return t}}class eo{constructor(t){this.specification=t}possiblyEvaluate(t,e,i,r){return!!t.expression.evaluate(e,null,{},i,r)}interpolate(){return!1}}class io{constructor(t){this.properties=t,this.defaultPropertyValues={},this.defaultTransitionablePropertyValues={},this.defaultTransitioningPropertyValues={},this.defaultPossiblyEvaluatedValues={},this.overridableProperties=[];for(const e in t){const i=t[e];i.specification.overridable&&this.overridableProperties.push(e);const r=this.defaultPropertyValues[e]=new qn(i,void 0),n=this.defaultTransitionablePropertyValues[e]=new $n(i);this.defaultTransitioningPropertyValues[e]=n.untransitioned(),this.defaultPossiblyEvaluatedValues[e]=r.possiblyEvaluate({})}}}xn("DataDrivenProperty",Yn),xn("DataConstantProperty",Kn),xn("CrossFadedDataDrivenProperty",Qn),xn("CrossFadedProperty",to),xn("ColorRampProperty",eo);const ro="-transition";class no extends G{constructor(t,e){if(super(),this.id=t.id,this.type=t.type,this._featureFilter={filter:()=>!0,needGeometry:!1},"custom"!==t.type&&(this.metadata=t.metadata,this.minzoom=t.minzoom,this.maxzoom=t.maxzoom,"background"!==t.type&&(this.source=t.source,this.sourceLayer=t["source-layer"],this.filter=t.filter),e.layout&&(this._unevaluatedLayout=new Wn(e.layout)),e.paint)){this._transitionablePaint=new Gn(e.paint);for(const e in t.paint)this.setPaintProperty(e,t.paint[e],{validate:!1});for(const e in t.layout)this.setLayoutProperty(e,t.layout[e],{validate:!1});this._transitioningPaint=this._transitionablePaint.untransitioned(),this.paint=new Jn(e.paint)}}getCrossfadeParameters(){return this._crossfadeParameters}getLayoutProperty(t){return"visibility"===t?this.visibility:this._unevaluatedLayout.getValue(t)}setLayoutProperty(t,e,i={}){null!=e&&this._validate(yn,`layers.${this.id}.layout.${t}`,t,e,i)||("visibility"!==t?this._unevaluatedLayout.setValue(t,e):this.visibility=e)}getPaintProperty(t){return t.endsWith(ro)?this._transitionablePaint.getTransition(t.slice(0,-11)):this._transitionablePaint.getValue(t)}setPaintProperty(t,e,i={}){if(null!=e&&this._validate(gn,`layers.${this.id}.paint.${t}`,t,e,i))return!1;if(t.endsWith(ro))return this._transitionablePaint.setTransition(t.slice(0,-11),e||void 0),!1;{const i=this._transitionablePaint._values[t],r="cross-faded-data-driven"===i.property.specification["property-type"],n=i.value.isDataDriven(),o=i.value;this._transitionablePaint.setValue(t,e),this._handleSpecialPaintPropertyUpdate(t);const a=this._transitionablePaint._values[t].value;return a.isDataDriven()||n||r||this._handleOverridablePaintPropertyUpdate(t,o,a)}}_handleSpecialPaintPropertyUpdate(t){}_handleOverridablePaintPropertyUpdate(t,e,i){return!1}isHidden(t){return!!(this.minzoom&&t<this.minzoom)||!!(this.maxzoom&&t>=this.maxzoom)||"none"===this.visibility}updateTransitions(t){this._transitioningPaint=this._transitionablePaint.transitioned(t,this._transitioningPaint)}hasTransition(){return this._transitioningPaint.hasTransition()}recalculate(t,e){t.getCrossfadeParameters&&(this._crossfadeParameters=t.getCrossfadeParameters()),this._unevaluatedLayout&&(this.layout=this._unevaluatedLayout.possiblyEvaluate(t,void 0,e)),this.paint=this._transitioningPaint.possiblyEvaluate(t,void 0,e)}serialize(){const t={id:this.id,type:this.type,source:this.source,"source-layer":this.sourceLayer,metadata:this.metadata,minzoom:this.minzoom,maxzoom:this.maxzoom,filter:this.filter,layout:this._unevaluatedLayout&&this._unevaluatedLayout.serialize(),paint:this._transitionablePaint&&this._transitionablePaint.serialize()};return this.visibility&&(t.layout=t.layout||{},t.layout.visibility=this.visibility),b(t,((t,e)=>!(void 0===t||"layout"===e&&!Object.keys(t).length||"paint"===e&&!Object.keys(t).length)))}_validate(t,e,i,r,n={}){return(!n||!1!==n.validate)&&_n(this,t.call(pn,{key:e,layerType:this.type,objectKey:i,value:r,styleSpec:H,style:{glyphs:!0,sprite:!0}}))}is3D(){return!1}isTileClipped(){return!1}hasOffscreenPass(){return!1}resize(){}isStateDependent(){for(const t in this.paint._values){const e=this.paint.get(t);if(e instanceof Xn&&or(e.property.specification)&&("source"===e.value.kind||"composite"===e.value.kind)&&e.value.isStateDependent)return!0}return!1}}const oo={Int8:Int8Array,Uint8:Uint8Array,Int16:Int16Array,Uint16:Uint16Array,Int32:Int32Array,Uint32:Uint32Array,Float32:Float32Array};class ao{constructor(t,e){this._structArray=t,this._pos1=e*this.size,this._pos2=this._pos1/2,this._pos4=this._pos1/4,this._pos8=this._pos1/8}}class so{constructor(){this.isTransferred=!1,this.capacity=-1,this.resize(0)}static serialize(t,e){return t._trim(),e&&(t.isTransferred=!0,e.push(t.arrayBuffer)),{length:t.length,arrayBuffer:t.arrayBuffer}}static deserialize(t){const e=Object.create(this.prototype);return e.arrayBuffer=t.arrayBuffer,e.length=t.length,e.capacity=t.arrayBuffer.byteLength/e.bytesPerElement,e._refreshViews(),e}_trim(){this.length!==this.capacity&&(this.capacity=this.length,this.arrayBuffer=this.arrayBuffer.slice(0,this.length*this.bytesPerElement),this._refreshViews())}clear(){this.length=0}resize(t){this.reserve(t),this.length=t}reserve(t){if(t>this.capacity){this.capacity=Math.max(t,Math.floor(5*this.capacity),128),this.arrayBuffer=new ArrayBuffer(this.capacity*this.bytesPerElement);const e=this.uint8;this._refreshViews(),e&&this.uint8.set(e)}}_refreshViews(){throw new Error("_refreshViews() must be implemented by each concrete StructArray layout")}}function lo(t,e=1){let i=0,r=0;return{members:t.map((t=>{const n=oo[t.type].BYTES_PER_ELEMENT,o=i=co(i,Math.max(e,n)),a=t.components||1;return r=Math.max(r,n),i+=n*a,{name:t.name,type:t.type,components:a,offset:o}})),size:co(i,Math.max(r,e)),alignment:e}}function co(t,e){return Math.ceil(t/e)*e}class uo extends so{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(t,e){const i=this.length;return this.resize(i+1),this.emplace(i,t,e)}emplace(t,e,i){const r=2*t;return this.int16[r+0]=e,this.int16[r+1]=i,t}}uo.prototype.bytesPerElement=4,xn("StructArrayLayout2i4",uo);class ho extends so{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(t,e,i){const r=this.length;return this.resize(r+1),this.emplace(r,t,e,i)}emplace(t,e,i,r){const n=3*t;return this.int16[n+0]=e,this.int16[n+1]=i,this.int16[n+2]=r,t}}ho.prototype.bytesPerElement=6,xn("StructArrayLayout3i6",ho);class po extends so{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(t,e,i,r){const n=this.length;return this.resize(n+1),this.emplace(n,t,e,i,r)}emplace(t,e,i,r,n){const o=4*t;return this.int16[o+0]=e,this.int16[o+1]=i,this.int16[o+2]=r,this.int16[o+3]=n,t}}po.prototype.bytesPerElement=8,xn("StructArrayLayout4i8",po);class fo extends so{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(t,e,i,r,n,o){const a=this.length;return this.resize(a+1),this.emplace(a,t,e,i,r,n,o)}emplace(t,e,i,r,n,o,a){const s=6*t;return this.int16[s+0]=e,this.int16[s+1]=i,this.int16[s+2]=r,this.int16[s+3]=n,this.int16[s+4]=o,this.int16[s+5]=a,t}}fo.prototype.bytesPerElement=12,xn("StructArrayLayout2i4i12",fo);class mo extends so{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(t,e,i,r,n,o){const a=this.length;return this.resize(a+1),this.emplace(a,t,e,i,r,n,o)}emplace(t,e,i,r,n,o,a){const s=4*t,l=8*t;return this.int16[s+0]=e,this.int16[s+1]=i,this.uint8[l+4]=r,this.uint8[l+5]=n,this.uint8[l+6]=o,this.uint8[l+7]=a,t}}mo.prototype.bytesPerElement=8,xn("StructArrayLayout2i4ub8",mo);class go extends so{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(t,e){const i=this.length;return this.resize(i+1),this.emplace(i,t,e)}emplace(t,e,i){const r=2*t;return this.float32[r+0]=e,this.float32[r+1]=i,t}}go.prototype.bytesPerElement=8,xn("StructArrayLayout2f8",go);class yo extends so{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(t,e,i,r,n,o,a,s,l,c){const u=this.length;return this.resize(u+1),this.emplace(u,t,e,i,r,n,o,a,s,l,c)}emplace(t,e,i,r,n,o,a,s,l,c,u){const h=10*t;return this.uint16[h+0]=e,this.uint16[h+1]=i,this.uint16[h+2]=r,this.uint16[h+3]=n,this.uint16[h+4]=o,this.uint16[h+5]=a,this.uint16[h+6]=s,this.uint16[h+7]=l,this.uint16[h+8]=c,this.uint16[h+9]=u,t}}yo.prototype.bytesPerElement=20,xn("StructArrayLayout10ui20",yo);class _o extends so{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(t,e,i,r,n,o,a,s,l,c,u,h){const d=this.length;return this.resize(d+1),this.emplace(d,t,e,i,r,n,o,a,s,l,c,u,h)}emplace(t,e,i,r,n,o,a,s,l,c,u,h,d){const p=12*t;return this.int16[p+0]=e,this.int16[p+1]=i,this.int16[p+2]=r,this.int16[p+3]=n,this.uint16[p+4]=o,this.uint16[p+5]=a,this.uint16[p+6]=s,this.uint16[p+7]=l,this.int16[p+8]=c,this.int16[p+9]=u,this.int16[p+10]=h,this.int16[p+11]=d,t}}_o.prototype.bytesPerElement=24,xn("StructArrayLayout4i4ui4i24",_o);class vo extends so{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(t,e,i){const r=this.length;return this.resize(r+1),this.emplace(r,t,e,i)}emplace(t,e,i,r){const n=3*t;return this.float32[n+0]=e,this.float32[n+1]=i,this.float32[n+2]=r,t}}vo.prototype.bytesPerElement=12,xn("StructArrayLayout3f12",vo);class bo extends so{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer)}emplaceBack(t){const e=this.length;return this.resize(e+1),this.emplace(e,t)}emplace(t,e){return this.uint32[1*t+0]=e,t}}bo.prototype.bytesPerElement=4,xn("StructArrayLayout1ul4",bo);class xo extends so{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(t,e,i,r,n,o,a,s,l){const c=this.length;return this.resize(c+1),this.emplace(c,t,e,i,r,n,o,a,s,l)}emplace(t,e,i,r,n,o,a,s,l,c){const u=10*t,h=5*t;return this.int16[u+0]=e,this.int16[u+1]=i,this.int16[u+2]=r,this.int16[u+3]=n,this.int16[u+4]=o,this.int16[u+5]=a,this.uint32[h+3]=s,this.uint16[u+8]=l,this.uint16[u+9]=c,t}}xo.prototype.bytesPerElement=20,xn("StructArrayLayout6i1ul2ui20",xo);class wo extends so{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(t,e,i,r,n,o){const a=this.length;return this.resize(a+1),this.emplace(a,t,e,i,r,n,o)}emplace(t,e,i,r,n,o,a){const s=6*t;return this.int16[s+0]=e,this.int16[s+1]=i,this.int16[s+2]=r,this.int16[s+3]=n,this.int16[s+4]=o,this.int16[s+5]=a,t}}wo.prototype.bytesPerElement=12,xn("StructArrayLayout2i2i2i12",wo);class ko extends so{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(t,e,i,r,n){const o=this.length;return this.resize(o+1),this.emplace(o,t,e,i,r,n)}emplace(t,e,i,r,n,o){const a=4*t,s=8*t;return this.float32[a+0]=e,this.float32[a+1]=i,this.float32[a+2]=r,this.int16[s+6]=n,this.int16[s+7]=o,t}}ko.prototype.bytesPerElement=16,xn("StructArrayLayout2f1f2i16",ko);class Eo extends so{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(t,e,i,r,n,o){const a=this.length;return this.resize(a+1),this.emplace(a,t,e,i,r,n,o)}emplace(t,e,i,r,n,o,a){const s=16*t,l=4*t,c=8*t;return this.uint8[s+0]=e,this.uint8[s+1]=i,this.float32[l+1]=r,this.float32[l+2]=n,this.int16[c+6]=o,this.int16[c+7]=a,t}}Eo.prototype.bytesPerElement=16,xn("StructArrayLayout2ub2f2i16",Eo);class So extends so{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(t,e,i){const r=this.length;return this.resize(r+1),this.emplace(r,t,e,i)}emplace(t,e,i,r){const n=3*t;return this.uint16[n+0]=e,this.uint16[n+1]=i,this.uint16[n+2]=r,t}}So.prototype.bytesPerElement=6,xn("StructArrayLayout3ui6",So);class Io extends so{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(t,e,i,r,n,o,a,s,l,c,u,h,d,p,f,m,g){const y=this.length;return this.resize(y+1),this.emplace(y,t,e,i,r,n,o,a,s,l,c,u,h,d,p,f,m,g)}emplace(t,e,i,r,n,o,a,s,l,c,u,h,d,p,f,m,g,y){const _=24*t,v=12*t,b=48*t;return this.int16[_+0]=e,this.int16[_+1]=i,this.uint16[_+2]=r,this.uint16[_+3]=n,this.uint32[v+2]=o,this.uint32[v+3]=a,this.uint32[v+4]=s,this.uint16[_+10]=l,this.uint16[_+11]=c,this.uint16[_+12]=u,this.float32[v+7]=h,this.float32[v+8]=d,this.uint8[b+36]=p,this.uint8[b+37]=f,this.uint8[b+38]=m,this.uint32[v+10]=g,this.int16[_+22]=y,t}}Io.prototype.bytesPerElement=48,xn("StructArrayLayout2i2ui3ul3ui2f3ub1ul1i48",Io);class Co extends so{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(t,e,i,r,n,o,a,s,l,c,u,h,d,p,f,m,g,y,_,v,b,x,w,k,E,S,I,C){const T=this.length;return this.resize(T+1),this.emplace(T,t,e,i,r,n,o,a,s,l,c,u,h,d,p,f,m,g,y,_,v,b,x,w,k,E,S,I,C)}emplace(t,e,i,r,n,o,a,s,l,c,u,h,d,p,f,m,g,y,_,v,b,x,w,k,E,S,I,C,T){const A=32*t,P=16*t;return this.int16[A+0]=e,this.int16[A+1]=i,this.int16[A+2]=r,this.int16[A+3]=n,this.int16[A+4]=o,this.int16[A+5]=a,this.int16[A+6]=s,this.int16[A+7]=l,this.uint16[A+8]=c,this.uint16[A+9]=u,this.uint16[A+10]=h,this.uint16[A+11]=d,this.uint16[A+12]=p,this.uint16[A+13]=f,this.uint16[A+14]=m,this.uint16[A+15]=g,this.uint16[A+16]=y,this.uint16[A+17]=_,this.uint16[A+18]=v,this.uint16[A+19]=b,this.uint16[A+20]=x,this.uint16[A+21]=w,this.uint16[A+22]=k,this.uint32[P+12]=E,this.float32[P+13]=S,this.float32[P+14]=I,this.uint16[A+30]=C,this.uint16[A+31]=T,t}}Co.prototype.bytesPerElement=64,xn("StructArrayLayout8i15ui1ul2f2ui64",Co);class To extends so{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(t){const e=this.length;return this.resize(e+1),this.emplace(e,t)}emplace(t,e){return this.float32[1*t+0]=e,t}}To.prototype.bytesPerElement=4,xn("StructArrayLayout1f4",To);class Ao extends so{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(t,e,i){const r=this.length;return this.resize(r+1),this.emplace(r,t,e,i)}emplace(t,e,i,r){const n=3*t;return this.uint16[6*t+0]=e,this.float32[n+1]=i,this.float32[n+2]=r,t}}Ao.prototype.bytesPerElement=12,xn("StructArrayLayout1ui2f12",Ao);class Po extends so{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(t,e,i){const r=this.length;return this.resize(r+1),this.emplace(r,t,e,i)}emplace(t,e,i,r){const n=4*t;return this.uint32[2*t+0]=e,this.uint16[n+2]=i,this.uint16[n+3]=r,t}}Po.prototype.bytesPerElement=8,xn("StructArrayLayout1ul2ui8",Po);class Mo extends so{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(t,e){const i=this.length;return this.resize(i+1),this.emplace(i,t,e)}emplace(t,e,i){const r=2*t;return this.uint16[r+0]=e,this.uint16[r+1]=i,t}}Mo.prototype.bytesPerElement=4,xn("StructArrayLayout2ui4",Mo);class Lo extends so{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(t){const e=this.length;return this.resize(e+1),this.emplace(e,t)}emplace(t,e){return this.uint16[1*t+0]=e,t}}Lo.prototype.bytesPerElement=2,xn("StructArrayLayout1ui2",Lo);class zo extends so{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(t,e,i,r){const n=this.length;return this.resize(n+1),this.emplace(n,t,e,i,r)}emplace(t,e,i,r,n){const o=4*t;return this.float32[o+0]=e,this.float32[o+1]=i,this.float32[o+2]=r,this.float32[o+3]=n,t}}zo.prototype.bytesPerElement=16,xn("StructArrayLayout4f16",zo);class Do extends ao{get anchorPointX(){return this._structArray.int16[this._pos2+0]}get anchorPointY(){return this._structArray.int16[this._pos2+1]}get x1(){return this._structArray.int16[this._pos2+2]}get y1(){return this._structArray.int16[this._pos2+3]}get x2(){return this._structArray.int16[this._pos2+4]}get y2(){return this._structArray.int16[this._pos2+5]}get featureIndex(){return this._structArray.uint32[this._pos4+3]}get sourceLayerIndex(){return this._structArray.uint16[this._pos2+8]}get bucketIndex(){return this._structArray.uint16[this._pos2+9]}get anchorPoint(){return new o(this.anchorPointX,this.anchorPointY)}}Do.prototype.size=20;class Ro extends xo{get(t){return new Do(this,t)}}xn("CollisionBoxArray",Ro);class Oo extends ao{get anchorX(){return this._structArray.int16[this._pos2+0]}get anchorY(){return this._structArray.int16[this._pos2+1]}get glyphStartIndex(){return this._structArray.uint16[this._pos2+2]}get numGlyphs(){return this._structArray.uint16[this._pos2+3]}get vertexStartIndex(){return this._structArray.uint32[this._pos4+2]}get lineStartIndex(){return this._structArray.uint32[this._pos4+3]}get lineLength(){return this._structArray.uint32[this._pos4+4]}get segment(){return this._structArray.uint16[this._pos2+10]}get lowerSize(){return this._structArray.uint16[this._pos2+11]}get upperSize(){return this._structArray.uint16[this._pos2+12]}get lineOffsetX(){return this._structArray.float32[this._pos4+7]}get lineOffsetY(){return this._structArray.float32[this._pos4+8]}get writingMode(){return this._structArray.uint8[this._pos1+36]}get placedOrientation(){return this._structArray.uint8[this._pos1+37]}set placedOrientation(t){this._structArray.uint8[this._pos1+37]=t}get hidden(){return this._structArray.uint8[this._pos1+38]}set hidden(t){this._structArray.uint8[this._pos1+38]=t}get crossTileID(){return this._structArray.uint32[this._pos4+10]}set crossTileID(t){this._structArray.uint32[this._pos4+10]=t}get associatedIconIndex(){return this._structArray.int16[this._pos2+22]}}Oo.prototype.size=48;class Fo extends Io{get(t){return new Oo(this,t)}}xn("PlacedSymbolArray",Fo);class Bo extends ao{get anchorX(){return this._structArray.int16[this._pos2+0]}get anchorY(){return this._structArray.int16[this._pos2+1]}get rightJustifiedTextSymbolIndex(){return this._structArray.int16[this._pos2+2]}get centerJustifiedTextSymbolIndex(){return this._structArray.int16[this._pos2+3]}get leftJustifiedTextSymbolIndex(){return this._structArray.int16[this._pos2+4]}get verticalPlacedTextSymbolIndex(){return this._structArray.int16[this._pos2+5]}get placedIconSymbolIndex(){return this._structArray.int16[this._pos2+6]}get verticalPlacedIconSymbolIndex(){return this._structArray.int16[this._pos2+7]}get key(){return this._structArray.uint16[this._pos2+8]}get textBoxStartIndex(){return this._structArray.uint16[this._pos2+9]}get textBoxEndIndex(){return this._structArray.uint16[this._pos2+10]}get verticalTextBoxStartIndex(){return this._structArray.uint16[this._pos2+11]}get verticalTextBoxEndIndex(){return this._structArray.uint16[this._pos2+12]}get iconBoxStartIndex(){return this._structArray.uint16[this._pos2+13]}get iconBoxEndIndex(){return this._structArray.uint16[this._pos2+14]}get verticalIconBoxStartIndex(){return this._structArray.uint16[this._pos2+15]}get verticalIconBoxEndIndex(){return this._structArray.uint16[this._pos2+16]}get featureIndex(){return this._structArray.uint16[this._pos2+17]}get numHorizontalGlyphVertices(){return this._structArray.uint16[this._pos2+18]}get numVerticalGlyphVertices(){return this._structArray.uint16[this._pos2+19]}get numIconVertices(){return this._structArray.uint16[this._pos2+20]}get numVerticalIconVertices(){return this._structArray.uint16[this._pos2+21]}get useRuntimeCollisionCircles(){return this._structArray.uint16[this._pos2+22]}get crossTileID(){return this._structArray.uint32[this._pos4+12]}set crossTileID(t){this._structArray.uint32[this._pos4+12]=t}get textBoxScale(){return this._structArray.float32[this._pos4+13]}get collisionCircleDiameter(){return this._structArray.float32[this._pos4+14]}get textAnchorOffsetStartIndex(){return this._structArray.uint16[this._pos2+30]}get textAnchorOffsetEndIndex(){return this._structArray.uint16[this._pos2+31]}}Bo.prototype.size=64;class No extends Co{get(t){return new Bo(this,t)}}xn("SymbolInstanceArray",No);class jo extends To{getoffsetX(t){return this.float32[1*t+0]}}xn("GlyphOffsetArray",jo);class Vo extends ho{getx(t){return this.int16[3*t+0]}gety(t){return this.int16[3*t+1]}gettileUnitDistanceFromAnchor(t){return this.int16[3*t+2]}}xn("SymbolLineVertexArray",Vo);class Uo extends ao{get textAnchor(){return this._structArray.uint16[this._pos2+0]}get textOffset0(){return this._structArray.float32[this._pos4+1]}get textOffset1(){return this._structArray.float32[this._pos4+2]}}Uo.prototype.size=12;class qo extends Ao{get(t){return new Uo(this,t)}}xn("TextAnchorOffsetArray",qo);class $o extends ao{get featureIndex(){return this._structArray.uint32[this._pos4+0]}get sourceLayerIndex(){return this._structArray.uint16[this._pos2+2]}get bucketIndex(){return this._structArray.uint16[this._pos2+3]}}$o.prototype.size=8;class Go extends Po{get(t){return new $o(this,t)}}xn("FeatureIndexArray",Go);class Ho extends uo{}class Zo extends uo{}class Wo extends uo{}class Xo extends fo{}class Jo extends mo{}class Ko extends go{}class Yo extends yo{}class Qo extends _o{}class ta extends vo{}class ea extends bo{}class ia extends wo{}class ra extends Eo{}class na extends So{}class oa extends Mo{}const aa=lo([{name:"a_pos",components:2,type:"Int16"}],4),{members:sa}=aa;class la{constructor(t=[]){this.segments=t}prepareSegment(t,e,i,r){let n=this.segments[this.segments.length-1];return t>la.MAX_VERTEX_ARRAY_LENGTH&&k(`Max vertices per segment is ${la.MAX_VERTEX_ARRAY_LENGTH}: bucket requested ${t}`),(!n||n.vertexLength+t>la.MAX_VERTEX_ARRAY_LENGTH||n.sortKey!==r)&&(n={vertexOffset:e.length,primitiveOffset:i.length,vertexLength:0,primitiveLength:0},void 0!==r&&(n.sortKey=r),this.segments.push(n)),n}get(){return this.segments}destroy(){for(const t of this.segments)for(const e in t.vaos)t.vaos[e].destroy()}static simpleSegment(t,e,i,r){return new la([{vertexOffset:t,primitiveOffset:e,vertexLength:i,primitiveLength:r,vaos:{},sortKey:0}])}}function ca(t,e){return 256*(t=m(Math.floor(t),0,255))+m(Math.floor(e),0,255)}la.MAX_VERTEX_ARRAY_LENGTH=Math.pow(2,16)-1,xn("SegmentVector",la);const ua=lo([{name:"a_pattern_from",components:4,type:"Uint16"},{name:"a_pattern_to",components:4,type:"Uint16"},{name:"a_pixel_ratio_from",components:1,type:"Uint16"},{name:"a_pixel_ratio_to",components:1,type:"Uint16"}]);var ha={exports:{}},da={exports:{}};da.exports=function(t,e){var i,r,n,o,a,s,l,c;for(r=t.length-(i=3&t.length),n=e,a=3432918353,s=461845907,c=0;c<r;)l=255&t.charCodeAt(c)|(255&t.charCodeAt(++c))<<8|(255&t.charCodeAt(++c))<<16|(255&t.charCodeAt(++c))<<24,++c,n=27492+(65535&(o=5*(65535&(n=(n^=l=(65535&(l=(l=(65535&l)*a+(((l>>>16)*a&65535)<<16)&4294967295)<<15|l>>>17))*s+(((l>>>16)*s&65535)<<16)&4294967295)<<13|n>>>19))+((5*(n>>>16)&65535)<<16)&4294967295))+((58964+(o>>>16)&65535)<<16);switch(l=0,i){case 3:l^=(255&t.charCodeAt(c+2))<<16;case 2:l^=(255&t.charCodeAt(c+1))<<8;case 1:n^=l=(65535&(l=(l=(65535&(l^=255&t.charCodeAt(c)))*a+(((l>>>16)*a&65535)<<16)&4294967295)<<15|l>>>17))*s+(((l>>>16)*s&65535)<<16)&4294967295}return n^=t.length,n=2246822507*(65535&(n^=n>>>16))+((2246822507*(n>>>16)&65535)<<16)&4294967295,n=3266489909*(65535&(n^=n>>>13))+((3266489909*(n>>>16)&65535)<<16)&4294967295,(n^=n>>>16)>>>0};var pa=da.exports,fa={exports:{}};fa.exports=function(t,e){for(var i,r=t.length,n=e^r,o=0;r>=4;)i=1540483477*(65535&(i=255&t.charCodeAt(o)|(255&t.charCodeAt(++o))<<8|(255&t.charCodeAt(++o))<<16|(255&t.charCodeAt(++o))<<24))+((1540483477*(i>>>16)&65535)<<16),n=1540483477*(65535&n)+((1540483477*(n>>>16)&65535)<<16)^(i=1540483477*(65535&(i^=i>>>24))+((1540483477*(i>>>16)&65535)<<16)),r-=4,++o;switch(r){case 3:n^=(255&t.charCodeAt(o+2))<<16;case 2:n^=(255&t.charCodeAt(o+1))<<8;case 1:n=1540483477*(65535&(n^=255&t.charCodeAt(o)))+((1540483477*(n>>>16)&65535)<<16)}return n=1540483477*(65535&(n^=n>>>13))+((1540483477*(n>>>16)&65535)<<16),(n^=n>>>15)>>>0};var ma=pa,ga=fa.exports;ha.exports=ma,ha.exports.murmur3=ma,ha.exports.murmur2=ga;var ya=i(ha.exports);class _a{constructor(){this.ids=[],this.positions=[],this.indexed=!1}add(t,e,i,r){this.ids.push(va(t)),this.positions.push(e,i,r)}getPositions(t){if(!this.indexed)throw new Error("Trying to get index, but feature positions are not indexed");const e=va(t);let i=0,r=this.ids.length-1;for(;i<r;){const t=i+r>>1;this.ids[t]>=e?r=t:i=t+1}const n=[];for(;this.ids[i]===e;)n.push({index:this.positions[3*i],start:this.positions[3*i+1],end:this.positions[3*i+2]}),i++;return n}static serialize(t,e){const i=new Float64Array(t.ids),r=new Uint32Array(t.positions);return ba(i,r,0,i.length-1),e&&e.push(i.buffer,r.buffer),{ids:i,positions:r}}static deserialize(t){const e=new _a;return e.ids=t.ids,e.positions=t.positions,e.indexed=!0,e}}function va(t){const e=+t;return!isNaN(e)&&e<=Number.MAX_SAFE_INTEGER?e:ya(String(t))}function ba(t,e,i,r){for(;i<r;){const n=t[i+r>>1];let o=i-1,a=r+1;for(;;){do{o++}while(t[o]<n);do{a--}while(t[a]>n);if(o>=a)break;xa(t,o,a),xa(e,3*o,3*a),xa(e,3*o+1,3*a+1),xa(e,3*o+2,3*a+2)}a-i<r-a?(ba(t,e,i,a),i=a+1):(ba(t,e,a+1,r),r=a)}}function xa(t,e,i){const r=t[e];t[e]=t[i],t[i]=r}xn("FeaturePositionMap",_a);class wa{constructor(t,e){this.gl=t.gl,this.location=e}}class ka extends wa{constructor(t,e){super(t,e),this.current=0}set(t){this.current!==t&&(this.current=t,this.gl.uniform1f(this.location,t))}}class Ea extends wa{constructor(t,e){super(t,e),this.current=[0,0,0,0]}set(t){t[0]===this.current[0]&&t[1]===this.current[1]&&t[2]===this.current[2]&&t[3]===this.current[3]||(this.current=t,this.gl.uniform4f(this.location,t[0],t[1],t[2],t[3]))}}class Sa extends wa{constructor(t,e){super(t,e),this.current=Zt.transparent}set(t){t.r===this.current.r&&t.g===this.current.g&&t.b===this.current.b&&t.a===this.current.a||(this.current=t,this.gl.uniform4f(this.location,t.r,t.g,t.b,t.a))}}const Ia=new Float32Array(16);function Ca(t){return[ca(255*t.r,255*t.g),ca(255*t.b,255*t.a)]}class Ta{constructor(t,e,i){this.value=t,this.uniformNames=e.map((t=>`u_${t}`)),this.type=i}setUniform(t,e,i){t.set(i.constantOr(this.value))}getBinding(t,e,i){return"color"===this.type?new Sa(t,e):new ka(t,e)}}class Aa{constructor(t,e){this.uniformNames=e.map((t=>`u_${t}`)),this.patternFrom=null,this.patternTo=null,this.pixelRatioFrom=1,this.pixelRatioTo=1}setConstantPatternPositions(t,e){this.pixelRatioFrom=e.pixelRatio,this.pixelRatioTo=t.pixelRatio,this.patternFrom=e.tlbr,this.patternTo=t.tlbr}setUniform(t,e,i,r){const n="u_pattern_to"===r?this.patternTo:"u_pattern_from"===r?this.patternFrom:"u_pixel_ratio_to"===r?this.pixelRatioTo:"u_pixel_ratio_from"===r?this.pixelRatioFrom:null;n&&t.set(n)}getBinding(t,e,i){return"u_pattern"===i.substr(0,9)?new Ea(t,e):new ka(t,e)}}class Pa{constructor(t,e,i,r){this.expression=t,this.type=i,this.maxValue=0,this.paintVertexAttributes=e.map((t=>({name:`a_${t}`,type:"Float32",components:"color"===i?2:1,offset:0}))),this.paintVertexArray=new r}populatePaintArray(t,e,i,r,n){const o=this.paintVertexArray.length,a=this.expression.evaluate(new Un(0),e,{},r,[],n);this.paintVertexArray.resize(t),this._setPaintValue(o,t,a)}updatePaintArray(t,e,i,r){const n=this.expression.evaluate({zoom:0},i,r);this._setPaintValue(t,e,n)}_setPaintValue(t,e,i){if("color"===this.type){const r=Ca(i);for(let i=t;i<e;i++)this.paintVertexArray.emplace(i,r[0],r[1])}else{for(let r=t;r<e;r++)this.paintVertexArray.emplace(r,i);this.maxValue=Math.max(this.maxValue,Math.abs(i))}}upload(t){this.paintVertexArray&&this.paintVertexArray.arrayBuffer&&(this.paintVertexBuffer&&this.paintVertexBuffer.buffer?this.paintVertexBuffer.updateData(this.paintVertexArray):this.paintVertexBuffer=t.createVertexBuffer(this.paintVertexArray,this.paintVertexAttributes,this.expression.isStateDependent))}destroy(){this.paintVertexBuffer&&this.paintVertexBuffer.destroy()}}class Ma{constructor(t,e,i,r,n,o){this.expression=t,this.uniformNames=e.map((t=>`u_${t}_t`)),this.type=i,this.useIntegerZoom=r,this.zoom=n,this.maxValue=0,this.paintVertexAttributes=e.map((t=>({name:`a_${t}`,type:"Float32",components:"color"===i?4:2,offset:0}))),this.paintVertexArray=new o}populatePaintArray(t,e,i,r,n){const o=this.expression.evaluate(new Un(this.zoom),e,{},r,[],n),a=this.expression.evaluate(new Un(this.zoom+1),e,{},r,[],n),s=this.paintVertexArray.length;this.paintVertexArray.resize(t),this._setPaintValue(s,t,o,a)}updatePaintArray(t,e,i,r){const n=this.expression.evaluate({zoom:this.zoom},i,r),o=this.expression.evaluate({zoom:this.zoom+1},i,r);this._setPaintValue(t,e,n,o)}_setPaintValue(t,e,i,r){if("color"===this.type){const n=Ca(i),o=Ca(r);for(let i=t;i<e;i++)this.paintVertexArray.emplace(i,n[0],n[1],o[0],o[1])}else{for(let n=t;n<e;n++)this.paintVertexArray.emplace(n,i,r);this.maxValue=Math.max(this.maxValue,Math.abs(i),Math.abs(r))}}upload(t){this.paintVertexArray&&this.paintVertexArray.arrayBuffer&&(this.paintVertexBuffer&&this.paintVertexBuffer.buffer?this.paintVertexBuffer.updateData(this.paintVertexArray):this.paintVertexBuffer=t.createVertexBuffer(this.paintVertexArray,this.paintVertexAttributes,this.expression.isStateDependent))}destroy(){this.paintVertexBuffer&&this.paintVertexBuffer.destroy()}setUniform(t,e){const i=this.useIntegerZoom?Math.floor(e.zoom):e.zoom,r=m(this.expression.interpolationFactor(i,this.zoom,this.zoom+1),0,1);t.set(r)}getBinding(t,e,i){return new ka(t,e)}}class La{constructor(t,e,i,r,n,o){this.expression=t,this.type=e,this.useIntegerZoom=i,this.zoom=r,this.layerId=o,this.zoomInPaintVertexArray=new n,this.zoomOutPaintVertexArray=new n}populatePaintArray(t,e,i){const r=this.zoomInPaintVertexArray.length;this.zoomInPaintVertexArray.resize(t),this.zoomOutPaintVertexArray.resize(t),this._setPaintValues(r,t,e.patterns&&e.patterns[this.layerId],i)}updatePaintArray(t,e,i,r,n){this._setPaintValues(t,e,i.patterns&&i.patterns[this.layerId],n)}_setPaintValues(t,e,i,r){if(!r||!i)return;const{min:n,mid:o,max:a}=i,s=r[n],l=r[o],c=r[a];if(s&&l&&c)for(let u=t;u<e;u++)this.zoomInPaintVertexArray.emplace(u,l.tl[0],l.tl[1],l.br[0],l.br[1],s.tl[0],s.tl[1],s.br[0],s.br[1],l.pixelRatio,s.pixelRatio),this.zoomOutPaintVertexArray.emplace(u,l.tl[0],l.tl[1],l.br[0],l.br[1],c.tl[0],c.tl[1],c.br[0],c.br[1],l.pixelRatio,c.pixelRatio)}upload(t){this.zoomInPaintVertexArray&&this.zoomInPaintVertexArray.arrayBuffer&&this.zoomOutPaintVertexArray&&this.zoomOutPaintVertexArray.arrayBuffer&&(this.zoomInPaintVertexBuffer=t.createVertexBuffer(this.zoomInPaintVertexArray,ua.members,this.expression.isStateDependent),this.zoomOutPaintVertexBuffer=t.createVertexBuffer(this.zoomOutPaintVertexArray,ua.members,this.expression.isStateDependent))}destroy(){this.zoomOutPaintVertexBuffer&&this.zoomOutPaintVertexBuffer.destroy(),this.zoomInPaintVertexBuffer&&this.zoomInPaintVertexBuffer.destroy()}}class za{constructor(t,e,i){this.binders={},this._buffers=[];const r=[];for(const n in t.paint._values){if(!i(n))continue;const o=t.paint.get(n);if(!(o instanceof Xn&&or(o.property.specification)))continue;const a=Ra(n,t.type),s=o.value,l=o.property.specification.type,c=o.property.useIntegerZoom,u=o.property.specification["property-type"],h="cross-faded"===u||"cross-faded-data-driven"===u;if("constant"===s.kind)this.binders[n]=h?new Aa(s.value,a):new Ta(s.value,a,l),r.push(`/u_${n}`);else if("source"===s.kind||h){const i=Oa(n,l,"source");this.binders[n]=h?new La(s,l,c,e,i,t.id):new Pa(s,a,l,i),r.push(`/a_${n}`)}else{const t=Oa(n,l,"composite");this.binders[n]=new Ma(s,a,l,c,e,t),r.push(`/z_${n}`)}}this.cacheKey=r.sort().join("")}getMaxValue(t){const e=this.binders[t];return e instanceof Pa||e instanceof Ma?e.maxValue:0}populatePaintArrays(t,e,i,r,n){for(const o in this.binders){const a=this.binders[o];(a instanceof Pa||a instanceof Ma||a instanceof La)&&a.populatePaintArray(t,e,i,r,n)}}setConstantPatternPositions(t,e){for(const i in this.binders){const r=this.binders[i];r instanceof Aa&&r.setConstantPatternPositions(t,e)}}updatePaintArrays(t,e,i,r,n){let o=!1;for(const a in t){const s=e.getPositions(a);for(const e of s){const s=i.feature(e.index);for(const i in this.binders){const l=this.binders[i];if((l instanceof Pa||l instanceof Ma||l instanceof La)&&!0===l.expression.isStateDependent){const c=r.paint.get(i);l.expression=c.value,l.updatePaintArray(e.start,e.end,s,t[a],n),o=!0}}}}return o}defines(){const t=[];for(const e in this.binders){const i=this.binders[e];(i instanceof Ta||i instanceof Aa)&&t.push(...i.uniformNames.map((t=>`#define HAS_UNIFORM_${t}`)))}return t}getBinderAttributes(){const t=[];for(const e in this.binders){const i=this.binders[e];if(i instanceof Pa||i instanceof Ma)for(let e=0;e<i.paintVertexAttributes.length;e++)t.push(i.paintVertexAttributes[e].name);else if(i instanceof La)for(let e=0;e<ua.members.length;e++)t.push(ua.members[e].name)}return t}getBinderUniforms(){const t=[];for(const e in this.binders){const i=this.binders[e];if(i instanceof Ta||i instanceof Aa||i instanceof Ma)for(const e of i.uniformNames)t.push(e)}return t}getPaintVertexBuffers(){return this._buffers}getUniforms(t,e){const i=[];for(const r in this.binders){const n=this.binders[r];if(n instanceof Ta||n instanceof Aa||n instanceof Ma)for(const o of n.uniformNames)if(e[o]){const a=n.getBinding(t,e[o],o);i.push({name:o,property:r,binding:a})}}return i}setUniforms(t,e,i,r){for(const{name:n,property:o,binding:a}of e)this.binders[o].setUniform(a,r,i.get(o),n)}updatePaintBuffers(t){this._buffers=[];for(const e in this.binders){const i=this.binders[e];if(t&&i instanceof La){const e=2===t.fromScale?i.zoomInPaintVertexBuffer:i.zoomOutPaintVertexBuffer;e&&this._buffers.push(e)}else(i instanceof Pa||i instanceof Ma)&&i.paintVertexBuffer&&this._buffers.push(i.paintVertexBuffer)}}upload(t){for(const e in this.binders){const i=this.binders[e];(i instanceof Pa||i instanceof Ma||i instanceof La)&&i.upload(t)}this.updatePaintBuffers()}destroy(){for(const t in this.binders){const e=this.binders[t];(e instanceof Pa||e instanceof Ma||e instanceof La)&&e.destroy()}}}class Da{constructor(t,e,i=()=>!0){this.programConfigurations={};for(const r of t)this.programConfigurations[r.id]=new za(r,e,i);this.needsUpload=!1,this._featureMap=new _a,this._bufferOffset=0}populatePaintArrays(t,e,i,r,n,o){for(const a in this.programConfigurations)this.programConfigurations[a].populatePaintArrays(t,e,r,n,o);void 0!==e.id&&this._featureMap.add(e.id,i,this._bufferOffset,t),this._bufferOffset=t,this.needsUpload=!0}updatePaintArrays(t,e,i,r){for(const n of i)this.needsUpload=this.programConfigurations[n.id].updatePaintArrays(t,this._featureMap,e,n,r)||this.needsUpload}get(t){return this.programConfigurations[t]}upload(t){if(this.needsUpload){for(const e in this.programConfigurations)this.programConfigurations[e].upload(t);this.needsUpload=!1}}destroy(){for(const t in this.programConfigurations)this.programConfigurations[t].destroy()}}function Ra(t,e){return{"text-opacity":["opacity"],"icon-opacity":["opacity"],"text-color":["fill_color"],"icon-color":["fill_color"],"text-halo-color":["halo_color"],"icon-halo-color":["halo_color"],"text-halo-blur":["halo_blur"],"icon-halo-blur":["halo_blur"],"text-halo-width":["halo_width"],"icon-halo-width":["halo_width"],"line-gap-width":["gapwidth"],"line-pattern":["pattern_to","pattern_from","pixel_ratio_to","pixel_ratio_from"],"fill-pattern":["pattern_to","pattern_from","pixel_ratio_to","pixel_ratio_from"],"fill-extrusion-pattern":["pattern_to","pattern_from","pixel_ratio_to","pixel_ratio_from"]}[t]||[t.replace(`${e}-`,"").replace(/-/g,"_")]}function Oa(t,e,i){const r={color:{source:go,composite:zo},number:{source:To,composite:go}},n=function(t){return{"line-pattern":{source:Yo,composite:Yo},"fill-pattern":{source:Yo,composite:Yo},"fill-extrusion-pattern":{source:Yo,composite:Yo}}[t]}(t);return n&&n[i]||r[e][i]}xn("ConstantBinder",Ta),xn("CrossFadedConstantBinder",Aa),xn("SourceExpressionBinder",Pa),xn("CrossFadedCompositeBinder",La),xn("CompositeExpressionBinder",Ma),xn("ProgramConfiguration",za,{omit:["_buffers"]}),xn("ProgramConfigurationSet",Da);const Fa=8192,Ba=Math.pow(2,14)-1,Na=-Ba-1;function ja(t){const e=Fa/t.extent,i=t.loadGeometry();for(let r=0;r<i.length;r++){const t=i[r];for(let i=0;i<t.length;i++){const r=t[i],n=Math.round(r.x*e),o=Math.round(r.y*e);r.x=m(n,Na,Ba),r.y=m(o,Na,Ba),(n<r.x||n>r.x+1||o<r.y||o>r.y+1)&&k("Geometry exceeds allowed extent, reduce your vector tile buffer size")}}return i}function Va(t,e){return{type:t.type,id:t.id,properties:t.properties,geometry:e?ja(t):[]}}function Ua(t,e,i,r,n){t.emplaceBack(2*e+(r+1)/2,2*i+(n+1)/2)}class qa{constructor(t){this.zoom=t.zoom,this.overscaling=t.overscaling,this.layers=t.layers,this.layerIds=this.layers.map((t=>t.id)),this.index=t.index,this.hasPattern=!1,this.layoutVertexArray=new Zo,this.indexArray=new na,this.segments=new la,this.programConfigurations=new Da(t.layers,t.zoom),this.stateDependentLayerIds=this.layers.filter((t=>t.isStateDependent())).map((t=>t.id))}populate(t,e,i){const r=this.layers[0],n=[];let o=null,a=!1;"circle"===r.type&&(o=r.layout.get("circle-sort-key"),a=!o.isConstant());for(const{feature:s,id:l,index:c,sourceLayerIndex:u}of t){const t=this.layers[0]._featureFilter.needGeometry,e=Va(s,t);if(!this.layers[0]._featureFilter.filter(new Un(this.zoom),e,i))continue;const r=a?o.evaluate(e,{},i):void 0,h={id:l,properties:s.properties,type:s.type,sourceLayerIndex:u,index:c,geometry:t?e.geometry:ja(s),patterns:{},sortKey:r};n.push(h)}a&&n.sort(((t,e)=>t.sortKey-e.sortKey));for(const s of n){const{geometry:r,index:n,sourceLayerIndex:o}=s,a=t[n].feature;this.addFeature(s,r,n,i),e.featureIndex.insert(a,r,n,o,this.index)}}update(t,e,i){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(t,e,this.stateDependentLayers,i)}isEmpty(){return 0===this.layoutVertexArray.length}uploadPending(){return!this.uploaded||this.programConfigurations.needsUpload}upload(t){this.uploaded||(this.layoutVertexBuffer=t.createVertexBuffer(this.layoutVertexArray,sa),this.indexBuffer=t.createIndexBuffer(this.indexArray)),this.programConfigurations.upload(t),this.uploaded=!0}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy())}addFeature(t,e,i,r){for(const n of e)for(const e of n){const i=e.x,r=e.y;if(i<0||i>=Fa||r<0||r>=Fa)continue;const n=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray,t.sortKey),o=n.vertexLength;Ua(this.layoutVertexArray,i,r,-1,-1),Ua(this.layoutVertexArray,i,r,1,-1),Ua(this.layoutVertexArray,i,r,1,1),Ua(this.layoutVertexArray,i,r,-1,1),this.indexArray.emplaceBack(o,o+1,o+2),this.indexArray.emplaceBack(o,o+3,o+2),n.vertexLength+=4,n.primitiveLength+=2}this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,t,i,{},r)}}function $a(t,e){for(let i=0;i<t.length;i++)if(Qa(e,t[i]))return!0;for(let i=0;i<e.length;i++)if(Qa(t,e[i]))return!0;return!!Wa(t,e)}function Ga(t,e,i){return!!Qa(t,e)||!!Ja(e,t,i)}function Ha(t,e){if(1===t.length)return Ya(e,t[0]);for(let i=0;i<e.length;i++){const r=e[i];for(let e=0;e<r.length;e++)if(Qa(t,r[e]))return!0}for(let i=0;i<t.length;i++)if(Ya(e,t[i]))return!0;for(let i=0;i<e.length;i++)if(Wa(t,e[i]))return!0;return!1}function Za(t,e,i){if(t.length>1){if(Wa(t,e))return!0;for(let r=0;r<e.length;r++)if(Ja(e[r],t,i))return!0}for(let r=0;r<t.length;r++)if(Ja(t[r],e,i))return!0;return!1}function Wa(t,e){if(0===t.length||0===e.length)return!1;for(let i=0;i<t.length-1;i++){const r=t[i],n=t[i+1];for(let t=0;t<e.length-1;t++)if(Xa(r,n,e[t],e[t+1]))return!0}return!1}function Xa(t,e,i,r){return E(t,i,r)!==E(e,i,r)&&E(t,e,i)!==E(t,e,r)}function Ja(t,e,i){const r=i*i;if(1===e.length)return t.distSqr(e[0])<r;for(let n=1;n<e.length;n++)if(Ka(t,e[n-1],e[n])<r)return!0;return!1}function Ka(t,e,i){const r=e.distSqr(i);if(0===r)return t.distSqr(e);const n=((t.x-e.x)*(i.x-e.x)+(t.y-e.y)*(i.y-e.y))/r;return t.distSqr(n<0?e:n>1?i:i.sub(e)._mult(n)._add(e))}function Ya(t,e){let i,r,n,o=!1;for(let a=0;a<t.length;a++){i=t[a];for(let t=0,a=i.length-1;t<i.length;a=t++)r=i[t],n=i[a],r.y>e.y!=n.y>e.y&&e.x<(n.x-r.x)*(e.y-r.y)/(n.y-r.y)+r.x&&(o=!o)}return o}function Qa(t,e){let i=!1;for(let r=0,n=t.length-1;r<t.length;n=r++){const o=t[r],a=t[n];o.y>e.y!=a.y>e.y&&e.x<(a.x-o.x)*(e.y-o.y)/(a.y-o.y)+o.x&&(i=!i)}return i}function ts(t,e,i){const r=i[0],n=i[2];if(t.x<r.x&&e.x<r.x||t.x>n.x&&e.x>n.x||t.y<r.y&&e.y<r.y||t.y>n.y&&e.y>n.y)return!1;const o=E(t,e,i[0]);return o!==E(t,e,i[1])||o!==E(t,e,i[2])||o!==E(t,e,i[3])}function es(t,e,i){const r=e.paint.get(t).value;return"constant"===r.kind?r.value:i.programConfigurations.get(e.id).getMaxValue(t)}function is(t){return Math.sqrt(t[0]*t[0]+t[1]*t[1])}function rs(t,e,i,r,n){if(!e[0]&&!e[1])return t;const a=o.convert(e)._mult(n);"viewport"===i&&a._rotate(-r);const s=[];for(let o=0;o<t.length;o++)s.push(t[o].sub(a));return s}let ns,os;xn("CircleBucket",qa,{omit:["layers"]});var as={get paint(){return os=os||new io({"circle-radius":new Yn(H.paint_circle["circle-radius"]),"circle-color":new Yn(H.paint_circle["circle-color"]),"circle-blur":new Yn(H.paint_circle["circle-blur"]),"circle-opacity":new Yn(H.paint_circle["circle-opacity"]),"circle-translate":new Kn(H.paint_circle["circle-translate"]),"circle-translate-anchor":new Kn(H.paint_circle["circle-translate-anchor"]),"circle-pitch-scale":new Kn(H.paint_circle["circle-pitch-scale"]),"circle-pitch-alignment":new Kn(H.paint_circle["circle-pitch-alignment"]),"circle-stroke-width":new Yn(H.paint_circle["circle-stroke-width"]),"circle-stroke-color":new Yn(H.paint_circle["circle-stroke-color"]),"circle-stroke-opacity":new Yn(H.paint_circle["circle-stroke-opacity"])})},get layout(){return ns=ns||new io({"circle-sort-key":new Yn(H.layout_circle["circle-sort-key"])})}},ss=1e-6,ls="undefined"!=typeof Float32Array?Float32Array:Array;function cs(t){return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=1,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=1,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t}function us(t,e,i){var r=e[0],n=e[1],o=e[2],a=e[3],s=e[4],l=e[5],c=e[6],u=e[7],h=e[8],d=e[9],p=e[10],f=e[11],m=e[12],g=e[13],y=e[14],_=e[15],v=i[0],b=i[1],x=i[2],w=i[3];return t[0]=v*r+b*s+x*h+w*m,t[1]=v*n+b*l+x*d+w*g,t[2]=v*o+b*c+x*p+w*y,t[3]=v*a+b*u+x*f+w*_,t[4]=(v=i[4])*r+(b=i[5])*s+(x=i[6])*h+(w=i[7])*m,t[5]=v*n+b*l+x*d+w*g,t[6]=v*o+b*c+x*p+w*y,t[7]=v*a+b*u+x*f+w*_,t[8]=(v=i[8])*r+(b=i[9])*s+(x=i[10])*h+(w=i[11])*m,t[9]=v*n+b*l+x*d+w*g,t[10]=v*o+b*c+x*p+w*y,t[11]=v*a+b*u+x*f+w*_,t[12]=(v=i[12])*r+(b=i[13])*s+(x=i[14])*h+(w=i[15])*m,t[13]=v*n+b*l+x*d+w*g,t[14]=v*o+b*c+x*p+w*y,t[15]=v*a+b*u+x*f+w*_,t}Math.hypot||(Math.hypot=function(){for(var t=0,e=arguments.length;e--;)t+=arguments[e]*arguments[e];return Math.sqrt(t)});var hs,ds=us;function ps(t,e,i){var r=e[0],n=e[1],o=e[2],a=e[3];return t[0]=i[0]*r+i[4]*n+i[8]*o+i[12]*a,t[1]=i[1]*r+i[5]*n+i[9]*o+i[13]*a,t[2]=i[2]*r+i[6]*n+i[10]*o+i[14]*a,t[3]=i[3]*r+i[7]*n+i[11]*o+i[15]*a,t}hs=new ls(4),ls!=Float32Array&&(hs[0]=0,hs[1]=0,hs[2]=0,hs[3]=0);class fs extends no{constructor(t){super(t,as)}createBucket(t){return new qa(t)}queryRadius(t){const e=t;return es("circle-radius",this,e)+es("circle-stroke-width",this,e)+is(this.paint.get("circle-translate"))}queryIntersectsFeature(t,e,i,r,n,o,a,s){const l=rs(t,this.paint.get("circle-translate"),this.paint.get("circle-translate-anchor"),o.angle,a),c=this.paint.get("circle-radius").evaluate(e,i)+this.paint.get("circle-stroke-width").evaluate(e,i),u="map"===this.paint.get("circle-pitch-alignment"),h=u?l:function(t,e){return t.map((t=>ms(t,e)))}(l,s),d=u?c*a:c;for(const p of r)for(const t of p){const e=u?t:ms(t,s);let i=d;const r=ps([],[t.x,t.y,0,1],s);if("viewport"===this.paint.get("circle-pitch-scale")&&"map"===this.paint.get("circle-pitch-alignment")?i*=r[3]/o.cameraToCenterDistance:"map"===this.paint.get("circle-pitch-scale")&&"viewport"===this.paint.get("circle-pitch-alignment")&&(i*=o.cameraToCenterDistance/r[3]),Ga(h,e,i))return!0}return!1}}function ms(t,e){const i=ps([],[t.x,t.y,0,1],e);return new o(i[0]/i[3],i[1]/i[3])}class gs extends qa{}let ys;xn("HeatmapBucket",gs,{omit:["layers"]});var _s={get paint(){return ys=ys||new io({"heatmap-radius":new Yn(H.paint_heatmap["heatmap-radius"]),"heatmap-weight":new Yn(H.paint_heatmap["heatmap-weight"]),"heatmap-intensity":new Kn(H.paint_heatmap["heatmap-intensity"]),"heatmap-color":new eo(H.paint_heatmap["heatmap-color"]),"heatmap-opacity":new Kn(H.paint_heatmap["heatmap-opacity"])})}};function vs(t,{width:e,height:i},r,n){if(n){if(n instanceof Uint8ClampedArray)n=new Uint8Array(n.buffer);else if(n.length!==e*i*r)throw new RangeError(`mismatched image size. expected: ${n.length} but got: ${e*i*r}`)}else n=new Uint8Array(e*i*r);return t.width=e,t.height=i,t.data=n,t}function bs(t,{width:e,height:i},r){if(e===t.width&&i===t.height)return;const n=vs({},{width:e,height:i},r);xs(t,n,{x:0,y:0},{x:0,y:0},{width:Math.min(t.width,e),height:Math.min(t.height,i)},r),t.width=e,t.height=i,t.data=n.data}function xs(t,e,i,r,n,o){if(0===n.width||0===n.height)return e;if(n.width>t.width||n.height>t.height||i.x>t.width-n.width||i.y>t.height-n.height)throw new RangeError("out of range source coordinates for image copy");if(n.width>e.width||n.height>e.height||r.x>e.width-n.width||r.y>e.height-n.height)throw new RangeError("out of range destination coordinates for image copy");const a=t.data,s=e.data;if(a===s)throw new Error("srcData equals dstData, so image is already copied");for(let l=0;l<n.height;l++){const c=((i.y+l)*t.width+i.x)*o,u=((r.y+l)*e.width+r.x)*o;for(let t=0;t<n.width*o;t++)s[u+t]=a[c+t]}return e}class ws{constructor(t,e){vs(this,t,1,e)}resize(t){bs(this,t,1)}clone(){return new ws({width:this.width,height:this.height},new Uint8Array(this.data))}static copy(t,e,i,r,n){xs(t,e,i,r,n,1)}}class ks{constructor(t,e){vs(this,t,4,e)}resize(t){bs(this,t,4)}replace(t,e){e?this.data.set(t):this.data=t instanceof Uint8ClampedArray?new Uint8Array(t.buffer):t}clone(){return new ks({width:this.width,height:this.height},new Uint8Array(this.data))}static copy(t,e,i,r,n){xs(t,e,i,r,n,4)}}function Es(t){const e={},i=t.resolution||256,r=t.clips?t.clips.length:1,n=t.image||new ks({width:i,height:r});if(Math.log(i)/Math.LN2%1!=0)throw new Error(`width is not a power of 2 - ${i}`);const o=(i,r,o)=>{e[t.evaluationKey]=o;const a=t.expression.evaluate(e);n.data[i+r+0]=Math.floor(255*a.r/a.a),n.data[i+r+1]=Math.floor(255*a.g/a.a),n.data[i+r+2]=Math.floor(255*a.b/a.a),n.data[i+r+3]=Math.floor(255*a.a)};if(t.clips)for(let a=0,s=0;a<r;++a,s+=4*i)for(let e=0,r=0;e<i;e++,r+=4){const n=e/(i-1),{start:l,end:c}=t.clips[a];o(s,r,l*(1-n)+c*n)}else for(let a=0,s=0;a<i;a++,s+=4)o(0,s,a/(i-1));return n}xn("AlphaImage",ws),xn("RGBAImage",ks);const Ss="big-fb";class Is extends no{createBucket(t){return new gs(t)}constructor(t){super(t,_s),this.heatmapFbos=new Map,this._updateColorRamp()}_handleSpecialPaintPropertyUpdate(t){"heatmap-color"===t&&this._updateColorRamp()}_updateColorRamp(){this.colorRamp=Es({expression:this._transitionablePaint._values["heatmap-color"].value.expression,evaluationKey:"heatmapDensity",image:this.colorRamp}),this.colorRampTexture=null}resize(){this.heatmapFbos.has(Ss)&&this.heatmapFbos.delete(Ss)}queryRadius(){return 0}queryIntersectsFeature(){return!1}hasOffscreenPass(){return 0!==this.paint.get("heatmap-opacity")&&"none"!==this.visibility}}let Cs;var Ts={get paint(){return Cs=Cs||new io({"hillshade-illumination-direction":new Kn(H.paint_hillshade["hillshade-illumination-direction"]),"hillshade-illumination-anchor":new Kn(H.paint_hillshade["hillshade-illumination-anchor"]),"hillshade-exaggeration":new Kn(H.paint_hillshade["hillshade-exaggeration"]),"hillshade-shadow-color":new Kn(H.paint_hillshade["hillshade-shadow-color"]),"hillshade-highlight-color":new Kn(H.paint_hillshade["hillshade-highlight-color"]),"hillshade-accent-color":new Kn(H.paint_hillshade["hillshade-accent-color"])})}};class As extends no{constructor(t){super(t,Ts)}hasOffscreenPass(){return 0!==this.paint.get("hillshade-exaggeration")&&"none"!==this.visibility}}const Ps=lo([{name:"a_pos",components:2,type:"Int16"}],4),{members:Ms}=Ps;function Ls(t,e,i=2){const r=e&&e.length,n=r?e[0]*i:t.length;let o=zs(t,0,n,i,!0);const a=[];if(!o||o.next===o.prev)return a;let s,l,c;if(r&&(o=function(t,e,i,r){const n=[];for(let o=0,a=e.length;o<a;o++){const i=zs(t,e[o]*r,o<a-1?e[o+1]*r:t.length,r,!1);i===i.next&&(i.steiner=!0),n.push($s(i))}n.sort(js);for(let o=0;o<n.length;o++)i=Vs(n[o],i);return i}(t,e,o,i)),t.length>80*i){s=1/0,l=1/0;let e=-1/0,r=-1/0;for(let o=i;o<n;o+=i){const i=t[o],n=t[o+1];i<s&&(s=i),n<l&&(l=n),i>e&&(e=i),n>r&&(r=n)}c=Math.max(e-s,r-l),c=0!==c?32767/c:0}return Rs(o,a,i,s,l,c,0),a}function zs(t,e,i,r,n){let o;if(n===function(t,e,i,r){let n=0;for(let o=e,a=i-r;o<i;o+=r)n+=(t[a]-t[o])*(t[o+1]+t[a+1]),a=o;return n}(t,e,i,r)>0)for(let a=e;a<i;a+=r)o=tl(a/r|0,t[a],t[a+1],o);else for(let a=i-r;a>=e;a-=r)o=tl(a/r|0,t[a],t[a+1],o);return o&&Ws(o,o.next)&&(el(o),o=o.next),o}function Ds(t,e){if(!t)return t;e||(e=t);let i,r=t;do{if(i=!1,r.steiner||!Ws(r,r.next)&&0!==Zs(r.prev,r,r.next))r=r.next;else{if(el(r),r=e=r.prev,r===r.next)break;i=!0}}while(i||r!==e);return e}function Rs(t,e,i,r,n,o,a){if(!t)return;!a&&o&&function(t,e,i,r){let n=t;do{0===n.z&&(n.z=qs(n.x,n.y,e,i,r)),n.prevZ=n.prev,n.nextZ=n.next,n=n.next}while(n!==t);n.prevZ.nextZ=null,n.prevZ=null,function(t){let e,i=1;do{let r,n=t;t=null;let o=null;for(e=0;n;){e++;let a=n,s=0;for(let t=0;t<i&&(s++,a=a.nextZ,a);t++);let l=i;for(;s>0||l>0&&a;)0!==s&&(0===l||!a||n.z<=a.z)?(r=n,n=n.nextZ,s--):(r=a,a=a.nextZ,l--),o?o.nextZ=r:t=r,r.prevZ=o,o=r;n=a}o.nextZ=null,i*=2}while(e>1)}(n)}(t,r,n,o);let s=t;for(;t.prev!==t.next;){const l=t.prev,c=t.next;if(o?Fs(t,r,n,o):Os(t))e.push(l.i,t.i,c.i),el(t),t=c.next,s=c.next;else if((t=c)===s){a?1===a?Rs(t=Bs(Ds(t),e),e,i,r,n,o,2):2===a&&Ns(t,e,i,r,n,o):Rs(Ds(t),e,i,r,n,o,1);break}}}function Os(t){const e=t.prev,i=t,r=t.next;if(Zs(e,i,r)>=0)return!1;const n=e.x,o=i.x,a=r.x,s=e.y,l=i.y,c=r.y,u=n<o?n<a?n:a:o<a?o:a,h=s<l?s<c?s:c:l<c?l:c,d=n>o?n>a?n:a:o>a?o:a,p=s>l?s>c?s:c:l>c?l:c;let f=r.next;for(;f!==e;){if(f.x>=u&&f.x<=d&&f.y>=h&&f.y<=p&&Gs(n,s,o,l,a,c,f.x,f.y)&&Zs(f.prev,f,f.next)>=0)return!1;f=f.next}return!0}function Fs(t,e,i,r){const n=t.prev,o=t,a=t.next;if(Zs(n,o,a)>=0)return!1;const s=n.x,l=o.x,c=a.x,u=n.y,h=o.y,d=a.y,p=s<l?s<c?s:c:l<c?l:c,f=u<h?u<d?u:d:h<d?h:d,m=s>l?s>c?s:c:l>c?l:c,g=u>h?u>d?u:d:h>d?h:d,y=qs(p,f,e,i,r),_=qs(m,g,e,i,r);let v=t.prevZ,b=t.nextZ;for(;v&&v.z>=y&&b&&b.z<=_;){if(v.x>=p&&v.x<=m&&v.y>=f&&v.y<=g&&v!==n&&v!==a&&Gs(s,u,l,h,c,d,v.x,v.y)&&Zs(v.prev,v,v.next)>=0)return!1;if(v=v.prevZ,b.x>=p&&b.x<=m&&b.y>=f&&b.y<=g&&b!==n&&b!==a&&Gs(s,u,l,h,c,d,b.x,b.y)&&Zs(b.prev,b,b.next)>=0)return!1;b=b.nextZ}for(;v&&v.z>=y;){if(v.x>=p&&v.x<=m&&v.y>=f&&v.y<=g&&v!==n&&v!==a&&Gs(s,u,l,h,c,d,v.x,v.y)&&Zs(v.prev,v,v.next)>=0)return!1;v=v.prevZ}for(;b&&b.z<=_;){if(b.x>=p&&b.x<=m&&b.y>=f&&b.y<=g&&b!==n&&b!==a&&Gs(s,u,l,h,c,d,b.x,b.y)&&Zs(b.prev,b,b.next)>=0)return!1;b=b.nextZ}return!0}function Bs(t,e){let i=t;do{const r=i.prev,n=i.next.next;!Ws(r,n)&&Xs(r,i,i.next,n)&&Ys(r,n)&&Ys(n,r)&&(e.push(r.i,i.i,n.i),el(i),el(i.next),i=t=n),i=i.next}while(i!==t);return Ds(i)}function Ns(t,e,i,r,n,o){let a=t;do{let t=a.next.next;for(;t!==a.prev;){if(a.i!==t.i&&Hs(a,t)){let s=Qs(a,t);return a=Ds(a,a.next),s=Ds(s,s.next),Rs(a,e,i,r,n,o,0),void Rs(s,e,i,r,n,o,0)}t=t.next}a=a.next}while(a!==t)}function js(t,e){return t.x-e.x}function Vs(t,e){const i=function(t,e){let i=e;const r=t.x,n=t.y;let o,a=-1/0;do{if(n<=i.y&&n>=i.next.y&&i.next.y!==i.y){const t=i.x+(n-i.y)*(i.next.x-i.x)/(i.next.y-i.y);if(t<=r&&t>a&&(a=t,o=i.x<i.next.x?i:i.next,t===r))return o}i=i.next}while(i!==e);if(!o)return null;const s=o,l=o.x,c=o.y;let u=1/0;i=o;do{if(r>=i.x&&i.x>=l&&r!==i.x&&Gs(n<c?r:a,n,l,c,n<c?a:r,n,i.x,i.y)){const e=Math.abs(n-i.y)/(r-i.x);Ys(i,t)&&(e<u||e===u&&(i.x>o.x||i.x===o.x&&Us(o,i)))&&(o=i,u=e)}i=i.next}while(i!==s);return o}(t,e);if(!i)return e;const r=Qs(i,t);return Ds(r,r.next),Ds(i,i.next)}function Us(t,e){return Zs(t.prev,t,e.prev)<0&&Zs(e.next,t,t.next)<0}function qs(t,e,i,r,n){return(t=1431655765&((t=858993459&((t=252645135&((t=16711935&((t=(t-i)*n|0)|t<<8))|t<<4))|t<<2))|t<<1))|(e=1431655765&((e=858993459&((e=252645135&((e=16711935&((e=(e-r)*n|0)|e<<8))|e<<4))|e<<2))|e<<1))<<1}function $s(t){let e=t,i=t;do{(e.x<i.x||e.x===i.x&&e.y<i.y)&&(i=e),e=e.next}while(e!==t);return i}function Gs(t,e,i,r,n,o,a,s){return(n-a)*(e-s)>=(t-a)*(o-s)&&(t-a)*(r-s)>=(i-a)*(e-s)&&(i-a)*(o-s)>=(n-a)*(r-s)}function Hs(t,e){return t.next.i!==e.i&&t.prev.i!==e.i&&!function(t,e){let i=t;do{if(i.i!==t.i&&i.next.i!==t.i&&i.i!==e.i&&i.next.i!==e.i&&Xs(i,i.next,t,e))return!0;i=i.next}while(i!==t);return!1}(t,e)&&(Ys(t,e)&&Ys(e,t)&&function(t,e){let i=t,r=!1;const n=(t.x+e.x)/2,o=(t.y+e.y)/2;do{i.y>o!=i.next.y>o&&i.next.y!==i.y&&n<(i.next.x-i.x)*(o-i.y)/(i.next.y-i.y)+i.x&&(r=!r),i=i.next}while(i!==t);return r}(t,e)&&(Zs(t.prev,t,e.prev)||Zs(t,e.prev,e))||Ws(t,e)&&Zs(t.prev,t,t.next)>0&&Zs(e.prev,e,e.next)>0)}function Zs(t,e,i){return(e.y-t.y)*(i.x-e.x)-(e.x-t.x)*(i.y-e.y)}function Ws(t,e){return t.x===e.x&&t.y===e.y}function Xs(t,e,i,r){const n=Ks(Zs(t,e,i)),o=Ks(Zs(t,e,r)),a=Ks(Zs(i,r,t)),s=Ks(Zs(i,r,e));return n!==o&&a!==s||!(0!==n||!Js(t,i,e))||!(0!==o||!Js(t,r,e))||!(0!==a||!Js(i,t,r))||!(0!==s||!Js(i,e,r))}function Js(t,e,i){return e.x<=Math.max(t.x,i.x)&&e.x>=Math.min(t.x,i.x)&&e.y<=Math.max(t.y,i.y)&&e.y>=Math.min(t.y,i.y)}function Ks(t){return t>0?1:t<0?-1:0}function Ys(t,e){return Zs(t.prev,t,t.next)<0?Zs(t,e,t.next)>=0&&Zs(t,t.prev,e)>=0:Zs(t,e,t.prev)<0||Zs(t,t.next,e)<0}function Qs(t,e){const i=il(t.i,t.x,t.y),r=il(e.i,e.x,e.y),n=t.next,o=e.prev;return t.next=e,e.prev=t,i.next=n,n.prev=i,r.next=i,i.prev=r,o.next=r,r.prev=o,r}function tl(t,e,i,r){const n=il(t,e,i);return r?(n.next=r.next,n.prev=r,r.next.prev=n,r.next=n):(n.prev=n,n.next=n),n}function el(t){t.next.prev=t.prev,t.prev.next=t.next,t.prevZ&&(t.prevZ.nextZ=t.nextZ),t.nextZ&&(t.nextZ.prevZ=t.prevZ)}function il(t,e,i){return{i:t,x:e,y:i,prev:null,next:null,z:0,prevZ:null,nextZ:null,steiner:!1}}function rl(t,e,i){const r=i.patternDependencies;let n=!1;for(const o of e){const e=o.paint.get(`${t}-pattern`);e.isConstant()||(n=!0);const i=e.constantOr(null);i&&(n=!0,r[i.to]=!0,r[i.from]=!0)}return n}function nl(t,e,i,r,n){const o=n.patternDependencies;for(const a of e){const e=a.paint.get(`${t}-pattern`).value;if("constant"!==e.kind){let t=e.evaluate({zoom:r-1},i,{},n.availableImages),s=e.evaluate({zoom:r},i,{},n.availableImages),l=e.evaluate({zoom:r+1},i,{},n.availableImages);t=t&&t.name?t.name:t,s=s&&s.name?s.name:s,l=l&&l.name?l.name:l,o[t]=!0,o[s]=!0,o[l]=!0,i.patterns[a.id]={min:t,mid:s,max:l}}}return i}class ol{constructor(t){this.zoom=t.zoom,this.overscaling=t.overscaling,this.layers=t.layers,this.layerIds=this.layers.map((t=>t.id)),this.index=t.index,this.hasPattern=!1,this.patternFeatures=[],this.layoutVertexArray=new Wo,this.indexArray=new na,this.indexArray2=new oa,this.programConfigurations=new Da(t.layers,t.zoom),this.segments=new la,this.segments2=new la,this.stateDependentLayerIds=this.layers.filter((t=>t.isStateDependent())).map((t=>t.id))}populate(t,e,i){this.hasPattern=rl("fill",this.layers,e);const r=this.layers[0].layout.get("fill-sort-key"),n=!r.isConstant(),o=[];for(const{feature:a,id:s,index:l,sourceLayerIndex:c}of t){const t=this.layers[0]._featureFilter.needGeometry,u=Va(a,t);if(!this.layers[0]._featureFilter.filter(new Un(this.zoom),u,i))continue;const h=n?r.evaluate(u,{},i,e.availableImages):void 0,d={id:s,properties:a.properties,type:a.type,sourceLayerIndex:c,index:l,geometry:t?u.geometry:ja(a),patterns:{},sortKey:h};o.push(d)}n&&o.sort(((t,e)=>t.sortKey-e.sortKey));for(const a of o){const{geometry:r,index:n,sourceLayerIndex:o}=a;if(this.hasPattern){const t=nl("fill",this.layers,a,this.zoom,e);this.patternFeatures.push(t)}else this.addFeature(a,r,n,i,{});e.featureIndex.insert(t[n].feature,r,n,o,this.index)}}update(t,e,i){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(t,e,this.stateDependentLayers,i)}addFeatures(t,e,i){for(const r of this.patternFeatures)this.addFeature(r,r.geometry,r.index,e,i)}isEmpty(){return 0===this.layoutVertexArray.length}uploadPending(){return!this.uploaded||this.programConfigurations.needsUpload}upload(t){this.uploaded||(this.layoutVertexBuffer=t.createVertexBuffer(this.layoutVertexArray,Ms),this.indexBuffer=t.createIndexBuffer(this.indexArray),this.indexBuffer2=t.createIndexBuffer(this.indexArray2)),this.programConfigurations.upload(t),this.uploaded=!0}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.indexBuffer2.destroy(),this.programConfigurations.destroy(),this.segments.destroy(),this.segments2.destroy())}addFeature(t,e,i,r,n){for(const o of _i(e,500)){let t=0;for(const s of o)t+=s.length;const e=this.segments.prepareSegment(t,this.layoutVertexArray,this.indexArray),i=e.vertexLength,r=[],n=[];for(const s of o){if(0===s.length)continue;s!==o[0]&&n.push(r.length/2);const t=this.segments2.prepareSegment(s.length,this.layoutVertexArray,this.indexArray2),e=t.vertexLength;this.layoutVertexArray.emplaceBack(s[0].x,s[0].y),this.indexArray2.emplaceBack(e+s.length-1,e),r.push(s[0].x),r.push(s[0].y);for(let i=1;i<s.length;i++)this.layoutVertexArray.emplaceBack(s[i].x,s[i].y),this.indexArray2.emplaceBack(e+i-1,e+i),r.push(s[i].x),r.push(s[i].y);t.vertexLength+=s.length,t.primitiveLength+=s.length}const a=Ls(r,n);for(let o=0;o<a.length;o+=3)this.indexArray.emplaceBack(i+a[o],i+a[o+1],i+a[o+2]);e.vertexLength+=t,e.primitiveLength+=a.length/3}this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,t,i,n,r)}}let al,sl;xn("FillBucket",ol,{omit:["layers","patternFeatures"]});var ll={get paint(){return sl=sl||new io({"fill-antialias":new Kn(H.paint_fill["fill-antialias"]),"fill-opacity":new Yn(H.paint_fill["fill-opacity"]),"fill-color":new Yn(H.paint_fill["fill-color"]),"fill-outline-color":new Yn(H.paint_fill["fill-outline-color"]),"fill-translate":new Kn(H.paint_fill["fill-translate"]),"fill-translate-anchor":new Kn(H.paint_fill["fill-translate-anchor"]),"fill-pattern":new Qn(H.paint_fill["fill-pattern"])})},get layout(){return al=al||new io({"fill-sort-key":new Yn(H.layout_fill["fill-sort-key"])})}};class cl extends no{constructor(t){super(t,ll)}recalculate(t,e){super.recalculate(t,e);const i=this.paint._values["fill-outline-color"];"constant"===i.value.kind&&void 0===i.value.value&&(this.paint._values["fill-outline-color"]=this.paint._values["fill-color"])}createBucket(t){return new ol(t)}queryRadius(){return is(this.paint.get("fill-translate"))}queryIntersectsFeature(t,e,i,r,n,o,a){return Ha(rs(t,this.paint.get("fill-translate"),this.paint.get("fill-translate-anchor"),o.angle,a),r)}isTileClipped(){return!0}}const ul=lo([{name:"a_pos",components:2,type:"Int16"},{name:"a_normal_ed",components:4,type:"Int16"}],4),hl=lo([{name:"a_centroid",components:2,type:"Int16"}],4),{members:dl}=ul;var pl={},fl=r,ml=gl;function gl(t,e,i,r,n){this.properties={},this.extent=i,this.type=0,this._pbf=t,this._geometry=-1,this._keys=r,this._values=n,t.readFields(yl,this,e)}function yl(t,e,i){1==t?e.id=i.readVarint():2==t?function(t,e){for(var i=t.readVarint()+t.pos;t.pos<i;){var r=e._keys[t.readVarint()],n=e._values[t.readVarint()];e.properties[r]=n}}(i,e):3==t?e.type=i.readVarint():4==t&&(e._geometry=i.pos)}function _l(t){for(var e,i,r=0,n=0,o=t.length,a=o-1;n<o;a=n++)r+=((i=t[a]).x-(e=t[n]).x)*(e.y+i.y);return r}gl.types=["Unknown","Point","LineString","Polygon"],gl.prototype.loadGeometry=function(){var t=this._pbf;t.pos=this._geometry;for(var e,i=t.readVarint()+t.pos,r=1,n=0,o=0,a=0,s=[];t.pos<i;){if(n<=0){var l=t.readVarint();r=7&l,n=l>>3}if(n--,1===r||2===r)o+=t.readSVarint(),a+=t.readSVarint(),1===r&&(e&&s.push(e),e=[]),e.push(new fl(o,a));else{if(7!==r)throw new Error("unknown command "+r);e&&e.push(e[0].clone())}}return e&&s.push(e),s},gl.prototype.bbox=function(){var t=this._pbf;t.pos=this._geometry;for(var e=t.readVarint()+t.pos,i=1,r=0,n=0,o=0,a=1/0,s=-1/0,l=1/0,c=-1/0;t.pos<e;){if(r<=0){var u=t.readVarint();i=7&u,r=u>>3}if(r--,1===i||2===i)(n+=t.readSVarint())<a&&(a=n),n>s&&(s=n),(o+=t.readSVarint())<l&&(l=o),o>c&&(c=o);else if(7!==i)throw new Error("unknown command "+i)}return[a,l,s,c]},gl.prototype.toGeoJSON=function(t,e,i){var r,n,o=this.extent*Math.pow(2,i),a=this.extent*t,s=this.extent*e,l=this.loadGeometry(),c=gl.types[this.type];function u(t){for(var e=0;e<t.length;e++){var i=t[e];t[e]=[360*(i.x+a)/o-180,360/Math.PI*Math.atan(Math.exp((180-360*(i.y+s)/o)*Math.PI/180))-90]}}switch(this.type){case 1:var h=[];for(r=0;r<l.length;r++)h[r]=l[r][0];u(l=h);break;case 2:for(r=0;r<l.length;r++)u(l[r]);break;case 3:for(l=function(t){var e=t.length;if(e<=1)return[t];for(var i,r,n=[],o=0;o<e;o++){var a=_l(t[o]);0!==a&&(void 0===r&&(r=a<0),r===a<0?(i&&n.push(i),i=[t[o]]):i.push(t[o]))}return i&&n.push(i),n}(l),r=0;r<l.length;r++)for(n=0;n<l[r].length;n++)u(l[r][n])}1===l.length?l=l[0]:c="Multi"+c;var d={type:"Feature",geometry:{type:c,coordinates:l},properties:this.properties};return"id"in this&&(d.id=this.id),d};var vl=ml,bl=xl;function xl(t,e){this.version=1,this.name=null,this.extent=4096,this.length=0,this._pbf=t,this._keys=[],this._values=[],this._features=[],t.readFields(wl,this,e),this.length=this._features.length}function wl(t,e,i){15===t?e.version=i.readVarint():1===t?e.name=i.readString():5===t?e.extent=i.readVarint():2===t?e._features.push(i.pos):3===t?e._keys.push(i.readString()):4===t&&e._values.push(function(t){for(var e=null,i=t.readVarint()+t.pos;t.pos<i;){var r=t.readVarint()>>3;e=1===r?t.readString():2===r?t.readFloat():3===r?t.readDouble():4===r?t.readVarint64():5===r?t.readVarint():6===r?t.readSVarint():7===r?t.readBoolean():null}return e}(i))}xl.prototype.feature=function(t){if(t<0||t>=this._features.length)throw new Error("feature index out of bounds");this._pbf.pos=this._features[t];var e=this._pbf.readVarint()+this._pbf.pos;return new vl(this._pbf,e,this.extent,this._keys,this._values)};var kl=bl;function El(t,e,i){if(3===t){var r=new kl(i,i.readVarint()+i.pos);r.length&&(e[r.name]=r)}}pl.VectorTile=function(t,e){this.layers=t.readFields(El,{},e)},pl.VectorTileFeature=ml,pl.VectorTileLayer=bl;const Sl=pl.VectorTileFeature.types,Il=Math.pow(2,13);function Cl(t,e,i,r,n,o,a,s){t.emplaceBack(e,i,2*Math.floor(r*Il)+a,n*Il*2,o*Il*2,Math.round(s))}class Tl{constructor(t){this.zoom=t.zoom,this.overscaling=t.overscaling,this.layers=t.layers,this.layerIds=this.layers.map((t=>t.id)),this.index=t.index,this.hasPattern=!1,this.layoutVertexArray=new Xo,this.centroidVertexArray=new Ho,this.indexArray=new na,this.programConfigurations=new Da(t.layers,t.zoom),this.segments=new la,this.stateDependentLayerIds=this.layers.filter((t=>t.isStateDependent())).map((t=>t.id))}populate(t,e,i){this.features=[],this.hasPattern=rl("fill-extrusion",this.layers,e);for(const{feature:r,id:n,index:o,sourceLayerIndex:a}of t){const t=this.layers[0]._featureFilter.needGeometry,s=Va(r,t);if(!this.layers[0]._featureFilter.filter(new Un(this.zoom),s,i))continue;const l={id:n,sourceLayerIndex:a,index:o,geometry:t?s.geometry:ja(r),properties:r.properties,type:r.type,patterns:{}};this.hasPattern?this.features.push(nl("fill-extrusion",this.layers,l,this.zoom,e)):this.addFeature(l,l.geometry,o,i,{}),e.featureIndex.insert(r,l.geometry,o,a,this.index,!0)}}addFeatures(t,e,i){for(const r of this.features){const{geometry:t}=r;this.addFeature(r,t,r.index,e,i)}}update(t,e,i){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(t,e,this.stateDependentLayers,i)}isEmpty(){return 0===this.layoutVertexArray.length&&0===this.centroidVertexArray.length}uploadPending(){return!this.uploaded||this.programConfigurations.needsUpload}upload(t){this.uploaded||(this.layoutVertexBuffer=t.createVertexBuffer(this.layoutVertexArray,dl),this.centroidVertexBuffer=t.createVertexBuffer(this.centroidVertexArray,hl.members,!0),this.indexBuffer=t.createIndexBuffer(this.indexArray)),this.programConfigurations.upload(t),this.uploaded=!0}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy(),this.centroidVertexBuffer.destroy())}addFeature(t,e,i,r,n){for(const o of _i(e,500)){const e={x:0,y:0,vertexCount:0};let i=0;for(const t of o)i+=t.length;let r=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray);for(const t of o){if(0===t.length)continue;if(Pl(t))continue;let i=0;for(let n=0;n<t.length;n++){const o=t[n];if(n>=1){const a=t[n-1];if(!Al(o,a)){r.vertexLength+4>la.MAX_VERTEX_ARRAY_LENGTH&&(r=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray));const t=o.sub(a)._perp()._unit(),n=a.dist(o);i+n>32768&&(i=0),Cl(this.layoutVertexArray,o.x,o.y,t.x,t.y,0,0,i),Cl(this.layoutVertexArray,o.x,o.y,t.x,t.y,0,1,i),e.x+=2*o.x,e.y+=2*o.y,e.vertexCount+=2,i+=n,Cl(this.layoutVertexArray,a.x,a.y,t.x,t.y,0,0,i),Cl(this.layoutVertexArray,a.x,a.y,t.x,t.y,0,1,i),e.x+=2*a.x,e.y+=2*a.y,e.vertexCount+=2;const s=r.vertexLength;this.indexArray.emplaceBack(s,s+2,s+1),this.indexArray.emplaceBack(s+1,s+2,s+3),r.vertexLength+=4,r.primitiveLength+=2}}}}if(r.vertexLength+i>la.MAX_VERTEX_ARRAY_LENGTH&&(r=this.segments.prepareSegment(i,this.layoutVertexArray,this.indexArray)),"Polygon"!==Sl[t.type])continue;const n=[],a=[],s=r.vertexLength;for(const t of o)if(0!==t.length){t!==o[0]&&a.push(n.length/2);for(let i=0;i<t.length;i++){const r=t[i];Cl(this.layoutVertexArray,r.x,r.y,0,0,1,1,0),e.x+=r.x,e.y+=r.y,e.vertexCount+=1,n.push(r.x),n.push(r.y)}}const l=Ls(n,a);for(let t=0;t<l.length;t+=3)this.indexArray.emplaceBack(s+l[t],s+l[t+2],s+l[t+1]);r.primitiveLength+=l.length/3,r.vertexLength+=i;for(let t=0;t<e.vertexCount;t++){const t=Math.floor(e.x/e.vertexCount),i=Math.floor(e.y/e.vertexCount);this.centroidVertexArray.emplaceBack(t,i)}}this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,t,i,n,r)}}function Al(t,e){return t.x===e.x&&(t.x<0||t.x>Fa)||t.y===e.y&&(t.y<0||t.y>Fa)}function Pl(t){return t.every((t=>t.x<0))||t.every((t=>t.x>Fa))||t.every((t=>t.y<0))||t.every((t=>t.y>Fa))}let Ml;xn("FillExtrusionBucket",Tl,{omit:["layers","features"]});var Ll={get paint(){return Ml=Ml||new io({"fill-extrusion-opacity":new Kn(H["paint_fill-extrusion"]["fill-extrusion-opacity"]),"fill-extrusion-color":new Yn(H["paint_fill-extrusion"]["fill-extrusion-color"]),"fill-extrusion-translate":new Kn(H["paint_fill-extrusion"]["fill-extrusion-translate"]),"fill-extrusion-translate-anchor":new Kn(H["paint_fill-extrusion"]["fill-extrusion-translate-anchor"]),"fill-extrusion-pattern":new Qn(H["paint_fill-extrusion"]["fill-extrusion-pattern"]),"fill-extrusion-height":new Yn(H["paint_fill-extrusion"]["fill-extrusion-height"]),"fill-extrusion-base":new Yn(H["paint_fill-extrusion"]["fill-extrusion-base"]),"fill-extrusion-vertical-gradient":new Kn(H["paint_fill-extrusion"]["fill-extrusion-vertical-gradient"])})}};class zl extends no{constructor(t){super(t,Ll)}createBucket(t){return new Tl(t)}queryRadius(){return is(this.paint.get("fill-extrusion-translate"))}is3D(){return!0}queryIntersectsFeature(t,e,i,r,n,a,s,l){const c=rs(t,this.paint.get("fill-extrusion-translate"),this.paint.get("fill-extrusion-translate-anchor"),a.angle,s),u=this.paint.get("fill-extrusion-height").evaluate(e,i),h=this.paint.get("fill-extrusion-base").evaluate(e,i),d=function(t,e){const i=[];for(const r of t){const t=[r.x,r.y,0,1];ps(t,t,e),i.push(new o(t[0]/t[3],t[1]/t[3]))}return i}(c,l),p=function(t,e,i,r){const n=[],a=[],s=r[8]*e,l=r[9]*e,c=r[10]*e,u=r[11]*e,h=r[8]*i,d=r[9]*i,p=r[10]*i,f=r[11]*i;for(const m of t){const t=[],e=[];for(const i of m){const n=i.x,a=i.y,m=r[0]*n+r[4]*a+r[12],g=r[1]*n+r[5]*a+r[13],y=r[2]*n+r[6]*a+r[14],_=r[3]*n+r[7]*a+r[15],v=y+c,b=_+u,x=m+h,w=g+d,k=y+p,E=_+f,S=new o((m+s)/b,(g+l)/b);S.z=v/b,t.push(S);const I=new o(x/E,w/E);I.z=k/E,e.push(I)}n.push(t),a.push(e)}return[n,a]}(r,h,u,l);return function(t,e,i){let r=1/0;Ha(i,e)&&(r=Rl(i,e[0]));for(let n=0;n<e.length;n++){const o=e[n],a=t[n];for(let t=0;t<o.length-1;t++){const e=o[t],n=[e,o[t+1],a[t+1],a[t],e];$a(i,n)&&(r=Math.min(r,Rl(i,n)))}}return r!==1/0&&r}(p[0],p[1],d)}}function Dl(t,e){return t.x*e.x+t.y*e.y}function Rl(t,e){if(1===t.length){let i=0;const r=e[i++];let n;for(;!n||r.equals(n);)if(n=e[i++],!n)return 1/0;for(;i<e.length;i++){const o=e[i],a=t[0],s=n.sub(r),l=o.sub(r),c=a.sub(r),u=Dl(s,s),h=Dl(s,l),d=Dl(l,l),p=Dl(c,s),f=Dl(c,l),m=u*d-h*h,g=(d*p-h*f)/m,y=(u*f-h*p)/m,_=r.z*(1-g-y)+n.z*g+o.z*y;if(isFinite(_))return _}return 1/0}{let t=1/0;for(const i of e)t=Math.min(t,i.z);return t}}const Ol=lo([{name:"a_pos_normal",components:2,type:"Int16"},{name:"a_data",components:4,type:"Uint8"}],4),{members:Fl}=Ol,Bl=lo([{name:"a_uv_x",components:1,type:"Float32"},{name:"a_split_index",components:1,type:"Float32"}]),{members:Nl}=Bl,jl=pl.VectorTileFeature.types,Vl=Math.cos(Math.PI/180*37.5),Ul=Math.pow(2,14)/.5;class ql{constructor(t){this.zoom=t.zoom,this.overscaling=t.overscaling,this.layers=t.layers,this.layerIds=this.layers.map((t=>t.id)),this.index=t.index,this.hasPattern=!1,this.patternFeatures=[],this.lineClipsArray=[],this.gradients={},this.layers.forEach((t=>{this.gradients[t.id]={}})),this.layoutVertexArray=new Jo,this.layoutVertexArray2=new Ko,this.indexArray=new na,this.programConfigurations=new Da(t.layers,t.zoom),this.segments=new la,this.maxLineLength=0,this.stateDependentLayerIds=this.layers.filter((t=>t.isStateDependent())).map((t=>t.id))}populate(t,e,i){this.hasPattern=rl("line",this.layers,e);const r=this.layers[0].layout.get("line-sort-key"),n=!r.isConstant(),o=[];for(const{feature:a,id:s,index:l,sourceLayerIndex:c}of t){const t=this.layers[0]._featureFilter.needGeometry,e=Va(a,t);if(!this.layers[0]._featureFilter.filter(new Un(this.zoom),e,i))continue;const u=n?r.evaluate(e,{},i):void 0,h={id:s,properties:a.properties,type:a.type,sourceLayerIndex:c,index:l,geometry:t?e.geometry:ja(a),patterns:{},sortKey:u};o.push(h)}n&&o.sort(((t,e)=>t.sortKey-e.sortKey));for(const a of o){const{geometry:r,index:n,sourceLayerIndex:o}=a;if(this.hasPattern){const t=nl("line",this.layers,a,this.zoom,e);this.patternFeatures.push(t)}else this.addFeature(a,r,n,i,{});e.featureIndex.insert(t[n].feature,r,n,o,this.index)}}update(t,e,i){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(t,e,this.stateDependentLayers,i)}addFeatures(t,e,i){for(const r of this.patternFeatures)this.addFeature(r,r.geometry,r.index,e,i)}isEmpty(){return 0===this.layoutVertexArray.length}uploadPending(){return!this.uploaded||this.programConfigurations.needsUpload}upload(t){this.uploaded||(0!==this.layoutVertexArray2.length&&(this.layoutVertexBuffer2=t.createVertexBuffer(this.layoutVertexArray2,Nl)),this.layoutVertexBuffer=t.createVertexBuffer(this.layoutVertexArray,Fl),this.indexBuffer=t.createIndexBuffer(this.indexArray)),this.programConfigurations.upload(t),this.uploaded=!0}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy())}lineFeatureClips(t){if(t.properties&&Object.prototype.hasOwnProperty.call(t.properties,"mapbox_clip_start")&&Object.prototype.hasOwnProperty.call(t.properties,"mapbox_clip_end"))return{start:+t.properties.mapbox_clip_start,end:+t.properties.mapbox_clip_end}}addFeature(t,e,i,r,n){const o=this.layers[0].layout,a=o.get("line-join").evaluate(t,{}),s=o.get("line-cap"),l=o.get("line-miter-limit"),c=o.get("line-round-limit");this.lineClips=this.lineFeatureClips(t);for(const u of e)this.addLine(u,t,a,s,l,c);this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,t,i,n,r)}addLine(t,e,i,r,n,o){if(this.distance=0,this.scaledDistance=0,this.totalDistance=0,this.lineClips){this.lineClipsArray.push(this.lineClips);for(let e=0;e<t.length-1;e++)this.totalDistance+=t[e].dist(t[e+1]);this.updateScaledDistance(),this.maxLineLength=Math.max(this.maxLineLength,this.totalDistance)}const a="Polygon"===jl[e.type];let s=t.length;for(;s>=2&&t[s-1].equals(t[s-2]);)s--;let l=0;for(;l<s-1&&t[l].equals(t[l+1]);)l++;if(s<(a?3:2))return;"bevel"===i&&(n=1.05);const c=this.overscaling<=16?15*Fa/(512*this.overscaling):0,u=this.segments.prepareSegment(10*s,this.layoutVertexArray,this.indexArray);let h,d,p,f,m;this.e1=this.e2=-1,a&&(h=t[s-2],m=t[l].sub(h)._unit()._perp());for(let g=l;g<s;g++){if(p=g===s-1?a?t[l+1]:void 0:t[g+1],p&&t[g].equals(p))continue;m&&(f=m),h&&(d=h),h=t[g],m=p?p.sub(h)._unit()._perp():f,f=f||m;let e=f.add(m);0===e.x&&0===e.y||e._unit();const y=f.x*m.x+f.y*m.y,_=e.x*m.x+e.y*m.y,v=0!==_?1/_:1/0,b=2*Math.sqrt(2-2*_),x=_<Vl&&d&&p,w=f.x*m.y-f.y*m.x>0;if(x&&g>l){const t=h.dist(d);if(t>2*c){const e=h.sub(h.sub(d)._mult(c/t)._round());this.updateDistance(d,e),this.addCurrentVertex(e,f,0,0,u),d=e}}const k=d&&p;let E=k?i:a?"butt":r;if(k&&"round"===E&&(v<o?E="miter":v<=2&&(E="fakeround")),"miter"===E&&v>n&&(E="bevel"),"bevel"===E&&(v>2&&(E="flipbevel"),v<n&&(E="miter")),d&&this.updateDistance(d,h),"miter"===E)e._mult(v),this.addCurrentVertex(h,e,0,0,u);else if("flipbevel"===E){if(v>100)e=m.mult(-1);else{const t=v*f.add(m).mag()/f.sub(m).mag();e._perp()._mult(t*(w?-1:1))}this.addCurrentVertex(h,e,0,0,u),this.addCurrentVertex(h,e.mult(-1),0,0,u)}else if("bevel"===E||"fakeround"===E){const t=-Math.sqrt(v*v-1),e=w?t:0,i=w?0:t;if(d&&this.addCurrentVertex(h,f,e,i,u),"fakeround"===E){const t=Math.round(180*b/Math.PI/20);for(let e=1;e<t;e++){let i=e/t;if(.5!==i){const t=i-.5;i+=i*t*(i-1)*((1.0904+y*(y*(3.55645-1.43519*y)-3.2452))*t*t+(.848013+y*(.215638*y-1.06021)))}const r=m.sub(f)._mult(i)._add(f)._unit()._mult(w?-1:1);this.addHalfVertex(h,r.x,r.y,!1,w,0,u)}}p&&this.addCurrentVertex(h,m,-e,-i,u)}else if("butt"===E)this.addCurrentVertex(h,e,0,0,u);else if("square"===E){const t=d?1:-1;this.addCurrentVertex(h,e,t,t,u)}else"round"===E&&(d&&(this.addCurrentVertex(h,f,0,0,u),this.addCurrentVertex(h,f,1,1,u,!0)),p&&(this.addCurrentVertex(h,m,-1,-1,u,!0),this.addCurrentVertex(h,m,0,0,u)));if(x&&g<s-1){const t=h.dist(p);if(t>2*c){const e=h.add(p.sub(h)._mult(c/t)._round());this.updateDistance(h,e),this.addCurrentVertex(e,m,0,0,u),h=e}}}}addCurrentVertex(t,e,i,r,n,o=!1){const a=e.y*r-e.x,s=-e.y-e.x*r;this.addHalfVertex(t,e.x+e.y*i,e.y-e.x*i,o,!1,i,n),this.addHalfVertex(t,a,s,o,!0,-r,n),this.distance>Ul/2&&0===this.totalDistance&&(this.distance=0,this.updateScaledDistance(),this.addCurrentVertex(t,e,i,r,n,o))}addHalfVertex({x:t,y:e},i,r,n,o,a,s){const l=.5*(this.lineClips?this.scaledDistance*(Ul-1):this.scaledDistance);this.layoutVertexArray.emplaceBack((t<<1)+(n?1:0),(e<<1)+(o?1:0),Math.round(63*i)+128,Math.round(63*r)+128,1+(0===a?0:a<0?-1:1)|(63&l)<<2,l>>6),this.lineClips&&this.layoutVertexArray2.emplaceBack((this.scaledDistance-this.lineClips.start)/(this.lineClips.end-this.lineClips.start),this.lineClipsArray.length);const c=s.vertexLength++;this.e1>=0&&this.e2>=0&&(this.indexArray.emplaceBack(this.e1,this.e2,c),s.primitiveLength++),o?this.e2=c:this.e1=c}updateScaledDistance(){this.scaledDistance=this.lineClips?this.lineClips.start+(this.lineClips.end-this.lineClips.start)*this.distance/this.totalDistance:this.distance}updateDistance(t,e){this.distance+=t.dist(e),this.updateScaledDistance()}}let $l,Gl;xn("LineBucket",ql,{omit:["layers","patternFeatures"]});var Hl={get paint(){return Gl=Gl||new io({"line-opacity":new Yn(H.paint_line["line-opacity"]),"line-color":new Yn(H.paint_line["line-color"]),"line-translate":new Kn(H.paint_line["line-translate"]),"line-translate-anchor":new Kn(H.paint_line["line-translate-anchor"]),"line-width":new Yn(H.paint_line["line-width"]),"line-gap-width":new Yn(H.paint_line["line-gap-width"]),"line-offset":new Yn(H.paint_line["line-offset"]),"line-blur":new Yn(H.paint_line["line-blur"]),"line-dasharray":new to(H.paint_line["line-dasharray"]),"line-pattern":new Qn(H.paint_line["line-pattern"]),"line-gradient":new eo(H.paint_line["line-gradient"])})},get layout(){return $l=$l||new io({"line-cap":new Kn(H.layout_line["line-cap"]),"line-join":new Yn(H.layout_line["line-join"]),"line-miter-limit":new Kn(H.layout_line["line-miter-limit"]),"line-round-limit":new Kn(H.layout_line["line-round-limit"]),"line-sort-key":new Yn(H.layout_line["line-sort-key"])})}};class Zl extends Yn{possiblyEvaluate(t,e){return e=new Un(Math.floor(e.zoom),{now:e.now,fadeDuration:e.fadeDuration,zoomHistory:e.zoomHistory,transition:e.transition}),super.possiblyEvaluate(t,e)}evaluate(t,e,i,r){return e=y({},e,{zoom:Math.floor(e.zoom)}),super.evaluate(t,e,i,r)}}let Wl;class Xl extends no{constructor(t){super(t,Hl),this.gradientVersion=0,Wl||(Wl=new Zl(Hl.paint.properties["line-width"].specification),Wl.useIntegerZoom=!0)}_handleSpecialPaintPropertyUpdate(t){if("line-gradient"===t){const t=this.gradientExpression();this.stepInterpolant=!!function(t){return void 0!==t._styleExpression}(t)&&t._styleExpression.expression instanceof ke,this.gradientVersion=(this.gradientVersion+1)%Number.MAX_SAFE_INTEGER}}gradientExpression(){return this._transitionablePaint._values["line-gradient"].value.expression}recalculate(t,e){super.recalculate(t,e),this.paint._values["line-floorwidth"]=Wl.possiblyEvaluate(this._transitioningPaint._values["line-width"].value,t)}createBucket(t){return new ql(t)}queryRadius(t){const e=t,i=Jl(es("line-width",this,e),es("line-gap-width",this,e)),r=es("line-offset",this,e);return i/2+Math.abs(r)+is(this.paint.get("line-translate"))}queryIntersectsFeature(t,e,i,r,n,a,s){const l=rs(t,this.paint.get("line-translate"),this.paint.get("line-translate-anchor"),a.angle,s),c=s/2*Jl(this.paint.get("line-width").evaluate(e,i),this.paint.get("line-gap-width").evaluate(e,i)),u=this.paint.get("line-offset").evaluate(e,i);return u&&(r=function(t,e){const i=[];for(let r=0;r<t.length;r++){const n=t[r],a=[];for(let t=0;t<n.length;t++){const i=n[t-1],r=n[t],s=n[t+1],l=0===t?new o(0,0):r.sub(i)._unit()._perp(),c=t===n.length-1?new o(0,0):s.sub(r)._unit()._perp(),u=l._add(c)._unit(),h=u.x*c.x+u.y*c.y;0!==h&&u._mult(1/h),a.push(u._mult(e)._add(r))}i.push(a)}return i}(r,u*s)),function(t,e,i){for(let r=0;r<e.length;r++){const n=e[r];if(t.length>=3)for(let e=0;e<n.length;e++)if(Qa(t,n[e]))return!0;if(Za(t,n,i))return!0}return!1}(l,r,c)}isTileClipped(){return!0}}function Jl(t,e){return e>0?e+2*t:t}const Kl=lo([{name:"a_pos_offset",components:4,type:"Int16"},{name:"a_data",components:4,type:"Uint16"},{name:"a_pixeloffset",components:4,type:"Int16"}],4),Yl=lo([{name:"a_projected_pos",components:3,type:"Float32"}],4);lo([{name:"a_fade_opacity",components:1,type:"Uint32"}],4);const Ql=lo([{name:"a_placed",components:2,type:"Uint8"},{name:"a_shift",components:2,type:"Float32"},{name:"a_box_real",components:2,type:"Int16"}]);lo([{type:"Int16",name:"anchorPointX"},{type:"Int16",name:"anchorPointY"},{type:"Int16",name:"x1"},{type:"Int16",name:"y1"},{type:"Int16",name:"x2"},{type:"Int16",name:"y2"},{type:"Uint32",name:"featureIndex"},{type:"Uint16",name:"sourceLayerIndex"},{type:"Uint16",name:"bucketIndex"}]);const tc=lo([{name:"a_pos",components:2,type:"Int16"},{name:"a_anchor_pos",components:2,type:"Int16"},{name:"a_extrude",components:2,type:"Int16"}],4),ec=lo([{name:"a_pos",components:2,type:"Float32"},{name:"a_radius",components:1,type:"Float32"},{name:"a_flags",components:2,type:"Int16"}],4);function ic(t,e,i){return t.sections.forEach((t=>{t.text=function(t,e,i){const r=e.layout.get("text-transform").evaluate(i,{});return"uppercase"===r?t=t.toLocaleUpperCase():"lowercase"===r&&(t=t.toLocaleLowerCase()),Vn.applyArabicShaping&&(t=Vn.applyArabicShaping(t)),t}(t.text,e,i)})),t}lo([{name:"triangle",components:3,type:"Uint16"}]),lo([{type:"Int16",name:"anchorX"},{type:"Int16",name:"anchorY"},{type:"Uint16",name:"glyphStartIndex"},{type:"Uint16",name:"numGlyphs"},{type:"Uint32",name:"vertexStartIndex"},{type:"Uint32",name:"lineStartIndex"},{type:"Uint32",name:"lineLength"},{type:"Uint16",name:"segment"},{type:"Uint16",name:"lowerSize"},{type:"Uint16",name:"upperSize"},{type:"Float32",name:"lineOffsetX"},{type:"Float32",name:"lineOffsetY"},{type:"Uint8",name:"writingMode"},{type:"Uint8",name:"placedOrientation"},{type:"Uint8",name:"hidden"},{type:"Uint32",name:"crossTileID"},{type:"Int16",name:"associatedIconIndex"}]),lo([{type:"Int16",name:"anchorX"},{type:"Int16",name:"anchorY"},{type:"Int16",name:"rightJustifiedTextSymbolIndex"},{type:"Int16",name:"centerJustifiedTextSymbolIndex"},{type:"Int16",name:"leftJustifiedTextSymbolIndex"},{type:"Int16",name:"verticalPlacedTextSymbolIndex"},{type:"Int16",name:"placedIconSymbolIndex"},{type:"Int16",name:"verticalPlacedIconSymbolIndex"},{type:"Uint16",name:"key"},{type:"Uint16",name:"textBoxStartIndex"},{type:"Uint16",name:"textBoxEndIndex"},{type:"Uint16",name:"verticalTextBoxStartIndex"},{type:"Uint16",name:"verticalTextBoxEndIndex"},{type:"Uint16",name:"iconBoxStartIndex"},{type:"Uint16",name:"iconBoxEndIndex"},{type:"Uint16",name:"verticalIconBoxStartIndex"},{type:"Uint16",name:"verticalIconBoxEndIndex"},{type:"Uint16",name:"featureIndex"},{type:"Uint16",name:"numHorizontalGlyphVertices"},{type:"Uint16",name:"numVerticalGlyphVertices"},{type:"Uint16",name:"numIconVertices"},{type:"Uint16",name:"numVerticalIconVertices"},{type:"Uint16",name:"useRuntimeCollisionCircles"},{type:"Uint32",name:"crossTileID"},{type:"Float32",name:"textBoxScale"},{type:"Float32",name:"collisionCircleDiameter"},{type:"Uint16",name:"textAnchorOffsetStartIndex"},{type:"Uint16",name:"textAnchorOffsetEndIndex"}]),lo([{type:"Float32",name:"offsetX"}]),lo([{type:"Int16",name:"x"},{type:"Int16",name:"y"},{type:"Int16",name:"tileUnitDistanceFromAnchor"}]),lo([{type:"Uint16",name:"textAnchor"},{type:"Float32",components:2,name:"textOffset"}]);const rc={"!":"︕","#":"#",$:"$","%":"%","&":"&","(":"︵",")":"︶","*":"*","+":"+",",":"︐","-":"︲",".":"・","/":"/",":":"︓",";":"︔","<":"︿","=":"=",">":"﹀","?":"︖","@":"@","[":"﹇","\\":"\","]":"﹈","^":"^",_:"︳","`":"`","{":"︷","|":"―","}":"︸","~":"~","¢":"¢","£":"£","¥":"¥","¦":"¦","¬":"¬","¯":" ̄","–":"︲","—":"︱","‘":"﹃","’":"﹄","“":"﹁","”":"﹂","…":"︙","‧":"・","₩":"₩","、":"︑","。":"︒","〈":"︿","〉":"﹀","《":"︽","》":"︾","「":"﹁","」":"﹂","『":"﹃","』":"﹄","【":"︻","】":"︼","〔":"︹","〕":"︺","〖":"︗","〗":"︘","!":"︕","(":"︵",")":"︶",",":"︐","-":"︲",".":"・",":":"︓",";":"︔","<":"︿",">":"﹀","?":"︖","[":"﹇","]":"﹈","_":"︳","{":"︷","|":"―","}":"︸","⦅":"︵","⦆":"︶","。":"︒","「":"﹁","」":"﹂"};var nc=24,oc=lc,ac=function(t,e,i,r,n){var o,a,s=8*n-r-1,l=(1<<s)-1,c=l>>1,u=-7,h=n-1,d=-1,p=t[e+h];for(h+=d,o=p&(1<<-u)-1,p>>=-u,u+=s;u>0;o=256*o+t[e+h],h+=d,u-=8);for(a=o&(1<<-u)-1,o>>=-u,u+=r;u>0;a=256*a+t[e+h],h+=d,u-=8);if(0===o)o=1-c;else{if(o===l)return a?NaN:1/0*(p?-1:1);a+=Math.pow(2,r),o-=c}return(p?-1:1)*a*Math.pow(2,o-r)},sc=function(t,e,i,r,n,o){var a,s,l,c=8*o-n-1,u=(1<<c)-1,h=u>>1,d=23===n?Math.pow(2,-24)-Math.pow(2,-77):0,p=0,f=1,m=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=u):(a=Math.floor(Math.log(e)/Math.LN2),e*(l=Math.pow(2,-a))<1&&(a--,l*=2),(e+=a+h>=1?d/l:d*Math.pow(2,1-h))*l>=2&&(a++,l/=2),a+h>=u?(s=0,a=u):a+h>=1?(s=(e*l-1)*Math.pow(2,n),a+=h):(s=e*Math.pow(2,h-1)*Math.pow(2,n),a=0));n>=8;t[i+p]=255&s,p+=f,s/=256,n-=8);for(a=a<<n|s,c+=n;c>0;t[i+p]=255&a,p+=f,a/=256,c-=8);t[i+p-f]|=128*m};function lc(t){this.buf=ArrayBuffer.isView&&ArrayBuffer.isView(t)?t:new Uint8Array(t||0),this.pos=0,this.type=0,this.length=this.buf.length}lc.Varint=0,lc.Fixed64=1,lc.Bytes=2,lc.Fixed32=5;var cc=4294967296,uc=1/cc,hc="undefined"==typeof TextDecoder?null:new TextDecoder("utf-8");function dc(t){return t.type===lc.Bytes?t.readVarint()+t.pos:t.pos+1}function pc(t,e,i){return i?4294967296*e+(t>>>0):4294967296*(e>>>0)+(t>>>0)}function fc(t,e,i){var r=e<=16383?1:e<=2097151?2:e<=268435455?3:Math.floor(Math.log(e)/(7*Math.LN2));i.realloc(r);for(var n=i.pos-1;n>=t;n--)i.buf[n+r]=i.buf[n]}function mc(t,e){for(var i=0;i<t.length;i++)e.writeVarint(t[i])}function gc(t,e){for(var i=0;i<t.length;i++)e.writeSVarint(t[i])}function yc(t,e){for(var i=0;i<t.length;i++)e.writeFloat(t[i])}function _c(t,e){for(var i=0;i<t.length;i++)e.writeDouble(t[i])}function vc(t,e){for(var i=0;i<t.length;i++)e.writeBoolean(t[i])}function bc(t,e){for(var i=0;i<t.length;i++)e.writeFixed32(t[i])}function xc(t,e){for(var i=0;i<t.length;i++)e.writeSFixed32(t[i])}function wc(t,e){for(var i=0;i<t.length;i++)e.writeFixed64(t[i])}function kc(t,e){for(var i=0;i<t.length;i++)e.writeSFixed64(t[i])}function Ec(t,e){return(t[e]|t[e+1]<<8|t[e+2]<<16)+16777216*t[e+3]}function Sc(t,e,i){t[i]=e,t[i+1]=e>>>8,t[i+2]=e>>>16,t[i+3]=e>>>24}function Ic(t,e){return(t[e]|t[e+1]<<8|t[e+2]<<16)+(t[e+3]<<24)}lc.prototype={destroy:function(){this.buf=null},readFields:function(t,e,i){for(i=i||this.length;this.pos<i;){var r=this.readVarint(),n=r>>3,o=this.pos;this.type=7&r,t(n,e,this),this.pos===o&&this.skip(r)}return e},readMessage:function(t,e){return this.readFields(t,e,this.readVarint()+this.pos)},readFixed32:function(){var t=Ec(this.buf,this.pos);return this.pos+=4,t},readSFixed32:function(){var t=Ic(this.buf,this.pos);return this.pos+=4,t},readFixed64:function(){var t=Ec(this.buf,this.pos)+Ec(this.buf,this.pos+4)*cc;return this.pos+=8,t},readSFixed64:function(){var t=Ec(this.buf,this.pos)+Ic(this.buf,this.pos+4)*cc;return this.pos+=8,t},readFloat:function(){var t=ac(this.buf,this.pos,!0,23,4);return this.pos+=4,t},readDouble:function(){var t=ac(this.buf,this.pos,!0,52,8);return this.pos+=8,t},readVarint:function(t){var e,i,r=this.buf;return e=127&(i=r[this.pos++]),i<128?e:(e|=(127&(i=r[this.pos++]))<<7,i<128?e:(e|=(127&(i=r[this.pos++]))<<14,i<128?e:(e|=(127&(i=r[this.pos++]))<<21,i<128?e:function(t,e,i){var r,n,o=i.buf;if(r=(112&(n=o[i.pos++]))>>4,n<128)return pc(t,r,e);if(r|=(127&(n=o[i.pos++]))<<3,n<128)return pc(t,r,e);if(r|=(127&(n=o[i.pos++]))<<10,n<128)return pc(t,r,e);if(r|=(127&(n=o[i.pos++]))<<17,n<128)return pc(t,r,e);if(r|=(127&(n=o[i.pos++]))<<24,n<128)return pc(t,r,e);if(r|=(1&(n=o[i.pos++]))<<31,n<128)return pc(t,r,e);throw new Error("Expected varint not more than 10 bytes")}(e|=(15&(i=r[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&&hc?function(t,e,i){return hc.decode(t.subarray(e,i))}(this.buf,e,t):function(t,e,i){for(var r="",n=e;n<i;){var o,a,s,l=t[n],c=null,u=l>239?4:l>223?3:l>191?2:1;if(n+u>i)break;1===u?l<128&&(c=l):2===u?128==(192&(o=t[n+1]))&&(c=(31&l)<<6|63&o)<=127&&(c=null):3===u?(a=t[n+2],128==(192&(o=t[n+1]))&&128==(192&a)&&((c=(15&l)<<12|(63&o)<<6|63&a)<=2047||c>=55296&&c<=57343)&&(c=null)):4===u&&(a=t[n+2],s=t[n+3],128==(192&(o=t[n+1]))&&128==(192&a)&&128==(192&s)&&((c=(15&l)<<18|(63&o)<<12|(63&a)<<6|63&s)<=65535||c>=1114112)&&(c=null)),null===c?(c=65533,u=1):c>65535&&(c-=65536,r+=String.fromCharCode(c>>>10&1023|55296),c=56320|1023&c),r+=String.fromCharCode(c),n+=u}return r}(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!==lc.Bytes)return t.push(this.readVarint(e));var i=dc(this);for(t=t||[];this.pos<i;)t.push(this.readVarint(e));return t},readPackedSVarint:function(t){if(this.type!==lc.Bytes)return t.push(this.readSVarint());var e=dc(this);for(t=t||[];this.pos<e;)t.push(this.readSVarint());return t},readPackedBoolean:function(t){if(this.type!==lc.Bytes)return t.push(this.readBoolean());var e=dc(this);for(t=t||[];this.pos<e;)t.push(this.readBoolean());return t},readPackedFloat:function(t){if(this.type!==lc.Bytes)return t.push(this.readFloat());var e=dc(this);for(t=t||[];this.pos<e;)t.push(this.readFloat());return t},readPackedDouble:function(t){if(this.type!==lc.Bytes)return t.push(this.readDouble());var e=dc(this);for(t=t||[];this.pos<e;)t.push(this.readDouble());return t},readPackedFixed32:function(t){if(this.type!==lc.Bytes)return t.push(this.readFixed32());var e=dc(this);for(t=t||[];this.pos<e;)t.push(this.readFixed32());return t},readPackedSFixed32:function(t){if(this.type!==lc.Bytes)return t.push(this.readSFixed32());var e=dc(this);for(t=t||[];this.pos<e;)t.push(this.readSFixed32());return t},readPackedFixed64:function(t){if(this.type!==lc.Bytes)return t.push(this.readFixed64());var e=dc(this);for(t=t||[];this.pos<e;)t.push(this.readFixed64());return t},readPackedSFixed64:function(t){if(this.type!==lc.Bytes)return t.push(this.readSFixed64());var e=dc(this);for(t=t||[];this.pos<e;)t.push(this.readSFixed64());return t},skip:function(t){var e=7&t;if(e===lc.Varint)for(;this.buf[this.pos++]>127;);else if(e===lc.Bytes)this.pos=this.readVarint()+this.pos;else if(e===lc.Fixed32)this.pos+=4;else{if(e!==lc.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),Sc(this.buf,t,this.pos),this.pos+=4},writeSFixed32:function(t){this.realloc(4),Sc(this.buf,t,this.pos),this.pos+=4},writeFixed64:function(t){this.realloc(8),Sc(this.buf,-1&t,this.pos),Sc(this.buf,Math.floor(t*uc),this.pos+4),this.pos+=8},writeSFixed64:function(t){this.realloc(8),Sc(this.buf,-1&t,this.pos),Sc(this.buf,Math.floor(t*uc),this.pos+4),this.pos+=8},writeVarint:function(t){(t=+t||0)>268435455||t<0?function(t,e){var i,r;if(t>=0?(i=t%4294967296|0,r=t/4294967296|0):(r=~(-t/4294967296),4294967295^(i=~(-t%4294967296))?i=i+1|0:(i=0,r=r+1|0)),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,i.buf[i.pos]=127&(t>>>=7)}(i,0,e),function(t,e){var i=(7&t)<<4;e.buf[e.pos++]|=i|((t>>>=3)?128:0),t&&(e.buf[e.pos++]=127&t|((t>>>=7)?128:0),t&&(e.buf[e.pos++]=127&t|((t>>>=7)?128:0),t&&(e.buf[e.pos++]=127&t|((t>>>=7)?128:0),t&&(e.buf[e.pos++]=127&t|((t>>>=7)?128:0),t&&(e.buf[e.pos++]=127&t)))))}(r,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 r,n,o=0;o<e.length;o++){if((r=e.charCodeAt(o))>55295&&r<57344){if(!n){r>56319||o+1===e.length?(t[i++]=239,t[i++]=191,t[i++]=189):n=r;continue}if(r<56320){t[i++]=239,t[i++]=191,t[i++]=189,n=r;continue}r=n-55296<<10|r-56320|65536,n=null}else n&&(t[i++]=239,t[i++]=191,t[i++]=189,n=null);r<128?t[i++]=r:(r<2048?t[i++]=r>>6|192:(r<65536?t[i++]=r>>12|224:(t[i++]=r>>18|240,t[i++]=r>>12&63|128),t[i++]=r>>6&63|128),t[i++]=63&r|128)}return i}(this.buf,t,this.pos);var i=this.pos-e;i>=128&&fc(e,i,this),this.pos=e-1,this.writeVarint(i),this.pos+=i},writeFloat:function(t){this.realloc(4),sc(this.buf,t,this.pos,!0,23,4),this.pos+=4},writeDouble:function(t){this.realloc(8),sc(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 r=this.pos-i;r>=128&&fc(i,r,this),this.pos=i-1,this.writeVarint(r),this.pos+=r},writeMessage:function(t,e,i){this.writeTag(t,lc.Bytes),this.writeRawMessage(e,i)},writePackedVarint:function(t,e){e.length&&this.writeMessage(t,mc,e)},writePackedSVarint:function(t,e){e.length&&this.writeMessage(t,gc,e)},writePackedBoolean:function(t,e){e.length&&this.writeMessage(t,vc,e)},writePackedFloat:function(t,e){e.length&&this.writeMessage(t,yc,e)},writePackedDouble:function(t,e){e.length&&this.writeMessage(t,_c,e)},writePackedFixed32:function(t,e){e.length&&this.writeMessage(t,bc,e)},writePackedSFixed32:function(t,e){e.length&&this.writeMessage(t,xc,e)},writePackedFixed64:function(t,e){e.length&&this.writeMessage(t,wc,e)},writePackedSFixed64:function(t,e){e.length&&this.writeMessage(t,kc,e)},writeBytesField:function(t,e){this.writeTag(t,lc.Bytes),this.writeBytes(e)},writeFixed32Field:function(t,e){this.writeTag(t,lc.Fixed32),this.writeFixed32(e)},writeSFixed32Field:function(t,e){this.writeTag(t,lc.Fixed32),this.writeSFixed32(e)},writeFixed64Field:function(t,e){this.writeTag(t,lc.Fixed64),this.writeFixed64(e)},writeSFixed64Field:function(t,e){this.writeTag(t,lc.Fixed64),this.writeSFixed64(e)},writeVarintField:function(t,e){this.writeTag(t,lc.Varint),this.writeVarint(e)},writeSVarintField:function(t,e){this.writeTag(t,lc.Varint),this.writeSVarint(e)},writeStringField:function(t,e){this.writeTag(t,lc.Bytes),this.writeString(e)},writeFloatField:function(t,e){this.writeTag(t,lc.Fixed32),this.writeFloat(e)},writeDoubleField:function(t,e){this.writeTag(t,lc.Fixed64),this.writeDouble(e)},writeBooleanField:function(t,e){this.writeVarintField(t,Boolean(e))}};var Cc=i(oc);const Tc=3;function Ac(t,e,i){1===t&&i.readMessage(Pc,e)}function Pc(t,e,i){if(3===t){const{id:t,bitmap:r,width:n,height:o,left:a,top:s,advance:l}=i.readMessage(Mc,{});e.push({id:t,bitmap:new ws({width:n+2*Tc,height:o+2*Tc},r),metrics:{width:n,height:o,left:a,top:s,advance:l}})}}function Mc(t,e,i){1===t?e.id=i.readVarint():2===t?e.bitmap=i.readBytes():3===t?e.width=i.readVarint():4===t?e.height=i.readVarint():5===t?e.left=i.readSVarint():6===t?e.top=i.readSVarint():7===t&&(e.advance=i.readVarint())}const Lc=Tc;function zc(t){let e=0,i=0;for(const a of t)e+=a.w*a.h,i=Math.max(i,a.w);t.sort(((t,e)=>e.h-t.h));const r=[{x:0,y:0,w:Math.max(Math.ceil(Math.sqrt(e/.95)),i),h:1/0}];let n=0,o=0;for(const a of t)for(let t=r.length-1;t>=0;t--){const e=r[t];if(!(a.w>e.w||a.h>e.h)){if(a.x=e.x,a.y=e.y,o=Math.max(o,a.y+a.h),n=Math.max(n,a.x+a.w),a.w===e.w&&a.h===e.h){const e=r.pop();t<r.length&&(r[t]=e)}else a.h===e.h?(e.x+=a.w,e.w-=a.w):a.w===e.w?(e.y+=a.h,e.h-=a.h):(r.push({x:e.x+a.w,y:e.y,w:e.w-a.w,h:a.h}),e.y+=a.h,e.h-=a.h);break}}return{w:n,h:o,fill:e/(n*o)||0}}const Dc=1;class Rc{constructor(t,{pixelRatio:e,version:i,stretchX:r,stretchY:n,content:o,textFitWidth:a,textFitHeight:s}){this.paddedRect=t,this.pixelRatio=e,this.stretchX=r,this.stretchY=n,this.content=o,this.version=i,this.textFitWidth=a,this.textFitHeight=s}get tl(){return[this.paddedRect.x+Dc,this.paddedRect.y+Dc]}get br(){return[this.paddedRect.x+this.paddedRect.w-Dc,this.paddedRect.y+this.paddedRect.h-Dc]}get tlbr(){return this.tl.concat(this.br)}get displaySize(){return[(this.paddedRect.w-2*Dc)/this.pixelRatio,(this.paddedRect.h-2*Dc)/this.pixelRatio]}}class Oc{constructor(t,e){const i={},r={};this.haveRenderCallbacks=[];const n=[];this.addImages(t,i,n),this.addImages(e,r,n);const{w:o,h:a}=zc(n),s=new ks({width:o||1,height:a||1});for(const l in t){const e=t[l],r=i[l].paddedRect;ks.copy(e.data,s,{x:0,y:0},{x:r.x+Dc,y:r.y+Dc},e.data)}for(const l in e){const t=e[l],i=r[l].paddedRect,n=i.x+Dc,o=i.y+Dc,a=t.data.width,c=t.data.height;ks.copy(t.data,s,{x:0,y:0},{x:n,y:o},t.data),ks.copy(t.data,s,{x:0,y:c-1},{x:n,y:o-1},{width:a,height:1}),ks.copy(t.data,s,{x:0,y:0},{x:n,y:o+c},{width:a,height:1}),ks.copy(t.data,s,{x:a-1,y:0},{x:n-1,y:o},{width:1,height:c}),ks.copy(t.data,s,{x:0,y:0},{x:n+a,y:o},{width:1,height:c})}this.image=s,this.iconPositions=i,this.patternPositions=r}addImages(t,e,i){for(const r in t){const n=t[r],o={x:0,y:0,w:n.data.width+2*Dc,h:n.data.height+2*Dc};i.push(o),e[r]=new Rc(o,n),n.hasRenderCallback&&this.haveRenderCallbacks.push(r)}}patchUpdatedImages(t,e){t.dispatchRenderCallbacks(this.haveRenderCallbacks);for(const i in t.updatedImages)this.patchUpdatedImage(this.iconPositions[i],t.getImage(i),e),this.patchUpdatedImage(this.patternPositions[i],t.getImage(i),e)}patchUpdatedImage(t,e,i){if(!t||!e)return;if(t.version===e.version)return;t.version=e.version;const[r,n]=t.tl;i.update(e.data,void 0,{x:r,y:n})}}var Fc;xn("ImagePosition",Rc),xn("ImageAtlas",Oc),t.ah=void 0,(Fc=t.ah||(t.ah={}))[Fc.none=0]="none",Fc[Fc.horizontal=1]="horizontal",Fc[Fc.vertical=2]="vertical",Fc[Fc.horizontalOnly=3]="horizontalOnly";const Bc=-17;class Nc{constructor(){this.scale=1,this.fontStack="",this.imageName=null}static forText(t,e){const i=new Nc;return i.scale=t||1,i.fontStack=e,i}static forImage(t){const e=new Nc;return e.imageName=t,e}}class jc{constructor(){this.text="",this.sectionIndex=[],this.sections=[],this.imageSectionID=null}static fromFeature(t,e){const i=new jc;for(let r=0;r<t.sections.length;r++){const n=t.sections[r];n.image?i.addImageSection(n):i.addTextSection(n,e)}return i}length(){return this.text.length}getSection(t){return this.sections[this.sectionIndex[t]]}getSectionIndex(t){return this.sectionIndex[t]}getCharCode(t){return this.text.charCodeAt(t)}verticalizePunctuation(){this.text=function(t){let e="";for(let i=0;i<t.length;i++){const r=t.charCodeAt(i+1)||null,n=t.charCodeAt(i-1)||null;e+=r&&On(r)&&!rc[t[i+1]]||n&&On(n)&&!rc[t[i-1]]||!rc[t[i]]?t[i]:rc[t[i]]}return e}(this.text)}trim(){let t=0;for(let i=0;i<this.text.length&&Uc[this.text.charCodeAt(i)];i++)t++;let e=this.text.length;for(let i=this.text.length-1;i>=0&&i>=t&&Uc[this.text.charCodeAt(i)];i--)e--;this.text=this.text.substring(t,e),this.sectionIndex=this.sectionIndex.slice(t,e)}substring(t,e){const i=new jc;return i.text=this.text.substring(t,e),i.sectionIndex=this.sectionIndex.slice(t,e),i.sections=this.sections,i}toString(){return this.text}getMaxScale(){return this.sectionIndex.reduce(((t,e)=>Math.max(t,this.sections[e].scale)),0)}addTextSection(t,e){this.text+=t.text,this.sections.push(Nc.forText(t.scale,t.fontStack||e));const i=this.sections.length-1;for(let r=0;r<t.text.length;++r)this.sectionIndex.push(i)}addImageSection(t){const e=t.image?t.image.name:"";if(0===e.length)return void k("Can't add FormattedSection with an empty image.");const i=this.getNextImageSectionCharCode();i?(this.text+=String.fromCharCode(i),this.sections.push(Nc.forImage(e)),this.sectionIndex.push(this.sections.length-1)):k("Reached maximum number of images 6401")}getNextImageSectionCharCode(){return this.imageSectionID?this.imageSectionID>=63743?null:++this.imageSectionID:(this.imageSectionID=57344,this.imageSectionID)}}function Vc(e,i,r,n,o,a,s,l,c,u,h,d,p,f,m){const g=jc.fromFeature(e,o);let y;d===t.ah.vertical&&g.verticalizePunctuation();const{processBidirectionalText:_,processStyledBidirectionalText:v}=Vn;if(_&&1===g.sections.length){y=[];const t=_(g.toString(),Jc(g,u,a,i,n,f));for(const e of t){const t=new jc;t.text=e,t.sections=g.sections;for(let i=0;i<e.length;i++)t.sectionIndex.push(0);y.push(t)}}else if(v){y=[];const t=v(g.text,g.sectionIndex,Jc(g,u,a,i,n,f));for(const e of t){const t=new jc;t.text=e[0],t.sectionIndex=e[1],t.sections=g.sections,y.push(t)}}else y=function(t,e){const i=[],r=t.text;let n=0;for(const o of e)i.push(t.substring(n,o)),n=o;return n<r.length&&i.push(t.substring(n,r.length)),i}(g,Jc(g,u,a,i,n,f));const b=[],x={positionedLines:b,text:g.toString(),top:h[1],bottom:h[1],left:h[0],right:h[0],writingMode:d,iconsInText:!1,verticalizable:!1};return function(e,i,r,n,o,a,s,l,c,u,h,d){let p=0,f=Bc,m=0,g=0;const y="right"===l?1:"left"===l?0:.5;let _=0;for(const k of o){k.trim();const o=k.getMaxScale(),s=(o-1)*nc,l={positionedGlyphs:[],lineOffset:0};e.positionedLines[_]=l;const b=l.positionedGlyphs;let x=0;if(!k.length()){f+=a,++_;continue}for(let a=0;a<k.length();a++){const l=k.getSection(a),m=k.getSectionIndex(a),g=k.getCharCode(a);let y=0,_=null,w=null,E=null,S=nc;const I=!(c===t.ah.horizontal||!h&&!Rn(g)||h&&(Uc[g]||(v=g,/\p{sc=Arab}/u.test(String.fromCodePoint(v)))));if(l.imageName){const t=n[l.imageName];if(!t)continue;E=l.imageName,e.iconsInText=e.iconsInText||!0,w=t.paddedRect;const i=t.displaySize;l.scale=l.scale*nc/d,_={width:i[0],height:i[1],left:Dc,top:-3,advance:I?i[1]:i[0]},y=s+(nc-i[1]*l.scale),S=_.advance;const r=I?i[0]*l.scale-nc*o:i[1]*l.scale-nc*o;r>0&&r>x&&(x=r)}else{const t=r[l.fontStack],e=t&&t[g];if(e&&e.rect)w=e.rect,_=e.metrics;else{const t=i[l.fontStack],e=t&&t[g];if(!e)continue;_=e.metrics}y=(o-l.scale)*nc}I?(e.verticalizable=!0,b.push({glyph:g,imageName:E,x:p,y:f+y,vertical:I,scale:l.scale,fontStack:l.fontStack,sectionIndex:m,metrics:_,rect:w}),p+=S*l.scale+u):(b.push({glyph:g,imageName:E,x:p,y:f+y,vertical:I,scale:l.scale,fontStack:l.fontStack,sectionIndex:m,metrics:_,rect:w}),p+=_.advance*l.scale+u)}0!==b.length&&(m=Math.max(p-u,m),Yc(b,0,b.length-1,y,x)),p=0;const w=a*o+x;l.lineOffset=Math.max(x,s),f+=w,g=Math.max(w,g),++_}var v;const b=f-Bc,{horizontalAlign:x,verticalAlign:w}=Kc(s);(function(t,e,i,r,n,o,a,s,l){const c=(e-i)*n;let u=0;u=o!==a?-s*r-Bc:(-r*l+.5)*a;for(const h of t)for(const t of h.positionedGlyphs)t.x+=c,t.y+=u})(e.positionedLines,y,x,w,m,g,a,b,o.length),e.top+=-w*b,e.bottom=e.top+b,e.left+=-x*m,e.right=e.left+m}(x,i,r,n,y,s,l,c,d,u,p,m),!function(t){for(const e of t)if(0!==e.positionedGlyphs.length)return!1;return!0}(b)&&x}const Uc={9:!0,10:!0,11:!0,12:!0,13:!0,32:!0},qc={10:!0,32:!0,38:!0,41:!0,43:!0,45:!0,47:!0,173:!0,183:!0,8203:!0,8208:!0,8211:!0,8231:!0},$c={40:!0};function Gc(t,e,i,r,n,o){if(e.imageName){const t=r[e.imageName];return t?t.displaySize[0]*e.scale*nc/o+n:0}{const r=i[e.fontStack],o=r&&r[t];return o?o.metrics.advance*e.scale+n:0}}function Hc(t,e,i,r){const n=Math.pow(t-e,2);return r?t<e?n/2:2*n:n+Math.abs(i)*i}function Zc(t,e,i){let r=0;return 10===t&&(r-=1e4),i&&(r+=150),40!==t&&65288!==t||(r+=50),41!==e&&65289!==e||(r+=50),r}function Wc(t,e,i,r,n,o){let a=null,s=Hc(e,i,n,o);for(const l of r){const t=Hc(e-l.x,i,n,o)+l.badness;t<=s&&(a=l,s=t)}return{index:t,x:e,priorBreak:a,badness:s}}function Xc(t){return t?Xc(t.priorBreak).concat(t.index):[]}function Jc(t,e,i,r,n,o){if(!t)return[];const a=[],s=function(t,e,i,r,n,o){let a=0;for(let s=0;s<t.length();s++){const i=t.getSection(s);a+=Gc(t.getCharCode(s),i,r,n,e,o)}return a/Math.max(1,Math.ceil(a/i))}(t,e,i,r,n,o),l=t.text.indexOf("​")>=0;let c=0;for(let h=0;h<t.length();h++){const i=t.getSection(h),d=t.getCharCode(h);if(Uc[d]||(c+=Gc(d,i,r,n,e,o)),h<t.length()-1){const e=!((u=d)<11904)&&(!!Tn["CJK Compatibility Forms"](u)||!!Tn["CJK Compatibility"](u)||!!Tn["CJK Strokes"](u)||!!Tn["CJK Symbols and Punctuation"](u)||!!Tn["Enclosed CJK Letters and Months"](u)||!!Tn["Halfwidth and Fullwidth Forms"](u)||!!Tn["Ideographic Description Characters"](u)||!!Tn["Vertical Forms"](u)||Dn.test(String.fromCodePoint(u)));(qc[d]||e||i.imageName||h!==t.length()-2&&$c[t.getCharCode(h+1)])&&a.push(Wc(h+1,c,s,a,Zc(d,t.getCharCode(h+1),e&&l),!1))}}var u;return Xc(Wc(t.length(),c,s,a,0,!0))}function Kc(t){let e=.5,i=.5;switch(t){case"right":case"top-right":case"bottom-right":e=1;break;case"left":case"top-left":case"bottom-left":e=0}switch(t){case"bottom":case"bottom-right":case"bottom-left":i=1;break;case"top":case"top-right":case"top-left":i=0}return{horizontalAlign:e,verticalAlign:i}}function Yc(t,e,i,r,n){if(!r&&!n)return;const o=t[i],a=(t[i].x+o.metrics.advance*o.scale)*r;for(let s=e;s<=i;s++)t[s].x-=a,t[s].y+=n}function Qc(t,e,i){const{horizontalAlign:r,verticalAlign:n}=Kc(i),o=e[0]-t.displaySize[0]*r,a=e[1]-t.displaySize[1]*n;return{image:t,top:a,bottom:a+t.displaySize[1],left:o,right:o+t.displaySize[0]}}function tu(t){var e,i;let r=t.left,n=t.top,o=t.right-r,a=t.bottom-n;const s=null!==(e=t.image.textFitWidth)&&void 0!==e?e:"stretchOrShrink",l=null!==(i=t.image.textFitHeight)&&void 0!==i?i:"stretchOrShrink",c=(t.image.content[2]-t.image.content[0])/(t.image.content[3]-t.image.content[1]);if("proportional"===l){if("stretchOnly"===s&&o/a<c||"proportional"===s){const t=Math.ceil(a*c);r*=t/o,o=t}}else if("proportional"===s&&"stretchOnly"===l&&0!==c&&o/a>c){const t=Math.ceil(o/c);n*=t/a,a=t}return{x1:r,y1:n,x2:r+o,y2:n+a}}function eu(t,e,i,r,n,o){const a=t.image;let s;if(a.content){const t=a.content,e=a.pixelRatio||1;s=[t[0]/e,t[1]/e,a.displaySize[0]-t[2]/e,a.displaySize[1]-t[3]/e]}const l=e.left*o,c=e.right*o;let u,h,d,p;"width"===i||"both"===i?(p=n[0]+l-r[3],h=n[0]+c+r[1]):(p=n[0]+(l+c-a.displaySize[0])/2,h=p+a.displaySize[0]);const f=e.top*o,m=e.bottom*o;return"height"===i||"both"===i?(u=n[1]+f-r[0],d=n[1]+m+r[2]):(u=n[1]+(f+m-a.displaySize[1])/2,d=u+a.displaySize[1]),{image:a,top:u,right:h,bottom:d,left:p,collisionPadding:s}}const iu=255,ru=128,nu=iu*ru;function ou(t,e){const{expression:i}=e;if("constant"===i.kind)return{kind:"constant",layoutSize:i.evaluate(new Un(t+1))};if("source"===i.kind)return{kind:"source"};{const{zoomStops:e,interpolationType:r}=i;let n=0;for(;n<e.length&&e[n]<=t;)n++;n=Math.max(0,n-1);let o=n;for(;o<e.length&&e[o]<t+1;)o++;o=Math.min(e.length-1,o);const a=e[n],s=e[o];return"composite"===i.kind?{kind:"composite",minZoom:a,maxZoom:s,interpolationType:r}:{kind:"camera",minZoom:a,maxZoom:s,minSize:i.evaluate(new Un(a)),maxSize:i.evaluate(new Un(s)),interpolationType:r}}}function au(t,e,i){let r="never";const n=t.get(e);return n?r=n:t.get(i)&&(r="always"),r}const su=pl.VectorTileFeature.types,lu=[{name:"a_fade_opacity",components:1,type:"Uint8",offset:0}];function cu(t,e,i,r,n,o,a,s,l,c,u,h,d){const p=s?Math.min(nu,Math.round(s[0])):0,f=s?Math.min(nu,Math.round(s[1])):0;t.emplaceBack(e,i,Math.round(32*r),Math.round(32*n),o,a,(p<<1)+(l?1:0),f,16*c,16*u,256*h,256*d)}function uu(t,e,i){t.emplaceBack(e.x,e.y,i),t.emplaceBack(e.x,e.y,i),t.emplaceBack(e.x,e.y,i),t.emplaceBack(e.x,e.y,i)}function hu(t){for(const e of t.sections)if(jn(e.text))return!0;return!1}class du{constructor(t){this.layoutVertexArray=new Qo,this.indexArray=new na,this.programConfigurations=t,this.segments=new la,this.dynamicLayoutVertexArray=new ta,this.opacityVertexArray=new ea,this.hasVisibleVertices=!1,this.placedSymbolArray=new Fo}isEmpty(){return 0===this.layoutVertexArray.length&&0===this.indexArray.length&&0===this.dynamicLayoutVertexArray.length&&0===this.opacityVertexArray.length}upload(t,e,i,r){this.isEmpty()||(i&&(this.layoutVertexBuffer=t.createVertexBuffer(this.layoutVertexArray,Kl.members),this.indexBuffer=t.createIndexBuffer(this.indexArray,e),this.dynamicLayoutVertexBuffer=t.createVertexBuffer(this.dynamicLayoutVertexArray,Yl.members,!0),this.opacityVertexBuffer=t.createVertexBuffer(this.opacityVertexArray,lu,!0),this.opacityVertexBuffer.itemSize=1),(i||r)&&this.programConfigurations.upload(t))}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy(),this.dynamicLayoutVertexBuffer.destroy(),this.opacityVertexBuffer.destroy())}}xn("SymbolBuffers",du);class pu{constructor(t,e,i){this.layoutVertexArray=new t,this.layoutAttributes=e,this.indexArray=new i,this.segments=new la,this.collisionVertexArray=new ra}upload(t){this.layoutVertexBuffer=t.createVertexBuffer(this.layoutVertexArray,this.layoutAttributes),this.indexBuffer=t.createIndexBuffer(this.indexArray),this.collisionVertexBuffer=t.createVertexBuffer(this.collisionVertexArray,Ql.members,!0)}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.segments.destroy(),this.collisionVertexBuffer.destroy())}}xn("CollisionBuffers",pu);class fu{constructor(e){this.collisionBoxArray=e.collisionBoxArray,this.zoom=e.zoom,this.overscaling=e.overscaling,this.layers=e.layers,this.layerIds=this.layers.map((t=>t.id)),this.index=e.index,this.pixelRatio=e.pixelRatio,this.sourceLayerIndex=e.sourceLayerIndex,this.hasPattern=!1,this.hasRTLText=!1,this.sortKeyRanges=[],this.collisionCircleArray=[],this.placementInvProjMatrix=cs([]),this.placementViewportMatrix=cs([]);const i=this.layers[0]._unevaluatedLayout._values;this.textSizeData=ou(this.zoom,i["text-size"]),this.iconSizeData=ou(this.zoom,i["icon-size"]);const r=this.layers[0].layout,n=r.get("symbol-sort-key"),o=r.get("symbol-z-order");this.canOverlap="never"!==au(r,"text-overlap","text-allow-overlap")||"never"!==au(r,"icon-overlap","icon-allow-overlap")||r.get("text-ignore-placement")||r.get("icon-ignore-placement"),this.sortFeaturesByKey="viewport-y"!==o&&!n.isConstant(),this.sortFeaturesByY=("viewport-y"===o||"auto"===o&&!this.sortFeaturesByKey)&&this.canOverlap,"point"===r.get("symbol-placement")&&(this.writingModes=r.get("text-writing-mode").map((e=>t.ah[e]))),this.stateDependentLayerIds=this.layers.filter((t=>t.isStateDependent())).map((t=>t.id)),this.sourceID=e.sourceID}createArrays(){this.text=new du(new Da(this.layers,this.zoom,(t=>/^text/.test(t)))),this.icon=new du(new Da(this.layers,this.zoom,(t=>/^icon/.test(t)))),this.glyphOffsetArray=new jo,this.lineVertexArray=new Vo,this.symbolInstances=new No,this.textAnchorOffsets=new qo}calculateGlyphDependencies(t,e,i,r,n){for(let o=0;o<t.length;o++)if(e[t.charCodeAt(o)]=!0,(i||r)&&n){const i=rc[t.charAt(o)];i&&(e[i.charCodeAt(0)]=!0)}}populate(e,i,r){const n=this.layers[0],o=n.layout,a=o.get("text-font"),s=o.get("text-field"),l=o.get("icon-image"),c=("constant"!==s.value.kind||s.value.value instanceof Jt&&!s.value.value.isEmpty()||s.value.value.toString().length>0)&&("constant"!==a.value.kind||a.value.value.length>0),u="constant"!==l.value.kind||!!l.value.value||Object.keys(l.parameters).length>0,h=o.get("symbol-sort-key");if(this.features=[],!c&&!u)return;const d=i.iconDependencies,p=i.glyphDependencies,f=i.availableImages,m=new Un(this.zoom);for(const{feature:g,id:y,index:_,sourceLayerIndex:v}of e){const e=n._featureFilter.needGeometry,i=Va(g,e);if(!n._featureFilter.filter(m,i,r))continue;let s,l;if(e||(i.geometry=ja(g)),c){const t=n.getValueAndResolveTokens("text-field",i,r,f),e=Jt.factory(t),o=this.hasRTLText=this.hasRTLText||hu(e);(!o||"unavailable"===Vn.getRTLTextPluginStatus()||o&&Vn.isParsed())&&(s=ic(e,n,i))}if(u){const t=n.getValueAndResolveTokens("icon-image",i,r,f);l=t instanceof te?t:te.fromString(t)}if(!s&&!l)continue;const b=this.sortFeaturesByKey?h.evaluate(i,{},r):void 0;if(this.features.push({id:y,text:s,icon:l,index:_,sourceLayerIndex:v,geometry:i.geometry,properties:g.properties,type:su[g.type],sortKey:b}),l&&(d[l.name]=!0),s){const e=a.evaluate(i,{},r).join(","),n="viewport"!==o.get("text-rotation-alignment")&&"point"!==o.get("symbol-placement");this.allowVerticalPlacement=this.writingModes&&this.writingModes.indexOf(t.ah.vertical)>=0;for(const t of s.sections)if(t.image)d[t.image.name]=!0;else{const i=An(s.toString()),r=t.fontStack||e,o=p[r]=p[r]||{};this.calculateGlyphDependencies(t.text,o,n,this.allowVerticalPlacement,i)}}}"line"===o.get("symbol-placement")&&(this.features=function(t){const e={},i={},r=[];let n=0;function o(e){r.push(t[e]),n++}function a(t,e,n){const o=i[t];return delete i[t],i[e]=o,r[o].geometry[0].pop(),r[o].geometry[0]=r[o].geometry[0].concat(n[0]),o}function s(t,i,n){const o=e[i];return delete e[i],e[t]=o,r[o].geometry[0].shift(),r[o].geometry[0]=n[0].concat(r[o].geometry[0]),o}function l(t,e,i){const r=i?e[0][e[0].length-1]:e[0][0];return`${t}:${r.x}:${r.y}`}for(let c=0;c<t.length;c++){const u=t[c],h=u.geometry,d=u.text?u.text.toString():null;if(!d){o(c);continue}const p=l(d,h),f=l(d,h,!0);if(p in i&&f in e&&i[p]!==e[f]){const t=s(p,f,h),n=a(p,f,r[t].geometry);delete e[p],delete i[f],i[l(d,r[n].geometry,!0)]=n,r[t].geometry=null}else p in i?a(p,f,h):f in e?s(p,f,h):(o(c),e[p]=n-1,i[f]=n-1)}return r.filter((t=>t.geometry))}(this.features)),this.sortFeaturesByKey&&this.features.sort(((t,e)=>t.sortKey-e.sortKey))}update(t,e,i){this.stateDependentLayers.length&&(this.text.programConfigurations.updatePaintArrays(t,e,this.layers,i),this.icon.programConfigurations.updatePaintArrays(t,e,this.layers,i))}isEmpty(){return 0===this.symbolInstances.length&&!this.hasRTLText}uploadPending(){return!this.uploaded||this.text.programConfigurations.needsUpload||this.icon.programConfigurations.needsUpload}upload(t){!this.uploaded&&this.hasDebugData()&&(this.textCollisionBox.upload(t),this.iconCollisionBox.upload(t)),this.text.upload(t,this.sortFeaturesByY,!this.uploaded,this.text.programConfigurations.needsUpload),this.icon.upload(t,this.sortFeaturesByY,!this.uploaded,this.icon.programConfigurations.needsUpload),this.uploaded=!0}destroyDebugData(){this.textCollisionBox.destroy(),this.iconCollisionBox.destroy()}destroy(){this.text.destroy(),this.icon.destroy(),this.hasDebugData()&&this.destroyDebugData()}addToLineVertexArray(t,e){const i=this.lineVertexArray.length;if(void 0!==t.segment){let i=t.dist(e[t.segment+1]),r=t.dist(e[t.segment]);const n={};for(let o=t.segment+1;o<e.length;o++)n[o]={x:e[o].x,y:e[o].y,tileUnitDistanceFromAnchor:i},o<e.length-1&&(i+=e[o+1].dist(e[o]));for(let o=t.segment||0;o>=0;o--)n[o]={x:e[o].x,y:e[o].y,tileUnitDistanceFromAnchor:r},o>0&&(r+=e[o-1].dist(e[o]));for(let t=0;t<e.length;t++){const e=n[t];this.lineVertexArray.emplaceBack(e.x,e.y,e.tileUnitDistanceFromAnchor)}}return{lineStartIndex:i,lineLength:this.lineVertexArray.length-i}}addSymbols(e,i,r,n,o,a,s,l,c,u,h,d){const p=e.indexArray,f=e.layoutVertexArray,m=e.segments.prepareSegment(4*i.length,f,p,this.canOverlap?a.sortKey:void 0),g=this.glyphOffsetArray.length,y=m.vertexLength,_=this.allowVerticalPlacement&&s===t.ah.vertical?Math.PI/2:0,v=a.text&&a.text.sections;for(let t=0;t<i.length;t++){const{tl:n,tr:o,bl:s,br:c,tex:u,pixelOffsetTL:h,pixelOffsetBR:g,minFontScaleX:y,minFontScaleY:b,glyphOffset:x,isSDF:w,sectionIndex:k}=i[t],E=m.vertexLength,S=x[1];cu(f,l.x,l.y,n.x,S+n.y,u.x,u.y,r,w,h.x,h.y,y,b),cu(f,l.x,l.y,o.x,S+o.y,u.x+u.w,u.y,r,w,g.x,h.y,y,b),cu(f,l.x,l.y,s.x,S+s.y,u.x,u.y+u.h,r,w,h.x,g.y,y,b),cu(f,l.x,l.y,c.x,S+c.y,u.x+u.w,u.y+u.h,r,w,g.x,g.y,y,b),uu(e.dynamicLayoutVertexArray,l,_),p.emplaceBack(E,E+1,E+2),p.emplaceBack(E+1,E+2,E+3),m.vertexLength+=4,m.primitiveLength+=2,this.glyphOffsetArray.emplaceBack(x[0]),t!==i.length-1&&k===i[t+1].sectionIndex||e.programConfigurations.populatePaintArrays(f.length,a,a.index,{},d,v&&v[k])}e.placedSymbolArray.emplaceBack(l.x,l.y,g,this.glyphOffsetArray.length-g,y,c,u,l.segment,r?r[0]:0,r?r[1]:0,n[0],n[1],s,0,!1,0,h)}_addCollisionDebugVertex(t,e,i,r,n,o){return e.emplaceBack(0,0),t.emplaceBack(i.x,i.y,r,n,Math.round(o.x),Math.round(o.y))}addCollisionDebugVertices(t,e,i,r,n,a,s){const l=n.segments.prepareSegment(4,n.layoutVertexArray,n.indexArray),c=l.vertexLength,u=n.layoutVertexArray,h=n.collisionVertexArray,d=s.anchorX,p=s.anchorY;this._addCollisionDebugVertex(u,h,a,d,p,new o(t,e)),this._addCollisionDebugVertex(u,h,a,d,p,new o(i,e)),this._addCollisionDebugVertex(u,h,a,d,p,new o(i,r)),this._addCollisionDebugVertex(u,h,a,d,p,new o(t,r)),l.vertexLength+=4;const f=n.indexArray;f.emplaceBack(c,c+1),f.emplaceBack(c+1,c+2),f.emplaceBack(c+2,c+3),f.emplaceBack(c+3,c),l.primitiveLength+=4}addDebugCollisionBoxes(t,e,i,r){for(let n=t;n<e;n++){const t=this.collisionBoxArray.get(n);this.addCollisionDebugVertices(t.x1,t.y1,t.x2,t.y2,r?this.textCollisionBox:this.iconCollisionBox,t.anchorPoint,i)}}generateCollisionDebugBuffers(){this.hasDebugData()&&this.destroyDebugData(),this.textCollisionBox=new pu(ia,tc.members,oa),this.iconCollisionBox=new pu(ia,tc.members,oa);for(let t=0;t<this.symbolInstances.length;t++){const e=this.symbolInstances.get(t);this.addDebugCollisionBoxes(e.textBoxStartIndex,e.textBoxEndIndex,e,!0),this.addDebugCollisionBoxes(e.verticalTextBoxStartIndex,e.verticalTextBoxEndIndex,e,!0),this.addDebugCollisionBoxes(e.iconBoxStartIndex,e.iconBoxEndIndex,e,!1),this.addDebugCollisionBoxes(e.verticalIconBoxStartIndex,e.verticalIconBoxEndIndex,e,!1)}}_deserializeCollisionBoxesForSymbol(t,e,i,r,n,o,a,s,l){const c={};for(let u=e;u<i;u++){const e=t.get(u);c.textBox={x1:e.x1,y1:e.y1,x2:e.x2,y2:e.y2,anchorPointX:e.anchorPointX,anchorPointY:e.anchorPointY},c.textFeatureIndex=e.featureIndex;break}for(let u=r;u<n;u++){const e=t.get(u);c.verticalTextBox={x1:e.x1,y1:e.y1,x2:e.x2,y2:e.y2,anchorPointX:e.anchorPointX,anchorPointY:e.anchorPointY},c.verticalTextFeatureIndex=e.featureIndex;break}for(let u=o;u<a;u++){const e=t.get(u);c.iconBox={x1:e.x1,y1:e.y1,x2:e.x2,y2:e.y2,anchorPointX:e.anchorPointX,anchorPointY:e.anchorPointY},c.iconFeatureIndex=e.featureIndex;break}for(let u=s;u<l;u++){const e=t.get(u);c.verticalIconBox={x1:e.x1,y1:e.y1,x2:e.x2,y2:e.y2,anchorPointX:e.anchorPointX,anchorPointY:e.anchorPointY},c.verticalIconFeatureIndex=e.featureIndex;break}return c}deserializeCollisionBoxes(t){this.collisionArrays=[];for(let e=0;e<this.symbolInstances.length;e++){const i=this.symbolInstances.get(e);this.collisionArrays.push(this._deserializeCollisionBoxesForSymbol(t,i.textBoxStartIndex,i.textBoxEndIndex,i.verticalTextBoxStartIndex,i.verticalTextBoxEndIndex,i.iconBoxStartIndex,i.iconBoxEndIndex,i.verticalIconBoxStartIndex,i.verticalIconBoxEndIndex))}}hasTextData(){return this.text.segments.get().length>0}hasIconData(){return this.icon.segments.get().length>0}hasDebugData(){return this.textCollisionBox&&this.iconCollisionBox}hasTextCollisionBoxData(){return this.hasDebugData()&&this.textCollisionBox.segments.get().length>0}hasIconCollisionBoxData(){return this.hasDebugData()&&this.iconCollisionBox.segments.get().length>0}addIndicesForPlacedSymbol(t,e){const i=t.placedSymbolArray.get(e),r=i.vertexStartIndex+4*i.numGlyphs;for(let n=i.vertexStartIndex;n<r;n+=4)t.indexArray.emplaceBack(n,n+1,n+2),t.indexArray.emplaceBack(n+1,n+2,n+3)}getSortedSymbolIndexes(t){if(this.sortedAngle===t&&void 0!==this.symbolInstanceIndexes)return this.symbolInstanceIndexes;const e=Math.sin(t),i=Math.cos(t),r=[],n=[],o=[];for(let a=0;a<this.symbolInstances.length;++a){o.push(a);const t=this.symbolInstances.get(a);r.push(0|Math.round(e*t.anchorX+i*t.anchorY)),n.push(t.featureIndex)}return o.sort(((t,e)=>r[t]-r[e]||n[e]-n[t])),o}addToSortKeyRanges(t,e){const i=this.sortKeyRanges[this.sortKeyRanges.length-1];i&&i.sortKey===e?i.symbolInstanceEnd=t+1:this.sortKeyRanges.push({sortKey:e,symbolInstanceStart:t,symbolInstanceEnd:t+1})}sortFeatures(t){if(this.sortFeaturesByY&&this.sortedAngle!==t&&!(this.text.segments.get().length>1||this.icon.segments.get().length>1)){this.symbolInstanceIndexes=this.getSortedSymbolIndexes(t),this.sortedAngle=t,this.text.indexArray.clear(),this.icon.indexArray.clear(),this.featureSortOrder=[];for(const t of this.symbolInstanceIndexes){const e=this.symbolInstances.get(t);this.featureSortOrder.push(e.featureIndex),[e.rightJustifiedTextSymbolIndex,e.centerJustifiedTextSymbolIndex,e.leftJustifiedTextSymbolIndex].forEach(((t,e,i)=>{t>=0&&i.indexOf(t)===e&&this.addIndicesForPlacedSymbol(this.text,t)})),e.verticalPlacedTextSymbolIndex>=0&&this.addIndicesForPlacedSymbol(this.text,e.verticalPlacedTextSymbolIndex),e.placedIconSymbolIndex>=0&&this.addIndicesForPlacedSymbol(this.icon,e.placedIconSymbolIndex),e.verticalPlacedIconSymbolIndex>=0&&this.addIndicesForPlacedSymbol(this.icon,e.verticalPlacedIconSymbolIndex)}this.text.indexBuffer&&this.text.indexBuffer.updateData(this.text.indexArray),this.icon.indexBuffer&&this.icon.indexBuffer.updateData(this.icon.indexArray)}}}let mu,gu;xn("SymbolBucket",fu,{omit:["layers","collisionBoxArray","features","compareText"]}),fu.MAX_GLYPHS=65535,fu.addDynamicAttributes=uu;var yu={get paint(){return gu=gu||new io({"icon-opacity":new Yn(H.paint_symbol["icon-opacity"]),"icon-color":new Yn(H.paint_symbol["icon-color"]),"icon-halo-color":new Yn(H.paint_symbol["icon-halo-color"]),"icon-halo-width":new Yn(H.paint_symbol["icon-halo-width"]),"icon-halo-blur":new Yn(H.paint_symbol["icon-halo-blur"]),"icon-translate":new Kn(H.paint_symbol["icon-translate"]),"icon-translate-anchor":new Kn(H.paint_symbol["icon-translate-anchor"]),"text-opacity":new Yn(H.paint_symbol["text-opacity"]),"text-color":new Yn(H.paint_symbol["text-color"],{runtimeType:dt,getOverride:t=>t.textColor,hasOverride:t=>!!t.textColor}),"text-halo-color":new Yn(H.paint_symbol["text-halo-color"]),"text-halo-width":new Yn(H.paint_symbol["text-halo-width"]),"text-halo-blur":new Yn(H.paint_symbol["text-halo-blur"]),"text-translate":new Kn(H.paint_symbol["text-translate"]),"text-translate-anchor":new Kn(H.paint_symbol["text-translate-anchor"])})},get layout(){return mu=mu||new io({"symbol-placement":new Kn(H.layout_symbol["symbol-placement"]),"symbol-spacing":new Kn(H.layout_symbol["symbol-spacing"]),"symbol-avoid-edges":new Kn(H.layout_symbol["symbol-avoid-edges"]),"symbol-sort-key":new Yn(H.layout_symbol["symbol-sort-key"]),"symbol-z-order":new Kn(H.layout_symbol["symbol-z-order"]),"icon-allow-overlap":new Kn(H.layout_symbol["icon-allow-overlap"]),"icon-overlap":new Kn(H.layout_symbol["icon-overlap"]),"icon-ignore-placement":new Kn(H.layout_symbol["icon-ignore-placement"]),"icon-optional":new Kn(H.layout_symbol["icon-optional"]),"icon-rotation-alignment":new Kn(H.layout_symbol["icon-rotation-alignment"]),"icon-size":new Yn(H.layout_symbol["icon-size"]),"icon-text-fit":new Kn(H.layout_symbol["icon-text-fit"]),"icon-text-fit-padding":new Kn(H.layout_symbol["icon-text-fit-padding"]),"icon-image":new Yn(H.layout_symbol["icon-image"]),"icon-rotate":new Yn(H.layout_symbol["icon-rotate"]),"icon-padding":new Yn(H.layout_symbol["icon-padding"]),"icon-keep-upright":new Kn(H.layout_symbol["icon-keep-upright"]),"icon-offset":new Yn(H.layout_symbol["icon-offset"]),"icon-anchor":new Yn(H.layout_symbol["icon-anchor"]),"icon-pitch-alignment":new Kn(H.layout_symbol["icon-pitch-alignment"]),"text-pitch-alignment":new Kn(H.layout_symbol["text-pitch-alignment"]),"text-rotation-alignment":new Kn(H.layout_symbol["text-rotation-alignment"]),"text-field":new Yn(H.layout_symbol["text-field"]),"text-font":new Yn(H.layout_symbol["text-font"]),"text-size":new Yn(H.layout_symbol["text-size"]),"text-max-width":new Yn(H.layout_symbol["text-max-width"]),"text-line-height":new Kn(H.layout_symbol["text-line-height"]),"text-letter-spacing":new Yn(H.layout_symbol["text-letter-spacing"]),"text-justify":new Yn(H.layout_symbol["text-justify"]),"text-radial-offset":new Yn(H.layout_symbol["text-radial-offset"]),"text-variable-anchor":new Kn(H.layout_symbol["text-variable-anchor"]),"text-variable-anchor-offset":new Yn(H.layout_symbol["text-variable-anchor-offset"]),"text-anchor":new Yn(H.layout_symbol["text-anchor"]),"text-max-angle":new Kn(H.layout_symbol["text-max-angle"]),"text-writing-mode":new Kn(H.layout_symbol["text-writing-mode"]),"text-rotate":new Yn(H.layout_symbol["text-rotate"]),"text-padding":new Kn(H.layout_symbol["text-padding"]),"text-keep-upright":new Kn(H.layout_symbol["text-keep-upright"]),"text-transform":new Yn(H.layout_symbol["text-transform"]),"text-offset":new Yn(H.layout_symbol["text-offset"]),"text-allow-overlap":new Kn(H.layout_symbol["text-allow-overlap"]),"text-overlap":new Kn(H.layout_symbol["text-overlap"]),"text-ignore-placement":new Kn(H.layout_symbol["text-ignore-placement"]),"text-optional":new Kn(H.layout_symbol["text-optional"])})}};class _u{constructor(t){if(void 0===t.property.overrides)throw new Error("overrides must be provided to instantiate FormatSectionOverride class");this.type=t.property.overrides?t.property.overrides.runtimeType:lt,this.defaultValue=t}evaluate(t){if(t.formattedSection){const e=this.defaultValue.property.overrides;if(e&&e.hasOverride(t.formattedSection))return e.getOverride(t.formattedSection)}return t.feature&&t.featureState?this.defaultValue.evaluate(t.feature,t.featureState):this.defaultValue.property.specification.default}eachChild(t){this.defaultValue.isConstant()||t(this.defaultValue.value._styleExpression.expression)}outputDefined(){return!1}serialize(){return null}}xn("FormatSectionOverride",_u,{omit:["defaultValue"]});class vu extends no{constructor(t){super(t,yu)}recalculate(t,e){if(super.recalculate(t,e),"auto"===this.layout.get("icon-rotation-alignment")&&(this.layout._values["icon-rotation-alignment"]="point"!==this.layout.get("symbol-placement")?"map":"viewport"),"auto"===this.layout.get("text-rotation-alignment")&&(this.layout._values["text-rotation-alignment"]="point"!==this.layout.get("symbol-placement")?"map":"viewport"),"auto"===this.layout.get("text-pitch-alignment")&&(this.layout._values["text-pitch-alignment"]="map"===this.layout.get("text-rotation-alignment")?"map":"viewport"),"auto"===this.layout.get("icon-pitch-alignment")&&(this.layout._values["icon-pitch-alignment"]=this.layout.get("icon-rotation-alignment")),"point"===this.layout.get("symbol-placement")){const t=this.layout.get("text-writing-mode");if(t){const e=[];for(const i of t)e.indexOf(i)<0&&e.push(i);this.layout._values["text-writing-mode"]=e}else this.layout._values["text-writing-mode"]=["horizontal"]}this._setPaintOverrides()}getValueAndResolveTokens(t,e,i,r){const n=this.layout.get(t).evaluate(e,{},i,r),o=this._unevaluatedLayout._values[t];return o.isDataDriven()||_r(o.value)||!n?n:function(t,e){return e.replace(/{([^{}]+)}/g,((e,i)=>t&&i in t?String(t[i]):""))}(e.properties,n)}createBucket(t){return new fu(t)}queryRadius(){return 0}queryIntersectsFeature(){throw new Error("Should take a different path in FeatureIndex")}_setPaintOverrides(){for(const t of yu.paint.overridableProperties){if(!vu.hasPaintOverride(this.layout,t))continue;const e=this.paint.get(t),i=new _u(e),r=new yr(i,e.property.specification);let n=null;n="constant"===e.value.kind||"source"===e.value.kind?new br("source",r):new xr("composite",r,e.value.zoomStops),this.paint._values[t]=new Xn(e.property,n,e.parameters)}}_handleOverridablePaintPropertyUpdate(t,e,i){return!(!this.layout||e.isDataDriven()||i.isDataDriven())&&vu.hasPaintOverride(this.layout,t)}static hasPaintOverride(t,e){const i=t.get("text-field"),r=yu.paint.properties[e];let n=!1;const o=t=>{for(const e of t)if(r.overrides&&r.overrides.hasOverride(e))return void(n=!0)};if("constant"===i.value.kind&&i.value.value instanceof Jt)o(i.value.value.sections);else if("source"===i.value.kind){const t=e=>{n||(e instanceof oe&&re(e.value)===gt?o(e.value.sections):e instanceof Ge?o(e.sections):e.eachChild(t))},e=i.value;e._styleExpression&&t(e._styleExpression.expression)}return n}}let bu;var xu={get paint(){return bu=bu||new io({"background-color":new Kn(H.paint_background["background-color"]),"background-pattern":new to(H.paint_background["background-pattern"]),"background-opacity":new Kn(H.paint_background["background-opacity"])})}};class wu extends no{constructor(t){super(t,xu)}}let ku;var Eu={get paint(){return ku=ku||new io({"raster-opacity":new Kn(H.paint_raster["raster-opacity"]),"raster-hue-rotate":new Kn(H.paint_raster["raster-hue-rotate"]),"raster-brightness-min":new Kn(H.paint_raster["raster-brightness-min"]),"raster-brightness-max":new Kn(H.paint_raster["raster-brightness-max"]),"raster-saturation":new Kn(H.paint_raster["raster-saturation"]),"raster-contrast":new Kn(H.paint_raster["raster-contrast"]),"raster-resampling":new Kn(H.paint_raster["raster-resampling"]),"raster-fade-duration":new Kn(H.paint_raster["raster-fade-duration"])})}};class Su extends no{constructor(t){super(t,Eu)}}class Iu extends no{constructor(t){super(t,{}),this.onAdd=t=>{this.implementation.onAdd&&this.implementation.onAdd(t,t.painter.context.gl)},this.onRemove=t=>{this.implementation.onRemove&&this.implementation.onRemove(t,t.painter.context.gl)},this.implementation=t}is3D(){return"3d"===this.implementation.renderingMode}hasOffscreenPass(){return void 0!==this.implementation.prerender}recalculate(){}updateTransitions(){}hasTransition(){return!1}serialize(){throw new Error("Custom layers cannot be serialized")}}class Cu{constructor(t){this._methodToThrottle=t,this._triggered=!1,"undefined"!=typeof MessageChannel&&(this._channel=new MessageChannel,this._channel.port2.onmessage=()=>{this._triggered=!1,this._methodToThrottle()})}trigger(){this._triggered||(this._triggered=!0,this._channel?this._channel.port1.postMessage(!0):setTimeout((()=>{this._triggered=!1,this._methodToThrottle()}),0))}remove(){delete this._channel,this._methodToThrottle=()=>{}}}const Tu=6371008.8;class Au{constructor(t,e){if(isNaN(t)||isNaN(e))throw new Error(`Invalid LngLat object: (${t}, ${e})`);if(this.lng=+t,this.lat=+e,this.lat>90||this.lat<-90)throw new Error("Invalid LngLat latitude value: must be between -90 and 90")}wrap(){return new Au(g(this.lng,-180,180),this.lat)}toArray(){return[this.lng,this.lat]}toString(){return`LngLat(${this.lng}, ${this.lat})`}distanceTo(t){const e=Math.PI/180,i=this.lat*e,r=t.lat*e,n=Math.sin(i)*Math.sin(r)+Math.cos(i)*Math.cos(r)*Math.cos((t.lng-this.lng)*e);return Tu*Math.acos(Math.min(n,1))}static convert(t){if(t instanceof Au)return t;if(Array.isArray(t)&&(2===t.length||3===t.length))return new Au(Number(t[0]),Number(t[1]));if(!Array.isArray(t)&&"object"==typeof t&&null!==t)return new Au(Number("lng"in t?t.lng:t.lon),Number(t.lat));throw new Error("`LngLatLike` argument must be specified as a LngLat instance, an object {lng: <lng>, lat: <lat>}, an object {lon: <lng>, lat: <lat>}, or an array of [<lng>, <lat>]")}}const Pu=2*Math.PI*Tu;function Mu(t){return Pu*Math.cos(t*Math.PI/180)}function Lu(t){return(180+t)/360}function zu(t){return(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+t*Math.PI/360)))/360}function Du(t,e){return t/Mu(e)}function Ru(t){return 360/Math.PI*Math.atan(Math.exp((180-360*t)*Math.PI/180))-90}class Ou{constructor(t,e,i=0){this.x=+t,this.y=+e,this.z=+i}static fromLngLat(t,e=0){const i=Au.convert(t);return new Ou(Lu(i.lng),zu(i.lat),Du(e,i.lat))}toLngLat(){return new Au(360*this.x-180,Ru(this.y))}toAltitude(){return this.z*Mu(Ru(this.y))}meterInMercatorCoordinateUnits(){return 1/Pu*(t=Ru(this.y),1/Math.cos(t*Math.PI/180));var t}}function Fu(t,e,i){var r=2*Math.PI*6378137/256/Math.pow(2,i);return[t*r-2*Math.PI*6378137/2,e*r-2*Math.PI*6378137/2]}class Bu{constructor(t,e,i){if(!function(t,e,i){return!(t<0||t>25||i<0||i>=Math.pow(2,t)||e<0||e>=Math.pow(2,t))}(t,e,i))throw new Error(`x=${e}, y=${i}, z=${t} outside of bounds. 0<=x<${Math.pow(2,t)}, 0<=y<${Math.pow(2,t)} 0<=z<=25 `);this.z=t,this.x=e,this.y=i,this.key=Vu(0,t,t,e,i)}equals(t){return this.z===t.z&&this.x===t.x&&this.y===t.y}url(t,e,i){const r=(o=this.y,a=this.z,s=Fu(256*(n=this.x),256*(o=Math.pow(2,a)-o-1),a),l=Fu(256*(n+1),256*(o+1),a),s[0]+","+s[1]+","+l[0]+","+l[1]);var n,o,a,s,l;const c=function(t,e,i){let r,n="";for(let o=t;o>0;o--)r=1<<o-1,n+=(e&r?1:0)+(i&r?2:0);return n}(this.z,this.x,this.y);return t[(this.x+this.y)%t.length].replace(/{prefix}/g,(this.x%16).toString(16)+(this.y%16).toString(16)).replace(/{z}/g,String(this.z)).replace(/{x}/g,String(this.x)).replace(/{y}/g,String("tms"===i?Math.pow(2,this.z)-this.y-1:this.y)).replace(/{ratio}/g,e>1?"@2x":"").replace(/{quadkey}/g,c).replace(/{bbox-epsg-3857}/g,r)}isChildOf(t){const e=this.z-t.z;return e>0&&t.x===this.x>>e&&t.y===this.y>>e}getTilePoint(t){const e=Math.pow(2,this.z);return new o((t.x*e-this.x)*Fa,(t.y*e-this.y)*Fa)}toString(){return`${this.z}/${this.x}/${this.y}`}}class Nu{constructor(t,e){this.wrap=t,this.canonical=e,this.key=Vu(t,e.z,e.z,e.x,e.y)}}class ju{constructor(t,e,i,r,n){if(t<i)throw new Error(`overscaledZ should be >= z; overscaledZ = ${t}; z = ${i}`);this.overscaledZ=t,this.wrap=e,this.canonical=new Bu(i,+r,+n),this.key=Vu(e,t,i,r,n)}clone(){return new ju(this.overscaledZ,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y)}equals(t){return this.overscaledZ===t.overscaledZ&&this.wrap===t.wrap&&this.canonical.equals(t.canonical)}scaledTo(t){if(t>this.overscaledZ)throw new Error(`targetZ > this.overscaledZ; targetZ = ${t}; overscaledZ = ${this.overscaledZ}`);const e=this.canonical.z-t;return t>this.canonical.z?new ju(t,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y):new ju(t,this.wrap,t,this.canonical.x>>e,this.canonical.y>>e)}calculateScaledKey(t,e){if(t>this.overscaledZ)throw new Error(`targetZ > this.overscaledZ; targetZ = ${t}; overscaledZ = ${this.overscaledZ}`);const i=this.canonical.z-t;return t>this.canonical.z?Vu(this.wrap*+e,t,this.canonical.z,this.canonical.x,this.canonical.y):Vu(this.wrap*+e,t,t,this.canonical.x>>i,this.canonical.y>>i)}isChildOf(t){if(t.wrap!==this.wrap)return!1;const e=this.canonical.z-t.canonical.z;return 0===t.overscaledZ||t.overscaledZ<this.overscaledZ&&t.canonical.x===this.canonical.x>>e&&t.canonical.y===this.canonical.y>>e}children(t){if(this.overscaledZ>=t)return[new ju(this.overscaledZ+1,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y)];const e=this.canonical.z+1,i=2*this.canonical.x,r=2*this.canonical.y;return[new ju(e,this.wrap,e,i,r),new ju(e,this.wrap,e,i+1,r),new ju(e,this.wrap,e,i,r+1),new ju(e,this.wrap,e,i+1,r+1)]}isLessThan(t){return this.wrap<t.wrap||!(this.wrap>t.wrap)&&(this.overscaledZ<t.overscaledZ||!(this.overscaledZ>t.overscaledZ)&&(this.canonical.x<t.canonical.x||!(this.canonical.x>t.canonical.x)&&this.canonical.y<t.canonical.y))}wrapped(){return new ju(this.overscaledZ,0,this.canonical.z,this.canonical.x,this.canonical.y)}unwrapTo(t){return new ju(this.overscaledZ,t,this.canonical.z,this.canonical.x,this.canonical.y)}overscaleFactor(){return Math.pow(2,this.overscaledZ-this.canonical.z)}toUnwrapped(){return new Nu(this.wrap,this.canonical)}toString(){return`${this.overscaledZ}/${this.canonical.x}/${this.canonical.y}`}getTilePoint(t){return this.canonical.getTilePoint(new Ou(t.x-this.wrap,t.y))}}function Vu(t,e,i,r,n){(t*=2)<0&&(t=-1*t-1);const o=1<<i;return(o*o*t+o*n+r).toString(36)+i.toString(36)+e.toString(36)}xn("CanonicalTileID",Bu),xn("OverscaledTileID",ju,{omit:["posMatrix"]});class Uu{constructor(t,e,i,r=1,n=1,o=1,a=0){if(this.uid=t,e.height!==e.width)throw new RangeError("DEM tiles must be square");if(i&&!["mapbox","terrarium","custom"].includes(i))return void k(`"${i}" is not a valid encoding type. Valid types include "mapbox", "terrarium" and "custom".`);this.stride=e.height;const s=this.dim=e.height-2;switch(this.data=new Uint32Array(e.data.buffer),i){case"terrarium":this.redFactor=256,this.greenFactor=1,this.blueFactor=1/256,this.baseShift=32768;break;case"custom":this.redFactor=r,this.greenFactor=n,this.blueFactor=o,this.baseShift=a;break;default:this.redFactor=6553.6,this.greenFactor=25.6,this.blueFactor=.1,this.baseShift=1e4}for(let l=0;l<s;l++)this.data[this._idx(-1,l)]=this.data[this._idx(0,l)],this.data[this._idx(s,l)]=this.data[this._idx(s-1,l)],this.data[this._idx(l,-1)]=this.data[this._idx(l,0)],this.data[this._idx(l,s)]=this.data[this._idx(l,s-1)];this.data[this._idx(-1,-1)]=this.data[this._idx(0,0)],this.data[this._idx(s,-1)]=this.data[this._idx(s-1,0)],this.data[this._idx(-1,s)]=this.data[this._idx(0,s-1)],this.data[this._idx(s,s)]=this.data[this._idx(s-1,s-1)],this.min=Number.MAX_SAFE_INTEGER,this.max=Number.MIN_SAFE_INTEGER;for(let l=0;l<s;l++)for(let t=0;t<s;t++){const e=this.get(l,t);e>this.max&&(this.max=e),e<this.min&&(this.min=e)}}get(t,e){const i=new Uint8Array(this.data.buffer),r=4*this._idx(t,e);return this.unpack(i[r],i[r+1],i[r+2])}getUnpackVector(){return[this.redFactor,this.greenFactor,this.blueFactor,this.baseShift]}_idx(t,e){if(t<-1||t>=this.dim+1||e<-1||e>=this.dim+1)throw new RangeError("out of range source coordinates for DEM data");return(e+1)*this.stride+(t+1)}unpack(t,e,i){return t*this.redFactor+e*this.greenFactor+i*this.blueFactor-this.baseShift}getPixels(){return new ks({width:this.stride,height:this.stride},new Uint8Array(this.data.buffer))}backfillBorder(t,e,i){if(this.dim!==t.dim)throw new Error("dem dimension mismatch");let r=e*this.dim,n=e*this.dim+this.dim,o=i*this.dim,a=i*this.dim+this.dim;switch(e){case-1:r=n-1;break;case 1:n=r+1}switch(i){case-1:o=a-1;break;case 1:a=o+1}const s=-e*this.dim,l=-i*this.dim;for(let c=o;c<a;c++)for(let e=r;e<n;e++)this.data[this._idx(e,c)]=t.data[this._idx(e+s,c+l)]}}xn("DEMData",Uu);class qu{constructor(t){this._stringToNumber={},this._numberToString=[];for(let e=0;e<t.length;e++){const i=t[e];this._stringToNumber[i]=e,this._numberToString[e]=i}}encode(t){return this._stringToNumber[t]}decode(t){if(t>=this._numberToString.length)throw new Error(`Out of bounds. Index requested n=${t} can't be >= this._numberToString.length ${this._numberToString.length}`);return this._numberToString[t]}}class $u{constructor(t,e,i,r,n){this.type="Feature",this._vectorTileFeature=t,t._z=e,t._x=i,t._y=r,this.properties=t.properties,this.id=n}get geometry(){return void 0===this._geometry&&(this._geometry=this._vectorTileFeature.toGeoJSON(this._vectorTileFeature._x,this._vectorTileFeature._y,this._vectorTileFeature._z).geometry),this._geometry}set geometry(t){this._geometry=t}toJSON(){const t={geometry:this.geometry};for(const e in this)"_geometry"!==e&&"_vectorTileFeature"!==e&&(t[e]=this[e]);return t}}class Gu{constructor(t,e){this.tileID=t,this.x=t.canonical.x,this.y=t.canonical.y,this.z=t.canonical.z,this.grid=new vn(Fa,16,0),this.grid3D=new vn(Fa,16,0),this.featureIndexArray=new Go,this.promoteId=e}insert(t,e,i,r,n,o){const a=this.featureIndexArray.length;this.featureIndexArray.emplaceBack(i,r,n);const s=o?this.grid3D:this.grid;for(let l=0;l<e.length;l++){const t=e[l],i=[1/0,1/0,-1/0,-1/0];for(let e=0;e<t.length;e++){const r=t[e];i[0]=Math.min(i[0],r.x),i[1]=Math.min(i[1],r.y),i[2]=Math.max(i[2],r.x),i[3]=Math.max(i[3],r.y)}i[0]<Fa&&i[1]<Fa&&i[2]>=0&&i[3]>=0&&s.insert(a,i[0],i[1],i[2],i[3])}}loadVTLayers(){return this.vtLayers||(this.vtLayers=new pl.VectorTile(new Cc(this.rawTileData)).layers,this.sourceLayerCoder=new qu(this.vtLayers?Object.keys(this.vtLayers).sort():["_geojsonTileLayer"])),this.vtLayers}query(t,e,i,r){this.loadVTLayers();const n=t.params||{},a=Fa/t.tileSize/t.scale,s=Cr(n.filter),l=t.queryGeometry,c=t.queryPadding*a,u=Zu(l),h=this.grid.query(u.minX-c,u.minY-c,u.maxX+c,u.maxY+c),d=Zu(t.cameraQueryGeometry),p=this.grid3D.query(d.minX-c,d.minY-c,d.maxX+c,d.maxY+c,((e,i,r,n)=>function(t,e,i,r,n){for(const o of t)if(e<=o.x&&i<=o.y&&r>=o.x&&n>=o.y)return!0;const a=[new o(e,i),new o(e,n),new o(r,n),new o(r,i)];if(t.length>2)for(const o of a)if(Qa(t,o))return!0;for(let o=0;o<t.length-1;o++)if(ts(t[o],t[o+1],a))return!0;return!1}(t.cameraQueryGeometry,e-c,i-c,r+c,n+c)));for(const o of p)h.push(o);h.sort(Wu);const f={};let m;for(let o=0;o<h.length;o++){const c=h[o];if(c===m)continue;m=c;const u=this.featureIndexArray.get(c);let d=null;this.loadMatchingFeature(f,u.bucketIndex,u.sourceLayerIndex,u.featureIndex,s,n.layers,n.availableImages,e,i,r,((e,i,r)=>(d||(d=ja(e)),i.queryIntersectsFeature(l,e,r,d,this.z,t.transform,a,t.pixelPosMatrix))))}return f}loadMatchingFeature(t,e,i,r,n,o,a,s,l,c,u){const h=this.bucketLayerIDs[e];if(o&&!function(t,e){for(let i=0;i<t.length;i++)if(e.indexOf(t[i])>=0)return!0;return!1}(o,h))return;const d=this.sourceLayerCoder.decode(i),p=this.vtLayers[d].feature(r);if(n.needGeometry){const t=Va(p,!0);if(!n.filter(new Un(this.tileID.overscaledZ),t,this.tileID.canonical))return}else if(!n.filter(new Un(this.tileID.overscaledZ),p))return;const f=this.getId(p,d);for(let m=0;m<h.length;m++){const e=h[m];if(o&&o.indexOf(e)<0)continue;const i=s[e];if(!i)continue;let n={};f&&c&&(n=c.getState(i.sourceLayer||"_geojsonTileLayer",f));const d=y({},l[e]);d.paint=Hu(d.paint,i.paint,p,n,a),d.layout=Hu(d.layout,i.layout,p,n,a);const g=!u||u(p,i,n);if(!g)continue;const _=new $u(p,this.z,this.x,this.y,f);_.layer=d;let v=t[e];void 0===v&&(v=t[e]=[]),v.push({featureIndex:r,feature:_,intersectionZ:g})}}lookupSymbolFeatures(t,e,i,r,n,o,a,s){const l={};this.loadVTLayers();const c=Cr(n);for(const u of t)this.loadMatchingFeature(l,i,r,u,c,o,a,s,e);return l}hasLayer(t){for(const e of this.bucketLayerIDs)for(const i of e)if(t===i)return!0;return!1}getId(t,e){let i=t.id;return this.promoteId&&(i=t.properties["string"==typeof this.promoteId?this.promoteId:this.promoteId[e]],"boolean"==typeof i&&(i=Number(i))),i}}function Hu(t,e,i,r,n){return v(t,((t,o)=>{const a=e instanceof Jn?e.get(o):null;return a&&a.evaluate?a.evaluate(i,r,n):a}))}function Zu(t){let e=1/0,i=1/0,r=-1/0,n=-1/0;for(const o of t)e=Math.min(e,o.x),i=Math.min(i,o.y),r=Math.max(r,o.x),n=Math.max(n,o.y);return{minX:e,minY:i,maxX:r,maxY:n}}function Wu(t,e){return e-t}function Xu(t,e,i,r,n){const a=[];for(let s=0;s<t.length;s++){const l=t[s];let c;for(let t=0;t<l.length-1;t++){let s=l[t],u=l[t+1];s.x<e&&u.x<e||(s.x<e?s=new o(e,s.y+(e-s.x)/(u.x-s.x)*(u.y-s.y))._round():u.x<e&&(u=new o(e,s.y+(e-s.x)/(u.x-s.x)*(u.y-s.y))._round()),s.y<i&&u.y<i||(s.y<i?s=new o(s.x+(i-s.y)/(u.y-s.y)*(u.x-s.x),i)._round():u.y<i&&(u=new o(s.x+(i-s.y)/(u.y-s.y)*(u.x-s.x),i)._round()),s.x>=r&&u.x>=r||(s.x>=r?s=new o(r,s.y+(r-s.x)/(u.x-s.x)*(u.y-s.y))._round():u.x>=r&&(u=new o(r,s.y+(r-s.x)/(u.x-s.x)*(u.y-s.y))._round()),s.y>=n&&u.y>=n||(s.y>=n?s=new o(s.x+(n-s.y)/(u.y-s.y)*(u.x-s.x),n)._round():u.y>=n&&(u=new o(s.x+(n-s.y)/(u.y-s.y)*(u.x-s.x),n)._round()),c&&s.equals(c[c.length-1])||(c=[s],a.push(c)),c.push(u)))))}}return a}xn("FeatureIndex",Gu,{omit:["rawTileData","sourceLayerCoder"]});class Ju extends o{constructor(t,e,i,r){super(t,e),this.angle=i,void 0!==r&&(this.segment=r)}clone(){return new Ju(this.x,this.y,this.angle,this.segment)}}function Ku(t,e,i,r,n){if(void 0===e.segment||0===i)return!0;let o=e,a=e.segment+1,s=0;for(;s>-i/2;){if(a--,a<0)return!1;s-=t[a].dist(o),o=t[a]}s+=t[a].dist(t[a+1]),a++;const l=[];let c=0;for(;s<i/2;){const e=t[a],i=t[a+1];if(!i)return!1;let o=t[a-1].angleTo(e)-e.angleTo(i);for(o=Math.abs((o+3*Math.PI)%(2*Math.PI)-Math.PI),l.push({distance:s,angleDelta:o}),c+=o;s-l[0].distance>r;)c-=l.shift().angleDelta;if(c>n)return!1;a++,s+=e.dist(i)}return!0}function Yu(t){let e=0;for(let i=0;i<t.length-1;i++)e+=t[i].dist(t[i+1]);return e}function Qu(t,e,i){return t?.6*e*i:0}function th(t,e){return Math.max(t?t.right-t.left:0,e?e.right-e.left:0)}function eh(t,e,i,r,n,o){const a=Qu(i,n,o),s=th(i,r)*o;let l=0;const c=Yu(t)/2;for(let u=0;u<t.length-1;u++){const i=t[u],r=t[u+1],n=i.dist(r);if(l+n>c){const o=(c-l)/n,h=Pe.number(i.x,r.x,o),d=Pe.number(i.y,r.y,o),p=new Ju(h,d,r.angleTo(i),u);return p._round(),!a||Ku(t,p,s,a,e)?p:void 0}l+=n}}function ih(t,e,i,r,n,o,a,s,l){const c=Qu(r,o,a),u=th(r,n),h=u*a,d=0===t[0].x||t[0].x===l||0===t[0].y||t[0].y===l;return e-h<e/4&&(e=h+e/4),rh(t,d?e/2*s%e:(u/2+2*o)*a*s%e,e,c,i,h,d,!1,l)}function rh(t,e,i,r,n,o,a,s,l){const c=o/2,u=Yu(t);let h=0,d=e-i,p=[];for(let f=0;f<t.length-1;f++){const e=t[f],a=t[f+1],s=e.dist(a),m=a.angleTo(e);for(;d+i<h+s;){d+=i;const g=(d-h)/s,y=Pe.number(e.x,a.x,g),_=Pe.number(e.y,a.y,g);if(y>=0&&y<l&&_>=0&&_<l&&d-c>=0&&d+c<=u){const e=new Ju(y,_,m,f);e._round(),r&&!Ku(t,e,o,r,n)||p.push(e)}}h+=s}return s||p.length||a||(p=rh(t,h/2,i,r,n,o,a,!0,l)),p}xn("Anchor",Ju);const nh=Dc;function oh(t,e,i,r){const n=[],a=t.image,s=a.pixelRatio,l=a.paddedRect.w-2*nh,c=a.paddedRect.h-2*nh;let u={x1:t.left,y1:t.top,x2:t.right,y2:t.bottom};const h=a.stretchX||[[0,l]],d=a.stretchY||[[0,c]],p=(t,e)=>t+e[1]-e[0],f=h.reduce(p,0),m=d.reduce(p,0),g=l-f,y=c-m;let _=0,v=f,b=0,x=m,w=0,k=g,E=0,S=y;if(a.content&&r){const e=a.content,i=e[2]-e[0],r=e[3]-e[1];(a.textFitWidth||a.textFitHeight)&&(u=tu(t)),_=ah(h,0,e[0]),b=ah(d,0,e[1]),v=ah(h,e[0],e[2]),x=ah(d,e[1],e[3]),w=e[0]-_,E=e[1]-b,k=i-v,S=r-x}const I=u.x1,C=u.y1,T=u.x2-I,A=u.y2-C,P=(t,r,n,l)=>{const c=lh(t.stretch-_,v,T,I),u=ch(t.fixed-w,k,t.stretch,f),h=lh(r.stretch-b,x,A,C),d=ch(r.fixed-E,S,r.stretch,m),p=lh(n.stretch-_,v,T,I),g=ch(n.fixed-w,k,n.stretch,f),y=lh(l.stretch-b,x,A,C),P=ch(l.fixed-E,S,l.stretch,m),M=new o(c,h),L=new o(p,h),z=new o(p,y),D=new o(c,y),R=new o(u/s,d/s),O=new o(g/s,P/s),F=e*Math.PI/180;if(F){const t=Math.sin(F),e=Math.cos(F),i=[e,-t,t,e];M._matMult(i),L._matMult(i),D._matMult(i),z._matMult(i)}const B=t.stretch+t.fixed,N=r.stretch+r.fixed;return{tl:M,tr:L,bl:D,br:z,tex:{x:a.paddedRect.x+nh+B,y:a.paddedRect.y+nh+N,w:n.stretch+n.fixed-B,h:l.stretch+l.fixed-N},writingMode:void 0,glyphOffset:[0,0],sectionIndex:0,pixelOffsetTL:R,pixelOffsetBR:O,minFontScaleX:k/s/T,minFontScaleY:S/s/A,isSDF:i}};if(r&&(a.stretchX||a.stretchY)){const t=sh(h,g,f),e=sh(d,y,m);for(let i=0;i<t.length-1;i++){const r=t[i],o=t[i+1];for(let t=0;t<e.length-1;t++)n.push(P(r,e[t],o,e[t+1]))}}else n.push(P({fixed:0,stretch:-1},{fixed:0,stretch:-1},{fixed:0,stretch:l+1},{fixed:0,stretch:c+1}));return n}function ah(t,e,i){let r=0;for(const n of t)r+=Math.max(e,Math.min(i,n[1]))-Math.max(e,Math.min(i,n[0]));return r}function sh(t,e,i){const r=[{fixed:-1,stretch:0}];for(const[n,o]of t){const t=r[r.length-1];r.push({fixed:n-t.stretch,stretch:t.stretch}),r.push({fixed:n-t.stretch,stretch:t.stretch+(o-n)})}return r.push({fixed:e+nh,stretch:i}),r}function lh(t,e,i,r){return t/e*i+r}function ch(t,e,i,r){return t-e*i/r}class uh{constructor(t,e,i,r,n,a,s,l,c,u){var h;if(this.boxStartIndex=t.length,c){let t=a.top,e=a.bottom;const i=a.collisionPadding;i&&(t-=i[1],e+=i[3]);let r=e-t;r>0&&(r=Math.max(10,r),this.circleDiameter=r)}else{const c=(null===(h=a.image)||void 0===h?void 0:h.content)&&(a.image.textFitWidth||a.image.textFitHeight)?tu(a):{x1:a.left,y1:a.top,x2:a.right,y2:a.bottom};c.y1=c.y1*s-l[0],c.y2=c.y2*s+l[2],c.x1=c.x1*s-l[3],c.x2=c.x2*s+l[1];const d=a.collisionPadding;if(d&&(c.x1-=d[0]*s,c.y1-=d[1]*s,c.x2+=d[2]*s,c.y2+=d[3]*s),u){const t=new o(c.x1,c.y1),e=new o(c.x2,c.y1),i=new o(c.x1,c.y2),r=new o(c.x2,c.y2),n=u*Math.PI/180;t._rotate(n),e._rotate(n),i._rotate(n),r._rotate(n),c.x1=Math.min(t.x,e.x,i.x,r.x),c.x2=Math.max(t.x,e.x,i.x,r.x),c.y1=Math.min(t.y,e.y,i.y,r.y),c.y2=Math.max(t.y,e.y,i.y,r.y)}t.emplaceBack(e.x,e.y,c.x1,c.y1,c.x2,c.y2,i,r,n)}this.boxEndIndex=t.length}}class hh{constructor(t=[],e=(t,e)=>t<e?-1:t>e?1:0){if(this.data=t,this.length=this.data.length,this.compare=e,this.length>0)for(let i=(this.length>>1)-1;i>=0;i--)this._down(i)}push(t){this.data.push(t),this._up(this.length++)}pop(){if(0===this.length)return;const t=this.data[0],e=this.data.pop();return--this.length>0&&(this.data[0]=e,this._down(0)),t}peek(){return this.data[0]}_up(t){const{data:e,compare:i}=this,r=e[t];for(;t>0;){const n=t-1>>1,o=e[n];if(i(r,o)>=0)break;e[t]=o,t=n}e[t]=r}_down(t){const{data:e,compare:i}=this,r=this.length>>1,n=e[t];for(;t<r;){let r=1+(t<<1);const o=r+1;if(o<this.length&&i(e[o],e[r])<0&&(r=o),i(e[r],n)>=0)break;e[t]=e[r],t=r}e[t]=n}}function dh(t,e=1,i=!1){let r=1/0,n=1/0,a=-1/0,s=-1/0;const l=t[0];for(let o=0;o<l.length;o++){const t=l[o];(!o||t.x<r)&&(r=t.x),(!o||t.y<n)&&(n=t.y),(!o||t.x>a)&&(a=t.x),(!o||t.y>s)&&(s=t.y)}const c=Math.min(a-r,s-n);let u=c/2;const h=new hh([],ph);if(0===c)return new o(r,n);for(let o=r;o<a;o+=c)for(let e=n;e<s;e+=c)h.push(new fh(o+u,e+u,u,t));let d=function(t){let e=0,i=0,r=0;const n=t[0];for(let o=0,a=n.length,s=a-1;o<a;s=o++){const t=n[o],a=n[s],l=t.x*a.y-a.x*t.y;i+=(t.x+a.x)*l,r+=(t.y+a.y)*l,e+=3*l}return new fh(i/e,r/e,0,t)}(t),p=h.length;for(;h.length;){const r=h.pop();(r.d>d.d||!d.d)&&(d=r,i&&console.log("found best %d after %d probes",Math.round(1e4*r.d)/1e4,p)),r.max-d.d<=e||(u=r.h/2,h.push(new fh(r.p.x-u,r.p.y-u,u,t)),h.push(new fh(r.p.x+u,r.p.y-u,u,t)),h.push(new fh(r.p.x-u,r.p.y+u,u,t)),h.push(new fh(r.p.x+u,r.p.y+u,u,t)),p+=4)}return i&&(console.log(`num probes: ${p}`),console.log(`best distance: ${d.d}`)),d.p}function ph(t,e){return e.max-t.max}function fh(t,e,i,r){this.p=new o(t,e),this.h=i,this.d=function(t,e){let i=!1,r=1/0;for(let n=0;n<e.length;n++){const o=e[n];for(let e=0,n=o.length,a=n-1;e<n;a=e++){const n=o[e],s=o[a];n.y>t.y!=s.y>t.y&&t.x<(s.x-n.x)*(t.y-n.y)/(s.y-n.y)+n.x&&(i=!i),r=Math.min(r,Ka(t,n,s))}}return(i?1:-1)*Math.sqrt(r)}(this.p,r),this.max=this.d+this.h*Math.SQRT2}var mh;t.aq=void 0,(mh=t.aq||(t.aq={}))[mh.center=1]="center",mh[mh.left=2]="left",mh[mh.right=3]="right",mh[mh.top=4]="top",mh[mh.bottom=5]="bottom",mh[mh["top-left"]=6]="top-left",mh[mh["top-right"]=7]="top-right",mh[mh["bottom-left"]=8]="bottom-left",mh[mh["bottom-right"]=9]="bottom-right";const gh=7,yh=Number.POSITIVE_INFINITY;function _h(t,e){return e[1]!==yh?function(t,e,i){let r=0,n=0;switch(e=Math.abs(e),i=Math.abs(i),t){case"top-right":case"top-left":case"top":n=i-gh;break;case"bottom-right":case"bottom-left":case"bottom":n=-i+gh}switch(t){case"top-right":case"bottom-right":case"right":r=-e;break;case"top-left":case"bottom-left":case"left":r=e}return[r,n]}(t,e[0],e[1]):function(t,e){let i=0,r=0;e<0&&(e=0);const n=e/Math.SQRT2;switch(t){case"top-right":case"top-left":r=n-gh;break;case"bottom-right":case"bottom-left":r=-n+gh;break;case"bottom":r=-e+gh;break;case"top":r=e-gh}switch(t){case"top-right":case"bottom-right":i=-n;break;case"top-left":case"bottom-left":i=n;break;case"left":i=e;break;case"right":i=-e}return[i,r]}(t,e[0])}function vh(t,e,i){var r;const n=t.layout,o=null===(r=n.get("text-variable-anchor-offset"))||void 0===r?void 0:r.evaluate(e,{},i);if(o){const t=o.values,e=[];for(let i=0;i<t.length;i+=2){const r=e[i]=t[i],n=t[i+1].map((t=>t*nc));r.startsWith("top")?n[1]-=gh:r.startsWith("bottom")&&(n[1]+=gh),e[i+1]=n}return new Qt(e)}const a=n.get("text-variable-anchor");if(a){let r;r=void 0!==t._unevaluatedLayout.getValue("text-radial-offset")?[n.get("text-radial-offset").evaluate(e,{},i)*nc,yh]:n.get("text-offset").evaluate(e,{},i).map((t=>t*nc));const o=[];for(const t of a)o.push(t,_h(t,r));return new Qt(o)}return null}function bh(t){switch(t){case"right":case"top-right":case"bottom-right":return"right";case"left":case"top-left":case"bottom-left":return"left"}return"center"}function xh(e,i,r,n,o,a,s,l,c,u,h){let d=a.textMaxSize.evaluate(i,{});void 0===d&&(d=s);const p=e.layers[0].layout,f=p.get("icon-offset").evaluate(i,{},h),m=kh(r.horizontal),g=s/24,y=e.tilePixelRatio*g,_=e.tilePixelRatio*d/24,v=e.tilePixelRatio*l,b=e.tilePixelRatio*p.get("symbol-spacing"),x=p.get("text-padding")*e.tilePixelRatio,w=function(t,e,i,r=1){const n=t.get("icon-padding").evaluate(e,{},i),o=n&&n.values;return[o[0]*r,o[1]*r,o[2]*r,o[3]*r]}(p,i,h,e.tilePixelRatio),E=p.get("text-max-angle")/180*Math.PI,S="viewport"!==p.get("text-rotation-alignment")&&"point"!==p.get("symbol-placement"),I="map"===p.get("icon-rotation-alignment")&&"point"!==p.get("symbol-placement"),C=p.get("symbol-placement"),T=b/2,A=p.get("icon-text-fit");let P;n&&"none"!==A&&(e.allowVerticalPlacement&&r.vertical&&(P=eu(n,r.vertical,A,p.get("icon-text-fit-padding"),f,g)),m&&(n=eu(n,m,A,p.get("icon-text-fit-padding"),f,g)));const M=(l,d)=>{d.x<0||d.x>=Fa||d.y<0||d.y>=Fa||function(e,i,r,n,o,a,s,l,c,u,h,d,p,f,m,g,y,_,v,b,x,w,E,S,I){const C=e.addToLineVertexArray(i,r);let T,A,P,M,L=0,z=0,D=0,R=0,O=-1,F=-1;const B={};let N=ya("");if(e.allowVerticalPlacement&&n.vertical){const t=l.layout.get("text-rotate").evaluate(x,{},S)+90;P=new uh(c,i,u,h,d,n.vertical,p,f,m,t),s&&(M=new uh(c,i,u,h,d,s,y,_,m,t))}if(o){const r=l.layout.get("icon-rotate").evaluate(x,{}),n="none"!==l.layout.get("icon-text-fit"),a=oh(o,r,E,n),p=s?oh(s,r,E,n):void 0;A=new uh(c,i,u,h,d,o,y,_,!1,r),L=4*a.length;const f=e.iconSizeData;let m=null;"source"===f.kind?(m=[ru*l.layout.get("icon-size").evaluate(x,{})],m[0]>nu&&k(`${e.layerIds[0]}: Value for "icon-size" is >= ${iu}. Reduce your "icon-size".`)):"composite"===f.kind&&(m=[ru*w.compositeIconSizes[0].evaluate(x,{},S),ru*w.compositeIconSizes[1].evaluate(x,{},S)],(m[0]>nu||m[1]>nu)&&k(`${e.layerIds[0]}: Value for "icon-size" is >= ${iu}. Reduce your "icon-size".`)),e.addSymbols(e.icon,a,m,b,v,x,t.ah.none,i,C.lineStartIndex,C.lineLength,-1,S),O=e.icon.placedSymbolArray.length-1,p&&(z=4*p.length,e.addSymbols(e.icon,p,m,b,v,x,t.ah.vertical,i,C.lineStartIndex,C.lineLength,-1,S),F=e.icon.placedSymbolArray.length-1)}const j=Object.keys(n.horizontal);for(const k of j){const r=n.horizontal[k];if(!T){N=ya(r.text);const t=l.layout.get("text-rotate").evaluate(x,{},S);T=new uh(c,i,u,h,d,r,p,f,m,t)}const o=1===r.positionedLines.length;if(D+=wh(e,i,r,a,l,m,x,g,C,n.vertical?t.ah.horizontal:t.ah.horizontalOnly,o?j:[k],B,O,w,S),o)break}n.vertical&&(R+=wh(e,i,n.vertical,a,l,m,x,g,C,t.ah.vertical,["vertical"],B,F,w,S));const V=T?T.boxStartIndex:e.collisionBoxArray.length,U=T?T.boxEndIndex:e.collisionBoxArray.length,q=P?P.boxStartIndex:e.collisionBoxArray.length,$=P?P.boxEndIndex:e.collisionBoxArray.length,G=A?A.boxStartIndex:e.collisionBoxArray.length,H=A?A.boxEndIndex:e.collisionBoxArray.length,Z=M?M.boxStartIndex:e.collisionBoxArray.length,W=M?M.boxEndIndex:e.collisionBoxArray.length;let X=-1;const J=(t,e)=>t&&t.circleDiameter?Math.max(t.circleDiameter,e):e;X=J(T,X),X=J(P,X),X=J(A,X),X=J(M,X);const K=X>-1?1:0;K&&(X*=I/nc),e.glyphOffsetArray.length>=fu.MAX_GLYPHS&&k("Too many glyphs being rendered in a tile. See https://github.com/mapbox/mapbox-gl-js/issues/2907"),void 0!==x.sortKey&&e.addToSortKeyRanges(e.symbolInstances.length,x.sortKey);const Y=vh(l,x,S),[Q,tt]=function(e,i){const r=e.length,n=null==i?void 0:i.values;if((null==n?void 0:n.length)>0)for(let o=0;o<n.length;o+=2){const i=n[o+1];e.emplaceBack(t.aq[n[o]],i[0],i[1])}return[r,e.length]}(e.textAnchorOffsets,Y);e.symbolInstances.emplaceBack(i.x,i.y,B.right>=0?B.right:-1,B.center>=0?B.center:-1,B.left>=0?B.left:-1,B.vertical||-1,O,F,N,V,U,q,$,G,H,Z,W,u,D,R,L,z,K,0,p,X,Q,tt)}(e,d,l,r,n,o,P,e.layers[0],e.collisionBoxArray,i.index,i.sourceLayerIndex,e.index,y,[x,x,x,x],S,c,v,w,I,f,i,a,u,h,s)};if("line"===C)for(const t of Xu(i.geometry,0,0,Fa,Fa)){const i=ih(t,b,E,r.vertical||m,n,24,_,e.overscaling,Fa);for(const r of i)m&&Eh(e,m.text,T,r)||M(t,r)}else if("line-center"===C){for(const t of i.geometry)if(t.length>1){const e=eh(t,E,r.vertical||m,n,24,_);e&&M(t,e)}}else if("Polygon"===i.type)for(const t of _i(i.geometry,0)){const e=dh(t,16);M(t[0],new Ju(e.x,e.y,0))}else if("LineString"===i.type)for(const t of i.geometry)M(t,new Ju(t[0].x,t[0].y,0));else if("Point"===i.type)for(const t of i.geometry)for(const e of t)M([e],new Ju(e.x,e.y,0))}function wh(t,e,i,r,n,a,s,l,c,u,h,d,p,f,m){const g=function(t,e,i,r,n,a,s,l){const c=r.layout.get("text-rotate").evaluate(a,{})*Math.PI/180,u=[];for(const h of e.positionedLines)for(const t of h.positionedGlyphs){if(!t.rect)continue;const r=t.rect||{};let a=Lc+1,d=!0,p=1,f=0;const m=(n||l)&&t.vertical,g=t.metrics.advance*t.scale/2;if(l&&e.verticalizable&&(f=h.lineOffset/2-(t.imageName?-(nc-t.metrics.width*t.scale)/2:(t.scale-1)*nc)),t.imageName){const e=s[t.imageName];d=e.sdf,p=e.pixelRatio,a=Dc/p}const y=n?[t.x+g,t.y]:[0,0];let _=n?[0,0]:[t.x+g+i[0],t.y+i[1]-f],v=[0,0];m&&(v=_,_=[0,0]);const b=t.metrics.isDoubleResolution?2:1,x=(t.metrics.left-a)*t.scale-g+_[0],w=(-t.metrics.top-a)*t.scale+_[1],k=x+r.w/b*t.scale/p,E=w+r.h/b*t.scale/p,S=new o(x,w),I=new o(k,w),C=new o(x,E),T=new o(k,E);if(m){const e=new o(-g,g-Bc),i=-Math.PI/2,r=nc/2-g,n=new o(5-Bc-r,-(t.imageName?r:0)),a=new o(...v);S._rotateAround(i,e)._add(n)._add(a),I._rotateAround(i,e)._add(n)._add(a),C._rotateAround(i,e)._add(n)._add(a),T._rotateAround(i,e)._add(n)._add(a)}if(c){const t=Math.sin(c),e=Math.cos(c),i=[e,-t,t,e];S._matMult(i),I._matMult(i),C._matMult(i),T._matMult(i)}const A=new o(0,0),P=new o(0,0);u.push({tl:S,tr:I,bl:C,br:T,tex:r,writingMode:e.writingMode,glyphOffset:y,sectionIndex:t.sectionIndex,isSDF:d,pixelOffsetTL:A,pixelOffsetBR:P,minFontScaleX:0,minFontScaleY:0})}return u}(0,i,l,n,a,s,r,t.allowVerticalPlacement),y=t.textSizeData;let _=null;"source"===y.kind?(_=[ru*n.layout.get("text-size").evaluate(s,{})],_[0]>nu&&k(`${t.layerIds[0]}: Value for "text-size" is >= ${iu}. Reduce your "text-size".`)):"composite"===y.kind&&(_=[ru*f.compositeTextSizes[0].evaluate(s,{},m),ru*f.compositeTextSizes[1].evaluate(s,{},m)],(_[0]>nu||_[1]>nu)&&k(`${t.layerIds[0]}: Value for "text-size" is >= ${iu}. Reduce your "text-size".`)),t.addSymbols(t.text,g,_,l,a,s,u,e,c.lineStartIndex,c.lineLength,p,m);for(const o of h)d[o]=t.text.placedSymbolArray.length-1;return 4*g.length}function kh(t){for(const e in t)return t[e];return null}function Eh(t,e,i,r){const n=t.compareText;if(e in n){const t=n[e];for(let e=t.length-1;e>=0;e--)if(r.dist(t[e])<i)return!0}else n[e]=[];return n[e].push(r),!1}const Sh=[Int8Array,Uint8Array,Uint8ClampedArray,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array];class Ih{static from(t){if(!(t instanceof ArrayBuffer))throw new Error("Data must be an instance of ArrayBuffer.");const[e,i]=new Uint8Array(t,0,2);if(219!==e)throw new Error("Data does not appear to be in a KDBush format.");const r=i>>4;if(1!==r)throw new Error(`Got v${r} data when expected v1.`);const n=Sh[15&i];if(!n)throw new Error("Unrecognized array type.");const[o]=new Uint16Array(t,2,1),[a]=new Uint32Array(t,4,1);return new Ih(a,o,n,t)}constructor(t,e=64,i=Float64Array,r){if(isNaN(t)||t<0)throw new Error(`Unpexpected numItems value: ${t}.`);this.numItems=+t,this.nodeSize=Math.min(Math.max(+e,2),65535),this.ArrayType=i,this.IndexArrayType=t<65536?Uint16Array:Uint32Array;const n=Sh.indexOf(this.ArrayType),o=2*t*this.ArrayType.BYTES_PER_ELEMENT,a=t*this.IndexArrayType.BYTES_PER_ELEMENT,s=(8-a%8)%8;if(n<0)throw new Error(`Unexpected typed array class: ${i}.`);r&&r instanceof ArrayBuffer?(this.data=r,this.ids=new this.IndexArrayType(this.data,8,t),this.coords=new this.ArrayType(this.data,8+a+s,2*t),this._pos=2*t,this._finished=!0):(this.data=new ArrayBuffer(8+o+a+s),this.ids=new this.IndexArrayType(this.data,8,t),this.coords=new this.ArrayType(this.data,8+a+s,2*t),this._pos=0,this._finished=!1,new Uint8Array(this.data,0,2).set([219,16+n]),new Uint16Array(this.data,2,1)[0]=e,new Uint32Array(this.data,4,1)[0]=t)}add(t,e){const i=this._pos>>1;return this.ids[i]=i,this.coords[this._pos++]=t,this.coords[this._pos++]=e,i}finish(){const t=this._pos>>1;if(t!==this.numItems)throw new Error(`Added ${t} items when expected ${this.numItems}.`);return Ch(this.ids,this.coords,this.nodeSize,0,this.numItems-1,0),this._finished=!0,this}range(t,e,i,r){if(!this._finished)throw new Error("Data not yet indexed - call index.finish().");const{ids:n,coords:o,nodeSize:a}=this,s=[0,n.length-1,0],l=[];for(;s.length;){const c=s.pop()||0,u=s.pop()||0,h=s.pop()||0;if(u-h<=a){for(let a=h;a<=u;a++){const s=o[2*a],c=o[2*a+1];s>=t&&s<=i&&c>=e&&c<=r&&l.push(n[a])}continue}const d=h+u>>1,p=o[2*d],f=o[2*d+1];p>=t&&p<=i&&f>=e&&f<=r&&l.push(n[d]),(0===c?t<=p:e<=f)&&(s.push(h),s.push(d-1),s.push(1-c)),(0===c?i>=p:r>=f)&&(s.push(d+1),s.push(u),s.push(1-c))}return l}within(t,e,i){if(!this._finished)throw new Error("Data not yet indexed - call index.finish().");const{ids:r,coords:n,nodeSize:o}=this,a=[0,r.length-1,0],s=[],l=i*i;for(;a.length;){const c=a.pop()||0,u=a.pop()||0,h=a.pop()||0;if(u-h<=o){for(let i=h;i<=u;i++)Mh(n[2*i],n[2*i+1],t,e)<=l&&s.push(r[i]);continue}const d=h+u>>1,p=n[2*d],f=n[2*d+1];Mh(p,f,t,e)<=l&&s.push(r[d]),(0===c?t-i<=p:e-i<=f)&&(a.push(h),a.push(d-1),a.push(1-c)),(0===c?t+i>=p:e+i>=f)&&(a.push(d+1),a.push(u),a.push(1-c))}return s}}function Ch(t,e,i,r,n,o){if(n-r<=i)return;const a=r+n>>1;Th(t,e,a,r,n,o),Ch(t,e,i,r,a-1,1-o),Ch(t,e,i,a+1,n,1-o)}function Th(t,e,i,r,n,o){for(;n>r;){if(n-r>600){const a=n-r+1,s=i-r+1,l=Math.log(a),c=.5*Math.exp(2*l/3),u=.5*Math.sqrt(l*c*(a-c)/a)*(s-a/2<0?-1:1);Th(t,e,i,Math.max(r,Math.floor(i-s*c/a+u)),Math.min(n,Math.floor(i+(a-s)*c/a+u)),o)}const a=e[2*i+o];let s=r,l=n;for(Ah(t,e,r,i),e[2*n+o]>a&&Ah(t,e,r,n);s<l;){for(Ah(t,e,s,l),s++,l--;e[2*s+o]<a;)s++;for(;e[2*l+o]>a;)l--}e[2*r+o]===a?Ah(t,e,r,l):(l++,Ah(t,e,l,n)),l<=i&&(r=l+1),i<=l&&(n=l-1)}}function Ah(t,e,i,r){Ph(t,i,r),Ph(e,2*i,2*r),Ph(e,2*i+1,2*r+1)}function Ph(t,e,i){const r=t[e];t[e]=t[i],t[i]=r}function Mh(t,e,i,r){const n=t-i,o=e-r;return n*n+o*o}var Lh;t.bg=void 0,(Lh=t.bg||(t.bg={})).create="create",Lh.load="load",Lh.fullLoad="fullLoad";let zh=null,Dh=[];const Rh=1e3/60,Oh="loadTime",Fh="fullLoadTime",Bh={mark(t){performance.mark(t)},frame(t){const e=t;null!=zh&&Dh.push(e-zh),zh=e},clearMetrics(){zh=null,Dh=[],performance.clearMeasures(Oh),performance.clearMeasures(Fh);for(const e in t.bg)performance.clearMarks(t.bg[e])},getPerformanceMetrics(){performance.measure(Oh,t.bg.create,t.bg.load),performance.measure(Fh,t.bg.create,t.bg.fullLoad);const e=performance.getEntriesByName(Oh)[0].duration,i=performance.getEntriesByName(Fh)[0].duration,r=Dh.length,n=1/(Dh.reduce(((t,e)=>t+e),0)/r/1e3),o=Dh.filter((t=>t>Rh)).reduce(((t,e)=>t+(e-Rh)/Rh),0);return{loadTime:e,fullLoadTime:i,fps:n,percentDroppedFrames:o/(r+o)*100,totalFrames:r}}};t.$=class extends po{},t.A=ls,t.B=mn,t.C=function(t){if(null==I){const e=t.navigator?t.navigator.userAgent:null;I=!!t.safari||!(!e||!(/\b(iPad|iPhone|iPod)\b/.test(e)||e.match("Safari")&&!e.match("Chrome")))}return I},t.D=Kn,t.E=G,t.F=class{constructor(t,e){this.target=t,this.mapId=e,this.resolveRejects={},this.tasks={},this.taskQueue=[],this.abortControllers={},this.messageHandlers={},this.invoker=new Cu((()=>this.process())),this.subscription=function(t,e,i){return t.addEventListener(e,i,!1),{unsubscribe:()=>{t.removeEventListener(e,i,!1)}}}(this.target,"message",(t=>this.receive(t))),this.globalScope=S(self)?t:window}registerMessageHandler(t,e){this.messageHandlers[t]=e}sendAsync(t,e){return new Promise(((i,r)=>{const n=Math.round(1e18*Math.random()).toString(36).substring(0,10);this.resolveRejects[n]={resolve:i,reject:r},e&&e.signal.addEventListener("abort",(()=>{delete this.resolveRejects[n];const e={id:n,type:"<cancel>",origin:location.origin,targetMapId:t.targetMapId,sourceMapId:this.mapId};this.target.postMessage(e)}),{once:!0});const o=[],a=Object.assign(Object.assign({},t),{id:n,sourceMapId:this.mapId,origin:location.origin,data:Sn(t.data,o)});this.target.postMessage(a,{transfer:o})}))}receive(t){const e=t.data,i=e.id;if(!("file://"!==e.origin&&"file://"!==location.origin&&"resource://android"!==e.origin&&"resource://android"!==location.origin&&e.origin!==location.origin||e.targetMapId&&this.mapId!==e.targetMapId)){if("<cancel>"===e.type){delete this.tasks[i];const t=this.abortControllers[i];return delete this.abortControllers[i],void(t&&t.abort())}if(S(self)||e.mustQueue)return this.tasks[i]=e,this.taskQueue.push(i),void this.invoker.trigger();this.processTask(i,e)}}process(){if(0===this.taskQueue.length)return;const t=this.taskQueue.shift(),e=this.tasks[t];delete this.tasks[t],this.taskQueue.length>0&&this.invoker.trigger(),e&&this.processTask(t,e)}processTask(t,i){return e(this,void 0,void 0,(function*(){if("<response>"===i.type){const e=this.resolveRejects[t];if(delete this.resolveRejects[t],!e)return;return void(i.error?e.reject(In(i.error)):e.resolve(In(i.data)))}if(!this.messageHandlers[i.type])return void this.completeTask(t,new Error(`Could not find a registered handler for ${i.type}, map ID: ${this.mapId}, available handlers: ${Object.keys(this.messageHandlers).join(", ")}`));const e=In(i.data),r=new AbortController;this.abortControllers[t]=r;try{const n=yield this.messageHandlers[i.type](i.sourceMapId,e,r);this.completeTask(t,null,n)}catch(e){this.completeTask(t,e)}}))}completeTask(t,e,i){const r=[];delete this.abortControllers[t];const n={id:t,type:"<response>",sourceMapId:this.mapId,origin:location.origin,error:e?Sn(e):null,data:Sn(i,r)};this.target.postMessage(n,{transfer:r})}remove(){this.invoker.remove(),this.subscription.unsubscribe()}},t.G=O,t.H=function(){var t=new ls(16);return ls!=Float32Array&&(t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[11]=0,t[12]=0,t[13]=0,t[14]=0),t[0]=1,t[5]=1,t[10]=1,t[15]=1,t},t.I=Rc,t.J=function(t,e,i){var r,n,o,a,s,l,c,u,h,d,p,f,m=i[0],g=i[1],y=i[2];return e===t?(t[12]=e[0]*m+e[4]*g+e[8]*y+e[12],t[13]=e[1]*m+e[5]*g+e[9]*y+e[13],t[14]=e[2]*m+e[6]*g+e[10]*y+e[14],t[15]=e[3]*m+e[7]*g+e[11]*y+e[15]):(n=e[1],o=e[2],a=e[3],s=e[4],l=e[5],c=e[6],u=e[7],h=e[8],d=e[9],p=e[10],f=e[11],t[0]=r=e[0],t[1]=n,t[2]=o,t[3]=a,t[4]=s,t[5]=l,t[6]=c,t[7]=u,t[8]=h,t[9]=d,t[10]=p,t[11]=f,t[12]=r*m+s*g+h*y+e[12],t[13]=n*m+l*g+d*y+e[13],t[14]=o*m+c*g+p*y+e[14],t[15]=a*m+u*g+f*y+e[15]),t},t.K=function(t,e,i){var r=i[0],n=i[1],o=i[2];return t[0]=e[0]*r,t[1]=e[1]*r,t[2]=e[2]*r,t[3]=e[3]*r,t[4]=e[4]*n,t[5]=e[5]*n,t[6]=e[6]*n,t[7]=e[7]*n,t[8]=e[8]*o,t[9]=e[9]*o,t[10]=e[10]*o,t[11]=e[11]*o,t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],t},t.L=us,t.M=function(t,e){const i={};for(let r=0;r<e.length;r++){const n=e[r];n in t&&(i[n]=t[n])}return i},t.N=Au,t.O=Lu,t.P=o,t.Q=zu,t.R=ks,t.S=ju,t.T=Gn,t.U=h,t.V=d,t.W=A,t.X=Fa,t.Y=lo,t.Z=Ou,t._=e,t.a=D,t.a$=function(t,e){var i=t[0],r=t[1],n=t[2],o=t[3],a=t[4],s=t[5],l=t[6],c=t[7],u=t[8],h=t[9],d=t[10],p=t[11],f=t[12],m=t[13],g=t[14],y=t[15],_=e[0],v=e[1],b=e[2],x=e[3],w=e[4],k=e[5],E=e[6],S=e[7],I=e[8],C=e[9],T=e[10],A=e[11],P=e[12],M=e[13],L=e[14],z=e[15];return Math.abs(i-_)<=ss*Math.max(1,Math.abs(i),Math.abs(_))&&Math.abs(r-v)<=ss*Math.max(1,Math.abs(r),Math.abs(v))&&Math.abs(n-b)<=ss*Math.max(1,Math.abs(n),Math.abs(b))&&Math.abs(o-x)<=ss*Math.max(1,Math.abs(o),Math.abs(x))&&Math.abs(a-w)<=ss*Math.max(1,Math.abs(a),Math.abs(w))&&Math.abs(s-k)<=ss*Math.max(1,Math.abs(s),Math.abs(k))&&Math.abs(l-E)<=ss*Math.max(1,Math.abs(l),Math.abs(E))&&Math.abs(c-S)<=ss*Math.max(1,Math.abs(c),Math.abs(S))&&Math.abs(u-I)<=ss*Math.max(1,Math.abs(u),Math.abs(I))&&Math.abs(h-C)<=ss*Math.max(1,Math.abs(h),Math.abs(C))&&Math.abs(d-T)<=ss*Math.max(1,Math.abs(d),Math.abs(T))&&Math.abs(p-A)<=ss*Math.max(1,Math.abs(p),Math.abs(A))&&Math.abs(f-P)<=ss*Math.max(1,Math.abs(f),Math.abs(P))&&Math.abs(m-M)<=ss*Math.max(1,Math.abs(m),Math.abs(M))&&Math.abs(g-L)<=ss*Math.max(1,Math.abs(g),Math.abs(L))&&Math.abs(y-z)<=ss*Math.max(1,Math.abs(y),Math.abs(z))},t.a0=la,t.a1=Bu,t.a2=nt,t.a3=t=>{const e=window.document.createElement("video");return e.muted=!0,new Promise((i=>{e.onloadstart=()=>{i(e)};for(const r of t){const t=window.document.createElement("source");j(r)||(e.crossOrigin="Anonymous"),t.src=r,e.appendChild(t)}}))},t.a4=function(){return _++},t.a5=Ro,t.a6=fu,t.a7=Cr,t.a8=Va,t.a9=$u,t.aA=function(t){if("custom"===t.type)return new Iu(t);switch(t.type){case"background":return new wu(t);case"circle":return new fs(t);case"fill":return new cl(t);case"fill-extrusion":return new zl(t);case"heatmap":return new Is(t);case"hillshade":return new As(t);case"line":return new Xl(t);case"raster":return new Su(t);case"symbol":return new vu(t)}},t.aB=x,t.aC=function(t,e){if(!t)return[{command:"setStyle",args:[e]}];let i=[];try{if(!X(t.version,e.version))return[{command:"setStyle",args:[e]}];X(t.center,e.center)||i.push({command:"setCenter",args:[e.center]}),X(t.zoom,e.zoom)||i.push({command:"setZoom",args:[e.zoom]}),X(t.bearing,e.bearing)||i.push({command:"setBearing",args:[e.bearing]}),X(t.pitch,e.pitch)||i.push({command:"setPitch",args:[e.pitch]}),X(t.sprite,e.sprite)||i.push({command:"setSprite",args:[e.sprite]}),X(t.glyphs,e.glyphs)||i.push({command:"setGlyphs",args:[e.glyphs]}),X(t.transition,e.transition)||i.push({command:"setTransition",args:[e.transition]}),X(t.light,e.light)||i.push({command:"setLight",args:[e.light]}),X(t.terrain,e.terrain)||i.push({command:"setTerrain",args:[e.terrain]}),X(t.sky,e.sky)||i.push({command:"setSky",args:[e.sky]}),X(t.projection,e.projection)||i.push({command:"setProjection",args:[e.projection]});const r={},n=[];!function(t,e,i,r){let n;for(n in e=e||{},t=t||{})Object.prototype.hasOwnProperty.call(t,n)&&(Object.prototype.hasOwnProperty.call(e,n)||Y(n,i,r));for(n in e)Object.prototype.hasOwnProperty.call(e,n)&&(Object.prototype.hasOwnProperty.call(t,n)?X(t[n],e[n])||("geojson"===t[n].type&&"geojson"===e[n].type&&tt(t,e,n)?J(i,{command:"setGeoJSONSourceData",args:[n,e[n].data]}):Q(n,e,i,r)):K(n,e,i))}(t.sources,e.sources,n,r);const o=[];t.layers&&t.layers.forEach((t=>{"source"in t&&r[t.source]?i.push({command:"removeLayer",args:[t.id]}):o.push(t)})),i=i.concat(n),function(t,e,i){e=e||[];const r=(t=t||[]).map(it),n=e.map(it),o=t.reduce(rt,{}),a=e.reduce(rt,{}),s=r.slice(),l=Object.create(null);let c,u,h,d,p;for(let f=0,m=0;f<r.length;f++)c=r[f],Object.prototype.hasOwnProperty.call(a,c)?m++:(J(i,{command:"removeLayer",args:[c]}),s.splice(s.indexOf(c,m),1));for(let f=0,m=0;f<n.length;f++)c=n[n.length-1-f],s[s.length-1-f]!==c&&(Object.prototype.hasOwnProperty.call(o,c)?(J(i,{command:"removeLayer",args:[c]}),s.splice(s.lastIndexOf(c,s.length-m),1)):m++,d=s[s.length-f],J(i,{command:"addLayer",args:[a[c],d]}),s.splice(s.length-f,0,c),l[c]=!0);for(let f=0;f<n.length;f++)if(c=n[f],u=o[c],h=a[c],!l[c]&&!X(u,h))if(X(u.source,h.source)&&X(u["source-layer"],h["source-layer"])&&X(u.type,h.type)){for(p in et(u.layout,h.layout,i,c,null,"setLayoutProperty"),et(u.paint,h.paint,i,c,null,"setPaintProperty"),X(u.filter,h.filter)||J(i,{command:"setFilter",args:[c,h.filter]}),X(u.minzoom,h.minzoom)&&X(u.maxzoom,h.maxzoom)||J(i,{command:"setLayerZoomRange",args:[c,h.minzoom,h.maxzoom]}),u)Object.prototype.hasOwnProperty.call(u,p)&&"layout"!==p&&"paint"!==p&&"filter"!==p&&"metadata"!==p&&"minzoom"!==p&&"maxzoom"!==p&&(0===p.indexOf("paint.")?et(u[p],h[p],i,c,p.slice(6),"setPaintProperty"):X(u[p],h[p])||J(i,{command:"setLayerProperty",args:[c,p,h[p]]}));for(p in h)Object.prototype.hasOwnProperty.call(h,p)&&!Object.prototype.hasOwnProperty.call(u,p)&&"layout"!==p&&"paint"!==p&&"filter"!==p&&"metadata"!==p&&"minzoom"!==p&&"maxzoom"!==p&&(0===p.indexOf("paint.")?et(u[p],h[p],i,c,p.slice(6),"setPaintProperty"):X(u[p],h[p])||J(i,{command:"setLayerProperty",args:[c,p,h[p]]}))}else J(i,{command:"removeLayer",args:[c]}),d=s[s.lastIndexOf(c)+1],J(i,{command:"addLayer",args:[h,d]})}(o,e.layers,i)}catch(t){console.warn("Unable to compute style diff:",t),i=[{command:"setStyle",args:[e]}]}return i},t.aD=function(t){const e=[],i=t.id;return void 0===i&&e.push({message:`layers.${i}: missing required property "id"`}),void 0===t.render&&e.push({message:`layers.${i}: missing required method "render"`}),t.renderingMode&&"2d"!==t.renderingMode&&"3d"!==t.renderingMode&&e.push({message:`layers.${i}: property "renderingMode" must be either "2d" or "3d"`}),e},t.aE=function t(e,i){if(Array.isArray(e)){if(!Array.isArray(i)||e.length!==i.length)return!1;for(let r=0;r<e.length;r++)if(!t(e[r],i[r]))return!1;return!0}if("object"==typeof e&&null!==e&&null!==i){if("object"!=typeof i)return!1;if(Object.keys(e).length!==Object.keys(i).length)return!1;for(const r in e)if(!t(e[r],i[r]))return!1;return!0}return e===i},t.aF=v,t.aG=b,t.aH=class extends wa{constructor(t,e){super(t,e),this.current=0}set(t){this.current!==t&&(this.current=t,this.gl.uniform1i(this.location,t))}},t.aI=ka,t.aJ=class extends wa{constructor(t,e){super(t,e),this.current=Ia}set(t){if(t[12]!==this.current[12]||t[0]!==this.current[0])return this.current=t,void this.gl.uniformMatrix4fv(this.location,!1,t);for(let e=1;e<16;e++)if(t[e]!==this.current[e]){this.current=t,this.gl.uniformMatrix4fv(this.location,!1,t);break}}},t.aK=Ea,t.aL=Sa,t.aM=Zt,t.aN=class extends wa{constructor(t,e){super(t,e),this.current=[0,0,0]}set(t){t[0]===this.current[0]&&t[1]===this.current[1]&&t[2]===this.current[2]||(this.current=t,this.gl.uniform3f(this.location,t[0],t[1],t[2]))}},t.aO=class extends wa{constructor(t,e){super(t,e),this.current=[0,0]}set(t){t[0]===this.current[0]&&t[1]===this.current[1]||(this.current=t,this.gl.uniform2f(this.location,t[0],t[1]))}},t.aP=function(t,e,i,r,n,o,a){var s=1/(e-i),l=1/(r-n),c=1/(o-a);return t[0]=-2*s,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=-2*l,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=2*c,t[11]=0,t[12]=(e+i)*s,t[13]=(n+r)*l,t[14]=(a+o)*c,t[15]=1,t},t.aQ=ds,t.aR=class extends ko{},t.aS=ec,t.aT=class extends So{},t.aU=Ss,t.aV=function(t){return t<=1?1:Math.pow(2,Math.ceil(Math.log(t)/Math.LN2))},t.aW=Es,t.aX=Ho,t.aY=na,t.aZ=class extends Lo{},t.a_=function(t,e){return t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]&&t[3]===e[3]&&t[4]===e[4]&&t[5]===e[5]&&t[6]===e[6]&&t[7]===e[7]&&t[8]===e[8]&&t[9]===e[9]&&t[10]===e[10]&&t[11]===e[11]&&t[12]===e[12]&&t[13]===e[13]&&t[14]===e[14]&&t[15]===e[15]},t.aa=function(t){const e={};if(t.replace(/(?:^|(?:\s*\,\s*))([^\x00-\x20\(\)<>@\,;\:\\"\/\[\]\?\=\{\}\x7F]+)(?:\=(?:([^\x00-\x20\(\)<>@\,;\:\\"\/\[\]\?\=\{\}\x7F]+)|(?:\"((?:[^"\\]|\\.)*)\")))?/g,((t,i,r,n)=>{const o=r||n;return e[i]=!o||o.toLowerCase(),""})),e["max-age"]){const t=parseInt(e["max-age"],10);isNaN(t)?delete e["max-age"]:e["max-age"]=t}return e},t.ab=function(t,e){const i=[];for(const r in t)r in e||i.push(r);return i},t.ac=m,t.ad=function(t,e,i){var r=Math.sin(i),n=Math.cos(i),o=e[0],a=e[1],s=e[2],l=e[3],c=e[4],u=e[5],h=e[6],d=e[7];return e!==t&&(t[8]=e[8],t[9]=e[9],t[10]=e[10],t[11]=e[11],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]),t[0]=o*n+c*r,t[1]=a*n+u*r,t[2]=s*n+h*r,t[3]=l*n+d*r,t[4]=c*n-o*r,t[5]=u*n-a*r,t[6]=h*n-s*r,t[7]=d*n-l*r,t},t.ae=function(t){var e=new ls(16);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],e[9]=t[9],e[10]=t[10],e[11]=t[11],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15],e},t.af=ps,t.ag=function(t,e){let i=0,r=0;if("constant"===t.kind)r=t.layoutSize;else if("source"!==t.kind){const{interpolationType:n,minZoom:o,maxZoom:a}=t,s=n?m(Me.interpolationFactor(n,e,o,a),0,1):0;"camera"===t.kind?r=Pe.number(t.minSize,t.maxSize,s):i=s}return{uSizeT:i,uSize:r}},t.ai=function(t,{uSize:e,uSizeT:i},{lowerSize:r,upperSize:n}){return"source"===t.kind?r/ru:"composite"===t.kind?Pe.number(r/ru,n/ru,i):e},t.aj=uu,t.ak=function(t,e,i,r){const n=e.y-t.y,a=e.x-t.x,s=r.y-i.y,l=r.x-i.x,c=s*a-l*n;if(0===c)return null;const u=(l*(t.y-i.y)-s*(t.x-i.x))/c;return new o(t.x+u*a,t.y+u*n)},t.al=Xu,t.am=$a,t.an=cs,t.ao=function(t){let e=1/0,i=1/0,r=-1/0,n=-1/0;for(const o of t)e=Math.min(e,o.x),i=Math.min(i,o.y),r=Math.max(r,o.x),n=Math.max(n,o.y);return[e,i,r,n]},t.ap=nc,t.ar=au,t.as=function(t,e){var i=e[0],r=e[1],n=e[2],o=e[3],a=e[4],s=e[5],l=e[6],c=e[7],u=e[8],h=e[9],d=e[10],p=e[11],f=e[12],m=e[13],g=e[14],y=e[15],_=i*s-r*a,v=i*l-n*a,b=i*c-o*a,x=r*l-n*s,w=r*c-o*s,k=n*c-o*l,E=u*m-h*f,S=u*g-d*f,I=u*y-p*f,C=h*g-d*m,T=h*y-p*m,A=d*y-p*g,P=_*A-v*T+b*C+x*I-w*S+k*E;return P?(t[0]=(s*A-l*T+c*C)*(P=1/P),t[1]=(n*T-r*A-o*C)*P,t[2]=(m*k-g*w+y*x)*P,t[3]=(d*w-h*k-p*x)*P,t[4]=(l*I-a*A-c*S)*P,t[5]=(i*A-n*I+o*S)*P,t[6]=(g*b-f*k-y*v)*P,t[7]=(u*k-d*b+p*v)*P,t[8]=(a*T-s*I+c*E)*P,t[9]=(r*I-i*T-o*E)*P,t[10]=(f*w-m*b+y*_)*P,t[11]=(h*b-u*w-p*_)*P,t[12]=(s*S-a*C-l*E)*P,t[13]=(i*C-r*S+n*E)*P,t[14]=(m*v-f*x-g*_)*P,t[15]=(u*x-h*v+d*_)*P,t):null},t.at=bh,t.au=Kc,t.av=Ih,t.aw=function(){const t={},e=H.$version;for(const i in H.$root){const r=H.$root[i];if(r.required){let n=null;n="version"===i?e:"array"===r.type?[]:{},null!=n&&(t[i]=n)}}return t},t.ax=Cn,t.ay=B,t.az=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]=W(t[i],e[t[i].ref]));return t},t.b=C,t.b0=function(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t[9]=e[9],t[10]=e[10],t[11]=e[11],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],t},t.b1=function(t,e,i){return t[0]=e[0]*i[0],t[1]=e[1]*i[1],t[2]=e[2]*i[2],t[3]=e[3]*i[3],t},t.b2=function(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]+t[3]*e[3]},t.b3=g,t.b4=Nu,t.b5=Du,t.b6=function(t,e,i,r,n){var o,a=1/Math.tan(e/2);return t[0]=a/i,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=a,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[11]=-1,t[12]=0,t[13]=0,t[15]=0,null!=n&&n!==1/0?(t[10]=(n+r)*(o=1/(r-n)),t[14]=2*n*r*o):(t[10]=-1,t[14]=-2*r),t},t.b7=function(t,e,i){var r=Math.sin(i),n=Math.cos(i),o=e[4],a=e[5],s=e[6],l=e[7],c=e[8],u=e[9],h=e[10],d=e[11];return e!==t&&(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]),t[4]=o*n+c*r,t[5]=a*n+u*r,t[6]=s*n+h*r,t[7]=l*n+d*r,t[8]=c*n-o*r,t[9]=u*n-a*r,t[10]=h*n-s*r,t[11]=d*n-l*r,t},t.b8=p,t.b9=f,t.bA=oc,t.bB=function(t){return t.message===L},t.bC=vr,t.bD=Vn,t.ba=function(t){return t*Math.PI/180},t.bb=function(t,e){const{x:i,y:r}=Ou.fromLngLat(e);return!(t<0||t>25||r<0||r>=1||i<0||i>=1)},t.bc=function(t,e){return t[0]=e[0],t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=e[1],t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=e[2],t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t},t.bd=class extends ho{},t.be=Tu,t.bf=Bh,t.bh=F,t.bi=function(t,e){D.REGISTERED_PROTOCOLS[t]=e},t.bj=function(t){delete D.REGISTERED_PROTOCOLS[t]},t.bk=function(t,e){const i={};for(let n=0;n<t.length;n++){const r=e&&e[t[n].id]||Or(t[n]);e&&(e[t[n].id]=r);let o=i[r];o||(o=i[r]=[]),o.push(t[n])}const r=[];for(const n in i)r.push(i[n]);return r},t.bl=xn,t.bm=qu,t.bn=Gu,t.bo=Oc,t.bp=function(e){e.bucket.createArrays(),e.bucket.tilePixelRatio=Fa/(512*e.bucket.overscaling),e.bucket.compareText={},e.bucket.iconsNeedLinear=!1;const i=e.bucket.layers[0],r=i.layout,n=i._unevaluatedLayout._values,o={layoutIconSize:n["icon-size"].possiblyEvaluate(new Un(e.bucket.zoom+1),e.canonical),layoutTextSize:n["text-size"].possiblyEvaluate(new Un(e.bucket.zoom+1),e.canonical),textMaxSize:n["text-size"].possiblyEvaluate(new Un(18))};if("composite"===e.bucket.textSizeData.kind){const{minZoom:t,maxZoom:i}=e.bucket.textSizeData;o.compositeTextSizes=[n["text-size"].possiblyEvaluate(new Un(t),e.canonical),n["text-size"].possiblyEvaluate(new Un(i),e.canonical)]}if("composite"===e.bucket.iconSizeData.kind){const{minZoom:t,maxZoom:i}=e.bucket.iconSizeData;o.compositeIconSizes=[n["icon-size"].possiblyEvaluate(new Un(t),e.canonical),n["icon-size"].possiblyEvaluate(new Un(i),e.canonical)]}const a=r.get("text-line-height")*nc,s="viewport"!==r.get("text-rotation-alignment")&&"point"!==r.get("symbol-placement"),l=r.get("text-keep-upright"),c=r.get("text-size");for(const u of e.bucket.features){const n=r.get("text-font").evaluate(u,{},e.canonical).join(","),h=c.evaluate(u,{},e.canonical),d=o.layoutTextSize.evaluate(u,{},e.canonical),p=o.layoutIconSize.evaluate(u,{},e.canonical),f={horizontal:{},vertical:void 0},m=u.text;let g,y=[0,0];if(m){const o=m.toString(),c=r.get("text-letter-spacing").evaluate(u,{},e.canonical)*nc,p=Pn(o)?c:0,g=r.get("text-anchor").evaluate(u,{},e.canonical),_=vh(i,u,e.canonical);if(!_){const t=r.get("text-radial-offset").evaluate(u,{},e.canonical);y=t?_h(g,[t*nc,yh]):r.get("text-offset").evaluate(u,{},e.canonical).map((t=>t*nc))}let v=s?"center":r.get("text-justify").evaluate(u,{},e.canonical);const b="point"===r.get("symbol-placement")?r.get("text-max-width").evaluate(u,{},e.canonical)*nc:1/0,x=()=>{e.bucket.allowVerticalPlacement&&An(o)&&(f.vertical=Vc(m,e.glyphMap,e.glyphPositions,e.imagePositions,n,b,a,g,"left",p,y,t.ah.vertical,!0,d,h))};if(!s&&_){const i=new Set;if("auto"===v)for(let t=0;t<_.values.length;t+=2)i.add(bh(_.values[t]));else i.add(v);let r=!1;for(const o of i)if(!f.horizontal[o])if(r)f.horizontal[o]=f.horizontal[0];else{const i=Vc(m,e.glyphMap,e.glyphPositions,e.imagePositions,n,b,a,"center",o,p,y,t.ah.horizontal,!1,d,h);i&&(f.horizontal[o]=i,r=1===i.positionedLines.length)}x()}else{"auto"===v&&(v=bh(g));const i=Vc(m,e.glyphMap,e.glyphPositions,e.imagePositions,n,b,a,g,v,p,y,t.ah.horizontal,!1,d,h);i&&(f.horizontal[v]=i),x(),An(o)&&s&&l&&(f.vertical=Vc(m,e.glyphMap,e.glyphPositions,e.imagePositions,n,b,a,g,v,p,y,t.ah.vertical,!1,d,h))}}let _=!1;if(u.icon&&u.icon.name){const t=e.imageMap[u.icon.name];t&&(g=Qc(e.imagePositions[u.icon.name],r.get("icon-offset").evaluate(u,{},e.canonical),r.get("icon-anchor").evaluate(u,{},e.canonical)),_=!!t.sdf,void 0===e.bucket.sdfIcons?e.bucket.sdfIcons=_:e.bucket.sdfIcons!==_&&k("Style sheet warning: Cannot mix SDF and non-SDF icons in one buffer"),(t.pixelRatio!==e.bucket.pixelRatio||0!==r.get("icon-rotate").constantOr(1))&&(e.bucket.iconsNeedLinear=!0))}const v=kh(f.horizontal)||f.vertical;e.bucket.iconsInText=!!v&&v.iconsInText,(v||g)&&xh(e.bucket,u,f,g,e.imageMap,o,d,p,y,_,e.canonical)}e.showCollisionBoxes&&e.bucket.generateCollisionDebugBuffers()},t.bq=ql,t.br=ol,t.bs=Tl,t.bt=pl,t.bu=Cc,t.bv=class{constructor(t){this._marks={start:[t.url,"start"].join("#"),end:[t.url,"end"].join("#"),measure:t.url.toString()},performance.mark(this._marks.start)}finish(){performance.mark(this._marks.end);let t=performance.getEntriesByName(this._marks.measure);return 0===t.length&&(performance.measure(this._marks.measure,this._marks.start,this._marks.end),t=performance.getEntriesByName(this._marks.measure),performance.clearMarks(this._marks.start),performance.clearMarks(this._marks.end),performance.clearMeasures(this._marks.measure)),t}},t.bw=function(t,i,r,n,o){return e(this,void 0,void 0,(function*(){if(d())try{return yield A(t,i,r,n,o)}catch(t){}return function(t,e,i,r,n){const o=t.width,a=t.height;P&&M||(P=new OffscreenCanvas(o,a),M=P.getContext("2d",{willReadFrequently:!0})),P.width=o,P.height=a,M.drawImage(t,0,0,o,a);const s=M.getImageData(e,i,r,n);return M.clearRect(0,0,o,a),s.data}(t,i,r,n,o)}))},t.bx=Uu,t.by=i,t.bz=r,t.c=z,t.d=t=>e(void 0,void 0,void 0,(function*(){if(0===t.byteLength)return createImageBitmap(new ImageData(1,1));const e=new Blob([new Uint8Array(t)],{type:"image/png"});try{return createImageBitmap(e)}catch(t){throw new Error(`Could not load image because of ${t.message}. Please make sure to use a supported image type such as PNG or JPEG. Note that SVGs are not supported.`)}})),t.e=y,t.f=t=>new Promise(((e,i)=>{const r=new Image;r.onload=()=>{e(r),URL.revokeObjectURL(r.src),r.onload=null,window.requestAnimationFrame((()=>{r.src=T}))},r.onerror=()=>i(new Error("Could not load image. Please make sure to use a supported image type such as PNG or JPEG. Note that SVGs are not supported."));const n=new Blob([new Uint8Array(t)],{type:"image/png"});r.src=t.byteLength?URL.createObjectURL(n):T})),t.g=R,t.h=(t,e)=>N(y(t,{type:"json"}),e),t.i=S,t.j=$,t.k=q,t.l=(t,e)=>N(y(t,{type:"arrayBuffer"}),e),t.m=N,t.n=function(t){return new Cc(t).readFields(Ac,[])},t.o=ws,t.p=zc,t.q=io,t.r=fn,t.s=j,t.t=_n,t.u=pn,t.v=H,t.w=k,t.x=function([t,e,i]){return e+=90,e*=Math.PI/180,i*=Math.PI/180,{x:t*Math.cos(e)*Math.sin(i),y:t*Math.sin(e)*Math.sin(i),z:t*Math.cos(i)}},t.y=Pe,t.z=Un})),i("worker",["./shared"],(function(t){class e{constructor(t){this.keyCache={},t&&this.replace(t)}replace(t){this._layerConfigs={},this._layers={},this.update(t,[])}update(e,i){for(const n of e){this._layerConfigs[n.id]=n;const e=this._layers[n.id]=t.aA(n);e._featureFilter=t.a7(e.filter),this.keyCache[n.id]&&delete this.keyCache[n.id]}for(const t of i)delete this.keyCache[t],delete this._layerConfigs[t],delete this._layers[t];this.familiesBySource={};const r=t.bk(Object.values(this._layerConfigs),this.keyCache);for(const t of r){const e=t.map((t=>this._layers[t.id])),i=e[0];if("none"===i.visibility)continue;const r=i.source||"";let n=this.familiesBySource[r];n||(n=this.familiesBySource[r]={});const o=i.sourceLayer||"_geojsonTileLayer";let a=n[o];a||(a=n[o]=[]),a.push(e)}}}class i{constructor(e){const i={},r=[];for(const t in e){const n=e[t],o=i[t]={};for(const t in n){const e=n[+t];if(!e||0===e.bitmap.width||0===e.bitmap.height)continue;const i={x:0,y:0,w:e.bitmap.width+2,h:e.bitmap.height+2};r.push(i),o[t]={rect:i,metrics:e.metrics}}}const{w:n,h:o}=t.p(r),a=new t.o({width:n||1,height:o||1});for(const s in e){const r=e[s];for(const e in r){const n=r[+e];if(!n||0===n.bitmap.width||0===n.bitmap.height)continue;const o=i[s][e].rect;t.o.copy(n.bitmap,a,{x:0,y:0},{x:o.x+1,y:o.y+1},n.bitmap)}}this.image=a,this.positions=i}}t.bl("GlyphAtlas",i);class r{constructor(e){this.tileID=new t.S(e.tileID.overscaledZ,e.tileID.wrap,e.tileID.canonical.z,e.tileID.canonical.x,e.tileID.canonical.y),this.uid=e.uid,this.zoom=e.zoom,this.pixelRatio=e.pixelRatio,this.tileSize=e.tileSize,this.source=e.source,this.overscaling=this.tileID.overscaleFactor(),this.showCollisionBoxes=e.showCollisionBoxes,this.collectResourceTiming=!!e.collectResourceTiming,this.returnDependencies=!!e.returnDependencies,this.promoteId=e.promoteId,this.inFlightDependencies=[]}parse(e,r,o,a){return t._(this,void 0,void 0,(function*(){this.status="parsing",this.data=e,this.collisionBoxArray=new t.a5;const s=new t.bm(Object.keys(e.layers).sort()),l=new t.bn(this.tileID,this.promoteId);l.bucketLayerIDs=[];const c={},u={featureIndex:l,iconDependencies:{},patternDependencies:{},glyphDependencies:{},availableImages:o},h=r.familiesBySource[this.source];for(const i in h){const r=e.layers[i];if(!r)continue;1===r.version&&t.w(`Vector tile source "${this.source}" layer "${i}" does not use vector tile spec v2 and therefore may have some rendering errors.`);const a=s.encode(i),d=[];for(let t=0;t<r.length;t++){const e=r.feature(t),n=l.getId(e,i);d.push({feature:e,id:n,index:t,sourceLayerIndex:a})}for(const e of h[i]){const i=e[0];i.source!==this.source&&t.w(`layer.source = ${i.source} does not equal this.source = ${this.source}`),i.minzoom&&this.zoom<Math.floor(i.minzoom)||i.maxzoom&&this.zoom>=i.maxzoom||"none"!==i.visibility&&(n(e,this.zoom,o),(c[i.id]=i.createBucket({index:l.bucketLayerIDs.length,layers:e,zoom:this.zoom,pixelRatio:this.pixelRatio,overscaling:this.overscaling,collisionBoxArray:this.collisionBoxArray,sourceLayerIndex:a,sourceID:this.source})).populate(d,u,this.tileID.canonical),l.bucketLayerIDs.push(e.map((t=>t.id))))}}const d=t.aF(u.glyphDependencies,(t=>Object.keys(t).map(Number)));this.inFlightDependencies.forEach((t=>null==t?void 0:t.abort())),this.inFlightDependencies=[];let p=Promise.resolve({});if(Object.keys(d).length){const t=new AbortController;this.inFlightDependencies.push(t),p=a.sendAsync({type:"GG",data:{stacks:d,source:this.source,tileID:this.tileID,type:"glyphs"}},t)}const f=Object.keys(u.iconDependencies);let m=Promise.resolve({});if(f.length){const t=new AbortController;this.inFlightDependencies.push(t),m=a.sendAsync({type:"GI",data:{icons:f,source:this.source,tileID:this.tileID,type:"icons"}},t)}const g=Object.keys(u.patternDependencies);let y=Promise.resolve({});if(g.length){const t=new AbortController;this.inFlightDependencies.push(t),y=a.sendAsync({type:"GI",data:{icons:g,source:this.source,tileID:this.tileID,type:"patterns"}},t)}const[_,v,b]=yield Promise.all([p,m,y]),x=new i(_),w=new t.bo(v,b);for(const e in c){const i=c[e];i instanceof t.a6?(n(i.layers,this.zoom,o),t.bp({bucket:i,glyphMap:_,glyphPositions:x.positions,imageMap:v,imagePositions:w.iconPositions,showCollisionBoxes:this.showCollisionBoxes,canonical:this.tileID.canonical})):i.hasPattern&&(i instanceof t.bq||i instanceof t.br||i instanceof t.bs)&&(n(i.layers,this.zoom,o),i.addFeatures(u,this.tileID.canonical,w.patternPositions))}return this.status="done",{buckets:Object.values(c).filter((t=>!t.isEmpty())),featureIndex:l,collisionBoxArray:this.collisionBoxArray,glyphAtlasImage:x.image,imageAtlas:w,glyphMap:this.returnDependencies?_:null,iconMap:this.returnDependencies?v:null,glyphPositions:this.returnDependencies?x.positions:null}}))}}function n(e,i,r){const n=new t.z(i);for(const t of e)t.recalculate(n,r)}class o{constructor(t,e,i){this.actor=t,this.layerIndex=e,this.availableImages=i,this.fetching={},this.loading={},this.loaded={}}loadVectorTile(e,i){return t._(this,void 0,void 0,(function*(){const r=yield t.l(e.request,i);try{return{vectorTile:new t.bt.VectorTile(new t.bu(r.data)),rawData:r.data,cacheControl:r.cacheControl,expires:r.expires}}catch(t){const n=new Uint8Array(r.data);let o=`Unable to parse the tile at ${e.request.url}, `;throw o+=31===n[0]&&139===n[1]?"please make sure the data is not gzipped and that you have configured the relevant header in the server":`got error: ${t.message}`,new Error(o)}}))}loadTile(e){return t._(this,void 0,void 0,(function*(){const i=e.uid,n=!!(e&&e.request&&e.request.collectResourceTiming)&&new t.bv(e.request),o=new r(e);this.loading[i]=o;const a=new AbortController;o.abort=a;try{const r=yield this.loadVectorTile(e,a);if(delete this.loading[i],!r)return null;const s=r.rawData,l={};r.expires&&(l.expires=r.expires),r.cacheControl&&(l.cacheControl=r.cacheControl);const c={};if(n){const t=n.finish();t&&(c.resourceTiming=JSON.parse(JSON.stringify(t)))}o.vectorTile=r.vectorTile;const u=o.parse(r.vectorTile,this.layerIndex,this.availableImages,this.actor);this.loaded[i]=o,this.fetching[i]={rawTileData:s,cacheControl:l,resourceTiming:c};try{const e=yield u;return t.e({rawTileData:s.slice(0)},e,l,c)}finally{delete this.fetching[i]}}catch(t){throw delete this.loading[i],o.status="done",this.loaded[i]=o,t}}))}reloadTile(e){return t._(this,void 0,void 0,(function*(){const i=e.uid;if(!this.loaded||!this.loaded[i])throw new Error("Should not be trying to reload a tile that was never loaded or has been removed");const r=this.loaded[i];if(r.showCollisionBoxes=e.showCollisionBoxes,"parsing"===r.status){const e=yield r.parse(r.vectorTile,this.layerIndex,this.availableImages,this.actor);let n;if(this.fetching[i]){const{rawTileData:r,cacheControl:o,resourceTiming:a}=this.fetching[i];delete this.fetching[i],n=t.e({rawTileData:r.slice(0)},e,o,a)}else n=e;return n}if("done"===r.status&&r.vectorTile)return r.parse(r.vectorTile,this.layerIndex,this.availableImages,this.actor)}))}abortTile(e){return t._(this,void 0,void 0,(function*(){const t=this.loading,i=e.uid;t&&t[i]&&t[i].abort&&(t[i].abort.abort(),delete t[i])}))}removeTile(e){return t._(this,void 0,void 0,(function*(){this.loaded&&this.loaded[e.uid]&&delete this.loaded[e.uid]}))}}class a{constructor(){this.loaded={}}loadTile(e){return t._(this,void 0,void 0,(function*(){const{uid:i,encoding:r,rawImageData:n,redFactor:o,greenFactor:a,blueFactor:s,baseShift:l}=e,c=n.width+2,u=n.height+2,h=t.b(n)?new t.R({width:c,height:u},yield t.bw(n,-1,-1,c,u)):n,d=new t.bx(i,h,r,o,a,s,l);return this.loaded=this.loaded||{},this.loaded[i]=d,d}))}removeTile(t){const e=this.loaded,i=t.uid;e&&e[i]&&delete e[i]}}function s(t,e){if(0!==t.length){l(t[0],e);for(var i=1;i<t.length;i++)l(t[i],!e)}}function l(t,e){for(var i=0,r=0,n=0,o=t.length,a=o-1;n<o;a=n++){var s=(t[n][0]-t[a][0])*(t[a][1]+t[n][1]),l=i+s;r+=Math.abs(i)>=Math.abs(s)?i-l+s:s-l+i,i=l}i+r>=0!=!!e&&t.reverse()}var c=t.by((function t(e,i){var r,n=e&&e.type;if("FeatureCollection"===n)for(r=0;r<e.features.length;r++)t(e.features[r],i);else if("GeometryCollection"===n)for(r=0;r<e.geometries.length;r++)t(e.geometries[r],i);else if("Feature"===n)t(e.geometry,i);else if("Polygon"===n)s(e.coordinates,i);else if("MultiPolygon"===n)for(r=0;r<e.coordinates.length;r++)s(e.coordinates[r],i);return e}));const u=t.bt.VectorTileFeature.prototype.toGeoJSON;var h={exports:{}},d=t.bz,p=t.bt.VectorTileFeature,f=m;function m(t,e){this.options=e||{},this.features=t,this.length=t.length}function g(t,e){this.id="number"==typeof t.id?t.id:void 0,this.type=t.type,this.rawGeometry=1===t.type?[t.geometry]:t.geometry,this.properties=t.tags,this.extent=e||4096}m.prototype.feature=function(t){return new g(this.features[t],this.options.extent)},g.prototype.loadGeometry=function(){var t=this.rawGeometry;this.geometry=[];for(var e=0;e<t.length;e++){for(var i=t[e],r=[],n=0;n<i.length;n++)r.push(new d(i[n][0],i[n][1]));this.geometry.push(r)}return this.geometry},g.prototype.bbox=function(){this.geometry||this.loadGeometry();for(var t=this.geometry,e=1/0,i=-1/0,r=1/0,n=-1/0,o=0;o<t.length;o++)for(var a=t[o],s=0;s<a.length;s++){var l=a[s];e=Math.min(e,l.x),i=Math.max(i,l.x),r=Math.min(r,l.y),n=Math.max(n,l.y)}return[e,r,i,n]},g.prototype.toGeoJSON=p.prototype.toGeoJSON;var y=t.bA,_=f;function v(t){var e=new y;return function(t,e){for(var i in t.layers)e.writeMessage(3,b,t.layers[i])}(t,e),e.finish()}function b(t,e){var i;e.writeVarintField(15,t.version||1),e.writeStringField(1,t.name||""),e.writeVarintField(5,t.extent||4096);var r={keys:[],values:[],keycache:{},valuecache:{}};for(i=0;i<t.length;i++)r.feature=t.feature(i),e.writeMessage(2,x,r);var n=r.keys;for(i=0;i<n.length;i++)e.writeStringField(3,n[i]);var o=r.values;for(i=0;i<o.length;i++)e.writeMessage(4,I,o[i])}function x(t,e){var i=t.feature;void 0!==i.id&&e.writeVarintField(1,i.id),e.writeMessage(2,w,t),e.writeVarintField(3,i.type),e.writeMessage(4,S,i)}function w(t,e){var i=t.feature,r=t.keys,n=t.values,o=t.keycache,a=t.valuecache;for(var s in i.properties){var l=i.properties[s],c=o[s];if(null!==l){void 0===c&&(r.push(s),o[s]=c=r.length-1),e.writeVarint(c);var u=typeof l;"string"!==u&&"boolean"!==u&&"number"!==u&&(l=JSON.stringify(l));var h=u+":"+l,d=a[h];void 0===d&&(n.push(l),a[h]=d=n.length-1),e.writeVarint(d)}}}function k(t,e){return(e<<3)+(7&t)}function E(t){return t<<1^t>>31}function S(t,e){for(var i=t.loadGeometry(),r=t.type,n=0,o=0,a=i.length,s=0;s<a;s++){var l=i[s],c=1;1===r&&(c=l.length),e.writeVarint(k(1,c));for(var u=3===r?l.length-1:l.length,h=0;h<u;h++){1===h&&1!==r&&e.writeVarint(k(2,u-1));var d=l[h].x-n,p=l[h].y-o;e.writeVarint(E(d)),e.writeVarint(E(p)),n+=d,o+=p}3===r&&e.writeVarint(k(7,1))}}function I(t,e){var i=typeof t;"string"===i?e.writeStringField(1,t):"boolean"===i?e.writeBooleanField(7,t):"number"===i&&(t%1!=0?e.writeDoubleField(3,t):t<0?e.writeSVarintField(6,t):e.writeVarintField(5,t))}h.exports=v,h.exports.fromVectorTileJs=v,h.exports.fromGeojsonVt=function(t,e){e=e||{};var i={};for(var r in t)i[r]=new _(t[r].features,e),i[r].name=r,i[r].version=e.version,i[r].extent=e.extent;return v({layers:i})},h.exports.GeoJSONWrapper=_;var C=t.by(h.exports);const T={minZoom:0,maxZoom:16,minPoints:2,radius:40,extent:512,nodeSize:64,log:!1,generateId:!1,reduce:null,map:t=>t},A=Math.fround||(P=new Float32Array(1),t=>(P[0]=+t,P[0]));var P;const M=3,L=5,z=6;class D{constructor(t){this.options=Object.assign(Object.create(T),t),this.trees=new Array(this.options.maxZoom+1),this.stride=this.options.reduce?7:6,this.clusterProps=[]}load(t){const{log:e,minZoom:i,maxZoom:r}=this.options;e&&console.time("total time");const n=`prepare ${t.length} points`;e&&console.time(n),this.points=t;const o=[];for(let s=0;s<t.length;s++){const e=t[s];if(!e.geometry)continue;const[i,r]=e.geometry.coordinates,n=A(F(i)),a=A(B(r));o.push(n,a,1/0,s,-1,1),this.options.reduce&&o.push(0)}let a=this.trees[r+1]=this._createTree(o);e&&console.timeEnd(n);for(let s=r;s>=i;s--){const t=+Date.now();a=this.trees[s]=this._createTree(this._cluster(a,s)),e&&console.log("z%d: %d clusters in %dms",s,a.numItems,+Date.now()-t)}return e&&console.timeEnd("total time"),this}getClusters(t,e){let i=((t[0]+180)%360+360)%360-180;const r=Math.max(-90,Math.min(90,t[1]));let n=180===t[2]?180:((t[2]+180)%360+360)%360-180;const o=Math.max(-90,Math.min(90,t[3]));if(t[2]-t[0]>=360)i=-180,n=180;else if(i>n){const t=this.getClusters([i,r,180,o],e),a=this.getClusters([-180,r,n,o],e);return t.concat(a)}const a=this.trees[this._limitZoom(e)],s=a.range(F(i),B(o),F(n),B(r)),l=a.data,c=[];for(const u of s){const t=this.stride*u;c.push(l[t+L]>1?R(l,t,this.clusterProps):this.points[l[t+M]])}return c}getChildren(t){const e=this._getOriginId(t),i=this._getOriginZoom(t),r="No cluster with the specified id.",n=this.trees[i];if(!n)throw new Error(r);const o=n.data;if(e*this.stride>=o.length)throw new Error(r);const a=this.options.radius/(this.options.extent*Math.pow(2,i-1)),s=n.within(o[e*this.stride],o[e*this.stride+1],a),l=[];for(const c of s){const e=c*this.stride;o[e+4]===t&&l.push(o[e+L]>1?R(o,e,this.clusterProps):this.points[o[e+M]])}if(0===l.length)throw new Error(r);return l}getLeaves(t,e,i){const r=[];return this._appendLeaves(r,t,e=e||10,i=i||0,0),r}getTile(t,e,i){const r=this.trees[this._limitZoom(t)],n=Math.pow(2,t),{extent:o,radius:a}=this.options,s=a/o,l=(i-s)/n,c=(i+1+s)/n,u={features:[]};return this._addTileFeatures(r.range((e-s)/n,l,(e+1+s)/n,c),r.data,e,i,n,u),0===e&&this._addTileFeatures(r.range(1-s/n,l,1,c),r.data,n,i,n,u),e===n-1&&this._addTileFeatures(r.range(0,l,s/n,c),r.data,-1,i,n,u),u.features.length?u:null}getClusterExpansionZoom(t){let e=this._getOriginZoom(t)-1;for(;e<=this.options.maxZoom;){const i=this.getChildren(t);if(e++,1!==i.length)break;t=i[0].properties.cluster_id}return e}_appendLeaves(t,e,i,r,n){const o=this.getChildren(e);for(const a of o){const e=a.properties;if(e&&e.cluster?n+e.point_count<=r?n+=e.point_count:n=this._appendLeaves(t,e.cluster_id,i,r,n):n<r?n++:t.push(a),t.length===i)break}return n}_createTree(e){const i=new t.av(e.length/this.stride|0,this.options.nodeSize,Float32Array);for(let t=0;t<e.length;t+=this.stride)i.add(e[t],e[t+1]);return i.finish(),i.data=e,i}_addTileFeatures(t,e,i,r,n,o){for(const a of t){const t=a*this.stride,s=e[t+L]>1;let l,c,u;if(s)l=O(e,t,this.clusterProps),c=e[t],u=e[t+1];else{const i=this.points[e[t+M]];l=i.properties;const[r,n]=i.geometry.coordinates;c=F(r),u=B(n)}const h={type:1,geometry:[[Math.round(this.options.extent*(c*n-i)),Math.round(this.options.extent*(u*n-r))]],tags:l};let d;d=s||this.options.generateId?e[t+M]:this.points[e[t+M]].id,void 0!==d&&(h.id=d),o.features.push(h)}}_limitZoom(t){return Math.max(this.options.minZoom,Math.min(Math.floor(+t),this.options.maxZoom+1))}_cluster(t,e){const{radius:i,extent:r,reduce:n,minPoints:o}=this.options,a=i/(r*Math.pow(2,e)),s=t.data,l=[],c=this.stride;for(let u=0;u<s.length;u+=c){if(s[u+2]<=e)continue;s[u+2]=e;const i=s[u],r=s[u+1],h=t.within(s[u],s[u+1],a),d=s[u+L];let p=d;for(const t of h){const i=t*c;s[i+2]>e&&(p+=s[i+L])}if(p>d&&p>=o){let t,o=i*d,a=r*d,f=-1;const m=(u/c<<5)+(e+1)+this.points.length;for(const i of h){const r=i*c;if(s[r+2]<=e)continue;s[r+2]=e;const l=s[r+L];o+=s[r]*l,a+=s[r+1]*l,s[r+4]=m,n&&(t||(t=this._map(s,u,!0),f=this.clusterProps.length,this.clusterProps.push(t)),n(t,this._map(s,r)))}s[u+4]=m,l.push(o/p,a/p,1/0,m,-1,p),n&&l.push(f)}else{for(let t=0;t<c;t++)l.push(s[u+t]);if(p>1)for(const t of h){const i=t*c;if(!(s[i+2]<=e)){s[i+2]=e;for(let t=0;t<c;t++)l.push(s[i+t])}}}}return l}_getOriginId(t){return t-this.points.length>>5}_getOriginZoom(t){return(t-this.points.length)%32}_map(t,e,i){if(t[e+L]>1){const r=this.clusterProps[t[e+z]];return i?Object.assign({},r):r}const r=this.points[t[e+M]].properties,n=this.options.map(r);return i&&n===r?Object.assign({},n):n}}function R(t,e,i){return{type:"Feature",id:t[e+M],properties:O(t,e,i),geometry:{type:"Point",coordinates:[(r=t[e],360*(r-.5)),N(t[e+1])]}};var r}function O(t,e,i){const r=t[e+L],n=r>=1e4?`${Math.round(r/1e3)}k`:r>=1e3?Math.round(r/100)/10+"k":r,o=t[e+z],a=-1===o?{}:Object.assign({},i[o]);return Object.assign(a,{cluster:!0,cluster_id:t[e+M],point_count:r,point_count_abbreviated:n})}function F(t){return t/360+.5}function B(t){const e=Math.sin(t*Math.PI/180),i=.5-.25*Math.log((1+e)/(1-e))/Math.PI;return i<0?0:i>1?1:i}function N(t){const e=(180-360*t)*Math.PI/180;return 360*Math.atan(Math.exp(e))/Math.PI-90}function j(t,e,i,r){let n=r;const o=e+(i-e>>1);let a,s=i-e;const l=t[e],c=t[e+1],u=t[i],h=t[i+1];for(let d=e+3;d<i;d+=3){const e=V(t[d],t[d+1],l,c,u,h);if(e>n)a=d,n=e;else if(e===n){const t=Math.abs(d-o);t<s&&(a=d,s=t)}}n>r&&(a-e>3&&j(t,e,a,r),t[a+2]=n,i-a>3&&j(t,a,i,r))}function V(t,e,i,r,n,o){let a=n-i,s=o-r;if(0!==a||0!==s){const l=((t-i)*a+(e-r)*s)/(a*a+s*s);l>1?(i=n,r=o):l>0&&(i+=a*l,r+=s*l)}return a=t-i,s=e-r,a*a+s*s}function U(t,e,i,r){const n={id:null==t?null:t,type:e,geometry:i,tags:r,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0};if("Point"===e||"MultiPoint"===e||"LineString"===e)q(n,i);else if("Polygon"===e)q(n,i[0]);else if("MultiLineString"===e)for(const o of i)q(n,o);else if("MultiPolygon"===e)for(const o of i)q(n,o[0]);return n}function q(t,e){for(let i=0;i<e.length;i+=3)t.minX=Math.min(t.minX,e[i]),t.minY=Math.min(t.minY,e[i+1]),t.maxX=Math.max(t.maxX,e[i]),t.maxY=Math.max(t.maxY,e[i+1])}function $(t,e,i,r){if(!e.geometry)return;const n=e.geometry.coordinates;if(n&&0===n.length)return;const o=e.geometry.type,a=Math.pow(i.tolerance/((1<<i.maxZoom)*i.extent),2);let s=[],l=e.id;if(i.promoteId?l=e.properties[i.promoteId]:i.generateId&&(l=r||0),"Point"===o)G(n,s);else if("MultiPoint"===o)for(const c of n)G(c,s);else if("LineString"===o)H(n,s,a,!1);else if("MultiLineString"===o){if(i.lineMetrics){for(const i of n)s=[],H(i,s,a,!1),t.push(U(l,"LineString",s,e.properties));return}Z(n,s,a,!1)}else if("Polygon"===o)Z(n,s,a,!0);else{if("MultiPolygon"!==o){if("GeometryCollection"===o){for(const n of e.geometry.geometries)$(t,{id:l,geometry:n,properties:e.properties},i,r);return}throw new Error("Input data is not a valid GeoJSON object.")}for(const t of n){const e=[];Z(t,e,a,!0),s.push(e)}}t.push(U(l,o,s,e.properties))}function G(t,e){e.push(W(t[0]),X(t[1]),0)}function H(t,e,i,r){let n,o,a=0;for(let l=0;l<t.length;l++){const i=W(t[l][0]),s=X(t[l][1]);e.push(i,s,0),l>0&&(a+=r?(n*s-i*o)/2:Math.sqrt(Math.pow(i-n,2)+Math.pow(s-o,2))),n=i,o=s}const s=e.length-3;e[2]=1,j(e,0,s,i),e[s+2]=1,e.size=Math.abs(a),e.start=0,e.end=e.size}function Z(t,e,i,r){for(let n=0;n<t.length;n++){const o=[];H(t[n],o,i,r),e.push(o)}}function W(t){return t/360+.5}function X(t){const e=Math.sin(t*Math.PI/180),i=.5-.25*Math.log((1+e)/(1-e))/Math.PI;return i<0?0:i>1?1:i}function J(t,e,i,r,n,o,a,s){if(r/=e,o>=(i/=e)&&a<r)return t;if(a<i||o>=r)return null;const l=[];for(const c of t){const t=c.geometry;let e=c.type;const o=0===n?c.minX:c.minY,a=0===n?c.maxX:c.maxY;if(o>=i&&a<r){l.push(c);continue}if(a<i||o>=r)continue;let u=[];if("Point"===e||"MultiPoint"===e)K(t,u,i,r,n);else if("LineString"===e)Y(t,u,i,r,n,!1,s.lineMetrics);else if("MultiLineString"===e)tt(t,u,i,r,n,!1);else if("Polygon"===e)tt(t,u,i,r,n,!0);else if("MultiPolygon"===e)for(const s of t){const t=[];tt(s,t,i,r,n,!0),t.length&&u.push(t)}if(u.length){if(s.lineMetrics&&"LineString"===e){for(const t of u)l.push(U(c.id,e,t,c.tags));continue}"LineString"!==e&&"MultiLineString"!==e||(1===u.length?(e="LineString",u=u[0]):e="MultiLineString"),"Point"!==e&&"MultiPoint"!==e||(e=3===u.length?"Point":"MultiPoint"),l.push(U(c.id,e,u,c.tags))}}return l.length?l:null}function K(t,e,i,r,n){for(let o=0;o<t.length;o+=3){const a=t[o+n];a>=i&&a<=r&&et(e,t[o],t[o+1],t[o+2])}}function Y(t,e,i,r,n,o,a){let s=Q(t);const l=0===n?it:rt;let c,u,h=t.start;for(let g=0;g<t.length-3;g+=3){const d=t[g],p=t[g+1],f=t[g+2],m=t[g+3],y=t[g+4],_=0===n?d:p,v=0===n?m:y;let b=!1;a&&(c=Math.sqrt(Math.pow(d-m,2)+Math.pow(p-y,2))),_<i?v>i&&(u=l(s,d,p,m,y,i),a&&(s.start=h+c*u)):_>r?v<r&&(u=l(s,d,p,m,y,r),a&&(s.start=h+c*u)):et(s,d,p,f),v<i&&_>=i&&(u=l(s,d,p,m,y,i),b=!0),v>r&&_<=r&&(u=l(s,d,p,m,y,r),b=!0),!o&&b&&(a&&(s.end=h+c*u),e.push(s),s=Q(t)),a&&(h+=c)}let d=t.length-3;const p=t[d],f=t[d+1],m=0===n?p:f;m>=i&&m<=r&&et(s,p,f,t[d+2]),d=s.length-3,o&&d>=3&&(s[d]!==s[0]||s[d+1]!==s[1])&&et(s,s[0],s[1],s[2]),s.length&&e.push(s)}function Q(t){const e=[];return e.size=t.size,e.start=t.start,e.end=t.end,e}function tt(t,e,i,r,n,o){for(const a of t)Y(a,e,i,r,n,o,!1)}function et(t,e,i,r){t.push(e,i,r)}function it(t,e,i,r,n,o){const a=(o-e)/(r-e);return et(t,o,i+(n-i)*a,1),a}function rt(t,e,i,r,n,o){const a=(o-i)/(n-i);return et(t,e+(r-e)*a,o,1),a}function nt(t,e){const i=[];for(let r=0;r<t.length;r++){const n=t[r],o=n.type;let a;if("Point"===o||"MultiPoint"===o||"LineString"===o)a=ot(n.geometry,e);else if("MultiLineString"===o||"Polygon"===o){a=[];for(const t of n.geometry)a.push(ot(t,e))}else if("MultiPolygon"===o){a=[];for(const t of n.geometry){const i=[];for(const r of t)i.push(ot(r,e));a.push(i)}}i.push(U(n.id,o,a,n.tags))}return i}function ot(t,e){const i=[];i.size=t.size,void 0!==t.start&&(i.start=t.start,i.end=t.end);for(let r=0;r<t.length;r+=3)i.push(t[r]+e,t[r+1],t[r+2]);return i}function at(t,e){if(t.transformed)return t;const i=1<<t.z,r=t.x,n=t.y;for(const o of t.features){const t=o.geometry,a=o.type;if(o.geometry=[],1===a)for(let s=0;s<t.length;s+=2)o.geometry.push(st(t[s],t[s+1],e,i,r,n));else for(let s=0;s<t.length;s++){const a=[];for(let o=0;o<t[s].length;o+=2)a.push(st(t[s][o],t[s][o+1],e,i,r,n));o.geometry.push(a)}}return t.transformed=!0,t}function st(t,e,i,r,n,o){return[Math.round(i*(t*r-n)),Math.round(i*(e*r-o))]}function lt(t,e,i,r,n){const o=e===n.maxZoom?0:n.tolerance/((1<<e)*n.extent),a={features:[],numPoints:0,numSimplified:0,numFeatures:t.length,source:null,x:i,y:r,z:e,transformed:!1,minX:2,minY:1,maxX:-1,maxY:0};for(const s of t)ct(a,s,o,n);return a}function ct(t,e,i,r){const n=e.geometry,o=e.type,a=[];if(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),"Point"===o||"MultiPoint"===o)for(let s=0;s<n.length;s+=3)a.push(n[s],n[s+1]),t.numPoints++,t.numSimplified++;else if("LineString"===o)ut(a,n,t,i,!1,!1);else if("MultiLineString"===o||"Polygon"===o)for(let s=0;s<n.length;s++)ut(a,n[s],t,i,"Polygon"===o,0===s);else if("MultiPolygon"===o)for(let s=0;s<n.length;s++){const e=n[s];for(let r=0;r<e.length;r++)ut(a,e[r],t,i,!0,0===r)}if(a.length){let i=e.tags||null;if("LineString"===o&&r.lineMetrics){i={};for(const t in e.tags)i[t]=e.tags[t];i.mapbox_clip_start=n.start/n.size,i.mapbox_clip_end=n.end/n.size}const s={geometry:a,type:"Polygon"===o||"MultiPolygon"===o?3:"LineString"===o||"MultiLineString"===o?2:1,tags:i};null!==e.id&&(s.id=e.id),t.features.push(s)}}function ut(t,e,i,r,n,o){const a=r*r;if(r>0&&e.size<(n?a:r))return void(i.numPoints+=e.length/3);const s=[];for(let l=0;l<e.length;l+=3)(0===r||e[l+2]>a)&&(i.numSimplified++,s.push(e[l],e[l+1])),i.numPoints++;n&&function(t,e){let i=0;for(let r=0,n=t.length,o=n-2;r<n;o=r,r+=2)i+=(t[r]-t[o])*(t[r+1]+t[o+1]);if(i>0===e)for(let r=0,n=t.length;r<n/2;r+=2){const e=t[r],i=t[r+1];t[r]=t[n-2-r],t[r+1]=t[n-1-r],t[n-2-r]=e,t[n-1-r]=i}}(s,o),t.push(s)}const ht={maxZoom:14,indexMaxZoom:5,indexMaxPoints:1e5,tolerance:3,extent:4096,buffer:64,lineMetrics:!1,promoteId:null,generateId:!1,debug:0};class dt{constructor(t,e){const i=(e=this.options=function(t,e){for(const i in e)t[i]=e[i];return t}(Object.create(ht),e)).debug;if(i&&console.time("preprocess data"),e.maxZoom<0||e.maxZoom>24)throw new Error("maxZoom should be in the 0-24 range");if(e.promoteId&&e.generateId)throw new Error("promoteId and generateId cannot be used together.");let r=function(t,e){const i=[];if("FeatureCollection"===t.type)for(let r=0;r<t.features.length;r++)$(i,t.features[r],e,r);else $(i,"Feature"===t.type?t:{geometry:t},e);return i}(t,e);this.tiles={},this.tileCoords=[],i&&(console.timeEnd("preprocess data"),console.log("index: maxZoom: %d, maxPoints: %d",e.indexMaxZoom,e.indexMaxPoints),console.time("generate tiles"),this.stats={},this.total=0),r=function(t,e){const i=e.buffer/e.extent;let r=t;const n=J(t,1,-1-i,i,0,-1,2,e),o=J(t,1,1-i,2+i,0,-1,2,e);return(n||o)&&(r=J(t,1,-i,1+i,0,-1,2,e)||[],n&&(r=nt(n,1).concat(r)),o&&(r=r.concat(nt(o,-1)))),r}(r,e),r.length&&this.splitTile(r,0,0,0),i&&(r.length&&console.log("features: %d, points: %d",this.tiles[0].numFeatures,this.tiles[0].numPoints),console.timeEnd("generate tiles"),console.log("tiles generated:",this.total,JSON.stringify(this.stats)))}splitTile(t,e,i,r,n,o,a){const s=[t,e,i,r],l=this.options,c=l.debug;for(;s.length;){r=s.pop(),i=s.pop(),e=s.pop(),t=s.pop();const u=1<<e,h=pt(e,i,r);let d=this.tiles[h];if(!d&&(c>1&&console.time("creation"),d=this.tiles[h]=lt(t,e,i,r,l),this.tileCoords.push({z:e,x:i,y:r}),c)){c>1&&(console.log("tile z%d-%d-%d (features: %d, points: %d, simplified: %d)",e,i,r,d.numFeatures,d.numPoints,d.numSimplified),console.timeEnd("creation"));const t=`z${e}`;this.stats[t]=(this.stats[t]||0)+1,this.total++}if(d.source=t,null==n){if(e===l.indexMaxZoom||d.numPoints<=l.indexMaxPoints)continue}else{if(e===l.maxZoom||e===n)continue;if(null!=n){const t=n-e;if(i!==o>>t||r!==a>>t)continue}}if(d.source=null,0===t.length)continue;c>1&&console.time("clipping");const p=.5*l.buffer/l.extent,f=.5-p,m=.5+p,g=1+p;let y=null,_=null,v=null,b=null,x=J(t,u,i-p,i+m,0,d.minX,d.maxX,l),w=J(t,u,i+f,i+g,0,d.minX,d.maxX,l);t=null,x&&(y=J(x,u,r-p,r+m,1,d.minY,d.maxY,l),_=J(x,u,r+f,r+g,1,d.minY,d.maxY,l),x=null),w&&(v=J(w,u,r-p,r+m,1,d.minY,d.maxY,l),b=J(w,u,r+f,r+g,1,d.minY,d.maxY,l),w=null),c>1&&console.timeEnd("clipping"),s.push(y||[],e+1,2*i,2*r),s.push(_||[],e+1,2*i,2*r+1),s.push(v||[],e+1,2*i+1,2*r),s.push(b||[],e+1,2*i+1,2*r+1)}}getTile(t,e,i){t=+t,e=+e,i=+i;const r=this.options,{extent:n,debug:o}=r;if(t<0||t>24)return null;const a=1<<t,s=pt(t,e=e+a&a-1,i);if(this.tiles[s])return at(this.tiles[s],n);o>1&&console.log("drilling down to z%d-%d-%d",t,e,i);let l,c=t,u=e,h=i;for(;!l&&c>0;)c--,u>>=1,h>>=1,l=this.tiles[pt(c,u,h)];return l&&l.source?(o>1&&(console.log("found parent tile z%d-%d-%d",c,u,h),console.time("drilling down")),this.splitTile(l.source,c,u,h,t,e,i),o>1&&console.timeEnd("drilling down"),this.tiles[s]?at(this.tiles[s],n):null):null}}function pt(t,e,i){return 32*((1<<t)*i+e)+t}function ft(t,e){return e?t.properties[e]:t.id}function mt(t,e){if(null==t)return!0;if("Feature"===t.type)return null!=ft(t,e);if("FeatureCollection"===t.type){const i=new Set;for(const r of t.features){const t=ft(r,e);if(null==t)return!1;if(i.has(t))return!1;i.add(t)}return!0}return!1}function gt(t,e){const i=new Map;if(null==t);else if("Feature"===t.type)i.set(ft(t,e),t);else for(const r of t.features)i.set(ft(r,e),r);return i}class yt extends o{constructor(){super(...arguments),this._dataUpdateable=new Map}loadVectorTile(e,i){return t._(this,void 0,void 0,(function*(){const i=e.tileID.canonical;if(!this._geoJSONIndex)throw new Error("Unable to parse the data into a cluster or geojson");const r=this._geoJSONIndex.getTile(i.z,i.x,i.y);if(!r)return null;const n=new class{constructor(e){this.layers={_geojsonTileLayer:this},this.name="_geojsonTileLayer",this.extent=t.X,this.length=e.length,this._features=e}feature(e){return new class{constructor(e){this._feature=e,this.extent=t.X,this.type=e.type,this.properties=e.tags,"id"in e&&!isNaN(e.id)&&(this.id=parseInt(e.id,10))}loadGeometry(){if(1===this._feature.type){const e=[];for(const i of this._feature.geometry)e.push([new t.P(i[0],i[1])]);return e}{const e=[];for(const i of this._feature.geometry){const r=[];for(const e of i)r.push(new t.P(e[0],e[1]));e.push(r)}return e}}toGeoJSON(t,e,i){return u.call(this,t,e,i)}}(this._features[e])}}(r.features);let o=C(n);return 0===o.byteOffset&&o.byteLength===o.buffer.byteLength||(o=new Uint8Array(o)),{vectorTile:n,rawData:o.buffer}}))}loadData(e){return t._(this,void 0,void 0,(function*(){var i;null===(i=this._pendingRequest)||void 0===i||i.abort();const r=!!(e&&e.request&&e.request.collectResourceTiming)&&new t.bv(e.request);this._pendingRequest=new AbortController;try{this._pendingData=this.loadAndProcessGeoJSON(e,this._pendingRequest),this._geoJSONIndex=e.cluster?new D(function({superclusterOptions:e,clusterProperties:i}){if(!i||!e)return e;const r={},n={},o={accumulated:null,zoom:0},a={properties:null},s=Object.keys(i);for(const l of s){const[e,o]=i[l],a=t.bC(o),s=t.bC("string"==typeof e?[e,["accumulated"],["get",l]]:e);r[l]=a.value,n[l]=s.value}return e.map=t=>{a.properties=t;const e={};for(const i of s)e[i]=r[i].evaluate(o,a);return e},e.reduce=(t,e)=>{a.properties=e;for(const i of s)o.accumulated=t[i],t[i]=n[i].evaluate(o,a)},e}(e)).load((yield this._pendingData).features):(n=yield this._pendingData,new dt(n,e.geojsonVtOptions)),this.loaded={};const i={};if(r){const t=r.finish();t&&(i.resourceTiming={},i.resourceTiming[e.source]=JSON.parse(JSON.stringify(t)))}return i}catch(e){if(delete this._pendingRequest,t.bB(e))return{abandoned:!0};throw e}var n}))}getData(){return t._(this,void 0,void 0,(function*(){return this._pendingData}))}reloadTile(t){const e=this.loaded;return e&&e[t.uid]?super.reloadTile(t):this.loadTile(t)}loadAndProcessGeoJSON(e,i){return t._(this,void 0,void 0,(function*(){let r=yield this.loadGeoJSON(e,i);if(delete this._pendingRequest,"object"!=typeof r)throw new Error(`Input data given to '${e.source}' is not a valid GeoJSON object.`);if(c(r,!0),e.filter){const i=t.bC(e.filter,{type:"boolean","property-type":"data-driven",overridable:!1,transition:!1});if("error"===i.result)throw new Error(i.value.map((t=>`${t.key}: ${t.message}`)).join(", "));const n=r.features.filter((t=>i.value.evaluate({zoom:0},t)));r={type:"FeatureCollection",features:n}}return r}))}loadGeoJSON(e,i){return t._(this,void 0,void 0,(function*(){const{promoteId:r}=e;if(e.request){const n=yield t.h(e.request,i);return this._dataUpdateable=mt(n.data,r)?gt(n.data,r):void 0,n.data}if("string"==typeof e.data)try{const t=JSON.parse(e.data);return this._dataUpdateable=mt(t,r)?gt(t,r):void 0,t}catch(t){throw new Error(`Input data given to '${e.source}' is not a valid GeoJSON object.`)}if(!e.dataDiff)throw new Error(`Input data given to '${e.source}' is not a valid GeoJSON object.`);if(!this._dataUpdateable)throw new Error(`Cannot update existing geojson data in ${e.source}`);return function(t,e,i){var r,n,o,a;if(e.removeAll&&t.clear(),e.remove)for(const s of e.remove)t.delete(s);if(e.add)for(const s of e.add){const e=ft(s,i);null!=e&&t.set(e,s)}if(e.update)for(const s of e.update){let e=t.get(s.id);if(null==e)continue;const i=!s.removeAllProperties&&((null===(r=s.removeProperties)||void 0===r?void 0:r.length)>0||(null===(n=s.addOrUpdateProperties)||void 0===n?void 0:n.length)>0);if((s.newGeometry||s.removeAllProperties||i)&&(e=Object.assign({},e),t.set(s.id,e),i&&(e.properties=Object.assign({},e.properties))),s.newGeometry&&(e.geometry=s.newGeometry),s.removeAllProperties)e.properties={};else if((null===(o=s.removeProperties)||void 0===o?void 0:o.length)>0)for(const t of s.removeProperties)Object.prototype.hasOwnProperty.call(e.properties,t)&&delete e.properties[t];if((null===(a=s.addOrUpdateProperties)||void 0===a?void 0:a.length)>0)for(const{key:t,value:r}of s.addOrUpdateProperties)e.properties[t]=r}}(this._dataUpdateable,e.dataDiff,r),{type:"FeatureCollection",features:Array.from(this._dataUpdateable.values())}}))}removeSource(e){return t._(this,void 0,void 0,(function*(){this._pendingRequest&&this._pendingRequest.abort()}))}getClusterExpansionZoom(t){return this._geoJSONIndex.getClusterExpansionZoom(t.clusterId)}getClusterChildren(t){return this._geoJSONIndex.getChildren(t.clusterId)}getClusterLeaves(t){return this._geoJSONIndex.getLeaves(t.clusterId,t.limit,t.offset)}}class _t{constructor(e){this.self=e,this.actor=new t.F(e),this.layerIndexes={},this.availableImages={},this.workerSources={},this.demWorkerSources={},this.externalWorkerSourceTypes={},this.self.registerWorkerSource=(t,e)=>{if(this.externalWorkerSourceTypes[t])throw new Error(`Worker source with name "${t}" already registered.`);this.externalWorkerSourceTypes[t]=e},this.self.addProtocol=t.bi,this.self.removeProtocol=t.bj,this.self.registerRTLTextPlugin=e=>{if(t.bD.isParsed())throw new Error("RTL text plugin already registered.");t.bD.setMethods(e)},this.actor.registerMessageHandler("LDT",((t,e)=>this._getDEMWorkerSource(t,e.source).loadTile(e))),this.actor.registerMessageHandler("RDT",((e,i)=>t._(this,void 0,void 0,(function*(){this._getDEMWorkerSource(e,i.source).removeTile(i)})))),this.actor.registerMessageHandler("GCEZ",((e,i)=>t._(this,void 0,void 0,(function*(){return this._getWorkerSource(e,i.type,i.source).getClusterExpansionZoom(i)})))),this.actor.registerMessageHandler("GCC",((e,i)=>t._(this,void 0,void 0,(function*(){return this._getWorkerSource(e,i.type,i.source).getClusterChildren(i)})))),this.actor.registerMessageHandler("GCL",((e,i)=>t._(this,void 0,void 0,(function*(){return this._getWorkerSource(e,i.type,i.source).getClusterLeaves(i)})))),this.actor.registerMessageHandler("LD",((t,e)=>this._getWorkerSource(t,e.type,e.source).loadData(e))),this.actor.registerMessageHandler("GD",((t,e)=>this._getWorkerSource(t,e.type,e.source).getData())),this.actor.registerMessageHandler("LT",((t,e)=>this._getWorkerSource(t,e.type,e.source).loadTile(e))),this.actor.registerMessageHandler("RT",((t,e)=>this._getWorkerSource(t,e.type,e.source).reloadTile(e))),this.actor.registerMessageHandler("AT",((t,e)=>this._getWorkerSource(t,e.type,e.source).abortTile(e))),this.actor.registerMessageHandler("RMT",((t,e)=>this._getWorkerSource(t,e.type,e.source).removeTile(e))),this.actor.registerMessageHandler("RS",((e,i)=>t._(this,void 0,void 0,(function*(){if(!this.workerSources[e]||!this.workerSources[e][i.type]||!this.workerSources[e][i.type][i.source])return;const t=this.workerSources[e][i.type][i.source];delete this.workerSources[e][i.type][i.source],void 0!==t.removeSource&&t.removeSource(i)})))),this.actor.registerMessageHandler("RM",(e=>t._(this,void 0,void 0,(function*(){delete this.layerIndexes[e],delete this.availableImages[e],delete this.workerSources[e],delete this.demWorkerSources[e]})))),this.actor.registerMessageHandler("SR",((e,i)=>t._(this,void 0,void 0,(function*(){this.referrer=i})))),this.actor.registerMessageHandler("SRPS",((t,e)=>this._syncRTLPluginState(t,e))),this.actor.registerMessageHandler("IS",((e,i)=>t._(this,void 0,void 0,(function*(){this.self.importScripts(i)})))),this.actor.registerMessageHandler("SI",((t,e)=>this._setImages(t,e))),this.actor.registerMessageHandler("UL",((e,i)=>t._(this,void 0,void 0,(function*(){this._getLayerIndex(e).update(i.layers,i.removedIds)})))),this.actor.registerMessageHandler("SL",((e,i)=>t._(this,void 0,void 0,(function*(){this._getLayerIndex(e).replace(i)}))))}_setImages(e,i){return t._(this,void 0,void 0,(function*(){this.availableImages[e]=i;for(const t in this.workerSources[e]){const r=this.workerSources[e][t];for(const t in r)r[t].availableImages=i}}))}_syncRTLPluginState(e,i){return t._(this,void 0,void 0,(function*(){if(t.bD.isParsed())return t.bD.getState();if("loading"!==i.pluginStatus)return t.bD.setState(i),i;const e=i.pluginURL;if(this.self.importScripts(e),t.bD.isParsed()){const i={pluginStatus:"loaded",pluginURL:e};return t.bD.setState(i),i}throw t.bD.setState({pluginStatus:"error",pluginURL:""}),new Error(`RTL Text Plugin failed to import scripts from ${e}`)}))}_getAvailableImages(t){let e=this.availableImages[t];return e||(e=[]),e}_getLayerIndex(t){let i=this.layerIndexes[t];return i||(i=this.layerIndexes[t]=new e),i}_getWorkerSource(t,e,i){if(this.workerSources[t]||(this.workerSources[t]={}),this.workerSources[t][e]||(this.workerSources[t][e]={}),!this.workerSources[t][e][i]){const r={sendAsync:(e,i)=>(e.targetMapId=t,this.actor.sendAsync(e,i))};switch(e){case"vector":this.workerSources[t][e][i]=new o(r,this._getLayerIndex(t),this._getAvailableImages(t));break;case"geojson":this.workerSources[t][e][i]=new yt(r,this._getLayerIndex(t),this._getAvailableImages(t));break;default:this.workerSources[t][e][i]=new this.externalWorkerSourceTypes[e](r,this._getLayerIndex(t),this._getAvailableImages(t))}}return this.workerSources[t][e][i]}_getDEMWorkerSource(t,e){return this.demWorkerSources[t]||(this.demWorkerSources[t]={}),this.demWorkerSources[t][e]||(this.demWorkerSources[t][e]=new a),this.demWorkerSources[t][e]}}return t.i(self)&&(self.worker=new _t(self)),_t})),i("index",["exports","./shared"],(function(t,e){var i="4.7.1";let r,n;const o={now:"undefined"!=typeof performance&&performance&&performance.now?performance.now.bind(performance):Date.now.bind(Date),frameAsync:t=>new Promise(((i,r)=>{const n=requestAnimationFrame(i);t.signal.addEventListener("abort",(()=>{cancelAnimationFrame(n),r(e.c())}))})),getImageData(t,e=0){return this.getImageCanvasContext(t).getImageData(-e,-e,t.width+2*e,t.height+2*e)},getImageCanvasContext(t){const e=window.document.createElement("canvas"),i=e.getContext("2d",{willReadFrequently:!0});if(!i)throw new Error("failed to create canvas 2d context");return e.width=t.width,e.height=t.height,i.drawImage(t,0,0,t.width,t.height),i},resolveURL:t=>(r||(r=document.createElement("a")),r.href=t,r.href),hardwareConcurrency:"undefined"!=typeof navigator&&navigator.hardwareConcurrency||4,get prefersReducedMotion(){return!!matchMedia&&(null==n&&(n=matchMedia("(prefers-reduced-motion: reduce)")),n.matches)}};class a{static testProp(t){if(!a.docStyle)return t[0];for(let e=0;e<t.length;e++)if(t[e]in a.docStyle)return t[e];return t[0]}static create(t,e,i){const r=window.document.createElement(t);return void 0!==e&&(r.className=e),i&&i.appendChild(r),r}static createNS(t,e){return window.document.createElementNS(t,e)}static disableDrag(){a.docStyle&&a.selectProp&&(a.userSelect=a.docStyle[a.selectProp],a.docStyle[a.selectProp]="none")}static enableDrag(){a.docStyle&&a.selectProp&&(a.docStyle[a.selectProp]=a.userSelect)}static setTransform(t,e){t.style[a.transformProp]=e}static addEventListener(t,e,i,r={}){t.addEventListener(e,i,"passive"in r?r:r.capture)}static removeEventListener(t,e,i,r={}){t.removeEventListener(e,i,"passive"in r?r:r.capture)}static suppressClickInternal(t){t.preventDefault(),t.stopPropagation(),window.removeEventListener("click",a.suppressClickInternal,!0)}static suppressClick(){window.addEventListener("click",a.suppressClickInternal,!0),window.setTimeout((()=>{window.removeEventListener("click",a.suppressClickInternal,!0)}),0)}static getScale(t){const e=t.getBoundingClientRect();return{x:e.width/t.offsetWidth||1,y:e.height/t.offsetHeight||1,boundingClientRect:e}}static getPoint(t,i,r){const n=i.boundingClientRect;return new e.P((r.clientX-n.left)/i.x-t.clientLeft,(r.clientY-n.top)/i.y-t.clientTop)}static mousePos(t,e){const i=a.getScale(t);return a.getPoint(t,i,e)}static touchPos(t,e){const i=[],r=a.getScale(t);for(let n=0;n<e.length;n++)i.push(a.getPoint(t,r,e[n]));return i}static mouseButton(t){return t.button}static remove(t){t.parentNode&&t.parentNode.removeChild(t)}}a.docStyle="undefined"!=typeof window&&window.document&&window.document.documentElement.style,a.selectProp=a.testProp(["userSelect","MozUserSelect","WebkitUserSelect","msUserSelect"]),a.transformProp=a.testProp(["transform","WebkitTransform"]);const s={supported:!1,testSupport:function(t){!u&&c&&(h?d(t):l=t)}};let l,c,u=!1,h=!1;function d(t){const e=t.createTexture();t.bindTexture(t.TEXTURE_2D,e);try{if(t.texImage2D(t.TEXTURE_2D,0,t.RGBA,t.RGBA,t.UNSIGNED_BYTE,c),t.isContextLost())return;s.supported=!0}catch(t){}t.deleteTexture(e),u=!0}var p;"undefined"!=typeof document&&(c=document.createElement("img"),c.onload=()=>{l&&d(l),l=null,h=!0},c.onerror=()=>{u=!0,l=null},c.src="data:image/webp;base64,UklGRh4AAABXRUJQVlA4TBEAAAAvAQAAAAfQ//73v/+BiOh/AAA="),function(t){let i,r,n,o;t.resetRequestQueue=()=>{i=[],r=0,n=0,o={}},t.addThrottleControl=t=>{const e=n++;return o[e]=t,e},t.removeThrottleControl=t=>{delete o[t],l()},t.getImage=(t,r,n=!0)=>new Promise(((o,a)=>{s.supported&&(t.headers||(t.headers={}),t.headers.accept="image/webp,*/*"),e.e(t,{type:"image"}),i.push({abortController:r,requestParameters:t,supportImageRefresh:n,state:"queued",onError:t=>{a(t)},onSuccess:t=>{o(t)}}),l()}));const a=t=>e._(this,void 0,void 0,(function*(){t.state="running";const{requestParameters:i,supportImageRefresh:n,onError:o,onSuccess:a,abortController:s}=t,u=!1===n&&!e.i(self)&&!e.g(i.url)&&(!i.headers||Object.keys(i.headers).reduce(((t,e)=>t&&"accept"===e),!0));r++;const h=u?c(i,s):e.m(i,s);try{const i=yield h;delete t.abortController,t.state="completed",i.data instanceof HTMLImageElement||e.b(i.data)?a(i):i.data&&a({data:yield(d=i.data,"function"==typeof createImageBitmap?e.d(d):e.f(d)),cacheControl:i.cacheControl,expires:i.expires})}catch(e){delete t.abortController,o(e)}finally{r--,l()}var d})),l=()=>{const t=(()=>{for(const t of Object.keys(o))if(o[t]())return!0;return!1})()?e.a.MAX_PARALLEL_IMAGE_REQUESTS_PER_FRAME:e.a.MAX_PARALLEL_IMAGE_REQUESTS;for(let e=r;e<t&&i.length>0;e++){const t=i.shift();t.abortController.signal.aborted?e--:a(t)}},c=(t,i)=>new Promise(((r,n)=>{const o=new Image,a=t.url,s=t.credentials;s&&"include"===s?o.crossOrigin="use-credentials":(s&&"same-origin"===s||!e.s(a))&&(o.crossOrigin="anonymous"),i.signal.addEventListener("abort",(()=>{o.src="",n(e.c())})),o.fetchPriority="high",o.onload=()=>{o.onerror=o.onload=null,r({data:o})},o.onerror=()=>{o.onerror=o.onload=null,i.signal.aborted||n(new Error("Could not load image. Please make sure to use a supported image type such as PNG or JPEG. Note that SVGs are not supported."))},o.src=a}))}(p||(p={})),p.resetRequestQueue();class f{constructor(t){this._transformRequestFn=t}transformRequest(t,e){return this._transformRequestFn&&this._transformRequestFn(t,e)||{url:t}}setTransformRequest(t){this._transformRequestFn=t}}function m(t){var i=new e.A(3);return i[0]=t[0],i[1]=t[1],i[2]=t[2],i}var g,y=function(t,e,i){return t[0]=e[0]-i[0],t[1]=e[1]-i[1],t[2]=e[2]-i[2],t};g=new e.A(3),e.A!=Float32Array&&(g[0]=0,g[1]=0,g[2]=0);var _=function(t){var e=t[0],i=t[1];return e*e+i*i};function v(t){const e=[];if("string"==typeof t)e.push({id:"default",url:t});else if(t&&t.length>0){const i=[];for(const{id:r,url:n}of t){const t=`${r}${n}`;-1===i.indexOf(t)&&(i.push(t),e.push({id:r,url:n}))}}return e}function b(t,e,i){const r=t.split("?");return r[0]+=`${e}${i}`,r.join("?")}!function(){var t=new e.A(2);e.A!=Float32Array&&(t[0]=0,t[1]=0)}();class x{constructor(t,e,i,r){this.context=t,this.format=i,this.texture=t.gl.createTexture(),this.update(e,r)}update(t,i,r){const{width:n,height:o}=t,a=!(this.size&&this.size[0]===n&&this.size[1]===o||r),{context:s}=this,{gl:l}=s;if(this.useMipmap=Boolean(i&&i.useMipmap),l.bindTexture(l.TEXTURE_2D,this.texture),s.pixelStoreUnpackFlipY.set(!1),s.pixelStoreUnpack.set(1),s.pixelStoreUnpackPremultiplyAlpha.set(this.format===l.RGBA&&(!i||!1!==i.premultiply)),a)this.size=[n,o],t instanceof HTMLImageElement||t instanceof HTMLCanvasElement||t instanceof HTMLVideoElement||t instanceof ImageData||e.b(t)?l.texImage2D(l.TEXTURE_2D,0,this.format,this.format,l.UNSIGNED_BYTE,t):l.texImage2D(l.TEXTURE_2D,0,this.format,n,o,0,this.format,l.UNSIGNED_BYTE,t.data);else{const{x:i,y:a}=r||{x:0,y:0};t instanceof HTMLImageElement||t instanceof HTMLCanvasElement||t instanceof HTMLVideoElement||t instanceof ImageData||e.b(t)?l.texSubImage2D(l.TEXTURE_2D,0,i,a,l.RGBA,l.UNSIGNED_BYTE,t):l.texSubImage2D(l.TEXTURE_2D,0,i,a,n,o,l.RGBA,l.UNSIGNED_BYTE,t.data)}this.useMipmap&&this.isSizePowerOfTwo()&&l.generateMipmap(l.TEXTURE_2D)}bind(t,e,i){const{context:r}=this,{gl:n}=r;n.bindTexture(n.TEXTURE_2D,this.texture),i!==n.LINEAR_MIPMAP_NEAREST||this.isSizePowerOfTwo()||(i=n.LINEAR),t!==this.filter&&(n.texParameteri(n.TEXTURE_2D,n.TEXTURE_MAG_FILTER,t),n.texParameteri(n.TEXTURE_2D,n.TEXTURE_MIN_FILTER,i||t),this.filter=t),e!==this.wrap&&(n.texParameteri(n.TEXTURE_2D,n.TEXTURE_WRAP_S,e),n.texParameteri(n.TEXTURE_2D,n.TEXTURE_WRAP_T,e),this.wrap=e)}isSizePowerOfTwo(){return this.size[0]===this.size[1]&&Math.log(this.size[0])/Math.LN2%1==0}destroy(){const{gl:t}=this.context;t.deleteTexture(this.texture),this.texture=null}}function w(t){const{userImage:e}=t;return!!(e&&e.render&&e.render())&&(t.data.replace(new Uint8Array(e.data.buffer)),!0)}class k extends e.E{constructor(){super(),this.images={},this.updatedImages={},this.callbackDispatchedThisFrame={},this.loaded=!1,this.requestors=[],this.patterns={},this.atlasImage=new e.R({width:1,height:1}),this.dirty=!0}isLoaded(){return this.loaded}setLoaded(t){if(this.loaded!==t&&(this.loaded=t,t)){for(const{ids:t,promiseResolve:e}of this.requestors)e(this._getImagesForIds(t));this.requestors=[]}}getImage(t){const i=this.images[t];if(i&&!i.data&&i.spriteData){const t=i.spriteData;i.data=new e.R({width:t.width,height:t.height},t.context.getImageData(t.x,t.y,t.width,t.height).data),i.spriteData=null}return i}addImage(t,e){if(this.images[t])throw new Error(`Image id ${t} already exist, use updateImage instead`);this._validate(t,e)&&(this.images[t]=e)}_validate(t,i){let r=!0;const n=i.data||i.spriteData;return this._validateStretch(i.stretchX,n&&n.width)||(this.fire(new e.j(new Error(`Image "${t}" has invalid "stretchX" value`))),r=!1),this._validateStretch(i.stretchY,n&&n.height)||(this.fire(new e.j(new Error(`Image "${t}" has invalid "stretchY" value`))),r=!1),this._validateContent(i.content,i)||(this.fire(new e.j(new Error(`Image "${t}" has invalid "content" value`))),r=!1),r}_validateStretch(t,e){if(!t)return!0;let i=0;for(const r of t){if(r[0]<i||r[1]<r[0]||e<r[1])return!1;i=r[1]}return!0}_validateContent(t,e){if(!t)return!0;if(4!==t.length)return!1;const i=e.spriteData,r=i&&i.width||e.data.width,n=i&&i.height||e.data.height;return!(t[0]<0||r<t[0]||t[1]<0||n<t[1]||t[2]<0||r<t[2]||t[3]<0||n<t[3]||t[2]<t[0]||t[3]<t[1])}updateImage(t,e,i=!0){const r=this.getImage(t);if(i&&(r.data.width!==e.data.width||r.data.height!==e.data.height))throw new Error(`size mismatch between old image (${r.data.width}x${r.data.height}) and new image (${e.data.width}x${e.data.height}).`);e.version=r.version+1,this.images[t]=e,this.updatedImages[t]=!0}removeImage(t){const e=this.images[t];delete this.images[t],delete this.patterns[t],e.userImage&&e.userImage.onRemove&&e.userImage.onRemove()}listImages(){return Object.keys(this.images)}getImages(t){return new Promise(((e,i)=>{let r=!0;if(!this.isLoaded())for(const n of t)this.images[n]||(r=!1);this.isLoaded()||r?e(this._getImagesForIds(t)):this.requestors.push({ids:t,promiseResolve:e})}))}_getImagesForIds(t){const i={};for(const r of t){let t=this.getImage(r);t||(this.fire(new e.k("styleimagemissing",{id:r})),t=this.getImage(r)),t?i[r]={data:t.data.clone(),pixelRatio:t.pixelRatio,sdf:t.sdf,version:t.version,stretchX:t.stretchX,stretchY:t.stretchY,content:t.content,textFitWidth:t.textFitWidth,textFitHeight:t.textFitHeight,hasRenderCallback:Boolean(t.userImage&&t.userImage.render)}:e.w(`Image "${r}" could not be loaded. Please make sure you have added the image with map.addImage() or a "sprite" property in your style. You can provide missing images by listening for the "styleimagemissing" map event.`)}return i}getPixelSize(){const{width:t,height:e}=this.atlasImage;return{width:t,height:e}}getPattern(t){const i=this.patterns[t],r=this.getImage(t);if(!r)return null;if(i&&i.position.version===r.version)return i.position;if(i)i.position.version=r.version;else{const i={w:r.data.width+2,h:r.data.height+2,x:0,y:0},n=new e.I(i,r);this.patterns[t]={bin:i,position:n}}return this._updatePatternAtlas(),this.patterns[t].position}bind(t){const e=t.gl;this.atlasTexture?this.dirty&&(this.atlasTexture.update(this.atlasImage),this.dirty=!1):this.atlasTexture=new x(t,this.atlasImage,e.RGBA),this.atlasTexture.bind(e.LINEAR,e.CLAMP_TO_EDGE)}_updatePatternAtlas(){const t=[];for(const e in this.patterns)t.push(this.patterns[e].bin);const{w:i,h:r}=e.p(t),n=this.atlasImage;n.resize({width:i||1,height:r||1});for(const o in this.patterns){const{bin:t}=this.patterns[o],i=t.x+1,r=t.y+1,a=this.getImage(o).data,s=a.width,l=a.height;e.R.copy(a,n,{x:0,y:0},{x:i,y:r},{width:s,height:l}),e.R.copy(a,n,{x:0,y:l-1},{x:i,y:r-1},{width:s,height:1}),e.R.copy(a,n,{x:0,y:0},{x:i,y:r+l},{width:s,height:1}),e.R.copy(a,n,{x:s-1,y:0},{x:i-1,y:r},{width:1,height:l}),e.R.copy(a,n,{x:0,y:0},{x:i+s,y:r},{width:1,height:l})}this.dirty=!0}beginFrame(){this.callbackDispatchedThisFrame={}}dispatchRenderCallbacks(t){for(const i of t){if(this.callbackDispatchedThisFrame[i])continue;this.callbackDispatchedThisFrame[i]=!0;const t=this.getImage(i);t||e.w(`Image with ID: "${i}" was not found`),w(t)&&this.updateImage(i,t)}}}const E=1e20;function S(t,e,i,r,n,o,a,s,l){for(let c=e;c<e+r;c++)I(t,i*o+c,o,n,a,s,l);for(let c=i;c<i+n;c++)I(t,c*o+e,1,r,a,s,l)}function I(t,e,i,r,n,o,a){o[0]=0,a[0]=-1e20,a[1]=E,n[0]=t[e];for(let s=1,l=0,c=0;s<r;s++){n[s]=t[e+s*i];const r=s*s;do{const t=o[l];c=(n[s]-n[t]+r-t*t)/(s-t)/2}while(c<=a[l]&&--l>-1);l++,o[l]=s,a[l]=c,a[l+1]=E}for(let s=0,l=0;s<r;s++){for(;a[l+1]<s;)l++;const r=o[l],c=s-r;t[e+s*i]=n[r]+c*c}}class C{constructor(t,e){this.requestManager=t,this.localIdeographFontFamily=e,this.entries={}}setURL(t){this.url=t}getGlyphs(t){return e._(this,void 0,void 0,(function*(){const e=[];for(const n in t)for(const i of t[n])e.push(this._getAndCacheGlyphsPromise(n,i));const i=yield Promise.all(e),r={};for(const{stack:t,id:n,glyph:o}of i)r[t]||(r[t]={}),r[t][n]=o&&{id:o.id,bitmap:o.bitmap.clone(),metrics:o.metrics};return r}))}_getAndCacheGlyphsPromise(t,i){return e._(this,void 0,void 0,(function*(){let e=this.entries[t];e||(e=this.entries[t]={glyphs:{},requests:{},ranges:{}});let r=e.glyphs[i];if(void 0!==r)return{stack:t,id:i,glyph:r};if(r=this._tinySDF(e,t,i),r)return e.glyphs[i]=r,{stack:t,id:i,glyph:r};const n=Math.floor(i/256);if(256*n>65535)throw new Error("glyphs > 65535 not supported");if(e.ranges[n])return{stack:t,id:i,glyph:r};if(!this.url)throw new Error("glyphsUrl is not set");if(!e.requests[n]){const i=C.loadGlyphRange(t,n,this.url,this.requestManager);e.requests[n]=i}const o=yield e.requests[n];for(const t in o)this._doesCharSupportLocalGlyph(+t)||(e.glyphs[+t]=o[+t]);return e.ranges[n]=!0,{stack:t,id:i,glyph:o[i]||null}}))}_doesCharSupportLocalGlyph(t){return!!this.localIdeographFontFamily&&/\p{Ideo}|\p{sc=Hang}|\p{sc=Hira}|\p{sc=Kana}/u.test(String.fromCodePoint(t))}_tinySDF(t,i,r){const n=this.localIdeographFontFamily;if(!n)return;if(!this._doesCharSupportLocalGlyph(r))return;let o=t.tinySDF;if(!o){let e="400";/bold/i.test(i)?e="900":/medium/i.test(i)?e="500":/light/i.test(i)&&(e="200"),o=t.tinySDF=new C.TinySDF({fontSize:48,buffer:6,radius:16,cutoff:.25,fontFamily:n,fontWeight:e})}const a=o.draw(String.fromCharCode(r));return{id:r,bitmap:new e.o({width:a.width||60,height:a.height||60},a.data),metrics:{width:a.glyphWidth/2||24,height:a.glyphHeight/2||24,left:a.glyphLeft/2+.5||0,top:a.glyphTop/2-27.5||-8,advance:a.glyphAdvance/2||24,isDoubleResolution:!0}}}}C.loadGlyphRange=function(t,i,r,n){return e._(this,void 0,void 0,(function*(){const o=256*i,a=o+255,s=n.transformRequest(r.replace("{fontstack}",t).replace("{range}",`${o}-${a}`),"Glyphs"),l=yield e.l(s,new AbortController);if(!l||!l.data)throw new Error(`Could not load glyph range. range: ${i}, ${o}-${a}`);const c={};for(const t of e.n(l.data))c[t.id]=t;return c}))},C.TinySDF=class{constructor({fontSize:t=24,buffer:e=3,radius:i=8,cutoff:r=.25,fontFamily:n="sans-serif",fontWeight:o="normal",fontStyle:a="normal"}={}){this.buffer=e,this.cutoff=r,this.radius=i;const s=this.size=t+4*e,l=this._createCanvas(s),c=this.ctx=l.getContext("2d",{willReadFrequently:!0});c.font=`${a} ${o} ${t}px ${n}`,c.textBaseline="alphabetic",c.textAlign="left",c.fillStyle="black",this.gridOuter=new Float64Array(s*s),this.gridInner=new Float64Array(s*s),this.f=new Float64Array(s),this.z=new Float64Array(s+1),this.v=new Uint16Array(s)}_createCanvas(t){const e=document.createElement("canvas");return e.width=e.height=t,e}draw(t){const{width:e,actualBoundingBoxAscent:i,actualBoundingBoxDescent:r,actualBoundingBoxLeft:n,actualBoundingBoxRight:o}=this.ctx.measureText(t),a=Math.ceil(i),s=Math.max(0,Math.min(this.size-this.buffer,Math.ceil(o-n))),l=Math.min(this.size-this.buffer,a+Math.ceil(r)),c=s+2*this.buffer,u=l+2*this.buffer,h=Math.max(c*u,0),d=new Uint8ClampedArray(h),p={data:d,width:c,height:u,glyphWidth:s,glyphHeight:l,glyphTop:a,glyphLeft:0,glyphAdvance:e};if(0===s||0===l)return p;const{ctx:f,buffer:m,gridInner:g,gridOuter:y}=this;f.clearRect(m,m,s,l),f.fillText(t,m,m+a);const _=f.getImageData(m,m,s,l);y.fill(E,0,h),g.fill(0,0,h);for(let v=0;v<l;v++)for(let t=0;t<s;t++){const e=_.data[4*(v*s+t)+3]/255;if(0===e)continue;const i=(v+m)*c+t+m;if(1===e)y[i]=0,g[i]=E;else{const t=.5-e;y[i]=t>0?t*t:0,g[i]=t<0?t*t:0}}S(y,0,0,c,u,c,this.f,this.v,this.z),S(g,m,m,s,l,c,this.f,this.v,this.z);for(let v=0;v<h;v++){const t=Math.sqrt(y[v])-Math.sqrt(g[v]);d[v]=Math.round(255-255*(t/this.radius+this.cutoff))}return p}};class T{constructor(){this.specification=e.v.light.position}possiblyEvaluate(t,i){return e.x(t.expression.evaluate(i))}interpolate(t,i,r){return{x:e.y.number(t.x,i.x,r),y:e.y.number(t.y,i.y,r),z:e.y.number(t.z,i.z,r)}}}let A;class P extends e.E{constructor(t){super(),A=A||new e.q({anchor:new e.D(e.v.light.anchor),position:new T,color:new e.D(e.v.light.color),intensity:new e.D(e.v.light.intensity)}),this._transitionable=new e.T(A),this.setLight(t),this._transitioning=this._transitionable.untransitioned()}getLight(){return this._transitionable.serialize()}setLight(t,i={}){if(!this._validate(e.r,t,i))for(const e in t){const i=t[e];e.endsWith("-transition")?this._transitionable.setTransition(e.slice(0,-11),i):this._transitionable.setValue(e,i)}}updateTransitions(t){this._transitioning=this._transitionable.transitioned(t,this._transitioning)}hasTransition(){return this._transitioning.hasTransition()}recalculate(t){this.properties=this._transitioning.possiblyEvaluate(t)}_validate(t,i,r){return(!r||!1!==r.validate)&&e.t(this,t.call(e.u,{value:i,style:{glyphs:!0,sprite:!0},styleSpec:e.v}))}}const M=new e.q({"sky-color":new e.D(e.v.sky["sky-color"]),"horizon-color":new e.D(e.v.sky["horizon-color"]),"fog-color":new e.D(e.v.sky["fog-color"]),"fog-ground-blend":new e.D(e.v.sky["fog-ground-blend"]),"horizon-fog-blend":new e.D(e.v.sky["horizon-fog-blend"]),"sky-horizon-blend":new e.D(e.v.sky["sky-horizon-blend"]),"atmosphere-blend":new e.D(e.v.sky["atmosphere-blend"])});class L extends e.E{constructor(t){super(),this._transitionable=new e.T(M),this.setSky(t),this._transitioning=this._transitionable.untransitioned(),this.recalculate(new e.z(0))}setSky(t,i={}){if(!this._validate(e.B,t,i)){t||(t={"sky-color":"transparent","horizon-color":"transparent","fog-color":"transparent","fog-ground-blend":1,"atmosphere-blend":0});for(const e in t){const i=t[e];e.endsWith("-transition")?this._transitionable.setTransition(e.slice(0,-11),i):this._transitionable.setValue(e,i)}}}getSky(){return this._transitionable.serialize()}updateTransitions(t){this._transitioning=this._transitionable.transitioned(t,this._transitioning)}hasTransition(){return this._transitioning.hasTransition()}recalculate(t){this.properties=this._transitioning.possiblyEvaluate(t)}_validate(t,i,r={}){return!1!==(null==r?void 0:r.validate)&&e.t(this,t.call(e.u,e.e({value:i,style:{glyphs:!0,sprite:!0},styleSpec:e.v})))}calculateFogBlendOpacity(t){return t<60?0:t<70?(t-60)/10:1}}class z{constructor(t,e){this.width=t,this.height=e,this.nextRow=0,this.data=new Uint8Array(this.width*this.height),this.dashEntry={}}getDash(t,e){const i=t.join(",")+String(e);return this.dashEntry[i]||(this.dashEntry[i]=this.addDash(t,e)),this.dashEntry[i]}getDashRanges(t,e,i){const r=[];let n=t.length%2==1?-t[t.length-1]*i:0,o=t[0]*i,a=!0;r.push({left:n,right:o,isDash:a,zeroLength:0===t[0]});let s=t[0];for(let l=1;l<t.length;l++){a=!a;const e=t[l];n=s*i,s+=e,o=s*i,r.push({left:n,right:o,isDash:a,zeroLength:0===e})}return r}addRoundDash(t,e,i){const r=e/2;for(let n=-i;n<=i;n++){const e=this.width*(this.nextRow+i+n);let o=0,a=t[o];for(let s=0;s<this.width;s++){s/a.right>1&&(a=t[++o]);const l=Math.abs(s-a.left),c=Math.abs(s-a.right),u=Math.min(l,c);let h;const d=n/i*(r+1);if(a.isDash){const t=r-Math.abs(d);h=Math.sqrt(u*u+t*t)}else h=r-Math.sqrt(u*u+d*d);this.data[e+s]=Math.max(0,Math.min(255,h+128))}}}addRegularDash(t){for(let a=t.length-1;a>=0;--a){const e=t[a],i=t[a+1];e.zeroLength?t.splice(a,1):i&&i.isDash===e.isDash&&(i.left=e.left,t.splice(a,1))}const e=t[0],i=t[t.length-1];e.isDash===i.isDash&&(e.left=i.left-this.width,i.right=e.right+this.width);const r=this.width*this.nextRow;let n=0,o=t[n];for(let a=0;a<this.width;a++){a/o.right>1&&(o=t[++n]);const e=Math.abs(a-o.left),i=Math.abs(a-o.right),s=Math.min(e,i);this.data[r+a]=Math.max(0,Math.min(255,(o.isDash?s:-s)+128))}}addDash(t,i){const r=i?7:0,n=2*r+1;if(this.nextRow+n>this.height)return e.w("LineAtlas out of space"),null;let o=0;for(let e=0;e<t.length;e++)o+=t[e];if(0!==o){const e=this.width/o,n=this.getDashRanges(t,this.width,e);i?this.addRoundDash(n,e,r):this.addRegularDash(n)}const a={y:(this.nextRow+r+.5)/this.height,height:2*r/this.height,width:o};return this.nextRow+=n,this.dirty=!0,a}bind(t){const e=t.gl;this.texture?(e.bindTexture(e.TEXTURE_2D,this.texture),this.dirty&&(this.dirty=!1,e.texSubImage2D(e.TEXTURE_2D,0,0,0,this.width,this.height,e.ALPHA,e.UNSIGNED_BYTE,this.data))):(this.texture=e.createTexture(),e.bindTexture(e.TEXTURE_2D,this.texture),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_S,e.REPEAT),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_T,e.REPEAT),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MIN_FILTER,e.LINEAR),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MAG_FILTER,e.LINEAR),e.texImage2D(e.TEXTURE_2D,0,e.ALPHA,this.width,this.height,0,e.ALPHA,e.UNSIGNED_BYTE,this.data))}}const D="maplibre_preloaded_worker_pool";class R{constructor(){this.active={}}acquire(t){if(!this.workers)for(this.workers=[];this.workers.length<R.workerCount;)this.workers.push(new Worker(e.a.WORKER_URL));return this.active[t]=!0,this.workers.slice()}release(t){delete this.active[t],0===this.numActive()&&(this.workers.forEach((t=>{t.terminate()})),this.workers=null)}isPreloaded(){return!!this.active[D]}numActive(){return Object.keys(this.active).length}}const O=Math.floor(o.hardwareConcurrency/2);let F,B;function N(){return F||(F=new R),F}R.workerCount=e.C(globalThis)?Math.max(Math.min(O,3),1):1;class j{constructor(t,i){this.workerPool=t,this.actors=[],this.currentActor=0,this.id=i;const r=this.workerPool.acquire(i);for(let n=0;n<r.length;n++){const t=new e.F(r[n],i);t.name=`Worker ${n}`,this.actors.push(t)}if(!this.actors.length)throw new Error("No actors found")}broadcast(t,e){const i=[];for(const r of this.actors)i.push(r.sendAsync({type:t,data:e}));return Promise.all(i)}getActor(){return this.currentActor=(this.currentActor+1)%this.actors.length,this.actors[this.currentActor]}remove(t=!0){this.actors.forEach((t=>{t.remove()})),this.actors=[],t&&this.workerPool.release(this.id)}registerMessageHandler(t,e){for(const i of this.actors)i.registerMessageHandler(t,e)}}function V(){return B||(B=new j(N(),e.G),B.registerMessageHandler("GR",((t,i,r)=>e.m(i,r)))),B}function U(t,i){const r=e.H();return e.J(r,r,[1,1,0]),e.K(r,r,[.5*t.width,.5*t.height,1]),e.L(r,r,t.calculatePosMatrix(i.toUnwrapped()))}function q(t,e,i,r,n,o){const a=function(t,e,i){if(t)for(const r of t){const t=e[r];if(t&&t.source===i&&"fill-extrusion"===t.type)return!0}else for(const r in e){const t=e[r];if(t.source===i&&"fill-extrusion"===t.type)return!0}return!1}(n&&n.layers,e,t.id),s=o.maxPitchScaleFactor(),l=t.tilesIn(r,s,a);l.sort($);const c=[];for(const h of l)c.push({wrappedTileID:h.tileID.wrapped().key,queryResults:h.tile.queryRenderedFeatures(e,i,t._state,h.queryGeometry,h.cameraQueryGeometry,h.scale,n,o,s,U(t.transform,h.tileID))});const u=function(t){const e={},i={};for(const r of t){const t=r.queryResults,n=r.wrappedTileID,o=i[n]=i[n]||{};for(const i in t){const r=t[i],n=o[i]=o[i]||{},a=e[i]=e[i]||[];for(const t of r)n[t.featureIndex]||(n[t.featureIndex]=!0,a.push(t))}}return e}(c);for(const h in u)u[h].forEach((e=>{const i=e.feature,r=t.getFeatureState(i.layer["source-layer"],i.id);i.source=i.layer.source,i.layer["source-layer"]&&(i.sourceLayer=i.layer["source-layer"]),i.state=r}));return u}function $(t,e){const i=t.tileID,r=e.tileID;return i.overscaledZ-r.overscaledZ||i.canonical.y-r.canonical.y||i.wrap-r.wrap||i.canonical.x-r.canonical.x}function G(t,i,r){return e._(this,void 0,void 0,(function*(){let n=t;if(t.url?n=(yield e.h(i.transformRequest(t.url,"Source"),r)).data:yield o.frameAsync(r),!n)return null;const a=e.M(e.e(n,t),["tiles","minzoom","maxzoom","attribution","bounds","scheme","tileSize","encoding"]);return"vector_layers"in n&&n.vector_layers&&(a.vectorLayerIds=n.vector_layers.map((t=>t.id))),a}))}class H{constructor(t,e){t&&(e?this.setSouthWest(t).setNorthEast(e):Array.isArray(t)&&(4===t.length?this.setSouthWest([t[0],t[1]]).setNorthEast([t[2],t[3]]):this.setSouthWest(t[0]).setNorthEast(t[1])))}setNorthEast(t){return this._ne=t instanceof e.N?new e.N(t.lng,t.lat):e.N.convert(t),this}setSouthWest(t){return this._sw=t instanceof e.N?new e.N(t.lng,t.lat):e.N.convert(t),this}extend(t){const i=this._sw,r=this._ne;let n,o;if(t instanceof e.N)n=t,o=t;else{if(!(t instanceof H))return Array.isArray(t)?4===t.length||t.every(Array.isArray)?this.extend(H.convert(t)):this.extend(e.N.convert(t)):t&&("lng"in t||"lon"in t)&&"lat"in t?this.extend(e.N.convert(t)):this;if(n=t._sw,o=t._ne,!n||!o)return this}return i||r?(i.lng=Math.min(n.lng,i.lng),i.lat=Math.min(n.lat,i.lat),r.lng=Math.max(o.lng,r.lng),r.lat=Math.max(o.lat,r.lat)):(this._sw=new e.N(n.lng,n.lat),this._ne=new e.N(o.lng,o.lat)),this}getCenter(){return new e.N((this._sw.lng+this._ne.lng)/2,(this._sw.lat+this._ne.lat)/2)}getSouthWest(){return this._sw}getNorthEast(){return this._ne}getNorthWest(){return new e.N(this.getWest(),this.getNorth())}getSouthEast(){return new e.N(this.getEast(),this.getSouth())}getWest(){return this._sw.lng}getSouth(){return this._sw.lat}getEast(){return this._ne.lng}getNorth(){return this._ne.lat}toArray(){return[this._sw.toArray(),this._ne.toArray()]}toString(){return`LngLatBounds(${this._sw.toString()}, ${this._ne.toString()})`}isEmpty(){return!(this._sw&&this._ne)}contains(t){const{lng:i,lat:r}=e.N.convert(t);let n=this._sw.lng<=i&&i<=this._ne.lng;return this._sw.lng>this._ne.lng&&(n=this._sw.lng>=i&&i>=this._ne.lng),this._sw.lat<=r&&r<=this._ne.lat&&n}static convert(t){return t instanceof H?t:t?new H(t):t}static fromLngLat(t,i=0){const r=360*i/40075017,n=r/Math.cos(Math.PI/180*t.lat);return new H(new e.N(t.lng-n,t.lat-r),new e.N(t.lng+n,t.lat+r))}adjustAntiMeridian(){const t=new e.N(this._sw.lng,this._sw.lat),i=new e.N(this._ne.lng,this._ne.lat);return new H(t,t.lng>i.lng?new e.N(i.lng+360,i.lat):i)}}class Z{constructor(t,e,i){this.bounds=H.convert(this.validateBounds(t)),this.minzoom=e||0,this.maxzoom=i||24}validateBounds(t){return Array.isArray(t)&&4===t.length?[Math.max(-180,t[0]),Math.max(-90,t[1]),Math.min(180,t[2]),Math.min(90,t[3])]:[-180,-90,180,90]}contains(t){const i=Math.pow(2,t.z),r=Math.floor(e.O(this.bounds.getWest())*i),n=Math.floor(e.Q(this.bounds.getNorth())*i),o=Math.ceil(e.O(this.bounds.getEast())*i),a=Math.ceil(e.Q(this.bounds.getSouth())*i);return t.x>=r&&t.x<o&&t.y>=n&&t.y<a}}class W extends e.E{constructor(t,i,r,n){if(super(),this.id=t,this.dispatcher=r,this.type="vector",this.minzoom=0,this.maxzoom=22,this.scheme="xyz",this.tileSize=512,this.reparseOverscaled=!0,this.isTileClipped=!0,this._loaded=!1,e.e(this,e.M(i,["url","scheme","tileSize","promoteId"])),this._options=e.e({type:"vector"},i),this._collectResourceTiming=i.collectResourceTiming,512!==this.tileSize)throw new Error("vector tile sources must have a tileSize of 512");this.setEventedParent(n)}load(){return e._(this,void 0,void 0,(function*(){this._loaded=!1,this.fire(new e.k("dataloading",{dataType:"source"})),this._tileJSONRequest=new AbortController;try{const t=yield G(this._options,this.map._requestManager,this._tileJSONRequest);this._tileJSONRequest=null,this._loaded=!0,this.map.style.sourceCaches[this.id].clearTiles(),t&&(e.e(this,t),t.bounds&&(this.tileBounds=new Z(t.bounds,this.minzoom,this.maxzoom)),this.fire(new e.k("data",{dataType:"source",sourceDataType:"metadata"})),this.fire(new e.k("data",{dataType:"source",sourceDataType:"content"})))}catch(t){this._tileJSONRequest=null,this.fire(new e.j(t))}}))}loaded(){return this._loaded}hasTile(t){return!this.tileBounds||this.tileBounds.contains(t.canonical)}onAdd(t){this.map=t,this.load()}setSourceProperty(t){this._tileJSONRequest&&this._tileJSONRequest.abort(),t(),this.load()}setTiles(t){return this.setSourceProperty((()=>{this._options.tiles=t})),this}setUrl(t){return this.setSourceProperty((()=>{this.url=t,this._options.url=t})),this}onRemove(){this._tileJSONRequest&&(this._tileJSONRequest.abort(),this._tileJSONRequest=null)}serialize(){return e.e({},this._options)}loadTile(t){return e._(this,void 0,void 0,(function*(){const e=t.tileID.canonical.url(this.tiles,this.map.getPixelRatio(),this.scheme),i={request:this.map._requestManager.transformRequest(e,"Tile"),uid:t.uid,tileID:t.tileID,zoom:t.tileID.overscaledZ,tileSize:this.tileSize*t.tileID.overscaleFactor(),type:this.type,source:this.id,pixelRatio:this.map.getPixelRatio(),showCollisionBoxes:this.map.showCollisionBoxes,promoteId:this.promoteId};i.request.collectResourceTiming=this._collectResourceTiming;let r="RT";if(t.actor&&"expired"!==t.state){if("loading"===t.state)return new Promise(((e,i)=>{t.reloadPromise={resolve:e,reject:i}}))}else t.actor=this.dispatcher.getActor(),r="LT";t.abortController=new AbortController;try{const e=yield t.actor.sendAsync({type:r,data:i},t.abortController);if(delete t.abortController,t.aborted)return;this._afterTileLoadWorkerResponse(t,e)}catch(e){if(delete t.abortController,t.aborted)return;if(e&&404!==e.status)throw e;this._afterTileLoadWorkerResponse(t,null)}}))}_afterTileLoadWorkerResponse(t,e){if(e&&e.resourceTiming&&(t.resourceTiming=e.resourceTiming),e&&this.map._refreshExpiredTiles&&t.setExpiryData(e),t.loadVectorData(e,this.map.painter),t.reloadPromise){const e=t.reloadPromise;t.reloadPromise=null,this.loadTile(t).then(e.resolve).catch(e.reject)}}abortTile(t){return e._(this,void 0,void 0,(function*(){t.abortController&&(t.abortController.abort(),delete t.abortController),t.actor&&(yield t.actor.sendAsync({type:"AT",data:{uid:t.uid,type:this.type,source:this.id}}))}))}unloadTile(t){return e._(this,void 0,void 0,(function*(){t.unloadVectorData(),t.actor&&(yield t.actor.sendAsync({type:"RMT",data:{uid:t.uid,type:this.type,source:this.id}}))}))}hasTransition(){return!1}}class X extends e.E{constructor(t,i,r,n){super(),this.id=t,this.dispatcher=r,this.setEventedParent(n),this.type="raster",this.minzoom=0,this.maxzoom=22,this.roundZoom=!0,this.scheme="xyz",this.tileSize=512,this._loaded=!1,this._options=e.e({type:"raster"},i),e.e(this,e.M(i,["url","scheme","tileSize"]))}load(){return e._(this,void 0,void 0,(function*(){this._loaded=!1,this.fire(new e.k("dataloading",{dataType:"source"})),this._tileJSONRequest=new AbortController;try{const t=yield G(this._options,this.map._requestManager,this._tileJSONRequest);this._tileJSONRequest=null,this._loaded=!0,t&&(e.e(this,t),t.bounds&&(this.tileBounds=new Z(t.bounds,this.minzoom,this.maxzoom)),this.fire(new e.k("data",{dataType:"source",sourceDataType:"metadata"})),this.fire(new e.k("data",{dataType:"source",sourceDataType:"content"})))}catch(t){this._tileJSONRequest=null,this.fire(new e.j(t))}}))}loaded(){return this._loaded}onAdd(t){this.map=t,this.load()}onRemove(){this._tileJSONRequest&&(this._tileJSONRequest.abort(),this._tileJSONRequest=null)}setSourceProperty(t){this._tileJSONRequest&&(this._tileJSONRequest.abort(),this._tileJSONRequest=null),t(),this.load()}setTiles(t){return this.setSourceProperty((()=>{this._options.tiles=t})),this}setUrl(t){return this.setSourceProperty((()=>{this.url=t,this._options.url=t})),this}serialize(){return e.e({},this._options)}hasTile(t){return!this.tileBounds||this.tileBounds.contains(t.canonical)}loadTile(t){return e._(this,void 0,void 0,(function*(){const e=t.tileID.canonical.url(this.tiles,this.map.getPixelRatio(),this.scheme);t.abortController=new AbortController;try{const i=yield p.getImage(this.map._requestManager.transformRequest(e,"Tile"),t.abortController,this.map._refreshExpiredTiles);if(delete t.abortController,t.aborted)return void(t.state="unloaded");if(i&&i.data){this.map._refreshExpiredTiles&&i.cacheControl&&i.expires&&t.setExpiryData({cacheControl:i.cacheControl,expires:i.expires});const e=this.map.painter.context,r=e.gl,n=i.data;t.texture=this.map.painter.getTileTexture(n.width),t.texture?t.texture.update(n,{useMipmap:!0}):(t.texture=new x(e,n,r.RGBA,{useMipmap:!0}),t.texture.bind(r.LINEAR,r.CLAMP_TO_EDGE,r.LINEAR_MIPMAP_NEAREST)),t.state="loaded"}}catch(e){if(delete t.abortController,t.aborted)t.state="unloaded";else if(e)throw t.state="errored",e}}))}abortTile(t){return e._(this,void 0,void 0,(function*(){t.abortController&&(t.abortController.abort(),delete t.abortController)}))}unloadTile(t){return e._(this,void 0,void 0,(function*(){t.texture&&this.map.painter.saveTileTexture(t.texture)}))}hasTransition(){return!1}}class J extends X{constructor(t,i,r,n){super(t,i,r,n),this.type="raster-dem",this.maxzoom=22,this._options=e.e({type:"raster-dem"},i),this.encoding=i.encoding||"mapbox",this.redFactor=i.redFactor,this.greenFactor=i.greenFactor,this.blueFactor=i.blueFactor,this.baseShift=i.baseShift}loadTile(t){return e._(this,void 0,void 0,(function*(){const i=t.tileID.canonical.url(this.tiles,this.map.getPixelRatio(),this.scheme),r=this.map._requestManager.transformRequest(i,"Tile");t.neighboringTiles=this._getNeighboringTiles(t.tileID),t.abortController=new AbortController;try{const i=yield p.getImage(r,t.abortController,this.map._refreshExpiredTiles);if(delete t.abortController,t.aborted)return void(t.state="unloaded");if(i&&i.data){const r=i.data;this.map._refreshExpiredTiles&&i.cacheControl&&i.expires&&t.setExpiryData({cacheControl:i.cacheControl,expires:i.expires});const n=e.b(r)&&e.U()?r:yield this.readImageNow(r),o={type:this.type,uid:t.uid,source:this.id,rawImageData:n,encoding:this.encoding,redFactor:this.redFactor,greenFactor:this.greenFactor,blueFactor:this.blueFactor,baseShift:this.baseShift};if(!t.actor||"expired"===t.state){t.actor=this.dispatcher.getActor();const e=yield t.actor.sendAsync({type:"LDT",data:o});t.dem=e,t.needsHillshadePrepare=!0,t.needsTerrainPrepare=!0,t.state="loaded"}}}catch(e){if(delete t.abortController,t.aborted)t.state="unloaded";else if(e)throw t.state="errored",e}}))}readImageNow(t){return e._(this,void 0,void 0,(function*(){if("undefined"!=typeof VideoFrame&&e.V()){const i=t.width+2,r=t.height+2;try{return new e.R({width:i,height:r},yield e.W(t,-1,-1,i,r))}catch(t){}}return o.getImageData(t,1)}))}_getNeighboringTiles(t){const i=t.canonical,r=Math.pow(2,i.z),n=(i.x-1+r)%r,o=0===i.x?t.wrap-1:t.wrap,a=(i.x+1+r)%r,s=i.x+1===r?t.wrap+1:t.wrap,l={};return l[new e.S(t.overscaledZ,o,i.z,n,i.y).key]={backfilled:!1},l[new e.S(t.overscaledZ,s,i.z,a,i.y).key]={backfilled:!1},i.y>0&&(l[new e.S(t.overscaledZ,o,i.z,n,i.y-1).key]={backfilled:!1},l[new e.S(t.overscaledZ,t.wrap,i.z,i.x,i.y-1).key]={backfilled:!1},l[new e.S(t.overscaledZ,s,i.z,a,i.y-1).key]={backfilled:!1}),i.y+1<r&&(l[new e.S(t.overscaledZ,o,i.z,n,i.y+1).key]={backfilled:!1},l[new e.S(t.overscaledZ,t.wrap,i.z,i.x,i.y+1).key]={backfilled:!1},l[new e.S(t.overscaledZ,s,i.z,a,i.y+1).key]={backfilled:!1}),l}unloadTile(t){return e._(this,void 0,void 0,(function*(){t.demTexture&&this.map.painter.saveTileTexture(t.demTexture),t.fbo&&(t.fbo.destroy(),delete t.fbo),t.dem&&delete t.dem,delete t.neighboringTiles,t.state="unloaded",t.actor&&(yield t.actor.sendAsync({type:"RDT",data:{type:this.type,uid:t.uid,source:this.id}}))}))}}class K extends e.E{constructor(t,i,r,n){super(),this.id=t,this.type="geojson",this.minzoom=0,this.maxzoom=18,this.tileSize=512,this.isTileClipped=!0,this.reparseOverscaled=!0,this._removed=!1,this._pendingLoads=0,this.actor=r.getActor(),this.setEventedParent(n),this._data=i.data,this._options=e.e({},i),this._collectResourceTiming=i.collectResourceTiming,void 0!==i.maxzoom&&(this.maxzoom=i.maxzoom),i.type&&(this.type=i.type),i.attribution&&(this.attribution=i.attribution),this.promoteId=i.promoteId;const o=e.X/this.tileSize;void 0!==i.clusterMaxZoom&&this.maxzoom<=i.clusterMaxZoom&&e.w(`The maxzoom value "${this.maxzoom}" is expected to be greater than the clusterMaxZoom value "${i.clusterMaxZoom}".`),this.workerOptions=e.e({source:this.id,cluster:i.cluster||!1,geojsonVtOptions:{buffer:(void 0!==i.buffer?i.buffer:128)*o,tolerance:(void 0!==i.tolerance?i.tolerance:.375)*o,extent:e.X,maxZoom:this.maxzoom,lineMetrics:i.lineMetrics||!1,generateId:i.generateId||!1},superclusterOptions:{maxZoom:void 0!==i.clusterMaxZoom?i.clusterMaxZoom:this.maxzoom-1,minPoints:Math.max(2,i.clusterMinPoints||2),extent:e.X,radius:(i.clusterRadius||50)*o,log:!1,generateId:i.generateId||!1},clusterProperties:i.clusterProperties,filter:i.filter},i.workerOptions),"string"==typeof this.promoteId&&(this.workerOptions.promoteId=this.promoteId)}load(){return e._(this,void 0,void 0,(function*(){yield this._updateWorkerData()}))}onAdd(t){this.map=t,this.load()}setData(t){return this._data=t,this._updateWorkerData(),this}updateData(t){return this._updateWorkerData(t),this}getData(){return e._(this,void 0,void 0,(function*(){const t=e.e({type:this.type},this.workerOptions);return this.actor.sendAsync({type:"GD",data:t})}))}setClusterOptions(t){return this.workerOptions.cluster=t.cluster,t&&(void 0!==t.clusterRadius&&(this.workerOptions.superclusterOptions.radius=t.clusterRadius),void 0!==t.clusterMaxZoom&&(this.workerOptions.superclusterOptions.maxZoom=t.clusterMaxZoom)),this._updateWorkerData(),this}getClusterExpansionZoom(t){return this.actor.sendAsync({type:"GCEZ",data:{type:this.type,clusterId:t,source:this.id}})}getClusterChildren(t){return this.actor.sendAsync({type:"GCC",data:{type:this.type,clusterId:t,source:this.id}})}getClusterLeaves(t,e,i){return this.actor.sendAsync({type:"GCL",data:{type:this.type,source:this.id,clusterId:t,limit:e,offset:i}})}_updateWorkerData(t){return e._(this,void 0,void 0,(function*(){const i=e.e({type:this.type},this.workerOptions);t?i.dataDiff=t:"string"==typeof this._data?(i.request=this.map._requestManager.transformRequest(o.resolveURL(this._data),"Source"),i.request.collectResourceTiming=this._collectResourceTiming):i.data=JSON.stringify(this._data),this._pendingLoads++,this.fire(new e.k("dataloading",{dataType:"source"}));try{const t=yield this.actor.sendAsync({type:"LD",data:i});if(this._pendingLoads--,this._removed||t.abandoned)return void this.fire(new e.k("dataabort",{dataType:"source"}));let r=null;t.resourceTiming&&t.resourceTiming[this.id]&&(r=t.resourceTiming[this.id].slice(0));const n={dataType:"source"};this._collectResourceTiming&&r&&r.length>0&&e.e(n,{resourceTiming:r}),this.fire(new e.k("data",Object.assign(Object.assign({},n),{sourceDataType:"metadata"}))),this.fire(new e.k("data",Object.assign(Object.assign({},n),{sourceDataType:"content"})))}catch(t){if(this._pendingLoads--,this._removed)return void this.fire(new e.k("dataabort",{dataType:"source"}));this.fire(new e.j(t))}}))}loaded(){return 0===this._pendingLoads}loadTile(t){return e._(this,void 0,void 0,(function*(){const e=t.actor?"RT":"LT";t.actor=this.actor;const i={type:this.type,uid:t.uid,tileID:t.tileID,zoom:t.tileID.overscaledZ,maxZoom:this.maxzoom,tileSize:this.tileSize,source:this.id,pixelRatio:this.map.getPixelRatio(),showCollisionBoxes:this.map.showCollisionBoxes,promoteId:this.promoteId};t.abortController=new AbortController;const r=yield this.actor.sendAsync({type:e,data:i},t.abortController);delete t.abortController,t.unloadVectorData(),t.aborted||t.loadVectorData(r,this.map.painter,"RT"===e)}))}abortTile(t){return e._(this,void 0,void 0,(function*(){t.abortController&&(t.abortController.abort(),delete t.abortController),t.aborted=!0}))}unloadTile(t){return e._(this,void 0,void 0,(function*(){t.unloadVectorData(),yield this.actor.sendAsync({type:"RMT",data:{uid:t.uid,type:this.type,source:this.id}})}))}onRemove(){this._removed=!0,this.actor.sendAsync({type:"RS",data:{type:this.type,source:this.id}})}serialize(){return e.e({},this._options,{type:this.type,data:this._data})}hasTransition(){return!1}}var Y=e.Y([{name:"a_pos",type:"Int16",components:2},{name:"a_texture_pos",type:"Int16",components:2}]);class Q extends e.E{constructor(t,e,i,r){super(),this.id=t,this.dispatcher=i,this.coordinates=e.coordinates,this.type="image",this.minzoom=0,this.maxzoom=22,this.tileSize=512,this.tiles={},this._loaded=!1,this.setEventedParent(r),this.options=e}load(t){return e._(this,void 0,void 0,(function*(){this._loaded=!1,this.fire(new e.k("dataloading",{dataType:"source"})),this.url=this.options.url,this._request=new AbortController;try{const e=yield p.getImage(this.map._requestManager.transformRequest(this.url,"Image"),this._request);this._request=null,this._loaded=!0,e&&e.data&&(this.image=e.data,t&&(this.coordinates=t),this._finishLoading())}catch(t){this._request=null,this._loaded=!0,this.fire(new e.j(t))}}))}loaded(){return this._loaded}updateImage(t){return t.url?(this._request&&(this._request.abort(),this._request=null),this.options.url=t.url,this.load(t.coordinates).finally((()=>{this.texture=null})),this):this}_finishLoading(){this.map&&(this.setCoordinates(this.coordinates),this.fire(new e.k("data",{dataType:"source",sourceDataType:"metadata"})))}onAdd(t){this.map=t,this.load()}onRemove(){this._request&&(this._request.abort(),this._request=null)}setCoordinates(t){this.coordinates=t;const i=t.map(e.Z.fromLngLat);this.tileID=function(t){let i=1/0,r=1/0,n=-1/0,o=-1/0;for(const e of t)i=Math.min(i,e.x),r=Math.min(r,e.y),n=Math.max(n,e.x),o=Math.max(o,e.y);const a=Math.max(n-i,o-r),s=Math.max(0,Math.floor(-Math.log(a)/Math.LN2)),l=Math.pow(2,s);return new e.a1(s,Math.floor((i+n)/2*l),Math.floor((r+o)/2*l))}(i),this.minzoom=this.maxzoom=this.tileID.z;const r=i.map((t=>this.tileID.getTilePoint(t)._round()));return this._boundsArray=new e.$,this._boundsArray.emplaceBack(r[0].x,r[0].y,0,0),this._boundsArray.emplaceBack(r[1].x,r[1].y,e.X,0),this._boundsArray.emplaceBack(r[3].x,r[3].y,0,e.X),this._boundsArray.emplaceBack(r[2].x,r[2].y,e.X,e.X),this.boundsBuffer&&(this.boundsBuffer.destroy(),delete this.boundsBuffer),this.fire(new e.k("data",{dataType:"source",sourceDataType:"content"})),this}prepare(){if(0===Object.keys(this.tiles).length||!this.image)return;const t=this.map.painter.context,i=t.gl;this.boundsBuffer||(this.boundsBuffer=t.createVertexBuffer(this._boundsArray,Y.members)),this.boundsSegments||(this.boundsSegments=e.a0.simpleSegment(0,0,4,2)),this.texture||(this.texture=new x(t,this.image,i.RGBA),this.texture.bind(i.LINEAR,i.CLAMP_TO_EDGE));let r=!1;for(const e in this.tiles){const t=this.tiles[e];"loaded"!==t.state&&(t.state="loaded",t.texture=this.texture,r=!0)}r&&this.fire(new e.k("data",{dataType:"source",sourceDataType:"idle",sourceId:this.id}))}loadTile(t){return e._(this,void 0,void 0,(function*(){this.tileID&&this.tileID.equals(t.tileID.canonical)?(this.tiles[String(t.tileID.wrap)]=t,t.buckets={}):t.state="errored"}))}serialize(){return{type:"image",url:this.options.url,coordinates:this.coordinates}}hasTransition(){return!1}}class tt extends Q{constructor(t,e,i,r){super(t,e,i,r),this.roundZoom=!0,this.type="video",this.options=e}load(){return e._(this,void 0,void 0,(function*(){this._loaded=!1;const t=this.options;this.urls=[];for(const e of t.urls)this.urls.push(this.map._requestManager.transformRequest(e,"Source").url);try{const t=yield e.a3(this.urls);if(this._loaded=!0,!t)return;this.video=t,this.video.loop=!0,this.video.addEventListener("playing",(()=>{this.map.triggerRepaint()})),this.map&&this.video.play(),this._finishLoading()}catch(t){this.fire(new e.j(t))}}))}pause(){this.video&&this.video.pause()}play(){this.video&&this.video.play()}seek(t){if(this.video){const i=this.video.seekable;t<i.start(0)||t>i.end(0)?this.fire(new e.j(new e.a2(`sources.${this.id}`,null,`Playback for this video can be set only between the ${i.start(0)} and ${i.end(0)}-second mark.`))):this.video.currentTime=t}}getVideo(){return this.video}onAdd(t){this.map||(this.map=t,this.load(),this.video&&(this.video.play(),this.setCoordinates(this.coordinates)))}prepare(){if(0===Object.keys(this.tiles).length||this.video.readyState<2)return;const t=this.map.painter.context,i=t.gl;this.boundsBuffer||(this.boundsBuffer=t.createVertexBuffer(this._boundsArray,Y.members)),this.boundsSegments||(this.boundsSegments=e.a0.simpleSegment(0,0,4,2)),this.texture?this.video.paused||(this.texture.bind(i.LINEAR,i.CLAMP_TO_EDGE),i.texSubImage2D(i.TEXTURE_2D,0,0,0,i.RGBA,i.UNSIGNED_BYTE,this.video)):(this.texture=new x(t,this.video,i.RGBA),this.texture.bind(i.LINEAR,i.CLAMP_TO_EDGE));let r=!1;for(const e in this.tiles){const t=this.tiles[e];"loaded"!==t.state&&(t.state="loaded",t.texture=this.texture,r=!0)}r&&this.fire(new e.k("data",{dataType:"source",sourceDataType:"idle",sourceId:this.id}))}serialize(){return{type:"video",urls:this.urls,coordinates:this.coordinates}}hasTransition(){return this.video&&!this.video.paused}}class et extends Q{constructor(t,i,r,n){super(t,i,r,n),i.coordinates?Array.isArray(i.coordinates)&&4===i.coordinates.length&&!i.coordinates.some((t=>!Array.isArray(t)||2!==t.length||t.some((t=>"number"!=typeof t))))||this.fire(new e.j(new e.a2(`sources.${t}`,null,'"coordinates" property must be an array of 4 longitude/latitude array pairs'))):this.fire(new e.j(new e.a2(`sources.${t}`,null,'missing required property "coordinates"'))),i.animate&&"boolean"!=typeof i.animate&&this.fire(new e.j(new e.a2(`sources.${t}`,null,'optional "animate" property must be a boolean value'))),i.canvas?"string"==typeof i.canvas||i.canvas instanceof HTMLCanvasElement||this.fire(new e.j(new e.a2(`sources.${t}`,null,'"canvas" must be either a string representing the ID of the canvas element from which to read, or an HTMLCanvasElement instance'))):this.fire(new e.j(new e.a2(`sources.${t}`,null,'missing required property "canvas"'))),this.options=i,this.animate=void 0===i.animate||i.animate}load(){return e._(this,void 0,void 0,(function*(){this._loaded=!0,this.canvas||(this.canvas=this.options.canvas instanceof HTMLCanvasElement?this.options.canvas:document.getElementById(this.options.canvas)),this.width=this.canvas.width,this.height=this.canvas.height,this._hasInvalidDimensions()?this.fire(new e.j(new Error("Canvas dimensions cannot be less than or equal to zero."))):(this.play=function(){this._playing=!0,this.map.triggerRepaint()},this.pause=function(){this._playing&&(this.prepare(),this._playing=!1)},this._finishLoading())}))}getCanvas(){return this.canvas}onAdd(t){this.map=t,this.load(),this.canvas&&this.animate&&this.play()}onRemove(){this.pause()}prepare(){let t=!1;if(this.canvas.width!==this.width&&(this.width=this.canvas.width,t=!0),this.canvas.height!==this.height&&(this.height=this.canvas.height,t=!0),this._hasInvalidDimensions())return;if(0===Object.keys(this.tiles).length)return;const i=this.map.painter.context,r=i.gl;this.boundsBuffer||(this.boundsBuffer=i.createVertexBuffer(this._boundsArray,Y.members)),this.boundsSegments||(this.boundsSegments=e.a0.simpleSegment(0,0,4,2)),this.texture?(t||this._playing)&&this.texture.update(this.canvas,{premultiply:!0}):this.texture=new x(i,this.canvas,r.RGBA,{premultiply:!0});let n=!1;for(const e in this.tiles){const t=this.tiles[e];"loaded"!==t.state&&(t.state="loaded",t.texture=this.texture,n=!0)}n&&this.fire(new e.k("data",{dataType:"source",sourceDataType:"idle",sourceId:this.id}))}serialize(){return{type:"canvas",coordinates:this.coordinates}}hasTransition(){return this._playing}_hasInvalidDimensions(){for(const t of[this.canvas.width,this.canvas.height])if(isNaN(t)||t<=0)return!0;return!1}}const it={},rt=t=>{switch(t){case"geojson":return K;case"image":return Q;case"raster":return X;case"raster-dem":return J;case"vector":return W;case"video":return tt;case"canvas":return et}return it[t]},nt="RTLPluginLoaded";class ot extends e.E{constructor(){super(...arguments),this.status="unavailable",this.url=null,this.dispatcher=V()}_syncState(t){return this.status=t,this.dispatcher.broadcast("SRPS",{pluginStatus:t,pluginURL:this.url}).catch((t=>{throw this.status="error",t}))}getRTLTextPluginStatus(){return this.status}clearRTLTextPlugin(){this.status="unavailable",this.url=null}setRTLTextPlugin(t){return e._(this,arguments,void 0,(function*(t,e=!1){if(this.url)throw new Error("setRTLTextPlugin cannot be called multiple times.");if(this.url=o.resolveURL(t),!this.url)throw new Error(`requested url ${t} is invalid`);if("unavailable"===this.status){if(!e)return this._requestImport();this.status="deferred",this._syncState(this.status)}else if("requested"===this.status)return this._requestImport()}))}_requestImport(){return e._(this,void 0,void 0,(function*(){yield this._syncState("loading"),this.status="loaded",this.fire(new e.k(nt))}))}lazyLoad(){"unavailable"===this.status?this.status="requested":"deferred"===this.status&&this._requestImport()}}let at=null;function st(){return at||(at=new ot),at}class lt{constructor(t,i){this.timeAdded=0,this.fadeEndTime=0,this.tileID=t,this.uid=e.a4(),this.uses=0,this.tileSize=i,this.buckets={},this.expirationTime=null,this.queryPadding=0,this.hasSymbolBuckets=!1,this.hasRTLText=!1,this.dependencies={},this.rtt=[],this.rttCoords={},this.expiredRequestCount=0,this.state="loading"}registerFadeDuration(t){const e=t+this.timeAdded;e<this.fadeEndTime||(this.fadeEndTime=e)}wasRequested(){return"errored"===this.state||"loaded"===this.state||"reloading"===this.state}clearTextures(t){this.demTexture&&t.saveTileTexture(this.demTexture),this.demTexture=null}loadVectorData(t,i,r){if(this.hasData()&&this.unloadVectorData(),this.state="loaded",t){t.featureIndex&&(this.latestFeatureIndex=t.featureIndex,t.rawTileData?(this.latestRawTileData=t.rawTileData,this.latestFeatureIndex.rawTileData=t.rawTileData):this.latestRawTileData&&(this.latestFeatureIndex.rawTileData=this.latestRawTileData)),this.collisionBoxArray=t.collisionBoxArray,this.buckets=function(t,e){const i={};if(!e)return i;for(const r of t){const t=r.layerIds.map((t=>e.getLayer(t))).filter(Boolean);if(0!==t.length){r.layers=t,r.stateDependentLayerIds&&(r.stateDependentLayers=r.stateDependentLayerIds.map((e=>t.filter((t=>t.id===e))[0])));for(const e of t)i[e.id]=r}}return i}(t.buckets,i.style),this.hasSymbolBuckets=!1;for(const t in this.buckets){const i=this.buckets[t];if(i instanceof e.a6){if(this.hasSymbolBuckets=!0,!r)break;i.justReloaded=!0}}if(this.hasRTLText=!1,this.hasSymbolBuckets)for(const t in this.buckets){const i=this.buckets[t];if(i instanceof e.a6&&i.hasRTLText){this.hasRTLText=!0,st().lazyLoad();break}}this.queryPadding=0;for(const t in this.buckets){const e=this.buckets[t];this.queryPadding=Math.max(this.queryPadding,i.style.getLayer(t).queryRadius(e))}t.imageAtlas&&(this.imageAtlas=t.imageAtlas),t.glyphAtlasImage&&(this.glyphAtlasImage=t.glyphAtlasImage)}else this.collisionBoxArray=new e.a5}unloadVectorData(){for(const t in this.buckets)this.buckets[t].destroy();this.buckets={},this.imageAtlasTexture&&this.imageAtlasTexture.destroy(),this.imageAtlas&&(this.imageAtlas=null),this.glyphAtlasTexture&&this.glyphAtlasTexture.destroy(),this.latestFeatureIndex=null,this.state="unloaded"}getBucket(t){return this.buckets[t.id]}upload(t){for(const i in this.buckets){const e=this.buckets[i];e.uploadPending()&&e.upload(t)}const e=t.gl;this.imageAtlas&&!this.imageAtlas.uploaded&&(this.imageAtlasTexture=new x(t,this.imageAtlas.image,e.RGBA),this.imageAtlas.uploaded=!0),this.glyphAtlasImage&&(this.glyphAtlasTexture=new x(t,this.glyphAtlasImage,e.ALPHA),this.glyphAtlasImage=null)}prepare(t){this.imageAtlas&&this.imageAtlas.patchUpdatedImages(t,this.imageAtlasTexture)}queryRenderedFeatures(t,e,i,r,n,o,a,s,l,c){return this.latestFeatureIndex&&this.latestFeatureIndex.rawTileData?this.latestFeatureIndex.query({queryGeometry:r,cameraQueryGeometry:n,scale:o,tileSize:this.tileSize,pixelPosMatrix:c,transform:s,params:a,queryPadding:this.queryPadding*l},t,e,i):{}}querySourceFeatures(t,i){const r=this.latestFeatureIndex;if(!r||!r.rawTileData)return;const n=r.loadVTLayers(),o=i&&i.sourceLayer?i.sourceLayer:"",a=n._geojsonTileLayer||n[o];if(!a)return;const s=e.a7(i&&i.filter),{z:l,x:c,y:u}=this.tileID.canonical,h={z:l,x:c,y:u};for(let d=0;d<a.length;d++){const i=a.feature(d);if(s.needGeometry){const t=e.a8(i,!0);if(!s.filter(new e.z(this.tileID.overscaledZ),t,this.tileID.canonical))continue}else if(!s.filter(new e.z(this.tileID.overscaledZ),i))continue;const n=r.getId(i,o),p=new e.a9(i,l,c,u,n);p.tile=h,t.push(p)}}hasData(){return"loaded"===this.state||"reloading"===this.state||"expired"===this.state}patternsLoaded(){return this.imageAtlas&&!!Object.keys(this.imageAtlas.patternPositions).length}setExpiryData(t){const i=this.expirationTime;if(t.cacheControl){const i=e.aa(t.cacheControl);i["max-age"]&&(this.expirationTime=Date.now()+1e3*i["max-age"])}else t.expires&&(this.expirationTime=new Date(t.expires).getTime());if(this.expirationTime){const t=Date.now();let e=!1;if(this.expirationTime>t)e=!1;else if(i)if(this.expirationTime<i)e=!0;else{const r=this.expirationTime-i;r?this.expirationTime=t+Math.max(r,3e4):e=!0}else e=!0;e?(this.expiredRequestCount++,this.state="expired"):this.expiredRequestCount=0}}getExpiryTimeout(){if(this.expirationTime)return this.expiredRequestCount?1e3*(1<<Math.min(this.expiredRequestCount-1,31)):Math.min(this.expirationTime-(new Date).getTime(),Math.pow(2,31)-1)}setFeatureState(t,e){if(!this.latestFeatureIndex||!this.latestFeatureIndex.rawTileData||0===Object.keys(t).length)return;const i=this.latestFeatureIndex.loadVTLayers();for(const r in this.buckets){if(!e.style.hasLayer(r))continue;const n=this.buckets[r],o=n.layers[0].sourceLayer||"_geojsonTileLayer",a=i[o],s=t[o];if(!a||!s||0===Object.keys(s).length)continue;n.update(s,a,this.imageAtlas&&this.imageAtlas.patternPositions||{});const l=e&&e.style&&e.style.getLayer(r);l&&(this.queryPadding=Math.max(this.queryPadding,l.queryRadius(n)))}}holdingForFade(){return void 0!==this.symbolFadeHoldUntil}symbolFadeFinished(){return!this.symbolFadeHoldUntil||this.symbolFadeHoldUntil<o.now()}clearFadeHold(){this.symbolFadeHoldUntil=void 0}setHoldDuration(t){this.symbolFadeHoldUntil=o.now()+t}setDependencies(t,e){const i={};for(const r of e)i[r]=!0;this.dependencies[t]=i}hasDependency(t,e){for(const i of t){const t=this.dependencies[i];if(t)for(const i of e)if(t[i])return!0}return!1}}class ct{constructor(t,e){this.max=t,this.onRemove=e,this.reset()}reset(){for(const t in this.data)for(const e of this.data[t])e.timeout&&clearTimeout(e.timeout),this.onRemove(e.value);return this.data={},this.order=[],this}add(t,e,i){const r=t.wrapped().key;void 0===this.data[r]&&(this.data[r]=[]);const n={value:e,timeout:void 0};if(void 0!==i&&(n.timeout=setTimeout((()=>{this.remove(t,n)}),i)),this.data[r].push(n),this.order.push(r),this.order.length>this.max){const t=this._getAndRemoveByKey(this.order[0]);t&&this.onRemove(t)}return this}has(t){return t.wrapped().key in this.data}getAndRemove(t){return this.has(t)?this._getAndRemoveByKey(t.wrapped().key):null}_getAndRemoveByKey(t){const e=this.data[t].shift();return e.timeout&&clearTimeout(e.timeout),0===this.data[t].length&&delete this.data[t],this.order.splice(this.order.indexOf(t),1),e.value}getByKey(t){const e=this.data[t];return e?e[0].value:null}get(t){return this.has(t)?this.data[t.wrapped().key][0].value:null}remove(t,e){if(!this.has(t))return this;const i=t.wrapped().key,r=void 0===e?0:this.data[i].indexOf(e),n=this.data[i][r];return this.data[i].splice(r,1),n.timeout&&clearTimeout(n.timeout),0===this.data[i].length&&delete this.data[i],this.onRemove(n.value),this.order.splice(this.order.indexOf(i),1),this}setMaxSize(t){for(this.max=t;this.order.length>this.max;){const t=this._getAndRemoveByKey(this.order[0]);t&&this.onRemove(t)}return this}filter(t){const e=[];for(const i in this.data)for(const r of this.data[i])t(r.value)||e.push(r);for(const i of e)this.remove(i.value.tileID,i)}}class ut{constructor(){this.state={},this.stateChanges={},this.deletedStates={}}updateState(t,i,r){const n=String(i);if(this.stateChanges[t]=this.stateChanges[t]||{},this.stateChanges[t][n]=this.stateChanges[t][n]||{},e.e(this.stateChanges[t][n],r),null===this.deletedStates[t]){this.deletedStates[t]={};for(const e in this.state[t])e!==n&&(this.deletedStates[t][e]=null)}else if(this.deletedStates[t]&&null===this.deletedStates[t][n]){this.deletedStates[t][n]={};for(const e in this.state[t][n])r[e]||(this.deletedStates[t][n][e]=null)}else for(const e in r)this.deletedStates[t]&&this.deletedStates[t][n]&&null===this.deletedStates[t][n][e]&&delete this.deletedStates[t][n][e]}removeFeatureState(t,e,i){if(null===this.deletedStates[t])return;const r=String(e);if(this.deletedStates[t]=this.deletedStates[t]||{},i&&void 0!==e)null!==this.deletedStates[t][r]&&(this.deletedStates[t][r]=this.deletedStates[t][r]||{},this.deletedStates[t][r][i]=null);else if(void 0!==e)if(this.stateChanges[t]&&this.stateChanges[t][r])for(i in this.deletedStates[t][r]={},this.stateChanges[t][r])this.deletedStates[t][r][i]=null;else this.deletedStates[t][r]=null;else this.deletedStates[t]=null}getState(t,i){const r=String(i),n=e.e({},(this.state[t]||{})[r],(this.stateChanges[t]||{})[r]);if(null===this.deletedStates[t])return{};if(this.deletedStates[t]){const e=this.deletedStates[t][i];if(null===e)return{};for(const t in e)delete n[t]}return n}initializeTileState(t,e){t.setFeatureState(this.state,e)}coalesceChanges(t,i){const r={};for(const n in this.stateChanges){this.state[n]=this.state[n]||{};const t={};for(const i in this.stateChanges[n])this.state[n][i]||(this.state[n][i]={}),e.e(this.state[n][i],this.stateChanges[n][i]),t[i]=this.state[n][i];r[n]=t}for(const n in this.deletedStates){this.state[n]=this.state[n]||{};const t={};if(null===this.deletedStates[n])for(const e in this.state[n])t[e]={},this.state[n][e]={};else for(const e in this.deletedStates[n]){if(null===this.deletedStates[n][e])this.state[n][e]={};else for(const t of Object.keys(this.deletedStates[n][e]))delete this.state[n][e][t];t[e]=this.state[n][e]}r[n]=r[n]||{},e.e(r[n],t)}if(this.stateChanges={},this.deletedStates={},0!==Object.keys(r).length)for(const e in t)t[e].setFeatureState(r,i)}}class ht extends e.E{constructor(t,e,i){super(),this.id=t,this.dispatcher=i,this.on("data",(t=>this._dataHandler(t))),this.on("dataloading",(()=>{this._sourceErrored=!1})),this.on("error",(()=>{this._sourceErrored=this._source.loaded()})),this._source=((t,e,i,r)=>{const n=new(rt(e.type))(t,e,i,r);if(n.id!==t)throw new Error(`Expected Source id to be ${t} instead of ${n.id}`);return n})(t,e,i,this),this._tiles={},this._cache=new ct(0,(t=>this._unloadTile(t))),this._timers={},this._cacheTimers={},this._maxTileCacheSize=null,this._maxTileCacheZoomLevels=null,this._loadedParentTiles={},this._coveredTiles={},this._state=new ut,this._didEmitContent=!1,this._updated=!1}onAdd(t){this.map=t,this._maxTileCacheSize=t?t._maxTileCacheSize:null,this._maxTileCacheZoomLevels=t?t._maxTileCacheZoomLevels:null,this._source&&this._source.onAdd&&this._source.onAdd(t)}onRemove(t){this.clearTiles(),this._source&&this._source.onRemove&&this._source.onRemove(t)}loaded(){if(this._sourceErrored)return!0;if(!this._sourceLoaded)return!1;if(!this._source.loaded())return!1;if(!(void 0===this.used&&void 0===this.usedForTerrain||this.used||this.usedForTerrain))return!0;if(!this._updated)return!1;for(const t in this._tiles){const e=this._tiles[t];if("loaded"!==e.state&&"errored"!==e.state)return!1}return!0}getSource(){return this._source}pause(){this._paused=!0}resume(){if(!this._paused)return;const t=this._shouldReloadOnResume;this._paused=!1,this._shouldReloadOnResume=!1,t&&this.reload(),this.transform&&this.update(this.transform,this.terrain)}_loadTile(t,i,r){return e._(this,void 0,void 0,(function*(){try{yield this._source.loadTile(t),this._tileLoaded(t,i,r)}catch(i){t.state="errored",404!==i.status?this._source.fire(new e.j(i,{tile:t})):this.update(this.transform,this.terrain)}}))}_unloadTile(t){this._source.unloadTile&&this._source.unloadTile(t)}_abortTile(t){this._source.abortTile&&this._source.abortTile(t),this._source.fire(new e.k("dataabort",{tile:t,coord:t.tileID,dataType:"source"}))}serialize(){return this._source.serialize()}prepare(t){this._source.prepare&&this._source.prepare(),this._state.coalesceChanges(this._tiles,this.map?this.map.painter:null);for(const e in this._tiles){const i=this._tiles[e];i.upload(t),i.prepare(this.map.style.imageManager)}}getIds(){return Object.values(this._tiles).map((t=>t.tileID)).sort(dt).map((t=>t.key))}getRenderableIds(t){const i=[];for(const e in this._tiles)this._isIdRenderable(e,t)&&i.push(this._tiles[e]);return t?i.sort(((t,i)=>{const r=t.tileID,n=i.tileID,o=new e.P(r.canonical.x,r.canonical.y)._rotate(this.transform.angle),a=new e.P(n.canonical.x,n.canonical.y)._rotate(this.transform.angle);return r.overscaledZ-n.overscaledZ||a.y-o.y||a.x-o.x})).map((t=>t.tileID.key)):i.map((t=>t.tileID)).sort(dt).map((t=>t.key))}hasRenderableParent(t){const e=this.findLoadedParent(t,0);return!!e&&this._isIdRenderable(e.tileID.key)}_isIdRenderable(t,e){return this._tiles[t]&&this._tiles[t].hasData()&&!this._coveredTiles[t]&&(e||!this._tiles[t].holdingForFade())}reload(){if(this._paused)this._shouldReloadOnResume=!0;else{this._cache.reset();for(const t in this._tiles)"errored"!==this._tiles[t].state&&this._reloadTile(t,"reloading")}}_reloadTile(t,i){return e._(this,void 0,void 0,(function*(){const e=this._tiles[t];e&&("loading"!==e.state&&(e.state=i),yield this._loadTile(e,t,i))}))}_tileLoaded(t,i,r){t.timeAdded=o.now(),"expired"===r&&(t.refreshedUponExpiration=!0),this._setTileReloadTimer(i,t),"raster-dem"===this.getSource().type&&t.dem&&this._backfillDEM(t),this._state.initializeTileState(t,this.map?this.map.painter:null),t.aborted||this._source.fire(new e.k("data",{dataType:"source",tile:t,coord:t.tileID}))}_backfillDEM(t){const e=this.getRenderableIds();for(let r=0;r<e.length;r++){const n=e[r];if(t.neighboringTiles&&t.neighboringTiles[n]){const e=this.getTileByID(n);i(t,e),i(e,t)}}function i(t,e){t.needsHillshadePrepare=!0,t.needsTerrainPrepare=!0;let i=e.tileID.canonical.x-t.tileID.canonical.x;const r=e.tileID.canonical.y-t.tileID.canonical.y,n=Math.pow(2,t.tileID.canonical.z),o=e.tileID.key;0===i&&0===r||Math.abs(r)>1||(Math.abs(i)>1&&(1===Math.abs(i+n)?i+=n:1===Math.abs(i-n)&&(i-=n)),e.dem&&t.dem&&(t.dem.backfillBorder(e.dem,i,r),t.neighboringTiles&&t.neighboringTiles[o]&&(t.neighboringTiles[o].backfilled=!0)))}}getTile(t){return this.getTileByID(t.key)}getTileByID(t){return this._tiles[t]}_retainLoadedChildren(t,e,i,r){for(const n in this._tiles){let o=this._tiles[n];if(r[n]||!o.hasData()||o.tileID.overscaledZ<=e||o.tileID.overscaledZ>i)continue;let a=o.tileID;for(;o&&o.tileID.overscaledZ>e+1;){const t=o.tileID.scaledTo(o.tileID.overscaledZ-1);o=this._tiles[t.key],o&&o.hasData()&&(a=t)}let s=a;for(;s.overscaledZ>e;)if(s=s.scaledTo(s.overscaledZ-1),t[s.key]){r[a.key]=a;break}}}findLoadedParent(t,e){if(t.key in this._loadedParentTiles){const i=this._loadedParentTiles[t.key];return i&&i.tileID.overscaledZ>=e?i:null}for(let i=t.overscaledZ-1;i>=e;i--){const e=t.scaledTo(i),r=this._getLoadedTile(e);if(r)return r}}findLoadedSibling(t){return this._getLoadedTile(t)}_getLoadedTile(t){const e=this._tiles[t.key];return e&&e.hasData()?e:this._cache.getByKey(t.wrapped().key)}updateCacheSize(t){const i=Math.ceil(t.width/this._source.tileSize)+1,r=Math.ceil(t.height/this._source.tileSize)+1,n=Math.floor(i*r*(null===this._maxTileCacheZoomLevels?e.a.MAX_TILE_CACHE_ZOOM_LEVELS:this._maxTileCacheZoomLevels)),o="number"==typeof this._maxTileCacheSize?Math.min(this._maxTileCacheSize,n):n;this._cache.setMaxSize(o)}handleWrapJump(t){const e=Math.round((t-(void 0===this._prevLng?t:this._prevLng))/360);if(this._prevLng=t,e){const t={};for(const i in this._tiles){const r=this._tiles[i];r.tileID=r.tileID.unwrapTo(r.tileID.wrap+e),t[r.tileID.key]=r}this._tiles=t;for(const e in this._timers)clearTimeout(this._timers[e]),delete this._timers[e];for(const e in this._tiles)this._setTileReloadTimer(e,this._tiles[e])}}_updateCoveredAndRetainedTiles(t,e,i,r,n,a){const s={},l={},c=Object.keys(t),u=o.now();for(const o of c){const i=t[o],r=this._tiles[o];if(!r||0!==r.fadeEndTime&&r.fadeEndTime<=u)continue;const n=this.findLoadedParent(i,e),a=this.findLoadedSibling(i),c=n||a||null;c&&(this._addTile(c.tileID),s[c.tileID.key]=c.tileID),l[o]=i}this._retainLoadedChildren(l,r,i,t);for(const o in s)t[o]||(this._coveredTiles[o]=!0,t[o]=s[o]);if(a){const e={},i={};for(const t of n)this._tiles[t.key].hasData()?e[t.key]=t:i[t.key]=t;for(const r in i){const n=i[r].children(this._source.maxzoom);this._tiles[n[0].key]&&this._tiles[n[1].key]&&this._tiles[n[2].key]&&this._tiles[n[3].key]&&(e[n[0].key]=t[n[0].key]=n[0],e[n[1].key]=t[n[1].key]=n[1],e[n[2].key]=t[n[2].key]=n[2],e[n[3].key]=t[n[3].key]=n[3],delete i[r])}for(const r in i){const n=i[r],o=this.findLoadedParent(n,this._source.minzoom),a=this.findLoadedSibling(n),s=o||a||null;if(s){e[s.tileID.key]=t[s.tileID.key]=s.tileID;for(const t in e)e[t].isChildOf(s.tileID)&&delete e[t]}}for(const t in this._tiles)e[t]||(this._coveredTiles[t]=!0)}}update(t,i){if(!this._sourceLoaded||this._paused)return;let r;this.transform=t,this.terrain=i,this.updateCacheSize(t),this.handleWrapJump(this.transform.center.lng),this._coveredTiles={},this.used||this.usedForTerrain?this._source.tileID?r=t.getVisibleUnwrappedCoordinates(this._source.tileID).map((t=>new e.S(t.canonical.z,t.wrap,t.canonical.z,t.canonical.x,t.canonical.y))):(r=t.coveringTiles({tileSize:this.usedForTerrain?this.tileSize:this._source.tileSize,minzoom:this._source.minzoom,maxzoom:this._source.maxzoom,roundZoom:!this.usedForTerrain&&this._source.roundZoom,reparseOverscaled:this._source.reparseOverscaled,terrain:i}),this._source.hasTile&&(r=r.filter((t=>this._source.hasTile(t))))):r=[];const n=t.coveringZoomLevel(this._source),o=Math.max(n-ht.maxOverzooming,this._source.minzoom),a=Math.max(n+ht.maxUnderzooming,this._source.minzoom);if(this.usedForTerrain){const t={};for(const e of r)if(e.canonical.z>this._source.minzoom){const i=e.scaledTo(e.canonical.z-1);t[i.key]=i;const r=e.scaledTo(Math.max(this._source.minzoom,Math.min(e.canonical.z,5)));t[r.key]=r}r=r.concat(Object.values(t))}const s=0===r.length&&!this._updated&&this._didEmitContent;this._updated=!0,s&&this.fire(new e.k("data",{sourceDataType:"idle",dataType:"source",sourceId:this.id}));const l=this._updateRetainedTiles(r,n);pt(this._source.type)&&this._updateCoveredAndRetainedTiles(l,o,a,n,r,i);for(const e in l)this._tiles[e].clearFadeHold();const c=e.ab(this._tiles,l);for(const e of c){const t=this._tiles[e];t.hasSymbolBuckets&&!t.holdingForFade()?t.setHoldDuration(this.map._fadeDuration):t.hasSymbolBuckets&&!t.symbolFadeFinished()||this._removeTile(e)}this._updateLoadedParentTileCache(),this._updateLoadedSiblingTileCache()}releaseSymbolFadeTiles(){for(const t in this._tiles)this._tiles[t].holdingForFade()&&this._removeTile(t)}_updateRetainedTiles(t,e){var i;const r={},n={},o=Math.max(e-ht.maxOverzooming,this._source.minzoom),a=Math.max(e+ht.maxUnderzooming,this._source.minzoom),s={};for(const l of t){const t=this._addTile(l);r[l.key]=l,t.hasData()||e<this._source.maxzoom&&(s[l.key]=l)}this._retainLoadedChildren(s,e,a,r);for(const l of t){let t=this._tiles[l.key];if(t.hasData())continue;if(e+1>this._source.maxzoom){const t=l.children(this._source.maxzoom)[0],e=this.getTile(t);if(e&&e.hasData()){r[t.key]=t;continue}}else{const t=l.children(this._source.maxzoom);if(r[t[0].key]&&r[t[1].key]&&r[t[2].key]&&r[t[3].key])continue}let a=t.wasRequested();for(let e=l.overscaledZ-1;e>=o;--e){const o=l.scaledTo(e);if(n[o.key])break;if(n[o.key]=!0,t=this.getTile(o),!t&&a&&(t=this._addTile(o)),t){const e=t.hasData();if((e||!(null===(i=this.map)||void 0===i?void 0:i.cancelPendingTileRequestsWhileZooming)||a)&&(r[o.key]=o),a=t.wasRequested(),e)break}}}return r}_updateLoadedParentTileCache(){this._loadedParentTiles={};for(const t in this._tiles){const e=[];let i,r=this._tiles[t].tileID;for(;r.overscaledZ>0;){if(r.key in this._loadedParentTiles){i=this._loadedParentTiles[r.key];break}e.push(r.key);const t=r.scaledTo(r.overscaledZ-1);if(i=this._getLoadedTile(t),i)break;r=t}for(const t of e)this._loadedParentTiles[t]=i}}_updateLoadedSiblingTileCache(){this._loadedSiblingTiles={};for(const t in this._tiles){const e=this._tiles[t].tileID,i=this._getLoadedTile(e);this._loadedSiblingTiles[e.key]=i}}_addTile(t){let i=this._tiles[t.key];if(i)return i;i=this._cache.getAndRemove(t),i&&(this._setTileReloadTimer(t.key,i),i.tileID=t,this._state.initializeTileState(i,this.map?this.map.painter:null),this._cacheTimers[t.key]&&(clearTimeout(this._cacheTimers[t.key]),delete this._cacheTimers[t.key],this._setTileReloadTimer(t.key,i)));const r=i;return i||(i=new lt(t,this._source.tileSize*t.overscaleFactor()),this._loadTile(i,t.key,i.state)),i.uses++,this._tiles[t.key]=i,r||this._source.fire(new e.k("dataloading",{tile:i,coord:i.tileID,dataType:"source"})),i}_setTileReloadTimer(t,e){t in this._timers&&(clearTimeout(this._timers[t]),delete this._timers[t]);const i=e.getExpiryTimeout();i&&(this._timers[t]=setTimeout((()=>{this._reloadTile(t,"expired"),delete this._timers[t]}),i))}_removeTile(t){const e=this._tiles[t];e&&(e.uses--,delete this._tiles[t],this._timers[t]&&(clearTimeout(this._timers[t]),delete this._timers[t]),e.uses>0||(e.hasData()&&"reloading"!==e.state?this._cache.add(e.tileID,e,e.getExpiryTimeout()):(e.aborted=!0,this._abortTile(e),this._unloadTile(e))))}_dataHandler(t){const e=t.sourceDataType;"source"===t.dataType&&"metadata"===e&&(this._sourceLoaded=!0),this._sourceLoaded&&!this._paused&&"source"===t.dataType&&"content"===e&&(this.reload(),this.transform&&this.update(this.transform,this.terrain),this._didEmitContent=!0)}clearTiles(){this._shouldReloadOnResume=!1,this._paused=!1;for(const t in this._tiles)this._removeTile(t);this._cache.reset()}tilesIn(t,i,r){const n=[],o=this.transform;if(!o)return n;const a=r?o.getCameraQueryGeometry(t):t,s=t.map((t=>o.pointCoordinate(t,this.terrain))),l=a.map((t=>o.pointCoordinate(t,this.terrain))),c=this.getIds();let u=1/0,h=1/0,d=-1/0,p=-1/0;for(const e of l)u=Math.min(u,e.x),h=Math.min(h,e.y),d=Math.max(d,e.x),p=Math.max(p,e.y);for(let f=0;f<c.length;f++){const t=this._tiles[c[f]];if(t.holdingForFade())continue;const r=t.tileID,a=Math.pow(2,o.zoom-t.tileID.overscaledZ),m=i*t.queryPadding*e.X/t.tileSize/a,g=[r.getTilePoint(new e.Z(u,h)),r.getTilePoint(new e.Z(d,p))];if(g[0].x-m<e.X&&g[0].y-m<e.X&&g[1].x+m>=0&&g[1].y+m>=0){const e=s.map((t=>r.getTilePoint(t))),i=l.map((t=>r.getTilePoint(t)));n.push({tile:t,tileID:r,queryGeometry:e,cameraQueryGeometry:i,scale:a})}}return n}getVisibleCoordinates(t){const e=this.getRenderableIds(t).map((t=>this._tiles[t].tileID));for(const i of e)i.posMatrix=this.transform.calculatePosMatrix(i.toUnwrapped());return e}hasTransition(){if(this._source.hasTransition())return!0;if(pt(this._source.type)){const t=o.now();for(const e in this._tiles)if(this._tiles[e].fadeEndTime>=t)return!0}return!1}setFeatureState(t,e,i){this._state.updateState(t=t||"_geojsonTileLayer",e,i)}removeFeatureState(t,e,i){this._state.removeFeatureState(t=t||"_geojsonTileLayer",e,i)}getFeatureState(t,e){return this._state.getState(t=t||"_geojsonTileLayer",e)}setDependencies(t,e,i){const r=this._tiles[t];r&&r.setDependencies(e,i)}reloadTilesForDependencies(t,e){for(const i in this._tiles)this._tiles[i].hasDependency(t,e)&&this._reloadTile(i,"reloading");this._cache.filter((i=>!i.hasDependency(t,e)))}}function dt(t,e){const i=Math.abs(2*t.wrap)-+(t.wrap<0),r=Math.abs(2*e.wrap)-+(e.wrap<0);return t.overscaledZ-e.overscaledZ||r-i||e.canonical.y-t.canonical.y||e.canonical.x-t.canonical.x}function pt(t){return"raster"===t||"image"===t||"video"===t}ht.maxOverzooming=10,ht.maxUnderzooming=3;class ft{constructor(t,e){this.reset(t,e)}reset(t,e){this.points=t||[],this._distances=[0];for(let i=1;i<this.points.length;i++)this._distances[i]=this._distances[i-1]+this.points[i].dist(this.points[i-1]);this.length=this._distances[this._distances.length-1],this.padding=Math.min(e||0,.5*this.length),this.paddedLength=this.length-2*this.padding}lerp(t){if(1===this.points.length)return this.points[0];t=e.ac(t,0,1);let i=1,r=this._distances[i];const n=t*this.paddedLength+this.padding;for(;r<n&&i<this._distances.length;)r=this._distances[++i];const o=i-1,a=this._distances[o],s=r-a,l=s>0?(n-a)/s:0;return this.points[o].mult(1-l).add(this.points[i].mult(l))}}function mt(t,e){let i=!0;return"always"===t||"never"!==t&&"never"!==e||(i=!1),i}class gt{constructor(t,e,i){const r=this.boxCells=[],n=this.circleCells=[];this.xCellCount=Math.ceil(t/i),this.yCellCount=Math.ceil(e/i);for(let o=0;o<this.xCellCount*this.yCellCount;o++)r.push([]),n.push([]);this.circleKeys=[],this.boxKeys=[],this.bboxes=[],this.circles=[],this.width=t,this.height=e,this.xScale=this.xCellCount/t,this.yScale=this.yCellCount/e,this.boxUid=0,this.circleUid=0}keysLength(){return this.boxKeys.length+this.circleKeys.length}insert(t,e,i,r,n){this._forEachCell(e,i,r,n,this._insertBoxCell,this.boxUid++),this.boxKeys.push(t),this.bboxes.push(e),this.bboxes.push(i),this.bboxes.push(r),this.bboxes.push(n)}insertCircle(t,e,i,r){this._forEachCell(e-r,i-r,e+r,i+r,this._insertCircleCell,this.circleUid++),this.circleKeys.push(t),this.circles.push(e),this.circles.push(i),this.circles.push(r)}_insertBoxCell(t,e,i,r,n,o){this.boxCells[n].push(o)}_insertCircleCell(t,e,i,r,n,o){this.circleCells[n].push(o)}_query(t,e,i,r,n,o,a){if(i<0||t>this.width||r<0||e>this.height)return[];const s=[];if(t<=0&&e<=0&&this.width<=i&&this.height<=r){if(n)return[{key:null,x1:t,y1:e,x2:i,y2:r}];for(let t=0;t<this.boxKeys.length;t++)s.push({key:this.boxKeys[t],x1:this.bboxes[4*t],y1:this.bboxes[4*t+1],x2:this.bboxes[4*t+2],y2:this.bboxes[4*t+3]});for(let t=0;t<this.circleKeys.length;t++){const e=this.circles[3*t],i=this.circles[3*t+1],r=this.circles[3*t+2];s.push({key:this.circleKeys[t],x1:e-r,y1:i-r,x2:e+r,y2:i+r})}}else this._forEachCell(t,e,i,r,this._queryCell,s,{hitTest:n,overlapMode:o,seenUids:{box:{},circle:{}}},a);return s}query(t,e,i,r){return this._query(t,e,i,r,!1,null)}hitTest(t,e,i,r,n,o){return this._query(t,e,i,r,!0,n,o).length>0}hitTestCircle(t,e,i,r,n){const o=t-i,a=t+i,s=e-i,l=e+i;if(a<0||o>this.width||l<0||s>this.height)return!1;const c=[];return this._forEachCell(o,s,a,l,this._queryCellCircle,c,{hitTest:!0,overlapMode:r,circle:{x:t,y:e,radius:i},seenUids:{box:{},circle:{}}},n),c.length>0}_queryCell(t,e,i,r,n,o,a,s){const{seenUids:l,hitTest:c,overlapMode:u}=a,h=this.boxCells[n];if(null!==h){const n=this.bboxes;for(const a of h)if(!l.box[a]){l.box[a]=!0;const h=4*a,d=this.boxKeys[a];if(t<=n[h+2]&&e<=n[h+3]&&i>=n[h+0]&&r>=n[h+1]&&(!s||s(d))&&(!c||!mt(u,d.overlapMode))&&(o.push({key:d,x1:n[h],y1:n[h+1],x2:n[h+2],y2:n[h+3]}),c))return!0}}const d=this.circleCells[n];if(null!==d){const n=this.circles;for(const a of d)if(!l.circle[a]){l.circle[a]=!0;const h=3*a,d=this.circleKeys[a];if(this._circleAndRectCollide(n[h],n[h+1],n[h+2],t,e,i,r)&&(!s||s(d))&&(!c||!mt(u,d.overlapMode))){const t=n[h],e=n[h+1],i=n[h+2];if(o.push({key:d,x1:t-i,y1:e-i,x2:t+i,y2:e+i}),c)return!0}}}return!1}_queryCellCircle(t,e,i,r,n,o,a,s){const{circle:l,seenUids:c,overlapMode:u}=a,h=this.boxCells[n];if(null!==h){const t=this.bboxes;for(const e of h)if(!c.box[e]){c.box[e]=!0;const i=4*e,r=this.boxKeys[e];if(this._circleAndRectCollide(l.x,l.y,l.radius,t[i+0],t[i+1],t[i+2],t[i+3])&&(!s||s(r))&&!mt(u,r.overlapMode))return o.push(!0),!0}}const d=this.circleCells[n];if(null!==d){const t=this.circles;for(const e of d)if(!c.circle[e]){c.circle[e]=!0;const i=3*e,r=this.circleKeys[e];if(this._circlesCollide(t[i],t[i+1],t[i+2],l.x,l.y,l.radius)&&(!s||s(r))&&!mt(u,r.overlapMode))return o.push(!0),!0}}}_forEachCell(t,e,i,r,n,o,a,s){const l=this._convertToXCellCoord(t),c=this._convertToYCellCoord(e),u=this._convertToXCellCoord(i),h=this._convertToYCellCoord(r);for(let d=l;d<=u;d++)for(let l=c;l<=h;l++)if(n.call(this,t,e,i,r,this.xCellCount*l+d,o,a,s))return}_convertToXCellCoord(t){return Math.max(0,Math.min(this.xCellCount-1,Math.floor(t*this.xScale)))}_convertToYCellCoord(t){return Math.max(0,Math.min(this.yCellCount-1,Math.floor(t*this.yScale)))}_circlesCollide(t,e,i,r,n,o){const a=r-t,s=n-e,l=i+o;return l*l>a*a+s*s}_circleAndRectCollide(t,e,i,r,n,o,a){const s=(o-r)/2,l=Math.abs(t-(r+s));if(l>s+i)return!1;const c=(a-n)/2,u=Math.abs(e-(n+c));if(u>c+i)return!1;if(l<=s||u<=c)return!0;const h=l-s,d=u-c;return h*h+d*d<=i*i}}function yt(t,i,r,n,o){const a=e.H();return i?(e.K(a,a,[1/o,1/o,1]),r||e.ad(a,a,n.angle)):e.L(a,n.labelPlaneMatrix,t),a}function _t(t,i,r,n,o){if(i){const i=e.ae(t);return e.K(i,i,[o,o,1]),r||e.ad(i,i,-n.angle),i}return n.glCoordMatrix}function vt(t,i,r,n){let o;n?(o=[t,i,n(t,i),1],e.af(o,o,r)):(o=[t,i,0,1],Dt(o,o,r));const a=o[3];return{point:new e.P(o[0]/a,o[1]/a),signedDistanceFromCamera:a,isOccluded:!1}}function bt(t,e){return.5+t/e*.5}function xt(t,e){return t.x>=-e[0]&&t.x<=e[0]&&t.y>=-e[1]&&t.y<=e[1]}function wt(t,i,r,n,o,a,s,l,c,u,h,d,p,f,m){const g=n?t.textSizeData:t.iconSizeData,y=e.ag(g,r.transform.zoom),_=[256/r.width*2+1,256/r.height*2+1],v=n?t.text.dynamicLayoutVertexArray:t.icon.dynamicLayoutVertexArray;v.clear();const b=t.lineVertexArray,x=n?t.text.placedSymbolArray:t.icon.placedSymbolArray,w=r.transform.width/r.transform.height;let k=!1;for(let E=0;E<x.length;E++){const n=x.get(E);if(n.hidden||n.writingMode===e.ah.vertical&&!k){zt(n.numGlyphs,v);continue}k=!1;const S=vt(n.anchorX,n.anchorY,i,m);if(!xt(S.point,_)){zt(n.numGlyphs,v);continue}const I=bt(r.transform.cameraToCenterDistance,S.signedDistanceFromCamera),C=e.ai(g,y,n),T=s?C/I:C*I,A={getElevation:m,labelPlaneMatrix:o,lineVertexArray:b,pitchWithMap:s,projectionCache:{projections:{},offsets:{},cachedAnchorPoint:void 0,anyProjectionOccluded:!1},projection:u,tileAnchorPoint:new e.P(n.anchorX,n.anchorY),unwrappedTileID:h,width:d,height:p,translation:f},P=St(A,n,T,!1,l,i,a,t.glyphOffsetArray,v,w,c);k=P.useVertical,(P.notEnoughRoom||k||P.needsFlipping&&St(A,n,T,!0,l,i,a,t.glyphOffsetArray,v,w,c).notEnoughRoom)&&zt(n.numGlyphs,v)}n?t.text.dynamicLayoutVertexBuffer.updateData(v):t.icon.dynamicLayoutVertexBuffer.updateData(v)}function kt(t,e,i,r,n,o,a,s){const l=o.glyphStartIndex+o.numGlyphs,c=o.lineStartIndex,u=o.lineStartIndex+o.lineLength,h=e.getoffsetX(o.glyphStartIndex),d=e.getoffsetX(l-1),p=Mt(t*h,i,r,n,o.segment,c,u,s,a);if(!p)return null;const f=Mt(t*d,i,r,n,o.segment,c,u,s,a);return f?s.projectionCache.anyProjectionOccluded?null:{first:p,last:f}:null}function Et(t,i,r,n){return t===e.ah.horizontal&&Math.abs(r.y-i.y)>Math.abs(r.x-i.x)*n?{useVertical:!0}:(t===e.ah.vertical?i.y<r.y:i.x>r.x)?{needsFlipping:!0}:null}function St(t,i,r,n,o,a,s,l,c,u,h){const d=r/24,p=i.lineOffsetX*d,f=i.lineOffsetY*d;let m;if(i.numGlyphs>1){const e=i.glyphStartIndex+i.numGlyphs,r=i.lineStartIndex,a=i.lineStartIndex+i.lineLength,c=kt(d,l,p,f,n,i,h,t);if(!c)return{notEnoughRoom:!0};const g=vt(c.first.point.x,c.first.point.y,s,t.getElevation).point,y=vt(c.last.point.x,c.last.point.y,s,t.getElevation).point;if(o&&!n){const t=Et(i.writingMode,g,y,u);if(t)return t}m=[c.first];for(let o=i.glyphStartIndex+1;o<e-1;o++)m.push(Mt(d*l.getoffsetX(o),p,f,n,i.segment,r,a,t,h));m.push(c.last)}else{if(o&&!n){const r=vt(t.tileAnchorPoint.x,t.tileAnchorPoint.y,a,t.getElevation).point,n=i.lineStartIndex+i.segment+1,o=new e.P(t.lineVertexArray.getx(n),t.lineVertexArray.gety(n)),s=vt(o.x,o.y,a,t.getElevation),l=s.signedDistanceFromCamera>0?s.point:function(t,e,i,r,n,o){return It(t,e,i,1,n,o)}(t.tileAnchorPoint,o,r,0,a,t),c=Et(i.writingMode,r,l,u);if(c)return c}const r=Mt(d*l.getoffsetX(i.glyphStartIndex),p,f,n,i.segment,i.lineStartIndex,i.lineStartIndex+i.lineLength,t,h);if(!r||t.projectionCache.anyProjectionOccluded)return{notEnoughRoom:!0};m=[r]}for(const g of m)e.aj(c,g.point,g.angle);return{}}function It(t,e,i,r,n,o){const a=t.add(t.sub(e)._unit()),s=void 0!==n?vt(a.x,a.y,n,o.getElevation).point:Tt(a.x,a.y,o).point,l=i.sub(s);return i.add(l._mult(r/l.mag()))}function Ct(t,i,r){const n=i.projectionCache;if(n.projections[t])return n.projections[t];const o=new e.P(i.lineVertexArray.getx(t),i.lineVertexArray.gety(t)),a=Tt(o.x,o.y,i);if(a.signedDistanceFromCamera>0)return n.projections[t]=a.point,n.anyProjectionOccluded=n.anyProjectionOccluded||a.isOccluded,a.point;const s=t-r.direction;return function(t,e,i,r,n){return It(t,e,i,r,void 0,n)}(0===r.distanceFromAnchor?i.tileAnchorPoint:new e.P(i.lineVertexArray.getx(s),i.lineVertexArray.gety(s)),o,r.previousVertex,r.absOffsetX-r.distanceFromAnchor+1,i)}function Tt(t,e,i){const r=t+i.translation[0],n=e+i.translation[1];let o;return!i.pitchWithMap&&i.projection.useSpecialProjectionForSymbols?(o=i.projection.projectTileCoordinates(r,n,i.unwrappedTileID,i.getElevation),o.point.x=(.5*o.point.x+.5)*i.width,o.point.y=(.5*-o.point.y+.5)*i.height):(o=vt(r,n,i.labelPlaneMatrix,i.getElevation),o.isOccluded=!1),o}function At(t,e,i){return t._unit()._perp()._mult(e*i)}function Pt(t,i,r,n,o,a,s,l,c){if(l.projectionCache.offsets[t])return l.projectionCache.offsets[t];const u=r.add(i);if(t+c.direction<n||t+c.direction>=o)return l.projectionCache.offsets[t]=u,u;const h=Ct(t+c.direction,l,c),d=At(h.sub(r),s,c.direction),p=r.add(d),f=h.add(d);return l.projectionCache.offsets[t]=e.ak(a,u,p,f)||u,l.projectionCache.offsets[t]}function Mt(t,e,i,r,n,o,a,s,l){const c=r?t-e:t+e;let u=c>0?1:-1,h=0;r&&(u*=-1,h=Math.PI),u<0&&(h+=Math.PI);let d,p=u>0?o+n:o+n+1;s.projectionCache.cachedAnchorPoint?d=s.projectionCache.cachedAnchorPoint:(d=Tt(s.tileAnchorPoint.x,s.tileAnchorPoint.y,s).point,s.projectionCache.cachedAnchorPoint=d);let f,m,g=d,y=d,_=0,v=0;const b=Math.abs(c),x=[];let w;for(;_+v<=b;){if(p+=u,p<o||p>=a)return null;_+=v,y=g,m=f;const t={absOffsetX:b,direction:u,distanceFromAnchor:_,previousVertex:y};if(g=Ct(p,s,t),0===i)x.push(y),w=g.sub(y);else{let e;const r=g.sub(y);e=0===r.mag()?At(Ct(p+u,s,t).sub(g),i,u):At(r,i,u),m||(m=y.add(e)),f=Pt(p,e,g,o,a,m,i,s,t),x.push(m),w=f.sub(m)}v=w.mag()}const k=w._mult((b-_)/v)._add(m||y),E=h+Math.atan2(g.y-y.y,g.x-y.x);return x.push(k),{point:k,angle:l?E:0,path:x}}const Lt=new Float32Array([-1/0,-1/0,0,-1/0,-1/0,0,-1/0,-1/0,0,-1/0,-1/0,0]);function zt(t,e){for(let i=0;i<t;i++){const t=e.length;e.resize(t+4),e.float32.set(Lt,3*t)}}function Dt(t,e,i){const r=e[0],n=e[1];return t[0]=i[0]*r+i[4]*n+i[12],t[1]=i[1]*r+i[5]*n+i[13],t[3]=i[3]*r+i[7]*n+i[15],t}const Rt=100;class Ot{constructor(t,e,i=new gt(t.width+200,t.height+200,25),r=new gt(t.width+200,t.height+200,25)){this.transform=t,this.mapProjection=e,this.grid=i,this.ignoredGrid=r,this.pitchFactor=Math.cos(t._pitch)*t.cameraToCenterDistance,this.screenRightBoundary=t.width+Rt,this.screenBottomBoundary=t.height+Rt,this.gridRightBoundary=t.width+200,this.gridBottomBoundary=t.height+200,this.perspectiveRatioCutoff=.6}placeCollisionBox(t,e,i,r,n,o,a,s,l,c,u){const h=t.anchorPointX+s[0],d=t.anchorPointY+s[1],p=this.projectAndGetPerspectiveRatio(r,h,d,n,c),f=i*p.perspectiveRatio;let m;if(o||a)m=this._projectCollisionBox(t,f,r,n,o,a,s,p,c,u);else{const e=p.point.x+(u?u.x*f:0),i=p.point.y+(u?u.y*f:0);m={allPointsOccluded:!1,box:[e+t.x1*f,i+t.y1*f,e+t.x2*f,i+t.y2*f]}}const[g,y,_,v]=m.box;return this.mapProjection.useSpecialProjectionForSymbols&&(o?m.allPointsOccluded:this.mapProjection.isOccluded(h,d,n))||p.perspectiveRatio<this.perspectiveRatioCutoff||!this.isInsideGrid(g,y,_,v)||"always"!==e&&this.grid.hitTest(g,y,_,v,e,l)?{box:[g,y,_,v],placeable:!1,offscreen:!1}:{box:[g,y,_,v],placeable:!0,offscreen:this.isOffscreen(g,y,_,v)}}placeCollisionCircles(t,i,r,n,o,a,s,l,c,u,h,d,p,f,m,g){const y=[],_=new e.P(i.anchorX,i.anchorY),v=this.getPerspectiveRatio(a,_.x,_.y,s,g),b=(h?o/v:o*v)/e.ap,x={getElevation:g,labelPlaneMatrix:l,lineVertexArray:r,pitchWithMap:h,projectionCache:{projections:{},offsets:{},cachedAnchorPoint:void 0,anyProjectionOccluded:!1},projection:this.mapProjection,tileAnchorPoint:_,unwrappedTileID:s,width:this.transform.width,height:this.transform.height,translation:m},w=kt(b,n,i.lineOffsetX*b,i.lineOffsetY*b,!1,i,!1,x);let k=!1,E=!1,S=!0;if(w){const i=.5*p*v+f,r=new e.P(-100,-100),n=new e.P(this.screenRightBoundary,this.screenBottomBoundary),o=new ft,a=w.first,s=w.last;let l=[];for(let t=a.path.length-1;t>=1;t--)l.push(a.path[t]);for(let t=1;t<s.path.length;t++)l.push(s.path[t]);const h=2.5*i;if(c){const t=this.projectPathToScreenSpace(l,x,c);l=t.some((t=>t.signedDistanceFromCamera<=0))?[]:t.map((t=>t.point))}let m=[];if(l.length>0){const t=l[0].clone(),i=l[0].clone();for(let e=1;e<l.length;e++)t.x=Math.min(t.x,l[e].x),t.y=Math.min(t.y,l[e].y),i.x=Math.max(i.x,l[e].x),i.y=Math.max(i.y,l[e].y);m=t.x>=r.x&&i.x<=n.x&&t.y>=r.y&&i.y<=n.y?[l]:i.x<r.x||t.x>n.x||i.y<r.y||t.y>n.y?[]:e.al([l],r.x,r.y,n.x,n.y)}for(const e of m){o.reset(e,.25*i);let r=0;r=o.length<=.5*i?1:Math.ceil(o.paddedLength/h)+1;for(let e=0;e<r;e++){const n=e/Math.max(r-1,1),a=o.lerp(n),s=a.x+Rt,l=a.y+Rt;y.push(s,l,i,0);const c=s-i,h=l-i,p=s+i,f=l+i;if(S=S&&this.isOffscreen(c,h,p,f),E=E||this.isInsideGrid(c,h,p,f),"always"!==t&&this.grid.hitTestCircle(s,l,i,t,d)&&(k=!0,!u))return{circles:[],offscreen:!1,collisionDetected:k}}}}return{circles:!u&&k||!E||v<this.perspectiveRatioCutoff?[]:y,offscreen:S,collisionDetected:k}}projectPathToScreenSpace(t,e,i){return t.map((t=>vt(t.x,t.y,i,e.getElevation)))}queryRenderedSymbols(t){if(0===t.length||0===this.grid.keysLength()&&0===this.ignoredGrid.keysLength())return{};const i=[];let r=1/0,n=1/0,o=-1/0,a=-1/0;for(const u of t){const t=new e.P(u.x+Rt,u.y+Rt);r=Math.min(r,t.x),n=Math.min(n,t.y),o=Math.max(o,t.x),a=Math.max(a,t.y),i.push(t)}const s=this.grid.query(r,n,o,a).concat(this.ignoredGrid.query(r,n,o,a)),l={},c={};for(const u of s){const t=u.key;if(void 0===l[t.bucketInstanceId]&&(l[t.bucketInstanceId]={}),l[t.bucketInstanceId][t.featureIndex])continue;const r=[new e.P(u.x1,u.y1),new e.P(u.x2,u.y1),new e.P(u.x2,u.y2),new e.P(u.x1,u.y2)];e.am(i,r)&&(l[t.bucketInstanceId][t.featureIndex]=!0,void 0===c[t.bucketInstanceId]&&(c[t.bucketInstanceId]=[]),c[t.bucketInstanceId].push(t.featureIndex))}return c}insertCollisionBox(t,e,i,r,n,o){(i?this.ignoredGrid:this.grid).insert({bucketInstanceId:r,featureIndex:n,collisionGroupID:o,overlapMode:e},t[0],t[1],t[2],t[3])}insertCollisionCircles(t,e,i,r,n,o){const a=i?this.ignoredGrid:this.grid,s={bucketInstanceId:r,featureIndex:n,collisionGroupID:o,overlapMode:e};for(let l=0;l<t.length;l+=4)a.insertCircle(s,t[l],t[l+1],t[l+2])}projectAndGetPerspectiveRatio(t,i,r,n,o){let a;o?(a=[i,r,o(i,r),1],e.af(a,a,t)):(a=[i,r,0,1],Dt(a,a,t));const s=a[3];return{point:new e.P((a[0]/s+1)/2*this.transform.width+Rt,(-a[1]/s+1)/2*this.transform.height+Rt),perspectiveRatio:.5+this.transform.cameraToCenterDistance/s*.5,isOccluded:!1,signedDistanceFromCamera:s}}getPerspectiveRatio(t,e,i,r,n){const o=this.mapProjection.useSpecialProjectionForSymbols?this.mapProjection.projectTileCoordinates(e,i,r,n):vt(e,i,t,n);return.5+this.transform.cameraToCenterDistance/o.signedDistanceFromCamera*.5}isOffscreen(t,e,i,r){return i<Rt||t>=this.screenRightBoundary||r<Rt||e>this.screenBottomBoundary}isInsideGrid(t,e,i,r){return i>=0&&t<this.gridRightBoundary&&r>=0&&e<this.gridBottomBoundary}getViewportMatrix(){const t=e.an([]);return e.J(t,t,[-100,-100,0]),t}_projectCollisionBox(t,i,r,n,o,a,s,l,c,u){let h=new e.P(1,0),d=new e.P(0,1);const p=new e.P(t.anchorPointX+s[0],t.anchorPointY+s[1]);if(a&&!o){const t=this.projectAndGetPerspectiveRatio(r,p.x+1,p.y,n,c).point.sub(l.point).unit(),i=Math.atan(t.y/t.x)+(t.x<0?Math.PI:0),o=Math.sin(i),a=Math.cos(i);h=new e.P(a,o),d=new e.P(-o,a)}else if(!a&&o){const t=-this.transform.angle,i=Math.sin(t),r=Math.cos(t);h=new e.P(r,i),d=new e.P(-i,r)}let f=l.point,m=i;if(o){f=p;const t=this.transform.zoom-Math.floor(this.transform.zoom);m=Math.pow(2,-t),m*=this.mapProjection.getPitchedTextCorrection(this.transform,p,n),u||(m*=e.ac(.5+l.signedDistanceFromCamera/this.transform.cameraToCenterDistance*.5,0,4))}u&&(f=f.add(h.mult(u.x*m)).add(d.mult(u.y*m)));const g=t.x1*m,y=t.x2*m,_=(g+y)/2,v=t.y1*m,b=t.y2*m,x=(v+b)/2,w=[{offsetX:g,offsetY:v},{offsetX:_,offsetY:v},{offsetX:y,offsetY:v},{offsetX:y,offsetY:x},{offsetX:y,offsetY:b},{offsetX:_,offsetY:b},{offsetX:g,offsetY:b},{offsetX:g,offsetY:x}];let k=[];for(const{offsetX:S,offsetY:I}of w)k.push(new e.P(f.x+h.x*S+d.x*I,f.y+h.y*S+d.y*I));let E=!1;if(o){const t=k.map((t=>this.projectAndGetPerspectiveRatio(r,t.x,t.y,n,c)));E=t.some((t=>!t.isOccluded)),k=t.map((t=>t.point))}else E=!0;return{box:e.ao(k),allPointsOccluded:!E}}}function Ft(t,i,r){return i*(e.X/(t.tileSize*Math.pow(2,r-t.tileID.overscaledZ)))}class Bt{constructor(t,e,i,r){this.opacity=t?Math.max(0,Math.min(1,t.opacity+(t.placed?e:-e))):r&&i?1:0,this.placed=i}isHidden(){return 0===this.opacity&&!this.placed}}class Nt{constructor(t,e,i,r,n){this.text=new Bt(t?t.text:null,e,i,n),this.icon=new Bt(t?t.icon:null,e,r,n)}isHidden(){return this.text.isHidden()&&this.icon.isHidden()}}class jt{constructor(t,e,i){this.text=t,this.icon=e,this.skipFade=i}}class Vt{constructor(){this.invProjMatrix=e.H(),this.viewportMatrix=e.H(),this.circles=[]}}class Ut{constructor(t,e,i,r,n){this.bucketInstanceId=t,this.featureIndex=e,this.sourceLayerIndex=i,this.bucketIndex=r,this.tileID=n}}class qt{constructor(t){this.crossSourceCollisions=t,this.maxGroupID=0,this.collisionGroups={}}get(t){if(this.crossSourceCollisions)return{ID:0,predicate:null};if(!this.collisionGroups[t]){const e=++this.maxGroupID;this.collisionGroups[t]={ID:e,predicate:t=>t.collisionGroupID===e}}return this.collisionGroups[t]}}function $t(t,i,r,n,o){const{horizontalAlign:a,verticalAlign:s}=e.au(t);return new e.P(-(a-.5)*i+n[0]*o,-(s-.5)*r+n[1]*o)}class Gt{constructor(t,e,i,r,n,o){this.transform=t.clone(),this.terrain=i,this.collisionIndex=new Ot(this.transform,e),this.placements={},this.opacities={},this.variableOffsets={},this.stale=!1,this.commitTime=0,this.fadeDuration=r,this.retainedQueryData={},this.collisionGroups=new qt(n),this.collisionCircleArrays={},this.collisionBoxArrays=new Map,this.prevPlacement=o,o&&(o.prevPlacement=void 0),this.placedOrientations={}}_getTerrainElevationFunc(t){const e=this.terrain;return e?(i,r)=>e.getElevation(t,i,r):null}getBucketParts(t,i,r,n){const o=r.getBucket(i),a=r.latestFeatureIndex;if(!o||!a||i.id!==o.layerIds[0])return;const s=r.collisionBoxArray,l=o.layers[0].layout,c=o.layers[0].paint,u=Math.pow(2,this.transform.zoom-r.tileID.overscaledZ),h=r.tileSize/e.X,d=r.tileID.toUnwrapped(),p=this.transform.calculatePosMatrix(d),f="map"===l.get("text-pitch-alignment"),m="map"===l.get("text-rotation-alignment"),g=Ft(r,1,this.transform.zoom),y=this.collisionIndex.mapProjection.translatePosition(this.transform,r,c.get("text-translate"),c.get("text-translate-anchor")),_=this.collisionIndex.mapProjection.translatePosition(this.transform,r,c.get("icon-translate"),c.get("icon-translate-anchor")),v=yt(p,f,m,this.transform,g);let b=null;if(f){const t=_t(p,f,m,this.transform,g);b=e.L([],this.transform.labelPlaneMatrix,t)}this.retainedQueryData[o.bucketInstanceId]=new Ut(o.bucketInstanceId,a,o.sourceLayerIndex,o.index,r.tileID);const x={bucket:o,layout:l,translationText:y,translationIcon:_,posMatrix:p,unwrappedTileID:d,textLabelPlaneMatrix:v,labelToScreenMatrix:b,scale:u,textPixelRatio:h,holdingForFade:r.holdingForFade(),collisionBoxArray:s,partiallyEvaluatedTextSize:e.ag(o.textSizeData,this.transform.zoom),collisionGroup:this.collisionGroups.get(o.sourceID)};if(n)for(const e of o.sortKeyRanges){const{sortKey:i,symbolInstanceStart:r,symbolInstanceEnd:n}=e;t.push({sortKey:i,symbolInstanceStart:r,symbolInstanceEnd:n,parameters:x})}else t.push({symbolInstanceStart:0,symbolInstanceEnd:o.symbolInstances.length,parameters:x})}attemptAnchorPlacement(t,i,r,n,o,a,s,l,c,u,h,d,p,f,m,g,y,_,v){const b=e.aq[t.textAnchor],x=[t.textOffset0,t.textOffset1],w=$t(b,r,n,x,o),k=this.collisionIndex.placeCollisionBox(i,d,l,c,u,s,a,g,h.predicate,v,w);if((!_||this.collisionIndex.placeCollisionBox(_,d,l,c,u,s,a,y,h.predicate,v,w).placeable)&&k.placeable){let t;if(this.prevPlacement&&this.prevPlacement.variableOffsets[p.crossTileID]&&this.prevPlacement.placements[p.crossTileID]&&this.prevPlacement.placements[p.crossTileID].text&&(t=this.prevPlacement.variableOffsets[p.crossTileID].anchor),0===p.crossTileID)throw new Error("symbolInstance.crossTileID can't be 0");return this.variableOffsets[p.crossTileID]={textOffset:x,width:r,height:n,anchor:b,textBoxScale:o,prevAnchor:t},this.markUsedJustification(f,b,p,m),f.allowVerticalPlacement&&(this.markUsedOrientation(f,m,p),this.placedOrientations[p.crossTileID]=m),{shift:w,placedGlyphBoxes:k}}}placeLayerBucketPart(t,i,r){const{bucket:n,layout:o,translationText:a,translationIcon:s,posMatrix:l,unwrappedTileID:c,textLabelPlaneMatrix:u,labelToScreenMatrix:h,textPixelRatio:d,holdingForFade:p,collisionBoxArray:f,partiallyEvaluatedTextSize:m,collisionGroup:g}=t.parameters,y=o.get("text-optional"),_=o.get("icon-optional"),v=e.ar(o,"text-overlap","text-allow-overlap"),b="always"===v,x=e.ar(o,"icon-overlap","icon-allow-overlap"),w="always"===x,k="map"===o.get("text-rotation-alignment"),E="map"===o.get("text-pitch-alignment"),S="none"!==o.get("icon-text-fit"),I="viewport-y"===o.get("symbol-z-order"),C=b&&(w||!n.hasIconData()||_),T=w&&(b||!n.hasTextData()||y);!n.collisionArrays&&f&&n.deserializeCollisionBoxes(f);const A=this._getTerrainElevationFunc(this.retainedQueryData[n.bucketInstanceId].tileID),P=(t,f,w)=>{var I,P;if(i[t.crossTileID])return;if(p)return void(this.placements[t.crossTileID]=new jt(!1,!1,!1));let M=!1,L=!1,z=!0,D=null,R={box:null,placeable:!1,offscreen:null},O={placeable:!1},F=null,B=null,N=null,j=0,V=0,U=0;f.textFeatureIndex?j=f.textFeatureIndex:t.useRuntimeCollisionCircles&&(j=t.featureIndex),f.verticalTextFeatureIndex&&(V=f.verticalTextFeatureIndex);const q=f.textBox;if(q){const i=i=>{let r=e.ah.horizontal;if(n.allowVerticalPlacement&&!i&&this.prevPlacement){const e=this.prevPlacement.placedOrientations[t.crossTileID];e&&(this.placedOrientations[t.crossTileID]=e,r=e,this.markUsedOrientation(n,r,t))}return r},o=(i,r)=>{if(n.allowVerticalPlacement&&t.numVerticalGlyphVertices>0&&f.verticalTextBox){for(const t of n.writingModes)if(t===e.ah.vertical?(R=r(),O=R):R=i(),R&&R.placeable)break}else R=i()},u=t.textAnchorOffsetStartIndex,h=t.textAnchorOffsetEndIndex;if(h===u){const r=(e,i)=>{const r=this.collisionIndex.placeCollisionBox(e,v,d,l,c,E,k,a,g.predicate,A);return r&&r.placeable&&(this.markUsedOrientation(n,i,t),this.placedOrientations[t.crossTileID]=i),r};o((()=>r(q,e.ah.horizontal)),(()=>{const i=f.verticalTextBox;return n.allowVerticalPlacement&&t.numVerticalGlyphVertices>0&&i?r(i,e.ah.vertical):{box:null,offscreen:null}})),i(R&&R.placeable)}else{let p=e.aq[null===(P=null===(I=this.prevPlacement)||void 0===I?void 0:I.variableOffsets[t.crossTileID])||void 0===P?void 0:P.anchor];const m=(i,o,f)=>{const m=i.x2-i.x1,y=i.y2-i.y1,_=t.textBoxScale,b=S&&"never"===x?o:null;let w=null,I="never"===v?1:2,C="never";p&&I++;for(let e=0;e<I;e++){for(let e=u;e<h;e++){const r=n.textAnchorOffsets.get(e);if(p&&r.textAnchor!==p)continue;const o=this.attemptAnchorPlacement(r,i,m,y,_,k,E,d,l,c,g,C,t,n,f,a,s,b,A);if(o&&(w=o.placedGlyphBoxes,w&&w.placeable))return M=!0,D=o.shift,w}p?p=null:C=v}return r&&!w&&(w={box:this.collisionIndex.placeCollisionBox(q,"always",d,l,c,E,k,a,g.predicate,A,new e.P(0,0)).box,offscreen:!1,placeable:!1}),w};o((()=>m(q,f.iconBox,e.ah.horizontal)),(()=>{const i=f.verticalTextBox;return n.allowVerticalPlacement&&(!R||!R.placeable)&&t.numVerticalGlyphVertices>0&&i?m(i,f.verticalIconBox,e.ah.vertical):{box:null,occluded:!0,offscreen:null}})),R&&(M=R.placeable,z=R.offscreen);const y=i(R&&R.placeable);if(!M&&this.prevPlacement){const e=this.prevPlacement.variableOffsets[t.crossTileID];e&&(this.variableOffsets[t.crossTileID]=e,this.markUsedJustification(n,e.anchor,t,y))}}}if(F=R,M=F&&F.placeable,z=F&&F.offscreen,t.useRuntimeCollisionCircles){const i=n.text.placedSymbolArray.get(t.centerJustifiedTextSymbolIndex),s=e.ai(n.textSizeData,m,i),d=o.get("text-padding");B=this.collisionIndex.placeCollisionCircles(v,i,n.lineVertexArray,n.glyphOffsetArray,s,l,c,u,h,r,E,g.predicate,t.collisionCircleDiameter,d,a,A),B.circles.length&&B.collisionDetected&&!r&&e.w("Collisions detected, but collision boxes are not shown"),M=b||B.circles.length>0&&!B.collisionDetected,z=z&&B.offscreen}if(f.iconFeatureIndex&&(U=f.iconFeatureIndex),f.iconBox){const t=t=>this.collisionIndex.placeCollisionBox(t,x,d,l,c,E,k,s,g.predicate,A,S&&D?D:void 0);O&&O.placeable&&f.verticalIconBox?(N=t(f.verticalIconBox),L=N.placeable):(N=t(f.iconBox),L=N.placeable),z=z&&N.offscreen}const $=y||0===t.numHorizontalGlyphVertices&&0===t.numVerticalGlyphVertices,G=_||0===t.numIconVertices;$||G?G?$||(L=L&&M):M=L&&M:L=M=L&&M;const H=L&&N.placeable;if(M&&F.placeable&&this.collisionIndex.insertCollisionBox(F.box,v,o.get("text-ignore-placement"),n.bucketInstanceId,O&&O.placeable&&V?V:j,g.ID),H&&this.collisionIndex.insertCollisionBox(N.box,x,o.get("icon-ignore-placement"),n.bucketInstanceId,U,g.ID),B&&M&&this.collisionIndex.insertCollisionCircles(B.circles,v,o.get("text-ignore-placement"),n.bucketInstanceId,j,g.ID),r&&this.storeCollisionData(n.bucketInstanceId,w,f,F,N,B),0===t.crossTileID)throw new Error("symbolInstance.crossTileID can't be 0");if(0===n.bucketInstanceId)throw new Error("bucket.bucketInstanceId can't be 0");this.placements[t.crossTileID]=new jt(M||C,L||T,z||n.justReloaded),i[t.crossTileID]=!0};if(I){if(0!==t.symbolInstanceStart)throw new Error("bucket.bucketInstanceId should be 0");const e=n.getSortedSymbolIndexes(this.transform.angle);for(let t=e.length-1;t>=0;--t){const i=e[t];P(n.symbolInstances.get(i),n.collisionArrays[i],i)}}else for(let e=t.symbolInstanceStart;e<t.symbolInstanceEnd;e++)P(n.symbolInstances.get(e),n.collisionArrays[e],e);if(r&&n.bucketInstanceId in this.collisionCircleArrays){const t=this.collisionCircleArrays[n.bucketInstanceId];e.as(t.invProjMatrix,l),t.viewportMatrix=this.collisionIndex.getViewportMatrix()}n.justReloaded=!1}storeCollisionData(t,e,i,r,n,o){if(i.textBox||i.iconBox){let o,a;this.collisionBoxArrays.has(t)?o=this.collisionBoxArrays.get(t):(o=new Map,this.collisionBoxArrays.set(t,o)),o.has(e)?a=o.get(e):(a={text:null,icon:null},o.set(e,a)),i.textBox&&(a.text=r.box),i.iconBox&&(a.icon=n.box)}if(o){let e=this.collisionCircleArrays[t];void 0===e&&(e=this.collisionCircleArrays[t]=new Vt);for(let t=0;t<o.circles.length;t+=4)e.circles.push(o.circles[t+0]),e.circles.push(o.circles[t+1]),e.circles.push(o.circles[t+2]),e.circles.push(o.collisionDetected?1:0)}}markUsedJustification(t,i,r,n){let o;o=n===e.ah.vertical?r.verticalPlacedTextSymbolIndex:{left:r.leftJustifiedTextSymbolIndex,center:r.centerJustifiedTextSymbolIndex,right:r.rightJustifiedTextSymbolIndex}[e.at(i)];const a=[r.leftJustifiedTextSymbolIndex,r.centerJustifiedTextSymbolIndex,r.rightJustifiedTextSymbolIndex,r.verticalPlacedTextSymbolIndex];for(const e of a)e>=0&&(t.text.placedSymbolArray.get(e).crossTileID=o>=0&&e!==o?0:r.crossTileID)}markUsedOrientation(t,i,r){const n=i===e.ah.horizontal||i===e.ah.horizontalOnly?i:0,o=i===e.ah.vertical?i:0,a=[r.leftJustifiedTextSymbolIndex,r.centerJustifiedTextSymbolIndex,r.rightJustifiedTextSymbolIndex];for(const e of a)t.text.placedSymbolArray.get(e).placedOrientation=n;r.verticalPlacedTextSymbolIndex&&(t.text.placedSymbolArray.get(r.verticalPlacedTextSymbolIndex).placedOrientation=o)}commit(t){this.commitTime=t,this.zoomAtLastRecencyCheck=this.transform.zoom;const e=this.prevPlacement;let i=!1;this.prevZoomAdjustment=e?e.zoomAdjustment(this.transform.zoom):0;const r=e?e.symbolFadeChange(t):1,n=e?e.opacities:{},o=e?e.variableOffsets:{},a=e?e.placedOrientations:{};for(const s in this.placements){const t=this.placements[s],e=n[s];e?(this.opacities[s]=new Nt(e,r,t.text,t.icon),i=i||t.text!==e.text.placed||t.icon!==e.icon.placed):(this.opacities[s]=new Nt(null,r,t.text,t.icon,t.skipFade),i=i||t.text||t.icon)}for(const s in n){const t=n[s];if(!this.opacities[s]){const e=new Nt(t,r,!1,!1);e.isHidden()||(this.opacities[s]=e,i=i||t.text.placed||t.icon.placed)}}for(const s in o)this.variableOffsets[s]||!this.opacities[s]||this.opacities[s].isHidden()||(this.variableOffsets[s]=o[s]);for(const s in a)this.placedOrientations[s]||!this.opacities[s]||this.opacities[s].isHidden()||(this.placedOrientations[s]=a[s]);if(e&&void 0===e.lastPlacementChangeTime)throw new Error("Last placement time for previous placement is not defined");i?this.lastPlacementChangeTime=t:"number"!=typeof this.lastPlacementChangeTime&&(this.lastPlacementChangeTime=e?e.lastPlacementChangeTime:t)}updateLayerOpacities(t,e){const i={};for(const r of e){const e=r.getBucket(t);e&&r.latestFeatureIndex&&t.id===e.layerIds[0]&&this.updateBucketOpacities(e,r.tileID,i,r.collisionBoxArray)}}updateBucketOpacities(t,i,r,n){t.hasTextData()&&(t.text.opacityVertexArray.clear(),t.text.hasVisibleVertices=!1),t.hasIconData()&&(t.icon.opacityVertexArray.clear(),t.icon.hasVisibleVertices=!1),t.hasIconCollisionBoxData()&&t.iconCollisionBox.collisionVertexArray.clear(),t.hasTextCollisionBoxData()&&t.textCollisionBox.collisionVertexArray.clear();const o=t.layers[0],a=o.layout,s=new Nt(null,0,!1,!1,!0),l=a.get("text-allow-overlap"),c=a.get("icon-allow-overlap"),u=o._unevaluatedLayout.hasValue("text-variable-anchor")||o._unevaluatedLayout.hasValue("text-variable-anchor-offset"),h="map"===a.get("text-rotation-alignment"),d="map"===a.get("text-pitch-alignment"),p="none"!==a.get("icon-text-fit"),f=new Nt(null,0,l&&(c||!t.hasIconData()||a.get("icon-optional")),c&&(l||!t.hasTextData()||a.get("text-optional")),!0);!t.collisionArrays&&n&&(t.hasIconCollisionBoxData()||t.hasTextCollisionBoxData())&&t.deserializeCollisionBoxes(n);const m=(t,e,i)=>{for(let r=0;r<e/4;r++)t.opacityVertexArray.emplaceBack(i);t.hasVisibleVertices=t.hasVisibleVertices||i!==ee},g=this.collisionBoxArrays.get(t.bucketInstanceId);for(let y=0;y<t.symbolInstances.length;y++){const i=t.symbolInstances.get(y),{numHorizontalGlyphVertices:n,numVerticalGlyphVertices:o,crossTileID:a}=i;let l=this.opacities[a];r[a]?l=s:l||(l=f,this.opacities[a]=l),r[a]=!0;const c=i.numIconVertices>0,_=this.placedOrientations[i.crossTileID],v=_===e.ah.vertical,b=_===e.ah.horizontal||_===e.ah.horizontalOnly;if(n>0||o>0){const e=te(l.text);m(t.text,n,v?ee:e),m(t.text,o,b?ee:e);const r=l.text.isHidden();[i.rightJustifiedTextSymbolIndex,i.centerJustifiedTextSymbolIndex,i.leftJustifiedTextSymbolIndex].forEach((e=>{e>=0&&(t.text.placedSymbolArray.get(e).hidden=r||v?1:0)})),i.verticalPlacedTextSymbolIndex>=0&&(t.text.placedSymbolArray.get(i.verticalPlacedTextSymbolIndex).hidden=r||b?1:0);const a=this.variableOffsets[i.crossTileID];a&&this.markUsedJustification(t,a.anchor,i,_);const s=this.placedOrientations[i.crossTileID];s&&(this.markUsedJustification(t,"left",i,s),this.markUsedOrientation(t,s,i))}if(c){const e=te(l.icon),r=!(p&&i.verticalPlacedIconSymbolIndex&&v);i.placedIconSymbolIndex>=0&&(m(t.icon,i.numIconVertices,r?e:ee),t.icon.placedSymbolArray.get(i.placedIconSymbolIndex).hidden=l.icon.isHidden()),i.verticalPlacedIconSymbolIndex>=0&&(m(t.icon,i.numVerticalIconVertices,r?ee:e),t.icon.placedSymbolArray.get(i.verticalPlacedIconSymbolIndex).hidden=l.icon.isHidden())}const x=g&&g.has(y)?g.get(y):{text:null,icon:null};if(t.hasIconCollisionBoxData()||t.hasTextCollisionBoxData()){const i=t.collisionArrays[y];if(i){let r=new e.P(0,0);if(i.textBox||i.verticalTextBox){let e=!0;if(u){const t=this.variableOffsets[a];t?(r=$t(t.anchor,t.width,t.height,t.textOffset,t.textBoxScale),h&&r._rotate(d?this.transform.angle:-this.transform.angle)):e=!1}if(i.textBox||i.verticalTextBox){let n;i.textBox&&(n=v),i.verticalTextBox&&(n=b),Ht(t.textCollisionBox.collisionVertexArray,l.text.placed,!e||n,x.text,r.x,r.y)}}if(i.iconBox||i.verticalIconBox){const e=Boolean(!b&&i.verticalIconBox);let n;i.iconBox&&(n=e),i.verticalIconBox&&(n=!e),Ht(t.iconCollisionBox.collisionVertexArray,l.icon.placed,n,x.icon,p?r.x:0,p?r.y:0)}}}}if(t.sortFeatures(this.transform.angle),this.retainedQueryData[t.bucketInstanceId]&&(this.retainedQueryData[t.bucketInstanceId].featureSortOrder=t.featureSortOrder),t.hasTextData()&&t.text.opacityVertexBuffer&&t.text.opacityVertexBuffer.updateData(t.text.opacityVertexArray),t.hasIconData()&&t.icon.opacityVertexBuffer&&t.icon.opacityVertexBuffer.updateData(t.icon.opacityVertexArray),t.hasIconCollisionBoxData()&&t.iconCollisionBox.collisionVertexBuffer&&t.iconCollisionBox.collisionVertexBuffer.updateData(t.iconCollisionBox.collisionVertexArray),t.hasTextCollisionBoxData()&&t.textCollisionBox.collisionVertexBuffer&&t.textCollisionBox.collisionVertexBuffer.updateData(t.textCollisionBox.collisionVertexArray),t.text.opacityVertexArray.length!==t.text.layoutVertexArray.length/4)throw new Error(`bucket.text.opacityVertexArray.length (= ${t.text.opacityVertexArray.length}) !== bucket.text.layoutVertexArray.length (= ${t.text.layoutVertexArray.length}) / 4`);if(t.icon.opacityVertexArray.length!==t.icon.layoutVertexArray.length/4)throw new Error(`bucket.icon.opacityVertexArray.length (= ${t.icon.opacityVertexArray.length}) !== bucket.icon.layoutVertexArray.length (= ${t.icon.layoutVertexArray.length}) / 4`);if(t.bucketInstanceId in this.collisionCircleArrays){const e=this.collisionCircleArrays[t.bucketInstanceId];t.placementInvProjMatrix=e.invProjMatrix,t.placementViewportMatrix=e.viewportMatrix,t.collisionCircleArray=e.circles,delete this.collisionCircleArrays[t.bucketInstanceId]}}symbolFadeChange(t){return 0===this.fadeDuration?1:(t-this.commitTime)/this.fadeDuration+this.prevZoomAdjustment}zoomAdjustment(t){return Math.max(0,(this.transform.zoom-t)/1.5)}hasTransitions(t){return this.stale||t-this.lastPlacementChangeTime<this.fadeDuration}stillRecent(t,e){const i=this.zoomAtLastRecencyCheck===e?1-this.zoomAdjustment(e):1;return this.zoomAtLastRecencyCheck=e,this.commitTime+this.fadeDuration*i>t}setStale(){this.stale=!0}}function Ht(t,e,i,r,n,o){r&&0!==r.length||(r=[0,0,0,0]);const a=r[0]-Rt,s=r[1]-Rt,l=r[2]-Rt,c=r[3]-Rt;t.emplaceBack(e?1:0,i?1:0,n||0,o||0,a,s),t.emplaceBack(e?1:0,i?1:0,n||0,o||0,l,s),t.emplaceBack(e?1:0,i?1:0,n||0,o||0,l,c),t.emplaceBack(e?1:0,i?1:0,n||0,o||0,a,c)}const Zt=Math.pow(2,25),Wt=Math.pow(2,24),Xt=Math.pow(2,17),Jt=Math.pow(2,16),Kt=Math.pow(2,9),Yt=Math.pow(2,8),Qt=Math.pow(2,1);function te(t){if(0===t.opacity&&!t.placed)return 0;if(1===t.opacity&&t.placed)return 4294967295;const e=t.placed?1:0,i=Math.floor(127*t.opacity);return i*Zt+e*Wt+i*Xt+e*Jt+i*Kt+e*Yt+i*Qt+e}const ee=0;function ie(){return{isOccluded:(t,e,i)=>!1,getPitchedTextCorrection:(t,e,i)=>1,get useSpecialProjectionForSymbols(){return!1},projectTileCoordinates(t,e,i,r){throw new Error("Not implemented.")},translatePosition:(t,e,i,r)=>function(t,e,i,r,n=!1){if(!i[0]&&!i[1])return[0,0];const o=n?"map"===r?t.angle:0:"viewport"===r?-t.angle:0;if(o){const t=Math.sin(o),e=Math.cos(o);i=[i[0]*e-i[1]*t,i[0]*t+i[1]*e]}return[n?i[0]:Ft(e,i[0],t.zoom),n?i[1]:Ft(e,i[1],t.zoom)]}(t,e,i,r),getCircleRadiusCorrection:t=>1}}class re{constructor(t){this._sortAcrossTiles="viewport-y"!==t.layout.get("symbol-z-order")&&!t.layout.get("symbol-sort-key").isConstant(),this._currentTileIndex=0,this._currentPartIndex=0,this._seenCrossTileIDs={},this._bucketParts=[]}continuePlacement(t,e,i,r,n){const o=this._bucketParts;for(;this._currentTileIndex<t.length;)if(e.getBucketParts(o,r,t[this._currentTileIndex],this._sortAcrossTiles),this._currentTileIndex++,n())return!0;for(this._sortAcrossTiles&&(this._sortAcrossTiles=!1,o.sort(((t,e)=>t.sortKey-e.sortKey)));this._currentPartIndex<o.length;)if(e.placeLayerBucketPart(o[this._currentPartIndex],this._seenCrossTileIDs,i),this._currentPartIndex++,n())return!0;return!1}}class ne{constructor(t,e,i,r,n,o,a,s){this.placement=new Gt(t,ie(),e,o,a,s),this._currentPlacementIndex=i.length-1,this._forceFullPlacement=r,this._showCollisionBoxes=n,this._done=!1}isDone(){return this._done}continuePlacement(t,e,i){const r=o.now(),n=()=>!this._forceFullPlacement&&o.now()-r>2;for(;this._currentPlacementIndex>=0;){const r=e[t[this._currentPlacementIndex]],o=this.placement.collisionIndex.transform.zoom;if("symbol"===r.type&&(!r.minzoom||r.minzoom<=o)&&(!r.maxzoom||r.maxzoom>o)){if(this._inProgressLayer||(this._inProgressLayer=new re(r)),this._inProgressLayer.continuePlacement(i[r.source],this.placement,this._showCollisionBoxes,r,n))return;delete this._inProgressLayer}this._currentPlacementIndex--}this._done=!0}commit(t){return this.placement.commit(t),this.placement}}const oe=512/e.X/2;class ae{constructor(t,i,r){this.tileID=t,this.bucketInstanceId=r,this._symbolsByKey={};const n=new Map;for(let e=0;e<i.length;e++){const t=i.get(e),r=t.key,o=n.get(r);o?o.push(t):n.set(r,[t])}for(const[o,a]of n){const t={positions:a.map((t=>({x:Math.floor(t.anchorX*oe),y:Math.floor(t.anchorY*oe)}))),crossTileIDs:a.map((t=>t.crossTileID))};if(t.positions.length>128){const i=new e.av(t.positions.length,16,Uint16Array);for(const{x:e,y:r}of t.positions)i.add(e,r);i.finish(),delete t.positions,t.index=i}this._symbolsByKey[o]=t}}getScaledCoordinates(t,i){const{x:r,y:n,z:o}=this.tileID.canonical,{x:a,y:s,z:l}=i.canonical,c=oe/Math.pow(2,l-o),u=(s*e.X+t.anchorY)*c,h=n*e.X*oe;return{x:Math.floor((a*e.X+t.anchorX)*c-r*e.X*oe),y:Math.floor(u-h)}}findMatches(t,e,i){const r=this.tileID.canonical.z<e.canonical.z?1:Math.pow(2,this.tileID.canonical.z-e.canonical.z);for(let n=0;n<t.length;n++){const o=t.get(n);if(o.crossTileID)continue;const a=this._symbolsByKey[o.key];if(!a)continue;const s=this.getScaledCoordinates(o,e);if(a.index){const t=a.index.range(s.x-r,s.y-r,s.x+r,s.y+r).sort();for(const e of t){const t=a.crossTileIDs[e];if(!i[t]){i[t]=!0,o.crossTileID=t;break}}}else if(a.positions)for(let t=0;t<a.positions.length;t++){const e=a.positions[t],n=a.crossTileIDs[t];if(Math.abs(e.x-s.x)<=r&&Math.abs(e.y-s.y)<=r&&!i[n]){i[n]=!0,o.crossTileID=n;break}}}}getCrossTileIDsLists(){return Object.values(this._symbolsByKey).map((({crossTileIDs:t})=>t))}}class se{constructor(){this.maxCrossTileID=0}generate(){return++this.maxCrossTileID}}class le{constructor(){this.indexes={},this.usedCrossTileIDs={},this.lng=0}handleWrapJump(t){const e=Math.round((t-this.lng)/360);if(0!==e)for(const i in this.indexes){const t=this.indexes[i],r={};for(const i in t){const n=t[i];n.tileID=n.tileID.unwrapTo(n.tileID.wrap+e),r[n.tileID.key]=n}this.indexes[i]=r}this.lng=t}addBucket(t,e,i){if(this.indexes[t.overscaledZ]&&this.indexes[t.overscaledZ][t.key]){if(this.indexes[t.overscaledZ][t.key].bucketInstanceId===e.bucketInstanceId)return!1;this.removeBucketCrossTileIDs(t.overscaledZ,this.indexes[t.overscaledZ][t.key])}for(let n=0;n<e.symbolInstances.length;n++)e.symbolInstances.get(n).crossTileID=0;this.usedCrossTileIDs[t.overscaledZ]||(this.usedCrossTileIDs[t.overscaledZ]={});const r=this.usedCrossTileIDs[t.overscaledZ];for(const n in this.indexes){const i=this.indexes[n];if(Number(n)>t.overscaledZ)for(const n in i){const o=i[n];o.tileID.isChildOf(t)&&o.findMatches(e.symbolInstances,t,r)}else{const o=i[t.scaledTo(Number(n)).key];o&&o.findMatches(e.symbolInstances,t,r)}}for(let n=0;n<e.symbolInstances.length;n++){const t=e.symbolInstances.get(n);t.crossTileID||(t.crossTileID=i.generate(),r[t.crossTileID]=!0)}return void 0===this.indexes[t.overscaledZ]&&(this.indexes[t.overscaledZ]={}),this.indexes[t.overscaledZ][t.key]=new ae(t,e.symbolInstances,e.bucketInstanceId),!0}removeBucketCrossTileIDs(t,e){for(const i of e.getCrossTileIDsLists())for(const e of i)delete this.usedCrossTileIDs[t][e]}removeStaleBuckets(t){let e=!1;for(const i in this.indexes){const r=this.indexes[i];for(const n in r)t[r[n].bucketInstanceId]||(this.removeBucketCrossTileIDs(i,r[n]),delete r[n],e=!0)}return e}}class ce{constructor(){this.layerIndexes={},this.crossTileIDs=new se,this.maxBucketInstanceId=0,this.bucketsInCurrentPlacement={}}addLayer(t,e,i){let r=this.layerIndexes[t.id];void 0===r&&(r=this.layerIndexes[t.id]=new le);let n=!1;const o={};r.handleWrapJump(i);for(const a of e){const e=a.getBucket(t);e&&t.id===e.layerIds[0]&&(e.bucketInstanceId||(e.bucketInstanceId=++this.maxBucketInstanceId),r.addBucket(a.tileID,e,this.crossTileIDs)&&(n=!0),o[e.bucketInstanceId]=!0)}return r.removeStaleBuckets(o)&&(n=!0),n}pruneUnusedLayers(t){const e={};t.forEach((t=>{e[t]=!0}));for(const i in this.layerIndexes)e[i]||delete this.layerIndexes[i]}}const ue=(t,i)=>e.t(t,i&&i.filter((t=>"source.canvas"!==t.identifier))),he=e.aw();class de extends e.E{constructor(t,i={}){super(),this._rtlPluginLoaded=()=>{for(const t in this.sourceCaches){const e=this.sourceCaches[t].getSource().type;"vector"!==e&&"geojson"!==e||this.sourceCaches[t].reload()}},this.map=t,this.dispatcher=new j(N(),t._getMapId()),this.dispatcher.registerMessageHandler("GG",((t,e)=>this.getGlyphs(t,e))),this.dispatcher.registerMessageHandler("GI",((t,e)=>this.getImages(t,e))),this.imageManager=new k,this.imageManager.setEventedParent(this),this.glyphManager=new C(t._requestManager,i.localIdeographFontFamily),this.lineAtlas=new z(256,512),this.crossTileSymbolIndex=new ce,this._spritesImagesIds={},this._layers={},this._order=[],this.sourceCaches={},this.zoomHistory=new e.ax,this._loaded=!1,this._availableImages=[],this._resetUpdates(),this.dispatcher.broadcast("SR",e.ay()),st().on(nt,this._rtlPluginLoaded),this.on("data",(t=>{if("source"!==t.dataType||"metadata"!==t.sourceDataType)return;const e=this.sourceCaches[t.sourceId];if(!e)return;const i=e.getSource();if(i&&i.vectorLayerIds)for(const r in this._layers){const t=this._layers[r];t.source===i.id&&this._validateLayer(t)}}))}loadURL(t,i={},r){this.fire(new e.k("dataloading",{dataType:"style"})),i.validate="boolean"!=typeof i.validate||i.validate;const n=this.map._requestManager.transformRequest(t,"Style");this._loadStyleRequest=new AbortController;const o=this._loadStyleRequest;e.h(n,this._loadStyleRequest).then((t=>{this._loadStyleRequest=null,this._load(t.data,i,r)})).catch((t=>{this._loadStyleRequest=null,t&&!o.signal.aborted&&this.fire(new e.j(t))}))}loadJSON(t,i={},r){this.fire(new e.k("dataloading",{dataType:"style"})),this._frameRequest=new AbortController,o.frameAsync(this._frameRequest).then((()=>{this._frameRequest=null,i.validate=!1!==i.validate,this._load(t,i,r)})).catch((()=>{}))}loadEmpty(){this.fire(new e.k("dataloading",{dataType:"style"})),this._load(he,{validate:!1})}_load(t,i,r){var n;const o=i.transformStyle?i.transformStyle(r,t):t;if(!i.validate||!ue(this,e.u(o))){this._loaded=!0,this.stylesheet=o;for(const t in o.sources)this.addSource(t,o.sources[t],{validate:!1});o.sprite?this._loadSprite(o.sprite):this.imageManager.setLoaded(!0),this.glyphManager.setURL(o.glyphs),this._createLayers(),this.light=new P(this.stylesheet.light),this.sky=new L(this.stylesheet.sky),this.map.setTerrain(null!==(n=this.stylesheet.terrain)&&void 0!==n?n:null),this.fire(new e.k("data",{dataType:"style"})),this.fire(new e.k("style.load"))}}_createLayers(){const t=e.az(this.stylesheet.layers);this.dispatcher.broadcast("SL",t),this._order=t.map((t=>t.id)),this._layers={},this._serializedLayers=null;for(const i of t){const t=e.aA(i);t.setEventedParent(this,{layer:{id:i.id}}),this._layers[i.id]=t}}_loadSprite(t,i=!1,r=void 0){let n;this.imageManager.setLoaded(!1),this._spriteRequest=new AbortController,function(t,i,r,n){return e._(this,void 0,void 0,(function*(){const a=v(t),s=r>1?"@2x":"",l={},c={};for(const{id:t,url:r}of a){const o=i.transformRequest(b(r,s,".json"),"SpriteJSON");l[t]=e.h(o,n);const a=i.transformRequest(b(r,s,".png"),"SpriteImage");c[t]=p.getImage(a,n)}return yield Promise.all([...Object.values(l),...Object.values(c)]),function(t,i){return e._(this,void 0,void 0,(function*(){const e={};for(const r in t){e[r]={};const n=o.getImageCanvasContext((yield i[r]).data),a=(yield t[r]).data;for(const t in a){const{width:i,height:o,x:s,y:l,sdf:c,pixelRatio:u,stretchX:h,stretchY:d,content:p,textFitWidth:f,textFitHeight:m}=a[t];e[r][t]={data:null,pixelRatio:u,sdf:c,stretchX:h,stretchY:d,content:p,textFitWidth:f,textFitHeight:m,spriteData:{width:i,height:o,x:s,y:l,context:n}}}}return e}))}(l,c)}))}(t,this.map._requestManager,this.map.getPixelRatio(),this._spriteRequest).then((t=>{if(this._spriteRequest=null,t)for(const e in t){this._spritesImagesIds[e]=[];const r=this._spritesImagesIds[e]?this._spritesImagesIds[e].filter((e=>!(e in t))):[];for(const t of r)this.imageManager.removeImage(t),this._changedImages[t]=!0;for(const n in t[e]){const r="default"===e?n:`${e}:${n}`;this._spritesImagesIds[e].push(r),r in this.imageManager.images?this.imageManager.updateImage(r,t[e][n],!1):this.imageManager.addImage(r,t[e][n]),i&&(this._changedImages[r]=!0)}}})).catch((t=>{this._spriteRequest=null,n=t,this.fire(new e.j(n))})).finally((()=>{this.imageManager.setLoaded(!0),this._availableImages=this.imageManager.listImages(),i&&(this._changed=!0),this.dispatcher.broadcast("SI",this._availableImages),this.fire(new e.k("data",{dataType:"style"})),r&&r(n)}))}_unloadSprite(){for(const t of Object.values(this._spritesImagesIds).flat())this.imageManager.removeImage(t),this._changedImages[t]=!0;this._spritesImagesIds={},this._availableImages=this.imageManager.listImages(),this._changed=!0,this.dispatcher.broadcast("SI",this._availableImages),this.fire(new e.k("data",{dataType:"style"}))}_validateLayer(t){const i=this.sourceCaches[t.source];if(!i)return;const r=t.sourceLayer;if(!r)return;const n=i.getSource();("geojson"===n.type||n.vectorLayerIds&&-1===n.vectorLayerIds.indexOf(r))&&this.fire(new e.j(new Error(`Source layer "${r}" does not exist on source "${n.id}" as specified by style layer "${t.id}".`)))}loaded(){if(!this._loaded)return!1;if(Object.keys(this._updatedSources).length)return!1;for(const t in this.sourceCaches)if(!this.sourceCaches[t].loaded())return!1;return!!this.imageManager.isLoaded()}_serializeByIds(t,i=!1){const r=this._serializedAllLayers();if(!t||0===t.length)return Object.values(i?e.aB(r):r);const n=[];for(const o of t)if(r[o]){const t=i?e.aB(r[o]):r[o];n.push(t)}return n}_serializedAllLayers(){let t=this._serializedLayers;if(t)return t;t=this._serializedLayers={};const e=Object.keys(this._layers);for(const i of e){const e=this._layers[i];"custom"!==e.type&&(t[i]=e.serialize())}return t}hasTransitions(){if(this.light&&this.light.hasTransition())return!0;if(this.sky&&this.sky.hasTransition())return!0;for(const t in this.sourceCaches)if(this.sourceCaches[t].hasTransition())return!0;for(const t in this._layers)if(this._layers[t].hasTransition())return!0;return!1}_checkLoaded(){if(!this._loaded)throw new Error("Style is not done loading.")}update(t){if(!this._loaded)return;const i=this._changed;if(i){const e=Object.keys(this._updatedLayers),i=Object.keys(this._removedLayers);(e.length||i.length)&&this._updateWorkerLayers(e,i);for(const t in this._updatedSources){const e=this._updatedSources[t];if("reload"===e)this._reloadSource(t);else{if("clear"!==e)throw new Error(`Invalid action ${e}`);this._clearSource(t)}}this._updateTilesForChangedImages(),this._updateTilesForChangedGlyphs();for(const r in this._updatedPaintProps)this._layers[r].updateTransitions(t);this.light.updateTransitions(t),this.sky.updateTransitions(t),this._resetUpdates()}const r={};for(const e in this.sourceCaches){const t=this.sourceCaches[e];r[e]=t.used,t.used=!1}for(const e of this._order){const i=this._layers[e];i.recalculate(t,this._availableImages),!i.isHidden(t.zoom)&&i.source&&(this.sourceCaches[i.source].used=!0)}for(const n in r){const t=this.sourceCaches[n];!!r[n]!=!!t.used&&t.fire(new e.k("data",{sourceDataType:"visibility",dataType:"source",sourceId:n}))}this.light.recalculate(t),this.sky.recalculate(t),this.z=t.zoom,i&&this.fire(new e.k("data",{dataType:"style"}))}_updateTilesForChangedImages(){const t=Object.keys(this._changedImages);if(t.length){for(const e in this.sourceCaches)this.sourceCaches[e].reloadTilesForDependencies(["icons","patterns"],t);this._changedImages={}}}_updateTilesForChangedGlyphs(){if(this._glyphsDidChange){for(const t in this.sourceCaches)this.sourceCaches[t].reloadTilesForDependencies(["glyphs"],[""]);this._glyphsDidChange=!1}}_updateWorkerLayers(t,e){this.dispatcher.broadcast("UL",{layers:this._serializeByIds(t,!1),removedIds:e})}_resetUpdates(){this._changed=!1,this._updatedLayers={},this._removedLayers={},this._updatedSources={},this._updatedPaintProps={},this._changedImages={},this._glyphsDidChange=!1}setState(t,i={}){var r;this._checkLoaded();const n=this.serialize();if(t=i.transformStyle?i.transformStyle(n,t):t,(null===(r=i.validate)||void 0===r||r)&&ue(this,e.u(t)))return!1;(t=e.aB(t)).layers=e.az(t.layers);const o=e.aC(n,t),a=this._getOperationsToPerform(o);if(a.unimplemented.length>0)throw new Error(`Unimplemented: ${a.unimplemented.join(", ")}.`);if(0===a.operations.length)return!1;for(const e of a.operations)e();return this.stylesheet=t,this._serializedLayers=null,!0}_getOperationsToPerform(t){const e=[],i=[];for(const r of t)switch(r.command){case"setCenter":case"setZoom":case"setBearing":case"setPitch":continue;case"addLayer":e.push((()=>this.addLayer.apply(this,r.args)));break;case"removeLayer":e.push((()=>this.removeLayer.apply(this,r.args)));break;case"setPaintProperty":e.push((()=>this.setPaintProperty.apply(this,r.args)));break;case"setLayoutProperty":e.push((()=>this.setLayoutProperty.apply(this,r.args)));break;case"setFilter":e.push((()=>this.setFilter.apply(this,r.args)));break;case"addSource":e.push((()=>this.addSource.apply(this,r.args)));break;case"removeSource":e.push((()=>this.removeSource.apply(this,r.args)));break;case"setLayerZoomRange":e.push((()=>this.setLayerZoomRange.apply(this,r.args)));break;case"setLight":e.push((()=>this.setLight.apply(this,r.args)));break;case"setGeoJSONSourceData":e.push((()=>this.setGeoJSONSourceData.apply(this,r.args)));break;case"setGlyphs":e.push((()=>this.setGlyphs.apply(this,r.args)));break;case"setSprite":e.push((()=>this.setSprite.apply(this,r.args)));break;case"setSky":e.push((()=>this.setSky.apply(this,r.args)));break;case"setTerrain":e.push((()=>this.map.setTerrain.apply(this,r.args)));break;case"setTransition":e.push((()=>{}));break;default:i.push(r.command)}return{operations:e,unimplemented:i}}addImage(t,i){if(this.getImage(t))return this.fire(new e.j(new Error(`An image named "${t}" already exists.`)));this.imageManager.addImage(t,i),this._afterImageUpdated(t)}updateImage(t,e){this.imageManager.updateImage(t,e)}getImage(t){return this.imageManager.getImage(t)}removeImage(t){if(!this.getImage(t))return this.fire(new e.j(new Error(`An image named "${t}" does not exist.`)));this.imageManager.removeImage(t),this._afterImageUpdated(t)}_afterImageUpdated(t){this._availableImages=this.imageManager.listImages(),this._changedImages[t]=!0,this._changed=!0,this.dispatcher.broadcast("SI",this._availableImages),this.fire(new e.k("data",{dataType:"style"}))}listImages(){return this._checkLoaded(),this.imageManager.listImages()}addSource(t,i,r={}){if(this._checkLoaded(),void 0!==this.sourceCaches[t])throw new Error(`Source "${t}" already exists.`);if(!i.type)throw new Error(`The type property must be defined, but only the following properties were given: ${Object.keys(i).join(", ")}.`);if(["vector","raster","geojson","video","image"].indexOf(i.type)>=0&&this._validate(e.u.source,`sources.${t}`,i,null,r))return;this.map&&this.map._collectResourceTiming&&(i.collectResourceTiming=!0);const n=this.sourceCaches[t]=new ht(t,i,this.dispatcher);n.style=this,n.setEventedParent(this,(()=>({isSourceLoaded:n.loaded(),source:n.serialize(),sourceId:t}))),n.onAdd(this.map),this._changed=!0}removeSource(t){if(this._checkLoaded(),void 0===this.sourceCaches[t])throw new Error("There is no source with this ID");for(const r in this._layers)if(this._layers[r].source===t)return this.fire(new e.j(new Error(`Source "${t}" cannot be removed while layer "${r}" is using it.`)));const i=this.sourceCaches[t];delete this.sourceCaches[t],delete this._updatedSources[t],i.fire(new e.k("data",{sourceDataType:"metadata",dataType:"source",sourceId:t})),i.setEventedParent(null),i.onRemove(this.map),this._changed=!0}setGeoJSONSourceData(t,e){if(this._checkLoaded(),void 0===this.sourceCaches[t])throw new Error(`There is no source with this ID=${t}`);const i=this.sourceCaches[t].getSource();if("geojson"!==i.type)throw new Error(`geojsonSource.type is ${i.type}, which is !== 'geojson`);i.setData(e),this._changed=!0}getSource(t){return this.sourceCaches[t]&&this.sourceCaches[t].getSource()}addLayer(t,i,r={}){this._checkLoaded();const n=t.id;if(this.getLayer(n))return void this.fire(new e.j(new Error(`Layer "${n}" already exists on this map.`)));let o;if("custom"===t.type){if(ue(this,e.aD(t)))return;o=e.aA(t)}else{if("source"in t&&"object"==typeof t.source&&(this.addSource(n,t.source),t=e.aB(t),t=e.e(t,{source:n})),this._validate(e.u.layer,`layers.${n}`,t,{arrayIndex:-1},r))return;o=e.aA(t),this._validateLayer(o),o.setEventedParent(this,{layer:{id:n}})}const a=i?this._order.indexOf(i):this._order.length;if(i&&-1===a)this.fire(new e.j(new Error(`Cannot add layer "${n}" before non-existing layer "${i}".`)));else{if(this._order.splice(a,0,n),this._layerOrderChanged=!0,this._layers[n]=o,this._removedLayers[n]&&o.source&&"custom"!==o.type){const t=this._removedLayers[n];delete this._removedLayers[n],t.type!==o.type?this._updatedSources[o.source]="clear":(this._updatedSources[o.source]="reload",this.sourceCaches[o.source].pause())}this._updateLayer(o),o.onAdd&&o.onAdd(this.map)}}moveLayer(t,i){if(this._checkLoaded(),this._changed=!0,!this._layers[t])return void this.fire(new e.j(new Error(`The layer '${t}' does not exist in the map's style and cannot be moved.`)));if(t===i)return;const r=this._order.indexOf(t);this._order.splice(r,1);const n=i?this._order.indexOf(i):this._order.length;i&&-1===n?this.fire(new e.j(new Error(`Cannot move layer "${t}" before non-existing layer "${i}".`))):(this._order.splice(n,0,t),this._layerOrderChanged=!0)}removeLayer(t){this._checkLoaded();const i=this._layers[t];if(!i)return void this.fire(new e.j(new Error(`Cannot remove non-existing layer "${t}".`)));i.setEventedParent(null);const r=this._order.indexOf(t);this._order.splice(r,1),this._layerOrderChanged=!0,this._changed=!0,this._removedLayers[t]=i,delete this._layers[t],this._serializedLayers&&delete this._serializedLayers[t],delete this._updatedLayers[t],delete this._updatedPaintProps[t],i.onRemove&&i.onRemove(this.map)}getLayer(t){return this._layers[t]}getLayersOrder(){return[...this._order]}hasLayer(t){return t in this._layers}setLayerZoomRange(t,i,r){this._checkLoaded();const n=this.getLayer(t);n?n.minzoom===i&&n.maxzoom===r||(null!=i&&(n.minzoom=i),null!=r&&(n.maxzoom=r),this._updateLayer(n)):this.fire(new e.j(new Error(`Cannot set the zoom range of non-existing layer "${t}".`)))}setFilter(t,i,r={}){this._checkLoaded();const n=this.getLayer(t);if(n){if(!e.aE(n.filter,i))return null==i?(n.filter=void 0,void this._updateLayer(n)):void(this._validate(e.u.filter,`layers.${n.id}.filter`,i,null,r)||(n.filter=e.aB(i),this._updateLayer(n)))}else this.fire(new e.j(new Error(`Cannot filter non-existing layer "${t}".`)))}getFilter(t){return e.aB(this.getLayer(t).filter)}setLayoutProperty(t,i,r,n={}){this._checkLoaded();const o=this.getLayer(t);o?e.aE(o.getLayoutProperty(i),r)||(o.setLayoutProperty(i,r,n),this._updateLayer(o)):this.fire(new e.j(new Error(`Cannot style non-existing layer "${t}".`)))}getLayoutProperty(t,i){const r=this.getLayer(t);if(r)return r.getLayoutProperty(i);this.fire(new e.j(new Error(`Cannot get style of non-existing layer "${t}".`)))}setPaintProperty(t,i,r,n={}){this._checkLoaded();const o=this.getLayer(t);o?e.aE(o.getPaintProperty(i),r)||(o.setPaintProperty(i,r,n)&&this._updateLayer(o),this._changed=!0,this._updatedPaintProps[t]=!0,this._serializedLayers=null):this.fire(new e.j(new Error(`Cannot style non-existing layer "${t}".`)))}getPaintProperty(t,e){return this.getLayer(t).getPaintProperty(e)}setFeatureState(t,i){this._checkLoaded();const r=t.source,n=t.sourceLayer,o=this.sourceCaches[r];if(void 0===o)return void this.fire(new e.j(new Error(`The source '${r}' does not exist in the map's style.`)));const a=o.getSource().type;"geojson"===a&&n?this.fire(new e.j(new Error("GeoJSON sources cannot have a sourceLayer parameter."))):"vector"!==a||n?(void 0===t.id&&this.fire(new e.j(new Error("The feature id parameter must be provided."))),o.setFeatureState(n,t.id,i)):this.fire(new e.j(new Error("The sourceLayer parameter must be provided for vector source types.")))}removeFeatureState(t,i){this._checkLoaded();const r=t.source,n=this.sourceCaches[r];if(void 0===n)return void this.fire(new e.j(new Error(`The source '${r}' does not exist in the map's style.`)));const o=n.getSource().type,a="vector"===o?t.sourceLayer:void 0;"vector"!==o||a?i&&"string"!=typeof t.id&&"number"!=typeof t.id?this.fire(new e.j(new Error("A feature id is required to remove its specific state property."))):n.removeFeatureState(a,t.id,i):this.fire(new e.j(new Error("The sourceLayer parameter must be provided for vector source types.")))}getFeatureState(t){this._checkLoaded();const i=t.source,r=t.sourceLayer,n=this.sourceCaches[i];if(void 0!==n)return"vector"!==n.getSource().type||r?(void 0===t.id&&this.fire(new e.j(new Error("The feature id parameter must be provided."))),n.getFeatureState(r,t.id)):void this.fire(new e.j(new Error("The sourceLayer parameter must be provided for vector source types.")));this.fire(new e.j(new Error(`The source '${i}' does not exist in the map's style.`)))}getTransition(){return e.e({duration:300,delay:0},this.stylesheet&&this.stylesheet.transition)}serialize(){if(!this._loaded)return;const t=e.aF(this.sourceCaches,(t=>t.serialize())),i=this._serializeByIds(this._order,!0),r=this.map.getTerrain()||void 0,n=this.stylesheet;return e.aG({version:n.version,name:n.name,metadata:n.metadata,light:n.light,sky:n.sky,center:n.center,zoom:n.zoom,bearing:n.bearing,pitch:n.pitch,sprite:n.sprite,glyphs:n.glyphs,transition:n.transition,sources:t,layers:i,terrain:r},(t=>void 0!==t))}_updateLayer(t){this._updatedLayers[t.id]=!0,t.source&&!this._updatedSources[t.source]&&"raster"!==this.sourceCaches[t.source].getSource().type&&(this._updatedSources[t.source]="reload",this.sourceCaches[t.source].pause()),this._serializedLayers=null,this._changed=!0}_flattenAndSortRenderedFeatures(t){const e=t=>"fill-extrusion"===this._layers[t].type,i={},r=[];for(let o=this._order.length-1;o>=0;o--){const n=this._order[o];if(e(n)){i[n]=o;for(const e of t){const t=e[n];if(t)for(const e of t)r.push(e)}}}r.sort(((t,e)=>e.intersectionZ-t.intersectionZ));const n=[];for(let o=this._order.length-1;o>=0;o--){const a=this._order[o];if(e(a))for(let t=r.length-1;t>=0;t--){const e=r[t].feature;if(i[e.layer.id]<o)break;n.push(e),r.pop()}else for(const e of t){const t=e[a];if(t)for(const e of t)n.push(e.feature)}}return n}queryRenderedFeatures(t,i,r){i&&i.filter&&this._validate(e.u.filter,"queryRenderedFeatures.filter",i.filter,null,i);const n={};if(i&&i.layers){if(!Array.isArray(i.layers))return this.fire(new e.j(new Error("parameters.layers must be an Array."))),[];for(const t of i.layers){const i=this._layers[t];if(!i)return this.fire(new e.j(new Error(`The layer '${t}' does not exist in the map's style and cannot be queried for features.`))),[];n[i.source]=!0}}const o=[];i.availableImages=this._availableImages;const a=this._serializedAllLayers();for(const e in this.sourceCaches)i.layers&&!n[e]||o.push(q(this.sourceCaches[e],this._layers,a,t,i,r));return this.placement&&o.push(function(t,e,i,r,n,o,a){const s={},l=o.queryRenderedSymbols(r),c=[];for(const u of Object.keys(l).map(Number))c.push(a[u]);c.sort($);for(const u of c){const i=u.featureIndex.lookupSymbolFeatures(l[u.bucketInstanceId],e,u.bucketIndex,u.sourceLayerIndex,n.filter,n.layers,n.availableImages,t);for(const t in i){const e=s[t]=s[t]||[],r=i[t];r.sort(((t,e)=>{const i=u.featureSortOrder;if(i){const r=i.indexOf(t.featureIndex);return i.indexOf(e.featureIndex)-r}return e.featureIndex-t.featureIndex}));for(const t of r)e.push(t)}}for(const u in s)s[u].forEach((e=>{const r=e.feature,n=i[t[u].source].getFeatureState(r.layer["source-layer"],r.id);r.source=r.layer.source,r.layer["source-layer"]&&(r.sourceLayer=r.layer["source-layer"]),r.state=n}));return s}(this._layers,a,this.sourceCaches,t,i,this.placement.collisionIndex,this.placement.retainedQueryData)),this._flattenAndSortRenderedFeatures(o)}querySourceFeatures(t,i){i&&i.filter&&this._validate(e.u.filter,"querySourceFeatures.filter",i.filter,null,i);const r=this.sourceCaches[t];return r?function(t,e){const i=t.getRenderableIds().map((e=>t.getTileByID(e))),r=[],n={};for(let o=0;o<i.length;o++){const t=i[o],a=t.tileID.canonical.key;n[a]||(n[a]=!0,t.querySourceFeatures(r,e))}return r}(r,i):[]}getLight(){return this.light.getLight()}setLight(t,i={}){this._checkLoaded();const r=this.light.getLight();let n=!1;for(const o in t)if(!e.aE(t[o],r[o])){n=!0;break}if(!n)return;const a={now:o.now(),transition:e.e({duration:300,delay:0},this.stylesheet.transition)};this.light.setLight(t,i),this.light.updateTransitions(a)}getSky(){var t;return null===(t=this.stylesheet)||void 0===t?void 0:t.sky}setSky(t,i={}){const r=this.getSky();let n=!1;if(!t&&!r)return;if(t&&!r)n=!0;else if(!t&&r)n=!0;else for(const o in t)if(!e.aE(t[o],r[o])){n=!0;break}if(!n)return;const a={now:o.now(),transition:e.e({duration:300,delay:0},this.stylesheet.transition)};this.stylesheet.sky=t,this.sky.setSky(t,i),this.sky.updateTransitions(a)}_validate(t,i,r,n,o={}){return(!o||!1!==o.validate)&&ue(this,t.call(e.u,e.e({key:i,style:this.serialize(),value:r,styleSpec:e.v},n)))}_remove(t=!0){this._frameRequest&&(this._frameRequest.abort(),this._frameRequest=null),this._loadStyleRequest&&(this._loadStyleRequest.abort(),this._loadStyleRequest=null),this._spriteRequest&&(this._spriteRequest.abort(),this._spriteRequest=null),st().off(nt,this._rtlPluginLoaded);for(const e in this._layers)this._layers[e].setEventedParent(null);for(const e in this.sourceCaches){const t=this.sourceCaches[e];t.setEventedParent(null),t.onRemove(this.map)}this.imageManager.setEventedParent(null),this.setEventedParent(null),t&&this.dispatcher.broadcast("RM",void 0),this.dispatcher.remove(t)}_clearSource(t){this.sourceCaches[t].clearTiles()}_reloadSource(t){this.sourceCaches[t].resume(),this.sourceCaches[t].reload()}_updateSources(t){for(const e in this.sourceCaches)this.sourceCaches[e].update(t,this.map.terrain)}_generateCollisionBoxes(){for(const t in this.sourceCaches)this._reloadSource(t)}_updatePlacement(t,e,i,r,n=!1){let a=!1,s=!1;const l={};for(const o of this._order){const e=this._layers[o];if("symbol"!==e.type)continue;if(!l[e.source]){const t=this.sourceCaches[e.source];l[e.source]=t.getRenderableIds(!0).map((e=>t.getTileByID(e))).sort(((t,e)=>e.tileID.overscaledZ-t.tileID.overscaledZ||(t.tileID.isLessThan(e.tileID)?-1:1)))}const i=this.crossTileSymbolIndex.addLayer(e,l[e.source],t.center.lng);a=a||i}if(this.crossTileSymbolIndex.pruneUnusedLayers(this._order),((n=n||this._layerOrderChanged||0===i)||!this.pauseablePlacement||this.pauseablePlacement.isDone()&&!this.placement.stillRecent(o.now(),t.zoom))&&(this.pauseablePlacement=new ne(t,this.map.terrain,this._order,n,e,i,r,this.placement),this._layerOrderChanged=!1),this.pauseablePlacement.isDone()?this.placement.setStale():(this.pauseablePlacement.continuePlacement(this._order,this._layers,l),this.pauseablePlacement.isDone()&&(this.placement=this.pauseablePlacement.commit(o.now()),s=!0),a&&this.pauseablePlacement.placement.setStale()),s||a)for(const o of this._order){const t=this._layers[o];"symbol"===t.type&&this.placement.updateLayerOpacities(t,l[t.source])}return!this.pauseablePlacement.isDone()||this.placement.hasTransitions(o.now())}_releaseSymbolFadeTiles(){for(const t in this.sourceCaches)this.sourceCaches[t].releaseSymbolFadeTiles()}getImages(t,i){return e._(this,void 0,void 0,(function*(){const t=yield this.imageManager.getImages(i.icons);this._updateTilesForChangedImages();const e=this.sourceCaches[i.source];return e&&e.setDependencies(i.tileID.key,i.type,i.icons),t}))}getGlyphs(t,i){return e._(this,void 0,void 0,(function*(){const t=yield this.glyphManager.getGlyphs(i.stacks),e=this.sourceCaches[i.source];return e&&e.setDependencies(i.tileID.key,i.type,[""]),t}))}getGlyphsUrl(){return this.stylesheet.glyphs||null}setGlyphs(t,i={}){this._checkLoaded(),t&&this._validate(e.u.glyphs,"glyphs",t,null,i)||(this._glyphsDidChange=!0,this.stylesheet.glyphs=t,this.glyphManager.entries={},this.glyphManager.setURL(t))}addSprite(t,i,r={},n){this._checkLoaded();const o=[{id:t,url:i}],a=[...v(this.stylesheet.sprite),...o];this._validate(e.u.sprite,"sprite",a,null,r)||(this.stylesheet.sprite=a,this._loadSprite(o,!0,n))}removeSprite(t){this._checkLoaded();const i=v(this.stylesheet.sprite);if(i.find((e=>e.id===t))){if(this._spritesImagesIds[t])for(const e of this._spritesImagesIds[t])this.imageManager.removeImage(e),this._changedImages[e]=!0;i.splice(i.findIndex((e=>e.id===t)),1),this.stylesheet.sprite=i.length>0?i:void 0,delete this._spritesImagesIds[t],this._availableImages=this.imageManager.listImages(),this._changed=!0,this.dispatcher.broadcast("SI",this._availableImages),this.fire(new e.k("data",{dataType:"style"}))}else this.fire(new e.j(new Error(`Sprite "${t}" doesn't exists on this map.`)))}getSprite(){return v(this.stylesheet.sprite)}setSprite(t,i={},r){this._checkLoaded(),t&&this._validate(e.u.sprite,"sprite",t,null,i)||(this.stylesheet.sprite=t,t?this._loadSprite(t,!0,r):(this._unloadSprite(),r&&r(null)))}}var pe=e.Y([{name:"a_pos",type:"Int16",components:2}]);const fe={prelude:me("#ifdef GL_ES\nprecision mediump float;\n#else\n#if !defined(lowp)\n#define lowp\n#endif\n#if !defined(mediump)\n#define mediump\n#endif\n#if !defined(highp)\n#define highp\n#endif\n#endif\n","#ifdef GL_ES\nprecision highp float;\n#else\n#if !defined(lowp)\n#define lowp\n#endif\n#if !defined(mediump)\n#define mediump\n#endif\n#if !defined(highp)\n#define highp\n#endif\n#endif\nvec2 unpack_float(const float packedValue) {int packedIntValue=int(packedValue);int v0=packedIntValue/256;return vec2(v0,packedIntValue-v0*256);}vec2 unpack_opacity(const float packedOpacity) {int intOpacity=int(packedOpacity)/2;return vec2(float(intOpacity)/127.0,mod(packedOpacity,2.0));}vec4 decode_color(const vec2 encodedColor) {return vec4(unpack_float(encodedColor[0])/255.0,unpack_float(encodedColor[1])/255.0\n);}float unpack_mix_vec2(const vec2 packedValue,const float t) {return mix(packedValue[0],packedValue[1],t);}vec4 unpack_mix_color(const vec4 packedColors,const float t) {vec4 minColor=decode_color(vec2(packedColors[0],packedColors[1]));vec4 maxColor=decode_color(vec2(packedColors[2],packedColors[3]));return mix(minColor,maxColor,t);}vec2 get_pattern_pos(const vec2 pixel_coord_upper,const vec2 pixel_coord_lower,const vec2 pattern_size,const float tile_units_to_pixels,const vec2 pos) {vec2 offset=mod(mod(mod(pixel_coord_upper,pattern_size)*256.0,pattern_size)*256.0+pixel_coord_lower,pattern_size);return (tile_units_to_pixels*pos+offset)/pattern_size;}\n#ifdef TERRAIN3D\nuniform sampler2D u_terrain;uniform float u_terrain_dim;uniform mat4 u_terrain_matrix;uniform vec4 u_terrain_unpack;uniform float u_terrain_exaggeration;uniform highp sampler2D u_depth;\n#endif\nconst highp vec4 bitSh=vec4(256.*256.*256.,256.*256.,256.,1.);const highp vec4 bitShifts=vec4(1.)/bitSh;highp float unpack(highp vec4 color) {return dot(color,bitShifts);}highp float depthOpacity(vec3 frag) {\n#ifdef TERRAIN3D\nhighp float d=unpack(texture2D(u_depth,frag.xy*0.5+0.5))+0.0001-frag.z;return 1.0-max(0.0,min(1.0,-d*500.0));\n#else\nreturn 1.0;\n#endif\n}float calculate_visibility(vec4 pos) {\n#ifdef TERRAIN3D\nvec3 frag=pos.xyz/pos.w;highp float d=depthOpacity(frag);if (d > 0.95) return 1.0;return (d+depthOpacity(frag+vec3(0.0,0.01,0.0)))/2.0;\n#else\nreturn 1.0;\n#endif\n}float ele(vec2 pos) {\n#ifdef TERRAIN3D\nvec4 rgb=(texture2D(u_terrain,pos)*255.0)*u_terrain_unpack;return rgb.r+rgb.g+rgb.b-u_terrain_unpack.a;\n#else\nreturn 0.0;\n#endif\n}float get_elevation(vec2 pos) {\n#ifdef TERRAIN3D\nvec2 coord=(u_terrain_matrix*vec4(pos,0.0,1.0)).xy*u_terrain_dim+1.0;vec2 f=fract(coord);vec2 c=(floor(coord)+0.5)/(u_terrain_dim+2.0);float d=1.0/(u_terrain_dim+2.0);float tl=ele(c);float tr=ele(c+vec2(d,0.0));float bl=ele(c+vec2(0.0,d));float br=ele(c+vec2(d,d));float elevation=mix(mix(tl,tr,f.x),mix(bl,br,f.x),f.y);return elevation*u_terrain_exaggeration;\n#else\nreturn 0.0;\n#endif\n}"),background:me("uniform vec4 u_color;uniform float u_opacity;void main() {gl_FragColor=u_color*u_opacity;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","attribute vec2 a_pos;uniform mat4 u_matrix;void main() {gl_Position=u_matrix*vec4(a_pos,0,1);}"),backgroundPattern:me("uniform vec2 u_pattern_tl_a;uniform vec2 u_pattern_br_a;uniform vec2 u_pattern_tl_b;uniform vec2 u_pattern_br_b;uniform vec2 u_texsize;uniform float u_mix;uniform float u_opacity;uniform sampler2D u_image;varying vec2 v_pos_a;varying vec2 v_pos_b;void main() {vec2 imagecoord=mod(v_pos_a,1.0);vec2 pos=mix(u_pattern_tl_a/u_texsize,u_pattern_br_a/u_texsize,imagecoord);vec4 color1=texture2D(u_image,pos);vec2 imagecoord_b=mod(v_pos_b,1.0);vec2 pos2=mix(u_pattern_tl_b/u_texsize,u_pattern_br_b/u_texsize,imagecoord_b);vec4 color2=texture2D(u_image,pos2);gl_FragColor=mix(color1,color2,u_mix)*u_opacity;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","uniform mat4 u_matrix;uniform vec2 u_pattern_size_a;uniform vec2 u_pattern_size_b;uniform vec2 u_pixel_coord_upper;uniform vec2 u_pixel_coord_lower;uniform float u_scale_a;uniform float u_scale_b;uniform float u_tile_units_to_pixels;attribute vec2 a_pos;varying vec2 v_pos_a;varying vec2 v_pos_b;void main() {gl_Position=u_matrix*vec4(a_pos,0,1);v_pos_a=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,u_scale_a*u_pattern_size_a,u_tile_units_to_pixels,a_pos);v_pos_b=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,u_scale_b*u_pattern_size_b,u_tile_units_to_pixels,a_pos);}"),circle:me("varying vec3 v_data;varying float v_visibility;\n#pragma mapbox: define highp vec4 color\n#pragma mapbox: define mediump float radius\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define highp vec4 stroke_color\n#pragma mapbox: define mediump float stroke_width\n#pragma mapbox: define lowp float stroke_opacity\nvoid main() {\n#pragma mapbox: initialize highp vec4 color\n#pragma mapbox: initialize mediump float radius\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize highp vec4 stroke_color\n#pragma mapbox: initialize mediump float stroke_width\n#pragma mapbox: initialize lowp float stroke_opacity\nvec2 extrude=v_data.xy;float extrude_length=length(extrude);float antialiased_blur=v_data.z;float opacity_t=smoothstep(0.0,antialiased_blur,extrude_length-1.0);float color_t=stroke_width < 0.01 ? 0.0 : smoothstep(antialiased_blur,0.0,extrude_length-radius/(radius+stroke_width));gl_FragColor=v_visibility*opacity_t*mix(color*opacity,stroke_color*stroke_opacity,color_t);\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","uniform mat4 u_matrix;uniform bool u_scale_with_map;uniform bool u_pitch_with_map;uniform vec2 u_extrude_scale;uniform lowp float u_device_pixel_ratio;uniform highp float u_camera_to_center_distance;attribute vec2 a_pos;varying vec3 v_data;varying float v_visibility;\n#pragma mapbox: define highp vec4 color\n#pragma mapbox: define mediump float radius\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define highp vec4 stroke_color\n#pragma mapbox: define mediump float stroke_width\n#pragma mapbox: define lowp float stroke_opacity\nvoid main(void) {\n#pragma mapbox: initialize highp vec4 color\n#pragma mapbox: initialize mediump float radius\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize highp vec4 stroke_color\n#pragma mapbox: initialize mediump float stroke_width\n#pragma mapbox: initialize lowp float stroke_opacity\nvec2 extrude=vec2(mod(a_pos,2.0)*2.0-1.0);vec2 circle_center=floor(a_pos*0.5);float ele=get_elevation(circle_center);v_visibility=calculate_visibility(u_matrix*vec4(circle_center,ele,1.0));if (u_pitch_with_map) {vec2 corner_position=circle_center;if (u_scale_with_map) {corner_position+=extrude*(radius+stroke_width)*u_extrude_scale;} else {vec4 projected_center=u_matrix*vec4(circle_center,0,1);corner_position+=extrude*(radius+stroke_width)*u_extrude_scale*(projected_center.w/u_camera_to_center_distance);}gl_Position=u_matrix*vec4(corner_position,ele,1);} else {gl_Position=u_matrix*vec4(circle_center,ele,1);if (u_scale_with_map) {gl_Position.xy+=extrude*(radius+stroke_width)*u_extrude_scale*u_camera_to_center_distance;} else {gl_Position.xy+=extrude*(radius+stroke_width)*u_extrude_scale*gl_Position.w;}}float antialiasblur=-max(1.0/u_device_pixel_ratio/(radius+stroke_width),blur);v_data=vec3(extrude.x,extrude.y,antialiasblur);}"),clippingMask:me("void main() {gl_FragColor=vec4(1.0);}","attribute vec2 a_pos;uniform mat4 u_matrix;void main() {gl_Position=u_matrix*vec4(a_pos,0,1);}"),heatmap:me("uniform highp float u_intensity;varying vec2 v_extrude;\n#pragma mapbox: define highp float weight\n#define GAUSS_COEF 0.3989422804014327\nvoid main() {\n#pragma mapbox: initialize highp float weight\nfloat d=-0.5*3.0*3.0*dot(v_extrude,v_extrude);float val=weight*u_intensity*GAUSS_COEF*exp(d);gl_FragColor=vec4(val,1.0,1.0,1.0);\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","uniform mat4 u_matrix;uniform float u_extrude_scale;uniform float u_opacity;uniform float u_intensity;attribute vec2 a_pos;varying vec2 v_extrude;\n#pragma mapbox: define highp float weight\n#pragma mapbox: define mediump float radius\nconst highp float ZERO=1.0/255.0/16.0;\n#define GAUSS_COEF 0.3989422804014327\nvoid main(void) {\n#pragma mapbox: initialize highp float weight\n#pragma mapbox: initialize mediump float radius\nvec2 unscaled_extrude=vec2(mod(a_pos,2.0)*2.0-1.0);float S=sqrt(-2.0*log(ZERO/weight/u_intensity/GAUSS_COEF))/3.0;v_extrude=S*unscaled_extrude;vec2 extrude=v_extrude*radius*u_extrude_scale;vec4 pos=vec4(floor(a_pos*0.5)+extrude,get_elevation(floor(a_pos*0.5)),1);gl_Position=u_matrix*pos;}"),heatmapTexture:me("uniform sampler2D u_image;uniform sampler2D u_color_ramp;uniform float u_opacity;varying vec2 v_pos;void main() {float t=texture2D(u_image,v_pos).r;vec4 color=texture2D(u_color_ramp,vec2(t,0.5));gl_FragColor=color*u_opacity;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(0.0);\n#endif\n}","uniform mat4 u_matrix;uniform vec2 u_world;attribute vec2 a_pos;varying vec2 v_pos;void main() {gl_Position=u_matrix*vec4(a_pos*u_world,0,1);v_pos.x=a_pos.x;v_pos.y=1.0-a_pos.y;}"),collisionBox:me("varying float v_placed;varying float v_notUsed;void main() {float alpha=0.5;gl_FragColor=vec4(1.0,0.0,0.0,1.0)*alpha;if (v_placed > 0.5) {gl_FragColor=vec4(0.0,0.0,1.0,0.5)*alpha;}if (v_notUsed > 0.5) {gl_FragColor*=.1;}}","attribute vec2 a_anchor_pos;attribute vec2 a_placed;attribute vec2 a_box_real;uniform mat4 u_matrix;uniform vec2 u_pixel_extrude_scale;varying float v_placed;varying float v_notUsed;vec4 projectTileWithElevation(vec2 posInTile,float elevation) {return u_matrix*vec4(posInTile,elevation,1.0);}void main() {gl_Position=projectTileWithElevation(a_anchor_pos,get_elevation(a_anchor_pos));gl_Position.xy=((a_box_real+0.5)*u_pixel_extrude_scale*2.0-1.0)*vec2(1.0,-1.0)*gl_Position.w;if (gl_Position.z/gl_Position.w < 1.1) {gl_Position.z=0.5;}v_placed=a_placed.x;v_notUsed=a_placed.y;}"),collisionCircle:me("varying float v_radius;varying vec2 v_extrude;varying float v_perspective_ratio;varying float v_collision;void main() {float alpha=0.5*min(v_perspective_ratio,1.0);float stroke_radius=0.9*max(v_perspective_ratio,1.0);float distance_to_center=length(v_extrude);float distance_to_edge=abs(distance_to_center-v_radius);float opacity_t=smoothstep(-stroke_radius,0.0,-distance_to_edge);vec4 color=mix(vec4(0.0,0.0,1.0,0.5),vec4(1.0,0.0,0.0,1.0),v_collision);gl_FragColor=color*alpha*opacity_t;}","attribute vec2 a_pos;attribute float a_radius;attribute vec2 a_flags;uniform mat4 u_matrix;uniform mat4 u_inv_matrix;uniform vec2 u_viewport_size;uniform float u_camera_to_center_distance;varying float v_radius;varying vec2 v_extrude;varying float v_perspective_ratio;varying float v_collision;vec3 toTilePosition(vec2 screenPos) {vec4 rayStart=u_inv_matrix*vec4(screenPos,-1.0,1.0);vec4 rayEnd =u_inv_matrix*vec4(screenPos, 1.0,1.0);rayStart.xyz/=rayStart.w;rayEnd.xyz /=rayEnd.w;highp float t=(0.0-rayStart.z)/(rayEnd.z-rayStart.z);return mix(rayStart.xyz,rayEnd.xyz,t);}void main() {vec2 quadCenterPos=a_pos;float radius=a_radius;float collision=a_flags.x;float vertexIdx=a_flags.y;vec2 quadVertexOffset=vec2(mix(-1.0,1.0,float(vertexIdx >=2.0)),mix(-1.0,1.0,float(vertexIdx >=1.0 && vertexIdx <=2.0)));vec2 quadVertexExtent=quadVertexOffset*radius;vec3 tilePos=toTilePosition(quadCenterPos);vec4 clipPos=u_matrix*vec4(tilePos,1.0);highp float camera_to_anchor_distance=clipPos.w;highp float collision_perspective_ratio=clamp(0.5+0.5*(u_camera_to_center_distance/camera_to_anchor_distance),0.0,4.0);float padding_factor=1.2;v_radius=radius;v_extrude=quadVertexExtent*padding_factor;v_perspective_ratio=collision_perspective_ratio;v_collision=collision;gl_Position=vec4(clipPos.xyz/clipPos.w,1.0)+vec4(quadVertexExtent*padding_factor/u_viewport_size*2.0,0.0,0.0);}"),debug:me("uniform highp vec4 u_color;uniform sampler2D u_overlay;varying vec2 v_uv;void main() {vec4 overlay_color=texture2D(u_overlay,v_uv);gl_FragColor=mix(u_color,overlay_color,overlay_color.a);}","attribute vec2 a_pos;varying vec2 v_uv;uniform mat4 u_matrix;uniform float u_overlay_scale;void main() {v_uv=a_pos/8192.0;gl_Position=u_matrix*vec4(a_pos*u_overlay_scale,get_elevation(a_pos),1);}"),fill:me("#pragma mapbox: define highp vec4 color\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize highp vec4 color\n#pragma mapbox: initialize lowp float opacity\ngl_FragColor=color*opacity;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","attribute vec2 a_pos;uniform mat4 u_matrix;\n#pragma mapbox: define highp vec4 color\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize highp vec4 color\n#pragma mapbox: initialize lowp float opacity\ngl_Position=u_matrix*vec4(a_pos,0,1);}"),fillOutline:me("varying vec2 v_pos;\n#pragma mapbox: define highp vec4 outline_color\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize highp vec4 outline_color\n#pragma mapbox: initialize lowp float opacity\nfloat dist=length(v_pos-gl_FragCoord.xy);float alpha=1.0-smoothstep(0.0,1.0,dist);gl_FragColor=outline_color*(alpha*opacity);\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","attribute vec2 a_pos;uniform mat4 u_matrix;uniform vec2 u_world;varying vec2 v_pos;\n#pragma mapbox: define highp vec4 outline_color\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize highp vec4 outline_color\n#pragma mapbox: initialize lowp float opacity\ngl_Position=u_matrix*vec4(a_pos,0,1);v_pos=(gl_Position.xy/gl_Position.w+1.0)/2.0*u_world;}"),fillOutlinePattern:me("uniform vec2 u_texsize;uniform sampler2D u_image;uniform float u_fade;varying vec2 v_pos_a;varying vec2 v_pos_b;varying vec2 v_pos;\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp vec4 pattern_from\n#pragma mapbox: define lowp vec4 pattern_to\nvoid main() {\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize mediump vec4 pattern_from\n#pragma mapbox: initialize mediump vec4 pattern_to\nvec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;vec2 imagecoord=mod(v_pos_a,1.0);vec2 pos=mix(pattern_tl_a/u_texsize,pattern_br_a/u_texsize,imagecoord);vec4 color1=texture2D(u_image,pos);vec2 imagecoord_b=mod(v_pos_b,1.0);vec2 pos2=mix(pattern_tl_b/u_texsize,pattern_br_b/u_texsize,imagecoord_b);vec4 color2=texture2D(u_image,pos2);float dist=length(v_pos-gl_FragCoord.xy);float alpha=1.0-smoothstep(0.0,1.0,dist);gl_FragColor=mix(color1,color2,u_fade)*alpha*opacity;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","uniform mat4 u_matrix;uniform vec2 u_world;uniform vec2 u_pixel_coord_upper;uniform vec2 u_pixel_coord_lower;uniform vec3 u_scale;attribute vec2 a_pos;varying vec2 v_pos_a;varying vec2 v_pos_b;varying vec2 v_pos;\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp vec4 pattern_from\n#pragma mapbox: define lowp vec4 pattern_to\n#pragma mapbox: define lowp float pixel_ratio_from\n#pragma mapbox: define lowp float pixel_ratio_to\nvoid main() {\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize mediump vec4 pattern_from\n#pragma mapbox: initialize mediump vec4 pattern_to\n#pragma mapbox: initialize lowp float pixel_ratio_from\n#pragma mapbox: initialize lowp float pixel_ratio_to\nvec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;float tileRatio=u_scale.x;float fromScale=u_scale.y;float toScale=u_scale.z;gl_Position=u_matrix*vec4(a_pos,0,1);vec2 display_size_a=(pattern_br_a-pattern_tl_a)/pixel_ratio_from;vec2 display_size_b=(pattern_br_b-pattern_tl_b)/pixel_ratio_to;v_pos_a=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,fromScale*display_size_a,tileRatio,a_pos);v_pos_b=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,toScale*display_size_b,tileRatio,a_pos);v_pos=(gl_Position.xy/gl_Position.w+1.0)/2.0*u_world;}"),fillPattern:me("#ifdef GL_ES\nprecision highp float;\n#endif\nuniform vec2 u_texsize;uniform float u_fade;uniform sampler2D u_image;varying vec2 v_pos_a;varying vec2 v_pos_b;\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp vec4 pattern_from\n#pragma mapbox: define lowp vec4 pattern_to\nvoid main() {\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize mediump vec4 pattern_from\n#pragma mapbox: initialize mediump vec4 pattern_to\nvec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;vec2 imagecoord=mod(v_pos_a,1.0);vec2 pos=mix(pattern_tl_a/u_texsize,pattern_br_a/u_texsize,imagecoord);vec4 color1=texture2D(u_image,pos);vec2 imagecoord_b=mod(v_pos_b,1.0);vec2 pos2=mix(pattern_tl_b/u_texsize,pattern_br_b/u_texsize,imagecoord_b);vec4 color2=texture2D(u_image,pos2);gl_FragColor=mix(color1,color2,u_fade)*opacity;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","uniform mat4 u_matrix;uniform vec2 u_pixel_coord_upper;uniform vec2 u_pixel_coord_lower;uniform vec3 u_scale;attribute vec2 a_pos;varying vec2 v_pos_a;varying vec2 v_pos_b;\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp vec4 pattern_from\n#pragma mapbox: define lowp vec4 pattern_to\n#pragma mapbox: define lowp float pixel_ratio_from\n#pragma mapbox: define lowp float pixel_ratio_to\nvoid main() {\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize mediump vec4 pattern_from\n#pragma mapbox: initialize mediump vec4 pattern_to\n#pragma mapbox: initialize lowp float pixel_ratio_from\n#pragma mapbox: initialize lowp float pixel_ratio_to\nvec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;float tileZoomRatio=u_scale.x;float fromScale=u_scale.y;float toScale=u_scale.z;vec2 display_size_a=(pattern_br_a-pattern_tl_a)/pixel_ratio_from;vec2 display_size_b=(pattern_br_b-pattern_tl_b)/pixel_ratio_to;gl_Position=u_matrix*vec4(a_pos,0,1);v_pos_a=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,fromScale*display_size_a,tileZoomRatio,a_pos);v_pos_b=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,toScale*display_size_b,tileZoomRatio,a_pos);}"),fillExtrusion:me("varying vec4 v_color;void main() {gl_FragColor=v_color;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","uniform mat4 u_matrix;uniform vec3 u_lightcolor;uniform lowp vec3 u_lightpos;uniform lowp float u_lightintensity;uniform float u_vertical_gradient;uniform lowp float u_opacity;attribute vec2 a_pos;attribute vec4 a_normal_ed;\n#ifdef TERRAIN3D\nattribute vec2 a_centroid;\n#endif\nvarying vec4 v_color;\n#pragma mapbox: define highp float base\n#pragma mapbox: define highp float height\n#pragma mapbox: define highp vec4 color\nvoid main() {\n#pragma mapbox: initialize highp float base\n#pragma mapbox: initialize highp float height\n#pragma mapbox: initialize highp vec4 color\nvec3 normal=a_normal_ed.xyz;\n#ifdef TERRAIN3D\nfloat height_terrain3d_offset=get_elevation(a_centroid);float base_terrain3d_offset=height_terrain3d_offset-(base > 0.0 ? 0.0 : 10.0);\n#else\nfloat height_terrain3d_offset=0.0;float base_terrain3d_offset=0.0;\n#endif\nbase=max(0.0,base)+base_terrain3d_offset;height=max(0.0,height)+height_terrain3d_offset;float t=mod(normal.x,2.0);gl_Position=u_matrix*vec4(a_pos,t > 0.0 ? height : base,1);float colorvalue=color.r*0.2126+color.g*0.7152+color.b*0.0722;v_color=vec4(0.0,0.0,0.0,1.0);vec4 ambientlight=vec4(0.03,0.03,0.03,1.0);color+=ambientlight;float directional=clamp(dot(normal/16384.0,u_lightpos),0.0,1.0);directional=mix((1.0-u_lightintensity),max((1.0-colorvalue+u_lightintensity),1.0),directional);if (normal.y !=0.0) {directional*=((1.0-u_vertical_gradient)+(u_vertical_gradient*clamp((t+base)*pow(height/150.0,0.5),mix(0.7,0.98,1.0-u_lightintensity),1.0)));}v_color.r+=clamp(color.r*directional*u_lightcolor.r,mix(0.0,0.3,1.0-u_lightcolor.r),1.0);v_color.g+=clamp(color.g*directional*u_lightcolor.g,mix(0.0,0.3,1.0-u_lightcolor.g),1.0);v_color.b+=clamp(color.b*directional*u_lightcolor.b,mix(0.0,0.3,1.0-u_lightcolor.b),1.0);v_color*=u_opacity;}"),fillExtrusionPattern:me("uniform vec2 u_texsize;uniform float u_fade;uniform sampler2D u_image;varying vec2 v_pos_a;varying vec2 v_pos_b;varying vec4 v_lighting;\n#pragma mapbox: define lowp float base\n#pragma mapbox: define lowp float height\n#pragma mapbox: define lowp vec4 pattern_from\n#pragma mapbox: define lowp vec4 pattern_to\n#pragma mapbox: define lowp float pixel_ratio_from\n#pragma mapbox: define lowp float pixel_ratio_to\nvoid main() {\n#pragma mapbox: initialize lowp float base\n#pragma mapbox: initialize lowp float height\n#pragma mapbox: initialize mediump vec4 pattern_from\n#pragma mapbox: initialize mediump vec4 pattern_to\n#pragma mapbox: initialize lowp float pixel_ratio_from\n#pragma mapbox: initialize lowp float pixel_ratio_to\nvec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;vec2 imagecoord=mod(v_pos_a,1.0);vec2 pos=mix(pattern_tl_a/u_texsize,pattern_br_a/u_texsize,imagecoord);vec4 color1=texture2D(u_image,pos);vec2 imagecoord_b=mod(v_pos_b,1.0);vec2 pos2=mix(pattern_tl_b/u_texsize,pattern_br_b/u_texsize,imagecoord_b);vec4 color2=texture2D(u_image,pos2);vec4 mixedColor=mix(color1,color2,u_fade);gl_FragColor=mixedColor*v_lighting;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","uniform mat4 u_matrix;uniform vec2 u_pixel_coord_upper;uniform vec2 u_pixel_coord_lower;uniform float u_height_factor;uniform vec3 u_scale;uniform float u_vertical_gradient;uniform lowp float u_opacity;uniform vec3 u_lightcolor;uniform lowp vec3 u_lightpos;uniform lowp float u_lightintensity;attribute vec2 a_pos;attribute vec4 a_normal_ed;\n#ifdef TERRAIN3D\nattribute vec2 a_centroid;\n#endif\nvarying vec2 v_pos_a;varying vec2 v_pos_b;varying vec4 v_lighting;\n#pragma mapbox: define lowp float base\n#pragma mapbox: define lowp float height\n#pragma mapbox: define lowp vec4 pattern_from\n#pragma mapbox: define lowp vec4 pattern_to\n#pragma mapbox: define lowp float pixel_ratio_from\n#pragma mapbox: define lowp float pixel_ratio_to\nvoid main() {\n#pragma mapbox: initialize lowp float base\n#pragma mapbox: initialize lowp float height\n#pragma mapbox: initialize mediump vec4 pattern_from\n#pragma mapbox: initialize mediump vec4 pattern_to\n#pragma mapbox: initialize lowp float pixel_ratio_from\n#pragma mapbox: initialize lowp float pixel_ratio_to\nvec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;float tileRatio=u_scale.x;float fromScale=u_scale.y;float toScale=u_scale.z;vec3 normal=a_normal_ed.xyz;float edgedistance=a_normal_ed.w;vec2 display_size_a=(pattern_br_a-pattern_tl_a)/pixel_ratio_from;vec2 display_size_b=(pattern_br_b-pattern_tl_b)/pixel_ratio_to;\n#ifdef TERRAIN3D\nfloat height_terrain3d_offset=get_elevation(a_centroid);float base_terrain3d_offset=height_terrain3d_offset-(base > 0.0 ? 0.0 : 10.0);\n#else\nfloat height_terrain3d_offset=0.0;float base_terrain3d_offset=0.0;\n#endif\nbase=max(0.0,base)+base_terrain3d_offset;height=max(0.0,height)+height_terrain3d_offset;float t=mod(normal.x,2.0);float z=t > 0.0 ? height : base;gl_Position=u_matrix*vec4(a_pos,z,1);vec2 pos=normal.x==1.0 && normal.y==0.0 && normal.z==16384.0\n? a_pos\n: vec2(edgedistance,z*u_height_factor);v_pos_a=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,fromScale*display_size_a,tileRatio,pos);v_pos_b=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,toScale*display_size_b,tileRatio,pos);v_lighting=vec4(0.0,0.0,0.0,1.0);float directional=clamp(dot(normal/16383.0,u_lightpos),0.0,1.0);directional=mix((1.0-u_lightintensity),max((0.5+u_lightintensity),1.0),directional);if (normal.y !=0.0) {directional*=((1.0-u_vertical_gradient)+(u_vertical_gradient*clamp((t+base)*pow(height/150.0,0.5),mix(0.7,0.98,1.0-u_lightintensity),1.0)));}v_lighting.rgb+=clamp(directional*u_lightcolor,mix(vec3(0.0),vec3(0.3),1.0-u_lightcolor),vec3(1.0));v_lighting*=u_opacity;}"),hillshadePrepare:me("#ifdef GL_ES\nprecision highp float;\n#endif\nuniform sampler2D u_image;varying vec2 v_pos;uniform vec2 u_dimension;uniform float u_zoom;uniform vec4 u_unpack;float getElevation(vec2 coord,float bias) {vec4 data=texture2D(u_image,coord)*255.0;data.a=-1.0;return dot(data,u_unpack)/4.0;}void main() {vec2 epsilon=1.0/u_dimension;float a=getElevation(v_pos+vec2(-epsilon.x,-epsilon.y),0.0);float b=getElevation(v_pos+vec2(0,-epsilon.y),0.0);float c=getElevation(v_pos+vec2(epsilon.x,-epsilon.y),0.0);float d=getElevation(v_pos+vec2(-epsilon.x,0),0.0);float e=getElevation(v_pos,0.0);float f=getElevation(v_pos+vec2(epsilon.x,0),0.0);float g=getElevation(v_pos+vec2(-epsilon.x,epsilon.y),0.0);float h=getElevation(v_pos+vec2(0,epsilon.y),0.0);float i=getElevation(v_pos+vec2(epsilon.x,epsilon.y),0.0);float exaggerationFactor=u_zoom < 2.0 ? 0.4 : u_zoom < 4.5 ? 0.35 : 0.3;float exaggeration=u_zoom < 15.0 ? (u_zoom-15.0)*exaggerationFactor : 0.0;vec2 deriv=vec2((c+f+f+i)-(a+d+d+g),(g+h+h+i)-(a+b+b+c))/pow(2.0,exaggeration+(19.2562-u_zoom));gl_FragColor=clamp(vec4(deriv.x/2.0+0.5,deriv.y/2.0+0.5,1.0,1.0),0.0,1.0);\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","uniform mat4 u_matrix;uniform vec2 u_dimension;attribute vec2 a_pos;attribute vec2 a_texture_pos;varying vec2 v_pos;void main() {gl_Position=u_matrix*vec4(a_pos,0,1);highp vec2 epsilon=1.0/u_dimension;float scale=(u_dimension.x-2.0)/u_dimension.x;v_pos=(a_texture_pos/8192.0)*scale+epsilon;}"),hillshade:me("uniform sampler2D u_image;varying vec2 v_pos;uniform vec2 u_latrange;uniform vec2 u_light;uniform vec4 u_shadow;uniform vec4 u_highlight;uniform vec4 u_accent;\n#define PI 3.141592653589793\nvoid main() {vec4 pixel=texture2D(u_image,v_pos);vec2 deriv=((pixel.rg*2.0)-1.0);float scaleFactor=cos(radians((u_latrange[0]-u_latrange[1])*(1.0-v_pos.y)+u_latrange[1]));float slope=atan(1.25*length(deriv)/scaleFactor);float aspect=deriv.x !=0.0 ? atan(deriv.y,-deriv.x) : PI/2.0*(deriv.y > 0.0 ? 1.0 :-1.0);float intensity=u_light.x;float azimuth=u_light.y+PI;float base=1.875-intensity*1.75;float maxValue=0.5*PI;float scaledSlope=intensity !=0.5 ? ((pow(base,slope)-1.0)/(pow(base,maxValue)-1.0))*maxValue : slope;float accent=cos(scaledSlope);vec4 accent_color=(1.0-accent)*u_accent*clamp(intensity*2.0,0.0,1.0);float shade=abs(mod((aspect+azimuth)/PI+0.5,2.0)-1.0);vec4 shade_color=mix(u_shadow,u_highlight,shade)*sin(scaledSlope)*clamp(intensity*2.0,0.0,1.0);gl_FragColor=accent_color*(1.0-shade_color.a)+shade_color;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","uniform mat4 u_matrix;attribute vec2 a_pos;attribute vec2 a_texture_pos;varying vec2 v_pos;void main() {gl_Position=u_matrix*vec4(a_pos,0,1);v_pos=a_texture_pos/8192.0;}"),line:me("uniform lowp float u_device_pixel_ratio;varying vec2 v_width2;varying vec2 v_normal;varying float v_gamma_scale;\n#pragma mapbox: define highp vec4 color\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize highp vec4 color\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\nfloat dist=length(v_normal)*v_width2.s;float blur2=(blur+1.0/u_device_pixel_ratio)*v_gamma_scale;float alpha=clamp(min(dist-(v_width2.t-blur2),v_width2.s-dist)/blur2,0.0,1.0);gl_FragColor=color*(alpha*opacity);\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","\n#define scale 0.015873016\nattribute vec2 a_pos_normal;attribute vec4 a_data;uniform mat4 u_matrix;uniform mediump float u_ratio;uniform vec2 u_units_to_pixels;uniform lowp float u_device_pixel_ratio;varying vec2 v_normal;varying vec2 v_width2;varying float v_gamma_scale;varying highp float v_linesofar;\n#pragma mapbox: define highp vec4 color\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define mediump float gapwidth\n#pragma mapbox: define lowp float offset\n#pragma mapbox: define mediump float width\nvoid main() {\n#pragma mapbox: initialize highp vec4 color\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize mediump float gapwidth\n#pragma mapbox: initialize lowp float offset\n#pragma mapbox: initialize mediump float width\nfloat ANTIALIASING=1.0/u_device_pixel_ratio/2.0;vec2 a_extrude=a_data.xy-128.0;float a_direction=mod(a_data.z,4.0)-1.0;v_linesofar=(floor(a_data.z/4.0)+a_data.w*64.0)*2.0;vec2 pos=floor(a_pos_normal*0.5);mediump vec2 normal=a_pos_normal-2.0*pos;normal.y=normal.y*2.0-1.0;v_normal=normal;gapwidth=gapwidth/2.0;float halfwidth=width/2.0;offset=-1.0*offset;float inset=gapwidth+(gapwidth > 0.0 ? ANTIALIASING : 0.0);float outset=gapwidth+halfwidth*(gapwidth > 0.0 ? 2.0 : 1.0)+(halfwidth==0.0 ? 0.0 : ANTIALIASING);mediump vec2 dist=outset*a_extrude*scale;mediump float u=0.5*a_direction;mediump float t=1.0-abs(u);mediump vec2 offset2=offset*a_extrude*scale*normal.y*mat2(t,-u,u,t);vec4 projected_extrude=u_matrix*vec4(dist/u_ratio,0.0,0.0);gl_Position=u_matrix*vec4(pos+offset2/u_ratio,0.0,1.0)+projected_extrude;\n#ifdef TERRAIN3D\nv_gamma_scale=1.0;\n#else\nfloat extrude_length_without_perspective=length(dist);float extrude_length_with_perspective=length(projected_extrude.xy/gl_Position.w*u_units_to_pixels);v_gamma_scale=extrude_length_without_perspective/extrude_length_with_perspective;\n#endif\nv_width2=vec2(outset,inset);}"),lineGradient:me("uniform lowp float u_device_pixel_ratio;uniform sampler2D u_image;varying vec2 v_width2;varying vec2 v_normal;varying float v_gamma_scale;varying highp vec2 v_uv;\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\nfloat dist=length(v_normal)*v_width2.s;float blur2=(blur+1.0/u_device_pixel_ratio)*v_gamma_scale;float alpha=clamp(min(dist-(v_width2.t-blur2),v_width2.s-dist)/blur2,0.0,1.0);vec4 color=texture2D(u_image,v_uv);gl_FragColor=color*(alpha*opacity);\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","\n#define scale 0.015873016\nattribute vec2 a_pos_normal;attribute vec4 a_data;attribute float a_uv_x;attribute float a_split_index;uniform mat4 u_matrix;uniform mediump float u_ratio;uniform lowp float u_device_pixel_ratio;uniform vec2 u_units_to_pixels;uniform float u_image_height;varying vec2 v_normal;varying vec2 v_width2;varying float v_gamma_scale;varying highp vec2 v_uv;\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define mediump float gapwidth\n#pragma mapbox: define lowp float offset\n#pragma mapbox: define mediump float width\nvoid main() {\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize mediump float gapwidth\n#pragma mapbox: initialize lowp float offset\n#pragma mapbox: initialize mediump float width\nfloat ANTIALIASING=1.0/u_device_pixel_ratio/2.0;vec2 a_extrude=a_data.xy-128.0;float a_direction=mod(a_data.z,4.0)-1.0;highp float texel_height=1.0/u_image_height;highp float half_texel_height=0.5*texel_height;v_uv=vec2(a_uv_x,a_split_index*texel_height-half_texel_height);vec2 pos=floor(a_pos_normal*0.5);mediump vec2 normal=a_pos_normal-2.0*pos;normal.y=normal.y*2.0-1.0;v_normal=normal;gapwidth=gapwidth/2.0;float halfwidth=width/2.0;offset=-1.0*offset;float inset=gapwidth+(gapwidth > 0.0 ? ANTIALIASING : 0.0);float outset=gapwidth+halfwidth*(gapwidth > 0.0 ? 2.0 : 1.0)+(halfwidth==0.0 ? 0.0 : ANTIALIASING);mediump vec2 dist=outset*a_extrude*scale;mediump float u=0.5*a_direction;mediump float t=1.0-abs(u);mediump vec2 offset2=offset*a_extrude*scale*normal.y*mat2(t,-u,u,t);vec4 projected_extrude=u_matrix*vec4(dist/u_ratio,0.0,0.0);gl_Position=u_matrix*vec4(pos+offset2/u_ratio,0.0,1.0)+projected_extrude;\n#ifdef TERRAIN3D\nv_gamma_scale=1.0;\n#else\nfloat extrude_length_without_perspective=length(dist);float extrude_length_with_perspective=length(projected_extrude.xy/gl_Position.w*u_units_to_pixels);v_gamma_scale=extrude_length_without_perspective/extrude_length_with_perspective;\n#endif\nv_width2=vec2(outset,inset);}"),linePattern:me("#ifdef GL_ES\nprecision highp float;\n#endif\nuniform lowp float u_device_pixel_ratio;uniform vec2 u_texsize;uniform float u_fade;uniform mediump vec3 u_scale;uniform sampler2D u_image;varying vec2 v_normal;varying vec2 v_width2;varying float v_linesofar;varying float v_gamma_scale;varying float v_width;\n#pragma mapbox: define lowp vec4 pattern_from\n#pragma mapbox: define lowp vec4 pattern_to\n#pragma mapbox: define lowp float pixel_ratio_from\n#pragma mapbox: define lowp float pixel_ratio_to\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize mediump vec4 pattern_from\n#pragma mapbox: initialize mediump vec4 pattern_to\n#pragma mapbox: initialize lowp float pixel_ratio_from\n#pragma mapbox: initialize lowp float pixel_ratio_to\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\nvec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;float tileZoomRatio=u_scale.x;float fromScale=u_scale.y;float toScale=u_scale.z;vec2 display_size_a=(pattern_br_a-pattern_tl_a)/pixel_ratio_from;vec2 display_size_b=(pattern_br_b-pattern_tl_b)/pixel_ratio_to;vec2 pattern_size_a=vec2(display_size_a.x*fromScale/tileZoomRatio,display_size_a.y);vec2 pattern_size_b=vec2(display_size_b.x*toScale/tileZoomRatio,display_size_b.y);float aspect_a=display_size_a.y/v_width;float aspect_b=display_size_b.y/v_width;float dist=length(v_normal)*v_width2.s;float blur2=(blur+1.0/u_device_pixel_ratio)*v_gamma_scale;float alpha=clamp(min(dist-(v_width2.t-blur2),v_width2.s-dist)/blur2,0.0,1.0);float x_a=mod(v_linesofar/pattern_size_a.x*aspect_a,1.0);float x_b=mod(v_linesofar/pattern_size_b.x*aspect_b,1.0);float y=0.5*v_normal.y+0.5;vec2 texel_size=1.0/u_texsize;vec2 pos_a=mix(pattern_tl_a*texel_size-texel_size,pattern_br_a*texel_size+texel_size,vec2(x_a,y));vec2 pos_b=mix(pattern_tl_b*texel_size-texel_size,pattern_br_b*texel_size+texel_size,vec2(x_b,y));vec4 color=mix(texture2D(u_image,pos_a),texture2D(u_image,pos_b),u_fade);gl_FragColor=color*alpha*opacity;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","\n#define scale 0.015873016\n#define LINE_DISTANCE_SCALE 2.0\nattribute vec2 a_pos_normal;attribute vec4 a_data;uniform mat4 u_matrix;uniform vec2 u_units_to_pixels;uniform mediump float u_ratio;uniform lowp float u_device_pixel_ratio;varying vec2 v_normal;varying vec2 v_width2;varying float v_linesofar;varying float v_gamma_scale;varying float v_width;\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp float offset\n#pragma mapbox: define mediump float gapwidth\n#pragma mapbox: define mediump float width\n#pragma mapbox: define lowp float floorwidth\n#pragma mapbox: define lowp vec4 pattern_from\n#pragma mapbox: define lowp vec4 pattern_to\n#pragma mapbox: define lowp float pixel_ratio_from\n#pragma mapbox: define lowp float pixel_ratio_to\nvoid main() {\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize lowp float offset\n#pragma mapbox: initialize mediump float gapwidth\n#pragma mapbox: initialize mediump float width\n#pragma mapbox: initialize lowp float floorwidth\n#pragma mapbox: initialize mediump vec4 pattern_from\n#pragma mapbox: initialize mediump vec4 pattern_to\n#pragma mapbox: initialize lowp float pixel_ratio_from\n#pragma mapbox: initialize lowp float pixel_ratio_to\nfloat ANTIALIASING=1.0/u_device_pixel_ratio/2.0;vec2 a_extrude=a_data.xy-128.0;float a_direction=mod(a_data.z,4.0)-1.0;float a_linesofar=(floor(a_data.z/4.0)+a_data.w*64.0)*LINE_DISTANCE_SCALE;vec2 pos=floor(a_pos_normal*0.5);mediump vec2 normal=a_pos_normal-2.0*pos;normal.y=normal.y*2.0-1.0;v_normal=normal;gapwidth=gapwidth/2.0;float halfwidth=width/2.0;offset=-1.0*offset;float inset=gapwidth+(gapwidth > 0.0 ? ANTIALIASING : 0.0);float outset=gapwidth+halfwidth*(gapwidth > 0.0 ? 2.0 : 1.0)+(halfwidth==0.0 ? 0.0 : ANTIALIASING);mediump vec2 dist=outset*a_extrude*scale;mediump float u=0.5*a_direction;mediump float t=1.0-abs(u);mediump vec2 offset2=offset*a_extrude*scale*normal.y*mat2(t,-u,u,t);vec4 projected_extrude=u_matrix*vec4(dist/u_ratio,0.0,0.0);gl_Position=u_matrix*vec4(pos+offset2/u_ratio,0.0,1.0)+projected_extrude;\n#ifdef TERRAIN3D\nv_gamma_scale=1.0;\n#else\nfloat extrude_length_without_perspective=length(dist);float extrude_length_with_perspective=length(projected_extrude.xy/gl_Position.w*u_units_to_pixels);v_gamma_scale=extrude_length_without_perspective/extrude_length_with_perspective;\n#endif\nv_linesofar=a_linesofar;v_width2=vec2(outset,inset);v_width=floorwidth;}"),lineSDF:me("uniform lowp float u_device_pixel_ratio;uniform sampler2D u_image;uniform float u_sdfgamma;uniform float u_mix;varying vec2 v_normal;varying vec2 v_width2;varying vec2 v_tex_a;varying vec2 v_tex_b;varying float v_gamma_scale;\n#pragma mapbox: define highp vec4 color\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define mediump float width\n#pragma mapbox: define lowp float floorwidth\nvoid main() {\n#pragma mapbox: initialize highp vec4 color\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize mediump float width\n#pragma mapbox: initialize lowp float floorwidth\nfloat dist=length(v_normal)*v_width2.s;float blur2=(blur+1.0/u_device_pixel_ratio)*v_gamma_scale;float alpha=clamp(min(dist-(v_width2.t-blur2),v_width2.s-dist)/blur2,0.0,1.0);float sdfdist_a=texture2D(u_image,v_tex_a).a;float sdfdist_b=texture2D(u_image,v_tex_b).a;float sdfdist=mix(sdfdist_a,sdfdist_b,u_mix);alpha*=smoothstep(0.5-u_sdfgamma/floorwidth,0.5+u_sdfgamma/floorwidth,sdfdist);gl_FragColor=color*(alpha*opacity);\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","\n#define scale 0.015873016\n#define LINE_DISTANCE_SCALE 2.0\nattribute vec2 a_pos_normal;attribute vec4 a_data;uniform mat4 u_matrix;uniform mediump float u_ratio;uniform lowp float u_device_pixel_ratio;uniform vec2 u_patternscale_a;uniform float u_tex_y_a;uniform vec2 u_patternscale_b;uniform float u_tex_y_b;uniform vec2 u_units_to_pixels;varying vec2 v_normal;varying vec2 v_width2;varying vec2 v_tex_a;varying vec2 v_tex_b;varying float v_gamma_scale;\n#pragma mapbox: define highp vec4 color\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define mediump float gapwidth\n#pragma mapbox: define lowp float offset\n#pragma mapbox: define mediump float width\n#pragma mapbox: define lowp float floorwidth\nvoid main() {\n#pragma mapbox: initialize highp vec4 color\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize mediump float gapwidth\n#pragma mapbox: initialize lowp float offset\n#pragma mapbox: initialize mediump float width\n#pragma mapbox: initialize lowp float floorwidth\nfloat ANTIALIASING=1.0/u_device_pixel_ratio/2.0;vec2 a_extrude=a_data.xy-128.0;float a_direction=mod(a_data.z,4.0)-1.0;float a_linesofar=(floor(a_data.z/4.0)+a_data.w*64.0)*LINE_DISTANCE_SCALE;vec2 pos=floor(a_pos_normal*0.5);mediump vec2 normal=a_pos_normal-2.0*pos;normal.y=normal.y*2.0-1.0;v_normal=normal;gapwidth=gapwidth/2.0;float halfwidth=width/2.0;offset=-1.0*offset;float inset=gapwidth+(gapwidth > 0.0 ? ANTIALIASING : 0.0);float outset=gapwidth+halfwidth*(gapwidth > 0.0 ? 2.0 : 1.0)+(halfwidth==0.0 ? 0.0 : ANTIALIASING);mediump vec2 dist=outset*a_extrude*scale;mediump float u=0.5*a_direction;mediump float t=1.0-abs(u);mediump vec2 offset2=offset*a_extrude*scale*normal.y*mat2(t,-u,u,t);vec4 projected_extrude=u_matrix*vec4(dist/u_ratio,0.0,0.0);gl_Position=u_matrix*vec4(pos+offset2/u_ratio,0.0,1.0)+projected_extrude;\n#ifdef TERRAIN3D\nv_gamma_scale=1.0;\n#else\nfloat extrude_length_without_perspective=length(dist);float extrude_length_with_perspective=length(projected_extrude.xy/gl_Position.w*u_units_to_pixels);v_gamma_scale=extrude_length_without_perspective/extrude_length_with_perspective;\n#endif\nv_tex_a=vec2(a_linesofar*u_patternscale_a.x/floorwidth,normal.y*u_patternscale_a.y+u_tex_y_a);v_tex_b=vec2(a_linesofar*u_patternscale_b.x/floorwidth,normal.y*u_patternscale_b.y+u_tex_y_b);v_width2=vec2(outset,inset);}"),raster:me("uniform float u_fade_t;uniform float u_opacity;uniform sampler2D u_image0;uniform sampler2D u_image1;varying vec2 v_pos0;varying vec2 v_pos1;uniform float u_brightness_low;uniform float u_brightness_high;uniform float u_saturation_factor;uniform float u_contrast_factor;uniform vec3 u_spin_weights;void main() {vec4 color0=texture2D(u_image0,v_pos0);vec4 color1=texture2D(u_image1,v_pos1);if (color0.a > 0.0) {color0.rgb=color0.rgb/color0.a;}if (color1.a > 0.0) {color1.rgb=color1.rgb/color1.a;}vec4 color=mix(color0,color1,u_fade_t);color.a*=u_opacity;vec3 rgb=color.rgb;rgb=vec3(dot(rgb,u_spin_weights.xyz),dot(rgb,u_spin_weights.zxy),dot(rgb,u_spin_weights.yzx));float average=(color.r+color.g+color.b)/3.0;rgb+=(average-rgb)*u_saturation_factor;rgb=(rgb-0.5)*u_contrast_factor+0.5;vec3 u_high_vec=vec3(u_brightness_low,u_brightness_low,u_brightness_low);vec3 u_low_vec=vec3(u_brightness_high,u_brightness_high,u_brightness_high);gl_FragColor=vec4(mix(u_high_vec,u_low_vec,rgb)*color.a,color.a);\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","uniform mat4 u_matrix;uniform vec2 u_tl_parent;uniform float u_scale_parent;uniform float u_buffer_scale;attribute vec2 a_pos;attribute vec2 a_texture_pos;varying vec2 v_pos0;varying vec2 v_pos1;void main() {gl_Position=u_matrix*vec4(a_pos,0,1);v_pos0=(((a_texture_pos/8192.0)-0.5)/u_buffer_scale )+0.5;v_pos1=(v_pos0*u_scale_parent)+u_tl_parent;}"),symbolIcon:me("uniform sampler2D u_texture;varying vec2 v_tex;varying float v_fade_opacity;\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize lowp float opacity\nlowp float alpha=opacity*v_fade_opacity;gl_FragColor=texture2D(u_texture,v_tex)*alpha;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","attribute vec4 a_pos_offset;attribute vec4 a_data;attribute vec4 a_pixeloffset;attribute vec3 a_projected_pos;attribute float a_fade_opacity;uniform bool u_is_size_zoom_constant;uniform bool u_is_size_feature_constant;uniform highp float u_size_t;uniform highp float u_size;uniform highp float u_camera_to_center_distance;uniform highp float u_pitch;uniform bool u_rotate_symbol;uniform highp float u_aspect_ratio;uniform float u_fade_change;uniform mat4 u_matrix;uniform mat4 u_label_plane_matrix;uniform mat4 u_coord_matrix;uniform bool u_is_text;uniform bool u_pitch_with_map;uniform vec2 u_texsize;uniform bool u_is_along_line;uniform bool u_is_variable_anchor;uniform vec2 u_translation;uniform float u_pitched_scale;varying vec2 v_tex;varying float v_fade_opacity;vec4 projectTileWithElevation(vec2 posInTile,float elevation) {return u_matrix*vec4(posInTile,elevation,1.0);}\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize lowp float opacity\nvec2 a_pos=a_pos_offset.xy;vec2 a_offset=a_pos_offset.zw;vec2 a_tex=a_data.xy;vec2 a_size=a_data.zw;float a_size_min=floor(a_size[0]*0.5);vec2 a_pxoffset=a_pixeloffset.xy;vec2 a_minFontScale=a_pixeloffset.zw/256.0;float ele=get_elevation(a_pos);highp float segment_angle=-a_projected_pos[2];float size;if (!u_is_size_zoom_constant && !u_is_size_feature_constant) {size=mix(a_size_min,a_size[1],u_size_t)/128.0;} else if (u_is_size_zoom_constant && !u_is_size_feature_constant) {size=a_size_min/128.0;} else {size=u_size;}vec2 translated_a_pos=a_pos+u_translation;vec4 projectedPoint=projectTileWithElevation(translated_a_pos,ele);highp float camera_to_anchor_distance=projectedPoint.w;highp float distance_ratio=u_pitch_with_map ?\ncamera_to_anchor_distance/u_camera_to_center_distance :\nu_camera_to_center_distance/camera_to_anchor_distance;highp float perspective_ratio=clamp(0.5+0.5*distance_ratio,0.0,4.0);size*=perspective_ratio;float fontScale=u_is_text ? size/24.0 : size;highp float symbol_rotation=0.0;if (u_rotate_symbol) {vec4 offsetProjectedPoint=projectTileWithElevation(translated_a_pos+vec2(1,0),ele);vec2 a=projectedPoint.xy/projectedPoint.w;vec2 b=offsetProjectedPoint.xy/offsetProjectedPoint.w;symbol_rotation=atan((b.y-a.y)/u_aspect_ratio,b.x-a.x);}highp float angle_sin=sin(segment_angle+symbol_rotation);highp float angle_cos=cos(segment_angle+symbol_rotation);mat2 rotation_matrix=mat2(angle_cos,-1.0*angle_sin,angle_sin,angle_cos);vec4 projected_pos;if (u_is_along_line || u_is_variable_anchor) {projected_pos=vec4(a_projected_pos.xy,ele,1.0);} else if (u_pitch_with_map) {projected_pos=u_label_plane_matrix*vec4(a_projected_pos.xy+u_translation,ele,1.0);} else {projected_pos=u_label_plane_matrix*projectTileWithElevation(a_projected_pos.xy+u_translation,ele);}float z=float(u_pitch_with_map)*projected_pos.z/projected_pos.w;float projectionScaling=1.0;vec4 finalPos=u_coord_matrix*vec4(projected_pos.xy/projected_pos.w+rotation_matrix*(a_offset/32.0*max(a_minFontScale,fontScale)+a_pxoffset/16.0)*projectionScaling,z,1.0);if(u_pitch_with_map) {finalPos=projectTileWithElevation(finalPos.xy,finalPos.z);}gl_Position=finalPos;v_tex=a_tex/u_texsize;vec2 fade_opacity=unpack_opacity(a_fade_opacity);float fade_change=fade_opacity[1] > 0.5 ? u_fade_change :-u_fade_change;float visibility=calculate_visibility(projectedPoint);v_fade_opacity=max(0.0,min(visibility,fade_opacity[0]+fade_change));}"),symbolSDF:me("#define SDF_PX 8.0\nuniform bool u_is_halo;uniform sampler2D u_texture;uniform highp float u_gamma_scale;uniform lowp float u_device_pixel_ratio;uniform bool u_is_text;varying vec2 v_data0;varying vec3 v_data1;\n#pragma mapbox: define highp vec4 fill_color\n#pragma mapbox: define highp vec4 halo_color\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp float halo_width\n#pragma mapbox: define lowp float halo_blur\nvoid main() {\n#pragma mapbox: initialize highp vec4 fill_color\n#pragma mapbox: initialize highp vec4 halo_color\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize lowp float halo_width\n#pragma mapbox: initialize lowp float halo_blur\nfloat EDGE_GAMMA=0.105/u_device_pixel_ratio;vec2 tex=v_data0.xy;float gamma_scale=v_data1.x;float size=v_data1.y;float fade_opacity=v_data1[2];float fontScale=u_is_text ? size/24.0 : size;lowp vec4 color=fill_color;highp float gamma=EDGE_GAMMA/(fontScale*u_gamma_scale);lowp float inner_edge=(256.0-64.0)/256.0;if (u_is_halo) {color=halo_color;gamma=(halo_blur*1.19/SDF_PX+EDGE_GAMMA)/(fontScale*u_gamma_scale);inner_edge=inner_edge+gamma*gamma_scale;}lowp float dist=texture2D(u_texture,tex).a;highp float gamma_scaled=gamma*gamma_scale;highp float alpha=smoothstep(inner_edge-gamma_scaled,inner_edge+gamma_scaled,dist);if (u_is_halo) {lowp float halo_edge=(6.0-halo_width/fontScale)/SDF_PX;alpha=min(smoothstep(halo_edge-gamma_scaled,halo_edge+gamma_scaled,dist),1.0-alpha);}gl_FragColor=color*(alpha*opacity*fade_opacity);\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","attribute vec4 a_pos_offset;attribute vec4 a_data;attribute vec4 a_pixeloffset;attribute vec3 a_projected_pos;attribute float a_fade_opacity;uniform bool u_is_size_zoom_constant;uniform bool u_is_size_feature_constant;uniform highp float u_size_t;uniform highp float u_size;uniform mat4 u_matrix;uniform mat4 u_label_plane_matrix;uniform mat4 u_coord_matrix;uniform bool u_is_text;uniform bool u_pitch_with_map;uniform bool u_is_along_line;uniform bool u_is_variable_anchor;uniform highp float u_pitch;uniform bool u_rotate_symbol;uniform highp float u_aspect_ratio;uniform highp float u_camera_to_center_distance;uniform float u_fade_change;uniform vec2 u_texsize;uniform vec2 u_translation;uniform float u_pitched_scale;varying vec2 v_data0;varying vec3 v_data1;vec4 projectTileWithElevation(vec2 posInTile,float elevation) {return u_matrix*vec4(posInTile,elevation,1.0);}\n#pragma mapbox: define highp vec4 fill_color\n#pragma mapbox: define highp vec4 halo_color\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp float halo_width\n#pragma mapbox: define lowp float halo_blur\nvoid main() {\n#pragma mapbox: initialize highp vec4 fill_color\n#pragma mapbox: initialize highp vec4 halo_color\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize lowp float halo_width\n#pragma mapbox: initialize lowp float halo_blur\nvec2 a_pos=a_pos_offset.xy;vec2 a_offset=a_pos_offset.zw;vec2 a_tex=a_data.xy;vec2 a_size=a_data.zw;float a_size_min=floor(a_size[0]*0.5);vec2 a_pxoffset=a_pixeloffset.xy;float ele=get_elevation(a_pos);highp float segment_angle=-a_projected_pos[2];float size;if (!u_is_size_zoom_constant && !u_is_size_feature_constant) {size=mix(a_size_min,a_size[1],u_size_t)/128.0;} else if (u_is_size_zoom_constant && !u_is_size_feature_constant) {size=a_size_min/128.0;} else {size=u_size;}vec2 translated_a_pos=a_pos+u_translation;vec4 projectedPoint=projectTileWithElevation(translated_a_pos,ele);highp float camera_to_anchor_distance=projectedPoint.w;highp float distance_ratio=u_pitch_with_map ?\ncamera_to_anchor_distance/u_camera_to_center_distance :\nu_camera_to_center_distance/camera_to_anchor_distance;highp float perspective_ratio=clamp(0.5+0.5*distance_ratio,0.0,4.0);size*=perspective_ratio;float fontScale=u_is_text ? size/24.0 : size;highp float symbol_rotation=0.0;if (u_rotate_symbol) {vec4 offsetProjectedPoint=projectTileWithElevation(translated_a_pos+vec2(1,0),ele);vec2 a=projectedPoint.xy/projectedPoint.w;vec2 b=offsetProjectedPoint.xy/offsetProjectedPoint.w;symbol_rotation=atan((b.y-a.y)/u_aspect_ratio,b.x-a.x);}highp float angle_sin=sin(segment_angle+symbol_rotation);highp float angle_cos=cos(segment_angle+symbol_rotation);mat2 rotation_matrix=mat2(angle_cos,-1.0*angle_sin,angle_sin,angle_cos);vec4 projected_pos;if (u_is_along_line || u_is_variable_anchor) {projected_pos=vec4(a_projected_pos.xy,ele,1.0);} else if (u_pitch_with_map) {projected_pos=u_label_plane_matrix*vec4(a_projected_pos.xy+u_translation,ele,1.0);} else {projected_pos=u_label_plane_matrix*projectTileWithElevation(a_projected_pos.xy+u_translation,ele);}float z=float(u_pitch_with_map)*projected_pos.z/projected_pos.w;float projectionScaling=1.0;vec4 finalPos=u_coord_matrix*vec4(projected_pos.xy/projected_pos.w+rotation_matrix*(a_offset/32.0*fontScale+a_pxoffset)*projectionScaling,z,1.0);if(u_pitch_with_map) {finalPos=projectTileWithElevation(finalPos.xy,finalPos.z);}float gamma_scale=finalPos.w;gl_Position=finalPos;vec2 fade_opacity=unpack_opacity(a_fade_opacity);float visibility=calculate_visibility(projectedPoint);float fade_change=fade_opacity[1] > 0.5 ? u_fade_change :-u_fade_change;float interpolated_fade_opacity=max(0.0,min(visibility,fade_opacity[0]+fade_change));v_data0=a_tex/u_texsize;v_data1=vec3(gamma_scale,size,interpolated_fade_opacity);}"),symbolTextAndIcon:me("#define SDF_PX 8.0\n#define SDF 1.0\n#define ICON 0.0\nuniform bool u_is_halo;uniform sampler2D u_texture;uniform sampler2D u_texture_icon;uniform highp float u_gamma_scale;uniform lowp float u_device_pixel_ratio;varying vec4 v_data0;varying vec4 v_data1;\n#pragma mapbox: define highp vec4 fill_color\n#pragma mapbox: define highp vec4 halo_color\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp float halo_width\n#pragma mapbox: define lowp float halo_blur\nvoid main() {\n#pragma mapbox: initialize highp vec4 fill_color\n#pragma mapbox: initialize highp vec4 halo_color\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize lowp float halo_width\n#pragma mapbox: initialize lowp float halo_blur\nfloat fade_opacity=v_data1[2];if (v_data1.w==ICON) {vec2 tex_icon=v_data0.zw;lowp float alpha=opacity*fade_opacity;gl_FragColor=texture2D(u_texture_icon,tex_icon)*alpha;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\nreturn;}vec2 tex=v_data0.xy;float EDGE_GAMMA=0.105/u_device_pixel_ratio;float gamma_scale=v_data1.x;float size=v_data1.y;float fontScale=size/24.0;lowp vec4 color=fill_color;highp float gamma=EDGE_GAMMA/(fontScale*u_gamma_scale);lowp float buff=(256.0-64.0)/256.0;if (u_is_halo) {color=halo_color;gamma=(halo_blur*1.19/SDF_PX+EDGE_GAMMA)/(fontScale*u_gamma_scale);buff=(6.0-halo_width/fontScale)/SDF_PX;}lowp float dist=texture2D(u_texture,tex).a;highp float gamma_scaled=gamma*gamma_scale;highp float alpha=smoothstep(buff-gamma_scaled,buff+gamma_scaled,dist);gl_FragColor=color*(alpha*opacity*fade_opacity);\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","attribute vec4 a_pos_offset;attribute vec4 a_data;attribute vec3 a_projected_pos;attribute float a_fade_opacity;uniform bool u_is_size_zoom_constant;uniform bool u_is_size_feature_constant;uniform highp float u_size_t;uniform highp float u_size;uniform mat4 u_matrix;uniform mat4 u_label_plane_matrix;uniform mat4 u_coord_matrix;uniform bool u_is_text;uniform bool u_pitch_with_map;uniform highp float u_pitch;uniform bool u_rotate_symbol;uniform highp float u_aspect_ratio;uniform highp float u_camera_to_center_distance;uniform float u_fade_change;uniform vec2 u_texsize;uniform vec2 u_texsize_icon;uniform bool u_is_along_line;uniform bool u_is_variable_anchor;uniform vec2 u_translation;uniform float u_pitched_scale;varying vec4 v_data0;varying vec4 v_data1;vec4 projectTileWithElevation(vec2 posInTile,float elevation) {return u_matrix*vec4(posInTile,elevation,1.0);}\n#pragma mapbox: define highp vec4 fill_color\n#pragma mapbox: define highp vec4 halo_color\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp float halo_width\n#pragma mapbox: define lowp float halo_blur\nvoid main() {\n#pragma mapbox: initialize highp vec4 fill_color\n#pragma mapbox: initialize highp vec4 halo_color\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize lowp float halo_width\n#pragma mapbox: initialize lowp float halo_blur\nvec2 a_pos=a_pos_offset.xy;vec2 a_offset=a_pos_offset.zw;vec2 a_tex=a_data.xy;vec2 a_size=a_data.zw;float a_size_min=floor(a_size[0]*0.5);float is_sdf=a_size[0]-2.0*a_size_min;float ele=get_elevation(a_pos);highp float segment_angle=-a_projected_pos[2];float size;if (!u_is_size_zoom_constant && !u_is_size_feature_constant) {size=mix(a_size_min,a_size[1],u_size_t)/128.0;} else if (u_is_size_zoom_constant && !u_is_size_feature_constant) {size=a_size_min/128.0;} else {size=u_size;}vec2 translated_a_pos=a_pos+u_translation;vec4 projectedPoint=projectTileWithElevation(translated_a_pos,ele);highp float camera_to_anchor_distance=projectedPoint.w;highp float distance_ratio=u_pitch_with_map ?\ncamera_to_anchor_distance/u_camera_to_center_distance :\nu_camera_to_center_distance/camera_to_anchor_distance;highp float perspective_ratio=clamp(0.5+0.5*distance_ratio,0.0,4.0);size*=perspective_ratio;float fontScale=size/24.0;highp float symbol_rotation=0.0;if (u_rotate_symbol) {vec4 offsetProjectedPoint=projectTileWithElevation(translated_a_pos+vec2(1,0),ele);vec2 a=projectedPoint.xy/projectedPoint.w;vec2 b=offsetProjectedPoint.xy/offsetProjectedPoint.w;symbol_rotation=atan((b.y-a.y)/u_aspect_ratio,b.x-a.x);}highp float angle_sin=sin(segment_angle+symbol_rotation);highp float angle_cos=cos(segment_angle+symbol_rotation);mat2 rotation_matrix=mat2(angle_cos,-1.0*angle_sin,angle_sin,angle_cos);vec4 projected_pos;if (u_is_along_line || u_is_variable_anchor) {projected_pos=vec4(a_projected_pos.xy,ele,1.0);} else if (u_pitch_with_map) {projected_pos=u_label_plane_matrix*vec4(a_projected_pos.xy+u_translation,ele,1.0);} else {projected_pos=u_label_plane_matrix*projectTileWithElevation(a_projected_pos.xy+u_translation,ele);}float z=float(u_pitch_with_map)*projected_pos.z/projected_pos.w;float projectionScaling=1.0;vec4 finalPos=u_coord_matrix*vec4(projected_pos.xy/projected_pos.w+rotation_matrix*(a_offset/32.0*fontScale)*projectionScaling,z,1.0);if(u_pitch_with_map) {finalPos=projectTileWithElevation(finalPos.xy,finalPos.z);}float gamma_scale=finalPos.w;gl_Position=finalPos;vec2 fade_opacity=unpack_opacity(a_fade_opacity);float visibility=calculate_visibility(projectedPoint);float fade_change=fade_opacity[1] > 0.5 ? u_fade_change :-u_fade_change;float interpolated_fade_opacity=max(0.0,min(visibility,fade_opacity[0]+fade_change));v_data0.xy=a_tex/u_texsize;v_data0.zw=a_tex/u_texsize_icon;v_data1=vec4(gamma_scale,size,interpolated_fade_opacity,is_sdf);}"),terrain:me("uniform sampler2D u_texture;uniform vec4 u_fog_color;uniform vec4 u_horizon_color;uniform float u_fog_ground_blend;uniform float u_fog_ground_blend_opacity;uniform float u_horizon_fog_blend;varying vec2 v_texture_pos;varying float v_fog_depth;const float gamma=2.2;vec4 gammaToLinear(vec4 color) {return pow(color,vec4(gamma));}vec4 linearToGamma(vec4 color) {return pow(color,vec4(1.0/gamma));}void main() {vec4 surface_color=texture2D(u_texture,v_texture_pos);if (v_fog_depth > u_fog_ground_blend) {vec4 surface_color_linear=gammaToLinear(surface_color);float blend_color=smoothstep(0.0,1.0,max((v_fog_depth-u_horizon_fog_blend)/(1.0-u_horizon_fog_blend),0.0));vec4 fog_horizon_color_linear=mix(gammaToLinear(u_fog_color),gammaToLinear(u_horizon_color),blend_color);float factor_fog=max(v_fog_depth-u_fog_ground_blend,0.0)/(1.0-u_fog_ground_blend);gl_FragColor=linearToGamma(mix(surface_color_linear,fog_horizon_color_linear,pow(factor_fog,2.0)*u_fog_ground_blend_opacity));} else {gl_FragColor=surface_color;}}","attribute vec3 a_pos3d;uniform mat4 u_matrix;uniform mat4 u_fog_matrix;uniform float u_ele_delta;varying vec2 v_texture_pos;varying float v_fog_depth;void main() {float ele=get_elevation(a_pos3d.xy);float ele_delta=a_pos3d.z==1.0 ? u_ele_delta : 0.0;v_texture_pos=a_pos3d.xy/8192.0;gl_Position=u_matrix*vec4(a_pos3d.xy,ele-ele_delta,1.0);vec4 pos=u_fog_matrix*vec4(a_pos3d.xy,ele,1.0);v_fog_depth=pos.z/pos.w*0.5+0.5;}"),terrainDepth:me("varying float v_depth;const highp vec4 bitSh=vec4(256.*256.*256.,256.*256.,256.,1.);const highp vec4 bitMsk=vec4(0.,vec3(1./256.0));highp vec4 pack(highp float value) {highp vec4 comp=fract(value*bitSh);comp-=comp.xxyz*bitMsk;return comp;}void main() {gl_FragColor=pack(v_depth);}","attribute vec3 a_pos3d;uniform mat4 u_matrix;uniform float u_ele_delta;varying float v_depth;void main() {float ele=get_elevation(a_pos3d.xy);float ele_delta=a_pos3d.z==1.0 ? u_ele_delta : 0.0;gl_Position=u_matrix*vec4(a_pos3d.xy,ele-ele_delta,1.0);v_depth=gl_Position.z/gl_Position.w;}"),terrainCoords:me("precision mediump float;uniform sampler2D u_texture;uniform float u_terrain_coords_id;varying vec2 v_texture_pos;void main() {vec4 rgba=texture2D(u_texture,v_texture_pos);gl_FragColor=vec4(rgba.r,rgba.g,rgba.b,u_terrain_coords_id);}","attribute vec3 a_pos3d;uniform mat4 u_matrix;uniform float u_ele_delta;varying vec2 v_texture_pos;void main() {float ele=get_elevation(a_pos3d.xy);float ele_delta=a_pos3d.z==1.0 ? u_ele_delta : 0.0;v_texture_pos=a_pos3d.xy/8192.0;gl_Position=u_matrix*vec4(a_pos3d.xy,ele-ele_delta,1.0);}"),sky:me("uniform vec4 u_sky_color;uniform vec4 u_horizon_color;uniform float u_horizon;uniform float u_sky_horizon_blend;void main() {float y=gl_FragCoord.y;if (y > u_horizon) {float blend=y-u_horizon;if (blend < u_sky_horizon_blend) {gl_FragColor=mix(u_sky_color,u_horizon_color,pow(1.0-blend/u_sky_horizon_blend,2.0));} else {gl_FragColor=u_sky_color;}}}","attribute vec2 a_pos;void main() {gl_Position=vec4(a_pos,1.0,1.0);}")};function me(t,e){const i=/#pragma mapbox: ([\w]+) ([\w]+) ([\w]+) ([\w]+)/g,r=e.match(/attribute ([\w]+) ([\w]+)/g),n=t.match(/uniform ([\w]+) ([\w]+)([\s]*)([\w]*)/g),o=e.match(/uniform ([\w]+) ([\w]+)([\s]*)([\w]*)/g),a=o?o.concat(n):n,s={};return{fragmentSource:t=t.replace(i,((t,e,i,r,n)=>(s[n]=!0,"define"===e?`\n#ifndef HAS_UNIFORM_u_${n}\nvarying ${i} ${r} ${n};\n#else\nuniform ${i} ${r} u_${n};\n#endif\n`:`\n#ifdef HAS_UNIFORM_u_${n}\n ${i} ${r} ${n} = u_${n};\n#endif\n`))),vertexSource:e=e.replace(i,((t,e,i,r,n)=>{const o="float"===r?"vec2":"vec4",a=n.match(/color/)?"color":o;return s[n]?"define"===e?`\n#ifndef HAS_UNIFORM_u_${n}\nuniform lowp float u_${n}_t;\nattribute ${i} ${o} a_${n};\nvarying ${i} ${r} ${n};\n#else\nuniform ${i} ${r} u_${n};\n#endif\n`:"vec4"===a?`\n#ifndef HAS_UNIFORM_u_${n}\n ${n} = a_${n};\n#else\n ${i} ${r} ${n} = u_${n};\n#endif\n`:`\n#ifndef HAS_UNIFORM_u_${n}\n ${n} = unpack_mix_${a}(a_${n}, u_${n}_t);\n#else\n ${i} ${r} ${n} = u_${n};\n#endif\n`:"define"===e?`\n#ifndef HAS_UNIFORM_u_${n}\nuniform lowp float u_${n}_t;\nattribute ${i} ${o} a_${n};\n#else\nuniform ${i} ${r} u_${n};\n#endif\n`:"vec4"===a?`\n#ifndef HAS_UNIFORM_u_${n}\n ${i} ${r} ${n} = a_${n};\n#else\n ${i} ${r} ${n} = u_${n};\n#endif\n`:`\n#ifndef HAS_UNIFORM_u_${n}\n ${i} ${r} ${n} = unpack_mix_${a}(a_${n}, u_${n}_t);\n#else\n ${i} ${r} ${n} = u_${n};\n#endif\n`})),staticAttributes:r,staticUniforms:a}}class ge{constructor(){this.boundProgram=null,this.boundLayoutVertexBuffer=null,this.boundPaintVertexBuffers=[],this.boundIndexBuffer=null,this.boundVertexOffset=null,this.boundDynamicVertexBuffer=null,this.vao=null}bind(t,e,i,r,n,o,a,s,l){this.context=t;let c=this.boundPaintVertexBuffers.length!==r.length;for(let u=0;!c&&u<r.length;u++)this.boundPaintVertexBuffers[u]!==r[u]&&(c=!0);!this.vao||this.boundProgram!==e||this.boundLayoutVertexBuffer!==i||c||this.boundIndexBuffer!==n||this.boundVertexOffset!==o||this.boundDynamicVertexBuffer!==a||this.boundDynamicVertexBuffer2!==s||this.boundDynamicVertexBuffer3!==l?this.freshBind(e,i,r,n,o,a,s,l):(t.bindVertexArray.set(this.vao),a&&a.bind(),n&&n.dynamicDraw&&n.bind(),s&&s.bind(),l&&l.bind())}freshBind(t,e,i,r,n,o,a,s){const l=t.numAttributes,c=this.context,u=c.gl;this.vao&&this.destroy(),this.vao=c.createVertexArray(),c.bindVertexArray.set(this.vao),this.boundProgram=t,this.boundLayoutVertexBuffer=e,this.boundPaintVertexBuffers=i,this.boundIndexBuffer=r,this.boundVertexOffset=n,this.boundDynamicVertexBuffer=o,this.boundDynamicVertexBuffer2=a,this.boundDynamicVertexBuffer3=s,e.enableAttributes(u,t);for(const h of i)h.enableAttributes(u,t);o&&o.enableAttributes(u,t),a&&a.enableAttributes(u,t),s&&s.enableAttributes(u,t),e.bind(),e.setVertexAttribPointers(u,t,n);for(const h of i)h.bind(),h.setVertexAttribPointers(u,t,n);o&&(o.bind(),o.setVertexAttribPointers(u,t,n)),r&&r.bind(),a&&(a.bind(),a.setVertexAttribPointers(u,t,n)),s&&(s.bind(),s.setVertexAttribPointers(u,t,n)),c.currentNumAttributes=l}destroy(){this.vao&&(this.context.deleteVertexArray(this.vao),this.vao=null)}}const ye=(t,i,r,n,o)=>({u_matrix:t,u_texture:0,u_ele_delta:i,u_fog_matrix:r,u_fog_color:n?n.properties.get("fog-color"):e.aM.white,u_fog_ground_blend:n?n.properties.get("fog-ground-blend"):1,u_fog_ground_blend_opacity:n?n.calculateFogBlendOpacity(o):0,u_horizon_color:n?n.properties.get("horizon-color"):e.aM.white,u_horizon_fog_blend:n?n.properties.get("horizon-fog-blend"):1});function _e(t){const e=[];for(let i=0;i<t.length;i++){if(null===t[i])continue;const r=t[i].split(" ");e.push(r.pop())}return e}class ve{constructor(t,i,r,n,o,a){const s=t.gl;this.program=s.createProgram();const l=_e(i.staticAttributes),c=r?r.getBinderAttributes():[],u=l.concat(c),h=fe.prelude.staticUniforms?_e(fe.prelude.staticUniforms):[],d=i.staticUniforms?_e(i.staticUniforms):[],p=r?r.getBinderUniforms():[],f=h.concat(d).concat(p),m=[];for(const e of f)m.indexOf(e)<0&&m.push(e);const g=r?r.defines():[];o&&g.push("#define OVERDRAW_INSPECTOR;"),a&&g.push("#define TERRAIN3D;");const y=g.concat(fe.prelude.fragmentSource,i.fragmentSource).join("\n"),_=g.concat(fe.prelude.vertexSource,i.vertexSource).join("\n"),v=s.createShader(s.FRAGMENT_SHADER);if(s.isContextLost())return void(this.failedToCreate=!0);if(s.shaderSource(v,y),s.compileShader(v),!s.getShaderParameter(v,s.COMPILE_STATUS))throw new Error(`Could not compile fragment shader: ${s.getShaderInfoLog(v)}`);s.attachShader(this.program,v);const b=s.createShader(s.VERTEX_SHADER);if(s.isContextLost())return void(this.failedToCreate=!0);if(s.shaderSource(b,_),s.compileShader(b),!s.getShaderParameter(b,s.COMPILE_STATUS))throw new Error(`Could not compile vertex shader: ${s.getShaderInfoLog(b)}`);s.attachShader(this.program,b),this.attributes={};const x={};this.numAttributes=u.length;for(let e=0;e<this.numAttributes;e++)u[e]&&(s.bindAttribLocation(this.program,e,u[e]),this.attributes[u[e]]=e);if(s.linkProgram(this.program),!s.getProgramParameter(this.program,s.LINK_STATUS))throw new Error(`Program failed to link: ${s.getProgramInfoLog(this.program)}`);s.deleteShader(b),s.deleteShader(v);for(let e=0;e<m.length;e++){const t=m[e];if(t&&!x[t]){const e=s.getUniformLocation(this.program,t);e&&(x[t]=e)}}this.fixedUniforms=n(t,x),this.terrainUniforms=((t,i)=>({u_depth:new e.aH(t,i.u_depth),u_terrain:new e.aH(t,i.u_terrain),u_terrain_dim:new e.aI(t,i.u_terrain_dim),u_terrain_matrix:new e.aJ(t,i.u_terrain_matrix),u_terrain_unpack:new e.aK(t,i.u_terrain_unpack),u_terrain_exaggeration:new e.aI(t,i.u_terrain_exaggeration)}))(t,x),this.binderUniforms=r?r.getUniforms(t,x):[]}draw(t,e,i,r,n,o,a,s,l,c,u,h,d,p,f,m,g,y){const _=t.gl;if(this.failedToCreate)return;if(t.program.set(this.program),t.setDepthMode(i),t.setStencilMode(r),t.setColorMode(n),t.setCullFace(o),s){t.activeTexture.set(_.TEXTURE2),_.bindTexture(_.TEXTURE_2D,s.depthTexture),t.activeTexture.set(_.TEXTURE3),_.bindTexture(_.TEXTURE_2D,s.texture);for(const t in this.terrainUniforms)this.terrainUniforms[t].set(s[t])}for(const b in this.fixedUniforms)this.fixedUniforms[b].set(a[b]);f&&f.setUniforms(t,this.binderUniforms,d,{zoom:p});let v=0;switch(e){case _.LINES:v=2;break;case _.TRIANGLES:v=3;break;case _.LINE_STRIP:v=1}for(const b of h.get()){const i=b.vaos||(b.vaos={});(i[l]||(i[l]=new ge)).bind(t,this,c,f?f.getPaintVertexBuffers():[],u,b.vertexOffset,m,g,y),_.drawElements(e,b.primitiveLength*v,_.UNSIGNED_SHORT,b.primitiveOffset*v*2)}}}function be(t,e,i){const r=1/Ft(i,1,e.transform.tileZoom),n=Math.pow(2,i.tileID.overscaledZ),o=i.tileSize*Math.pow(2,e.transform.tileZoom)/n,a=o*(i.tileID.canonical.x+i.tileID.wrap*n),s=o*i.tileID.canonical.y;return{u_image:0,u_texsize:i.imageAtlasTexture.size,u_scale:[r,t.fromScale,t.toScale],u_fade:t.t,u_pixel_coord_upper:[a>>16,s>>16],u_pixel_coord_lower:[65535&a,65535&s]}}const xe=(t,i,r,n)=>{const o=i.style.light,a=o.properties.get("position"),s=[a.x,a.y,a.z],l=function(){var t=new e.A(9);return e.A!=Float32Array&&(t[1]=0,t[2]=0,t[3]=0,t[5]=0,t[6]=0,t[7]=0),t[0]=1,t[4]=1,t[8]=1,t}();"viewport"===o.properties.get("anchor")&&function(t,e){var i=Math.sin(e),r=Math.cos(e);t[0]=r,t[1]=i,t[2]=0,t[3]=-i,t[4]=r,t[5]=0,t[6]=0,t[7]=0,t[8]=1}(l,-i.transform.angle),function(t,e,i){var r=e[0],n=e[1],o=e[2];t[0]=r*i[0]+n*i[3]+o*i[6],t[1]=r*i[1]+n*i[4]+o*i[7],t[2]=r*i[2]+n*i[5]+o*i[8]}(s,s,l);const c=o.properties.get("color");return{u_matrix:t,u_lightpos:s,u_lightintensity:o.properties.get("intensity"),u_lightcolor:[c.r,c.g,c.b],u_vertical_gradient:+r,u_opacity:n}},we=(t,i,r,n,o,a,s)=>e.e(xe(t,i,r,n),be(a,i,s),{u_height_factor:-Math.pow(2,o.overscaledZ)/s.tileSize/8}),ke=t=>({u_matrix:t}),Ee=(t,i,r,n)=>e.e(ke(t),be(r,i,n)),Se=(t,e)=>({u_matrix:t,u_world:e}),Ie=(t,i,r,n,o)=>e.e(Ee(t,i,r,n),{u_world:o}),Ce=(t,e,i,r)=>{const n=t.transform;let o,a;if("map"===r.paint.get("circle-pitch-alignment")){const t=Ft(i,1,n.zoom);o=!0,a=[t,t]}else o=!1,a=n.pixelsToGLUnits;return{u_camera_to_center_distance:n.cameraToCenterDistance,u_scale_with_map:+("map"===r.paint.get("circle-pitch-scale")),u_matrix:t.translatePosMatrix(e.posMatrix,i,r.paint.get("circle-translate"),r.paint.get("circle-translate-anchor")),u_pitch_with_map:+o,u_device_pixel_ratio:t.pixelRatio,u_extrude_scale:a}},Te=(t,e,i)=>({u_matrix:t,u_inv_matrix:e,u_camera_to_center_distance:i.cameraToCenterDistance,u_viewport_size:[i.width,i.height]}),Ae=(t,e,i=1)=>({u_matrix:t,u_color:e,u_overlay:0,u_overlay_scale:i}),Pe=t=>({u_matrix:t}),Me=(t,e,i,r)=>({u_matrix:t,u_extrude_scale:Ft(e,1,i),u_intensity:r}),Le=(t,i,r,n)=>{const o=e.H();e.aP(o,0,t.width,t.height,0,0,1);const a=t.context.gl;return{u_matrix:o,u_world:[a.drawingBufferWidth,a.drawingBufferHeight],u_image:r,u_color_ramp:n,u_opacity:i.paint.get("heatmap-opacity")}};function ze(t,i){const r=Math.pow(2,i.canonical.z),n=i.canonical.y;return[new e.Z(0,n/r).toLngLat().lat,new e.Z(0,(n+1)/r).toLngLat().lat]}const De=(t,e,i,r)=>{const n=t.transform;return{u_matrix:Ne(t,e,i,r),u_ratio:1/Ft(e,1,n.zoom),u_device_pixel_ratio:t.pixelRatio,u_units_to_pixels:[1/n.pixelsToGLUnits[0],1/n.pixelsToGLUnits[1]]}},Re=(t,i,r,n,o)=>e.e(De(t,i,r,o),{u_image:0,u_image_height:n}),Oe=(t,e,i,r,n)=>{const o=t.transform,a=Be(e,o);return{u_matrix:Ne(t,e,i,n),u_texsize:e.imageAtlasTexture.size,u_ratio:1/Ft(e,1,o.zoom),u_device_pixel_ratio:t.pixelRatio,u_image:0,u_scale:[a,r.fromScale,r.toScale],u_fade:r.t,u_units_to_pixels:[1/o.pixelsToGLUnits[0],1/o.pixelsToGLUnits[1]]}},Fe=(t,i,r,n,o,a)=>{const s=t.lineAtlas,l=Be(i,t.transform),c="round"===r.layout.get("line-cap"),u=s.getDash(n.from,c),h=s.getDash(n.to,c),d=u.width*o.fromScale,p=h.width*o.toScale;return e.e(De(t,i,r,a),{u_patternscale_a:[l/d,-u.height/2],u_patternscale_b:[l/p,-h.height/2],u_sdfgamma:s.width/(256*Math.min(d,p)*t.pixelRatio)/2,u_image:0,u_tex_y_a:u.y,u_tex_y_b:h.y,u_mix:o.t})};function Be(t,e){return 1/Ft(t,1,e.tileZoom)}function Ne(t,e,i,r){return t.translatePosMatrix(r?r.posMatrix:e.tileID.posMatrix,e,i.paint.get("line-translate"),i.paint.get("line-translate-anchor"))}const je=(t,e,i,r,n)=>{return{u_matrix:t,u_tl_parent:e,u_scale_parent:i,u_buffer_scale:1,u_fade_t:r.mix,u_opacity:r.opacity*n.paint.get("raster-opacity"),u_image0:0,u_image1:1,u_brightness_low:n.paint.get("raster-brightness-min"),u_brightness_high:n.paint.get("raster-brightness-max"),u_saturation_factor:(a=n.paint.get("raster-saturation"),a>0?1-1/(1.001-a):-a),u_contrast_factor:(o=n.paint.get("raster-contrast"),o>0?1/(1-o):1+o),u_spin_weights:Ve(n.paint.get("raster-hue-rotate"))};var o,a};function Ve(t){t*=Math.PI/180;const e=Math.sin(t),i=Math.cos(t);return[(2*i+1)/3,(-Math.sqrt(3)*e-i+1)/3,(Math.sqrt(3)*e-i+1)/3]}const Ue=(t,e,i,r,n,o,a,s,l,c,u,h,d,p)=>{const f=a.transform;return{u_is_size_zoom_constant:+("constant"===t||"source"===t),u_is_size_feature_constant:+("constant"===t||"camera"===t),u_size_t:e?e.uSizeT:0,u_size:e?e.uSize:0,u_camera_to_center_distance:f.cameraToCenterDistance,u_pitch:f.pitch/360*2*Math.PI,u_rotate_symbol:+i,u_aspect_ratio:f.width/f.height,u_fade_change:a.options.fadeDuration?a.symbolFadeChange:1,u_matrix:s,u_label_plane_matrix:l,u_coord_matrix:c,u_is_text:+h,u_pitch_with_map:+r,u_is_along_line:n,u_is_variable_anchor:o,u_texsize:d,u_texture:0,u_translation:u,u_pitched_scale:p}},qe=(t,i,r,n,o,a,s,l,c,u,h,d,p,f,m)=>{const g=s.transform;return e.e(Ue(t,i,r,n,o,a,s,l,c,u,h,d,p,m),{u_gamma_scale:n?Math.cos(g._pitch)*g.cameraToCenterDistance:1,u_device_pixel_ratio:s.pixelRatio,u_is_halo:1})},$e=(t,i,r,n,o,a,s,l,c,u,h,d,p,f)=>e.e(qe(t,i,r,n,o,a,s,l,c,u,h,!0,d,!0,f),{u_texsize_icon:p,u_texture_icon:1}),Ge=(t,e,i)=>({u_matrix:t,u_opacity:e,u_color:i}),He=(t,i,r,n,o,a)=>e.e(function(t,e,i,r){const n=i.imageManager.getPattern(t.from.toString()),o=i.imageManager.getPattern(t.to.toString()),{width:a,height:s}=i.imageManager.getPixelSize(),l=Math.pow(2,r.tileID.overscaledZ),c=r.tileSize*Math.pow(2,i.transform.tileZoom)/l,u=c*(r.tileID.canonical.x+r.tileID.wrap*l),h=c*r.tileID.canonical.y;return{u_image:0,u_pattern_tl_a:n.tl,u_pattern_br_a:n.br,u_pattern_tl_b:o.tl,u_pattern_br_b:o.br,u_texsize:[a,s],u_mix:e.t,u_pattern_size_a:n.displaySize,u_pattern_size_b:o.displaySize,u_scale_a:e.fromScale,u_scale_b:e.toScale,u_tile_units_to_pixels:1/Ft(r,1,i.transform.tileZoom),u_pixel_coord_upper:[u>>16,h>>16],u_pixel_coord_lower:[65535&u,65535&h]}}(n,a,r,o),{u_matrix:t,u_opacity:i}),Ze={fillExtrusion:(t,i)=>({u_matrix:new e.aJ(t,i.u_matrix),u_lightpos:new e.aN(t,i.u_lightpos),u_lightintensity:new e.aI(t,i.u_lightintensity),u_lightcolor:new e.aN(t,i.u_lightcolor),u_vertical_gradient:new e.aI(t,i.u_vertical_gradient),u_opacity:new e.aI(t,i.u_opacity)}),fillExtrusionPattern:(t,i)=>({u_matrix:new e.aJ(t,i.u_matrix),u_lightpos:new e.aN(t,i.u_lightpos),u_lightintensity:new e.aI(t,i.u_lightintensity),u_lightcolor:new e.aN(t,i.u_lightcolor),u_vertical_gradient:new e.aI(t,i.u_vertical_gradient),u_height_factor:new e.aI(t,i.u_height_factor),u_image:new e.aH(t,i.u_image),u_texsize:new e.aO(t,i.u_texsize),u_pixel_coord_upper:new e.aO(t,i.u_pixel_coord_upper),u_pixel_coord_lower:new e.aO(t,i.u_pixel_coord_lower),u_scale:new e.aN(t,i.u_scale),u_fade:new e.aI(t,i.u_fade),u_opacity:new e.aI(t,i.u_opacity)}),fill:(t,i)=>({u_matrix:new e.aJ(t,i.u_matrix)}),fillPattern:(t,i)=>({u_matrix:new e.aJ(t,i.u_matrix),u_image:new e.aH(t,i.u_image),u_texsize:new e.aO(t,i.u_texsize),u_pixel_coord_upper:new e.aO(t,i.u_pixel_coord_upper),u_pixel_coord_lower:new e.aO(t,i.u_pixel_coord_lower),u_scale:new e.aN(t,i.u_scale),u_fade:new e.aI(t,i.u_fade)}),fillOutline:(t,i)=>({u_matrix:new e.aJ(t,i.u_matrix),u_world:new e.aO(t,i.u_world)}),fillOutlinePattern:(t,i)=>({u_matrix:new e.aJ(t,i.u_matrix),u_world:new e.aO(t,i.u_world),u_image:new e.aH(t,i.u_image),u_texsize:new e.aO(t,i.u_texsize),u_pixel_coord_upper:new e.aO(t,i.u_pixel_coord_upper),u_pixel_coord_lower:new e.aO(t,i.u_pixel_coord_lower),u_scale:new e.aN(t,i.u_scale),u_fade:new e.aI(t,i.u_fade)}),circle:(t,i)=>({u_camera_to_center_distance:new e.aI(t,i.u_camera_to_center_distance),u_scale_with_map:new e.aH(t,i.u_scale_with_map),u_pitch_with_map:new e.aH(t,i.u_pitch_with_map),u_extrude_scale:new e.aO(t,i.u_extrude_scale),u_device_pixel_ratio:new e.aI(t,i.u_device_pixel_ratio),u_matrix:new e.aJ(t,i.u_matrix)}),collisionBox:(t,i)=>({u_matrix:new e.aJ(t,i.u_matrix),u_pixel_extrude_scale:new e.aO(t,i.u_pixel_extrude_scale)}),collisionCircle:(t,i)=>({u_matrix:new e.aJ(t,i.u_matrix),u_inv_matrix:new e.aJ(t,i.u_inv_matrix),u_camera_to_center_distance:new e.aI(t,i.u_camera_to_center_distance),u_viewport_size:new e.aO(t,i.u_viewport_size)}),debug:(t,i)=>({u_color:new e.aL(t,i.u_color),u_matrix:new e.aJ(t,i.u_matrix),u_overlay:new e.aH(t,i.u_overlay),u_overlay_scale:new e.aI(t,i.u_overlay_scale)}),clippingMask:(t,i)=>({u_matrix:new e.aJ(t,i.u_matrix)}),heatmap:(t,i)=>({u_extrude_scale:new e.aI(t,i.u_extrude_scale),u_intensity:new e.aI(t,i.u_intensity),u_matrix:new e.aJ(t,i.u_matrix)}),heatmapTexture:(t,i)=>({u_matrix:new e.aJ(t,i.u_matrix),u_world:new e.aO(t,i.u_world),u_image:new e.aH(t,i.u_image),u_color_ramp:new e.aH(t,i.u_color_ramp),u_opacity:new e.aI(t,i.u_opacity)}),hillshade:(t,i)=>({u_matrix:new e.aJ(t,i.u_matrix),u_image:new e.aH(t,i.u_image),u_latrange:new e.aO(t,i.u_latrange),u_light:new e.aO(t,i.u_light),u_shadow:new e.aL(t,i.u_shadow),u_highlight:new e.aL(t,i.u_highlight),u_accent:new e.aL(t,i.u_accent)}),hillshadePrepare:(t,i)=>({u_matrix:new e.aJ(t,i.u_matrix),u_image:new e.aH(t,i.u_image),u_dimension:new e.aO(t,i.u_dimension),u_zoom:new e.aI(t,i.u_zoom),u_unpack:new e.aK(t,i.u_unpack)}),line:(t,i)=>({u_matrix:new e.aJ(t,i.u_matrix),u_ratio:new e.aI(t,i.u_ratio),u_device_pixel_ratio:new e.aI(t,i.u_device_pixel_ratio),u_units_to_pixels:new e.aO(t,i.u_units_to_pixels)}),lineGradient:(t,i)=>({u_matrix:new e.aJ(t,i.u_matrix),u_ratio:new e.aI(t,i.u_ratio),u_device_pixel_ratio:new e.aI(t,i.u_device_pixel_ratio),u_units_to_pixels:new e.aO(t,i.u_units_to_pixels),u_image:new e.aH(t,i.u_image),u_image_height:new e.aI(t,i.u_image_height)}),linePattern:(t,i)=>({u_matrix:new e.aJ(t,i.u_matrix),u_texsize:new e.aO(t,i.u_texsize),u_ratio:new e.aI(t,i.u_ratio),u_device_pixel_ratio:new e.aI(t,i.u_device_pixel_ratio),u_image:new e.aH(t,i.u_image),u_units_to_pixels:new e.aO(t,i.u_units_to_pixels),u_scale:new e.aN(t,i.u_scale),u_fade:new e.aI(t,i.u_fade)}),lineSDF:(t,i)=>({u_matrix:new e.aJ(t,i.u_matrix),u_ratio:new e.aI(t,i.u_ratio),u_device_pixel_ratio:new e.aI(t,i.u_device_pixel_ratio),u_units_to_pixels:new e.aO(t,i.u_units_to_pixels),u_patternscale_a:new e.aO(t,i.u_patternscale_a),u_patternscale_b:new e.aO(t,i.u_patternscale_b),u_sdfgamma:new e.aI(t,i.u_sdfgamma),u_image:new e.aH(t,i.u_image),u_tex_y_a:new e.aI(t,i.u_tex_y_a),u_tex_y_b:new e.aI(t,i.u_tex_y_b),u_mix:new e.aI(t,i.u_mix)}),raster:(t,i)=>({u_matrix:new e.aJ(t,i.u_matrix),u_tl_parent:new e.aO(t,i.u_tl_parent),u_scale_parent:new e.aI(t,i.u_scale_parent),u_buffer_scale:new e.aI(t,i.u_buffer_scale),u_fade_t:new e.aI(t,i.u_fade_t),u_opacity:new e.aI(t,i.u_opacity),u_image0:new e.aH(t,i.u_image0),u_image1:new e.aH(t,i.u_image1),u_brightness_low:new e.aI(t,i.u_brightness_low),u_brightness_high:new e.aI(t,i.u_brightness_high),u_saturation_factor:new e.aI(t,i.u_saturation_factor),u_contrast_factor:new e.aI(t,i.u_contrast_factor),u_spin_weights:new e.aN(t,i.u_spin_weights)}),symbolIcon:(t,i)=>({u_is_size_zoom_constant:new e.aH(t,i.u_is_size_zoom_constant),u_is_size_feature_constant:new e.aH(t,i.u_is_size_feature_constant),u_size_t:new e.aI(t,i.u_size_t),u_size:new e.aI(t,i.u_size),u_camera_to_center_distance:new e.aI(t,i.u_camera_to_center_distance),u_pitch:new e.aI(t,i.u_pitch),u_rotate_symbol:new e.aH(t,i.u_rotate_symbol),u_aspect_ratio:new e.aI(t,i.u_aspect_ratio),u_fade_change:new e.aI(t,i.u_fade_change),u_matrix:new e.aJ(t,i.u_matrix),u_label_plane_matrix:new e.aJ(t,i.u_label_plane_matrix),u_coord_matrix:new e.aJ(t,i.u_coord_matrix),u_is_text:new e.aH(t,i.u_is_text),u_pitch_with_map:new e.aH(t,i.u_pitch_with_map),u_is_along_line:new e.aH(t,i.u_is_along_line),u_is_variable_anchor:new e.aH(t,i.u_is_variable_anchor),u_texsize:new e.aO(t,i.u_texsize),u_texture:new e.aH(t,i.u_texture),u_translation:new e.aO(t,i.u_translation),u_pitched_scale:new e.aI(t,i.u_pitched_scale)}),symbolSDF:(t,i)=>({u_is_size_zoom_constant:new e.aH(t,i.u_is_size_zoom_constant),u_is_size_feature_constant:new e.aH(t,i.u_is_size_feature_constant),u_size_t:new e.aI(t,i.u_size_t),u_size:new e.aI(t,i.u_size),u_camera_to_center_distance:new e.aI(t,i.u_camera_to_center_distance),u_pitch:new e.aI(t,i.u_pitch),u_rotate_symbol:new e.aH(t,i.u_rotate_symbol),u_aspect_ratio:new e.aI(t,i.u_aspect_ratio),u_fade_change:new e.aI(t,i.u_fade_change),u_matrix:new e.aJ(t,i.u_matrix),u_label_plane_matrix:new e.aJ(t,i.u_label_plane_matrix),u_coord_matrix:new e.aJ(t,i.u_coord_matrix),u_is_text:new e.aH(t,i.u_is_text),u_pitch_with_map:new e.aH(t,i.u_pitch_with_map),u_is_along_line:new e.aH(t,i.u_is_along_line),u_is_variable_anchor:new e.aH(t,i.u_is_variable_anchor),u_texsize:new e.aO(t,i.u_texsize),u_texture:new e.aH(t,i.u_texture),u_gamma_scale:new e.aI(t,i.u_gamma_scale),u_device_pixel_ratio:new e.aI(t,i.u_device_pixel_ratio),u_is_halo:new e.aH(t,i.u_is_halo),u_translation:new e.aO(t,i.u_translation),u_pitched_scale:new e.aI(t,i.u_pitched_scale)}),symbolTextAndIcon:(t,i)=>({u_is_size_zoom_constant:new e.aH(t,i.u_is_size_zoom_constant),u_is_size_feature_constant:new e.aH(t,i.u_is_size_feature_constant),u_size_t:new e.aI(t,i.u_size_t),u_size:new e.aI(t,i.u_size),u_camera_to_center_distance:new e.aI(t,i.u_camera_to_center_distance),u_pitch:new e.aI(t,i.u_pitch),u_rotate_symbol:new e.aH(t,i.u_rotate_symbol),u_aspect_ratio:new e.aI(t,i.u_aspect_ratio),u_fade_change:new e.aI(t,i.u_fade_change),u_matrix:new e.aJ(t,i.u_matrix),u_label_plane_matrix:new e.aJ(t,i.u_label_plane_matrix),u_coord_matrix:new e.aJ(t,i.u_coord_matrix),u_is_text:new e.aH(t,i.u_is_text),u_pitch_with_map:new e.aH(t,i.u_pitch_with_map),u_is_along_line:new e.aH(t,i.u_is_along_line),u_is_variable_anchor:new e.aH(t,i.u_is_variable_anchor),u_texsize:new e.aO(t,i.u_texsize),u_texsize_icon:new e.aO(t,i.u_texsize_icon),u_texture:new e.aH(t,i.u_texture),u_texture_icon:new e.aH(t,i.u_texture_icon),u_gamma_scale:new e.aI(t,i.u_gamma_scale),u_device_pixel_ratio:new e.aI(t,i.u_device_pixel_ratio),u_is_halo:new e.aH(t,i.u_is_halo),u_translation:new e.aO(t,i.u_translation),u_pitched_scale:new e.aI(t,i.u_pitched_scale)}),background:(t,i)=>({u_matrix:new e.aJ(t,i.u_matrix),u_opacity:new e.aI(t,i.u_opacity),u_color:new e.aL(t,i.u_color)}),backgroundPattern:(t,i)=>({u_matrix:new e.aJ(t,i.u_matrix),u_opacity:new e.aI(t,i.u_opacity),u_image:new e.aH(t,i.u_image),u_pattern_tl_a:new e.aO(t,i.u_pattern_tl_a),u_pattern_br_a:new e.aO(t,i.u_pattern_br_a),u_pattern_tl_b:new e.aO(t,i.u_pattern_tl_b),u_pattern_br_b:new e.aO(t,i.u_pattern_br_b),u_texsize:new e.aO(t,i.u_texsize),u_mix:new e.aI(t,i.u_mix),u_pattern_size_a:new e.aO(t,i.u_pattern_size_a),u_pattern_size_b:new e.aO(t,i.u_pattern_size_b),u_scale_a:new e.aI(t,i.u_scale_a),u_scale_b:new e.aI(t,i.u_scale_b),u_pixel_coord_upper:new e.aO(t,i.u_pixel_coord_upper),u_pixel_coord_lower:new e.aO(t,i.u_pixel_coord_lower),u_tile_units_to_pixels:new e.aI(t,i.u_tile_units_to_pixels)}),terrain:(t,i)=>({u_matrix:new e.aJ(t,i.u_matrix),u_texture:new e.aH(t,i.u_texture),u_ele_delta:new e.aI(t,i.u_ele_delta),u_fog_matrix:new e.aJ(t,i.u_fog_matrix),u_fog_color:new e.aL(t,i.u_fog_color),u_fog_ground_blend:new e.aI(t,i.u_fog_ground_blend),u_fog_ground_blend_opacity:new e.aI(t,i.u_fog_ground_blend_opacity),u_horizon_color:new e.aL(t,i.u_horizon_color),u_horizon_fog_blend:new e.aI(t,i.u_horizon_fog_blend)}),terrainDepth:(t,i)=>({u_matrix:new e.aJ(t,i.u_matrix),u_ele_delta:new e.aI(t,i.u_ele_delta)}),terrainCoords:(t,i)=>({u_matrix:new e.aJ(t,i.u_matrix),u_texture:new e.aH(t,i.u_texture),u_terrain_coords_id:new e.aI(t,i.u_terrain_coords_id),u_ele_delta:new e.aI(t,i.u_ele_delta)}),sky:(t,i)=>({u_sky_color:new e.aL(t,i.u_sky_color),u_horizon_color:new e.aL(t,i.u_horizon_color),u_horizon:new e.aI(t,i.u_horizon),u_sky_horizon_blend:new e.aI(t,i.u_sky_horizon_blend)})};class We{constructor(t,e,i){this.context=t;const r=t.gl;this.buffer=r.createBuffer(),this.dynamicDraw=Boolean(i),this.context.unbindVAO(),t.bindElementBuffer.set(this.buffer),r.bufferData(r.ELEMENT_ARRAY_BUFFER,e.arrayBuffer,this.dynamicDraw?r.DYNAMIC_DRAW:r.STATIC_DRAW),this.dynamicDraw||delete e.arrayBuffer}bind(){this.context.bindElementBuffer.set(this.buffer)}updateData(t){const e=this.context.gl;if(!this.dynamicDraw)throw new Error("Attempted to update data while not in dynamic mode.");this.context.unbindVAO(),this.bind(),e.bufferSubData(e.ELEMENT_ARRAY_BUFFER,0,t.arrayBuffer)}destroy(){this.buffer&&(this.context.gl.deleteBuffer(this.buffer),delete this.buffer)}}const Xe={Int8:"BYTE",Uint8:"UNSIGNED_BYTE",Int16:"SHORT",Uint16:"UNSIGNED_SHORT",Int32:"INT",Uint32:"UNSIGNED_INT",Float32:"FLOAT"};class Je{constructor(t,e,i,r){this.length=e.length,this.attributes=i,this.itemSize=e.bytesPerElement,this.dynamicDraw=r,this.context=t;const n=t.gl;this.buffer=n.createBuffer(),t.bindVertexBuffer.set(this.buffer),n.bufferData(n.ARRAY_BUFFER,e.arrayBuffer,this.dynamicDraw?n.DYNAMIC_DRAW:n.STATIC_DRAW),this.dynamicDraw||delete e.arrayBuffer}bind(){this.context.bindVertexBuffer.set(this.buffer)}updateData(t){if(t.length!==this.length)throw new Error(`Length of new data is ${t.length}, which doesn't match current length of ${this.length}`);const e=this.context.gl;this.bind(),e.bufferSubData(e.ARRAY_BUFFER,0,t.arrayBuffer)}enableAttributes(t,e){for(let i=0;i<this.attributes.length;i++){const r=e.attributes[this.attributes[i].name];void 0!==r&&t.enableVertexAttribArray(r)}}setVertexAttribPointers(t,e,i){for(let r=0;r<this.attributes.length;r++){const n=this.attributes[r],o=e.attributes[n.name];void 0!==o&&t.vertexAttribPointer(o,n.components,t[Xe[n.type]],!1,this.itemSize,n.offset+this.itemSize*(i||0))}}destroy(){this.buffer&&(this.context.gl.deleteBuffer(this.buffer),delete this.buffer)}}const Ke=new WeakMap;function Ye(t){var e;if(Ke.has(t))return Ke.get(t);{const i=null===(e=t.getParameter(t.VERSION))||void 0===e?void 0:e.startsWith("WebGL 2.0");return Ke.set(t,i),i}}class Qe{constructor(t){this.gl=t.gl,this.default=this.getDefault(),this.current=this.default,this.dirty=!1}get(){return this.current}set(t){}getDefault(){return this.default}setDefault(){this.set(this.default)}}class ti extends Qe{getDefault(){return e.aM.transparent}set(t){const e=this.current;(t.r!==e.r||t.g!==e.g||t.b!==e.b||t.a!==e.a||this.dirty)&&(this.gl.clearColor(t.r,t.g,t.b,t.a),this.current=t,this.dirty=!1)}}class ei extends Qe{getDefault(){return 1}set(t){(t!==this.current||this.dirty)&&(this.gl.clearDepth(t),this.current=t,this.dirty=!1)}}class ii extends Qe{getDefault(){return 0}set(t){(t!==this.current||this.dirty)&&(this.gl.clearStencil(t),this.current=t,this.dirty=!1)}}class ri extends Qe{getDefault(){return[!0,!0,!0,!0]}set(t){const e=this.current;(t[0]!==e[0]||t[1]!==e[1]||t[2]!==e[2]||t[3]!==e[3]||this.dirty)&&(this.gl.colorMask(t[0],t[1],t[2],t[3]),this.current=t,this.dirty=!1)}}class ni extends Qe{getDefault(){return!0}set(t){(t!==this.current||this.dirty)&&(this.gl.depthMask(t),this.current=t,this.dirty=!1)}}class oi extends Qe{getDefault(){return 255}set(t){(t!==this.current||this.dirty)&&(this.gl.stencilMask(t),this.current=t,this.dirty=!1)}}class ai extends Qe{getDefault(){return{func:this.gl.ALWAYS,ref:0,mask:255}}set(t){const e=this.current;(t.func!==e.func||t.ref!==e.ref||t.mask!==e.mask||this.dirty)&&(this.gl.stencilFunc(t.func,t.ref,t.mask),this.current=t,this.dirty=!1)}}class si extends Qe{getDefault(){const t=this.gl;return[t.KEEP,t.KEEP,t.KEEP]}set(t){const e=this.current;(t[0]!==e[0]||t[1]!==e[1]||t[2]!==e[2]||this.dirty)&&(this.gl.stencilOp(t[0],t[1],t[2]),this.current=t,this.dirty=!1)}}class li extends Qe{getDefault(){return!1}set(t){if(t===this.current&&!this.dirty)return;const e=this.gl;t?e.enable(e.STENCIL_TEST):e.disable(e.STENCIL_TEST),this.current=t,this.dirty=!1}}class ci extends Qe{getDefault(){return[0,1]}set(t){const e=this.current;(t[0]!==e[0]||t[1]!==e[1]||this.dirty)&&(this.gl.depthRange(t[0],t[1]),this.current=t,this.dirty=!1)}}class ui extends Qe{getDefault(){return!1}set(t){if(t===this.current&&!this.dirty)return;const e=this.gl;t?e.enable(e.DEPTH_TEST):e.disable(e.DEPTH_TEST),this.current=t,this.dirty=!1}}class hi extends Qe{getDefault(){return this.gl.LESS}set(t){(t!==this.current||this.dirty)&&(this.gl.depthFunc(t),this.current=t,this.dirty=!1)}}class di extends Qe{getDefault(){return!1}set(t){if(t===this.current&&!this.dirty)return;const e=this.gl;t?e.enable(e.BLEND):e.disable(e.BLEND),this.current=t,this.dirty=!1}}class pi extends Qe{getDefault(){const t=this.gl;return[t.ONE,t.ZERO]}set(t){const e=this.current;(t[0]!==e[0]||t[1]!==e[1]||this.dirty)&&(this.gl.blendFunc(t[0],t[1]),this.current=t,this.dirty=!1)}}class fi extends Qe{getDefault(){return e.aM.transparent}set(t){const e=this.current;(t.r!==e.r||t.g!==e.g||t.b!==e.b||t.a!==e.a||this.dirty)&&(this.gl.blendColor(t.r,t.g,t.b,t.a),this.current=t,this.dirty=!1)}}class mi extends Qe{getDefault(){return this.gl.FUNC_ADD}set(t){(t!==this.current||this.dirty)&&(this.gl.blendEquation(t),this.current=t,this.dirty=!1)}}class gi extends Qe{getDefault(){return!1}set(t){if(t===this.current&&!this.dirty)return;const e=this.gl;t?e.enable(e.CULL_FACE):e.disable(e.CULL_FACE),this.current=t,this.dirty=!1}}class yi extends Qe{getDefault(){return this.gl.BACK}set(t){(t!==this.current||this.dirty)&&(this.gl.cullFace(t),this.current=t,this.dirty=!1)}}class _i extends Qe{getDefault(){return this.gl.CCW}set(t){(t!==this.current||this.dirty)&&(this.gl.frontFace(t),this.current=t,this.dirty=!1)}}class vi extends Qe{getDefault(){return null}set(t){(t!==this.current||this.dirty)&&(this.gl.useProgram(t),this.current=t,this.dirty=!1)}}class bi extends Qe{getDefault(){return this.gl.TEXTURE0}set(t){(t!==this.current||this.dirty)&&(this.gl.activeTexture(t),this.current=t,this.dirty=!1)}}class xi extends Qe{getDefault(){const t=this.gl;return[0,0,t.drawingBufferWidth,t.drawingBufferHeight]}set(t){const e=this.current;(t[0]!==e[0]||t[1]!==e[1]||t[2]!==e[2]||t[3]!==e[3]||this.dirty)&&(this.gl.viewport(t[0],t[1],t[2],t[3]),this.current=t,this.dirty=!1)}}class wi extends Qe{getDefault(){return null}set(t){if(t===this.current&&!this.dirty)return;const e=this.gl;e.bindFramebuffer(e.FRAMEBUFFER,t),this.current=t,this.dirty=!1}}class ki extends Qe{getDefault(){return null}set(t){if(t===this.current&&!this.dirty)return;const e=this.gl;e.bindRenderbuffer(e.RENDERBUFFER,t),this.current=t,this.dirty=!1}}class Ei extends Qe{getDefault(){return null}set(t){if(t===this.current&&!this.dirty)return;const e=this.gl;e.bindTexture(e.TEXTURE_2D,t),this.current=t,this.dirty=!1}}class Si extends Qe{getDefault(){return null}set(t){if(t===this.current&&!this.dirty)return;const e=this.gl;e.bindBuffer(e.ARRAY_BUFFER,t),this.current=t,this.dirty=!1}}class Ii extends Qe{getDefault(){return null}set(t){const e=this.gl;e.bindBuffer(e.ELEMENT_ARRAY_BUFFER,t),this.current=t,this.dirty=!1}}class Ci extends Qe{getDefault(){return null}set(t){var e;if(t===this.current&&!this.dirty)return;const i=this.gl;Ye(i)?i.bindVertexArray(t):null===(e=i.getExtension("OES_vertex_array_object"))||void 0===e||e.bindVertexArrayOES(t),this.current=t,this.dirty=!1}}class Ti extends Qe{getDefault(){return 4}set(t){if(t===this.current&&!this.dirty)return;const e=this.gl;e.pixelStorei(e.UNPACK_ALIGNMENT,t),this.current=t,this.dirty=!1}}class Ai extends Qe{getDefault(){return!1}set(t){if(t===this.current&&!this.dirty)return;const e=this.gl;e.pixelStorei(e.UNPACK_PREMULTIPLY_ALPHA_WEBGL,t),this.current=t,this.dirty=!1}}class Pi extends Qe{getDefault(){return!1}set(t){if(t===this.current&&!this.dirty)return;const e=this.gl;e.pixelStorei(e.UNPACK_FLIP_Y_WEBGL,t),this.current=t,this.dirty=!1}}class Mi extends Qe{constructor(t,e){super(t),this.context=t,this.parent=e}getDefault(){return null}}class Li extends Mi{setDirty(){this.dirty=!0}set(t){if(t===this.current&&!this.dirty)return;this.context.bindFramebuffer.set(this.parent);const e=this.gl;e.framebufferTexture2D(e.FRAMEBUFFER,e.COLOR_ATTACHMENT0,e.TEXTURE_2D,t,0),this.current=t,this.dirty=!1}}class zi extends Mi{set(t){if(t===this.current&&!this.dirty)return;this.context.bindFramebuffer.set(this.parent);const e=this.gl;e.framebufferRenderbuffer(e.FRAMEBUFFER,e.DEPTH_ATTACHMENT,e.RENDERBUFFER,t),this.current=t,this.dirty=!1}}class Di extends Mi{set(t){if(t===this.current&&!this.dirty)return;this.context.bindFramebuffer.set(this.parent);const e=this.gl;e.framebufferRenderbuffer(e.FRAMEBUFFER,e.DEPTH_STENCIL_ATTACHMENT,e.RENDERBUFFER,t),this.current=t,this.dirty=!1}}class Ri{constructor(t,e,i,r,n){this.context=t,this.width=e,this.height=i;const o=t.gl,a=this.framebuffer=o.createFramebuffer();if(this.colorAttachment=new Li(t,a),r)this.depthAttachment=n?new Di(t,a):new zi(t,a);else if(n)throw new Error("Stencil cannot be set without depth");if(o.checkFramebufferStatus(o.FRAMEBUFFER)!==o.FRAMEBUFFER_COMPLETE)throw new Error("Framebuffer is not complete")}destroy(){const t=this.context.gl,e=this.colorAttachment.get();if(e&&t.deleteTexture(e),this.depthAttachment){const e=this.depthAttachment.get();e&&t.deleteRenderbuffer(e)}t.deleteFramebuffer(this.framebuffer)}}class Oi{constructor(t,e,i){this.blendFunction=t,this.blendColor=e,this.mask=i}}Oi.Replace=[1,0],Oi.disabled=new Oi(Oi.Replace,e.aM.transparent,[!1,!1,!1,!1]),Oi.unblended=new Oi(Oi.Replace,e.aM.transparent,[!0,!0,!0,!0]),Oi.alphaBlended=new Oi([1,771],e.aM.transparent,[!0,!0,!0,!0]);class Fi{constructor(t){var e,i;if(this.gl=t,this.clearColor=new ti(this),this.clearDepth=new ei(this),this.clearStencil=new ii(this),this.colorMask=new ri(this),this.depthMask=new ni(this),this.stencilMask=new oi(this),this.stencilFunc=new ai(this),this.stencilOp=new si(this),this.stencilTest=new li(this),this.depthRange=new ci(this),this.depthTest=new ui(this),this.depthFunc=new hi(this),this.blend=new di(this),this.blendFunc=new pi(this),this.blendColor=new fi(this),this.blendEquation=new mi(this),this.cullFace=new gi(this),this.cullFaceSide=new yi(this),this.frontFace=new _i(this),this.program=new vi(this),this.activeTexture=new bi(this),this.viewport=new xi(this),this.bindFramebuffer=new wi(this),this.bindRenderbuffer=new ki(this),this.bindTexture=new Ei(this),this.bindVertexBuffer=new Si(this),this.bindElementBuffer=new Ii(this),this.bindVertexArray=new Ci(this),this.pixelStoreUnpack=new Ti(this),this.pixelStoreUnpackPremultiplyAlpha=new Ai(this),this.pixelStoreUnpackFlipY=new Pi(this),this.extTextureFilterAnisotropic=t.getExtension("EXT_texture_filter_anisotropic")||t.getExtension("MOZ_EXT_texture_filter_anisotropic")||t.getExtension("WEBKIT_EXT_texture_filter_anisotropic"),this.extTextureFilterAnisotropic&&(this.extTextureFilterAnisotropicMax=t.getParameter(this.extTextureFilterAnisotropic.MAX_TEXTURE_MAX_ANISOTROPY_EXT)),this.maxTextureSize=t.getParameter(t.MAX_TEXTURE_SIZE),Ye(t)){this.HALF_FLOAT=t.HALF_FLOAT;const r=t.getExtension("EXT_color_buffer_half_float");this.RGBA16F=null!==(e=t.RGBA16F)&&void 0!==e?e:null==r?void 0:r.RGBA16F_EXT,this.RGB16F=null!==(i=t.RGB16F)&&void 0!==i?i:null==r?void 0:r.RGB16F_EXT,t.getExtension("EXT_color_buffer_float")}else{t.getExtension("EXT_color_buffer_half_float"),t.getExtension("OES_texture_half_float_linear");const e=t.getExtension("OES_texture_half_float");this.HALF_FLOAT=null==e?void 0:e.HALF_FLOAT_OES}}setDefault(){this.unbindVAO(),this.clearColor.setDefault(),this.clearDepth.setDefault(),this.clearStencil.setDefault(),this.colorMask.setDefault(),this.depthMask.setDefault(),this.stencilMask.setDefault(),this.stencilFunc.setDefault(),this.stencilOp.setDefault(),this.stencilTest.setDefault(),this.depthRange.setDefault(),this.depthTest.setDefault(),this.depthFunc.setDefault(),this.blend.setDefault(),this.blendFunc.setDefault(),this.blendColor.setDefault(),this.blendEquation.setDefault(),this.cullFace.setDefault(),this.cullFaceSide.setDefault(),this.frontFace.setDefault(),this.program.setDefault(),this.activeTexture.setDefault(),this.bindFramebuffer.setDefault(),this.pixelStoreUnpack.setDefault(),this.pixelStoreUnpackPremultiplyAlpha.setDefault(),this.pixelStoreUnpackFlipY.setDefault()}setDirty(){this.clearColor.dirty=!0,this.clearDepth.dirty=!0,this.clearStencil.dirty=!0,this.colorMask.dirty=!0,this.depthMask.dirty=!0,this.stencilMask.dirty=!0,this.stencilFunc.dirty=!0,this.stencilOp.dirty=!0,this.stencilTest.dirty=!0,this.depthRange.dirty=!0,this.depthTest.dirty=!0,this.depthFunc.dirty=!0,this.blend.dirty=!0,this.blendFunc.dirty=!0,this.blendColor.dirty=!0,this.blendEquation.dirty=!0,this.cullFace.dirty=!0,this.cullFaceSide.dirty=!0,this.frontFace.dirty=!0,this.program.dirty=!0,this.activeTexture.dirty=!0,this.viewport.dirty=!0,this.bindFramebuffer.dirty=!0,this.bindRenderbuffer.dirty=!0,this.bindTexture.dirty=!0,this.bindVertexBuffer.dirty=!0,this.bindElementBuffer.dirty=!0,this.bindVertexArray.dirty=!0,this.pixelStoreUnpack.dirty=!0,this.pixelStoreUnpackPremultiplyAlpha.dirty=!0,this.pixelStoreUnpackFlipY.dirty=!0}createIndexBuffer(t,e){return new We(this,t,e)}createVertexBuffer(t,e,i){return new Je(this,t,e,i)}createRenderbuffer(t,e,i){const r=this.gl,n=r.createRenderbuffer();return this.bindRenderbuffer.set(n),r.renderbufferStorage(r.RENDERBUFFER,t,e,i),this.bindRenderbuffer.set(null),n}createFramebuffer(t,e,i,r){return new Ri(this,t,e,i,r)}clear({color:t,depth:e,stencil:i}){const r=this.gl;let n=0;t&&(n|=r.COLOR_BUFFER_BIT,this.clearColor.set(t),this.colorMask.set([!0,!0,!0,!0])),void 0!==e&&(n|=r.DEPTH_BUFFER_BIT,this.depthRange.set([0,1]),this.clearDepth.set(e),this.depthMask.set(!0)),void 0!==i&&(n|=r.STENCIL_BUFFER_BIT,this.clearStencil.set(i),this.stencilMask.set(255)),r.clear(n)}setCullFace(t){!1===t.enable?this.cullFace.set(!1):(this.cullFace.set(!0),this.cullFaceSide.set(t.mode),this.frontFace.set(t.frontFace))}setDepthMode(t){t.func!==this.gl.ALWAYS||t.mask?(this.depthTest.set(!0),this.depthFunc.set(t.func),this.depthMask.set(t.mask),this.depthRange.set(t.range)):this.depthTest.set(!1)}setStencilMode(t){t.test.func!==this.gl.ALWAYS||t.mask?(this.stencilTest.set(!0),this.stencilMask.set(t.mask),this.stencilOp.set([t.fail,t.depthFail,t.pass]),this.stencilFunc.set({func:t.test.func,ref:t.ref,mask:t.test.mask})):this.stencilTest.set(!1)}setColorMode(t){e.aE(t.blendFunction,Oi.Replace)?this.blend.set(!1):(this.blend.set(!0),this.blendFunc.set(t.blendFunction),this.blendColor.set(t.blendColor)),this.colorMask.set(t.mask)}createVertexArray(){var t;return Ye(this.gl)?this.gl.createVertexArray():null===(t=this.gl.getExtension("OES_vertex_array_object"))||void 0===t?void 0:t.createVertexArrayOES()}deleteVertexArray(t){var e;return Ye(this.gl)?this.gl.deleteVertexArray(t):null===(e=this.gl.getExtension("OES_vertex_array_object"))||void 0===e?void 0:e.deleteVertexArrayOES(t)}unbindVAO(){this.bindVertexArray.set(null)}}class Bi{constructor(t,e,i){this.func=t,this.mask=e,this.range=i}}Bi.ReadOnly=!1,Bi.ReadWrite=!0,Bi.disabled=new Bi(519,Bi.ReadOnly,[0,1]);const Ni=7680;class ji{constructor(t,e,i,r,n,o){this.test=t,this.ref=e,this.mask=i,this.fail=r,this.depthFail=n,this.pass=o}}ji.disabled=new ji({func:519,mask:0},0,0,Ni,Ni,Ni);class Vi{constructor(t,e,i){this.enable=t,this.mode=e,this.frontFace=i}}let Ui;function qi(t,i,r,n,o){const a=t.context,s=a.gl,l=t.useProgram("collisionBox"),c=[];let u=0,h=0;for(let _=0;_<n.length;_++){const p=n[_],f=i.getTile(p).getBucket(r);if(!f)continue;const m=o?f.textCollisionBox:f.iconCollisionBox,g=f.collisionCircleArray;if(g.length>0){const i=e.H();e.aQ(i,f.placementInvProjMatrix,t.transform.glCoordMatrix),e.aQ(i,i,f.placementViewportMatrix),c.push({circleArray:g,circleOffset:h,transform:p.posMatrix,invTransform:i,coord:p}),u+=g.length/4,h=u}m&&l.draw(a,s.LINES,Bi.disabled,ji.disabled,t.colorModeForRenderPass(),Vi.disabled,{u_matrix:p.posMatrix,u_pixel_extrude_scale:[1/(d=t.transform).width,1/d.height]},t.style.map.terrain&&t.style.map.terrain.getTerrainData(p),r.id,m.layoutVertexBuffer,m.indexBuffer,m.segments,null,t.transform.zoom,null,null,m.collisionVertexBuffer)}var d;if(!o||!c.length)return;const p=t.useProgram("collisionCircle"),f=new e.aR;f.resize(4*u),f._trim();let m=0;for(const e of c)for(let t=0;t<e.circleArray.length/4;t++){const i=4*t,r=e.circleArray[i+0],n=e.circleArray[i+1],o=e.circleArray[i+2],a=e.circleArray[i+3];f.emplace(m++,r,n,o,a,0),f.emplace(m++,r,n,o,a,1),f.emplace(m++,r,n,o,a,2),f.emplace(m++,r,n,o,a,3)}(!Ui||Ui.length<2*u)&&(Ui=function(t){const i=2*t,r=new e.aT;r.resize(i),r._trim();for(let e=0;e<i;e++){const t=6*e;r.uint16[t+0]=4*e+0,r.uint16[t+1]=4*e+1,r.uint16[t+2]=4*e+2,r.uint16[t+3]=4*e+2,r.uint16[t+4]=4*e+3,r.uint16[t+5]=4*e+0}return r}(u));const g=a.createIndexBuffer(Ui,!0),y=a.createVertexBuffer(f,e.aS.members,!0);for(const _ of c){const i=Te(_.transform,_.invTransform,t.transform);p.draw(a,s.TRIANGLES,Bi.disabled,ji.disabled,t.colorModeForRenderPass(),Vi.disabled,i,t.style.map.terrain&&t.style.map.terrain.getTerrainData(_.coord),r.id,y,g,e.a0.simpleSegment(0,2*_.circleOffset,_.circleArray.length,_.circleArray.length/2),null,t.transform.zoom,null,null,null)}y.destroy(),g.destroy()}Vi.disabled=new Vi(!1,1029,2305),Vi.backCCW=new Vi(!0,1029,2305);const $i=e.an(new Float32Array(16));function Gi(t,i,r,n,o,a){const{horizontalAlign:s,verticalAlign:l}=e.au(t);return new e.P((-(s-.5)*i/o+n[0])*a,(-(l-.5)*r/o+n[1])*a)}function Hi(t,i,r,n,o,a){const s=i.tileAnchorPoint.add(new e.P(i.translation[0],i.translation[1]));if(i.pitchWithMap){let t=n.mult(a);r||(t=t.rotate(-o));const e=s.add(t);return vt(e.x,e.y,i.labelPlaneMatrix,i.getElevation).point}if(r){const e=Tt(i.tileAnchorPoint.x+1,i.tileAnchorPoint.y,i).point.sub(t),r=Math.atan(e.y/e.x)+(e.x<0?Math.PI:0);return t.add(n.rotate(r))}return t.add(n)}function Zi(t,i,r,n,o,a,s,l,c,u,h,d,p,f){const m=t.text.placedSymbolArray,g=t.text.dynamicLayoutVertexArray,y=t.icon.dynamicLayoutVertexArray,_={};g.clear();for(let v=0;v<m.length;v++){const y=m.get(v),b=y.hidden||!y.crossTileID||t.allowVerticalPlacement&&!y.placedOrientation?null:n[y.crossTileID];if(b){const n=new e.P(y.anchorX,y.anchorY),m={getElevation:f,width:o.width,height:o.height,labelPlaneMatrix:a,pitchWithMap:r,projection:h,tileAnchorPoint:n,translation:d,unwrappedTileID:p},v=r?vt(n.x,n.y,s,f):Tt(n.x,n.y,m),x=bt(o.cameraToCenterDistance,v.signedDistanceFromCamera);let w=e.ai(t.textSizeData,c,y)*x/e.ap;r&&(w*=t.tilePixelRatio/l);const{width:k,height:E,anchor:S,textOffset:I,textBoxScale:C}=b,T=Gi(S,k,E,I,C,w),A=h.getPitchedTextCorrection(o,n.add(new e.P(d[0],d[1])),p),P=Hi(v.point,m,i,T,o.angle,A),M=t.allowVerticalPlacement&&y.placedOrientation===e.ah.vertical?Math.PI/2:0;for(let t=0;t<y.numGlyphs;t++)e.aj(g,P,M);u&&y.associatedIconIndex>=0&&(_[y.associatedIconIndex]={shiftedAnchor:P,angle:M})}else zt(y.numGlyphs,g)}if(u){y.clear();const i=t.icon.placedSymbolArray;for(let t=0;t<i.length;t++){const r=i.get(t);if(r.hidden)zt(r.numGlyphs,y);else{const i=_[t];if(i)for(let t=0;t<r.numGlyphs;t++)e.aj(y,i.shiftedAnchor,i.angle);else zt(r.numGlyphs,y)}}t.icon.dynamicLayoutVertexBuffer.updateData(y)}t.text.dynamicLayoutVertexBuffer.updateData(g)}function Wi(t,e,i){return i.iconsInText&&e?"symbolTextAndIcon":t?"symbolSDF":"symbolIcon"}function Xi(t,i,r,n,o,a,s,l,c,u,h,d){const p=t.context,f=p.gl,m=t.transform,g=ie(),y="map"===l,_="map"===c,v="viewport"!==l&&"point"!==r.layout.get("symbol-placement"),b=y&&!_&&!v,x=!_&&v,w=!r.layout.get("symbol-sort-key").isConstant();let k=!1;const E=t.depthModeForSublayer(0,Bi.ReadOnly),S=r._unevaluatedLayout.hasValue("text-variable-anchor")||r._unevaluatedLayout.hasValue("text-variable-anchor-offset"),I=[],C=g.getCircleRadiusCorrection(m);for(const T of n){const n=i.getTile(T),l=n.getBucket(r);if(!l)continue;const c=o?l.text:l.icon;if(!c||!c.segments.get().length||!c.hasVisibleVertices)continue;const h=c.programConfigurations.get(r.id),d=o||l.sdfIcons,p=o?l.textSizeData:l.iconSizeData,E=_||0!==m.pitch,A=t.useProgram(Wi(d,o,l),h),P=e.ag(p,m.zoom),M=t.style.map.terrain&&t.style.map.terrain.getTerrainData(T);let L,z,D,R,O=[0,0],F=null;if(o)z=n.glyphAtlasTexture,D=f.LINEAR,L=n.glyphAtlasTexture.size,l.iconsInText&&(O=n.imageAtlasTexture.size,F=n.imageAtlasTexture,R=E||t.options.rotating||t.options.zooming||"composite"===p.kind||"camera"===p.kind?f.LINEAR:f.NEAREST);else{const e=1!==r.layout.get("icon-size").constantOr(0)||l.iconsNeedLinear;z=n.imageAtlasTexture,D=d||t.options.rotating||t.options.zooming||e||E?f.LINEAR:f.NEAREST,L=n.imageAtlasTexture.size}const B=Ft(n,1,t.transform.zoom),N=x?T.posMatrix:$i,j=yt(N,_,y,t.transform,B),V=_t(N,_,y,t.transform,B),U=_t(T.posMatrix,_,y,t.transform,B),q=g.translatePosition(t.transform,n,a,s),$=S&&l.hasTextData(),G="none"!==r.layout.get("icon-text-fit")&&$&&l.hasIconData();if(v){const e=t.style.map.terrain?(e,i)=>t.style.map.terrain.getElevation(T,e,i):null,i="map"===r.layout.get("text-rotation-alignment");wt(l,T.posMatrix,t,o,j,U,_,u,i,g,T.toUnwrapped(),m.width,m.height,q,e)}const H=T.posMatrix,Z=o&&S||G,W=v||Z?$i:j,X=V,J=d&&0!==r.paint.get(o?"text-halo-width":"icon-halo-width").constantOr(1);let K;K=d?l.iconsInText?$e(p.kind,P,b,_,v,Z,t,H,W,X,q,L,O,C):qe(p.kind,P,b,_,v,Z,t,H,W,X,q,o,L,!0,C):Ue(p.kind,P,b,_,v,Z,t,H,W,X,q,o,L,C);const Y={program:A,buffers:c,uniformValues:K,atlasTexture:z,atlasTextureIcon:F,atlasInterpolation:D,atlasInterpolationIcon:R,isSDF:d,hasHalo:J};if(w&&l.canOverlap){k=!0;const t=c.segments.get();for(const i of t)I.push({segments:new e.a0([i]),sortKey:i.sortKey,state:Y,terrainData:M})}else I.push({segments:c.segments,sortKey:0,state:Y,terrainData:M})}k&&I.sort(((t,e)=>t.sortKey-e.sortKey));for(const e of I){const i=e.state;if(p.activeTexture.set(f.TEXTURE0),i.atlasTexture.bind(i.atlasInterpolation,f.CLAMP_TO_EDGE),i.atlasTextureIcon&&(p.activeTexture.set(f.TEXTURE1),i.atlasTextureIcon&&i.atlasTextureIcon.bind(i.atlasInterpolationIcon,f.CLAMP_TO_EDGE)),i.isSDF){const n=i.uniformValues;i.hasHalo&&(n.u_is_halo=1,Ji(i.buffers,e.segments,r,t,i.program,E,h,d,n,e.terrainData)),n.u_is_halo=0}Ji(i.buffers,e.segments,r,t,i.program,E,h,d,i.uniformValues,e.terrainData)}}function Ji(t,e,i,r,n,o,a,s,l,c){const u=r.context;n.draw(u,u.gl.TRIANGLES,o,a,s,Vi.disabled,l,c,i.id,t.layoutVertexBuffer,t.indexBuffer,e,i.paint,r.transform.zoom,t.programConfigurations.get(i.id),t.dynamicLayoutVertexBuffer,t.opacityVertexBuffer)}function Ki(t,i,r,n){const o=t.context,a=o.gl,s=ji.disabled,l=new Oi([a.ONE,a.ONE],e.aM.transparent,[!0,!0,!0,!0]),c=i.getBucket(r);if(!c)return;const u=n.key;let h=r.heatmapFbos.get(u);h||(h=Qi(o,i.tileSize,i.tileSize),r.heatmapFbos.set(u,h)),o.bindFramebuffer.set(h.framebuffer),o.viewport.set([0,0,i.tileSize,i.tileSize]),o.clear({color:e.aM.transparent});const d=c.programConfigurations.get(r.id),p=t.useProgram("heatmap",d),f=t.style.map.terrain.getTerrainData(n);p.draw(o,a.TRIANGLES,Bi.disabled,s,l,Vi.disabled,Me(n.posMatrix,i,t.transform.zoom,r.paint.get("heatmap-intensity")),f,r.id,c.layoutVertexBuffer,c.indexBuffer,c.segments,r.paint,t.transform.zoom,d)}function Yi(t,e,i){const r=t.context,n=r.gl;r.setColorMode(t.colorModeForRenderPass());const o=tr(r,e),a=i.key,s=e.heatmapFbos.get(a);s&&(r.activeTexture.set(n.TEXTURE0),n.bindTexture(n.TEXTURE_2D,s.colorAttachment.get()),r.activeTexture.set(n.TEXTURE1),o.bind(n.LINEAR,n.CLAMP_TO_EDGE),t.useProgram("heatmapTexture").draw(r,n.TRIANGLES,Bi.disabled,ji.disabled,t.colorModeForRenderPass(),Vi.disabled,Le(t,e,0,1),null,e.id,t.rasterBoundsBuffer,t.quadTriangleIndexBuffer,t.rasterBoundsSegments,e.paint,t.transform.zoom),s.destroy(),e.heatmapFbos.delete(a))}function Qi(t,e,i){var r,n;const o=t.gl,a=o.createTexture();o.bindTexture(o.TEXTURE_2D,a),o.texParameteri(o.TEXTURE_2D,o.TEXTURE_WRAP_S,o.CLAMP_TO_EDGE),o.texParameteri(o.TEXTURE_2D,o.TEXTURE_WRAP_T,o.CLAMP_TO_EDGE),o.texParameteri(o.TEXTURE_2D,o.TEXTURE_MIN_FILTER,o.LINEAR),o.texParameteri(o.TEXTURE_2D,o.TEXTURE_MAG_FILTER,o.LINEAR);const s=null!==(r=t.HALF_FLOAT)&&void 0!==r?r:o.UNSIGNED_BYTE,l=null!==(n=t.RGBA16F)&&void 0!==n?n:o.RGBA;o.texImage2D(o.TEXTURE_2D,0,l,e,i,0,o.RGBA,s,null);const c=t.createFramebuffer(e,i,!1,!1);return c.colorAttachment.set(a),c}function tr(t,e){return e.colorRampTexture||(e.colorRampTexture=new x(t,e.colorRamp,t.gl.RGBA)),e.colorRampTexture}function er(t,e,i,r,n){if(!i||!r||!r.imageAtlas)return;const o=r.imageAtlas.patternPositions;let a=o[i.to.toString()],s=o[i.from.toString()];if(!a&&s&&(a=s),!s&&a&&(s=a),!a||!s){const t=n.getPaintProperty(e);a=o[t],s=o[t]}a&&s&&t.setConstantPatternPositions(a,s)}function ir(t,e,i,r,n,o,a){const s=t.context.gl,l="fill-pattern",c=i.paint.get(l),u=c&&c.constantOr(1),h=i.getCrossfadeParameters();let d,p,f,m,g;a?(p=u&&!i.getPaintProperty("fill-outline-color")?"fillOutlinePattern":"fillOutline",d=s.LINES):(p=u?"fillPattern":"fill",d=s.TRIANGLES);const y=c.constantOr(null);for(const _ of r){const r=e.getTile(_);if(u&&!r.patternsLoaded())continue;const c=r.getBucket(i);if(!c)continue;const v=c.programConfigurations.get(i.id),b=t.useProgram(p,v),x=t.style.map.terrain&&t.style.map.terrain.getTerrainData(_);u&&(t.context.activeTexture.set(s.TEXTURE0),r.imageAtlasTexture.bind(s.LINEAR,s.CLAMP_TO_EDGE),v.updatePaintBuffers(h)),er(v,l,y,r,i);const w=x?_:null,k=t.translatePosMatrix(w?w.posMatrix:_.posMatrix,r,i.paint.get("fill-translate"),i.paint.get("fill-translate-anchor"));if(a){m=c.indexBuffer2,g=c.segments2;const e=[s.drawingBufferWidth,s.drawingBufferHeight];f="fillOutlinePattern"===p&&u?Ie(k,t,h,r,e):Se(k,e)}else m=c.indexBuffer,g=c.segments,f=u?Ee(k,t,h,r):ke(k);b.draw(t.context,d,n,t.stencilModeForClipping(_),o,Vi.disabled,f,x,i.id,c.layoutVertexBuffer,m,g,i.paint,t.transform.zoom,v)}}function rr(t,e,i,r,n,o,a){const s=t.context,l=s.gl,c="fill-extrusion-pattern",u=i.paint.get(c),h=u.constantOr(1),d=i.getCrossfadeParameters(),p=i.paint.get("fill-extrusion-opacity"),f=u.constantOr(null);for(const m of r){const r=e.getTile(m),u=r.getBucket(i);if(!u)continue;const g=t.style.map.terrain&&t.style.map.terrain.getTerrainData(m),y=u.programConfigurations.get(i.id),_=t.useProgram(h?"fillExtrusionPattern":"fillExtrusion",y);h&&(t.context.activeTexture.set(l.TEXTURE0),r.imageAtlasTexture.bind(l.LINEAR,l.CLAMP_TO_EDGE),y.updatePaintBuffers(d)),er(y,c,f,r,i);const v=t.translatePosMatrix(m.posMatrix,r,i.paint.get("fill-extrusion-translate"),i.paint.get("fill-extrusion-translate-anchor")),b=i.paint.get("fill-extrusion-vertical-gradient"),x=h?we(v,t,b,p,m,d,r):xe(v,t,b,p);_.draw(s,s.gl.TRIANGLES,n,o,a,Vi.backCCW,x,g,i.id,u.layoutVertexBuffer,u.indexBuffer,u.segments,i.paint,t.transform.zoom,y,t.style.map.terrain&&u.centroidVertexBuffer)}}function nr(t,e,i,r,n,o,a){const s=t.context,l=s.gl,c=i.fbo;if(!c)return;const u=t.useProgram("hillshade"),h=t.style.map.terrain&&t.style.map.terrain.getTerrainData(e);s.activeTexture.set(l.TEXTURE0),l.bindTexture(l.TEXTURE_2D,c.colorAttachment.get()),u.draw(s,l.TRIANGLES,n,o,a,Vi.disabled,((t,e,i,r)=>{const n=i.paint.get("hillshade-shadow-color"),o=i.paint.get("hillshade-highlight-color"),a=i.paint.get("hillshade-accent-color");let s=i.paint.get("hillshade-illumination-direction")*(Math.PI/180);"viewport"===i.paint.get("hillshade-illumination-anchor")&&(s-=t.transform.angle);const l=!t.options.moving;return{u_matrix:r?r.posMatrix:t.transform.calculatePosMatrix(e.tileID.toUnwrapped(),l),u_image:0,u_latrange:ze(0,e.tileID),u_light:[i.paint.get("hillshade-exaggeration"),s],u_shadow:n,u_highlight:o,u_accent:a}})(t,i,r,h?e:null),h,r.id,t.rasterBoundsBuffer,t.quadTriangleIndexBuffer,t.rasterBoundsSegments)}function or(t,i,r,n,o,a){const s=t.context,l=s.gl,c=i.dem;if(c&&c.data){const u=c.dim,h=c.stride,d=c.getPixels();if(s.activeTexture.set(l.TEXTURE1),s.pixelStoreUnpackPremultiplyAlpha.set(!1),i.demTexture=i.demTexture||t.getTileTexture(h),i.demTexture){const t=i.demTexture;t.update(d,{premultiply:!1}),t.bind(l.NEAREST,l.CLAMP_TO_EDGE)}else i.demTexture=new x(s,d,l.RGBA,{premultiply:!1}),i.demTexture.bind(l.NEAREST,l.CLAMP_TO_EDGE);s.activeTexture.set(l.TEXTURE0);let p=i.fbo;if(!p){const t=new x(s,{width:u,height:u,data:null},l.RGBA);t.bind(l.LINEAR,l.CLAMP_TO_EDGE),p=i.fbo=s.createFramebuffer(u,u,!0,!1),p.colorAttachment.set(t.texture)}s.bindFramebuffer.set(p.framebuffer),s.viewport.set([0,0,u,u]),t.useProgram("hillshadePrepare").draw(s,l.TRIANGLES,n,o,a,Vi.disabled,((t,i)=>{const r=i.stride,n=e.H();return e.aP(n,0,e.X,-e.X,0,0,1),e.J(n,n,[0,-e.X,0]),{u_matrix:n,u_image:1,u_dimension:[r,r],u_zoom:t.overscaledZ,u_unpack:i.getUnpackVector()}})(i.tileID,c),null,r.id,t.rasterBoundsBuffer,t.quadTriangleIndexBuffer,t.rasterBoundsSegments),i.needsHillshadePrepare=!1}}function ar(t,i,r,n,a,s){const l=n.paint.get("raster-fade-duration");if(!s&&l>0){const n=o.now(),s=(n-t.timeAdded)/l,c=i?(n-i.timeAdded)/l:-1,u=r.getSource(),h=a.coveringZoomLevel({tileSize:u.tileSize,roundZoom:u.roundZoom}),d=!i||Math.abs(i.tileID.overscaledZ-h)>Math.abs(t.tileID.overscaledZ-h),p=d&&t.refreshedUponExpiration?1:e.ac(d?s:1-c,0,1);return t.refreshedUponExpiration&&s>=1&&(t.refreshedUponExpiration=!1),i?{opacity:1,mix:1-p}:{opacity:p,mix:0}}return{opacity:1,mix:0}}const sr=new e.aM(1,0,0,1),lr=new e.aM(0,1,0,1),cr=new e.aM(0,0,1,1),ur=new e.aM(1,0,1,1),hr=new e.aM(0,1,1,1);function dr(t,e,i,r){fr(t,0,e+i/2,t.transform.width,i,r)}function pr(t,e,i,r){fr(t,e-i/2,0,i,t.transform.height,r)}function fr(t,e,i,r,n,o){const a=t.context,s=a.gl;s.enable(s.SCISSOR_TEST),s.scissor(e*t.pixelRatio,i*t.pixelRatio,r*t.pixelRatio,n*t.pixelRatio),a.clear({color:o}),s.disable(s.SCISSOR_TEST)}function mr(t,i,r){const n=t.context,o=n.gl,a=r.posMatrix,s=t.useProgram("debug"),l=Bi.disabled,c=ji.disabled,u=t.colorModeForRenderPass(),h="$debug",d=t.style.map.terrain&&t.style.map.terrain.getTerrainData(r);n.activeTexture.set(o.TEXTURE0);const p=i.getTileByID(r.key).latestRawTileData,f=Math.floor((p&&p.byteLength||0)/1024),m=i.getTile(r).tileSize,g=512/Math.min(m,512)*(r.overscaledZ/t.transform.zoom)*.5;let y=r.canonical.toString();r.overscaledZ!==r.canonical.z&&(y+=` => ${r.overscaledZ}`),function(t,e){t.initDebugOverlayCanvas();const i=t.debugOverlayCanvas,r=t.context.gl,n=t.debugOverlayCanvas.getContext("2d");n.clearRect(0,0,i.width,i.height),n.shadowColor="white",n.shadowBlur=2,n.lineWidth=1.5,n.strokeStyle="white",n.textBaseline="top",n.font="bold 36px Open Sans, sans-serif",n.fillText(e,5,5),n.strokeText(e,5,5),t.debugOverlayTexture.update(i),t.debugOverlayTexture.bind(r.LINEAR,r.CLAMP_TO_EDGE)}(t,`${y} ${f}kB`),s.draw(n,o.TRIANGLES,l,c,Oi.alphaBlended,Vi.disabled,Ae(a,e.aM.transparent,g),null,h,t.debugBuffer,t.quadTriangleIndexBuffer,t.debugSegments),s.draw(n,o.LINE_STRIP,l,c,u,Vi.disabled,Ae(a,e.aM.red),d,h,t.debugBuffer,t.tileBorderIndexBuffer,t.debugSegments)}function gr(t,e,i){const r=t.context,n=r.gl,o=t.colorModeForRenderPass(),a=new Bi(n.LEQUAL,Bi.ReadWrite,t.depthRangeFor3D),s=t.useProgram("terrain"),l=e.getTerrainMesh();r.bindFramebuffer.set(null),r.viewport.set([0,0,t.width,t.height]);for(const c of i){const i=t.renderToTexture.getTexture(c),u=e.getTerrainData(c.tileID);r.activeTexture.set(n.TEXTURE0),n.bindTexture(n.TEXTURE_2D,i.texture);const h=t.transform.calculatePosMatrix(c.tileID.toUnwrapped()),d=e.getMeshFrameDelta(t.transform.zoom),p=t.transform.calculateFogMatrix(c.tileID.toUnwrapped()),f=ye(h,d,p,t.style.sky,t.transform.pitch);s.draw(r,n.TRIANGLES,a,ji.disabled,o,Vi.backCCW,f,u,"terrain",l.vertexBuffer,l.indexBuffer,l.segments)}}class yr{constructor(t,e,i){this.vertexBuffer=t,this.indexBuffer=e,this.segments=i}destroy(){this.vertexBuffer.destroy(),this.indexBuffer.destroy(),this.segments.destroy(),this.vertexBuffer=null,this.indexBuffer=null,this.segments=null}}class _r{constructor(t,i){this.context=new Fi(t),this.transform=i,this._tileTextures={},this.terrainFacilitator={dirty:!0,matrix:e.an(new Float64Array(16)),renderTime:0},this.setup(),this.numSublayers=ht.maxUnderzooming+ht.maxOverzooming+1,this.depthEpsilon=1/Math.pow(2,16),this.crossTileSymbolIndex=new ce}resize(t,e,i){if(this.width=Math.floor(t*i),this.height=Math.floor(e*i),this.pixelRatio=i,this.context.viewport.set([0,0,this.width,this.height]),this.style)for(const r of this.style._order)this.style._layers[r].resize()}setup(){const t=this.context,i=new e.aX;i.emplaceBack(0,0),i.emplaceBack(e.X,0),i.emplaceBack(0,e.X),i.emplaceBack(e.X,e.X),this.tileExtentBuffer=t.createVertexBuffer(i,pe.members),this.tileExtentSegments=e.a0.simpleSegment(0,0,4,2);const r=new e.aX;r.emplaceBack(0,0),r.emplaceBack(e.X,0),r.emplaceBack(0,e.X),r.emplaceBack(e.X,e.X),this.debugBuffer=t.createVertexBuffer(r,pe.members),this.debugSegments=e.a0.simpleSegment(0,0,4,5);const n=new e.$;n.emplaceBack(0,0,0,0),n.emplaceBack(e.X,0,e.X,0),n.emplaceBack(0,e.X,0,e.X),n.emplaceBack(e.X,e.X,e.X,e.X),this.rasterBoundsBuffer=t.createVertexBuffer(n,Y.members),this.rasterBoundsSegments=e.a0.simpleSegment(0,0,4,2);const o=new e.aX;o.emplaceBack(0,0),o.emplaceBack(1,0),o.emplaceBack(0,1),o.emplaceBack(1,1),this.viewportBuffer=t.createVertexBuffer(o,pe.members),this.viewportSegments=e.a0.simpleSegment(0,0,4,2);const a=new e.aZ;a.emplaceBack(0),a.emplaceBack(1),a.emplaceBack(3),a.emplaceBack(2),a.emplaceBack(0),this.tileBorderIndexBuffer=t.createIndexBuffer(a);const s=new e.aY;s.emplaceBack(0,1,2),s.emplaceBack(2,1,3),this.quadTriangleIndexBuffer=t.createIndexBuffer(s);const l=this.context.gl;this.stencilClearMode=new ji({func:l.ALWAYS,mask:0},0,255,l.ZERO,l.ZERO,l.ZERO)}clearStencil(){const t=this.context,i=t.gl;this.nextStencilID=1,this.currentStencilSource=void 0;const r=e.H();e.aP(r,0,this.width,this.height,0,0,1),e.K(r,r,[i.drawingBufferWidth,i.drawingBufferHeight,0]),this.useProgram("clippingMask").draw(t,i.TRIANGLES,Bi.disabled,this.stencilClearMode,Oi.disabled,Vi.disabled,Pe(r),null,"$clipping",this.viewportBuffer,this.quadTriangleIndexBuffer,this.viewportSegments)}_renderTileClippingMasks(t,e){if(this.currentStencilSource===t.source||!t.isTileClipped()||!e||!e.length)return;this.currentStencilSource=t.source;const i=this.context,r=i.gl;this.nextStencilID+e.length>256&&this.clearStencil(),i.setColorMode(Oi.disabled),i.setDepthMode(Bi.disabled);const n=this.useProgram("clippingMask");this._tileClippingMaskIDs={};for(const o of e){const t=this._tileClippingMaskIDs[o.key]=this.nextStencilID++,e=this.style.map.terrain&&this.style.map.terrain.getTerrainData(o);n.draw(i,r.TRIANGLES,Bi.disabled,new ji({func:r.ALWAYS,mask:0},t,255,r.KEEP,r.KEEP,r.REPLACE),Oi.disabled,Vi.disabled,Pe(o.posMatrix),e,"$clipping",this.tileExtentBuffer,this.quadTriangleIndexBuffer,this.tileExtentSegments)}}stencilModeFor3D(){this.currentStencilSource=void 0,this.nextStencilID+1>256&&this.clearStencil();const t=this.nextStencilID++,e=this.context.gl;return new ji({func:e.NOTEQUAL,mask:255},t,255,e.KEEP,e.KEEP,e.REPLACE)}stencilModeForClipping(t){const e=this.context.gl;return new ji({func:e.EQUAL,mask:255},this._tileClippingMaskIDs[t.key],0,e.KEEP,e.KEEP,e.REPLACE)}stencilConfigForOverlap(t){const e=this.context.gl,i=t.sort(((t,e)=>e.overscaledZ-t.overscaledZ)),r=i[i.length-1].overscaledZ,n=i[0].overscaledZ-r+1;if(n>1){this.currentStencilSource=void 0,this.nextStencilID+n>256&&this.clearStencil();const t={};for(let i=0;i<n;i++)t[i+r]=new ji({func:e.GEQUAL,mask:255},i+this.nextStencilID,255,e.KEEP,e.KEEP,e.REPLACE);return this.nextStencilID+=n,[t,i]}return[{[r]:ji.disabled},i]}colorModeForRenderPass(){const t=this.context.gl;if(this._showOverdrawInspector){const i=1/8;return new Oi([t.CONSTANT_COLOR,t.ONE],new e.aM(i,i,i,0),[!0,!0,!0,!0])}return"opaque"===this.renderPass?Oi.unblended:Oi.alphaBlended}depthModeForSublayer(t,e,i){if(!this.opaquePassEnabledForLayer())return Bi.disabled;const r=1-((1+this.currentLayer)*this.numSublayers+t)*this.depthEpsilon;return new Bi(i||this.context.gl.LEQUAL,e,[r,r])}opaquePassEnabledForLayer(){return this.currentLayer<this.opaquePassCutoff}render(t,i){this.style=t,this.options=i,this.lineAtlas=t.lineAtlas,this.imageManager=t.imageManager,this.glyphManager=t.glyphManager,this.symbolFadeChange=t.placement.symbolFadeChange(o.now()),this.imageManager.beginFrame();const r=this.style._order,n=this.style.sourceCaches,a={},s={},l={};for(const e in n){const t=n[e];t.used&&t.prepare(this.context),a[e]=t.getVisibleCoordinates(),s[e]=a[e].slice().reverse(),l[e]=t.getVisibleCoordinates(!0).reverse()}this.opaquePassCutoff=1/0;for(let e=0;e<r.length;e++)if(this.style._layers[r[e]].is3D()){this.opaquePassCutoff=e;break}this.maybeDrawDepthAndCoords(!1),this.renderToTexture&&(this.renderToTexture.prepareForRender(this.style,this.transform.zoom),this.opaquePassCutoff=0),this.renderPass="offscreen";for(const e of r){const t=this.style._layers[e];if(!t.hasOffscreenPass()||t.isHidden(this.transform.zoom))continue;const i=s[t.source];("custom"===t.type||i.length)&&this.renderLayer(this,n[t.source],t,i)}if(this.context.bindFramebuffer.set(null),this.context.clear({color:i.showOverdrawInspector?e.aM.black:e.aM.transparent,depth:1}),this.clearStencil(),this.style.sky&&function(t,i){const r=t.context,n=r.gl,o=((t,e,i)=>({u_sky_color:t.properties.get("sky-color"),u_horizon_color:t.properties.get("horizon-color"),u_horizon:(e.height/2+e.getHorizon())*i,u_sky_horizon_blend:t.properties.get("sky-horizon-blend")*e.height/2*i}))(i,t.style.map.transform,t.pixelRatio),a=new Bi(n.LEQUAL,Bi.ReadWrite,[0,1]),s=ji.disabled,l=t.colorModeForRenderPass(),c=t.useProgram("sky");if(!i.mesh){const t=new e.aX;t.emplaceBack(-1,-1),t.emplaceBack(1,-1),t.emplaceBack(1,1),t.emplaceBack(-1,1);const n=new e.aY;n.emplaceBack(0,1,2),n.emplaceBack(0,2,3),i.mesh=new yr(r.createVertexBuffer(t,pe.members),r.createIndexBuffer(n),e.a0.simpleSegment(0,0,t.length,n.length))}c.draw(r,n.TRIANGLES,a,s,l,Vi.disabled,o,void 0,"sky",i.mesh.vertexBuffer,i.mesh.indexBuffer,i.mesh.segments)}(this,this.style.sky),this._showOverdrawInspector=i.showOverdrawInspector,this.depthRangeFor3D=[0,1-(t._order.length+2)*this.numSublayers*this.depthEpsilon],!this.renderToTexture)for(this.renderPass="opaque",this.currentLayer=r.length-1;this.currentLayer>=0;this.currentLayer--){const t=this.style._layers[r[this.currentLayer]],e=n[t.source],i=a[t.source];this._renderTileClippingMasks(t,i),this.renderLayer(this,e,t,i)}for(this.renderPass="translucent",this.currentLayer=0;this.currentLayer<r.length;this.currentLayer++){const t=this.style._layers[r[this.currentLayer]],e=n[t.source];if(this.renderToTexture&&this.renderToTexture.renderLayer(t))continue;const i=("symbol"===t.type?l:s)[t.source];this._renderTileClippingMasks(t,a[t.source]),this.renderLayer(this,e,t,i)}if(this.options.showTileBoundaries){const t=function(t,e){let i=null;const r=Object.values(t._layers).flatMap((i=>i.source&&!i.isHidden(e)?[t.sourceCaches[i.source]]:[])),n=r.filter((t=>"vector"===t.getSource().type)),o=r.filter((t=>"vector"!==t.getSource().type)),a=t=>{(!i||i.getSource().maxzoom<t.getSource().maxzoom)&&(i=t)};return n.forEach((t=>a(t))),i||o.forEach((t=>a(t))),i}(this.style,this.transform.zoom);t&&function(t,e,i){for(let r=0;r<i.length;r++)mr(t,e,i[r])}(this,t,t.getVisibleCoordinates())}this.options.showPadding&&function(t){const e=t.transform.padding;dr(t,t.transform.height-(e.top||0),3,sr),dr(t,e.bottom||0,3,lr),pr(t,e.left||0,3,cr),pr(t,t.transform.width-(e.right||0),3,ur);const i=t.transform.centerPoint;!function(t,e,i,r){fr(t,e-1,i-10,2,20,r),fr(t,e-10,i-1,20,2,r)}(t,i.x,t.transform.height-i.y,hr)}(this),this.context.setDefault()}maybeDrawDepthAndCoords(t){if(!this.style||!this.style.map||!this.style.map.terrain)return;const i=this.terrainFacilitator.matrix,r=this.transform.modelViewProjectionMatrix;let n=this.terrainFacilitator.dirty;n||(n=t?!e.a_(i,r):!e.a$(i,r)),n||(n=this.style.map.terrain.sourceCache.tilesAfterTime(this.terrainFacilitator.renderTime).length>0),n&&(e.b0(i,r),this.terrainFacilitator.renderTime=Date.now(),this.terrainFacilitator.dirty=!1,function(t,i){const r=t.context,n=r.gl,o=Oi.unblended,a=new Bi(n.LEQUAL,Bi.ReadWrite,[0,1]),s=i.getTerrainMesh(),l=i.sourceCache.getRenderableTiles(),c=t.useProgram("terrainDepth");r.bindFramebuffer.set(i.getFramebuffer("depth").framebuffer),r.viewport.set([0,0,t.width/devicePixelRatio,t.height/devicePixelRatio]),r.clear({color:e.aM.transparent,depth:1});for(const e of l){const l=i.getTerrainData(e.tileID),u={u_matrix:t.transform.calculatePosMatrix(e.tileID.toUnwrapped()),u_ele_delta:i.getMeshFrameDelta(t.transform.zoom)};c.draw(r,n.TRIANGLES,a,ji.disabled,o,Vi.backCCW,u,l,"terrain",s.vertexBuffer,s.indexBuffer,s.segments)}r.bindFramebuffer.set(null),r.viewport.set([0,0,t.width,t.height])}(this,this.style.map.terrain),function(t,i){const r=t.context,n=r.gl,o=Oi.unblended,a=new Bi(n.LEQUAL,Bi.ReadWrite,[0,1]),s=i.getTerrainMesh(),l=i.getCoordsTexture(),c=i.sourceCache.getRenderableTiles(),u=t.useProgram("terrainCoords");r.bindFramebuffer.set(i.getFramebuffer("coords").framebuffer),r.viewport.set([0,0,t.width/devicePixelRatio,t.height/devicePixelRatio]),r.clear({color:e.aM.transparent,depth:1}),i.coordsIndex=[];for(const e of c){const c=i.getTerrainData(e.tileID);r.activeTexture.set(n.TEXTURE0),n.bindTexture(n.TEXTURE_2D,l.texture);const h={u_matrix:t.transform.calculatePosMatrix(e.tileID.toUnwrapped()),u_terrain_coords_id:(255-i.coordsIndex.length)/255,u_texture:0,u_ele_delta:i.getMeshFrameDelta(t.transform.zoom)};u.draw(r,n.TRIANGLES,a,ji.disabled,o,Vi.backCCW,h,c,"terrain",s.vertexBuffer,s.indexBuffer,s.segments),i.coordsIndex.push(e.tileID.key)}r.bindFramebuffer.set(null),r.viewport.set([0,0,t.width,t.height])}(this,this.style.map.terrain))}renderLayer(t,i,r,n){if(!r.isHidden(this.transform.zoom)&&("background"===r.type||"custom"===r.type||(n||[]).length))switch(this.id=r.id,r.type){case"symbol":!function(t,i,r,n,o){if("translucent"!==t.renderPass)return;const a=ji.disabled,s=t.colorModeForRenderPass();(r._unevaluatedLayout.hasValue("text-variable-anchor")||r._unevaluatedLayout.hasValue("text-variable-anchor-offset"))&&function(t,i,r,n,o,a,s,l,c){const u=i.transform,h=ie(),d="map"===o,p="map"===a;for(const f of t){const t=n.getTile(f),o=t.getBucket(r);if(!o||!o.text||!o.text.segments.get().length)continue;const a=e.ag(o.textSizeData,u.zoom),m=Ft(t,1,i.transform.zoom),g=yt(f.posMatrix,p,d,i.transform,m),y="none"!==r.layout.get("icon-text-fit")&&o.hasIconData();if(a){const e=Math.pow(2,u.zoom-t.tileID.overscaledZ),r=i.style.map.terrain?(t,e)=>i.style.map.terrain.getElevation(f,t,e):null,n=h.translatePosition(u,t,s,l);Zi(o,d,p,c,u,g,f.posMatrix,e,a,y,h,n,f.toUnwrapped(),r)}}}(n,t,r,i,r.layout.get("text-rotation-alignment"),r.layout.get("text-pitch-alignment"),r.paint.get("text-translate"),r.paint.get("text-translate-anchor"),o),0!==r.paint.get("icon-opacity").constantOr(1)&&Xi(t,i,r,n,!1,r.paint.get("icon-translate"),r.paint.get("icon-translate-anchor"),r.layout.get("icon-rotation-alignment"),r.layout.get("icon-pitch-alignment"),r.layout.get("icon-keep-upright"),a,s),0!==r.paint.get("text-opacity").constantOr(1)&&Xi(t,i,r,n,!0,r.paint.get("text-translate"),r.paint.get("text-translate-anchor"),r.layout.get("text-rotation-alignment"),r.layout.get("text-pitch-alignment"),r.layout.get("text-keep-upright"),a,s),i.map.showCollisionBoxes&&(qi(t,i,r,n,!0),qi(t,i,r,n,!1))}(t,i,r,n,this.style.placement.variableOffsets);break;case"circle":!function(t,i,r,n){if("translucent"!==t.renderPass)return;const o=r.paint.get("circle-opacity"),a=r.paint.get("circle-stroke-width"),s=r.paint.get("circle-stroke-opacity"),l=!r.layout.get("circle-sort-key").isConstant();if(0===o.constantOr(1)&&(0===a.constantOr(1)||0===s.constantOr(1)))return;const c=t.context,u=c.gl,h=t.depthModeForSublayer(0,Bi.ReadOnly),d=ji.disabled,p=t.colorModeForRenderPass(),f=[];for(let m=0;m<n.length;m++){const o=n[m],a=i.getTile(o),s=a.getBucket(r);if(!s)continue;const c=s.programConfigurations.get(r.id),u=t.useProgram("circle",c),h=s.layoutVertexBuffer,d=s.indexBuffer,p=t.style.map.terrain&&t.style.map.terrain.getTerrainData(o),g={programConfiguration:c,program:u,layoutVertexBuffer:h,indexBuffer:d,uniformValues:Ce(t,o,a,r),terrainData:p};if(l){const t=s.segments.get();for(const i of t)f.push({segments:new e.a0([i]),sortKey:i.sortKey,state:g})}else f.push({segments:s.segments,sortKey:0,state:g})}l&&f.sort(((t,e)=>t.sortKey-e.sortKey));for(const e of f){const{programConfiguration:i,program:n,layoutVertexBuffer:o,indexBuffer:a,uniformValues:s,terrainData:l}=e.state;n.draw(c,u.TRIANGLES,h,d,p,Vi.disabled,s,l,r.id,o,a,e.segments,r.paint,t.transform.zoom,i)}}(t,i,r,n);break;case"heatmap":!function(t,i,r,n){if(0===r.paint.get("heatmap-opacity"))return;const o=t.context;if(t.style.map.terrain){for(const e of n){const n=i.getTile(e);i.hasRenderableParent(e)||("offscreen"===t.renderPass?Ki(t,n,r,e):"translucent"===t.renderPass&&Yi(t,r,e))}o.viewport.set([0,0,t.width,t.height])}else"offscreen"===t.renderPass?function(t,i,r,n){const o=t.context,a=o.gl,s=ji.disabled,l=new Oi([a.ONE,a.ONE],e.aM.transparent,[!0,!0,!0,!0]);(function(t,i,r){const n=t.gl;t.activeTexture.set(n.TEXTURE1),t.viewport.set([0,0,i.width/4,i.height/4]);let o=r.heatmapFbos.get(e.aU);o?(n.bindTexture(n.TEXTURE_2D,o.colorAttachment.get()),t.bindFramebuffer.set(o.framebuffer)):(o=Qi(t,i.width/4,i.height/4),r.heatmapFbos.set(e.aU,o))})(o,t,r),o.clear({color:e.aM.transparent});for(let e=0;e<n.length;e++){const c=n[e];if(i.hasRenderableParent(c))continue;const u=i.getTile(c),h=u.getBucket(r);if(!h)continue;const d=h.programConfigurations.get(r.id),p=t.useProgram("heatmap",d),{zoom:f}=t.transform;p.draw(o,a.TRIANGLES,Bi.disabled,s,l,Vi.disabled,Me(c.posMatrix,u,f,r.paint.get("heatmap-intensity")),null,r.id,h.layoutVertexBuffer,h.indexBuffer,h.segments,r.paint,t.transform.zoom,d)}o.viewport.set([0,0,t.width,t.height])}(t,i,r,n):"translucent"===t.renderPass&&function(t,i){const r=t.context,n=r.gl;r.setColorMode(t.colorModeForRenderPass());const o=i.heatmapFbos.get(e.aU);o&&(r.activeTexture.set(n.TEXTURE0),n.bindTexture(n.TEXTURE_2D,o.colorAttachment.get()),r.activeTexture.set(n.TEXTURE1),tr(r,i).bind(n.LINEAR,n.CLAMP_TO_EDGE),t.useProgram("heatmapTexture").draw(r,n.TRIANGLES,Bi.disabled,ji.disabled,t.colorModeForRenderPass(),Vi.disabled,Le(t,i,0,1),null,i.id,t.viewportBuffer,t.quadTriangleIndexBuffer,t.viewportSegments,i.paint,t.transform.zoom))}(t,r)}(t,i,r,n);break;case"line":!function(t,i,r,n){if("translucent"!==t.renderPass)return;const o=r.paint.get("line-opacity"),a=r.paint.get("line-width");if(0===o.constantOr(1)||0===a.constantOr(1))return;const s=t.depthModeForSublayer(0,Bi.ReadOnly),l=t.colorModeForRenderPass(),c=r.paint.get("line-dasharray"),u=r.paint.get("line-pattern"),h=u.constantOr(1),d=r.paint.get("line-gradient"),p=r.getCrossfadeParameters(),f=h?"linePattern":c?"lineSDF":d?"lineGradient":"line",m=t.context,g=m.gl;let y=!0;for(const _ of n){const n=i.getTile(_);if(h&&!n.patternsLoaded())continue;const o=n.getBucket(r);if(!o)continue;const a=o.programConfigurations.get(r.id),v=t.context.program.get(),b=t.useProgram(f,a),w=y||b.program!==v,k=t.style.map.terrain&&t.style.map.terrain.getTerrainData(_),E=u.constantOr(null);if(E&&n.imageAtlas){const t=n.imageAtlas,e=t.patternPositions[E.to.toString()],i=t.patternPositions[E.from.toString()];e&&i&&a.setConstantPatternPositions(e,i)}const S=k?_:null,I=h?Oe(t,n,r,p,S):c?Fe(t,n,r,c,p,S):d?Re(t,n,r,o.lineClipsArray.length,S):De(t,n,r,S);if(h)m.activeTexture.set(g.TEXTURE0),n.imageAtlasTexture.bind(g.LINEAR,g.CLAMP_TO_EDGE),a.updatePaintBuffers(p);else if(c&&(w||t.lineAtlas.dirty))m.activeTexture.set(g.TEXTURE0),t.lineAtlas.bind(m);else if(d){const n=o.gradients[r.id];let a=n.texture;if(r.gradientVersion!==n.version){let s=256;if(r.stepInterpolant){const r=i.getSource().maxzoom,n=_.canonical.z===r?Math.ceil(1<<t.transform.maxZoom-_.canonical.z):1;s=e.ac(e.aV(o.maxLineLength/e.X*1024*n),256,m.maxTextureSize)}n.gradient=e.aW({expression:r.gradientExpression(),evaluationKey:"lineProgress",resolution:s,image:n.gradient||void 0,clips:o.lineClipsArray}),n.texture?n.texture.update(n.gradient):n.texture=new x(m,n.gradient,g.RGBA),n.version=r.gradientVersion,a=n.texture}m.activeTexture.set(g.TEXTURE0),a.bind(r.stepInterpolant?g.NEAREST:g.LINEAR,g.CLAMP_TO_EDGE)}b.draw(m,g.TRIANGLES,s,t.stencilModeForClipping(_),l,Vi.disabled,I,k,r.id,o.layoutVertexBuffer,o.indexBuffer,o.segments,r.paint,t.transform.zoom,a,o.layoutVertexBuffer2),y=!1}}(t,i,r,n);break;case"fill":!function(t,i,r,n){const o=r.paint.get("fill-color"),a=r.paint.get("fill-opacity");if(0===a.constantOr(1))return;const s=t.colorModeForRenderPass(),l=r.paint.get("fill-pattern"),c=t.opaquePassEnabledForLayer()&&!l.constantOr(1)&&1===o.constantOr(e.aM.transparent).a&&1===a.constantOr(0)?"opaque":"translucent";if(t.renderPass===c){const e=t.depthModeForSublayer(1,"opaque"===t.renderPass?Bi.ReadWrite:Bi.ReadOnly);ir(t,i,r,n,e,s,!1)}if("translucent"===t.renderPass&&r.paint.get("fill-antialias")){const e=t.depthModeForSublayer(r.getPaintProperty("fill-outline-color")?2:0,Bi.ReadOnly);ir(t,i,r,n,e,s,!0)}}(t,i,r,n);break;case"fill-extrusion":!function(t,e,i,r){const n=i.paint.get("fill-extrusion-opacity");if(0!==n&&"translucent"===t.renderPass){const o=new Bi(t.context.gl.LEQUAL,Bi.ReadWrite,t.depthRangeFor3D);if(1!==n||i.paint.get("fill-extrusion-pattern").constantOr(1))rr(t,e,i,r,o,ji.disabled,Oi.disabled),rr(t,e,i,r,o,t.stencilModeFor3D(),t.colorModeForRenderPass());else{const n=t.colorModeForRenderPass();rr(t,e,i,r,o,ji.disabled,n)}}}(t,i,r,n);break;case"hillshade":!function(t,e,i,r){if("offscreen"!==t.renderPass&&"translucent"!==t.renderPass)return;const n=t.context,o=t.depthModeForSublayer(0,Bi.ReadOnly),a=t.colorModeForRenderPass(),[s,l]="translucent"===t.renderPass?t.stencilConfigForOverlap(r):[{},r];for(const c of l){const r=e.getTile(c);void 0!==r.needsHillshadePrepare&&r.needsHillshadePrepare&&"offscreen"===t.renderPass?or(t,r,i,o,ji.disabled,a):"translucent"===t.renderPass&&nr(t,c,r,i,o,s[c.overscaledZ],a)}n.viewport.set([0,0,t.width,t.height])}(t,i,r,n);break;case"raster":!function(t,e,i,r){if("translucent"!==t.renderPass)return;if(0===i.paint.get("raster-opacity"))return;if(!r.length)return;const n=t.context,o=n.gl,a=e.getSource(),s=t.useProgram("raster"),l=t.colorModeForRenderPass(),[c,u]=a instanceof Q?[{},r]:t.stencilConfigForOverlap(r),h=u[u.length-1].overscaledZ,d=!t.options.moving;for(const p of u){const r=t.depthModeForSublayer(p.overscaledZ-h,1===i.paint.get("raster-opacity")?Bi.ReadWrite:Bi.ReadOnly,o.LESS),u=e.getTile(p);u.registerFadeDuration(i.paint.get("raster-fade-duration"));const f=e.findLoadedParent(p,0),m=e.findLoadedSibling(p),g=ar(u,f||m||null,e,i,t.transform,t.style.map.terrain);let y,_;const v="nearest"===i.paint.get("raster-resampling")?o.NEAREST:o.LINEAR;n.activeTexture.set(o.TEXTURE0),u.texture.bind(v,o.CLAMP_TO_EDGE,o.LINEAR_MIPMAP_NEAREST),n.activeTexture.set(o.TEXTURE1),f?(f.texture.bind(v,o.CLAMP_TO_EDGE,o.LINEAR_MIPMAP_NEAREST),y=Math.pow(2,f.tileID.overscaledZ-u.tileID.overscaledZ),_=[u.tileID.canonical.x*y%1,u.tileID.canonical.y*y%1]):u.texture.bind(v,o.CLAMP_TO_EDGE,o.LINEAR_MIPMAP_NEAREST),u.texture.useMipmap&&n.extTextureFilterAnisotropic&&t.transform.pitch>20&&o.texParameterf(o.TEXTURE_2D,n.extTextureFilterAnisotropic.TEXTURE_MAX_ANISOTROPY_EXT,n.extTextureFilterAnisotropicMax);const b=t.style.map.terrain&&t.style.map.terrain.getTerrainData(p),x=b?p:null,w=x?x.posMatrix:t.transform.calculatePosMatrix(p.toUnwrapped(),d),k=je(w,_||[0,0],y||1,g,i);a instanceof Q?s.draw(n,o.TRIANGLES,r,ji.disabled,l,Vi.disabled,k,b,i.id,a.boundsBuffer,t.quadTriangleIndexBuffer,a.boundsSegments):s.draw(n,o.TRIANGLES,r,c[p.overscaledZ],l,Vi.disabled,k,b,i.id,t.rasterBoundsBuffer,t.quadTriangleIndexBuffer,t.rasterBoundsSegments)}}(t,i,r,n);break;case"background":!function(t,e,i,r){const n=i.paint.get("background-color"),o=i.paint.get("background-opacity");if(0===o)return;const a=t.context,s=a.gl,l=t.transform,c=l.tileSize,u=i.paint.get("background-pattern");if(t.isPatternMissing(u))return;const h=!u&&1===n.a&&1===o&&t.opaquePassEnabledForLayer()?"opaque":"translucent";if(t.renderPass!==h)return;const d=ji.disabled,p=t.depthModeForSublayer(0,"opaque"===h?Bi.ReadWrite:Bi.ReadOnly),f=t.colorModeForRenderPass(),m=t.useProgram(u?"backgroundPattern":"background"),g=r||l.coveringTiles({tileSize:c,terrain:t.style.map.terrain});u&&(a.activeTexture.set(s.TEXTURE0),t.imageManager.bind(t.context));const y=i.getCrossfadeParameters();for(const _ of g){const e=r?_.posMatrix:t.transform.calculatePosMatrix(_.toUnwrapped()),l=u?He(e,o,t,u,{tileID:_,tileSize:c},y):Ge(e,o,n),h=t.style.map.terrain&&t.style.map.terrain.getTerrainData(_);m.draw(a,s.TRIANGLES,p,d,f,Vi.disabled,l,h,i.id,t.tileExtentBuffer,t.quadTriangleIndexBuffer,t.tileExtentSegments)}}(t,0,r,n);break;case"custom":!function(t,e,i){const r=t.context,n=i.implementation;if("offscreen"===t.renderPass){const e=n.prerender;e&&(t.setCustomLayerDefaults(),r.setColorMode(t.colorModeForRenderPass()),e.call(n,r.gl,t.transform.customLayerMatrix()),r.setDirty(),t.setBaseState())}else if("translucent"===t.renderPass){t.setCustomLayerDefaults(),r.setColorMode(t.colorModeForRenderPass()),r.setStencilMode(ji.disabled);const e="3d"===n.renderingMode?new Bi(t.context.gl.LEQUAL,Bi.ReadWrite,t.depthRangeFor3D):t.depthModeForSublayer(0,Bi.ReadOnly);r.setDepthMode(e),n.render(r.gl,t.transform.customLayerMatrix(),{farZ:t.transform.farZ,nearZ:t.transform.nearZ,fov:t.transform._fov,modelViewProjectionMatrix:t.transform.modelViewProjectionMatrix,projectionMatrix:t.transform.projectionMatrix}),r.setDirty(),t.setBaseState(),r.bindFramebuffer.set(null)}}(t,0,r)}}translatePosMatrix(t,i,r,n,o){if(!r[0]&&!r[1])return t;const a=o?"map"===n?this.transform.angle:0:"viewport"===n?-this.transform.angle:0;if(a){const t=Math.sin(a),e=Math.cos(a);r=[r[0]*e-r[1]*t,r[0]*t+r[1]*e]}const s=[o?r[0]:Ft(i,r[0],this.transform.zoom),o?r[1]:Ft(i,r[1],this.transform.zoom),0],l=new Float32Array(16);return e.J(l,t,s),l}saveTileTexture(t){const e=this._tileTextures[t.size[0]];e?e.push(t):this._tileTextures[t.size[0]]=[t]}getTileTexture(t){const e=this._tileTextures[t];return e&&e.length>0?e.pop():null}isPatternMissing(t){if(!t)return!1;if(!t.from||!t.to)return!0;const e=this.imageManager.getPattern(t.from.toString()),i=this.imageManager.getPattern(t.to.toString());return!e||!i}useProgram(t,e){this.cache=this.cache||{};const i=t+(e?e.cacheKey:"")+(this._showOverdrawInspector?"/overdraw":"")+(this.style.map.terrain?"/terrain":"");return this.cache[i]||(this.cache[i]=new ve(this.context,fe[t],e,Ze[t],this._showOverdrawInspector,this.style.map.terrain)),this.cache[i]}setCustomLayerDefaults(){this.context.unbindVAO(),this.context.cullFace.setDefault(),this.context.activeTexture.setDefault(),this.context.pixelStoreUnpack.setDefault(),this.context.pixelStoreUnpackPremultiplyAlpha.setDefault(),this.context.pixelStoreUnpackFlipY.setDefault()}setBaseState(){const t=this.context.gl;this.context.cullFace.set(!1),this.context.viewport.set([0,0,this.width,this.height]),this.context.blendEquation.set(t.FUNC_ADD)}initDebugOverlayCanvas(){null==this.debugOverlayCanvas&&(this.debugOverlayCanvas=document.createElement("canvas"),this.debugOverlayCanvas.width=512,this.debugOverlayCanvas.height=512,this.debugOverlayTexture=new x(this.context,this.debugOverlayCanvas,this.context.gl.RGBA))}destroy(){this.debugOverlayTexture&&this.debugOverlayTexture.destroy()}overLimit(){const{drawingBufferWidth:t,drawingBufferHeight:e}=this.context.gl;return this.width!==t||this.height!==e}}class vr{constructor(t,e){this.points=t,this.planes=e}static fromInvProjectionMatrix(t,i,r){const n=Math.pow(2,r),o=[[-1,1,-1,1],[1,1,-1,1],[1,-1,-1,1],[-1,-1,-1,1],[-1,1,1,1],[1,1,1,1],[1,-1,1,1],[-1,-1,1,1]].map((r=>{const o=1/(r=e.af([],r,t))[3]/i*n;return e.b1(r,r,[o,o,1/r[3],o])})),a=[[0,1,2],[6,5,4],[0,3,7],[2,1,5],[3,2,6],[0,4,5]].map((t=>{const e=function(t,e){var i=e[0],r=e[1],n=e[2],o=i*i+r*r+n*n;return o>0&&(o=1/Math.sqrt(o)),t[0]=e[0]*o,t[1]=e[1]*o,t[2]=e[2]*o,t}([],function(t,e,i){var r=e[0],n=e[1],o=e[2],a=i[0],s=i[1],l=i[2];return t[0]=n*l-o*s,t[1]=o*a-r*l,t[2]=r*s-n*a,t}([],y([],o[t[0]],o[t[1]]),y([],o[t[2]],o[t[1]]))),i=-((r=e)[0]*(n=o[t[1]])[0]+r[1]*n[1]+r[2]*n[2]);var r,n;return e.concat(i)}));return new vr(o,a)}}class br{constructor(t,e){this.min=t,this.max=e,this.center=function(t,e){return t[0]=.5*e[0],t[1]=.5*e[1],t[2]=.5*e[2],t}([],function(t,e,i){return t[0]=e[0]+i[0],t[1]=e[1]+i[1],t[2]=e[2]+i[2],t}([],this.min,this.max))}quadrant(t){const e=[t%2==0,t<2],i=m(this.min),r=m(this.max);for(let n=0;n<e.length;n++)i[n]=e[n]?this.min[n]:this.center[n],r[n]=e[n]?this.center[n]:this.max[n];return r[2]=this.max[2],new br(i,r)}distanceX(t){return Math.max(Math.min(this.max[0],t[0]),this.min[0])-t[0]}distanceY(t){return Math.max(Math.min(this.max[1],t[1]),this.min[1])-t[1]}intersects(t){const i=[[this.min[0],this.min[1],this.min[2],1],[this.max[0],this.min[1],this.min[2],1],[this.max[0],this.max[1],this.min[2],1],[this.min[0],this.max[1],this.min[2],1],[this.min[0],this.min[1],this.max[2],1],[this.max[0],this.min[1],this.max[2],1],[this.max[0],this.max[1],this.max[2],1],[this.min[0],this.max[1],this.max[2],1]];let r=!0;for(let n=0;n<t.planes.length;n++){const o=t.planes[n];let a=0;for(let t=0;t<i.length;t++)e.b2(o,i[t])>=0&&a++;if(0===a)return 0;a!==i.length&&(r=!1)}if(r)return 2;for(let e=0;e<3;e++){let i=Number.MAX_VALUE,r=-Number.MAX_VALUE;for(let n=0;n<t.points.length;n++){const o=t.points[n][e]-this.min[e];i=Math.min(i,o),r=Math.max(r,o)}if(r<0||i>this.max[e]-this.min[e])return 0}return 1}}class xr{constructor(t=0,e=0,i=0,r=0){if(isNaN(t)||t<0||isNaN(e)||e<0||isNaN(i)||i<0||isNaN(r)||r<0)throw new Error("Invalid value for edge-insets, top, bottom, left and right must all be numbers");this.top=t,this.bottom=e,this.left=i,this.right=r}interpolate(t,i,r){return null!=i.top&&null!=t.top&&(this.top=e.y.number(t.top,i.top,r)),null!=i.bottom&&null!=t.bottom&&(this.bottom=e.y.number(t.bottom,i.bottom,r)),null!=i.left&&null!=t.left&&(this.left=e.y.number(t.left,i.left,r)),null!=i.right&&null!=t.right&&(this.right=e.y.number(t.right,i.right,r)),this}getCenter(t,i){const r=e.ac((this.left+t-this.right)/2,0,t),n=e.ac((this.top+i-this.bottom)/2,0,i);return new e.P(r,n)}equals(t){return this.top===t.top&&this.bottom===t.bottom&&this.left===t.left&&this.right===t.right}clone(){return new xr(this.top,this.bottom,this.left,this.right)}toJSON(){return{top:this.top,bottom:this.bottom,left:this.left,right:this.right}}}const wr=85.051129;class kr{constructor(t,i,r,n,o){this.tileSize=512,this._renderWorldCopies=void 0===o||!!o,this._minZoom=t||0,this._maxZoom=i||22,this._minPitch=null==r?0:r,this._maxPitch=null==n?60:n,this.setMaxBounds(),this.width=0,this.height=0,this._center=new e.N(0,0),this._elevation=0,this.zoom=0,this.angle=0,this._fov=.6435011087932844,this._pitch=0,this._unmodified=!0,this._edgeInsets=new xr,this._posMatrixCache={},this._alignedPosMatrixCache={},this._fogMatrixCache={},this.minElevationForCurrentTile=0}clone(){const t=new kr(this._minZoom,this._maxZoom,this._minPitch,this.maxPitch,this._renderWorldCopies);return t.apply(this),t}apply(t){this.tileSize=t.tileSize,this.latRange=t.latRange,this.lngRange=t.lngRange,this.width=t.width,this.height=t.height,this._center=t._center,this._elevation=t._elevation,this.minElevationForCurrentTile=t.minElevationForCurrentTile,this.zoom=t.zoom,this.angle=t.angle,this._fov=t._fov,this._pitch=t._pitch,this._unmodified=t._unmodified,this._edgeInsets=t._edgeInsets.clone(),this._calcMatrices()}get minZoom(){return this._minZoom}set minZoom(t){this._minZoom!==t&&(this._minZoom=t,this.zoom=Math.max(this.zoom,t))}get maxZoom(){return this._maxZoom}set maxZoom(t){this._maxZoom!==t&&(this._maxZoom=t,this.zoom=Math.min(this.zoom,t))}get minPitch(){return this._minPitch}set minPitch(t){this._minPitch!==t&&(this._minPitch=t,this.pitch=Math.max(this.pitch,t))}get maxPitch(){return this._maxPitch}set maxPitch(t){this._maxPitch!==t&&(this._maxPitch=t,this.pitch=Math.min(this.pitch,t))}get renderWorldCopies(){return this._renderWorldCopies}set renderWorldCopies(t){void 0===t?t=!0:null===t&&(t=!1),this._renderWorldCopies=t}get worldSize(){return this.tileSize*this.scale}get centerOffset(){return this.centerPoint._sub(this.size._div(2))}get size(){return new e.P(this.width,this.height)}get bearing(){return-this.angle/Math.PI*180}set bearing(t){const i=-e.b3(t,-180,180)*Math.PI/180;this.angle!==i&&(this._unmodified=!1,this.angle=i,this._calcMatrices(),this.rotationMatrix=function(){var t=new e.A(4);return e.A!=Float32Array&&(t[1]=0,t[2]=0),t[0]=1,t[3]=1,t}(),function(t,e,i){var r=e[0],n=e[1],o=e[2],a=e[3],s=Math.sin(i),l=Math.cos(i);t[0]=r*l+o*s,t[1]=n*l+a*s,t[2]=r*-s+o*l,t[3]=n*-s+a*l}(this.rotationMatrix,this.rotationMatrix,this.angle))}get pitch(){return this._pitch/Math.PI*180}set pitch(t){const i=e.ac(t,this.minPitch,this.maxPitch)/180*Math.PI;this._pitch!==i&&(this._unmodified=!1,this._pitch=i,this._calcMatrices())}get fov(){return this._fov/Math.PI*180}set fov(t){t=Math.max(.01,Math.min(60,t)),this._fov!==t&&(this._unmodified=!1,this._fov=t/180*Math.PI,this._calcMatrices())}get zoom(){return this._zoom}set zoom(t){const e=Math.min(Math.max(t,this.minZoom),this.maxZoom);this._zoom!==e&&(this._unmodified=!1,this._zoom=e,this.tileZoom=Math.max(0,Math.floor(e)),this.scale=this.zoomScale(e),this._constrain(),this._calcMatrices())}get center(){return this._center}set center(t){t.lat===this._center.lat&&t.lng===this._center.lng||(this._unmodified=!1,this._center=t,this._constrain(),this._calcMatrices())}get elevation(){return this._elevation}set elevation(t){t!==this._elevation&&(this._elevation=t,this._constrain(),this._calcMatrices())}get padding(){return this._edgeInsets.toJSON()}set padding(t){this._edgeInsets.equals(t)||(this._unmodified=!1,this._edgeInsets.interpolate(this._edgeInsets,t,1),this._calcMatrices())}get centerPoint(){return this._edgeInsets.getCenter(this.width,this.height)}isPaddingEqual(t){return this._edgeInsets.equals(t)}interpolatePadding(t,e,i){this._unmodified=!1,this._edgeInsets.interpolate(t,e,i),this._constrain(),this._calcMatrices()}coveringZoomLevel(t){const e=(t.roundZoom?Math.round:Math.floor)(this.zoom+this.scaleZoom(this.tileSize/t.tileSize));return Math.max(0,e)}getVisibleUnwrappedCoordinates(t){const i=[new e.b4(0,t)];if(this._renderWorldCopies){const r=this.pointCoordinate(new e.P(0,0)),n=this.pointCoordinate(new e.P(this.width,0)),o=this.pointCoordinate(new e.P(this.width,this.height)),a=this.pointCoordinate(new e.P(0,this.height)),s=Math.floor(Math.min(r.x,n.x,o.x,a.x)),l=Math.floor(Math.max(r.x,n.x,o.x,a.x)),c=1;for(let u=s-c;u<=l+c;u++)0!==u&&i.push(new e.b4(u,t))}return i}coveringTiles(t){var i,r;let n=this.coveringZoomLevel(t);const o=n;if(void 0!==t.minzoom&&n<t.minzoom)return[];void 0!==t.maxzoom&&n>t.maxzoom&&(n=t.maxzoom);const a=this.pointCoordinate(this.getCameraPoint()),s=e.Z.fromLngLat(this.center),l=Math.pow(2,n),c=[l*a.x,l*a.y,0],u=[l*s.x,l*s.y,0],h=vr.fromInvProjectionMatrix(this.invModelViewProjectionMatrix,this.worldSize,n);let d=t.minzoom||0;!t.terrain&&this.pitch<=60&&this._edgeInsets.top<.1&&(d=n);const p=t.terrain?2/Math.min(this.tileSize,t.tileSize)*this.tileSize:3,f=t=>({aabb:new br([t*l,0,0],[(t+1)*l,l,0]),zoom:0,x:0,y:0,wrap:t,fullyVisible:!1}),m=[],g=[],y=n,v=t.reparseOverscaled?o:n;if(this._renderWorldCopies)for(let e=1;e<=3;e++)m.push(f(-e)),m.push(f(e));for(m.push(f(0));m.length>0;){const n=m.pop(),o=n.x,a=n.y;let s=n.fullyVisible;if(!s){const t=n.aabb.intersects(h);if(0===t)continue;s=2===t}const l=t.terrain?c:u,f=n.aabb.distanceX(l),b=n.aabb.distanceY(l),x=Math.max(Math.abs(f),Math.abs(b));if(n.zoom===y||x>p+(1<<y-n.zoom)-2&&n.zoom>=d){const t=y-n.zoom,i=c[0]-.5-(o<<t),r=c[1]-.5-(a<<t);g.push({tileID:new e.S(n.zoom===y?v:n.zoom,n.wrap,n.zoom,o,a),distanceSq:_([u[0]-.5-o,u[1]-.5-a]),tileDistanceToCamera:Math.sqrt(i*i+r*r)})}else for(let c=0;c<4;c++){const l=(o<<1)+c%2,u=(a<<1)+(c>>1),h=n.zoom+1;let d=n.aabb.quadrant(c);if(t.terrain){const o=new e.S(h,n.wrap,h,l,u),a=t.terrain.getMinMaxElevation(o),s=null!==(i=a.minElevation)&&void 0!==i?i:this.elevation,c=null!==(r=a.maxElevation)&&void 0!==r?r:this.elevation;d=new br([d.min[0],d.min[1],s],[d.max[0],d.max[1],c])}m.push({aabb:d,zoom:h,x:l,y:u,wrap:n.wrap,fullyVisible:s})}}return g.sort(((t,e)=>t.distanceSq-e.distanceSq)).map((t=>t.tileID))}resize(t,e){this.width=t,this.height=e,this.pixelsToGLUnits=[2/t,-2/e],this._constrain(),this._calcMatrices()}get unmodified(){return this._unmodified}zoomScale(t){return Math.pow(2,t)}scaleZoom(t){return Math.log(t)/Math.LN2}project(t){const i=e.ac(t.lat,-85.051129,wr);return new e.P(e.O(t.lng)*this.worldSize,e.Q(i)*this.worldSize)}unproject(t){return new e.Z(t.x/this.worldSize,t.y/this.worldSize).toLngLat()}get point(){return this.project(this.center)}getCameraPosition(){return{lngLat:this.pointLocation(this.getCameraPoint()),altitude:Math.cos(this._pitch)*this.cameraToCenterDistance/this._pixelPerMeter+this.elevation}}recalculateZoom(t){const i=this.elevation,r=Math.cos(this._pitch)*this.cameraToCenterDistance/this._pixelPerMeter,n=this.pointLocation(this.centerPoint,t),o=t.getElevationForLngLatZoom(n,this.tileZoom);if(!(this.elevation-o))return;const a=r+i-o,s=Math.cos(this._pitch)*this.cameraToCenterDistance/a/e.b5(1,n.lat),l=this.scaleZoom(s/this.tileSize);this._elevation=o,this._center=n,this.zoom=l}setLocationAtPoint(t,i){const r=this.pointCoordinate(i),n=this.pointCoordinate(this.centerPoint),o=this.locationCoordinate(t),a=new e.Z(o.x-(r.x-n.x),o.y-(r.y-n.y));this.center=this.coordinateLocation(a),this._renderWorldCopies&&(this.center=this.center.wrap())}locationPoint(t,e){return e?this.coordinatePoint(this.locationCoordinate(t),e.getElevationForLngLatZoom(t,this.tileZoom),this.pixelMatrix3D):this.coordinatePoint(this.locationCoordinate(t))}pointLocation(t,e){return this.coordinateLocation(this.pointCoordinate(t,e))}locationCoordinate(t){return e.Z.fromLngLat(t)}coordinateLocation(t){return t&&t.toLngLat()}pointCoordinate(t,i){if(i){const e=i.pointCoordinate(t);if(null!=e)return e}const r=[t.x,t.y,0,1],n=[t.x,t.y,1,1];e.af(r,r,this.pixelMatrixInverse),e.af(n,n,this.pixelMatrixInverse);const o=r[3],a=n[3],s=r[1]/o,l=n[1]/a,c=r[2]/o,u=n[2]/a,h=c===u?0:(0-c)/(u-c);return new e.Z(e.y.number(r[0]/o,n[0]/a,h)/this.worldSize,e.y.number(s,l,h)/this.worldSize)}coordinatePoint(t,i=0,r=this.pixelMatrix){const n=[t.x*this.worldSize,t.y*this.worldSize,i,1];return e.af(n,n,r),new e.P(n[0]/n[3],n[1]/n[3])}getBounds(){const t=Math.max(0,this.height/2-this.getHorizon());return(new H).extend(this.pointLocation(new e.P(0,t))).extend(this.pointLocation(new e.P(this.width,t))).extend(this.pointLocation(new e.P(this.width,this.height))).extend(this.pointLocation(new e.P(0,this.height)))}getMaxBounds(){return this.latRange&&2===this.latRange.length&&this.lngRange&&2===this.lngRange.length?new H([this.lngRange[0],this.latRange[0]],[this.lngRange[1],this.latRange[1]]):null}getHorizon(){return Math.tan(Math.PI/2-this._pitch)*this.cameraToCenterDistance*.85}setMaxBounds(t){t?(this.lngRange=[t.getWest(),t.getEast()],this.latRange=[t.getSouth(),t.getNorth()],this._constrain()):(this.lngRange=null,this.latRange=[-85.051129,wr])}calculateTileMatrix(t){const i=t.canonical,r=this.worldSize/this.zoomScale(i.z),n=i.x+Math.pow(2,i.z)*t.wrap,o=e.an(new Float64Array(16));return e.J(o,o,[n*r,i.y*r,0]),e.K(o,o,[r/e.X,r/e.X,1]),o}calculatePosMatrix(t,i=!1){const r=t.key,n=i?this._alignedPosMatrixCache:this._posMatrixCache;if(n[r])return n[r];const o=this.calculateTileMatrix(t);return e.L(o,i?this.alignedModelViewProjectionMatrix:this.modelViewProjectionMatrix,o),n[r]=new Float32Array(o),n[r]}calculateFogMatrix(t){const i=t.key,r=this._fogMatrixCache;if(r[i])return r[i];const n=this.calculateTileMatrix(t);return e.L(n,this.fogMatrix,n),r[i]=new Float32Array(n),r[i]}customLayerMatrix(){return this.mercatorMatrix.slice()}getConstrained(t,i){i=e.ac(+i,this.minZoom,this.maxZoom);const r={center:new e.N(t.lng,t.lat),zoom:i};let n=this.lngRange;this._renderWorldCopies||null!==n||(n=[-179.9999999999,180-1e-10]);const o=this.tileSize*this.zoomScale(r.zoom);let a=0,s=o,l=0,c=o,u=0,h=0;const{x:d,y:p}=this.size;if(this.latRange){const t=this.latRange;a=e.Q(t[1])*o,s=e.Q(t[0])*o,s-a<p&&(u=p/(s-a))}n&&(l=e.b3(e.O(n[0])*o,0,o),c=e.b3(e.O(n[1])*o,0,o),c<l&&(c+=o),c-l<d&&(h=d/(c-l)));const{x:f,y:m}=this.project.call({worldSize:o},t);let g,y;const _=Math.max(h||0,u||0);if(_){const t=new e.P(h?(c+l)/2:f,u?(s+a)/2:m);return r.center=this.unproject.call({worldSize:o},t).wrap(),r.zoom+=this.scaleZoom(_),r}if(this.latRange){const t=p/2;m-t<a&&(y=a+t),m+t>s&&(y=s-t)}if(n){const t=(l+c)/2;let i=f;this._renderWorldCopies&&(i=e.b3(f,t-o/2,t+o/2));const r=d/2;i-r<l&&(g=l+r),i+r>c&&(g=c-r)}if(void 0!==g||void 0!==y){const t=new e.P(null!=g?g:f,null!=y?y:m);r.center=this.unproject.call({worldSize:o},t).wrap()}return r}_constrain(){if(!this.center||!this.width||!this.height||this._constraining)return;this._constraining=!0;const t=this._unmodified,{center:e,zoom:i}=this.getConstrained(this.center,this.zoom);this.center=e,this.zoom=i,this._unmodified=t,this._constraining=!1}_calcMatrices(){if(!this.height)return;const t=this.centerOffset,i=this.point.x,r=this.point.y;this.cameraToCenterDistance=.5/Math.tan(this._fov/2)*this.height,this._pixelPerMeter=e.b5(1,this.center.lat)*this.worldSize;let n=e.an(new Float64Array(16));e.K(n,n,[this.width/2,-this.height/2,1]),e.J(n,n,[1,-1,0]),this.labelPlaneMatrix=n,n=e.an(new Float64Array(16)),e.K(n,n,[1,-1,1]),e.J(n,n,[-1,-1,0]),e.K(n,n,[2/this.width,2/this.height,1]),this.glCoordMatrix=n;const o=this.cameraToCenterDistance+this._elevation*this._pixelPerMeter/Math.cos(this._pitch),a=Math.min(this.elevation,this.minElevationForCurrentTile),s=o-a*this._pixelPerMeter/Math.cos(this._pitch),l=a<0?s:o,c=Math.PI/2+this._pitch,u=this._fov*(.5+t.y/this.height),h=Math.sin(u)*l/Math.sin(e.ac(Math.PI-c-u,.01,Math.PI-.01)),d=this.getHorizon(),p=2*Math.atan(d/this.cameraToCenterDistance)*(.5+t.y/(2*d)),f=Math.sin(p)*l/Math.sin(e.ac(Math.PI-c-p,.01,Math.PI-.01)),m=Math.min(h,f);this.farZ=1.01*(Math.cos(Math.PI/2-this._pitch)*m+l),this.nearZ=this.height/50,n=new Float64Array(16),e.b6(n,this._fov,this.width/this.height,this.nearZ,this.farZ),n[8]=2*-t.x/this.width,n[9]=2*t.y/this.height,this.projectionMatrix=e.ae(n),e.K(n,n,[1,-1,1]),e.J(n,n,[0,0,-this.cameraToCenterDistance]),e.b7(n,n,this._pitch),e.ad(n,n,this.angle),e.J(n,n,[-i,-r,0]),this.mercatorMatrix=e.K([],n,[this.worldSize,this.worldSize,this.worldSize]),e.K(n,n,[1,1,this._pixelPerMeter]),this.pixelMatrix=e.L(new Float64Array(16),this.labelPlaneMatrix,n),e.J(n,n,[0,0,-this.elevation]),this.modelViewProjectionMatrix=n,this.invModelViewProjectionMatrix=e.as([],n),this.fogMatrix=new Float64Array(16),e.b6(this.fogMatrix,this._fov,this.width/this.height,o,this.farZ),this.fogMatrix[8]=2*-t.x/this.width,this.fogMatrix[9]=2*t.y/this.height,e.K(this.fogMatrix,this.fogMatrix,[1,-1,1]),e.J(this.fogMatrix,this.fogMatrix,[0,0,-this.cameraToCenterDistance]),e.b7(this.fogMatrix,this.fogMatrix,this._pitch),e.ad(this.fogMatrix,this.fogMatrix,this.angle),e.J(this.fogMatrix,this.fogMatrix,[-i,-r,0]),e.K(this.fogMatrix,this.fogMatrix,[1,1,this._pixelPerMeter]),e.J(this.fogMatrix,this.fogMatrix,[0,0,-this.elevation]),this.pixelMatrix3D=e.L(new Float64Array(16),this.labelPlaneMatrix,n);const g=this.width%2/2,y=this.height%2/2,_=Math.cos(this.angle),v=Math.sin(this.angle),b=i-Math.round(i)+_*g+v*y,x=r-Math.round(r)+_*y+v*g,w=new Float64Array(n);if(e.J(w,w,[b>.5?b-1:b,x>.5?x-1:x,0]),this.alignedModelViewProjectionMatrix=w,n=e.as(new Float64Array(16),this.pixelMatrix),!n)throw new Error("failed to invert matrix");this.pixelMatrixInverse=n,this._posMatrixCache={},this._alignedPosMatrixCache={},this._fogMatrixCache={}}maxPitchScaleFactor(){if(!this.pixelMatrixInverse)return 1;const t=this.pointCoordinate(new e.P(0,0)),i=[t.x*this.worldSize,t.y*this.worldSize,0,1];return e.af(i,i,this.pixelMatrix)[3]/this.cameraToCenterDistance}getCameraPoint(){const t=Math.tan(this._pitch)*(this.cameraToCenterDistance||1);return this.centerPoint.add(new e.P(0,t))}getCameraQueryGeometry(t){const i=this.getCameraPoint();if(1===t.length)return[t[0],i];{let r=i.x,n=i.y,o=i.x,a=i.y;for(const e of t)r=Math.min(r,e.x),n=Math.min(n,e.y),o=Math.max(o,e.x),a=Math.max(a,e.y);return[new e.P(r,n),new e.P(o,n),new e.P(o,a),new e.P(r,a),new e.P(r,n)]}}lngLatToCameraDepth(t,i){const r=this.locationCoordinate(t),n=[r.x*this.worldSize,r.y*this.worldSize,i,1];return e.af(n,n,this.modelViewProjectionMatrix),n[2]/n[3]}}function Er(t,e){let i,r=!1,n=null,o=null;const a=()=>{n=null,r&&(t.apply(o,i),n=setTimeout(a,e),r=!1)};return(...t)=>(r=!0,o=this,i=t,n||a(),n)}class Sr{constructor(t){this._getCurrentHash=()=>{const t=window.location.hash.replace("#","");if(this._hashName){let e;return t.split("&").map((t=>t.split("="))).forEach((t=>{t[0]===this._hashName&&(e=t)})),(e&&e[1]||"").split("/")}return t.split("/")},this._onHashChange=()=>{const t=this._getCurrentHash();if(t.length>=3&&!t.some((t=>isNaN(t)))){const e=this._map.dragRotate.isEnabled()&&this._map.touchZoomRotate.isEnabled()?+(t[3]||0):this._map.getBearing();return this._map.jumpTo({center:[+t[2],+t[1]],zoom:+t[0],bearing:e,pitch:+(t[4]||0)}),!0}return!1},this._updateHashUnthrottled=()=>{const t=window.location.href.replace(/(#.*)?$/,this.getHashString());window.history.replaceState(window.history.state,null,t)},this._removeHash=()=>{const t=this._getCurrentHash();if(0===t.length)return;const e=t.join("/");let i=e;i.split("&").length>0&&(i=i.split("&")[0]),this._hashName&&(i=`${this._hashName}=${e}`);let r=window.location.hash.replace(i,"");r.startsWith("#&")?r=r.slice(0,1)+r.slice(2):"#"===r&&(r="");let n=window.location.href.replace(/(#.+)?$/,r);n=n.replace("&&","&"),window.history.replaceState(window.history.state,null,n)},this._updateHash=Er(this._updateHashUnthrottled,300),this._hashName=t&&encodeURIComponent(t)}addTo(t){return this._map=t,addEventListener("hashchange",this._onHashChange,!1),this._map.on("moveend",this._updateHash),this}remove(){return removeEventListener("hashchange",this._onHashChange,!1),this._map.off("moveend",this._updateHash),clearTimeout(this._updateHash()),this._removeHash(),delete this._map,this}getHashString(t){const e=this._map.getCenter(),i=Math.round(100*this._map.getZoom())/100,r=Math.ceil((i*Math.LN2+Math.log(512/360/.5))/Math.LN10),n=Math.pow(10,r),o=Math.round(e.lng*n)/n,a=Math.round(e.lat*n)/n,s=this._map.getBearing(),l=this._map.getPitch();let c="";if(c+=t?`/${o}/${a}/${i}`:`${i}/${a}/${o}`,(s||l)&&(c+="/"+Math.round(10*s)/10),l&&(c+=`/${Math.round(l)}`),this._hashName){const t=this._hashName;let e=!1;const i=window.location.hash.slice(1).split("&").map((i=>{const r=i.split("=")[0];return r===t?(e=!0,`${r}=${c}`):i})).filter((t=>t));return e||i.push(`${t}=${c}`),`#${i.join("&")}`}return`#${c}`}}const Ir={linearity:.3,easing:e.b8(0,0,.3,1)},Cr=e.e({deceleration:2500,maxSpeed:1400},Ir),Tr=e.e({deceleration:20,maxSpeed:1400},Ir),Ar=e.e({deceleration:1e3,maxSpeed:360},Ir),Pr=e.e({deceleration:1e3,maxSpeed:90},Ir);class Mr{constructor(t){this._map=t,this.clear()}clear(){this._inertiaBuffer=[]}record(t){this._drainInertiaBuffer(),this._inertiaBuffer.push({time:o.now(),settings:t})}_drainInertiaBuffer(){const t=this._inertiaBuffer,e=o.now();for(;t.length>0&&e-t[0].time>160;)t.shift()}_onMoveEnd(t){if(this._drainInertiaBuffer(),this._inertiaBuffer.length<2)return;const i={zoom:0,bearing:0,pitch:0,pan:new e.P(0,0),pinchAround:void 0,around:void 0};for(const{settings:e}of this._inertiaBuffer)i.zoom+=e.zoomDelta||0,i.bearing+=e.bearingDelta||0,i.pitch+=e.pitchDelta||0,e.panDelta&&i.pan._add(e.panDelta),e.around&&(i.around=e.around),e.pinchAround&&(i.pinchAround=e.pinchAround);const r=this._inertiaBuffer[this._inertiaBuffer.length-1].time-this._inertiaBuffer[0].time,n={};if(i.pan.mag()){const o=zr(i.pan.mag(),r,e.e({},Cr,t||{}));n.offset=i.pan.mult(o.amount/i.pan.mag()),n.center=this._map.transform.center,Lr(n,o)}if(i.zoom){const t=zr(i.zoom,r,Tr);n.zoom=this._map.transform.zoom+t.amount,Lr(n,t)}if(i.bearing){const t=zr(i.bearing,r,Ar);n.bearing=this._map.transform.bearing+e.ac(t.amount,-179,179),Lr(n,t)}if(i.pitch){const t=zr(i.pitch,r,Pr);n.pitch=this._map.transform.pitch+t.amount,Lr(n,t)}if(n.zoom||n.bearing){const t=void 0===i.pinchAround?i.around:i.pinchAround;n.around=t?this._map.unproject(t):this._map.getCenter()}return this.clear(),e.e(n,{noMoveStart:!0})}}function Lr(t,e){(!t.duration||t.duration<e.duration)&&(t.duration=e.duration,t.easing=e.easing)}function zr(t,i,r){const{maxSpeed:n,linearity:o,deceleration:a}=r,s=e.ac(t*o/(i/1e3),-n,n),l=Math.abs(s)/(a*o);return{easing:r.easing,duration:1e3*l,amount:s*(l/2)}}class Dr extends e.k{preventDefault(){this._defaultPrevented=!0}get defaultPrevented(){return this._defaultPrevented}constructor(t,i,r,n={}){const o=a.mousePos(i.getCanvas(),r),s=i.unproject(o);super(t,e.e({point:o,lngLat:s,originalEvent:r},n)),this._defaultPrevented=!1,this.target=i}}class Rr extends e.k{preventDefault(){this._defaultPrevented=!0}get defaultPrevented(){return this._defaultPrevented}constructor(t,i,r){const n="touchend"===t?r.changedTouches:r.touches,o=a.touchPos(i.getCanvasContainer(),n),s=o.map((t=>i.unproject(t))),l=o.reduce(((t,e,i,r)=>t.add(e.div(r.length))),new e.P(0,0));super(t,{points:o,point:l,lngLats:s,lngLat:i.unproject(l),originalEvent:r}),this._defaultPrevented=!1}}class Or extends e.k{preventDefault(){this._defaultPrevented=!0}get defaultPrevented(){return this._defaultPrevented}constructor(t,e,i){super(t,{originalEvent:i}),this._defaultPrevented=!1}}class Fr{constructor(t,e){this._map=t,this._clickTolerance=e.clickTolerance}reset(){delete this._mousedownPos}wheel(t){return this._firePreventable(new Or(t.type,this._map,t))}mousedown(t,e){return this._mousedownPos=e,this._firePreventable(new Dr(t.type,this._map,t))}mouseup(t){this._map.fire(new Dr(t.type,this._map,t))}click(t,e){this._mousedownPos&&this._mousedownPos.dist(e)>=this._clickTolerance||this._map.fire(new Dr(t.type,this._map,t))}dblclick(t){return this._firePreventable(new Dr(t.type,this._map,t))}mouseover(t){this._map.fire(new Dr(t.type,this._map,t))}mouseout(t){this._map.fire(new Dr(t.type,this._map,t))}touchstart(t){return this._firePreventable(new Rr(t.type,this._map,t))}touchmove(t){this._map.fire(new Rr(t.type,this._map,t))}touchend(t){this._map.fire(new Rr(t.type,this._map,t))}touchcancel(t){this._map.fire(new Rr(t.type,this._map,t))}_firePreventable(t){if(this._map.fire(t),t.defaultPrevented)return{}}isEnabled(){return!0}isActive(){return!1}enable(){}disable(){}}class Br{constructor(t){this._map=t}reset(){this._delayContextMenu=!1,this._ignoreContextMenu=!0,delete this._contextMenuEvent}mousemove(t){this._map.fire(new Dr(t.type,this._map,t))}mousedown(){this._delayContextMenu=!0,this._ignoreContextMenu=!1}mouseup(){this._delayContextMenu=!1,this._contextMenuEvent&&(this._map.fire(new Dr("contextmenu",this._map,this._contextMenuEvent)),delete this._contextMenuEvent)}contextmenu(t){this._delayContextMenu?this._contextMenuEvent=t:this._ignoreContextMenu||this._map.fire(new Dr(t.type,this._map,t)),this._map.listens("contextmenu")&&t.preventDefault()}isEnabled(){return!0}isActive(){return!1}enable(){}disable(){}}class Nr{constructor(t){this._map=t}get transform(){return this._map._requestedCameraState||this._map.transform}get center(){return{lng:this.transform.center.lng,lat:this.transform.center.lat}}get zoom(){return this.transform.zoom}get pitch(){return this.transform.pitch}get bearing(){return this.transform.bearing}unproject(t){return this.transform.pointLocation(e.P.convert(t),this._map.terrain)}}class jr{constructor(t,e){this._map=t,this._tr=new Nr(t),this._el=t.getCanvasContainer(),this._container=t.getContainer(),this._clickTolerance=e.clickTolerance||1}isEnabled(){return!!this._enabled}isActive(){return!!this._active}enable(){this.isEnabled()||(this._enabled=!0)}disable(){this.isEnabled()&&(this._enabled=!1)}mousedown(t,e){this.isEnabled()&&t.shiftKey&&0===t.button&&(a.disableDrag(),this._startPos=this._lastPos=e,this._active=!0)}mousemoveWindow(t,e){if(!this._active)return;const i=e;if(this._lastPos.equals(i)||!this._box&&i.dist(this._startPos)<this._clickTolerance)return;const r=this._startPos;this._lastPos=i,this._box||(this._box=a.create("div","maplibregl-boxzoom",this._container),this._container.classList.add("maplibregl-crosshair"),this._fireEvent("boxzoomstart",t));const n=Math.min(r.x,i.x),o=Math.max(r.x,i.x),s=Math.min(r.y,i.y),l=Math.max(r.y,i.y);a.setTransform(this._box,`translate(${n}px,${s}px)`),this._box.style.width=o-n+"px",this._box.style.height=l-s+"px"}mouseupWindow(t,i){if(!this._active)return;if(0!==t.button)return;const r=this._startPos,n=i;if(this.reset(),a.suppressClick(),r.x!==n.x||r.y!==n.y)return this._map.fire(new e.k("boxzoomend",{originalEvent:t})),{cameraAnimation:t=>t.fitScreenCoordinates(r,n,this._tr.bearing,{linear:!0})};this._fireEvent("boxzoomcancel",t)}keydown(t){this._active&&27===t.keyCode&&(this.reset(),this._fireEvent("boxzoomcancel",t))}reset(){this._active=!1,this._container.classList.remove("maplibregl-crosshair"),this._box&&(a.remove(this._box),this._box=null),a.enableDrag(),delete this._startPos,delete this._lastPos}_fireEvent(t,i){return this._map.fire(new e.k(t,{originalEvent:i}))}}function Vr(t,e){if(t.length!==e.length)throw new Error(`The number of touches and points are not equal - touches ${t.length}, points ${e.length}`);const i={};for(let r=0;r<t.length;r++)i[t[r].identifier]=e[r];return i}class Ur{constructor(t){this.reset(),this.numTouches=t.numTouches}reset(){delete this.centroid,delete this.startTime,delete this.touches,this.aborted=!1}touchstart(t,i,r){(this.centroid||r.length>this.numTouches)&&(this.aborted=!0),this.aborted||(void 0===this.startTime&&(this.startTime=t.timeStamp),r.length===this.numTouches&&(this.centroid=function(t){const i=new e.P(0,0);for(const e of t)i._add(e);return i.div(t.length)}(i),this.touches=Vr(r,i)))}touchmove(t,e,i){if(this.aborted||!this.centroid)return;const r=Vr(i,e);for(const n in this.touches){const t=r[n];(!t||t.dist(this.touches[n])>30)&&(this.aborted=!0)}}touchend(t,e,i){if((!this.centroid||t.timeStamp-this.startTime>500)&&(this.aborted=!0),0===i.length){const t=!this.aborted&&this.centroid;if(this.reset(),t)return t}}}class qr{constructor(t){this.singleTap=new Ur(t),this.numTaps=t.numTaps,this.reset()}reset(){this.lastTime=1/0,delete this.lastTap,this.count=0,this.singleTap.reset()}touchstart(t,e,i){this.singleTap.touchstart(t,e,i)}touchmove(t,e,i){this.singleTap.touchmove(t,e,i)}touchend(t,e,i){const r=this.singleTap.touchend(t,e,i);if(r){const e=t.timeStamp-this.lastTime<500,i=!this.lastTap||this.lastTap.dist(r)<30;if(e&&i||this.reset(),this.count++,this.lastTime=t.timeStamp,this.lastTap=r,this.count===this.numTaps)return this.reset(),r}}}class $r{constructor(t){this._tr=new Nr(t),this._zoomIn=new qr({numTouches:1,numTaps:2}),this._zoomOut=new qr({numTouches:2,numTaps:1}),this.reset()}reset(){this._active=!1,this._zoomIn.reset(),this._zoomOut.reset()}touchstart(t,e,i){this._zoomIn.touchstart(t,e,i),this._zoomOut.touchstart(t,e,i)}touchmove(t,e,i){this._zoomIn.touchmove(t,e,i),this._zoomOut.touchmove(t,e,i)}touchend(t,e,i){const r=this._zoomIn.touchend(t,e,i),n=this._zoomOut.touchend(t,e,i),o=this._tr;return r?(this._active=!0,t.preventDefault(),setTimeout((()=>this.reset()),0),{cameraAnimation:e=>e.easeTo({duration:300,zoom:o.zoom+1,around:o.unproject(r)},{originalEvent:t})}):n?(this._active=!0,t.preventDefault(),setTimeout((()=>this.reset()),0),{cameraAnimation:e=>e.easeTo({duration:300,zoom:o.zoom-1,around:o.unproject(n)},{originalEvent:t})}):void 0}touchcancel(){this.reset()}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}}class Gr{constructor(t){this._enabled=!!t.enable,this._moveStateManager=t.moveStateManager,this._clickTolerance=t.clickTolerance||1,this._moveFunction=t.move,this._activateOnStart=!!t.activateOnStart,t.assignEvents(this),this.reset()}reset(t){this._active=!1,this._moved=!1,delete this._lastPoint,this._moveStateManager.endMove(t)}_move(...t){const e=this._moveFunction(...t);if(e.bearingDelta||e.pitchDelta||e.around||e.panDelta)return this._active=!0,e}dragStart(t,e){this.isEnabled()&&!this._lastPoint&&this._moveStateManager.isValidStartEvent(t)&&(this._moveStateManager.startMove(t),this._lastPoint=e.length?e[0]:e,this._activateOnStart&&this._lastPoint&&(this._active=!0))}dragMove(t,e){if(!this.isEnabled())return;const i=this._lastPoint;if(!i)return;if(t.preventDefault(),!this._moveStateManager.isValidMoveEvent(t))return void this.reset(t);const r=e.length?e[0]:e;return!this._moved&&r.dist(i)<this._clickTolerance?void 0:(this._moved=!0,this._lastPoint=r,this._move(i,r))}dragEnd(t){this.isEnabled()&&this._lastPoint&&this._moveStateManager.isValidEndEvent(t)&&(this._moved&&a.suppressClick(),this.reset(t))}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}getClickTolerance(){return this._clickTolerance}}const Hr={0:1,2:2};class Zr{constructor(t){this._correctEvent=t.checkCorrectEvent}startMove(t){const e=a.mouseButton(t);this._eventButton=e}endMove(t){delete this._eventButton}isValidStartEvent(t){return this._correctEvent(t)}isValidMoveEvent(t){return!function(t,e){const i=Hr[e];return void 0===t.buttons||(t.buttons&i)!==i}(t,this._eventButton)}isValidEndEvent(t){return a.mouseButton(t)===this._eventButton}}class Wr{constructor(){this._firstTouch=void 0}_isOneFingerTouch(t){return 1===t.targetTouches.length}_isSameTouchEvent(t){return t.targetTouches[0].identifier===this._firstTouch}startMove(t){this._firstTouch=t.targetTouches[0].identifier}endMove(t){delete this._firstTouch}isValidStartEvent(t){return this._isOneFingerTouch(t)}isValidMoveEvent(t){return this._isOneFingerTouch(t)&&this._isSameTouchEvent(t)}isValidEndEvent(t){return this._isOneFingerTouch(t)&&this._isSameTouchEvent(t)}}const Xr=t=>{t.mousedown=t.dragStart,t.mousemoveWindow=t.dragMove,t.mouseup=t.dragEnd,t.contextmenu=t=>{t.preventDefault()}},Jr=({enable:t,clickTolerance:e,bearingDegreesPerPixelMoved:i=.8})=>{const r=new Zr({checkCorrectEvent:t=>0===a.mouseButton(t)&&t.ctrlKey||2===a.mouseButton(t)});return new Gr({clickTolerance:e,move:(t,e)=>({bearingDelta:(e.x-t.x)*i}),moveStateManager:r,enable:t,assignEvents:Xr})},Kr=({enable:t,clickTolerance:e,pitchDegreesPerPixelMoved:i=-.5})=>{const r=new Zr({checkCorrectEvent:t=>0===a.mouseButton(t)&&t.ctrlKey||2===a.mouseButton(t)});return new Gr({clickTolerance:e,move:(t,e)=>({pitchDelta:(e.y-t.y)*i}),moveStateManager:r,enable:t,assignEvents:Xr})};class Yr{constructor(t,e){this._clickTolerance=t.clickTolerance||1,this._map=e,this.reset()}reset(){this._active=!1,this._touches={},this._sum=new e.P(0,0)}_shouldBePrevented(t){return t<(this._map.cooperativeGestures.isEnabled()?2:1)}touchstart(t,e,i){return this._calculateTransform(t,e,i)}touchmove(t,e,i){if(this._active){if(!this._shouldBePrevented(i.length))return t.preventDefault(),this._calculateTransform(t,e,i);this._map.cooperativeGestures.notifyGestureBlocked("touch_pan",t)}}touchend(t,e,i){this._calculateTransform(t,e,i),this._active&&this._shouldBePrevented(i.length)&&this.reset()}touchcancel(){this.reset()}_calculateTransform(t,i,r){r.length>0&&(this._active=!0);const n=Vr(r,i),o=new e.P(0,0),a=new e.P(0,0);let s=0;for(const e in n){const t=n[e],i=this._touches[e];i&&(o._add(t),a._add(t.sub(i)),s++,n[e]=t)}if(this._touches=n,this._shouldBePrevented(s)||!a.mag())return;const l=a.div(s);return this._sum._add(l),this._sum.mag()<this._clickTolerance?void 0:{around:o.div(s),panDelta:l}}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}}class Qr{constructor(){this.reset()}reset(){this._active=!1,delete this._firstTwoTouches}touchstart(t,e,i){this._firstTwoTouches||i.length<2||(this._firstTwoTouches=[i[0].identifier,i[1].identifier],this._start([e[0],e[1]]))}touchmove(t,e,i){if(!this._firstTwoTouches)return;t.preventDefault();const[r,n]=this._firstTwoTouches,o=tn(i,e,r),a=tn(i,e,n);if(!o||!a)return;const s=this._aroundCenter?null:o.add(a).div(2);return this._move([o,a],s,t)}touchend(t,e,i){if(!this._firstTwoTouches)return;const[r,n]=this._firstTwoTouches,o=tn(i,e,r),s=tn(i,e,n);o&&s||(this._active&&a.suppressClick(),this.reset())}touchcancel(){this.reset()}enable(t){this._enabled=!0,this._aroundCenter=!!t&&"center"===t.around}disable(){this._enabled=!1,this.reset()}isEnabled(){return!!this._enabled}isActive(){return!!this._active}}function tn(t,e,i){for(let r=0;r<t.length;r++)if(t[r].identifier===i)return e[r]}function en(t,e){return Math.log(t/e)/Math.LN2}class rn extends Qr{reset(){super.reset(),delete this._distance,delete this._startDistance}_start(t){this._startDistance=this._distance=t[0].dist(t[1])}_move(t,e){const i=this._distance;if(this._distance=t[0].dist(t[1]),this._active||!(Math.abs(en(this._distance,this._startDistance))<.1))return this._active=!0,{zoomDelta:en(this._distance,i),pinchAround:e}}}function nn(t,e){return 180*t.angleWith(e)/Math.PI}class on extends Qr{reset(){super.reset(),delete this._minDiameter,delete this._startVector,delete this._vector}_start(t){this._startVector=this._vector=t[0].sub(t[1]),this._minDiameter=t[0].dist(t[1])}_move(t,e,i){const r=this._vector;if(this._vector=t[0].sub(t[1]),this._active||!this._isBelowThreshold(this._vector))return this._active=!0,{bearingDelta:nn(this._vector,r),pinchAround:e}}_isBelowThreshold(t){this._minDiameter=Math.min(this._minDiameter,t.mag());const e=25/(Math.PI*this._minDiameter)*360,i=nn(t,this._startVector);return Math.abs(i)<e}}function an(t){return Math.abs(t.y)>Math.abs(t.x)}class sn extends Qr{constructor(t){super(),this._currentTouchCount=0,this._map=t}reset(){super.reset(),this._valid=void 0,delete this._firstMove,delete this._lastPoints}touchstart(t,e,i){super.touchstart(t,e,i),this._currentTouchCount=i.length}_start(t){this._lastPoints=t,an(t[0].sub(t[1]))&&(this._valid=!1)}_move(t,e,i){if(this._map.cooperativeGestures.isEnabled()&&this._currentTouchCount<3)return;const r=t[0].sub(this._lastPoints[0]),n=t[1].sub(this._lastPoints[1]);return this._valid=this.gestureBeginsVertically(r,n,i.timeStamp),this._valid?(this._lastPoints=t,this._active=!0,{pitchDelta:(r.y+n.y)/2*-.5}):void 0}gestureBeginsVertically(t,e,i){if(void 0!==this._valid)return this._valid;const r=t.mag()>=2,n=e.mag()>=2;if(!r&&!n)return;if(!r||!n)return void 0===this._firstMove&&(this._firstMove=i),i-this._firstMove<100&&void 0;const o=t.y>0==e.y>0;return an(t)&&an(e)&&o}}const ln={panStep:100,bearingStep:15,pitchStep:10};class cn{constructor(t){this._tr=new Nr(t);const e=ln;this._panStep=e.panStep,this._bearingStep=e.bearingStep,this._pitchStep=e.pitchStep,this._rotationDisabled=!1}reset(){this._active=!1}keydown(t){if(t.altKey||t.ctrlKey||t.metaKey)return;let e=0,i=0,r=0,n=0,o=0;switch(t.keyCode){case 61:case 107:case 171:case 187:e=1;break;case 189:case 109:case 173:e=-1;break;case 37:t.shiftKey?i=-1:(t.preventDefault(),n=-1);break;case 39:t.shiftKey?i=1:(t.preventDefault(),n=1);break;case 38:t.shiftKey?r=1:(t.preventDefault(),o=-1);break;case 40:t.shiftKey?r=-1:(t.preventDefault(),o=1);break;default:return}return this._rotationDisabled&&(i=0,r=0),{cameraAnimation:a=>{const s=this._tr;a.easeTo({duration:300,easeId:"keyboardHandler",easing:un,zoom:e?Math.round(s.zoom)+e*(t.shiftKey?2:1):s.zoom,bearing:s.bearing+i*this._bearingStep,pitch:s.pitch+r*this._pitchStep,offset:[-n*this._panStep,-o*this._panStep],center:s.center},{originalEvent:t})}}}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}disableRotation(){this._rotationDisabled=!0}enableRotation(){this._rotationDisabled=!1}}function un(t){return t*(2-t)}const hn=4.000244140625;class dn{constructor(t,e){this._onTimeout=t=>{this._type="wheel",this._delta-=this._lastValue,this._active||this._start(t)},this._map=t,this._tr=new Nr(t),this._triggerRenderFrame=e,this._delta=0,this._defaultZoomRate=.01,this._wheelZoomRate=.0022222222222222222}setZoomRate(t){this._defaultZoomRate=t}setWheelZoomRate(t){this._wheelZoomRate=t}isEnabled(){return!!this._enabled}isActive(){return!!this._active||void 0!==this._finishTimeout}isZooming(){return!!this._zooming}enable(t){this.isEnabled()||(this._enabled=!0,this._aroundCenter=!!t&&"center"===t.around)}disable(){this.isEnabled()&&(this._enabled=!1)}_shouldBePrevented(t){return!!this._map.cooperativeGestures.isEnabled()&&!(t.ctrlKey||this._map.cooperativeGestures.isBypassed(t))}wheel(t){if(!this.isEnabled())return;if(this._shouldBePrevented(t))return void this._map.cooperativeGestures.notifyGestureBlocked("wheel_zoom",t);let e=t.deltaMode===WheelEvent.DOM_DELTA_LINE?40*t.deltaY:t.deltaY;const i=o.now(),r=i-(this._lastWheelEventTime||0);this._lastWheelEventTime=i,0!==e&&e%hn==0?this._type="wheel":0!==e&&Math.abs(e)<4?this._type="trackpad":r>400?(this._type=null,this._lastValue=e,this._timeout=setTimeout(this._onTimeout,40,t)):this._type||(this._type=Math.abs(r*e)<200?"trackpad":"wheel",this._timeout&&(clearTimeout(this._timeout),this._timeout=null,e+=this._lastValue)),t.shiftKey&&e&&(e/=4),this._type&&(this._lastWheelEvent=t,this._delta-=e,this._active||this._start(t)),t.preventDefault()}_start(t){if(!this._delta)return;this._frameId&&(this._frameId=null),this._active=!0,this.isZooming()||(this._zooming=!0),this._finishTimeout&&(clearTimeout(this._finishTimeout),delete this._finishTimeout);const i=a.mousePos(this._map.getCanvas(),t),r=this._tr;this._around=i.y>r.transform.height/2-r.transform.getHorizon()?e.N.convert(this._aroundCenter?r.center:r.unproject(i)):e.N.convert(r.center),this._aroundPoint=r.transform.locationPoint(this._around),this._frameId||(this._frameId=!0,this._triggerRenderFrame())}renderFrame(){if(!this._frameId)return;if(this._frameId=null,!this.isActive())return;const t=this._tr.transform;if(0!==this._delta){const e="wheel"===this._type&&Math.abs(this._delta)>hn?this._wheelZoomRate:this._defaultZoomRate;let i=2/(1+Math.exp(-Math.abs(this._delta*e)));this._delta<0&&0!==i&&(i=1/i);const r="number"==typeof this._targetZoom?t.zoomScale(this._targetZoom):t.scale;this._targetZoom=Math.min(t.maxZoom,Math.max(t.minZoom,t.scaleZoom(r*i))),"wheel"===this._type&&(this._startZoom=t.zoom,this._easing=this._smoothOutEasing(200)),this._delta=0}const i="number"==typeof this._targetZoom?this._targetZoom:t.zoom,r=this._startZoom,n=this._easing;let a,s=!1;const l=o.now()-this._lastWheelEventTime;if("wheel"===this._type&&r&&n&&l){const t=Math.min(l/200,1),o=n(t);a=e.y.number(r,i,o),t<1?this._frameId||(this._frameId=!0):s=!0}else a=i,s=!0;return this._active=!0,s&&(this._active=!1,this._finishTimeout=setTimeout((()=>{this._zooming=!1,this._triggerRenderFrame(),delete this._targetZoom,delete this._finishTimeout}),200)),{noInertia:!0,needsRenderFrame:!s,zoomDelta:a-t.zoom,around:this._aroundPoint,originalEvent:this._lastWheelEvent}}_smoothOutEasing(t){let i=e.b9;if(this._prevEase){const t=this._prevEase,r=(o.now()-t.start)/t.duration,n=t.easing(r+.01)-t.easing(r),a=.27/Math.sqrt(n*n+1e-4)*.01,s=Math.sqrt(.0729-a*a);i=e.b8(a,s,.25,1)}return this._prevEase={start:o.now(),duration:t,easing:i},i}reset(){this._active=!1,this._zooming=!1,delete this._targetZoom,this._finishTimeout&&(clearTimeout(this._finishTimeout),delete this._finishTimeout)}}class pn{constructor(t,e){this._clickZoom=t,this._tapZoom=e}enable(){this._clickZoom.enable(),this._tapZoom.enable()}disable(){this._clickZoom.disable(),this._tapZoom.disable()}isEnabled(){return this._clickZoom.isEnabled()&&this._tapZoom.isEnabled()}isActive(){return this._clickZoom.isActive()||this._tapZoom.isActive()}}class fn{constructor(t){this._tr=new Nr(t),this.reset()}reset(){this._active=!1}dblclick(t,e){return t.preventDefault(),{cameraAnimation:i=>{i.easeTo({duration:300,zoom:this._tr.zoom+(t.shiftKey?-1:1),around:this._tr.unproject(e)},{originalEvent:t})}}}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}}class mn{constructor(){this._tap=new qr({numTouches:1,numTaps:1}),this.reset()}reset(){this._active=!1,delete this._swipePoint,delete this._swipeTouch,delete this._tapTime,delete this._tapPoint,this._tap.reset()}touchstart(t,e,i){if(!this._swipePoint)if(this._tapTime){const r=e[0],n=t.timeStamp-this._tapTime<500,o=this._tapPoint.dist(r)<30;n&&o?i.length>0&&(this._swipePoint=r,this._swipeTouch=i[0].identifier):this.reset()}else this._tap.touchstart(t,e,i)}touchmove(t,e,i){if(this._tapTime){if(this._swipePoint){if(i[0].identifier!==this._swipeTouch)return;const r=e[0],n=r.y-this._swipePoint.y;return this._swipePoint=r,t.preventDefault(),this._active=!0,{zoomDelta:n/128}}}else this._tap.touchmove(t,e,i)}touchend(t,e,i){if(this._tapTime)this._swipePoint&&0===i.length&&this.reset();else{const r=this._tap.touchend(t,e,i);r&&(this._tapTime=t.timeStamp,this._tapPoint=r)}}touchcancel(){this.reset()}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}}class gn{constructor(t,e,i){this._el=t,this._mousePan=e,this._touchPan=i}enable(t){this._inertiaOptions=t||{},this._mousePan.enable(),this._touchPan.enable(),this._el.classList.add("maplibregl-touch-drag-pan")}disable(){this._mousePan.disable(),this._touchPan.disable(),this._el.classList.remove("maplibregl-touch-drag-pan")}isEnabled(){return this._mousePan.isEnabled()&&this._touchPan.isEnabled()}isActive(){return this._mousePan.isActive()||this._touchPan.isActive()}}class yn{constructor(t,e,i){this._pitchWithRotate=t.pitchWithRotate,this._mouseRotate=e,this._mousePitch=i}enable(){this._mouseRotate.enable(),this._pitchWithRotate&&this._mousePitch.enable()}disable(){this._mouseRotate.disable(),this._mousePitch.disable()}isEnabled(){return this._mouseRotate.isEnabled()&&(!this._pitchWithRotate||this._mousePitch.isEnabled())}isActive(){return this._mouseRotate.isActive()||this._mousePitch.isActive()}}class _n{constructor(t,e,i,r){this._el=t,this._touchZoom=e,this._touchRotate=i,this._tapDragZoom=r,this._rotationDisabled=!1,this._enabled=!0}enable(t){this._touchZoom.enable(t),this._rotationDisabled||this._touchRotate.enable(t),this._tapDragZoom.enable(),this._el.classList.add("maplibregl-touch-zoom-rotate")}disable(){this._touchZoom.disable(),this._touchRotate.disable(),this._tapDragZoom.disable(),this._el.classList.remove("maplibregl-touch-zoom-rotate")}isEnabled(){return this._touchZoom.isEnabled()&&(this._rotationDisabled||this._touchRotate.isEnabled())&&this._tapDragZoom.isEnabled()}isActive(){return this._touchZoom.isActive()||this._touchRotate.isActive()||this._tapDragZoom.isActive()}disableRotation(){this._rotationDisabled=!0,this._touchRotate.disable()}enableRotation(){this._rotationDisabled=!1,this._touchZoom.isEnabled()&&this._touchRotate.enable()}}class vn{constructor(t,e){this._bypassKey=-1!==navigator.userAgent.indexOf("Mac")?"metaKey":"ctrlKey",this._map=t,this._options=e,this._enabled=!1}isActive(){return!1}reset(){}_setupUI(){if(this._container)return;const t=this._map.getCanvasContainer();t.classList.add("maplibregl-cooperative-gestures"),this._container=a.create("div","maplibregl-cooperative-gesture-screen",t);let e=this._map._getUIString("CooperativeGesturesHandler.WindowsHelpText");"metaKey"===this._bypassKey&&(e=this._map._getUIString("CooperativeGesturesHandler.MacHelpText"));const i=this._map._getUIString("CooperativeGesturesHandler.MobileHelpText"),r=document.createElement("div");r.className="maplibregl-desktop-message",r.textContent=e,this._container.appendChild(r);const n=document.createElement("div");n.className="maplibregl-mobile-message",n.textContent=i,this._container.appendChild(n),this._container.setAttribute("aria-hidden","true")}_destroyUI(){this._container&&(a.remove(this._container),this._map.getCanvasContainer().classList.remove("maplibregl-cooperative-gestures")),delete this._container}enable(){this._setupUI(),this._enabled=!0}disable(){this._enabled=!1,this._destroyUI()}isEnabled(){return this._enabled}isBypassed(t){return t[this._bypassKey]}notifyGestureBlocked(t,i){this._enabled&&(this._map.fire(new e.k("cooperativegestureprevented",{gestureType:t,originalEvent:i})),this._container.classList.add("maplibregl-show"),setTimeout((()=>{this._container.classList.remove("maplibregl-show")}),100))}}const bn=t=>t.zoom||t.drag||t.pitch||t.rotate;class xn extends e.k{}function wn(t){return t.panDelta&&t.panDelta.mag()||t.zoomDelta||t.bearingDelta||t.pitchDelta}class kn{constructor(t,e){this.handleWindowEvent=t=>{this.handleEvent(t,`${t.type}Window`)},this.handleEvent=(t,e)=>{if("blur"===t.type)return void this.stop(!0);this._updatingCamera=!0;const i="renderFrame"===t.type?void 0:t,r={needsRenderFrame:!1},n={},o={},s=t.touches,l=s?this._getMapTouches(s):void 0,c=l?a.touchPos(this._map.getCanvas(),l):a.mousePos(this._map.getCanvas(),t);for(const{handlerName:a,handler:d,allowed:p}of this._handlers){if(!d.isEnabled())continue;let s;this._blockedByActive(o,p,a)?d.reset():d[e||t.type]&&(s=d[e||t.type](t,c,l),this.mergeHandlerResult(r,n,s,a,i),s&&s.needsRenderFrame&&this._triggerRenderFrame()),(s||d.isActive())&&(o[a]=d)}const u={};for(const a in this._previousActiveHandlers)o[a]||(u[a]=i);this._previousActiveHandlers=o,(Object.keys(u).length||wn(r))&&(this._changes.push([r,n,u]),this._triggerRenderFrame()),(Object.keys(o).length||wn(r))&&this._map._stop(!0),this._updatingCamera=!1;const{cameraAnimation:h}=r;h&&(this._inertia.clear(),this._fireEvents({},{},!0),this._changes=[],h(this._map))},this._map=t,this._el=this._map.getCanvasContainer(),this._handlers=[],this._handlersById={},this._changes=[],this._inertia=new Mr(t),this._bearingSnap=e.bearingSnap,this._previousActiveHandlers={},this._eventsInProgress={},this._addDefaultHandlers(e);const i=this._el;this._listeners=[[i,"touchstart",{passive:!0}],[i,"touchmove",{passive:!1}],[i,"touchend",void 0],[i,"touchcancel",void 0],[i,"mousedown",void 0],[i,"mousemove",void 0],[i,"mouseup",void 0],[document,"mousemove",{capture:!0}],[document,"mouseup",void 0],[i,"mouseover",void 0],[i,"mouseout",void 0],[i,"dblclick",void 0],[i,"click",void 0],[i,"keydown",{capture:!1}],[i,"keyup",void 0],[i,"wheel",{passive:!1}],[i,"contextmenu",void 0],[window,"blur",void 0]];for(const[r,n,o]of this._listeners)a.addEventListener(r,n,r===document?this.handleWindowEvent:this.handleEvent,o)}destroy(){for(const[t,e,i]of this._listeners)a.removeEventListener(t,e,t===document?this.handleWindowEvent:this.handleEvent,i)}_addDefaultHandlers(t){const e=this._map,i=e.getCanvasContainer();this._add("mapEvent",new Fr(e,t));const r=e.boxZoom=new jr(e,t);this._add("boxZoom",r),t.interactive&&t.boxZoom&&r.enable();const n=e.cooperativeGestures=new vn(e,t.cooperativeGestures);this._add("cooperativeGestures",n),t.cooperativeGestures&&n.enable();const o=new $r(e),s=new fn(e);e.doubleClickZoom=new pn(s,o),this._add("tapZoom",o),this._add("clickZoom",s),t.interactive&&t.doubleClickZoom&&e.doubleClickZoom.enable();const l=new mn;this._add("tapDragZoom",l);const c=e.touchPitch=new sn(e);this._add("touchPitch",c),t.interactive&&t.touchPitch&&e.touchPitch.enable(t.touchPitch);const u=Jr(t),h=Kr(t);e.dragRotate=new yn(t,u,h),this._add("mouseRotate",u,["mousePitch"]),this._add("mousePitch",h,["mouseRotate"]),t.interactive&&t.dragRotate&&e.dragRotate.enable();const d=(({enable:t,clickTolerance:e})=>{const i=new Zr({checkCorrectEvent:t=>0===a.mouseButton(t)&&!t.ctrlKey});return new Gr({clickTolerance:e,move:(t,e)=>({around:e,panDelta:e.sub(t)}),activateOnStart:!0,moveStateManager:i,enable:t,assignEvents:Xr})})(t),p=new Yr(t,e);e.dragPan=new gn(i,d,p),this._add("mousePan",d),this._add("touchPan",p,["touchZoom","touchRotate"]),t.interactive&&t.dragPan&&e.dragPan.enable(t.dragPan);const f=new on,m=new rn;e.touchZoomRotate=new _n(i,m,f,l),this._add("touchRotate",f,["touchPan","touchZoom"]),this._add("touchZoom",m,["touchPan","touchRotate"]),t.interactive&&t.touchZoomRotate&&e.touchZoomRotate.enable(t.touchZoomRotate);const g=e.scrollZoom=new dn(e,(()=>this._triggerRenderFrame()));this._add("scrollZoom",g,["mousePan"]),t.interactive&&t.scrollZoom&&e.scrollZoom.enable(t.scrollZoom);const y=e.keyboard=new cn(e);this._add("keyboard",y),t.interactive&&t.keyboard&&e.keyboard.enable(),this._add("blockableMapEvent",new Br(e))}_add(t,e,i){this._handlers.push({handlerName:t,handler:e,allowed:i}),this._handlersById[t]=e}stop(t){if(!this._updatingCamera){for(const{handler:t}of this._handlers)t.reset();this._inertia.clear(),this._fireEvents({},{},t),this._changes=[]}}isActive(){for(const{handler:t}of this._handlers)if(t.isActive())return!0;return!1}isZooming(){return!!this._eventsInProgress.zoom||this._map.scrollZoom.isZooming()}isRotating(){return!!this._eventsInProgress.rotate}isMoving(){return Boolean(bn(this._eventsInProgress))||this.isZooming()}_blockedByActive(t,e,i){for(const r in t)if(r!==i&&(!e||e.indexOf(r)<0))return!0;return!1}_getMapTouches(t){const e=[];for(const i of t)this._el.contains(i.target)&&e.push(i);return e}mergeHandlerResult(t,i,r,n,o){if(!r)return;e.e(t,r);const a={handlerName:n,originalEvent:r.originalEvent||o};void 0!==r.zoomDelta&&(i.zoom=a),void 0!==r.panDelta&&(i.drag=a),void 0!==r.pitchDelta&&(i.pitch=a),void 0!==r.bearingDelta&&(i.rotate=a)}_applyChanges(){const t={},i={},r={};for(const[n,o,a]of this._changes)n.panDelta&&(t.panDelta=(t.panDelta||new e.P(0,0))._add(n.panDelta)),n.zoomDelta&&(t.zoomDelta=(t.zoomDelta||0)+n.zoomDelta),n.bearingDelta&&(t.bearingDelta=(t.bearingDelta||0)+n.bearingDelta),n.pitchDelta&&(t.pitchDelta=(t.pitchDelta||0)+n.pitchDelta),void 0!==n.around&&(t.around=n.around),void 0!==n.pinchAround&&(t.pinchAround=n.pinchAround),n.noInertia&&(t.noInertia=n.noInertia),e.e(i,o),e.e(r,a);this._updateMapTransform(t,i,r),this._changes=[]}_updateMapTransform(t,e,i){const r=this._map,n=r._getTransformForUpdate(),o=r.terrain;if(!(wn(t)||o&&this._terrainMovement))return this._fireEvents(e,i,!0);let{panDelta:a,zoomDelta:s,bearingDelta:l,pitchDelta:c,around:u,pinchAround:h}=t;void 0!==h&&(u=h),r._stop(!0),u=u||r.transform.centerPoint;const d=n.pointLocation(a?u.sub(a):u);l&&(n.bearing+=l),c&&(n.pitch+=c),s&&(n.zoom+=s),o?this._terrainMovement||!e.drag&&!e.zoom?e.drag&&this._terrainMovement?n.center=n.pointLocation(n.centerPoint.sub(a)):n.setLocationAtPoint(d,u):(this._terrainMovement=!0,this._map._elevationFreeze=!0,n.setLocationAtPoint(d,u)):n.setLocationAtPoint(d,u),r._applyUpdatedTransform(n),this._map._update(),t.noInertia||this._inertia.record(t),this._fireEvents(e,i,!0)}_fireEvents(t,i,r){const n=bn(this._eventsInProgress),a=bn(t),s={};for(const e in t){const{originalEvent:i}=t[e];this._eventsInProgress[e]||(s[`${e}start`]=i),this._eventsInProgress[e]=t[e]}!n&&a&&this._fireEvent("movestart",a.originalEvent);for(const e in s)this._fireEvent(e,s[e]);a&&this._fireEvent("move",a.originalEvent);for(const e in t){const{originalEvent:i}=t[e];this._fireEvent(e,i)}const l={};let c;for(const e in this._eventsInProgress){const{handlerName:t,originalEvent:r}=this._eventsInProgress[e];this._handlersById[t].isActive()||(delete this._eventsInProgress[e],c=i[t]||r,l[`${e}end`]=c)}for(const e in l)this._fireEvent(e,l[e]);const u=bn(this._eventsInProgress),h=(n||a)&&!u;if(h&&this._terrainMovement){this._map._elevationFreeze=!1,this._terrainMovement=!1;const t=this._map._getTransformForUpdate();t.recalculateZoom(this._map.terrain),this._map._applyUpdatedTransform(t)}if(r&&h){this._updatingCamera=!0;const t=this._inertia._onMoveEnd(this._map.dragPan._inertiaOptions),i=t=>0!==t&&-this._bearingSnap<t&&t<this._bearingSnap;!t||!t.essential&&o.prefersReducedMotion?(this._map.fire(new e.k("moveend",{originalEvent:c})),i(this._map.getBearing())&&this._map.resetNorth()):(i(t.bearing||this._map.getBearing())&&(t.bearing=0),t.freezeElevation=!0,this._map.easeTo(t,{originalEvent:c})),this._updatingCamera=!1}}_fireEvent(t,i){this._map.fire(new e.k(t,i?{originalEvent:i}:{}))}_requestFrame(){return this._map.triggerRepaint(),this._map._renderTaskQueue.add((t=>{delete this._frameId,this.handleEvent(new xn("renderFrame",{timeStamp:t})),this._applyChanges()}))}_triggerRenderFrame(){void 0===this._frameId&&(this._frameId=this._requestFrame())}}class En extends e.E{constructor(t,e){super(),this._renderFrameCallback=()=>{const t=Math.min((o.now()-this._easeStart)/this._easeOptions.duration,1);this._onEaseFrame(this._easeOptions.easing(t)),t<1&&this._easeFrameId?this._easeFrameId=this._requestRenderFrame(this._renderFrameCallback):this.stop()},this._moving=!1,this._zooming=!1,this.transform=t,this._bearingSnap=e.bearingSnap,this.on("moveend",(()=>{delete this._requestedCameraState}))}getCenter(){return new e.N(this.transform.center.lng,this.transform.center.lat)}setCenter(t,e){return this.jumpTo({center:t},e)}panBy(t,i,r){return t=e.P.convert(t).mult(-1),this.panTo(this.transform.center,e.e({offset:t},i),r)}panTo(t,i,r){return this.easeTo(e.e({center:t},i),r)}getZoom(){return this.transform.zoom}setZoom(t,e){return this.jumpTo({zoom:t},e),this}zoomTo(t,i,r){return this.easeTo(e.e({zoom:t},i),r)}zoomIn(t,e){return this.zoomTo(this.getZoom()+1,t,e),this}zoomOut(t,e){return this.zoomTo(this.getZoom()-1,t,e),this}getBearing(){return this.transform.bearing}setBearing(t,e){return this.jumpTo({bearing:t},e),this}getPadding(){return this.transform.padding}setPadding(t,e){return this.jumpTo({padding:t},e),this}rotateTo(t,i,r){return this.easeTo(e.e({bearing:t},i),r)}resetNorth(t,i){return this.rotateTo(0,e.e({duration:1e3},t),i),this}resetNorthPitch(t,i){return this.easeTo(e.e({bearing:0,pitch:0,duration:1e3},t),i),this}snapToNorth(t,e){return Math.abs(this.getBearing())<this._bearingSnap?this.resetNorth(t,e):this}getPitch(){return this.transform.pitch}setPitch(t,e){return this.jumpTo({pitch:t},e),this}cameraForBounds(t,e){t=H.convert(t).adjustAntiMeridian();const i=e&&e.bearing||0;return this._cameraForBoxAndBearing(t.getNorthWest(),t.getSouthEast(),i,e)}_cameraForBoxAndBearing(t,i,r,n){const o={top:0,bottom:0,right:0,left:0};if("number"==typeof(n=e.e({padding:o,offset:[0,0],maxZoom:this.transform.maxZoom},n)).padding){const t=n.padding;n.padding={top:t,bottom:t,right:t,left:t}}n.padding=e.e(o,n.padding);const a=this.transform,s=a.padding,l=new H(t,i),c=a.project(l.getNorthWest()),u=a.project(l.getNorthEast()),h=a.project(l.getSouthEast()),d=a.project(l.getSouthWest()),p=e.ba(-r),f=c.rotate(p),m=u.rotate(p),g=h.rotate(p),y=d.rotate(p),_=new e.P(Math.max(f.x,m.x,y.x,g.x),Math.max(f.y,m.y,y.y,g.y)),v=new e.P(Math.min(f.x,m.x,y.x,g.x),Math.min(f.y,m.y,y.y,g.y)),b=_.sub(v),x=(a.width-(s.left+s.right+n.padding.left+n.padding.right))/b.x,w=(a.height-(s.top+s.bottom+n.padding.top+n.padding.bottom))/b.y;if(w<0||x<0)return void e.w("Map cannot fit within canvas with the given bounds, padding, and/or offset.");const k=Math.min(a.scaleZoom(a.scale*Math.min(x,w)),n.maxZoom),E=e.P.convert(n.offset),S=new e.P((n.padding.left-n.padding.right)/2,(n.padding.top-n.padding.bottom)/2).rotate(e.ba(r)),I=E.add(S).mult(a.scale/a.zoomScale(k));return{center:a.unproject(c.add(h).div(2).sub(I)),zoom:k,bearing:r}}fitBounds(t,e,i){return this._fitInternal(this.cameraForBounds(t,e),e,i)}fitScreenCoordinates(t,i,r,n,o){return this._fitInternal(this._cameraForBoxAndBearing(this.transform.pointLocation(e.P.convert(t)),this.transform.pointLocation(e.P.convert(i)),r,n),n,o)}_fitInternal(t,i,r){return t?(delete(i=e.e(t,i)).padding,i.linear?this.easeTo(i,r):this.flyTo(i,r)):this}jumpTo(t,i){this.stop();const r=this._getTransformForUpdate();let n=!1,o=!1,a=!1;return"zoom"in t&&r.zoom!==+t.zoom&&(n=!0,r.zoom=+t.zoom),void 0!==t.center&&(r.center=e.N.convert(t.center)),"bearing"in t&&r.bearing!==+t.bearing&&(o=!0,r.bearing=+t.bearing),"pitch"in t&&r.pitch!==+t.pitch&&(a=!0,r.pitch=+t.pitch),null==t.padding||r.isPaddingEqual(t.padding)||(r.padding=t.padding),this._applyUpdatedTransform(r),this.fire(new e.k("movestart",i)).fire(new e.k("move",i)),n&&this.fire(new e.k("zoomstart",i)).fire(new e.k("zoom",i)).fire(new e.k("zoomend",i)),o&&this.fire(new e.k("rotatestart",i)).fire(new e.k("rotate",i)).fire(new e.k("rotateend",i)),a&&this.fire(new e.k("pitchstart",i)).fire(new e.k("pitch",i)).fire(new e.k("pitchend",i)),this.fire(new e.k("moveend",i))}calculateCameraOptionsFromTo(t,i,r,n=0){const o=e.Z.fromLngLat(t,i),a=e.Z.fromLngLat(r,n),s=a.x-o.x,l=a.y-o.y,c=a.z-o.z,u=Math.hypot(s,l,c);if(0===u)throw new Error("Can't calculate camera options with same From and To");const h=Math.hypot(s,l),d=this.transform.scaleZoom(this.transform.cameraToCenterDistance/u/this.transform.tileSize),p=180*Math.atan2(s,-l)/Math.PI;let f=180*Math.acos(h/u)/Math.PI;return f=c<0?90-f:90+f,{center:a.toLngLat(),zoom:d,pitch:f,bearing:p}}easeTo(t,i){var r;this._stop(!1,t.easeId),(!1===(t=e.e({offset:[0,0],duration:500,easing:e.b9},t)).animate||!t.essential&&o.prefersReducedMotion)&&(t.duration=0);const n=this._getTransformForUpdate(),a=n.zoom,s=n.bearing,l=n.pitch,c=n.padding,u="bearing"in t?this._normalizeBearing(t.bearing,s):s,h="pitch"in t?+t.pitch:l,d="padding"in t?t.padding:n.padding,p=e.P.convert(t.offset);let f=n.centerPoint.add(p);const m=n.pointLocation(f),{center:g,zoom:y}=n.getConstrained(e.N.convert(t.center||m),null!==(r=t.zoom)&&void 0!==r?r:a);this._normalizeCenter(g,n);const _=n.project(m),v=n.project(g).sub(_),b=n.zoomScale(y-a);let x,w;t.around&&(x=e.N.convert(t.around),w=n.locationPoint(x));const k={moving:this._moving,zooming:this._zooming,rotating:this._rotating,pitching:this._pitching};return this._zooming=this._zooming||y!==a,this._rotating=this._rotating||s!==u,this._pitching=this._pitching||h!==l,this._padding=!n.isPaddingEqual(d),this._easeId=t.easeId,this._prepareEase(i,t.noMoveStart,k),this.terrain&&this._prepareElevation(g),this._ease((r=>{if(this._zooming&&(n.zoom=e.y.number(a,y,r)),this._rotating&&(n.bearing=e.y.number(s,u,r)),this._pitching&&(n.pitch=e.y.number(l,h,r)),this._padding&&(n.interpolatePadding(c,d,r),f=n.centerPoint.add(p)),this.terrain&&!t.freezeElevation&&this._updateElevation(r),x)n.setLocationAtPoint(x,w);else{const t=n.zoomScale(n.zoom-a),e=y>a?Math.min(2,b):Math.max(.5,b),i=Math.pow(e,1-r),o=n.unproject(_.add(v.mult(r*i)).mult(t));n.setLocationAtPoint(n.renderWorldCopies?o.wrap():o,f)}this._applyUpdatedTransform(n),this._fireMoveEvents(i)}),(e=>{this.terrain&&t.freezeElevation&&this._finalizeElevation(),this._afterEase(i,e)}),t),this}_prepareEase(t,i,r={}){this._moving=!0,i||r.moving||this.fire(new e.k("movestart",t)),this._zooming&&!r.zooming&&this.fire(new e.k("zoomstart",t)),this._rotating&&!r.rotating&&this.fire(new e.k("rotatestart",t)),this._pitching&&!r.pitching&&this.fire(new e.k("pitchstart",t))}_prepareElevation(t){this._elevationCenter=t,this._elevationStart=this.transform.elevation,this._elevationTarget=this.terrain.getElevationForLngLatZoom(t,this.transform.tileZoom),this._elevationFreeze=!0}_updateElevation(t){this.transform.minElevationForCurrentTile=this.terrain.getMinTileElevationForLngLatZoom(this._elevationCenter,this.transform.tileZoom);const i=this.terrain.getElevationForLngLatZoom(this._elevationCenter,this.transform.tileZoom);if(t<1&&i!==this._elevationTarget){const e=this._elevationTarget-this._elevationStart;this._elevationStart+=t*(e-(i-(e*t+this._elevationStart))/(1-t)),this._elevationTarget=i}this.transform.elevation=e.y.number(this._elevationStart,this._elevationTarget,t)}_finalizeElevation(){this._elevationFreeze=!1,this.transform.recalculateZoom(this.terrain)}_getTransformForUpdate(){return this.transformCameraUpdate||this.terrain?(this._requestedCameraState||(this._requestedCameraState=this.transform.clone()),this._requestedCameraState):this.transform}_elevateCameraIfInsideTerrain(t){const e=t.getCameraPosition(),i=this.terrain.getElevationForLngLatZoom(e.lngLat,t.zoom);if(e.altitude<i){const r=this.calculateCameraOptionsFromTo(e.lngLat,i,t.center,t.elevation);return{pitch:r.pitch,zoom:r.zoom}}return{}}_applyUpdatedTransform(t){const e=[];if(this.terrain&&e.push((t=>this._elevateCameraIfInsideTerrain(t))),this.transformCameraUpdate&&e.push((t=>this.transformCameraUpdate(t))),!e.length)return;const i=t.clone();for(const r of e){const t=i.clone(),{center:e,zoom:n,pitch:o,bearing:a,elevation:s}=r(t);e&&(t.center=e),void 0!==n&&(t.zoom=n),void 0!==o&&(t.pitch=o),void 0!==a&&(t.bearing=a),void 0!==s&&(t.elevation=s),i.apply(t)}this.transform.apply(i)}_fireMoveEvents(t){this.fire(new e.k("move",t)),this._zooming&&this.fire(new e.k("zoom",t)),this._rotating&&this.fire(new e.k("rotate",t)),this._pitching&&this.fire(new e.k("pitch",t))}_afterEase(t,i){if(this._easeId&&i&&this._easeId===i)return;delete this._easeId;const r=this._zooming,n=this._rotating,o=this._pitching;this._moving=!1,this._zooming=!1,this._rotating=!1,this._pitching=!1,this._padding=!1,r&&this.fire(new e.k("zoomend",t)),n&&this.fire(new e.k("rotateend",t)),o&&this.fire(new e.k("pitchend",t)),this.fire(new e.k("moveend",t))}flyTo(t,i){var r;if(!t.essential&&o.prefersReducedMotion){const r=e.M(t,["center","zoom","bearing","pitch","around"]);return this.jumpTo(r,i)}this.stop(),t=e.e({offset:[0,0],speed:1.2,curve:1.42,easing:e.b9},t);const n=this._getTransformForUpdate(),a=n.zoom,s=n.bearing,l=n.pitch,c=n.padding,u="bearing"in t?this._normalizeBearing(t.bearing,s):s,h="pitch"in t?+t.pitch:l,d="padding"in t?t.padding:n.padding,p=e.P.convert(t.offset);let f=n.centerPoint.add(p);const m=n.pointLocation(f),{center:g,zoom:y}=n.getConstrained(e.N.convert(t.center||m),null!==(r=t.zoom)&&void 0!==r?r:a);this._normalizeCenter(g,n);const _=n.zoomScale(y-a),v=n.project(m),b=n.project(g).sub(v);let x=t.curve;const w=Math.max(n.width,n.height),k=w/_,E=b.mag();if("minZoom"in t){const i=e.ac(Math.min(t.minZoom,a,y),n.minZoom,n.maxZoom),r=w/n.zoomScale(i-a);x=Math.sqrt(r/E*2)}const S=x*x;function I(t){const e=(k*k-w*w+(t?-1:1)*S*S*E*E)/(2*(t?k:w)*S*E);return Math.log(Math.sqrt(e*e+1)-e)}function C(t){return(Math.exp(t)-Math.exp(-t))/2}function T(t){return(Math.exp(t)+Math.exp(-t))/2}const A=I(!1);let P=function(t){return T(A)/T(A+x*t)},M=function(t){return w*((T(A)*(C(e=A+x*t)/T(e))-C(A))/S)/E;var e},L=(I(!0)-A)/x;if(Math.abs(E)<1e-6||!isFinite(L)){if(Math.abs(w-k)<1e-6)return this.easeTo(t,i);const e=k<w?-1:1;L=Math.abs(Math.log(k/w))/x,M=()=>0,P=t=>Math.exp(e*x*t)}return t.duration="duration"in t?+t.duration:1e3*L/("screenSpeed"in t?+t.screenSpeed/x:+t.speed),t.maxDuration&&t.duration>t.maxDuration&&(t.duration=0),this._zooming=!0,this._rotating=s!==u,this._pitching=h!==l,this._padding=!n.isPaddingEqual(d),this._prepareEase(i,!1),this.terrain&&this._prepareElevation(g),this._ease((r=>{const o=r*L,m=1/P(o);n.zoom=1===r?y:a+n.scaleZoom(m),this._rotating&&(n.bearing=e.y.number(s,u,r)),this._pitching&&(n.pitch=e.y.number(l,h,r)),this._padding&&(n.interpolatePadding(c,d,r),f=n.centerPoint.add(p)),this.terrain&&!t.freezeElevation&&this._updateElevation(r);const _=1===r?g:n.unproject(v.add(b.mult(M(o))).mult(m));n.setLocationAtPoint(n.renderWorldCopies?_.wrap():_,f),this._applyUpdatedTransform(n),this._fireMoveEvents(i)}),(()=>{this.terrain&&t.freezeElevation&&this._finalizeElevation(),this._afterEase(i)}),t),this}isEasing(){return!!this._easeFrameId}stop(){return this._stop()}_stop(t,e){var i;if(this._easeFrameId&&(this._cancelRenderFrame(this._easeFrameId),delete this._easeFrameId,delete this._onEaseFrame),this._onEaseEnd){const t=this._onEaseEnd;delete this._onEaseEnd,t.call(this,e)}return t||null===(i=this.handlers)||void 0===i||i.stop(!1),this}_ease(t,e,i){!1===i.animate||0===i.duration?(t(1),e()):(this._easeStart=o.now(),this._easeOptions=i,this._onEaseFrame=t,this._onEaseEnd=e,this._easeFrameId=this._requestRenderFrame(this._renderFrameCallback))}_normalizeBearing(t,i){t=e.b3(t,-180,180);const r=Math.abs(t-i);return Math.abs(t-360-i)<r&&(t-=360),Math.abs(t+360-i)<r&&(t+=360),t}_normalizeCenter(t,e){if(!e.renderWorldCopies||e.lngRange)return;const i=t.lng-e.center.lng;t.lng+=i>180?-360:i<-180?360:0}queryTerrainElevation(t){return this.terrain?this.terrain.getElevationForLngLatZoom(e.N.convert(t),this.transform.tileZoom)-this.transform.elevation:null}}const Sn={compact:!0,customAttribution:'<a href="https://maplibre.org/" target="_blank">MapLibre</a>'};class In{constructor(t=Sn){this._toggleAttribution=()=>{this._container.classList.contains("maplibregl-compact")&&(this._container.classList.contains("maplibregl-compact-show")?(this._container.setAttribute("open",""),this._container.classList.remove("maplibregl-compact-show")):(this._container.classList.add("maplibregl-compact-show"),this._container.removeAttribute("open")))},this._updateData=t=>{!t||"metadata"!==t.sourceDataType&&"visibility"!==t.sourceDataType&&"style"!==t.dataType&&"terrain"!==t.type||this._updateAttributions()},this._updateCompact=()=>{this._map.getCanvasContainer().offsetWidth<=640||this._compact?!1===this._compact?this._container.setAttribute("open",""):this._container.classList.contains("maplibregl-compact")||this._container.classList.contains("maplibregl-attrib-empty")||(this._container.setAttribute("open",""),this._container.classList.add("maplibregl-compact","maplibregl-compact-show")):(this._container.setAttribute("open",""),this._container.classList.contains("maplibregl-compact")&&this._container.classList.remove("maplibregl-compact","maplibregl-compact-show"))},this._updateCompactMinimize=()=>{this._container.classList.contains("maplibregl-compact")&&this._container.classList.contains("maplibregl-compact-show")&&this._container.classList.remove("maplibregl-compact-show")},this.options=t}getDefaultPosition(){return"bottom-right"}onAdd(t){return this._map=t,this._compact=this.options.compact,this._container=a.create("details","maplibregl-ctrl maplibregl-ctrl-attrib"),this._compactButton=a.create("summary","maplibregl-ctrl-attrib-button",this._container),this._compactButton.addEventListener("click",this._toggleAttribution),this._setElementTitle(this._compactButton,"ToggleAttribution"),this._innerContainer=a.create("div","maplibregl-ctrl-attrib-inner",this._container),this._updateAttributions(),this._updateCompact(),this._map.on("styledata",this._updateData),this._map.on("sourcedata",this._updateData),this._map.on("terrain",this._updateData),this._map.on("resize",this._updateCompact),this._map.on("drag",this._updateCompactMinimize),this._container}onRemove(){a.remove(this._container),this._map.off("styledata",this._updateData),this._map.off("sourcedata",this._updateData),this._map.off("terrain",this._updateData),this._map.off("resize",this._updateCompact),this._map.off("drag",this._updateCompactMinimize),this._map=void 0,this._compact=void 0,this._attribHTML=void 0}_setElementTitle(t,e){const i=this._map._getUIString(`AttributionControl.${e}`);t.title=i,t.setAttribute("aria-label",i)}_updateAttributions(){if(!this._map.style)return;let t=[];if(this.options.customAttribution&&(Array.isArray(this.options.customAttribution)?t=t.concat(this.options.customAttribution.map((t=>"string"!=typeof t?"":t))):"string"==typeof this.options.customAttribution&&t.push(this.options.customAttribution)),this._map.style.stylesheet){const t=this._map.style.stylesheet;this.styleOwner=t.owner,this.styleId=t.id}const e=this._map.style.sourceCaches;for(const r in e){const i=e[r];if(i.used||i.usedForTerrain){const e=i.getSource();e.attribution&&t.indexOf(e.attribution)<0&&t.push(e.attribution)}}t=t.filter((t=>String(t).trim())),t.sort(((t,e)=>t.length-e.length)),t=t.filter(((e,i)=>{for(let r=i+1;r<t.length;r++)if(t[r].indexOf(e)>=0)return!1;return!0}));const i=t.join(" | ");i!==this._attribHTML&&(this._attribHTML=i,t.length?(this._innerContainer.innerHTML=i,this._container.classList.remove("maplibregl-attrib-empty")):this._container.classList.add("maplibregl-attrib-empty"),this._updateCompact(),this._editLink=null)}}class Cn{constructor(t={}){this._updateCompact=()=>{const t=this._container.children;if(t.length){const e=t[0];this._map.getCanvasContainer().offsetWidth<=640||this._compact?!1!==this._compact&&e.classList.add("maplibregl-compact"):e.classList.remove("maplibregl-compact")}},this.options=t}getDefaultPosition(){return"bottom-left"}onAdd(t){this._map=t,this._compact=this.options&&this.options.compact,this._container=a.create("div","maplibregl-ctrl");const e=a.create("a","maplibregl-ctrl-logo");return e.target="_blank",e.rel="noopener nofollow",e.href="https://maplibre.org/",e.setAttribute("aria-label",this._map._getUIString("LogoControl.Title")),e.setAttribute("rel","noopener nofollow"),this._container.appendChild(e),this._container.style.display="block",this._map.on("resize",this._updateCompact),this._updateCompact(),this._container}onRemove(){a.remove(this._container),this._map.off("resize",this._updateCompact),this._map=void 0,this._compact=void 0}}class Tn{constructor(){this._queue=[],this._id=0,this._cleared=!1,this._currentlyRunning=!1}add(t){const e=++this._id;return this._queue.push({callback:t,id:e,cancelled:!1}),e}remove(t){const e=this._currentlyRunning,i=e?this._queue.concat(e):this._queue;for(const r of i)if(r.id===t)return void(r.cancelled=!0)}run(t=0){if(this._currentlyRunning)throw new Error("Attempting to run(), but is already running.");const e=this._currentlyRunning=this._queue;this._queue=[];for(const i of e)if(!i.cancelled&&(i.callback(t),this._cleared))break;this._cleared=!1,this._currentlyRunning=!1}clear(){this._currentlyRunning&&(this._cleared=!0),this._queue=[]}}var An=e.Y([{name:"a_pos3d",type:"Int16",components:3}]);class Pn extends e.E{constructor(t){super(),this.sourceCache=t,this._tiles={},this._renderableTilesKeys=[],this._sourceTileCache={},this.minzoom=0,this.maxzoom=22,this.tileSize=512,this.deltaZoom=1,t.usedForTerrain=!0,t.tileSize=this.tileSize*2**this.deltaZoom}destruct(){this.sourceCache.usedForTerrain=!1,this.sourceCache.tileSize=null}update(t,i){this.sourceCache.update(t,i),this._renderableTilesKeys=[];const r={};for(const n of t.coveringTiles({tileSize:this.tileSize,minzoom:this.minzoom,maxzoom:this.maxzoom,reparseOverscaled:!1,terrain:i}))r[n.key]=!0,this._renderableTilesKeys.push(n.key),this._tiles[n.key]||(n.posMatrix=new Float64Array(16),e.aP(n.posMatrix,0,e.X,0,e.X,0,1),this._tiles[n.key]=new lt(n,this.tileSize));for(const e in this._tiles)r[e]||delete this._tiles[e]}freeRtt(t){for(const e in this._tiles){const i=this._tiles[e];(!t||i.tileID.equals(t)||i.tileID.isChildOf(t)||t.isChildOf(i.tileID))&&(i.rtt=[])}}getRenderableTiles(){return this._renderableTilesKeys.map((t=>this.getTileByID(t)))}getTileByID(t){return this._tiles[t]}getTerrainCoords(t){const i={};for(const r of this._renderableTilesKeys){const n=this._tiles[r].tileID;if(n.canonical.equals(t.canonical)){const n=t.clone();n.posMatrix=new Float64Array(16),e.aP(n.posMatrix,0,e.X,0,e.X,0,1),i[r]=n}else if(n.canonical.isChildOf(t.canonical)){const o=t.clone();o.posMatrix=new Float64Array(16);const a=n.canonical.z-t.canonical.z,s=n.canonical.x-(n.canonical.x>>a<<a),l=n.canonical.y-(n.canonical.y>>a<<a),c=e.X>>a;e.aP(o.posMatrix,0,c,0,c,0,1),e.J(o.posMatrix,o.posMatrix,[-s*c,-l*c,0]),i[r]=o}else if(t.canonical.isChildOf(n.canonical)){const o=t.clone();o.posMatrix=new Float64Array(16);const a=t.canonical.z-n.canonical.z,s=t.canonical.x-(t.canonical.x>>a<<a),l=t.canonical.y-(t.canonical.y>>a<<a),c=e.X>>a;e.aP(o.posMatrix,0,e.X,0,e.X,0,1),e.J(o.posMatrix,o.posMatrix,[s*c,l*c,0]),e.K(o.posMatrix,o.posMatrix,[1/2**a,1/2**a,0]),i[r]=o}}return i}getSourceTile(t,e){const i=this.sourceCache._source;let r=t.overscaledZ-this.deltaZoom;if(r>i.maxzoom&&(r=i.maxzoom),r<i.minzoom)return null;this._sourceTileCache[t.key]||(this._sourceTileCache[t.key]=t.scaledTo(r).key);let n=this.sourceCache.getTileByID(this._sourceTileCache[t.key]);if((!n||!n.dem)&&e)for(;r>=i.minzoom&&(!n||!n.dem);)n=this.sourceCache.getTileByID(t.scaledTo(r--).key);return n}tilesAfterTime(t=Date.now()){return Object.values(this._tiles).filter((e=>e.timeAdded>=t))}}class Mn{constructor(t,e,i){this.painter=t,this.sourceCache=new Pn(e),this.options=i,this.exaggeration="number"==typeof i.exaggeration?i.exaggeration:1,this.qualityFactor=2,this.meshSize=128,this._demMatrixCache={},this.coordsIndex=[],this._coordsTextureSize=1024}getDEMElevation(t,i,r,n=e.X){var o;if(!(i>=0&&i<n&&r>=0&&r<n))return 0;const a=this.getTerrainData(t),s=null===(o=a.tile)||void 0===o?void 0:o.dem;if(!s)return 0;const l=function(t,e,i){var r=e[0],n=e[1];return t[0]=i[0]*r+i[4]*n+i[12],t[1]=i[1]*r+i[5]*n+i[13],t}([],[i/n*e.X,r/n*e.X],a.u_terrain_matrix),c=[l[0]*s.dim,l[1]*s.dim],u=Math.floor(c[0]),h=Math.floor(c[1]),d=c[0]-u,p=c[1]-h;return s.get(u,h)*(1-d)*(1-p)+s.get(u+1,h)*d*(1-p)+s.get(u,h+1)*(1-d)*p+s.get(u+1,h+1)*d*p}getElevationForLngLatZoom(t,i){if(!e.bb(i,t.wrap()))return 0;const{tileID:r,mercatorX:n,mercatorY:o}=this._getOverscaledTileIDFromLngLatZoom(t,i);return this.getElevation(r,n%e.X,o%e.X,e.X)}getElevation(t,i,r,n=e.X){return this.getDEMElevation(t,i,r,n)*this.exaggeration}getTerrainData(t){if(!this._emptyDemTexture){const t=this.painter.context,i=new e.R({width:1,height:1},new Uint8Array(4));this._emptyDepthTexture=new x(t,i,t.gl.RGBA,{premultiply:!1}),this._emptyDemUnpack=[0,0,0,0],this._emptyDemTexture=new x(t,new e.R({width:1,height:1}),t.gl.RGBA,{premultiply:!1}),this._emptyDemTexture.bind(t.gl.NEAREST,t.gl.CLAMP_TO_EDGE),this._emptyDemMatrix=e.an([])}const i=this.sourceCache.getSourceTile(t,!0);if(i&&i.dem&&(!i.demTexture||i.needsTerrainPrepare)){const t=this.painter.context;i.demTexture=this.painter.getTileTexture(i.dem.stride),i.demTexture?i.demTexture.update(i.dem.getPixels(),{premultiply:!1}):i.demTexture=new x(t,i.dem.getPixels(),t.gl.RGBA,{premultiply:!1}),i.demTexture.bind(t.gl.NEAREST,t.gl.CLAMP_TO_EDGE),i.needsTerrainPrepare=!1}const r=i&&i+i.tileID.key+t.key;if(r&&!this._demMatrixCache[r]){const r=this.sourceCache.sourceCache._source.maxzoom;let n=t.canonical.z-i.tileID.canonical.z;t.overscaledZ>t.canonical.z&&(t.canonical.z>=r?n=t.canonical.z-r:e.w("cannot calculate elevation if elevation maxzoom > source.maxzoom"));const o=t.canonical.x-(t.canonical.x>>n<<n),a=t.canonical.y-(t.canonical.y>>n<<n),s=e.bc(new Float64Array(16),[1/(e.X<<n),1/(e.X<<n),0]);e.J(s,s,[o*e.X,a*e.X,0]),this._demMatrixCache[t.key]={matrix:s,coord:t}}return{u_depth:2,u_terrain:3,u_terrain_dim:i&&i.dem&&i.dem.dim||1,u_terrain_matrix:r?this._demMatrixCache[t.key].matrix:this._emptyDemMatrix,u_terrain_unpack:i&&i.dem&&i.dem.getUnpackVector()||this._emptyDemUnpack,u_terrain_exaggeration:this.exaggeration,texture:(i&&i.demTexture||this._emptyDemTexture).texture,depthTexture:(this._fboDepthTexture||this._emptyDepthTexture).texture,tile:i}}getFramebuffer(t){const e=this.painter,i=e.width/devicePixelRatio,r=e.height/devicePixelRatio;return!this._fbo||this._fbo.width===i&&this._fbo.height===r||(this._fbo.destroy(),this._fboCoordsTexture.destroy(),this._fboDepthTexture.destroy(),delete this._fbo,delete this._fboDepthTexture,delete this._fboCoordsTexture),this._fboCoordsTexture||(this._fboCoordsTexture=new x(e.context,{width:i,height:r,data:null},e.context.gl.RGBA,{premultiply:!1}),this._fboCoordsTexture.bind(e.context.gl.NEAREST,e.context.gl.CLAMP_TO_EDGE)),this._fboDepthTexture||(this._fboDepthTexture=new x(e.context,{width:i,height:r,data:null},e.context.gl.RGBA,{premultiply:!1}),this._fboDepthTexture.bind(e.context.gl.NEAREST,e.context.gl.CLAMP_TO_EDGE)),this._fbo||(this._fbo=e.context.createFramebuffer(i,r,!0,!1),this._fbo.depthAttachment.set(e.context.createRenderbuffer(e.context.gl.DEPTH_COMPONENT16,i,r))),this._fbo.colorAttachment.set("coords"===t?this._fboCoordsTexture.texture:this._fboDepthTexture.texture),this._fbo}getCoordsTexture(){const t=this.painter.context;if(this._coordsTexture)return this._coordsTexture;const i=new Uint8Array(this._coordsTextureSize*this._coordsTextureSize*4);for(let e=0,o=0;e<this._coordsTextureSize;e++)for(let t=0;t<this._coordsTextureSize;t++,o+=4)i[o+0]=255&t,i[o+1]=255&e,i[o+2]=t>>8<<4|e>>8,i[o+3]=0;const r=new e.R({width:this._coordsTextureSize,height:this._coordsTextureSize},new Uint8Array(i.buffer)),n=new x(t,r,t.gl.RGBA,{premultiply:!1});return n.bind(t.gl.NEAREST,t.gl.CLAMP_TO_EDGE),this._coordsTexture=n,n}pointCoordinate(t){this.painter.maybeDrawDepthAndCoords(!0);const i=new Uint8Array(4),r=this.painter.context,n=r.gl,o=Math.round(t.x*this.painter.pixelRatio/devicePixelRatio),a=Math.round(t.y*this.painter.pixelRatio/devicePixelRatio),s=Math.round(this.painter.height/devicePixelRatio);r.bindFramebuffer.set(this.getFramebuffer("coords").framebuffer),n.readPixels(o,s-a-1,1,1,n.RGBA,n.UNSIGNED_BYTE,i),r.bindFramebuffer.set(null);const l=i[0]+(i[2]>>4<<8),c=i[1]+((15&i[2])<<8),u=this.coordsIndex[255-i[3]],h=u&&this.sourceCache.getTileByID(u);if(!h)return null;const d=this._coordsTextureSize,p=(1<<h.tileID.canonical.z)*d;return new e.Z((h.tileID.canonical.x*d+l)/p+h.tileID.wrap,(h.tileID.canonical.y*d+c)/p,this.getElevation(h.tileID,l,c,d))}depthAtPoint(t){const e=new Uint8Array(4),i=this.painter.context,r=i.gl;return i.bindFramebuffer.set(this.getFramebuffer("depth").framebuffer),r.readPixels(t.x,this.painter.height/devicePixelRatio-t.y-1,1,1,r.RGBA,r.UNSIGNED_BYTE,e),i.bindFramebuffer.set(null),(e[0]/16777216+e[1]/65536+e[2]/256+e[3])/256}getTerrainMesh(){if(this._mesh)return this._mesh;const t=this.painter.context,i=new e.bd,r=new e.aY,n=this.meshSize,o=e.X/n,a=n*n;for(let e=0;e<=n;e++)for(let t=0;t<=n;t++)i.emplaceBack(t*o,e*o,0);for(let e=0;e<a;e+=n+1)for(let t=0;t<n;t++)r.emplaceBack(t+e,n+t+e+1,n+t+e+2),r.emplaceBack(t+e,n+t+e+2,t+e+1);const s=i.length,l=s+2*(n+1);for(const h of[0,1])for(let t=0;t<=n;t++)for(const r of[0,1])i.emplaceBack(t*o,h*e.X,r);for(let e=0;e<2*n;e+=2)r.emplaceBack(l+e,l+e+1,l+e+3),r.emplaceBack(l+e,l+e+3,l+e+2),r.emplaceBack(s+e,s+e+3,s+e+1),r.emplaceBack(s+e,s+e+2,s+e+3);const c=i.length,u=c+2*(n+1);for(const h of[0,1])for(let t=0;t<=n;t++)for(const r of[0,1])i.emplaceBack(h*e.X,t*o,r);for(let e=0;e<2*n;e+=2)r.emplaceBack(c+e,c+e+1,c+e+3),r.emplaceBack(c+e,c+e+3,c+e+2),r.emplaceBack(u+e,u+e+3,u+e+1),r.emplaceBack(u+e,u+e+2,u+e+3);return this._mesh=new yr(t.createVertexBuffer(i,An.members),t.createIndexBuffer(r),e.a0.simpleSegment(0,0,i.length,r.length)),this._mesh}getMeshFrameDelta(t){return 2*Math.PI*e.be/Math.pow(2,t)/5}getMinTileElevationForLngLatZoom(t,e){var i;const{tileID:r}=this._getOverscaledTileIDFromLngLatZoom(t,e);return null!==(i=this.getMinMaxElevation(r).minElevation)&&void 0!==i?i:0}getMinMaxElevation(t){const e=this.getTerrainData(t).tile,i={minElevation:null,maxElevation:null};return e&&e.dem&&(i.minElevation=e.dem.min*this.exaggeration,i.maxElevation=e.dem.max*this.exaggeration),i}_getOverscaledTileIDFromLngLatZoom(t,i){const r=e.Z.fromLngLat(t.wrap()),n=(1<<i)*e.X,o=r.x*n,a=r.y*n,s=Math.floor(o/e.X),l=Math.floor(a/e.X);return{tileID:new e.S(i,0,i,s,l),mercatorX:o,mercatorY:a}}}class Ln{constructor(t,e,i){this._context=t,this._size=e,this._tileSize=i,this._objects=[],this._recentlyUsed=[],this._stamp=0}destruct(){for(const t of this._objects)t.texture.destroy(),t.fbo.destroy()}_createObject(t){const e=this._context.createFramebuffer(this._tileSize,this._tileSize,!0,!0),i=new x(this._context,{width:this._tileSize,height:this._tileSize,data:null},this._context.gl.RGBA);return i.bind(this._context.gl.LINEAR,this._context.gl.CLAMP_TO_EDGE),e.depthAttachment.set(this._context.createRenderbuffer(this._context.gl.DEPTH_STENCIL,this._tileSize,this._tileSize)),e.colorAttachment.set(i.texture),{id:t,fbo:e,texture:i,stamp:-1,inUse:!1}}getObjectForId(t){return this._objects[t]}useObject(t){t.inUse=!0,this._recentlyUsed=this._recentlyUsed.filter((e=>t.id!==e)),this._recentlyUsed.push(t.id)}stampObject(t){t.stamp=++this._stamp}getOrCreateFreeObject(){for(const e of this._recentlyUsed)if(!this._objects[e].inUse)return this._objects[e];if(this._objects.length>=this._size)throw new Error("No free RenderPool available, call freeAllObjects() required!");const t=this._createObject(this._objects.length);return this._objects.push(t),t}freeObject(t){t.inUse=!1}freeAllObjects(){for(const t of this._objects)this.freeObject(t)}isFull(){return!(this._objects.length<this._size)&&!1===this._objects.some((t=>!t.inUse))}}const zn={background:!0,fill:!0,line:!0,raster:!0,hillshade:!0};class Dn{constructor(t,e){this.painter=t,this.terrain=e,this.pool=new Ln(t.context,30,e.sourceCache.tileSize*e.qualityFactor)}destruct(){this.pool.destruct()}getTexture(t){return this.pool.getObjectForId(t.rtt[this._stacks.length-1].id).texture}prepareForRender(t,e){this._stacks=[],this._prevType=null,this._rttTiles=[],this._renderableTiles=this.terrain.sourceCache.getRenderableTiles(),this._renderableLayerIds=t._order.filter((i=>!t._layers[i].isHidden(e))),this._coordsDescendingInv={};for(const i in t.sourceCaches){this._coordsDescendingInv[i]={};const e=t.sourceCaches[i].getVisibleCoordinates();for(const t of e){const e=this.terrain.sourceCache.getTerrainCoords(t);for(const t in e)this._coordsDescendingInv[i][t]||(this._coordsDescendingInv[i][t]=[]),this._coordsDescendingInv[i][t].push(e[t])}}this._coordsDescendingInvStr={};for(const i of t._order){const e=t._layers[i],r=e.source;if(zn[e.type]&&!this._coordsDescendingInvStr[r]){this._coordsDescendingInvStr[r]={};for(const t in this._coordsDescendingInv[r])this._coordsDescendingInvStr[r][t]=this._coordsDescendingInv[r][t].map((t=>t.key)).sort().join()}}for(const i of this._renderableTiles)for(const t in this._coordsDescendingInvStr){const e=this._coordsDescendingInvStr[t][i.tileID.key];e&&e!==i.rttCoords[t]&&(i.rtt=[])}}renderLayer(t){if(t.isHidden(this.painter.transform.zoom))return!1;const i=t.type,r=this.painter,n=this._renderableLayerIds[this._renderableLayerIds.length-1]===t.id;if(zn[i]&&(this._prevType&&zn[this._prevType]||this._stacks.push([]),this._prevType=i,this._stacks[this._stacks.length-1].push(t.id),!n))return!0;if(zn[this._prevType]||zn[i]&&n){this._prevType=i;const t=this._stacks.length-1,n=this._stacks[t]||[];for(const i of this._renderableTiles){if(this.pool.isFull()&&(gr(this.painter,this.terrain,this._rttTiles),this._rttTiles=[],this.pool.freeAllObjects()),this._rttTiles.push(i),i.rtt[t]){const e=this.pool.getObjectForId(i.rtt[t].id);if(e.stamp===i.rtt[t].stamp){this.pool.useObject(e);continue}}const o=this.pool.getOrCreateFreeObject();this.pool.useObject(o),this.pool.stampObject(o),i.rtt[t]={id:o.id,stamp:o.stamp},r.context.bindFramebuffer.set(o.fbo.framebuffer),r.context.clear({color:e.aM.transparent,stencil:0}),r.currentStencilSource=void 0;for(let t=0;t<n.length;t++){const e=r.style._layers[n[t]],a=e.source?this._coordsDescendingInv[e.source][i.tileID.key]:[i.tileID];r.context.viewport.set([0,0,o.fbo.width,o.fbo.height]),r._renderTileClippingMasks(e,a),r.renderLayer(r,r.style.sourceCaches[e.source],e,a),e.source&&(i.rttCoords[e.source]=this._coordsDescendingInvStr[e.source][i.tileID.key])}}return gr(this.painter,this.terrain,this._rttTiles),this._rttTiles=[],this.pool.freeAllObjects(),zn[i]}return!1}}const Rn={"AttributionControl.ToggleAttribution":"Toggle attribution","AttributionControl.MapFeedback":"Map feedback","FullscreenControl.Enter":"Enter fullscreen","FullscreenControl.Exit":"Exit fullscreen","GeolocateControl.FindMyLocation":"Find my location","GeolocateControl.LocationNotAvailable":"Location not available","LogoControl.Title":"MapLibre logo","Map.Title":"Map","Marker.Title":"Map marker","NavigationControl.ResetBearing":"Reset bearing to north","NavigationControl.ZoomIn":"Zoom in","NavigationControl.ZoomOut":"Zoom out","Popup.Close":"Close popup","ScaleControl.Feet":"ft","ScaleControl.Meters":"m","ScaleControl.Kilometers":"km","ScaleControl.Miles":"mi","ScaleControl.NauticalMiles":"nm","TerrainControl.Enable":"Enable terrain","TerrainControl.Disable":"Disable terrain","CooperativeGesturesHandler.WindowsHelpText":"Use Ctrl + scroll to zoom the map","CooperativeGesturesHandler.MacHelpText":"Use ⌘ + scroll to zoom the map","CooperativeGesturesHandler.MobileHelpText":"Use two fingers to move the map"},On=i,Fn={hash:!1,interactive:!0,bearingSnap:7,attributionControl:Sn,maplibreLogo:!1,failIfMajorPerformanceCaveat:!1,preserveDrawingBuffer:!1,refreshExpiredTiles:!0,scrollZoom:!0,minZoom:-2,maxZoom:22,minPitch:0,maxPitch:60,boxZoom:!0,dragRotate:!0,dragPan:!0,keyboard:!0,doubleClickZoom:!0,touchZoomRotate:!0,touchPitch:!0,cooperativeGestures:!1,trackResize:!0,center:[0,0],zoom:0,bearing:0,pitch:0,renderWorldCopies:!0,maxTileCacheSize:null,maxTileCacheZoomLevels:e.a.MAX_TILE_CACHE_ZOOM_LEVELS,transformRequest:null,transformCameraUpdate:null,fadeDuration:300,crossSourceCollisions:!0,clickTolerance:3,localIdeographFontFamily:"sans-serif",pitchWithRotate:!0,validateStyle:!0,maxCanvasSize:[4096,4096],cancelPendingTileRequestsWhileZooming:!0},Bn=t=>{t.touchstart=t.dragStart,t.touchmoveWindow=t.dragMove,t.touchend=t.dragEnd},Nn={showCompass:!0,showZoom:!0,visualizePitch:!1};class jn{constructor(t,i,r=!1){this.mousedown=t=>{this.startMouse(e.e({},t,{ctrlKey:!0,preventDefault:()=>t.preventDefault()}),a.mousePos(this.element,t)),a.addEventListener(window,"mousemove",this.mousemove),a.addEventListener(window,"mouseup",this.mouseup)},this.mousemove=t=>{this.moveMouse(t,a.mousePos(this.element,t))},this.mouseup=t=>{this.mouseRotate.dragEnd(t),this.mousePitch&&this.mousePitch.dragEnd(t),this.offTemp()},this.touchstart=t=>{1!==t.targetTouches.length?this.reset():(this._startPos=this._lastPos=a.touchPos(this.element,t.targetTouches)[0],this.startTouch(t,this._startPos),a.addEventListener(window,"touchmove",this.touchmove,{passive:!1}),a.addEventListener(window,"touchend",this.touchend))},this.touchmove=t=>{1!==t.targetTouches.length?this.reset():(this._lastPos=a.touchPos(this.element,t.targetTouches)[0],this.moveTouch(t,this._lastPos))},this.touchend=t=>{0===t.targetTouches.length&&this._startPos&&this._lastPos&&this._startPos.dist(this._lastPos)<this._clickTolerance&&this.element.click(),delete this._startPos,delete this._lastPos,this.offTemp()},this.reset=()=>{this.mouseRotate.reset(),this.mousePitch&&this.mousePitch.reset(),this.touchRotate.reset(),this.touchPitch&&this.touchPitch.reset(),delete this._startPos,delete this._lastPos,this.offTemp()},this._clickTolerance=10;const n=t.dragRotate._mouseRotate.getClickTolerance(),o=t.dragRotate._mousePitch.getClickTolerance();this.element=i,this.mouseRotate=Jr({clickTolerance:n,enable:!0}),this.touchRotate=(({enable:t,clickTolerance:e,bearingDegreesPerPixelMoved:i=.8})=>{const r=new Wr;return new Gr({clickTolerance:e,move:(t,e)=>({bearingDelta:(e.x-t.x)*i}),moveStateManager:r,enable:t,assignEvents:Bn})})({clickTolerance:n,enable:!0}),this.map=t,r&&(this.mousePitch=Kr({clickTolerance:o,enable:!0}),this.touchPitch=(({enable:t,clickTolerance:e,pitchDegreesPerPixelMoved:i=-.5})=>{const r=new Wr;return new Gr({clickTolerance:e,move:(t,e)=>({pitchDelta:(e.y-t.y)*i}),moveStateManager:r,enable:t,assignEvents:Bn})})({clickTolerance:o,enable:!0})),a.addEventListener(i,"mousedown",this.mousedown),a.addEventListener(i,"touchstart",this.touchstart,{passive:!1}),a.addEventListener(i,"touchcancel",this.reset)}startMouse(t,e){this.mouseRotate.dragStart(t,e),this.mousePitch&&this.mousePitch.dragStart(t,e),a.disableDrag()}startTouch(t,e){this.touchRotate.dragStart(t,e),this.touchPitch&&this.touchPitch.dragStart(t,e),a.disableDrag()}moveMouse(t,e){const i=this.map,{bearingDelta:r}=this.mouseRotate.dragMove(t,e)||{};if(r&&i.setBearing(i.getBearing()+r),this.mousePitch){const{pitchDelta:r}=this.mousePitch.dragMove(t,e)||{};r&&i.setPitch(i.getPitch()+r)}}moveTouch(t,e){const i=this.map,{bearingDelta:r}=this.touchRotate.dragMove(t,e)||{};if(r&&i.setBearing(i.getBearing()+r),this.touchPitch){const{pitchDelta:r}=this.touchPitch.dragMove(t,e)||{};r&&i.setPitch(i.getPitch()+r)}}off(){const t=this.element;a.removeEventListener(t,"mousedown",this.mousedown),a.removeEventListener(t,"touchstart",this.touchstart,{passive:!1}),a.removeEventListener(window,"touchmove",this.touchmove,{passive:!1}),a.removeEventListener(window,"touchend",this.touchend),a.removeEventListener(t,"touchcancel",this.reset),this.offTemp()}offTemp(){a.enableDrag(),a.removeEventListener(window,"mousemove",this.mousemove),a.removeEventListener(window,"mouseup",this.mouseup),a.removeEventListener(window,"touchmove",this.touchmove,{passive:!1}),a.removeEventListener(window,"touchend",this.touchend)}}let Vn;function Un(t,i,r){const n=new e.N(t.lng,t.lat);if(t=new e.N(t.lng,t.lat),i){const n=new e.N(t.lng-360,t.lat),o=new e.N(t.lng+360,t.lat),a=r.locationPoint(t).distSqr(i);r.locationPoint(n).distSqr(i)<a?t=n:r.locationPoint(o).distSqr(i)<a&&(t=o)}for(;Math.abs(t.lng-r.center.lng)>180;){const e=r.locationPoint(t);if(e.x>=0&&e.y>=0&&e.x<=r.width&&e.y<=r.height)break;t.lng>r.center.lng?t.lng-=360:t.lng+=360}return t.lng!==n.lng&&r.locationPoint(t).y>r.height/2-r.getHorizon()?t:n}const qn={center:"translate(-50%,-50%)",top:"translate(-50%,0)","top-left":"translate(0,0)","top-right":"translate(-100%,0)",bottom:"translate(-50%,-100%)","bottom-left":"translate(0,-100%)","bottom-right":"translate(-100%,-100%)",left:"translate(0,-50%)",right:"translate(-100%,-50%)"};function $n(t,e,i){const r=t.classList;for(const n in qn)r.remove(`maplibregl-${i}-anchor-${n}`);r.add(`maplibregl-${i}-anchor-${e}`)}class Gn extends e.E{constructor(t){if(super(),this._onKeyPress=t=>{const e=t.code,i=t.charCode||t.keyCode;"Space"!==e&&"Enter"!==e&&32!==i&&13!==i||this.togglePopup()},this._onMapClick=t=>{const e=t.originalEvent.target,i=this._element;this._popup&&(e===i||i.contains(e))&&this.togglePopup()},this._update=t=>{var e;if(!this._map)return;const i=this._map.loaded()&&!this._map.isMoving();("terrain"===(null==t?void 0:t.type)||"render"===(null==t?void 0:t.type)&&!i)&&this._map.once("render",this._update),this._lngLat=this._map.transform.renderWorldCopies?Un(this._lngLat,this._flatPos,this._map.transform):null===(e=this._lngLat)||void 0===e?void 0:e.wrap(),this._flatPos=this._pos=this._map.project(this._lngLat)._add(this._offset),this._map.terrain&&(this._flatPos=this._map.transform.locationPoint(this._lngLat)._add(this._offset));let r="";"viewport"===this._rotationAlignment||"auto"===this._rotationAlignment?r=`rotateZ(${this._rotation}deg)`:"map"===this._rotationAlignment&&(r=`rotateZ(${this._rotation-this._map.getBearing()}deg)`);let n="";"viewport"===this._pitchAlignment||"auto"===this._pitchAlignment?n="rotateX(0deg)":"map"===this._pitchAlignment&&(n=`rotateX(${this._map.getPitch()}deg)`),this._subpixelPositioning||t&&"moveend"!==t.type||(this._pos=this._pos.round()),a.setTransform(this._element,`${qn[this._anchor]} translate(${this._pos.x}px, ${this._pos.y}px) ${n} ${r}`),o.frameAsync(new AbortController).then((()=>{this._updateOpacity(t&&"moveend"===t.type)})).catch((()=>{}))},this._onMove=t=>{if(!this._isDragging){const e=this._clickTolerance||this._map._clickTolerance;this._isDragging=t.point.dist(this._pointerdownPos)>=e}this._isDragging&&(this._pos=t.point.sub(this._positionDelta),this._lngLat=this._map.unproject(this._pos),this.setLngLat(this._lngLat),this._element.style.pointerEvents="none","pending"===this._state&&(this._state="active",this.fire(new e.k("dragstart"))),this.fire(new e.k("drag")))},this._onUp=()=>{this._element.style.pointerEvents="auto",this._positionDelta=null,this._pointerdownPos=null,this._isDragging=!1,this._map.off("mousemove",this._onMove),this._map.off("touchmove",this._onMove),"active"===this._state&&this.fire(new e.k("dragend")),this._state="inactive"},this._addDragHandler=t=>{this._element.contains(t.originalEvent.target)&&(t.preventDefault(),this._positionDelta=t.point.sub(this._pos).add(this._offset),this._pointerdownPos=t.point,this._state="pending",this._map.on("mousemove",this._onMove),this._map.on("touchmove",this._onMove),this._map.once("mouseup",this._onUp),this._map.once("touchend",this._onUp))},this._anchor=t&&t.anchor||"center",this._color=t&&t.color||"#3FB1CE",this._scale=t&&t.scale||1,this._draggable=t&&t.draggable||!1,this._clickTolerance=t&&t.clickTolerance||0,this._subpixelPositioning=t&&t.subpixelPositioning||!1,this._isDragging=!1,this._state="inactive",this._rotation=t&&t.rotation||0,this._rotationAlignment=t&&t.rotationAlignment||"auto",this._pitchAlignment=t&&t.pitchAlignment&&"auto"!==t.pitchAlignment?t.pitchAlignment:this._rotationAlignment,this.setOpacity(),this.setOpacity(null==t?void 0:t.opacity,null==t?void 0:t.opacityWhenCovered),t&&t.element)this._element=t.element,this._offset=e.P.convert(t&&t.offset||[0,0]);else{this._defaultMarker=!0,this._element=a.create("div");const i=a.createNS("http://www.w3.org/2000/svg","svg"),r=41,n=27;i.setAttributeNS(null,"display","block"),i.setAttributeNS(null,"height",`${r}px`),i.setAttributeNS(null,"width",`${n}px`),i.setAttributeNS(null,"viewBox",`0 0 ${n} ${r}`);const o=a.createNS("http://www.w3.org/2000/svg","g");o.setAttributeNS(null,"stroke","none"),o.setAttributeNS(null,"stroke-width","1"),o.setAttributeNS(null,"fill","none"),o.setAttributeNS(null,"fill-rule","evenodd");const s=a.createNS("http://www.w3.org/2000/svg","g");s.setAttributeNS(null,"fill-rule","nonzero");const l=a.createNS("http://www.w3.org/2000/svg","g");l.setAttributeNS(null,"transform","translate(3.0, 29.0)"),l.setAttributeNS(null,"fill","#000000");const c=[{rx:"10.5",ry:"5.25002273"},{rx:"10.5",ry:"5.25002273"},{rx:"9.5",ry:"4.77275007"},{rx:"8.5",ry:"4.29549936"},{rx:"7.5",ry:"3.81822308"},{rx:"6.5",ry:"3.34094679"},{rx:"5.5",ry:"2.86367051"},{rx:"4.5",ry:"2.38636864"}];for(const t of c){const e=a.createNS("http://www.w3.org/2000/svg","ellipse");e.setAttributeNS(null,"opacity","0.04"),e.setAttributeNS(null,"cx","10.5"),e.setAttributeNS(null,"cy","5.80029008"),e.setAttributeNS(null,"rx",t.rx),e.setAttributeNS(null,"ry",t.ry),l.appendChild(e)}const u=a.createNS("http://www.w3.org/2000/svg","g");u.setAttributeNS(null,"fill",this._color);const h=a.createNS("http://www.w3.org/2000/svg","path");h.setAttributeNS(null,"d","M27,13.5 C27,19.074644 20.250001,27.000002 14.75,34.500002 C14.016665,35.500004 12.983335,35.500004 12.25,34.500002 C6.7499993,27.000002 0,19.222562 0,13.5 C0,6.0441559 6.0441559,0 13.5,0 C20.955844,0 27,6.0441559 27,13.5 Z"),u.appendChild(h);const d=a.createNS("http://www.w3.org/2000/svg","g");d.setAttributeNS(null,"opacity","0.25"),d.setAttributeNS(null,"fill","#000000");const p=a.createNS("http://www.w3.org/2000/svg","path");p.setAttributeNS(null,"d","M13.5,0 C6.0441559,0 0,6.0441559 0,13.5 C0,19.222562 6.7499993,27 12.25,34.5 C13,35.522727 14.016664,35.500004 14.75,34.5 C20.250001,27 27,19.074644 27,13.5 C27,6.0441559 20.955844,0 13.5,0 Z M13.5,1 C20.415404,1 26,6.584596 26,13.5 C26,15.898657 24.495584,19.181431 22.220703,22.738281 C19.945823,26.295132 16.705119,30.142167 13.943359,33.908203 C13.743445,34.180814 13.612715,34.322738 13.5,34.441406 C13.387285,34.322738 13.256555,34.180814 13.056641,33.908203 C10.284481,30.127985 7.4148684,26.314159 5.015625,22.773438 C2.6163816,19.232715 1,15.953538 1,13.5 C1,6.584596 6.584596,1 13.5,1 Z"),d.appendChild(p);const f=a.createNS("http://www.w3.org/2000/svg","g");f.setAttributeNS(null,"transform","translate(6.0, 7.0)"),f.setAttributeNS(null,"fill","#FFFFFF");const m=a.createNS("http://www.w3.org/2000/svg","g");m.setAttributeNS(null,"transform","translate(8.0, 8.0)");const g=a.createNS("http://www.w3.org/2000/svg","circle");g.setAttributeNS(null,"fill","#000000"),g.setAttributeNS(null,"opacity","0.25"),g.setAttributeNS(null,"cx","5.5"),g.setAttributeNS(null,"cy","5.5"),g.setAttributeNS(null,"r","5.4999962");const y=a.createNS("http://www.w3.org/2000/svg","circle");y.setAttributeNS(null,"fill","#FFFFFF"),y.setAttributeNS(null,"cx","5.5"),y.setAttributeNS(null,"cy","5.5"),y.setAttributeNS(null,"r","5.4999962"),m.appendChild(g),m.appendChild(y),s.appendChild(l),s.appendChild(u),s.appendChild(d),s.appendChild(f),s.appendChild(m),i.appendChild(s),i.setAttributeNS(null,"height",r*this._scale+"px"),i.setAttributeNS(null,"width",n*this._scale+"px"),this._element.appendChild(i),this._offset=e.P.convert(t&&t.offset||[0,-14])}if(this._element.classList.add("maplibregl-marker"),this._element.addEventListener("dragstart",(t=>{t.preventDefault()})),this._element.addEventListener("mousedown",(t=>{t.preventDefault()})),$n(this._element,this._anchor,"marker"),t&&t.className)for(const e of t.className.split(" "))this._element.classList.add(e);this._popup=null}addTo(t){return this.remove(),this._map=t,this._element.setAttribute("aria-label",t._getUIString("Marker.Title")),t.getCanvasContainer().appendChild(this._element),t.on("move",this._update),t.on("moveend",this._update),t.on("terrain",this._update),this.setDraggable(this._draggable),this._update(),this._map.on("click",this._onMapClick),this}remove(){return this._opacityTimeout&&(clearTimeout(this._opacityTimeout),delete this._opacityTimeout),this._map&&(this._map.off("click",this._onMapClick),this._map.off("move",this._update),this._map.off("moveend",this._update),this._map.off("terrain",this._update),this._map.off("mousedown",this._addDragHandler),this._map.off("touchstart",this._addDragHandler),this._map.off("mouseup",this._onUp),this._map.off("touchend",this._onUp),this._map.off("mousemove",this._onMove),this._map.off("touchmove",this._onMove),delete this._map),a.remove(this._element),this._popup&&this._popup.remove(),this}getLngLat(){return this._lngLat}setLngLat(t){return this._lngLat=e.N.convert(t),this._pos=null,this._popup&&this._popup.setLngLat(this._lngLat),this._update(),this}getElement(){return this._element}setPopup(t){if(this._popup&&(this._popup.remove(),this._popup=null,this._element.removeEventListener("keypress",this._onKeyPress),this._originalTabIndex||this._element.removeAttribute("tabindex")),t){if(!("offset"in t.options)){const e=38.1,i=13.5,r=Math.abs(i)/Math.SQRT2;t.options.offset=this._defaultMarker?{top:[0,0],"top-left":[0,0],"top-right":[0,0],bottom:[0,-38.1],"bottom-left":[r,-1*(e-i+r)],"bottom-right":[-r,-1*(e-i+r)],left:[i,-1*(e-i)],right:[-13.5,-1*(e-i)]}:this._offset}this._popup=t,this._originalTabIndex=this._element.getAttribute("tabindex"),this._originalTabIndex||this._element.setAttribute("tabindex","0"),this._element.addEventListener("keypress",this._onKeyPress)}return this}setSubpixelPositioning(t){return this._subpixelPositioning=t,this}getPopup(){return this._popup}togglePopup(){const t=this._popup;return this._element.style.opacity===this._opacityWhenCovered?this:t?(t.isOpen()?t.remove():(t.setLngLat(this._lngLat),t.addTo(this._map)),this):this}_updateOpacity(t=!1){var i,r;if(!(null===(i=this._map)||void 0===i?void 0:i.terrain))return void(this._element.style.opacity!==this._opacity&&(this._element.style.opacity=this._opacity));if(t)this._opacityTimeout=null;else{if(this._opacityTimeout)return;this._opacityTimeout=setTimeout((()=>{this._opacityTimeout=null}),100)}const n=this._map,o=n.terrain.depthAtPoint(this._pos),a=n.terrain.getElevationForLngLatZoom(this._lngLat,n.transform.tileZoom);if(n.transform.lngLatToCameraDepth(this._lngLat,a)-o<.006)return void(this._element.style.opacity=this._opacity);const s=-this._offset.y/n.transform._pixelPerMeter,l=Math.sin(n.getPitch()*Math.PI/180)*s,c=n.terrain.depthAtPoint(new e.P(this._pos.x,this._pos.y-this._offset.y)),u=n.transform.lngLatToCameraDepth(this._lngLat,a+l)-c>.006;(null===(r=this._popup)||void 0===r?void 0:r.isOpen())&&u&&this._popup.remove(),this._element.style.opacity=u?this._opacityWhenCovered:this._opacity}getOffset(){return this._offset}setOffset(t){return this._offset=e.P.convert(t),this._update(),this}addClassName(t){this._element.classList.add(t)}removeClassName(t){this._element.classList.remove(t)}toggleClassName(t){return this._element.classList.toggle(t)}setDraggable(t){return this._draggable=!!t,this._map&&(t?(this._map.on("mousedown",this._addDragHandler),this._map.on("touchstart",this._addDragHandler)):(this._map.off("mousedown",this._addDragHandler),this._map.off("touchstart",this._addDragHandler))),this}isDraggable(){return this._draggable}setRotation(t){return this._rotation=t||0,this._update(),this}getRotation(){return this._rotation}setRotationAlignment(t){return this._rotationAlignment=t||"auto",this._update(),this}getRotationAlignment(){return this._rotationAlignment}setPitchAlignment(t){return this._pitchAlignment=t&&"auto"!==t?t:this._rotationAlignment,this._update(),this}getPitchAlignment(){return this._pitchAlignment}setOpacity(t,e){return void 0===t&&void 0===e&&(this._opacity="1",this._opacityWhenCovered="0.2"),void 0!==t&&(this._opacity=t),void 0!==e&&(this._opacityWhenCovered=e),this._map&&this._updateOpacity(!0),this}}const Hn={positionOptions:{enableHighAccuracy:!1,maximumAge:0,timeout:6e3},fitBoundsOptions:{maxZoom:15},trackUserLocation:!1,showAccuracyCircle:!0,showUserLocation:!0};let Zn=0,Wn=!1;const Xn={maxWidth:100,unit:"metric"};function Jn(t,e,i){const r=i&&i.maxWidth||100,n=t._container.clientHeight/2,o=t.unproject([0,n]),a=t.unproject([r,n]),s=o.distanceTo(a);if(i&&"imperial"===i.unit){const i=3.2808*s;i>5280?Kn(e,r,i/5280,t._getUIString("ScaleControl.Miles")):Kn(e,r,i,t._getUIString("ScaleControl.Feet"))}else i&&"nautical"===i.unit?Kn(e,r,s/1852,t._getUIString("ScaleControl.NauticalMiles")):s>=1e3?Kn(e,r,s/1e3,t._getUIString("ScaleControl.Kilometers")):Kn(e,r,s,t._getUIString("ScaleControl.Meters"))}function Kn(t,e,i,r){const n=function(t){const e=Math.pow(10,`${Math.floor(t)}`.length-1);let i=t/e;return i=i>=10?10:i>=5?5:i>=3?3:i>=2?2:i>=1?1:function(t){const e=Math.pow(10,Math.ceil(-Math.log(t)/Math.LN10));return Math.round(t*e)/e}(i),e*i}(i);t.style.width=e*(n/i)+"px",t.innerHTML=`${n}&nbsp;${r}`}const Yn={closeButton:!0,closeOnClick:!0,focusAfterOpen:!0,className:"",maxWidth:"240px",subpixelPositioning:!1},Qn=["a[href]","[tabindex]:not([tabindex='-1'])","[contenteditable]:not([contenteditable='false'])","button:not([disabled])","input:not([disabled])","select:not([disabled])","textarea:not([disabled])"].join(", ");function to(t){if(t){if("number"==typeof t){const i=Math.round(Math.abs(t)/Math.SQRT2);return{center:new e.P(0,0),top:new e.P(0,t),"top-left":new e.P(i,i),"top-right":new e.P(-i,i),bottom:new e.P(0,-t),"bottom-left":new e.P(i,-i),"bottom-right":new e.P(-i,-i),left:new e.P(t,0),right:new e.P(-t,0)}}if(t instanceof e.P||Array.isArray(t)){const i=e.P.convert(t);return{center:i,top:i,"top-left":i,"top-right":i,bottom:i,"bottom-left":i,"bottom-right":i,left:i,right:i}}return{center:e.P.convert(t.center||[0,0]),top:e.P.convert(t.top||[0,0]),"top-left":e.P.convert(t["top-left"]||[0,0]),"top-right":e.P.convert(t["top-right"]||[0,0]),bottom:e.P.convert(t.bottom||[0,0]),"bottom-left":e.P.convert(t["bottom-left"]||[0,0]),"bottom-right":e.P.convert(t["bottom-right"]||[0,0]),left:e.P.convert(t.left||[0,0]),right:e.P.convert(t.right||[0,0])}}return to(new e.P(0,0))}const eo=i;t.AJAXError=e.bh,t.Evented=e.E,t.LngLat=e.N,t.MercatorCoordinate=e.Z,t.Point=e.P,t.addProtocol=e.bi,t.config=e.a,t.removeProtocol=e.bj,t.AttributionControl=In,t.BoxZoomHandler=jr,t.CanvasSource=et,t.CooperativeGesturesHandler=vn,t.DoubleClickZoomHandler=pn,t.DragPanHandler=gn,t.DragRotateHandler=yn,t.EdgeInsets=xr,t.FullscreenControl=class extends e.E{constructor(t={}){super(),this._onFullscreenChange=()=>{var t;let e=window.document.fullscreenElement||window.document.mozFullScreenElement||window.document.webkitFullscreenElement||window.document.msFullscreenElement;for(;null===(t=null==e?void 0:e.shadowRoot)||void 0===t?void 0:t.fullscreenElement;)e=e.shadowRoot.fullscreenElement;e===this._container!==this._fullscreen&&this._handleFullscreenChange()},this._onClickFullscreen=()=>{this._isFullscreen()?this._exitFullscreen():this._requestFullscreen()},this._fullscreen=!1,t&&t.container&&(t.container instanceof HTMLElement?this._container=t.container:e.w("Full screen control 'container' must be a DOM element.")),"onfullscreenchange"in document?this._fullscreenchange="fullscreenchange":"onmozfullscreenchange"in document?this._fullscreenchange="mozfullscreenchange":"onwebkitfullscreenchange"in document?this._fullscreenchange="webkitfullscreenchange":"onmsfullscreenchange"in document&&(this._fullscreenchange="MSFullscreenChange")}onAdd(t){return this._map=t,this._container||(this._container=this._map.getContainer()),this._controlContainer=a.create("div","maplibregl-ctrl maplibregl-ctrl-group"),this._setupUI(),this._controlContainer}onRemove(){a.remove(this._controlContainer),this._map=null,window.document.removeEventListener(this._fullscreenchange,this._onFullscreenChange)}_setupUI(){const t=this._fullscreenButton=a.create("button","maplibregl-ctrl-fullscreen",this._controlContainer);a.create("span","maplibregl-ctrl-icon",t).setAttribute("aria-hidden","true"),t.type="button",this._updateTitle(),this._fullscreenButton.addEventListener("click",this._onClickFullscreen),window.document.addEventListener(this._fullscreenchange,this._onFullscreenChange)}_updateTitle(){const t=this._getTitle();this._fullscreenButton.setAttribute("aria-label",t),this._fullscreenButton.title=t}_getTitle(){return this._map._getUIString(this._isFullscreen()?"FullscreenControl.Exit":"FullscreenControl.Enter")}_isFullscreen(){return this._fullscreen}_handleFullscreenChange(){this._fullscreen=!this._fullscreen,this._fullscreenButton.classList.toggle("maplibregl-ctrl-shrink"),this._fullscreenButton.classList.toggle("maplibregl-ctrl-fullscreen"),this._updateTitle(),this._fullscreen?(this.fire(new e.k("fullscreenstart")),this._prevCooperativeGesturesEnabled=this._map.cooperativeGestures.isEnabled(),this._map.cooperativeGestures.disable()):(this.fire(new e.k("fullscreenend")),this._prevCooperativeGesturesEnabled&&this._map.cooperativeGestures.enable())}_exitFullscreen(){window.document.exitFullscreen?window.document.exitFullscreen():window.document.mozCancelFullScreen?window.document.mozCancelFullScreen():window.document.msExitFullscreen?window.document.msExitFullscreen():window.document.webkitCancelFullScreen?window.document.webkitCancelFullScreen():this._togglePseudoFullScreen()}_requestFullscreen(){this._container.requestFullscreen?this._container.requestFullscreen():this._container.mozRequestFullScreen?this._container.mozRequestFullScreen():this._container.msRequestFullscreen?this._container.msRequestFullscreen():this._container.webkitRequestFullscreen?this._container.webkitRequestFullscreen():this._togglePseudoFullScreen()}_togglePseudoFullScreen(){this._container.classList.toggle("maplibregl-pseudo-fullscreen"),this._handleFullscreenChange(),this._map.resize()}},t.GeoJSONSource=K,t.GeolocateControl=class extends e.E{constructor(t){super(),this._onSuccess=t=>{if(this._map){if(this._isOutOfMapMaxBounds(t))return this._setErrorState(),this.fire(new e.k("outofmaxbounds",t)),this._updateMarker(),void this._finish();if(this.options.trackUserLocation)switch(this._lastKnownPosition=t,this._watchState){case"WAITING_ACTIVE":case"ACTIVE_LOCK":case"ACTIVE_ERROR":this._watchState="ACTIVE_LOCK",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active-error"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-active");break;case"BACKGROUND":case"BACKGROUND_ERROR":this._watchState="BACKGROUND",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-background-error"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-background");break;default:throw new Error(`Unexpected watchState ${this._watchState}`)}this.options.showUserLocation&&"OFF"!==this._watchState&&this._updateMarker(t),this.options.trackUserLocation&&"ACTIVE_LOCK"!==this._watchState||this._updateCamera(t),this.options.showUserLocation&&this._dotElement.classList.remove("maplibregl-user-location-dot-stale"),this.fire(new e.k("geolocate",t)),this._finish()}},this._updateCamera=t=>{const i=new e.N(t.coords.longitude,t.coords.latitude),r=t.coords.accuracy,n=this._map.getBearing(),o=e.e({bearing:n},this.options.fitBoundsOptions),a=H.fromLngLat(i,r);this._map.fitBounds(a,o,{geolocateSource:!0})},this._updateMarker=t=>{if(t){const i=new e.N(t.coords.longitude,t.coords.latitude);this._accuracyCircleMarker.setLngLat(i).addTo(this._map),this._userLocationDotMarker.setLngLat(i).addTo(this._map),this._accuracy=t.coords.accuracy,this.options.showUserLocation&&this.options.showAccuracyCircle&&this._updateCircleRadius()}else this._userLocationDotMarker.remove(),this._accuracyCircleMarker.remove()},this._onZoom=()=>{this.options.showUserLocation&&this.options.showAccuracyCircle&&this._updateCircleRadius()},this._onError=t=>{if(this._map){if(this.options.trackUserLocation)if(1===t.code){this._watchState="OFF",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active-error"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-background"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-background-error"),this._geolocateButton.disabled=!0;const t=this._map._getUIString("GeolocateControl.LocationNotAvailable");this._geolocateButton.title=t,this._geolocateButton.setAttribute("aria-label",t),void 0!==this._geolocationWatchID&&this._clearWatch()}else{if(3===t.code&&Wn)return;this._setErrorState()}"OFF"!==this._watchState&&this.options.showUserLocation&&this._dotElement.classList.add("maplibregl-user-location-dot-stale"),this.fire(new e.k("error",t)),this._finish()}},this._finish=()=>{this._timeoutId&&clearTimeout(this._timeoutId),this._timeoutId=void 0},this._setupUI=()=>{this._map&&(this._container.addEventListener("contextmenu",(t=>t.preventDefault())),this._geolocateButton=a.create("button","maplibregl-ctrl-geolocate",this._container),a.create("span","maplibregl-ctrl-icon",this._geolocateButton).setAttribute("aria-hidden","true"),this._geolocateButton.type="button",this._geolocateButton.disabled=!0)},this._finishSetupUI=t=>{if(this._map){if(!1===t){e.w("Geolocation support is not available so the GeolocateControl will be disabled.");const t=this._map._getUIString("GeolocateControl.LocationNotAvailable");this._geolocateButton.disabled=!0,this._geolocateButton.title=t,this._geolocateButton.setAttribute("aria-label",t)}else{const t=this._map._getUIString("GeolocateControl.FindMyLocation");this._geolocateButton.disabled=!1,this._geolocateButton.title=t,this._geolocateButton.setAttribute("aria-label",t)}this.options.trackUserLocation&&(this._geolocateButton.setAttribute("aria-pressed","false"),this._watchState="OFF"),this.options.showUserLocation&&(this._dotElement=a.create("div","maplibregl-user-location-dot"),this._userLocationDotMarker=new Gn({element:this._dotElement}),this._circleElement=a.create("div","maplibregl-user-location-accuracy-circle"),this._accuracyCircleMarker=new Gn({element:this._circleElement,pitchAlignment:"map"}),this.options.trackUserLocation&&(this._watchState="OFF"),this._map.on("zoom",this._onZoom)),this._geolocateButton.addEventListener("click",(()=>this.trigger())),this._setup=!0,this.options.trackUserLocation&&this._map.on("movestart",(t=>{t.geolocateSource||"ACTIVE_LOCK"!==this._watchState||t.originalEvent&&"resize"===t.originalEvent.type||(this._watchState="BACKGROUND",this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-background"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active"),this.fire(new e.k("trackuserlocationend")),this.fire(new e.k("userlocationlostfocus")))}))}},this.options=e.e({},Hn,t)}onAdd(t){return this._map=t,this._container=a.create("div","maplibregl-ctrl maplibregl-ctrl-group"),this._setupUI(),function(){return e._(this,arguments,void 0,(function*(t=!1){if(void 0!==Vn&&!t)return Vn;if(void 0===window.navigator.permissions)return Vn=!!window.navigator.geolocation,Vn;try{const t=yield window.navigator.permissions.query({name:"geolocation"});Vn="denied"!==t.state}catch(t){Vn=!!window.navigator.geolocation}return Vn}))}().then((t=>this._finishSetupUI(t))),this._container}onRemove(){void 0!==this._geolocationWatchID&&(window.navigator.geolocation.clearWatch(this._geolocationWatchID),this._geolocationWatchID=void 0),this.options.showUserLocation&&this._userLocationDotMarker&&this._userLocationDotMarker.remove(),this.options.showAccuracyCircle&&this._accuracyCircleMarker&&this._accuracyCircleMarker.remove(),a.remove(this._container),this._map.off("zoom",this._onZoom),this._map=void 0,Zn=0,Wn=!1}_isOutOfMapMaxBounds(t){const e=this._map.getMaxBounds(),i=t.coords;return e&&(i.longitude<e.getWest()||i.longitude>e.getEast()||i.latitude<e.getSouth()||i.latitude>e.getNorth())}_setErrorState(){switch(this._watchState){case"WAITING_ACTIVE":this._watchState="ACTIVE_ERROR",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-active-error");break;case"ACTIVE_LOCK":this._watchState="ACTIVE_ERROR",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-active-error"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-waiting");break;case"BACKGROUND":this._watchState="BACKGROUND_ERROR",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-background"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-background-error"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-waiting");break;case"ACTIVE_ERROR":break;default:throw new Error(`Unexpected watchState ${this._watchState}`)}}_updateCircleRadius(){const t=this._map.getBounds(),e=t.getSouthEast(),i=t.getNorthEast(),r=e.distanceTo(i),n=Math.ceil(this._accuracy/(r/this._map._container.clientHeight)*2);this._circleElement.style.width=`${n}px`,this._circleElement.style.height=`${n}px`}trigger(){if(!this._setup)return e.w("Geolocate control triggered before added to a map"),!1;if(this.options.trackUserLocation){switch(this._watchState){case"OFF":this._watchState="WAITING_ACTIVE",this.fire(new e.k("trackuserlocationstart"));break;case"WAITING_ACTIVE":case"ACTIVE_LOCK":case"ACTIVE_ERROR":case"BACKGROUND_ERROR":Zn--,Wn=!1,this._watchState="OFF",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active-error"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-background"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-background-error"),this.fire(new e.k("trackuserlocationend"));break;case"BACKGROUND":this._watchState="ACTIVE_LOCK",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-background"),this._lastKnownPosition&&this._updateCamera(this._lastKnownPosition),this.fire(new e.k("trackuserlocationstart")),this.fire(new e.k("userlocationfocus"));break;default:throw new Error(`Unexpected watchState ${this._watchState}`)}switch(this._watchState){case"WAITING_ACTIVE":this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-waiting"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-active");break;case"ACTIVE_LOCK":this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-active");break;case"OFF":break;default:throw new Error(`Unexpected watchState ${this._watchState}`)}if("OFF"===this._watchState&&void 0!==this._geolocationWatchID)this._clearWatch();else if(void 0===this._geolocationWatchID){let t;this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-waiting"),this._geolocateButton.setAttribute("aria-pressed","true"),Zn++,Zn>1?(t={maximumAge:6e5,timeout:0},Wn=!0):(t=this.options.positionOptions,Wn=!1),this._geolocationWatchID=window.navigator.geolocation.watchPosition(this._onSuccess,this._onError,t)}}else window.navigator.geolocation.getCurrentPosition(this._onSuccess,this._onError,this.options.positionOptions),this._timeoutId=setTimeout(this._finish,1e4);return!0}_clearWatch(){window.navigator.geolocation.clearWatch(this._geolocationWatchID),this._geolocationWatchID=void 0,this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-waiting"),this._geolocateButton.setAttribute("aria-pressed","false"),this.options.showUserLocation&&this._updateMarker(null)}},t.Hash=Sr,t.ImageSource=Q,t.KeyboardHandler=cn,t.LngLatBounds=H,t.LogoControl=Cn,t.Map=class extends En{constructor(t){e.bf.mark(e.bg.create);const i=Object.assign(Object.assign({},Fn),t);if(null!=i.minZoom&&null!=i.maxZoom&&i.minZoom>i.maxZoom)throw new Error("maxZoom must be greater than or equal to minZoom");if(null!=i.minPitch&&null!=i.maxPitch&&i.minPitch>i.maxPitch)throw new Error("maxPitch must be greater than or equal to minPitch");if(null!=i.minPitch&&i.minPitch<0)throw new Error("minPitch must be greater than or equal to 0");if(null!=i.maxPitch&&i.maxPitch>85)throw new Error("maxPitch must be less than or equal to 85");if(super(new kr(i.minZoom,i.maxZoom,i.minPitch,i.maxPitch,i.renderWorldCopies),{bearingSnap:i.bearingSnap}),this._idleTriggered=!1,this._crossFadingFactor=1,this._renderTaskQueue=new Tn,this._controls=[],this._mapId=e.a4(),this._contextLost=t=>{t.preventDefault(),this._frameRequest&&(this._frameRequest.abort(),this._frameRequest=null),this.fire(new e.k("webglcontextlost",{originalEvent:t}))},this._contextRestored=t=>{this._setupPainter(),this.resize(),this._update(),this.fire(new e.k("webglcontextrestored",{originalEvent:t}))},this._onMapScroll=t=>{if(t.target===this._container)return this._container.scrollTop=0,this._container.scrollLeft=0,!1},this._onWindowOnline=()=>{this._update()},this._interactive=i.interactive,this._maxTileCacheSize=i.maxTileCacheSize,this._maxTileCacheZoomLevels=i.maxTileCacheZoomLevels,this._failIfMajorPerformanceCaveat=!0===i.failIfMajorPerformanceCaveat,this._preserveDrawingBuffer=!0===i.preserveDrawingBuffer,this._antialias=!0===i.antialias,this._trackResize=!0===i.trackResize,this._bearingSnap=i.bearingSnap,this._refreshExpiredTiles=!0===i.refreshExpiredTiles,this._fadeDuration=i.fadeDuration,this._crossSourceCollisions=!0===i.crossSourceCollisions,this._collectResourceTiming=!0===i.collectResourceTiming,this._locale=Object.assign(Object.assign({},Rn),i.locale),this._clickTolerance=i.clickTolerance,this._overridePixelRatio=i.pixelRatio,this._maxCanvasSize=i.maxCanvasSize,this.transformCameraUpdate=i.transformCameraUpdate,this.cancelPendingTileRequestsWhileZooming=!0===i.cancelPendingTileRequestsWhileZooming,this._imageQueueHandle=p.addThrottleControl((()=>this.isMoving())),this._requestManager=new f(i.transformRequest),"string"==typeof i.container){if(this._container=document.getElementById(i.container),!this._container)throw new Error(`Container '${i.container}' not found.`)}else{if(!(i.container instanceof HTMLElement))throw new Error("Invalid type: 'container' must be a String or HTMLElement.");this._container=i.container}if(i.maxBounds&&this.setMaxBounds(i.maxBounds),this._setupContainer(),this._setupPainter(),this.on("move",(()=>this._update(!1))).on("moveend",(()=>this._update(!1))).on("zoom",(()=>this._update(!0))).on("terrain",(()=>{this.painter.terrainFacilitator.dirty=!0,this._update(!0)})).once("idle",(()=>{this._idleTriggered=!0})),"undefined"!=typeof window){addEventListener("online",this._onWindowOnline,!1);let t=!1;const e=Er((t=>{this._trackResize&&!this._removed&&(this.resize(t),this.redraw())}),50);this._resizeObserver=new ResizeObserver((i=>{t?e(i):t=!0})),this._resizeObserver.observe(this._container)}this.handlers=new kn(this,i),this._hash=i.hash&&new Sr("string"==typeof i.hash&&i.hash||void 0).addTo(this),this._hash&&this._hash._onHashChange()||(this.jumpTo({center:i.center,zoom:i.zoom,bearing:i.bearing,pitch:i.pitch}),i.bounds&&(this.resize(),this.fitBounds(i.bounds,e.e({},i.fitBoundsOptions,{duration:0})))),this.resize(),this._localIdeographFontFamily=i.localIdeographFontFamily,this._validateStyle=i.validateStyle,i.style&&this.setStyle(i.style,{localIdeographFontFamily:i.localIdeographFontFamily}),i.attributionControl&&this.addControl(new In("boolean"==typeof i.attributionControl?void 0:i.attributionControl)),i.maplibreLogo&&this.addControl(new Cn,i.logoPosition),this.on("style.load",(()=>{this.transform.unmodified&&this.jumpTo(this.style.stylesheet)})),this.on("data",(t=>{this._update("style"===t.dataType),this.fire(new e.k(`${t.dataType}data`,t))})),this.on("dataloading",(t=>{this.fire(new e.k(`${t.dataType}dataloading`,t))})),this.on("dataabort",(t=>{this.fire(new e.k("sourcedataabort",t))}))}_getMapId(){return this._mapId}addControl(t,i){if(void 0===i&&(i=t.getDefaultPosition?t.getDefaultPosition():"top-right"),!t||!t.onAdd)return this.fire(new e.j(new Error("Invalid argument to map.addControl(). Argument must be a control with onAdd and onRemove methods.")));const r=t.onAdd(this);this._controls.push(t);const n=this._controlPositions[i];return-1!==i.indexOf("bottom")?n.insertBefore(r,n.firstChild):n.appendChild(r),this}removeControl(t){if(!t||!t.onRemove)return this.fire(new e.j(new Error("Invalid argument to map.removeControl(). Argument must be a control with onAdd and onRemove methods.")));const i=this._controls.indexOf(t);return i>-1&&this._controls.splice(i,1),t.onRemove(this),this}hasControl(t){return this._controls.indexOf(t)>-1}calculateCameraOptionsFromTo(t,e,i,r){return null==r&&this.terrain&&(r=this.terrain.getElevationForLngLatZoom(i,this.transform.tileZoom)),super.calculateCameraOptionsFromTo(t,e,i,r)}resize(t){var i;const r=this._containerDimensions(),n=r[0],o=r[1],a=this._getClampedPixelRatio(n,o);if(this._resizeCanvas(n,o,a),this.painter.resize(n,o,a),this.painter.overLimit()){const t=this.painter.context.gl;this._maxCanvasSize=[t.drawingBufferWidth,t.drawingBufferHeight];const e=this._getClampedPixelRatio(n,o);this._resizeCanvas(n,o,e),this.painter.resize(n,o,e)}this.transform.resize(n,o),null===(i=this._requestedCameraState)||void 0===i||i.resize(n,o);const s=!this._moving;return s&&(this.stop(),this.fire(new e.k("movestart",t)).fire(new e.k("move",t))),this.fire(new e.k("resize",t)),s&&this.fire(new e.k("moveend",t)),this}_getClampedPixelRatio(t,e){const{0:i,1:r}=this._maxCanvasSize,n=this.getPixelRatio(),o=t*n,a=e*n;return Math.min(o>i?i/o:1,a>r?r/a:1)*n}getPixelRatio(){var t;return null!==(t=this._overridePixelRatio)&&void 0!==t?t:devicePixelRatio}setPixelRatio(t){this._overridePixelRatio=t,this.resize()}getBounds(){return this.transform.getBounds()}getMaxBounds(){return this.transform.getMaxBounds()}setMaxBounds(t){return this.transform.setMaxBounds(H.convert(t)),this._update()}setMinZoom(t){if((t=null==t?-2:t)>=-2&&t<=this.transform.maxZoom)return this.transform.minZoom=t,this._update(),this.getZoom()<t&&this.setZoom(t),this;throw new Error("minZoom must be between -2 and the current maxZoom, inclusive")}getMinZoom(){return this.transform.minZoom}setMaxZoom(t){if((t=null==t?22:t)>=this.transform.minZoom)return this.transform.maxZoom=t,this._update(),this.getZoom()>t&&this.setZoom(t),this;throw new Error("maxZoom must be greater than the current minZoom")}getMaxZoom(){return this.transform.maxZoom}setMinPitch(t){if((t=null==t?0:t)<0)throw new Error("minPitch must be greater than or equal to 0");if(t>=0&&t<=this.transform.maxPitch)return this.transform.minPitch=t,this._update(),this.getPitch()<t&&this.setPitch(t),this;throw new Error("minPitch must be between 0 and the current maxPitch, inclusive")}getMinPitch(){return this.transform.minPitch}setMaxPitch(t){if((t=null==t?60:t)>85)throw new Error("maxPitch must be less than or equal to 85");if(t>=this.transform.minPitch)return this.transform.maxPitch=t,this._update(),this.getPitch()>t&&this.setPitch(t),this;throw new Error("maxPitch must be greater than the current minPitch")}getMaxPitch(){return this.transform.maxPitch}getRenderWorldCopies(){return this.transform.renderWorldCopies}setRenderWorldCopies(t){return this.transform.renderWorldCopies=t,this._update()}project(t){return this.transform.locationPoint(e.N.convert(t),this.style&&this.terrain)}unproject(t){return this.transform.pointLocation(e.P.convert(t),this.terrain)}isMoving(){var t;return this._moving||(null===(t=this.handlers)||void 0===t?void 0:t.isMoving())}isZooming(){var t;return this._zooming||(null===(t=this.handlers)||void 0===t?void 0:t.isZooming())}isRotating(){var t;return this._rotating||(null===(t=this.handlers)||void 0===t?void 0:t.isRotating())}_createDelegatedListener(t,e,i){if("mouseenter"===t||"mouseover"===t){let r=!1;const n=n=>{const o=e.filter((t=>this.getLayer(t))),a=0!==o.length?this.queryRenderedFeatures(n.point,{layers:o}):[];a.length?r||(r=!0,i.call(this,new Dr(t,this,n.originalEvent,{features:a}))):r=!1};return{layers:e,listener:i,delegates:{mousemove:n,mouseout:()=>{r=!1}}}}if("mouseleave"===t||"mouseout"===t){let r=!1;const n=n=>{const o=e.filter((t=>this.getLayer(t)));(0!==o.length?this.queryRenderedFeatures(n.point,{layers:o}):[]).length?r=!0:r&&(r=!1,i.call(this,new Dr(t,this,n.originalEvent)))},o=e=>{r&&(r=!1,i.call(this,new Dr(t,this,e.originalEvent)))};return{layers:e,listener:i,delegates:{mousemove:n,mouseout:o}}}{const r=t=>{const r=e.filter((t=>this.getLayer(t))),n=0!==r.length?this.queryRenderedFeatures(t.point,{layers:r}):[];n.length&&(t.features=n,i.call(this,t),delete t.features)};return{layers:e,listener:i,delegates:{[t]:r}}}}_saveDelegatedListener(t,e){this._delegatedListeners=this._delegatedListeners||{},this._delegatedListeners[t]=this._delegatedListeners[t]||[],this._delegatedListeners[t].push(e)}_removeDelegatedListener(t,e,i){if(!this._delegatedListeners||!this._delegatedListeners[t])return;const r=this._delegatedListeners[t];for(let n=0;n<r.length;n++){const t=r[n];if(t.listener===i&&t.layers.length===e.length&&t.layers.every((t=>e.includes(t)))){for(const e in t.delegates)this.off(e,t.delegates[e]);return void r.splice(n,1)}}}on(t,e,i){if(void 0===i)return super.on(t,e);const r=this._createDelegatedListener(t,"string"==typeof e?[e]:e,i);this._saveDelegatedListener(t,r);for(const n in r.delegates)this.on(n,r.delegates[n]);return this}once(t,e,i){if(void 0===i)return super.once(t,e);const r="string"==typeof e?[e]:e,n=this._createDelegatedListener(t,r,i);for(const o in n.delegates){const e=n.delegates[o];n.delegates[o]=(...n)=>{this._removeDelegatedListener(t,r,i),e(...n)}}this._saveDelegatedListener(t,n);for(const o in n.delegates)this.once(o,n.delegates[o]);return this}off(t,e,i){return void 0===i?super.off(t,e):(this._removeDelegatedListener(t,"string"==typeof e?[e]:e,i),this)}queryRenderedFeatures(t,i){if(!this.style)return[];let r;const n=t instanceof e.P||Array.isArray(t),o=n?t:[[0,0],[this.transform.width,this.transform.height]];if(i=i||(n?{}:t)||{},o instanceof e.P||"number"==typeof o[0])r=[e.P.convert(o)];else{const t=e.P.convert(o[0]),i=e.P.convert(o[1]);r=[t,new e.P(i.x,t.y),i,new e.P(t.x,i.y),t]}return this.style.queryRenderedFeatures(r,i,this.transform)}querySourceFeatures(t,e){return this.style.querySourceFeatures(t,e)}setStyle(t,i){return!1!==(i=e.e({},{localIdeographFontFamily:this._localIdeographFontFamily,validate:this._validateStyle},i)).diff&&i.localIdeographFontFamily===this._localIdeographFontFamily&&this.style&&t?(this._diffStyle(t,i),this):(this._localIdeographFontFamily=i.localIdeographFontFamily,this._updateStyle(t,i))}setTransformRequest(t){return this._requestManager.setTransformRequest(t),this}_getUIString(t){const e=this._locale[t];if(null==e)throw new Error(`Missing UI string '${t}'`);return e}_updateStyle(t,e){if(e.transformStyle&&this.style&&!this.style._loaded)return void this.style.once("style.load",(()=>this._updateStyle(t,e)));const i=this.style&&e.transformStyle?this.style.serialize():void 0;return this.style&&(this.style.setEventedParent(null),this.style._remove(!t)),t?(this.style=new de(this,e||{}),this.style.setEventedParent(this,{style:this.style}),"string"==typeof t?this.style.loadURL(t,e,i):this.style.loadJSON(t,e,i),this):(delete this.style,this)}_lazyInitEmptyStyle(){this.style||(this.style=new de(this,{}),this.style.setEventedParent(this,{style:this.style}),this.style.loadEmpty())}_diffStyle(t,i){if("string"==typeof t){const r=this._requestManager.transformRequest(t,"Style");e.h(r,new AbortController).then((t=>{this._updateDiff(t.data,i)})).catch((t=>{t&&this.fire(new e.j(t))}))}else"object"==typeof t&&this._updateDiff(t,i)}_updateDiff(t,i){try{this.style.setState(t,i)&&this._update(!0)}catch(r){e.w(`Unable to perform style diff: ${r.message||r.error||r}. Rebuilding the style from scratch.`),this._updateStyle(t,i)}}getStyle(){if(this.style)return this.style.serialize()}isStyleLoaded(){return this.style?this.style.loaded():e.w("There is no style added to the map.")}addSource(t,e){return this._lazyInitEmptyStyle(),this.style.addSource(t,e),this._update(!0)}isSourceLoaded(t){const i=this.style&&this.style.sourceCaches[t];if(void 0!==i)return i.loaded();this.fire(new e.j(new Error(`There is no source with ID '${t}'`)))}setTerrain(t){if(this.style._checkLoaded(),this._terrainDataCallback&&this.style.off("data",this._terrainDataCallback),t){const i=this.style.sourceCaches[t.source];if(!i)throw new Error(`cannot load terrain, because there exists no source with ID: ${t.source}`);null===this.terrain&&i.reload();for(const r in this.style._layers){const i=this.style._layers[r];"hillshade"===i.type&&i.source===t.source&&e.w("You are using the same source for a hillshade layer and for 3D terrain. Please consider using two separate sources to improve rendering quality.")}this.terrain=new Mn(this.painter,i,t),this.painter.renderToTexture=new Dn(this.painter,this.terrain),this.transform.minElevationForCurrentTile=this.terrain.getMinTileElevationForLngLatZoom(this.transform.center,this.transform.tileZoom),this.transform.elevation=this.terrain.getElevationForLngLatZoom(this.transform.center,this.transform.tileZoom),this._terrainDataCallback=e=>{"style"===e.dataType?this.terrain.sourceCache.freeRtt():"source"===e.dataType&&e.tile&&(e.sourceId!==t.source||this._elevationFreeze||(this.transform.minElevationForCurrentTile=this.terrain.getMinTileElevationForLngLatZoom(this.transform.center,this.transform.tileZoom),this.transform.elevation=this.terrain.getElevationForLngLatZoom(this.transform.center,this.transform.tileZoom)),this.terrain.sourceCache.freeRtt(e.tile.tileID))},this.style.on("data",this._terrainDataCallback)}else this.terrain&&this.terrain.sourceCache.destruct(),this.terrain=null,this.painter.renderToTexture&&this.painter.renderToTexture.destruct(),this.painter.renderToTexture=null,this.transform.minElevationForCurrentTile=0,this.transform.elevation=0;return this.fire(new e.k("terrain",{terrain:t})),this}getTerrain(){var t,e;return null!==(e=null===(t=this.terrain)||void 0===t?void 0:t.options)&&void 0!==e?e:null}areTilesLoaded(){const t=this.style&&this.style.sourceCaches;for(const e in t){const i=t[e]._tiles;for(const t in i){const e=i[t];if("loaded"!==e.state&&"errored"!==e.state)return!1}}return!0}removeSource(t){return this.style.removeSource(t),this._update(!0)}getSource(t){return this.style.getSource(t)}addImage(t,i,r={}){const{pixelRatio:n=1,sdf:a=!1,stretchX:s,stretchY:l,content:c,textFitWidth:u,textFitHeight:h}=r;if(this._lazyInitEmptyStyle(),!(i instanceof HTMLImageElement||e.b(i))){if(void 0===i.width||void 0===i.height)return this.fire(new e.j(new Error("Invalid arguments to map.addImage(). The second argument must be an `HTMLImageElement`, `ImageData`, `ImageBitmap`, or object with `width`, `height`, and `data` properties with the same format as `ImageData`")));{const{width:r,height:o,data:d}=i,p=i;return this.style.addImage(t,{data:new e.R({width:r,height:o},new Uint8Array(d)),pixelRatio:n,stretchX:s,stretchY:l,content:c,textFitWidth:u,textFitHeight:h,sdf:a,version:0,userImage:p}),p.onAdd&&p.onAdd(this,t),this}}{const{width:r,height:d,data:p}=o.getImageData(i);this.style.addImage(t,{data:new e.R({width:r,height:d},p),pixelRatio:n,stretchX:s,stretchY:l,content:c,textFitWidth:u,textFitHeight:h,sdf:a,version:0})}}updateImage(t,i){const r=this.style.getImage(t);if(!r)return this.fire(new e.j(new Error("The map has no image with that id. If you are adding a new image use `map.addImage(...)` instead.")));const n=i instanceof HTMLImageElement||e.b(i)?o.getImageData(i):i,{width:a,height:s,data:l}=n;if(void 0===a||void 0===s)return this.fire(new e.j(new Error("Invalid arguments to map.updateImage(). The second argument must be an `HTMLImageElement`, `ImageData`, `ImageBitmap`, or object with `width`, `height`, and `data` properties with the same format as `ImageData`")));if(a!==r.data.width||s!==r.data.height)return this.fire(new e.j(new Error("The width and height of the updated image must be that same as the previous version of the image")));const c=!(i instanceof HTMLImageElement||e.b(i));return r.data.replace(l,c),this.style.updateImage(t,r),this}getImage(t){return this.style.getImage(t)}hasImage(t){return t?!!this.style.getImage(t):(this.fire(new e.j(new Error("Missing required image id"))),!1)}removeImage(t){this.style.removeImage(t)}loadImage(t){return p.getImage(this._requestManager.transformRequest(t,"Image"),new AbortController)}listImages(){return this.style.listImages()}addLayer(t,e){return this._lazyInitEmptyStyle(),this.style.addLayer(t,e),this._update(!0)}moveLayer(t,e){return this.style.moveLayer(t,e),this._update(!0)}removeLayer(t){return this.style.removeLayer(t),this._update(!0)}getLayer(t){return this.style.getLayer(t)}getLayersOrder(){return this.style.getLayersOrder()}setLayerZoomRange(t,e,i){return this.style.setLayerZoomRange(t,e,i),this._update(!0)}setFilter(t,e,i={}){return this.style.setFilter(t,e,i),this._update(!0)}getFilter(t){return this.style.getFilter(t)}setPaintProperty(t,e,i,r={}){return this.style.setPaintProperty(t,e,i,r),this._update(!0)}getPaintProperty(t,e){return this.style.getPaintProperty(t,e)}setLayoutProperty(t,e,i,r={}){return this.style.setLayoutProperty(t,e,i,r),this._update(!0)}getLayoutProperty(t,e){return this.style.getLayoutProperty(t,e)}setGlyphs(t,e={}){return this._lazyInitEmptyStyle(),this.style.setGlyphs(t,e),this._update(!0)}getGlyphs(){return this.style.getGlyphsUrl()}addSprite(t,e,i={}){return this._lazyInitEmptyStyle(),this.style.addSprite(t,e,i,(t=>{t||this._update(!0)})),this}removeSprite(t){return this._lazyInitEmptyStyle(),this.style.removeSprite(t),this._update(!0)}getSprite(){return this.style.getSprite()}setSprite(t,e={}){return this._lazyInitEmptyStyle(),this.style.setSprite(t,e,(t=>{t||this._update(!0)})),this}setLight(t,e={}){return this._lazyInitEmptyStyle(),this.style.setLight(t,e),this._update(!0)}getLight(){return this.style.getLight()}setSky(t){return this._lazyInitEmptyStyle(),this.style.setSky(t),this._update(!0)}getSky(){return this.style.getSky()}setFeatureState(t,e){return this.style.setFeatureState(t,e),this._update()}removeFeatureState(t,e){return this.style.removeFeatureState(t,e),this._update()}getFeatureState(t){return this.style.getFeatureState(t)}getContainer(){return this._container}getCanvasContainer(){return this._canvasContainer}getCanvas(){return this._canvas}_containerDimensions(){let t=0,e=0;return this._container&&(t=this._container.clientWidth||400,e=this._container.clientHeight||300),[t,e]}_setupContainer(){const t=this._container;t.classList.add("maplibregl-map");const e=this._canvasContainer=a.create("div","maplibregl-canvas-container",t);this._interactive&&e.classList.add("maplibregl-interactive"),this._canvas=a.create("canvas","maplibregl-canvas",e),this._canvas.addEventListener("webglcontextlost",this._contextLost,!1),this._canvas.addEventListener("webglcontextrestored",this._contextRestored,!1),this._canvas.setAttribute("tabindex",this._interactive?"0":"-1"),this._canvas.setAttribute("aria-label",this._getUIString("Map.Title")),this._canvas.setAttribute("role","region");const i=this._containerDimensions(),r=this._getClampedPixelRatio(i[0],i[1]);this._resizeCanvas(i[0],i[1],r);const n=this._controlContainer=a.create("div","maplibregl-control-container",t),o=this._controlPositions={};["top-left","top-right","bottom-left","bottom-right"].forEach((t=>{o[t]=a.create("div",`maplibregl-ctrl-${t} `,n)})),this._container.addEventListener("scroll",this._onMapScroll,!1)}_resizeCanvas(t,e,i){this._canvas.width=Math.floor(i*t),this._canvas.height=Math.floor(i*e),this._canvas.style.width=`${t}px`,this._canvas.style.height=`${e}px`}_setupPainter(){const t={alpha:!0,stencil:!0,depth:!0,failIfMajorPerformanceCaveat:this._failIfMajorPerformanceCaveat,preserveDrawingBuffer:this._preserveDrawingBuffer,antialias:this._antialias||!1};let e=null;this._canvas.addEventListener("webglcontextcreationerror",(i=>{e={requestedAttributes:t},i&&(e.statusMessage=i.statusMessage,e.type=i.type)}),{once:!0});const i=this._canvas.getContext("webgl2",t)||this._canvas.getContext("webgl",t);if(!i){const t="Failed to initialize WebGL";throw e?(e.message=t,new Error(JSON.stringify(e))):new Error(t)}this.painter=new _r(i,this.transform),s.testSupport(i)}loaded(){return!this._styleDirty&&!this._sourcesDirty&&!!this.style&&this.style.loaded()}_update(t){return this.style&&this.style._loaded?(this._styleDirty=this._styleDirty||t,this._sourcesDirty=!0,this.triggerRepaint(),this):this}_requestRenderFrame(t){return this._update(),this._renderTaskQueue.add(t)}_cancelRenderFrame(t){this._renderTaskQueue.remove(t)}_render(t){const i=this._idleTriggered?this._fadeDuration:0;if(this.painter.context.setDirty(),this.painter.setBaseState(),this._renderTaskQueue.run(t),this._removed)return;let r=!1;if(this.style&&this._styleDirty){this._styleDirty=!1;const t=this.transform.zoom,n=o.now();this.style.zoomHistory.update(t,n);const a=new e.z(t,{now:n,fadeDuration:i,zoomHistory:this.style.zoomHistory,transition:this.style.getTransition()}),s=a.crossFadingFactor();1===s&&s===this._crossFadingFactor||(r=!0,this._crossFadingFactor=s),this.style.update(a)}this.style&&this._sourcesDirty&&(this._sourcesDirty=!1,this.style._updateSources(this.transform)),this.terrain?(this.terrain.sourceCache.update(this.transform,this.terrain),this.transform.minElevationForCurrentTile=this.terrain.getMinTileElevationForLngLatZoom(this.transform.center,this.transform.tileZoom),this._elevationFreeze||(this.transform.elevation=this.terrain.getElevationForLngLatZoom(this.transform.center,this.transform.tileZoom))):(this.transform.minElevationForCurrentTile=0,this.transform.elevation=0),this._placementDirty=this.style&&this.style._updatePlacement(this.painter.transform,this.showCollisionBoxes,i,this._crossSourceCollisions),this.painter.render(this.style,{showTileBoundaries:this.showTileBoundaries,showOverdrawInspector:this._showOverdrawInspector,rotating:this.isRotating(),zooming:this.isZooming(),moving:this.isMoving(),fadeDuration:i,showPadding:this.showPadding}),this.fire(new e.k("render")),this.loaded()&&!this._loaded&&(this._loaded=!0,e.bf.mark(e.bg.load),this.fire(new e.k("load"))),this.style&&(this.style.hasTransitions()||r)&&(this._styleDirty=!0),this.style&&!this._placementDirty&&this.style._releaseSymbolFadeTiles();const n=this._sourcesDirty||this._styleDirty||this._placementDirty;return n||this._repaint?this.triggerRepaint():!this.isMoving()&&this.loaded()&&this.fire(new e.k("idle")),!this._loaded||this._fullyLoaded||n||(this._fullyLoaded=!0,e.bf.mark(e.bg.fullLoad)),this}redraw(){return this.style&&(this._frameRequest&&(this._frameRequest.abort(),this._frameRequest=null),this._render(0)),this}remove(){var t;this._hash&&this._hash.remove();for(const e of this._controls)e.onRemove(this);this._controls=[],this._frameRequest&&(this._frameRequest.abort(),this._frameRequest=null),this._renderTaskQueue.clear(),this.painter.destroy(),this.handlers.destroy(),delete this.handlers,this.setStyle(null),"undefined"!=typeof window&&removeEventListener("online",this._onWindowOnline,!1),p.removeThrottleControl(this._imageQueueHandle),null===(t=this._resizeObserver)||void 0===t||t.disconnect();const i=this.painter.context.gl.getExtension("WEBGL_lose_context");(null==i?void 0:i.loseContext)&&i.loseContext(),this._canvas.removeEventListener("webglcontextrestored",this._contextRestored,!1),this._canvas.removeEventListener("webglcontextlost",this._contextLost,!1),a.remove(this._canvasContainer),a.remove(this._controlContainer),this._container.classList.remove("maplibregl-map"),e.bf.clearMetrics(),this._removed=!0,this.fire(new e.k("remove"))}triggerRepaint(){this.style&&!this._frameRequest&&(this._frameRequest=new AbortController,o.frameAsync(this._frameRequest).then((t=>{e.bf.frame(t),this._frameRequest=null,this._render(t)})).catch((()=>{})))}get showTileBoundaries(){return!!this._showTileBoundaries}set showTileBoundaries(t){this._showTileBoundaries!==t&&(this._showTileBoundaries=t,this._update())}get showPadding(){return!!this._showPadding}set showPadding(t){this._showPadding!==t&&(this._showPadding=t,this._update())}get showCollisionBoxes(){return!!this._showCollisionBoxes}set showCollisionBoxes(t){this._showCollisionBoxes!==t&&(this._showCollisionBoxes=t,t?this.style._generateCollisionBoxes():this._update())}get showOverdrawInspector(){return!!this._showOverdrawInspector}set showOverdrawInspector(t){this._showOverdrawInspector!==t&&(this._showOverdrawInspector=t,this._update())}get repaint(){return!!this._repaint}set repaint(t){this._repaint!==t&&(this._repaint=t,this.triggerRepaint())}get vertices(){return!!this._vertices}set vertices(t){this._vertices=t,this._update()}get version(){return On}getCameraTargetElevation(){return this.transform.elevation}},t.MapMouseEvent=Dr,t.MapTouchEvent=Rr,t.MapWheelEvent=Or,t.Marker=Gn,t.NavigationControl=class{constructor(t){this._updateZoomButtons=()=>{const t=this._map.getZoom(),e=t===this._map.getMaxZoom(),i=t===this._map.getMinZoom();this._zoomInButton.disabled=e,this._zoomOutButton.disabled=i,this._zoomInButton.setAttribute("aria-disabled",e.toString()),this._zoomOutButton.setAttribute("aria-disabled",i.toString())},this._rotateCompassArrow=()=>{const t=this.options.visualizePitch?`scale(${1/Math.pow(Math.cos(this._map.transform.pitch*(Math.PI/180)),.5)}) rotateX(${this._map.transform.pitch}deg) rotateZ(${this._map.transform.angle*(180/Math.PI)}deg)`:`rotate(${this._map.transform.angle*(180/Math.PI)}deg)`;this._compassIcon.style.transform=t},this._setButtonTitle=(t,e)=>{const i=this._map._getUIString(`NavigationControl.${e}`);t.title=i,t.setAttribute("aria-label",i)},this.options=e.e({},Nn,t),this._container=a.create("div","maplibregl-ctrl maplibregl-ctrl-group"),this._container.addEventListener("contextmenu",(t=>t.preventDefault())),this.options.showZoom&&(this._zoomInButton=this._createButton("maplibregl-ctrl-zoom-in",(t=>this._map.zoomIn({},{originalEvent:t}))),a.create("span","maplibregl-ctrl-icon",this._zoomInButton).setAttribute("aria-hidden","true"),this._zoomOutButton=this._createButton("maplibregl-ctrl-zoom-out",(t=>this._map.zoomOut({},{originalEvent:t}))),a.create("span","maplibregl-ctrl-icon",this._zoomOutButton).setAttribute("aria-hidden","true")),this.options.showCompass&&(this._compass=this._createButton("maplibregl-ctrl-compass",(t=>{this.options.visualizePitch?this._map.resetNorthPitch({},{originalEvent:t}):this._map.resetNorth({},{originalEvent:t})})),this._compassIcon=a.create("span","maplibregl-ctrl-icon",this._compass),this._compassIcon.setAttribute("aria-hidden","true"))}onAdd(t){return this._map=t,this.options.showZoom&&(this._setButtonTitle(this._zoomInButton,"ZoomIn"),this._setButtonTitle(this._zoomOutButton,"ZoomOut"),this._map.on("zoom",this._updateZoomButtons),this._updateZoomButtons()),this.options.showCompass&&(this._setButtonTitle(this._compass,"ResetBearing"),this.options.visualizePitch&&this._map.on("pitch",this._rotateCompassArrow),this._map.on("rotate",this._rotateCompassArrow),this._rotateCompassArrow(),this._handler=new jn(this._map,this._compass,this.options.visualizePitch)),this._container}onRemove(){a.remove(this._container),this.options.showZoom&&this._map.off("zoom",this._updateZoomButtons),this.options.showCompass&&(this.options.visualizePitch&&this._map.off("pitch",this._rotateCompassArrow),this._map.off("rotate",this._rotateCompassArrow),this._handler.off(),delete this._handler),delete this._map}_createButton(t,e){const i=a.create("button",t,this._container);return i.type="button",i.addEventListener("click",e),i}},t.Popup=class extends e.E{constructor(t){super(),this.remove=()=>(this._content&&a.remove(this._content),this._container&&(a.remove(this._container),delete this._container),this._map&&(this._map.off("move",this._update),this._map.off("move",this._onClose),this._map.off("click",this._onClose),this._map.off("remove",this.remove),this._map.off("mousemove",this._onMouseMove),this._map.off("mouseup",this._onMouseUp),this._map.off("drag",this._onDrag),this._map._canvasContainer.classList.remove("maplibregl-track-pointer"),delete this._map,this.fire(new e.k("close"))),this),this._onMouseUp=t=>{this._update(t.point)},this._onMouseMove=t=>{this._update(t.point)},this._onDrag=t=>{this._update(t.point)},this._update=t=>{var e;if(!this._map||!this._lngLat&&!this._trackPointer||!this._content)return;if(!this._container){if(this._container=a.create("div","maplibregl-popup",this._map.getContainer()),this._tip=a.create("div","maplibregl-popup-tip",this._container),this._container.appendChild(this._content),this.options.className)for(const t of this.options.className.split(" "))this._container.classList.add(t);this._closeButton&&this._closeButton.setAttribute("aria-label",this._map._getUIString("Popup.Close")),this._trackPointer&&this._container.classList.add("maplibregl-popup-track-pointer")}if(this.options.maxWidth&&this._container.style.maxWidth!==this.options.maxWidth&&(this._container.style.maxWidth=this.options.maxWidth),this._lngLat=this._map.transform.renderWorldCopies&&!this._trackPointer?Un(this._lngLat,this._flatPos,this._map.transform):null===(e=this._lngLat)||void 0===e?void 0:e.wrap(),this._trackPointer&&!t)return;const i=this._flatPos=this._pos=this._trackPointer&&t?t:this._map.project(this._lngLat);this._map.terrain&&(this._flatPos=this._trackPointer&&t?t:this._map.transform.locationPoint(this._lngLat));let r=this.options.anchor;const n=to(this.options.offset);if(!r){const t=this._container.offsetWidth,e=this._container.offsetHeight;let o;o=i.y+n.bottom.y<e?["top"]:i.y>this._map.transform.height-e?["bottom"]:[],i.x<t/2?o.push("left"):i.x>this._map.transform.width-t/2&&o.push("right"),r=0===o.length?"bottom":o.join("-")}let o=i.add(n[r]);this.options.subpixelPositioning||(o=o.round()),a.setTransform(this._container,`${qn[r]} translate(${o.x}px,${o.y}px)`),$n(this._container,r,"popup")},this._onClose=()=>{this.remove()},this.options=e.e(Object.create(Yn),t)}addTo(t){return this._map&&this.remove(),this._map=t,this.options.closeOnClick&&this._map.on("click",this._onClose),this.options.closeOnMove&&this._map.on("move",this._onClose),this._map.on("remove",this.remove),this._update(),this._focusFirstElement(),this._trackPointer?(this._map.on("mousemove",this._onMouseMove),this._map.on("mouseup",this._onMouseUp),this._container&&this._container.classList.add("maplibregl-popup-track-pointer"),this._map._canvasContainer.classList.add("maplibregl-track-pointer")):this._map.on("move",this._update),this.fire(new e.k("open")),this}isOpen(){return!!this._map}getLngLat(){return this._lngLat}setLngLat(t){return this._lngLat=e.N.convert(t),this._pos=null,this._flatPos=null,this._trackPointer=!1,this._update(),this._map&&(this._map.on("move",this._update),this._map.off("mousemove",this._onMouseMove),this._container&&this._container.classList.remove("maplibregl-popup-track-pointer"),this._map._canvasContainer.classList.remove("maplibregl-track-pointer")),this}trackPointer(){return this._trackPointer=!0,this._pos=null,this._flatPos=null,this._update(),this._map&&(this._map.off("move",this._update),this._map.on("mousemove",this._onMouseMove),this._map.on("drag",this._onDrag),this._container&&this._container.classList.add("maplibregl-popup-track-pointer"),this._map._canvasContainer.classList.add("maplibregl-track-pointer")),this}getElement(){return this._container}setText(t){return this.setDOMContent(document.createTextNode(t))}setHTML(t){const e=document.createDocumentFragment(),i=document.createElement("body");let r;for(i.innerHTML=t;r=i.firstChild,r;)e.appendChild(r);return this.setDOMContent(e)}getMaxWidth(){var t;return null===(t=this._container)||void 0===t?void 0:t.style.maxWidth}setMaxWidth(t){return this.options.maxWidth=t,this._update(),this}setDOMContent(t){if(this._content)for(;this._content.hasChildNodes();)this._content.firstChild&&this._content.removeChild(this._content.firstChild);else this._content=a.create("div","maplibregl-popup-content",this._container);return this._content.appendChild(t),this._createCloseButton(),this._update(),this._focusFirstElement(),this}addClassName(t){return this._container&&this._container.classList.add(t),this}removeClassName(t){return this._container&&this._container.classList.remove(t),this}setOffset(t){return this.options.offset=t,this._update(),this}toggleClassName(t){if(this._container)return this._container.classList.toggle(t)}setSubpixelPositioning(t){this.options.subpixelPositioning=t}_createCloseButton(){this.options.closeButton&&(this._closeButton=a.create("button","maplibregl-popup-close-button",this._content),this._closeButton.type="button",this._closeButton.innerHTML="&#215;",this._closeButton.addEventListener("click",this._onClose))}_focusFirstElement(){if(!this.options.focusAfterOpen||!this._container)return;const t=this._container.querySelector(Qn);t&&t.focus()}},t.RasterDEMTileSource=J,t.RasterTileSource=X,t.ScaleControl=class{constructor(t){this._onMove=()=>{Jn(this._map,this._container,this.options)},this.setUnit=t=>{this.options.unit=t,Jn(this._map,this._container,this.options)},this.options=Object.assign(Object.assign({},Xn),t)}getDefaultPosition(){return"bottom-left"}onAdd(t){return this._map=t,this._container=a.create("div","maplibregl-ctrl maplibregl-ctrl-scale",t.getContainer()),this._map.on("move",this._onMove),this._onMove(),this._container}onRemove(){a.remove(this._container),this._map.off("move",this._onMove),this._map=void 0}},t.ScrollZoomHandler=dn,t.Style=de,t.TerrainControl=class{constructor(t){this._toggleTerrain=()=>{this._map.getTerrain()?this._map.setTerrain(null):this._map.setTerrain(this.options),this._updateTerrainIcon()},this._updateTerrainIcon=()=>{this._terrainButton.classList.remove("maplibregl-ctrl-terrain"),this._terrainButton.classList.remove("maplibregl-ctrl-terrain-enabled"),this._map.terrain?(this._terrainButton.classList.add("maplibregl-ctrl-terrain-enabled"),this._terrainButton.title=this._map._getUIString("TerrainControl.Disable")):(this._terrainButton.classList.add("maplibregl-ctrl-terrain"),this._terrainButton.title=this._map._getUIString("TerrainControl.Enable"))},this.options=t}onAdd(t){return this._map=t,this._container=a.create("div","maplibregl-ctrl maplibregl-ctrl-group"),this._terrainButton=a.create("button","maplibregl-ctrl-terrain",this._container),a.create("span","maplibregl-ctrl-icon",this._terrainButton).setAttribute("aria-hidden","true"),this._terrainButton.type="button",this._terrainButton.addEventListener("click",this._toggleTerrain),this._updateTerrainIcon(),this._map.on("terrain",this._updateTerrainIcon),this._container}onRemove(){a.remove(this._container),this._map.off("terrain",this._updateTerrainIcon),this._map=void 0}},t.TwoFingersTouchPitchHandler=sn,t.TwoFingersTouchRotateHandler=on,t.TwoFingersTouchZoomHandler=rn,t.TwoFingersTouchZoomRotateHandler=_n,t.VectorTileSource=W,t.VideoSource=tt,t.addSourceType=(t,i)=>e._(void 0,void 0,void 0,(function*(){if(rt(t))throw new Error(`A source type called "${t}" already exists.`);((t,e)=>{it[t]=e})(t,i)})),t.clearPrewarmedResources=function(){const t=F;t&&(t.isPreloaded()&&1===t.numActive()?(t.release(D),F=null):console.warn("Could not clear WebWorkers since there are active Map instances that still reference it. The pre-warmed WebWorker pool can only be cleared when all map instances have been removed with map.remove()"))},t.getMaxParallelImageRequests=function(){return e.a.MAX_PARALLEL_IMAGE_REQUESTS},t.getRTLTextPluginStatus=function(){return st().getRTLTextPluginStatus()},t.getVersion=function(){return eo},t.getWorkerCount=function(){return R.workerCount},t.getWorkerUrl=function(){return e.a.WORKER_URL},t.importScriptInWorkers=function(t){return V().broadcast("IS",t)},t.prewarm=function(){N().acquire(D)},t.setMaxParallelImageRequests=function(t){e.a.MAX_PARALLEL_IMAGE_REQUESTS=t},t.setRTLTextPlugin=function(t,e){return st().setRTLTextPlugin(t,e)},t.setWorkerCount=function(t){R.workerCount=t},t.setWorkerUrl=function(t){e.a.WORKER_URL=t}})),t}()}},e={};function i(r){var n=e[r];if(void 0!==n)return n.exports;var o=e[r]={exports:{}};return t[r].call(o.exports,o,o.exports,i),o.exports}i.n=t=>{var e=t&&t.__esModule?()=>t.default:()=>t;return i.d(e,{a:e}),e},i.d=(t,e)=>{for(var r in e)i.o(e,r)&&!i.o(t,r)&&Object.defineProperty(t,r,{enumerable:!0,get:e[r]})},i.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),i.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})};var r={};return(()=>{i.r(r),i.d(r,{AnimationConfig:()=>n.AnimationConfig,AnimationDrawingConfig:()=>n.AnimationDrawingConfig,AnimationStatus:()=>n.AnimationStatus,BasicCategory:()=>s.BasicCategory,BasicWithIcon:()=>s.BasicWithIcon,BasicWithLogo:()=>s.BasicWithLogo,CameraAnimation:()=>f.CameraAnimation,Category:()=>s.Category,Configuration:()=>l.Configuration,CssComponent:()=>c.CssComponent,CssCustomization:()=>c.CssCustomization,CssDefinitions:()=>c.CssDefinitions,CssElement:()=>c.CssElement,CssScreen:()=>c.CssScreen,CssTheme:()=>c.CssTheme,DrawRouteConfiguration:()=>e.DrawRouteConfiguration,FitOptions:()=>u.FitOptions,GetRouteConfiguration:()=>e.GetRouteConfiguration,GradientStyle:()=>_.GradientStyle,IdLocation:()=>e.IdLocation,InnerFloor:()=>h.InnerFloor,Institution:()=>re,InternalLinkCategory:()=>s.InternalLinkCategory,LatLng:()=>d.LatLng,LazarilloMap:()=>a.LazarilloMap,LazarilloSDK:()=>v.LazarilloSDK,LzLocation:()=>p.LzLocation,LzPlace:()=>Kt,LzRoute:()=>Nt,LzRouteLeg:()=>jt,LzRouteStep:()=>Vt,LzTransport:()=>oe,MapCamera:()=>f.MapCamera,MapConfig:()=>m.MapConfig,MarkerConfig:()=>t.MarkerConfig,MultiLanguage:()=>g.MultiLanguage,NestedCategory:()=>s.NestedCategory,OpeningHours:()=>y.OpeningHours,PhoneCategory:()=>s.PhoneCategory,PlaceCategory:()=>s.PlaceCategory,ProductCategory:()=>s.ProductCategory,Property:()=>o.Property,RouteLocation:()=>e.RouteLocation,RouteStyle:()=>_.RouteStyle,SolidStyle:()=>_.SolidStyle,TextCategory:()=>s.TextCategory,TextPosition:()=>L,UrlCategory:()=>s.UrlCategory,initializeSDK:()=>bi,isBasicWithIcon:()=>ni,isBasicWithLogo:()=>ri});var t={};i.r(t),i.d(t,{D:()=>D,x:()=>L});var e={};i.r(e),i.d(e,{D_:()=>ut,lc:()=>ct,sZ:()=>lt});var n={};i.r(n),i.d(n,{o:()=>mt,U:()=>gt});var o={};i.r(o),i.d(o,{n:()=>ee});var a={};i.r(a),i.d(a,{O:()=>ii});var s={};i.r(s),i.d(s,{Y:()=>ni,c:()=>ri});var l={};i.r(l);var c={};i.r(c);var u={};i.r(u);var h={};i.r(h);var d={};i.r(d);var p={};i.r(p);var f={};i.r(f);var m={};i.r(m);var g={};i.r(g);var y={};i.r(y);var _={};i.r(_);var v={};i.r(v),i.d(v,{f:()=>bi});var b=i(443),x=i.n(b);function w(t){var e={lat:-1/0,lng:-1/0},i={lat:1/0,lng:1/0};return t.forEach((function(t){t.lat>e.lat&&(e.lat=t.lat),t.lng>e.lng&&(e.lng=t.lng),t.lat<i.lat&&(i.lat=t.lat),t.lng<i.lng&&(i.lng=t.lng)})),[i,e]}function k(t,e,i){return e=S(e),function(t,e){if(e&&("object"==C(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(t,E()?Reflect.construct(e,i||[],S(t).constructor):e.apply(t,i))}function E(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(E=function(){return!!t})()}function S(t){return S=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},S(t)}function I(t,e){return I=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},I(t,e)}function C(t){return C="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},C(t)}function T(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function A(t,e){for(var i=0;i<e.length;i++){var r=e[i];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,M(r.key),r)}}function P(t,e,i){return e&&A(t.prototype,e),i&&A(t,i),Object.defineProperty(t,"prototype",{writable:!1}),t}function M(t){var e=function(t,e){if("object"!=C(t)||!t)return t;var i=t[Symbol.toPrimitive];if(void 0!==i){var r=i.call(t,e);if("object"!=C(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t,"string");return"symbol"==C(e)?e:e+""}var L=function(t){return t[t.left=0]="left",t[t.right=1]="right",t[t.top=2]="top",t[t.bottom=3]="bottom",t}({}),z=function(){return P((function t(){T(this,t)}),null,[{key:"createMarkerElement",value:function(t){var e=document.createElement("div");e.addEventListener("click",(function(){var e;null===(e=t.onClick)||void 0===e||e.call(t)}));var i="40px",r="40px";if(t.element){var n,o,a;e.appendChild(t.element);var s=null===(n=e.getElementsByTagName("img"))||void 0===n?void 0:n[0];return i="".concat(null!==(o=null==s?void 0:s.height)&&void 0!==o?o:40,"px"),r="".concat(null!==(a=null==s?void 0:s.width)&&void 0!==a?a:40,"px"),this.setAndCreateText(t,e,i,r)}var l=document.createElement("div");if(l.id="element",l.style.display="flex",l.style.justifyContent="center",l.style.alignItems="center",l.style.cursor="pointer",e.appendChild(l),"string"==typeof t.icon){var c=this.createIcon(t);i=c.style.height,r=c.style.width,l.appendChild(c)}else if(t.icon instanceof HTMLImageElement)i="".concat(t.icon.height,"px"),r="".concat(t.icon.width,"px"),l.appendChild(t.icon);else if(t.icon){var u,h,d,p=null===(u=t.icon.getElementsByTagName("img"))||void 0===u?void 0:u[0];i="".concat(null!==(h=null==p?void 0:p.height)&&void 0!==h?h:40,"px"),r="".concat(null!==(d=null==p?void 0:p.width)&&void 0!==d?d:40,"px"),l.appendChild(t.icon)}return this.setAndCreateText(t,l,i,r),e}},{key:"setAndCreateText",value:function(t,e,i,r){if("string"==typeof t.text){var n=this.createTextElement(t.text,t.textProperties),o=this.setMarkerTextStyle(n,i,r,t.textPosition);e.appendChild(o)}else if(t.text){var a=this.setMarkerTextStyle(t.text,i,r,t.textPosition);e.appendChild(a)}return e}},{key:"setMarkerTextStyle",value:function(t,e,i,r){switch(t.style.position="absolute",t.style.display="flex",t.style.justifyContent="center",t.style.alignItems="center",t.style.width="max-content",r){case L.top:t.style.bottom=e;break;case L.bottom:t.style.top=e;break;case L.left:t.style.right=i;break;default:t.style.left=i}return t}},{key:"createIcon",value:function(t){var e,i,r,n,o=document.createElement("img");return o.src="string"==typeof t.icon?t.icon:"",o.width=null!==(e=null===(i=t.iconProperties)||void 0===i?void 0:i.width)&&void 0!==e?e:40,o.height=null!==(r=null===(n=t.iconProperties)||void 0===n?void 0:n.height)&&void 0!==r?r:40,o.style.objectFit="contain",o.style.filter="drop-shadow(0px 4px 4px rgba(0, 0, 0, 0.25))",o}},{key:"createTextElement",value:function(t,e){var i,r,n,o,a,s,l,c=document.createElement("p");return c.textContent=t,c.style.fontSize=null!==(i=null==e?void 0:e.fontSize)&&void 0!==i?i:"14px",c.style.padding=null!==(r=null==e?void 0:e.padding)&&void 0!==r?r:"0px",c.style.margin=null!==(n=null==e?void 0:e.margin)&&void 0!==n?n:"0px",c.style.fontWeight=null!==(o=null==e?void 0:e.fontWeight)&&void 0!==o?o:"600",c.style.fontFamily=null!==(a=null==e?void 0:e.fontFamily)&&void 0!==a?a:"'Open Sans', sans-serif",c.style.color=null!==(s=null==e?void 0:e.color)&&void 0!==s?s:"#000000",c.style.textShadow=null!==(l=null==e?void 0:e.textShadow)&&void 0!==l?l:"-1px -1px 0 #fff, 1px -1px 0 #fff, -1px 1px 0 #fff, 1px 1px 0 #fff",c}}])}(),D=function(t){function e(t){var i,r,n,o;return T(this,e),(o=k(this,e,[{element:z.createMarkerElement(t),draggable:!1}])).setLngLat([t.coordinate.lng,t.coordinate.lat]),o.setRotationAlignment(null!==(i=t.rotationAlignment)&&void 0!==i?i:"viewport"),o.setPitchAlignment("viewport"),o.id=null!==(r=t.id)&&void 0!==r?r:function(){for(var t="",e="0123456789ABCDEF",i=0;i<10;i++)t+=e.charAt(Math.floor(16*Math.random()));return t}(),o.coordinate=t.coordinate,o.floorId=null!==(n=t.floorId)&&void 0!==n?n:"",o}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&I(t,e)}(e,t),P(e,[{key:"addToMap",value:function(t){t&&this.addTo(t)}},{key:"updateIcon",value:function(t){var e;if(t.element)this._element.innerHTML="",this._element.appendChild(t.element);else{var i,r=z.createMarkerElement(t),n=this._element.querySelector("div"),o=r.querySelector("div");o&&(null==n||null===(i=n.parentElement)||void 0===i||i.replaceChild(o,n))}this.setRotationAlignment(null!==(e=t.rotationAlignment)&&void 0!==e?e:"viewport"),this.setPitchAlignment("viewport")}},{key:"setFloor",value:function(t){this.floorId=t}},{key:"hide",value:function(){this.remove()}},{key:"show",value:function(t){t&&this.addTo(t)}},{key:"changeFloor",value:function(t,e){t!=this.floorId&&this.floorId?this.hide():this.show(e)}}])}(b.Marker);function R(t){return R="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},R(t)}function O(t,e,i){return i&&function(t,e){for(var i=0;i<e.length;i++){var r=e[i];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,F(r.key),r)}}(t,i),Object.defineProperty(t,"prototype",{writable:!1}),t}function F(t){var e=function(t,e){if("object"!=R(t)||!t)return t;var i=t[Symbol.toPrimitive];if(void 0!==i){var r=i.call(t,e);if("object"!=R(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==R(e)?e:e+""}var B=Math.asin,N=Math.atan2,j=Math.cos,V=Math.sin,U=Math.pow,q=Math.sqrt,$=Math.PI;function G(t){return V(t/2)*V(t/2)}function H(t){return t*($/180)}function Z(t){return t*(180/$)}function W(t,e){return t.lat===e.lat&&t.lng===e.lng}var X=function(){function t(){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t)}return O(t,0,[{key:"distance",value:function(e,i){var r=H(e.lat),n=H(i.lat),o=H(e.lng),a=H(i.lng)-o,s=G(n-r)+j(r)*j(n)*G(a);return 2*t.EARTH_RADIUS*B(q(s))}},{key:"intermediatePointBetween",value:function(e,i,r){var n=H(e.lat),o=H(i.lat),a=H(e.lng),s=H(i.lng),l=t.distance(e,i)/t.EARTH_RADIUS,c=V((1-r)*l)/V(l),u=V(r*l)/V(l),h=c*j(n)*j(a)+u*j(o)*j(s),d=c*j(n)*V(a)+u*j(o)*V(s),p=c*V(n)+u*V(o),f=N(p,q(U(h,2)+U(d,2))),m=N(d,h);return{lat:Z(f),lng:Z(m)}}},{key:"bearingInDegBetween",value:function(e,i){return Z(t.bearingInRadBetween(e,i))}},{key:"bearingInRadBetween",value:function(t,e){var i=e.lng-t.lng,r=e.lat-t.lat;return($/2-N(r,i)+2*$)%(2*$)}},{key:"intermediateAngleBetween",value:function(t,e,i){var r=(e-t+180)%360-180;return r<-180&&(r+=360),(t+360+r*i)%360}}])}();function J(t){return J="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},J(t)}function K(t){return function(t){if(Array.isArray(t))return Y(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||function(t,e){if(t){if("string"==typeof t)return Y(t,e);var i={}.toString.call(t).slice(8,-1);return"Object"===i&&t.constructor&&(i=t.constructor.name),"Map"===i||"Set"===i?Array.from(t):"Arguments"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i)?Y(t,e):void 0}}(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Y(t,e){(null==e||e>t.length)&&(e=t.length);for(var i=0,r=Array(e);i<e;i++)r[i]=t[i];return r}function Q(t,e,i){return e&&function(t,e){for(var i=0;i<e.length;i++){var r=e[i];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,et(r.key),r)}}(t.prototype,e),Object.defineProperty(t,"prototype",{writable:!1}),t}function tt(t,e,i){return(e=et(e))in t?Object.defineProperty(t,e,{value:i,enumerable:!0,configurable:!0,writable:!0}):t[e]=i,t}function et(t){var e=function(t,e){if("object"!=J(t)||!t)return t;var i=t[Symbol.toPrimitive];if(void 0!==i){var r=i.call(t,e);if("object"!=J(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t,"string");return"symbol"==J(e)?e:e+""}!function(t,e,i){(e=F(e))in t?Object.defineProperty(t,e,{value:i,enumerable:!0,configurable:!0,writable:!0}):t[e]=i}(X,"EARTH_RADIUS",6378e3);var it=function(){return Q((function t(e){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),tt(this,"AHEAD_ID","AHEAD_ID"),tt(this,"BEHIND_ID","BEHIND_ID"),tt(this,"CURRENT_ID","CURRENT_ID"),tt(this,"aheadSourceData",{type:"FeatureCollection",features:[]}),tt(this,"behindSourceData",{type:"FeatureCollection",features:[]}),tt(this,"currentSourceData",{type:"Feature",properties:{},geometry:{type:"LineString",coordinates:[]}}),tt(this,"animationStatus","NO_ROUTE"),tt(this,"stepAnimationStatus","NO_ROUTE"),this.lazarilloMap=e}),[{key:"map",get:function(){return this.lazarilloMap.map}},{key:"addSourcesAndLayers",value:function(){this.map.addSource(this.AHEAD_ID,{type:"geojson",data:this.aheadSourceData}),this.map.addLayer({id:this.AHEAD_ID,type:"line",source:this.AHEAD_ID,layout:{"line-join":"round","line-cap":"round"}}),this.map.addSource(this.BEHIND_ID,{type:"geojson",data:this.behindSourceData}),this.map.addLayer({id:this.BEHIND_ID,type:"line",source:this.BEHIND_ID,layout:{"line-join":"round","line-cap":"round"}}),this.map.addSource(this.CURRENT_ID,{type:"geojson",data:this.currentSourceData}),this.map.addLayer({id:this.CURRENT_ID,type:"line",source:this.CURRENT_ID,layout:{"line-join":"round","line-cap":"round"}})}},{key:"addRoute",value:function(t,e){this.setSourceData(this.AHEAD_ID,t.steps),this.setLayerPaint(this.AHEAD_ID,e),this.updateLayerFilter(this.AHEAD_ID)}},{key:"setSourceData",value:function(t,e){var i=this.createFeaturesFrom(e),r=this.map.getSource(t);switch(t){case this.AHEAD_ID:this.aheadSourceData.features=i,null==r||r.setData(this.aheadSourceData);break;case this.BEHIND_ID:this.behindSourceData.features=i,null==r||r.setData(this.behindSourceData)}}},{key:"setCurrentSourceData",value:function(t){var e,i;this.currentSourceData.properties={floor_key:(null!==(e=null==t||null===(i=t.startInsideFloor)||void 0===i?void 0:i.length)&&void 0!==e?e:0)>0?null==t?void 0:t.startInsideFloor:this.lazarilloMap.getCurrentFloor()};var r=null==t?void 0:t.coordinates[0];this.currentSourceData.geometry.coordinates=null!=r?[[r.lng,r.lat]]:[];var n=this.map.getSource(this.CURRENT_ID);null==n||n.setData(this.currentSourceData)}},{key:"setLayerPaint",value:function(t,e){var i=this.preparePaintForLayer(e);for(var r in i)this.map.setPaintProperty(t,r,i[r])}},{key:"preparePaintForLayer",value:function(t){if("color"in t.routeStyle)return{"line-color":t.routeStyle.color,"line-gradient":null,"line-width":t.polylineWidth};var e=t.routeStyle,i=e.colors,r=e.positions;if(null==r&&(n=i.length,o=1/(n-1),r=Array.from({length:n},(function(t,e){return e*o}))),r.length!==i.length)throw new Error("Error: position array has different length than colors array");var n,o,a=function(t,e){return t.flatMap((function(t,i){return[t,e[i]]}))}(r,i);return{"line-color":null,"line-gradient":["interpolate",["linear"],["line-progress"]].concat(K(a)),"line-width":t.polylineWidth}}},{key:"updateLayerFilter",value:function(t,e){var i=null!=e?e:this.lazarilloMap.getCurrentFloor();void 0!==i&&this.map&&this.map.getStyle().layers.some((function(e){return e.id===t}))&&this.map.setFilter(t,["==",["get","floor_key"],i])}},{key:"createFeaturesFrom",value:function(t){var e=this.lazarilloMap.getCurrentFloor();return t.map((function(t){var i,r;return{type:"Feature",properties:{floor_key:(null!==(i=null===(r=t.startInsideFloor)||void 0===r?void 0:r.length)&&void 0!==i?i:0)>0?t.startInsideFloor:e},geometry:{type:"LineString",coordinates:t.geoJsonCoordinates}}}))}},{key:"updateRouteLayers",value:function(t){this.updateLayerFilter(this.AHEAD_ID,t),this.updateLayerFilter(this.BEHIND_ID,t),this.updateLayerFilter(this.CURRENT_ID,t)}},{key:"updateRouteMarkerVisibility",value:function(t){var e,i,r;(null===(e=this.routeMarker)||void 0===e?void 0:e.floorId)===t?null===(i=this.routeMarker)||void 0===i||i.show(this.map):null===(r=this.routeMarker)||void 0===r||r.hide()}},{key:"updatePlaceFloorForRouting",value:function(t,e){t&&e&&(this.lazarilloMap.updatePlaceAndFloorForRouting(t,e),this.updateRouteLayers(e),this.setMarkerFloor(e),this.updateRouteMarkerVisibility(e))}},{key:"startAnimating",value:function(t,e,i){var r,n,o,a,s=this;"NO_ROUTE"===this.animationStatus&&"NO_ROUTE"===this.stepAnimationStatus||this.clearForNextAnimation(),this.animationStatus="STARTED",this.route=t;var l=t.steps[0];this.updatePlaceFloorForRouting(l.startInsidePlace,l.startInsideFloor),this.setSourceData(this.AHEAD_ID,t.steps),this.setSourceData(this.BEHIND_ID,[]),this.currentSourceData.properties={floor_key:(null!==(r=null===(n=l.startInsideFloor)||void 0===n?void 0:n.length)&&void 0!==r?r:0)>0?l.startInsideFloor:this.lazarilloMap.getCurrentFloor()},this.currentSourceData.geometry.coordinates=[[l.coordinates[0].lng,l.coordinates[0].lat]],this.setLayerPaint(this.AHEAD_ID,e.aheadConfig),this.setLayerPaint(this.BEHIND_ID,e.behindConfig),this.setLayerPaint(this.CURRENT_ID,e.behindConfig),this.animationConfig=i,this.routeMarker=new D({coordinate:l.startLocation,floorId:l.startInsideFloor,icon:e.routeIcon,rotationAlignment:"map"}),this.routeMarker.addToMap(this.map),null===(o=(a=this.animationConfig).callBack)||void 0===o||o.call(a,{isFinished:!1,step:l}),this.conditions={index:0,coordinatesIndex:0,iconRotation:0,rotatingIcon:!0,startTime:void 0,progress:0,resetTime:!1,waitStartTime:void 0,animationId:requestAnimationFrame((function(t){return s.animateStep(t)})),onFinish:function(t){return s.prepareForNextStep(t)}}}},{key:"clearForNextAnimation",value:function(){var t;null===(t=this.routeMarker)||void 0===t||t.remove(),this.routeMarker=void 0,this.setSourceData(this.AHEAD_ID,[]),this.setSourceData(this.BEHIND_ID,[]),this.currentSourceData.geometry.coordinates=[];var e=this.map.getSource(this.CURRENT_ID);null==e||e.setData(this.currentSourceData),"STARTED"!==this.animationStatus&&"ANIMATING"!==this.stepAnimationStatus||null==this.conditions||cancelAnimationFrame(this.conditions.animationId),this.animationStatus="NO_ROUTE",this.stepAnimationStatus="NO_ROUTE",this.conditions=void 0,this.animationConfig=void 0}},{key:"removeRoute",value:function(){this.clearForNextAnimation()}},{key:"internalPause",value:function(){"STARTED"==this.animationStatus&&null!=this.conditions&&(cancelAnimationFrame(this.conditions.animationId),this.animationStatus="PAUSED")}},{key:"pauseAnimation",value:function(){this.internalPause()}},{key:"internalResume",value:function(){var t=this;"PAUSED"==this.animationStatus&&null!=this.conditions&&(this.conditions.resetTime=!0,this.conditions.animationId=requestAnimationFrame((function(e){return t.animateStep(e)})),this.animationStatus="STARTED")}},{key:"resumeAnimation",value:function(){this.internalResume()}},{key:"restartAnimation",value:function(){var t,e,i,r,n,o=this;if("NO_ROUTE"===this.animationStatus)throw new Error("Does not exist animated route to restart");if(null==this.conditions||null==this.animationConfig||null==this.route||null==this.routeMarker)throw new Error("Error: conditions and animationConfig should not be null at this point");"STARTED"===this.animationStatus&&cancelAnimationFrame(this.conditions.animationId),this.animationStatus="STARTED";var a=this.route.steps[0];this.updatePlaceFloorForRouting(a.startInsidePlace,a.startInsideFloor),this.setSourceData(this.AHEAD_ID,this.route.steps),this.setSourceData(this.BEHIND_ID,[]),this.currentSourceData.properties={floor_key:(null!==(t=null===(e=a.startInsideFloor)||void 0===e?void 0:e.length)&&void 0!==t?t:0)>0?a.startInsideFloor:this.lazarilloMap.getCurrentFloor()},this.currentSourceData.geometry.coordinates=[[a.coordinates[0].lng,a.coordinates[0].lat]];var s=this.map.getSource(this.CURRENT_ID);null==s||s.setData(this.currentSourceData),null===(i=this.setRotation(0))||void 0===i||i.setLngLat(a.startLocation).addTo(this.map),null===(r=(n=this.animationConfig).callBack)||void 0===r||r.call(n,{isFinished:!1,step:a}),this.conditions={index:0,coordinatesIndex:0,iconRotation:0,rotatingIcon:!0,startTime:void 0,progress:0,resetTime:!1,waitStartTime:void 0,animationId:requestAnimationFrame((function(t){return o.animateStep(t)})),onFinish:function(t){return o.prepareForNextStep(t)}}}},{key:"stopAnimation",value:function(){"FINISHED"!=this.animationStatus&&(this.animationStatus="FINISHED")}},{key:"addStepAnimation",value:function(t,e,i){var r,n=this;"NO_ROUTE"===this.animationStatus&&"NO_ROUTE"===this.stepAnimationStatus||this.clearForNextAnimation(),this.stepAnimationStatus="WAITING",this.route=t;var o=t.steps[0];this.updatePlaceFloorForRouting(o.startInsidePlace,o.startInsideFloor),this.setSourceData(this.AHEAD_ID,t.steps),this.setSourceData(this.BEHIND_ID,[]),this.setCurrentSourceData(o),this.setLayerPaint(this.AHEAD_ID,e.aheadConfig),this.setLayerPaint(this.BEHIND_ID,e.behindConfig),this.setLayerPaint(this.CURRENT_ID,e.behindConfig),this.animationConfig=i,this.routeMarker=new D({coordinate:o.startLocation,floorId:o.startInsideFloor,icon:e.routeIcon,rotationAlignment:"map"}),this.routeMarker.addToMap(this.map),this.cameraFollow(o.startLocation),null===(r=i.callBack)||void 0===r||r.call(i,{isFinished:!1,step:o}),this.conditions={index:0,coordinatesIndex:0,iconRotation:0,rotatingIcon:!0,startTime:void 0,progress:0,resetTime:!1,waitStartTime:void 0,animationId:0,isStepByStep:!0,onFinish:function(){if(null==n.conditions||null==n.animationConfig||null==n.route)throw new Error("Error: conditions, animationConfig or route should not be null at this point");var e=n.conditions.index;e++;var r=n.route.steps.slice(0,e),o=n.route.steps.slice(e),a=n.route.steps[e];if(n.setSourceData(n.BEHIND_ID,r),n.setSourceData(n.AHEAD_ID,o),n.setCurrentSourceData(a),n.conditions.index=e,e<t.steps.length){var s,l=t.steps[e];null===(s=i.callBack)||void 0===s||s.call(i,{isFinished:!1,step:l})}else{var c;null===(c=i.callBack)||void 0===c||c.call(i,{isFinished:!0,step:null})}n.stepAnimationStatus="WAITING"}}}},{key:"nextStepAnimation",value:function(){var t=this;if("NO_ROUTE"===this.stepAnimationStatus)throw new Error("Error: Does not exist step animation");if(null==this.conditions||null==this.animationConfig||null==this.route)throw new Error("Error: conditions, animationConfig or route should not be null at this point");if("ANIMATING"===this.stepAnimationStatus&&cancelAnimationFrame(this.conditions.animationId),this.stepAnimationStatus="ANIMATING",!(this.conditions.index<this.route.steps.length))throw new Error("Error: Does not exist next step to animate");this.conditions.coordinatesIndex=0,this.conditions.startTime=void 0,this.conditions.progress=0,this.conditions.rotatingIcon=!0,this.conditions.waitStartTime=void 0,this.conditions.animationId=requestAnimationFrame((function(e){return t.animateStep(e)}))}},{key:"previousStepAnimation",value:function(){if("NO_ROUTE"===this.stepAnimationStatus)throw new Error("Error: Does not exist step animation");if(null==this.conditions||null==this.animationConfig||null==this.route)throw new Error("Error: conditions, animationConfig or route should not be null at this point");"ANIMATING"===this.stepAnimationStatus&&cancelAnimationFrame(this.conditions.animationId),this.stepAnimationStatus="WAITING";var t,e,i=this.conditions.index;if(!(i>0))throw new Error("previous step doesn't exists to animate");i--;var r=this.route.steps.slice(0,i),n=this.route.steps.slice(i),o=this.route.steps[i];this.setSourceData(this.BEHIND_ID,r),this.setSourceData(this.AHEAD_ID,n),this.setCurrentSourceData(o),o.startInsideFloor!=o.endInsideFloor&&o.startInsideFloor&&this.updatePlaceFloorForRouting(o.startInsidePlace,o.startInsideFloor),this.conditions.index=i,this.conditions.coordinatesIndex=0,this.conditions.startTime=void 0,this.conditions.progress=0,this.conditions.rotatingIcon=!0,this.conditions.waitStartTime=void 0,this.setLngLat(o.startLocation);var a=r.at(-1);if(null!=a){var s=a.coordinates.slice(-2),l=X.bearingInDegBetween(s[0],s[1]);this.setRotation(l)}else this.setRotation(0);null===(t=(e=this.animationConfig).callBack)||void 0===t||t.call(e,{isFinished:!1,step:o})}},{key:"centerOnCurrentStep",value:function(){var t;if("NO_ROUTE"===this.stepAnimationStatus)throw new Error("Error: Does not exist step animation");if(null==this.conditions||null==this.animationConfig||null==this.route)throw new Error("Error: conditions, animationConfig or route should not be null at this point");var e=null===(t=this.routeMarker)||void 0===t?void 0:t.getLngLat();if(!e)throw new Error("Error: marker has no position set");this.map.panTo(e)}},{key:"prepareForNextStep",value:function(t){var e=this;if(null==this.conditions||null==this.animationConfig||null==this.route)throw new Error("Error: conditions, animationConfig or route should not be null at this point");var i=this.conditions.index,r=this.route.steps.slice(0,i+1),n=this.route.steps.slice(i+1);if(this.setSourceData(this.BEHIND_ID,r),this.setSourceData(this.AHEAD_ID,n),this.currentSourceData.geometry.coordinates=[],i+1<this.route.steps.length){var o,a,s,l,c=this.route.steps[i+1];this.currentSourceData.geometry.coordinates.push([c.startLocation.lng,c.startLocation.lat]),this.currentSourceData.properties={floor_key:(null!==(o=null===(a=c.startInsideFloor)||void 0===a?void 0:a.length)&&void 0!==o?o:0)>0?c.startInsideFloor:this.lazarilloMap.getCurrentFloor()},this.conditions.startTime=t,this.conditions.index++,this.conditions.coordinatesIndex=0,this.conditions.progress=0,this.conditions.rotatingIcon=!0,W(this.route.steps[i].endLocation,c.startLocation)||(this.conditions.nextFloorFirstStepIndex=i+2),this.conditions.animationId=requestAnimationFrame((function(t){return e.animateStep(t)})),null===(s=(l=this.animationConfig).callBack)||void 0===s||s.call(l,{isFinished:!1,step:this.route.steps[i+1]})}else{var u,h;null===(u=(h=this.animationConfig).callBack)||void 0===u||u.call(h,{isFinished:!0,step:null}),this.animationStatus="FINISHED"}}},{key:"animateStep",value:function(t){var e=this;if(null==this.conditions||null==this.animationConfig||null==this.route)throw new Error("Error: conditions and animationConfig should not be null at this point");var i=this.conditions,r=i.startTime,n=i.resetTime,o=i.progress,a=this.conditions,s=a.coordinatesIndex,l=a.iconRotation,c=a.index,u=a.onFinish,h=a.rotatingIcon,d=a.waitStartTime,p=this.animationConfig,f=p.stepTime,m=p.minimumSpeed,g=p.iconRotationTime,y=p.changeFloorTime;if(null==r)return this.conditions.startTime=t,void(this.conditions.animationId=requestAnimationFrame((function(t){return e.animateStep(t)})));n?(r=t-o,this.conditions.startTime=r,n=!1,this.conditions.resetTime=n):(o=t-r,this.conditions.progress=o);var _=o/1e3,v=this.route.steps[c];if(v.coordinates.length<=0)null==u||u(t);else{var b=v.coordinates[s],x=v.coordinates[s+1];if(null!=b&&null!=x){var w;if(h){var k=X.bearingInDegBetween(b,x);if(0===g||this.conditions.nextFloorFirstStepIndex===c||Math.abs(k-this.conditions.iconRotation)<15)return this.conditions.nextFloorFirstStepIndex=void 0,this.setRotation(k),this.conditions.startTime=t,this.conditions.rotatingIcon=!1,this.conditions.iconRotation=k,void(this.conditions.animationId=requestAnimationFrame((function(t){return e.animateStep(t)})));if(_<g){var E=X.intermediateAngleBetween(l,k,_/g);return this.setRotation(E),void(this.conditions.animationId=requestAnimationFrame((function(t){return e.animateStep(t)})))}return this.setRotation(k),this.conditions.startTime=t,this.conditions.rotatingIcon=!1,this.conditions.iconRotation=k,void(this.conditions.animationId=requestAnimationFrame((function(t){return e.animateStep(t)})))}var S=X.distance(b,x),I=Math.max(v.distance/f,null!=m?m:0);if(I*_>S){this.currentSourceData.geometry.coordinates.push([x.lng,x.lat]);var C=this.map.getSource(this.CURRENT_ID);if(null==C||C.setData(this.currentSourceData),s+2<v.coordinates.length){var T=v.coordinates[s+2];if(!W(x,T))if(this.conditions.isStepByStep)this.conditions.rotatingIcon=!0;else{var A,P=X.bearingInDegBetween(x,T);this.conditions.iconRotation=P,null===(A=this.routeMarker)||void 0===A||A.setRotation(P)}return this.conditions.startTime=t,this.conditions.progress=0,this.conditions.coordinatesIndex++,void(this.conditions.animationId=requestAnimationFrame((function(t){return e.animateStep(t)})))}return v.startInsideFloor!==v.endInsideFloor?null==d?(this.conditions.waitStartTime=t,void(this.conditions.animationId=requestAnimationFrame((function(t){return e.animateStep(t)})))):t-d<1e3*y?void(this.conditions.animationId=requestAnimationFrame((function(t){return e.animateStep(t)}))):(this.updatePlaceFloorForRouting(v.endInsidePlace,v.endInsideFloor),this.setLngLat(v.endLocation),this.conditions.waitStartTime=void 0,void(null==u||u(t))):void(null==u||u(t))}var M=I*_/S,L=0===S?x:X.intermediatePointBetween(b,x,Math.min(M,1));this.currentSourceData.geometry.coordinates.push([L.lng,L.lat]);var z=this.map.getSource(this.CURRENT_ID);return null==z||z.setData(this.currentSourceData),this.setLngLat(L),null===(w=this.routeMarker)||void 0===w||w.addTo(this.map),void(this.conditions.animationId=requestAnimationFrame((function(t){return e.animateStep(t)})))}null==u||u(t)}}},{key:"setLngLat",value:function(t){var e,i;null!==(e=this.conditions)&&void 0!==e&&e.isStepByStep&&this.cameraFollow(t),null===(i=this.routeMarker)||void 0===i||i.setLngLat(t)}},{key:"setRotation",value:function(t){var e,i,r,n;return null!==(e=this.conditions)&&void 0!==e&&e.isStepByStep&&this.lazarilloMap.updateCamera({duration:null===(r=this.animationConfig)||void 0===r?void 0:r.iconRotationTime,animate:!0,bearing:t,center:null===(n=this.routeMarker)||void 0===n?void 0:n.getLngLat()}),null===(i=this.routeMarker)||void 0===i?void 0:i.setRotation(t)}},{key:"setMarkerFloor",value:function(t){var e;null===(e=this.routeMarker)||void 0===e||e.setFloor(t)}},{key:"cameraFollow",value:function(t){var e,i;this.lazarilloMap.updateCamera({center:t,animate:!0,bearing:null===(e=this.routeMarker)||void 0===e?void 0:e.getRotation(),duration:null===(i=this.animationConfig)||void 0===i?void 0:i.iconRotationTime})}}])}(),rt=["ar"];function nt(t,e,i){return Object.defineProperty(t,"prototype",{writable:!1}),t}function ot(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}var at=function(t){return t.cardinal="CARDINAL",t.clock="CLOCK",t.relative="RELATIVE",t}({}),st=function(t){return t.metric="METRIC",t.imperial="IMPERIAL",t.steps="STEPS",t}({}),lt=function(t){return t.walking="WALKING",t.driving="DRIVING",t.bicycling="BICYCLING",t.transit="TRANSIT",t}({}),ct=nt((function t(e){var i,r,n,o;ot(this,t),this.initialLocation=e.initialLocation,this.finalLocation=e.finalLocation,this.preferAccessibleRoute=null!==(i=e.preferAccessibleRoute)&&void 0!==i&&i,this.language=null!==(r=e.language)&&void 0!==r?r:"en",this.unitSystem=null!==(n=e.unitSystem)&&void 0!==n?n:st.metric,this.announceFormat=null!==(o=e.announceFormat)&&void 0!==o?o:at.relative})),ut=nt((function t(e){var i,r;ot(this,t),this.polylineWidth=null!==(i=e.polylineWidth)&&void 0!==i?i:10,this.routeStyle=null!==(r=e.routeStyle)&&void 0!==r?r:{type:"Solid",color:"#1257ED"}}));function ht(t){return ht="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},ht(t)}function dt(t,e,i){return e&&function(t,e){for(var i=0;i<e.length;i++){var r=e[i];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,pt(r.key),r)}}(t.prototype,e),Object.defineProperty(t,"prototype",{writable:!1}),t}function pt(t){var e=function(t,e){if("object"!=ht(t)||!t)return t;var i=t[Symbol.toPrimitive];if(void 0!==i){var r=i.call(t,e);if("object"!=ht(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t,"string");return"symbol"==ht(e)?e:e+""}function ft(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}var mt=dt((function t(e){var i,r,n,o;ft(this,t),this.stepTime=null!==(i=e.stepTime)&&void 0!==i?i:3,this.minimumSpeed=null!==(r=e.minimumSpeed)&&void 0!==r?r:40,this.changeFloorTime=null!==(n=e.changeFloorTime)&&void 0!==n?n:0,this.iconRotationTime=null!==(o=e.iconRotationTime)&&void 0!==o?o:0,this.callBack=e.callBack})),gt=function(){return dt((function t(e){var i,r,n;if(ft(this,t),this.aheadPathStyle=null!==(i=e.aheadPathStyle)&&void 0!==i?i:{type:"Solid",color:"#757575"},this.behindPathStyle=null!==(r=e.behindPathStyle)&&void 0!==r?r:{type:"Solid",color:"#0076B6"},this.polylineWidth=null!==(n=e.polylineWidth)&&void 0!==n?n:10,null!=e.routeIcon)this.routeIcon=e.routeIcon;else{var o=new Image(40,40);o.src="data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz4KPCEtLSBHZW5lcmF0b3I6IEFkb2JlIElsbHVzdHJhdG9yIDI2LjUuMCwgU1ZHIEV4cG9ydCBQbHVnLUluIC4gU1ZHIFZlcnNpb246IDYuMDAgQnVpbGQgMCkgIC0tPgo8c3ZnIHZlcnNpb249IjEuMSIgaWQ9IkNhcGFfMSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayIgeD0iMHB4IiB5PSIwcHgiCgkgdmlld0JveD0iMCAwIDQwIDQwIiBzdHlsZT0iZW5hYmxlLWJhY2tncm91bmQ6bmV3IDAgMCA0MCA0MDsiIHhtbDpzcGFjZT0icHJlc2VydmUiPgo8c3R5bGUgdHlwZT0idGV4dC9jc3MiPgoJLnN0MHtmaWxsOiMwMDc2QjY7fQoJLnN0MXtmaWxsOiNGRkZGRkY7fQo8L3N0eWxlPgo8Zz4KCTxjaXJjbGUgY2xhc3M9InN0MCIgY3g9IjIwIiBjeT0iMjAiIHI9IjIwIi8+Cgk8cGF0aCBjbGFzcz0ic3QxIiBkPSJNMTIuNCwyOS43Yy0wLjIsMC4xLTAuNCwwLjEtMC42LDAuMWMtMC4yLDAtMC40LTAuMS0wLjUtMC4zYy0wLjItMC4xLTAuMi0wLjMtMC4zLTAuNWMwLTAuMiwwLTAuNCwwLjEtMC42CgkJbDguMi0xNy44YzAuMi0wLjQsMC41LTAuNiwwLjktMC42YzAuNCwwLDAuNywwLjIsMC45LDAuNmw3LjksMTcuOWMwLjEsMC4yLDAuMSwwLjQsMC4xLDAuNmMwLDAuMi0wLjEsMC40LTAuMywwLjUKCQljLTAuMSwwLjEtMC4zLDAuMi0wLjUsMC4zYy0wLjIsMC0wLjQsMC0wLjYtMC4xTDIwLDI2LjVMMTIuNCwyOS43eiBNMTMuOSwyN2w2LjEtMi42bDYuMSwyLjdsLTYtMTMuOEwxMy45LDI3eiIvPgo8L2c+Cjwvc3ZnPgo=",this.routeIcon=o}}),[{key:"aheadConfig",get:function(){return new ut({polylineWidth:this.polylineWidth,routeStyle:this.aheadPathStyle})}},{key:"behindConfig",get:function(){return new ut({polylineWidth:this.polylineWidth,routeStyle:this.behindPathStyle})}}])}(),yt=i(773),_t=i.n(yt);function vt(t){return vt="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},vt(t)}function bt(t,e){for(var i=0;i<e.length;i++){var r=e[i];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,xt(r.key),r)}}function xt(t){var e=function(t,e){if("object"!=vt(t)||!t)return t;var i=t[Symbol.toPrimitive];if(void 0!==i){var r=i.call(t,e);if("object"!=vt(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t,"string");return"symbol"==vt(e)?e:e+""}var wt="f0c8d3b96d336e857a8628f49dd1baf7d7add0e9",kt="https://countly.lazarillo.app",Et=function(){function t(){var e;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),_t().init({app_key:wt,url:kt,app_version:"2.15.0",session_update:10,debug:!1,require_consent:!1,namespace:"SDK JS"}),this.countly=null!==_t()&&void 0!==_t()?_t():{},this.countly.q=null!==(e=_t().q)&&void 0!==e?e:[],this.countly.q.push(["track_sessions","track_pageview","track_clicks","track_scrolls","track_errors","track_links","track_forms","collect_from_forms"])}return function(t,e,i){return e&&bt(t.prototype,e),i&&bt(t,i),Object.defineProperty(t,"prototype",{writable:!1}),t}(t,[{key:"logEvent",value:function(t,e){this.countly.q.push(["add_event",{key:t,segmentation:e}])}},{key:"logError",value:function(t,e){this.countly.q.push(["log_error",t,e])}},{key:"debugLog",value:function(){}}],[{key:"getInstance",value:function(){return null==t.instance&&(t.instance=new t),t.instance}}])}();function St(t){return St="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},St(t)}function It(t,e,i){return e&&function(t,e){for(var i=0;i<e.length;i++){var r=e[i];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,Ct(r.key),r)}}(t.prototype,e),Object.defineProperty(t,"prototype",{writable:!1}),t}function Ct(t){var e=function(t,e){if("object"!=St(t)||!t)return t;var i=t[Symbol.toPrimitive];if(void 0!==i){var r=i.call(t,e);if("object"!=St(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t,"string");return"symbol"==St(e)?e:e+""}var Tt=function(){return It((function t(){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.logger=Et.getInstance()}),[{key:"logEvent",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};this.logger.logEvent(t,this.prepareSegmentation(e))}},{key:"logError",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};this.logger.logError(t,this.prepareSegmentation(e))}},{key:"debugLog",value:function(){for(var t=arguments.length,e=new Array(t),i=0;i<t;i++)e[i]=arguments[i];this.logger.debugLog(e)}}])}();const At={randomUUID:"undefined"!=typeof crypto&&crypto.randomUUID&&crypto.randomUUID.bind(crypto)};let Pt;const Mt=new Uint8Array(16);function Lt(){if(!Pt&&(Pt="undefined"!=typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!Pt))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return Pt(Mt)}const zt=[];for(let i=0;i<256;++i)zt.push((i+256).toString(16).slice(1));const Dt=function(t,e,i){if(At.randomUUID&&!e&&!t)return At.randomUUID();const r=(t=t||{}).random||(t.rng||Lt)();if(r[6]=15&r[6]|64,r[8]=63&r[8]|128,e){i=i||0;for(let t=0;t<16;++t)e[i+t]=r[t];return e}return function(t,e=0){return zt[t[e+0]]+zt[t[e+1]]+zt[t[e+2]]+zt[t[e+3]]+"-"+zt[t[e+4]]+zt[t[e+5]]+"-"+zt[t[e+6]]+zt[t[e+7]]+"-"+zt[t[e+8]]+zt[t[e+9]]+"-"+zt[t[e+10]]+zt[t[e+11]]+zt[t[e+12]]+zt[t[e+13]]+zt[t[e+14]]+zt[t[e+15]]}(r)};function Rt(t){return Rt="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Rt(t)}function Ot(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Ft(t,e,i){return e&&function(t,e){for(var i=0;i<e.length;i++){var r=e[i];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,Bt(r.key),r)}}(t.prototype,e),Object.defineProperty(t,"prototype",{writable:!1}),t}function Bt(t){var e=function(t,e){if("object"!=Rt(t)||!t)return t;var i=t[Symbol.toPrimitive];if(void 0!==i){var r=i.call(t,e);if("object"!=Rt(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t,"string");return"symbol"==Rt(e)?e:e+""}var Nt=function(){return Ft((function t(e){var i=this;Ot(this,t),this.id=Dt(),this.legs=[],e.legs.forEach((function(t){var e=new jt(t);i.legs.push(e)}))}),[{key:"steps",get:function(){return this.legs.flatMap((function(t){return t.steps}))}},{key:"duration",get:function(){return this.legs.map((function(t){return t.duration})).reduce((function(t,e){return t+e}),0)}},{key:"length",get:function(){return this.legs.map((function(t){return t.distance})).reduce((function(t,e){return t+e}),0)}}])}(),jt=Ft((function t(e){var i=this;Ot(this,t),this.distance=e.distance.value,this.duration=e.duration.value,this.startLocation=e.start_location,this.endLocation=e.end_location,this.steps=[],e.steps.forEach((function(t){var e=new Vt(t);i.steps.push(e)}))})),Vt=function(){return Ft((function t(e){Ot(this,t),this.distance=e.distance.value,this.duration=e.duration.value,this.startLocation=e.start_location,this.startInsideFloor=e.start_inside_floor,this.startInsidePlace=e.start_inside_place,this.endLocation=e.end_location,this.endInsideFloor=e.end_inside_floor,this.endInsidePlace=e.end_inside_place,this.htmlInstruction=e.html_instructions,this.plainInstruction=e.plain_instructions,this.maneuver=e.maneuver,this.elevatorStep=e.elevator_step,this.showPopup=e.show_popup,this.iconPrefix=e.icon_prefix,this.polyline=new Ut(e.polyline)}),[{key:"geoJsonCoordinates",get:function(){return this.polyline.geoJsonCoordinates}},{key:"coordinates",get:function(){return this.polyline.coordinates}}])}(),Ut=function(){return Ft((function t(e){Ot(this,t),this.points=e.points,this.pointsLatLng=e.points_lat_lng,this.overviewPoints=e.overview_points,this.decodedPoints=function(t,e){void 0===e&&(e=5);for(var i=Math.pow(10,e),r=t.length,n=new Array(Math.floor(t.length/2)),o=0,a=0,s=0,l=0;o<r;++l){var c=1,u=0,h=void 0;do{c+=(h=t.charCodeAt(o++)-63-1)<<u,u+=5}while(h>=31);a+=1&c?~(c>>1):c>>1,c=1,u=0;do{c+=(h=t.charCodeAt(o++)-63-1)<<u,u+=5}while(h>=31);s+=1&c?~(c>>1):c>>1,n[l]=[a/i,s/i]}return n.length=l,n}(e.points).map((function(t){return{lat:t[0],lng:t[1]}}))}),[{key:"geoJsonCoordinates",get:function(){return null!=this.overviewPoints?this.overviewPoints.map((function(t){return[t.lng,t.lat]})):this.decodedPoints.map((function(t){return[t.lng,t.lat]}))}},{key:"coordinates",get:function(){return null!=this.overviewPoints?this.overviewPoints:this.decodedPoints}}])}();function qt(t,e,i){return Object.defineProperty(t,"prototype",{writable:!1}),t}var $t=qt((function t(e){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.url=e.url,this.tags=e.tags,this.urlAction=e.url_action,this.sameLink=e.sameLink}));function Gt(t){return Gt="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Gt(t)}function Ht(t,e){var i=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),i.push.apply(i,r)}return i}function Zt(t){for(var e=1;e<arguments.length;e++){var i=null!=arguments[e]?arguments[e]:{};e%2?Ht(Object(i),!0).forEach((function(e){Wt(t,e,i[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(i)):Ht(Object(i)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(i,e))}))}return t}function Wt(t,e,i){return(e=Jt(e))in t?Object.defineProperty(t,e,{value:i,enumerable:!0,configurable:!0,writable:!0}):t[e]=i,t}function Xt(t,e,i){return e&&function(t,e){for(var i=0;i<e.length;i++){var r=e[i];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,Jt(r.key),r)}}(t.prototype,e),Object.defineProperty(t,"prototype",{writable:!1}),t}function Jt(t){var e=function(t,e){if("object"!=Gt(t)||!t)return t;var i=t[Symbol.toPrimitive];if(void 0!==i){var r=i.call(t,e);if("object"!=Gt(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t,"string");return"symbol"==Gt(e)?e:e+""}var Kt=function(){return Xt((function t(e){var i,r,n,o,a,s,l,c,u;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t);var h=(null!==(i=e.tags)&&void 0!==i?i:[]).concat(null!==(r=e.keywords)&&void 0!==r?r:[]);for(var d in this.lazarilloId=e.id,this.clientId=null!==(n=e.alias)&&void 0!==n?n:e.externalId,this.title=e.title,this.hidePlace=h.includes("hide_search"),this.description=e.description,this.shortDescription=e.shortDescription,this.position={lat:e.lat,lng:e.lng},this.category=e.category,this.tags=null!==(o=e.tags)&&void 0!==o?o:[],this.generalCategory=e.general_category,this.localizedCategory=null!==(a=e.localizedCategory)&&void 0!==a?a:"",this.parentInstitutionId=e.parent_institution,this.inFloors=e.inFloor,this.innerFloors=[],e.innerFloors)this.innerFloors.push(Zt(Zt({},e.innerFloors[d]),{},{key:d}));this.innerFloors.sort((function(t,e){return t.index-e.index})),this.openingHours=e.opening_hours,this.address=e.address,this.transportLine=null===(s=e.properties)||void 0===s?void 0:s.filter((function(t){return"transport_line"===t.type})),e.logo&&(this.logo="string"==typeof e.logo?e.logo:e.logo.light),this.images=null!==(l=e.images)&&void 0!==l?l:[],this.banners=(null!==(c=e.banners)&&void 0!==c?c:[]).map((function(t){return new $t(t)})),this.properties=ee.parseProperties(null!==(u=e.properties)&&void 0!==u?u:[]),this.parentId=e.parent_id,this.parentType=e.parent_type}),[{key:"inFloor",value:function(t){var e=this;return t.find((function(t){var i;return t.key===(null===(i=e.inFloors)||void 0===i?void 0:i[0])}))}}])}();function Yt(t){return Yt="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Yt(t)}function Qt(t,e,i){return i&&function(t,e){for(var i=0;i<e.length;i++){var r=e[i];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,te(r.key),r)}}(t,i),Object.defineProperty(t,"prototype",{writable:!1}),t}function te(t){var e=function(t,e){if("object"!=Yt(t)||!t)return t;var i=t[Symbol.toPrimitive];if(void 0!==i){var r=i.call(t,e);if("object"!=Yt(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t,"string");return"symbol"==Yt(e)?e:e+""}var ee=function(){return Qt((function t(){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t)}),0,[{key:"parseProperties",value:function(t){var e=this;try{var i=[];return t&&t.forEach((function(t){if(t.child_places){var r,n=t.child_places,o={childPlaces:[],title:t.key,subtitle:t.text,childParentPlace:t.child_parent_place,icon:t.icon,iconPrefix:null!==(r=t.iconPrefix)&&void 0!==r?r:"fas"};n.forEach((function(t){if("string"==typeof t)o.childPlaces.push(t);else{var e=new Kt(t);o.childPlaces.push(e)}})),i.push(o)}else if(t.child_properties){var a,s=t.child_properties,l={childProperties:[],title:t.key,subtitle:t.text,childParentPlace:t.child_parent_place,icon:t.icon,iconPrefix:null!==(a=t.iconPrefix)&&void 0!==a?a:"fas"},c=e.parseProperties(s);l.childProperties=c,i.push(l)}else if(t.url){var u={title:t.key,subtitle:t.text,icon:t.icon,iconPrefix:t.iconPrefix,url:t.url,type:t.type};i.push(u)}else{var h,d={title:t.key,subtitle:t.text,childParentPlace:t.child_parent_place,icon:t.icon,type:t.type,iconPrefix:null!==(h=t.iconPrefix)&&void 0!==h?h:"fas"};i.push(d)}})),i}catch(r){return[]}}}])}();function ie(t,e,i){return Object.defineProperty(t,"prototype",{writable:!1}),t}var re=ie((function t(e){var i;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.lazarilloId=e.id,this.country=e.country,this.title=e.title,this.category=e.category,this.icon=e.icon,this.description=e.description,this.hasPlaces=e.hasPlaces,this.properties=ee.parseProperties(null!==(i=e.properties)&&void 0!==i?i:[])}));function ne(t,e,i){return Object.defineProperty(t,"prototype",{writable:!1}),t}var oe=ne((function t(e){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.schedule=e.schedules,this.routes=e.realtimeSchedules}));function ae(t){return ae="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},ae(t)}function se(t,e,i){return e&&function(t,e){for(var i=0;i<e.length;i++){var r=e[i];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,ce(r.key),r)}}(t.prototype,e),Object.defineProperty(t,"prototype",{writable:!1}),t}function le(t,e,i){return(e=ce(e))in t?Object.defineProperty(t,e,{value:i,enumerable:!0,configurable:!0,writable:!0}):t[e]=i,t}function ce(t){var e=function(t,e){if("object"!=ae(t)||!t)return t;var i=t[Symbol.toPrimitive];if(void 0!==i){var r=i.call(t,e);if("object"!=ae(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==ae(e)?e:e+""}var ue=function(){return se((function t(){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),le(this,"cachedPlaces",new Map),le(this,"cachedVehicles",new Map),le(this,"cachedStops",new Map),le(this,"cachedRoutes",new Map),le(this,"cachedAccessibleRoutes",new Map)}),[{key:"getPlace",value:function(t){return this.cachedPlaces.get(t)}},{key:"hasPlace",value:function(t){return this.cachedPlaces.has(t)}},{key:"setPlace",value:function(t,e){this.cachedPlaces.set(t,e)}},{key:"getVehicle",value:function(t){return this.cachedVehicles.get(t)}},{key:"setVehicle",value:function(t,e){this.cachedVehicles.set(t,e)}},{key:"getStops",value:function(t){return this.cachedStops.get(t)}},{key:"setStops",value:function(t,e){this.cachedStops.set(t,e)}},{key:"getRoute",value:function(t){return this.cachedRoutes.get(t)}},{key:"setRoute",value:function(t,e){this.cachedRoutes.set(t,e)}},{key:"getAccessibleRoute",value:function(t){return this.cachedAccessibleRoutes.get(t)}},{key:"setAccessibleRoute",value:function(t,e){this.cachedAccessibleRoutes.set(t,e)}},{key:"cleanRoutesCache",value:function(){this.cachedRoutes.clear()}},{key:"cleanAccessibleRoutesCache",value:function(){this.cachedAccessibleRoutes.clear()}}])}();function he(t){return he="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},he(t)}function de(t){return function(t){if(Array.isArray(t))return pe(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||function(t,e){if(t){if("string"==typeof t)return pe(t,e);var i={}.toString.call(t).slice(8,-1);return"Object"===i&&t.constructor&&(i=t.constructor.name),"Map"===i||"Set"===i?Array.from(t):"Arguments"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i)?pe(t,e):void 0}}(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function pe(t,e){(null==e||e>t.length)&&(e=t.length);for(var i=0,r=Array(e);i<e;i++)r[i]=t[i];return r}function fe(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */fe=function(){return e};var t,e={},i=Object.prototype,r=i.hasOwnProperty,n=Object.defineProperty||function(t,e,i){t[e]=i.value},o="function"==typeof Symbol?Symbol:{},a=o.iterator||"@@iterator",s=o.asyncIterator||"@@asyncIterator",l=o.toStringTag||"@@toStringTag";function c(t,e,i){return Object.defineProperty(t,e,{value:i,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{c({},"")}catch(t){c=function(t,e,i){return t[e]=i}}function u(t,e,i,r){var o=e&&e.prototype instanceof y?e:y,a=Object.create(o.prototype),s=new P(r||[]);return n(a,"_invoke",{value:I(t,i,s)}),a}function h(t,e,i){try{return{type:"normal",arg:t.call(e,i)}}catch(t){return{type:"throw",arg:t}}}e.wrap=u;var d="suspendedStart",p="suspendedYield",f="executing",m="completed",g={};function y(){}function _(){}function v(){}var b={};c(b,a,(function(){return this}));var x=Object.getPrototypeOf,w=x&&x(x(M([])));w&&w!==i&&r.call(w,a)&&(b=w);var k=v.prototype=y.prototype=Object.create(b);function E(t){["next","throw","return"].forEach((function(e){c(t,e,(function(t){return this._invoke(e,t)}))}))}function S(t,e){function i(n,o,a,s){var l=h(t[n],t,o);if("throw"!==l.type){var c=l.arg,u=c.value;return u&&"object"==he(u)&&r.call(u,"__await")?e.resolve(u.__await).then((function(t){i("next",t,a,s)}),(function(t){i("throw",t,a,s)})):e.resolve(u).then((function(t){c.value=t,a(c)}),(function(t){return i("throw",t,a,s)}))}s(l.arg)}var o;n(this,"_invoke",{value:function(t,r){function n(){return new e((function(e,n){i(t,r,e,n)}))}return o=o?o.then(n,n):n()}})}function I(e,i,r){var n=d;return function(o,a){if(n===f)throw Error("Generator is already running");if(n===m){if("throw"===o)throw a;return{value:t,done:!0}}for(r.method=o,r.arg=a;;){var s=r.delegate;if(s){var l=C(s,r);if(l){if(l===g)continue;return l}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if(n===d)throw n=m,r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n=f;var c=h(e,i,r);if("normal"===c.type){if(n=r.done?m:p,c.arg===g)continue;return{value:c.arg,done:r.done}}"throw"===c.type&&(n=m,r.method="throw",r.arg=c.arg)}}}function C(e,i){var r=i.method,n=e.iterator[r];if(n===t)return i.delegate=null,"throw"===r&&e.iterator.return&&(i.method="return",i.arg=t,C(e,i),"throw"===i.method)||"return"!==r&&(i.method="throw",i.arg=new TypeError("The iterator does not provide a '"+r+"' method")),g;var o=h(n,e.iterator,i.arg);if("throw"===o.type)return i.method="throw",i.arg=o.arg,i.delegate=null,g;var a=o.arg;return a?a.done?(i[e.resultName]=a.value,i.next=e.nextLoc,"return"!==i.method&&(i.method="next",i.arg=t),i.delegate=null,g):a:(i.method="throw",i.arg=new TypeError("iterator result is not an object"),i.delegate=null,g)}function T(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function A(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function P(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(T,this),this.reset(!0)}function M(e){if(e||""===e){var i=e[a];if(i)return i.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var n=-1,o=function i(){for(;++n<e.length;)if(r.call(e,n))return i.value=e[n],i.done=!1,i;return i.value=t,i.done=!0,i};return o.next=o}}throw new TypeError(he(e)+" is not iterable")}return _.prototype=v,n(k,"constructor",{value:v,configurable:!0}),n(v,"constructor",{value:_,configurable:!0}),_.displayName=c(v,l,"GeneratorFunction"),e.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===_||"GeneratorFunction"===(e.displayName||e.name))},e.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,v):(t.__proto__=v,c(t,l,"GeneratorFunction")),t.prototype=Object.create(k),t},e.awrap=function(t){return{__await:t}},E(S.prototype),c(S.prototype,s,(function(){return this})),e.AsyncIterator=S,e.async=function(t,i,r,n,o){void 0===o&&(o=Promise);var a=new S(u(t,i,r,n),o);return e.isGeneratorFunction(i)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},E(k),c(k,l,"Generator"),c(k,a,(function(){return this})),c(k,"toString",(function(){return"[object Generator]"})),e.keys=function(t){var e=Object(t),i=[];for(var r in e)i.push(r);return i.reverse(),function t(){for(;i.length;){var r=i.pop();if(r in e)return t.value=r,t.done=!1,t}return t.done=!0,t}},e.values=M,P.prototype={constructor:P,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(A),!e)for(var i in this)"t"===i.charAt(0)&&r.call(this,i)&&!isNaN(+i.slice(1))&&(this[i]=t)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var i=this;function n(r,n){return s.type="throw",s.arg=e,i.next=r,n&&(i.method="next",i.arg=t),!!n}for(var o=this.tryEntries.length-1;o>=0;--o){var a=this.tryEntries[o],s=a.completion;if("root"===a.tryLoc)return n("end");if(a.tryLoc<=this.prev){var l=r.call(a,"catchLoc"),c=r.call(a,"finallyLoc");if(l&&c){if(this.prev<a.catchLoc)return n(a.catchLoc,!0);if(this.prev<a.finallyLoc)return n(a.finallyLoc)}else if(l){if(this.prev<a.catchLoc)return n(a.catchLoc,!0)}else{if(!c)throw Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return n(a.finallyLoc)}}}},abrupt:function(t,e){for(var i=this.tryEntries.length-1;i>=0;--i){var n=this.tryEntries[i];if(n.tryLoc<=this.prev&&r.call(n,"finallyLoc")&&this.prev<n.finallyLoc){var o=n;break}}o&&("break"===t||"continue"===t)&&o.tryLoc<=e&&e<=o.finallyLoc&&(o=null);var a=o?o.completion:{};return a.type=t,a.arg=e,o?(this.method="next",this.next=o.finallyLoc,g):this.complete(a)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),g},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var i=this.tryEntries[e];if(i.finallyLoc===t)return this.complete(i.completion,i.afterLoc),A(i),g}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var i=this.tryEntries[e];if(i.tryLoc===t){var r=i.completion;if("throw"===r.type){var n=r.arg;A(i)}return n}}throw Error("illegal catch attempt")},delegateYield:function(e,i,r){return this.delegate={iterator:M(e),resultName:i,nextLoc:r},"next"===this.method&&(this.arg=t),g}},e}function me(t,e,i,r,n,o,a){try{var s=t[o](a),l=s.value}catch(t){return void i(t)}s.done?e(l):Promise.resolve(l).then(r,n)}function ge(t){return function(){var e=this,i=arguments;return new Promise((function(r,n){var o=t.apply(e,i);function a(t){me(o,r,n,a,s,"next",t)}function s(t){me(o,r,n,a,s,"throw",t)}a(void 0)}))}}function ye(t,e){for(var i=0;i<e.length;i++){var r=e[i];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,ve(r.key),r)}}function _e(t,e,i){return(e=ve(e))in t?Object.defineProperty(t,e,{value:i,enumerable:!0,configurable:!0,writable:!0}):t[e]=i,t}function ve(t){var e=function(t,e){if("object"!=he(t)||!t)return t;var i=t[Symbol.toPrimitive];if(void 0!==i){var r=i.call(t,e);if("object"!=he(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t,"string");return"symbol"==he(e)?e:e+""}le(ue,"instance",new ue);var be=function(){function t(e){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),_e(this,"baseUrl","https://us-central1-project-1393626302506343732.cloudfunctions.net/sdk/"),_e(this,"baseUrlMapVx","https://api.mapvx.com/api/"),this.lang=e}return function(t,e,i){return e&&ye(t.prototype,e),i&&ye(t,i),Object.defineProperty(t,"prototype",{writable:!1}),t}(t,[{key:"setLang",value:function(t){this.lang=t}},{key:"fetchTransport",value:(g=ge(fe().mark((function e(i,r){var n,o;return fe().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n={method:"GET",headers:{"content-type":"application/json"}},o={token:i,stopId:r,lang:this.lang},e.abrupt("return",t.fetchFromUrl(this.baseUrl+"v2/vehiclesWithSchedules",o,n));case 3:case"end":return e.stop()}}),e,this)}))),function(t,e){return g.apply(this,arguments)})},{key:"fetchStops",value:(m=ge(fe().mark((function e(i,r,n){var o,a;return fe().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return o={method:"GET",headers:{"content-type":"application/json"}},a={token:i,stopId:r,vehicleId:n,lang:this.lang},e.abrupt("return",t.fetchFromUrl(this.baseUrl+"v2/stops",a,o));case 3:case"end":return e.stop()}}),e,this)}))),function(t,e,i){return m.apply(this,arguments)})},{key:"fetchMapStyle",value:(f=ge(fe().mark((function e(i,r){var n,o;return fe().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n={method:"GET",headers:{"content-type":"application/json"}},o={token:i,lang:this.lang},null!=r&&(o.place_id=r),e.abrupt("return",t.fetchFromUrl(this.baseUrl+"mapStyleJson",o,n));case 4:case"end":return e.stop()}}),e,this)}))),function(t,e){return f.apply(this,arguments)})},{key:"fetchAllowedPlaces",value:(p=ge(fe().mark((function e(i){var r,n;return fe().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r={method:"GET",headers:{"content-type":"application/json"}},n={token:i,lang:this.lang},e.abrupt("return",t.fetchFromUrl(this.baseUrl+"v2/availablePlaces",n,r));case 3:case"end":return e.stop()}}),e,this)}))),function(t){return p.apply(this,arguments)})},{key:"fetchPlaceDetail",value:(d=ge(fe().mark((function e(i,r){var n,o;return fe().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n={method:"GET",headers:{"content-type":"application/json"}},o={token:i,place_id:r,lang:this.lang},e.abrupt("return",t.fetchFromUrl(this.baseUrl+"v3/place",o,n));case 3:case"end":return e.stop()}}),e,this)}))),function(t,e){return d.apply(this,arguments)})},{key:"fetchSubPlaces",value:(h=ge(fe().mark((function e(i,r){var n,o;return fe().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n={method:"GET",headers:{"content-type":"application/json"}},o={token:r,targetPlace:i,lang:this.lang},e.abrupt("return",t.fetchFromUrl(this.baseUrl+"v3/subPlaces",o,n));case 3:case"end":return e.stop()}}),e,this)}))),function(t,e){return h.apply(this,arguments)})},{key:"fetchRoute",value:(u=ge(fe().mark((function e(i,r){var n,o,a,s,l,c,u,h,d,p,f,m,g,y,_;return fe().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:for(y in n={method:"GET",headers:{"content-type":"application/json"}},o={fromLatLng:void 0,fromBuilding:void 0,fromFloor:void 0,toLatLng:void 0,toBuilding:void 0,toFloor:void 0,fromPlaceId:void 0,toPlaceId:void 0,travelMode:lt.walking,reducedMobility:i.preferAccessibleRoute?1:0,announceFormat:i.announceFormat,userBearing:0,lang:this.lang,unitSystem:i.unitSystem,token:r},"id"in i.initialLocation?o.fromPlaceId=i.initialLocation.id:(a=i.initialLocation,s=a.lat,l=a.lng,c=a.floorId,u=a.placeId,o.fromLatLng="".concat(s,",").concat(l),o.fromFloor=c,o.fromBuilding=u),"id"in i.finalLocation?o.toPlaceId=i.finalLocation.id:(h=i.finalLocation,d=h.lat,p=h.lng,f=h.floorId,m=h.placeId,o.toLatLng="".concat(d,",").concat(p),o.toFloor=f,o.toBuilding=m),g={},o)null!=(_=o[y])&&(g[y]=_);return e.abrupt("return",t.fetchFromUrl(this.baseUrl+"route",g,n));case 7:case"end":return e.stop()}}),e,this)}))),function(t,e){return u.apply(this,arguments)})},{key:"fetchRouteV2",value:(c=ge(fe().mark((function e(i,r){var n,o,a,s,l,c,u,h,d,p,f,m,g,y,_;return fe().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:for(y in n={method:"GET",headers:{"content-type":"application/json"}},o={fromLatLng:void 0,fromBuilding:void 0,fromFloor:void 0,toLatLng:void 0,toBuilding:void 0,toFloor:void 0,fromPlaceId:void 0,toPlaceId:void 0,travelMode:lt.walking,reducedMobility:i.preferAccessibleRoute?1:0,announceFormat:i.announceFormat,userBearing:0,lang:this.lang,unitSystem:i.unitSystem,token:r},"id"in i.initialLocation?o.fromPlaceId=i.initialLocation.id:(a=i.initialLocation,s=a.lat,l=a.lng,c=a.floorId,u=a.placeId,o.fromLatLng="".concat(s,",").concat(l),o.fromFloor=c,o.fromBuilding=u),"id"in i.finalLocation?o.toPlaceId=i.finalLocation.id:(h=i.finalLocation,d=h.lat,p=h.lng,f=h.floorId,m=h.placeId,o.toLatLng="".concat(d,",").concat(p),o.toFloor=f,o.toBuilding=m),g={},o)null!=(_=o[y])&&(g[y]=_);return e.abrupt("return",t.fetchFromUrl(this.baseUrl+"v2/route",g,n));case 7:case"end":return e.stop()}}),e,this)}))),function(t,e){return c.apply(this,arguments)})},{key:"fetchInstitutions",value:(l=ge(fe().mark((function e(i){var r,n;return fe().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r={method:"GET",headers:{"content-type":"application/json"}},n={token:i,lang:this.lang},e.abrupt("return",t.fetchFromUrl(this.baseUrl+"v2/institution",n,r));case 3:case"end":return e.stop()}}),e,this)}))),function(t){return l.apply(this,arguments)})},{key:"fetchSearchResults",value:(s=ge(fe().mark((function e(i,r,n,o){var a,s;return fe().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return a={method:"GET",headers:{"content-type":"application/json"}},s={institution_id:i,input:r,lang:this.lang,token:n},o&&(s.parentPlaces=de(o)),e.abrupt("return",t.fetchFromUrl(this.baseUrl+"v2/searchPlacesWithFilters",s,a));case 4:case"end":return e.stop()}}),e,this)}))),function(t,e,i,r){return s.apply(this,arguments)})},{key:"fetchConfiguration",value:(a=ge(fe().mark((function e(i,r){var n,o;return fe().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n={method:"GET",headers:{"content-type":"application/json"}},o={token:i,lang:this.lang},r&&(o.place_id=r),e.abrupt("return",t.fetchFromUrl(this.baseUrlMapVx+"configuration",o,n));case 4:case"end":return e.stop()}}),e,this)}))),function(t,e){return a.apply(this,arguments)})},{key:"fetchCategories",value:(o=ge(fe().mark((function e(i,r){var n,o;return fe().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n={method:"GET",headers:{"content-type":"application/json"}},o={token:i,lang:this.lang},r&&(o.id=r),e.abrupt("return",t.fetchFromUrl(this.baseUrlMapVx+"category",o,n));case 4:case"end":return e.stop()}}),e,this)}))),function(t,e){return o.apply(this,arguments)})},{key:"fetchRoutesForOrigin",value:(n=ge(fe().mark((function e(i,r,n,o,a,s){var l,c;return fe().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return l={method:"GET",headers:{"content-type":"application/json"}},c={token:i,placeId:r,fromPlace:n,announceFormat:o,unitSystem:a,mode:s,lang:this.lang},e.abrupt("return",t.fetchFromUrl(this.baseUrl+"routes_for_origin",c,l));case 3:case"end":return e.stop()}}),e,this)}))),function(t,e,i,r,o,a){return n.apply(this,arguments)})},{key:"fetchCacheTimestamp",value:(r=ge(fe().mark((function e(i,r){var n,o;return fe().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n={method:"GET",headers:{"content-type":"application/json"}},o={token:i,placeId:r},e.abrupt("return",t.fetchFromUrl(this.baseUrl+"cache_timestamp",o,n));case 3:case"end":return e.stop()}}),e,this)}))),function(t,e){return r.apply(this,arguments)})},{key:"fetchCssCustomization",value:(i=ge(fe().mark((function e(i,r){var n,o;return fe().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n={method:"GET",headers:{"content-type":"application/json"}},o={token:i,type:r},e.abrupt("return",t.fetchFromUrl(this.baseUrlMapVx+"styles/customStyles",o,n));case 3:case"end":return e.stop()}}),e,this)}))),function(t,e){return i.apply(this,arguments)})}],[{key:"fetchFromUrl",value:(e=ge(fe().mark((function t(e,i,r){var n;return fe().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return(n=new URL(e)).search=new URLSearchParams(i).toString(),t.abrupt("return",fetch(n.toString(),r));case 3:case"end":return t.stop()}}),t)}))),function(t,i,r){return e.apply(this,arguments)})}]);var e,i,r,n,o,a,s,l,c,u,h,d,p,f,m,g}();function xe(t){return xe="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},xe(t)}function we(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var i=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=i){var r,n,o,a,s=[],l=!0,c=!1;try{if(o=(i=i.call(t)).next,0===e);else for(;!(l=(r=o.call(i)).done)&&(s.push(r.value),s.length!==e);l=!0);}catch(t){c=!0,n=t}finally{try{if(!l&&null!=i.return&&(a=i.return(),Object(a)!==a))return}finally{if(c)throw n}}return s}}(t,e)||Ee(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function ke(t,e){var i="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!i){if(Array.isArray(t)||(i=Ee(t))||e){i&&(t=i);var r=0,n=function(){};return{s:n,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:n}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,s=!1;return{s:function(){i=i.call(t)},n:function(){var t=i.next();return a=t.done,t},e:function(t){s=!0,o=t},f:function(){try{a||null==i.return||i.return()}finally{if(s)throw o}}}}function Ee(t,e){if(t){if("string"==typeof t)return Se(t,e);var i={}.toString.call(t).slice(8,-1);return"Object"===i&&t.constructor&&(i=t.constructor.name),"Map"===i||"Set"===i?Array.from(t):"Arguments"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i)?Se(t,e):void 0}}function Se(t,e){(null==e||e>t.length)&&(e=t.length);for(var i=0,r=Array(e);i<e;i++)r[i]=t[i];return r}function Ie(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */Ie=function(){return e};var t,e={},i=Object.prototype,r=i.hasOwnProperty,n=Object.defineProperty||function(t,e,i){t[e]=i.value},o="function"==typeof Symbol?Symbol:{},a=o.iterator||"@@iterator",s=o.asyncIterator||"@@asyncIterator",l=o.toStringTag||"@@toStringTag";function c(t,e,i){return Object.defineProperty(t,e,{value:i,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{c({},"")}catch(t){c=function(t,e,i){return t[e]=i}}function u(t,e,i,r){var o=e&&e.prototype instanceof y?e:y,a=Object.create(o.prototype),s=new P(r||[]);return n(a,"_invoke",{value:I(t,i,s)}),a}function h(t,e,i){try{return{type:"normal",arg:t.call(e,i)}}catch(t){return{type:"throw",arg:t}}}e.wrap=u;var d="suspendedStart",p="suspendedYield",f="executing",m="completed",g={};function y(){}function _(){}function v(){}var b={};c(b,a,(function(){return this}));var x=Object.getPrototypeOf,w=x&&x(x(M([])));w&&w!==i&&r.call(w,a)&&(b=w);var k=v.prototype=y.prototype=Object.create(b);function E(t){["next","throw","return"].forEach((function(e){c(t,e,(function(t){return this._invoke(e,t)}))}))}function S(t,e){function i(n,o,a,s){var l=h(t[n],t,o);if("throw"!==l.type){var c=l.arg,u=c.value;return u&&"object"==xe(u)&&r.call(u,"__await")?e.resolve(u.__await).then((function(t){i("next",t,a,s)}),(function(t){i("throw",t,a,s)})):e.resolve(u).then((function(t){c.value=t,a(c)}),(function(t){return i("throw",t,a,s)}))}s(l.arg)}var o;n(this,"_invoke",{value:function(t,r){function n(){return new e((function(e,n){i(t,r,e,n)}))}return o=o?o.then(n,n):n()}})}function I(e,i,r){var n=d;return function(o,a){if(n===f)throw Error("Generator is already running");if(n===m){if("throw"===o)throw a;return{value:t,done:!0}}for(r.method=o,r.arg=a;;){var s=r.delegate;if(s){var l=C(s,r);if(l){if(l===g)continue;return l}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if(n===d)throw n=m,r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n=f;var c=h(e,i,r);if("normal"===c.type){if(n=r.done?m:p,c.arg===g)continue;return{value:c.arg,done:r.done}}"throw"===c.type&&(n=m,r.method="throw",r.arg=c.arg)}}}function C(e,i){var r=i.method,n=e.iterator[r];if(n===t)return i.delegate=null,"throw"===r&&e.iterator.return&&(i.method="return",i.arg=t,C(e,i),"throw"===i.method)||"return"!==r&&(i.method="throw",i.arg=new TypeError("The iterator does not provide a '"+r+"' method")),g;var o=h(n,e.iterator,i.arg);if("throw"===o.type)return i.method="throw",i.arg=o.arg,i.delegate=null,g;var a=o.arg;return a?a.done?(i[e.resultName]=a.value,i.next=e.nextLoc,"return"!==i.method&&(i.method="next",i.arg=t),i.delegate=null,g):a:(i.method="throw",i.arg=new TypeError("iterator result is not an object"),i.delegate=null,g)}function T(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function A(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function P(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(T,this),this.reset(!0)}function M(e){if(e||""===e){var i=e[a];if(i)return i.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var n=-1,o=function i(){for(;++n<e.length;)if(r.call(e,n))return i.value=e[n],i.done=!1,i;return i.value=t,i.done=!0,i};return o.next=o}}throw new TypeError(xe(e)+" is not iterable")}return _.prototype=v,n(k,"constructor",{value:v,configurable:!0}),n(v,"constructor",{value:_,configurable:!0}),_.displayName=c(v,l,"GeneratorFunction"),e.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===_||"GeneratorFunction"===(e.displayName||e.name))},e.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,v):(t.__proto__=v,c(t,l,"GeneratorFunction")),t.prototype=Object.create(k),t},e.awrap=function(t){return{__await:t}},E(S.prototype),c(S.prototype,s,(function(){return this})),e.AsyncIterator=S,e.async=function(t,i,r,n,o){void 0===o&&(o=Promise);var a=new S(u(t,i,r,n),o);return e.isGeneratorFunction(i)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},E(k),c(k,l,"Generator"),c(k,a,(function(){return this})),c(k,"toString",(function(){return"[object Generator]"})),e.keys=function(t){var e=Object(t),i=[];for(var r in e)i.push(r);return i.reverse(),function t(){for(;i.length;){var r=i.pop();if(r in e)return t.value=r,t.done=!1,t}return t.done=!0,t}},e.values=M,P.prototype={constructor:P,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(A),!e)for(var i in this)"t"===i.charAt(0)&&r.call(this,i)&&!isNaN(+i.slice(1))&&(this[i]=t)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var i=this;function n(r,n){return s.type="throw",s.arg=e,i.next=r,n&&(i.method="next",i.arg=t),!!n}for(var o=this.tryEntries.length-1;o>=0;--o){var a=this.tryEntries[o],s=a.completion;if("root"===a.tryLoc)return n("end");if(a.tryLoc<=this.prev){var l=r.call(a,"catchLoc"),c=r.call(a,"finallyLoc");if(l&&c){if(this.prev<a.catchLoc)return n(a.catchLoc,!0);if(this.prev<a.finallyLoc)return n(a.finallyLoc)}else if(l){if(this.prev<a.catchLoc)return n(a.catchLoc,!0)}else{if(!c)throw Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return n(a.finallyLoc)}}}},abrupt:function(t,e){for(var i=this.tryEntries.length-1;i>=0;--i){var n=this.tryEntries[i];if(n.tryLoc<=this.prev&&r.call(n,"finallyLoc")&&this.prev<n.finallyLoc){var o=n;break}}o&&("break"===t||"continue"===t)&&o.tryLoc<=e&&e<=o.finallyLoc&&(o=null);var a=o?o.completion:{};return a.type=t,a.arg=e,o?(this.method="next",this.next=o.finallyLoc,g):this.complete(a)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),g},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var i=this.tryEntries[e];if(i.finallyLoc===t)return this.complete(i.completion,i.afterLoc),A(i),g}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var i=this.tryEntries[e];if(i.tryLoc===t){var r=i.completion;if("throw"===r.type){var n=r.arg;A(i)}return n}}throw Error("illegal catch attempt")},delegateYield:function(e,i,r){return this.delegate={iterator:M(e),resultName:i,nextLoc:r},"next"===this.method&&(this.arg=t),g}},e}function Ce(t,e,i,r,n,o,a){try{var s=t[o](a),l=s.value}catch(t){return void i(t)}s.done?e(l):Promise.resolve(l).then(r,n)}function Te(t){return function(){var e=this,i=arguments;return new Promise((function(r,n){var o=t.apply(e,i);function a(t){Ce(o,r,n,a,s,"next",t)}function s(t){Ce(o,r,n,a,s,"throw",t)}a(void 0)}))}}function Ae(t,e){var i=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),i.push.apply(i,r)}return i}function Pe(t){for(var e=1;e<arguments.length;e++){var i=null!=arguments[e]?arguments[e]:{};e%2?Ae(Object(i),!0).forEach((function(e){Oe(t,e,i[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(i)):Ae(Object(i)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(i,e))}))}return t}function Me(t,e,i){return e&&function(t,e){for(var i=0;i<e.length;i++){var r=e[i];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,Fe(r.key),r)}}(t.prototype,e),Object.defineProperty(t,"prototype",{writable:!1}),t}function Le(t,e,i){return e=De(e),function(t,e){if(e&&("object"==xe(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(t,ze()?Reflect.construct(e,[],De(t).constructor):e.apply(t,i))}function ze(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(ze=function(){return!!t})()}function De(t){return De=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},De(t)}function Re(t,e){return Re=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},Re(t,e)}function Oe(t,e,i){return(e=Fe(e))in t?Object.defineProperty(t,e,{value:i,enumerable:!0,configurable:!0,writable:!0}):t[e]=i,t}function Fe(t){var e=function(t,e){if("object"!=xe(t)||!t)return t;var i=t[Symbol.toPrimitive];if(void 0!==i){var r=i.call(t,e);if("object"!=xe(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t,"string");return"symbol"==xe(e)?e:e+""}var Be=function(t){function e(t,i){var r;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),Oe(r=Le(this,e),"cache",ue.instance),r.token=t,r.requester=new be(i),r}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&Re(t,e)}(e,t),Me(e,[{key:"setLang",value:function(t){this.requester.setLang(t)}},{key:"prepareSegmentation",value:function(t){return Pe(Pe({},t),{},{token:this.token})}},{key:"fetchAndParseMapStyle",value:(g=Te(Ie().mark((function t(e){var i,r,n,o;return Ie().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(void 0!==e||!this.baseStyle){t.next=2;break}return t.abrupt("return",this.baseStyle);case 2:return t.prev=2,t.next=5,this.requester.fetchMapStyle(this.token,e);case 5:if((i=t.sent).ok){t.next=11;break}return t.next=9,i.json();case 9:throw r=t.sent,new Error("Fetch failed with status ".concat(i.status,": ").concat(r));case 11:return t.next=13,i.json();case 13:return n=t.sent,o=n.style,void 0===e&&(this.baseStyle=o),this.logEvent("fetchAndParseMapStyle"),t.abrupt("return",o);case 20:throw t.prev=20,t.t0=t.catch(2),this.logError(t.t0,{functionName:"fetchAndParseMapStyle"}),new Error("Failed to fetch and parse map style");case 24:case"end":return t.stop()}}),t,this,[[2,20]])}))),function(t){return g.apply(this,arguments)})},{key:"fetchAndParseInstitutions",value:(m=Te(Ie().mark((function t(){var e,i,r,n,o,a,s,l,c;return Ie().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,t.next=3,this.requester.fetchInstitutions(this.token);case 3:if((e=t.sent).ok){t.next=9;break}return t.next=7,e.json();case 7:throw i=t.sent,new Error("Fetch failed with status ".concat(e.status,": ").concat(i));case 9:return t.next=11,e.json();case 11:r=t.sent,n=[],o=ke(r);try{for(o.s();!(a=o.n()).done;)s=a.value,l=new re(s),n.push(l)}catch(u){o.e(u)}finally{o.f()}if(n.sort((function(t,e){return t.title.localeCompare(e.title)})),!(c=n)){t.next=22;break}return this.logEvent("fetchAndParseInstitutionsV2"),t.abrupt("return",c);case 22:throw new Error("No institutions associated to this apiKey");case 23:t.next=29;break;case 25:throw t.prev=25,t.t0=t.catch(0),this.logError(t.t0,{functionName:"fetchAndParseInstitutionsV2"}),new Error("Failed to fetch and parse institution");case 29:case"end":return t.stop()}}),t,this,[[0,25]])}))),function(){return m.apply(this,arguments)})},{key:"fetchAndParsePlaceDetail",value:(f=Te(Ie().mark((function t(e){var i,r,n,o,a;return Ie().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(t.prev=0,null==(i=this.cache.getPlace(e))){t.next=5;break}return this.logEvent("fetchAndParsePlaceDetail",{cached:"true"}),t.abrupt("return",i);case 5:return t.next=7,this.requester.fetchPlaceDetail(this.token,e);case 7:if((r=t.sent).ok){t.next=13;break}return t.next=11,r.json();case 11:throw n=t.sent,new Error("Fetch failed with status ".concat(r.status,": ").concat(n));case 13:return t.next=15,r.json();case 15:return o=t.sent,a=new Kt(o),this.cache.setPlace(a.lazarilloId,a),null!=a.clientId&&this.cache.setPlace(a.clientId,a),this.logEvent("fetchAndParsePlaceDetail",{cached:"false"}),t.abrupt("return",a);case 23:throw t.prev=23,t.t0=t.catch(0),this.logError(t.t0,{functionName:"fetchAndParsePlaceDetail"}),new Error("Failed to fetch and parse place detail");case 27:case"end":return t.stop()}}),t,this,[[0,23]])}))),function(t){return f.apply(this,arguments)})},{key:"fetchAndParseSubPlaces",value:(p=Te(Ie().mark((function t(e){var i,r,n,o,a=this;return Ie().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,t.next=3,this.requester.fetchSubPlaces(e,this.token);case 3:if((i=t.sent).ok){t.next=9;break}return t.next=7,i.json();case 7:throw r=t.sent,new Error("Fetch failed with status ".concat(i.status,": ").concat(r));case 9:return t.next=11,i.json();case 11:return n=t.sent,o=n.map((function(t){return new Kt(t)})),this.logEvent("fetchAndParseSubPlaces"),o.forEach((function(t){a.cache.hasPlace(t.lazarilloId)||a.cache.setPlace(t.lazarilloId,t),null==t.clientId||a.cache.hasPlace(t.clientId)||a.cache.setPlace(t.clientId,t)})),t.abrupt("return",o);case 18:throw t.prev=18,t.t0=t.catch(0),this.logError(t.t0,{functionName:"fetchAndParseSubPlaces",parentPlaceId:e}),new Error("Failed to fetch and parse subplaces");case 22:case"end":return t.stop()}}),t,this,[[0,18]])}))),function(t){return p.apply(this,arguments)})},{key:"fetchAndParseAvailablePlaces",value:(d=Te(Ie().mark((function t(){var e,i,r,n,o=this;return Ie().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,t.next=3,this.requester.fetchAllowedPlaces(this.token);case 3:if((e=t.sent).ok){t.next=9;break}return t.next=7,e.json();case 7:throw i=t.sent,new Error("Fetch failed with status ".concat(e.status,": ").concat(i));case 9:return t.next=11,e.json();case 11:return r=t.sent,n=r.map((function(t){return new Kt(t)})),this.logEvent("fetchAndParseAvailablePlaces"),n.forEach((function(t){o.cache.hasPlace(t.lazarilloId)||o.cache.setPlace(t.lazarilloId,t),null==t.clientId||o.cache.hasPlace(t.clientId)||o.cache.setPlace(t.clientId,t)})),t.abrupt("return",n);case 18:throw t.prev=18,t.t0=t.catch(0),this.logError(t.t0,{functionName:"fetchAndParseAvailablePlaces"}),new Error("Failed to fetch and parse parent places");case 22:case"end":return t.stop()}}),t,this,[[0,18]])}))),function(){return d.apply(this,arguments)})},{key:"getCachedPlaces",value:function(t){var e=this,i=[];return t.forEach((function(t){var r=e.cache.getPlace(t);if(null!=r)i.push(r);else{var n=new Error("The id was not found on cache");"captureStackTrace"in Error&&Error.captureStackTrace(n),e.logError(n,{functionName:"getcache",id:t})}})),i}},{key:"fetchAndParseRoute",value:(h=Te(Ie().mark((function t(e){var i,r,n,o,a,s;return Ie().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(t.prev=0,i="","id"in e.finalLocation&&(i=e.finalLocation.id),null==(r=this.cache.getRoute(i))){t.next=8;break}return this.logEvent("fetchAndParseRoute",{cached:"true"}),this.debugLog("Route cache testing. Found in caché."),t.abrupt("return",r.data);case 8:return t.next=10,this.requester.fetchRoute(e,this.token);case 10:if((n=t.sent).ok){t.next=16;break}return t.next=14,n.json();case 14:throw o=t.sent,new Error("Fetch failed with status ".concat(n.status,": ").concat(o));case 16:return t.next=18,n.json();case 18:return a=t.sent,s=new Nt(a[0]),this.logEvent("fetchAndParseRoute"),this.debugLog("Route cache testing. Fetched."),t.abrupt("return",s);case 25:throw t.prev=25,t.t0=t.catch(0),this.logError(t.t0,{functionName:"fetchAndParseRoute"}),new Error("Failed to fetch and parse route");case 29:case"end":return t.stop()}}),t,this,[[0,25]])}))),function(t){return h.apply(this,arguments)})},{key:"fetchAndParseRouteV2",value:(u=Te(Ie().mark((function t(e){var i,r,n,o,a,s;return Ie().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(t.prev=0,i="","id"in e.finalLocation&&(i=e.finalLocation.id),null==(r=this.cache.getRoute(i))){t.next=8;break}return this.logEvent("fetchAndParseRouteV2",{cached:"true"}),this.debugLog("Route cache testing. Found in caché."),t.abrupt("return",r.data);case 8:return t.next=10,this.requester.fetchRouteV2(e,this.token);case 10:if((n=t.sent).ok){t.next=16;break}return t.next=14,n.json();case 14:throw o=t.sent,new Error("Fetch failed with status ".concat(n.status,": ").concat(o));case 16:return t.next=18,n.json();case 18:return a=t.sent,s=new Nt(a[0]),this.logEvent("fetchAndParseRouteV2"),this.debugLog("Route cache testing. Fetched."),t.abrupt("return",s);case 25:throw t.prev=25,t.t0=t.catch(0),this.logError(t.t0,{functionName:"fetchAndParseRouteV2"}),new Error("Failed to fetch and parse route");case 29:case"end":return t.stop()}}),t,this,[[0,25]])}))),function(t){return u.apply(this,arguments)})},{key:"fetchAndParseTransport",value:(c=Te(Ie().mark((function t(e){var i,r,n,o,a,s,l,c,u,h=this;return Ie().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(t.prev=0,null==(i=this.cache.getVehicle(e))||!(Date.now()-i.timestamp<6e3||0===i.data.routes.length)){t.next=5;break}return this.logEvent("fetchAndParseTransport",{cached:"true"}),t.abrupt("return",i.data);case 5:return t.next=7,this.requester.fetchTransport(this.token,e);case 7:if((r=t.sent).ok){t.next=13;break}return t.next=11,r.json();case 11:throw n=t.sent,new Error("Fetch failed with status ".concat(r.status,": ").concat(n));case 13:return t.next=15,r.json();case 15:if(!((o=t.sent).realtimeSchedules.length>0)){t.next=22;break}return a=o.realtimeSchedules.map((function(t){return h.fetchAndParseStops(e,t.vehicleId)})),t.next=20,Promise.all(a);case 20:(s=t.sent).length>0&&o.realtimeSchedules.forEach((function(t){var e,i;t.stops=null!==(e=null===(i=s.find((function(e){return e.id==t.vehicleId})))||void 0===i?void 0:i.places)&&void 0!==e?e:[]}));case 22:return l=new oe(o),this.cache.setVehicle(e,{timestamp:Date.now(),data:l}),this.logEvent("fetchAndParseTransport",{cached:"false"}),t.abrupt("return",l);case 28:if(t.prev=28,t.t0=t.catch(0),this.logError(t.t0,{functionName:"fetchAndParseTransport"}),null==(c=this.cache.getVehicle(e))){t.next=38;break}return u=new oe({realtimeSchedules:[],schedules:c.data.schedule}),this.logEvent("fetchAndParseTransport",{cached:"true"}),t.abrupt("return",u);case 38:throw new Error("Failed to fetch and parse transport");case 39:case"end":return t.stop()}}),t,this,[[0,28]])}))),function(t){return c.apply(this,arguments)})},{key:"fetchAndParseStops",value:(l=Te(Ie().mark((function t(e,i){var r,n,o,a,s;return Ie().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(t.prev=0,!(null!=(r=this.cache.getStops(e+i))&&Date.now()-r.timestamp<6e4)){t.next=5;break}return this.logEvent("fetchAndParseStops",{cached:"true"}),t.abrupt("return",{id:i,places:r.data});case 5:return t.next=7,this.requester.fetchStops(this.token,e,i);case 7:if((n=t.sent).ok){t.next=13;break}return t.next=11,n.json();case 11:throw o=t.sent,new Error("Fetch failed with status ".concat(n.status,": ").concat(o));case 13:return t.next=15,n.json();case 15:return a=t.sent,s=a.map((function(t){return new Kt(t)})),this.cache.setStops(e+i,{timestamp:Date.now(),data:s}),this.logEvent("fetchAndParseStops",{cached:"false"}),t.abrupt("return",{id:i,places:s});case 22:throw t.prev=22,t.t0=t.catch(0),this.logError(t.t0,{functionName:"fetchAndParseStops"}),new Error("Failed to fetch and parse stops");case 26:case"end":return t.stop()}}),t,this,[[0,22]])}))),function(t,e){return l.apply(this,arguments)})},{key:"fetchAndParseSearchResults",value:(s=Te(Ie().mark((function t(e,i,r){var n,o,a,s;return Ie().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,t.next=3,this.requester.fetchSearchResults(e,i,this.token,r);case 3:if((n=t.sent).ok){t.next=9;break}return t.next=7,n.json();case 7:throw o=t.sent,new Error("Fetch failed with status ".concat(n.status,": ").concat(o));case 9:return t.next=11,n.json();case 11:return a=t.sent,s=a.map((function(t){return new Kt(t)})),t.abrupt("return",s);case 16:throw t.prev=16,t.t0=t.catch(0),this.logError(t.t0,{functionName:"fetchAndParseSearchResults"}),new Error("Failed to fetch and parse search results");case 20:case"end":return t.stop()}}),t,this,[[0,16]])}))),function(t,e,i){return s.apply(this,arguments)})},{key:"fetchAndParseRoutesFromOrigin",value:(a=Te(Ie().mark((function t(e,i,r,n,o){var a,s,l,c,u,h=this;return Ie().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,t.next=3,this.requester.fetchRoutesForOrigin(this.token,e,i,r,n,o);case 3:if((a=t.sent).ok){t.next=9;break}return t.next=7,a.json();case 7:throw s=t.sent,new Error("Fetch failed with status ".concat(a.status,": ").concat(s));case 9:return t.next=11,a.json();case 11:l=t.sent,c=l.routes,u=l.accessibleRoutes,Object.entries(c).forEach((function(t){var e=we(t,2),i=e[0],r=e[1],n=new Nt(r[0]);h.cache.setRoute(i,{timestamp:Date.now(),data:n})})),Object.entries(u).forEach((function(t){var e=we(t,2),i=e[0],r=e[1],n=new Nt(r[0]);h.cache.setAccessibleRoute(i,{timestamp:Date.now(),data:n})})),this.debugLog("Route cache testing. Cache populated!"),t.next=23;break;case 19:throw t.prev=19,t.t0=t.catch(0),this.logError(t.t0,{functionName:"fetchAndParseRoutesFromOrigin"}),new Error("Failed to fetch and parse routes from origin results");case 23:case"end":return t.stop()}}),t,this,[[0,19]])}))),function(t,e,i,r,n){return a.apply(this,arguments)})},{key:"fetchAndParseCacheTimestamp",value:(o=Te(Ie().mark((function t(e){var i,r,n,o;return Ie().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,t.next=3,this.requester.fetchCacheTimestamp(this.token,e);case 3:if((i=t.sent).ok){t.next=9;break}return t.next=7,i.json();case 7:throw r=t.sent,new Error("Fetch failed with status ".concat(i.status,": ").concat(r));case 9:return t.next=11,i.json();case 11:return n=t.sent,o=n.lastUpdate,t.abrupt("return",o);case 16:throw t.prev=16,t.t0=t.catch(0),this.logError(t.t0,{functionName:"fetchAndParseCacheTimestamp"}),new Error("Failed to fetch and parse cache timestamp");case 20:case"end":return t.stop()}}),t,this,[[0,16]])}))),function(t){return o.apply(this,arguments)})},{key:"cleanRoutesCache",value:function(){this.cache.cleanRoutesCache(),this.cache.cleanAccessibleRoutesCache()}},{key:"fetchAndParseConfiguration",value:(n=Te(Ie().mark((function t(e){var i,r,n;return Ie().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,t.next=3,this.requester.fetchConfiguration(this.token,e);case 3:if((i=t.sent).ok){t.next=9;break}return t.next=7,i.json();case 7:throw r=t.sent,new Error("Fetch failed with status ".concat(i.status,": ").concat(r));case 9:return t.next=11,i.json();case 11:return n=t.sent,t.abrupt("return",n);case 15:throw t.prev=15,t.t0=t.catch(0),this.logError(t.t0,{functionName:"fetchAndParseConfiguration"}),new Error("Failed to fetch and parse configuration");case 19:case"end":return t.stop()}}),t,this,[[0,15]])}))),function(t){return n.apply(this,arguments)})},{key:"fetchAndParseCategories",value:(r=Te(Ie().mark((function t(e){var i,r;return Ie().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,t.next=3,this.requester.fetchCategories(this.token,e);case 3:if((i=t.sent).ok){t.next=9;break}return t.next=7,i.json();case 7:throw r=t.sent,new Error("Fetch failed with status ".concat(i.status,": ").concat(r));case 9:return t.next=11,i.json();case 11:return t.abrupt("return",t.sent);case 14:throw t.prev=14,t.t0=t.catch(0),this.logError(t.t0,{functionName:"fetchAndParseCategories"}),new Error("Failed to fetch and parse categories");case 18:case"end":return t.stop()}}),t,this,[[0,14]])}))),function(t){return r.apply(this,arguments)})},{key:"fetchAndParseCssCustomization",value:(i=Te(Ie().mark((function t(e){var i,r,n;return Ie().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,t.next=3,this.requester.fetchCssCustomization(this.token,e);case 3:if((i=t.sent).ok){t.next=9;break}return t.next=7,i.json();case 7:throw r=t.sent,new Error("Fetch failed with status ".concat(i.status,": ").concat(r));case 9:return t.next=11,i.json();case 11:return n=t.sent,t.abrupt("return",n);case 15:throw t.prev=15,t.t0=t.catch(0),this.logError(t.t0,{functionName:"fetchAndParseCssCustomization"}),new Error("Failed to fetch and parse css customization");case 19:case"end":return t.stop()}}),t,this,[[0,15]])}))),function(t){return i.apply(this,arguments)})}]);var i,r,n,o,a,s,l,c,u,h,d,p,f,m,g}(Tt);function Ne(t){return Ne="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Ne(t)}function je(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */je=function(){return e};var t,e={},i=Object.prototype,r=i.hasOwnProperty,n=Object.defineProperty||function(t,e,i){t[e]=i.value},o="function"==typeof Symbol?Symbol:{},a=o.iterator||"@@iterator",s=o.asyncIterator||"@@asyncIterator",l=o.toStringTag||"@@toStringTag";function c(t,e,i){return Object.defineProperty(t,e,{value:i,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{c({},"")}catch(t){c=function(t,e,i){return t[e]=i}}function u(t,e,i,r){var o=e&&e.prototype instanceof y?e:y,a=Object.create(o.prototype),s=new P(r||[]);return n(a,"_invoke",{value:I(t,i,s)}),a}function h(t,e,i){try{return{type:"normal",arg:t.call(e,i)}}catch(t){return{type:"throw",arg:t}}}e.wrap=u;var d="suspendedStart",p="suspendedYield",f="executing",m="completed",g={};function y(){}function _(){}function v(){}var b={};c(b,a,(function(){return this}));var x=Object.getPrototypeOf,w=x&&x(x(M([])));w&&w!==i&&r.call(w,a)&&(b=w);var k=v.prototype=y.prototype=Object.create(b);function E(t){["next","throw","return"].forEach((function(e){c(t,e,(function(t){return this._invoke(e,t)}))}))}function S(t,e){function i(n,o,a,s){var l=h(t[n],t,o);if("throw"!==l.type){var c=l.arg,u=c.value;return u&&"object"==Ne(u)&&r.call(u,"__await")?e.resolve(u.__await).then((function(t){i("next",t,a,s)}),(function(t){i("throw",t,a,s)})):e.resolve(u).then((function(t){c.value=t,a(c)}),(function(t){return i("throw",t,a,s)}))}s(l.arg)}var o;n(this,"_invoke",{value:function(t,r){function n(){return new e((function(e,n){i(t,r,e,n)}))}return o=o?o.then(n,n):n()}})}function I(e,i,r){var n=d;return function(o,a){if(n===f)throw Error("Generator is already running");if(n===m){if("throw"===o)throw a;return{value:t,done:!0}}for(r.method=o,r.arg=a;;){var s=r.delegate;if(s){var l=C(s,r);if(l){if(l===g)continue;return l}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if(n===d)throw n=m,r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n=f;var c=h(e,i,r);if("normal"===c.type){if(n=r.done?m:p,c.arg===g)continue;return{value:c.arg,done:r.done}}"throw"===c.type&&(n=m,r.method="throw",r.arg=c.arg)}}}function C(e,i){var r=i.method,n=e.iterator[r];if(n===t)return i.delegate=null,"throw"===r&&e.iterator.return&&(i.method="return",i.arg=t,C(e,i),"throw"===i.method)||"return"!==r&&(i.method="throw",i.arg=new TypeError("The iterator does not provide a '"+r+"' method")),g;var o=h(n,e.iterator,i.arg);if("throw"===o.type)return i.method="throw",i.arg=o.arg,i.delegate=null,g;var a=o.arg;return a?a.done?(i[e.resultName]=a.value,i.next=e.nextLoc,"return"!==i.method&&(i.method="next",i.arg=t),i.delegate=null,g):a:(i.method="throw",i.arg=new TypeError("iterator result is not an object"),i.delegate=null,g)}function T(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function A(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function P(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(T,this),this.reset(!0)}function M(e){if(e||""===e){var i=e[a];if(i)return i.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var n=-1,o=function i(){for(;++n<e.length;)if(r.call(e,n))return i.value=e[n],i.done=!1,i;return i.value=t,i.done=!0,i};return o.next=o}}throw new TypeError(Ne(e)+" is not iterable")}return _.prototype=v,n(k,"constructor",{value:v,configurable:!0}),n(v,"constructor",{value:_,configurable:!0}),_.displayName=c(v,l,"GeneratorFunction"),e.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===_||"GeneratorFunction"===(e.displayName||e.name))},e.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,v):(t.__proto__=v,c(t,l,"GeneratorFunction")),t.prototype=Object.create(k),t},e.awrap=function(t){return{__await:t}},E(S.prototype),c(S.prototype,s,(function(){return this})),e.AsyncIterator=S,e.async=function(t,i,r,n,o){void 0===o&&(o=Promise);var a=new S(u(t,i,r,n),o);return e.isGeneratorFunction(i)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},E(k),c(k,l,"Generator"),c(k,a,(function(){return this})),c(k,"toString",(function(){return"[object Generator]"})),e.keys=function(t){var e=Object(t),i=[];for(var r in e)i.push(r);return i.reverse(),function t(){for(;i.length;){var r=i.pop();if(r in e)return t.value=r,t.done=!1,t}return t.done=!0,t}},e.values=M,P.prototype={constructor:P,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(A),!e)for(var i in this)"t"===i.charAt(0)&&r.call(this,i)&&!isNaN(+i.slice(1))&&(this[i]=t)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var i=this;function n(r,n){return s.type="throw",s.arg=e,i.next=r,n&&(i.method="next",i.arg=t),!!n}for(var o=this.tryEntries.length-1;o>=0;--o){var a=this.tryEntries[o],s=a.completion;if("root"===a.tryLoc)return n("end");if(a.tryLoc<=this.prev){var l=r.call(a,"catchLoc"),c=r.call(a,"finallyLoc");if(l&&c){if(this.prev<a.catchLoc)return n(a.catchLoc,!0);if(this.prev<a.finallyLoc)return n(a.finallyLoc)}else if(l){if(this.prev<a.catchLoc)return n(a.catchLoc,!0)}else{if(!c)throw Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return n(a.finallyLoc)}}}},abrupt:function(t,e){for(var i=this.tryEntries.length-1;i>=0;--i){var n=this.tryEntries[i];if(n.tryLoc<=this.prev&&r.call(n,"finallyLoc")&&this.prev<n.finallyLoc){var o=n;break}}o&&("break"===t||"continue"===t)&&o.tryLoc<=e&&e<=o.finallyLoc&&(o=null);var a=o?o.completion:{};return a.type=t,a.arg=e,o?(this.method="next",this.next=o.finallyLoc,g):this.complete(a)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),g},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var i=this.tryEntries[e];if(i.finallyLoc===t)return this.complete(i.completion,i.afterLoc),A(i),g}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var i=this.tryEntries[e];if(i.tryLoc===t){var r=i.completion;if("throw"===r.type){var n=r.arg;A(i)}return n}}throw Error("illegal catch attempt")},delegateYield:function(e,i,r){return this.delegate={iterator:M(e),resultName:i,nextLoc:r},"next"===this.method&&(this.arg=t),g}},e}function Ve(t,e,i,r,n,o,a){try{var s=t[o](a),l=s.value}catch(t){return void i(t)}s.done?e(l):Promise.resolve(l).then(r,n)}function Ue(t){return function(){var e=this,i=arguments;return new Promise((function(r,n){var o=t.apply(e,i);function a(t){Ve(o,r,n,a,s,"next",t)}function s(t){Ve(o,r,n,a,s,"throw",t)}a(void 0)}))}}function qe(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var i=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=i){var r,n,o,a,s=[],l=!0,c=!1;try{if(o=(i=i.call(t)).next,0===e);else for(;!(l=(r=o.call(i)).done)&&(s.push(r.value),s.length!==e);l=!0);}catch(t){c=!0,n=t}finally{try{if(!l&&null!=i.return&&(a=i.return(),Object(a)!==a))return}finally{if(c)throw n}}return s}}(t,e)||Ze(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function $e(t,e){var i=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),i.push.apply(i,r)}return i}function Ge(t){for(var e=1;e<arguments.length;e++){var i=null!=arguments[e]?arguments[e]:{};e%2?$e(Object(i),!0).forEach((function(e){ti(t,e,i[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(i)):$e(Object(i)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(i,e))}))}return t}function He(t){return function(t){if(Array.isArray(t))return We(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||Ze(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Ze(t,e){if(t){if("string"==typeof t)return We(t,e);var i={}.toString.call(t).slice(8,-1);return"Object"===i&&t.constructor&&(i=t.constructor.name),"Map"===i||"Set"===i?Array.from(t):"Arguments"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i)?We(t,e):void 0}}function We(t,e){(null==e||e>t.length)&&(e=t.length);for(var i=0,r=Array(e);i<e;i++)r[i]=t[i];return r}function Xe(t,e,i){return e&&function(t,e){for(var i=0;i<e.length;i++){var r=e[i];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,ei(r.key),r)}}(t.prototype,e),Object.defineProperty(t,"prototype",{writable:!1}),t}function Je(t,e,i){return e=Ye(e),function(t,e){if(e&&("object"==Ne(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(t,Ke()?Reflect.construct(e,[],Ye(t).constructor):e.apply(t,i))}function Ke(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(Ke=function(){return!!t})()}function Ye(t){return Ye=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Ye(t)}function Qe(t,e){return Qe=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},Qe(t,e)}function ti(t,e,i){return(e=ei(e))in t?Object.defineProperty(t,e,{value:i,enumerable:!0,configurable:!0,writable:!0}):t[e]=i,t}function ei(t){var e=function(t,e){if("object"!=Ne(t)||!t)return t;var i=t[Symbol.toPrimitive];if(void 0!==i){var r=i.call(t,e);if("object"!=Ne(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==Ne(e)?e:e+""}var ii=function(t){function e(t,i,r){var n,o,a;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),ti(a=Je(this,e),"potentialParentPlaces",[]),ti(a,"innerFloors",[]),ti(a,"subPlaces",[]),ti(a,"currentFloor",""),ti(a,"baseFilters",{}),ti(a,"markers",[]),ti(a,"enableHover",!1),ti(a,"hoveredId","unselected"),rt.includes(null!==(n=t.lang)&&void 0!==n?n:"")&&a.setRTLSupport(),a.repository=new Be(r,null!==(o=t.lang)&&void 0!==o?o:"en"),a.token=r,a.parentPlaceId=t.parentPlaceId,a.routeController=new it(a),a.userLocationMarker=void 0,a.watchPositionID=void 0,a.onFloorChange=t.onFloorChange,a.onParentPlaceChange=t.onParentPlaceChange,null!=t.parentPlaceId&&a.initialPlaceDetailSetUp(t.parentPlaceId),t.otherPotentialParentPlacesIds&&t.otherPotentialParentPlacesIds.length>0&&a.loadOtherPotentialParentPlaces(t.otherPotentialParentPlacesIds),a.enableHover=t.enableHover||!1,a.initialMapStyleSetUp(t,i),a}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&Qe(t,e)}(e,t),Xe(e,[{key:"setRTLSupport",value:function(){var t=this;(0,b.setRTLTextPlugin)("https://unpkg.com/@mapbox/mapbox-gl-rtl-text@0.3.0/dist/mapbox-gl-rtl-text.js",!1).catch((function(e){t.logError(e,{functionName:"setRTLSupport"})}))}},{key:"initialPlaceDetailSetUp",value:function(t){var e=this;this.repository.fetchAndParsePlaceDetail(t).then((function(t){e.changeParentPlaceTo(t),e.potentialParentPlaces.push(t)})).catch((function(t){e.logError(t,{functionName:"initialPlaceDetailSetUp"})}))}},{key:"loadOtherPotentialParentPlaces",value:function(t){var e=this;Promise.all(t.map((function(t){return e.repository.fetchAndParsePlaceDetail(t)}))).then((function(t){var i;(i=e.potentialParentPlaces).push.apply(i,He(t))})).catch((function(t){e.logError(t,{functionName:"loadOtherPotentialParentPlaces"})}))}},{key:"subPlacesLoad",value:function(t){var e=this;this.repository.fetchAndParseSubPlaces(t).then((function(t){e.subPlaces=t})).catch((function(t){e.logError(t,{functionName:"subPlacesLoad"}),e.subPlaces=[]}))}},{key:"initialMapStyleSetUp",value:function(t,e){var i=this;this.repository.fetchAndParseMapStyle(t.parentPlaceId).then((function(r){var n,o,a,s={container:e,style:r,center:t.center,zoom:t.zoom,pitch:null!==(n=t.pitch)&&void 0!==n?n:0,attributionControl:!1,maplibreLogo:!1,bearingSnap:null!==(o=t.bearingSnap)&&void 0!==o?o:0};if(t.maxZoom&&(s.maxZoom=t.maxZoom),t.minZoom&&(s.minZoom=t.minZoom),t.maxBounds&&t.maxBounds.length>1){var l=w(t.maxBounds);s.maxBounds=new b.LngLatBounds([l[0].lng,l[0].lat],[l[1].lng,l[1].lat])}return i.map=new b.Map(s),i.map.addControl(new b.NavigationControl({showCompass:void 0===t.showCompass||t.showCompass,showZoom:void 0===t.showZoom||t.showZoom}),null!==(a=t.navigationPosition)&&void 0!==a?a:"top-right"),i.map.on("load",(function(){var e;i.whenStyleUpdates(r),t.lang&&i.setLayersForLanguage(t.lang),null===(e=t.onMapReady)||void 0===e||e.call(t),i.onHover()})),i.map.on("zoomend",(function(){var e;null===(e=t.onZoomEnd)||void 0===e||e.call(t,i.getZoomLevel())})),i.map.on("rotate",(function(){var e;null===(e=t.onRotate)||void 0===e||e.call(t,i.map.getBearing())})),i.defaultClickListener(),i.map})).catch((function(t){i.logError(t,{functionName:"initialMapStyleSetUp"})}))}},{key:"setBaseFilters",value:function(t){var e=this,i=["==",["get","public_place"],!0];t.layers.filter((function(t){return t.id.startsWith("indoor-")})).forEach((function(t){var r=e.baseFilters[t.id];if(null!=r){var n=["all",r,i];e.map.setFilter(t.id,n)}else e.map.setFilter(t.id,i);switch(t.type){case"line":case"symbol":case"fill-extrusion":case"fill":null!=t.filter&&(e.baseFilters[t.id]=t.filter)}}))}},{key:"setLayersForLanguage",value:function(t){var e,i,r=this,n=["aerodrome_label","mountain_peak","park","place","poi","transportation_name","water_name","waterway"],o=null!==(e=null===(i=this.map.getStyle())||void 0===i?void 0:i.layers)&&void 0!==e?e:[];o.filter((function(t){var e;return"symbol"===t.type&&"openmaptiles"===t.source&&n.includes(null!==(e=t["source-layer"])&&void 0!==e?e:"")})).map((function(t){return t.id})).forEach((function(e){try{var i=r.map.getLayoutProperty(e,"symbol-placement");r.map.setLayoutProperty(e,"text-field",["case",["has","name:".concat(t)],["get","name:".concat(t)],["format",["get","name:latin"],"line"===i?" ":"\n",["get","name:nonlatin"]]])}catch(n){r.logError(n,{functionName:"setLayersForLanguage"})}})),o.filter((function(t){var e;return"symbol"===t.type&&"indoorequal"===t.source&&void 0!==(null===(e=t.layout)||void 0===e?void 0:e["text-field"])})).map((function(t){return t.id})).forEach((function(e){try{r.map.setLayoutProperty(e,"text-field",["case",["has","name:".concat(t)],["get","name:".concat(t)],["get","name"]])}catch(i){r.logError(i,{functionName:"setLayersForLanguage"})}}))}},{key:"prepareSegmentation",value:function(t){var e;return Ge(Ge({},t),{},{token:this.token,parentPlaceId:null!==(e=this.parentPlaceId)&&void 0!==e?e:"None"})}},{key:"destroyMap",value:function(){this.map.remove()}},{key:"getCurrentFloor",value:function(){return this.currentFloor}},{key:"changeParentPlaceTo",value:function(t){var e,i,r,n,o,a=this,s=arguments.length>1&&void 0!==arguments[1]&&arguments[1],l=arguments.length>2?arguments[2]:void 0;this.parentPlace=t,this.parentPlaceId=null==t?void 0:t.lazarilloId,this.innerFloors=null!==(e=null==t?void 0:t.innerFloors.sort((function(t,e){return t.index-e.index})))&&void 0!==e?e:[],this.currentFloor=null!==(i=null!==(r=null===(n=this.innerFloors.find((function(t){return t.defaultFloor})))||void 0===n?void 0:n.key)&&void 0!==r?r:null===(o=this.innerFloors[0])||void 0===o?void 0:o.key)&&void 0!==i?i:"",t&&this.subPlacesLoad(t.lazarilloId),s&&this.repository.fetchAndParseMapStyle(null==t?void 0:t.lazarilloId).then((function(t){a.map.setStyle(t),a.whenStyleUpdates(t),null==l||l()})).catch((function(t){a.logError(t,{functionName:"changeParentPlaceTo"})}))}},{key:"updatePlaceAndFloor",value:function(t,e){var i,r,n,o,a,s=this.potentialParentPlaces.find((function(e){return e.lazarilloId===t}));this.parentPlace=s,this.parentPlaceId=null==s?void 0:s.lazarilloId,this.innerFloors=null!==(i=null==s?void 0:s.innerFloors.sort((function(t,e){return t.index-e.index})))&&void 0!==i?i:[],this.currentFloor=null!==(r=null!==(n=null!=e?e:null===(o=this.innerFloors.find((function(t){return t.defaultFloor})))||void 0===o?void 0:o.key)&&void 0!==n?n:null===(a=this.innerFloors[0])||void 0===a?void 0:a.key)&&void 0!==r?r:""}},{key:"updateParentPlaceAndFloor",value:function(t,e){try{var i,r;this.updatePlaceAndFloor(t,e),this.filterByFloorKey(this.currentFloor),null===(i=this.onParentPlaceChange)||void 0===i||i.call(this,t),null===(r=this.onFloorChange)||void 0===r||r.call(this,this.currentFloor),this.logEvent("updateParentPlaceAndFloor")}catch(n){this.logError(n,{functionName:"updateParentPlaceAndFloor"})}}},{key:"setLang",value:function(t){this.repository.setLang(t)}},{key:"setParentPlace",value:function(t,e,i){this.changeParentPlaceTo(t,e,i)}},{key:"removeParentPlace",value:function(){this.changeParentPlaceTo(void 0,!0)}},{key:"whenStyleUpdates",value:function(t){this.setBaseFilters(t),this.routeController.addSourcesAndLayers(),this.filterByFloorKey(this.currentFloor)}},{key:"addMarker",value:function(t){try{var e=new D(t);return e.changeFloor(this.currentFloor,this.map),this.markers.push(e),this.logEvent("addMarker"),e.id}catch(i){return this.logError(i,{functionName:"addMarker"}),""}}},{key:"updateMarker",value:function(t){try{var e,i=this.markers.find((function(e){return e.id===t.id}));return void 0!==i&&i.updateIcon(t),this.logEvent("updateMarker"),null!==(e=null==i?void 0:i.id)&&void 0!==e?e:""}catch(r){return this.logError(r,{functionName:"updateMarker"}),""}}},{key:"showMarker",value:function(t){try{var e=this.markers.find((function(e){return e.id===t}));null!==e&&this.map&&(null==e||e.show(this.map)),this.logEvent("showMarker")}catch(i){this.logError(i,{functionName:"showMarker"})}}},{key:"hideMarker",value:function(t){try{var e=this.markers.find((function(e){return e.id===t}));null!==e&&(null==e||e.hide()),this.logEvent("hideMarker")}catch(i){this.logError(i,{functionName:"hideMarker"})}}},{key:"removeMarker",value:function(t){try{var e=this.markers.find((function(e){return e.id===t}));null!==e&&(null==e||e.remove(),this.markers=this.markers.filter((function(e){return e.id!==t}))),this.logEvent("removeMarker")}catch(i){this.logError(i,{functionName:"removeMarker"})}}},{key:"filterByFloorKey",value:function(t){this.currentFloor=t,this.innerFloors.every((function(e){return e.key!==t}))&&""!==t&&this.logEvent("invalidFloorKey",{floorKey:t}),this.updateFiltersTo(t),this.updateMarkersTo(t),this.routeController.updateRouteLayers(t),this.routeController.updateRouteMarkerVisibility(t)}},{key:"getContainer",value:function(){return this.map.getContainer()}},{key:"updateMarkersTo",value:function(t){var e=this;this.markers.forEach((function(i){i.changeFloor(t,e.map)}))}},{key:"updateFiltersTo",value:function(t){var e,i,r,n=this;if(this.map){var o=null!==(e=null===(i=this.map.getStyle())||void 0===i?void 0:i.layers)&&void 0!==e?e:[];o.filter((function(t){return t.id.startsWith("base-indoor-")})).forEach((function(t){n.map.removeLayer(t.id)}));var a=null===(r=this.innerFloors.find((function(e){return e.key===t})))||void 0===r?void 0:r.baseFloor,s=o.filter((function(t){return t.id.startsWith("indoor-")}));if(null!=a){var l,c=null===(l=s[0])||void 0===l?void 0:l.id;s.filter((function(t){return"fill-extrusion"!==t.type})).forEach((function(t){var e=structuredClone(t);e.id="base-"+t.id,n.baseFilters[e.id]=n.baseFilters[t.id],n.map.addLayer(e,c),n.applyLayerFilters(e,a)}))}s.forEach((function(e){n.applyLayerFilters(e,t)}))}}},{key:"applyLayerFilters",value:function(t,e){var i,r=this.baseFilters[t.id],n=["any",["==",["get","floor_key"],e]],o=["==",["get","public_place"],!0],a=["!=",["get","is_subplace"],null!==(i=this.parentPlaceId)&&void 0!==i?i:""],s=["==",["get","show_in_floor"],e],l=o;null!=this.parentPlaceId&&(l=["any",n,o]);var c=["all",l,["any",a,s]];if(t.id.includes("hover")?r=["==",["get","ref"],this.hoveredId]:t.id.includes("colored")||"fill"!=t.type&&"fill-extrusion"!==t.type||c.push(["!=",["get","ref"],this.hoveredId]),null!=r){var u=["all",r,c];this.map.setFilter(t.id,u)}else this.map.setFilter(t.id,c)}},{key:"getInnerFloors",value:function(){return this.innerFloors}},{key:"updateCamera",value:function(t,e){this.map.once("moveend",e),this.map.easeTo(Ge({},t))}},{key:"setMaxZoom",value:function(t){this.map.setMaxZoom(t)}},{key:"setMinZoom",value:function(t){this.map.setMinZoom(t)}},{key:"isInsideBounds",value:function(t){var e=this.map.getMaxBounds();return null==e||e.contains(t)}},{key:"setMaxBounds",value:function(t){if(t.length>1){var e=w(t);this.map.setMaxBounds(new b.LngLatBounds([e[0].lng,e[0].lat],[e[1].lng,e[1].lat]))}}},{key:"fitCoordinates",value:function(t,e){if(1===t.length){var i=qe(t,1)[0];this.map.setCenter({lat:i.lat,lng:i.lng})}else if(t.length>1){var r,n,o,a,s,l,c,u,h,d=function(t,e){var i="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!i){if(Array.isArray(t)||(i=Ze(t))||e){i&&(t=i);var r=0,n=function(){};return{s:n,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:n}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,s=!1;return{s:function(){i=i.call(t)},n:function(){var t=i.next();return a=t.done,t},e:function(t){s=!0,o=t},f:function(){try{a||null==i.return||i.return()}finally{if(s)throw o}}}}(t);try{for(d.s();!(h=d.n()).done;){var p=h.value,f=p.lat,m=p.lng;s=void 0===s?f:Math.min(s,f),l=void 0===l?m:Math.min(l,m),c=void 0===c?f:Math.max(c,f),u=void 0===u?m:Math.max(u,m)}}catch(v){d.e(v)}finally{d.f()}var g=[null!==(r=l)&&void 0!==r?r:0,null!==(n=s)&&void 0!==n?n:0,null!==(o=u)&&void 0!==o?o:0,null!==(a=c)&&void 0!==a?a:0];if(e){var y=this.map.getBearing(),_=this.map.getPitch();e.bearing=void 0!==e.bearing?e.bearing:y,e.pitch=void 0!==e.pitch?e.pitch:_}this.map.fitBounds(g,e)}}},{key:"getZoomLevel",value:function(){return this.map.getZoom()}},{key:"updateFloor",value:function(t){try{var e;this.filterByFloorKey(t),null===(e=this.onFloorChange)||void 0===e||e.call(this,t),this.logEvent("updateFloor",{floorId:t})}catch(i){this.logError(i,{functionName:"updateFloor",floorId:t})}}},{key:"updatePlaceAndFloorForRouting",value:function(t,e){try{var i;this.updatePlaceAndFloor(t,e),this.updateFiltersTo(e),this.updateMarkersTo(e),null===(i=this.onFloorChange)||void 0===i||i.call(this,e),this.logEvent("updatePlaceAndFloorForRouting",{floorId:e})}catch(r){this.logError(r,{functionName:"updatePlaceAndFloorForRouting",floorId:e})}}},{key:"addRoute",value:(a=Ue(je().mark((function t(e){var i,r,n,o,a=arguments;return je().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return i=a.length>1&&void 0!==a[1]?a[1]:{},t.prev=1,r=new ct(e),n=new ut(i),t.next=6,this.repository.fetchAndParseRoute(r);case 6:return o=t.sent,this.routeController.addRoute(o,n),this.logEvent("addRoute"),t.abrupt("return",o);case 12:throw t.prev=12,t.t0=t.catch(1),this.logError(t.t0,{functionName:"addRoute"}),new Error("Error: Failed to add route");case 16:case"end":return t.stop()}}),t,this,[[1,12]])}))),function(t){return a.apply(this,arguments)})},{key:"removeRoute",value:function(){try{this.routeController.removeRoute(),this.logEvent("removeRoute")}catch(t){this.logError(t,{functionName:"removeRoute"})}}},{key:"addPopOver",value:function(t){var e=t.placeId;if(void 0!==e){var i=this.subPlaces.find((function(t){return t.clientId===e||t.lazarilloId===e}));void 0!==i&&(new(x().Popup)).setLngLat(i.position).setHTML(i.title).addTo(this.map)}return""}},{key:"removePopOver",value:function(t){throw Error("Not implemented")}},{key:"startClickListener",value:function(t){this.clickCallback=t}},{key:"stopClickListener",value:function(){this.clickCallback=void 0}},{key:"defaultClickListener",value:function(){var t=this;this.map.on("click",(function(e){var i,r,n=t.map.queryRenderedFeatures(e.point).find((function(t){return"room"===t.properties.class})),o=t.subPlaces.find((function(t){return t.lazarilloId===(null==n?void 0:n.properties.ref)})),a=null!==(i=null!==(r=null==o?void 0:o.lazarilloId)&&void 0!==r?r:null==o?void 0:o.clientId)&&void 0!==i?i:"";void 0!==o&&t.clickCallback&&t.clickCallback(a)}))}},{key:"onHover",value:function(){var t=this;this.enableHover&&(this.map.on("mousemove","hoverable",(function(e){var i,r=null===(i=e.features)||void 0===i?void 0:i.find((function(e){var i,r;return(null===(i=e.properties.ref)||void 0===i?void 0:i.length)>0&&(null===(r=e.properties)||void 0===r?void 0:r.floor_key)===t.currentFloor})),n=null==r?void 0:r.properties.ref;void 0!==n&&n.length>0?(t.hoveredId=n,t.updateFiltersTo(t.currentFloor)):void 0===n&&"unselected"!==t.hoveredId&&(t.hoveredId="unselected",t.updateFiltersTo(t.currentFloor))})),this.map.on("mouseleave","hoverable",(function(){t.hoveredId="unselected",t.updateFiltersTo(t.currentFloor)})))}},{key:"setPlacesAsSelected",value:function(t,e){try{this.hasLayer("indoor-colored-places")||(this.logError(new Error("Layer indoor-colored-places does not exist on current style")),this.createColoredPlacesLayer());var i=this.createBasicFilters(),r=t.map((function(t){return["==",["get","ref"],t]})),n=["any"].concat(He(r)),o=["all",n,i];if(this.map.setFilter("indoor-colored-places",o),this.baseFilters["indoor-colored-places"]=n,void 0!==e){var a=this.map.getLayer("indoor-colored-places");switch(null==a?void 0:a.type){case"fill":this.map.setPaintProperty("indoor-colored-places","fill-color",e);break;case"fill-extrusion":this.map.setPaintProperty("indoor-colored-places","fill-extrusion-color",e)}}}catch(s){this.logError(s,{functionName:"setPlacesAsSelected"})}}},{key:"is3DStyle",value:function(){return this.map.getStyle().layers.some((function(t){return"fill-extrusion"===t.type}))}},{key:"createColoredPlacesLayer",value:function(){this.is3DStyle()?this.map.addLayer({id:"indoor-colored-places",type:"fill-extrusion",source:"indoorequal","source-layer":"area",filter:["all",["has","ref"],["==",["get","ref"],"unselected"]],paint:{"fill-extrusion-height":2.5,"fill-extrusion-color":"#276EF1","fill-extrusion-opacity":.8}}):this.map.addLayer({id:"indoor-colored-places",type:"fill",source:"indoorequal","source-layer":"area",filter:["all",["has","ref"],["==",["get","ref"],"unselected"]],paint:{"fill-color":"#276EF1"}})}},{key:"createBasicFilters",value:function(){var t,e,i=["==",["get","public_place"],!0],r=["!=",["get","is_subplace"],null!==(t=this.parentPlaceId)&&void 0!==t?t:""],n=null!==(e=this.currentFloor)&&void 0!==e?e:"+",o=["==",["get","floor_key"],n],a=["==",["get","show_in_floor"],n],s=i;return null!=this.parentPlaceId&&(s=["any",o,i]),["all",s,["any",r,a]]}},{key:"hasLayer",value:function(t){return void 0!==this.map.getLayer(t)}},{key:"clearColoredPlaces",value:function(){if(this.hasLayer("indoor-colored-places")){var t=["==",["get","ref"],"unselected"];this.baseFilters["indoor-colored-places"]=t,this.map.setFilter("indoor-colored-places",t)}}},{key:"startAnimateRoute",value:(o=Ue(je().mark((function t(e){var i,r,n,o,a,s,l=arguments;return je().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(i=l.length>1&&void 0!==l[1]?l[1]:{},r=l.length>2&&void 0!==l[2]?l[2]:{},t.prev=2,!(e instanceof Nt)){t.next=7;break}n=e,t.next=11;break;case 7:return o=new ct(e),t.next=10,this.repository.fetchAndParseRoute(o);case 10:n=t.sent;case 11:return a=new gt(i),s=new mt(r),this.routeController.startAnimating(n,a,s),t.abrupt("return",n);case 17:throw t.prev=17,t.t0=t.catch(2),this.logError(t.t0,{functionName:"startAnimateRoute"}),new Error("Error: Failed to start animating route");case 21:case"end":return t.stop()}}),t,this,[[2,17]])}))),function(t){return o.apply(this,arguments)})},{key:"startAnimateRouteV2",value:(n=Ue(je().mark((function t(e){var i,r,n,o,a,s,l=arguments;return je().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(i=l.length>1&&void 0!==l[1]?l[1]:{},r=l.length>2&&void 0!==l[2]?l[2]:{},t.prev=2,!(e instanceof Nt)){t.next=7;break}n=e,t.next=11;break;case 7:return o=new ct(e),t.next=10,this.repository.fetchAndParseRouteV2(o);case 10:n=t.sent;case 11:return a=new gt(i),s=new mt(r),this.routeController.startAnimating(n,a,s),t.abrupt("return",n);case 17:throw t.prev=17,t.t0=t.catch(2),this.logError(t.t0,{functionName:"startAnimateRouteV2"}),new Error("Error: Failed to start animating route");case 21:case"end":return t.stop()}}),t,this,[[2,17]])}))),function(t){return n.apply(this,arguments)})},{key:"pauseAnimateRoute",value:function(){try{this.routeController.pauseAnimation(),this.logEvent("pauseAnimateRoute")}catch(t){throw this.logError(t,{functionName:"pauseAnimateRoute"}),new Error("Error: Failed to pause animate route")}}},{key:"resumeAnimateRoute",value:function(){try{this.routeController.resumeAnimation(),this.logEvent("resumeAnimateRoute")}catch(t){throw this.logError(t,{functionName:"resumeAnimateRoute"}),new Error("Error: Failed to resume animate route")}}},{key:"restartAnimateRoute",value:function(){try{this.routeController.restartAnimation(),this.logEvent("restartAnimateRoute")}catch(t){throw this.logError(t,{functionName:"restartAnimateRoute"}),new Error("Error: Failed to restart animating route")}}},{key:"stopAnimateRoute",value:function(){throw Error("Not implemented")}},{key:"addStepAnimation",value:(r=Ue(je().mark((function t(e){var i,r,n,o,a,s,l=arguments;return je().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(i=l.length>1&&void 0!==l[1]?l[1]:{},r=l.length>2&&void 0!==l[2]?l[2]:{},t.prev=2,!(e instanceof Nt)){t.next=7;break}n=e,t.next=11;break;case 7:return o=new ct(e),t.next=10,this.repository.fetchAndParseRoute(o);case 10:n=t.sent;case 11:return a=new gt(i),s=new mt(r),this.routeController.addStepAnimation(n,a,s),this.logEvent("addStepAnimation"),t.abrupt("return",n);case 18:throw t.prev=18,t.t0=t.catch(2),this.logError(t.t0,{functionName:"addStepAnimation"}),new Error("Error: Failed to add step animation");case 22:case"end":return t.stop()}}),t,this,[[2,18]])}))),function(t){return r.apply(this,arguments)})},{key:"addStepAnimationV2",value:(i=Ue(je().mark((function t(e){var i,r,n,o,a,s,l=arguments;return je().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(i=l.length>1&&void 0!==l[1]?l[1]:{},r=l.length>2&&void 0!==l[2]?l[2]:{},t.prev=2,!(e instanceof Nt)){t.next=7;break}n=e,t.next=11;break;case 7:return o=new ct(e),t.next=10,this.repository.fetchAndParseRouteV2(o);case 10:n=t.sent;case 11:return a=new gt(i),s=new mt(r),this.routeController.addStepAnimation(n,a,s),this.logEvent("addStepAnimationV2"),t.abrupt("return",n);case 18:throw t.prev=18,t.t0=t.catch(2),this.logError(t.t0,{functionName:"addStepAnimationV2"}),new Error("Error: Failed to add step animation");case 22:case"end":return t.stop()}}),t,this,[[2,18]])}))),function(t){return i.apply(this,arguments)})},{key:"nextStepAnimation",value:function(){try{this.routeController.nextStepAnimation(),this.logEvent("nextStepAnimation")}catch(t){throw this.logError(t,{functionName:"nextStepAnimation"}),new Error("Error: Failed to animate step")}}},{key:"previousStepAnimation",value:function(){try{this.routeController.previousStepAnimation(),this.logEvent("previousStepAnimation")}catch(e){this.logError(e,{functionName:"previousStepAnimation"});var t=e instanceof Error?e.message:String(e);throw new Error("Error: Failed to prepare to animate previous step, "+t)}}},{key:"centerOnCurrentStepAnimation",value:function(){try{this.routeController.centerOnCurrentStep(),this.logEvent("centerOnCurrentStepAnimation")}catch(e){this.logError(e,{functionName:"centerOnCurrentStepAnimation"});var t=e instanceof Error?e.message:String(e);throw new Error("Error: Failed to center on current step animation, "+t)}}},{key:"addUserLocationTracking",value:function(t){var e=this,i=new Image(40,40);i.src="data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz4NCjwhLS0gR2VuZXJhdG9yOiBBZG9iZSBJbGx1c3RyYXRvciAxNi4wLjAsIFNWRyBFeHBvcnQgUGx1Zy1JbiAuIFNWRyBWZXJzaW9uOiA2LjAwIEJ1aWxkIDApICAtLT4NCjwhRE9DVFlQRSBzdmcgUFVCTElDICItLy9XM0MvL0RURCBTVkcgMS4xLy9FTiIgImh0dHA6Ly93d3cudzMub3JnL0dyYXBoaWNzL1NWRy8xLjEvRFREL3N2ZzExLmR0ZCI+DQo8c3ZnIHZlcnNpb249IjEuMSIgaWQ9IkxheWVyXzEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIHg9IjBweCIgeT0iMHB4Ig0KCSB3aWR0aD0iMTAwIiBoZWlnaHQ9IjEwMCIgdmlld0JveD0iMCAwIDk5OS45IDk5OS45IiBlbmFibGUtYmFja2dyb3VuZD0ibmV3IDAgMCA5OTkuOSA5OTkuOSIgeG1sOnNwYWNlPSJwcmVzZXJ2ZSI+DQo8ZyBpZD0iY2lyY2xlIj4NCgk8Y2lyY2xlIGZpbGw9IiM0NzdDRkMiIGN4PSI1MDAiIGN5PSI1MDAiIHI9IjQ5OS45Ii8+DQo8L2c+DQo8ZyBpZD0iTGF5ZXJfMV8xXyI+DQoJPHBhdGggZmlsbD0iI0ZGRkZGRiIgZD0iTTczNC43LDQwOS43YzAtMzIuNC02LjEwMS02Mi44LTE4LjMtOTEuM2MtMTIuMi0yOC40LTI5LTUzLjMtNTAuNC03NC43Yy0yMS40LTIxLjQtNDYuMy0zOC4yLTc0LjctNTAuNA0KCQlDNTYyLjksMTgxLjEsNTMyLjQsMTc1LDUwMCwxNzVzLTYyLjgsNi4xLTkxLjMsMTguM2MtMjguNCwxMi4yLTUzLjQsMjktNzQuNyw1MC40Yy0yMS40LDIxLjQtMzguMiw0Ni4zLTUwLjQsNzQuNw0KCQljLTEyLjIsMjguMzk5LTE4LjMsNTguODk5LTE4LjMsOTEuM2MwLDIyLDMuNCw0NS4zLDEwLjEsNjkuN2M2LjcsMjQuNSwxNS42LDQ5LjEsMjYuNiw3My44YzExLDI0LjgsMjMuNSw0OS4yLDM3LjYsNzMuMzk5DQoJCWMxNC4xLDI0LjIsMjguNCw0Ny4yLDQzLjEsNjkuMkM0MTYuOSw3NDcuMiw0NTYuMSw3OTguNSw1MDAuMSw4NDkuOWM0NC01MS40LDgzLjEwMS0xMDIuNywxMTcuNC0xNTQuMTAxDQoJCWMxNC43LTIyLDI5LTQ1LjEsNDMuMS02OS4yQzY3NC43LDYwMi41LDY4Ny4yLDU3OCw2OTguMiw1NTMuMnMxOS44OTktNDkuNCwyNi42LTczLjhDNzMxLjMsNDU0LjksNzM0LjcsNDMxLjcsNzM0LjcsNDA5Ljd6DQoJCSBNNTIyLjIsNDkyLjd2LTc4LjVINDk2Yy03LjQsMC0xNC4yLDEuMzk5LTIwLjQsNC4xYy02LjMsMi43LTExLjgsNi41LTE2LjYsMTEuMmMtNC44LDQuOC04LjUsMTAuMy0xMS4yLDE2LjYNCgkJYy0yLjcsNi4zMDEtNC4xLDEzLjEwMS00LjEsMjAuNHYxMDQuN2gtNTIuM1Y0NjYuNWMwLTE0LjQsMi43LTI4LDguMi00MC43YzUuNC0xMi43LDEyLjktMjMuOCwyMi41LTMzLjMNCgkJYzkuNS05LjUsMjAuNjAxLTE3LDMzLjMwMS0yMi41YzEyLjY5OS01LjQsMjYuMTk5LTguMiw0MC42OTktOC4yaDI2LjJ2LTc4LjVMNjUzLDM4OEw1MjIuMiw0OTIuN3oiLz4NCjwvZz4NCjxjaXJjbGUgZmlsbD0iI0ZGRkZGRiIgY3g9IjUwMC41NDgiIGN5PSI0MDguNDUiIHI9IjIyNCIvPg0KPGNpcmNsZSBmaWxsPSIjNDc3Q0ZDIiBjeD0iNTAwLjU0OCIgY3k9IjQwOC40NSIgcj0iNjgiLz4NCjwvc3ZnPg0K";var r=new D({coordinate:{lat:0,lng:0},icon:i,text:""});r.addToMap(this.map),this.userLocationMarker=r,this.watchPositionID=navigator.geolocation.watchPosition((function(t){r.setLngLat([t.coords.longitude,t.coords.latitude])}),(function(t){e.logError(t,{functionName:"addUserLocationTracking"})}),{enableHighAccuracy:t})}},{key:"removeUserLocationTracking",value:function(){void 0!==this.userLocationMarker?(this.userLocationMarker.remove(),this.userLocationMarker=void 0,this.watchPositionID&&(navigator.geolocation.clearWatch(this.watchPositionID),this.watchPositionID=void 0)):this.logError(new Error("Error trying to remove location tracking, is already gone"),{functionName:"removeUserLocationTracking"})}},{key:"getBearing",value:function(){return this.map.getBearing()}},{key:"addBorderToPlaces",value:function(t,e,i){try{this.hasLayer("indoor-bordered-places")||(this.logError(new Error("Layer indoor-bordered-places does not exist on current style")),this.createBorderedPlacesLayer());var r=this.createBasicFilters(),n=t.map((function(t){return["==",["get","ref"],t]})),o=["any"].concat(He(n)),a=["all",o,r];this.map.setFilter("indoor-bordered-places",a),this.baseFilters["indoor-bordered-places"]=o,void 0!==e&&void 0!==i&&(this.map.setPaintProperty("indoor-bordered-places","line-color",e),this.map.setPaintProperty("indoor-bordered-places","line-width",i))}catch(s){throw this.logError(s,{functionName:"addBorderToPlaces"}),new Error("Failed to add border to places")}}},{key:"createBorderedPlacesLayer",value:function(){this.map.addLayer({id:"indoor-bordered-places",type:"line",source:"indoorequal","source-layer":"area",filter:["all",["has","ref"],["==",["get","ref"],"unselected"]],paint:{"line-color":"#276EF1","line-width":4}})}},{key:"clearBorderedPlaces",value:function(){if(this.hasLayer("indoor-bordered-places")){var t=["==",["get","ref"],"unselected"];this.baseFilters["indoor-bordered-places"]=t,this.map.setFilter("indoor-bordered-places",t)}}}]);var i,r,n,o,a}(Tt);function ri(t){return void 0!==t.logo}function ni(t){return void 0!==t.icon}function oi(t){return oi="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},oi(t)}function ai(t){return function(t){if(Array.isArray(t))return si(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||function(t,e){if(t){if("string"==typeof t)return si(t,e);var i={}.toString.call(t).slice(8,-1);return"Object"===i&&t.constructor&&(i=t.constructor.name),"Map"===i||"Set"===i?Array.from(t):"Arguments"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i)?si(t,e):void 0}}(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function si(t,e){(null==e||e>t.length)&&(e=t.length);for(var i=0,r=Array(e);i<e;i++)r[i]=t[i];return r}function li(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */li=function(){return e};var t,e={},i=Object.prototype,r=i.hasOwnProperty,n=Object.defineProperty||function(t,e,i){t[e]=i.value},o="function"==typeof Symbol?Symbol:{},a=o.iterator||"@@iterator",s=o.asyncIterator||"@@asyncIterator",l=o.toStringTag||"@@toStringTag";function c(t,e,i){return Object.defineProperty(t,e,{value:i,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{c({},"")}catch(t){c=function(t,e,i){return t[e]=i}}function u(t,e,i,r){var o=e&&e.prototype instanceof y?e:y,a=Object.create(o.prototype),s=new P(r||[]);return n(a,"_invoke",{value:I(t,i,s)}),a}function h(t,e,i){try{return{type:"normal",arg:t.call(e,i)}}catch(t){return{type:"throw",arg:t}}}e.wrap=u;var d="suspendedStart",p="suspendedYield",f="executing",m="completed",g={};function y(){}function _(){}function v(){}var b={};c(b,a,(function(){return this}));var x=Object.getPrototypeOf,w=x&&x(x(M([])));w&&w!==i&&r.call(w,a)&&(b=w);var k=v.prototype=y.prototype=Object.create(b);function E(t){["next","throw","return"].forEach((function(e){c(t,e,(function(t){return this._invoke(e,t)}))}))}function S(t,e){function i(n,o,a,s){var l=h(t[n],t,o);if("throw"!==l.type){var c=l.arg,u=c.value;return u&&"object"==oi(u)&&r.call(u,"__await")?e.resolve(u.__await).then((function(t){i("next",t,a,s)}),(function(t){i("throw",t,a,s)})):e.resolve(u).then((function(t){c.value=t,a(c)}),(function(t){return i("throw",t,a,s)}))}s(l.arg)}var o;n(this,"_invoke",{value:function(t,r){function n(){return new e((function(e,n){i(t,r,e,n)}))}return o=o?o.then(n,n):n()}})}function I(e,i,r){var n=d;return function(o,a){if(n===f)throw Error("Generator is already running");if(n===m){if("throw"===o)throw a;return{value:t,done:!0}}for(r.method=o,r.arg=a;;){var s=r.delegate;if(s){var l=C(s,r);if(l){if(l===g)continue;return l}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if(n===d)throw n=m,r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n=f;var c=h(e,i,r);if("normal"===c.type){if(n=r.done?m:p,c.arg===g)continue;return{value:c.arg,done:r.done}}"throw"===c.type&&(n=m,r.method="throw",r.arg=c.arg)}}}function C(e,i){var r=i.method,n=e.iterator[r];if(n===t)return i.delegate=null,"throw"===r&&e.iterator.return&&(i.method="return",i.arg=t,C(e,i),"throw"===i.method)||"return"!==r&&(i.method="throw",i.arg=new TypeError("The iterator does not provide a '"+r+"' method")),g;var o=h(n,e.iterator,i.arg);if("throw"===o.type)return i.method="throw",i.arg=o.arg,i.delegate=null,g;var a=o.arg;return a?a.done?(i[e.resultName]=a.value,i.next=e.nextLoc,"return"!==i.method&&(i.method="next",i.arg=t),i.delegate=null,g):a:(i.method="throw",i.arg=new TypeError("iterator result is not an object"),i.delegate=null,g)}function T(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function A(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function P(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(T,this),this.reset(!0)}function M(e){if(e||""===e){var i=e[a];if(i)return i.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var n=-1,o=function i(){for(;++n<e.length;)if(r.call(e,n))return i.value=e[n],i.done=!1,i;return i.value=t,i.done=!0,i};return o.next=o}}throw new TypeError(oi(e)+" is not iterable")}return _.prototype=v,n(k,"constructor",{value:v,configurable:!0}),n(v,"constructor",{value:_,configurable:!0}),_.displayName=c(v,l,"GeneratorFunction"),e.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===_||"GeneratorFunction"===(e.displayName||e.name))},e.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,v):(t.__proto__=v,c(t,l,"GeneratorFunction")),t.prototype=Object.create(k),t},e.awrap=function(t){return{__await:t}},E(S.prototype),c(S.prototype,s,(function(){return this})),e.AsyncIterator=S,e.async=function(t,i,r,n,o){void 0===o&&(o=Promise);var a=new S(u(t,i,r,n),o);return e.isGeneratorFunction(i)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},E(k),c(k,l,"Generator"),c(k,a,(function(){return this})),c(k,"toString",(function(){return"[object Generator]"})),e.keys=function(t){var e=Object(t),i=[];for(var r in e)i.push(r);return i.reverse(),function t(){for(;i.length;){var r=i.pop();if(r in e)return t.value=r,t.done=!1,t}return t.done=!0,t}},e.values=M,P.prototype={constructor:P,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(A),!e)for(var i in this)"t"===i.charAt(0)&&r.call(this,i)&&!isNaN(+i.slice(1))&&(this[i]=t)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var i=this;function n(r,n){return s.type="throw",s.arg=e,i.next=r,n&&(i.method="next",i.arg=t),!!n}for(var o=this.tryEntries.length-1;o>=0;--o){var a=this.tryEntries[o],s=a.completion;if("root"===a.tryLoc)return n("end");if(a.tryLoc<=this.prev){var l=r.call(a,"catchLoc"),c=r.call(a,"finallyLoc");if(l&&c){if(this.prev<a.catchLoc)return n(a.catchLoc,!0);if(this.prev<a.finallyLoc)return n(a.finallyLoc)}else if(l){if(this.prev<a.catchLoc)return n(a.catchLoc,!0)}else{if(!c)throw Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return n(a.finallyLoc)}}}},abrupt:function(t,e){for(var i=this.tryEntries.length-1;i>=0;--i){var n=this.tryEntries[i];if(n.tryLoc<=this.prev&&r.call(n,"finallyLoc")&&this.prev<n.finallyLoc){var o=n;break}}o&&("break"===t||"continue"===t)&&o.tryLoc<=e&&e<=o.finallyLoc&&(o=null);var a=o?o.completion:{};return a.type=t,a.arg=e,o?(this.method="next",this.next=o.finallyLoc,g):this.complete(a)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),g},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var i=this.tryEntries[e];if(i.finallyLoc===t)return this.complete(i.completion,i.afterLoc),A(i),g}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var i=this.tryEntries[e];if(i.tryLoc===t){var r=i.completion;if("throw"===r.type){var n=r.arg;A(i)}return n}}throw Error("illegal catch attempt")},delegateYield:function(e,i,r){return this.delegate={iterator:M(e),resultName:i,nextLoc:r},"next"===this.method&&(this.arg=t),g}},e}function ci(t,e,i,r,n,o,a){try{var s=t[o](a),l=s.value}catch(t){return void i(t)}s.done?e(l):Promise.resolve(l).then(r,n)}function ui(t){return function(){var e=this,i=arguments;return new Promise((function(r,n){var o=t.apply(e,i);function a(t){ci(o,r,n,a,s,"next",t)}function s(t){ci(o,r,n,a,s,"throw",t)}a(void 0)}))}}function hi(t,e){for(var i=0;i<e.length;i++){var r=e[i];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,vi(r.key),r)}}function di(t,e,i){return e=fi(e),function(t,e){if(e&&("object"==oi(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(t,pi()?Reflect.construct(e,[],fi(t).constructor):e.apply(t,i))}function pi(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(pi=function(){return!!t})()}function fi(t){return fi=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},fi(t)}function mi(t,e){return mi=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},mi(t,e)}function gi(t,e){var i=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),i.push.apply(i,r)}return i}function yi(t){for(var e=1;e<arguments.length;e++){var i=null!=arguments[e]?arguments[e]:{};e%2?gi(Object(i),!0).forEach((function(e){_i(t,e,i[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(i)):gi(Object(i)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(i,e))}))}return t}function _i(t,e,i){return(e=vi(e))in t?Object.defineProperty(t,e,{value:i,enumerable:!0,configurable:!0,writable:!0}):t[e]=i,t}function vi(t){var e=function(t,e){if("object"!=oi(t)||!t)return t;var i=t[Symbol.toPrimitive];if(void 0!==i){var r=i.call(t,e);if("object"!=oi(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==oi(e)?e:e+""}function bi(t,e){var i=yi(yi({},{lang:"en"}),e);return new xi(t,i)}var xi=function(t){function e(t,i){var r;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),_i(r=di(this,e),"headingListeners",[]),r.token=t,r.config=i,r.repository=new Be(t,r.config.lang),r.cachePlaces(),r.logEvent("initSDK"),r}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&mi(t,e)}(e,t),function(t,e,i){return e&&hi(t.prototype,e),i&&hi(t,i),Object.defineProperty(t,"prototype",{writable:!1}),t}(e,[{key:"cachePlaces",value:function(){var t=this;this.repository.fetchAndParseAvailablePlaces().catch((function(e){t.logError(e)}))}},{key:"setSdkLang",value:function(t){this.config.lang=t,this.repository.setLang(t)}},{key:"getPlaceDetail",value:(f=ui(li().mark((function t(e){var i;return li().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,t.next=3,this.repository.fetchAndParsePlaceDetail(e);case 3:return i=t.sent,this.logEvent("getPlaceDetail",{id:e}),t.abrupt("return",i);case 8:throw t.prev=8,t.t0=t.catch(0),this.logError(t.t0,{functionName:"getPlaceDetail",id:e}),Error("Error getPlaceDetail");case 12:case"end":return t.stop()}}),t,this,[[0,8]])}))),function(t){return f.apply(this,arguments)})},{key:"prepareSegmentation",value:function(t){return yi(yi({},t),{},{token:this.token})}},{key:"createMap",value:function(t,e){try{e.lang=this.config.lang;var i=new ii(e,t,this.token);return this.logEvent("createMap"),i}catch(r){throw this.logError(r,{functionName:"createMap"}),new Error("Failed to create map")}}},{key:"getConfiguration",value:(p=ui(li().mark((function t(e){var i;return li().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,t.next=3,this.repository.fetchAndParseConfiguration(e);case 3:return i=t.sent,this.logEvent("configuration"),t.abrupt("return",i);case 8:throw t.prev=8,t.t0=t.catch(0),this.logError(t.t0,{functionName:"getConfiguration"}),new Error("Failed to get configuration");case 12:case"end":return t.stop()}}),t,this,[[0,8]])}))),function(t){return p.apply(this,arguments)})},{key:"getCategories",value:(d=ui(li().mark((function t(e){var i;return li().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,t.next=3,this.repository.fetchAndParseCategories(e);case 3:return i=t.sent,this.logEvent("categories"),t.abrupt("return",i);case 8:throw t.prev=8,t.t0=t.catch(0),this.logError(t.t0,{functionName:"getCategories"}),new Error("Failed to get categories");case 12:case"end":return t.stop()}}),t,this,[[0,8]])}))),function(t){return d.apply(this,arguments)})},{key:"getTransport",value:(h=ui(li().mark((function t(e){var i;return li().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,t.next=3,this.repository.fetchAndParseTransport(e);case 3:return i=t.sent,t.abrupt("return",i);case 7:throw t.prev=7,t.t0=t.catch(0),Error("Failed to get transport");case 10:case"end":return t.stop()}}),t,this,[[0,7]])}))),function(t){return h.apply(this,arguments)})},{key:"getCachedPlaces",value:function(t){try{var e=this.repository.getCachedPlaces(t);return this.logEvent("getCachedPlaces"),e}catch(i){throw this.logError(i,{functionName:"getCachedPlaces"}),Error("Failed to get cached places")}}},{key:"getAvailablePlaces",value:(u=ui(li().mark((function t(){var e;return li().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,t.next=3,this.repository.fetchAndParseAvailablePlaces();case 3:return e=t.sent,this.logEvent("getAvailablePlaces"),t.abrupt("return",e);case 8:throw t.prev=8,t.t0=t.catch(0),this.logError(t.t0,{functionName:"getAvailablePlaces"}),Error("Failed to get available places");case 12:case"end":return t.stop()}}),t,this,[[0,8]])}))),function(){return u.apply(this,arguments)})},{key:"getSubPlaces",value:(c=ui(li().mark((function t(e){var i;return li().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,t.next=3,this.repository.fetchAndParseSubPlaces(e);case 3:return i=t.sent,this.logEvent("getSubPlaces"),t.abrupt("return",i);case 8:throw t.prev=8,t.t0=t.catch(0),this.logError(t.t0,{functionName:"getSubPlaces"}),Error("Failed to get subplaces");case 12:case"end":return t.stop()}}),t,this,[[0,8]])}))),function(t){return c.apply(this,arguments)})},{key:"getInstitutions",value:(l=ui(li().mark((function t(){var e;return li().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,t.next=3,this.repository.fetchAndParseInstitutions();case 3:return e=t.sent,this.logEvent("getInstitutions"),t.abrupt("return",e);case 8:throw t.prev=8,t.t0=t.catch(0),this.logError(t.t0,{functionName:"getInstitution"}),Error("Error getInstitution");case 12:case"end":return t.stop()}}),t,this,[[0,8]])}))),function(){return l.apply(this,arguments)})},{key:"getRoute",value:(s=ui(li().mark((function t(e){var i,r;return li().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,i=new ct(e),t.next=4,this.repository.fetchAndParseRoute(i);case 4:return r=t.sent,this.logEvent("getRoute"),t.abrupt("return",r);case 9:throw t.prev=9,t.t0=t.catch(0),this.logError(t.t0,{functionName:"getRoute"}),new Error("Failed to get route");case 13:case"end":return t.stop()}}),t,this,[[0,9]])}))),function(t){return s.apply(this,arguments)})},{key:"getRouteV2",value:(a=ui(li().mark((function t(e){var i,r;return li().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,i=new ct(e),t.next=4,this.repository.fetchAndParseRouteV2(i);case 4:return r=t.sent,this.logEvent("getRouteV2"),t.abrupt("return",r);case 9:throw t.prev=9,t.t0=t.catch(0),this.logError(t.t0,{functionName:"getRouteV2"}),new Error("Failed to get route");case 13:case"end":return t.stop()}}),t,this,[[0,9]])}))),function(t){return a.apply(this,arguments)})},{key:"getPlacesByInput",value:(o=ui(li().mark((function t(e,i,r,n){var o,a;return li().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,o=r?n?[r].concat(ai(n)):[r]:n,t.next=4,this.repository.fetchAndParseSearchResults(i,e,o);case 4:return a=t.sent,this.logEvent("getPlacesByInput"),t.abrupt("return",a);case 9:throw t.prev=9,t.t0=t.catch(0),this.logError(t.t0,{functionName:"getPlacesByInput"}),new Error("Failed to get places by input");case 13:case"end":return t.stop()}}),t,this,[[0,9]])}))),function(t,e,i,r){return o.apply(this,arguments)})},{key:"getPlacesByCategory",value:function(t){throw Error("Not implemented")}},{key:"getUserLocation",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{enableHighAccuracy:!0,timeout:6e4,maximumAge:1e4};return new Promise((function(e,i){navigator.geolocation.getCurrentPosition((function(t){e(t)}),(function(t){i(t)}),t)}))}},{key:"watchUserPosition",value:function(t,e){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{enableHighAccuracy:!0,timeout:6e4,maximumAge:1e3};return navigator.geolocation.watchPosition((function(e){t(e)}),(function(t){e(t)}),i)}},{key:"unWatchUserPosition",value:function(t){navigator.geolocation.clearWatch(t)}},{key:"watchUserHeading",value:function(t,e){var i=function(i){if(function(t){return t instanceof DeviceOrientationEvent}(i)){var r=null;void 0!==i.webkitCompassHeading?r=i.webkitCompassHeading||null:i.absolute&&null!==i.alpha&&(r=360-i.alpha),null!==r?t(r):e("Could not retrieve heading information.")}};this.headingListeners.push(i),"ondeviceorientationabsolute"in window?window.addEventListener("deviceorientationabsolute",i):"ondeviceorientation"in window&&window.addEventListener("deviceorientation",i)}},{key:"unwatchUserHeading",value:function(){this.headingListeners.forEach((function(t){window.removeEventListener("deviceorientationabsolute",t),window.removeEventListener("deviceorientation",t)})),this.headingListeners=[]}},{key:"loadRoutesForOriginCache",value:(n=ui(li().mark((function t(e,i,r,n,o){return li().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this.repository.fetchAndParseRoutesFromOrigin(e,i,r,n,o);case 2:case"end":return t.stop()}}),t,this)}))),function(t,e,i,r,o){return n.apply(this,arguments)})},{key:"getCacheTimestamp",value:(r=ui(li().mark((function t(e){var i;return li().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,t.next=3,this.repository.fetchAndParseCacheTimestamp(e);case 3:return i=t.sent,this.logEvent("getCacheTimestamp"),t.abrupt("return",i);case 8:throw t.prev=8,t.t0=t.catch(0),this.logError(t.t0,{functionName:"getCacheTimestamp"}),new Error("Failed to get cache timestamp");case 12:case"end":return t.stop()}}),t,this,[[0,8]])}))),function(t){return r.apply(this,arguments)})},{key:"cleanRoutesCache",value:function(){this.repository.cleanRoutesCache()}},{key:"getCssCustomization",value:(i=ui(li().mark((function t(e){var i;return li().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,t.next=3,this.repository.fetchAndParseCssCustomization(e);case 3:return i=t.sent,this.logEvent("cssCustomization"),t.abrupt("return",i);case 8:throw t.prev=8,t.t0=t.catch(0),this.logError(t.t0,{functionName:"getCssCustomization"}),new Error("Failed to get css customization");case 12:case"end":return t.stop()}}),t,this,[[0,8]])}))),function(t){return i.apply(this,arguments)})}],[{key:"getLang",value:function(){return this.config.lang}}]);var i,r,n,o,a,s,l,c,u,h,d,p,f}(Tt)})(),r})(),t.exports=e()}(Et)),Et.exports),It=(t=>(t.youAreHere="youAreHere",t.placePopup="placePopup",t.pin="pin",t.default="default",t))(It||{});const Ct="lazarillo-sdk";class Tt{constructor(t){this.connected=!1,this.enabledFloors=[],this.host=t,this.host.addController(this),this.contextProvider=new wt(this.host,{context:Ct,initialValue:{enabledFloors:[],markers:[]}})}initialize(t,e,i){if(!this.connected)return;this.initializeSDK(t,e,i);const{originId:r,destinationId:n}=this.contextProvider.value;r&&n&&this.setOriginAndDestination(r,n)}async setOriginAndDestination(t,e){if(!this.connected)return;const i=this.contextProvider.value.sdk;if(this.contextProvider.setValue({...this.contextProvider.value,originId:t,destinationId:e}),i)try{const[r,n]=await Promise.all([t,e].map((t=>{if(t?.length>0)return i.getPlaceDetail(t).catch((()=>{}))})));this.contextProvider.setValue({...this.contextProvider.value,origin:r,destination:n}),this.createOriginDestinationMarkers(r,n);const o=r?r.inFloors?.[0]:n?n.inFloors?.[0]:void 0;o&&this.setFloor(o);const a=this.contextProvider.value.parentPlace?.innerFloors||[],s=[r,n].filter((t=>!!t)).map((t=>t.inFloor(a))).filter((t=>void 0!==t));this.enabledFloors=s,this.contextProvider.setValue({...this.contextProvider.value,enabledFloors:s})}catch(r){console.error("Error initializing SDK:",r)}}async loadRoute(t,e,i=!1){if(!this.connected)return;const r=this.contextProvider.value.sdk;if(r)try{const n=await r.getRoute({initialLocation:{id:t},finalLocation:{id:e},preferAccessibleRoute:i});if(!n)return;const o=this.contextProvider.value.parentPlace?.innerFloors||[],a=n.legs.flatMap((t=>t.steps.flatMap((t=>[t.startInsideFloor,t.endInsideFloor])))).map((t=>t?o.find((e=>e.key===t)):void 0)).filter((t=>void 0!==t));this.contextProvider.setValue({...this.contextProvider.value,route:n,enabledFloors:a})}catch(n){console.error("Error loading route:",n)}}async loadConfig(t){const e=this.contextProvider.value.sdk;if(e)try{const i=await e.getConfiguration(t);this.contextProvider.setValue({...this.contextProvider.value,generalConfig:i})}catch(i){console.error("Error loading config:",i)}}async initializeSDK(t,e,i){const r=St.initializeSDK(t,{lang:e});this.contextProvider.setValue({...this.contextProvider.value,sdk:r,locale:e,parentPlaceId:i});try{await this.loadConfig(i)}catch(n){console.error("Error loading config:",n)}try{const t=await r.getPlaceDetail(i),{origin:e,destination:n}=this.contextProvider.value;let o=t.innerFloors||[];const a=e?.inFloor(o)||n?.inFloor(o);(e||n)&&(o=[e,n].map((t=>t?.inFloor(o))).filter((t=>void 0!==t)),this.enabledFloors=o),this.contextProvider.setValue({...this.contextProvider.value,parentPlace:t,enabledFloors:o,currentFloor:a})}catch(n){console.error("Error initializing SDK:",n)}}createOriginDestinationMarkers(t,e){const i=[];t&&i.push({id:t.lazarilloId,data:t,style:It.youAreHere}),e&&i.push({id:e.lazarilloId,data:e,style:It.placePopup}),this.contextProvider.setValue({...this.contextProvider.value,markers:i})}setAccessibleRoute(t){this.contextProvider.setValue({...this.contextProvider.value,accessibleRoute:t});const{originId:e,destinationId:i,route:r}=this.contextProvider.value;e&&i&&r&&this.loadRoute(e,i,t)}repeatRoute(){this.contextProvider.setValue({...this.contextProvider.value,isRouteAnimating:!0})}removeRoute(){this.contextProvider.setValue({...this.contextProvider.value,route:void 0,enabledFloors:this.enabledFloors})}routeAnimationFinished(){this.contextProvider.setValue({...this.contextProvider.value,isRouteAnimating:!1})}startRouteAnimation(){this.contextProvider.setValue({...this.contextProvider.value,isRouteAnimating:!0})}generateRoute(){const{originId:t,destinationId:e,accessibleRoute:i}=this.contextProvider.value;t&&e&&this.loadRoute(t,e,!!i)}setFloor(t){const{parentPlace:e}=this.contextProvider.value;if(!e)return;const i=e.innerFloors.find((e=>e.key===t));i&&this.contextProvider.setValue({...this.contextProvider.value,currentFloor:i})}hostConnected(){console.log("hostConnected"),this.connected=!0}hostDisconnected(){console.log("hostDisconnected"),this.connected=!1}setMapReady(t){this.contextProvider.setValue({...this.contextProvider.value,mapReady:t})}}class At{constructor(){this.MEASUREMENT_ID="G-6XL8YD35QR",this.isInitialized=!1}static getInstance(){return At.instance||(At.instance=new At),At.instance}initialize(){if(this.isInitialized)return;const t=document.createElement("script");t.async=!0,t.src=`https://www.googletagmanager.com/gtag/js?id=${this.MEASUREMENT_ID}`,document.head.appendChild(t),window.dataLayer=window.dataLayer||[];window.gtag=window.gtag||((...t)=>{window.dataLayer.push(t)}),window.gtag("js",new Date),window.gtag("config",this.MEASUREMENT_ID,{send_page_view:!0,groups:"mapvx"}),this.isInitialized=!0}trackPageView(t){this.isInitialized&&window.gtag("event","page_view",{page_title:t,page_location:window.location.href,page_path:t,component:"route-view-totems",send_to:"mapvx"})}trackEvent(t,e){this.isInitialized&&window.gtag("event",t,{...e,component:"route-view-totems",send_to:"mapvx"})}trackUserTiming(t,e,i){this.isInitialized&&window.gtag("event","timing_complete",{name:e,value:i,event_category:t,component:"route-view-totems",send_to:"mapvx"})}trackException(t,e=!1){this.isInitialized&&window.gtag("event","exception",{description:t,fatal:e,component:"route-view-totems",send_to:"mapvx"})}}var Pt,Mt,Lt,zt,Dt=Object.defineProperty,Rt=Object.getOwnPropertyDescriptor,Ot=t=>{throw TypeError(t)},Ft=(t,e,i,r)=>{for(var n,o=r>1?void 0:r?Rt(e,i):e,a=t.length-1;a>=0;a--)(n=t[a])&&(o=(r?n(e,i,o):n(o))||o);return r&&o&&Dt(e,i,o),o},Bt=(t,e,i)=>e.has(t)||Ot("Cannot "+i),Nt=(t,e,i)=>(Bt(t,e,"read from private field"),i?i.call(t):e.get(t)),jt=(t,e,i)=>e.has(t)?Ot("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(t):e.set(t,i),Vt=(t,e,i,r)=>(Bt(t,e,"write to private field"),e.set(t,i),i);t.MapViewWithModal=class extends st{constructor(){super(...arguments),this.styles=[s`
70
+ :host {
71
+ display: block;
72
+ }
73
+ `],jt(this,Pt,""),jt(this,Mt,""),jt(this,Lt,"es"),jt(this,zt,""),this.sdkController=new Tt(this),this.analyticsController=At.getInstance()}get apiKey(){return Nt(this,Pt)}set apiKey(t){Vt(this,Pt,t)}get parentPlaceId(){return Nt(this,Mt)}set parentPlaceId(t){Vt(this,Mt,t)}get locale(){return Nt(this,Lt)}set locale(t){Vt(this,Lt,t)}get placeId(){return Nt(this,zt)}set placeId(t){Vt(this,zt,t)}async _loadComponents(){await Promise.all([Promise.resolve().then((()=>Xt))])}async firstUpdated(){await this._loadComponents(),this.analyticsController.initialize(),yt.initialize()}_mapReadyHandler(){this.sdkController.setMapReady(!0),this.analyticsController.trackEvent("map_ready",this.baseParams())}_updateFloorHandler(t){const e=t.detail;this.sdkController.setFloor(e);const i=this.baseParams();i.floor_id=e,this.analyticsController.trackEvent("floor_change",i)}baseParams(){return{apiKey:this.apiKey,locale:this.locale,parentPlaceId:this.parentPlaceId,placeId:this.placeId,host:window.location.host,pathname:window.location.pathname,search:window.location.search,hash:window.location.hash,referrer:document.referrer,userAgent:navigator.userAgent,screenWidth:window.innerWidth}}updated(t){this.apiKey&&this.locale&&this.parentPlaceId&&(t.has("apiKey")||t.has("locale")||t.has("parentPlaceId"))&&this.sdkController.initialize(this.apiKey,this.locale,this.parentPlaceId),this.placeId&&t.has("placeId")&&this.sdkController.setOriginAndDestination("",this.placeId)}render(){return q`
74
+ <div class="route-container">
75
+ <custom-map
76
+ class="map-container"
77
+ @mapReady=${this._mapReadyHandler}
78
+ @floorChange=${this._updateFloorHandler}
79
+ ></custom-map>
80
+ </div>
81
+ `}},Pt=new WeakMap,Mt=new WeakMap,Lt=new WeakMap,zt=new WeakMap,Ft([dt({type:String})],t.MapViewWithModal.prototype,"apiKey",1),Ft([dt({type:String})],t.MapViewWithModal.prototype,"parentPlaceId",1),Ft([dt({type:String})],t.MapViewWithModal.prototype,"locale",1),Ft([dt({type:String})],t.MapViewWithModal.prototype,"placeId",1),t.MapViewWithModal=Ft([ct("map-view-with-modal")],t.MapViewWithModal);class Ut{static create(t){const e=document.createElement("div"),i=document.createElement("style");i.textContent='@keyframes fadeIn{0%{opacity:0;transform:scale(.95)}to{opacity:1;transform:scale(1)}}.popup{background:#fff;filter:drop-shadow(0 1px 4px rgba(0,0,0,.2));padding:15px;border-radius:10px;border:1px solid #cccccc;min-width:180px;position:relative;transform:translateY(-50%)}.popup:after{content:"";position:absolute;bottom:-10px;left:50%;transform:translate(-50%);width:0;height:0;border-left:10px solid transparent;border-right:10px solid transparent;border-top:10px solid white;z-index:1}.popup:before{content:"";position:absolute;bottom:-11px;left:50%;transform:translate(-50%);width:0;height:0;border-left:11px solid transparent;border-right:11px solid transparent;border-top:11px solid #cccccc;z-index:0}.popup-content{display:flex;flex-direction:column;gap:4px}.popup-logo{width:100%;object-fit:contain;object-position:center;height:60px;overflow:hidden;align-self:center;max-width:100%}.popup-name{position:relative;color:#000;text-align:center;letter-spacing:-1.1719905853px;margin-top:10px;max-width:250px;font:700 23px/23px Poppins,-apple-system,Roboto,Helvetica,sans-serif}.popup-category{color:#555;position:relative;color:#000;text-align:center;letter-spacing:-.5859952927px;white-space:nowrap;margin:5px 0 20px;font:400 12px/14px Poppins,-apple-system,Roboto,Helvetica,sans-serif}@media (max-width: 991px){.popup-category{margin-bottom:40px;white-space:initial}}',e.appendChild(i);const r=document.createElement("div");return r.className="popup",r.innerHTML=`<div class="popup-content">\n ${t.url_logo?`<img src="${t.url_logo}" class="popup-logo" loading="lazy"/>`:""}\n <div class="popup-name">${t.name}</div>\n ${t.category?`<div class="popup-category">${t.category}</div>`:""}\n </div>\n `,e.appendChild(r),e}}class qt{constructor(t){this.host=t,this.connected=!1,this.markersIds=[],this.mapReady=!1,this.accessibleRoute=!1,this.host.addController(this)}hostConnected(){this.connected=!0}hostDisconnected(){this.connected=!1}setMap(t){this.map=t}setMapReady(t){this.mapReady=t}setAccessibleRoute(t){this.accessibleRoute=t}setParentPlace(t){this.parentPlace=t}updateMarkers(t){if(!(this.connected&&this.map&&this.mapReady&&this.parentPlace))return;const e=this.parentPlace.innerFloors??[];this.markersIds.forEach((t=>{try{this.map?.removeMarker(t.id)}catch{}})),this.markersIds=[],t.forEach((t=>{const{style:i,id:r,data:n}=t;let o,a,s=null;switch(i){case It.youAreHere:{console.info("youAreHere",n);const t=document.createElement("img"),i=n;o=i.inFloor(e)?.key,t.src=this.accessibleRoute?"data:image/svg+xml,%3csvg%20width='165'%20height='48'%20viewBox='0%200%20210%2061'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M47.2975%208.64848L186.354%208.64848C198.371%208.64848%20208.112%2018.3895%20208.112%2030.4057C208.112%2042.4219%20198.371%2052.1629%20186.354%2052.1629L47.2975%2052.1629L47.2975%208.64848Z'%20fill='%239D55F9'%20stroke='white'%20stroke-width='1.89193'/%3e%3cpath%20d='M58.6414%2030.4057C58.6414%2045.5565%2046.3592%2057.8387%2031.2084%2057.8387C16.0576%2057.8387%203.7754%2045.5565%203.7754%2030.4057C3.7754%2015.2548%2016.0576%202.97266%2031.2084%202.97266C46.3592%202.97266%2058.6414%2015.2548%2058.6414%2030.4057Z'%20fill='white'%20stroke='%239D55F9'%20stroke-width='5.67579'/%3e%3cpath%20d='M45.9091%2039.0728C45.6031%2038.1568%2044.6222%2037.6597%2043.6957%2037.967L42.6358%2038.3191L40.3551%2032.852C40.0899%2032.1384%2039.45%2031.7501%2038.7335%2031.7501H33.3858L32.817%2029.1251H36.378C37.3455%2029.1251%2038.1281%2028.3425%2038.1281%2027.3751C38.1281%2026.4077%2037.3455%2025.6251%2036.378%2025.6251H32.0584L31.9791%2025.2532C31.7713%2023.7712%2030.4259%2022.8251%2029.0039%2023.0275C27.5218%2023.2298%2026.5702%2024.5587%2026.778%2025.997L28.0731%2033.6751C28.1617%2034.572%2028.9164%2035.2501%2029.8134%2035.2501H37.5467L40.0002%2041.1509C40.2758%2041.829%2040.9321%2042.2501%2041.6267%2042.2501C41.8096%2042.2501%2041.9976%2042.2211%2042.1802%2042.1596L44.8054%2041.2846C45.7231%2040.9814%2046.2153%2039.9915%2045.9091%2039.0728ZM26.7506%2041.3751C23.3729%2041.3751%2020.6252%2038.6276%2020.6252%2035.2501C20.6252%2032.2833%2022.7461%2029.806%2025.5507%2029.2454L25.1154%2026.6642C21.066%2027.4298%2018%2030.979%2018%2035.2501C18%2040.0829%2021.9176%2044.0001%2026.7506%2044.0001C30.9838%2044.0001%2034.5114%2040.9939%2035.3263%2037.0001H32.6409C31.8315%2039.5212%2029.518%2041.3751%2026.7506%2041.3751ZM28.5008%2021.2501C29.9506%2021.2501%2031.126%2020.0749%2031.126%2018.6251C31.126%2017.1754%2029.9501%2016.0001%2028.5008%2016.0001C27.0514%2016.0001%2025.8756%2017.1754%2025.8756%2018.6251C25.8756%2020.0749%2027.0514%2021.2501%2028.5008%2021.2501Z'%20fill='%23020202'/%3e%3cpath%20d='M78.5428%2041.0531L67.6531%2041.0531L67.6531%2022.1449L78.5428%2022.1449L78.5428%2025.4299L71.6624%2025.4299L71.6624%2029.5814L78.0643%2029.5814L78.0643%2032.8664L71.6624%2032.8664L71.6624%2037.7422L78.5428%2037.7422L78.5428%2041.0531ZM90.9534%2036.7593C90.9534%2038.2423%2090.4361%2039.3718%2089.4015%2040.1478C88.3754%2040.9238%2086.8364%2041.3118%2084.7843%2041.3118C83.7324%2041.3118%2082.8358%2041.2385%2082.0943%2041.0919C81.3528%2040.9539%2080.6587%2040.747%2080.012%2040.4711L80.012%2037.212C80.7449%2037.5568%2081.5683%2037.8457%2082.4822%2038.0785C83.4048%2038.3113%2084.2153%2038.4277%2084.9137%2038.4277C86.3449%2038.4277%2087.0606%2038.0138%2087.0606%2037.1861C87.0606%2036.8757%2086.9657%2036.6257%2086.776%2036.436C86.5864%2036.2377%2086.2587%2036.0178%2085.7931%2035.7764C85.3275%2035.5263%2084.7067%2035.2375%2083.9308%2034.9099C82.8185%2034.4443%2081.9994%2034.0132%2081.4735%2033.6166C80.9561%2033.2199%2080.5768%2032.7673%2080.3353%2032.2586C80.1026%2031.7413%2079.9862%2031.1075%2079.9862%2030.3574C79.9862%2029.0727%2080.4819%2028.0812%2081.4735%2027.3828C82.4736%2026.6758%2083.8876%2026.3223%2085.7155%2026.3223C87.4572%2026.3223%2089.1514%2026.7016%2090.7982%2027.4604L89.6084%2030.3057C88.8841%2029.9953%2088.2073%2029.7409%2087.5779%2029.5426C86.9485%2029.3443%2086.3061%2029.2452%2085.6509%2029.2452C84.4869%2029.2452%2083.9049%2029.5599%2083.9049%2030.1893C83.9049%2030.5428%2084.0903%2030.8489%2084.461%2031.1075C84.8404%2031.3662%2085.6638%2031.7499%2086.9312%2032.2586C88.0607%2032.7155%2088.8885%2033.1423%2089.4144%2033.539C89.9403%2033.9356%2090.3283%2034.3925%2090.5784%2034.9099C90.8284%2035.4272%2090.9534%2036.0437%2090.9534%2036.7593ZM98.7987%2038.169C99.4884%2038.169%20100.316%2038.0181%20101.282%2037.7164L101.282%2040.6522C100.299%2041.0919%2099.0918%2041.3118%2097.6606%2041.3118C96.0827%2041.3118%2094.9317%2040.9151%2094.2074%2040.1219C93.4918%2039.3201%2093.134%2038.1216%2093.134%2036.5265L93.134%2029.5556L91.2457%2029.5556L91.2457%2027.8872L93.4185%2026.568L94.5566%2023.5158L97.0786%2023.5158L97.0786%2026.5939L101.127%2026.5939V29.5556L97.0786%2029.5556L97.0786%2036.5265C97.0786%2037.0869%2097.2338%2037.5008%2097.5442%2037.7681C97.8632%2038.0354%2098.2813%2038.169%2098.7987%2038.169ZM112.076%2041.0531L111.313%2039.0873H111.209C110.545%2039.9236%20109.86%2040.5056%20109.153%2040.8332C108.455%2041.1523%20107.541%2041.3118%20106.411%2041.3118C105.023%2041.3118%20103.928%2040.9151%20103.126%2040.1219C102.333%2039.3287%20101.936%2038.1992%20101.936%2036.7334C101.936%2035.1987%20102.471%2034.0692%20103.54%2033.345C104.618%2032.6121%20106.239%2032.2068%20108.403%2032.1292L110.912%2032.0516V31.4179C110.912%2029.9522%20110.162%2029.2193%20108.661%2029.2193C107.506%2029.2193%20106.148%2029.5685%20104.588%2030.2669L103.281%2027.6027C104.945%2026.7318%20106.79%2026.2964%20108.817%2026.2964C110.757%2026.2964%20112.244%2026.7189%20113.279%2027.5639C114.313%2028.4088%20114.831%2029.6935%20114.831%2031.4179L114.831%2041.0531L112.076%2041.0531ZM110.912%2034.3537L109.386%2034.4055C108.239%2034.44%20107.385%2034.6469%20106.825%2035.0263C106.265%2035.4056%20105.984%2035.9833%20105.984%2036.7593C105.984%2037.8716%20106.622%2038.4277%20107.898%2038.4277C108.812%2038.4277%20109.541%2038.1647%20110.084%2037.6388C110.636%2037.1128%20110.912%2036.4144%20110.912%2035.5436V34.3537ZM106.527%2025.0031V24.6539C108.01%2022.9295%20109.024%2021.6319%20109.567%2020.761L113.99%2020.761V21.0326C113.542%2021.481%20112.774%2022.1492%20111.688%2023.0373C110.61%2023.9167%20109.765%2024.572%20109.153%2025.0031L106.527%2025.0031ZM127.668%2036.7593C127.668%2038.2423%20127.151%2039.3718%20126.116%2040.1478C125.09%2040.9238%20123.551%2041.3118%20121.499%2041.3118C120.447%2041.3118%20119.55%2041.2385%20118.809%2041.0919C118.067%2040.9539%20117.373%2040.747%20116.727%2040.4711L116.727%2037.212C117.459%2037.5568%20118.283%2037.8457%20119.197%2038.0785C120.119%2038.3113%20120.93%2038.4277%20121.628%2038.4277C123.059%2038.4277%20123.775%2038.0138%20123.775%2037.1861C123.775%2036.8757%20123.68%2036.6257%20123.491%2036.436C123.301%2036.2377%20122.973%2036.0178%20122.508%2035.7764C122.042%2035.5263%20121.421%2035.2375%20120.645%2034.9099C119.533%2034.4443%20118.714%2034.0132%20118.188%2033.6166C117.671%2033.2199%20117.291%2032.7673%20117.05%2032.2586C116.817%2031.7413%20116.701%2031.1075%20116.701%2030.3574C116.701%2029.0727%20117.196%2028.0812%20118.188%2027.3828C119.188%2026.6758%20120.602%2026.3223%20122.43%2026.3223C124.172%2026.3223%20125.866%2026.7016%20127.513%2027.4604L126.323%2030.3057C125.599%2029.9953%20124.922%2029.7409%20124.292%2029.5426C123.663%2029.3443%20123.021%2029.2452%20122.365%2029.2452C121.201%2029.2452%20120.619%2029.5599%20120.619%2030.1893C120.619%2030.5428%20120.805%2030.8489%20121.176%2031.1075C121.555%2031.3662%20122.378%2031.7499%20123.646%2032.2586C124.775%2032.7155%20125.603%2033.1423%20126.129%2033.539C126.655%2033.9356%20127.043%2034.3925%20127.293%2034.9099C127.543%2035.4272%20127.668%2036.0437%20127.668%2036.7593ZM144.16%2041.0531L143.397%2039.0873H143.294C142.63%2039.9236%20141.944%2040.5056%20141.237%2040.8332C140.539%2041.1523%20139.625%2041.3118%20138.496%2041.3118C137.107%2041.3118%20136.012%2040.9151%20135.211%2040.1219C134.417%2039.3287%20134.021%2038.1992%20134.021%2036.7334C134.021%2035.1987%20134.555%2034.0692%20135.624%2033.345C136.702%2032.6121%20138.323%2032.2068%20140.487%2032.1292L142.996%2032.0516V31.4179C142.996%2029.9522%20142.246%2029.2193%20140.746%2029.2193C139.591%2029.2193%20138.233%2029.5685%20136.672%2030.2669L135.366%2027.6027C137.03%2026.7318%20138.875%2026.2964%20140.901%2026.2964C142.841%2026.2964%20144.328%2026.7189%20145.363%2027.5639C146.398%2028.4088%20146.915%2029.6935%20146.915%2031.4179L146.915%2041.0531L144.16%2041.0531ZM142.996%2034.3537L141.47%2034.4055C140.323%2034.44%20139.47%2034.6469%20138.909%2035.0263C138.349%2035.4056%20138.069%2035.9833%20138.069%2036.7593C138.069%2037.8716%20138.707%2038.4277%20139.983%2038.4277C140.897%2038.4277%20141.625%2038.1647%20142.169%2037.6388C142.72%2037.1128%20142.996%2036.4144%20142.996%2035.5436V34.3537ZM155.653%2038.2207C156.653%2038.2207%20157.386%2037.9362%20157.851%2037.3672C158.317%2036.7895%20158.571%2035.785%20158.614%2034.3537V33.8752C158.614%2032.3232%20158.373%2031.211%20157.89%2030.5385C157.416%2029.866%20156.649%2029.5297%20155.588%2029.5297C153.734%2029.5297%20152.807%2030.9868%20152.807%2033.9011C152.807%2035.3496%20153.036%2036.4317%20153.493%2037.1473C153.958%2037.8629%20154.678%2038.2207%20155.653%2038.2207ZM154.243%2041.3118C152.536%2041.3118%20151.199%2040.6565%20150.234%2039.3459C149.268%2038.0268%20148.785%2036.1946%20148.785%2033.8494C148.785%2031.4869%20149.277%2029.6418%20150.26%2028.314C151.251%2026.9862%20152.605%2026.3223%20154.321%2026.3223C155.234%2026.3223%20156.032%2026.4947%20156.713%2026.8396C157.394%2027.1845%20157.994%2027.7191%20158.511%2028.4433L158.614%2028.4433L158.964%2026.5939L162.3%2026.5939L162.3%2047.4162L158.343%2047.4162L158.343%2041.3506C158.343%2040.8246%20158.399%2040.1004%20158.511%2039.1778H158.343C157.92%2039.8762%20157.36%2040.4064%20156.661%2040.7686C155.963%2041.1307%20155.157%2041.3118%20154.243%2041.3118ZM175.345%2041.0531L174.814%2039.2037L174.607%2039.2037C174.185%2039.8762%20173.586%2040.3978%20172.81%2040.7686C172.034%2041.1307%20171.15%2041.3118%20170.158%2041.3118C168.46%2041.3118%20167.18%2040.8591%20166.317%2039.9538C165.455%2039.0398%20165.024%2037.7293%20165.024%2036.0221L165.024%2026.5939L168.969%2026.5939L168.969%2035.0392C168.969%2036.0825%20169.154%2036.8671%20169.525%2037.393C169.895%2037.9104%20170.486%2038.169%20171.297%2038.169C172.4%2038.169%20173.198%2037.8026%20173.689%2037.0697C174.181%2036.3282%20174.426%2035.1039%20174.426%2033.3967L174.426%2026.5939L178.371%2026.5939L178.371%2041.0531L175.345%2041.0531ZM185.13%2041.0531L181.185%2041.0531L181.185%2026.5939L185.13%2026.5939L185.13%2041.0531ZM180.991%2025.0031V24.6539C182.474%2022.9295%20183.487%2021.6319%20184.031%2020.761L188.454%2020.761V21.0326C188.005%2021.481%20187.238%2022.1492%20186.152%2023.0373C185.074%2023.9167%20184.229%2024.572%20183.617%2025.0031L180.991%2025.0031Z'%20fill='white'/%3e%3c/svg%3e":"data:image/svg+xml,%3csvg%20width='165'%20height='48'%20viewBox='0%200%20110%2032'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M24%204H98C104.627%204%20110%209.37258%20110%2016C110%2022.6274%20104.627%2028%2098%2028H24V4Z'%20fill='%239D55F9'/%3e%3ccircle%20cx='16'%20cy='16'%20r='14.5'%20fill='white'%20stroke='%239D55F9'%20stroke-width='3'/%3e%3cpath%20d='M18.9254%209.90632C18.9254%2010.683%2018.2703%2011.3126%2017.4628%2011.3126C16.6553%2011.3126%2016.0002%2010.683%2016.0002%209.90632C16.0002%209.12962%2016.6553%208.5%2017.4628%208.5C18.2703%208.5%2018.9254%209.12962%2018.9254%209.90632ZM14.9795%2014.3392C14.9521%2014.3509%2014.9216%2014.3626%2014.8942%2014.3743L14.559%2014.5179C14.0931%2014.7171%2013.7278%2015.0804%2013.5389%2015.5345L13.4928%2015.6459C13.293%2016.1263%2012.7256%2016.3607%2012.2256%2016.1674C11.7256%2015.974%2011.4824%2015.429%2011.6823%2014.9486L11.7283%2014.8372C12.1058%2013.9319%2012.8368%2013.2024%2013.7656%2012.8039L14.1007%2012.6604C14.7357%2012.3908%2015.3939%2012.2502%2016.113%2012.2502C17.4719%2012.2502%2018.6968%2013.0354%2019.2179%2014.2395L19.6597%2015.3177L20.3361%2015.6312C20.8176%2015.8627%2021.0126%2016.4252%2020.7719%2016.8881C20.5312%2017.351%2019.9461%2017.5385%2019.4647%2017.3071L18.6511%2016.9174C18.3373%2016.7651%2018.0905%2016.5102%2017.9564%2016.1996L17.6639%2015.5257L17.0758%2017.4448L18.5841%2019.0298C18.7486%2019.2027%2018.8675%2019.4107%2018.9254%2019.6392L19.6262%2022.3347C19.7572%2022.8386%2019.4403%2023.3484%2018.9193%2023.4714C18.3952%2023.5974%2017.865%2023.2927%2017.7096%2022.7917L17.0636%2020.2076L14.9124%2017.9487C14.4615%2017.477%2014.2665%2016.8178%2014.4645%2016.1996L14.9795%2014.3392ZM13.2192%2020.1607L13.9798%2018.3325C14.0453%2018.4204%2014.116%2018.5024%2014.1934%2018.5845L15.4335%2019.8853L14.9917%2020.9459C14.9185%2021.1246%2014.8089%2021.2858%2014.6687%2021.4176L12.7896%2023.2253C12.4087%2023.5916%2011.7914%2023.5916%2011.4106%2023.2253C11.0298%2022.8591%2011.0298%2022.2673%2011.4106%2021.901L13.2192%2020.1607Z'%20fill='black'/%3e%3cpath%20d='M41.0137%2021H35.2578V11.0059H41.0137V12.7422H37.377V14.9365H40.7607V16.6729H37.377V19.25H41.0137V21ZM47.5734%2018.7305C47.5734%2019.5143%2047.3%2020.1113%2046.7531%2020.5215C46.2108%2020.9316%2045.3973%2021.1367%2044.3127%2021.1367C43.7567%2021.1367%2043.2827%2021.098%2042.8908%2021.0205C42.4989%2020.9476%2042.132%2020.8382%2041.7902%2020.6924V18.9697C42.1776%2019.152%2042.6128%2019.3047%2043.0959%2019.4277C43.5835%2019.5508%2044.0119%2019.6123%2044.3811%2019.6123C45.1376%2019.6123%2045.5158%2019.3936%2045.5158%2018.9561C45.5158%2018.792%2045.4657%2018.6598%2045.3654%2018.5596C45.2652%2018.4548%2045.092%2018.3385%2044.8459%2018.2109C44.5998%2018.0788%2044.2717%2017.9261%2043.8615%2017.7529C43.2736%2017.5068%2042.8407%2017.279%2042.5627%2017.0693C42.2893%2016.8597%2042.0887%2016.6204%2041.9611%2016.3516C41.8381%2016.0781%2041.7766%2015.7432%2041.7766%2015.3467C41.7766%2014.6676%2042.0386%2014.1436%2042.5627%2013.7744C43.0913%2013.4007%2043.8387%2013.2139%2044.8049%2013.2139C45.7255%2013.2139%2046.621%2013.4144%2047.4914%2013.8154L46.8625%2015.3193C46.4797%2015.1553%2046.1219%2015.0208%2045.7893%2014.916C45.4566%2014.8112%2045.1171%2014.7588%2044.7707%2014.7588C44.1555%2014.7588%2043.8479%2014.9251%2043.8479%2015.2578C43.8479%2015.4447%2043.9458%2015.6064%2044.1418%2015.7432C44.3423%2015.8799%2044.7775%2016.0827%2045.4475%2016.3516C46.0445%2016.5931%2046.482%2016.8187%2046.76%2017.0283C47.038%2017.238%2047.243%2017.4795%2047.3752%2017.7529C47.5074%2018.0264%2047.5734%2018.3522%2047.5734%2018.7305ZM51.7201%2019.4756C52.0847%2019.4756%2052.5222%2019.3958%2053.0326%2019.2363V20.7881C52.5131%2021.0205%2051.8751%2021.1367%2051.1186%2021.1367C50.2846%2021.1367%2049.6762%2020.9271%2049.2934%2020.5078C48.9151%2020.084%2048.726%2019.4505%2048.726%2018.6074V14.9229H47.7279V14.041L48.8764%2013.3437L49.4779%2011.7305H50.8109V13.3574H52.9506V14.9229H50.8109V18.6074C50.8109%2018.9036%2050.893%2019.1224%2051.057%2019.2637C51.2257%2019.4049%2051.4467%2019.4756%2051.7201%2019.4756ZM58.7379%2021L58.3346%2019.9609H58.2799C57.929%2020.403%2057.5667%2020.7106%2057.193%2020.8838C56.8238%2021.0524%2056.3408%2021.1367%2055.7437%2021.1367C55.01%2021.1367%2054.4312%2020.9271%2054.0074%2020.5078C53.5881%2020.0885%2053.3785%2019.4915%2053.3785%2018.7168C53.3785%2017.9056%2053.6611%2017.3086%2054.2262%2016.9258C54.7958%2016.5384%2055.6526%2016.3242%2056.7965%2016.2832L58.1227%2016.2422V15.9072C58.1227%2015.1325%2057.7262%2014.7451%2056.9332%2014.7451C56.3225%2014.7451%2055.6048%2014.9297%2054.7799%2015.2988L54.0895%2013.8906C54.969%2013.4303%2055.9443%2013.2002%2057.0152%2013.2002C58.0406%2013.2002%2058.8268%2013.4235%2059.3736%2013.8701C59.9205%2014.3167%2060.1939%2014.9958%2060.1939%2015.9072V21H58.7379ZM58.1227%2017.459L57.316%2017.4863C56.7099%2017.5046%2056.2587%2017.6139%2055.9625%2017.8145C55.6663%2018.015%2055.5182%2018.3203%2055.5182%2018.7305C55.5182%2019.3184%2055.8554%2019.6123%2056.5299%2019.6123C57.013%2019.6123%2057.398%2019.4733%2057.6852%2019.1953C57.9768%2018.9173%2058.1227%2018.5482%2058.1227%2018.0879V17.459ZM55.8053%2012.5166V12.332C56.5891%2011.4206%2057.1246%2010.7347%2057.4117%2010.2744H59.7496V10.418C59.5126%2010.6549%2059.107%2011.0081%2058.5328%2011.4775C57.9631%2011.9424%2057.5165%2012.2887%2057.193%2012.5166H55.8053ZM66.9793%2018.7305C66.9793%2019.5143%2066.7059%2020.1113%2066.159%2020.5215C65.6167%2020.9316%2064.8032%2021.1367%2063.7186%2021.1367C63.1626%2021.1367%2062.6886%2021.098%2062.2967%2021.0205C61.9048%2020.9476%2061.5379%2020.8382%2061.1961%2020.6924V18.9697C61.5835%2019.152%2062.0187%2019.3047%2062.5018%2019.4277C62.9894%2019.5508%2063.4178%2019.6123%2063.7869%2019.6123C64.5434%2019.6123%2064.9217%2019.3936%2064.9217%2018.9561C64.9217%2018.792%2064.8715%2018.6598%2064.7713%2018.5596C64.671%2018.4548%2064.4979%2018.3385%2064.2518%2018.2109C64.0057%2018.0788%2063.6775%2017.9261%2063.2674%2017.7529C62.6795%2017.5068%2062.2465%2017.279%2061.9686%2017.0693C61.6951%2016.8597%2061.4946%2016.6204%2061.367%2016.3516C61.2439%2016.0781%2061.1824%2015.7432%2061.1824%2015.3467C61.1824%2014.6676%2061.4445%2014.1436%2061.9686%2013.7744C62.4972%2013.4007%2063.2446%2013.2139%2064.2107%2013.2139C65.1313%2013.2139%2066.0268%2013.4144%2066.8973%2013.8154L66.2684%2015.3193C65.8855%2015.1553%2065.5278%2015.0208%2065.1951%2014.916C64.8624%2014.8112%2064.5229%2014.7588%2064.1766%2014.7588C63.5613%2014.7588%2063.2537%2014.9251%2063.2537%2015.2578C63.2537%2015.4447%2063.3517%2015.6064%2063.5477%2015.7432C63.7482%2015.8799%2064.1834%2016.0827%2064.8533%2016.3516C65.4503%2016.5931%2065.8878%2016.8187%2066.1658%2017.0283C66.4438%2017.238%2066.6489%2017.4795%2066.7811%2017.7529C66.9132%2018.0264%2066.9793%2018.3522%2066.9793%2018.7305ZM75.6965%2021L75.2932%2019.9609H75.2385C74.8876%2020.403%2074.5253%2020.7106%2074.1516%2020.8838C73.7824%2021.0524%2073.2993%2021.1367%2072.7023%2021.1367C71.9686%2021.1367%2071.3898%2020.9271%2070.966%2020.5078C70.5467%2020.0885%2070.3371%2019.4915%2070.3371%2018.7168C70.3371%2017.9056%2070.6197%2017.3086%2071.1848%2016.9258C71.7544%2016.5384%2072.6112%2016.3242%2073.7551%2016.2832L75.0812%2016.2422V15.9072C75.0812%2015.1325%2074.6848%2014.7451%2073.8918%2014.7451C73.2811%2014.7451%2072.5633%2014.9297%2071.7385%2015.2988L71.048%2013.8906C71.9276%2013.4303%2072.9029%2013.2002%2073.9738%2013.2002C74.9992%2013.2002%2075.7853%2013.4235%2076.3322%2013.8701C76.8791%2014.3167%2077.1525%2014.9958%2077.1525%2015.9072V21H75.6965ZM75.0812%2017.459L74.2746%2017.4863C73.6685%2017.5046%2073.2173%2017.6139%2072.9211%2017.8145C72.6249%2018.015%2072.4768%2018.3203%2072.4768%2018.7305C72.4768%2019.3184%2072.814%2019.6123%2073.4885%2019.6123C73.9715%2019.6123%2074.3566%2019.4733%2074.6437%2019.1953C74.9354%2018.9173%2075.0812%2018.5482%2075.0812%2018.0879V17.459ZM81.7709%2019.5029C82.2995%2019.5029%2082.6869%2019.3525%2082.933%2019.0518C83.1791%2018.7464%2083.3135%2018.2155%2083.3363%2017.459V17.2061C83.3363%2016.3857%2083.2087%2015.7979%2082.9535%2015.4424C82.7029%2015.0869%2082.2973%2014.9092%2081.7367%2014.9092C80.7569%2014.9092%2080.267%2015.6794%2080.267%2017.2197C80.267%2017.9854%2080.3878%2018.5573%2080.6293%2018.9355C80.8754%2019.3138%2081.2559%2019.5029%2081.7709%2019.5029ZM81.0258%2021.1367C80.1234%2021.1367%2079.4171%2020.7904%2078.9066%2020.0977C78.3962%2019.4004%2078.141%2018.432%2078.141%2017.1924C78.141%2015.9437%2078.4008%2014.9684%2078.9203%2014.2666C79.4444%2013.5648%2080.1599%2013.2139%2081.0668%2013.2139C81.5499%2013.2139%2081.9714%2013.305%2082.3314%2013.4873C82.6915%2013.6696%2083.0082%2013.9521%2083.2816%2014.335H83.3363L83.5209%2013.3574H85.2846V24.3633H83.1928V21.1572C83.1928%2020.8792%2083.2224%2020.4964%2083.2816%2020.0088H83.1928C82.9695%2020.3779%2082.6732%2020.6582%2082.3041%2020.8496C81.935%2021.041%2081.5088%2021.1367%2081.0258%2021.1367ZM92.1793%2021L91.899%2020.0225H91.7896C91.5663%2020.3779%2091.2496%2020.6536%2090.8395%2020.8496C90.4293%2021.041%2089.9622%2021.1367%2089.4381%2021.1367C88.5403%2021.1367%2087.8635%2020.8975%2087.4078%2020.4189C86.9521%2019.9359%2086.7242%2019.2432%2086.7242%2018.3408V13.3574H88.8092V17.8213C88.8092%2018.3727%2088.9072%2018.7874%2089.1031%2019.0654C89.2991%2019.3389%2089.6113%2019.4756%2090.0396%2019.4756C90.623%2019.4756%2091.0445%2019.2819%2091.3043%2018.8945C91.5641%2018.5026%2091.6939%2017.8555%2091.6939%2016.9531V13.3574H93.7789V21H92.1793ZM97.3514%2021H95.2664V13.3574H97.3514V21ZM95.1639%2012.5166V12.332C95.9477%2011.4206%2096.4832%2010.7347%2096.7703%2010.2744H99.1082V10.418C98.8712%2010.6549%2098.4656%2011.0081%2097.8914%2011.4775C97.3217%2011.9424%2096.8751%2012.2887%2096.5516%2012.5166H95.1639Z'%20fill='white'/%3e%3c/svg%3e",s=t,a=i.position;break}case It.placePopup:{console.info("placePopup",n);const t=structuredClone(n);if(o=t.floorId,n instanceof St.LzPlace){t.name=n.title,t.category=n.localizedCategory??"";const i=["baños-general","baño-accesible","baño-niño","servicio-bicicletero","servicio-cajeros","servicio-cowork","servicio-escenario","servicio-lactancia","servicio-cliente","servicio-registrocivil","plaza-central","entrance","parking-entrance","servicio-handsfree","servicio-taxi","servicio-paramedicos","service-electric-car-charger"],r=n.tags?.find((t=>i.includes(t)));if(r){const e="https://lazarillo.app/internal/maps/vector-style/service-logos/"+r+".png";t.logo=e}else"string"==typeof n.logo?t.logo=n.logo:t.logo=n.logo?.light??"";t.position=n.position,o=n.inFloor(e)?.key}s=Ut.create({name:t.name,category:t.category,url_logo:t.logo}),a=t.position;break}}if(s&&a){console.info("addMarker",s,a);try{this.map?.addMarker({coordinate:a,id:r,refId:r,floorId:o,element:s}),this.markersIds.push({id:r,floorId:o,coordinate:a})}catch(l){console.error("addMarker error",l)}}})),this.map?.setPlacesAsSelected(this.markersIds.map((t=>t.id)),"#9D55F9");const i=this.map?.getCurrentFloor(),r=this.markersIds.filter((t=>t.floorId===i)).map((t=>t.coordinate));r.length>0&&setTimeout((()=>{this.map?.fitCoordinates(r,{padding:{top:350,bottom:50,left:50,right:100}})}),200)}getMarkersIds(){return this.markersIds.map((t=>t.id))}}class $t{constructor(t,e){this.host=t,this.handlers=e,this.connected=!1,this.isAnimatingRoute=!1,this.stepAnimationDate=new Date,this.minUpdateTimeInterval=5e3,this.host.addController(this)}hostConnected(){this.connected=!0}hostDisconnected(){this.connected=!1}setMap(t){this.lzMap=t}setCurrentFloor(t){this._currentMapFloor=t}setParentPlace(t){this.parentPlace=t}setLocale(t){this.locale=t}startRouteAnimation(t){if(!this.connected||!this.lzMap||this.isAnimatingRoute)return;this.isAnimatingRoute=!0;const e={callBack:t=>{t.isFinished&&(this.stopAnimatedRoute(),this.handlers.onRouteAnimationFinished());const e=t.step;if(!e||!this.parentPlace||!this._currentMapFloor)return;const i=e.endInsideFloor;if(this._currentMapFloor!=i&&i){const t=this.parentPlace.innerFloors.find((t=>t.key===this._currentMapFloor)),r=this.parentPlace.innerFloors.find((t=>t.key===i));this.setCurrentFloor(i),this.handlers.onFloorChange(i),this.lzMap?.pauseAnimateRoute();const n=(new Date).getTime()-this.stepAnimationDate.getTime(),o=!!t&&!!r&&t.level<r.level,a=e.elevatorStep;let s;s=o?a?"data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%20512%20512'%3e%3cpath%20d='M244.2%204.1l-64%2064c-4.6%204.6-5.6%2011.8-3.1%2017.4s8.2%2010.2%2014.8%2010.2h128c6.7%200%2012.3-4.1%2014.8-9.7s1.5-12.8-3.1-17.4l-64-63.5c-6.7-6.7-16.9-6.7-23.6-1zM64%20128c-35.3%200-64%2028.7-64%2064v256c0%2035.3%2028.7%2064%2064%2064h384c35.3%200%2064-28.7%2064-64V192c0-35.3-28.7-64-64-64H64zm95.7%2095.7c12.8%200%2025.1%205.1%2033.8%2014.3c9.2%209.2%2014.3%2021%2014.3%2033.8s-5.1%2025.1-14.3%2033.8c-9.2%209.2-21%2014.3-33.8%2014.3s-25.1-5.1-33.8-14.3c-9.2-9.2-14.3-21-14.3-33.8s5.1-25.1%2014.3-33.8c9.2-9.2%2021-14.3%2033.8-14.3zM79.9%20399.9c0-26.1%2022-48.1%2048.1-48.1h64c26.1%200%2048.1%2022%2048.1%2048.1v15.9c0%2017.9-14.3%2032.3-32.3%2032.3H112.1c-17.9%200-32.3-14.3-32.3-32.3V399.9zm192%200c0-26.1%2022-48.1%2048.1-48.1h64c26.1%200%2048.1%2022%2048.1%2048.1v15.9c0%2017.9-14.3%2032.3-32.3%2032.3H304.1c-17.9%200-32.3-14.3-32.3-32.3V399.9zm32.3-128c0-6.7%201.5-12.8%204.1-18.4s5.6-10.8%2010.2-15.4s9.7-7.7%2015.4-10.2s12.3-4.1%2018.4-4.1c6.7%200%2012.8%201.5%2018.4%204.1s10.8%205.6%2015.4%2010.2s7.7%209.7%2010.2%2015.4s4.1%2012.3%204.1%2018.4c0%206.7-1.5%2012.8-4.1%2018.4s-5.6%2010.8-10.2%2015.4s-9.7%207.7-15.4%2010.2s-12.3%204.1-18.4%204.1c-6.7%200-12.8-1.5-18.4-4.1s-10.8-5.6-15.4-10.2s-7.7-9.7-10.2-15.4s-4.1-11.8-4.1-18.4z'/%3e%3c/svg%3e":"data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%20636%20512'%3e%3cpath%20d='M532.8%20385.9c0-6.7-5.6-12.3-12.3-12.3h-86c-6.7%200-12.3%205.6-12.3%2012.3s5.6%2012.3%2012.3%2012.3h56.3l-77.3%2077.3c-4.8%204.8-4.8%2012.7%200%2017.4s12.7%204.8%2017.4%200l77.3-77.3v56.3c0%206.7%205.6%2012.3%2012.3%2012.3s12.3-5.6%2012.3-12.3v-86zM207.3%2050.3c0-12.6%205-24.7%2013.9-33.6c8.9-8.9%2021-13.9%2033.6-13.9s24.7%205%2033.6%2013.9c8.9%208.9%2013.9%2021%2013.9%2033.6s-5%2024.7-13.9%2033.6c-8.9%208.9-21%2013.9-33.6%2013.9s-24.7-5-33.6-13.9c-8.9-8.9-13.9-21-13.9-33.6zm180%2084.8c15.8-13.8%2036.2-21.5%2057.2-21.5h102.8c48%200%2087%2039%2087%2087s-39%2087-87%2087h-70.1L248.7%20487.5c-15.8%2013.8-36.2%2021.5-57.2%2021.5H88.6c-48.1%200-87-39-87-87s39-87%2087-87h70.1L387.3%20135.2zm57.2%2025.9c-9.6%200-18.8%203.5-26%209.8L183.3%20376.7c-4.4%203.8-9.9%205.8-15.6%205.8H88.6c-21.8%200-39.5%2017.7-39.5%2039.5s17.7%2039.5%2039.5%2039.5h102.8c9.6%200%2018.8-3.5%2026-9.8L452.7%20246c4.4-3.8%209.9-5.8%2015.6-5.8h79.1c21.8%200%2039.5-17.7%2039.5-39.5s-17.7-39.5-39.5-39.5H444.5zm-189.8-31.6c23.4%200%2043.9%2012.7%2054.9%2031.6L191.5%20264.4v-71.7c0-34.9%2028.4-63.3%2063.3-63.3z'/%3e%3c/svg%3e":a?"data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%20512%20512'%3e%3cpath%20d='M267.3%20507.3l63.9-63.9c4.6-4.6%205.9-11.5%203.5-17.4s-8.3-9.9-14.8-9.9H192.1c-6.5%200-12.3%203.9-14.8%209.9s-1.1%2012.9%203.5%2017.4l63.9%2063.9c6.2%206.2%2016.4%206.2%2022.6%200zM64.3-1.6C29-1.6%20.4%2027%20.4%2062.3V318c0%2035.2%2028.7%2063.9%2063.9%2063.9H447.7c35.2%200%2063.9-28.7%2063.9-63.9V62.3c0-35.2-28.7-63.9-63.9-63.9H64.3zm95.8%2095.8c12.7%200%2024.9%205.1%2033.9%2014c9%209%2014%2021.2%2014%2033.9s-5.1%2024.9-14%2033.9c-9%209-21.2%2014-33.9%2014s-24.9-5.1-33.9-14c-9-9-14-21.2-14-33.9s5.1-24.9%2014-33.9c9-9%2021.2-14%2033.9-14zM80.3%20270c0-26.5%2021.5-47.9%2047.9-47.9h63.9c26.5%200%2047.9%2021.5%2047.9%2047.9v16c0%2017.7-14.3%2031.9-31.9%2031.9H112.2c-17.7%200-31.9-14.3-31.9-31.9v-16zm191.7%200c0-26.5%2021.5-47.9%2047.9-47.9h63.9c26.5%200%2047.9%2021.5%2047.9%2047.9v16c0%2017.7-14.3%2031.9-31.9%2031.9h-95.8c-17.7%200-31.9-14.3-31.9-31.9v-16zm31.9-127.8c0-6.3%201.2-12.5%203.6-18.3c2.4-5.8%205.9-11.1%2010.4-15.6s9.7-8%2015.6-10.4s12-3.6%2018.3-3.6s12.5%201.2%2018.3%203.6c5.8%202.4%2011.1%205.9%2015.6%2010.4s8%209.7%2010.4%2015.6s3.6%2012%203.6%2018.3s-1.2%2012.5-3.6%2018.3c-2.4%205.8-5.9%2011.1-10.4%2015.6s-9.7%208-15.6%2010.4s-12%203.6-18.3%203.6s-12.5-1.2-18.3-3.6c-5.8-2.4-11.1-5.9-15.6-10.4s-8-9.7-10.4-15.6s-3.6-12-3.6-18.3z'/%3e%3c/svg%3e":"data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%20636%20512'%3e%3cpath%20d='M409.8%20484.2c0%206.7%205.6%2012.3%2012.3%2012.3h86c6.7%200%2012.3-5.6%2012.3-12.3s-5.6-12.3-12.3-12.3h-56.3l77.3-77.3c4.8-4.8%204.8-12.7%200-17.4s-12.7-4.8-17.4%200l-77.3%2077.3v-56.3c0-6.7-5.6-12.3-12.3-12.3s-12.3%205.6-12.3%2012.3v86zM207.3%2050.3c0-12.6%205-24.7%2013.9-33.6c8.9-8.9%2021-13.9%2033.6-13.9s24.7%205%2033.6%2013.9c8.9%208.9%2013.9%2021%2013.9%2033.6s-5%2024.7-13.9%2033.6c-8.9%208.9-21%2013.9-33.6%2013.9s-24.7-5-33.6-13.9c-8.9-8.9-13.9-21-13.9-33.6zm180%2084.8c15.8-13.8%2036.2-21.5%2057.2-21.5h102.8c48%200%2087%2039%2087%2087s-39%2087-87%2087h-70.1L248.7%20487.5c-15.8%2013.8-36.2%2021.5-57.2%2021.5H88.6c-48.1%200-87-39-87-87s39-87%2087-87h70.1L387.3%20135.2zm57.2%2025.9c-9.6%200-18.8%203.5-26%209.8L183.3%20376.7c-4.4%203.8-9.9%205.8-15.6%205.8H88.6c-21.8%200-39.5%2017.7-39.5%2039.5s17.7%2039.5%2039.5%2039.5h102.8c9.6%200%2018.8-3.5%2026-9.8L452.7%20246c4.4-3.8%209.9-5.8%2015.6-5.8h79.1c21.8%200%2039.5-17.7%2039.5-39.5s-17.7-39.5-39.5-39.5H444.5zm-189.8-31.6c23.4%200%2043.9%2012.7%2054.9%2031.6L191.5%20264.4v-71.7c0-34.9%2028.4-63.3%2063.3-63.3z'/%3e%3c/svg%3e";const l={iconPath:s,title:this.createChangeFloorMessage(o,a,r?.name??"")};n>this.minUpdateTimeInterval?this.showMapModal(l):this.animatedRoute=setTimeout((()=>{this.showMapModal(l)}),this.minUpdateTimeInterval-n)}}},i=document.createElement("img");i.src="data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2069%2072'%20height='72'%20width='69'%3e%3cg%20xmlns='http://www.w3.org/2000/svg'%20transform='matrix(-1%200%200%20-1%2069%2072)'%3e%3cpath%20d='M34.1699%2019.961L35.1326%2020.3959L36.0734%2019.9157L63.6569%205.83661L35.3531%2066.9132L5.66099%207.08131L34.1699%2019.961Z'%20fill='%239D55F9'%20stroke='white'%20stroke-width='4.39436'%20/%3e%3c/g%3e%3c/svg%3e";const r={aheadPathStyle:{color:"#757575",type:"Solid"},behindPathStyle:{color:"#9D55F9",type:"Solid"},polylineWidth:10,routeIcon:i};this.lzMap.startAnimateRoute(t,r,e),this.route=t,this.handlers.onStartRouteAnimation()}removeRoute(){this.lzMap&&(this.lzMap.removeRoute(),this.route=void 0,this.animatedRoute=void 0)}isAnimating(){return this.isAnimatingRoute}stopAnimatedRoute(){this.isAnimatingRoute&&(clearTimeout(this.animatedRoute),this.animatedRoute=void 0,this.isAnimatingRoute=!1,this.dismissChangeFloorAlert())}getCurrentRoute(){return this.route}dismissChangeFloorAlert(){this.isAnimatingRoute&&(clearTimeout(this.animatedRoute),this.animatedRoute=void 0,this.handlers.onDismissModal(),this.host.requestUpdate())}showMapModal(t){this.handlers.onShowMapModal(t),this.animatedRoute=setTimeout((()=>{this.lzMap?.resumeAnimateRoute(),this.dismissChangeFloorAlert()}),this.minUpdateTimeInterval)}createChangeFloorMessage(t,e,i){let r,n;if("es"==this.locale){r=t?"Sube":"Baja",n=e?"por el ascensor hasta ":"por las escaleras hasta ";n+=(i.toLowerCase().includes("nivel")||i.toLowerCase().includes("piso")?"el":"")+" "}else r=t?"Go up":"Go down",n=e?"using the elevator to the":"using the stairs to the";return`${r} ${n} ${i.toLowerCase()}`}}var Gt=Object.defineProperty,Ht=Object.getOwnPropertyDescriptor,Zt=(t,e,i,r)=>{for(var n,o=r>1?void 0:r?Ht(e,i):e,a=t.length-1;a>=0;a--)(n=t[a])&&(o=(r?n(e,i,o):n(o))||o);return r&&o&&Gt(e,i,o),o};let Wt=class extends st{constructor(){super(),this.mapReady=!1,this.routeAnimationHandlers={onRouteAnimationFinished:()=>{this.dispatchEvent(new CustomEvent("routeAnimationFinished",{bubbles:!0,composed:!0}))},onFloorChange:t=>{this.dispatchEvent(new CustomEvent("floorChange",{detail:t,bubbles:!0,composed:!0}))},onStartRouteAnimation:()=>{this.dispatchEvent(new CustomEvent("startRouteAnimation",{bubbles:!0,composed:!0}))},onShowMapModal:t=>{this.modalData=t},onDismissModal:()=>{this.modalData=void 0}},this.mapContainer=null,this.pendingUpdateMarkers=!1,this.pendingUpdateCamera=!1,this.routeAnimationController=new $t(this,this.routeAnimationHandlers),this.markerController=new qt(this)}async firstUpdated(){if(this.shadowRoot){const t=document.createElement("style");t.textContent=(await Promise.resolve().then((()=>Jt))).default,this.shadowRoot.appendChild(t)}}async updated(){if(!this.sdkData?.sdk)return;const{sdk:t,parentPlace:e,locale:i,generalConfig:r,currentFloor:n,markers:o,route:a,isRouteAnimating:s}=this.sdkData;if(!this.lzMap&&t&&e&&i&&this.shadowRoot&&r){this.routeAnimationController.setParentPlace(e),this.routeAnimationController.setLocale(i),this.mapContainer=this.shadowRoot.getElementById("map"),this.shadowRoot?.appendChild(this.mapContainer),this.config=r;const n={zoom:r.initialZoom||17,parentPlaceId:e?.lazarilloId,center:r.initialCenter||{lat:0,lng:0},minZoom:r.limitZoomOut||15,maxZoom:r.limitZoomIn||22,showCompass:!1,navigationPosition:"bottom-right",pitch:r.pitch||0,lang:i,maxBounds:r.pointsOfInterest||[],otherPotentialParentPlacesIds:r.potentialParentPlaces||[],onMapReady:()=>{this.mapReady=!0,this.markerController.setMapReady(!0),this.pendingUpdateCamera=!0,this.dispatchEvent(new CustomEvent("mapReady",{detail:{},bubbles:!0,composed:!0}))},onFloorChange:t=>{this.setCurrentMapFloor(t)}};this.lzMap=t.createMap(this.mapContainer,n),this.lzMap.setParentPlace(e,!1),this.routeAnimationController.setMap(this.lzMap),this.markerController.setMap(this.lzMap),this.markerController.setParentPlace(e)}n&&n.key!==this._currentMapFloor&&this.mapReady&&this.setCurrentMapFloor(n.key),o.some((t=>!this.markerController.getMarkersIds().includes(t.id)||o.length!==this.markerController.getMarkersIds().length))&&(this.mapReady?this.updateMarkers():this.pendingUpdateMarkers=!0),this.pendingUpdateMarkers&&this.mapReady&&this.updateMarkers(),this.pendingUpdateCamera&&this.sdkData?.origin&&(this._initializeCamera(),this.pendingUpdateCamera=!1);const l=this.routeAnimationController.getCurrentRoute();l&&l.id===a?.id||(l&&this.routeAnimationController.removeRoute(),a&&this.routeAnimationController.startRouteAnimation(a)),!this.routeAnimationController.isAnimating()&&s&&a&&this.routeAnimationController.startRouteAnimation(a)}updateMarkers(){const t=this.sdkData?.markers??[];this.markerController.updateMarkers(t),this.pendingUpdateMarkers=!1}_initializeCamera(){if(!this.lzMap||!this.mapReady||!this.sdkData)return;const{origin:t}=this.sdkData;this.lzMap?.updateCamera({bearing:this.config?.mapRotations?.[t?.lazarilloId??""]?.angle??0,animate:!1,pitch:this.config?.pitch??0})}setCurrentMapFloor(t){this._currentMapFloor!==t&&this.lzMap&&(this._currentMapFloor=t,this.lzMap?.updateFloor(t),this.routeAnimationController.setCurrentFloor(t),this.dispatchEvent(new CustomEvent("floorChange",{detail:t,bubbles:!0,composed:!0})))}render(){return q`<div id="map"></div>
82
+ <div id="modal" style="display: ${this.modalData?"flex":"none"}">
83
+ <div class="modal-content">
84
+ <img class="modal-icon" .src=${this.modalData?.iconPath}></img>
85
+ <p class="modal-text">${this.modalData?.title}</p>
86
+ </div>
87
+ </div>`}};Wt.styles=[a(':host{display:block;height:100%;width:100%}#map{width:100vw;height:100vh}.maplibregl-canvas{width:100%;height:100%}.maplibregl-ctrl-bottom-right .maplibregl-ctrl{float:right;margin:0 20px 50px 0}.maplibregl-ctrl{bottom:80px;right:40px;border:3px solid #000;padding:0;border-radius:100px;background:#fff;overflow:hidden;display:flex;flex-direction:column;width:70px;height:129px}.maplibregl-ctrl button{background-color:transparent;box-shadow:none;border-radius:0;margin:0;font-size:31px;font-weight:400;width:100%;height:100%;color:#000;transition:background-color .4s ease,color .4s ease}.maplibregl-ctrl button:hover{background-color:#000!important;color:#fff}.maplibregl-ctrl button.maplibregl-ctrl-zoom-in{border-bottom:3px solid #000}.maplibregl-ctrl-group .maplibregl-ctrl-icon{background:none!important;display:none!important}.maplibregl-ctrl-group button.maplibregl-ctrl-zoom-in:after{content:"+";display:block;font-size:32px;font-weight:600;line-height:1;text-align:center}.maplibregl-ctrl-group button.maplibregl-ctrl-zoom-out:after{content:"–";display:block;font-size:32px;font-weight:600;line-height:1;text-align:center}#modal{position:absolute;width:100%;height:100%;background:#0003;-webkit-backdrop-filter:blur(5px);backdrop-filter:blur(5px);display:flex;align-items:center;justify-content:center;justify-items:center;top:0;left:0;z-index:100}.modal-content{min-width:100px;min-height:100px;background-color:#fff;border:1px solid #000;border-radius:10px;padding:10px;width:fit-content;height:fit-content;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:10px}.modal-text{font-family:Poppins,sans-serif;font-size:20pt;font-weight:500;color:#000}.modal-icon{max-height:100px;align-self:center}.maplibregl-marker:has(.popup){z-index:10}.maplibregl-marker:not(:has(.popup)){z-index:5}')],Zt([function({context:t,subscribe:e}){return(i,r)=>{"object"==typeof r?r.addInitializer((function(){new vt(this,{context:t,callback:t=>{i.set.call(this,t)},subscribe:e})})):i.constructor.addInitializer((i=>{new vt(i,{context:t,callback:t=>{i[r]=t},subscribe:e})}))}}({context:Ct,subscribe:!0})],Wt.prototype,"sdkData",2),Wt=Zt([ct("custom-map")],Wt);const Xt=Object.freeze(Object.defineProperty({__proto__:null,get CustomMap(){return Wt}},Symbol.toStringTag,{value:"Module"})),Jt=Object.freeze(Object.defineProperty({__proto__:null,default:".maplibregl-map{font:12px/20px Helvetica Neue,Arial,Helvetica,sans-serif;overflow:hidden;position:relative;-webkit-tap-highlight-color:rgb(0 0 0/0)}.maplibregl-canvas{left:0;position:absolute;top:0}.maplibregl-map:fullscreen{height:100%;width:100%}.maplibregl-ctrl-group button.maplibregl-ctrl-compass{touch-action:none}.maplibregl-canvas-container.maplibregl-interactive,.maplibregl-ctrl-group button.maplibregl-ctrl-compass{cursor:grab;-webkit-user-select:none;-moz-user-select:none;user-select:none}.maplibregl-canvas-container.maplibregl-interactive.maplibregl-track-pointer{cursor:pointer}.maplibregl-canvas-container.maplibregl-interactive:active,.maplibregl-ctrl-group button.maplibregl-ctrl-compass:active{cursor:grabbing}.maplibregl-canvas-container.maplibregl-touch-zoom-rotate,.maplibregl-canvas-container.maplibregl-touch-zoom-rotate .maplibregl-canvas{touch-action:pan-x pan-y}.maplibregl-canvas-container.maplibregl-touch-drag-pan,.maplibregl-canvas-container.maplibregl-touch-drag-pan .maplibregl-canvas{touch-action:pinch-zoom}.maplibregl-canvas-container.maplibregl-touch-zoom-rotate.maplibregl-touch-drag-pan,.maplibregl-canvas-container.maplibregl-touch-zoom-rotate.maplibregl-touch-drag-pan .maplibregl-canvas{touch-action:none}.maplibregl-canvas-container.maplibregl-touch-drag-pan.maplibregl-cooperative-gestures,.maplibregl-canvas-container.maplibregl-touch-drag-pan.maplibregl-cooperative-gestures .maplibregl-canvas{touch-action:pan-x pan-y}.maplibregl-ctrl-bottom-left,.maplibregl-ctrl-bottom-right,.maplibregl-ctrl-top-left,.maplibregl-ctrl-top-right{pointer-events:none;position:absolute;z-index:2}.maplibregl-ctrl-top-left{left:0;top:0}.maplibregl-ctrl-top-right{right:0;top:0}.maplibregl-ctrl-bottom-left{bottom:0;left:0}.maplibregl-ctrl-bottom-right{bottom:0;right:0}.maplibregl-ctrl{clear:both;pointer-events:auto;transform:translate(0)}.maplibregl-ctrl-top-left .maplibregl-ctrl{float:left;margin:10px 0 0 10px}.maplibregl-ctrl-top-right .maplibregl-ctrl{float:right;margin:10px 10px 0 0}.maplibregl-ctrl-bottom-left .maplibregl-ctrl{float:left;margin:0 0 10px 10px}.maplibregl-ctrl-bottom-right .maplibregl-ctrl{float:right;margin:0 10px 10px 0}.maplibregl-ctrl-group{background:#fff;border-radius:4px}.maplibregl-ctrl-group:not(:empty){box-shadow:0 0 0 2px #0000001a}@media (forced-colors:active){.maplibregl-ctrl-group:not(:empty){box-shadow:0 0 0 2px ButtonText}}.maplibregl-ctrl-group button{background-color:transparent;border:0;box-sizing:border-box;cursor:pointer;display:block;height:29px;outline:none;padding:0;width:29px}.maplibregl-ctrl-group button+button{border-top:1px solid #ddd}.maplibregl-ctrl button .maplibregl-ctrl-icon{background-position:50%;background-repeat:no-repeat;display:block;height:100%;width:100%}@media (forced-colors:active){.maplibregl-ctrl-icon{background-color:transparent}.maplibregl-ctrl-group button+button{border-top:1px solid ButtonText}}.maplibregl-ctrl button::-moz-focus-inner{border:0;padding:0}.maplibregl-ctrl-attrib-button:focus,.maplibregl-ctrl-group button:focus{box-shadow:0 0 2px 2px #0096ff}.maplibregl-ctrl button:disabled{cursor:not-allowed}.maplibregl-ctrl button:disabled .maplibregl-ctrl-icon{opacity:.25}.maplibregl-ctrl button:not(:disabled):hover{background-color:#0000000d}.maplibregl-ctrl-group button:focus:focus-visible{box-shadow:0 0 2px 2px #0096ff}.maplibregl-ctrl-group button:focus:not(:focus-visible){box-shadow:none}.maplibregl-ctrl-group button:focus:first-child{border-radius:4px 4px 0 0}.maplibregl-ctrl-group button:focus:last-child{border-radius:0 0 4px 4px}.maplibregl-ctrl-group button:focus:only-child{border-radius:inherit}.maplibregl-ctrl button.maplibregl-ctrl-zoom-out .maplibregl-ctrl-icon{background-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' fill='%23333' viewBox='0 0 29 29'%3E%3Cpath d='M10 13c-.75 0-1.5.75-1.5 1.5S9.25 16 10 16h9c.75 0 1.5-.75 1.5-1.5S19.75 13 19 13z'/%3E%3C/svg%3E\")}.maplibregl-ctrl button.maplibregl-ctrl-zoom-in .maplibregl-ctrl-icon{background-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' fill='%23333' viewBox='0 0 29 29'%3E%3Cpath d='M14.5 8.5c-.75 0-1.5.75-1.5 1.5v3h-3c-.75 0-1.5.75-1.5 1.5S9.25 16 10 16h3v3c0 .75.75 1.5 1.5 1.5S16 19.75 16 19v-3h3c.75 0 1.5-.75 1.5-1.5S19.75 13 19 13h-3v-3c0-.75-.75-1.5-1.5-1.5'/%3E%3C/svg%3E\")}@media (forced-colors:active){.maplibregl-ctrl button.maplibregl-ctrl-zoom-out .maplibregl-ctrl-icon{background-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' fill='%23fff' viewBox='0 0 29 29'%3E%3Cpath d='M10 13c-.75 0-1.5.75-1.5 1.5S9.25 16 10 16h9c.75 0 1.5-.75 1.5-1.5S19.75 13 19 13z'/%3E%3C/svg%3E\")}.maplibregl-ctrl button.maplibregl-ctrl-zoom-in .maplibregl-ctrl-icon{background-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' fill='%23fff' viewBox='0 0 29 29'%3E%3Cpath d='M14.5 8.5c-.75 0-1.5.75-1.5 1.5v3h-3c-.75 0-1.5.75-1.5 1.5S9.25 16 10 16h3v3c0 .75.75 1.5 1.5 1.5S16 19.75 16 19v-3h3c.75 0 1.5-.75 1.5-1.5S19.75 13 19 13h-3v-3c0-.75-.75-1.5-1.5-1.5'/%3E%3C/svg%3E\")}}@media (forced-colors:active) and (prefers-color-scheme:light){.maplibregl-ctrl button.maplibregl-ctrl-zoom-out .maplibregl-ctrl-icon{background-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' viewBox='0 0 29 29'%3E%3Cpath d='M10 13c-.75 0-1.5.75-1.5 1.5S9.25 16 10 16h9c.75 0 1.5-.75 1.5-1.5S19.75 13 19 13z'/%3E%3C/svg%3E\")}.maplibregl-ctrl button.maplibregl-ctrl-zoom-in .maplibregl-ctrl-icon{background-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' viewBox='0 0 29 29'%3E%3Cpath d='M14.5 8.5c-.75 0-1.5.75-1.5 1.5v3h-3c-.75 0-1.5.75-1.5 1.5S9.25 16 10 16h3v3c0 .75.75 1.5 1.5 1.5S16 19.75 16 19v-3h3c.75 0 1.5-.75 1.5-1.5S19.75 13 19 13h-3v-3c0-.75-.75-1.5-1.5-1.5'/%3E%3C/svg%3E\")}}.maplibregl-ctrl button.maplibregl-ctrl-fullscreen .maplibregl-ctrl-icon{background-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' fill='%23333' viewBox='0 0 29 29'%3E%3Cpath d='M24 16v5.5c0 1.75-.75 2.5-2.5 2.5H16v-1l3-1.5-4-5.5 1-1 5.5 4 1.5-3zM6 16l1.5 3 5.5-4 1 1-4 5.5 3 1.5v1H7.5C5.75 24 5 23.25 5 21.5V16zm7-11v1l-3 1.5 4 5.5-1 1-5.5-4L6 13H5V7.5C5 5.75 5.75 5 7.5 5zm11 2.5c0-1.75-.75-2.5-2.5-2.5H16v1l3 1.5-4 5.5 1 1 5.5-4 1.5 3h1z'/%3E%3C/svg%3E\")}.maplibregl-ctrl button.maplibregl-ctrl-shrink .maplibregl-ctrl-icon{background-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' viewBox='0 0 29 29'%3E%3Cpath d='M18.5 16c-1.75 0-2.5.75-2.5 2.5V24h1l1.5-3 5.5 4 1-1-4-5.5 3-1.5v-1zM13 18.5c0-1.75-.75-2.5-2.5-2.5H5v1l3 1.5L4 24l1 1 5.5-4 1.5 3h1zm3-8c0 1.75.75 2.5 2.5 2.5H24v-1l-3-1.5L25 5l-1-1-5.5 4L17 5h-1zM10.5 13c1.75 0 2.5-.75 2.5-2.5V5h-1l-1.5 3L5 4 4 5l4 5.5L5 12v1z'/%3E%3C/svg%3E\")}@media (forced-colors:active){.maplibregl-ctrl button.maplibregl-ctrl-fullscreen .maplibregl-ctrl-icon{background-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' fill='%23fff' viewBox='0 0 29 29'%3E%3Cpath d='M24 16v5.5c0 1.75-.75 2.5-2.5 2.5H16v-1l3-1.5-4-5.5 1-1 5.5 4 1.5-3zM6 16l1.5 3 5.5-4 1 1-4 5.5 3 1.5v1H7.5C5.75 24 5 23.25 5 21.5V16zm7-11v1l-3 1.5 4 5.5-1 1-5.5-4L6 13H5V7.5C5 5.75 5.75 5 7.5 5zm11 2.5c0-1.75-.75-2.5-2.5-2.5H16v1l3 1.5-4 5.5 1 1 5.5-4 1.5 3h1z'/%3E%3C/svg%3E\")}.maplibregl-ctrl button.maplibregl-ctrl-shrink .maplibregl-ctrl-icon{background-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' fill='%23fff' viewBox='0 0 29 29'%3E%3Cpath d='M18.5 16c-1.75 0-2.5.75-2.5 2.5V24h1l1.5-3 5.5 4 1-1-4-5.5 3-1.5v-1zM13 18.5c0-1.75-.75-2.5-2.5-2.5H5v1l3 1.5L4 24l1 1 5.5-4 1.5 3h1zm3-8c0 1.75.75 2.5 2.5 2.5H24v-1l-3-1.5L25 5l-1-1-5.5 4L17 5h-1zM10.5 13c1.75 0 2.5-.75 2.5-2.5V5h-1l-1.5 3L5 4 4 5l4 5.5L5 12v1z'/%3E%3C/svg%3E\")}}@media (forced-colors:active) and (prefers-color-scheme:light){.maplibregl-ctrl button.maplibregl-ctrl-fullscreen .maplibregl-ctrl-icon{background-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' viewBox='0 0 29 29'%3E%3Cpath d='M24 16v5.5c0 1.75-.75 2.5-2.5 2.5H16v-1l3-1.5-4-5.5 1-1 5.5 4 1.5-3zM6 16l1.5 3 5.5-4 1 1-4 5.5 3 1.5v1H7.5C5.75 24 5 23.25 5 21.5V16zm7-11v1l-3 1.5 4 5.5-1 1-5.5-4L6 13H5V7.5C5 5.75 5.75 5 7.5 5zm11 2.5c0-1.75-.75-2.5-2.5-2.5H16v1l3 1.5-4 5.5 1 1 5.5-4 1.5 3h1z'/%3E%3C/svg%3E\")}.maplibregl-ctrl button.maplibregl-ctrl-shrink .maplibregl-ctrl-icon{background-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' viewBox='0 0 29 29'%3E%3Cpath d='M18.5 16c-1.75 0-2.5.75-2.5 2.5V24h1l1.5-3 5.5 4 1-1-4-5.5 3-1.5v-1zM13 18.5c0-1.75-.75-2.5-2.5-2.5H5v1l3 1.5L4 24l1 1 5.5-4 1.5 3h1zm3-8c0 1.75.75 2.5 2.5 2.5H24v-1l-3-1.5L25 5l-1-1-5.5 4L17 5h-1zM10.5 13c1.75 0 2.5-.75 2.5-2.5V5h-1l-1.5 3L5 4 4 5l4 5.5L5 12v1z'/%3E%3C/svg%3E\")}}.maplibregl-ctrl button.maplibregl-ctrl-compass .maplibregl-ctrl-icon{background-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' fill='%23333' viewBox='0 0 29 29'%3E%3Cpath d='m10.5 14 4-8 4 8z'/%3E%3Cpath fill='%23ccc' d='m10.5 16 4 8 4-8z'/%3E%3C/svg%3E\")}@media (forced-colors:active){.maplibregl-ctrl button.maplibregl-ctrl-compass .maplibregl-ctrl-icon{background-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' fill='%23fff' viewBox='0 0 29 29'%3E%3Cpath d='m10.5 14 4-8 4 8z'/%3E%3Cpath fill='%23ccc' d='m10.5 16 4 8 4-8z'/%3E%3C/svg%3E\")}}@media (forced-colors:active) and (prefers-color-scheme:light){.maplibregl-ctrl button.maplibregl-ctrl-compass .maplibregl-ctrl-icon{background-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' viewBox='0 0 29 29'%3E%3Cpath d='m10.5 14 4-8 4 8z'/%3E%3Cpath fill='%23ccc' d='m10.5 16 4 8 4-8z'/%3E%3C/svg%3E\")}}.maplibregl-ctrl button.maplibregl-ctrl-terrain .maplibregl-ctrl-icon{background-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='22' height='22' fill='%23333' viewBox='0 0 22 22'%3E%3Cpath d='m1.754 13.406 4.453-4.851 3.09 3.09 3.281 3.277.969-.969-3.309-3.312 3.844-4.121 6.148 6.886h1.082v-.855l-7.207-8.07-4.84 5.187L6.169 6.57l-5.48 5.965v.871ZM.688 16.844h20.625v1.375H.688Zm0 0'/%3E%3C/svg%3E\")}.maplibregl-ctrl button.maplibregl-ctrl-terrain-enabled .maplibregl-ctrl-icon{background-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='22' height='22' fill='%2333b5e5' viewBox='0 0 22 22'%3E%3Cpath d='m1.754 13.406 4.453-4.851 3.09 3.09 3.281 3.277.969-.969-3.309-3.312 3.844-4.121 6.148 6.886h1.082v-.855l-7.207-8.07-4.84 5.187L6.169 6.57l-5.48 5.965v.871ZM.688 16.844h20.625v1.375H.688Zm0 0'/%3E%3C/svg%3E\")}.maplibregl-ctrl button.maplibregl-ctrl-geolocate .maplibregl-ctrl-icon{background-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' fill='%23333' viewBox='0 0 20 20'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1m0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7'/%3E%3Ccircle cx='10' cy='10' r='2'/%3E%3C/svg%3E\")}.maplibregl-ctrl button.maplibregl-ctrl-geolocate:disabled .maplibregl-ctrl-icon{background-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' fill='%23aaa' viewBox='0 0 20 20'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1m0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7'/%3E%3Ccircle cx='10' cy='10' r='2'/%3E%3Cpath fill='red' d='m14 5 1 1-9 9-1-1z'/%3E%3C/svg%3E\")}.maplibregl-ctrl button.maplibregl-ctrl-geolocate.maplibregl-ctrl-geolocate-active .maplibregl-ctrl-icon{background-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' fill='%2333b5e5' viewBox='0 0 20 20'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1m0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7'/%3E%3Ccircle cx='10' cy='10' r='2'/%3E%3C/svg%3E\")}.maplibregl-ctrl button.maplibregl-ctrl-geolocate.maplibregl-ctrl-geolocate-active-error .maplibregl-ctrl-icon{background-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' fill='%23e58978' viewBox='0 0 20 20'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1m0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7'/%3E%3Ccircle cx='10' cy='10' r='2'/%3E%3C/svg%3E\")}.maplibregl-ctrl button.maplibregl-ctrl-geolocate.maplibregl-ctrl-geolocate-background .maplibregl-ctrl-icon{background-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' fill='%2333b5e5' viewBox='0 0 20 20'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1m0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7'/%3E%3C/svg%3E\")}.maplibregl-ctrl button.maplibregl-ctrl-geolocate.maplibregl-ctrl-geolocate-background-error .maplibregl-ctrl-icon{background-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' fill='%23e54e33' viewBox='0 0 20 20'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1m0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7'/%3E%3C/svg%3E\")}.maplibregl-ctrl button.maplibregl-ctrl-geolocate.maplibregl-ctrl-geolocate-waiting .maplibregl-ctrl-icon{animation:maplibregl-spin 2s linear infinite}@media (forced-colors:active){.maplibregl-ctrl button.maplibregl-ctrl-geolocate .maplibregl-ctrl-icon{background-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' fill='%23fff' viewBox='0 0 20 20'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1m0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7'/%3E%3Ccircle cx='10' cy='10' r='2'/%3E%3C/svg%3E\")}.maplibregl-ctrl button.maplibregl-ctrl-geolocate:disabled .maplibregl-ctrl-icon{background-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' fill='%23999' viewBox='0 0 20 20'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1m0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7'/%3E%3Ccircle cx='10' cy='10' r='2'/%3E%3Cpath fill='red' d='m14 5 1 1-9 9-1-1z'/%3E%3C/svg%3E\")}.maplibregl-ctrl button.maplibregl-ctrl-geolocate.maplibregl-ctrl-geolocate-active .maplibregl-ctrl-icon{background-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' fill='%2333b5e5' viewBox='0 0 20 20'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1m0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7'/%3E%3Ccircle cx='10' cy='10' r='2'/%3E%3C/svg%3E\")}.maplibregl-ctrl button.maplibregl-ctrl-geolocate.maplibregl-ctrl-geolocate-active-error .maplibregl-ctrl-icon{background-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' fill='%23e58978' viewBox='0 0 20 20'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1m0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7'/%3E%3Ccircle cx='10' cy='10' r='2'/%3E%3C/svg%3E\")}.maplibregl-ctrl button.maplibregl-ctrl-geolocate.maplibregl-ctrl-geolocate-background .maplibregl-ctrl-icon{background-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' fill='%2333b5e5' viewBox='0 0 20 20'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1m0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7'/%3E%3C/svg%3E\")}.maplibregl-ctrl button.maplibregl-ctrl-geolocate.maplibregl-ctrl-geolocate-background-error .maplibregl-ctrl-icon{background-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' fill='%23e54e33' viewBox='0 0 20 20'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1m0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7'/%3E%3C/svg%3E\")}}@media (forced-colors:active) and (prefers-color-scheme:light){.maplibregl-ctrl button.maplibregl-ctrl-geolocate .maplibregl-ctrl-icon{background-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' viewBox='0 0 20 20'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1m0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7'/%3E%3Ccircle cx='10' cy='10' r='2'/%3E%3C/svg%3E\")}.maplibregl-ctrl button.maplibregl-ctrl-geolocate:disabled .maplibregl-ctrl-icon{background-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' fill='%23666' viewBox='0 0 20 20'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1m0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7'/%3E%3Ccircle cx='10' cy='10' r='2'/%3E%3Cpath fill='red' d='m14 5 1 1-9 9-1-1z'/%3E%3C/svg%3E\")}}@keyframes maplibregl-spin{0%{transform:rotate(0)}to{transform:rotate(1turn)}}a.maplibregl-ctrl-logo{background-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='88' height='23' fill='none'%3E%3Cpath fill='%23000' fill-opacity='.4' fill-rule='evenodd' d='M17.408 16.796h-1.827l2.501-12.095h.198l3.324 6.533.988 2.19.988-2.19 3.258-6.533h.181l2.6 12.095h-1.81l-1.218-5.644-.362-1.71-.658 1.71-2.929 5.644h-.098l-2.914-5.644-.757-1.71-.345 1.71zm1.958-3.42-.726 3.663a1.255 1.255 0 0 1-1.232 1.011h-1.827a1.255 1.255 0 0 1-1.229-1.509l2.501-12.095a1.255 1.255 0 0 1 1.23-1.001h.197a1.25 1.25 0 0 1 1.12.685l3.19 6.273 3.125-6.263a1.25 1.25 0 0 1 1.123-.695h.181a1.255 1.255 0 0 1 1.227.991l1.443 6.71a5 5 0 0 1 .314-.787l.009-.016a4.6 4.6 0 0 1 1.777-1.887c.782-.46 1.668-.667 2.611-.667a4.6 4.6 0 0 1 1.7.32l.306.134c.21-.16.474-.256.759-.256h1.694a1.255 1.255 0 0 1 1.212.925 1.255 1.255 0 0 1 1.212-.925h1.711c.284 0 .545.094.755.252.613-.3 1.312-.45 2.075-.45 1.356 0 2.557.445 3.482 1.4q.47.48.763 1.064V4.701a1.255 1.255 0 0 1 1.255-1.255h1.86A1.255 1.255 0 0 1 54.44 4.7v9.194h2.217c.19 0 .37.043.532.118v-4.77c0-.356.147-.678.385-.906a2.42 2.42 0 0 1-.682-1.71c0-.665.267-1.253.735-1.7a2.45 2.45 0 0 1 1.722-.674 2.43 2.43 0 0 1 1.705.675q.318.302.504.683V4.7a1.255 1.255 0 0 1 1.255-1.255h1.744A1.255 1.255 0 0 1 65.812 4.7v3.335a4.8 4.8 0 0 1 1.526-.246c.938 0 1.817.214 2.59.69a4.47 4.47 0 0 1 1.67 1.743v-.98a1.255 1.255 0 0 1 1.256-1.256h1.777c.233 0 .451.064.639.174a3.4 3.4 0 0 1 1.567-.372c.346 0 .861.02 1.285.232a1.25 1.25 0 0 1 .689 1.004 4.7 4.7 0 0 1 .853-.588c.795-.44 1.675-.647 2.61-.647 1.385 0 2.65.39 3.525 1.396.836.938 1.168 2.173 1.168 3.528q-.001.515-.056 1.051a1.255 1.255 0 0 1-.947 1.09l.408.952a1.255 1.255 0 0 1-.477 1.552c-.418.268-.92.463-1.458.612-.613.171-1.304.244-2.049.244-1.06 0-2.043-.207-2.886-.698l-.015-.008c-.798-.48-1.419-1.135-1.818-1.963l-.004-.008a5.8 5.8 0 0 1-.548-2.512q0-.429.053-.843a1.3 1.3 0 0 1-.333-.086l-.166-.004c-.223 0-.426.062-.643.228-.03.024-.142.139-.142.59v3.883a1.255 1.255 0 0 1-1.256 1.256h-1.777a1.255 1.255 0 0 1-1.256-1.256V15.69l-.032.057a4.8 4.8 0 0 1-1.86 1.833 5.04 5.04 0 0 1-2.484.634 4.5 4.5 0 0 1-1.935-.424 1.25 1.25 0 0 1-.764.258h-1.71a1.255 1.255 0 0 1-1.256-1.255V7.687a2.4 2.4 0 0 1-.428.625c.253.23.412.561.412.93v7.553a1.255 1.255 0 0 1-1.256 1.255h-1.843a1.25 1.25 0 0 1-.894-.373c-.228.23-.544.373-.894.373H51.32a1.255 1.255 0 0 1-1.256-1.255v-1.251l-.061.117a4.7 4.7 0 0 1-1.782 1.884 4.77 4.77 0 0 1-2.485.67 5.6 5.6 0 0 1-1.485-.188l.009 2.764a1.255 1.255 0 0 1-1.255 1.259h-1.729a1.255 1.255 0 0 1-1.255-1.255v-3.537a1.255 1.255 0 0 1-1.167.793h-1.679a1.25 1.25 0 0 1-.77-.263 4.5 4.5 0 0 1-1.945.429c-.885 0-1.724-.21-2.495-.632l-.017-.01a5 5 0 0 1-1.081-.836 1.255 1.255 0 0 1-1.254 1.312h-1.81a1.255 1.255 0 0 1-1.228-.99l-.782-3.625-2.044 3.939a1.25 1.25 0 0 1-1.115.676h-.098a1.25 1.25 0 0 1-1.116-.68l-2.061-3.994zM35.92 16.63l.207-.114.223-.15q.493-.356.735-.785l.061-.118.033 1.332h1.678V9.242h-1.694l-.033 1.267q-.133-.329-.526-.658l-.032-.028a3.2 3.2 0 0 0-.668-.428l-.27-.12a3.3 3.3 0 0 0-1.235-.23q-1.136-.001-1.974.493a3.36 3.36 0 0 0-1.3 1.382q-.445.89-.444 2.074 0 1.2.51 2.107a3.8 3.8 0 0 0 1.382 1.381 3.9 3.9 0 0 0 1.893.477q.795 0 1.455-.33zm-2.789-5.38q-.576.675-.575 1.762 0 1.102.559 1.794.576.675 1.645.675a2.25 2.25 0 0 0 .934-.19 2.2 2.2 0 0 0 .468-.29l.178-.161a2.2 2.2 0 0 0 .397-.561q.244-.5.244-1.15v-.115q0-.708-.296-1.267l-.043-.077a2.2 2.2 0 0 0-.633-.709l-.13-.086-.047-.028a2.1 2.1 0 0 0-1.073-.285q-1.052 0-1.629.692zm2.316 2.706c.163-.17.28-.407.28-.83v-.114c0-.292-.06-.508-.15-.68a.96.96 0 0 0-.353-.389.85.85 0 0 0-.464-.127c-.4 0-.56.114-.664.239l-.01.012c-.148.174-.275.45-.275.945 0 .506.122.801.27.99.097.11.266.224.68.224.303 0 .504-.09.687-.269zm7.545 1.705a2.6 2.6 0 0 0 .331.423q.319.33.755.548l.173.074q.65.255 1.49.255 1.02 0 1.844-.493a3.45 3.45 0 0 0 1.316-1.4q.493-.904.493-2.089 0-1.909-.988-2.913-.988-1.02-2.584-1.02-.898 0-1.575.347a3 3 0 0 0-.415.262l-.199.166a3.4 3.4 0 0 0-.64.82V9.242h-1.712v11.553h1.729l-.017-5.134zm.53-1.138q.206.29.48.5l.155.11.053.034q.51.296 1.119.297 1.07 0 1.645-.675.577-.69.576-1.762 0-1.119-.576-1.777-.558-.675-1.645-.675-.435 0-.835.16a2 2 0 0 0-.284.136 2 2 0 0 0-.363.254 2.2 2.2 0 0 0-.46.569l-.082.162a2.6 2.6 0 0 0-.213 1.072v.115q0 .707.296 1.267l.135.211zm.964-.818a1.1 1.1 0 0 0 .367.385.94.94 0 0 0 .476.118c.423 0 .59-.117.687-.23.159-.194.28-.478.28-.95 0-.53-.133-.8-.266-.952l-.021-.025c-.078-.094-.231-.221-.68-.221a1 1 0 0 0-.503.135l-.012.007a.86.86 0 0 0-.335.343c-.073.133-.132.324-.132.614v.115a1.4 1.4 0 0 0 .14.66zm15.7-6.222q.347-.346.346-.856a1.05 1.05 0 0 0-.345-.79 1.18 1.18 0 0 0-.84-.329q-.51 0-.855.33a1.05 1.05 0 0 0-.346.79q0 .51.346.855.345.346.856.346.51 0 .839-.346zm4.337 9.314.033-1.332q.191.403.59.747l.098.081a4 4 0 0 0 .316.224l.223.122a3.2 3.2 0 0 0 1.44.322 3.8 3.8 0 0 0 1.875-.477 3.5 3.5 0 0 0 1.382-1.366q.527-.89.526-2.09 0-1.184-.444-2.073a3.24 3.24 0 0 0-1.283-1.399q-.823-.51-1.942-.51a3.5 3.5 0 0 0-1.527.344l-.086.043-.165.09a3 3 0 0 0-.33.214q-.432.315-.656.707a2 2 0 0 0-.099.198l.082-1.283V4.701h-1.744v12.095zm.473-2.509a2.5 2.5 0 0 0 .566.7q.117.098.245.18l.144.08a2.1 2.1 0 0 0 .975.232q1.07 0 1.645-.675.576-.69.576-1.778 0-1.102-.576-1.777-.56-.691-1.645-.692a2.2 2.2 0 0 0-1.015.235q-.22.113-.415.282l-.15.142a2.1 2.1 0 0 0-.42.594q-.223.479-.223 1.1v.115q0 .705.293 1.26zm2.616-.293c.157-.191.28-.479.28-.967 0-.51-.13-.79-.276-.961l-.021-.026c-.082-.1-.232-.225-.67-.225a.87.87 0 0 0-.681.279l-.012.011c-.154.155-.274.38-.274.807v.115c0 .285.057.499.144.669a1.1 1.1 0 0 0 .367.405c.137.082.28.123.455.123.423 0 .59-.118.686-.23zm8.266-3.013q.345-.13.724-.14l.069-.002q.493 0 .642.099l.247-1.794q-.196-.099-.717-.099a2.3 2.3 0 0 0-.545.063 2 2 0 0 0-.411.148 2.2 2.2 0 0 0-.4.249 2.5 2.5 0 0 0-.485.499 2.7 2.7 0 0 0-.32.581l-.05.137v-1.48h-1.778v7.553h1.777v-3.884q0-.546.159-.943a1.5 1.5 0 0 1 .466-.636 2.5 2.5 0 0 1 .399-.253 2 2 0 0 1 .224-.099zm9.784 2.656.05-.922q0-1.743-.856-2.698-.838-.97-2.584-.97-1.119-.001-2.007.493a3.46 3.46 0 0 0-1.4 1.382q-.493.906-.493 2.106 0 1.07.428 1.975.428.89 1.332 1.432.906.526 2.255.526.973 0 1.668-.185l.044-.012.135-.04q.613-.184.984-.421l-.542-1.267q-.3.162-.642.274l-.297.087q-.51.131-1.3.131-.954 0-1.497-.444a1.6 1.6 0 0 1-.192-.193q-.366-.44-.512-1.234l-.004-.021zm-5.427-1.256-.003.022h3.752v-.138q-.011-.727-.288-1.118a1 1 0 0 0-.156-.176q-.46-.428-1.316-.428-.986 0-1.494.604-.379.45-.494 1.234zm-27.053 2.77V4.7h-1.86v12.095h5.333V15.15zm7.103-5.908v7.553h-1.843V9.242h1.843z'/%3E%3Cpath fill='%23fff' d='m19.63 11.151-.757-1.71-.345 1.71-1.12 5.644h-1.827L18.083 4.7h.197l3.325 6.533.988 2.19.988-2.19L26.839 4.7h.181l2.6 12.095h-1.81l-1.218-5.644-.362-1.71-.658 1.71-2.93 5.644h-.098l-2.913-5.644zm14.836 5.81q-1.02 0-1.893-.478a3.8 3.8 0 0 1-1.381-1.382q-.51-.906-.51-2.106 0-1.185.444-2.074a3.36 3.36 0 0 1 1.3-1.382q.839-.494 1.974-.494a3.3 3.3 0 0 1 1.234.231 3.3 3.3 0 0 1 .97.575q.396.33.527.659l.033-1.267h1.694v7.553H37.18l-.033-1.332q-.279.593-1.02 1.053a3.17 3.17 0 0 1-1.662.444zm.296-1.482q.938 0 1.58-.642.642-.66.642-1.711v-.115q0-.708-.296-1.267a2.2 2.2 0 0 0-.807-.872 2.1 2.1 0 0 0-1.119-.313q-1.053 0-1.629.692-.575.675-.575 1.76 0 1.103.559 1.795.577.675 1.645.675zm6.521-6.237h1.711v1.4q.906-1.597 2.83-1.597 1.596 0 2.584 1.02.988 1.005.988 2.914 0 1.185-.493 2.09a3.46 3.46 0 0 1-1.316 1.399 3.5 3.5 0 0 1-1.844.493q-.954 0-1.662-.329a2.67 2.67 0 0 1-1.086-.97l.017 5.134h-1.728zm4.048 6.22q1.07 0 1.645-.674.577-.69.576-1.762 0-1.119-.576-1.777-.558-.675-1.645-.675-.592 0-1.12.296-.51.28-.822.823-.296.527-.296 1.234v.115q0 .708.296 1.267.313.543.823.855.51.296 1.119.297z'/%3E%3Cpath fill='%23e1e3e9' d='M51.325 4.7h1.86v10.45h3.473v1.646h-5.333zm7.12 4.542h1.843v7.553h-1.843zm.905-1.415a1.16 1.16 0 0 1-.856-.346 1.17 1.17 0 0 1-.346-.856 1.05 1.05 0 0 1 .346-.79q.346-.329.856-.329.494 0 .839.33a1.05 1.05 0 0 1 .345.79 1.16 1.16 0 0 1-.345.855q-.33.346-.84.346zm7.875 9.133a3.17 3.17 0 0 1-1.662-.444q-.723-.46-1.004-1.053l-.033 1.332h-1.71V4.701h1.743v4.657l-.082 1.283q.279-.658 1.086-1.119a3.5 3.5 0 0 1 1.778-.477q1.119 0 1.942.51a3.24 3.24 0 0 1 1.283 1.4q.445.888.444 2.072 0 1.201-.526 2.09a3.5 3.5 0 0 1-1.382 1.366 3.8 3.8 0 0 1-1.876.477zm-.296-1.481q1.069 0 1.645-.675.577-.69.577-1.778 0-1.102-.577-1.776-.56-.691-1.645-.692a2.12 2.12 0 0 0-1.58.659q-.642.641-.642 1.694v.115q0 .71.296 1.267a2.4 2.4 0 0 0 .807.872 2.1 2.1 0 0 0 1.119.313zm5.927-6.237h1.777v1.481q.263-.757.856-1.217a2.14 2.14 0 0 1 1.349-.46q.527 0 .724.098l-.247 1.794q-.149-.099-.642-.099-.774 0-1.416.494-.626.493-.626 1.58v3.883h-1.777V9.242zm9.534 7.718q-1.35 0-2.255-.526-.904-.543-1.332-1.432a4.6 4.6 0 0 1-.428-1.975q0-1.2.493-2.106a3.46 3.46 0 0 1 1.4-1.382q.889-.495 2.007-.494 1.744 0 2.584.97.855.956.856 2.7 0 .444-.05.92h-5.43q.18 1.005.708 1.45.542.443 1.497.443.79 0 1.3-.131a4 4 0 0 0 .938-.362l.542 1.267q-.411.263-1.119.46-.708.198-1.711.197zm1.596-4.558q.016-1.02-.444-1.432-.46-.428-1.316-.428-1.728 0-1.991 1.86z'/%3E%3Cpath d='M5.074 15.948a.484.657 0 0 0-.486.659v1.84a.484.657 0 0 0 .486.659h4.101a.484.657 0 0 0 .486-.659v-1.84a.484.657 0 0 0-.486-.659zm3.56 1.16H5.617v.838h3.017z' style='fill:%23fff;fill-rule:evenodd;stroke-width:1.03600001'/%3E%3Cg style='stroke-width:1.12603545'%3E%3Cpath d='M-9.408-1.416c-3.833-.025-7.056 2.912-7.08 6.615-.02 3.08 1.653 4.832 3.107 6.268.903.892 1.721 1.74 2.32 2.902l-.525-.004c-.543-.003-.992.304-1.24.639a1.87 1.87 0 0 0-.362 1.121l-.011 1.877c-.003.402.104.787.347 1.125.244.338.688.653 1.23.656l4.142.028c.542.003.99-.306 1.238-.641a1.87 1.87 0 0 0 .363-1.121l.012-1.875a1.87 1.87 0 0 0-.348-1.127c-.243-.338-.688-.653-1.23-.656l-.518-.004c.597-1.145 1.425-1.983 2.348-2.87 1.473-1.414 3.18-3.149 3.2-6.226-.016-3.59-2.923-6.684-6.993-6.707m-.006 1.1v.002c3.274.02 5.92 2.532 5.9 5.6-.017 2.706-1.39 4.026-2.863 5.44-1.034.994-2.118 2.033-2.814 3.633-.018.041-.052.055-.075.065q-.013.004-.02.01a.34.34 0 0 1-.226.084.34.34 0 0 1-.224-.086l-.092-.077c-.699-1.615-1.768-2.669-2.781-3.67-1.454-1.435-2.797-2.762-2.78-5.478.02-3.067 2.7-5.545 5.975-5.523m-.02 2.826c-1.62-.01-2.944 1.315-2.955 2.96-.01 1.646 1.295 2.988 2.916 2.999h.002c1.621.01 2.943-1.316 2.953-2.961.011-1.646-1.294-2.988-2.916-2.998m-.005 1.1c1.017.006 1.829.83 1.822 1.89s-.83 1.874-1.848 1.867c-1.018-.006-1.829-.83-1.822-1.89s.83-1.874 1.848-1.868m-2.155 11.857 4.14.025c.271.002.49.305.487.676l-.013 1.875c-.003.37-.224.67-.495.668l-4.14-.025c-.27-.002-.487-.306-.485-.676l.012-1.875c.003-.37.224-.67.494-.668' style='color:%23000;font-style:normal;font-variant:normal;font-weight:400;font-stretch:normal;font-size:medium;line-height:normal;font-family:sans-serif;font-variant-ligatures:normal;font-variant-position:normal;font-variant-caps:normal;font-variant-numeric:normal;font-variant-alternates:normal;font-feature-settings:normal;text-indent:0;text-align:start;text-decoration:none;text-decoration-line:none;text-decoration-style:solid;text-decoration-color:%23000;letter-spacing:normal;word-spacing:normal;text-transform:none;writing-mode:lr-tb;direction:ltr;text-orientation:mixed;dominant-baseline:auto;baseline-shift:baseline;text-anchor:start;white-space:normal;shape-padding:0;clip-rule:evenodd;display:inline;overflow:visible;visibility:visible;opacity:1;isolation:auto;mix-blend-mode:normal;color-interpolation:sRGB;color-interpolation-filters:linearRGB;solid-color:%23000;solid-opacity:1;vector-effect:none;fill:%23000;fill-opacity:.4;fill-rule:evenodd;stroke:none;stroke-width:2.47727823;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;color-rendering:auto;image-rendering:auto;shape-rendering:auto;text-rendering:auto' transform='translate(15.553 2.85)scale(.88807)'/%3E%3Cpath d='M-9.415-.316C-12.69-.338-15.37 2.14-15.39 5.207c-.017 2.716 1.326 4.041 2.78 5.477 1.013 1 2.081 2.055 2.78 3.67l.092.076a.34.34 0 0 0 .225.086.34.34 0 0 0 .227-.083l.019-.01c.022-.009.057-.024.074-.064.697-1.6 1.78-2.64 2.814-3.634 1.473-1.414 2.847-2.733 2.864-5.44.02-3.067-2.627-5.58-5.901-5.601m-.057 8.784c1.621.011 2.944-1.315 2.955-2.96.01-1.646-1.295-2.988-2.916-2.999-1.622-.01-2.945 1.315-2.955 2.96s1.295 2.989 2.916 3' style='clip-rule:evenodd;fill:%23e1e3e9;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:2.47727823;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:.4' transform='translate(15.553 2.85)scale(.88807)'/%3E%3Cpath d='M-11.594 15.465c-.27-.002-.492.297-.494.668l-.012 1.876c-.003.371.214.673.485.675l4.14.027c.271.002.492-.298.495-.668l.012-1.877c.003-.37-.215-.672-.485-.674z' style='clip-rule:evenodd;fill:%23fff;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:2.47727823;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:.4' transform='translate(15.553 2.85)scale(.88807)'/%3E%3C/g%3E%3C/svg%3E\");background-repeat:no-repeat;cursor:pointer;display:block;height:23px;margin:0 0 -4px -4px;overflow:hidden;width:88px}a.maplibregl-ctrl-logo.maplibregl-compact{width:14px}@media (forced-colors:active){a.maplibregl-ctrl-logo{background-color:transparent;background-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='88' height='23' fill='none'%3E%3Cpath fill='%23000' fill-opacity='.4' fill-rule='evenodd' d='M17.408 16.796h-1.827l2.501-12.095h.198l3.324 6.533.988 2.19.988-2.19 3.258-6.533h.181l2.6 12.095h-1.81l-1.218-5.644-.362-1.71-.658 1.71-2.929 5.644h-.098l-2.914-5.644-.757-1.71-.345 1.71zm1.958-3.42-.726 3.663a1.255 1.255 0 0 1-1.232 1.011h-1.827a1.255 1.255 0 0 1-1.229-1.509l2.501-12.095a1.255 1.255 0 0 1 1.23-1.001h.197a1.25 1.25 0 0 1 1.12.685l3.19 6.273 3.125-6.263a1.25 1.25 0 0 1 1.123-.695h.181a1.255 1.255 0 0 1 1.227.991l1.443 6.71a5 5 0 0 1 .314-.787l.009-.016a4.6 4.6 0 0 1 1.777-1.887c.782-.46 1.668-.667 2.611-.667a4.6 4.6 0 0 1 1.7.32l.306.134c.21-.16.474-.256.759-.256h1.694a1.255 1.255 0 0 1 1.212.925 1.255 1.255 0 0 1 1.212-.925h1.711c.284 0 .545.094.755.252.613-.3 1.312-.45 2.075-.45 1.356 0 2.557.445 3.482 1.4q.47.48.763 1.064V4.701a1.255 1.255 0 0 1 1.255-1.255h1.86A1.255 1.255 0 0 1 54.44 4.7v9.194h2.217c.19 0 .37.043.532.118v-4.77c0-.356.147-.678.385-.906a2.42 2.42 0 0 1-.682-1.71c0-.665.267-1.253.735-1.7a2.45 2.45 0 0 1 1.722-.674 2.43 2.43 0 0 1 1.705.675q.318.302.504.683V4.7a1.255 1.255 0 0 1 1.255-1.255h1.744A1.255 1.255 0 0 1 65.812 4.7v3.335a4.8 4.8 0 0 1 1.526-.246c.938 0 1.817.214 2.59.69a4.47 4.47 0 0 1 1.67 1.743v-.98a1.255 1.255 0 0 1 1.256-1.256h1.777c.233 0 .451.064.639.174a3.4 3.4 0 0 1 1.567-.372c.346 0 .861.02 1.285.232a1.25 1.25 0 0 1 .689 1.004 4.7 4.7 0 0 1 .853-.588c.795-.44 1.675-.647 2.61-.647 1.385 0 2.65.39 3.525 1.396.836.938 1.168 2.173 1.168 3.528q-.001.515-.056 1.051a1.255 1.255 0 0 1-.947 1.09l.408.952a1.255 1.255 0 0 1-.477 1.552c-.418.268-.92.463-1.458.612-.613.171-1.304.244-2.049.244-1.06 0-2.043-.207-2.886-.698l-.015-.008c-.798-.48-1.419-1.135-1.818-1.963l-.004-.008a5.8 5.8 0 0 1-.548-2.512q0-.429.053-.843a1.3 1.3 0 0 1-.333-.086l-.166-.004c-.223 0-.426.062-.643.228-.03.024-.142.139-.142.59v3.883a1.255 1.255 0 0 1-1.256 1.256h-1.777a1.255 1.255 0 0 1-1.256-1.256V15.69l-.032.057a4.8 4.8 0 0 1-1.86 1.833 5.04 5.04 0 0 1-2.484.634 4.5 4.5 0 0 1-1.935-.424 1.25 1.25 0 0 1-.764.258h-1.71a1.255 1.255 0 0 1-1.256-1.255V7.687a2.4 2.4 0 0 1-.428.625c.253.23.412.561.412.93v7.553a1.255 1.255 0 0 1-1.256 1.255h-1.843a1.25 1.25 0 0 1-.894-.373c-.228.23-.544.373-.894.373H51.32a1.255 1.255 0 0 1-1.256-1.255v-1.251l-.061.117a4.7 4.7 0 0 1-1.782 1.884 4.77 4.77 0 0 1-2.485.67 5.6 5.6 0 0 1-1.485-.188l.009 2.764a1.255 1.255 0 0 1-1.255 1.259h-1.729a1.255 1.255 0 0 1-1.255-1.255v-3.537a1.255 1.255 0 0 1-1.167.793h-1.679a1.25 1.25 0 0 1-.77-.263 4.5 4.5 0 0 1-1.945.429c-.885 0-1.724-.21-2.495-.632l-.017-.01a5 5 0 0 1-1.081-.836 1.255 1.255 0 0 1-1.254 1.312h-1.81a1.255 1.255 0 0 1-1.228-.99l-.782-3.625-2.044 3.939a1.25 1.25 0 0 1-1.115.676h-.098a1.25 1.25 0 0 1-1.116-.68l-2.061-3.994zM35.92 16.63l.207-.114.223-.15q.493-.356.735-.785l.061-.118.033 1.332h1.678V9.242h-1.694l-.033 1.267q-.133-.329-.526-.658l-.032-.028a3.2 3.2 0 0 0-.668-.428l-.27-.12a3.3 3.3 0 0 0-1.235-.23q-1.136-.001-1.974.493a3.36 3.36 0 0 0-1.3 1.382q-.445.89-.444 2.074 0 1.2.51 2.107a3.8 3.8 0 0 0 1.382 1.381 3.9 3.9 0 0 0 1.893.477q.795 0 1.455-.33zm-2.789-5.38q-.576.675-.575 1.762 0 1.102.559 1.794.576.675 1.645.675a2.25 2.25 0 0 0 .934-.19 2.2 2.2 0 0 0 .468-.29l.178-.161a2.2 2.2 0 0 0 .397-.561q.244-.5.244-1.15v-.115q0-.708-.296-1.267l-.043-.077a2.2 2.2 0 0 0-.633-.709l-.13-.086-.047-.028a2.1 2.1 0 0 0-1.073-.285q-1.052 0-1.629.692zm2.316 2.706c.163-.17.28-.407.28-.83v-.114c0-.292-.06-.508-.15-.68a.96.96 0 0 0-.353-.389.85.85 0 0 0-.464-.127c-.4 0-.56.114-.664.239l-.01.012c-.148.174-.275.45-.275.945 0 .506.122.801.27.99.097.11.266.224.68.224.303 0 .504-.09.687-.269zm7.545 1.705a2.6 2.6 0 0 0 .331.423q.319.33.755.548l.173.074q.65.255 1.49.255 1.02 0 1.844-.493a3.45 3.45 0 0 0 1.316-1.4q.493-.904.493-2.089 0-1.909-.988-2.913-.988-1.02-2.584-1.02-.898 0-1.575.347a3 3 0 0 0-.415.262l-.199.166a3.4 3.4 0 0 0-.64.82V9.242h-1.712v11.553h1.729l-.017-5.134zm.53-1.138q.206.29.48.5l.155.11.053.034q.51.296 1.119.297 1.07 0 1.645-.675.577-.69.576-1.762 0-1.119-.576-1.777-.558-.675-1.645-.675-.435 0-.835.16a2 2 0 0 0-.284.136 2 2 0 0 0-.363.254 2.2 2.2 0 0 0-.46.569l-.082.162a2.6 2.6 0 0 0-.213 1.072v.115q0 .707.296 1.267l.135.211zm.964-.818a1.1 1.1 0 0 0 .367.385.94.94 0 0 0 .476.118c.423 0 .59-.117.687-.23.159-.194.28-.478.28-.95 0-.53-.133-.8-.266-.952l-.021-.025c-.078-.094-.231-.221-.68-.221a1 1 0 0 0-.503.135l-.012.007a.86.86 0 0 0-.335.343c-.073.133-.132.324-.132.614v.115a1.4 1.4 0 0 0 .14.66zm15.7-6.222q.347-.346.346-.856a1.05 1.05 0 0 0-.345-.79 1.18 1.18 0 0 0-.84-.329q-.51 0-.855.33a1.05 1.05 0 0 0-.346.79q0 .51.346.855.345.346.856.346.51 0 .839-.346zm4.337 9.314.033-1.332q.191.403.59.747l.098.081a4 4 0 0 0 .316.224l.223.122a3.2 3.2 0 0 0 1.44.322 3.8 3.8 0 0 0 1.875-.477 3.5 3.5 0 0 0 1.382-1.366q.527-.89.526-2.09 0-1.184-.444-2.073a3.24 3.24 0 0 0-1.283-1.399q-.823-.51-1.942-.51a3.5 3.5 0 0 0-1.527.344l-.086.043-.165.09a3 3 0 0 0-.33.214q-.432.315-.656.707a2 2 0 0 0-.099.198l.082-1.283V4.701h-1.744v12.095zm.473-2.509a2.5 2.5 0 0 0 .566.7q.117.098.245.18l.144.08a2.1 2.1 0 0 0 .975.232q1.07 0 1.645-.675.576-.69.576-1.778 0-1.102-.576-1.777-.56-.691-1.645-.692a2.2 2.2 0 0 0-1.015.235q-.22.113-.415.282l-.15.142a2.1 2.1 0 0 0-.42.594q-.223.479-.223 1.1v.115q0 .705.293 1.26zm2.616-.293c.157-.191.28-.479.28-.967 0-.51-.13-.79-.276-.961l-.021-.026c-.082-.1-.232-.225-.67-.225a.87.87 0 0 0-.681.279l-.012.011c-.154.155-.274.38-.274.807v.115c0 .285.057.499.144.669a1.1 1.1 0 0 0 .367.405c.137.082.28.123.455.123.423 0 .59-.118.686-.23zm8.266-3.013q.345-.13.724-.14l.069-.002q.493 0 .642.099l.247-1.794q-.196-.099-.717-.099a2.3 2.3 0 0 0-.545.063 2 2 0 0 0-.411.148 2.2 2.2 0 0 0-.4.249 2.5 2.5 0 0 0-.485.499 2.7 2.7 0 0 0-.32.581l-.05.137v-1.48h-1.778v7.553h1.777v-3.884q0-.546.159-.943a1.5 1.5 0 0 1 .466-.636 2.5 2.5 0 0 1 .399-.253 2 2 0 0 1 .224-.099zm9.784 2.656.05-.922q0-1.743-.856-2.698-.838-.97-2.584-.97-1.119-.001-2.007.493a3.46 3.46 0 0 0-1.4 1.382q-.493.906-.493 2.106 0 1.07.428 1.975.428.89 1.332 1.432.906.526 2.255.526.973 0 1.668-.185l.044-.012.135-.04q.613-.184.984-.421l-.542-1.267q-.3.162-.642.274l-.297.087q-.51.131-1.3.131-.954 0-1.497-.444a1.6 1.6 0 0 1-.192-.193q-.366-.44-.512-1.234l-.004-.021zm-5.427-1.256-.003.022h3.752v-.138q-.011-.727-.288-1.118a1 1 0 0 0-.156-.176q-.46-.428-1.316-.428-.986 0-1.494.604-.379.45-.494 1.234zm-27.053 2.77V4.7h-1.86v12.095h5.333V15.15zm7.103-5.908v7.553h-1.843V9.242h1.843z'/%3E%3Cpath fill='%23fff' d='m19.63 11.151-.757-1.71-.345 1.71-1.12 5.644h-1.827L18.083 4.7h.197l3.325 6.533.988 2.19.988-2.19L26.839 4.7h.181l2.6 12.095h-1.81l-1.218-5.644-.362-1.71-.658 1.71-2.93 5.644h-.098l-2.913-5.644zm14.836 5.81q-1.02 0-1.893-.478a3.8 3.8 0 0 1-1.381-1.382q-.51-.906-.51-2.106 0-1.185.444-2.074a3.36 3.36 0 0 1 1.3-1.382q.839-.494 1.974-.494a3.3 3.3 0 0 1 1.234.231 3.3 3.3 0 0 1 .97.575q.396.33.527.659l.033-1.267h1.694v7.553H37.18l-.033-1.332q-.279.593-1.02 1.053a3.17 3.17 0 0 1-1.662.444zm.296-1.482q.938 0 1.58-.642.642-.66.642-1.711v-.115q0-.708-.296-1.267a2.2 2.2 0 0 0-.807-.872 2.1 2.1 0 0 0-1.119-.313q-1.053 0-1.629.692-.575.675-.575 1.76 0 1.103.559 1.795.577.675 1.645.675zm6.521-6.237h1.711v1.4q.906-1.597 2.83-1.597 1.596 0 2.584 1.02.988 1.005.988 2.914 0 1.185-.493 2.09a3.46 3.46 0 0 1-1.316 1.399 3.5 3.5 0 0 1-1.844.493q-.954 0-1.662-.329a2.67 2.67 0 0 1-1.086-.97l.017 5.134h-1.728zm4.048 6.22q1.07 0 1.645-.674.577-.69.576-1.762 0-1.119-.576-1.777-.558-.675-1.645-.675-.592 0-1.12.296-.51.28-.822.823-.296.527-.296 1.234v.115q0 .708.296 1.267.313.543.823.855.51.296 1.119.297z'/%3E%3Cpath fill='%23e1e3e9' d='M51.325 4.7h1.86v10.45h3.473v1.646h-5.333zm7.12 4.542h1.843v7.553h-1.843zm.905-1.415a1.16 1.16 0 0 1-.856-.346 1.17 1.17 0 0 1-.346-.856 1.05 1.05 0 0 1 .346-.79q.346-.329.856-.329.494 0 .839.33a1.05 1.05 0 0 1 .345.79 1.16 1.16 0 0 1-.345.855q-.33.346-.84.346zm7.875 9.133a3.17 3.17 0 0 1-1.662-.444q-.723-.46-1.004-1.053l-.033 1.332h-1.71V4.701h1.743v4.657l-.082 1.283q.279-.658 1.086-1.119a3.5 3.5 0 0 1 1.778-.477q1.119 0 1.942.51a3.24 3.24 0 0 1 1.283 1.4q.445.888.444 2.072 0 1.201-.526 2.09a3.5 3.5 0 0 1-1.382 1.366 3.8 3.8 0 0 1-1.876.477zm-.296-1.481q1.069 0 1.645-.675.577-.69.577-1.778 0-1.102-.577-1.776-.56-.691-1.645-.692a2.12 2.12 0 0 0-1.58.659q-.642.641-.642 1.694v.115q0 .71.296 1.267a2.4 2.4 0 0 0 .807.872 2.1 2.1 0 0 0 1.119.313zm5.927-6.237h1.777v1.481q.263-.757.856-1.217a2.14 2.14 0 0 1 1.349-.46q.527 0 .724.098l-.247 1.794q-.149-.099-.642-.099-.774 0-1.416.494-.626.493-.626 1.58v3.883h-1.777V9.242zm9.534 7.718q-1.35 0-2.255-.526-.904-.543-1.332-1.432a4.6 4.6 0 0 1-.428-1.975q0-1.2.493-2.106a3.46 3.46 0 0 1 1.4-1.382q.889-.495 2.007-.494 1.744 0 2.584.97.855.956.856 2.7 0 .444-.05.92h-5.43q.18 1.005.708 1.45.542.443 1.497.443.79 0 1.3-.131a4 4 0 0 0 .938-.362l.542 1.267q-.411.263-1.119.46-.708.198-1.711.197zm1.596-4.558q.016-1.02-.444-1.432-.46-.428-1.316-.428-1.728 0-1.991 1.86z'/%3E%3Cpath d='M5.074 15.948a.484.657 0 0 0-.486.659v1.84a.484.657 0 0 0 .486.659h4.101a.484.657 0 0 0 .486-.659v-1.84a.484.657 0 0 0-.486-.659zm3.56 1.16H5.617v.838h3.017z' style='fill:%23fff;fill-rule:evenodd;stroke-width:1.03600001'/%3E%3Cg style='stroke-width:1.12603545'%3E%3Cpath d='M-9.408-1.416c-3.833-.025-7.056 2.912-7.08 6.615-.02 3.08 1.653 4.832 3.107 6.268.903.892 1.721 1.74 2.32 2.902l-.525-.004c-.543-.003-.992.304-1.24.639a1.87 1.87 0 0 0-.362 1.121l-.011 1.877c-.003.402.104.787.347 1.125.244.338.688.653 1.23.656l4.142.028c.542.003.99-.306 1.238-.641a1.87 1.87 0 0 0 .363-1.121l.012-1.875a1.87 1.87 0 0 0-.348-1.127c-.243-.338-.688-.653-1.23-.656l-.518-.004c.597-1.145 1.425-1.983 2.348-2.87 1.473-1.414 3.18-3.149 3.2-6.226-.016-3.59-2.923-6.684-6.993-6.707m-.006 1.1v.002c3.274.02 5.92 2.532 5.9 5.6-.017 2.706-1.39 4.026-2.863 5.44-1.034.994-2.118 2.033-2.814 3.633-.018.041-.052.055-.075.065q-.013.004-.02.01a.34.34 0 0 1-.226.084.34.34 0 0 1-.224-.086l-.092-.077c-.699-1.615-1.768-2.669-2.781-3.67-1.454-1.435-2.797-2.762-2.78-5.478.02-3.067 2.7-5.545 5.975-5.523m-.02 2.826c-1.62-.01-2.944 1.315-2.955 2.96-.01 1.646 1.295 2.988 2.916 2.999h.002c1.621.01 2.943-1.316 2.953-2.961.011-1.646-1.294-2.988-2.916-2.998m-.005 1.1c1.017.006 1.829.83 1.822 1.89s-.83 1.874-1.848 1.867c-1.018-.006-1.829-.83-1.822-1.89s.83-1.874 1.848-1.868m-2.155 11.857 4.14.025c.271.002.49.305.487.676l-.013 1.875c-.003.37-.224.67-.495.668l-4.14-.025c-.27-.002-.487-.306-.485-.676l.012-1.875c.003-.37.224-.67.494-.668' style='color:%23000;font-style:normal;font-variant:normal;font-weight:400;font-stretch:normal;font-size:medium;line-height:normal;font-family:sans-serif;font-variant-ligatures:normal;font-variant-position:normal;font-variant-caps:normal;font-variant-numeric:normal;font-variant-alternates:normal;font-feature-settings:normal;text-indent:0;text-align:start;text-decoration:none;text-decoration-line:none;text-decoration-style:solid;text-decoration-color:%23000;letter-spacing:normal;word-spacing:normal;text-transform:none;writing-mode:lr-tb;direction:ltr;text-orientation:mixed;dominant-baseline:auto;baseline-shift:baseline;text-anchor:start;white-space:normal;shape-padding:0;clip-rule:evenodd;display:inline;overflow:visible;visibility:visible;opacity:1;isolation:auto;mix-blend-mode:normal;color-interpolation:sRGB;color-interpolation-filters:linearRGB;solid-color:%23000;solid-opacity:1;vector-effect:none;fill:%23000;fill-opacity:.4;fill-rule:evenodd;stroke:none;stroke-width:2.47727823;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;color-rendering:auto;image-rendering:auto;shape-rendering:auto;text-rendering:auto' transform='translate(15.553 2.85)scale(.88807)'/%3E%3Cpath d='M-9.415-.316C-12.69-.338-15.37 2.14-15.39 5.207c-.017 2.716 1.326 4.041 2.78 5.477 1.013 1 2.081 2.055 2.78 3.67l.092.076a.34.34 0 0 0 .225.086.34.34 0 0 0 .227-.083l.019-.01c.022-.009.057-.024.074-.064.697-1.6 1.78-2.64 2.814-3.634 1.473-1.414 2.847-2.733 2.864-5.44.02-3.067-2.627-5.58-5.901-5.601m-.057 8.784c1.621.011 2.944-1.315 2.955-2.96.01-1.646-1.295-2.988-2.916-2.999-1.622-.01-2.945 1.315-2.955 2.96s1.295 2.989 2.916 3' style='clip-rule:evenodd;fill:%23e1e3e9;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:2.47727823;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:.4' transform='translate(15.553 2.85)scale(.88807)'/%3E%3Cpath d='M-11.594 15.465c-.27-.002-.492.297-.494.668l-.012 1.876c-.003.371.214.673.485.675l4.14.027c.271.002.492-.298.495-.668l.012-1.877c.003-.37-.215-.672-.485-.674z' style='clip-rule:evenodd;fill:%23fff;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:2.47727823;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:.4' transform='translate(15.553 2.85)scale(.88807)'/%3E%3C/g%3E%3C/svg%3E\")}}@media (forced-colors:active) and (prefers-color-scheme:light){a.maplibregl-ctrl-logo{background-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='88' height='23' fill='none'%3E%3Cpath fill='%23000' fill-opacity='.4' fill-rule='evenodd' d='M17.408 16.796h-1.827l2.501-12.095h.198l3.324 6.533.988 2.19.988-2.19 3.258-6.533h.181l2.6 12.095h-1.81l-1.218-5.644-.362-1.71-.658 1.71-2.929 5.644h-.098l-2.914-5.644-.757-1.71-.345 1.71zm1.958-3.42-.726 3.663a1.255 1.255 0 0 1-1.232 1.011h-1.827a1.255 1.255 0 0 1-1.229-1.509l2.501-12.095a1.255 1.255 0 0 1 1.23-1.001h.197a1.25 1.25 0 0 1 1.12.685l3.19 6.273 3.125-6.263a1.25 1.25 0 0 1 1.123-.695h.181a1.255 1.255 0 0 1 1.227.991l1.443 6.71a5 5 0 0 1 .314-.787l.009-.016a4.6 4.6 0 0 1 1.777-1.887c.782-.46 1.668-.667 2.611-.667a4.6 4.6 0 0 1 1.7.32l.306.134c.21-.16.474-.256.759-.256h1.694a1.255 1.255 0 0 1 1.212.925 1.255 1.255 0 0 1 1.212-.925h1.711c.284 0 .545.094.755.252.613-.3 1.312-.45 2.075-.45 1.356 0 2.557.445 3.482 1.4q.47.48.763 1.064V4.701a1.255 1.255 0 0 1 1.255-1.255h1.86A1.255 1.255 0 0 1 54.44 4.7v9.194h2.217c.19 0 .37.043.532.118v-4.77c0-.356.147-.678.385-.906a2.42 2.42 0 0 1-.682-1.71c0-.665.267-1.253.735-1.7a2.45 2.45 0 0 1 1.722-.674 2.43 2.43 0 0 1 1.705.675q.318.302.504.683V4.7a1.255 1.255 0 0 1 1.255-1.255h1.744A1.255 1.255 0 0 1 65.812 4.7v3.335a4.8 4.8 0 0 1 1.526-.246c.938 0 1.817.214 2.59.69a4.47 4.47 0 0 1 1.67 1.743v-.98a1.255 1.255 0 0 1 1.256-1.256h1.777c.233 0 .451.064.639.174a3.4 3.4 0 0 1 1.567-.372c.346 0 .861.02 1.285.232a1.25 1.25 0 0 1 .689 1.004 4.7 4.7 0 0 1 .853-.588c.795-.44 1.675-.647 2.61-.647 1.385 0 2.65.39 3.525 1.396.836.938 1.168 2.173 1.168 3.528q-.001.515-.056 1.051a1.255 1.255 0 0 1-.947 1.09l.408.952a1.255 1.255 0 0 1-.477 1.552c-.418.268-.92.463-1.458.612-.613.171-1.304.244-2.049.244-1.06 0-2.043-.207-2.886-.698l-.015-.008c-.798-.48-1.419-1.135-1.818-1.963l-.004-.008a5.8 5.8 0 0 1-.548-2.512q0-.429.053-.843a1.3 1.3 0 0 1-.333-.086l-.166-.004c-.223 0-.426.062-.643.228-.03.024-.142.139-.142.59v3.883a1.255 1.255 0 0 1-1.256 1.256h-1.777a1.255 1.255 0 0 1-1.256-1.256V15.69l-.032.057a4.8 4.8 0 0 1-1.86 1.833 5.04 5.04 0 0 1-2.484.634 4.5 4.5 0 0 1-1.935-.424 1.25 1.25 0 0 1-.764.258h-1.71a1.255 1.255 0 0 1-1.256-1.255V7.687a2.4 2.4 0 0 1-.428.625c.253.23.412.561.412.93v7.553a1.255 1.255 0 0 1-1.256 1.255h-1.843a1.25 1.25 0 0 1-.894-.373c-.228.23-.544.373-.894.373H51.32a1.255 1.255 0 0 1-1.256-1.255v-1.251l-.061.117a4.7 4.7 0 0 1-1.782 1.884 4.77 4.77 0 0 1-2.485.67 5.6 5.6 0 0 1-1.485-.188l.009 2.764a1.255 1.255 0 0 1-1.255 1.259h-1.729a1.255 1.255 0 0 1-1.255-1.255v-3.537a1.255 1.255 0 0 1-1.167.793h-1.679a1.25 1.25 0 0 1-.77-.263 4.5 4.5 0 0 1-1.945.429c-.885 0-1.724-.21-2.495-.632l-.017-.01a5 5 0 0 1-1.081-.836 1.255 1.255 0 0 1-1.254 1.312h-1.81a1.255 1.255 0 0 1-1.228-.99l-.782-3.625-2.044 3.939a1.25 1.25 0 0 1-1.115.676h-.098a1.25 1.25 0 0 1-1.116-.68l-2.061-3.994zM35.92 16.63l.207-.114.223-.15q.493-.356.735-.785l.061-.118.033 1.332h1.678V9.242h-1.694l-.033 1.267q-.133-.329-.526-.658l-.032-.028a3.2 3.2 0 0 0-.668-.428l-.27-.12a3.3 3.3 0 0 0-1.235-.23q-1.136-.001-1.974.493a3.36 3.36 0 0 0-1.3 1.382q-.445.89-.444 2.074 0 1.2.51 2.107a3.8 3.8 0 0 0 1.382 1.381 3.9 3.9 0 0 0 1.893.477q.795 0 1.455-.33zm-2.789-5.38q-.576.675-.575 1.762 0 1.102.559 1.794.576.675 1.645.675a2.25 2.25 0 0 0 .934-.19 2.2 2.2 0 0 0 .468-.29l.178-.161a2.2 2.2 0 0 0 .397-.561q.244-.5.244-1.15v-.115q0-.708-.296-1.267l-.043-.077a2.2 2.2 0 0 0-.633-.709l-.13-.086-.047-.028a2.1 2.1 0 0 0-1.073-.285q-1.052 0-1.629.692zm2.316 2.706c.163-.17.28-.407.28-.83v-.114c0-.292-.06-.508-.15-.68a.96.96 0 0 0-.353-.389.85.85 0 0 0-.464-.127c-.4 0-.56.114-.664.239l-.01.012c-.148.174-.275.45-.275.945 0 .506.122.801.27.99.097.11.266.224.68.224.303 0 .504-.09.687-.269zm7.545 1.705a2.6 2.6 0 0 0 .331.423q.319.33.755.548l.173.074q.65.255 1.49.255 1.02 0 1.844-.493a3.45 3.45 0 0 0 1.316-1.4q.493-.904.493-2.089 0-1.909-.988-2.913-.988-1.02-2.584-1.02-.898 0-1.575.347a3 3 0 0 0-.415.262l-.199.166a3.4 3.4 0 0 0-.64.82V9.242h-1.712v11.553h1.729l-.017-5.134zm.53-1.138q.206.29.48.5l.155.11.053.034q.51.296 1.119.297 1.07 0 1.645-.675.577-.69.576-1.762 0-1.119-.576-1.777-.558-.675-1.645-.675-.435 0-.835.16a2 2 0 0 0-.284.136 2 2 0 0 0-.363.254 2.2 2.2 0 0 0-.46.569l-.082.162a2.6 2.6 0 0 0-.213 1.072v.115q0 .707.296 1.267l.135.211zm.964-.818a1.1 1.1 0 0 0 .367.385.94.94 0 0 0 .476.118c.423 0 .59-.117.687-.23.159-.194.28-.478.28-.95 0-.53-.133-.8-.266-.952l-.021-.025c-.078-.094-.231-.221-.68-.221a1 1 0 0 0-.503.135l-.012.007a.86.86 0 0 0-.335.343c-.073.133-.132.324-.132.614v.115a1.4 1.4 0 0 0 .14.66zm15.7-6.222q.347-.346.346-.856a1.05 1.05 0 0 0-.345-.79 1.18 1.18 0 0 0-.84-.329q-.51 0-.855.33a1.05 1.05 0 0 0-.346.79q0 .51.346.855.345.346.856.346.51 0 .839-.346zm4.337 9.314.033-1.332q.191.403.59.747l.098.081a4 4 0 0 0 .316.224l.223.122a3.2 3.2 0 0 0 1.44.322 3.8 3.8 0 0 0 1.875-.477 3.5 3.5 0 0 0 1.382-1.366q.527-.89.526-2.09 0-1.184-.444-2.073a3.24 3.24 0 0 0-1.283-1.399q-.823-.51-1.942-.51a3.5 3.5 0 0 0-1.527.344l-.086.043-.165.09a3 3 0 0 0-.33.214q-.432.315-.656.707a2 2 0 0 0-.099.198l.082-1.283V4.701h-1.744v12.095zm.473-2.509a2.5 2.5 0 0 0 .566.7q.117.098.245.18l.144.08a2.1 2.1 0 0 0 .975.232q1.07 0 1.645-.675.576-.69.576-1.778 0-1.102-.576-1.777-.56-.691-1.645-.692a2.2 2.2 0 0 0-1.015.235q-.22.113-.415.282l-.15.142a2.1 2.1 0 0 0-.42.594q-.223.479-.223 1.1v.115q0 .705.293 1.26zm2.616-.293c.157-.191.28-.479.28-.967 0-.51-.13-.79-.276-.961l-.021-.026c-.082-.1-.232-.225-.67-.225a.87.87 0 0 0-.681.279l-.012.011c-.154.155-.274.38-.274.807v.115c0 .285.057.499.144.669a1.1 1.1 0 0 0 .367.405c.137.082.28.123.455.123.423 0 .59-.118.686-.23zm8.266-3.013q.345-.13.724-.14l.069-.002q.493 0 .642.099l.247-1.794q-.196-.099-.717-.099a2.3 2.3 0 0 0-.545.063 2 2 0 0 0-.411.148 2.2 2.2 0 0 0-.4.249 2.5 2.5 0 0 0-.485.499 2.7 2.7 0 0 0-.32.581l-.05.137v-1.48h-1.778v7.553h1.777v-3.884q0-.546.159-.943a1.5 1.5 0 0 1 .466-.636 2.5 2.5 0 0 1 .399-.253 2 2 0 0 1 .224-.099zm9.784 2.656.05-.922q0-1.743-.856-2.698-.838-.97-2.584-.97-1.119-.001-2.007.493a3.46 3.46 0 0 0-1.4 1.382q-.493.906-.493 2.106 0 1.07.428 1.975.428.89 1.332 1.432.906.526 2.255.526.973 0 1.668-.185l.044-.012.135-.04q.613-.184.984-.421l-.542-1.267q-.3.162-.642.274l-.297.087q-.51.131-1.3.131-.954 0-1.497-.444a1.6 1.6 0 0 1-.192-.193q-.366-.44-.512-1.234l-.004-.021zm-5.427-1.256-.003.022h3.752v-.138q-.011-.727-.288-1.118a1 1 0 0 0-.156-.176q-.46-.428-1.316-.428-.986 0-1.494.604-.379.45-.494 1.234zm-27.053 2.77V4.7h-1.86v12.095h5.333V15.15zm7.103-5.908v7.553h-1.843V9.242h1.843z'/%3E%3Cpath fill='%23fff' d='m19.63 11.151-.757-1.71-.345 1.71-1.12 5.644h-1.827L18.083 4.7h.197l3.325 6.533.988 2.19.988-2.19L26.839 4.7h.181l2.6 12.095h-1.81l-1.218-5.644-.362-1.71-.658 1.71-2.93 5.644h-.098l-2.913-5.644zm14.836 5.81q-1.02 0-1.893-.478a3.8 3.8 0 0 1-1.381-1.382q-.51-.906-.51-2.106 0-1.185.444-2.074a3.36 3.36 0 0 1 1.3-1.382q.839-.494 1.974-.494a3.3 3.3 0 0 1 1.234.231 3.3 3.3 0 0 1 .97.575q.396.33.527.659l.033-1.267h1.694v7.553H37.18l-.033-1.332q-.279.593-1.02 1.053a3.17 3.17 0 0 1-1.662.444zm.296-1.482q.938 0 1.58-.642.642-.66.642-1.711v-.115q0-.708-.296-1.267a2.2 2.2 0 0 0-.807-.872 2.1 2.1 0 0 0-1.119-.313q-1.053 0-1.629.692-.575.675-.575 1.76 0 1.103.559 1.795.577.675 1.645.675zm6.521-6.237h1.711v1.4q.906-1.597 2.83-1.597 1.596 0 2.584 1.02.988 1.005.988 2.914 0 1.185-.493 2.09a3.46 3.46 0 0 1-1.316 1.399 3.5 3.5 0 0 1-1.844.493q-.954 0-1.662-.329a2.67 2.67 0 0 1-1.086-.97l.017 5.134h-1.728zm4.048 6.22q1.07 0 1.645-.674.577-.69.576-1.762 0-1.119-.576-1.777-.558-.675-1.645-.675-.592 0-1.12.296-.51.28-.822.823-.296.527-.296 1.234v.115q0 .708.296 1.267.313.543.823.855.51.296 1.119.297z'/%3E%3Cpath fill='%23e1e3e9' d='M51.325 4.7h1.86v10.45h3.473v1.646h-5.333zm7.12 4.542h1.843v7.553h-1.843zm.905-1.415a1.16 1.16 0 0 1-.856-.346 1.17 1.17 0 0 1-.346-.856 1.05 1.05 0 0 1 .346-.79q.346-.329.856-.329.494 0 .839.33a1.05 1.05 0 0 1 .345.79 1.16 1.16 0 0 1-.345.855q-.33.346-.84.346zm7.875 9.133a3.17 3.17 0 0 1-1.662-.444q-.723-.46-1.004-1.053l-.033 1.332h-1.71V4.701h1.743v4.657l-.082 1.283q.279-.658 1.086-1.119a3.5 3.5 0 0 1 1.778-.477q1.119 0 1.942.51a3.24 3.24 0 0 1 1.283 1.4q.445.888.444 2.072 0 1.201-.526 2.09a3.5 3.5 0 0 1-1.382 1.366 3.8 3.8 0 0 1-1.876.477zm-.296-1.481q1.069 0 1.645-.675.577-.69.577-1.778 0-1.102-.577-1.776-.56-.691-1.645-.692a2.12 2.12 0 0 0-1.58.659q-.642.641-.642 1.694v.115q0 .71.296 1.267a2.4 2.4 0 0 0 .807.872 2.1 2.1 0 0 0 1.119.313zm5.927-6.237h1.777v1.481q.263-.757.856-1.217a2.14 2.14 0 0 1 1.349-.46q.527 0 .724.098l-.247 1.794q-.149-.099-.642-.099-.774 0-1.416.494-.626.493-.626 1.58v3.883h-1.777V9.242zm9.534 7.718q-1.35 0-2.255-.526-.904-.543-1.332-1.432a4.6 4.6 0 0 1-.428-1.975q0-1.2.493-2.106a3.46 3.46 0 0 1 1.4-1.382q.889-.495 2.007-.494 1.744 0 2.584.97.855.956.856 2.7 0 .444-.05.92h-5.43q.18 1.005.708 1.45.542.443 1.497.443.79 0 1.3-.131a4 4 0 0 0 .938-.362l.542 1.267q-.411.263-1.119.46-.708.198-1.711.197zm1.596-4.558q.016-1.02-.444-1.432-.46-.428-1.316-.428-1.728 0-1.991 1.86z'/%3E%3Cpath d='M5.074 15.948a.484.657 0 0 0-.486.659v1.84a.484.657 0 0 0 .486.659h4.101a.484.657 0 0 0 .486-.659v-1.84a.484.657 0 0 0-.486-.659zm3.56 1.16H5.617v.838h3.017z' style='fill:%23fff;fill-rule:evenodd;stroke-width:1.03600001'/%3E%3Cg style='stroke-width:1.12603545'%3E%3Cpath d='M-9.408-1.416c-3.833-.025-7.056 2.912-7.08 6.615-.02 3.08 1.653 4.832 3.107 6.268.903.892 1.721 1.74 2.32 2.902l-.525-.004c-.543-.003-.992.304-1.24.639a1.87 1.87 0 0 0-.362 1.121l-.011 1.877c-.003.402.104.787.347 1.125.244.338.688.653 1.23.656l4.142.028c.542.003.99-.306 1.238-.641a1.87 1.87 0 0 0 .363-1.121l.012-1.875a1.87 1.87 0 0 0-.348-1.127c-.243-.338-.688-.653-1.23-.656l-.518-.004c.597-1.145 1.425-1.983 2.348-2.87 1.473-1.414 3.18-3.149 3.2-6.226-.016-3.59-2.923-6.684-6.993-6.707m-.006 1.1v.002c3.274.02 5.92 2.532 5.9 5.6-.017 2.706-1.39 4.026-2.863 5.44-1.034.994-2.118 2.033-2.814 3.633-.018.041-.052.055-.075.065q-.013.004-.02.01a.34.34 0 0 1-.226.084.34.34 0 0 1-.224-.086l-.092-.077c-.699-1.615-1.768-2.669-2.781-3.67-1.454-1.435-2.797-2.762-2.78-5.478.02-3.067 2.7-5.545 5.975-5.523m-.02 2.826c-1.62-.01-2.944 1.315-2.955 2.96-.01 1.646 1.295 2.988 2.916 2.999h.002c1.621.01 2.943-1.316 2.953-2.961.011-1.646-1.294-2.988-2.916-2.998m-.005 1.1c1.017.006 1.829.83 1.822 1.89s-.83 1.874-1.848 1.867c-1.018-.006-1.829-.83-1.822-1.89s.83-1.874 1.848-1.868m-2.155 11.857 4.14.025c.271.002.49.305.487.676l-.013 1.875c-.003.37-.224.67-.495.668l-4.14-.025c-.27-.002-.487-.306-.485-.676l.012-1.875c.003-.37.224-.67.494-.668' style='color:%23000;font-style:normal;font-variant:normal;font-weight:400;font-stretch:normal;font-size:medium;line-height:normal;font-family:sans-serif;font-variant-ligatures:normal;font-variant-position:normal;font-variant-caps:normal;font-variant-numeric:normal;font-variant-alternates:normal;font-feature-settings:normal;text-indent:0;text-align:start;text-decoration:none;text-decoration-line:none;text-decoration-style:solid;text-decoration-color:%23000;letter-spacing:normal;word-spacing:normal;text-transform:none;writing-mode:lr-tb;direction:ltr;text-orientation:mixed;dominant-baseline:auto;baseline-shift:baseline;text-anchor:start;white-space:normal;shape-padding:0;clip-rule:evenodd;display:inline;overflow:visible;visibility:visible;opacity:1;isolation:auto;mix-blend-mode:normal;color-interpolation:sRGB;color-interpolation-filters:linearRGB;solid-color:%23000;solid-opacity:1;vector-effect:none;fill:%23000;fill-opacity:.4;fill-rule:evenodd;stroke:none;stroke-width:2.47727823;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;color-rendering:auto;image-rendering:auto;shape-rendering:auto;text-rendering:auto' transform='translate(15.553 2.85)scale(.88807)'/%3E%3Cpath d='M-9.415-.316C-12.69-.338-15.37 2.14-15.39 5.207c-.017 2.716 1.326 4.041 2.78 5.477 1.013 1 2.081 2.055 2.78 3.67l.092.076a.34.34 0 0 0 .225.086.34.34 0 0 0 .227-.083l.019-.01c.022-.009.057-.024.074-.064.697-1.6 1.78-2.64 2.814-3.634 1.473-1.414 2.847-2.733 2.864-5.44.02-3.067-2.627-5.58-5.901-5.601m-.057 8.784c1.621.011 2.944-1.315 2.955-2.96.01-1.646-1.295-2.988-2.916-2.999-1.622-.01-2.945 1.315-2.955 2.96s1.295 2.989 2.916 3' style='clip-rule:evenodd;fill:%23e1e3e9;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:2.47727823;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:.4' transform='translate(15.553 2.85)scale(.88807)'/%3E%3Cpath d='M-11.594 15.465c-.27-.002-.492.297-.494.668l-.012 1.876c-.003.371.214.673.485.675l4.14.027c.271.002.492-.298.495-.668l.012-1.877c.003-.37-.215-.672-.485-.674z' style='clip-rule:evenodd;fill:%23fff;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:2.47727823;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:.4' transform='translate(15.553 2.85)scale(.88807)'/%3E%3C/g%3E%3C/svg%3E\")}}.maplibregl-ctrl.maplibregl-ctrl-attrib{background-color:#ffffff80;margin:0;padding:0 5px}@media screen{.maplibregl-ctrl-attrib.maplibregl-compact{background-color:#fff;border-radius:12px;box-sizing:content-box;color:#000;margin:10px;min-height:20px;padding:2px 24px 2px 0;position:relative}.maplibregl-ctrl-attrib.maplibregl-compact-show{padding:2px 28px 2px 8px;visibility:visible}.maplibregl-ctrl-bottom-left>.maplibregl-ctrl-attrib.maplibregl-compact-show,.maplibregl-ctrl-top-left>.maplibregl-ctrl-attrib.maplibregl-compact-show{border-radius:12px;padding:2px 8px 2px 28px}.maplibregl-ctrl-attrib.maplibregl-compact .maplibregl-ctrl-attrib-inner{display:none}.maplibregl-ctrl-attrib-button{background-color:#ffffff80;background-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' fill-rule='evenodd' viewBox='0 0 20 20'%3E%3Cpath d='M4 10a6 6 0 1 0 12 0 6 6 0 1 0-12 0m5-3a1 1 0 1 0 2 0 1 1 0 1 0-2 0m0 3a1 1 0 1 1 2 0v3a1 1 0 1 1-2 0'/%3E%3C/svg%3E\");border:0;border-radius:12px;box-sizing:border-box;cursor:pointer;display:none;height:24px;outline:none;position:absolute;right:0;top:0;width:24px}.maplibregl-ctrl-attrib summary.maplibregl-ctrl-attrib-button{-webkit-appearance:none;-moz-appearance:none;appearance:none;list-style:none}.maplibregl-ctrl-attrib summary.maplibregl-ctrl-attrib-button::-webkit-details-marker{display:none}.maplibregl-ctrl-bottom-left .maplibregl-ctrl-attrib-button,.maplibregl-ctrl-top-left .maplibregl-ctrl-attrib-button{left:0}.maplibregl-ctrl-attrib.maplibregl-compact .maplibregl-ctrl-attrib-button,.maplibregl-ctrl-attrib.maplibregl-compact-show .maplibregl-ctrl-attrib-inner{display:block}.maplibregl-ctrl-attrib.maplibregl-compact-show .maplibregl-ctrl-attrib-button{background-color:#0000000d}.maplibregl-ctrl-bottom-right>.maplibregl-ctrl-attrib.maplibregl-compact:after{bottom:0;right:0}.maplibregl-ctrl-top-right>.maplibregl-ctrl-attrib.maplibregl-compact:after{right:0;top:0}.maplibregl-ctrl-top-left>.maplibregl-ctrl-attrib.maplibregl-compact:after{left:0;top:0}.maplibregl-ctrl-bottom-left>.maplibregl-ctrl-attrib.maplibregl-compact:after{bottom:0;left:0}}@media screen and (forced-colors:active){.maplibregl-ctrl-attrib.maplibregl-compact:after{background-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' fill='%23fff' fill-rule='evenodd' viewBox='0 0 20 20'%3E%3Cpath d='M4 10a6 6 0 1 0 12 0 6 6 0 1 0-12 0m5-3a1 1 0 1 0 2 0 1 1 0 1 0-2 0m0 3a1 1 0 1 1 2 0v3a1 1 0 1 1-2 0'/%3E%3C/svg%3E\")}}@media screen and (forced-colors:active) and (prefers-color-scheme:light){.maplibregl-ctrl-attrib.maplibregl-compact:after{background-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' fill-rule='evenodd' viewBox='0 0 20 20'%3E%3Cpath d='M4 10a6 6 0 1 0 12 0 6 6 0 1 0-12 0m5-3a1 1 0 1 0 2 0 1 1 0 1 0-2 0m0 3a1 1 0 1 1 2 0v3a1 1 0 1 1-2 0'/%3E%3C/svg%3E\")}}.maplibregl-ctrl-attrib a{color:#000000bf;text-decoration:none}.maplibregl-ctrl-attrib a:hover{color:inherit;text-decoration:underline}.maplibregl-attrib-empty{display:none}.maplibregl-ctrl-scale{background-color:#ffffffbf;border:2px solid #333;border-top:#333;box-sizing:border-box;color:#333;font-size:10px;padding:0 5px}.maplibregl-popup{display:flex;left:0;pointer-events:none;position:absolute;top:0;will-change:transform}.maplibregl-popup-anchor-top,.maplibregl-popup-anchor-top-left,.maplibregl-popup-anchor-top-right{flex-direction:column}.maplibregl-popup-anchor-bottom,.maplibregl-popup-anchor-bottom-left,.maplibregl-popup-anchor-bottom-right{flex-direction:column-reverse}.maplibregl-popup-anchor-left{flex-direction:row}.maplibregl-popup-anchor-right{flex-direction:row-reverse}.maplibregl-popup-tip{border:10px solid transparent;height:0;width:0;z-index:1}.maplibregl-popup-anchor-top .maplibregl-popup-tip{align-self:center;border-bottom-color:#fff;border-top:none}.maplibregl-popup-anchor-top-left .maplibregl-popup-tip{align-self:flex-start;border-bottom-color:#fff;border-left:none;border-top:none}.maplibregl-popup-anchor-top-right .maplibregl-popup-tip{align-self:flex-end;border-bottom-color:#fff;border-right:none;border-top:none}.maplibregl-popup-anchor-bottom .maplibregl-popup-tip{align-self:center;border-bottom:none;border-top-color:#fff}.maplibregl-popup-anchor-bottom-left .maplibregl-popup-tip{align-self:flex-start;border-bottom:none;border-left:none;border-top-color:#fff}.maplibregl-popup-anchor-bottom-right .maplibregl-popup-tip{align-self:flex-end;border-bottom:none;border-right:none;border-top-color:#fff}.maplibregl-popup-anchor-left .maplibregl-popup-tip{align-self:center;border-left:none;border-right-color:#fff}.maplibregl-popup-anchor-right .maplibregl-popup-tip{align-self:center;border-left-color:#fff;border-right:none}.maplibregl-popup-close-button{background-color:transparent;border:0;border-radius:0 3px 0 0;cursor:pointer;position:absolute;right:0;top:0}.maplibregl-popup-close-button:hover{background-color:#0000000d}.maplibregl-popup-content{background:#fff;border-radius:3px;box-shadow:0 1px 2px #0000001a;padding:15px 10px;pointer-events:auto;position:relative}.maplibregl-popup-anchor-top-left .maplibregl-popup-content{border-top-left-radius:0}.maplibregl-popup-anchor-top-right .maplibregl-popup-content{border-top-right-radius:0}.maplibregl-popup-anchor-bottom-left .maplibregl-popup-content{border-bottom-left-radius:0}.maplibregl-popup-anchor-bottom-right .maplibregl-popup-content{border-bottom-right-radius:0}.maplibregl-popup-track-pointer{display:none}.maplibregl-popup-track-pointer *{pointer-events:none;-webkit-user-select:none;-moz-user-select:none;user-select:none}.maplibregl-map:hover .maplibregl-popup-track-pointer{display:flex}.maplibregl-map:active .maplibregl-popup-track-pointer{display:none}.maplibregl-marker{left:0;position:absolute;top:0;transition:opacity .2s;will-change:transform}.maplibregl-user-location-dot,.maplibregl-user-location-dot:before{background-color:#1da1f2;border-radius:50%;height:15px;width:15px}.maplibregl-user-location-dot:before{animation:maplibregl-user-location-dot-pulse 2s infinite;content:\"\";position:absolute}.maplibregl-user-location-dot:after{border:2px solid #fff;border-radius:50%;box-shadow:0 0 3px #00000059;box-sizing:border-box;content:\"\";height:19px;left:-2px;position:absolute;top:-2px;width:19px}@keyframes maplibregl-user-location-dot-pulse{0%{opacity:1;transform:scale(1)}70%{opacity:0;transform:scale(3)}to{opacity:0;transform:scale(1)}}.maplibregl-user-location-dot-stale{background-color:#aaa}.maplibregl-user-location-dot-stale:after{display:none}.maplibregl-user-location-accuracy-circle{background-color:#1da1f233;border-radius:100%;height:1px;width:1px}.maplibregl-crosshair,.maplibregl-crosshair .maplibregl-interactive,.maplibregl-crosshair .maplibregl-interactive:active{cursor:crosshair}.maplibregl-boxzoom{background:#fff;border:2px dotted #202020;height:0;left:0;opacity:.5;position:absolute;top:0;width:0}.maplibregl-cooperative-gesture-screen{align-items:center;background:#0006;color:#fff;display:flex;font-size:1.4em;inset:0;justify-content:center;line-height:1.2;opacity:0;padding:1rem;pointer-events:none;position:absolute;transition:opacity 1s ease 1s;z-index:99999}.maplibregl-cooperative-gesture-screen.maplibregl-show{opacity:1;transition:opacity .05s}.maplibregl-cooperative-gesture-screen .maplibregl-mobile-message{display:none}@media (hover:none),(width <= 480px){.maplibregl-cooperative-gesture-screen .maplibregl-desktop-message{display:none}.maplibregl-cooperative-gesture-screen .maplibregl-mobile-message{display:block}}.maplibregl-pseudo-fullscreen{height:100%!important;left:0!important;position:fixed!important;top:0!important;width:100%!important;z-index:99999}"},Symbol.toStringTag,{value:"Module"}));return Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),t}({});