1"use strict";(self.webpackChunkmaterial_ui_gatsby=self.webpackChunkmaterial_ui_gatsby||[]).push([[15],{9908:function(e,t,i){i.d(t,{Mz:function(){return pi},Nu:function(){return vi},gA:function(){return fi},mA:function(){return xi},oR:function(){return Le}});var o=i(8964),r=i(7007),s=Object.defineProperty,l=e=>{throw TypeError(e)},a=(e,t,i)=>((e,t,i)=>t in e?s(e,t,{enumerable:!0,configurable:!0,writable:!0,value:i}):e[t]=i)(e,"symbol"!=typeof t?t+"":t,i),n=(e,t,i)=>t.has(e)||l("Cannot "+i),c=(e,t,i)=>(n(e,t,"read from private field"),i?i.call(e):t.get(e)),u=(e,t,i)=>t.has(e)?l("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,i),h=(e,t,i,o)=>(n(e,t,"write to private field"),o?o.call(e,i):t.set(e,i),i),m=(e,t,i)=>(n(e,t,"access private method"),i),d=(e,t,i,o)=>({set _(o){h(e,t,o,i)},get _(){return c(e,t,o)}});function v(e,t){const i=e.get(t);if(void 0===i)throw new Error(`Element with key ${t} not found in map`);return i}function f(e,t,i){const o=e[0]*t[0]+e[1]*t[1]+e[2]*t[2],r=Math.min(Math.max(o,-1),1),s=Math.acos(r);if(s<1e-6)return e;const l=Math.sin(s),a=Math.sin((1-i)*s)/l,n=Math.sin(i*s)/l;return[e[0]*a+t[0]*n,e[1]*a+t[1]*n,e[2]*a+t[2]*n]}const p="object"==typeof performance&&performance&&"function"==typeof performance.now?performance:Date,g=new Set,x="object"==typeof process&&process?process:{},w=(e,t,i,o)=>{"function"==typeof x.emitWarning?x.emitWarning(e,t,i,o):console.error(`[${i}] ${t}: ${e}`)};let T=globalThis.AbortController,S=globalThis.AbortSignal;var y;if(typeof T>"u"){S=class{constructor(){a(this,"onabort"),a(this,"_onabort",[]),a(this,"reason"),a(this,"aborted",!1)}addEventListener(e,t){this._onabort.push(t)}},T=class{constructor(){a(this,"signal",new S),t()}abort(e){var t,i;if(!this.signal.aborted){this.signal.reason=e,this.signal.aborted=!0;for(const t of this.signal._onabort)t(e);null==(i=(t=this.signal).onabort)||i.call(t,e)}}};let e="1"!==(null==(y=x.env)?void 0:y.LRU_CACHE_IGNORE_AC_WARNING);const t=()=>{e&&(e=!1,w("AbortController is not defined. If using lru-cache in node 14, load an AbortController polyfill from the `node-abort-controller` package. A minimal polyfill is provided for use by LRUCache.fetch(), but it should not be relied upon in other contexts (eg, passing it to other APIs that use AbortController/AbortSignal might have undesirable effects). You may disable this with LRU_CACHE_IGNORE_AC_WARNING=1 in the env.","NO_ABORT_CONTROLLER","ENOTSUP",t))}}const M=e=>e&&e===Math.floor(e)&&e>0&&isFinite(e),_=e=>M(e)?e<=Math.pow(2,8)?Uint8Array:e<=Math.pow(2,16)?Uint16Array:e<=Math.pow(2,32)?Uint32Array:e<=Number.MAX_SAFE_INTEGER?R:null:null;class R extends Array{constructor(e){super(e),this.fill(0)}}var b;const E=class e{constructor(t,i){if(a(this,"heap"),a(this,"length"),!c(e,b))throw new TypeError("instantiate Stack using Stack.create(n)");this.heap=new i(t),this.length=0}static create(t){const i=_(t);if(!i)return[];h(e,b,!0);const o=new e(t,i);return h(e,b,!1),o}push(e){this.heap[this.length++]=e}pop(){return this.heap[--this.length]}};b=new WeakMap,u(E,b,!1);let A=E;var P,C,I,z,F,D,O,N,W,G,k,L,U,$,B,Z,Y,j,V,X,H,q,K,J,Q,ee,te,ie,oe,re,se,le,ae,ne,ce,ue,he,me,de,ve,fe,pe,ge,xe,we,Te;let Se=(Te=class{constructor(e){u(this,ee),u(this,I),u(this,z),u(this,F),u(this,D),u(this,O),u(this,N),a(this,"ttl"),a(this,"ttlResolution"),a(this,"ttlAutopurge"),a(this,"updateAgeOnGet"),a(this,"updateAgeOnHas"),a(this,"allowStale"),a(this,"noDisposeOnSet"),a(this,"noUpdateTTL"),a(this,"maxEntrySize"),a(this,"sizeCalculation"),a(this,"noDeleteOnFetchRejection"),a(this,"noDeleteOnStaleGet"),a(this,"allowStaleOnFetchAbort"),a(this,"allowStaleOnFetchRejection"),a(this,"ignoreFetchAbort"),u(this,W),u(this,G),u(this,k),u(this,L),u(this,U),u(this,$),u(this,B),u(this,Z),u(this,Y),u(this,j),u(this,V),u(this,X),u(this,H),u(this,q),u(this,K),u(this,J),u(this,Q),u(this,ie,(()=>{})),u(this,oe,(()=>{})),u(this,re,(()=>{})),u(this,se,(()=>!1)),u(this,ae,(e=>{})),u(this,ne,((e,t,i)=>{})),u(this,ce,((e,t,i,o)=>{if(i||o)throw new TypeError("cannot set size without setting maxSize or maxEntrySize on cache");return 0})),a(this,P,"LRUCache");const{max:t=0,ttl:i,ttlResolution:o=1,ttlAutopurge:r,updateAgeOnGet:s,updateAgeOnHas:l,allowStale:n,dispose:d,disposeAfter:v,n
1oDisposeOnSet:f,noUpdateTTL:p,maxSize:x=0,maxEntrySize:T=0,sizeCalculation:S,fetchMethod:y,memoMethod:R,noDeleteOnFetchRejection:b,noDeleteOnStaleGet:E,allowStaleOnFetchRejection:C,allowStaleOnFetchAbort:ue,ignoreFetchAbort:he}=e;if(0!==t&&!M(t))throw new TypeError("max option must be a nonnegative integer");const me=t?_(t):Array;if(!me)throw new Error("invalid max value: "+t);if(h(this,I,t),h(this,z,x),this.maxEntrySize=T||c(this,z),this.sizeCalculation=S,this.sizeCalculation){if(!c(this,z)&&!this.maxEntrySize)throw new TypeError("cannot set sizeCalculation without setting maxSize or maxEntrySize");if("function"!=typeof this.sizeCalculation)throw new TypeError("sizeCalculation set to non-function")}if(void 0!==R&&"function"!=typeof R)throw new TypeError("memoMethod must be a function if defined");if(h(this,N,R),void 0!==y&&"function"!=typeof y)throw new TypeError("fetchMethod must be a function if specified");if(h(this,O,y),h(this,J,!!y),h(this,k,new Map),h(this,L,new Array(t).fill(void 0)),h(this,U,new Array(t).fill(void 0)),h(this,$,new me(t)),h(this,B,new me(t)),h(this,Z,0),h(this,Y,0),h(this,j,A.create(t)),h(this,W,0),h(this,G,0),"function"==typeof d&&h(this,F,d),"function"==typeof v?(h(this,D,v),h(this,V,[])):(h(this,D,void 0),h(this,V,void 0)),h(this,K,!!c(this,F)),h(this,Q,!!c(this,D)),this.noDisposeOnSet=!!f,this.noUpdateTTL=!!p,this.noDeleteOnFetchRejection=!!b,this.allowStaleOnFetchRejection=!!C,this.allowStaleOnFetchAbort=!!ue,this.ignoreFetchAbort=!!he,0!==this.maxEntrySize){if(0!==c(this,z)&&!M(c(this,z)))throw new TypeError("maxSize must be a positive integer if specified");if(!M(this.maxEntrySize))throw new TypeError("maxEntrySize must be a positive integer if specified");m(this,ee,le).call(this)}if(this.allowStale=!!n,this.noDeleteOnStaleGet=!!E,this.updateAgeOnGet=!!s,this.updateAgeOnHas=!!l,this.ttlResolution=M(o)||0===o?o:1,this.ttlAutopurge=!!r,this.ttl=i||0,this.ttl){if(!M(this.ttl))throw new TypeError("ttl must be a positive integer if specified");m(this,ee,te).call(this)}if(0===c(this,I)&&0===this.ttl&&0===c(this,z))throw new TypeError("At least one of max, maxSize, or ttl is required");if(!this.ttlAutopurge&&!c(this,I)&&!c(this,z)){const e="LRU_CACHE_UNBOUNDED";de=e,!g.has(de)&&(g.add(e),w("TTL caching without ttlAutopurge, max, or maxSize can result in unbounded memory consumption.","UnboundedCacheWarning",e,Te))}var de}static unsafeExposeInternals(e){return{starts:c(e,H),ttls:c(e,q),sizes:c(e,X),keyMap:c(e,k),keyList:c(e,L),valList:c(e,U),next:c(e,$),prev:c(e,B),get head(){return c(e,Z)},get tail(){return c(e,Y)},free:c(e,j),isBackgroundFetch:t=>{var i;return m(i=e,ee,fe).call(i,t)},backgroundFetch:(t,i,o,r)=>{var s;return m(s=e,ee,ve).call(s,t,i,o,r)},moveToTail:t=>{var i;return m(i=e,ee,ge).call(i,t)},indexes:t=>{var i;return m(i=e,ee,ue).call(i,t)},rindexes:t=>{var i;return m(i=e,ee,he).call(i,t)},isStale:t=>{var i;return c(i=e,se).call(i,t)}}}get max(){return c(this,I)}get maxSize(){return c(this,z)}get calculatedSize(){return c(this,G)}get size(){return c(this,W)}get fetchMethod(){return c(this,O)}get memoMethod(){return c(this,N)}get dispose(){return c(this,F)}get disposeAfter(){return c(this,D)}getRemainingTTL(e){return c(this,k).has(e)?1/0:0}*entries(){for(const e of m(this,ee,ue).call(this))void 0!==c(this,U)[e]&&void 0!==c(this,L)[e]&&!m(this,ee,fe).call(this,c(this,U)[e])&&(yield[c(this,L)[e],c(this,U)[e]])}*rentries(){for(const e of m(this,ee,he).call(this))void 0!==c(this,U)[e]&&void 0!==c(this,L)[e]&&!m(this,ee,fe).call(this,c(this,U)[e])&&(yield[c(this,L)[e],c(this,U)[e]])}*keys(){for(const e of m(this,ee,ue).call(this)){const t=c(this,L)[e];void 0!==t&&!m(this,ee,fe).call(this,c(this,U)[e])&&(yield t)}}*rkeys(){for(const e of m(this,ee,he).call(this)){const t=c(this,L)[e];void 0!==t&&!m(this,ee,fe).call(this,c(this,U)[e])&&(yield t)}}*values(){for(const e of m(this,ee,ue).call(this))void 0!==c(this,U)[e]&&!m(this,ee,fe).call(this,c(this,U)[e])&&(yield c(this,U)[e])}*rvalues(){for(const e of m(this,ee,he).call(this))void 0!==c(this,U)[e]&&!m(this,ee,fe).call(this,c(this,U)[e])&&(yield c(this,U)[e])}[(C=Symbol.iterator,P=Symbol.toStringTag,C)](){return this.entries()}find(e,t={}){for(const i of m(this,ee,ue).call(this)){const o=c(this,U)[i],r=m(this,ee,fe).call(this,o)?o.__staleWhileFetching:o;if(void 0!==r&&e(r,c(this,L)[i],this))return this.get(c(this,L)[i],t)}}forEach(e,t=this){for(const i of m(this,ee,ue).call(this)){const o=c(this,U)[i],r=m(this,ee,fe).call(this,o)?o.__staleWhileFetching:o;void 0!==r&&e.call(t,r,c(this,L)[i],this)}}
1rforEach(e,t=this){for(const i of m(this,ee,he).call(this)){const o=c(this,U)[i],r=m(this,ee,fe).call(this,o)?o.__staleWhileFetching:o;void 0!==r&&e.call(t,r,c(this,L)[i],this)}}purgeStale(){let e=!1;for(const t of m(this,ee,he).call(this,{allowStale:!0}))c(this,se).call(this,t)&&(m(this,ee,xe).call(this,c(this,L)[t],"expire"),e=!0);return e}info(e){const t=c(this,k).get(e);if(void 0===t)return;const i=c(this,U)[t],o=m(this,ee,fe).call(this,i)?i.__staleWhileFetching:i;if(void 0===o)return;const r={value:o};if(c(this,q)&&c(this,H)){const e=c(this,q)[t],i=c(this,H)[t];if(e&&i){const t=e-(p.now()-i);r.ttl=t,r.start=Date.now()}}return c(this,X)&&(r.size=c(this,X)[t]),r}dump(){const e=[];for(const t of m(this,ee,ue).call(this,{allowStale:!0})){const i=c(this,L)[t],o=c(this,U)[t],r=m(this,ee,fe).call(this,o)?o.__staleWhileFetching:o;if(void 0===r||void 0===i)continue;const s={value:r};if(c(this,q)&&c(this,H)){s.ttl=c(this,q)[t];const e=p.now()-c(this,H)[t];s.start=Math.floor(Date.now()-e)}c(this,X)&&(s.size=c(this,X)[t]),e.unshift([i,s])}return e}load(e){this.clear();for(const[t,i]of e){if(i.start){const e=Date.now()-i.start;i.start=p.now()-e}this.set(t,i.value,i)}}set(e,t,i={}){var o,r,s,l,a;if(void 0===t)return this.delete(e),this;const{ttl:n=this.ttl,start:u,noDisposeOnSet:v=this.noDisposeOnSet,sizeCalculation:f=this.sizeCalculation,status:p}=i;let{noUpdateTTL:g=this.noUpdateTTL}=i;const x=c(this,ce).call(this,e,t,i.size||0,f);if(this.maxEntrySize&&x>this.maxEntrySize)return p&&(p.set="miss",p.maxEntrySizeExceeded=!0),m(this,ee,xe).call(this,e,"set"),this;let w=0===c(this,W)?void 0:c(this,k).get(e);if(void 0===w)w=0===c(this,W)?c(this,Y):0!==c(this,j).length?c(this,j).pop():c(this,W)===c(this,I)?m(this,ee,de).call(this,!1):c(this,W),c(this,L)[w]=e,c(this,U)[w]=t,c(this,k).set(e,w),c(this,$)[c(this,Y)]=w,c(this,B)[w]=c(this,Y),h(this,Y,w),d(this,W)._++,c(this,ne).call(this,w,x,p),p&&(p.set="add"),g=!1;else{m(this,ee,ge).call(this,w);const i=c(this,U)[w];if(t!==i){if(c(this,J)&&m(this,ee,fe).call(this,i)){i.__abortController.abort(new Error("replaced"));const{__staleWhileFetching:t}=i;void 0!==t&&!v&&(c(this,K)&&(null==(o=c(this,F))||o.call(this,t,e,"set")),c(this,Q)&&(null==(r=c(this,V))||r.push([t,e,"set"])))}else v||(c(this,K)&&(null==(s=c(this,F))||s.call(this,i,e,"set")),c(this,Q)&&(null==(l=c(this,V))||l.push([i,e,"set"])));if(c(this,ae).call(this,w),c(this,ne).call(this,w,x,p),c(this,U)[w]=t,p){p.set="replace";const e=i&&m(this,ee,fe).call(this,i)?i.__staleWhileFetching:i;void 0!==e&&(p.oldValue=e)}}else p&&(p.set="update")}if(0!==n&&!c(this,q)&&m(this,ee,te).call(this),c(this,q)&&(g||c(this,re).call(this,w,n,u),p&&c(this,oe).call(this,p,w)),!v&&c(this,Q)&&c(this,V)){const e=c(this,V);let t;for(;t=null==e?void 0:e.shift();)null==(a=c(this,D))||a.call(this,...t)}return this}pop(){var e;try{for(;c(this,W);){const e=c(this,U)[c(this,Z)];if(m(this,ee,de).call(this,!0),m(this,ee,fe).call(this,e)){if(e.__staleWhileFetching)return e.__staleWhileFetching}else if(void 0!==e)return e}}finally{if(c(this,Q)&&c(this,V)){const t=c(this,V);let i;for(;i=null==t?void 0:t.shift();)null==(e=c(this,D))||e.call(this,...i)}}}has(e,t={}){const{updateAgeOnHas:i=this.updateAgeOnHas,status:o}=t,r=c(this,k).get(e);if(void 0!==r){const e=c(this,U)[r];if(m(this,ee,fe).call(this,e)&&void 0===e.__staleWhileFetching)return!1;if(!c(this,se).call(this,r))return i&&c(this,ie).call(this,r),o&&(o.has="hit",c(this,oe).call(this,o,r)),!0;o&&(o.has="stale",c(this,oe).call(this,o,r))}else o&&(o.has="miss");return!1}peek(e,t={}){const{allowStale:i=this.allowStale}=t,o=c(this,k).get(e);if(void 0===o||!i&&c(this,se).call(this,o))return;const r=c(this,U)[o];return m(this,ee,fe).call(this,r)?r.__staleWhileFetching:r}async fetch(e,t={}){const{allowStale:i=this.allowStale,updateAgeOnGet:o=this.updateAgeOnGet,noDeleteOnStaleGet:r=this.noDeleteOnStaleGet,ttl:s=this.ttl,noDisposeOnSet:l=this.noDisposeOnSet,size:a=0,sizeCalculation:n=this.sizeCalculation,noUpdateTTL:u=this.noUpdateTTL,noDeleteOnFetchRejection:h=this.noDeleteOnFetchRejection,allowStaleOnFetchRejection:d=this.allowStaleOnFetchRejection,ignoreFetchAbort:v=this.ignoreFetchAbort,allowStaleOnFetchAbort:f=this.allowStaleOnFetchAbort,context:p,forceRefresh:g=!1,status:x,signal:w}=t;if(!c(this,J))return x&&(x.fetch="get"),this.get(e,{allowStale:i,updateAgeOnGet:o,noDeleteOnStaleGet:r,status:x});const T={allowStale:i,updateAgeOnGet:o,noDeleteOnStaleGet:r,ttl:s,noDisposeOnSet:l,size:a,sizeCalculation:n,noUpdateTTL:u,noDeleteOnFetchRejection:h,allowStaleOnFetchRejection:d,allowStaleOnFetchAbort:f,ignoreFetchAbort:v,status:x,signal:w};let S=c(this,k).get(e);if(void 0===S){x&&(x.fetch="miss");const t=m(this,ee,ve).call(this,e,S,T,p);return t.__returned=t}{const t=c(this,U)[S];if(m(this,ee,fe).call(this,t)){const e=i&&void 0!==t.__staleWhileFetching;return x&&(x.fetch="inflight",e&&(x.returnedStale=!0)),e?t.__staleWhileFetching:t.__returned=t}const r=c(this,se).call(this,S);if(!g&&!r)return x&&(x.fetch="hit"),m(this,ee,ge).call(this,S),o&&c(this,ie).
1call(this,S),x&&c(this,oe).call(this,x,S),t;const s=m(this,ee,ve).call(this,e,S,T,p),l=void 0!==s.__staleWhileFetching&&i;return x&&(x.fetch=r?"stale":"refresh",l&&r&&(x.returnedStale=!0)),l?s.__staleWhileFetching:s.__returned=s}}async forceFetch(e,t={}){const i=await this.fetch(e,t);if(void 0===i)throw new Error("fetch() returned undefined");return i}memo(e,t={}){const i=c(this,N);if(!i)throw new Error("no memoMethod provided to constructor");const{context:o,forceRefresh:r,...s}=t,l=this.get(e,s);if(!r&&void 0!==l)return l;const a=i(e,l,{options:s,context:o});return this.set(e,a,s),a}get(e,t={}){const{allowStale:i=this.allowStale,updateAgeOnGet:o=this.updateAgeOnGet,noDeleteOnStaleGet:r=this.noDeleteOnStaleGet,status:s}=t,l=c(this,k).get(e);if(void 0!==l){const t=c(this,U)[l],a=m(this,ee,fe).call(this,t);return s&&c(this,oe).call(this,s,l),c(this,se).call(this,l)?(s&&(s.get="stale"),a?(s&&i&&void 0!==t.__staleWhileFetching&&(s.returnedStale=!0),i?t.__staleWhileFetching:void 0):(r||m(this,ee,xe).call(this,e,"expire"),s&&i&&(s.returnedStale=!0),i?t:void 0)):(s&&(s.get="hit"),a?t.__staleWhileFetching:(m(this,ee,ge).call(this,l),o&&c(this,ie).call(this,l),t))}s&&(s.get="miss")}delete(e){return m(this,ee,xe).call(this,e,"delete")}clear(){return m(this,ee,we).call(this,"delete")}},I=new WeakMap,z=new WeakMap,F=new WeakMap,D=new WeakMap,O=new WeakMap,N=new WeakMap,W=new WeakMap,G=new WeakMap,k=new WeakMap,L=new WeakMap,U=new WeakMap,$=new WeakMap,B=new WeakMap,Z=new WeakMap,Y=new WeakMap,j=new WeakMap,V=new WeakMap,X=new WeakMap,H=new WeakMap,q=new WeakMap,K=new WeakMap,J=new WeakMap,Q=new WeakMap,ee=new WeakSet,te=function(){const e=new R(c(this,I)),t=new R(c(this,I));h(this,q,e),h(this,H,t),h(this,re,((i,o,r=p.now())=>{if(t[i]=0!==o?r:0,e[i]=o,0!==o&&this.ttlAutopurge){const e=setTimeout((()=>{c(this,se).call(this,i)&&m(this,ee,xe).call(this,c(this,L)[i],"expire")}),o+1);e.unref&&e.unref()}})),h(this,ie,(i=>{t[i]=0!==e[i]?p.now():0})),h(this,oe,((r,s)=>{if(e[s]){const l=e[s],a=t[s];if(!l||!a)return;r.ttl=l,r.start=a,r.now=i||o();const n=r.now-a;r.remainingTTL=l-n}}));let i=0;const o=()=>{const e=p.now();if(this.ttlResolution>0){i=e;const t=setTimeout((()=>i=0),this.ttlResolution);t.unref&&t.unref()}return e};this.getRemainingTTL=r=>{const s=c(this,k).get(r);if(void 0===s)return 0;const l=e[s],a=t[s];if(!l||!a)return 1/0;return l-((i||o())-a)},h(this,se,(r=>{const s=t[r],l=e[r];return!!l&&!!s&&(i||o())-s>l}))},ie=new WeakMap,oe=new WeakMap,re=new WeakMap,se=new WeakMap,le=function(){const e=new R(c(this,I));h(this,G,0),h(this,X,e),h(this,ae,(t=>{h(this,G,c(this,G)-e[t]),e[t]=0})),h(this,ce,((e,t,i,o)=>{if(m(this,ee,fe).call(this,t))return 0;if(!M(i)){if(!o)throw new TypeError("invalid size value (must be positive integer). When maxSize or maxEntrySize is used, sizeCalculation or size must be set.");if("function"!=typeof o)throw new TypeError("sizeCalculation must be a function");if(i=o(t,e),!M(i))throw new TypeError("sizeCalculation return invalid (expect positive integer)")}return i})),h(this,ne,((t,i,o)=>{if(e[t]=i,c(this,z)){const i=c(this,z)-e[t];for(;c(this,G)>i;)m(this,ee,de).call(this,!0)}h(this,G,c(this,G)+e[t]),o&&(o.entrySize=i,o.totalCalculatedSize=c(this,G))}))},ae=new WeakMap,ne=new WeakMap,ce=new WeakMap,ue=function*({allowStale:e=this.allowStale}={}){if(c(this,W))for(let t=c(this,Y);m(this,ee,me).call(this,t)&&((e||!c(this,se).call(this,t))&&(yield t),t!==c(this,Z));)t=c(this,B)[t]},he=function*({allowStale:e=this.allowStale}={}){if(c(this,W))for(let t=c(this,Z);m(this,ee,me).call(this,t)&&((e||!c(this,se).call(this,t))&&(yield t),t!==c(this,Y));)t=c(this,$)[t]},me=function(e){return void 0!==e&&c(this,k).get(c(this,L)[e])===e},de=function(e){var t,i;const o=c(this,Z),r=c(this,L)[o],s=c(this,U)[o];return c(this,J)&&m(this,ee,fe).call(this,s)?s.__abortController.abort(new Error("evicted")):(c(this,K)||c(this,Q))&&(c(this,K)&&(null==(t=c(this,F))||t.call(this,s,r,"evict")),c(this,Q)&&(null==(i=c(this,V))||i.push([s,r,"evict"]))),c(this,ae).call(this,o),e&&(c(this,L)[o]=void 0,c(this,U)[o]=void 0,c(this,j).push(o)),1===c(this,W)?(h(this,Z,h(this,Y,0)),c(this,j).length=0):h(this,Z,c(this,$)[o]),c(this,k).delete(r),d(this,W)._--,o},ve=function(e,t,i,o){const r=void 0===t?void 0:c(this,U)[t];
1if(m(this,ee,fe).call(this,r))return r;const s=new T,{signal:l}=i;null==l||l.addEventListener("abort",(()=>s.abort(l.reason)),{signal:s.signal});const a={signal:s.signal,options:i,context:o},n=(o,r=!1)=>{const{aborted:l}=s.signal,n=i.ignoreFetchAbort&&void 0!==o;if(i.status&&(l&&!r?(i.status.fetchAborted=!0,i.status.fetchError=s.signal.reason,n&&(i.status.fetchAbortIgnored=!0)):i.status.fetchResolved=!0),l&&!n&&!r)return u(s.signal.reason);const d=h;return c(this,U)[t]===h&&(void 0===o?d.__staleWhileFetching?c(this,U)[t]=d.__staleWhileFetching:m(this,ee,xe).call(this,e,"fetch"):(i.status&&(i.status.fetchUpdated=!0),this.set(e,o,a.options))),o},u=o=>{const{aborted:r}=s.signal,l=r&&i.allowStaleOnFetchAbort,a=l||i.allowStaleOnFetchRejection,n=a||i.noDeleteOnFetchRejection,u=h;if(c(this,U)[t]===h&&(n&&void 0!==u.__staleWhileFetching?l||(c(this,U)[t]=u.__staleWhileFetching):m(this,ee,xe).call(this,e,"fetch")),a)return i.status&&void 0!==u.__staleWhileFetching&&(i.status.returnedStale=!0),u.__staleWhileFetching;if(u.__returned===u)throw o};i.status&&(i.status.fetchDispatched=!0);const h=new Promise(((t,o)=>{var l;const u=null==(l=c(this,O))?void 0:l.call(this,e,r,a);u&&u instanceof Promise&&u.then((e=>t(void 0===e?void 0:e)),o),s.signal.addEventListener("abort",(()=>{(!i.ignoreFetchAbort||i.allowStaleOnFetchAbort)&&(t(void 0),i.allowStaleOnFetchAbort&&(t=e=>n(e,!0)))}))})).then(n,(e=>(i.status&&(i.status.fetchRejected=!0,i.status.fetchError=e),u(e)))),d=Object.assign(h,{__abortController:s,__staleWhileFetching:r,__returned:void 0});return void 0===t?(this.set(e,d,{...a.options,status:void 0}),t=c(this,k).get(e)):c(this,U)[t]=d,d},fe=function(e){if(!c(this,J))return!1;const t=e;return!!t&&t instanceof Promise&&t.hasOwnProperty("__staleWhileFetching")&&t.__abortController instanceof T},pe=function(e,t){c(this,B)[t]=e,c(this,$)[e]=t},ge=function(e){e!==c(this,Y)&&(e===c(this,Z)?h(this,Z,c(this,$)[e]):m(this,ee,pe).call(this,c(this,B)[e],c(this,$)[e]),m(this,ee,pe).call(this,c(this,Y),e),h(this,Y,e))},xe=function(e,t){var i,o,r,s;let l=!1;if(0!==c(this,W)){const r=c(this,k).get(e);if(void 0!==r)if(l=!0,1===c(this,W))m(this,ee,we).call(this,t);else{c(this,ae).call(this,r);const s=c(this,U)[r];if(m(this,ee,fe).call(this,s)?s.__abortController.abort(new Error("deleted")):(c(this,K)||c(this,Q))&&(c(this,K)&&(null==(i=c(this,F))||i.call(this,s,e,t)),c(this,Q)&&(null==(o=c(this,V))||o.push([s,e,t]))),c(this,k).delete(e),c(this,L)[r]=void 0,c(this,U)[r]=void 0,r===c(this,Y))h(this,Y,c(this,B)[r]);else if(r===c(this,Z))h(this,Z,c(this,$)[r]);else{const e=c(this,B)[r];c(this,$)[e]=c(this,$)[r];const t=c(this,$)[r];c(this,B)[t]=c(this,B)[r]}d(this,W)._--,c(this,j).push(r)}}if(c(this,Q)&&null!=(r=c(this,V))&&r.length){const e=c(this,V);let t;for(;t=null==e?void 0:e.shift();)null==(s=c(this,D))||s.call(this,...t)}return l},we=function(e){var t,i,o;for(const r of m(this,ee,he).call(this,{allowStale:!0})){const o=c(this,U)[r];if(m(this,ee,fe).call(this,o))o.__abortController.abort(new Error("deleted"));else{const s=c(this,L)[r];c(this,K)&&(null==(t=c(this,F))||t.call(this,o,s,e)),c(this,Q)&&(null==(i=c(this,V))||i.push([o,s,e]))}}if(c(this,k).clear(),c(this,U).fill(void 0),c(this,L).fill(void 0),c(this,q)&&c(this,H)&&(c(this,q).fill(0),c(this,H).fill(0)),c(this,X)&&c(this,X).fill(0),h(this,Z,0),h(this,Y,0),c(this,j).length=0,h(this,G,0),h(this,W,0),c(this,Q)&&c(this,V)){const e=c(this,V);let t;for(;t=null==e?void 0:e.shift();)null==(o=c(this,D))||o.call(this,...t)}},Te);let ye=null,Me=null,_e=null;function Re(){if(!Me||!_e){Me=document.createElement("canvas"),_e=Me.getContext("webgl2");const e=null==_e?void 0:_e.getParameter(_e.MAX_TEXTURE_IMAGE_UNITS);ye=new Se({max:e,dispose:(e,t)=>{Re().deleteTexture(e)}})}return _e}function be(e){return`vec4(${(e[0]/255).toFixed(3)},${(e[1]/255).toFixed(3)},${(e[2]/255).toFixed(3)},${((e[3]??255)/255).toFixed(3)})`}function Ee(e){return 180/Math.PI*Math.log(Math.tan(Math.PI/4+e*Math.PI/360))/360}function Ae(e,t){return[e/360,Ee(t)]}const Pe=2*Math.PI*6378137;function Ce(e,t){return Ae(e,t).map((e=>e*Pe))}function Ie(e,t,i){const o=Math.floor(t*e.width),r=Math.floor(i*e.height),s=Re();if(null==s)throw new Error("Failed to obtain WebGL2 context");if(!ye)throw new Error("Could not initialize texture cache");let l;s.activeTexture(s.TEXTURE0),ye.has(e)?l=ye.get(e):(l=s.createTexture(),s.bindTexture(s.TEXTURE_2D,l),s.texImage2D(s.TEXTURE_2D,0,s.RGBA,s.RGBA,s.UNSIGNED_BYTE,e),ye.set(e,l));const a=s.createFramebuffer();s.bindFramebuffer(s.FRAMEBUFFER,a),s.framebufferTexture2D(s.FRAMEBUFFER,s.COLOR_ATTACHMENT0,s.TEXTURE_2D,l,0),s.drawBuffers([s.COLOR_ATTACHMENT0]);const n=new Uint8Array(4);return s.readPixels(o,r,1,1,s.RGBA,s.UNSIGNED_BYTE,n),s.deleteFramebuffer(a),{r:n[0]/255,g:n[1]/255,b:n[2]/255,a:n[3]/255}}function ze(e,t){const i=function(e,t){const i=Ae(e,t);return[i[0]+.5,-1*i[1]+.5]}(e.lng,e.lat),o=2**t;return{z:t,x:i[0]*o,y:i[1]*o}}function Fe(e,t){const i=~~t,o=ze(e.getNorthWest(),i),r=ze(e.getSouthEast(),i),s=[];for(let l=Math.floor(o.x);l<=r.x;l+=1)for(let e=Math.floor(o.y);e<=Math.floor(r.y);e+=1)s.push(`${t}/${l}/${e}`);return s}function De(e,t=50){if(e.length<=t)return e;const i=function(e){return e.filter(((t,i)=>0===i||i%2||i===e.length-1))}(e);return De(i,t)}
1function Oe(e,t,i={inputName:"v",outputName:"c"}){const o=De(e);let r="";for(let s=0;s<o.length;s++){const e=o[s];0===s&&(r+=`vec4 ${i.outputName}=${be(e.color)};\n`);const l=e.value,a=be(e.color);if(t&&s+1<o.length){const e=o[s+1].value,t=be(o[s+1].color),n=0===Number.parseFloat((l-e).toFixed(7))?"0.":`(${i.inputName} - ${l.toFixed(7)}) / (${(e-l).toFixed(7)})`;r+=`${s>0?" else ":""} if(${i.inputName}>=${l.toFixed(7)}&&${i.inputName}<${e.toFixed(7)}) { ${i.outputName}=mix(${a},${t}, ${n} ); }\n`}else r+=`if(${i.inputName}>=${l.toFixed(7)})${i.outputName}=${a};\n`}return r}class Ne{constructor(e,t){this.code=e,this.decode=t,this.decode.min=this.decode.min??0,this.decode.max=this.decode.max??1}codeValue(e){return(e-this.decode.min)/(this.decode.max-this.decode.min)}decodeValue(e){return this.decode.min+e*(this.decode.max-this.decode.min)}decodeChannel(e){if(this.decode.channel.length>1){const t=this.decodeValue(e[this.decode.channel[0]]),i=this.decodeValue(e[this.decode.channel[1]]);return[t,i,Math.sqrt(t*t+i*i)]}return this.decodeValue(e[this.decode.channel])}getBlendCode(e){return`vec4 ${e}(vec4 d,vec4 data){${`${this.code} d.rgb=(d.rgb*d.a*(1.-c.a)+c.rgb*c.a)/(d.a*(1.-c.a)+c.a); d.a=d.a+c.a*(1.-d.a);`}return d;}`}getCode(e){return`vec4 ${e}(vec4 data){${this.code}return c;}`}}function We({channel:e="r",min:t=0,max:i=1}){let o=`${t.toFixed(7)}+data.${e}*${(i-t).toFixed(7)}`;return e.length>1&&(o=`length(${o})`),`float v=${o};`}class Ge extends Ne{constructor(e){const t=e.decode,i=e.stops||[{value:t.min,color:[0,0,0,0]},{value:t.max,color:[255,255,255,255]}],o=e.smooth??!0,r=e.opacity??1;let s=We(t);s+=Oe(i,o),s+=`c.a*=${r.toFixed(3)};`,super(s,t)}}const ke=class e extends Array{constructor(e={}){super(),a(this,"min",0),a(this,"max",1),"min"in e&&(this.min=e.min),"max"in e&&(this.max=e.max),"stops"in e&&this.setStops(e.stops,{clone:!1})}static fromArrayDefinition(t){return new e({stops:t.map((e=>({value:e[0],color:e[1]})))})}setStops(e,t={clone:!0}){const i=t.clone?this.clone():this;i.length=0;let o=Number.POSITIVE_INFINITY,r=Number.NEGATIVE_INFINITY;for(let s=0;s<e.length;s+=1)o=Math.min(o,e[s].value),r=Math.max(r,e[s].value),i.push({value:e[s].value,color:e[s].color.slice()});return i.sort(((e,t)=>e.value<t.value?-1:1)),this.min=o,this.max=r,i}scale(t,i,o={clone:!0}){const r=o.clone,s=this[0].value,l=this.at(-1).value-s,a=i-t,n=[];for(let e=0;e<this.length;e+=1){const i=(this[e].value-s)/l*a+t;r?n.push({value:i,color:this[e].color.slice()}):this[e].value=i}return r?new e({stops:n}):this}at(e){return e<0?this[this.length+e]:this[e]}clone(){return new e({stops:this.getRawColorStops()})}getRawColorStops(){const e=[];for(let t=0;t<this.length;t+=1)e.push(this[t]);return e}reverse(e={clone:!0}){const t=e.clone?this.clone():this;for(let i=0;i<~~(t.length/2);i+=1){const e=t[i].color;t[i].color=t.at(-(i+1)).color,t.at(-(i+1)).color=e}return t}getBounds(){return{min:this.min,max:this.max}}getColor(e,t={smooth:!0}){if(e<=this[0].value)return this[0].color;if(e>=this.at(-1).value)return this.at(-1).color;for(let i=0;i<this.length-1;i+=1){if(e>this[i+1].value)continue;const o=this[i].color;if(!t.smooth)return o.slice();const r=this[i].value,s=this[i+1].value,l=this[i+1].color,a=(s-e)/(s-r);return o.map(((e,t)=>Math.round(e*a+l[t]*(1-a))))}return[0,0,0]}getCanvasStrip(e={horizontal:!0,size:512,smooth:!0}){const t=document.createElement("canvas");t.width=e.horizontal?e.size:1,t.height=e.horizontal?1:e.size;const i=t.getContext("2d");if(!i)throw new Error("Canvs context is missing");const o=i.getImageData(0,0,t.width,t.height),r=o.data,s=e.size,l=this[0].value,a=(this.at(-1).value-l)/s;for(let n=0;n<s;n+=1){const t=this.getColor(l+n*a,{smooth:e.smooth});r[4*n]=t[0],r[4*n+1]=t[1],r[4*n+2]=t[2],r[4*n+3]=t.length>3?t[3]:255}return i.putImageData(o,0,0),t}};a(ke,"builtin",{NULL:new ke({stops:[{value:0,color:[0,0,0,0]},{value:1,color:[0,0,0,0]}]}),JET:new ke({stops:[{value:0,color:[0,0,131]},{value:.125,color:[0,60,170]},{value:.375,color:[5,255,255]},{value:.625,color:[255,255,0]},{value:.875,color:[250,0,0]},{value:1,color:[128,0,0]}]}),HSV:new ke({stops:[{value:0,color:[255,0,0]},{value:.169,color:[253,255,2]},{value:.173,color:[247,255,2]},{value:.337,color:[0,252,4]},{value:.341,color:[0,252,10]},{value:.506,color:[1,249,255]},{value:.671,color:[2,0,253]},{value:.675,color:[8,0,253]},{value:.839,color:[255,0,251]},{value:.843,color:[255,0,245]},{value:1,color:[255,0,6]}]}),HOT:new ke({stops:[{value:0,color:[0,0,0]},{value:.3,color:[230,0,0]},{value:.6,color:[255,210,0]},{value:1,color:[255,255,255]}]}),SPRING:new ke({stops:[{value:0,color:[255,0,255]},{value:1,color:[255,255,0]}]}),SUMMER:new ke({stops:[{value:0,color:[0,128,102]},{value:1,color:[255,255,102]}]}),AUTOMN:new ke({stops:[{value:0,color:[255,0,0]},{value:1,color:[255,255,0]}]}),WINTER:new ke({stops:[{value:0,color:[0,0,255]},{value:1,color:[0,255,128]}]}),BONE:new ke({stops:[{value:0,color:[0,0,0]},{value:.376,color:[84,84,116]},{value:.753,color:[169,200,200]},{value:1,color:[255,255,255]}]}),COPPER:new ke({stops:[{value:0,color:[0,0,0]},{value:.804,color:[255,160,102]},{value:1,color:[255,199,127]}]}),GREYS:new ke({stops:[{value:0,color:[0,0,0]},{value:1,color:[255,255,255]}]}),YIGNBU:new ke({stops:[{value:0,color:[8,29,88]},{value:.125,color:[37,52,148]},{value:.25,color:[34,94,168]},{value:.375,color:[29,145,192]},{value:.5,color:[65,182,196]},{value:.625,color:[127,205,187]}
1,{value:.75,color:[199,233,180]},{value:.875,color:[237,248,217]},{value:1,color:[255,255,217]}]}),GREENS:new ke({stops:[{value:0,color:[0,68,27]},{value:.125,color:[0,109,44]},{value:.25,color:[35,139,69]},{value:.375,color:[65,171,93]},{value:.5,color:[116,196,118]},{value:.625,color:[161,217,155]},{value:.75,color:[199,233,192]},{value:.875,color:[229,245,224]},{value:1,color:[247,252,245]}]}),YIORRD:new ke({stops:[{value:0,color:[128,0,38]},{value:.125,color:[189,0,38]},{value:.25,color:[227,26,28]},{value:.375,color:[252,78,42]},{value:.5,color:[253,141,60]},{value:.625,color:[254,178,76]},{value:.75,color:[254,217,118]},{value:.875,color:[255,237,160]},{value:1,color:[255,255,204]}]}),BLUERED:new ke({stops:[{value:0,color:[0,0,255]},{value:1,color:[255,0,0]}]}),RDBU:new ke({stops:[{value:0,color:[5,10,172]},{value:.35,color:[106,137,247]},{value:.5,color:[190,190,190]},{value:.6,color:[220,170,132]},{value:.7,color:[230,145,90]},{value:1,color:[178,10,28]}]}),PICNIC:new ke({stops:[{value:0,color:[0,0,255]},{value:.1,color:[51,153,255]},{value:.2,color:[102,204,255]},{value:.3,color:[153,204,255]},{value:.4,color:[204,204,255]},{value:.5,color:[255,255,255]},{value:.6,color:[255,204,255]},{value:.7,color:[255,153,255]},{value:.8,color:[255,102,204]},{value:.9,color:[255,102,102]},{value:1,color:[255,0,0]}]}),RAINBOW:new ke({stops:[{value:0,color:[150,0,90]},{value:.125,color:[0,0,200]},{value:.25,color:[0,25,255]},{value:.375,color:[0,152,255]},{value:.5,color:[44,255,150]},{value:.625,color:[151,255,0]},{value:.75,color:[255,234,0]},{value:.875,color:[255,111,0]},{value:1,color:[255,0,0]}]}),PORTLAND:new ke({stops:[{value:0,color:[12,51,131]},{value:.25,color:[10,136,186]},{value:.5,color:[242,211,56]},{value:.75,color:[242,143,56]},{value:1,color:[217,30,30]}]}),BLACKBODY:new ke({stops:[{value:0,color:[0,0,0]},{value:.2,color:[230,0,0]},{value:.4,color:[230,210,0]},{value:.7,color:[255,255,255]},{value:1,color:[160,200,255]}]}),EARTH:new ke({stops:[{value:0,color:[0,0,130]},{value:.1,color:[0,180,180]},{value:.2,color:[40,210,40]},{value:.4,color:[230,230,50]},{value:.6,color:[120,70,20]},{value:1,color:[255,255,255]}]}),ELECTRIC:new ke({stops:[{value:0,color:[0,0,0]},{value:.15,color:[30,0,100]},{value:.4,color:[120,0,100]},{value:.6,color:[160,90,0]},{value:.8,color:[230,200,0]},{value:1,color:[255,250,220]}]}),VIRIDIS:new ke({stops:[{value:0,color:[68,1,84]},{value:.13,color:[71,44,122]},{value:.25,color:[59,81,139]},{value:.38,color:[44,113,142]},{value:.5,color:[33,144,141]},{value:.63,color:[39,173,129]},{value:.75,color:[92,200,99]},{value:.88,color:[170,220,50]},{value:1,color:[253,231,37]}]}),INFERNO:new ke({stops:[{value:0,color:[0,0,4]},{value:.13,color:[31,12,72]},{value:.25,color:[85,15,109]},{value:.38,color:[136,34,106]},{value:.5,color:[186,54,85]},{value:.63,color:[227,89,51]},{value:.75,color:[249,140,10]},{value:.88,color:[249,201,50]},{value:1,color:[252,255,164]}]}),MAGMA:new ke({stops:[{value:0,color:[0,0,4]},{value:.13,color:[28,16,68]},{value:.25,color:[79,18,123]},{value:.38,color:[129,37,129]},{value:.5,color:[181,54,122]},{value:.63,color:[229,80,100]},{value:.75,color:[251,135,97]},{value:.88,color:[254,194,135]},{value:1,color:[252,253,191]}]}),PLASMA:new ke({stops:[{value:0,color:[13,8,135]},{value:.13,color:[75,3,161]},{value:.25,color:[125,3,168]},{value:.38,color:[168,34,150]},{value:.5,color:[203,70,121]},{value:.63,color:[229,107,93]},{value:.75,color:[248,148,65]},{value:.88,color:[253,195,40]},{value:1,color:[240,249,33]}]}),WARM:new ke({stops:[{value:0,color:[125,0,179]},{value:.13,color:[172,0,187]},{value:.25,color:[219,0,170]},{value:.38,color:[255,0,130]},{value:.5,color:[255,63,74]},{value:.63,color:[255,123,0]},{value:.75,color:[234,176,0]},{value:.88,color:[190,228,0]},{value:1,color:[147,255,0]}]}),COOL:new ke({stops:[{value:0,color:[125,0,179]},{value:.13,color:[116,0,218]},{value:.25,color:[98,74,237]},{value:.38,color:[68,146,231]},{value:.5,color:[0,204,197]},{value:.63,color:[0,247,146]},{value:.75,color:[0,255,88]},{value:.88,color:[40,255,8]},{value:1,color:[147,255,0]}]}),RAINBOW_SOFT:new ke({stops:[{value:0,color:[125,0,179]},{value:.1,color:[199,0,180]},{value:.2,color:[255,0,121]},{value:.3,color:[255,108,0]},{value:.4,color:[222,194,0]},{value:.5,color:[150,255,0]},{value:.6,color:[0,255,55]},{value:.7,color:[0,246,150]},{value:.8,color:[50,167,222]},{value:.9,color:[103,51,235]},{value:1,color:[124,0,186]}]}),BATHYMETRY:new ke({stops:[{value:0,color:[40,26,44]},{value:.13,color:[59,49,90]},{value:.25,color:[64,76,139]},{value:.38,color:[63,110,151]},{value:.5,color:[72,142,158]},{value:.63,color:[85,174,163]}
1,{value:.75,color:[120,206,163]},{value:.88,color:[187,230,172]},{value:1,color:[253,254,204]}]}),CDOM:new ke({stops:[{value:0,color:[47,15,62]},{value:.13,color:[87,23,86]},{value:.25,color:[130,28,99]},{value:.38,color:[171,41,96]},{value:.5,color:[206,67,86]},{value:.63,color:[230,106,84]},{value:.75,color:[242,149,103]},{value:.88,color:[249,193,135]},{value:1,color:[254,237,176]}]}),CHLOROPHYLL:new ke({stops:[{value:0,color:[18,36,20]},{value:.13,color:[25,63,41]},{value:.25,color:[24,91,59]},{value:.38,color:[13,119,72]},{value:.5,color:[18,148,80]},{value:.63,color:[80,173,89]},{value:.75,color:[132,196,122]},{value:.88,color:[175,221,162]},{value:1,color:[215,249,208]}]}),DENSITY:new ke({stops:[{value:0,color:[54,14,36]},{value:.13,color:[89,23,80]},{value:.25,color:[110,45,132]},{value:.38,color:[120,77,178]},{value:.5,color:[120,113,213]},{value:.63,color:[115,151,228]},{value:.75,color:[134,185,227]},{value:.88,color:[177,214,227]},{value:1,color:[230,241,241]}]}),FREESURFACE_BLUE:new ke({stops:[{value:0,color:[30,4,110]},{value:.13,color:[47,14,176]},{value:.25,color:[41,45,236]},{value:.38,color:[25,99,212]},{value:.5,color:[68,131,200]},{value:.63,color:[114,156,197]},{value:.75,color:[157,181,203]},{value:.88,color:[200,208,216]},{value:1,color:[241,237,236]}]}),FREESURFACE_RED:new ke({stops:[{value:0,color:[60,9,18]},{value:.13,color:[100,17,27]},{value:.25,color:[142,20,29]},{value:.38,color:[177,43,27]},{value:.5,color:[192,87,63]},{value:.63,color:[205,125,105]},{value:.75,color:[216,162,148]},{value:.88,color:[227,199,193]},{value:1,color:[241,237,236]}]}),OXYGEN:new ke({stops:[{value:0,color:[64,5,5]},{value:.13,color:[106,6,15]},{value:.25,color:[144,26,7]},{value:.38,color:[168,64,3]},{value:.5,color:[188,100,4]},{value:.63,color:[206,136,11]},{value:.75,color:[220,174,25]},{value:.88,color:[231,215,44]},{value:1,color:[248,254,105]}]}),PAR:new ke({stops:[{value:0,color:[51,20,24]},{value:.13,color:[90,32,35]},{value:.25,color:[129,44,34]},{value:.38,color:[159,68,25]},{value:.5,color:[182,99,19]},{value:.63,color:[199,134,22]},{value:.75,color:[212,171,35]},{value:.88,color:[221,210,54]},{value:1,color:[225,253,75]}]}),PHASE:new ke({stops:[{value:0,color:[145,105,18]},{value:.13,color:[184,71,38]},{value:.25,color:[186,58,115]},{value:.38,color:[160,71,185]},{value:.5,color:[110,97,218]},{value:.63,color:[50,123,164]},{value:.75,color:[31,131,110]},{value:.88,color:[77,129,34]},{value:1,color:[145,105,18]}]}),SALINITY:new ke({stops:[{value:0,color:[42,24,108]},{value:.13,color:[33,50,162]},{value:.25,color:[15,90,145]},{value:.38,color:[40,118,137]},{value:.5,color:[59,146,135]},{value:.63,color:[79,175,126]},{value:.75,color:[120,203,104]},{value:.88,color:[193,221,100]},{value:1,color:[253,239,154]}]}),TEMPERATURE:new ke({stops:[{value:0,color:[4,35,51]},{value:.13,color:[23,51,122]},{value:.25,color:[85,59,157]},{value:.38,color:[129,79,143]},{value:.5,color:[175,95,130]},{value:.63,color:[222,112,101]},{value:.75,color:[249,146,66]},{value:.88,color:[249,196,65]},{value:1,color:[232,250,91]}]}),TURBIDITY:new ke({stops:[{value:0,color:[34,31,27]},{value:.13,color:[65,50,41]},{value:.25,color:[98,69,52]},{value:.38,color:[131,89,57]},{value:.5,color:[161,112,59]},{value:.63,color:[185,140,66]},{value:.75,color:[202,174,88]},{value:.88,color:[216,209,126]},{value:1,color:[233,246,171]}]}),VELOCITY_BLUE:new ke({stops:[{value:0,color:[17,32,64]},{value:.13,color:[35,52,116]},{value:.25,color:[29,81,156]},{value:.38,color:[31,113,162]},{value:.5,color:[50,144,169]},{value:.63,color:[87,173,176]},{value:.75,color:[149,196,189]},{value:.88,color:[203,221,211]},{value:1,color:[254,251,230]}]}),VELOCITY_GREEN:new ke({stops:[{value:0,color:[23,35,19]},{value:.13,color:[24,64,38]},{value:.25,color:[11,95,45]},{value:.38,color:[39,123,35]},{value:.5,color:[95,146,12]},{value:.63,color:[152,165,18]},{value:.75,color:[201,186,69]},{value:.88,color:[233,216,137]},{value:1,color:[255,253,205]}]}),CUBEHELIX:new ke({stops:[{value:0,color:[0,0,0]},{value:.07,color:[22,5,59]},{value:.13,color:[60,4,105]},{value:.2,color:[109,1,135]},{value:.27,color:[161,0,147]},{value:.33,color:[210,2,142]},{value:.4,color:[251,11,123]},{value:.47,color:[255,29,97]},{value:.53,color:[255,54,69]},{value:.6,color:[255,85,46]},{value:.67,color:[255,120,34]},{value:.73,color:[255,157,37]},{value:.8,color:[241,191,57]},{value:.87,color:[224,220,93]},{value:.93,color:[218,241,142]},{value:1,color:[227,253,198]}]}),CIVIDIS:new ke({stops:[{value:0,color:[0,32,77,255]},{value:.125,color:[5,54,110,255]},{value:.25,color:[65,77,108,255]},{value:.375,color:[97,100,111,255]},{value:.5,color:[125,124,121,255]},{value:.625,color:[156,149,120,255]}
1,{value:.75,color:[190,175,111,255]},{value:.875,color:[225,204,94,255]},{value:1,color:[255,235,70,255]}]}),TURBO:new ke({stops:[{value:0,color:[48,18,59,255]},{value:.125,color:[70,107,227,255]},{value:.25,color:[40,187,236,255]},{value:.375,color:[49,242,153,255]},{value:.5,color:[162,252,60,255]},{value:.625,color:[237,208,58,255]},{value:.75,color:[251,128,34,255]},{value:.875,color:[210,49,5,255]},{value:1,color:[122,4,3,255]}]}),ROCKET:new ke({stops:[{value:0,color:[250,235,221,0]},{value:.133,color:[250,235,221,255]},{value:.266,color:[246,170,130,255]},{value:.4,color:[240,96,67,255]},{value:.533,color:[203,27,79,255]},{value:.666,color:[132,30,90,255]},{value:.8,color:[63,27,68,255]},{value:1,color:[3,5,26,255]}]}),MAKO:new ke({stops:[{value:0,color:[11,4,5,255]},{value:.125,color:[43,28,53,255]},{value:.25,color:[62,53,107,255]},{value:.375,color:[59,86,152,255]},{value:.5,color:[53,123,162,255]},{value:.625,color:[53,158,170,255]},{value:.75,color:[73,193,173,255]},{value:.875,color:[150,221,181,255]},{value:1,color:[222,245,229,255]}]}),TERRAIN:new ke({stops:[{value:-10001,color:[0,20,60]},{value:-5e3,color:[0,10,30]},{value:-1e3,color:[0,30,80]},{value:-100,color:[0,38,115]},{value:0,color:[122,200,255]},{value:10,color:[51,102,0]},{value:500,color:[129,195,31]},{value:800,color:[255,255,204]},{value:1200,color:[244,189,69]},{value:2e3,color:[132,75,0]},{value:3e3,color:[102,51,12]},{value:8e3,color:[255,255,255]}]}),PRESSURE:new ke({stops:[{value:900,color:[0,0,100,250]},{value:950,color:[0,0,255,250]},{value:980,color:[0,0,255,120]},{value:1e3,color:[255,255,255,0]},{value:1020,color:[255,0,0,120]},{value:1080,color:[255,0,0,250]}]}),PRESSURE_2:new ke({stops:[{value:900,color:[8,16,48,255]},{value:950,color:[0,32,96,255]},{value:976,color:[0,52,146,255]},{value:986,color:[0,90,148,255]},{value:995,color:[0,117,146,255]},{value:1002,color:[26,140,147,255]},{value:1007,color:[103,162,155,255]},{value:1011,color:[155,183,172,255]},{value:1013,color:[182,182,182,255]},{value:1015,color:[176,174,152,255]},{value:1019,color:[167,147,107,255]},{value:1024,color:[163,116,67,255]},{value:1030,color:[159,81,44,255]},{value:1038,color:[142,47,57,255]},{value:1046,color:[111,24,64,255]},{value:1080,color:[48,8,24,255]}]}),PRESSURE_3:new ke({stops:[{value:900,color:[40,46,117,255]},{value:950,color:[40,51,121,255]},{value:976,color:[42,63,125,255]},{value:986,color:[55,97,141,255]},{value:995,color:[69,115,150,255]},{value:1002,color:[87,144,168,255]},{value:1007,color:[125,184,194,255]},{value:1011,color:[195,226,226,255]},{value:1013,color:[245,220,196,255]},{value:1015,color:[232,191,160,255]},{value:1019,color:[219,154,125,255]},{value:1024,color:[210,115,98,255]},{value:1030,color:[194,72,67,255]},{value:1038,color:[199,61,60,255]},{value:1046,color:[177,50,54,255]},{value:1080,color:[159,42,48,255]}]}),PRESSURE_4:new ke({stops:[{value:900,color:[40,46,117,255]},{value:950,color:[40,51,121,255]},{value:976,color:[42,63,125,255]},{value:986,color:[55,97,141,255]},{value:995,color:[69,115,150,255]},{value:1002,color:[87,144,168,255]},{value:1007,color:[125,184,194,255]},{value:1012.5,color:[226,226,226,255]},{value:1013.5,color:[226,226,226,255]},{value:1015,color:[232,191,160,255]},{value:1019,color:[219,154,125,255]},{value:1024,color:[210,115,98,255]},{value:1030,color:[194,72,67,255]},{value:1038,color:[199,61,60,255]},{value:1046,color:[177,50,54,255]},{value:1080,color:[159,42,48,255]}]}),TEMPERATURE_2:new ke({stops:[{value:-70.15,color:[115,70,105,255]},{value:-55.15,color:[202,172,195,255]},{value:-40.15,color:[162,70,145,255]},{value:-25.15,color:[143,89,169,255]},{value:-15.15,color:[157,219,217,255]},{value:-8.15,color:[106,191,181,255]},{value:-4.15,color:[100,166,189,255]},{value:0,color:[93,133,198,255]},{value:.85,color:[68,125,99,255]},{value:9.85,color:[128,147,24,255]},{value:20.85,color:[243,183,4,255]},{value:29.85,color:[232,83,25,255]},{value:46.85,color:[71,14,0,255]}]}),TEMPERATURE_3:new ke({stops:[{value:-65,color:[3,78,77,255]},{value:-55,color:[4,98,96,255]},{value:-40,color:[5,122,120,255]},{value:-30,color:[6,152,149,255]},{value:-20,color:[8,201,198,255]},{value:-15,color:[20,245,241,255]}
1,{value:-10,color:[108,237,249,255]},{value:-5,color:[133,205,250,255]},{value:0,color:[186,227,252,255]},{value:5,color:[238,221,145,255]},{value:10,color:[232,183,105,255]},{value:15,color:[232,137,69,255]},{value:20,color:[231,107,24,255]},{value:25,color:[236,84,19,255]},{value:30,color:[236,44,19,255]},{value:40,color:[123,23,10,255]},{value:55,color:[91,11,0,255]}]}),PRECIPITATION:new ke({stops:[{value:0,color:[111,111,111,0]},{value:.6,color:[60,116,160,180]},{value:6,color:[59,161,161,255]},{value:8,color:[59,161,61,255]},{value:10,color:[130,161,59,255]},{value:15,color:[161,161,59,255]},{value:20,color:[161,59,59,255]},{value:31,color:[161,59,161,255]},{value:50,color:[168,168,168,255]}]}),PRECIPITATION_2:new ke({stops:[{value:0,color:[255,255,255,0]},{value:.1,color:[171,218,252,255]},{value:1,color:[98,186,249,255]},{value:2,color:[87,160,240,255]},{value:4,color:[112,128,250,255]},{value:6,color:[128,102,245,255]},{value:8,color:[152,102,245,255]},{value:10,color:[154,87,172,255]},{value:15,color:[228,88,126,255]},{value:20,color:[247,135,95,255]},{value:30,color:[249,206,64,255]},{value:50,color:[250,248,168,52]}]}),RADAR:new ke({stops:[{value:0,color:[7,235,236,0]},{value:4,color:[7,235,236,80]},{value:5,color:[7,235,236,255]},{value:10,color:[0,159,246,255]},{value:15,color:[0,0,247,255]},{value:20,color:[3,255,0,255]},{value:25,color:[0,200,2,255]},{value:30,color:[1,144,0,255]},{value:35,color:[255,255,0,255]},{value:40,color:[231,192,0,255]},{value:45,color:[255,145,3,255]},{value:50,color:[255,0,0,255]},{value:55,color:[215,0,0,255]},{value:60,color:[192,0,0,255]},{value:65,color:[255,0,255,255]},{value:70,color:[155,85,200,255]},{value:75,color:[235,235,235,255]}]}),RADAR_CLOUD:new ke({stops:[{value:4,color:[134,134,176,0]},{value:7,color:[134,134,176,30]},{value:10,color:[134,134,176,60]},{value:20,color:[110,110,145,80]},{value:35,color:[77,77,105,140]},{value:45,color:[58,58,87,180]},{value:60,color:[26,26,51,220]}]}),PRESSURE_CIVIDIS:new ke({stops:[{value:900,color:[0,32,77,255]},{value:950,color:[0,37,82,255]},{value:976,color:[15,56,110,255]},{value:986,color:[49,68,107,255]},{value:995,color:[70,80,107,255]},{value:1002,color:[87,92,109,255]},{value:1007,color:[102,105,112,255]},{value:1011,color:[117,117,117,255]},{value:1013,color:[132,130,121,255]},{value:1015,color:[149,143,120,255]},{value:1019,color:[166,157,117,255]},{value:1024,color:[184,171,112,255]},{value:1030,color:[203,186,105,255]},{value:1038,color:[221,201,95,255]},{value:1046,color:[250,229,65,255]},{value:1080,color:[255,234,70,255]}]}),RADAR_ROCKET:new ke({stops:[{value:0,color:[250,235,221,0]},{value:.1,color:[250,235,221,255]},{value:10,color:[246,180,142,255]},{value:20,color:[243,118,81,255]},{value:30,color:[225,51,66,255]},{value:40,color:[174,23,89,255]},{value:50,color:[112,31,87,255]},{value:60,color:[54,25,62,255]},{value:75,color:[3,5,26,255]}]}),WIND_ROCKET:new ke({stops:[{value:0,color:[250,235,221,255]},{value:1,color:[246,187,151,255]},{value:3,color:[244,135,94,255]},{value:5,color:[236,75,62,255]},{value:10,color:[203,27,79,255]},{value:15,color:[150,28,91,255]},{value:20,color:[97,31,83,255]},{value:25,color:[48,23,58,255]},{value:30,color:[3,5,26,255]}]}),MAKO_PRECIPITATION:new ke({stops:[{value:0,color:[255,255,255,0]},{value:.1,color:[222,245,229,255]},{value:1,color:[168,225,188,255]},{value:2,color:[96,206,172,255]},{value:4,color:[61,180,173,255]},{value:6,color:[52,151,169,255]},{value:8,color:[53,123,162,255]},{value:10,color:[57,93,156,255]},{value:15,color:[65,64,129,255]},{value:20,color:[56,42,84,255]},{value:30,color:[38,23,42,255]},{value:50,color:[11,4,5,255]}]}),TEMPERATURE_TURBO:new ke({stops:[{value:-65,color:[48,18,59,255]},{value:-55,color:[64,64,162,255]},{value:-40,color:[70,107,227,255]},{value:-30,color:[66,147,255,255]},{value:-20,color:[40,187,236,255]},{value:-15,color:[24,220,195,255]},{value:-10,color:[49,242,153,255]},{value:-5,color:[107,254,100,255]},{value:0,color:[162,252,60,255]},{value:5,color:[204,237,52,255]},{value:10,color:[237,208,58,255]},{value:15,color:[253,173,53,255]},{value:20,color:[231,107,24,255]},{value:25,color:[236,82,15,255]},{value:30,color:[210,49,5,255]},{value:40,color:[172,23,1,255]},{value:55,color:[122,4,3,255]}]})});let Le=ke;const Ue="api.maptiler.com",$e={maptilerApiHost:Ue,endpoint:`https://${Ue}/weather/latest.json`,tileSourceUrlSchema:`https://${Ue}/tiles/{tileset_id}/{zxy}.{format}`};Object.freeze($e);const Be="temperature-2m:gfs",Ze="pressure-msl:gfs",Ye="precipitation-1h:gfs",je="frozen_precipitation-1h:gfs",Ve="wind-10m:gfs",Xe="radar-composite:gfs",He="cloud_cover-total:gfs",qe={latest:null};class Ke{static async fetchLatest(e,t){const i=`${$e.endpoint}?key=${e}&mtsid=${t}`,o=await fetch(i,{cache:"no-store"});qe.latest=await o.json()}static getDataForWeatherVariableID(e){if(!qe.latest)return null;const t=qe.latest.variables.filter((t=>t.metadata.weather_variable.variable_id===e));return t.length?t[0]:null}static hasData(){return!!qe.latest}static getTemperatureData(){return Ke.getDataForWeatherVariableID(Be)}static getPressureData(){return Ke.getDataForWeatherVariableID(Ze)}static getPrecipitationData(){return Ke.getDataForWeatherVariableID(Ye)}static getCloudCoverData(){return Ke.getDataForWeatherVariableID(He)}static getFrozenPrecipitationData(){return Ke.getDataForWeatherVariableID(je)}static getRadarData(){return Ke.getDataForWeatherVariableID(Xe)}
1static getWindData(){return Ke.getDataForWeatherVariableID(Ve)}static getSourcesAndTimestamps(e,t,i){return e.keyframes.map((o=>({source:`${$e.tileSourceUrlSchema.replace("{tileset_id}",o.id).replace("{format}",e.tile_format)}?key=${t}&mtsid=${i}`,timestamp:+new Date(o.timestamp)/1e3})))}}class Je{constructor(){a(this,"allInstances",[]),a(this,"availableInstances",[])}add(e,t=!1){return this.allInstances.push(e),t&&this.availableInstances.push(e),e}isEmpty(){return 0===this.availableInstances.length}pop(){if(this.isEmpty())throw new Error("No more instances available ini the pool.");return this.availableInstances.pop()}init(){this.availableInstances=this.allInstances.slice()}reset(){this.availableInstances=[],this.allInstances=[]}}const Qe={UNKNOWN:0,INTERSECTING:1,ABOVE:2,RIGHT:4,BELOW:8,LEFT:16};function et(e,t){const i=e[0],o=e[1],r=e[2],s=e[3],l=t[0],a=t[1];let n=Qe.UNKNOWN;return l<i?n|=Qe.LEFT:l>r&&(n|=Qe.RIGHT),a<o?n|=Qe.BELOW:a>s&&(n|=Qe.ABOVE),n===Qe.UNKNOWN&&(n=Qe.INTERSECTING),n}function tt(e,t,i,o,r){return r?(r[0]=e,r[1]=t,r[2]=i,r[3]=o,r):[e,t,i,o]}function it(e,t,i){e[0]=Math.min(e[0],t),e[1]=Math.min(e[1],i),e[2]=Math.max(e[2],t),e[3]=Math.max(e[3],i)}function ot(e){let t=0;return function(e){return e[2]<e[0]||e[3]<e[1]}(e)||(t=lt(e)*rt(e)),t}function rt(e){return e[3]-e[1]}function st(e,t,i){const o=i||[1/0,1/0,-1/0,-1/0];return at(e,t)?(e[0]>t[0]?o[0]=e[0]:o[0]=t[0],e[1]>t[1]?o[1]=e[1]:o[1]=t[1],e[2]<t[2]?o[2]=e[2]:o[2]=t[2],e[3]<t[3]?o[3]=e[3]:o[3]=t[3]):function(e){tt(1/0,1/0,-1/0,-1/0,e)}(o),o}function lt(e){return e[2]-e[0]}function at(e,t){return e[0]<=t[2]&&e[2]>=t[0]&&e[1]<=t[3]&&e[3]>=t[1]}class nt{constructor(e,t,i,o){this.minX=e,this.maxX=t,this.minY=i,this.maxY=o}contains(e){return this.containsXY(e[1],e[2])}containsTileRange(e){return this.minX<=e.minX&&e.maxX<=this.maxX&&this.minY<=e.minY&&e.maxY<=this.maxY}containsXY(e,t){return this.minX<=e&&e<=this.maxX&&this.minY<=t&&t<=this.maxY}equals(e){return this.minX==e.minX&&this.minY==e.minY&&this.maxX==e.maxX&&this.maxY==e.maxY}extend(e){e.minX<this.minX&&(this.minX=e.minX),e.maxX>this.maxX&&(this.maxX=e.maxX),e.minY<this.minY&&(this.minY=e.minY),e.maxY>this.maxY&&(this.maxY=e.maxY)}
1getHeight(){return this.maxY-this.minY+1}getSize(){return[this.getWidth(),this.getHeight()]}getWidth(){return this.maxX-this.minX+1}intersects(e){return this.minX<=e.maxX&&this.maxX>=e.minX&&this.minY<=e.maxY&&this.maxY>=e.minY}}function ct(e,t,i,o,r){return void 0!==r?(r.minX=e,r.maxX=t,r.minY=i,r.maxY=o,r):new nt(e,t,i,o)}const ut=42,ht=256;function mt(e,t){if(!e)throw new Error(t)}function dt(e,t){const i=Math.pow(10,t);return Math.round(e*i)/i}function vt(e,t){return Math.floor(dt(e,t))}function ft(e,t){return Math.ceil(dt(e,t))}function pt(e,t,i,o){return void 0!==o?(o[0]=e,o[1]=t,o[2]=i,o):[e,t,i]}function gt(e,t,i,o,r,s){let l=0,a=e[i-o],n=e[i-o+1];for(;t<i;t+=o){const i=e[t],o=e[t+1];n<=s?o>s&&(i-a)*(s-n)-(r-a)*(o-n)>0&&l++:o<=s&&(i-a)*(s-n)-(r-a)*(o-n)<0&&l--,a=i,n=o}return 0!==l}function xt(e,t,i,o,r){const s=function(e,t,i,o,r){for(;i<o;i+=r)it(e,t[i],t[i+1]);return e}([1/0,1/0,-1/0,-1/0],e,t,i,o);return!!at(r,s)&&(!!(function(e,t){return e[0]<=t[0]&&t[2]<=e[2]&&e[1]<=t[1]&&t[3]<=e[3]}(r,s)||s[0]>=r[0]&&s[2]<=r[2]||s[1]>=r[1]&&s[3]<=r[3])||function(e,t,i,o,r){let s;for(t+=o;t<i;t+=o)if(s=r(e.slice(t-o,t),e.slice(t,t+o)),s)return s;return!1}(e,t,i,o,(function(e,t){return function(e,t,i){let o=!1;const r=et(e,t),s=et(e,i);if(r===Qe.INTERSECTING||s===Qe.INTERSECTING)o=!0;else{const l=e[0],a=e[1],n=e[2],c=e[3],u=t[0],h=t[1],m=i[0],d=i[1],v=(d-h)/(m-u);let f,p;s&Qe.ABOVE&&!(r&Qe.ABOVE)&&(f=m-(d-c)/v,o=f>=l&&f<=n),!o&&s&Qe.RIGHT&&!(r&Qe.RIGHT)&&(p=d-(m-n)*v,o=p>=a&&p<=c),!o&&s&Qe.BELOW&&!(r&Qe.BELOW)&&(f=m-(d-a)/v,o=f>=l&&f<=n),!o&&s&Qe.LEFT&&!(r&Qe.LEFT)&&(p=d-(m-l)*v,o=p>=a&&p<=c)}return o}(r,e,t)})))}function wt(e,t){return e>t?1:e<t?-1:0}function Tt(e,t){return Array.isArray(e)?e:(void 0===t?t=[e,e]:(t[0]=e,t[1]=e),t)}const St=[0,0,0];class yt{constructor(e){let t;if(this.minZoom=void 0!==e.minZoom?e.minZoom:0,this.resolutions_=e.resolutions,mt(function(e,t){const i=t||wt;return e.every((function(t,o){if(0===o)return!0;const r=i(e[o-1],t);return!(r>0||0===r)}))}(this.resolutions_,((e,t)=>t-e)),"`resolutions` must be sorted in descending order"),!e.origins)for(let r=0,s=this.resolutions_.length-1;r<s;++r)if(t){if(this.resolutions_[r]/this.resolutions_[r+1]!==t){t=void 0;break}}else t=this.resolutions_[r]/this.resolutions_[r+1];this.zoomFactor_=t,this.maxZoom=this.resolutions_.length-1,this.origin_=void 0!==e.origin?e.origin:null,this.origins_=null,void 0!==e.origins&&(this.origins_=e.origins,mt(this.origins_.length==this.resolutions_.length,"Number of `origins` and `resolutions` must be equal"));const i=e.extent;var o;void 0!==i&&!this.origin_&&!this.origins_&&(this.origin_=[(o=i)[0],o[3]]),mt(!this.origin_&&this.origins_||this.origin_&&!this.origins_,"Either `origin` or `origins` must be configured, never both"),this.tileSizes_=null,void 0!==e.tileSizes&&(this.tileSizes_=e.tileSizes,mt(this.tileSizes_.length==this.resolutions_.length,"Number of `tileSizes` and `resolutions` must be equal")),this.tileSize_=void 0!==e.tileSize?e.tileSize:this.tileSizes_?null:ht,mt(!this.tileSize_&&this.tileSizes_||this.tileSize_&&!this.tileSizes_,"Either `tileSize` or `tileSizes` must be configured, never both"),this.extent_=void 0!==i?i:null,this.fullTileRanges_=null,this.tmpSize_=[0,0],this.tmpExtent_=[0,0,0,0],void 0!==e.sizes?this.fullTileRanges_=e.sizes.map(((e,t)=>{const o=new nt(Math.min(0,e[0]),Math.max(e[0]-1,-1),Math.min(0,e[1]),Math.max(e[1]-1,-1));if(i){const e=this.getTileRangeForExtentAndZ(i,t);o.minX=Math.max(e.minX,o.minX),o.maxX=Math.min(e.maxX,o.maxX),o.minY=Math.max(e.minY,o.minY),o.maxY=Math.min(e.maxY,o.maxY)}return o})):i&&this.calculateTileRanges_(i)}forEachTileCoord(e,t,i){const o=this.getTileRangeForExtentAndZ(e,t);for(let r=o.minX,s=o.maxX;r<=s;++r)for(let e=o.minY,l=o.maxY;e<=l;++e)i([t,r,e])}forEachTileCoordParentTileRange(e,t,i,o){let r,s,l,a=null,n=e[0]-1;for(2===this.zoomFactor_?(s=e[1],l=e[2]):a=this.getTileCoordExtent(e,o);n>=this.minZoom;){if(void 0!==s&&void 0!==l?(s=Math.floor(s/2),l=Math.floor(l/2),r=ct(s,s,l,l,i)):r=this.getTileRangeForExtentAndZ(a,n,i),t(n,r))return!0;--n}return!1}getExtent(){return this.extent_}getMaxZoom(){return this.maxZoom}getMinZoom(){return this.minZoom}getOrigin(e){return this.origin_?this.origin_:this.origins_[e]}getResolution(e){return this.resolutions_[e]}getResolutions(){return this.resolutions_}getTileCoordChildTileRange(e,t,i){if(e[0]<this.maxZoom){if(2===this.zoomFactor_){const i=2*e[1],o=2*e[2];return ct(i,i+1,o,o+1,t)}const o=this.getTileCoordExtent(e,i||this.tmpExtent_);return this.getTileRangeForExtentAndZ(o,e[0]+1,t)}return null}getTileRangeForTileCoordAndZ(e,t,i){if(t>this.maxZoom||t<this.minZoom)return null;const o=e[0],r=e[1],s=e[2];if(t===o)return ct(r,s,r,s,i);if(this.zoomFactor_){const e=Math.pow(this.zoomFactor_,t-o),l=Math.floor(r*e),a=Math.floor(s*e);if(t<o)return ct(l,l,a,a,i);return ct(l,Math.floor(e*(r+1))-1,a,Math.floor(e*(s+1))-1,i)}const l=this.getTileCoordExtent(e,this.tmpExtent_);return this.getTileRangeForExtentAndZ(l,t,i)}getTileRangeForExtentAndZ(e,t,i){this.getTileCoordForXYAndZ_(e[0],e[3],t,!1,St);const o=St[1],r=St[2];this.getTileCoordForXYAndZ_(e[2],e[1],t,!0,St);return ct(o,St[1],r,St[2],i)}getTileCoordCenter(e){const t=this.getOrigin(e[0]),i=this.getResolution(e[0]),o=Tt(this.getTileSize(e[0]),this.tmpSize_);return[t[0]+(e[1]+.5)*o[0]*i,t[1]-(e[2]+.5)*o[1]*i]}getTileCoordExtent(e,t){const i=this.getOrigin(e[0]),o=this.getResolution(e[0]),r=Tt(this.getTileSize(e[0]),this.tmpSize_),s=i[0]+e[1]*r[0]*o,l=i[1]-(e[2]+1)*r[1]*o;return tt(s,l,s+r[0]*o,l+r[1]*o,t)}getTileCoordForCoordAndResolution(e,t,i){return this.getTileCoordForXYAndResolution_(e[0],e[1],t,!1,i)}getTileCoordForXYAndResolution_(e,t,i,o,r){const s=this.getZForResolution(i),l=i/this.getResolution(s),a=this.getOrigin(s),n=Tt(this.getTileSize(s),this.tmpSize_);let c=l*(e-a[0])/i/n[0],u=l*(a[1]-t)/i/n[1];return o?(c=ft(c,5)-1,u=ft(u,5)-1):(c=vt(c,5),u=vt(u,5)),pt(s,c,u,r)}getTileCoordForXYAndZ_(e,t,i,o,r){const s=this.getOrigin(i),l=this.getResolution(i),a=Tt(this.getTileSize(i),this.tmpSize_);let n=(e-s[0])/l/a[0],c=(s[1]-t)/l/a[1];return o?(n=ft(n,5)-1,c=ft(c,5)-1):(n=vt(n,5),c=vt(c,5)),pt(i,n,c,r)}getTileCoordForCoordAndZ(e,t,i){return this.getTileCoordForXYAndZ_(e[0],e[1],t,!1,i)}getTileCoordResolution(e){return this.resolutions_[e[0]]}getTileSize(e){return this.tileSize_?this.tileSize_:this.tileSizes_[e]}getFullTileRange(e){return this.fullTileRanges_?this.fullTileRanges_[e]:this.extent_?this.getTileRangeForExtentAndZ(this.extent_,e):null}getZForResolution(e,t){const i=function(e,t,i){if(e[0]<=t)return 0;const o=e.length;if(t<=e[o-1])return o-1;if("function"==typeof i){for(let r=1;r<o;++r){const o=e[r];if(o===t)return r;if(o<t)return i(t,e[r-1],o)>0?r-1:r}return o-1}if(i>0){for(let i=1;i<o;++i)if(e[i]<t)return i-1;return o-1}if(i<0){for(let i=1;i<o;++i)if(e[i]<=t)return i;return o-1}for(let r=1;r<o;++r){if(e[r]==t)return r;if(e[r]<t)return e[r-1]-t<t-e[r]?r-1:r}return o-1}(this.resolutions_,e,t||0);return function(e,t,i){return Math.min(Math.max(e,t),i)}(i,this.minZoom,this.maxZoom)}tileCoordIntersectsViewport(e,t){return function(e,t,i,o,r){return!!(xt(e,t,i,o,r)||gt(e,t,i,o,r[0],r[1])||gt(e,t,i,o,r[0],r[3])||gt(e,t,i,o,r[2],r[1])||gt(e,t,i,o,r[2],r[3]))}(t,0,t.length,2,this.getTileCoordExtent(e))}calculateTileRanges_(e){const t=this.resolutions_.length,i=new Array(t);for(let o=this.minZoom;o<t;++o)i[o]=this.getTileRangeForExtentAndZ(e,o);this.fullTileRanges_=i}}const Mt={radians:6370997/(2*Math.PI),degrees:2*Math.PI*6370997/360,ft:.3048,m:1,"us-ft":1200/3937};
1class _t{constructor(e){this.code_=e.code,this.units_=e.units,this.extent_=void 0!==e.extent?e.extent:null,this.worldExtent_=void 0!==e.worldExtent?e.worldExtent:null,this.axisOrientation_=void 0!==e.axisOrientation?e.axisOrientation:"enu",this.global_=void 0!==e.global&&e.global,this.canWrapX_=!(!this.global_||!this.extent_),this.getPointResolutionFunc_=e.getPointResolution,this.defaultTileGrid_=null,this.metersPerUnit_=e.metersPerUnit}canWrapX(){return this.canWrapX_}getCode(){return this.code_}getExtent(){return this.extent_}getUnits(){return this.units_}getMetersPerUnit(){return this.metersPerUnit_||Mt[this.units_]}getWorldExtent(){return this.worldExtent_}getAxisOrientation(){return this.axisOrientation_}isGlobal(){return this.global_}setGlobal(e){this.global_=e,this.canWrapX_=!(!e||!this.extent_)}getDefaultTileGrid(){return this.defaultTileGrid_}setDefaultTileGrid(e){this.defaultTileGrid_=e}setExtent(e){this.extent_=e,this.canWrapX_=!(!this.global_||!e)}setWorldExtent(e){this.worldExtent_=e}setGetPointResolution(e){this.getPointResolutionFunc_=e}getPointResolutionFunc(){return this.getPointResolutionFunc_}}const Rt=6378137,bt=Math.PI*Rt,Et=[-bt,-bt,bt,bt],At=[-180,-85,180,85],Pt=Rt*Math.log(Math.tan(Math.PI/2));class Ct extends _t{constructor(e){super({code:e,units:"m",extent:Et,global:!0,worldExtent:At,getPointResolution:function(e,t){return e/Math.cosh(t[1]/Rt)}})}}const It=[new Ct("EPSG:3857"),new Ct("EPSG:102100"),new Ct("EPSG:102113"),new Ct("EPSG:900913"),new Ct("http://www.opengis.net/def/crs/EPSG/0/3857"),new Ct("http://www.opengis.net/gml/srs/epsg.xml#3857")];function zt(e,t,i,o){const r=e.length;i=i>1?i:2,o=o??i,void 0===t&&(t=i>2?e.slice():new Array(r));for(let s=0;s<r;s+=o){t[s]=bt*e[s]/180;let i=Rt*Math.log(Math.tan(Math.PI*(+e[s+1]+90)/360));i>Pt?i=Pt:i<-Pt&&(i=-Pt),t[s+1]=i}return t}function Ft(e,t,i,o){const r=e.length;i=i>1?i:2,o=o??i,void 0===t&&(t=i>2?e.slice():new Array(r));for(let s=0;s<r;s+=o)t[s]=180*e[s]/bt,t[s+1]=360*Math.atan(Math.exp(e[s+1]/Rt))/Math.PI-90;return t}const Dt=[-180,-90,180,90],Ot=6378137*Math.PI/180;class Nt extends _t{constructor(e,t){super({code:e,units:"degrees",extent:Dt,axisOrientation:t,global:!0,metersPerUnit:Ot,worldExtent:Dt})}}const Wt=[new Nt("CRS:84"),new Nt("EPSG:4326","neu"),new Nt("urn:ogc:def:crs:OGC:1.3:CRS84"),new Nt("urn:ogc:def:crs:OGC:2:84"),new Nt("http://www.opengis.net/def/crs/OGC/1.3/CRS84"),new Nt("http://www.opengis.net/gml/srs/epsg.xml#4326","neu"),new Nt("http://www.opengis.net/def/crs/EPSG/0/4326","neu")];let Gt={};let kt={};function Lt(e,t,i){const o=e.getCode(),r=t.getCode();o in kt||(kt[o]={}),kt[o][r]=i}const Ut=[/^EPSG:(\d+)$/,/^urn:ogc:def:crs:EPSG::(\d+)$/,/^http:\/\/www\.opengis\.net\/def\/crs\/EPSG\/0\/(\d+)$/];const $t=[function(e){return function(e){let t=0;for(const r of Ut){const i=e.match(r);if(i){t=parseInt(i[1]);break}}if(!t)return null;let i=0,o=!1;return t>32700&&t<32761?i=t-32700:t>32600&&t<32661&&(o=!0,i=t-32600),i?{number:i,north:o}:null}(e)?new _t({code:e,units:"m"}):null}];function Bt(e,t){if(void 0!==t)for(let i=0,o=e.length;i<o;++i)t[i]=e[i];else t=e.slice();return t}function Zt(e){(function(e,t){Gt[e]=t})(e.getCode(),e),Lt(e,e,Bt)}function Yt(e){const t=function(e){return Gt[e]||Gt[e.replace(/urn:(x-)?ogc:def:crs:EPSG:(.*:)?(\w+)$/,"EPSG:$3")]||null}(e);if(t)return t;for(const i of $t){const t=i(e);if(t)return t}return null}function jt(e){(function(e){e.forEach(Zt)})(e),e.forEach((function(t){e.forEach((function(e){t!==e&&Lt(t,e,Bt)}))}))}var Vt,Xt,Ht;function qt(e,t,i,o){t=void 0!==t?t:ut,i=Tt(void 0!==i?i:ht);const r=rt(e),s=lt(e);o=o>0?o:Math.max(s/i[0],r/i[1]);const l=t+1,a=new Array(l);for(let n=0;n<l;++n)a[n]=o/Math.pow(2,n);return a}jt(It),jt(Wt),Vt=It,Xt=zt,Ht=Ft,Wt.forEach((function(e){Vt.forEach((function(t){Lt(e,t,Xt),Lt(t,e,Ht)}))}));var Kt="precision highp float;precision highp int;precision highp sampler2D;uniform vec2 direction;uniform int kernelSize;uniform sampler2D imgToBlur;in vec2 vUv;out vec4 fragColor;vec4 blur5(sampler2D image,vec2 uv,vec2 resolution,vec2 direction){vec4 color=vec4(0.0);vec2 off1=vec2(1.3333333333333333)*direction;
1color+=texture(image,uv)*0.29411764705882354;color+=texture(image,uv+(off1/resolution))*0.35294117647058826;color+=texture(image,uv-(off1/resolution))*0.35294117647058826;return color;}vec4 blur9(sampler2D image,vec2 uv,vec2 resolution,vec2 direction){vec4 color=vec4(0.0);vec2 off1=vec2(1.3846153846)*direction;vec2 off2=vec2(3.2307692308)*direction;color+=texture(image,uv)*0.2270270270;color+=texture(image,uv+(off1/resolution))*0.3162162162;color+=texture(image,uv-(off1/resolution))*0.3162162162;color+=texture(image,uv+(off2/resolution))*0.0702702703;color+=texture(image,uv-(off2/resolution))*0.0702702703;return color;}vec4 blur13(sampler2D image,vec2 uv,vec2 resolution,vec2 direction){vec4 color=vec4(0.0);vec2 off1=vec2(1.411764705882353)*direction;vec2 off2=vec2(3.2941176470588234)*direction;vec2 off3=vec2(5.176470588235294)*direction;color+=texture(image,uv)*0.1964825501511404;color+=texture(image,uv+(off1/resolution))*0.2969069646728344;color+=texture(image,uv-(off1/resolution))*0.2969069646728344;color+=texture(image,uv+(off2/resolution))*0.09447039785044732;color+=texture(image,uv-(off2/resolution))*0.09447039785044732;color+=texture(image,uv+(off3/resolution))*0.010381362401148057;color+=texture(image,uv-(off3/resolution))*0.010381362401148057;return color;}vec4 blur19(sampler2D image,vec2 uv,vec2 resolution,vec2 direction){vec4 color=vec4(0.0);vec2 off1=vec2(1.434782608695652)*direction;vec2 off2=vec2(3.347826086956522)*direction;vec2 off3=vec2(5.260869565217392)*direction;vec2 off4=vec2(7.173913043478261)*direction;color+=texture(image,uv)*0.16818993967466953;color+=texture(image,uv+(off1/resolution))*0.2727695816518679;color+=texture(image,uv-(off1/resolution))*0.2727695816518679;color+=texture(image,uv+(off2/resolution))*0.11690124927937194;color+=texture(image,uv-(off2/resolution))*0.11690124927937194;color+=texture(image,uv+(off3/resolution))*0.024067904263400105;color+=texture(image,uv-(off3/resolution))*0.024067904263400105;color+=texture(image,uv+(off4/resolution))*0.0021112196722280793;color+=texture(image,uv-(off4/resolution))*0.0021112196722280793;return color;}void main(){vec4 color=vec4(1.,0,0,1.);vec2 textureResolution=vec2(textureSize(imgToBlur,0));if(kernelSize==5){color=blur5(imgToBlur,vUv,textureResolution,direction);}else if(kernelSize==9){color=blur9(imgToBlur,vUv,textureResolution,direction);}else if(kernelSize==13){color=blur13(imgToBlur,vUv,textureResolution,direction);}else if(kernelSize==19){color=blur19(imgToBlur,vUv,textureResolution,direction);}fragColor=color;}";let Jt=null;class Qt{constructor(e,t,i=function(){return Jt||(Jt=new o.JeP({alpha:!0,premultipliedAlpha:!1})),Jt}()){a(this,"renderer"),a(this,"camera",new o.qUd(-1,1,1,-1,0,1)),a(this,"scene",new o.Z58),a(this,"renderTarget"),a(this,"material",new o.D$Q({glslVersion:o.Wdf,vertexShader:"precision highp float;precision highp int;uniform mat4 modelViewMatrix;uniform mat4 projectionMatrix;in vec3 position;in vec2 uv;out vec2 vUv;void main(){vUv=uv;gl_Position=projectionMatrix*modelViewMatrix*vec4(position,1.0);}",fragmentShader:"precision highp float;precision highp int;precision highp sampler2D;in vec2 vUv;out vec4 fragColor;void main(){fragColor=vec4(1.,0.,0.,1.);}",depthWrite:!1,transparent:!0})),a(this,"size"),this.size=new o.I9Y(e,t),this.renderTarget=new o.nWS(e,t,{minFilter:o.k6q,magFilter:o.k6q,format:o.GWd}),this.camera.matrixAutoUpdate=!1,this.renderer=i,this.renderer.setPixelRatio(1),this.renderer.autoClear=!1;const r=new o.eaF(new o.bdM(2,2),this.material);this.scene.add(r)}getOutputTexture(e=!1){return e?new o.GYF(this.getPixelData(),this.size.x,this.size.y,o.GWd):this.renderTarget.texture}setSize(e,t){e===this.size.x&&t===this.size.y||(this.size.x=e,this.size.y=t,this.renderTarget=new o.nWS(e,t,{minFilter:o.k6q,magFilter:o.k6q,format:o.GWd}),this.renderer.setRenderTarget(this.renderTarget))}setVertexShader(e){this.material.vertexShader=e.trim(),this.material.needsUpdate=!0}setFragmentShader(e){this.material.fragmentShader=e.trim(),this.material.needsUpdate=!0}setUniform(e,t){this.material.uniforms[e]={value:t}}setDefine(e,t){this.material.fragmentShader=this.material.fragmentShader.replace(new RegExp(e,"g"),t.toString()),this.material.vertexShader=this.material.vertexShader.replace(new RegExp(e,"g"),t.toString()),this.material.needsUpdate=!0}getPixelData(){const e=this.size,t=new Uint8Array(e.x*e.y*4);return this.renderer.readRenderTargetPixels(this.renderTarget,0,0,e.x,e.y,t),t}getSize(){return this.size.clone()}process(){return this.material.needsUpdate=!0,this.renderer.setRenderTarget(this.renderTarget),this.renderer.clear(),this.renderer.render(this.scene,this.camera),this.renderTarget.texture}debugAsPNG(){const e=this.getSize(),t=this.getPixelData(),i=document.createElement("canvas");i.width=e.x,i.height=e.y;const o=i.getContext("2d");if(!o)return;const r=o.getImageData(0,0,i.width,i.height);r.data.set(t),o.putImageData(r,0,0);const s=window.open();s&&s.document.write(`<iframe src="${i.toDataURL("image/png")}" frameborder="0" style="border:0; top:0px; left:0px; bottom:0px; right:0px; width:100%; height:100%;" allowfullscreen></iframe>`)}dispose(){this.renderTarget.texture.dispose(),this.renderTarget.dispose()}}class ei{constructor(){this.disposed=!1}dispose(){this.disposed||(this.disposed=!0,this.disposeInternal())}disposeInternal(){}}class ti{constructor(e){this.highWaterMark=void 0!==e?e:2048,this.count_=0,this.entries_={},this.oldest_=null,this.newest_=null}deleteOldest(){const e=this.pop();e instanceof ei&&e.dispose()}canExpireCache(){return this.highWaterMark>0&&this.getCount()>this.highWaterMark}expireCache(e){for(;this.canExpireCache();)this.deleteOldest()}clear(){for(;this.oldest_;)this.deleteOldest()}containsKey(e){return this.entries_.hasOwnProperty(e)}forEach(e){let t=this.oldest_;for(;t;)e(t.value_,t.key_,this),t=t.newer}get(e,t){const i=this.entries_[e];return mt(void 0!==i,"Tried to get a value for a key that does not exist in the cache"),i===this.newest_||(i===this.oldest_?(this.oldest_=this.oldest_.newer,this.oldest_.older=null):(i.newer.older=i.older,i.older.newer=i.newer),i.newer=null,i.older=this.newest_,this.newest_.newer=i,this.newest_=i),i.value_}remove(e){const t=this.entries_[e];return mt(void 0!==t,"Tried to get a value for a key that does not exist in the cache"),t===this.newest_?(this.newest_=t.older,this.newest_&&(this.newest_.newer=null)):t===this.oldest_?(this.oldest_=t.newer,this.oldest_&&(this.oldest_.older=null)):(t.newer.older=t.older,t.older.newer=t.newer),delete this.entries_[e],--this.count_,t.value_}getCount(){return this.count_}getKeys(){const e=new Array(this.count_);let t,i=0;for(t=this.newest_;t;t=t.older)e[i++]=t.key_;return e}getValues(){const e=new Array(this.count_);let t,i=0;for(t=this.newest_;t;t=t.older)e[i++]=t.value_;return e}peekLast(){return this.oldest_.value_}peekLastKey(){return this.oldest_.key_}peekFirstKey(){return this.newest_.key_}peek(e){var t;return null==(t=this.entries_[e])?void 0:t.value_}pop(){const e=this.oldest_;return delete this.entries_[e.key_],e.newer&&(e.newer.older=null),this.oldest_=e.newer,this.oldest_||(this.newest_=null),--this.count_,e.value_}replace(e,t){this.get(e),this.entries_[e].value_=t}set(e,t){mt(!(e in this.entries_),"Tried to set a value for a key that is used already");const i={key_:e,newer:null,older:this.newest_,value_:t};this.newest_?this.newest_.newer=i:this.oldest_=i,this.newest_=i,this.entries_[e]=i,++this.count_}setSize(e){this.highWaterMark=e}}class ii{constructor(e,t){a(this,"loader",new o.Tap),a(this,"lru",new ti(32)),a(this,"apiKey",""),a(this,"sessionId",""),this.url=e,this.onTileLoad=t}setMaptilerParams(e,t){this.apiKey=e,this.sessionId=t}urlPatternToUrl(e){let t;try{t=new URL(this.url.replace("{zxy}",e))}catch{t=new URL(this.url.replace("{zxy}",e),document.baseURI)}return t.host===$e.maptilerApiHost&&(this.apiKey&&!t.searchParams.has("key")&&t.searchParams.append("key",this.apiKey),this.sessionId&&!t.searchParams.has("mtsid")&&t.searchParams.append("mtsid",this.sessionId)),t.href}getTile(e,t){if(e.split("/").map((e=>Number.parseInt(e))).some((e=>
1e<0)))return null;if(this.lru.containsKey(e))return this.lru.get(e);if(t){const t=this.createTile(e);return this.lru.set(e,t),t}return null}createTile(e){const t=this.urlPatternToUrl(e),i={ready:!1,texture:null,zxy:e};return i.texture=this.loader.load(t,(()=>{i.ready=!0,null!=this.onTileLoad&&this.onTileLoad(i,t,null)}),void 0,(e=>{null!=this.onTileLoad&&this.onTileLoad(i,t,e)})),i.texture.minFilter=o.k6q,i.texture.needsUpdate=!0,i}disposeTile(e){e.texture&&e.texture.dispose()}expireCache(e){for(;this.lru.canExpireCache()&&!(this.lru.peekLast().zxy in e);)this.disposeTile(this.lru.pop())}dispose(){for(const e of this.lru.getValues())this.disposeTile(e);this.lru.clear()}}class oi extends r.EventEmitter{constructor(){super(...arguments),a(this,"frames",[]),a(this,"time",0),a(this,"animationSpeed",0),a(this,"lastTickTime",0)}addFrame(e,t){const i=this.findSmallerFrameIndex(e);if(i<0)this.frames.unshift({time:e,data:t});else{if(this.frames[i].time===e)throw new Error("Frame with this time already exists");this.frames.splice(i+1,0,{time:e,data:t})}this.clampAnimation()}removeFrame(e){const t=this.frames.filter((t=>t.time===e));return this.frames=this.frames.filter((t=>t.time!==e)),this.clampAnimation(),t}forEachFrame(e){for(const t of this.frames)e(t)}getAnimationStart(){return this.frames.length?this.frames[0].time:Number.POSITIVE_INFINITY}getAnimationStartDate(){return new Date(1e3*this.getAnimationStart())}getAnimationEnd(){return this.frames.length?this.frames[this.frames.length-1].time:Number.NEGATIVE_INFINITY}getAnimationEndDate(){return new Date(1e3*this.getAnimationEnd())}getAnimationTime(){return this.time}getAnimationTimeDate(){return new Date(1e3*this.getAnimationTime())}setAnimationTime(e){this.time=e,this.clampAnimation(),this.emit("animationTimeSet",{time:this.time})}clampAnimation(){this.time=Math.max(this.getAnimationStart(),Math.min(this.getAnimationEnd(),this.time))}animateByFactor(e){this.animate(e)}animate(e){e>0&&0===this.animationSpeed?this.emit("playAnimation",{time:this.time}):0===e&&this.animationSpeed>0&&this.emit("pauseAnimation",{time:this.time}),this.animationSpeed=e,0!==this.animationSpeed&&(this.lastTickTime=performance.now())}getAnimationSpeed(){return this.animationSpeed}isPlaying(){return this.animationSpeed>0}animationTick(){const e=performance.now();if(this.animationSpeed>0&&this.lastTickTime){const t=e-this.lastTickTime;this.time+=this.animationSpeed*(t/1e3);const i=this.getAnimationStart(),o=this.getAnimationEnd();this.time=i+(this.time-i)%(o-i),Number.isNaN(this.time)&&(this.time=i),this.emit("tick",{time:this.time})}this.lastTickTime=e}findSmallerFrameIndex(e){for(let t=this.frames.length-1;t>=0;--t)if(this.frames[t].time<=e)return t;return-1}getCurrentFrames(){if(0===this.frames.length)return{frameA:null,frameB:null,mix:0};let e=this.findSmallerFrameIndex(this.time);e<0&&(e=0);const t=this.frames[e],i=this.frames[Math.min(this.frames.length-1,e+1)],o=i.time-t.time;return{frameA:t,frameB:i,mix:0===o?0:(this.time-t.time)/o}}getNextFrame(e,t){const i=this.frames.findIndex((t=>t===e));return i<0?null:t<0?i>0?this.frames[i-1]:null:i<this.frames.length-1?this.frames[i+1]:null}}const ri=new o.V9B({transparent:!0,opacity:1,side:o.hB5,depthTest:!1,depthWrite:!1});function si({color:e}){const t=function({color:e}){const t=new o.Gu$(1,32,32),i=new o.V9B({color:e});return new o.eaF(t,i)}({color:e}),i=Array.isArray(t.material)?t.material:[t.material];for(const o of i)o.transparent=!0,o.depthTest=!1,o.depthWrite=!1;return t.renderOrder=9999,t}const li=.01;const ai=8192,ni=4;function ci(e,t,i,o,r){const s=1/(1<<r),l=t/ai*s+o*s,a=function(e,t){return(e%t+t)%t}((e/ai*s+i*s)*Math.PI*2+Math.PI,2*Math.PI),n=2*Math.atan(Math.exp(Math.PI-l*Math.PI*2))-.5*Math.PI,c=Math.cos(n),u=new Float64Array(3);return u[0]=Math.sin(a)*c,u[1]=Math.sin(n),u[2]=Math.cos(a)*c,u}function ui(e,t){const i=t.getZoom(),{width:o,height:r}=t.getCanvas().getBoundingClientRect(),s=function(e,t){return e<=ni-1||t.width<918&&t.height>1020||t.width<918?1:2}(i,{width:o,height:r});return{gridSize:e>30?9:3*s,resolutionScaleFactor:s}}class hi{constructor(){a(this,"object3D",new o.YJl),a(this,"helpersObject3D",new o.YJl),a(this,"map"),a(this,"currentTiles",[]),a(this,"currentTilesMeshes",new Map),a(this,"visibleTilesAreaMesh",new o.eaF),a(this,"areaGeometryVerticesRows",new Map),a(this,"minZoom",0),a(this,"maxZoom",24),a(this,"isGeometryNeedRefresh",!1);const e=function(){const e=new o.YJl,t=si({color:16711680});t.scale.setScalar(li),t.position.set(0,1.01,0);const i=si({color:255});i.scale.setScalar(li),i.position.set(0,-1.01,0);const r=si({color:65280});return r.scale.setScalar(li),r.position.set(0,0,1.01),e.add(t),e.add(i),e.add(r),e}();this.helpersObject3D.add(e),this.object3D.add(this.visibleTilesAreaMesh),this.visibleTilesAreaMesh.material=((e={})=>{const{color:t=16777215*Math.random(),wireframe:i=!1,opacity:r=1}=e,s=ri.clone();return s.color=new o.Q1f(t),s.wireframe=i,s.opacity=r,s})({color:16777215,wireframe:!1}),this.visibleTilesAreaMesh.renderOrder=2,this.visibleTilesAreaMesh.visible=!1}init({map:e,minZoom:t,maxZoom:i}){this.map=e,this.minZoom=t,this.maxZoom=i}update(){if(void 0===this.map)return;let e=Math.floor(this.map.getZoom());e=Math.min(Math.max(e,this.minZoom),this.maxZoom);const t=this.map.getCenter(),i=this.map.getPitch(),{gridSize:o}=ui(i,this.map),r=function(e,t){const i=2**t,{lat:o,lng:r}=e,s=o*Math.PI/180;let l=(r+180)/360*i,a=(1-Math.log(Math.tan(s)+1/Math.cos(s))/Math.PI)/2*i;return l=Math.floor((l%i+i)%i),a=Math.floor(Math.max(0,Math.min(a,i-1))),{id:`${t}/${l}/${a}`,x:l,y:a,z:t}}(t,e),s=e<=ni-1?function(e){const t=2**e,i=[];for(let o=0;o<t;o++)for(let r=0;r<t;r++)i.push({id:`${e}/${o}/${r}`,x:o,y:r,z:e});return i}(e):function(e,t){const{x:i,y:o,z:r}=e,s=2**r,l=Math.min(t,s),a=Math.floor(l/2),n=[],c=new Set;for(let u=-a;u<=a;u++)for(let e=-a;e<=a;e++){const t=(i+u+s)%s,l=(o+e+s)%s,a=`${r}/${t}/${l}`;c.has(a)||(c.add(a),n.push({id:a,x:t,y:l,z:r}))}return n}(r,o);(function(e,t){return e.length===t.length&&e.every(((e,i)=>e===t[i]))})(this.currentTiles.map((({id:e})=>e)),s.map((({id:e})=>e)))||(this.currentTiles=s,this.isGeometryNeedRefresh=!0,this.object3D.remove(this.visibleTilesAreaMesh))}recreateGlobeMeshes(){!1!==this.isGeometryNeedRefresh&&(this.isGeometryNeedRefresh=!1,this.object3D.clear(),this.helpersObject3D.clear(),this.currentTilesMeshes.clear(),this.areaGeometryVerticesRows.clear(),this.recreateGlobeTiles(),this.recreateAreaMesh())}recreateGlobeTiles(){const e=this.currentTiles.reduce(((e,t)=>Math.min(e,t.x)),Number.POSITIVE_INFINITY),t=this.currentTiles.reduce(((e,t)=>Math.min(e,t.y)),Number.POSITIVE_INFINITY);for(const i of this.currentTiles){const{z:r,x:s,y:l}=i,a=2**r-1,n=new o.LoY,c=[],u=[],h=[],m=s,d=l;for(let i=0;i<=16;i++){const o=i;for(let n=0;n<=16;n++){const p=n,g=n/16,x=i/16,w=1-x;let T=ci(g*ai,x*ai,s,l,r);if(0===d&&o<=4){T=f(T,[0,1,0],1-o/4)}if(d===a&&o>=12){T=f(T,[0,-1,0],1-(16-o)/4)}c.push(T[0],T[1],T[2]),h.push(g,w);const S=0===o,y=0===p,M=d===t,_=m===e;if(!1===S&&!1===y||!0===S&&!1===y&&!0===M||!0===y&&!1===S&&!0===_||!0===M&&!0===_){const e=`tileY:${d}__vertexRow:${o}
1`;!1===this.areaGeometryVerticesRows.has(e)&&this.areaGeometryVerticesRows.set(e,[]),v(this.areaGeometryVerticesRows,e).push(T)}if(16!==i&&16!==n){const e=17*i+n,t=17*(i+1)+n,o=17*(i+1)+(n+1),r=17*i+(n+1);u.push(e,t,r),u.push(t,o,r)}}}n.setAttribute("position",new o.qtW(c,3)),n.setAttribute("uv",new o.qtW(h,2)),n.setIndex(u);const p=new o.eaF;p.geometry=n,p.renderOrder=1,this.object3D.add(p),this.currentTilesMeshes.set(i.id,p)}}recreateAreaMesh(){const e=Array.from(this.areaGeometryVerticesRows.keys()).sort(((e,t)=>{const[i,o]=e.split("__").map((e=>Number(e.split(":")[1]))),[r,s]=t.split("__").map((e=>Number(e.split(":")[1])));return i===r?o-s:i-r})).map((e=>this.areaGeometryVerticesRows.get(e))),t=e.length,i=e[0].length;if(t<2)return void console.error("Not enough rows to create sphere fragment:",{rowsAmount:t});if(t!==i)return void console.warn("Rows amount is not equal to columns amount:",{rowsAmount:t,columnsAmount:i});const r=[],s=[],l=[],a=new Map;for(let o=0;o<t;o++)for(let l=0;l<i;l++){const n=e[o][l];let c=`${n[0]},${n[1]},${n[2]}`;a.has(c)&&(n[0]+=1e-4*Math.random(),n[1]+=1e-4*Math.random(),n[2]+=1e-4*Math.random(),c=`${n[0]},${n[1]},${n[2]}`),a.set(c,a.size),r.push(n[0],n[1],n[2]);const u=l/(i-1),h=1-o/(t-1);s.push(u,h)}for(let o=0;o<t-1;o++){const t=e[o],r=e[o+1];for(let e=0;e<i-1;e++){const i=`${t[e][0]},${t[e][1]},${t[e][2]}`,o=`${t[e+1][0]},${t[e+1][1]},${t[e+1][2]}`,s=`${r[e][0]},${r[e][1]},${r[e][2]}`,n=`${r[e+1][0]},${r[e+1][1]},${r[e+1][2]}`,c=a.get(i),u=a.get(o),h=a.get(s),m=a.get(n);void 0!==c&&void 0!==u&&void 0!==h&&void 0!==m?(l.push(c,h,u),l.push(h,m,u)):console.error("Undefined index:",{topLeftIndex:c,topRightIndex:u,bottomLeftIndex:h,bottomRightIndex:m})}}const n=new o.LoY;n.setAttribute("position",new o.qtW(r,3)),n.setAttribute("uv",new o.qtW(s,2)),n.setIndex(l),this.visibleTilesAreaMesh.geometry=n,this.object3D.add(this.visibleTilesAreaMesh)}}class mi extends oi{constructor(e,t,i=null,r=null){super(),a(this,"id"),a(this,"type","custom"),a(this,"renderingMode","3d"),a(this,"map",null),a(this,"dataMinZoom",0),a(this,"dataMaxZoom",4),a(this,"slippyTiles",[]),a(this,"renderer",null),a(this,"camera",new o.i7d),a(this,"scene",new o.Z58),a(this,"material"),a(this,"geometry",new o.bdM(1,1)),a(this,"tilegrid"),a(this,"extent",null),a(this,"repaintOnPausedAnimation",!0),a(this,"materialPool",new Je),a(this,"bluringNodePasses",[]),a(this,"extentScale",1),a(this,"extentChangedThreshold",.75),a(this,"lastExtent",[0,0,0,0]),a(this,"timeInterpolation",!0),a(this,"isReady",!1),a(this,"defaultTexture",new o.GYF(new Uint8Array([128,128,128,255]),1,1,o.GWd)),a(this,"onMoveEndListener"),a(this,"onResizeListener"),a(this,"onMoveListener"),a(this,"onProjectionChangedListener"),a(this,"coloringFragments",null),a(this,"multiChannelColoringFragment"),a(this,"loadLowerZoomLevels"),a(this,"interpolateTileEdge",!1),a(this,"flusher"),a(this,"globeTilesService"),a(this,"threeWorldGroup",new o.YJl),a(this,"slippyTilesGroup",new o.YJl),a(this,"getMapOrThrow",(()=>{if(null==this.map)throw new Error("Accessing map on detached layer");return this.map})),a(this,"getRendererOrThrow",(()=>{if(null==this.renderer)throw new Error("Accessing renderer on detached layer");return this.renderer})),this.defaultTexture.needsUpdate=!0,this.id=e,t&&this.init(t,i,r),this.onMoveEndListener=this.onMoveEnd.bind(this),this.onResizeListener=this.onResize.bind(this),this.onMoveListener=this.onMove.bind(this),this.onProjectionChangedListener=this.onProjectionChanged.bind(this),this.flusher=new o.eaF(new o.bdM(1,1),new o.V9B({colorWrite:!1,depthWrite:!1})),this.flusher.frustumCulled=!1,this.scene.add(this.flusher),this.threeWorldGroup.add(this.slippyTilesGroup),this.globeTilesService=new hi,this.threeWorldGroup.add(this.globeTilesService.object3D)}init(e,t=null,i=null){this.interpolateTileEdge=e.interpolateTileEdge??!1,this.loadLowerZoomLevels=e.loadLowerZoomLevels??!0,this.coloringFragments=t,this.multiChannelColoringFragment=i,this.repaintOnPausedAnimation=e.repaintOnPausedAnimation??!0,this.dataMinZoom=e.minZoom??this.dataMinZoom,this.dataMaxZoom=e.maxZoom??this.dataMaxZoom,this.tilegrid=function(e){const t=e||{},i=t.extent||Yt("EPSG:3857").getExtent(),o={extent:i,minZoom:t.minZoom,tileSize:t.tileSize,resolutions:qt(i,t.maxZoom,t.tileSize,t.maxResolution)};return new yt(o)}({minZoom:this.dataMinZoom,maxZoom:this.dataMaxZoom}),e.bounds&&(this.extent=Ce(e.bounds[0],e.bounds[1]).concat(Ce(e.bounds[2],e.bounds[3])));let r="";if(this.coloringFragments){const e=this.coloringFragments.map(((e,t)=>e.getBlendCode(`_cf_${t}`)));let t="fragColor";for(let i=0;i<this.coloringFragments.length;i++)t=`_cf_${i}(${t},inter)`;t=`fragColor=${t};`,r="precision highp float;precision highp sampler2D;COLORING_FRAGMENT_DEFSout vec4 fragColor;uniform float opacity;uniform float zoom;uniform float time;uniform sampler2D tex0;uniform sampler2D tex1;uniform float tilePixelSize;uniform sampler2D texN0;uniform sampler2D texN1;uniform bool availableN;uniform sampler2D texE0;uniform sampler2D texE1;uniform bool availableE;uniform sampler2D texS0;uniform sampler2D texS1;uniform bool availableS;uniform sampler2D texW0;uniform sampler2D texW1;uniform bool availableW;uniform float maxSmoothingDistance;uniform float smoothingDistanceDecayFactor;uniform bool localSmoothing;uniform float zoomDelta;in vec2 tex0coord;in vec2 tex1coord;in vec2 mercCoord;float PI=3.141592;const int halfNbSmoothingBins=int(ceil(float(NB_SMOOTHING_BINS))/2.);void textPositionToInternalTexPosition(vec2 uv,out vec2 newUv,out int texturePositionIndex){if(uv.x>=0.&&uv.x<=1.){if(uv.y>=0.&&uv.y<=1.){newUv=uv;texturePositionIndex=0;}else if(uv.y<0.&&availableS){newUv=vec2(uv.x,1.+uv.y);texturePositionIndex=5;}else if(uv.y>
11.&&availableN){newUv=vec2(uv.x,1.-uv.y);texturePositionIndex=1;}else{newUv=uv;texturePositionIndex=0;}}else if(uv.x<0.){if(uv.y>=0.&&uv.y<=1.&&availableW){newUv=vec2(1.+uv.x,uv.y);texturePositionIndex=7;}else{newUv=uv;texturePositionIndex=0;}}else if(uv.x>1.){if(uv.y>=0.&&uv.y<=1.&&availableE){newUv=vec2(uv.x-1.,uv.y);texturePositionIndex=3;}else{newUv=uv;texturePositionIndex=0;}}}vec4 getTextureColorByIndex(int textureTimeIndex,int texturePositionIndex,vec2 uv){if(textureTimeIndex==0){if(texturePositionIndex==0){return texture(tex0,uv);}else if(texturePositionIndex==1){return texture(texN0,uv);}else if(texturePositionIndex==3){return texture(texE0,uv);}else if(texturePositionIndex==5){return texture(texS0,uv);}else if(texturePositionIndex==7){return texture(texW0,uv);}}else if(textureTimeIndex==1){if(texturePositionIndex==0){return texture(tex1,uv);}else if(texturePositionIndex==1){return texture(texN1,uv);}else if(texturePositionIndex==3){return texture(texE1,uv);}else if(texturePositionIndex==5){return texture(texS1,uv);}else if(texturePositionIndex==7){return texture(texW1,uv);}}else{return vec4(1.,0.,0.,1.);}}vec4 getColor(int textureTimeIndex,vec2 uv){int texturePositionIndex=0;vec2 localUV=vec2(0.,0.);textPositionToInternalTexPosition(uv,localUV,texturePositionIndex);return getTextureColorByIndex(textureTimeIndex,texturePositionIndex,localUV);}vec4 circularSampleSmoothing(int textureTimeIndex,vec2 uv,float resolution,float distance,out bool isTransparant){vec4 colorRGBA=getColor(textureTimeIndex,uv);int weightCenter=3;vec4 color=colorRGBA*float(weightCenter);isTransparant=colorRGBA.a<1.;float angularStep=2.*PI/float(halfNbSmoothingBins);for(int i=0;i<halfNbSmoothingBins;i++){float angle=angularStep*float(i);vec2 offset=vec2(cos(angle),sin(angle))*distance*0.5;vec2 pos=uv+offset/resolution;vec4 c=getColor(textureTimeIndex,pos);color+=c;isTransparant=isTransparant||c.a<1.;angle=angularStep/2.+angularStep*float(i);offset=vec2(cos(angle),sin(angle))*distance;pos=uv+offset/resolution;c=getColor(textureTimeIndex,pos);color+=c;isTransparant=isTransparant||c.a<1.;}return color/float(2*halfNbSmoothingBins+weightCenter);}void main(){float scaledSamplingDistance=(maxSmoothingDistance*smoothingDistanceDecayFactor/(smoothingDistanceDecayFactor+zoom))*max(1.,2.-zoomDelta);bool isTransparant0=false;bool isTransparant1=false;vec4 tex0Color;vec4 tex1Color;if(localSmoothing&&halfNbSmoothingBins!=0){tex0Color=circularSampleSmoothing(0,tex0coord,tilePixelSize,scaledSamplingDistance,isTransparant0);tex1Color=circularSampleSmoothing(1,tex1coord,tilePixelSize,scaledSamplingDistance,isTransparant1);}else{tex0Color=texture(tex0,tex0coord);tex1Color=texture(tex1,tex1coord);}vec4 inter=mix(tex0Color,tex1Color,time);if(inter.a<1.0&&!RENDER_TRANSPARENT)discard;COLORING_FRAGMENT_CALLSfragColor.a*=opacity;}".replace("COLORING_FRAGMENT_DEFS",e.join("\n")).replace("COLORING_FRAGMENT_CALLS",t)}else i&&(r=i.getCode());const s=(e.nbSmoothingBins??16).toFixed(0);this.timeInterpolation=e.timeInterpolation??!0,this.material=new o.D$Q({glslVersion:o.Wdf,uniforms:{opacity:{value:1},time:{value:0},zoom:{value:0},tex0xy:{value:[0,0]},tex1xy:{value:[0,0]},tex0size:{value:1},tex1size:{value:1},tilePixelSize:{value:1},categorySmoothTransition:{value:e.categorySmoothTransition??!1},timeInterpolation:{value:this.timeInterpolation},tex0:{value:null},tex1:{value:null},zoomDelta:{value:0},localSmoothing:{value:e.localSmoothing??!1},maxSmoothingDistance:{value:e.maxSmoothingDistance??12},smoothingDistanceDecayFactor:{value:e.smoothingDistanceDecayFactor??10},texN0:{value:this.defaultTexture},texN1:{value:this.defaultTexture},availableN:{value:!1},texE0:{value:this.defaultTexture},texE1:{value:this.defaultTexture},availableE:{value:!1},texS0:{value:this.defaultTexture},texS1:{value:this.defaultTexture},availableS:{value:!1},texW0:{value:this.defaultTexture},texW1:{value:this.defaultTexture},availableW:{value:!1},interpolateTileEdge:{value:this.interpolateTileEdge}},vertexShader:"precision highp float;precision highp sampler2D;uniform mat4 modelViewMatrix;uniform mat4 projectionMatrix;in vec3 position;in vec2 uv;uniform vec2 tex0xy;uniform vec2 tex1xy;uniform float tex0size;uniform float tex1size;out vec2 tex0coord;out vec2 tex1coord;out vec2 mercCoord;void main(){tex0coord=tex0xy+uv*tex0size;tex1coord=tex1xy+uv*tex1size;mercCoord=(modelViewMatrix*vec4(position,1.0)).xy*vec2(1.0,-1.0);gl_Position=projectionMatrix*modelViewMatrix*vec4(position,1.);}",fragmentShader:r,depthTest:!1,depthWrite:!1,transparent:!0,side:o.hB5,defines:{RENDER_TRANSPARENT:e.renderTransparentArea?"true":"false",NB_SMOOTHING_BINS:s}}),this.scene.add(this.threeWorldGroup),this.updateSlippyTileGrid(8,8),this.on("playAnimation",(()=>{this.forceRepaint()})),this.on("animationTimeSet",(()=>{this.forceRepaint()})),this.isReady=!0}onResize(){if(!this.isReady)return;const{width:e,height:t}=this.getMapOrThrow().getCanvas();
1this.getRendererOrThrow().setViewport(0,0,e,t),this.updateSlippyTileGrid(Math.ceil(e/512)+2,Math.ceil(t/512)+2)}onMove(){if(!this.isReady)return;const e=this.getVisibleExtent(this.extentScale);if(!e)throw new Error("New extent is null");const t=ot([Math.min(e[0],this.lastExtent[0]),Math.min(e[1],this.lastExtent[1]),Math.max(e[2],this.lastExtent[2]),Math.max(e[3],this.lastExtent[3])]);(function(e,t){return ot(st(e,t))})(this.lastExtent,e)/t<=this.extentChangedThreshold&&(this.lastExtent=e,this.emit("extentChanged"))}onMoveEnd(){this.refresh()}onProjectionChanged(e){this.globeTilesService.object3D.visible=!1,this.slippyTilesGroup.visible=!1,this.onResize(),this.refresh(),"globe"===e.newProjection?this.globeTilesService.object3D.visible=!0:this.slippyTilesGroup.visible=!0}updateSlippyTileGrid(e,t){this.slippyTilesGroup.clear(),this.slippyTiles.length=0;for(let i=0;i<e;i++){this.slippyTiles[i]=[];for(let e=0;e<t;e++){const t=new o.eaF(this.geometry);t.frustumCulled=!1,this.slippyTiles[i][e]=t,this.slippyTilesGroup.add(t)}}}validateSource(e){let t;try{t=new URL(e)}catch{t=new URL(e,document.baseURI)}if(t.host!==$e.maptilerApiHost)throw new Error("\n\nMapTiler Weather library can only source data from MapTiler Cloud.\nPlease use our MapTiler Plus library for self hosting: https://www.maptiler.com/weather/\nor host your data with our generous free plan at MapTiler Cloud: https://cloud.maptiler.com\n")}addSource(e,t,i=null){this.validateSource(t);const o=new ii(t,((e,t,o)=>{i&&i(e,t,o),this.forceRepaint()}));if(this.map){const e=this.map.getSdkConfig().apiKey,t=this.map.getMaptilerSessionId();o.setMaptilerParams(e,t)}super.addFrame(e,o)}removeSource(e){const t=super.removeFrame(e);for(const i of t)i.data.dispose();this.forceRepaint()}getVisibleExtent(e){if(!this.isReady)return null;const t=this.getMapOrThrow().getBounds();let i=Ce(t.getWest(),t.getSouth()).concat(Ce(t.getEast(),t.getNorth()));return this.extent&&(i=st(this.extent,i)),e&&function(e,t){const i=(e[2]-e[0])/2*(t-1),o=(e[3]-e[1])/2*(t-1);e[0]-=i,e[2]+=i,e[1]-=o,e[3]+=o}(i,e),i}getWantedTiles(e,t,i){const o=Math.ceil(e),r={},s=this.getMapOrThrow().getBounds(),l=Math.min(i,Math.max(t,o-1)),a=Math.min(i,Math.max(t,o));for(let n=l;n<=a;++n){const e=Fe(s,n);for(const t of e)r[t]=!0}return r}setOpacity(e){this.isReady&&(this.material.uniforms.opacity.value=e,this.forceRepaint())}onAdd(e,t){this.registerTelemetry(e),this.map=e,this.map.on("resize",this.onResizeListener),this.map.on("projectiontransition",this.onProjectionChangedListener),this.map.on("move",this.onMoveListener),this.map.on("moveend",this.onMoveEndListener);const i=this.map.getSdkConfig().apiKey,r=this.map.getMaptilerSessionId();this.forEachFrame((e=>{e.data.setMaptilerParams(i,r)})),Ke.hasData()||Ke.fetchLatest(i,r),this.renderer=new o.JeP({canvas:e.getCanvas(),context:t,depth:!1,stencil:!1,antialias:!1,powerPreference:"high-performance"}),this.renderer.autoClear=!1,this.renderer.compile(this.scene,this.camera),this.globeTilesService.init({map:this.map,minZoom:1,maxZoom:this.map.getMaxZoom()});const s=this.getVisibleExtent(this.extentScale);if(null===s)throw new Error("The last extent is null");this.lastExtent=s,this.forceRepaint(),this.onProjectionChanged({type:"projectiontransition",newProjection:e.isGlobeProjection()?"globe":"mercator"})}refresh(){this.getMapOrThrow().isGlobeProjection()&&(this.globeTilesService.update(),this.globeTilesService.recreateGlobeMeshes())}onRemove(e,t){this.isReady&&(null!=this.map&&(this.map.off("resize",this.onResizeListener),this.map.off("projectiontransition",this.onProjectionChangedListener),this.map.off("move",this.onMoveListener),this.map.off("moveend",this.onMoveEndListener),this.map=null),null!=this.renderer&&(this.renderer.dispose(),this.renderer=null),this.forEachFrame((e=>{e.data.dispose()})),this.disposeObjects())}disposeObjects(){if(this.isReady){this.geometry.dispose(),this.material.dispose();for(const e of this.bluringNodePasses)e.dispose()}}getTilePlacement(e,t,i,o,r,s){if(!this.isReady)return null;const l=`${i}/${o}/${r}`,a=0!==i&&i>=this.dataMaxZoom?null:e.getTile(l,t);if(!a||!a.ready)return this.loadLowerZoomLevels&&i>this.tilegrid.getMinZoom()?this.getTilePlacement(e,t,i-1,Math.floor(o/2),Math.floor(r/2),s||{z:i,x:o,y:r}):null;const n={tile:a,xy:[0,0],size:1};if(void 0!==s){const e=2**(s.z-i);n.size/=e,n.xy[0]=s.x%e/e,n.xy[1]=(2**s.z-s.y-1)%e/e}return n}updateTilesMaterials(){var e;const t=this.getMapOrThrow();if(!1===t.isGlobeProjection())return void console.warn("For mercator projection use legacy waether tiles flow");const i=t.getZoom(),o=this.tilegrid.getMinZoom(),r=this.tilegrid.getMaxZoom(),s=i-Math.min(r,Math.max(o,Math.floor(i))),{frameA:l,frameB:a,mi
1x:n}=this.getCurrentFrames();if(l&&a){this.scene.visible=!0,this.materialPool.init();for(const[t,o]of this.globeTilesService.currentTilesMeshes){const r=this.getTilesPair(l,a,t);if(null===r){o.visible=!1;continue}o.visible=!0;const{tileA:c,tileB:u}=r,h=this.materialPool.isEmpty()?this.materialPool.add(this.material.clone()):this.materialPool.pop();o.material=h,h.uniforms.localSmoothing.value=this.material.uniforms.localSmoothing.value,h.uniforms.maxSmoothingDistance.value=this.material.uniforms.maxSmoothingDistance.value,h.uniforms.smoothingDistanceDecayFactor.value=this.material.uniforms.smoothingDistanceDecayFactor.value,h.uniforms.timeInterpolation.value=this.material.uniforms.timeInterpolation.value,h.uniforms.categorySmoothTransition.value=this.material.uniforms.categorySmoothTransition.value,h.uniforms.opacity.value=this.material.uniforms.opacity.value,h.uniforms.tex0.value=c.tile.texture,h.uniforms.tex0xy.value=c.xy,h.uniforms.tex0size.value=c.size,h.uniforms.tex1.value=u.tile.texture,h.uniforms.tex1xy.value=u.xy,h.uniforms.tex1size.value=u.size,h.uniforms.tilePixelSize.value=null==(e=c.tile.texture)?void 0:e.image.width,h.uniforms.time.value=n,h.uniforms.zoomDelta.value=s,h.uniforms.zoom.value=i}}else this.scene.visible=!1}updateSlippyTiles(){var e,t,i,o,r,s,l,a,n,c,u,h,m,d,v,f,p;if(!this.isReady)return;const{frameA:g,frameB:x,mix:w}=this.getCurrentFrames();if(!g||!x)return void(this.scene.visible=!1);this.scene.visible=!0;const T=g.data,S=x.data,y=this.getMapOrThrow().getZoom(),M=this.tilegrid.getMinZoom(),_=this.tilegrid.getMaxZoom(),R=this.getWantedTiles(y,M,_),b={},E=Math.min(_,Math.max(M,Math.floor(y))),A=2**E,P=1/A,C=this.getMapOrThrow().getCenter(),I=this.tilegrid.getTileCoordForCoordAndZ(Ce(C.lng,C.lat),E),z=y-E,F=this.slippyTiles.length;this.materialPool.init();const D=new Map;for(let O=0;O<F;O++){const t=this.slippyTiles[0].length;for(let i=0;i<t;i++){const o=this.slippyTiles[O][i],r=I[1]+O-Math.floor(F/2),s=I[2]+i-Math.floor(t/2);if(s<0||s>=A||!R[`${E}/${r}/${s}`]){o.visible=!1;continue}o.visible=!0;const l=(r%A+A)%A;b[`${E}/${l}/${s}`]=!0;const a=A-s-1;o.scale.x=P,o.scale.y=P,o.position.x=P*(r+.5),o.position.y=P*(a+.5)-1;let n=this.getTilePlacement(T,!0,E,l,s),c=this.getTilePlacement(S,!0,E,l,s);if(n&&!c&&(c=n),!n&&c&&(n=c),!n||!c){let e=g;for(;!n&&(e=this.getNextFrame(e,-1),e);)n=c=this.getTilePlacement(e.data,!1,E,l,s);if(!n||!c){o.visible=!1;continue}}const u=this.materialPool.isEmpty()?this.materialPool.add(this.material.clone()):this.materialPool.pop();u.uniforms.localSmoothing.value=this.material.uniforms.localSmoothing.value,u.uniforms.maxSmoothingDistance.value=this.material.uniforms.maxSmoothingDistance.value,u.uniforms.smoothingDistanceDecayFactor.value=this.material.uniforms.smoothingDistanceDecayFactor.value,u.uniforms.timeInterpolation.value=this.material.uniforms.timeInterpolation.value,u.uniforms.categorySmoothTransition.value=this.material.uniforms.categorySmoothTransition.value,u.uniforms.opacity.value=this.material.uniforms.opacity.value,u.uniforms.tex0.value=n.tile.texture,u.uniforms.tex0xy.value=n.xy,u.uniforms.tex0size.value=n.size,u.uniforms.tex1.value=c.tile.texture,u.uniforms.tex1xy.value=c.xy,u.uniforms.tex1size.value=c.size,u.uniforms.tilePixelSize.value=null==(e=n.tile.texture)?void 0:e.image.width,u.uniforms.time.value=w,u.uniforms.zoomDelta.value=z,u.uniforms.zoom.value=y,o.material=u,D.set(`${O} ${i}`,{material:u,tileA:n,tileB:c,x:O,y:i,z:E})}}if(this.material.uniforms.localSmoothing.value||this.interpolateTileEdge)for(const O of D){const e=O[1],g=e.x,x=e.y,w=e.material,T={x:g,y:x-1},S={x:g+1,y:x},y={x:g,y:x+1},M={x:g-1,y:x},_=`${T.x} ${T.y}`,R=`${S.x} ${S.y}`,b=`${y.x} ${y.y}`,E=`${M.x} ${M.y}`;let A=D.get(_);null!=(i=null==(t=null==A?void 0:A.tileA)?void 0:t.tile)&&i.ready&&null!=(r=null==(o=null==A?void 0:A.tileB)?void 0:o.tile)&&r.ready?(w.uniforms.texN0.value=A.tileA.tile.texture,w.uniforms.texN1.value=A.tileB.tile.texture,w.uniforms.availableN.value=!0):(w.uniforms.texN0.value=null,w.uniforms.texN1.value=null,w.uniforms.availableN.value=!1),A=D.get(R),null!=(l=null==(s=null==A?void 0:A.tileA)?void 0:s.tile)&&l.ready&&null!=(n=null==(a=null==A?void 0:A.tileB)?void 0:a.tile)&&n.ready?(w.uniforms.texE0.value=A.tileA.tile.texture,w.uniforms.texE1.value=A.tileB.tile.texture,w.uniforms.availableE.value=!0):(w.uniforms.texE0.value=null,w.uniforms.texE1.value=null,w.uniforms.availableE.value=!1),A=D.get(b),null!=(u=null==(c=null==A?void 0:A.tileA)?void 0:c.tile)&&u.ready&&null!=(m=null==(h=null==A?void 0:A.tileB)?void 0:h.tile)&&m.ready?(w.uniforms.texS0.value=A.tileA.tile.texture,w.uniforms.texS1.value=A.tileB.tile.texture,w.uniforms.availableS.value=!0):(w.uniforms.texS0.value=null,w.uniforms.texS1.value=null,w.uniforms.availableS.value=!1),A=D.get(E),null!=(v=null==(d=null==A?void 0:A.tileA)?void 0:d.tile)&&v.ready&&null!=(p=null==(f=null==A?void 0:A.tileB)?void 0:f.tile)&&p.ready?(w.uniforms.texW0.value=A.tileA.tile.texture,w.uniforms.texW1.value=A.tileB.tile.texture,w.uniforms.availableW.value=!0):(w.uniforms.texW0.value=null,w.uniforms.texW1.value=null,w.uniforms.availableW.value=!1)}setTimeout((()=>{T.expireCache(b),S.expireCache(b);const e=this.getNextFrame(x,1);if(null!=e&&e.data){const t=Object.keys(b);for(const i of t)e.data.getTile(i,!0)}}),0)}getTilesPair(e,t,i){const o=e.data,r=t.data,s=i.split("/").map((e=>Number.parseInt(e))),l=s[0],a=s[1],n=s[2];let c=this.getTilePlacement(o,!0,l,a,n),u=this.getTilePlacement(r,!0,l,a,n);if(null===c){let t=e;for(;null===c&&(t=this.getNextFrame(t,-1),null!==t);)c=this.getTilePlacement(t.data,!1,l,a,n)}return null===u&&(u=c),null===c||null===u?null:{tileA:c,tileB:u}}prerender(e,t){if(!this.isReady)return;this.animationTick();const i=(new o.kn4).fromArray(t.defaultProjectionData.mainMatrix);if(this.getMapOrThrow().isGlobeProjection())this.camera.projectionMatrix=i,this.updateTilesMaterials();else{const e=(new o.kn4).scale(new o.Pq0(1,-1,1));this.camera.projectionMatrix=i.multiply(e),this.updateSlippyTiles()}this.prerenderInternal()}prerenderInternal(){}render(e,t){if(!this.isReady)return;const i=this.getRendererOrThrow();i.state.reset(),this.renderInternal(),i.render(this.scene,this.camera),(this.getAnimationSpeed()>0||this.repaintOnPausedAnimation)&&this.forceRepaint()}renderInternal(){}pickFrame(e,t,i,o={}){var r;if(!this.isReady)return null;const s=Ae(e,t);if(!this.map)return null;const l=o.load??!1,a=o.highestRes?this.tilegrid.getMaxZoom():Math.min(~~(null==(r=this.map)?void 0:r.getZoom()),this.tilegrid.getMaxZoom()),n=2**a,c=(.5+s[0])%1*n,u=(1-(s[1]+.5))*n,h=this.getTilePlacement(i,l,a,Math.floor(c),Math.floor(u));if(null==h||null==h.tile.texture)return null;if(this.coloringFragments){const e=Ie(h.tile.texture.image,h.xy[0]+h.size*(c%1),1-h.xy[1]-h.size+h.size*(u%1));return this.coloringFragments.flatMap((t=>t.decodeChannel(e)))}if(this.multiChannelColoringFragment){const e=Ie(h.tile.texture.image,h.xy[0]+h.size*(c%1),1-h.xy[1]-h.size+h.size*(u%1));return this.multiChannelColoringFragment.decodeChannel(e)}return null}pickFrameBilinear(e,t,i,o={}){var r;
1const s=o.load??!1,l=o.highestRes??!1,a=Ae(e,t);if(!this.map)return null;const n=l?this.tilegrid.getMaxZoom():Math.min(~~(null==(r=this.map)?void 0:r.getZoom()),this.tilegrid.getMaxZoom()),c=2**n;let u=(.5+a[0])%1*c,h=(1-(a[1]+.5))*c;const m=this.getTilePlacement(i,s,n,Math.floor(u),Math.floor(h));if(null==m||null==m.tile.texture)return null;const d=1/m.tile.texture.image.width;u-=d/2,h-=d/2;const v={x:~~(u/d)*d,y:~~(h/d)*d},f={x:v.x+d,y:v.y},p={x:v.x+d,y:v.y+d},g={x:v.x,y:v.y+d},x=this.getTilePlacement(i,s,n,Math.floor(v.x),Math.floor(v.y)),w=this.getTilePlacement(i,s,n,Math.floor(f.x),Math.floor(f.y)),T=this.getTilePlacement(i,s,n,Math.floor(p.x),Math.floor(p.y)),S=this.getTilePlacement(i,s,n,Math.floor(g.x),Math.floor(g.y));if(null==x||null==x.tile.texture||null==w||null==w.tile.texture||null==T||null==T.tile.texture||null==S||null==S.tile.texture)return null;const y=Ie(m.tile.texture.image,m.xy[0]+m.size*(u%1),1-m.xy[1]-m.size+m.size*(h%1)),M=Ie(x.tile.texture.image,x.xy[0]+x.size*(v.x%1),1-x.xy[1]-x.size+x.size*(v.y%1)),_=Ie(w.tile.texture.image,w.xy[0]+w.size*(f.x%1),1-w.xy[1]-w.size+w.size*(f.y%1)),R=Ie(T.tile.texture.image,T.xy[0]+T.size*(p.x%1),1-T.xy[1]-T.size+T.size*(p.y%1)),b=Ie(S.tile.texture.image,S.xy[0]+S.size*(g.x%1),1-S.xy[1]-S.size+S.size*(g.y%1)),E=(h-v.y)/(g.y-v.y),A=1-E,P=(u-v.x)/(f.x-v.x),C=1-P;if(this.coloringFragments){const e={r:M.r*A+b.r*E,g:M.g*A+b.g*E,b:M.b*A+b.b*E,a:M.a*A+b.a*E},t={r:_.r*A+R.r*E,g:_.g*A+R.g*E,b:_.b*A+R.b*E,a:_.a*A+R.a*E},i={r:e.r*C+t.r*P,g:e.g*C+t.g*P,b:e.b*C+t.b*P,a:e.a*C+t.a*P};return this.coloringFragments.flatMap((e=>e.decodeChannel(i)))}if(this.multiChannelColoringFragment){if(M.a!==_.a||M.a!==R.a||M.a!==b.a)return this.multiChannelColoringFragment.decodeChannel(y);const e=this.multiChannelColoringFragment.decodeChannel(M),t=this.multiChannelColoringFragment.decodeChannel(_),i=this.multiChannelColoringFragment.decodeChannel(R),o=this.multiChannelColoringFragment.decodeChannel(b);return[(e[0]*A+o[0]*E)*C+(t[0]*A+i[0]*E)*P,e[1]]}return null}pick(e,t,i={}){if(!this.isReady)return null;const{frameA:o,frameB:r,mix:s}=this.getCurrentFrames();if(!o||!r)return null;const l=!!i.bilinear,a=i.load??!1,n=i.highestRes??!1,c=l?this.pickFrameBilinear(e,t,o.data,{load:a,highestRes:n}):this.pickFrame(e,t,o.data,{load:a,highestRes:n});let u=c;return o.data!==r.data&&(u=l?this.pickFrameBilinear(e,t,r.data,{load:a,highestRes:n}):this.pickFrame(e,t,r.data,{load:a,highestRes:n})),c?u?this.coloringFragments?c.flatMap(((e,t)=>{const i=u[t];return Array.isArray(e)&&Array.isArray(i)?e.map(((e,t)=>{const o=i[t];return e*(1-s)+o*s})):e*(1-s)+i*s})):this.multiChannelColoringFragment?this.timeInterpolation?[c[0]*(1-s)+u[0]*s,s<.5?c[1]:u[1]]:[s<.5?c[0]:u[0],s<.5?c[1]:u[1]]:null:c:u}forceRepaint(){try{this.getMapOrThrow().triggerRepaint()}catch{}}computeCurrentMixedImage({zxy:e="0/0/0",blurKernel:t=0,outputSize:i=-1,channel:r="r"}){var s,l,a,n;if(!this.isReady)return null;const c=this.getCurrentFrames(),u=c.mix,h=null==(l=null==(s=c.frameA)?void 0:s.data.getTile(e,!1))?void 0:l.texture,m=null==(n=null==(a=c.frameB)?void 0:a.data.getTile(e,!1))?void 0:n.texture,d=i<0?Number.parseInt(null==h?void 0:h.image.width):i,v=i<0?Number.parseInt(null==h?void 0:h.image.height):i;this.bluringNodePasses.length||this.bluringNodePasses.push(new Qt(d,v),new Qt(d,v),new Qt(d,v));const f=this.bluringNodePasses[0],p=this.bluringNodePasses[1],g=this.bluringNodePasses[2];if(f.setSize(d,v),p.setSize(d,v),p.setSize(d,v),f.setFragmentShader("precision highp float;precision highp int;precision highp sampler2D;uniform sampler2D imageA;uniform sampler2D imageB;uniform float mixValue;in vec2 vUv;out vec4 fragColor;void main(){fragColor=mix(texture(imageA,vUv),texture(imageB,vUv),mixValue);}"),f.setDefine("CHANNEL",r),f.setUniform("imageA",h),f.setUniform("imageB",m),f.setUniform("mixValue",u),f.process(),0===t){const e=f.getPixelData();return{data:e,channels:e.length/(d*v),width:d,height:v}}if(![5,9,13,19].includes(t))throw new Error(`The kernel bluring kernel size ${t} is not available.`);p.setUniform("direction",new o.I9Y(1,0)),p.setUniform("kernelSize",t),p.setUniform("imgToBlur",f.getOutputTexture()),p.setFragmentShader(Kt),p.process(),g.setUniform("direction",new o.I9Y(0,1)),g.setUniform("kernelSize",t),g.setUniform("imgToBlur",p.getOutputTexture()),g.setFragmentShader(Kt),g.process();const x=g.getPixelData();for(const o of this.bluringNodePasses)o.dispose();return{data:x,channels:x.length/(d*v),width:d,height:v}}setTimeInterpolation(e){this.isReady&&(this.material.uniforms.timeInterpolation.value=e)}setCategorySmoothTransition(e){this.isReady&&(this.material.uniforms.categorySmoothTransition.value=e,this.forceRepaint())}setLocalSmoothing(e){this.material.uniforms.localSmoothing.value=e,this.forceRepaint()}setMaxSmoothingDistance(e){this.material.uniforms.maxSmoothingDistance.value=e,this.forceRepaint()}setSmoothingDistanceDecayFactor(e){this.material.uniforms.smoothingDistanceDecayFactor.value=e,this.forceRepaint()}getRepaintOnPausedAnimation(){return this.repaintOnPausedAnimation}setRepaintOnPausedAnimation(e){this.repaintOnPausedAnimation=e,this.forceRepaint()}registerTelemetry(e){e.telemetry.registerModule("@maptiler/weather","3.1.1")}}class di extends mi{constructor(e,t,i,r){super(e,null,null),a(this,"rttScene",new o.Z58),a(this,"rttCamera"),a(this,"rttMaterial"),a(this,"rttMesh"),a(this,"particleTexturePrev"),a(this,"particleTexture0"),a(this,"particleTexture1"),a(this,"particleMaterial"),a(this,"particles"),a(this,"particleBackgroun
1d"),a(this,"accumulator"),a(this,"accumulatorDrawMesh"),a(this,"flipFlop",!1),a(this,"numParticles"),a(this,"particleDensity"),a(this,"refreshInterval"),a(this,"fadeFactor"),a(this,"particleColor"),a(this,"particleFastColor"),a(this,"particleFastSpeed"),a(this,"particleSize"),a(this,"drawAsLines"),a(this,"particleSpeed"),a(this,"pixelRatio"),a(this,"prevRenderTime",0),a(this,"lastRenderTime",0),a(this,"forceRender",!0),a(this,"rttTimestep",200),a(this,"tileGridPass",0),a(this,"particlesTexturePreview"),t&&i&&this.initParticle(t,i,r)}initParticle(e,t,i){if(this.init(e,i,null),this.extentScale=1.2,this.numParticles=128,null!=t.maxAmount){if(!(t.maxAmount>=4&&t.maxAmount)||t.maxAmount&t.maxAmount-1)throw new Error("The number of particles needs to be power of two and at least 4");this.numParticles=t.maxAmount}const r=window.devicePixelRatio;this.particleDensity=t.density??2,this.particleDensity/=r*r,this.refreshInterval=t.refreshInterval??800,this.fadeFactor=t.fadeFactor??.1,this.particleColor=be(t.color??[255,255,255,192]),this.particleFastColor=t.fastColor?be(t.fastColor):this.particleColor,this.particleFastSpeed=(t.fastSpeed??2)*r,this.particleSize=t.size??1.5,this.drawAsLines=t.drawAsLines??!1,this.particleSpeed=(t.speed??.001)/1e3,this.pixelRatio=t.pixelRatio??(r>1?1:2),this.particleTexturePrev=this.generateRandomizeParticleTexture(this.numParticles,this.numParticles),this.particleTexture0=new o.nWS(this.numParticles,this.numParticles,{stencilBuffer:!1,depthBuffer:!1}),this.particleTexture0.texture=this.particleTexturePrev.clone(),this.particleTexture1=this.particleTexture0.clone(),this.rttMaterial=new o.D$Q({glslVersion:o.Wdf,uniforms:{tileGridPass:{value:this.tileGridPass},uniformSpeed:{value:t.uniformSpeed??!1},canvasDiagonal:{value:0},angleDirectionShiftSkip:{value:t.angleDirectionShiftSkip??90},rttXY:{value:[0,0]},rttScale:{value:1},rttTexture:{value:this.particleTexture0.texture},tileScale:{value:0},useAlphaAsMask:{value:t.useAlphaAsMask??!1},tilePosition:{value:[0,0]},time:{value:0},timestep:{value:0},tex0xy:{value:[0,0]},tex1xy:{value:[0,0]},tex0size:{value:1},tex1size:{value:1},tex0:{value:null},tex1:{value:null}},vertexShader:"precision highp float;uniform mat4 modelViewMatrix;uniform mat4 projectionMatrix;in vec3 position;in vec2 uv;out vec2 rttCoord;void main(){rttCoord=uv;gl_Position=projectionMatrix*vec4(position,1.);}",fragmentShader:"precision highp float;precision highp sampler2D;\n#define M_PI 3.14159265358\nuniform float tileScale;uniform vec2 tilePosition;uniform vec2 tex0xy;uniform vec2 tex1xy;uniform float tex0size;uniform float tex1size;uniform bool useAlphaAsMask;uniform sampler2D rttTexture;uniform vec2 rttXY;uniform float rttScale;uniform float time;uniform sampler2D tex0;uniform sampler2D tex1;uniform float timestep;uniform float canvasDiagonal;uniform float angleDirectionShiftSkip;uniform bool uniformSpeed;uniform float tileGridPass;in vec2 rttCoord;out vec4 fragColor;float modI(float a,float b){float m=a-floor((a+0.5)/b)*b;return floor(m+0.5);}void main(){vec4 color=texture(rttTexture,rttCoord);if(tileGridPass==0.&&modI(floor(color.r*255.),2.)==0.){fragColor=color;return;}if(tileGridPass==1.&&modI(floor(color.r*255.),2.)!=0.){fragColor=color;return;}vec2 pos=color.ba+color.rg/255.0;vec2 posInTile=(rttXY+rttScale*pos)/tileScale-tilePosition;float uniformSpeedFactor=uniformSpeed ?(4000./canvasDiagonal): 1.;if(posInTile.x>=0.&&posInTile.x<=1.&&posInTile.y>=0.&&posInTile.y<=1.){posInTile.y=1.0-posInTile.y;vec2 tex0coord=tex0xy+posInTile*tex0size;vec2 tex1coord=tex1xy+posInTile*tex1size;vec4 tex0Color=texture(tex0,tex0coord);vec4 tex1Color=texture(tex1,tex1coord);if(useAlphaAsMask&&(tex0Color.a<1.||tex1Color.a<1.)){fragColor=color;return;}vec2 uv;bool skipRendering=false;if(D_WAVES){vec2 value0=tex0Color.D_CHANNELS;vec2 value1=tex1Color.D_CHANNELS;float dir0=2.0*M_PI*(-value0.x-0.25);float dir1=2.0*M_PI*(-value1.x-0.25);float speed=sqrt(1.0/mix(value0.y,value1.y,time));uv=vec2(mix(cos(dir0),cos(dir1),time),mix(sin(dir0),sin(dir1),time))*(D_MIN+(D_MAX-D_MIN)*speed);}else{vec4 lookup=mix(tex0Color,tex1Color,time);vec2 value=lookup.D_CHANNELS;uv=D_MIN+(D_MAX-D_MIN)*value;if(angleDirectionShiftSkip<89.999){vec2 offset=vec2(uv.x,-uv.y)*timestep*uniformSpeedFactor;vec2 nextPos=pos+offset;vec2 posNextInTile=(rttXY+rttScale*nextPos)/tileScale-tilePosition;posNextInTile.y=1.0-posNextInTile.y;vec2 tex0coordNext=tex0xy+posNextInTile*tex0size;vec2 tex1coordNext=tex1xy+posNextInTile*tex1size;vec4 tex0ColorNext=texture(tex0,tex0coordNext);vec4 tex1ColorNext=texture(tex1,tex1coordNext);vec4 lookupNext=mix(tex0ColorNext,tex1ColorNext,time);vec2 valueNext=lookupNext.D_CHANNELS;vec2 uvNext=D_MIN+(D_MAX-D_MIN)*valueNext;skipRendering=dot(normalize(uv),normalize(uvNext))<cos(angleDirectionShiftSkip*M_PI/180.);}}vec2 offset=vec2(uv.x,-uv.y)*timestep*uniformSpeedFactor;if(skipRendering){offset=vec2(0.,0.);}vec2 newPos=pos+offset;fragColor=vec4(fract(newPos*255.0),floor(newPos*255.0)/255.0);float red255=floor(fragColor.r*255.);
1if(tileGridPass==0.){if(modI(red255,2.)!=0.){red255-=1.;}}else{if(modI(red255,2.)==0.){red255+=1.;}}fragColor.r=red255/255.;}else{fragColor=color;}}",defines:{D_MIN:(t.decodeMin??0).toFixed(2),D_MAX:(t.decodeMax??1).toFixed(2),D_CHANNELS:t.decodeChannels??"rg",D_WAVES:t.decodeAsWaves?"true":"false"},depthTest:!1,depthWrite:!1}),this.rttCamera=new o.qUd(-this.numParticles/2,this.numParticles/2,this.numParticles/2,-this.numParticles/2,-100,100),this.rttMesh=new o.eaF(new o.bdM(this.numParticles,this.numParticles),this.rttMaterial),this.rttScene.add(this.rttMesh),this.accumulator=new o.nWS(16,16,{minFilter:o.k6q,magFilter:o.k6q,stencilBuffer:!1,format:o.GWd,depthBuffer:!1}),this.particleBackground=new o.eaF(new o.bdM(2,2),new o.D$Q({glslVersion:o.Wdf,transparent:!0,blending:o.bCz,blendEquationAlpha:o.nST,vertexShader:"precision highp float;in vec3 position;void main(){gl_Position=vec4(position,1.);}",fragmentShader:`precision highp float;out vec4 fragColor;void main(){fragColor=vec4(.0,.0,.0,${this.fadeFactor.toFixed(2)});}`}));const s=r*this.pixelRatio*this.particleSize,l=r*this.particleSize;if(this.particleMaterial=new o.D$Q({glslVersion:o.Wdf,uniforms:{fastIsLarger:{value:t.fastIsLarger??!1},rttSize:{value:this.numParticles},rttTexture:{value:this.particleTexture1.texture},rttTexturePrev:{value:this.particleTexturePrev},screenSize:{value:1},extrapolationFactor:{value:0},renderStepSize:{value:0}},vertexShader:this.drawAsLines?"#version 300 es\nprecision highp float;uniform sampler2D rttTexture;uniform sampler2D rttTexturePrev;uniform float rttSize;uniform float screenSize;uniform float extrapolationFactor;uniform float renderStepSize;out float speed;vec4 advance(float position_){if(position_>(DENSITY/1000.0)*screenSize*screenSize){speed=0.0;return vec4(0.0);}float x=fract(position_/rttSize);float y=floor(position_/rttSize)/rttSize;vec4 color=texture(rttTexture,vec2(x,y));vec2 pos=color.ba+color.rg/255.0;vec4 colorPrev=texture(rttTexturePrev,vec2(x,y));vec2 posPrev=colorPrev.ba+colorPrev.rg/255.0;vec2 diff=pos-posPrev;pos+=diff*extrapolationFactor;speed=renderStepSize*step(0.0001,dot(posPrev,posPrev))*length(diff*screenSize);return vec4(pos,diff);}void main(){float position_=floor(position/2.0);float vertex=2.0*fract(position/2.0);vec4 posdiff=advance(position_);vec2 pos=posdiff.xy;vec2 dir=normalize(posdiff.zw);vec2 uv=(float(SIZE)/screenSize)*vec2(vertex,-vertex)*dir.yx;pos=2.0*(pos-uv)-1.0;gl_Position=vec4(pos.x,-pos.y,0.,1.);}":"precision highp float;precision highp sampler2D;in float position;uniform sampler2D rttTexture;uniform sampler2D rttTexturePrev;uniform float rttSize;uniform float screenSize;uniform float extrapolationFactor;uniform float renderStepSize;uniform bool fastIsLarger;out float speed;float factor=1.;vec4 advance(float position_){if(position_>(DENSITY/1000.0)*screenSize*screenSize){speed=0.0;return vec4(0.0);}float x=fract(position_/rttSize);float y=floor(position_/rttSize)/rttSize;vec4 color=texture(rttTexture,vec2(x,y));vec2 pos=color.ba+color.rg/255.0;vec4 colorPrev=texture(rttTexturePrev,vec2(x,y));vec2 posPrev=colorPrev.ba+colorPrev.rg/255.0;vec2 diff=pos-posPrev;pos+=diff*extrapolationFactor;speed=renderStepSize*step(0.0001,dot(posPrev,posPrev))*length(diff*screenSize);return vec4(pos,diff);}void main(){vec4 posdiff=advance(position);gl_PointSize=fastIsLarger ?(SIZE+SIZE*log(speed+1.))/2. : SIZE;gl_Position=vec4(2.0*posdiff.x-1.0,-(2.0*posdiff.y-1.0),0.,1.);}",fragmentShader:"precision highp float;precision highp sampler2D;out vec4 fragColor;in float speed;void main(){vec2 uv=vec2(gl_PointCoord.x-0.5,1.0-gl_PointCoord.y-0.5);float dFromCenter=sqrt(uv.x*uv.x+uv.y*uv.y);if(dFromCenter>0.5){discard;return;}if(speed==0.){discard;return;}float colorFactor=min(1.0,speed/COLOR_SPEED);fragColor=mix(COLOR_A,COLOR_B,colorFactor);float opacityFactor=smoothstep(0.05,0.1,speed);fragColor.a*=opacityFactor;}",defines:{COLOR_A:this.particleColor,COLOR_B:this.particleFastColor,COLOR_SPEED:this.particleFastSpeed.toFixed(2),DENSITY:this.particleDensity.toFixed(2),SIZE:(this.drawAsLines?l:s).toFixed(1)},transparent:!0,depthTest:!1,depthWrite:!1,linewidth:this.pixelRatio}),this.drawAsLines){const e=new Float32Array(Array(2*this.numParticles*this.numParticles).keys()),t=new o.LoY;t.setAttribute("position",new o.qtW(e,1)),this.particles=new o.DXC(t,this.particleMaterial)}else{const e=new Float32Array(Array(this.numParticles*this.numParticles).keys()),t=new o.LoY;t.setAttribute("position",new o.qtW(e,1)),this.particles=new o.ONl(t,this.particleMaterial)}this.particles.frustumCulled=!1;const a=new o.D$Q({glslVersion:o.Wdf,premultipliedAlpha:!0,transparent:!0,depthTest:!1,depthWrite:!1,uniforms:{opacity:{value:1},tex0:{value:this.accumulator.texture}},vertexShader:"precision highp float;uniform mat4 modelViewMatrix;uniform mat4 projectionMatrix;in vec3 position;in vec2 uv;out vec2 coord;void main(){coord=uv;gl_Position=projectionMatrix*modelViewMatrix*vec4(position,1.);}",fragmentShader:"precision highp float;precision highp sampler2D;uniform float opacity;uniform sampler2D tex0;in vec2 coord;out vec4 fragColor;void main(){vec4 c=texture(tex0,coord);if(c.a<1.0/16.0){discard;}if(opacity<0.0001){discard;}fragColor=c;fragColor.a*=opacity;}"});this.accumulatorDrawMesh=new o.eaF(new o.bdM(1,1),a),this.accumulatorDrawMesh.renderOrder=2,this.slippyTilesGroup.add(this.accumulatorDrawMesh),this.globeTilesService.visibleTilesAreaMesh.visible=!0,this.globeTilesService.visibleTilesAreaMesh.material=a,setInterval((()=>{this.renderer&&this.randomizeParticles(!1)}),this.refreshInterval),this.on("extentChanged",(()=>{this.refresh()}))}generateRandomizeParticleTexture(e,t){const i=new Uint8Array(4*e*t);for(let o=0;o<i.length;
1o++)i[o]=Math.floor(256*Math.random());return new o.GYF(i,e,t)}randomizeParticles(e){if(!this.renderer)return;let t=this.numParticles,i=this.numParticles;const r=new o.I9Y(0,0);if(!e){const e=this.numParticles/4;t=e,i=e,r.x=Math.floor(Math.random()*this.numParticles/e)*e,r.y=Math.floor(Math.random()*this.numParticles/e)*e}const s=this.generateRandomizeParticleTexture(t,i);this.renderer.copyTextureToTexture(r,s,this.particleTexturePrev),this.renderer.copyTextureToTexture(r,s,this.particleTexture0.texture),this.renderer.copyTextureToTexture(r,s,this.particleTexture1.texture),s.dispose(),this.forceRender=e}getParticleUtilization(){const e=this.particleMaterial.uniforms.screenSize.value;return this.particleDensity/1e3*e*e/(this.numParticles*this.numParticles)}setOpacity(e){super.setOpacity(e),this.accumulatorDrawMesh.material.uniforms.opacity.value=e}disposeObjects(){super.disposeObjects(),this.particleTexturePrev.dispose(),this.particleTexture0.texture.dispose(),this.particleTexture0.dispose(),this.particleTexture1.texture.dispose(),this.particleTexture1.dispose(),this.accumulator.texture.dispose(),this.accumulator.dispose(),this.rttMesh.geometry.dispose(),this.rttMesh.material.dispose(),this.particleBackground.geometry.dispose(),this.particleBackground.material.dispose(),this.particles.geometry.dispose(),this.particles.material.dispose(),this.accumulatorDrawMesh.geometry.dispose(),this.accumulatorDrawMesh.material.dispose()}updateRenderingSize(){const e=this.getMapOrThrow(),t=e.getZoom(),i=e.getPitch(),o=e.getCanvas(),r=o.width,s=o.height,{resolutionScaleFactor:l}=ui(i,e),a=2048*this.pixelRatio*l;let n=a;n=!0===this.getMapOrThrow().isGlobeProjection()?t>ni+1?a:Math.max(a*(.75*t),1024):Math.round(this.pixelRatio*this.extentScale*Math.max(r,s)),n=Math.min(n,this.getRendererOrThrow().capabilities.maxTextureSize);const c=Math.sqrt(r*r+s*s)*(1===devicePixelRatio?2:1);this.rttMaterial.uniforms.canvasDiagonal.value=c,this.particleMaterial.uniforms.screenSize.value=n,this.accumulator.setSize(n,n),this.slippyTilesGroup.remove(this.accumulatorDrawMesh),this.slippyTilesGroup.add(this.accumulatorDrawMesh)}refresh(){super.refresh(),!1===this.getMapOrThrow().isGlobeProjection()?this.refreshMercator():this.refreshGlobe(),this.updateRenderingSize();const e=this.getRendererOrThrow();e.setRenderTarget(this.accumulator),e.setClearAlpha(0),e.clearColor(),e.setRenderTarget(null),this.randomizeParticles(!0)}prerenderInternal(){const e=performance.now(),t=e-this.lastRenderTime,i=this.forceRender||t>this.rttTimestep||!this.prevRenderTime;i&&(this.forceRender=!1,this.rttMaterial.uniforms.timestep.value=this.particleSpeed*t,this.getRendererOrThrow().setRenderTarget(this.flipFlop?this.particleTexture1:this.particleTexture0),this.getRendererOrThrow().copyFramebufferToTexture(new o.I9Y(0,0),this.particleTexturePrev),this.prevRenderTime=this.lastRenderTime,this.lastRenderTime=e,!1===this.getMapOrThrow().isGlobeProjection()?this.prerenderInternalMercator():this.prerenderInternalGlobe(),this.particleMaterial.uniforms.rttTexture.value=(this.flipFlop?this.particleTexture1:this.particleTexture0).texture,this.tileGridPass=0===this.tileGridPass?1:0);const r=this.lastRenderTime-this.prevRenderTime,s=i?0:t/r;this.particleMaterial.uniforms.extrapolationFactor.value=s,this.particleMaterial.uniforms.renderStepSize.value=r/1e3;const l=this.getRendererOrThrow();if(l.setRenderTarget(this.accumulator),l.render(this.particleBackground,this.camera),l.render(this.particles,this.camera),l.setRenderTarget(null),void 0!==this.particlesTexturePreview){const e=this.accumulator.width,t=this.accumulator.height,i=new Uint8Array(e*t*4);l.readRenderTargetPixels(this.accumulator,0,0,e,t,i),this.particlesTexturePreview.update(i,e,t)}}refreshMercator(){const e=this.getVisibleExtent(this.extentScale);if(!e)throw new Error("The extent is null");const t=Math.max(e[2]-e[0],e[3]-e[1])/Pe,i=[.5+(e[2]+e[0])/2/Pe-t/2,.5-(e[3]+e[1])/2/Pe-t/2];this.rttMaterial.uniforms.rttScale.value=t,this.rttMaterial.uniforms.rttXY.value=i}prerenderInternalMercator(){const e=this.slippyTiles.length;for(let t=0;t<e;t++){const e=this.slippyTiles[0].length;for(let i=0;i<e;i++){const e=this.slippyTiles[t][i];if(!e.visible)continue;const o=e.material.uniforms;if(!o)continue;const r=e.scale.x;this.rttMaterial.uniforms.tileScale.value=r,this.rttMaterial.uniforms.tilePosition.value=[e.position.x/r-.5,-e.position.y/r-.5],this.rttMaterial.uniforms.tileGridPass.value=this.tileGridPass,this.rttMaterial.uniforms.time.value=o.time.value,this.rttMaterial.uniforms.tex0.value=o.tex0.value,this.rttMaterial.uniforms.tex0xy.value=o.tex0xy.value,this.rttMaterial.uniforms.tex0size.value=o.tex0size.value,this.rttMaterial.uniforms.tex1.value=o.tex1.value,this.rttMaterial.uniforms.tex1xy.value=o.tex1xy.value,this.rttMaterial.uniforms.tex1size.value=o.tex1size.value,this.rttMaterial.uniforms.rttTexture.value=(this.flipFlop?this.particleTexture1:this.particleTexture0).texture;const s=this.getRendererOrThrow();s.setRenderTarget(this.flipFlop?this.particleTexture0:this.particleTexture1),s.render(this.rttScene,this.rttCamera),this.flipFlop=!this.flipFlop}}}refreshGlobe(){this.rttMaterial.uniforms.rttScale.value=1,this.rttMaterial.uniforms.rttXY.value=[0,0]}prerenderInternalGlobe(){const e=[...this.globeTilesService.currentTilesMeshes.entries()].map((([e])=>e)),t=this.getMapOrThrow().getCenter(),i=this.getMapOrThrow().getZoom(),r
1=e.length,s=Math.floor(Math.sqrt(r)),l=t.lng>=0?Math.floor(t.lng/90):-1*Math.floor(Math.abs(t.lng)/90);let a=0;if(this.globeTilesService.visibleTilesAreaMesh.rotation.y=0,i<=ni){const e=l*o.cj9.degToRad(180);this.globeTilesService.visibleTilesAreaMesh.rotation.y=e,a=l*(s/2)}const{frameA:n,frameB:c,mix:u}=this.getCurrentFrames();if(n&&c)for(const o of e){const t=e.indexOf(o),i=(Math.floor(t/s)+a+s)%s,r=t%s;this.rttMaterial.uniforms.tileScale.value=1/s,this.rttMaterial.uniforms.tilePosition.value=[i,r];const l=this.getTilesPair(n,c,o);if(null===l)continue;const{tileA:h,tileB:m}=l;this.rttMaterial.uniforms.tileGridPass.value=this.tileGridPass,this.rttMaterial.uniforms.time.value=u,this.rttMaterial.uniforms.tex0.value=h.tile.texture,this.rttMaterial.uniforms.tex0xy.value=h.xy,this.rttMaterial.uniforms.tex0size.value=h.size,this.rttMaterial.uniforms.tex1.value=m.tile.texture,this.rttMaterial.uniforms.tex1xy.value=m.xy,this.rttMaterial.uniforms.tex1size.value=m.size,this.rttMaterial.uniforms.rttTexture.value=(this.flipFlop?this.particleTexture1:this.particleTexture0).texture;const d=this.getRendererOrThrow();d.setRenderTarget(this.flipFlop?this.particleTexture0:this.particleTexture1),d.render(this.rttScene,this.rttCamera),this.flipFlop=!this.flipFlop}}renderInternal(){if(!1===this.getMapOrThrow().isGlobeProjection()){const e=this.rttMaterial.uniforms.rttScale.value;this.accumulatorDrawMesh.position.x=.5*e+this.rttMaterial.uniforms.rttXY.value[0],this.accumulatorDrawMesh.position.y=-.5*e-this.rttMaterial.uniforms.rttXY.value[1],this.accumulatorDrawMesh.scale.x=this.accumulatorDrawMesh.scale.y=e}}}class vi extends mi{constructor(e={}){super(e.id||"MapTiler Precipitation",null,null,null),a(this,"constructorOptions"),a(this,"isSourceReady",!1),a(this,"colorRamp"),this.constructorOptions=e}async onAdd(e,t){const i=e.getSdkConfig().apiKey,o=e.getMaptilerSessionId();Ke.hasData()||await Ke.fetchLatest(i,o);const r=Ke.getPrecipitationData();if(!r)throw new Error("The latest weather data is not avaialble");this.colorRamp=this.constructorOptions.colorramp??Le.builtin.PRECIPITATION,this.init({minZoom:r.metadata.minzoom,maxZoom:r.metadata.maxzoom,repaintOnPausedAnimation:!1},[new Ge({decode:{channel:r.metadata.weather_variable.decoding.channels.toLowerCase(),min:r.metadata.weather_variable.decoding.min,max:r.metadata.weather_variable.decoding.max},stops:this.colorRamp,smooth:this.constructorOptions.smooth??!0,opacity:this.constructorOptions.opacity??1})]),super.onAdd(e,t);const s=Ke.getSourcesAndTimestamps(r,i,o);for(const a of s)this.addSource(a.timestamp,a.source);const l=+new Date/1e3;l>=this.getAnimationStart()&&l<=this.getAnimationEnd()&&this.setAnimationTime(l),this.isSourceReady=!0,this.emit("sourceReady",{map:e,layer:this})}getIsSourceReady(){return this.isSourceReady}pickAt(e,t,i={}){const o=super.pick(e,t,i);return o?{value:o[0],valueImperial:o[0]/2.54}:null}getColorRamp(){return this.colorRamp}onSourceReadyAsync(){return new Promise((e=>{if(this.isSourceReady)return e();this.once("sourceReady",(()=>{e()}))}))}}class fi extends mi{constructor(e={}){super(e.id||"MapTiler Temperature",null,null,null),a(this,"constructorOptions"),a(this,"isSourceReady",!1),a(this,"colorRamp"),this.constructorOptions=e}async onAdd(e,t){const i=e.getSdkConfig().apiKey,o=e.getMaptilerSessionId();Ke.hasData()||await Ke.fetchLatest(i,o);const r=Ke.getTemperatureData();if(!r)throw new Error("The latest weather data is not avaialble");this.colorRamp=this.constructorOptions.colorramp??Le.builtin.TEMPERATURE_2,this.init({minZoom:r.metadata.minzoom,maxZoom:r.metadata.maxzoom,repaintOnPausedAnimation:!1},[new Ge({decode:{channel:r.metadata.weather_variable.decoding.channels.toLowerCase(),min:r.metadata.weather_variable.decoding.min,max:r.metadata.weather_variable.decoding.max},stops:this.colorRamp,smooth:this.constructorOptions.smooth??!0,opacity:this.constructorOptions.opacity??1})]),super.onAdd(e,t);const s=Ke.getSourcesAndTimestamps(r,i,o);for(const a of s)this.addSource(a.timestamp,a.source);const l=+new Date/1e3;l>=this.getAnimationStart()&&l<=this.getAnimationEnd()&&this.setAnimationTime(l),this.isSourceReady=!0,this.emit
1("sourceReady",{map:e,layer:this})}getIsSourceReady(){return this.isSourceReady}pickAt(e,t,i={}){const o=super.pick(e,t,i);if(!o)return null;const r=o[0];return{value:r,valueImperial:32+9*r/5}}getColorRamp(){return this.colorRamp}onSourceReadyAsync(){return new Promise((e=>{if(this.isSourceReady)return e();this.once("sourceReady",(()=>{e()}))}))}}class pi extends mi{constructor(e={}){super(e.id||"MapTiler Radar",null,null,null),a(this,"constructorOptions"),a(this,"isSourceReady",!1),a(this,"colorRamp"),this.constructorOptions=e}async onAdd(e,t){const i=e.getSdkConfig().apiKey,o=e.getMaptilerSessionId();Ke.hasData()||await Ke.fetchLatest(i,o);const r=Ke.getRadarData();if(!r)throw new Error("The latest weather data is not avaialble");this.colorRamp=this.constructorOptions.colorramp??Le.builtin.RADAR,this.init({minZoom:r.metadata.minzoom,maxZoom:r.metadata.maxzoom,repaintOnPausedAnimation:!1},[new Ge({decode:{channel:r.metadata.weather_variable.decoding.channels.toLowerCase(),min:r.metadata.weather_variable.decoding.min,max:r.metadata.weather_variable.decoding.max},stops:this.colorRamp,smooth:this.constructorOptions.smooth??!0,opacity:this.constructorOptions.opacity??1})]),super.onAdd(e,t);const s=Ke.getSourcesAndTimestamps(r,i,o);for(const a of s)this.addSource(a.timestamp,a.source);const l=+new Date/1e3;l>=this.getAnimationStart()&&l<=this.getAnimationEnd()&&this.setAnimationTime(l),this.isSourceReady=!0,this.emit("sourceReady",{map:e,layer:this})}getIsSourceReady(){return this.isSourceReady}pickAt(e,t,i={}){const o=super.pick(e,t,i);return o?{value:o[0]}:null}getColorRamp(){return this.colorRamp}onSourceReadyAsync(){return new Promise((e=>{if(this.isSourceReady)return e();this.once("sourceReady",(()=>{e()}))}))}}const gi={maxAmount:128,color:[255,255,255,0],density:200,size:1,speed:.0015,refreshInterval:200,fadeFactor:.04,opacity:1,colorramp:Le.builtin.VIRIDIS,smooth:!0,fastColor:[255,255,255,255],fastSpeed:3,fastIsLarger:!0};class xi extends di{constructor(e={}){super(e.id||"MapTiler Wind",null,null,null),a(this,"constructorOptions"),a(this,"isSourceReady",!1),a(this,"colorRamp"),this.constructorOptions=e}async onAdd(e,t){const i=e.getSdkConfig().apiKey,o=e.getMaptilerSessionId();Ke.hasData()||await Ke.fetchLatest(i,o);const r=Ke.getWindData();if(!r)throw new Error("The latest weather data is not avaialble");this.colorRamp=this.constructorOptions.colorramp??gi.colorramp.scale(0,40),this.initParticle({minZoom:r.metadata.minzoom,maxZoom:r.metadata.maxzoom},{decodeChannels:r.metadata.weather_variable.decoding.channels.toLowerCase(),decodeMin:r.metadata.weather_variable.decoding.min,decodeMax:r.metadata.weather_variable.decoding.max,decodeAsWaves:!1,maxAmount:this.constructorOptions.maxAmount??gi.maxAmount,color:this.constructorOptions.color??gi.color,fastColor:this.constructorOptions.fastColor??gi.fastColor,fastSpeed:this.constructorOptions.fastSpeed??gi.fastSpeed,density:this.constructorOptions.density??gi.density,size:this.constructorOptions.size??gi.size,speed:this.constructorOptions.speed??gi.speed,refreshInterval:this.constructorOptions.refreshInterval??gi.refreshInterval,fadeFactor:this.constructorOptions.fadeFactor??gi.fadeFactor,angleDirectionShiftSkip:30,uniformSpeed:!0,fastIsLarger:this.constructorOptions.fastIsLarger??gi.fastIsLarger},[new Ge({decode:{channel:r.metadata.weather_variable.decoding.channels.toLowerCase(),min:r.metadata.weather_variable.decoding.min,max:r.metadata.weather_variable.decoding.max},stops:this.colorRamp,smooth:this.constructorOptions.smooth??gi.smooth,opacity:this.constructorOptions.opacity??gi.opacity})]),super.onAdd(e,t);const s=Ke.getSourcesAndTimestamps(r,i,o);for(const a of s)this.addSource(a.timestamp,a.source);const l=+new Date/1e3;l>=this.getAnimationStart()&&l<=this.getAnimationEnd()&&this.setAnimationTime(l),this.isSourceReady=!0,this.emit("sourceReady",{map:e,layer:this})}getIsSourceReady(){return this.isSourceReady}pickAt(e,t,i={}){const o=super.pick(e,t,i);if(!o)return null;const r=o[0],s=o[1],l=Math.sqrt(r**2+s**2),a=180*Math.atan2(r,s)/Math.PI;return{speedMetersPerSecond:l,speedKilometersPerHour:3.6*l,speedMilesPerHour:2.23694*l,speedFeetPerSecond:3.28084*l,speedKnots:1.94384*l,directionAngle:a,c
1ompassDirection:(n=a+180,["N","NNE","NE","ENE","E","ESE","SE","SSE","S","SSW","SW","WSW","W","WNW","NW","NNW"][Math.round((n+360)%360/22.5)%16])};var n}getColorRamp(){return this.colorRamp}onSourceReadyAsync(){return new Promise((e=>{if(this.isSourceReady)return e();this.once("sourceReady",(()=>{e()}))}))}}}}]); 2//# sourceMappingURL=cf07f4a1-7c23f37f457842216f36.js.map
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.