@holoviz/panel 1.9.4-rc.2 → 1.9.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/bundled/deckglplot/@deck.gl/carto@^9.1.14/dist.min.js +2 -2
- package/dist/bundled/notificationarea/panel/1.9.4/dist/bundled/font-awesome/css/all.min.css +2 -0
- package/dist/bundled/panel/1.9.4/dist/bundled/bootstrap5/css/bootstrap.min.css +2 -0
- package/dist/bundled/panel/1.9.4/dist/bundled/bootstrap5/js/bootstrap.bundle.min.js +2 -0
- package/dist/bundled/panel/1.9.4/dist/bundled/font-awesome/css/all.min.css +2 -0
- package/dist/bundled/panel/1.9.4/dist/bundled/jquery/jquery.min.js +2 -0
- package/dist/lib/models/react_component.d.ts +1 -1
- package/dist/lib/models/react_component.js +1 -1
- package/dist/lib/models/react_component.js.map +1 -1
- package/dist/lib/models/reactive_esm.d.ts +13 -0
- package/dist/lib/models/reactive_esm.js +17 -0
- package/dist/lib/models/reactive_esm.js.map +1 -1
- package/dist/panel.js +25 -8
- package/dist/panel.js.map +1 -1
- package/dist/panel.json +1 -1
- package/dist/panel.min.js +5 -5
- package/package.json +1 -1
- package/dist/bundled/notificationarea/panel/1.9.4-rc.2/dist/bundled/font-awesome/css/all.min.css +0 -2
- package/dist/bundled/panel/1.9.4-rc.2/dist/bundled/bootstrap5/css/bootstrap.min.css +0 -2
- package/dist/bundled/panel/1.9.4-rc.2/dist/bundled/bootstrap5/js/bootstrap.bundle.min.js +0 -2
- package/dist/bundled/panel/1.9.4-rc.2/dist/bundled/font-awesome/css/all.min.css +0 -2
- package/dist/bundled/panel/1.9.4-rc.2/dist/bundled/jquery/jquery.min.js +0 -2
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
else if (typeof define === 'function' && define.amd) define([], factory);
|
|
5
5
|
else if (typeof exports === 'object') exports['deck'] = factory();
|
|
6
6
|
else root['deck'] = factory();})(globalThis, function () {
|
|
7
|
-
"use strict";var __exports__=(()=>{var sg=Object.create;var Gi=Object.defineProperty;var fg=Object.getOwnPropertyDescriptor;var lg=Object.getOwnPropertyNames;var cg=Object.getPrototypeOf,ug=Object.prototype.hasOwnProperty;var X=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),Ga=(e,t)=>{for(var r in t)Gi(e,r,{get:t[r],enumerable:!0})},qi=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of lg(t))!ug.call(e,i)&&i!==r&&Gi(e,i,{get:()=>t[i],enumerable:!(n=fg(t,i))||n.enumerable});return e},Je=(e,t,r)=>(qi(e,t,"default"),r&&qi(r,t,"default")),G=(e,t,r)=>(r=e!=null?sg(cg(e)):{},qi(t||!e||!e.__esModule?Gi(r,"default",{value:e,enumerable:!0}):r,e)),dg=e=>qi(Gi({},"__esModule",{value:!0}),e);var kt=X((C_,gl)=>{gl.exports=globalThis.deck});var pt=X((A_,ml)=>{ml.exports=globalThis.deck});var pn=X((P_,bl)=>{bl.exports=globalThis.loaders});var Se=X((O_,wl)=>{wl.exports=globalThis.deck});var Kt=X((C3,Vl)=>{Vl.exports=globalThis.h3||{}});var mt=X(pe=>{"use strict";var lm=typeof Uint8Array<"u"&&typeof Uint16Array<"u"&&typeof Int32Array<"u";function cm(e,t){return Object.prototype.hasOwnProperty.call(e,t)}pe.assign=function(e){for(var t=Array.prototype.slice.call(arguments,1);t.length;){var r=t.shift();if(r){if(typeof r!="object")throw new TypeError(r+"must be non-object");for(var n in r)cm(r,n)&&(e[n]=r[n])}}return e};pe.shrinkBuf=function(e,t){return e.length===t?e:e.subarray?e.subarray(0,t):(e.length=t,e)};var um={arraySet:function(e,t,r,n,i){if(t.subarray&&e.subarray){e.set(t.subarray(r,r+n),i);return}for(var o=0;o<n;o++)e[i+o]=t[r+o]},flattenChunks:function(e){var t,r,n,i,o,a;for(n=0,t=0,r=e.length;t<r;t++)n+=e[t].length;for(a=new Uint8Array(n),i=0,t=0,r=e.length;t<r;t++)o=e[t],a.set(o,i),i+=o.length;return a}},dm={arraySet:function(e,t,r,n,i){for(var o=0;o<n;o++)e[i+o]=t[r+o]},flattenChunks:function(e){return[].concat.apply([],e)}};pe.setTyped=function(e){e?(pe.Buf8=Uint8Array,pe.Buf16=Uint16Array,pe.Buf32=Int32Array,pe.assign(pe,um)):(pe.Buf8=Array,pe.Buf16=Array,pe.Buf32=Array,pe.assign(pe,dm))};pe.setTyped(lm)});var Mc=X(Or=>{"use strict";var hm=mt(),pm=4,lc=0,cc=1,gm=2;function Ir(e){for(var t=e.length;--t>=0;)e[t]=0}var mm=0,mc=1,bm=2,ym=3,xm=258,is=29,Sn=256,vn=Sn+1+is,Lr=30,os=19,bc=2*vn+1,Xt=15,Qa=16,vm=7,as=256,yc=16,xc=17,vc=18,rs=[0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0],Qi=[0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13],wm=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7],wc=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],_m=512,bt=new Array((vn+2)*2);Ir(bt);var xn=new Array(Lr*2);Ir(xn);var wn=new Array(_m);Ir(wn);var _n=new Array(xm-ym+1);Ir(_n);var ss=new Array(is);Ir(ss);var Ji=new Array(Lr);Ir(Ji);function Ja(e,t,r,n,i){this.static_tree=e,this.extra_bits=t,this.extra_base=r,this.elems=n,this.max_length=i,this.has_stree=e&&e.length}var _c,Ec,Sc;function es(e,t){this.dyn_tree=e,this.max_code=0,this.stat_desc=t}function Tc(e){return e<256?wn[e]:wn[256+(e>>>7)]}function En(e,t){e.pending_buf[e.pending++]=t&255,e.pending_buf[e.pending++]=t>>>8&255}function be(e,t,r){e.bi_valid>Qa-r?(e.bi_buf|=t<<e.bi_valid&65535,En(e,e.bi_buf),e.bi_buf=t>>Qa-e.bi_valid,e.bi_valid+=r-Qa):(e.bi_buf|=t<<e.bi_valid&65535,e.bi_valid+=r)}function rt(e,t,r){be(e,r[t*2],r[t*2+1])}function Cc(e,t){var r=0;do r|=e&1,e>>>=1,r<<=1;while(--t>0);return r>>>1}function Em(e){e.bi_valid===16?(En(e,e.bi_buf),e.bi_buf=0,e.bi_valid=0):e.bi_valid>=8&&(e.pending_buf[e.pending++]=e.bi_buf&255,e.bi_buf>>=8,e.bi_valid-=8)}function Sm(e,t){var r=t.dyn_tree,n=t.max_code,i=t.stat_desc.static_tree,o=t.stat_desc.has_stree,a=t.stat_desc.extra_bits,s=t.stat_desc.extra_base,l=t.stat_desc.max_length,f,c,u,d,h,g,x=0;for(d=0;d<=Xt;d++)e.bl_count[d]=0;for(r[e.heap[e.heap_max]*2+1]=0,f=e.heap_max+1;f<bc;f++)c=e.heap[f],d=r[r[c*2+1]*2+1]+1,d>l&&(d=l,x++),r[c*2+1]=d,!(c>n)&&(e.bl_count[d]++,h=0,c>=s&&(h=a[c-s]),g=r[c*2],e.opt_len+=g*(d+h),o&&(e.static_len+=g*(i[c*2+1]+h)));if(x!==0){do{for(d=l-1;e.bl_count[d]===0;)d--;e.bl_count[d]--,e.bl_count[d+1]+=2,e.bl_count[l]--,x-=2}while(x>0);for(d=l;d!==0;d--)for(c=e.bl_count[d];c!==0;)u=e.heap[--f],!(u>n)&&(r[u*2+1]!==d&&(e.opt_len+=(d-r[u*2+1])*r[u*2],r[u*2+1]=d),c--)}}function Ac(e,t,r){var n=new Array(Xt+1),i=0,o,a;for(o=1;o<=Xt;o++)n[o]=i=i+r[o-1]<<1;for(a=0;a<=t;a++){var s=e[a*2+1];s!==0&&(e[a*2]=Cc(n[s]++,s))}}function Tm(){var e,t,r,n,i,o=new Array(Xt+1);for(r=0,n=0;n<is-1;n++)for(ss[n]=r,e=0;e<1<<rs[n];e++)_n[r++]=n;for(_n[r-1]=n,i=0,n=0;n<16;n++)for(Ji[n]=i,e=0;e<1<<Qi[n];e++)wn[i++]=n;for(i>>=7;n<Lr;n++)for(Ji[n]=i<<7,e=0;e<1<<Qi[n]-7;e++)wn[256+i++]=n;for(t=0;t<=Xt;t++)o[t]=0;for(e=0;e<=143;)bt[e*2+1]=8,e++,o[8]++;for(;e<=255;)bt[e*2+1]=9,e++,o[9]++;for(;e<=279;)bt[e*2+1]=7,e++,o[7]++;for(;e<=287;)bt[e*2+1]=8,e++,o[8]++;for(Ac(bt,vn+1,o),e=0;e<Lr;e++)xn[e*2+1]=5,xn[e*2]=Cc(e,5);_c=new Ja(bt,rs,Sn+1,vn,Xt),Ec=new Ja(xn,Qi,0,Lr,Xt),Sc=new Ja(new Array(0),wm,0,os,vm)}function Pc(e){var t;for(t=0;t<vn;t++)e.dyn_ltree[t*2]=0;for(t=0;t<Lr;t++)e.dyn_dtree[t*2]=0;for(t=0;t<os;t++)e.bl_tree[t*2]=0;e.dyn_ltree[as*2]=1,e.opt_len=e.static_len=0,e.last_lit=e.matches=0}function Fc(e){e.bi_valid>8?En(e,e.bi_buf):e.bi_valid>0&&(e.pending_buf[e.pending++]=e.bi_buf),e.bi_buf=0,e.bi_valid=0}function Cm(e,t,r,n){Fc(e),n&&(En(e,r),En(e,~r)),hm.arraySet(e.pending_buf,e.window,t,r,e.pending),e.pending+=r}function uc(e,t,r,n){var i=t*2,o=r*2;return e[i]<e[o]||e[i]===e[o]&&n[t]<=n[r]}function ts(e,t,r){for(var n=e.heap[r],i=r<<1;i<=e.heap_len&&(i<e.heap_len&&uc(t,e.heap[i+1],e.heap[i],e.depth)&&i++,!uc(t,n,e.heap[i],e.depth));)e.heap[r]=e.heap[i],r=i,i<<=1;e.heap[r]=n}function dc(e,t,r){var n,i,o=0,a,s;if(e.last_lit!==0)do n=e.pending_buf[e.d_buf+o*2]<<8|e.pending_buf[e.d_buf+o*2+1],i=e.pending_buf[e.l_buf+o],o++,n===0?rt(e,i,t):(a=_n[i],rt(e,a+Sn+1,t),s=rs[a],s!==0&&(i-=ss[a],be(e,i,s)),n--,a=Tc(n),rt(e,a,r),s=Qi[a],s!==0&&(n-=Ji[a],be(e,n,s)));while(o<e.last_lit);rt(e,as,t)}function ns(e,t){var r=t.dyn_tree,n=t.stat_desc.static_tree,i=t.stat_desc.has_stree,o=t.stat_desc.elems,a,s,l=-1,f;for(e.heap_len=0,e.heap_max=bc,a=0;a<o;a++)r[a*2]!==0?(e.heap[++e.heap_len]=l=a,e.depth[a]=0):r[a*2+1]=0;for(;e.heap_len<2;)f=e.heap[++e.heap_len]=l<2?++l:0,r[f*2]=1,e.depth[f]=0,e.opt_len--,i&&(e.static_len-=n[f*2+1]);for(t.max_code=l,a=e.heap_len>>1;a>=1;a--)ts(e,r,a);f=o;do a=e.heap[1],e.heap[1]=e.heap[e.heap_len--],ts(e,r,1),s=e.heap[1],e.heap[--e.heap_max]=a,e.heap[--e.heap_max]=s,r[f*2]=r[a*2]+r[s*2],e.depth[f]=(e.depth[a]>=e.depth[s]?e.depth[a]:e.depth[s])+1,r[a*2+1]=r[s*2+1]=f,e.heap[1]=f++,ts(e,r,1);while(e.heap_len>=2);e.heap[--e.heap_max]=e.heap[1],Sm(e,t),Ac(r,l,e.bl_count)}function hc(e,t,r){var n,i=-1,o,a=t[0*2+1],s=0,l=7,f=4;for(a===0&&(l=138,f=3),t[(r+1)*2+1]=65535,n=0;n<=r;n++)o=a,a=t[(n+1)*2+1],!(++s<l&&o===a)&&(s<f?e.bl_tree[o*2]+=s:o!==0?(o!==i&&e.bl_tree[o*2]++,e.bl_tree[yc*2]++):s<=10?e.bl_tree[xc*2]++:e.bl_tree[vc*2]++,s=0,i=o,a===0?(l=138,f=3):o===a?(l=6,f=3):(l=7,f=4))}function pc(e,t,r){var n,i=-1,o,a=t[0*2+1],s=0,l=7,f=4;for(a===0&&(l=138,f=3),n=0;n<=r;n++)if(o=a,a=t[(n+1)*2+1],!(++s<l&&o===a)){if(s<f)do rt(e,o,e.bl_tree);while(--s!==0);else o!==0?(o!==i&&(rt(e,o,e.bl_tree),s--),rt(e,yc,e.bl_tree),be(e,s-3,2)):s<=10?(rt(e,xc,e.bl_tree),be(e,s-3,3)):(rt(e,vc,e.bl_tree),be(e,s-11,7));s=0,i=o,a===0?(l=138,f=3):o===a?(l=6,f=3):(l=7,f=4)}}function Am(e){var t;for(hc(e,e.dyn_ltree,e.l_desc.max_code),hc(e,e.dyn_dtree,e.d_desc.max_code),ns(e,e.bl_desc),t=os-1;t>=3&&e.bl_tree[wc[t]*2+1]===0;t--);return e.opt_len+=3*(t+1)+5+5+4,t}function Pm(e,t,r,n){var i;for(be(e,t-257,5),be(e,r-1,5),be(e,n-4,4),i=0;i<n;i++)be(e,e.bl_tree[wc[i]*2+1],3);pc(e,e.dyn_ltree,t-1),pc(e,e.dyn_dtree,r-1)}function Fm(e){var t=4093624447,r;for(r=0;r<=31;r++,t>>>=1)if(t&1&&e.dyn_ltree[r*2]!==0)return lc;if(e.dyn_ltree[9*2]!==0||e.dyn_ltree[10*2]!==0||e.dyn_ltree[13*2]!==0)return cc;for(r=32;r<Sn;r++)if(e.dyn_ltree[r*2]!==0)return cc;return lc}var gc=!1;function km(e){gc||(Tm(),gc=!0),e.l_desc=new es(e.dyn_ltree,_c),e.d_desc=new es(e.dyn_dtree,Ec),e.bl_desc=new es(e.bl_tree,Sc),e.bi_buf=0,e.bi_valid=0,Pc(e)}function kc(e,t,r,n){be(e,(mm<<1)+(n?1:0),3),Cm(e,t,r,!0)}function Mm(e){be(e,mc<<1,3),rt(e,as,bt),Em(e)}function Lm(e,t,r,n){var i,o,a=0;e.level>0?(e.strm.data_type===gm&&(e.strm.data_type=Fm(e)),ns(e,e.l_desc),ns(e,e.d_desc),a=Am(e),i=e.opt_len+3+7>>>3,o=e.static_len+3+7>>>3,o<=i&&(i=o)):i=o=r+5,r+4<=i&&t!==-1?kc(e,t,r,n):e.strategy===pm||o===i?(be(e,(mc<<1)+(n?1:0),3),dc(e,bt,xn)):(be(e,(bm<<1)+(n?1:0),3),Pm(e,e.l_desc.max_code+1,e.d_desc.max_code+1,a+1),dc(e,e.dyn_ltree,e.dyn_dtree)),Pc(e),n&&Fc(e)}function Im(e,t,r){return e.pending_buf[e.d_buf+e.last_lit*2]=t>>>8&255,e.pending_buf[e.d_buf+e.last_lit*2+1]=t&255,e.pending_buf[e.l_buf+e.last_lit]=r&255,e.last_lit++,t===0?e.dyn_ltree[r*2]++:(e.matches++,t--,e.dyn_ltree[(_n[r]+Sn+1)*2]++,e.dyn_dtree[Tc(t)*2]++),e.last_lit===e.lit_bufsize-1}Or._tr_init=km;Or._tr_stored_block=kc;Or._tr_flush_block=Lm;Or._tr_tally=Im;Or._tr_align=Mm});var fs=X((l5,Lc)=>{"use strict";function Om(e,t,r,n){for(var i=e&65535|0,o=e>>>16&65535|0,a=0;r!==0;){a=r>2e3?2e3:r,r-=a;do i=i+t[n++]|0,o=o+i|0;while(--a);i%=65521,o%=65521}return i|o<<16|0}Lc.exports=Om});var ls=X((c5,Ic)=>{"use strict";function Bm(){for(var e,t=[],r=0;r<256;r++){e=r;for(var n=0;n<8;n++)e=e&1?3988292384^e>>>1:e>>>1;t[r]=e}return t}var Rm=Bm();function Dm(e,t,r,n){var i=Rm,o=n+r;e^=-1;for(var a=n;a<o;a++)e=e>>>8^i[(e^t[a])&255];return e^-1}Ic.exports=Dm});var eo=X((u5,Oc)=>{"use strict";Oc.exports={2:"need dictionary",1:"stream end",0:"","-1":"file error","-2":"stream error","-3":"data error","-4":"insufficient memory","-5":"buffer error","-6":"incompatible version"}});var Vc=X(ot=>{"use strict";var ge=mt(),Me=Mc(),Nc=fs(),Ot=ls(),Nm=eo(),tr=0,zm=1,Um=3,zt=4,Bc=5,it=0,Rc=1,Le=-2,qm=-3,cs=-5,Gm=-1,Vm=1,to=2,$m=3,Hm=4,Zm=0,jm=2,oo=8,Wm=9,Ym=15,Km=8,Xm=29,Qm=256,ds=Qm+1+Xm,Jm=30,e1=19,t1=2*ds+1,r1=15,$=3,Dt=258,qe=Dt+$+1,n1=32,ao=42,hs=69,ro=73,no=91,io=103,Qt=113,Cn=666,se=1,An=2,Jt=3,Dr=4,i1=3;function Nt(e,t){return e.msg=Nm[t],t}function Dc(e){return(e<<1)-(e>4?9:0)}function Rt(e){for(var t=e.length;--t>=0;)e[t]=0}function Bt(e){var t=e.state,r=t.pending;r>e.avail_out&&(r=e.avail_out),r!==0&&(ge.arraySet(e.output,t.pending_buf,t.pending_out,r,e.next_out),e.next_out+=r,t.pending_out+=r,e.total_out+=r,e.avail_out-=r,t.pending-=r,t.pending===0&&(t.pending_out=0))}function le(e,t){Me._tr_flush_block(e,e.block_start>=0?e.block_start:-1,e.strstart-e.block_start,t),e.block_start=e.strstart,Bt(e.strm)}function j(e,t){e.pending_buf[e.pending++]=t}function Tn(e,t){e.pending_buf[e.pending++]=t>>>8&255,e.pending_buf[e.pending++]=t&255}function o1(e,t,r,n){var i=e.avail_in;return i>n&&(i=n),i===0?0:(e.avail_in-=i,ge.arraySet(t,e.input,e.next_in,i,r),e.state.wrap===1?e.adler=Nc(e.adler,t,i,r):e.state.wrap===2&&(e.adler=Ot(e.adler,t,i,r)),e.next_in+=i,e.total_in+=i,i)}function zc(e,t){var r=e.max_chain_length,n=e.strstart,i,o,a=e.prev_length,s=e.nice_match,l=e.strstart>e.w_size-qe?e.strstart-(e.w_size-qe):0,f=e.window,c=e.w_mask,u=e.prev,d=e.strstart+Dt,h=f[n+a-1],g=f[n+a];e.prev_length>=e.good_match&&(r>>=2),s>e.lookahead&&(s=e.lookahead);do if(i=t,!(f[i+a]!==g||f[i+a-1]!==h||f[i]!==f[n]||f[++i]!==f[n+1])){n+=2,i++;do;while(f[++n]===f[++i]&&f[++n]===f[++i]&&f[++n]===f[++i]&&f[++n]===f[++i]&&f[++n]===f[++i]&&f[++n]===f[++i]&&f[++n]===f[++i]&&f[++n]===f[++i]&&n<d);if(o=Dt-(d-n),n=d-Dt,o>a){if(e.match_start=t,a=o,o>=s)break;h=f[n+a-1],g=f[n+a]}}while((t=u[t&c])>l&&--r!==0);return a<=e.lookahead?a:e.lookahead}function er(e){var t=e.w_size,r,n,i,o,a;do{if(o=e.window_size-e.lookahead-e.strstart,e.strstart>=t+(t-qe)){ge.arraySet(e.window,e.window,t,t,0),e.match_start-=t,e.strstart-=t,e.block_start-=t,n=e.hash_size,r=n;do i=e.head[--r],e.head[r]=i>=t?i-t:0;while(--n);n=t,r=n;do i=e.prev[--r],e.prev[r]=i>=t?i-t:0;while(--n);o+=t}if(e.strm.avail_in===0)break;if(n=o1(e.strm,e.window,e.strstart+e.lookahead,o),e.lookahead+=n,e.lookahead+e.insert>=$)for(a=e.strstart-e.insert,e.ins_h=e.window[a],e.ins_h=(e.ins_h<<e.hash_shift^e.window[a+1])&e.hash_mask;e.insert&&(e.ins_h=(e.ins_h<<e.hash_shift^e.window[a+$-1])&e.hash_mask,e.prev[a&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=a,a++,e.insert--,!(e.lookahead+e.insert<$)););}while(e.lookahead<qe&&e.strm.avail_in!==0)}function a1(e,t){var r=65535;for(r>e.pending_buf_size-5&&(r=e.pending_buf_size-5);;){if(e.lookahead<=1){if(er(e),e.lookahead===0&&t===tr)return se;if(e.lookahead===0)break}e.strstart+=e.lookahead,e.lookahead=0;var n=e.block_start+r;if((e.strstart===0||e.strstart>=n)&&(e.lookahead=e.strstart-n,e.strstart=n,le(e,!1),e.strm.avail_out===0)||e.strstart-e.block_start>=e.w_size-qe&&(le(e,!1),e.strm.avail_out===0))return se}return e.insert=0,t===zt?(le(e,!0),e.strm.avail_out===0?Jt:Dr):(e.strstart>e.block_start&&(le(e,!1),e.strm.avail_out===0),se)}function us(e,t){for(var r,n;;){if(e.lookahead<qe){if(er(e),e.lookahead<qe&&t===tr)return se;if(e.lookahead===0)break}if(r=0,e.lookahead>=$&&(e.ins_h=(e.ins_h<<e.hash_shift^e.window[e.strstart+$-1])&e.hash_mask,r=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart),r!==0&&e.strstart-r<=e.w_size-qe&&(e.match_length=zc(e,r)),e.match_length>=$)if(n=Me._tr_tally(e,e.strstart-e.match_start,e.match_length-$),e.lookahead-=e.match_length,e.match_length<=e.max_lazy_match&&e.lookahead>=$){e.match_length--;do e.strstart++,e.ins_h=(e.ins_h<<e.hash_shift^e.window[e.strstart+$-1])&e.hash_mask,r=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart;while(--e.match_length!==0);e.strstart++}else e.strstart+=e.match_length,e.match_length=0,e.ins_h=e.window[e.strstart],e.ins_h=(e.ins_h<<e.hash_shift^e.window[e.strstart+1])&e.hash_mask;else n=Me._tr_tally(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++;if(n&&(le(e,!1),e.strm.avail_out===0))return se}return e.insert=e.strstart<$-1?e.strstart:$-1,t===zt?(le(e,!0),e.strm.avail_out===0?Jt:Dr):e.last_lit&&(le(e,!1),e.strm.avail_out===0)?se:An}function Br(e,t){for(var r,n,i;;){if(e.lookahead<qe){if(er(e),e.lookahead<qe&&t===tr)return se;if(e.lookahead===0)break}if(r=0,e.lookahead>=$&&(e.ins_h=(e.ins_h<<e.hash_shift^e.window[e.strstart+$-1])&e.hash_mask,r=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart),e.prev_length=e.match_length,e.prev_match=e.match_start,e.match_length=$-1,r!==0&&e.prev_length<e.max_lazy_match&&e.strstart-r<=e.w_size-qe&&(e.match_length=zc(e,r),e.match_length<=5&&(e.strategy===Vm||e.match_length===$&&e.strstart-e.match_start>4096)&&(e.match_length=$-1)),e.prev_length>=$&&e.match_length<=e.prev_length){i=e.strstart+e.lookahead-$,n=Me._tr_tally(e,e.strstart-1-e.prev_match,e.prev_length-$),e.lookahead-=e.prev_length-1,e.prev_length-=2;do++e.strstart<=i&&(e.ins_h=(e.ins_h<<e.hash_shift^e.window[e.strstart+$-1])&e.hash_mask,r=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart);while(--e.prev_length!==0);if(e.match_available=0,e.match_length=$-1,e.strstart++,n&&(le(e,!1),e.strm.avail_out===0))return se}else if(e.match_available){if(n=Me._tr_tally(e,0,e.window[e.strstart-1]),n&&le(e,!1),e.strstart++,e.lookahead--,e.strm.avail_out===0)return se}else e.match_available=1,e.strstart++,e.lookahead--}return e.match_available&&(n=Me._tr_tally(e,0,e.window[e.strstart-1]),e.match_available=0),e.insert=e.strstart<$-1?e.strstart:$-1,t===zt?(le(e,!0),e.strm.avail_out===0?Jt:Dr):e.last_lit&&(le(e,!1),e.strm.avail_out===0)?se:An}function s1(e,t){for(var r,n,i,o,a=e.window;;){if(e.lookahead<=Dt){if(er(e),e.lookahead<=Dt&&t===tr)return se;if(e.lookahead===0)break}if(e.match_length=0,e.lookahead>=$&&e.strstart>0&&(i=e.strstart-1,n=a[i],n===a[++i]&&n===a[++i]&&n===a[++i])){o=e.strstart+Dt;do;while(n===a[++i]&&n===a[++i]&&n===a[++i]&&n===a[++i]&&n===a[++i]&&n===a[++i]&&n===a[++i]&&n===a[++i]&&i<o);e.match_length=Dt-(o-i),e.match_length>e.lookahead&&(e.match_length=e.lookahead)}if(e.match_length>=$?(r=Me._tr_tally(e,1,e.match_length-$),e.lookahead-=e.match_length,e.strstart+=e.match_length,e.match_length=0):(r=Me._tr_tally(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++),r&&(le(e,!1),e.strm.avail_out===0))return se}return e.insert=0,t===zt?(le(e,!0),e.strm.avail_out===0?Jt:Dr):e.last_lit&&(le(e,!1),e.strm.avail_out===0)?se:An}function f1(e,t){for(var r;;){if(e.lookahead===0&&(er(e),e.lookahead===0)){if(t===tr)return se;break}if(e.match_length=0,r=Me._tr_tally(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++,r&&(le(e,!1),e.strm.avail_out===0))return se}return e.insert=0,t===zt?(le(e,!0),e.strm.avail_out===0?Jt:Dr):e.last_lit&&(le(e,!1),e.strm.avail_out===0)?se:An}function nt(e,t,r,n,i){this.good_length=e,this.max_lazy=t,this.nice_length=r,this.max_chain=n,this.func=i}var Rr;Rr=[new nt(0,0,0,0,a1),new nt(4,4,8,4,us),new nt(4,5,16,8,us),new nt(4,6,32,32,us),new nt(4,4,16,16,Br),new nt(8,16,32,32,Br),new nt(8,16,128,128,Br),new nt(8,32,128,256,Br),new nt(32,128,258,1024,Br),new nt(32,258,258,4096,Br)];function l1(e){e.window_size=2*e.w_size,Rt(e.head),e.max_lazy_match=Rr[e.level].max_lazy,e.good_match=Rr[e.level].good_length,e.nice_match=Rr[e.level].nice_length,e.max_chain_length=Rr[e.level].max_chain,e.strstart=0,e.block_start=0,e.lookahead=0,e.insert=0,e.match_length=e.prev_length=$-1,e.match_available=0,e.ins_h=0}function c1(){this.strm=null,this.status=0,this.pending_buf=null,this.pending_buf_size=0,this.pending_out=0,this.pending=0,this.wrap=0,this.gzhead=null,this.gzindex=0,this.method=oo,this.last_flush=-1,this.w_size=0,this.w_bits=0,this.w_mask=0,this.window=null,this.window_size=0,this.prev=null,this.head=null,this.ins_h=0,this.hash_size=0,this.hash_bits=0,this.hash_mask=0,this.hash_shift=0,this.block_start=0,this.match_length=0,this.prev_match=0,this.match_available=0,this.strstart=0,this.match_start=0,this.lookahead=0,this.prev_length=0,this.max_chain_length=0,this.max_lazy_match=0,this.level=0,this.strategy=0,this.good_match=0,this.nice_match=0,this.dyn_ltree=new ge.Buf16(t1*2),this.dyn_dtree=new ge.Buf16((2*Jm+1)*2),this.bl_tree=new ge.Buf16((2*e1+1)*2),Rt(this.dyn_ltree),Rt(this.dyn_dtree),Rt(this.bl_tree),this.l_desc=null,this.d_desc=null,this.bl_desc=null,this.bl_count=new ge.Buf16(r1+1),this.heap=new ge.Buf16(2*ds+1),Rt(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new ge.Buf16(2*ds+1),Rt(this.depth),this.l_buf=0,this.lit_bufsize=0,this.last_lit=0,this.d_buf=0,this.opt_len=0,this.static_len=0,this.matches=0,this.insert=0,this.bi_buf=0,this.bi_valid=0}function Uc(e){var t;return!e||!e.state?Nt(e,Le):(e.total_in=e.total_out=0,e.data_type=jm,t=e.state,t.pending=0,t.pending_out=0,t.wrap<0&&(t.wrap=-t.wrap),t.status=t.wrap?ao:Qt,e.adler=t.wrap===2?0:1,t.last_flush=tr,Me._tr_init(t),it)}function qc(e){var t=Uc(e);return t===it&&l1(e.state),t}function u1(e,t){return!e||!e.state||e.state.wrap!==2?Le:(e.state.gzhead=t,it)}function Gc(e,t,r,n,i,o){if(!e)return Le;var a=1;if(t===Gm&&(t=6),n<0?(a=0,n=-n):n>15&&(a=2,n-=16),i<1||i>Wm||r!==oo||n<8||n>15||t<0||t>9||o<0||o>Hm)return Nt(e,Le);n===8&&(n=9);var s=new c1;return e.state=s,s.strm=e,s.wrap=a,s.gzhead=null,s.w_bits=n,s.w_size=1<<s.w_bits,s.w_mask=s.w_size-1,s.hash_bits=i+7,s.hash_size=1<<s.hash_bits,s.hash_mask=s.hash_size-1,s.hash_shift=~~((s.hash_bits+$-1)/$),s.window=new ge.Buf8(s.w_size*2),s.head=new ge.Buf16(s.hash_size),s.prev=new ge.Buf16(s.w_size),s.lit_bufsize=1<<i+6,s.pending_buf_size=s.lit_bufsize*4,s.pending_buf=new ge.Buf8(s.pending_buf_size),s.d_buf=1*s.lit_bufsize,s.l_buf=(1+2)*s.lit_bufsize,s.level=t,s.strategy=o,s.method=r,qc(e)}function d1(e,t){return Gc(e,t,oo,Ym,Km,Zm)}function h1(e,t){var r,n,i,o;if(!e||!e.state||t>Bc||t<0)return e?Nt(e,Le):Le;if(n=e.state,!e.output||!e.input&&e.avail_in!==0||n.status===Cn&&t!==zt)return Nt(e,e.avail_out===0?cs:Le);if(n.strm=e,r=n.last_flush,n.last_flush=t,n.status===ao)if(n.wrap===2)e.adler=0,j(n,31),j(n,139),j(n,8),n.gzhead?(j(n,(n.gzhead.text?1:0)+(n.gzhead.hcrc?2:0)+(n.gzhead.extra?4:0)+(n.gzhead.name?8:0)+(n.gzhead.comment?16:0)),j(n,n.gzhead.time&255),j(n,n.gzhead.time>>8&255),j(n,n.gzhead.time>>16&255),j(n,n.gzhead.time>>24&255),j(n,n.level===9?2:n.strategy>=to||n.level<2?4:0),j(n,n.gzhead.os&255),n.gzhead.extra&&n.gzhead.extra.length&&(j(n,n.gzhead.extra.length&255),j(n,n.gzhead.extra.length>>8&255)),n.gzhead.hcrc&&(e.adler=Ot(e.adler,n.pending_buf,n.pending,0)),n.gzindex=0,n.status=hs):(j(n,0),j(n,0),j(n,0),j(n,0),j(n,0),j(n,n.level===9?2:n.strategy>=to||n.level<2?4:0),j(n,i1),n.status=Qt);else{var a=oo+(n.w_bits-8<<4)<<8,s=-1;n.strategy>=to||n.level<2?s=0:n.level<6?s=1:n.level===6?s=2:s=3,a|=s<<6,n.strstart!==0&&(a|=n1),a+=31-a%31,n.status=Qt,Tn(n,a),n.strstart!==0&&(Tn(n,e.adler>>>16),Tn(n,e.adler&65535)),e.adler=1}if(n.status===hs)if(n.gzhead.extra){for(i=n.pending;n.gzindex<(n.gzhead.extra.length&65535)&&!(n.pending===n.pending_buf_size&&(n.gzhead.hcrc&&n.pending>i&&(e.adler=Ot(e.adler,n.pending_buf,n.pending-i,i)),Bt(e),i=n.pending,n.pending===n.pending_buf_size));)j(n,n.gzhead.extra[n.gzindex]&255),n.gzindex++;n.gzhead.hcrc&&n.pending>i&&(e.adler=Ot(e.adler,n.pending_buf,n.pending-i,i)),n.gzindex===n.gzhead.extra.length&&(n.gzindex=0,n.status=ro)}else n.status=ro;if(n.status===ro)if(n.gzhead.name){i=n.pending;do{if(n.pending===n.pending_buf_size&&(n.gzhead.hcrc&&n.pending>i&&(e.adler=Ot(e.adler,n.pending_buf,n.pending-i,i)),Bt(e),i=n.pending,n.pending===n.pending_buf_size)){o=1;break}n.gzindex<n.gzhead.name.length?o=n.gzhead.name.charCodeAt(n.gzindex++)&255:o=0,j(n,o)}while(o!==0);n.gzhead.hcrc&&n.pending>i&&(e.adler=Ot(e.adler,n.pending_buf,n.pending-i,i)),o===0&&(n.gzindex=0,n.status=no)}else n.status=no;if(n.status===no)if(n.gzhead.comment){i=n.pending;do{if(n.pending===n.pending_buf_size&&(n.gzhead.hcrc&&n.pending>i&&(e.adler=Ot(e.adler,n.pending_buf,n.pending-i,i)),Bt(e),i=n.pending,n.pending===n.pending_buf_size)){o=1;break}n.gzindex<n.gzhead.comment.length?o=n.gzhead.comment.charCodeAt(n.gzindex++)&255:o=0,j(n,o)}while(o!==0);n.gzhead.hcrc&&n.pending>i&&(e.adler=Ot(e.adler,n.pending_buf,n.pending-i,i)),o===0&&(n.status=io)}else n.status=io;if(n.status===io&&(n.gzhead.hcrc?(n.pending+2>n.pending_buf_size&&Bt(e),n.pending+2<=n.pending_buf_size&&(j(n,e.adler&255),j(n,e.adler>>8&255),e.adler=0,n.status=Qt)):n.status=Qt),n.pending!==0){if(Bt(e),e.avail_out===0)return n.last_flush=-1,it}else if(e.avail_in===0&&Dc(t)<=Dc(r)&&t!==zt)return Nt(e,cs);if(n.status===Cn&&e.avail_in!==0)return Nt(e,cs);if(e.avail_in!==0||n.lookahead!==0||t!==tr&&n.status!==Cn){var l=n.strategy===to?f1(n,t):n.strategy===$m?s1(n,t):Rr[n.level].func(n,t);if((l===Jt||l===Dr)&&(n.status=Cn),l===se||l===Jt)return e.avail_out===0&&(n.last_flush=-1),it;if(l===An&&(t===zm?Me._tr_align(n):t!==Bc&&(Me._tr_stored_block(n,0,0,!1),t===Um&&(Rt(n.head),n.lookahead===0&&(n.strstart=0,n.block_start=0,n.insert=0))),Bt(e),e.avail_out===0))return n.last_flush=-1,it}return t!==zt?it:n.wrap<=0?Rc:(n.wrap===2?(j(n,e.adler&255),j(n,e.adler>>8&255),j(n,e.adler>>16&255),j(n,e.adler>>24&255),j(n,e.total_in&255),j(n,e.total_in>>8&255),j(n,e.total_in>>16&255),j(n,e.total_in>>24&255)):(Tn(n,e.adler>>>16),Tn(n,e.adler&65535)),Bt(e),n.wrap>0&&(n.wrap=-n.wrap),n.pending!==0?it:Rc)}function p1(e){var t;return!e||!e.state?Le:(t=e.state.status,t!==ao&&t!==hs&&t!==ro&&t!==no&&t!==io&&t!==Qt&&t!==Cn?Nt(e,Le):(e.state=null,t===Qt?Nt(e,qm):it))}function g1(e,t){var r=t.length,n,i,o,a,s,l,f,c;if(!e||!e.state||(n=e.state,a=n.wrap,a===2||a===1&&n.status!==ao||n.lookahead))return Le;for(a===1&&(e.adler=Nc(e.adler,t,r,0)),n.wrap=0,r>=n.w_size&&(a===0&&(Rt(n.head),n.strstart=0,n.block_start=0,n.insert=0),c=new ge.Buf8(n.w_size),ge.arraySet(c,t,r-n.w_size,n.w_size,0),t=c,r=n.w_size),s=e.avail_in,l=e.next_in,f=e.input,e.avail_in=r,e.next_in=0,e.input=t,er(n);n.lookahead>=$;){i=n.strstart,o=n.lookahead-($-1);do n.ins_h=(n.ins_h<<n.hash_shift^n.window[i+$-1])&n.hash_mask,n.prev[i&n.w_mask]=n.head[n.ins_h],n.head[n.ins_h]=i,i++;while(--o);n.strstart=i,n.lookahead=$-1,er(n)}return n.strstart+=n.lookahead,n.block_start=n.strstart,n.insert=n.lookahead,n.lookahead=0,n.match_length=n.prev_length=$-1,n.match_available=0,e.next_in=l,e.input=f,e.avail_in=s,n.wrap=a,it}ot.deflateInit=d1;ot.deflateInit2=Gc;ot.deflateReset=qc;ot.deflateResetKeep=Uc;ot.deflateSetHeader=u1;ot.deflate=h1;ot.deflateEnd=p1;ot.deflateSetDictionary=g1;ot.deflateInfo="pako deflate (from Nodeca project)"});var ps=X(Nr=>{"use strict";var so=mt(),$c=!0,Hc=!0;try{String.fromCharCode.apply(null,[0])}catch{$c=!1}try{String.fromCharCode.apply(null,new Uint8Array(1))}catch{Hc=!1}var Pn=new so.Buf8(256);for(yt=0;yt<256;yt++)Pn[yt]=yt>=252?6:yt>=248?5:yt>=240?4:yt>=224?3:yt>=192?2:1;var yt;Pn[254]=Pn[254]=1;Nr.string2buf=function(e){var t,r,n,i,o,a=e.length,s=0;for(i=0;i<a;i++)r=e.charCodeAt(i),(r&64512)===55296&&i+1<a&&(n=e.charCodeAt(i+1),(n&64512)===56320&&(r=65536+(r-55296<<10)+(n-56320),i++)),s+=r<128?1:r<2048?2:r<65536?3:4;for(t=new so.Buf8(s),o=0,i=0;o<s;i++)r=e.charCodeAt(i),(r&64512)===55296&&i+1<a&&(n=e.charCodeAt(i+1),(n&64512)===56320&&(r=65536+(r-55296<<10)+(n-56320),i++)),r<128?t[o++]=r:r<2048?(t[o++]=192|r>>>6,t[o++]=128|r&63):r<65536?(t[o++]=224|r>>>12,t[o++]=128|r>>>6&63,t[o++]=128|r&63):(t[o++]=240|r>>>18,t[o++]=128|r>>>12&63,t[o++]=128|r>>>6&63,t[o++]=128|r&63);return t};function Zc(e,t){if(t<65534&&(e.subarray&&Hc||!e.subarray&&$c))return String.fromCharCode.apply(null,so.shrinkBuf(e,t));for(var r="",n=0;n<t;n++)r+=String.fromCharCode(e[n]);return r}Nr.buf2binstring=function(e){return Zc(e,e.length)};Nr.binstring2buf=function(e){for(var t=new so.Buf8(e.length),r=0,n=t.length;r<n;r++)t[r]=e.charCodeAt(r);return t};Nr.buf2string=function(e,t){var r,n,i,o,a=t||e.length,s=new Array(a*2);for(n=0,r=0;r<a;){if(i=e[r++],i<128){s[n++]=i;continue}if(o=Pn[i],o>4){s[n++]=65533,r+=o-1;continue}for(i&=o===2?31:o===3?15:7;o>1&&r<a;)i=i<<6|e[r++]&63,o--;if(o>1){s[n++]=65533;continue}i<65536?s[n++]=i:(i-=65536,s[n++]=55296|i>>10&1023,s[n++]=56320|i&1023)}return Zc(s,n)};Nr.utf8border=function(e,t){var r;for(t=t||e.length,t>e.length&&(t=e.length),r=t-1;r>=0&&(e[r]&192)===128;)r--;return r<0||r===0?t:r+Pn[e[r]]>t?r:t}});var gs=X((p5,jc)=>{"use strict";function m1(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0}jc.exports=m1});var Xc=X(Mn=>{"use strict";var Fn=Vc(),kn=mt(),bs=ps(),ys=eo(),b1=gs(),Kc=Object.prototype.toString,y1=0,ms=4,zr=0,Wc=1,Yc=2,x1=-1,v1=0,w1=8;function rr(e){if(!(this instanceof rr))return new rr(e);this.options=kn.assign({level:x1,method:w1,chunkSize:16384,windowBits:15,memLevel:8,strategy:v1,to:""},e||{});var t=this.options;t.raw&&t.windowBits>0?t.windowBits=-t.windowBits:t.gzip&&t.windowBits>0&&t.windowBits<16&&(t.windowBits+=16),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new b1,this.strm.avail_out=0;var r=Fn.deflateInit2(this.strm,t.level,t.method,t.windowBits,t.memLevel,t.strategy);if(r!==zr)throw new Error(ys[r]);if(t.header&&Fn.deflateSetHeader(this.strm,t.header),t.dictionary){var n;if(typeof t.dictionary=="string"?n=bs.string2buf(t.dictionary):Kc.call(t.dictionary)==="[object ArrayBuffer]"?n=new Uint8Array(t.dictionary):n=t.dictionary,r=Fn.deflateSetDictionary(this.strm,n),r!==zr)throw new Error(ys[r]);this._dict_set=!0}}rr.prototype.push=function(e,t){var r=this.strm,n=this.options.chunkSize,i,o;if(this.ended)return!1;o=t===~~t?t:t===!0?ms:y1,typeof e=="string"?r.input=bs.string2buf(e):Kc.call(e)==="[object ArrayBuffer]"?r.input=new Uint8Array(e):r.input=e,r.next_in=0,r.avail_in=r.input.length;do{if(r.avail_out===0&&(r.output=new kn.Buf8(n),r.next_out=0,r.avail_out=n),i=Fn.deflate(r,o),i!==Wc&&i!==zr)return this.onEnd(i),this.ended=!0,!1;(r.avail_out===0||r.avail_in===0&&(o===ms||o===Yc))&&(this.options.to==="string"?this.onData(bs.buf2binstring(kn.shrinkBuf(r.output,r.next_out))):this.onData(kn.shrinkBuf(r.output,r.next_out)))}while((r.avail_in>0||r.avail_out===0)&&i!==Wc);return o===ms?(i=Fn.deflateEnd(this.strm),this.onEnd(i),this.ended=!0,i===zr):(o===Yc&&(this.onEnd(zr),r.avail_out=0),!0)};rr.prototype.onData=function(e){this.chunks.push(e)};rr.prototype.onEnd=function(e){e===zr&&(this.options.to==="string"?this.result=this.chunks.join(""):this.result=kn.flattenChunks(this.chunks)),this.chunks=[],this.err=e,this.msg=this.strm.msg};function xs(e,t){var r=new rr(t);if(r.push(e,!0),r.err)throw r.msg||ys[r.err];return r.result}function _1(e,t){return t=t||{},t.raw=!0,xs(e,t)}function E1(e,t){return t=t||{},t.gzip=!0,xs(e,t)}Mn.Deflate=rr;Mn.deflate=xs;Mn.deflateRaw=_1;Mn.gzip=E1});var Jc=X((m5,Qc)=>{"use strict";var fo=30,S1=12;Qc.exports=function(t,r){var n,i,o,a,s,l,f,c,u,d,h,g,x,S,T,w,k,I,L,R,N,p,m,b,y;n=t.state,i=t.next_in,b=t.input,o=i+(t.avail_in-5),a=t.next_out,y=t.output,s=a-(r-t.avail_out),l=a+(t.avail_out-257),f=n.dmax,c=n.wsize,u=n.whave,d=n.wnext,h=n.window,g=n.hold,x=n.bits,S=n.lencode,T=n.distcode,w=(1<<n.lenbits)-1,k=(1<<n.distbits)-1;e:do{x<15&&(g+=b[i++]<<x,x+=8,g+=b[i++]<<x,x+=8),I=S[g&w];t:for(;;){if(L=I>>>24,g>>>=L,x-=L,L=I>>>16&255,L===0)y[a++]=I&65535;else if(L&16){R=I&65535,L&=15,L&&(x<L&&(g+=b[i++]<<x,x+=8),R+=g&(1<<L)-1,g>>>=L,x-=L),x<15&&(g+=b[i++]<<x,x+=8,g+=b[i++]<<x,x+=8),I=T[g&k];r:for(;;){if(L=I>>>24,g>>>=L,x-=L,L=I>>>16&255,L&16){if(N=I&65535,L&=15,x<L&&(g+=b[i++]<<x,x+=8,x<L&&(g+=b[i++]<<x,x+=8)),N+=g&(1<<L)-1,N>f){t.msg="invalid distance too far back",n.mode=fo;break e}if(g>>>=L,x-=L,L=a-s,N>L){if(L=N-L,L>u&&n.sane){t.msg="invalid distance too far back",n.mode=fo;break e}if(p=0,m=h,d===0){if(p+=c-L,L<R){R-=L;do y[a++]=h[p++];while(--L);p=a-N,m=y}}else if(d<L){if(p+=c+d-L,L-=d,L<R){R-=L;do y[a++]=h[p++];while(--L);if(p=0,d<R){L=d,R-=L;do y[a++]=h[p++];while(--L);p=a-N,m=y}}}else if(p+=d-L,L<R){R-=L;do y[a++]=h[p++];while(--L);p=a-N,m=y}for(;R>2;)y[a++]=m[p++],y[a++]=m[p++],y[a++]=m[p++],R-=3;R&&(y[a++]=m[p++],R>1&&(y[a++]=m[p++]))}else{p=a-N;do y[a++]=y[p++],y[a++]=y[p++],y[a++]=y[p++],R-=3;while(R>2);R&&(y[a++]=y[p++],R>1&&(y[a++]=y[p++]))}}else if(L&64){t.msg="invalid distance code",n.mode=fo;break e}else{I=T[(I&65535)+(g&(1<<L)-1)];continue r}break}}else if(L&64)if(L&32){n.mode=S1;break e}else{t.msg="invalid literal/length code",n.mode=fo;break e}else{I=S[(I&65535)+(g&(1<<L)-1)];continue t}break}}while(i<o&&a<l);R=x>>3,i-=R,x-=R<<3,g&=(1<<x)-1,t.next_in=i,t.next_out=a,t.avail_in=i<o?5+(o-i):5-(i-o),t.avail_out=a<l?257+(l-a):257-(a-l),n.hold=g,n.bits=x}});var au=X((b5,ou)=>{"use strict";var eu=mt(),Ur=15,tu=852,ru=592,nu=0,vs=1,iu=2,T1=[3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,0,0],C1=[16,16,16,16,16,16,16,16,17,17,17,17,18,18,18,18,19,19,19,19,20,20,20,20,21,21,21,21,16,72,78],A1=[1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577,0,0],P1=[16,16,16,16,17,17,18,18,19,19,20,20,21,21,22,22,23,23,24,24,25,25,26,26,27,27,28,28,29,29,64,64];ou.exports=function(t,r,n,i,o,a,s,l){var f=l.bits,c=0,u=0,d=0,h=0,g=0,x=0,S=0,T=0,w=0,k=0,I,L,R,N,p,m=null,b=0,y,v=new eu.Buf16(Ur+1),E=new eu.Buf16(Ur+1),F=null,_=0,C,P,A;for(c=0;c<=Ur;c++)v[c]=0;for(u=0;u<i;u++)v[r[n+u]]++;for(g=f,h=Ur;h>=1&&v[h]===0;h--);if(g>h&&(g=h),h===0)return o[a++]=1<<24|64<<16|0,o[a++]=1<<24|64<<16|0,l.bits=1,0;for(d=1;d<h&&v[d]===0;d++);for(g<d&&(g=d),T=1,c=1;c<=Ur;c++)if(T<<=1,T-=v[c],T<0)return-1;if(T>0&&(t===nu||h!==1))return-1;for(E[1]=0,c=1;c<Ur;c++)E[c+1]=E[c]+v[c];for(u=0;u<i;u++)r[n+u]!==0&&(s[E[r[n+u]]++]=u);if(t===nu?(m=F=s,y=19):t===vs?(m=T1,b-=257,F=C1,_-=257,y=256):(m=A1,F=P1,y=-1),k=0,u=0,c=d,p=a,x=g,S=0,R=-1,w=1<<g,N=w-1,t===vs&&w>tu||t===iu&&w>ru)return 1;for(;;){C=c-S,s[u]<y?(P=0,A=s[u]):s[u]>y?(P=F[_+s[u]],A=m[b+s[u]]):(P=32+64,A=0),I=1<<c-S,L=1<<x,d=L;do L-=I,o[p+(k>>S)+L]=C<<24|P<<16|A|0;while(L!==0);for(I=1<<c-1;k&I;)I>>=1;if(I!==0?(k&=I-1,k+=I):k=0,u++,--v[c]===0){if(c===h)break;c=r[n+s[u]]}if(c>g&&(k&N)!==R){for(S===0&&(S=g),p+=d,x=c-S,T=1<<x;x+S<h&&(T-=v[x+S],!(T<=0));)x++,T<<=1;if(w+=1<<x,t===vs&&w>tu||t===iu&&w>ru)return 1;R=k&N,o[R]=g<<24|x<<16|p-a|0}}return k!==0&&(o[p+k]=c-S<<24|64<<16|0),l.bits=g,0}});var qu=X(Ge=>{"use strict";var Te=mt(),Cs=fs(),at=ls(),F1=Jc(),Ln=au(),k1=0,Lu=1,Iu=2,su=4,M1=5,lo=6,nr=0,L1=1,I1=2,Ie=-2,Ou=-3,As=-4,O1=-5,fu=8,Bu=1,lu=2,cu=3,uu=4,du=5,hu=6,pu=7,gu=8,mu=9,bu=10,ho=11,xt=12,ws=13,yu=14,_s=15,xu=16,vu=17,wu=18,_u=19,co=20,uo=21,Eu=22,Su=23,Tu=24,Cu=25,Au=26,Es=27,Pu=28,Fu=29,Q=30,Ps=31,B1=32,R1=852,D1=592,N1=15,z1=N1;function ku(e){return(e>>>24&255)+(e>>>8&65280)+((e&65280)<<8)+((e&255)<<24)}function U1(){this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new Te.Buf16(320),this.work=new Te.Buf16(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}function Ru(e){var t;return!e||!e.state?Ie:(t=e.state,e.total_in=e.total_out=t.total=0,e.msg="",t.wrap&&(e.adler=t.wrap&1),t.mode=Bu,t.last=0,t.havedict=0,t.dmax=32768,t.head=null,t.hold=0,t.bits=0,t.lencode=t.lendyn=new Te.Buf32(R1),t.distcode=t.distdyn=new Te.Buf32(D1),t.sane=1,t.back=-1,nr)}function Du(e){var t;return!e||!e.state?Ie:(t=e.state,t.wsize=0,t.whave=0,t.wnext=0,Ru(e))}function Nu(e,t){var r,n;return!e||!e.state||(n=e.state,t<0?(r=0,t=-t):(r=(t>>4)+1,t<48&&(t&=15)),t&&(t<8||t>15))?Ie:(n.window!==null&&n.wbits!==t&&(n.window=null),n.wrap=r,n.wbits=t,Du(e))}function zu(e,t){var r,n;return e?(n=new U1,e.state=n,n.window=null,r=Nu(e,t),r!==nr&&(e.state=null),r):Ie}function q1(e){return zu(e,z1)}var Mu=!0,Ss,Ts;function G1(e){if(Mu){var t;for(Ss=new Te.Buf32(512),Ts=new Te.Buf32(32),t=0;t<144;)e.lens[t++]=8;for(;t<256;)e.lens[t++]=9;for(;t<280;)e.lens[t++]=7;for(;t<288;)e.lens[t++]=8;for(Ln(Lu,e.lens,0,288,Ss,0,e.work,{bits:9}),t=0;t<32;)e.lens[t++]=5;Ln(Iu,e.lens,0,32,Ts,0,e.work,{bits:5}),Mu=!1}e.lencode=Ss,e.lenbits=9,e.distcode=Ts,e.distbits=5}function Uu(e,t,r,n){var i,o=e.state;return o.window===null&&(o.wsize=1<<o.wbits,o.wnext=0,o.whave=0,o.window=new Te.Buf8(o.wsize)),n>=o.wsize?(Te.arraySet(o.window,t,r-o.wsize,o.wsize,0),o.wnext=0,o.whave=o.wsize):(i=o.wsize-o.wnext,i>n&&(i=n),Te.arraySet(o.window,t,r-n,i,o.wnext),n-=i,n?(Te.arraySet(o.window,t,r-n,n,0),o.wnext=n,o.whave=o.wsize):(o.wnext+=i,o.wnext===o.wsize&&(o.wnext=0),o.whave<o.wsize&&(o.whave+=i))),0}function V1(e,t){var r,n,i,o,a,s,l,f,c,u,d,h,g,x,S=0,T,w,k,I,L,R,N,p,m=new Te.Buf8(4),b,y,v=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15];if(!e||!e.state||!e.output||!e.input&&e.avail_in!==0)return Ie;r=e.state,r.mode===xt&&(r.mode=ws),a=e.next_out,i=e.output,l=e.avail_out,o=e.next_in,n=e.input,s=e.avail_in,f=r.hold,c=r.bits,u=s,d=l,p=nr;e:for(;;)switch(r.mode){case Bu:if(r.wrap===0){r.mode=ws;break}for(;c<16;){if(s===0)break e;s--,f+=n[o++]<<c,c+=8}if(r.wrap&2&&f===35615){r.check=0,m[0]=f&255,m[1]=f>>>8&255,r.check=at(r.check,m,2,0),f=0,c=0,r.mode=lu;break}if(r.flags=0,r.head&&(r.head.done=!1),!(r.wrap&1)||(((f&255)<<8)+(f>>8))%31){e.msg="incorrect header check",r.mode=Q;break}if((f&15)!==fu){e.msg="unknown compression method",r.mode=Q;break}if(f>>>=4,c-=4,N=(f&15)+8,r.wbits===0)r.wbits=N;else if(N>r.wbits){e.msg="invalid window size",r.mode=Q;break}r.dmax=1<<N,e.adler=r.check=1,r.mode=f&512?bu:xt,f=0,c=0;break;case lu:for(;c<16;){if(s===0)break e;s--,f+=n[o++]<<c,c+=8}if(r.flags=f,(r.flags&255)!==fu){e.msg="unknown compression method",r.mode=Q;break}if(r.flags&57344){e.msg="unknown header flags set",r.mode=Q;break}r.head&&(r.head.text=f>>8&1),r.flags&512&&(m[0]=f&255,m[1]=f>>>8&255,r.check=at(r.check,m,2,0)),f=0,c=0,r.mode=cu;case cu:for(;c<32;){if(s===0)break e;s--,f+=n[o++]<<c,c+=8}r.head&&(r.head.time=f),r.flags&512&&(m[0]=f&255,m[1]=f>>>8&255,m[2]=f>>>16&255,m[3]=f>>>24&255,r.check=at(r.check,m,4,0)),f=0,c=0,r.mode=uu;case uu:for(;c<16;){if(s===0)break e;s--,f+=n[o++]<<c,c+=8}r.head&&(r.head.xflags=f&255,r.head.os=f>>8),r.flags&512&&(m[0]=f&255,m[1]=f>>>8&255,r.check=at(r.check,m,2,0)),f=0,c=0,r.mode=du;case du:if(r.flags&1024){for(;c<16;){if(s===0)break e;s--,f+=n[o++]<<c,c+=8}r.length=f,r.head&&(r.head.extra_len=f),r.flags&512&&(m[0]=f&255,m[1]=f>>>8&255,r.check=at(r.check,m,2,0)),f=0,c=0}else r.head&&(r.head.extra=null);r.mode=hu;case hu:if(r.flags&1024&&(h=r.length,h>s&&(h=s),h&&(r.head&&(N=r.head.extra_len-r.length,r.head.extra||(r.head.extra=new Array(r.head.extra_len)),Te.arraySet(r.head.extra,n,o,h,N)),r.flags&512&&(r.check=at(r.check,n,h,o)),s-=h,o+=h,r.length-=h),r.length))break e;r.length=0,r.mode=pu;case pu:if(r.flags&2048){if(s===0)break e;h=0;do N=n[o+h++],r.head&&N&&r.length<65536&&(r.head.name+=String.fromCharCode(N));while(N&&h<s);if(r.flags&512&&(r.check=at(r.check,n,h,o)),s-=h,o+=h,N)break e}else r.head&&(r.head.name=null);r.length=0,r.mode=gu;case gu:if(r.flags&4096){if(s===0)break e;h=0;do N=n[o+h++],r.head&&N&&r.length<65536&&(r.head.comment+=String.fromCharCode(N));while(N&&h<s);if(r.flags&512&&(r.check=at(r.check,n,h,o)),s-=h,o+=h,N)break e}else r.head&&(r.head.comment=null);r.mode=mu;case mu:if(r.flags&512){for(;c<16;){if(s===0)break e;s--,f+=n[o++]<<c,c+=8}if(f!==(r.check&65535)){e.msg="header crc mismatch",r.mode=Q;break}f=0,c=0}r.head&&(r.head.hcrc=r.flags>>9&1,r.head.done=!0),e.adler=r.check=0,r.mode=xt;break;case bu:for(;c<32;){if(s===0)break e;s--,f+=n[o++]<<c,c+=8}e.adler=r.check=ku(f),f=0,c=0,r.mode=ho;case ho:if(r.havedict===0)return e.next_out=a,e.avail_out=l,e.next_in=o,e.avail_in=s,r.hold=f,r.bits=c,I1;e.adler=r.check=1,r.mode=xt;case xt:if(t===M1||t===lo)break e;case ws:if(r.last){f>>>=c&7,c-=c&7,r.mode=Es;break}for(;c<3;){if(s===0)break e;s--,f+=n[o++]<<c,c+=8}switch(r.last=f&1,f>>>=1,c-=1,f&3){case 0:r.mode=yu;break;case 1:if(G1(r),r.mode=co,t===lo){f>>>=2,c-=2;break e}break;case 2:r.mode=vu;break;case 3:e.msg="invalid block type",r.mode=Q}f>>>=2,c-=2;break;case yu:for(f>>>=c&7,c-=c&7;c<32;){if(s===0)break e;s--,f+=n[o++]<<c,c+=8}if((f&65535)!==(f>>>16^65535)){e.msg="invalid stored block lengths",r.mode=Q;break}if(r.length=f&65535,f=0,c=0,r.mode=_s,t===lo)break e;case _s:r.mode=xu;case xu:if(h=r.length,h){if(h>s&&(h=s),h>l&&(h=l),h===0)break e;Te.arraySet(i,n,o,h,a),s-=h,o+=h,l-=h,a+=h,r.length-=h;break}r.mode=xt;break;case vu:for(;c<14;){if(s===0)break e;s--,f+=n[o++]<<c,c+=8}if(r.nlen=(f&31)+257,f>>>=5,c-=5,r.ndist=(f&31)+1,f>>>=5,c-=5,r.ncode=(f&15)+4,f>>>=4,c-=4,r.nlen>286||r.ndist>30){e.msg="too many length or distance symbols",r.mode=Q;break}r.have=0,r.mode=wu;case wu:for(;r.have<r.ncode;){for(;c<3;){if(s===0)break e;s--,f+=n[o++]<<c,c+=8}r.lens[v[r.have++]]=f&7,f>>>=3,c-=3}for(;r.have<19;)r.lens[v[r.have++]]=0;if(r.lencode=r.lendyn,r.lenbits=7,b={bits:r.lenbits},p=Ln(k1,r.lens,0,19,r.lencode,0,r.work,b),r.lenbits=b.bits,p){e.msg="invalid code lengths set",r.mode=Q;break}r.have=0,r.mode=_u;case _u:for(;r.have<r.nlen+r.ndist;){for(;S=r.lencode[f&(1<<r.lenbits)-1],T=S>>>24,w=S>>>16&255,k=S&65535,!(T<=c);){if(s===0)break e;s--,f+=n[o++]<<c,c+=8}if(k<16)f>>>=T,c-=T,r.lens[r.have++]=k;else{if(k===16){for(y=T+2;c<y;){if(s===0)break e;s--,f+=n[o++]<<c,c+=8}if(f>>>=T,c-=T,r.have===0){e.msg="invalid bit length repeat",r.mode=Q;break}N=r.lens[r.have-1],h=3+(f&3),f>>>=2,c-=2}else if(k===17){for(y=T+3;c<y;){if(s===0)break e;s--,f+=n[o++]<<c,c+=8}f>>>=T,c-=T,N=0,h=3+(f&7),f>>>=3,c-=3}else{for(y=T+7;c<y;){if(s===0)break e;s--,f+=n[o++]<<c,c+=8}f>>>=T,c-=T,N=0,h=11+(f&127),f>>>=7,c-=7}if(r.have+h>r.nlen+r.ndist){e.msg="invalid bit length repeat",r.mode=Q;break}for(;h--;)r.lens[r.have++]=N}}if(r.mode===Q)break;if(r.lens[256]===0){e.msg="invalid code -- missing end-of-block",r.mode=Q;break}if(r.lenbits=9,b={bits:r.lenbits},p=Ln(Lu,r.lens,0,r.nlen,r.lencode,0,r.work,b),r.lenbits=b.bits,p){e.msg="invalid literal/lengths set",r.mode=Q;break}if(r.distbits=6,r.distcode=r.distdyn,b={bits:r.distbits},p=Ln(Iu,r.lens,r.nlen,r.ndist,r.distcode,0,r.work,b),r.distbits=b.bits,p){e.msg="invalid distances set",r.mode=Q;break}if(r.mode=co,t===lo)break e;case co:r.mode=uo;case uo:if(s>=6&&l>=258){e.next_out=a,e.avail_out=l,e.next_in=o,e.avail_in=s,r.hold=f,r.bits=c,F1(e,d),a=e.next_out,i=e.output,l=e.avail_out,o=e.next_in,n=e.input,s=e.avail_in,f=r.hold,c=r.bits,r.mode===xt&&(r.back=-1);break}for(r.back=0;S=r.lencode[f&(1<<r.lenbits)-1],T=S>>>24,w=S>>>16&255,k=S&65535,!(T<=c);){if(s===0)break e;s--,f+=n[o++]<<c,c+=8}if(w&&!(w&240)){for(I=T,L=w,R=k;S=r.lencode[R+((f&(1<<I+L)-1)>>I)],T=S>>>24,w=S>>>16&255,k=S&65535,!(I+T<=c);){if(s===0)break e;s--,f+=n[o++]<<c,c+=8}f>>>=I,c-=I,r.back+=I}if(f>>>=T,c-=T,r.back+=T,r.length=k,w===0){r.mode=Au;break}if(w&32){r.back=-1,r.mode=xt;break}if(w&64){e.msg="invalid literal/length code",r.mode=Q;break}r.extra=w&15,r.mode=Eu;case Eu:if(r.extra){for(y=r.extra;c<y;){if(s===0)break e;s--,f+=n[o++]<<c,c+=8}r.length+=f&(1<<r.extra)-1,f>>>=r.extra,c-=r.extra,r.back+=r.extra}r.was=r.length,r.mode=Su;case Su:for(;S=r.distcode[f&(1<<r.distbits)-1],T=S>>>24,w=S>>>16&255,k=S&65535,!(T<=c);){if(s===0)break e;s--,f+=n[o++]<<c,c+=8}if(!(w&240)){for(I=T,L=w,R=k;S=r.distcode[R+((f&(1<<I+L)-1)>>I)],T=S>>>24,w=S>>>16&255,k=S&65535,!(I+T<=c);){if(s===0)break e;s--,f+=n[o++]<<c,c+=8}f>>>=I,c-=I,r.back+=I}if(f>>>=T,c-=T,r.back+=T,w&64){e.msg="invalid distance code",r.mode=Q;break}r.offset=k,r.extra=w&15,r.mode=Tu;case Tu:if(r.extra){for(y=r.extra;c<y;){if(s===0)break e;s--,f+=n[o++]<<c,c+=8}r.offset+=f&(1<<r.extra)-1,f>>>=r.extra,c-=r.extra,r.back+=r.extra}if(r.offset>r.dmax){e.msg="invalid distance too far back",r.mode=Q;break}r.mode=Cu;case Cu:if(l===0)break e;if(h=d-l,r.offset>h){if(h=r.offset-h,h>r.whave&&r.sane){e.msg="invalid distance too far back",r.mode=Q;break}h>r.wnext?(h-=r.wnext,g=r.wsize-h):g=r.wnext-h,h>r.length&&(h=r.length),x=r.window}else x=i,g=a-r.offset,h=r.length;h>l&&(h=l),l-=h,r.length-=h;do i[a++]=x[g++];while(--h);r.length===0&&(r.mode=uo);break;case Au:if(l===0)break e;i[a++]=r.length,l--,r.mode=uo;break;case Es:if(r.wrap){for(;c<32;){if(s===0)break e;s--,f|=n[o++]<<c,c+=8}if(d-=l,e.total_out+=d,r.total+=d,d&&(e.adler=r.check=r.flags?at(r.check,i,d,a-d):Cs(r.check,i,d,a-d)),d=l,(r.flags?f:ku(f))!==r.check){e.msg="incorrect data check",r.mode=Q;break}f=0,c=0}r.mode=Pu;case Pu:if(r.wrap&&r.flags){for(;c<32;){if(s===0)break e;s--,f+=n[o++]<<c,c+=8}if(f!==(r.total&4294967295)){e.msg="incorrect length check",r.mode=Q;break}f=0,c=0}r.mode=Fu;case Fu:p=L1;break e;case Q:p=Ou;break e;case Ps:return As;case B1:default:return Ie}return e.next_out=a,e.avail_out=l,e.next_in=o,e.avail_in=s,r.hold=f,r.bits=c,(r.wsize||d!==e.avail_out&&r.mode<Q&&(r.mode<Es||t!==su))&&Uu(e,e.output,e.next_out,d-e.avail_out)?(r.mode=Ps,As):(u-=e.avail_in,d-=e.avail_out,e.total_in+=u,e.total_out+=d,r.total+=d,r.wrap&&d&&(e.adler=r.check=r.flags?at(r.check,i,d,e.next_out-d):Cs(r.check,i,d,e.next_out-d)),e.data_type=r.bits+(r.last?64:0)+(r.mode===xt?128:0)+(r.mode===co||r.mode===_s?256:0),(u===0&&d===0||t===su)&&p===nr&&(p=O1),p)}function $1(e){if(!e||!e.state)return Ie;var t=e.state;return t.window&&(t.window=null),e.state=null,nr}function H1(e,t){var r;return!e||!e.state||(r=e.state,!(r.wrap&2))?Ie:(r.head=t,t.done=!1,nr)}function Z1(e,t){var r=t.length,n,i,o;return!e||!e.state||(n=e.state,n.wrap!==0&&n.mode!==ho)?Ie:n.mode===ho&&(i=1,i=Cs(i,t,r,0),i!==n.check)?Ou:(o=Uu(e,t,r,r),o?(n.mode=Ps,As):(n.havedict=1,nr))}Ge.inflateReset=Du;Ge.inflateReset2=Nu;Ge.inflateResetKeep=Ru;Ge.inflateInit=q1;Ge.inflateInit2=zu;Ge.inflate=V1;Ge.inflateEnd=$1;Ge.inflateGetHeader=H1;Ge.inflateSetDictionary=Z1;Ge.inflateInfo="pako inflate (from Nodeca project)"});var Fs=X((x5,Gu)=>{"use strict";Gu.exports={Z_NO_FLUSH:0,Z_PARTIAL_FLUSH:1,Z_SYNC_FLUSH:2,Z_FULL_FLUSH:3,Z_FINISH:4,Z_BLOCK:5,Z_TREES:6,Z_OK:0,Z_STREAM_END:1,Z_NEED_DICT:2,Z_ERRNO:-1,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_BUF_ERROR:-5,Z_NO_COMPRESSION:0,Z_BEST_SPEED:1,Z_BEST_COMPRESSION:9,Z_DEFAULT_COMPRESSION:-1,Z_FILTERED:1,Z_HUFFMAN_ONLY:2,Z_RLE:3,Z_FIXED:4,Z_DEFAULT_STRATEGY:0,Z_BINARY:0,Z_TEXT:1,Z_UNKNOWN:2,Z_DEFLATED:8}});var $u=X((v5,Vu)=>{"use strict";function j1(){this.text=0,this.time=0,this.xflags=0,this.os=0,this.extra=null,this.extra_len=0,this.name="",this.comment="",this.hcrc=0,this.done=!1}Vu.exports=j1});var Zu=X(On=>{"use strict";var qr=qu(),In=mt(),po=ps(),oe=Fs(),ks=eo(),W1=gs(),Y1=$u(),Hu=Object.prototype.toString;function ir(e){if(!(this instanceof ir))return new ir(e);this.options=In.assign({chunkSize:16384,windowBits:0,to:""},e||{});var t=this.options;t.raw&&t.windowBits>=0&&t.windowBits<16&&(t.windowBits=-t.windowBits,t.windowBits===0&&(t.windowBits=-15)),t.windowBits>=0&&t.windowBits<16&&!(e&&e.windowBits)&&(t.windowBits+=32),t.windowBits>15&&t.windowBits<48&&(t.windowBits&15||(t.windowBits|=15)),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new W1,this.strm.avail_out=0;var r=qr.inflateInit2(this.strm,t.windowBits);if(r!==oe.Z_OK)throw new Error(ks[r]);if(this.header=new Y1,qr.inflateGetHeader(this.strm,this.header),t.dictionary&&(typeof t.dictionary=="string"?t.dictionary=po.string2buf(t.dictionary):Hu.call(t.dictionary)==="[object ArrayBuffer]"&&(t.dictionary=new Uint8Array(t.dictionary)),t.raw&&(r=qr.inflateSetDictionary(this.strm,t.dictionary),r!==oe.Z_OK)))throw new Error(ks[r])}ir.prototype.push=function(e,t){var r=this.strm,n=this.options.chunkSize,i=this.options.dictionary,o,a,s,l,f,c=!1;if(this.ended)return!1;a=t===~~t?t:t===!0?oe.Z_FINISH:oe.Z_NO_FLUSH,typeof e=="string"?r.input=po.binstring2buf(e):Hu.call(e)==="[object ArrayBuffer]"?r.input=new Uint8Array(e):r.input=e,r.next_in=0,r.avail_in=r.input.length;do{if(r.avail_out===0&&(r.output=new In.Buf8(n),r.next_out=0,r.avail_out=n),o=qr.inflate(r,oe.Z_NO_FLUSH),o===oe.Z_NEED_DICT&&i&&(o=qr.inflateSetDictionary(this.strm,i)),o===oe.Z_BUF_ERROR&&c===!0&&(o=oe.Z_OK,c=!1),o!==oe.Z_STREAM_END&&o!==oe.Z_OK)return this.onEnd(o),this.ended=!0,!1;r.next_out&&(r.avail_out===0||o===oe.Z_STREAM_END||r.avail_in===0&&(a===oe.Z_FINISH||a===oe.Z_SYNC_FLUSH))&&(this.options.to==="string"?(s=po.utf8border(r.output,r.next_out),l=r.next_out-s,f=po.buf2string(r.output,s),r.next_out=l,r.avail_out=n-l,l&&In.arraySet(r.output,r.output,s,l,0),this.onData(f)):this.onData(In.shrinkBuf(r.output,r.next_out))),r.avail_in===0&&r.avail_out===0&&(c=!0)}while((r.avail_in>0||r.avail_out===0)&&o!==oe.Z_STREAM_END);return o===oe.Z_STREAM_END&&(a=oe.Z_FINISH),a===oe.Z_FINISH?(o=qr.inflateEnd(this.strm),this.onEnd(o),this.ended=!0,o===oe.Z_OK):(a===oe.Z_SYNC_FLUSH&&(this.onEnd(oe.Z_OK),r.avail_out=0),!0)};ir.prototype.onData=function(e){this.chunks.push(e)};ir.prototype.onEnd=function(e){e===oe.Z_OK&&(this.options.to==="string"?this.result=this.chunks.join(""):this.result=In.flattenChunks(this.chunks)),this.chunks=[],this.err=e,this.msg=this.strm.msg};function Ms(e,t){var r=new ir(t);if(r.push(e,!0),r.err)throw r.msg||ks[r.err];return r.result}function K1(e,t){return t=t||{},t.raw=!0,Ms(e,t)}On.Inflate=ir;On.inflate=Ms;On.inflateRaw=K1;On.ungzip=Ms});var Yu=X((_5,Wu)=>{"use strict";var X1=mt().assign,Q1=Xc(),J1=Zu(),eb=Fs(),ju={};X1(ju,Q1,J1,eb);Wu.exports=ju});var Ku=X(()=>{});var Xu=X(Ls=>{Ls.read=function(e,t,r,n,i){var o,a,s=i*8-n-1,l=(1<<s)-1,f=l>>1,c=-7,u=r?i-1:0,d=r?-1:1,h=e[t+u];for(u+=d,o=h&(1<<-c)-1,h>>=-c,c+=s;c>0;o=o*256+e[t+u],u+=d,c-=8);for(a=o&(1<<-c)-1,o>>=-c,c+=n;c>0;a=a*256+e[t+u],u+=d,c-=8);if(o===0)o=1-f;else{if(o===l)return a?NaN:(h?-1:1)*(1/0);a=a+Math.pow(2,n),o=o-f}return(h?-1:1)*a*Math.pow(2,o-n)};Ls.write=function(e,t,r,n,i,o){var a,s,l,f=o*8-i-1,c=(1<<f)-1,u=c>>1,d=i===23?Math.pow(2,-24)-Math.pow(2,-77):0,h=n?0:o-1,g=n?1:-1,x=t<0||t===0&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(s=isNaN(t)?1:0,a=c):(a=Math.floor(Math.log(t)/Math.LN2),t*(l=Math.pow(2,-a))<1&&(a--,l*=2),a+u>=1?t+=d/l:t+=d*Math.pow(2,1-u),t*l>=2&&(a++,l/=2),a+u>=c?(s=0,a=c):a+u>=1?(s=(t*l-1)*Math.pow(2,i),a=a+u):(s=t*Math.pow(2,u-1)*Math.pow(2,i),a=0));i>=8;e[r+h]=s&255,h+=g,s/=256,i-=8);for(a=a<<i|s,f+=i;f>0;e[r+h]=a&255,h+=g,a/=256,f-=8);e[r+h-g]|=x*128}});var nd=X((U5,rd)=>{"use strict";rd.exports=W;var mo=Xu();function W(e){this.buf=ArrayBuffer.isView&&ArrayBuffer.isView(e)?e:new Uint8Array(e||0),this.pos=0,this.type=0,this.length=this.buf.length}W.Varint=0;W.Fixed64=1;W.Bytes=2;W.Fixed32=5;var Is=(1<<16)*(1<<16),Qu=1/Is,tb=12,td=typeof TextDecoder>"u"?null:new TextDecoder("utf-8");W.prototype={destroy:function(){this.buf=null},readFields:function(e,t,r){for(r=r||this.length;this.pos<r;){var n=this.readVarint(),i=n>>3,o=this.pos;this.type=n&7,e(i,t,this),this.pos===o&&this.skip(n)}return t},readMessage:function(e,t){return this.readFields(e,t,this.readVarint()+this.pos)},readFixed32:function(){var e=bo(this.buf,this.pos);return this.pos+=4,e},readSFixed32:function(){var e=ed(this.buf,this.pos);return this.pos+=4,e},readFixed64:function(){var e=bo(this.buf,this.pos)+bo(this.buf,this.pos+4)*Is;return this.pos+=8,e},readSFixed64:function(){var e=bo(this.buf,this.pos)+ed(this.buf,this.pos+4)*Is;return this.pos+=8,e},readFloat:function(){var e=mo.read(this.buf,this.pos,!0,23,4);return this.pos+=4,e},readDouble:function(){var e=mo.read(this.buf,this.pos,!0,52,8);return this.pos+=8,e},readVarint:function(e){var t=this.buf,r,n;return n=t[this.pos++],r=n&127,n<128||(n=t[this.pos++],r|=(n&127)<<7,n<128)||(n=t[this.pos++],r|=(n&127)<<14,n<128)||(n=t[this.pos++],r|=(n&127)<<21,n<128)?r:(n=t[this.pos],r|=(n&15)<<28,rb(r,e,this))},readVarint64:function(){return this.readVarint(!0)},readSVarint:function(){var e=this.readVarint();return e%2===1?(e+1)/-2:e/2},readBoolean:function(){return Boolean(this.readVarint())},readString:function(){var e=this.readVarint()+this.pos,t=this.pos;return this.pos=e,e-t>=tb&&td?mb(this.buf,t,e):gb(this.buf,t,e)},readBytes:function(){var e=this.readVarint()+this.pos,t=this.buf.subarray(this.pos,e);return this.pos=e,t},readPackedVarint:function(e,t){if(this.type!==W.Bytes)return e.push(this.readVarint(t));var r=wt(this);for(e=e||[];this.pos<r;)e.push(this.readVarint(t));return e},readPackedSVarint:function(e){if(this.type!==W.Bytes)return e.push(this.readSVarint());var t=wt(this);for(e=e||[];this.pos<t;)e.push(this.readSVarint());return e},readPackedBoolean:function(e){if(this.type!==W.Bytes)return e.push(this.readBoolean());var t=wt(this);for(e=e||[];this.pos<t;)e.push(this.readBoolean());return e},readPackedFloat:function(e){if(this.type!==W.Bytes)return e.push(this.readFloat());var t=wt(this);for(e=e||[];this.pos<t;)e.push(this.readFloat());return e},readPackedDouble:function(e){if(this.type!==W.Bytes)return e.push(this.readDouble());var t=wt(this);for(e=e||[];this.pos<t;)e.push(this.readDouble());return e},readPackedFixed32:function(e){if(this.type!==W.Bytes)return e.push(this.readFixed32());var t=wt(this);for(e=e||[];this.pos<t;)e.push(this.readFixed32());return e},readPackedSFixed32:function(e){if(this.type!==W.Bytes)return e.push(this.readSFixed32());var t=wt(this);for(e=e||[];this.pos<t;)e.push(this.readSFixed32());return e},readPackedFixed64:function(e){if(this.type!==W.Bytes)return e.push(this.readFixed64());var t=wt(this);for(e=e||[];this.pos<t;)e.push(this.readFixed64());return e},readPackedSFixed64:function(e){if(this.type!==W.Bytes)return e.push(this.readSFixed64());var t=wt(this);for(e=e||[];this.pos<t;)e.push(this.readSFixed64());return e},skip:function(e){var t=e&7;if(t===W.Varint)for(;this.buf[this.pos++]>127;);else if(t===W.Bytes)this.pos=this.readVarint()+this.pos;else if(t===W.Fixed32)this.pos+=4;else if(t===W.Fixed64)this.pos+=8;else throw new Error("Unimplemented type: "+t)},writeTag:function(e,t){this.writeVarint(e<<3|t)},realloc:function(e){for(var t=this.length||16;t<this.pos+e;)t*=2;if(t!==this.length){var r=new Uint8Array(t);r.set(this.buf),this.buf=r,this.length=t}},finish:function(){return this.length=this.pos,this.pos=0,this.buf.subarray(0,this.length)},writeFixed32:function(e){this.realloc(4),Hr(this.buf,e,this.pos),this.pos+=4},writeSFixed32:function(e){this.realloc(4),Hr(this.buf,e,this.pos),this.pos+=4},writeFixed64:function(e){this.realloc(8),Hr(this.buf,e&-1,this.pos),Hr(this.buf,Math.floor(e*Qu),this.pos+4),this.pos+=8},writeSFixed64:function(e){this.realloc(8),Hr(this.buf,e&-1,this.pos),Hr(this.buf,Math.floor(e*Qu),this.pos+4),this.pos+=8},writeVarint:function(e){if(e=+e||0,e>268435455||e<0){nb(e,this);return}this.realloc(4),this.buf[this.pos++]=e&127|(e>127?128:0),!(e<=127)&&(this.buf[this.pos++]=(e>>>=7)&127|(e>127?128:0),!(e<=127)&&(this.buf[this.pos++]=(e>>>=7)&127|(e>127?128:0),!(e<=127)&&(this.buf[this.pos++]=e>>>7&127)))},writeSVarint:function(e){this.writeVarint(e<0?-e*2-1:e*2)},writeBoolean:function(e){this.writeVarint(Boolean(e))},writeString:function(e){e=String(e),this.realloc(e.length*4),this.pos++;var t=this.pos;this.pos=bb(this.buf,e,this.pos);var r=this.pos-t;r>=128&&Ju(t,r,this),this.pos=t-1,this.writeVarint(r),this.pos+=r},writeFloat:function(e){this.realloc(4),mo.write(this.buf,e,this.pos,!0,23,4),this.pos+=4},writeDouble:function(e){this.realloc(8),mo.write(this.buf,e,this.pos,!0,52,8),this.pos+=8},writeBytes:function(e){var t=e.length;this.writeVarint(t),this.realloc(t);for(var r=0;r<t;r++)this.buf[this.pos++]=e[r]},writeRawMessage:function(e,t){this.pos++;var r=this.pos;e(t,this);var n=this.pos-r;n>=128&&Ju(r,n,this),this.pos=r-1,this.writeVarint(n),this.pos+=n},writeMessage:function(e,t,r){this.writeTag(e,W.Bytes),this.writeRawMessage(t,r)},writePackedVarint:function(e,t){t.length&&this.writeMessage(e,ab,t)},writePackedSVarint:function(e,t){t.length&&this.writeMessage(e,sb,t)},writePackedBoolean:function(e,t){t.length&&this.writeMessage(e,cb,t)},writePackedFloat:function(e,t){t.length&&this.writeMessage(e,fb,t)},writePackedDouble:function(e,t){t.length&&this.writeMessage(e,lb,t)},writePackedFixed32:function(e,t){t.length&&this.writeMessage(e,ub,t)},writePackedSFixed32:function(e,t){t.length&&this.writeMessage(e,db,t)},writePackedFixed64:function(e,t){t.length&&this.writeMessage(e,hb,t)},writePackedSFixed64:function(e,t){t.length&&this.writeMessage(e,pb,t)},writeBytesField:function(e,t){this.writeTag(e,W.Bytes),this.writeBytes(t)},writeFixed32Field:function(e,t){this.writeTag(e,W.Fixed32),this.writeFixed32(t)},writeSFixed32Field:function(e,t){this.writeTag(e,W.Fixed32),this.writeSFixed32(t)},writeFixed64Field:function(e,t){this.writeTag(e,W.Fixed64),this.writeFixed64(t)},writeSFixed64Field:function(e,t){this.writeTag(e,W.Fixed64),this.writeSFixed64(t)},writeVarintField:function(e,t){this.writeTag(e,W.Varint),this.writeVarint(t)},writeSVarintField:function(e,t){this.writeTag(e,W.Varint),this.writeSVarint(t)},writeStringField:function(e,t){this.writeTag(e,W.Bytes),this.writeString(t)},writeFloatField:function(e,t){this.writeTag(e,W.Fixed32),this.writeFloat(t)},writeDoubleField:function(e,t){this.writeTag(e,W.Fixed64),this.writeDouble(t)},writeBooleanField:function(e,t){this.writeVarintField(e,Boolean(t))}};function rb(e,t,r){var n=r.buf,i,o;if(o=n[r.pos++],i=(o&112)>>4,o<128||(o=n[r.pos++],i|=(o&127)<<3,o<128)||(o=n[r.pos++],i|=(o&127)<<10,o<128)||(o=n[r.pos++],i|=(o&127)<<17,o<128)||(o=n[r.pos++],i|=(o&127)<<24,o<128)||(o=n[r.pos++],i|=(o&1)<<31,o<128))return $r(e,i,t);throw new Error("Expected varint not more than 10 bytes")}function wt(e){return e.type===W.Bytes?e.readVarint()+e.pos:e.pos+1}function $r(e,t,r){return r?t*4294967296+(e>>>0):(t>>>0)*4294967296+(e>>>0)}function nb(e,t){var r,n;if(e>=0?(r=e%4294967296|0,n=e/4294967296|0):(r=~(-e%4294967296),n=~(-e/4294967296),r^4294967295?r=r+1|0:(r=0,n=n+1|0)),e>=18446744073709552e3||e<-18446744073709552e3)throw new Error("Given varint doesn't fit into 10 bytes");t.realloc(10),ib(r,n,t),ob(n,t)}function ib(e,t,r){r.buf[r.pos++]=e&127|128,e>>>=7,r.buf[r.pos++]=e&127|128,e>>>=7,r.buf[r.pos++]=e&127|128,e>>>=7,r.buf[r.pos++]=e&127|128,e>>>=7,r.buf[r.pos]=e&127}function ob(e,t){var r=(e&7)<<4;t.buf[t.pos++]|=r|((e>>>=3)?128:0),e&&(t.buf[t.pos++]=e&127|((e>>>=7)?128:0),e&&(t.buf[t.pos++]=e&127|((e>>>=7)?128:0),e&&(t.buf[t.pos++]=e&127|((e>>>=7)?128:0),e&&(t.buf[t.pos++]=e&127|((e>>>=7)?128:0),e&&(t.buf[t.pos++]=e&127)))))}function Ju(e,t,r){var n=t<=16383?1:t<=2097151?2:t<=268435455?3:Math.floor(Math.log(t)/(Math.LN2*7));r.realloc(n);for(var i=r.pos-1;i>=e;i--)r.buf[i+n]=r.buf[i]}function ab(e,t){for(var r=0;r<e.length;r++)t.writeVarint(e[r])}function sb(e,t){for(var r=0;r<e.length;r++)t.writeSVarint(e[r])}function fb(e,t){for(var r=0;r<e.length;r++)t.writeFloat(e[r])}function lb(e,t){for(var r=0;r<e.length;r++)t.writeDouble(e[r])}function cb(e,t){for(var r=0;r<e.length;r++)t.writeBoolean(e[r])}function ub(e,t){for(var r=0;r<e.length;r++)t.writeFixed32(e[r])}function db(e,t){for(var r=0;r<e.length;r++)t.writeSFixed32(e[r])}function hb(e,t){for(var r=0;r<e.length;r++)t.writeFixed64(e[r])}function pb(e,t){for(var r=0;r<e.length;r++)t.writeSFixed64(e[r])}function bo(e,t){return(e[t]|e[t+1]<<8|e[t+2]<<16)+e[t+3]*16777216}function Hr(e,t,r){e[r]=t,e[r+1]=t>>>8,e[r+2]=t>>>16,e[r+3]=t>>>24}function ed(e,t){return(e[t]|e[t+1]<<8|e[t+2]<<16)+(e[t+3]<<24)}function gb(e,t,r){for(var n="",i=t;i<r;){var o=e[i],a=null,s=o>239?4:o>223?3:o>191?2:1;if(i+s>r)break;var l,f,c;s===1?o<128&&(a=o):s===2?(l=e[i+1],(l&192)===128&&(a=(o&31)<<6|l&63,a<=127&&(a=null))):s===3?(l=e[i+1],f=e[i+2],(l&192)===128&&(f&192)===128&&(a=(o&15)<<12|(l&63)<<6|f&63,(a<=2047||a>=55296&&a<=57343)&&(a=null))):s===4&&(l=e[i+1],f=e[i+2],c=e[i+3],(l&192)===128&&(f&192)===128&&(c&192)===128&&(a=(o&15)<<18|(l&63)<<12|(f&63)<<6|c&63,(a<=65535||a>=1114112)&&(a=null))),a===null?(a=65533,s=1):a>65535&&(a-=65536,n+=String.fromCharCode(a>>>10&1023|55296),a=56320|a&1023),n+=String.fromCharCode(a),i+=s}return n}function mb(e,t,r){return td.decode(e.subarray(t,r))}function bb(e,t,r){for(var n=0,i,o;n<t.length;n++){if(i=t.charCodeAt(n),i>55295&&i<57344)if(o)if(i<56320){e[r++]=239,e[r++]=191,e[r++]=189,o=i;continue}else i=o-55296<<10|i-56320|65536,o=null;else{i>56319||n+1===t.length?(e[r++]=239,e[r++]=191,e[r++]=189):o=i;continue}else o&&(e[r++]=239,e[r++]=191,e[r++]=189,o=null);i<128?e[r++]=i:(i<2048?e[r++]=i>>6|192:(i<65536?e[r++]=i>>12|224:(e[r++]=i>>18|240,e[r++]=i>>12&63|128),e[r++]=i>>6&63|128),e[r++]=i&63|128)}return r}});var jd=X((e4,qs)=>{"use strict";qs.exports=Bo;qs.exports.default=Bo;function Bo(e,t,r){r=r||2;var n=t&&t.length,i=n?t[0]*r:e.length,o=$d(e,0,i,r,!0),a=[];if(!o||o.next===o.prev)return a;var s,l,f,c,u,d,h;if(n&&(o=Qb(e,t,o,r)),e.length>80*r){s=f=e[0],l=c=e[1];for(var g=r;g<i;g+=r)u=e[g],d=e[g+1],u<s&&(s=u),d<l&&(l=d),u>f&&(f=u),d>c&&(c=d);h=Math.max(f-s,c-l),h=h!==0?32767/h:0}return fi(o,a,r,s,l,h,0),a}function $d(e,t,r,n,i){var o,a;if(i===Us(e,t,r,n)>0)for(o=t;o<r;o+=n)a=Vd(o,e[o],e[o+1],a);else for(o=r-n;o>=t;o-=n)a=Vd(o,e[o],e[o+1],a);return a&&Ro(a,a.next)&&(ci(a),a=a.next),a}function ur(e,t){if(!e)return e;t||(t=e);var r=e,n;do if(n=!1,!r.steiner&&(Ro(r,r.next)||ee(r.prev,r,r.next)===0)){if(ci(r),r=t=r.prev,r===r.next)break;n=!0}else r=r.next;while(n||r!==t);return t}function fi(e,t,r,n,i,o,a){if(e){!a&&o&&ny(e,n,i,o);for(var s=e,l,f;e.prev!==e.next;){if(l=e.prev,f=e.next,o?Yb(e,n,i,o):Wb(e)){t.push(l.i/r|0),t.push(e.i/r|0),t.push(f.i/r|0),ci(e),e=f.next,s=f.next;continue}if(e=f,e===s){a?a===1?(e=Kb(ur(e),t,r),fi(e,t,r,n,i,o,2)):a===2&&Xb(e,t,r,n,i,o):fi(ur(e),t,r,n,i,o,1);break}}}}function Wb(e){var t=e.prev,r=e,n=e.next;if(ee(t,r,n)>=0)return!1;for(var i=t.x,o=r.x,a=n.x,s=t.y,l=r.y,f=n.y,c=i<o?i<a?i:a:o<a?o:a,u=s<l?s<f?s:f:l<f?l:f,d=i>o?i>a?i:a:o>a?o:a,h=s>l?s>f?s:f:l>f?l:f,g=n.next;g!==t;){if(g.x>=c&&g.x<=d&&g.y>=u&&g.y<=h&&Wr(i,s,o,l,a,f,g.x,g.y)&&ee(g.prev,g,g.next)>=0)return!1;g=g.next}return!0}function Yb(e,t,r,n){var i=e.prev,o=e,a=e.next;if(ee(i,o,a)>=0)return!1;for(var s=i.x,l=o.x,f=a.x,c=i.y,u=o.y,d=a.y,h=s<l?s<f?s:f:l<f?l:f,g=c<u?c<d?c:d:u<d?u:d,x=s>l?s>f?s:f:l>f?l:f,S=c>u?c>d?c:d:u>d?u:d,T=Ns(h,g,t,r,n),w=Ns(x,S,t,r,n),k=e.prevZ,I=e.nextZ;k&&k.z>=T&&I&&I.z<=w;){if(k.x>=h&&k.x<=x&&k.y>=g&&k.y<=S&&k!==i&&k!==a&&Wr(s,c,l,u,f,d,k.x,k.y)&&ee(k.prev,k,k.next)>=0||(k=k.prevZ,I.x>=h&&I.x<=x&&I.y>=g&&I.y<=S&&I!==i&&I!==a&&Wr(s,c,l,u,f,d,I.x,I.y)&&ee(I.prev,I,I.next)>=0))return!1;I=I.nextZ}for(;k&&k.z>=T;){if(k.x>=h&&k.x<=x&&k.y>=g&&k.y<=S&&k!==i&&k!==a&&Wr(s,c,l,u,f,d,k.x,k.y)&&ee(k.prev,k,k.next)>=0)return!1;k=k.prevZ}for(;I&&I.z<=w;){if(I.x>=h&&I.x<=x&&I.y>=g&&I.y<=S&&I!==i&&I!==a&&Wr(s,c,l,u,f,d,I.x,I.y)&&ee(I.prev,I,I.next)>=0)return!1;I=I.nextZ}return!0}function Kb(e,t,r){var n=e;do{var i=n.prev,o=n.next.next;!Ro(i,o)&&Hd(i,n,n.next,o)&&li(i,o)&&li(o,i)&&(t.push(i.i/r|0),t.push(n.i/r|0),t.push(o.i/r|0),ci(n),ci(n.next),n=e=o),n=n.next}while(n!==e);return ur(n)}function Xb(e,t,r,n,i,o){var a=e;do{for(var s=a.next.next;s!==a.prev;){if(a.i!==s.i&&ay(a,s)){var l=Zd(a,s);a=ur(a,a.next),l=ur(l,l.next),fi(a,t,r,n,i,o,0),fi(l,t,r,n,i,o,0);return}s=s.next}a=a.next}while(a!==e)}function Qb(e,t,r,n){var i=[],o,a,s,l,f;for(o=0,a=t.length;o<a;o++)s=t[o]*n,l=o<a-1?t[o+1]*n:e.length,f=$d(e,s,l,n,!1),f===f.next&&(f.steiner=!0),i.push(oy(f));for(i.sort(Jb),o=0;o<i.length;o++)r=ey(i[o],r);return r}function Jb(e,t){return e.x-t.x}function ey(e,t){var r=ty(e,t);if(!r)return t;var n=Zd(r,e);return ur(n,n.next),ur(r,r.next)}function ty(e,t){var r=t,n=e.x,i=e.y,o=-1/0,a;do{if(i<=r.y&&i>=r.next.y&&r.next.y!==r.y){var s=r.x+(i-r.y)*(r.next.x-r.x)/(r.next.y-r.y);if(s<=n&&s>o&&(o=s,a=r.x<r.next.x?r:r.next,s===n))return a}r=r.next}while(r!==t);if(!a)return null;var l=a,f=a.x,c=a.y,u=1/0,d;r=a;do n>=r.x&&r.x>=f&&n!==r.x&&Wr(i<c?n:o,i,f,c,i<c?o:n,i,r.x,r.y)&&(d=Math.abs(i-r.y)/(n-r.x),li(r,e)&&(d<u||d===u&&(r.x>a.x||r.x===a.x&&ry(a,r)))&&(a=r,u=d)),r=r.next;while(r!==l);return a}function ry(e,t){return ee(e.prev,e,t.prev)<0&&ee(t.next,e,e.next)<0}function ny(e,t,r,n){var i=e;do i.z===0&&(i.z=Ns(i.x,i.y,t,r,n)),i.prevZ=i.prev,i.nextZ=i.next,i=i.next;while(i!==e);i.prevZ.nextZ=null,i.prevZ=null,iy(i)}function iy(e){var t,r,n,i,o,a,s,l,f=1;do{for(r=e,e=null,o=null,a=0;r;){for(a++,n=r,s=0,t=0;t<f&&(s++,n=n.nextZ,!!n);t++);for(l=f;s>0||l>0&&n;)s!==0&&(l===0||!n||r.z<=n.z)?(i=r,r=r.nextZ,s--):(i=n,n=n.nextZ,l--),o?o.nextZ=i:e=i,i.prevZ=o,o=i;r=n}o.nextZ=null,f*=2}while(a>1);return e}function Ns(e,t,r,n,i){return e=(e-r)*i|0,t=(t-n)*i|0,e=(e|e<<8)&16711935,e=(e|e<<4)&252645135,e=(e|e<<2)&858993459,e=(e|e<<1)&1431655765,t=(t|t<<8)&16711935,t=(t|t<<4)&252645135,t=(t|t<<2)&858993459,t=(t|t<<1)&1431655765,e|t<<1}function oy(e){var t=e,r=e;do(t.x<r.x||t.x===r.x&&t.y<r.y)&&(r=t),t=t.next;while(t!==e);return r}function Wr(e,t,r,n,i,o,a,s){return(i-a)*(t-s)>=(e-a)*(o-s)&&(e-a)*(n-s)>=(r-a)*(t-s)&&(r-a)*(o-s)>=(i-a)*(n-s)}function ay(e,t){return e.next.i!==t.i&&e.prev.i!==t.i&&!sy(e,t)&&(li(e,t)&&li(t,e)&&fy(e,t)&&(ee(e.prev,e,t.prev)||ee(e,t.prev,t))||Ro(e,t)&&ee(e.prev,e,e.next)>0&&ee(t.prev,t,t.next)>0)}function ee(e,t,r){return(t.y-e.y)*(r.x-t.x)-(t.x-e.x)*(r.y-t.y)}function Ro(e,t){return e.x===t.x&&e.y===t.y}function Hd(e,t,r,n){var i=Oo(ee(e,t,r)),o=Oo(ee(e,t,n)),a=Oo(ee(r,n,e)),s=Oo(ee(r,n,t));return!!(i!==o&&a!==s||i===0&&Io(e,r,t)||o===0&&Io(e,n,t)||a===0&&Io(r,e,n)||s===0&&Io(r,t,n))}function Io(e,t,r){return t.x<=Math.max(e.x,r.x)&&t.x>=Math.min(e.x,r.x)&&t.y<=Math.max(e.y,r.y)&&t.y>=Math.min(e.y,r.y)}function Oo(e){return e>0?1:e<0?-1:0}function sy(e,t){var r=e;do{if(r.i!==e.i&&r.next.i!==e.i&&r.i!==t.i&&r.next.i!==t.i&&Hd(r,r.next,e,t))return!0;r=r.next}while(r!==e);return!1}function li(e,t){return ee(e.prev,e,e.next)<0?ee(e,t,e.next)>=0&&ee(e,e.prev,t)>=0:ee(e,t,e.prev)<0||ee(e,e.next,t)<0}function fy(e,t){var r=e,n=!1,i=(e.x+t.x)/2,o=(e.y+t.y)/2;do r.y>o!=r.next.y>o&&r.next.y!==r.y&&i<(r.next.x-r.x)*(o-r.y)/(r.next.y-r.y)+r.x&&(n=!n),r=r.next;while(r!==e);return n}function Zd(e,t){var r=new zs(e.i,e.x,e.y),n=new zs(t.i,t.x,t.y),i=e.next,o=t.prev;return e.next=t,t.prev=e,r.next=i,i.prev=r,n.next=r,r.prev=n,o.next=n,n.prev=o,n}function Vd(e,t,r,n){var i=new zs(e,t,r);return n?(i.next=n.next,i.prev=n,n.next.prev=i,n.next=i):(i.prev=i,i.next=i),i}function ci(e){e.next.prev=e.prev,e.prev.next=e.next,e.prevZ&&(e.prevZ.nextZ=e.nextZ),e.nextZ&&(e.nextZ.prevZ=e.prevZ)}function zs(e,t,r){this.i=e,this.x=t,this.y=r,this.prev=null,this.next=null,this.z=0,this.prevZ=null,this.nextZ=null,this.steiner=!1}Bo.deviation=function(e,t,r,n){var i=t&&t.length,o=i?t[0]*r:e.length,a=Math.abs(Us(e,0,o,r));if(i)for(var s=0,l=t.length;s<l;s++){var f=t[s]*r,c=s<l-1?t[s+1]*r:e.length;a-=Math.abs(Us(e,f,c,r))}var u=0;for(s=0;s<n.length;s+=3){var d=n[s]*r,h=n[s+1]*r,g=n[s+2]*r;u+=Math.abs((e[d]-e[g])*(e[h+1]-e[d+1])-(e[d]-e[h])*(e[g+1]-e[d+1]))}return a===0&&u===0?0:Math.abs((u-a)/a)};function Us(e,t,r,n){for(var i=0,o=t,a=r-n;o<r;o+=n)i+=(e[a]-e[o])*(e[o+1]+e[a+1]),a=o;return i}Bo.flatten=function(e){for(var t=e[0][0].length,r={vertices:[],holes:[],dimensions:t},n=0,i=0;i<e.length;i++){for(var o=0;o<e[i].length;o++)for(var a=0;a<t;a++)r.vertices.push(e[i][o][a]);i>0&&(n+=e[i-1].length,r.holes.push(n))}return r}});var eh=X((o4,Jd)=>{Jd.exports=globalThis.deck});var Pr={};Ga(Pr,{carto:()=>S_});var za={};Ga(za,{BASEMAP:()=>eg,CARTO_LAYERS:()=>E_,CARTO_SOURCES:()=>Ip,CartoAPIError:()=>Cr,ClusterTileLayer:()=>jn,H3TileLayer:()=>lr,HeatmapTileLayer:()=>ei,LayerFactory:()=>hl,PointLabelLayer:()=>ni,QuadbinTileLayer:()=>cr,RasterTileLayer:()=>si,SOURCE_DEFAULTS:()=>Oi,VectorTileLayer:()=>Kr,_GOOGLE_BASEMAPS:()=>Ra,_QuadbinLayer:()=>Eo,_RasterLayer:()=>Mo,_STYLE_LAYER_GROUPS:()=>fl,_SpatialIndexTileLayer:()=>Zr,_applyLayerGroupFilters:()=>Da,_fetchStyle:()=>Na,_getStyleUrl:()=>Xe,boundaryQuerySource:()=>Xf,boundaryTableSource:()=>Qf,colorBins:()=>cl,colorCategories:()=>ul,colorContinuous:()=>dl,fetchBasemapProps:()=>og,fetchMap:()=>ng,h3QuerySource:()=>Sa,h3TableSource:()=>Ta,h3TilesetSource:()=>tl,quadbinQuerySource:()=>Aa,quadbinTableSource:()=>Pa,quadbinTilesetSource:()=>rl,query:()=>Op,rasterSource:()=>Fa,vectorQuerySource:()=>ka,vectorTableSource:()=>Ma,vectorTilesetSource:()=>La});var hd=G(kt(),1),pd=G(pt(),1),gd=G(pn(),1);function yl(e,t,r){switch(e.type){case"Point":return pg(e,t,r);case"LineString":return hg(e,t,r);case"Polygon":return xl(e,t,r);default:let n=e;throw new Error(`Unsupported geometry type: ${n?.type}`)}}function xl(e,t=-1/0,r=1/0){let{positions:n}=e,i=e.polygonIndices.value.filter(l=>l>=t&&l<=r),o=e.primitivePolygonIndices.value.filter(l=>l>=t&&l<=r);if(!(i.length>2)){let l=[];for(let f=0;f<o.length-1;f++){let c=o[f],u=o[f+1],d=Vi(n,c,u);l.push(d)}return{type:"Polygon",coordinates:l}}let s=[];for(let l=0;l<i.length-1;l++){let f=i[l],c=i[l+1],u=xl(e,f,c).coordinates;s.push(u)}return{type:"MultiPolygon",coordinates:s}}function hg(e,t=-1/0,r=1/0){let{positions:n}=e,i=e.pathIndices.value.filter(s=>s>=t&&s<=r);if(!(i.length>2))return{type:"LineString",coordinates:Vi(n,i[0],i[1])};let a=[];for(let s=0;s<i.length-1;s++){let l=Vi(n,i[s],i[s+1]);a.push(l)}return{type:"MultiLineString",coordinates:a}}function pg(e,t,r){let{positions:n}=e,i=Vi(n,t,r);return i.length>1?{type:"MultiPoint",coordinates:i}:{type:"Point",coordinates:i[0]}}function Vi(e,t,r){t=t||0,r=r||e.value.length/e.size;let n=[];for(let i=t;i<r;i++){let o=Array();for(let a=i*e.size;a<(i+1)*e.size;a++)o.push(Number(e.value[a]));n.push(o)}return n}function Hi(e,t){let r=t?.globalFeatureId;return r!==void 0?gg(e,r):mg(e,t?.type)}function gg(e,t){let r=vl(e);for(let n of r){let i=0,o=n.featureIds.value[0];for(let a=0;a<n.featureIds.value.length;a++){let s=n.featureIds.value[a];if(s!==o){if(t===n.globalFeatureIds.value[i])return $i(n,i,a);i=a,o=s}}if(t===n.globalFeatureIds.value[i])return $i(n,i,n.featureIds.value.length)}throw new Error(`featureId:${t} not found`)}function mg(e,t){let r=vl(e,t);return bg(r)}function vl(e,t){let r=[];return e.points&&(e.points.type="Point",r.push(e.points)),e.lines&&(e.lines.type="LineString",r.push(e.lines)),e.polygons&&(e.polygons.type="Polygon",r.push(e.polygons)),r}function bg(e){let t=[];for(let r of e){if(r.featureIds.value.length===0)continue;let n=0,i=r.featureIds.value[0];for(let o=0;o<r.featureIds.value.length;o++){let a=r.featureIds.value[o];a!==i&&(t.push($i(r,n,o)),n=o,i=a)}t.push($i(r,n,r.featureIds.value.length))}return t}function $i(e,t,r){let n=yl(e,t,r),i=xg(e,t,r),o=yg(e,t,r);return{type:"Feature",geometry:n,properties:i,...o}}function yg(e,t=0,r){return e.fields&&e.fields[e.featureIds.value[t]]}function xg(e,t=0,r){let n=Object.assign({},e.properties[e.featureIds.value[t]]);for(let i in e.numericProps)n[i]=e.numericProps[i].value[t];return n}var Vn=G(Se(),1);var Wt=Math.PI,Sg=Wt/4,z_=Wt/180,_l=180/Wt,El=512;function Fe(e){let[t,r]=e,n=t/El*(2*Wt)-Wt,i=2*(Math.atan(Math.exp(r/El*(2*Wt)-Wt))-Sg);return[n*_l,i*_l]}var j_=Math.PI/180;var Dg=Math.PI/180,Ng=180/Math.PI;function Ml(e){var t=Cl(e[0]+1,e[2]),r=Cl(e[0],e[2]),n=Al(e[1]+1,e[2]),i=Al(e[1],e[2]);return[r,n,t,i]}function zg(e){var t=Ml(e),r={type:"Polygon",coordinates:[[[t[0],t[1]],[t[0],t[3]],[t[2],t[3]],[t[2],t[1]],[t[0],t[1]]]]};return r}function Cl(e,t){return e/Math.pow(2,t)*360-180}function Al(e,t){var r=Math.PI-2*Math.PI*e/Math.pow(2,t);return Ng*Math.atan(.5*(Math.exp(r)-Math.exp(-r)))}function $a(e,t,r){var n=Dl(e,t,r);return n[0]=Math.floor(n[0]),n[1]=Math.floor(n[1]),n}function Ll(e){return[[e[0]*2,e[1]*2,e[2]+1],[e[0]*2+1,e[1]*2,e[2]+1],[e[0]*2+1,e[1]*2+1,e[2]+1],[e[0]*2,e[1]*2+1,e[2]+1]]}function Il(e){return e[0]%2===0&&e[1]%2===0?[e[0]/2,e[1]/2,e[2]-1]:e[0]%2===0&&!e[1]%2===0?[e[0]/2,(e[1]-1)/2,e[2]-1]:!e[0]%2===0&&e[1]%2===0?[(e[0]-1)/2,e[1]/2,e[2]-1]:[(e[0]-1)/2,(e[1]-1)/2,e[2]-1]}function Ol(e){return Ll(Il(e))}function Ug(e,t){for(var r=Ol(e),n=0;n<r.length;n++)if(!Bl(t,r[n]))return!1;return!0}function Bl(e,t){for(var r=0;r<e.length;r++)if(Rl(e[r],t))return!0;return!1}function Rl(e,t){return e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]}function qg(e){for(var t="",r=e[2];r>0;r--){var n=0,i=1<<r-1;e[0]&i&&n++,e[1]&i&&(n+=2),t+=n.toString()}return t}function Gg(e){for(var t=0,r=0,n=e.length,i=n;i>0;i--){var o=1<<i-1;switch(e[n-i]){case"0":break;case"1":t|=o;break;case"2":r|=o;break;case"3":t|=o,r|=o;break}}return[t,r,n]}function Vg(e){var t=$a(e[0],e[1],32),r=$a(e[2],e[3],32),n=[t[0],t[1],r[0],r[1]],i=$g(n);if(i===0)return[0,0,0];var o=n[0]>>>32-i,a=n[1]>>>32-i;return[o,a,i]}function $g(e){for(var t=28,r=0;r<t;r++){var n=1<<32-(r+1);if((e[0]&n)!=(e[2]&n)||(e[1]&n)!=(e[3]&n))return r}return t}function Dl(e,t,r){var n=Math.sin(t*Dg),i=Math.pow(2,r),o=i*(e/360+.5),a=i*(.5-.25*Math.log((1+n)/(1-n))/Math.PI);return[o,a,r]}var Zi={tileToGeoJSON:zg,tileToBBOX:Ml,getChildren:Ll,getParent:Il,getSiblings:Ol,hasTile:Bl,hasSiblings:Ug,tilesEqual:Rl,tileToQuadkey:qg,quadkeyToTile:Gg,pointToTile:$a,bboxToTile:Vg,pointToTileFraction:Dl},Hg=Zg;function Zg(e,t){var r,n,i=e.coordinates,o=t.max_zoom,a={},s=[];if(e.type==="Point")return[Zi.pointToTile(i[0],i[1],o)];if(e.type==="MultiPoint")for(r=0;r<i.length;r++)n=Zi.pointToTile(i[r][0],i[r][1],o),a[Ue(n[0],n[1],n[2])]=!0;else if(e.type==="LineString")Ha(a,i,o);else if(e.type==="MultiLineString")for(r=0;r<i.length;r++)Ha(a,i[r],o);else if(e.type==="Polygon")Pl(a,s,i,o);else if(e.type==="MultiPolygon")for(r=0;r<i.length;r++)Pl(a,s,i[r],o);else throw new Error("Geometry type not implemented");if(t.min_zoom!==o){var l=s.length;for(Fl(a,s),r=0;r<l;r++){var f=s[r];a[Ue(f[0],f[1],f[2])]=!0}return jg(a,s,t)}return Fl(a,s),s}function jg(e,t,r){for(var n=[],i=r.max_zoom;i>r.min_zoom;i--){for(var o={},a=[],s=0;s<t.length;s++){var l=t[s];if(l[0]%2===0&&l[1]%2===0){var f=Ue(l[0]+1,l[1],i),c=Ue(l[0],l[1]+1,i),u=Ue(l[0]+1,l[1]+1,i);if(e[f]&&e[c]&&e[u]){e[Ue(l[0],l[1],l[2])]=!1,e[f]=!1,e[c]=!1,e[u]=!1;var d=[l[0]/2,l[1]/2,i-1];i-1===r.min_zoom?n.push(d):(o[Ue(l[0]/2,l[1]/2,i-1)]=!0,a.push(d))}}}for(s=0;s<t.length;s++)l=t[s],e[Ue(l[0],l[1],l[2])]&&n.push(l);e=o,t=a}return n}function Pl(e,t,r,n){for(var i=[],o=0;o<r.length;o++){var a=[];Ha(e,r[o],n,a);for(var s=0,l=a.length,f=l-1;s<l;f=s++){var c=(s+1)%l,u=a[s][1];(u>a[f][1]||u>a[c][1])&&(u<a[f][1]||u<a[c][1])&&u!==a[c][1]&&i.push(a[s])}}for(i.sort(Wg),o=0;o<i.length;o+=2){u=i[o][1];for(var d=i[o][0]+1;d<i[o+1][0];d++){var h=Ue(d,u,n);e[h]||t.push([d,u,n])}}}function Wg(e,t){return e[1]-t[1]||e[0]-t[0]}function Ha(e,t,r,n){for(var i,o,a=0;a<t.length-1;a++){var s=Zi.pointToTileFraction(t[a][0],t[a][1],r),l=Zi.pointToTileFraction(t[a+1][0],t[a+1][1],r),f=s[0],c=s[1],u=l[0],d=l[1],h=u-f,g=d-c;if(!(g===0&&h===0)){var x=h>0?1:-1,S=g>0?1:-1,T=Math.floor(f),w=Math.floor(c),k=h===0?1/0:Math.abs(((h>0?1:0)+T-f)/h),I=g===0?1/0:Math.abs(((g>0?1:0)+w-c)/g),L=Math.abs(x/h),R=Math.abs(S/g);for((T!==i||w!==o)&&(e[Ue(T,w,r)]=!0,n&&w!==o&&n.push([T,w]),i=T,o=w);k<1||I<1;)k<I?(k+=L,T+=x):(I+=R,w+=S),e[Ue(T,w,r)]=!0,n&&w!==o&&n.push([T,w]),i=T,o=w}}n&&w===n[0][1]&&n.pop()}function Fl(e,t){for(var r=Object.keys(e),n=0;n<r.length;n++)t.push(Yg(+r[n]))}function Ue(e,t,r){var n=2*(1<<r);return(n*t+e)*32+r}function Yg(e){var t=e%32,r=2*(1<<t),n=(e-t)/32,i=n%r,o=(n-i)/r%r;return[i,o,t]}var Nl=[0x5555555555555555n,0x3333333333333333n,0x0f0f0f0f0f0f0f0fn,0x00ff00ff00ff00ffn,0x0000ffff0000ffffn,0x00000000ffffffffn],zl=[0n,1n,2n,4n,8n,16n],kl=512;function Kg(e){let{x:t,y:r,z:n}=Yt(e),i=kl/(1<<n);return[t*i,kl-r*i,i]}function Xg(e,t){let[r,n,i]=Kg(e);return[[r,n],[r+t*i,n-t*i]]}function Qg(e,t=1){let[r,n]=Xg(e,t),[i,o]=Fe(r),[a,s]=Fe(n);return[a,o,a,s,i,s,i,o,a,o]}function Ul(e){return BigInt(`0x${e}`)}function gn(e){return e.toString(16)}function mn(e){if(e.z<0||e.z>26)throw new Error("Wrong zoom");let t=BigInt(e.z),r=BigInt(e.x)<<32n-t,n=BigInt(e.y)<<32n-t;for(let o=0;o<5;o++){let a=zl[5-o],s=Nl[4-o];r=(r|r<<a)&s,n=(n|n<<a)&s}return 0x4000000000000000n|1n<<59n|t<<52n|(r|n<<1n)>>12n|0xfffffffffffffn>>t*2n}function Yt(e){let t=e>>59n&7n,r=e>>57n&3n,n=e>>52n&0x1fn,i=(e&0xfffffffffffffn)<<12n;if(t!==1n&&r!==0n)throw new Error("Wrong mode");let o=i,a=i>>1n;for(let s=0;s<6;s++){let l=zl[s],f=Nl[s];o=(o|o>>l)&f,a=(a|a>>l)&f}return o=o>>32n-n,a=a>>32n-n,{z:Number(n),x:Number(o),y:Number(a)}}function gt(e){return e>>52n&0x1fn}function ji(e){let t=gt(e)-1n;return e&~(0x1fn<<52n)|t<<52n|0xfffffffffffffn>>t*2n}function ql(e,t){let r=Number(t);return Hg(e,{min_zoom:r,max_zoom:r}).map(([n,i,o])=>mn({x:n,y:i,z:o}))}function Gl(e){let t=Qg(e);return{type:"Polygon",coordinates:[[[t[0],t[1]],[t[2],t[3]],[t[4],t[5]],[t[6],t[7]],[t[0],t[1]]]]}}var Yi=G(Kt(),1),Zl=G(Se(),1);var $l=G(Se(),1);function ke(e,t){$l.log.assert(e,t)}function Hl(e,t){let{properties:r,numericProps:n}=e;return new Proxy(r[t]||{},{get(i,o){return o in n?n[o].value[t]:i[o]},has(i,o){return o in n||o in i},ownKeys(i){return[...Object.keys(n),...Reflect.ownKeys(i)]},getOwnPropertyDescriptor(i,o){return{enumerable:!0,configurable:!0}}})}function Mt(e,t){return`https://unpkg.com/@deck.gl/carto@${t}/dist/${e}-worker.js`}var bn=new Uint16Array,Za={positions:{value:new Float32Array,size:2},properties:[],numericProps:{},featureIds:{value:bn,size:1},globalFeatureIds:{value:bn,size:1}};function Wi(){return{shape:"binary-feature-collection",points:{type:"Point",...Za},lines:{type:"LineString",pathIndices:{value:bn,size:1},...Za},polygons:{type:"Polygon",polygonIndices:{value:bn,size:1},primitivePolygonIndices:{value:bn,size:1},...Za}}}function yn(e,t,r,n,i,o=2){return{type:"Point",positions:{value:new Float32Array(e),size:o},featureIds:{value:new Uint16Array(t),size:1},globalFeatureIds:{value:new Uint32Array(r),size:1},numericProps:n,properties:i}}function ja(e,t){let r={};return t&&Object.keys(t).forEach(n=>{r[n]={value:new Float32Array(e),size:1}}),r}function Wa(e,t,r,n){Object.keys(e).forEach(i=>{t[i].value[n]=e[i].value[r]})}function jl(e,t,r,n=[],i,o,a="quadbin"){if(!e.content)return!1;e.userData||(e.userData={});let s=t.get(r)?.[0];if(s){if(n.every(f=>f.name in s))return!1;t.clear()}let l={};for(let f of e.content){let c=f.id,u=typeof i=="function"?i(f,{}):i;for(let S=0;S<r-1;S++)if(a==="h3"){let T=(0,Yi.getResolution)(c);c=(0,Yi.cellToParent)(c,Math.max(0,T-1))}else c=ji(c);let d=String(c);if(!(d in l)){l[d]={id:c,count:0,position:[0,0]};for(let{name:S,aggregation:T}of n)T==="any"?l[d][S]=f.properties[S]:l[d][S]=0}let h=l[d].count;l[d].count+=typeof o=="function"?o(f,{}):o;let g=l[d].count,x=g-h;l[d].position[0]=(h*l[d].position[0]+x*u[0])/g,l[d].position[1]=(h*l[d].position[1]+x*u[1])/g;for(let{name:S,aggregation:T}of n){let w=l[d][S],k=f.properties[S];T==="average"?l[d][S]=(h*w+x*k)/g:T==="count"||T==="sum"?l[d][S]=w+k:T==="max"?l[d][S]=Math.max(w,k):T==="min"&&(l[d][S]=Math.min(w,k))}}return t.set(r,Object.values(l)),!0}function Wl(e){let t=[],r=["any","average","count","min","max","sum"];for(let n of Object.keys(e.content[0].properties)){let i=n.split("_").pop().toLowerCase();r.includes(i)||(Zl.log.warn(`No valid aggregation present in ${n} property`)(),i="any"),t.push({name:n,aggregation:i})}return t}function Yl(e,t){let r={};for(let{name:n,aggregation:i}of t)if(r[n]={min:1/0,max:-1/0},i!=="any")for(let o of e)r[n].min=Math.min(r[n].min,o[n]),r[n].max=Math.max(r[n].max,o[n]);return r}function Kl(e){let t=new Float32Array(e.length*2),r=new Uint16Array(e.length);for(let n=0;n<e.length;n++)t.set(e[n].position,2*n),r[n]=n;return{...Wi(),points:yn(t,r,r,{},e)}}var Xl=G(pt(),1);var et=class extends Xl._Tileset2D{getTileIndices(t){return super.getTileIndices(t).map(mn).map(r=>({q:r,i:gn(r)}))}getTileId({q:t,i:r}){return r||gn(t)}getTileMetadata({q:t}){return super.getTileMetadata(Yt(t))}getTileZoom({q:t}){return Number(gt(t))}getParentIndex({q:t}){return{q:ji(t)}}};var Jl=G(pt(),1),ie=G(Kt(),1),Ql=85.051128;function ec({west:e,north:t,east:r,south:n},i,o=1){let l=[[t,r],[n,r],[n,e],[t,e]].map(u=>(0,ie.latLngToCell)(u[0],u[1],i)).map(u=>Math.max(...(0,ie.originToDirectedEdges)(u).map(d=>(0,ie.edgeLength)(d,ie.UNITS.rads)))*180/Math.PI),f=Math.max(...l)*o,c=Math.min(180,f/Math.cos((t+n)/2*Math.PI/180));return{north:Math.min(t+f,Ql),east:r+c,south:Math.max(n-f,-Ql),west:e-c}}function tc({west:e,north:t,east:r,south:n},i){let o=Math.abs(r-e);if(o>180){let s=Math.ceil(o/180),l=[];for(let f=0;f<s;f++){let c=e+f*180,u=Math.min(c+179.9999999,r);l=l.concat(tc({west:c,north:t,east:u,south:n},i))}return[...new Set(l)]}return(0,ie.polygonToCells)([[t,r],[n,r],[n,e],[t,e],[t,r]],i)}function Jg(e){let t=(0,ie.cellToBoundary)(e),r=t.map(f=>f[0]),n=t.map(f=>f[1]),i=Math.min(...n),o=Math.min(...r),a=Math.max(...n),s=Math.max(...r);return ec({west:i,south:o,east:a,north:s},(0,ie.getResolution)(e),.12)}var em=2;function Fr(e,t){let r=Math.log2(t/512),n=2/3*(e.zoom-r),i=Math.log(1/Math.cos(Math.PI*e.latitude/180));return Math.max(0,Math.floor(n+i-em))}var Lt=class extends Jl._Tileset2D{getTileIndices({viewport:t,minZoom:r,maxZoom:n}){if(t.latitude===void 0)return[];let[i,o,a,s]=t.getBounds(),{tileSize:l}=this.opts,f=Fr(t,l),c;if(typeof r=="number"&&Number.isFinite(r)&&f<r)return[];if(typeof n=="number"&&Number.isFinite(n)&&f>n){f=n;let u=(0,ie.latLngToCell)(t.latitude,t.longitude,n);c=(0,ie.gridDisk)(u,1)}else{let u=ec({west:i,north:s,east:a,south:o},f);c=tc(u,f)}return c.map(u=>({i:u}))}getTileId({i:t}){return t}getTileMetadata({i:t}){return{bbox:Jg(t)}}getTileZoom({i:t}){return(0,ie.getResolution)(t)}getParentIndex(t){let r=(0,ie.getResolution)(t.i);return{i:(0,ie.cellToParent)(t.i,r-1)}}};var rc=512;function Ya(e){let{x:t,y:r,z:n}=Yt(e),i=rc/(1<<n);return[t*i,rc-r*i,i]}function tm(e,t){let[r,n,i]=Ya(e);return[[r,n],[r+t*i,n-t*i]]}function Ki(e,t=1){let[r,n]=tm(e,t),[i,o]=Fe(r),[a,s]=Fe(n);return[a,o,a,s,i,s,i,o,a,o]}var xo=G(Kt(),1);var tt={self:typeof self<"u"&&self,window:typeof window<"u"&&window,global:typeof global<"u"&&global,document:typeof document<"u"&&document},rm=tt.self||tt.window||tt.global||{},nm=tt.window||tt.self||tt.global||{},im=tt.global||tt.self||tt.window||{},om=tt.document||{};var kr=Boolean(typeof process!="object"||String(process)!=="[object process]"||process.browser);var nc=typeof process<"u"&&process.version&&/v([0-9]*)/.exec(process.version),am=nc&&parseFloat(nc[1])||0;var ic=e=>typeof SharedArrayBuffer<"u"&&e instanceof SharedArrayBuffer;function Ka(e){globalThis.loaders||={},globalThis.loaders.modules||={},Object.assign(globalThis.loaders.modules,e)}function oc(...e){return sm(e)}function sm(e){let t=e.map(o=>o instanceof ArrayBuffer?new Uint8Array(o):o),r=t.reduce((o,a)=>o+a.byteLength,0),n=new Uint8Array(r),i=0;for(let o of t)n.set(o,i),i+=o.byteLength;return n.buffer}async function Xa(e){let t=[];for await(let r of e)t.push(fm(r));return oc(...t)}function fm(e){if(e instanceof ArrayBuffer)return e;if(ArrayBuffer.isView(e)){let{buffer:t,byteOffset:r,byteLength:n}=e;return ac(t,r,n)}return ac(e)}function ac(e,t=0,r=e.byteLength-t){let n=new Uint8Array(e,t,r),i=new Uint8Array(n.length);return i.set(n),i.buffer}function sc(e){return e&&typeof e=="object"&&e.isBuffer}function It(e){if(sc(e))return e;if(e instanceof ArrayBuffer)return e;if(ic(e))return fc(e);if(ArrayBuffer.isView(e)){let t=e.buffer;return e.byteOffset===0&&e.byteLength===e.buffer.byteLength?t:t.slice(e.byteOffset,e.byteOffset+e.byteLength)}if(typeof e=="string"){let t=e;return new TextEncoder().encode(t).buffer}if(e&&typeof e=="object"&&e._toArrayBuffer)return e._toArrayBuffer();throw new Error("toArrayBuffer")}function fc(e,t=0,r=e.byteLength-t){let n=new Uint8Array(e,t,r),i=new Uint8Array(n.length);return i.set(n),i.buffer}function Mr(e){return t=>new Promise((r,n)=>e(t,(i,o)=>i?n(i):r(o)))}var Xi=class{constructor(t){this.compressBatches=this.compressBatches.bind(this),this.decompressBatches=this.decompressBatches.bind(this)}async preload(t={}){Ka(t)}async compress(t){return await this.preload(),this.compressSync(t)}async decompress(t,r){return await this.preload(),this.decompressSync(t,r)}compressSync(t){throw new Error(`${this.name}: sync compression not supported`)}decompressSync(t,r){throw new Error(`${this.name}: sync decompression not supported`)}async*compressBatches(t){let r=await this.concatenate(t);yield this.compress(r)}async*decompressBatches(t){let r=await this.concatenate(t);yield this.decompress(r)}concatenate(t){return Xa(t)}improveError(t){return t.message.includes(this.name)||(t.message=`${this.name} ${t.message}`),t}};var or=G(Yu(),1),vt=G(Ku(),1),go=class extends Xi{name="deflate";extensions=[];contentEncodings=["deflate"];isSupported=!0;options;_chunks=[];constructor(t={}){super(t),this.options=t}async compress(t){if(!kr&&this.options.deflate?.useZlib){let r=this.options.deflate?.gzip?await Mr(vt.default.gzip)(t):await Mr(vt.default.deflate)(t);return It(r)}return this.compressSync(t)}async decompress(t){if(!kr&&this.options.deflate?.useZlib){let r=this.options.deflate?.gzip?await Mr(vt.default.gunzip)(t):await Mr(vt.default.inflate)(t);return It(r)}return this.decompressSync(t)}compressSync(t){if(!kr&&this.options.deflate?.useZlib){let o=this.options.deflate?.gzip?vt.default.gzipSync(t):vt.default.deflateSync(t);return It(o)}let r=this.options?.deflate||{},n=new Uint8Array(t),i=this.options?.raw?or.default.deflateRaw:or.default.deflate;return It(i(n,r).buffer)}decompressSync(t){if(!kr&&this.options.deflate?.useZlib){let o=this.options.deflate?.gzip?vt.default.gunzipSync(t):vt.default.inflateSync(t);return It(o)}let r=this.options?.deflate||{},n=new Uint8Array(t),i=this.options?.raw?or.default.inflateRaw:or.default.inflate;return It(i(n,r).buffer)}async*compressBatches(t){let r=this.options?.deflate||{},n=new or.default.Deflate(r);yield*this.transformBatches(n,t)}async*decompressBatches(t){let r=this.options?.deflate||{},n=new or.default.Inflate(r);yield*this.transformBatches(n,t)}async*transformBatches(t,r){t.onData=this._onData.bind(this),t.onEnd=this._onEnd.bind(this);for await(let a of r){let s=new Uint8Array(a);if(!t.push(s,!1))throw new Error(`${this._getError()}write`);yield*this._getChunks()}let n=new Uint8Array(0),i=t.push(n,!0);yield*this._getChunks()}_onData(t){this._chunks.push(t)}_onEnd(t){if(t!==0)throw new Error(this._getError(t)+this._chunks.length)}_getChunks(){let t=this._chunks;return this._chunks=[],t}_getError(t=0){let r={2:"need dictionary",1:"stream end",0:"","-1":"file error","-2":"stream error","-3":"data error","-4":"insufficient memory","-5":"buffer error","-6":"incompatible version"};return`${this.name}: ${r[t]}`}};var Bn=class extends go{name="gzip";extensions=["gz","gzip"];contentEncodings=["gzip","x-gzip"];isSupported=!0;constructor(t){super({...t,deflate:{...t?.gzip,gzip:!0}})}};function ar(e,t,r,n){let i=t.type===2?t.readVarint()+t.pos:t.pos+1,o=t.buf.buffer.slice(t.pos,i);if(n?.compression==="gzip"){let s=new Bn().decompressSync(o);r.value=new e(s)}else r.value=new e(o);return t.pos=i,r.value}var Rn=class{static read(t,r){return t.readFields(Rn._readField,{key:"",value:null},r)}static _readField(t,r,n){t===1?r.key=n.readString():t===2&&(r.value=n.readString())}},Ve=class{static read(t,r){return t.readFields(Ve._readField,{},r)}static _readField(t,r,n){if(t===1){let{key:i,value:o}=Rn.read(n,n.readVarint()+n.pos);r[i]=o}}},sr=class{static read(t,r){let{value:n,size:i}=t.readFields(sr._readField,{value:[],size:0},r);return{value:n,size:i}}static _readField(t,r,n){t===1?ar(Float64Array,n,r):t===2&&(r.size=n.readVarint(!0))}},ye=class{static read(t,r){let{value:n,size:i}=t.readFields(ye._readField,{value:[],size:0},r);return{value:new Uint32Array(n),size:i}}static _readField(t,r,n){t===1?n.readPackedVarint(r.value):t===2&&(r.size=n.readVarint(!0))}},fr=class{static read(t,r){return t.readFields(fr._readField,{id:0},r)}static _readField(t,r,n){t===1&&(r.id=n.readVarint())}},Dn=class{static read(t,r){return t.readFields(Dn._readField,{value:[]},r)}static _readField(t,r,n){t===1&&ar(Float64Array,n,r)}},$e=class{static read(t,r){return t.readFields($e._readField,{key:"",value:null},r)}static _readField(t,r,n){t===1?r.key=n.readString():t===2&&(r.value=Dn.read(n,n.readVarint()+n.pos))}},Nn=class{static read(t,r){return t.readFields(Nn._readField,{positions:null,globalFeatureIds:null,featureIds:null,properties:[],numericProps:{},fields:[]},r)}static _readField(t,r,n){if(t===1)r.positions=sr.read(n,n.readVarint()+n.pos);else if(t===2)r.globalFeatureIds=ye.read(n,n.readVarint()+n.pos);else if(t===3)r.featureIds=ye.read(n,n.readVarint()+n.pos);else if(t===4)r.properties.push(Ve.read(n,n.readVarint()+n.pos));else if(t===5){let i=$e.read(n,n.readVarint()+n.pos);r.numericProps[i.key]=i.value}else t===6&&r.fields.push(fr.read(n,n.readVarint()+n.pos))}},zn=class{static read(t,r){return t.readFields(zn._readField,{positions:null,pathIndices:null,globalFeatureIds:null,featureIds:null,properties:[],numericProps:{},fields:[]},r)}static _readField(t,r,n){if(t===1)r.positions=sr.read(n,n.readVarint()+n.pos);else if(t===2)r.pathIndices=ye.read(n,n.readVarint()+n.pos);else if(t===3)r.globalFeatureIds=ye.read(n,n.readVarint()+n.pos);else if(t===4)r.featureIds=ye.read(n,n.readVarint()+n.pos);else if(t===5)r.properties.push(Ve.read(n,n.readVarint()+n.pos));else if(t===6){let i=$e.read(n,n.readVarint()+n.pos);r.numericProps[i.key]=i.value}else t===7&&r.fields.push(fr.read(n,n.readVarint()+n.pos))}},Un=class{static read(t,r){return t.readFields(Un._readField,{positions:null,polygonIndices:null,globalFeatureIds:null,featureIds:null,primitivePolygonIndices:null,triangles:null,properties:[],numericProps:{},fields:[]},r)}static _readField(t,r,n){if(t===1)r.positions=sr.read(n,n.readVarint()+n.pos);else if(t===2)r.polygonIndices=ye.read(n,n.readVarint()+n.pos);else if(t===3)r.globalFeatureIds=ye.read(n,n.readVarint()+n.pos);else if(t===4)r.featureIds=ye.read(n,n.readVarint()+n.pos);else if(t===5)r.primitivePolygonIndices=ye.read(n,n.readVarint()+n.pos);else if(t===6)r.triangles=ye.read(n,n.readVarint()+n.pos);else if(t===7)r.properties.push(Ve.read(n,n.readVarint()+n.pos));else if(t===8){let i=$e.read(n,n.readVarint()+n.pos);r.numericProps[i.key]=i.value}else t===9&&r.fields.push(fr.read(n,n.readVarint()+n.pos))}},Gr=class{static read(t,r){return t.readFields(Gr._readField,{points:null,lines:null,polygons:null},r)}static _readField(t,r,n){t===1?r.points=Nn.read(n,n.readVarint()+n.pos):t===2?r.lines=zn.read(n,n.readVarint()+n.pos):t===3&&(r.polygons=Un.read(n,n.readVarint()+n.pos))}};var qn=class{static read(t,r){return t.readFields(qn._readField,{value:[]},r)}static _readField(t,r,n){t===1&&ar(BigUint64Array,n,r)}},Gn=class{static read(t,r){return t.readFields(Gn._readField,{indices:null,properties:[],numericProps:{}},r)}static _readField(t,r,n){if(t===1)r.indices=qn.read(n,n.readVarint()+n.pos);else if(t===2)r.properties.push(Ve.read(n,n.readVarint()+n.pos));else if(t===3){let i=$e.read(n,n.readVarint()+n.pos);r.numericProps[i.key]=i.value}}},Vr=class{static read(t,r){return t.readFields(Vr._readField,{scheme:0,cells:null},r)}static _readField(t,r,n){t===1?r.scheme=n.readVarint():t===2&&(r.cells=Gn.read(n,n.readVarint()+n.pos))}};var id=G(nd(),1);function Ut(e,t){let r=new id.default(e);return t.read(r)}function od(e){let{cells:t,scheme:r}=e,n=t.indices.value.length,i=[];for(let o=0;o<n;o++){let a=r==="h3"?gn(t.indices.value[o]):t.indices.value[o],s={...t.properties[o]};for(let l of Object.keys(t.numericProps))s[l]=t.numericProps[l].value[o];i.push({id:a,properties:s})}return i}var sd="9.3.9",fd="cartoSpatialTile",yb={cartoSpatialTile:{scheme:"quadbin",workerUrl:Mt(fd,sd)}},xb={name:"CARTO Spatial Tile",version:sd,id:fd,module:"carto",extensions:["pbf"],mimeTypes:["application/vnd.carto-spatial-tile"],category:"geometry",parse:async(e,t)=>ad(e,t),parseSync:ad,worker:!0,options:yb};function ad(e,t){if(!e)return null;let r=Ut(e,Vr),{cells:n}=r,i=t?.cartoSpatialTile?.scheme;return od({cells:n,scheme:i})}var yo=xb;var ld=G(Se(),1),cd=G(Se(),1);function He(e,t,r=0){if(!e)return t;if(!t)return e;if(r>10)return t;let n={...e};for(let i in t){let o=t[i];o===e||o===t||(typeof o=="object"&&o!==null?n[i]=He(e[i],o,r+1):n[i]=o)}return n}function ud(e,t){let r={};for(let{geoid:n,...i}of t.properties)n in r?ld.log.warn("Duplicate geoid key in boundary mapping, using first occurance")():r[n]=i;for(let n of["points","lines","polygons"]){let i=e[n];if(i.positions.value.length===0)continue;i.properties=i.properties.map(({geoid:f})=>r[f]);let{positions:o,globalFeatureIds:a}=i,s=null;n==="lines"&&(s=i.pathIndices.value),n==="polygons"&&(s=i.polygonIndices.value);let l=o.value.length/o.size;for(let f in t.numericProps){let c=t.numericProps[f].value,u=c.constructor,d=new u(l);if(i.numericProps[f]={value:d,size:1},s)for(let h=0;h<s.length-1;h++){let g=s[h],x=s[h+1],S=a.value[g];d.fill(c[S],g,x)}else for(let h=0;h<l;h++){let g=a.value[h];d[h]=c[g]}}}return e}var Ce={type:"object",value:null,validate:(e,t)=>t.optional&&e===null||typeof e=="object"&&Array.isArray(e.tiles)&&e.tiles.every(r=>typeof r=="string"),equal:(e,t)=>(0,cd._deepEqual)(e,t,2),async:!0};(0,gd.registerLoaders)([yo]);function dd(e){if(e===Lt)return"h3";if(e===et)return"quadbin";throw new Error("Invalid tileset class")}var md={data:Ce,clusterLevel:{type:"number",value:5,min:1},getPosition:{type:"accessor",value:({id:e})=>{if(typeof e=="string"){let[t,r]=(0,xo.cellToLatLng)(e);return[r,t]}return Ki(e,.5).slice(2,4)}},getWeight:{type:"accessor",value:1},refinementStrategy:"no-overlap",tileSize:512},$n=class extends pd.TileLayer{initializeState(){super.initializeState(),this.state.aggregationCache=new WeakMap,this.state.scheme=dd(this.props.TilesetClass)}updateState(t){let{props:r}=t,n=dd(r.TilesetClass);this.state.scheme!==n&&(this.setState({scheme:n,tileset:null}),this.state.aggregationCache=new WeakMap),super.updateState(t)}renderLayers(){let t=this.state.tileset?.tiles.filter(h=>h.isLoaded&&h.content&&this.state.tileset.isTileVisible(h));if(!t?.length||!this.state.tileset)return null;t.sort((h,g)=>g.zoom-h.zoom);let{getPosition:r,getWeight:n}=this.props,{aggregationCache:i,scheme:o}=this.state,a=o==="h3",s=Wl(t[0]),l=[],f=!1,c=this._getAggregationLevels(t);for(let h of t){let g=i.get(h.content);g||(g=new Map,i.set(h.content,g));let x=jl(h,g,c,s,r,n,a?"h3":"quadbin");f||(f=x),l.push(...g.get(c))}l.sort((h,g)=>Number(g.count-h.count));let u=l?.map(h=>h.id);if(f||(f=!(0,Vn._deepEqual)(u,this.state.clusterIds,1)),this.setState({clusterIds:u}),f){let h=Yl(l,s),g=Kl(l);g.points.attributes={stats:h},this.setState({data:g})}let d={...this.props,id:"clusters",data:this.state.data,dataComparator:(h,g)=>{let x=h?.points?.properties?.map(T=>T.id),S=g?.points?.properties?.map(T=>T.id);return(0,Vn._deepEqual)(x,S,1)}};return new hd.GeoJsonLayer(this.getSubLayerProps(d))}getPickingInfo(t){let r=t.info;if(r.index!==-1){let{data:n}=t.sourceLayer.props;r.object=Hi(n,{globalFeatureId:r.index})}return r}_updateAutoHighlight(t){for(let r of this.getSubLayers())r.updateAutoHighlight(t)}filterSubLayer(){return!0}_getAggregationLevels(t){let r=this.state.scheme==="h3",n=t[0],i,o;r?(i=(0,xo.getResolution)(n.id),o=Fr(this.context.viewport,this.state.tileset.opts.tileSize)):(i=n.zoom,o=this.context.viewport.zoom);let a=Math.round(o-i);return Math.round(this.props.clusterLevel)-a}};$n.layerName="ClusterGeoJsonLayer";$n.defaultProps=md;var Hn=class extends Vn.CompositeLayer{getLoadOptions(){let t=this.props.data,r=t&&"scheme"in t?t.scheme:"quadbin";return He(super.getLoadOptions(),{fetch:{headers:{Authorization:`Bearer ${t.accessToken}`}},cartoSpatialTile:{scheme:r}})}renderLayers(){let t=this.props.data;if(!t)return null;let{tiles:r,maxresolution:n}=t,o=t&&"scheme"in t&&t.scheme==="h3"?Lt:et;return[new $n(this.props,{id:`cluster-geojson-layer-${this.props.id}`,data:r,TilesetClass:o,maxZoom:n,loadOptions:this.getLoadOptions()})]}};Hn.layerName="ClusterTileLayer";Hn.defaultProps=md;var jn=Hn;var xd=G(Se(),1),Os=G(pt(),1);var bd=G(pn(),1);var yd=G(pt(),1);(0,bd.registerLoaders)([yo]);function vb(e){return e!=null&&e!==""}var wb={tileSize:512},Wn=class extends yd.TileLayer{_updateAutoHighlight(t){let{hoveredFeatureId:r}=this.state,n=t.object,i=null;if(n&&(i=n.id),r!==i){let{highlightColor:o}=this.props;typeof o=="function"&&(o=o(t)),this.setState({highlightColor:o,hoveredFeatureId:i})}}getSubLayerPropsByTile(t){return{highlightedObjectIndex:this.getHighlightedObjectIndex(t),highlightColor:this.state.highlightColor}}getHighlightedObjectIndex(t){let{hoveredFeatureId:r}=this.state,n=t.content;return!vb(r)||!Array.isArray(n)||!this._featureInTile(t,r)?-1:n.findIndex(o=>o.id===r)}_featureInTile(t,r){let n=this.state.tileset,i=n.getTileZoom(t.index),o=t.index.q?"q":"i",a={[o]:r},s=n.getTileZoom(a);for(;!(s<=i);)a=n.getParentIndex(a),s=n.getTileZoom(a);return a[o]===t.index[o]}};Wn.layerName="SpatialIndexTileLayer";Wn.defaultProps=wb;var Zr=Wn;var _b=e=>{let{data:t}=e,{index:r}=e.tile;return!t||!t.length?null:new Os.H3HexagonLayer(e,{getHexagon:n=>n.id,centerHexagon:r,highPrecision:!0})},Eb={data:Ce,tileSize:512},Yn=class extends xd.CompositeLayer{initializeState(){Os.H3HexagonLayer._checkH3Lib()}getLoadOptions(){let t=this.props.data;return He(super.getLoadOptions(),{fetch:{headers:{Authorization:`Bearer ${t.accessToken}`}},cartoSpatialTile:{scheme:"h3"}})}renderLayers(){let t=this.props.data;if(!t)return null;let{tiles:r}=t,{minresolution:n,maxresolution:i}=t;this.props.minZoom&&(n=Math.max(n,Fr({zoom:this.props.minZoom,latitude:0},this.props.tileSize))),this.props.maxZoom&&(i=Math.min(i,Fr({zoom:this.props.maxZoom,latitude:0},this.props.tileSize)));let o=this.getSubLayerClass("spatial-index-tile",Zr);return new o(this.props,{id:`h3-tile-layer-${this.props.id}`,data:r,TilesetClass:Lt,renderSubLayers:_b,minZoom:n,maxZoom:i,loadOptions:this.getLoadOptions()})}};Yn.layerName="H3TileLayer";Yn.defaultProps=Eb;var lr=Yn;var To=G(Kt(),1),Co=G(Se(),1),Ed=G(kt(),1);var Sb=`layout(std140) uniform heatmapUniforms {
|
|
7
|
+
"use strict";var __exports__=(()=>{var sg=Object.create;var Gi=Object.defineProperty;var fg=Object.getOwnPropertyDescriptor;var lg=Object.getOwnPropertyNames;var cg=Object.getPrototypeOf,ug=Object.prototype.hasOwnProperty;var X=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),Ga=(e,t)=>{for(var r in t)Gi(e,r,{get:t[r],enumerable:!0})},qi=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of lg(t))!ug.call(e,i)&&i!==r&&Gi(e,i,{get:()=>t[i],enumerable:!(n=fg(t,i))||n.enumerable});return e},Je=(e,t,r)=>(qi(e,t,"default"),r&&qi(r,t,"default")),G=(e,t,r)=>(r=e!=null?sg(cg(e)):{},qi(t||!e||!e.__esModule?Gi(r,"default",{value:e,enumerable:!0}):r,e)),dg=e=>qi(Gi({},"__esModule",{value:!0}),e);var kt=X((C_,gl)=>{gl.exports=globalThis.deck});var pt=X((A_,ml)=>{ml.exports=globalThis.deck});var pn=X((P_,bl)=>{bl.exports=globalThis.loaders});var Se=X((O_,wl)=>{wl.exports=globalThis.deck});var Kt=X((C3,Vl)=>{Vl.exports=globalThis.h3||{}});var mt=X(pe=>{"use strict";var lm=typeof Uint8Array<"u"&&typeof Uint16Array<"u"&&typeof Int32Array<"u";function cm(e,t){return Object.prototype.hasOwnProperty.call(e,t)}pe.assign=function(e){for(var t=Array.prototype.slice.call(arguments,1);t.length;){var r=t.shift();if(r){if(typeof r!="object")throw new TypeError(r+"must be non-object");for(var n in r)cm(r,n)&&(e[n]=r[n])}}return e};pe.shrinkBuf=function(e,t){return e.length===t?e:e.subarray?e.subarray(0,t):(e.length=t,e)};var um={arraySet:function(e,t,r,n,i){if(t.subarray&&e.subarray){e.set(t.subarray(r,r+n),i);return}for(var o=0;o<n;o++)e[i+o]=t[r+o]},flattenChunks:function(e){var t,r,n,i,o,a;for(n=0,t=0,r=e.length;t<r;t++)n+=e[t].length;for(a=new Uint8Array(n),i=0,t=0,r=e.length;t<r;t++)o=e[t],a.set(o,i),i+=o.length;return a}},dm={arraySet:function(e,t,r,n,i){for(var o=0;o<n;o++)e[i+o]=t[r+o]},flattenChunks:function(e){return[].concat.apply([],e)}};pe.setTyped=function(e){e?(pe.Buf8=Uint8Array,pe.Buf16=Uint16Array,pe.Buf32=Int32Array,pe.assign(pe,um)):(pe.Buf8=Array,pe.Buf16=Array,pe.Buf32=Array,pe.assign(pe,dm))};pe.setTyped(lm)});var Mc=X(Or=>{"use strict";var hm=mt(),pm=4,lc=0,cc=1,gm=2;function Ir(e){for(var t=e.length;--t>=0;)e[t]=0}var mm=0,mc=1,bm=2,ym=3,xm=258,is=29,Sn=256,vn=Sn+1+is,Lr=30,os=19,bc=2*vn+1,Xt=15,Qa=16,vm=7,as=256,yc=16,xc=17,vc=18,rs=[0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0],Qi=[0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13],wm=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7],wc=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],_m=512,bt=new Array((vn+2)*2);Ir(bt);var xn=new Array(Lr*2);Ir(xn);var wn=new Array(_m);Ir(wn);var _n=new Array(xm-ym+1);Ir(_n);var ss=new Array(is);Ir(ss);var Ji=new Array(Lr);Ir(Ji);function Ja(e,t,r,n,i){this.static_tree=e,this.extra_bits=t,this.extra_base=r,this.elems=n,this.max_length=i,this.has_stree=e&&e.length}var _c,Ec,Sc;function es(e,t){this.dyn_tree=e,this.max_code=0,this.stat_desc=t}function Tc(e){return e<256?wn[e]:wn[256+(e>>>7)]}function En(e,t){e.pending_buf[e.pending++]=t&255,e.pending_buf[e.pending++]=t>>>8&255}function be(e,t,r){e.bi_valid>Qa-r?(e.bi_buf|=t<<e.bi_valid&65535,En(e,e.bi_buf),e.bi_buf=t>>Qa-e.bi_valid,e.bi_valid+=r-Qa):(e.bi_buf|=t<<e.bi_valid&65535,e.bi_valid+=r)}function rt(e,t,r){be(e,r[t*2],r[t*2+1])}function Cc(e,t){var r=0;do r|=e&1,e>>>=1,r<<=1;while(--t>0);return r>>>1}function Em(e){e.bi_valid===16?(En(e,e.bi_buf),e.bi_buf=0,e.bi_valid=0):e.bi_valid>=8&&(e.pending_buf[e.pending++]=e.bi_buf&255,e.bi_buf>>=8,e.bi_valid-=8)}function Sm(e,t){var r=t.dyn_tree,n=t.max_code,i=t.stat_desc.static_tree,o=t.stat_desc.has_stree,a=t.stat_desc.extra_bits,s=t.stat_desc.extra_base,l=t.stat_desc.max_length,f,c,u,d,h,g,x=0;for(d=0;d<=Xt;d++)e.bl_count[d]=0;for(r[e.heap[e.heap_max]*2+1]=0,f=e.heap_max+1;f<bc;f++)c=e.heap[f],d=r[r[c*2+1]*2+1]+1,d>l&&(d=l,x++),r[c*2+1]=d,!(c>n)&&(e.bl_count[d]++,h=0,c>=s&&(h=a[c-s]),g=r[c*2],e.opt_len+=g*(d+h),o&&(e.static_len+=g*(i[c*2+1]+h)));if(x!==0){do{for(d=l-1;e.bl_count[d]===0;)d--;e.bl_count[d]--,e.bl_count[d+1]+=2,e.bl_count[l]--,x-=2}while(x>0);for(d=l;d!==0;d--)for(c=e.bl_count[d];c!==0;)u=e.heap[--f],!(u>n)&&(r[u*2+1]!==d&&(e.opt_len+=(d-r[u*2+1])*r[u*2],r[u*2+1]=d),c--)}}function Ac(e,t,r){var n=new Array(Xt+1),i=0,o,a;for(o=1;o<=Xt;o++)n[o]=i=i+r[o-1]<<1;for(a=0;a<=t;a++){var s=e[a*2+1];s!==0&&(e[a*2]=Cc(n[s]++,s))}}function Tm(){var e,t,r,n,i,o=new Array(Xt+1);for(r=0,n=0;n<is-1;n++)for(ss[n]=r,e=0;e<1<<rs[n];e++)_n[r++]=n;for(_n[r-1]=n,i=0,n=0;n<16;n++)for(Ji[n]=i,e=0;e<1<<Qi[n];e++)wn[i++]=n;for(i>>=7;n<Lr;n++)for(Ji[n]=i<<7,e=0;e<1<<Qi[n]-7;e++)wn[256+i++]=n;for(t=0;t<=Xt;t++)o[t]=0;for(e=0;e<=143;)bt[e*2+1]=8,e++,o[8]++;for(;e<=255;)bt[e*2+1]=9,e++,o[9]++;for(;e<=279;)bt[e*2+1]=7,e++,o[7]++;for(;e<=287;)bt[e*2+1]=8,e++,o[8]++;for(Ac(bt,vn+1,o),e=0;e<Lr;e++)xn[e*2+1]=5,xn[e*2]=Cc(e,5);_c=new Ja(bt,rs,Sn+1,vn,Xt),Ec=new Ja(xn,Qi,0,Lr,Xt),Sc=new Ja(new Array(0),wm,0,os,vm)}function Pc(e){var t;for(t=0;t<vn;t++)e.dyn_ltree[t*2]=0;for(t=0;t<Lr;t++)e.dyn_dtree[t*2]=0;for(t=0;t<os;t++)e.bl_tree[t*2]=0;e.dyn_ltree[as*2]=1,e.opt_len=e.static_len=0,e.last_lit=e.matches=0}function Fc(e){e.bi_valid>8?En(e,e.bi_buf):e.bi_valid>0&&(e.pending_buf[e.pending++]=e.bi_buf),e.bi_buf=0,e.bi_valid=0}function Cm(e,t,r,n){Fc(e),n&&(En(e,r),En(e,~r)),hm.arraySet(e.pending_buf,e.window,t,r,e.pending),e.pending+=r}function uc(e,t,r,n){var i=t*2,o=r*2;return e[i]<e[o]||e[i]===e[o]&&n[t]<=n[r]}function ts(e,t,r){for(var n=e.heap[r],i=r<<1;i<=e.heap_len&&(i<e.heap_len&&uc(t,e.heap[i+1],e.heap[i],e.depth)&&i++,!uc(t,n,e.heap[i],e.depth));)e.heap[r]=e.heap[i],r=i,i<<=1;e.heap[r]=n}function dc(e,t,r){var n,i,o=0,a,s;if(e.last_lit!==0)do n=e.pending_buf[e.d_buf+o*2]<<8|e.pending_buf[e.d_buf+o*2+1],i=e.pending_buf[e.l_buf+o],o++,n===0?rt(e,i,t):(a=_n[i],rt(e,a+Sn+1,t),s=rs[a],s!==0&&(i-=ss[a],be(e,i,s)),n--,a=Tc(n),rt(e,a,r),s=Qi[a],s!==0&&(n-=Ji[a],be(e,n,s)));while(o<e.last_lit);rt(e,as,t)}function ns(e,t){var r=t.dyn_tree,n=t.stat_desc.static_tree,i=t.stat_desc.has_stree,o=t.stat_desc.elems,a,s,l=-1,f;for(e.heap_len=0,e.heap_max=bc,a=0;a<o;a++)r[a*2]!==0?(e.heap[++e.heap_len]=l=a,e.depth[a]=0):r[a*2+1]=0;for(;e.heap_len<2;)f=e.heap[++e.heap_len]=l<2?++l:0,r[f*2]=1,e.depth[f]=0,e.opt_len--,i&&(e.static_len-=n[f*2+1]);for(t.max_code=l,a=e.heap_len>>1;a>=1;a--)ts(e,r,a);f=o;do a=e.heap[1],e.heap[1]=e.heap[e.heap_len--],ts(e,r,1),s=e.heap[1],e.heap[--e.heap_max]=a,e.heap[--e.heap_max]=s,r[f*2]=r[a*2]+r[s*2],e.depth[f]=(e.depth[a]>=e.depth[s]?e.depth[a]:e.depth[s])+1,r[a*2+1]=r[s*2+1]=f,e.heap[1]=f++,ts(e,r,1);while(e.heap_len>=2);e.heap[--e.heap_max]=e.heap[1],Sm(e,t),Ac(r,l,e.bl_count)}function hc(e,t,r){var n,i=-1,o,a=t[0*2+1],s=0,l=7,f=4;for(a===0&&(l=138,f=3),t[(r+1)*2+1]=65535,n=0;n<=r;n++)o=a,a=t[(n+1)*2+1],!(++s<l&&o===a)&&(s<f?e.bl_tree[o*2]+=s:o!==0?(o!==i&&e.bl_tree[o*2]++,e.bl_tree[yc*2]++):s<=10?e.bl_tree[xc*2]++:e.bl_tree[vc*2]++,s=0,i=o,a===0?(l=138,f=3):o===a?(l=6,f=3):(l=7,f=4))}function pc(e,t,r){var n,i=-1,o,a=t[0*2+1],s=0,l=7,f=4;for(a===0&&(l=138,f=3),n=0;n<=r;n++)if(o=a,a=t[(n+1)*2+1],!(++s<l&&o===a)){if(s<f)do rt(e,o,e.bl_tree);while(--s!==0);else o!==0?(o!==i&&(rt(e,o,e.bl_tree),s--),rt(e,yc,e.bl_tree),be(e,s-3,2)):s<=10?(rt(e,xc,e.bl_tree),be(e,s-3,3)):(rt(e,vc,e.bl_tree),be(e,s-11,7));s=0,i=o,a===0?(l=138,f=3):o===a?(l=6,f=3):(l=7,f=4)}}function Am(e){var t;for(hc(e,e.dyn_ltree,e.l_desc.max_code),hc(e,e.dyn_dtree,e.d_desc.max_code),ns(e,e.bl_desc),t=os-1;t>=3&&e.bl_tree[wc[t]*2+1]===0;t--);return e.opt_len+=3*(t+1)+5+5+4,t}function Pm(e,t,r,n){var i;for(be(e,t-257,5),be(e,r-1,5),be(e,n-4,4),i=0;i<n;i++)be(e,e.bl_tree[wc[i]*2+1],3);pc(e,e.dyn_ltree,t-1),pc(e,e.dyn_dtree,r-1)}function Fm(e){var t=4093624447,r;for(r=0;r<=31;r++,t>>>=1)if(t&1&&e.dyn_ltree[r*2]!==0)return lc;if(e.dyn_ltree[9*2]!==0||e.dyn_ltree[10*2]!==0||e.dyn_ltree[13*2]!==0)return cc;for(r=32;r<Sn;r++)if(e.dyn_ltree[r*2]!==0)return cc;return lc}var gc=!1;function km(e){gc||(Tm(),gc=!0),e.l_desc=new es(e.dyn_ltree,_c),e.d_desc=new es(e.dyn_dtree,Ec),e.bl_desc=new es(e.bl_tree,Sc),e.bi_buf=0,e.bi_valid=0,Pc(e)}function kc(e,t,r,n){be(e,(mm<<1)+(n?1:0),3),Cm(e,t,r,!0)}function Mm(e){be(e,mc<<1,3),rt(e,as,bt),Em(e)}function Lm(e,t,r,n){var i,o,a=0;e.level>0?(e.strm.data_type===gm&&(e.strm.data_type=Fm(e)),ns(e,e.l_desc),ns(e,e.d_desc),a=Am(e),i=e.opt_len+3+7>>>3,o=e.static_len+3+7>>>3,o<=i&&(i=o)):i=o=r+5,r+4<=i&&t!==-1?kc(e,t,r,n):e.strategy===pm||o===i?(be(e,(mc<<1)+(n?1:0),3),dc(e,bt,xn)):(be(e,(bm<<1)+(n?1:0),3),Pm(e,e.l_desc.max_code+1,e.d_desc.max_code+1,a+1),dc(e,e.dyn_ltree,e.dyn_dtree)),Pc(e),n&&Fc(e)}function Im(e,t,r){return e.pending_buf[e.d_buf+e.last_lit*2]=t>>>8&255,e.pending_buf[e.d_buf+e.last_lit*2+1]=t&255,e.pending_buf[e.l_buf+e.last_lit]=r&255,e.last_lit++,t===0?e.dyn_ltree[r*2]++:(e.matches++,t--,e.dyn_ltree[(_n[r]+Sn+1)*2]++,e.dyn_dtree[Tc(t)*2]++),e.last_lit===e.lit_bufsize-1}Or._tr_init=km;Or._tr_stored_block=kc;Or._tr_flush_block=Lm;Or._tr_tally=Im;Or._tr_align=Mm});var fs=X((l5,Lc)=>{"use strict";function Om(e,t,r,n){for(var i=e&65535|0,o=e>>>16&65535|0,a=0;r!==0;){a=r>2e3?2e3:r,r-=a;do i=i+t[n++]|0,o=o+i|0;while(--a);i%=65521,o%=65521}return i|o<<16|0}Lc.exports=Om});var ls=X((c5,Ic)=>{"use strict";function Bm(){for(var e,t=[],r=0;r<256;r++){e=r;for(var n=0;n<8;n++)e=e&1?3988292384^e>>>1:e>>>1;t[r]=e}return t}var Rm=Bm();function Dm(e,t,r,n){var i=Rm,o=n+r;e^=-1;for(var a=n;a<o;a++)e=e>>>8^i[(e^t[a])&255];return e^-1}Ic.exports=Dm});var eo=X((u5,Oc)=>{"use strict";Oc.exports={2:"need dictionary",1:"stream end",0:"","-1":"file error","-2":"stream error","-3":"data error","-4":"insufficient memory","-5":"buffer error","-6":"incompatible version"}});var Vc=X(ot=>{"use strict";var ge=mt(),Me=Mc(),Nc=fs(),Ot=ls(),Nm=eo(),tr=0,zm=1,Um=3,zt=4,Bc=5,it=0,Rc=1,Le=-2,qm=-3,cs=-5,Gm=-1,Vm=1,to=2,$m=3,Hm=4,Zm=0,jm=2,oo=8,Wm=9,Ym=15,Km=8,Xm=29,Qm=256,ds=Qm+1+Xm,Jm=30,e1=19,t1=2*ds+1,r1=15,$=3,Dt=258,qe=Dt+$+1,n1=32,ao=42,hs=69,ro=73,no=91,io=103,Qt=113,Cn=666,se=1,An=2,Jt=3,Dr=4,i1=3;function Nt(e,t){return e.msg=Nm[t],t}function Dc(e){return(e<<1)-(e>4?9:0)}function Rt(e){for(var t=e.length;--t>=0;)e[t]=0}function Bt(e){var t=e.state,r=t.pending;r>e.avail_out&&(r=e.avail_out),r!==0&&(ge.arraySet(e.output,t.pending_buf,t.pending_out,r,e.next_out),e.next_out+=r,t.pending_out+=r,e.total_out+=r,e.avail_out-=r,t.pending-=r,t.pending===0&&(t.pending_out=0))}function le(e,t){Me._tr_flush_block(e,e.block_start>=0?e.block_start:-1,e.strstart-e.block_start,t),e.block_start=e.strstart,Bt(e.strm)}function j(e,t){e.pending_buf[e.pending++]=t}function Tn(e,t){e.pending_buf[e.pending++]=t>>>8&255,e.pending_buf[e.pending++]=t&255}function o1(e,t,r,n){var i=e.avail_in;return i>n&&(i=n),i===0?0:(e.avail_in-=i,ge.arraySet(t,e.input,e.next_in,i,r),e.state.wrap===1?e.adler=Nc(e.adler,t,i,r):e.state.wrap===2&&(e.adler=Ot(e.adler,t,i,r)),e.next_in+=i,e.total_in+=i,i)}function zc(e,t){var r=e.max_chain_length,n=e.strstart,i,o,a=e.prev_length,s=e.nice_match,l=e.strstart>e.w_size-qe?e.strstart-(e.w_size-qe):0,f=e.window,c=e.w_mask,u=e.prev,d=e.strstart+Dt,h=f[n+a-1],g=f[n+a];e.prev_length>=e.good_match&&(r>>=2),s>e.lookahead&&(s=e.lookahead);do if(i=t,!(f[i+a]!==g||f[i+a-1]!==h||f[i]!==f[n]||f[++i]!==f[n+1])){n+=2,i++;do;while(f[++n]===f[++i]&&f[++n]===f[++i]&&f[++n]===f[++i]&&f[++n]===f[++i]&&f[++n]===f[++i]&&f[++n]===f[++i]&&f[++n]===f[++i]&&f[++n]===f[++i]&&n<d);if(o=Dt-(d-n),n=d-Dt,o>a){if(e.match_start=t,a=o,o>=s)break;h=f[n+a-1],g=f[n+a]}}while((t=u[t&c])>l&&--r!==0);return a<=e.lookahead?a:e.lookahead}function er(e){var t=e.w_size,r,n,i,o,a;do{if(o=e.window_size-e.lookahead-e.strstart,e.strstart>=t+(t-qe)){ge.arraySet(e.window,e.window,t,t,0),e.match_start-=t,e.strstart-=t,e.block_start-=t,n=e.hash_size,r=n;do i=e.head[--r],e.head[r]=i>=t?i-t:0;while(--n);n=t,r=n;do i=e.prev[--r],e.prev[r]=i>=t?i-t:0;while(--n);o+=t}if(e.strm.avail_in===0)break;if(n=o1(e.strm,e.window,e.strstart+e.lookahead,o),e.lookahead+=n,e.lookahead+e.insert>=$)for(a=e.strstart-e.insert,e.ins_h=e.window[a],e.ins_h=(e.ins_h<<e.hash_shift^e.window[a+1])&e.hash_mask;e.insert&&(e.ins_h=(e.ins_h<<e.hash_shift^e.window[a+$-1])&e.hash_mask,e.prev[a&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=a,a++,e.insert--,!(e.lookahead+e.insert<$)););}while(e.lookahead<qe&&e.strm.avail_in!==0)}function a1(e,t){var r=65535;for(r>e.pending_buf_size-5&&(r=e.pending_buf_size-5);;){if(e.lookahead<=1){if(er(e),e.lookahead===0&&t===tr)return se;if(e.lookahead===0)break}e.strstart+=e.lookahead,e.lookahead=0;var n=e.block_start+r;if((e.strstart===0||e.strstart>=n)&&(e.lookahead=e.strstart-n,e.strstart=n,le(e,!1),e.strm.avail_out===0)||e.strstart-e.block_start>=e.w_size-qe&&(le(e,!1),e.strm.avail_out===0))return se}return e.insert=0,t===zt?(le(e,!0),e.strm.avail_out===0?Jt:Dr):(e.strstart>e.block_start&&(le(e,!1),e.strm.avail_out===0),se)}function us(e,t){for(var r,n;;){if(e.lookahead<qe){if(er(e),e.lookahead<qe&&t===tr)return se;if(e.lookahead===0)break}if(r=0,e.lookahead>=$&&(e.ins_h=(e.ins_h<<e.hash_shift^e.window[e.strstart+$-1])&e.hash_mask,r=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart),r!==0&&e.strstart-r<=e.w_size-qe&&(e.match_length=zc(e,r)),e.match_length>=$)if(n=Me._tr_tally(e,e.strstart-e.match_start,e.match_length-$),e.lookahead-=e.match_length,e.match_length<=e.max_lazy_match&&e.lookahead>=$){e.match_length--;do e.strstart++,e.ins_h=(e.ins_h<<e.hash_shift^e.window[e.strstart+$-1])&e.hash_mask,r=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart;while(--e.match_length!==0);e.strstart++}else e.strstart+=e.match_length,e.match_length=0,e.ins_h=e.window[e.strstart],e.ins_h=(e.ins_h<<e.hash_shift^e.window[e.strstart+1])&e.hash_mask;else n=Me._tr_tally(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++;if(n&&(le(e,!1),e.strm.avail_out===0))return se}return e.insert=e.strstart<$-1?e.strstart:$-1,t===zt?(le(e,!0),e.strm.avail_out===0?Jt:Dr):e.last_lit&&(le(e,!1),e.strm.avail_out===0)?se:An}function Br(e,t){for(var r,n,i;;){if(e.lookahead<qe){if(er(e),e.lookahead<qe&&t===tr)return se;if(e.lookahead===0)break}if(r=0,e.lookahead>=$&&(e.ins_h=(e.ins_h<<e.hash_shift^e.window[e.strstart+$-1])&e.hash_mask,r=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart),e.prev_length=e.match_length,e.prev_match=e.match_start,e.match_length=$-1,r!==0&&e.prev_length<e.max_lazy_match&&e.strstart-r<=e.w_size-qe&&(e.match_length=zc(e,r),e.match_length<=5&&(e.strategy===Vm||e.match_length===$&&e.strstart-e.match_start>4096)&&(e.match_length=$-1)),e.prev_length>=$&&e.match_length<=e.prev_length){i=e.strstart+e.lookahead-$,n=Me._tr_tally(e,e.strstart-1-e.prev_match,e.prev_length-$),e.lookahead-=e.prev_length-1,e.prev_length-=2;do++e.strstart<=i&&(e.ins_h=(e.ins_h<<e.hash_shift^e.window[e.strstart+$-1])&e.hash_mask,r=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart);while(--e.prev_length!==0);if(e.match_available=0,e.match_length=$-1,e.strstart++,n&&(le(e,!1),e.strm.avail_out===0))return se}else if(e.match_available){if(n=Me._tr_tally(e,0,e.window[e.strstart-1]),n&&le(e,!1),e.strstart++,e.lookahead--,e.strm.avail_out===0)return se}else e.match_available=1,e.strstart++,e.lookahead--}return e.match_available&&(n=Me._tr_tally(e,0,e.window[e.strstart-1]),e.match_available=0),e.insert=e.strstart<$-1?e.strstart:$-1,t===zt?(le(e,!0),e.strm.avail_out===0?Jt:Dr):e.last_lit&&(le(e,!1),e.strm.avail_out===0)?se:An}function s1(e,t){for(var r,n,i,o,a=e.window;;){if(e.lookahead<=Dt){if(er(e),e.lookahead<=Dt&&t===tr)return se;if(e.lookahead===0)break}if(e.match_length=0,e.lookahead>=$&&e.strstart>0&&(i=e.strstart-1,n=a[i],n===a[++i]&&n===a[++i]&&n===a[++i])){o=e.strstart+Dt;do;while(n===a[++i]&&n===a[++i]&&n===a[++i]&&n===a[++i]&&n===a[++i]&&n===a[++i]&&n===a[++i]&&n===a[++i]&&i<o);e.match_length=Dt-(o-i),e.match_length>e.lookahead&&(e.match_length=e.lookahead)}if(e.match_length>=$?(r=Me._tr_tally(e,1,e.match_length-$),e.lookahead-=e.match_length,e.strstart+=e.match_length,e.match_length=0):(r=Me._tr_tally(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++),r&&(le(e,!1),e.strm.avail_out===0))return se}return e.insert=0,t===zt?(le(e,!0),e.strm.avail_out===0?Jt:Dr):e.last_lit&&(le(e,!1),e.strm.avail_out===0)?se:An}function f1(e,t){for(var r;;){if(e.lookahead===0&&(er(e),e.lookahead===0)){if(t===tr)return se;break}if(e.match_length=0,r=Me._tr_tally(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++,r&&(le(e,!1),e.strm.avail_out===0))return se}return e.insert=0,t===zt?(le(e,!0),e.strm.avail_out===0?Jt:Dr):e.last_lit&&(le(e,!1),e.strm.avail_out===0)?se:An}function nt(e,t,r,n,i){this.good_length=e,this.max_lazy=t,this.nice_length=r,this.max_chain=n,this.func=i}var Rr;Rr=[new nt(0,0,0,0,a1),new nt(4,4,8,4,us),new nt(4,5,16,8,us),new nt(4,6,32,32,us),new nt(4,4,16,16,Br),new nt(8,16,32,32,Br),new nt(8,16,128,128,Br),new nt(8,32,128,256,Br),new nt(32,128,258,1024,Br),new nt(32,258,258,4096,Br)];function l1(e){e.window_size=2*e.w_size,Rt(e.head),e.max_lazy_match=Rr[e.level].max_lazy,e.good_match=Rr[e.level].good_length,e.nice_match=Rr[e.level].nice_length,e.max_chain_length=Rr[e.level].max_chain,e.strstart=0,e.block_start=0,e.lookahead=0,e.insert=0,e.match_length=e.prev_length=$-1,e.match_available=0,e.ins_h=0}function c1(){this.strm=null,this.status=0,this.pending_buf=null,this.pending_buf_size=0,this.pending_out=0,this.pending=0,this.wrap=0,this.gzhead=null,this.gzindex=0,this.method=oo,this.last_flush=-1,this.w_size=0,this.w_bits=0,this.w_mask=0,this.window=null,this.window_size=0,this.prev=null,this.head=null,this.ins_h=0,this.hash_size=0,this.hash_bits=0,this.hash_mask=0,this.hash_shift=0,this.block_start=0,this.match_length=0,this.prev_match=0,this.match_available=0,this.strstart=0,this.match_start=0,this.lookahead=0,this.prev_length=0,this.max_chain_length=0,this.max_lazy_match=0,this.level=0,this.strategy=0,this.good_match=0,this.nice_match=0,this.dyn_ltree=new ge.Buf16(t1*2),this.dyn_dtree=new ge.Buf16((2*Jm+1)*2),this.bl_tree=new ge.Buf16((2*e1+1)*2),Rt(this.dyn_ltree),Rt(this.dyn_dtree),Rt(this.bl_tree),this.l_desc=null,this.d_desc=null,this.bl_desc=null,this.bl_count=new ge.Buf16(r1+1),this.heap=new ge.Buf16(2*ds+1),Rt(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new ge.Buf16(2*ds+1),Rt(this.depth),this.l_buf=0,this.lit_bufsize=0,this.last_lit=0,this.d_buf=0,this.opt_len=0,this.static_len=0,this.matches=0,this.insert=0,this.bi_buf=0,this.bi_valid=0}function Uc(e){var t;return!e||!e.state?Nt(e,Le):(e.total_in=e.total_out=0,e.data_type=jm,t=e.state,t.pending=0,t.pending_out=0,t.wrap<0&&(t.wrap=-t.wrap),t.status=t.wrap?ao:Qt,e.adler=t.wrap===2?0:1,t.last_flush=tr,Me._tr_init(t),it)}function qc(e){var t=Uc(e);return t===it&&l1(e.state),t}function u1(e,t){return!e||!e.state||e.state.wrap!==2?Le:(e.state.gzhead=t,it)}function Gc(e,t,r,n,i,o){if(!e)return Le;var a=1;if(t===Gm&&(t=6),n<0?(a=0,n=-n):n>15&&(a=2,n-=16),i<1||i>Wm||r!==oo||n<8||n>15||t<0||t>9||o<0||o>Hm)return Nt(e,Le);n===8&&(n=9);var s=new c1;return e.state=s,s.strm=e,s.wrap=a,s.gzhead=null,s.w_bits=n,s.w_size=1<<s.w_bits,s.w_mask=s.w_size-1,s.hash_bits=i+7,s.hash_size=1<<s.hash_bits,s.hash_mask=s.hash_size-1,s.hash_shift=~~((s.hash_bits+$-1)/$),s.window=new ge.Buf8(s.w_size*2),s.head=new ge.Buf16(s.hash_size),s.prev=new ge.Buf16(s.w_size),s.lit_bufsize=1<<i+6,s.pending_buf_size=s.lit_bufsize*4,s.pending_buf=new ge.Buf8(s.pending_buf_size),s.d_buf=1*s.lit_bufsize,s.l_buf=(1+2)*s.lit_bufsize,s.level=t,s.strategy=o,s.method=r,qc(e)}function d1(e,t){return Gc(e,t,oo,Ym,Km,Zm)}function h1(e,t){var r,n,i,o;if(!e||!e.state||t>Bc||t<0)return e?Nt(e,Le):Le;if(n=e.state,!e.output||!e.input&&e.avail_in!==0||n.status===Cn&&t!==zt)return Nt(e,e.avail_out===0?cs:Le);if(n.strm=e,r=n.last_flush,n.last_flush=t,n.status===ao)if(n.wrap===2)e.adler=0,j(n,31),j(n,139),j(n,8),n.gzhead?(j(n,(n.gzhead.text?1:0)+(n.gzhead.hcrc?2:0)+(n.gzhead.extra?4:0)+(n.gzhead.name?8:0)+(n.gzhead.comment?16:0)),j(n,n.gzhead.time&255),j(n,n.gzhead.time>>8&255),j(n,n.gzhead.time>>16&255),j(n,n.gzhead.time>>24&255),j(n,n.level===9?2:n.strategy>=to||n.level<2?4:0),j(n,n.gzhead.os&255),n.gzhead.extra&&n.gzhead.extra.length&&(j(n,n.gzhead.extra.length&255),j(n,n.gzhead.extra.length>>8&255)),n.gzhead.hcrc&&(e.adler=Ot(e.adler,n.pending_buf,n.pending,0)),n.gzindex=0,n.status=hs):(j(n,0),j(n,0),j(n,0),j(n,0),j(n,0),j(n,n.level===9?2:n.strategy>=to||n.level<2?4:0),j(n,i1),n.status=Qt);else{var a=oo+(n.w_bits-8<<4)<<8,s=-1;n.strategy>=to||n.level<2?s=0:n.level<6?s=1:n.level===6?s=2:s=3,a|=s<<6,n.strstart!==0&&(a|=n1),a+=31-a%31,n.status=Qt,Tn(n,a),n.strstart!==0&&(Tn(n,e.adler>>>16),Tn(n,e.adler&65535)),e.adler=1}if(n.status===hs)if(n.gzhead.extra){for(i=n.pending;n.gzindex<(n.gzhead.extra.length&65535)&&!(n.pending===n.pending_buf_size&&(n.gzhead.hcrc&&n.pending>i&&(e.adler=Ot(e.adler,n.pending_buf,n.pending-i,i)),Bt(e),i=n.pending,n.pending===n.pending_buf_size));)j(n,n.gzhead.extra[n.gzindex]&255),n.gzindex++;n.gzhead.hcrc&&n.pending>i&&(e.adler=Ot(e.adler,n.pending_buf,n.pending-i,i)),n.gzindex===n.gzhead.extra.length&&(n.gzindex=0,n.status=ro)}else n.status=ro;if(n.status===ro)if(n.gzhead.name){i=n.pending;do{if(n.pending===n.pending_buf_size&&(n.gzhead.hcrc&&n.pending>i&&(e.adler=Ot(e.adler,n.pending_buf,n.pending-i,i)),Bt(e),i=n.pending,n.pending===n.pending_buf_size)){o=1;break}n.gzindex<n.gzhead.name.length?o=n.gzhead.name.charCodeAt(n.gzindex++)&255:o=0,j(n,o)}while(o!==0);n.gzhead.hcrc&&n.pending>i&&(e.adler=Ot(e.adler,n.pending_buf,n.pending-i,i)),o===0&&(n.gzindex=0,n.status=no)}else n.status=no;if(n.status===no)if(n.gzhead.comment){i=n.pending;do{if(n.pending===n.pending_buf_size&&(n.gzhead.hcrc&&n.pending>i&&(e.adler=Ot(e.adler,n.pending_buf,n.pending-i,i)),Bt(e),i=n.pending,n.pending===n.pending_buf_size)){o=1;break}n.gzindex<n.gzhead.comment.length?o=n.gzhead.comment.charCodeAt(n.gzindex++)&255:o=0,j(n,o)}while(o!==0);n.gzhead.hcrc&&n.pending>i&&(e.adler=Ot(e.adler,n.pending_buf,n.pending-i,i)),o===0&&(n.status=io)}else n.status=io;if(n.status===io&&(n.gzhead.hcrc?(n.pending+2>n.pending_buf_size&&Bt(e),n.pending+2<=n.pending_buf_size&&(j(n,e.adler&255),j(n,e.adler>>8&255),e.adler=0,n.status=Qt)):n.status=Qt),n.pending!==0){if(Bt(e),e.avail_out===0)return n.last_flush=-1,it}else if(e.avail_in===0&&Dc(t)<=Dc(r)&&t!==zt)return Nt(e,cs);if(n.status===Cn&&e.avail_in!==0)return Nt(e,cs);if(e.avail_in!==0||n.lookahead!==0||t!==tr&&n.status!==Cn){var l=n.strategy===to?f1(n,t):n.strategy===$m?s1(n,t):Rr[n.level].func(n,t);if((l===Jt||l===Dr)&&(n.status=Cn),l===se||l===Jt)return e.avail_out===0&&(n.last_flush=-1),it;if(l===An&&(t===zm?Me._tr_align(n):t!==Bc&&(Me._tr_stored_block(n,0,0,!1),t===Um&&(Rt(n.head),n.lookahead===0&&(n.strstart=0,n.block_start=0,n.insert=0))),Bt(e),e.avail_out===0))return n.last_flush=-1,it}return t!==zt?it:n.wrap<=0?Rc:(n.wrap===2?(j(n,e.adler&255),j(n,e.adler>>8&255),j(n,e.adler>>16&255),j(n,e.adler>>24&255),j(n,e.total_in&255),j(n,e.total_in>>8&255),j(n,e.total_in>>16&255),j(n,e.total_in>>24&255)):(Tn(n,e.adler>>>16),Tn(n,e.adler&65535)),Bt(e),n.wrap>0&&(n.wrap=-n.wrap),n.pending!==0?it:Rc)}function p1(e){var t;return!e||!e.state?Le:(t=e.state.status,t!==ao&&t!==hs&&t!==ro&&t!==no&&t!==io&&t!==Qt&&t!==Cn?Nt(e,Le):(e.state=null,t===Qt?Nt(e,qm):it))}function g1(e,t){var r=t.length,n,i,o,a,s,l,f,c;if(!e||!e.state||(n=e.state,a=n.wrap,a===2||a===1&&n.status!==ao||n.lookahead))return Le;for(a===1&&(e.adler=Nc(e.adler,t,r,0)),n.wrap=0,r>=n.w_size&&(a===0&&(Rt(n.head),n.strstart=0,n.block_start=0,n.insert=0),c=new ge.Buf8(n.w_size),ge.arraySet(c,t,r-n.w_size,n.w_size,0),t=c,r=n.w_size),s=e.avail_in,l=e.next_in,f=e.input,e.avail_in=r,e.next_in=0,e.input=t,er(n);n.lookahead>=$;){i=n.strstart,o=n.lookahead-($-1);do n.ins_h=(n.ins_h<<n.hash_shift^n.window[i+$-1])&n.hash_mask,n.prev[i&n.w_mask]=n.head[n.ins_h],n.head[n.ins_h]=i,i++;while(--o);n.strstart=i,n.lookahead=$-1,er(n)}return n.strstart+=n.lookahead,n.block_start=n.strstart,n.insert=n.lookahead,n.lookahead=0,n.match_length=n.prev_length=$-1,n.match_available=0,e.next_in=l,e.input=f,e.avail_in=s,n.wrap=a,it}ot.deflateInit=d1;ot.deflateInit2=Gc;ot.deflateReset=qc;ot.deflateResetKeep=Uc;ot.deflateSetHeader=u1;ot.deflate=h1;ot.deflateEnd=p1;ot.deflateSetDictionary=g1;ot.deflateInfo="pako deflate (from Nodeca project)"});var ps=X(Nr=>{"use strict";var so=mt(),$c=!0,Hc=!0;try{String.fromCharCode.apply(null,[0])}catch{$c=!1}try{String.fromCharCode.apply(null,new Uint8Array(1))}catch{Hc=!1}var Pn=new so.Buf8(256);for(yt=0;yt<256;yt++)Pn[yt]=yt>=252?6:yt>=248?5:yt>=240?4:yt>=224?3:yt>=192?2:1;var yt;Pn[254]=Pn[254]=1;Nr.string2buf=function(e){var t,r,n,i,o,a=e.length,s=0;for(i=0;i<a;i++)r=e.charCodeAt(i),(r&64512)===55296&&i+1<a&&(n=e.charCodeAt(i+1),(n&64512)===56320&&(r=65536+(r-55296<<10)+(n-56320),i++)),s+=r<128?1:r<2048?2:r<65536?3:4;for(t=new so.Buf8(s),o=0,i=0;o<s;i++)r=e.charCodeAt(i),(r&64512)===55296&&i+1<a&&(n=e.charCodeAt(i+1),(n&64512)===56320&&(r=65536+(r-55296<<10)+(n-56320),i++)),r<128?t[o++]=r:r<2048?(t[o++]=192|r>>>6,t[o++]=128|r&63):r<65536?(t[o++]=224|r>>>12,t[o++]=128|r>>>6&63,t[o++]=128|r&63):(t[o++]=240|r>>>18,t[o++]=128|r>>>12&63,t[o++]=128|r>>>6&63,t[o++]=128|r&63);return t};function Zc(e,t){if(t<65534&&(e.subarray&&Hc||!e.subarray&&$c))return String.fromCharCode.apply(null,so.shrinkBuf(e,t));for(var r="",n=0;n<t;n++)r+=String.fromCharCode(e[n]);return r}Nr.buf2binstring=function(e){return Zc(e,e.length)};Nr.binstring2buf=function(e){for(var t=new so.Buf8(e.length),r=0,n=t.length;r<n;r++)t[r]=e.charCodeAt(r);return t};Nr.buf2string=function(e,t){var r,n,i,o,a=t||e.length,s=new Array(a*2);for(n=0,r=0;r<a;){if(i=e[r++],i<128){s[n++]=i;continue}if(o=Pn[i],o>4){s[n++]=65533,r+=o-1;continue}for(i&=o===2?31:o===3?15:7;o>1&&r<a;)i=i<<6|e[r++]&63,o--;if(o>1){s[n++]=65533;continue}i<65536?s[n++]=i:(i-=65536,s[n++]=55296|i>>10&1023,s[n++]=56320|i&1023)}return Zc(s,n)};Nr.utf8border=function(e,t){var r;for(t=t||e.length,t>e.length&&(t=e.length),r=t-1;r>=0&&(e[r]&192)===128;)r--;return r<0||r===0?t:r+Pn[e[r]]>t?r:t}});var gs=X((p5,jc)=>{"use strict";function m1(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0}jc.exports=m1});var Xc=X(Mn=>{"use strict";var Fn=Vc(),kn=mt(),bs=ps(),ys=eo(),b1=gs(),Kc=Object.prototype.toString,y1=0,ms=4,zr=0,Wc=1,Yc=2,x1=-1,v1=0,w1=8;function rr(e){if(!(this instanceof rr))return new rr(e);this.options=kn.assign({level:x1,method:w1,chunkSize:16384,windowBits:15,memLevel:8,strategy:v1,to:""},e||{});var t=this.options;t.raw&&t.windowBits>0?t.windowBits=-t.windowBits:t.gzip&&t.windowBits>0&&t.windowBits<16&&(t.windowBits+=16),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new b1,this.strm.avail_out=0;var r=Fn.deflateInit2(this.strm,t.level,t.method,t.windowBits,t.memLevel,t.strategy);if(r!==zr)throw new Error(ys[r]);if(t.header&&Fn.deflateSetHeader(this.strm,t.header),t.dictionary){var n;if(typeof t.dictionary=="string"?n=bs.string2buf(t.dictionary):Kc.call(t.dictionary)==="[object ArrayBuffer]"?n=new Uint8Array(t.dictionary):n=t.dictionary,r=Fn.deflateSetDictionary(this.strm,n),r!==zr)throw new Error(ys[r]);this._dict_set=!0}}rr.prototype.push=function(e,t){var r=this.strm,n=this.options.chunkSize,i,o;if(this.ended)return!1;o=t===~~t?t:t===!0?ms:y1,typeof e=="string"?r.input=bs.string2buf(e):Kc.call(e)==="[object ArrayBuffer]"?r.input=new Uint8Array(e):r.input=e,r.next_in=0,r.avail_in=r.input.length;do{if(r.avail_out===0&&(r.output=new kn.Buf8(n),r.next_out=0,r.avail_out=n),i=Fn.deflate(r,o),i!==Wc&&i!==zr)return this.onEnd(i),this.ended=!0,!1;(r.avail_out===0||r.avail_in===0&&(o===ms||o===Yc))&&(this.options.to==="string"?this.onData(bs.buf2binstring(kn.shrinkBuf(r.output,r.next_out))):this.onData(kn.shrinkBuf(r.output,r.next_out)))}while((r.avail_in>0||r.avail_out===0)&&i!==Wc);return o===ms?(i=Fn.deflateEnd(this.strm),this.onEnd(i),this.ended=!0,i===zr):(o===Yc&&(this.onEnd(zr),r.avail_out=0),!0)};rr.prototype.onData=function(e){this.chunks.push(e)};rr.prototype.onEnd=function(e){e===zr&&(this.options.to==="string"?this.result=this.chunks.join(""):this.result=kn.flattenChunks(this.chunks)),this.chunks=[],this.err=e,this.msg=this.strm.msg};function xs(e,t){var r=new rr(t);if(r.push(e,!0),r.err)throw r.msg||ys[r.err];return r.result}function _1(e,t){return t=t||{},t.raw=!0,xs(e,t)}function E1(e,t){return t=t||{},t.gzip=!0,xs(e,t)}Mn.Deflate=rr;Mn.deflate=xs;Mn.deflateRaw=_1;Mn.gzip=E1});var Jc=X((m5,Qc)=>{"use strict";var fo=30,S1=12;Qc.exports=function(t,r){var n,i,o,a,s,l,f,c,u,d,h,g,x,S,T,w,k,I,L,R,N,p,m,b,y;n=t.state,i=t.next_in,b=t.input,o=i+(t.avail_in-5),a=t.next_out,y=t.output,s=a-(r-t.avail_out),l=a+(t.avail_out-257),f=n.dmax,c=n.wsize,u=n.whave,d=n.wnext,h=n.window,g=n.hold,x=n.bits,S=n.lencode,T=n.distcode,w=(1<<n.lenbits)-1,k=(1<<n.distbits)-1;e:do{x<15&&(g+=b[i++]<<x,x+=8,g+=b[i++]<<x,x+=8),I=S[g&w];t:for(;;){if(L=I>>>24,g>>>=L,x-=L,L=I>>>16&255,L===0)y[a++]=I&65535;else if(L&16){R=I&65535,L&=15,L&&(x<L&&(g+=b[i++]<<x,x+=8),R+=g&(1<<L)-1,g>>>=L,x-=L),x<15&&(g+=b[i++]<<x,x+=8,g+=b[i++]<<x,x+=8),I=T[g&k];r:for(;;){if(L=I>>>24,g>>>=L,x-=L,L=I>>>16&255,L&16){if(N=I&65535,L&=15,x<L&&(g+=b[i++]<<x,x+=8,x<L&&(g+=b[i++]<<x,x+=8)),N+=g&(1<<L)-1,N>f){t.msg="invalid distance too far back",n.mode=fo;break e}if(g>>>=L,x-=L,L=a-s,N>L){if(L=N-L,L>u&&n.sane){t.msg="invalid distance too far back",n.mode=fo;break e}if(p=0,m=h,d===0){if(p+=c-L,L<R){R-=L;do y[a++]=h[p++];while(--L);p=a-N,m=y}}else if(d<L){if(p+=c+d-L,L-=d,L<R){R-=L;do y[a++]=h[p++];while(--L);if(p=0,d<R){L=d,R-=L;do y[a++]=h[p++];while(--L);p=a-N,m=y}}}else if(p+=d-L,L<R){R-=L;do y[a++]=h[p++];while(--L);p=a-N,m=y}for(;R>2;)y[a++]=m[p++],y[a++]=m[p++],y[a++]=m[p++],R-=3;R&&(y[a++]=m[p++],R>1&&(y[a++]=m[p++]))}else{p=a-N;do y[a++]=y[p++],y[a++]=y[p++],y[a++]=y[p++],R-=3;while(R>2);R&&(y[a++]=y[p++],R>1&&(y[a++]=y[p++]))}}else if(L&64){t.msg="invalid distance code",n.mode=fo;break e}else{I=T[(I&65535)+(g&(1<<L)-1)];continue r}break}}else if(L&64)if(L&32){n.mode=S1;break e}else{t.msg="invalid literal/length code",n.mode=fo;break e}else{I=S[(I&65535)+(g&(1<<L)-1)];continue t}break}}while(i<o&&a<l);R=x>>3,i-=R,x-=R<<3,g&=(1<<x)-1,t.next_in=i,t.next_out=a,t.avail_in=i<o?5+(o-i):5-(i-o),t.avail_out=a<l?257+(l-a):257-(a-l),n.hold=g,n.bits=x}});var au=X((b5,ou)=>{"use strict";var eu=mt(),Ur=15,tu=852,ru=592,nu=0,vs=1,iu=2,T1=[3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,0,0],C1=[16,16,16,16,16,16,16,16,17,17,17,17,18,18,18,18,19,19,19,19,20,20,20,20,21,21,21,21,16,72,78],A1=[1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577,0,0],P1=[16,16,16,16,17,17,18,18,19,19,20,20,21,21,22,22,23,23,24,24,25,25,26,26,27,27,28,28,29,29,64,64];ou.exports=function(t,r,n,i,o,a,s,l){var f=l.bits,c=0,u=0,d=0,h=0,g=0,x=0,S=0,T=0,w=0,k=0,I,L,R,N,p,m=null,b=0,y,v=new eu.Buf16(Ur+1),E=new eu.Buf16(Ur+1),F=null,_=0,C,P,A;for(c=0;c<=Ur;c++)v[c]=0;for(u=0;u<i;u++)v[r[n+u]]++;for(g=f,h=Ur;h>=1&&v[h]===0;h--);if(g>h&&(g=h),h===0)return o[a++]=1<<24|64<<16|0,o[a++]=1<<24|64<<16|0,l.bits=1,0;for(d=1;d<h&&v[d]===0;d++);for(g<d&&(g=d),T=1,c=1;c<=Ur;c++)if(T<<=1,T-=v[c],T<0)return-1;if(T>0&&(t===nu||h!==1))return-1;for(E[1]=0,c=1;c<Ur;c++)E[c+1]=E[c]+v[c];for(u=0;u<i;u++)r[n+u]!==0&&(s[E[r[n+u]]++]=u);if(t===nu?(m=F=s,y=19):t===vs?(m=T1,b-=257,F=C1,_-=257,y=256):(m=A1,F=P1,y=-1),k=0,u=0,c=d,p=a,x=g,S=0,R=-1,w=1<<g,N=w-1,t===vs&&w>tu||t===iu&&w>ru)return 1;for(;;){C=c-S,s[u]<y?(P=0,A=s[u]):s[u]>y?(P=F[_+s[u]],A=m[b+s[u]]):(P=32+64,A=0),I=1<<c-S,L=1<<x,d=L;do L-=I,o[p+(k>>S)+L]=C<<24|P<<16|A|0;while(L!==0);for(I=1<<c-1;k&I;)I>>=1;if(I!==0?(k&=I-1,k+=I):k=0,u++,--v[c]===0){if(c===h)break;c=r[n+s[u]]}if(c>g&&(k&N)!==R){for(S===0&&(S=g),p+=d,x=c-S,T=1<<x;x+S<h&&(T-=v[x+S],!(T<=0));)x++,T<<=1;if(w+=1<<x,t===vs&&w>tu||t===iu&&w>ru)return 1;R=k&N,o[R]=g<<24|x<<16|p-a|0}}return k!==0&&(o[p+k]=c-S<<24|64<<16|0),l.bits=g,0}});var qu=X(Ge=>{"use strict";var Te=mt(),Cs=fs(),at=ls(),F1=Jc(),Ln=au(),k1=0,Lu=1,Iu=2,su=4,M1=5,lo=6,nr=0,L1=1,I1=2,Ie=-2,Ou=-3,As=-4,O1=-5,fu=8,Bu=1,lu=2,cu=3,uu=4,du=5,hu=6,pu=7,gu=8,mu=9,bu=10,ho=11,xt=12,ws=13,yu=14,_s=15,xu=16,vu=17,wu=18,_u=19,co=20,uo=21,Eu=22,Su=23,Tu=24,Cu=25,Au=26,Es=27,Pu=28,Fu=29,Q=30,Ps=31,B1=32,R1=852,D1=592,N1=15,z1=N1;function ku(e){return(e>>>24&255)+(e>>>8&65280)+((e&65280)<<8)+((e&255)<<24)}function U1(){this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new Te.Buf16(320),this.work=new Te.Buf16(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}function Ru(e){var t;return!e||!e.state?Ie:(t=e.state,e.total_in=e.total_out=t.total=0,e.msg="",t.wrap&&(e.adler=t.wrap&1),t.mode=Bu,t.last=0,t.havedict=0,t.dmax=32768,t.head=null,t.hold=0,t.bits=0,t.lencode=t.lendyn=new Te.Buf32(R1),t.distcode=t.distdyn=new Te.Buf32(D1),t.sane=1,t.back=-1,nr)}function Du(e){var t;return!e||!e.state?Ie:(t=e.state,t.wsize=0,t.whave=0,t.wnext=0,Ru(e))}function Nu(e,t){var r,n;return!e||!e.state||(n=e.state,t<0?(r=0,t=-t):(r=(t>>4)+1,t<48&&(t&=15)),t&&(t<8||t>15))?Ie:(n.window!==null&&n.wbits!==t&&(n.window=null),n.wrap=r,n.wbits=t,Du(e))}function zu(e,t){var r,n;return e?(n=new U1,e.state=n,n.window=null,r=Nu(e,t),r!==nr&&(e.state=null),r):Ie}function q1(e){return zu(e,z1)}var Mu=!0,Ss,Ts;function G1(e){if(Mu){var t;for(Ss=new Te.Buf32(512),Ts=new Te.Buf32(32),t=0;t<144;)e.lens[t++]=8;for(;t<256;)e.lens[t++]=9;for(;t<280;)e.lens[t++]=7;for(;t<288;)e.lens[t++]=8;for(Ln(Lu,e.lens,0,288,Ss,0,e.work,{bits:9}),t=0;t<32;)e.lens[t++]=5;Ln(Iu,e.lens,0,32,Ts,0,e.work,{bits:5}),Mu=!1}e.lencode=Ss,e.lenbits=9,e.distcode=Ts,e.distbits=5}function Uu(e,t,r,n){var i,o=e.state;return o.window===null&&(o.wsize=1<<o.wbits,o.wnext=0,o.whave=0,o.window=new Te.Buf8(o.wsize)),n>=o.wsize?(Te.arraySet(o.window,t,r-o.wsize,o.wsize,0),o.wnext=0,o.whave=o.wsize):(i=o.wsize-o.wnext,i>n&&(i=n),Te.arraySet(o.window,t,r-n,i,o.wnext),n-=i,n?(Te.arraySet(o.window,t,r-n,n,0),o.wnext=n,o.whave=o.wsize):(o.wnext+=i,o.wnext===o.wsize&&(o.wnext=0),o.whave<o.wsize&&(o.whave+=i))),0}function V1(e,t){var r,n,i,o,a,s,l,f,c,u,d,h,g,x,S=0,T,w,k,I,L,R,N,p,m=new Te.Buf8(4),b,y,v=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15];if(!e||!e.state||!e.output||!e.input&&e.avail_in!==0)return Ie;r=e.state,r.mode===xt&&(r.mode=ws),a=e.next_out,i=e.output,l=e.avail_out,o=e.next_in,n=e.input,s=e.avail_in,f=r.hold,c=r.bits,u=s,d=l,p=nr;e:for(;;)switch(r.mode){case Bu:if(r.wrap===0){r.mode=ws;break}for(;c<16;){if(s===0)break e;s--,f+=n[o++]<<c,c+=8}if(r.wrap&2&&f===35615){r.check=0,m[0]=f&255,m[1]=f>>>8&255,r.check=at(r.check,m,2,0),f=0,c=0,r.mode=lu;break}if(r.flags=0,r.head&&(r.head.done=!1),!(r.wrap&1)||(((f&255)<<8)+(f>>8))%31){e.msg="incorrect header check",r.mode=Q;break}if((f&15)!==fu){e.msg="unknown compression method",r.mode=Q;break}if(f>>>=4,c-=4,N=(f&15)+8,r.wbits===0)r.wbits=N;else if(N>r.wbits){e.msg="invalid window size",r.mode=Q;break}r.dmax=1<<N,e.adler=r.check=1,r.mode=f&512?bu:xt,f=0,c=0;break;case lu:for(;c<16;){if(s===0)break e;s--,f+=n[o++]<<c,c+=8}if(r.flags=f,(r.flags&255)!==fu){e.msg="unknown compression method",r.mode=Q;break}if(r.flags&57344){e.msg="unknown header flags set",r.mode=Q;break}r.head&&(r.head.text=f>>8&1),r.flags&512&&(m[0]=f&255,m[1]=f>>>8&255,r.check=at(r.check,m,2,0)),f=0,c=0,r.mode=cu;case cu:for(;c<32;){if(s===0)break e;s--,f+=n[o++]<<c,c+=8}r.head&&(r.head.time=f),r.flags&512&&(m[0]=f&255,m[1]=f>>>8&255,m[2]=f>>>16&255,m[3]=f>>>24&255,r.check=at(r.check,m,4,0)),f=0,c=0,r.mode=uu;case uu:for(;c<16;){if(s===0)break e;s--,f+=n[o++]<<c,c+=8}r.head&&(r.head.xflags=f&255,r.head.os=f>>8),r.flags&512&&(m[0]=f&255,m[1]=f>>>8&255,r.check=at(r.check,m,2,0)),f=0,c=0,r.mode=du;case du:if(r.flags&1024){for(;c<16;){if(s===0)break e;s--,f+=n[o++]<<c,c+=8}r.length=f,r.head&&(r.head.extra_len=f),r.flags&512&&(m[0]=f&255,m[1]=f>>>8&255,r.check=at(r.check,m,2,0)),f=0,c=0}else r.head&&(r.head.extra=null);r.mode=hu;case hu:if(r.flags&1024&&(h=r.length,h>s&&(h=s),h&&(r.head&&(N=r.head.extra_len-r.length,r.head.extra||(r.head.extra=new Array(r.head.extra_len)),Te.arraySet(r.head.extra,n,o,h,N)),r.flags&512&&(r.check=at(r.check,n,h,o)),s-=h,o+=h,r.length-=h),r.length))break e;r.length=0,r.mode=pu;case pu:if(r.flags&2048){if(s===0)break e;h=0;do N=n[o+h++],r.head&&N&&r.length<65536&&(r.head.name+=String.fromCharCode(N));while(N&&h<s);if(r.flags&512&&(r.check=at(r.check,n,h,o)),s-=h,o+=h,N)break e}else r.head&&(r.head.name=null);r.length=0,r.mode=gu;case gu:if(r.flags&4096){if(s===0)break e;h=0;do N=n[o+h++],r.head&&N&&r.length<65536&&(r.head.comment+=String.fromCharCode(N));while(N&&h<s);if(r.flags&512&&(r.check=at(r.check,n,h,o)),s-=h,o+=h,N)break e}else r.head&&(r.head.comment=null);r.mode=mu;case mu:if(r.flags&512){for(;c<16;){if(s===0)break e;s--,f+=n[o++]<<c,c+=8}if(f!==(r.check&65535)){e.msg="header crc mismatch",r.mode=Q;break}f=0,c=0}r.head&&(r.head.hcrc=r.flags>>9&1,r.head.done=!0),e.adler=r.check=0,r.mode=xt;break;case bu:for(;c<32;){if(s===0)break e;s--,f+=n[o++]<<c,c+=8}e.adler=r.check=ku(f),f=0,c=0,r.mode=ho;case ho:if(r.havedict===0)return e.next_out=a,e.avail_out=l,e.next_in=o,e.avail_in=s,r.hold=f,r.bits=c,I1;e.adler=r.check=1,r.mode=xt;case xt:if(t===M1||t===lo)break e;case ws:if(r.last){f>>>=c&7,c-=c&7,r.mode=Es;break}for(;c<3;){if(s===0)break e;s--,f+=n[o++]<<c,c+=8}switch(r.last=f&1,f>>>=1,c-=1,f&3){case 0:r.mode=yu;break;case 1:if(G1(r),r.mode=co,t===lo){f>>>=2,c-=2;break e}break;case 2:r.mode=vu;break;case 3:e.msg="invalid block type",r.mode=Q}f>>>=2,c-=2;break;case yu:for(f>>>=c&7,c-=c&7;c<32;){if(s===0)break e;s--,f+=n[o++]<<c,c+=8}if((f&65535)!==(f>>>16^65535)){e.msg="invalid stored block lengths",r.mode=Q;break}if(r.length=f&65535,f=0,c=0,r.mode=_s,t===lo)break e;case _s:r.mode=xu;case xu:if(h=r.length,h){if(h>s&&(h=s),h>l&&(h=l),h===0)break e;Te.arraySet(i,n,o,h,a),s-=h,o+=h,l-=h,a+=h,r.length-=h;break}r.mode=xt;break;case vu:for(;c<14;){if(s===0)break e;s--,f+=n[o++]<<c,c+=8}if(r.nlen=(f&31)+257,f>>>=5,c-=5,r.ndist=(f&31)+1,f>>>=5,c-=5,r.ncode=(f&15)+4,f>>>=4,c-=4,r.nlen>286||r.ndist>30){e.msg="too many length or distance symbols",r.mode=Q;break}r.have=0,r.mode=wu;case wu:for(;r.have<r.ncode;){for(;c<3;){if(s===0)break e;s--,f+=n[o++]<<c,c+=8}r.lens[v[r.have++]]=f&7,f>>>=3,c-=3}for(;r.have<19;)r.lens[v[r.have++]]=0;if(r.lencode=r.lendyn,r.lenbits=7,b={bits:r.lenbits},p=Ln(k1,r.lens,0,19,r.lencode,0,r.work,b),r.lenbits=b.bits,p){e.msg="invalid code lengths set",r.mode=Q;break}r.have=0,r.mode=_u;case _u:for(;r.have<r.nlen+r.ndist;){for(;S=r.lencode[f&(1<<r.lenbits)-1],T=S>>>24,w=S>>>16&255,k=S&65535,!(T<=c);){if(s===0)break e;s--,f+=n[o++]<<c,c+=8}if(k<16)f>>>=T,c-=T,r.lens[r.have++]=k;else{if(k===16){for(y=T+2;c<y;){if(s===0)break e;s--,f+=n[o++]<<c,c+=8}if(f>>>=T,c-=T,r.have===0){e.msg="invalid bit length repeat",r.mode=Q;break}N=r.lens[r.have-1],h=3+(f&3),f>>>=2,c-=2}else if(k===17){for(y=T+3;c<y;){if(s===0)break e;s--,f+=n[o++]<<c,c+=8}f>>>=T,c-=T,N=0,h=3+(f&7),f>>>=3,c-=3}else{for(y=T+7;c<y;){if(s===0)break e;s--,f+=n[o++]<<c,c+=8}f>>>=T,c-=T,N=0,h=11+(f&127),f>>>=7,c-=7}if(r.have+h>r.nlen+r.ndist){e.msg="invalid bit length repeat",r.mode=Q;break}for(;h--;)r.lens[r.have++]=N}}if(r.mode===Q)break;if(r.lens[256]===0){e.msg="invalid code -- missing end-of-block",r.mode=Q;break}if(r.lenbits=9,b={bits:r.lenbits},p=Ln(Lu,r.lens,0,r.nlen,r.lencode,0,r.work,b),r.lenbits=b.bits,p){e.msg="invalid literal/lengths set",r.mode=Q;break}if(r.distbits=6,r.distcode=r.distdyn,b={bits:r.distbits},p=Ln(Iu,r.lens,r.nlen,r.ndist,r.distcode,0,r.work,b),r.distbits=b.bits,p){e.msg="invalid distances set",r.mode=Q;break}if(r.mode=co,t===lo)break e;case co:r.mode=uo;case uo:if(s>=6&&l>=258){e.next_out=a,e.avail_out=l,e.next_in=o,e.avail_in=s,r.hold=f,r.bits=c,F1(e,d),a=e.next_out,i=e.output,l=e.avail_out,o=e.next_in,n=e.input,s=e.avail_in,f=r.hold,c=r.bits,r.mode===xt&&(r.back=-1);break}for(r.back=0;S=r.lencode[f&(1<<r.lenbits)-1],T=S>>>24,w=S>>>16&255,k=S&65535,!(T<=c);){if(s===0)break e;s--,f+=n[o++]<<c,c+=8}if(w&&!(w&240)){for(I=T,L=w,R=k;S=r.lencode[R+((f&(1<<I+L)-1)>>I)],T=S>>>24,w=S>>>16&255,k=S&65535,!(I+T<=c);){if(s===0)break e;s--,f+=n[o++]<<c,c+=8}f>>>=I,c-=I,r.back+=I}if(f>>>=T,c-=T,r.back+=T,r.length=k,w===0){r.mode=Au;break}if(w&32){r.back=-1,r.mode=xt;break}if(w&64){e.msg="invalid literal/length code",r.mode=Q;break}r.extra=w&15,r.mode=Eu;case Eu:if(r.extra){for(y=r.extra;c<y;){if(s===0)break e;s--,f+=n[o++]<<c,c+=8}r.length+=f&(1<<r.extra)-1,f>>>=r.extra,c-=r.extra,r.back+=r.extra}r.was=r.length,r.mode=Su;case Su:for(;S=r.distcode[f&(1<<r.distbits)-1],T=S>>>24,w=S>>>16&255,k=S&65535,!(T<=c);){if(s===0)break e;s--,f+=n[o++]<<c,c+=8}if(!(w&240)){for(I=T,L=w,R=k;S=r.distcode[R+((f&(1<<I+L)-1)>>I)],T=S>>>24,w=S>>>16&255,k=S&65535,!(I+T<=c);){if(s===0)break e;s--,f+=n[o++]<<c,c+=8}f>>>=I,c-=I,r.back+=I}if(f>>>=T,c-=T,r.back+=T,w&64){e.msg="invalid distance code",r.mode=Q;break}r.offset=k,r.extra=w&15,r.mode=Tu;case Tu:if(r.extra){for(y=r.extra;c<y;){if(s===0)break e;s--,f+=n[o++]<<c,c+=8}r.offset+=f&(1<<r.extra)-1,f>>>=r.extra,c-=r.extra,r.back+=r.extra}if(r.offset>r.dmax){e.msg="invalid distance too far back",r.mode=Q;break}r.mode=Cu;case Cu:if(l===0)break e;if(h=d-l,r.offset>h){if(h=r.offset-h,h>r.whave&&r.sane){e.msg="invalid distance too far back",r.mode=Q;break}h>r.wnext?(h-=r.wnext,g=r.wsize-h):g=r.wnext-h,h>r.length&&(h=r.length),x=r.window}else x=i,g=a-r.offset,h=r.length;h>l&&(h=l),l-=h,r.length-=h;do i[a++]=x[g++];while(--h);r.length===0&&(r.mode=uo);break;case Au:if(l===0)break e;i[a++]=r.length,l--,r.mode=uo;break;case Es:if(r.wrap){for(;c<32;){if(s===0)break e;s--,f|=n[o++]<<c,c+=8}if(d-=l,e.total_out+=d,r.total+=d,d&&(e.adler=r.check=r.flags?at(r.check,i,d,a-d):Cs(r.check,i,d,a-d)),d=l,(r.flags?f:ku(f))!==r.check){e.msg="incorrect data check",r.mode=Q;break}f=0,c=0}r.mode=Pu;case Pu:if(r.wrap&&r.flags){for(;c<32;){if(s===0)break e;s--,f+=n[o++]<<c,c+=8}if(f!==(r.total&4294967295)){e.msg="incorrect length check",r.mode=Q;break}f=0,c=0}r.mode=Fu;case Fu:p=L1;break e;case Q:p=Ou;break e;case Ps:return As;case B1:default:return Ie}return e.next_out=a,e.avail_out=l,e.next_in=o,e.avail_in=s,r.hold=f,r.bits=c,(r.wsize||d!==e.avail_out&&r.mode<Q&&(r.mode<Es||t!==su))&&Uu(e,e.output,e.next_out,d-e.avail_out)?(r.mode=Ps,As):(u-=e.avail_in,d-=e.avail_out,e.total_in+=u,e.total_out+=d,r.total+=d,r.wrap&&d&&(e.adler=r.check=r.flags?at(r.check,i,d,e.next_out-d):Cs(r.check,i,d,e.next_out-d)),e.data_type=r.bits+(r.last?64:0)+(r.mode===xt?128:0)+(r.mode===co||r.mode===_s?256:0),(u===0&&d===0||t===su)&&p===nr&&(p=O1),p)}function $1(e){if(!e||!e.state)return Ie;var t=e.state;return t.window&&(t.window=null),e.state=null,nr}function H1(e,t){var r;return!e||!e.state||(r=e.state,!(r.wrap&2))?Ie:(r.head=t,t.done=!1,nr)}function Z1(e,t){var r=t.length,n,i,o;return!e||!e.state||(n=e.state,n.wrap!==0&&n.mode!==ho)?Ie:n.mode===ho&&(i=1,i=Cs(i,t,r,0),i!==n.check)?Ou:(o=Uu(e,t,r,r),o?(n.mode=Ps,As):(n.havedict=1,nr))}Ge.inflateReset=Du;Ge.inflateReset2=Nu;Ge.inflateResetKeep=Ru;Ge.inflateInit=q1;Ge.inflateInit2=zu;Ge.inflate=V1;Ge.inflateEnd=$1;Ge.inflateGetHeader=H1;Ge.inflateSetDictionary=Z1;Ge.inflateInfo="pako inflate (from Nodeca project)"});var Fs=X((x5,Gu)=>{"use strict";Gu.exports={Z_NO_FLUSH:0,Z_PARTIAL_FLUSH:1,Z_SYNC_FLUSH:2,Z_FULL_FLUSH:3,Z_FINISH:4,Z_BLOCK:5,Z_TREES:6,Z_OK:0,Z_STREAM_END:1,Z_NEED_DICT:2,Z_ERRNO:-1,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_BUF_ERROR:-5,Z_NO_COMPRESSION:0,Z_BEST_SPEED:1,Z_BEST_COMPRESSION:9,Z_DEFAULT_COMPRESSION:-1,Z_FILTERED:1,Z_HUFFMAN_ONLY:2,Z_RLE:3,Z_FIXED:4,Z_DEFAULT_STRATEGY:0,Z_BINARY:0,Z_TEXT:1,Z_UNKNOWN:2,Z_DEFLATED:8}});var $u=X((v5,Vu)=>{"use strict";function j1(){this.text=0,this.time=0,this.xflags=0,this.os=0,this.extra=null,this.extra_len=0,this.name="",this.comment="",this.hcrc=0,this.done=!1}Vu.exports=j1});var Zu=X(On=>{"use strict";var qr=qu(),In=mt(),po=ps(),oe=Fs(),ks=eo(),W1=gs(),Y1=$u(),Hu=Object.prototype.toString;function ir(e){if(!(this instanceof ir))return new ir(e);this.options=In.assign({chunkSize:16384,windowBits:0,to:""},e||{});var t=this.options;t.raw&&t.windowBits>=0&&t.windowBits<16&&(t.windowBits=-t.windowBits,t.windowBits===0&&(t.windowBits=-15)),t.windowBits>=0&&t.windowBits<16&&!(e&&e.windowBits)&&(t.windowBits+=32),t.windowBits>15&&t.windowBits<48&&(t.windowBits&15||(t.windowBits|=15)),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new W1,this.strm.avail_out=0;var r=qr.inflateInit2(this.strm,t.windowBits);if(r!==oe.Z_OK)throw new Error(ks[r]);if(this.header=new Y1,qr.inflateGetHeader(this.strm,this.header),t.dictionary&&(typeof t.dictionary=="string"?t.dictionary=po.string2buf(t.dictionary):Hu.call(t.dictionary)==="[object ArrayBuffer]"&&(t.dictionary=new Uint8Array(t.dictionary)),t.raw&&(r=qr.inflateSetDictionary(this.strm,t.dictionary),r!==oe.Z_OK)))throw new Error(ks[r])}ir.prototype.push=function(e,t){var r=this.strm,n=this.options.chunkSize,i=this.options.dictionary,o,a,s,l,f,c=!1;if(this.ended)return!1;a=t===~~t?t:t===!0?oe.Z_FINISH:oe.Z_NO_FLUSH,typeof e=="string"?r.input=po.binstring2buf(e):Hu.call(e)==="[object ArrayBuffer]"?r.input=new Uint8Array(e):r.input=e,r.next_in=0,r.avail_in=r.input.length;do{if(r.avail_out===0&&(r.output=new In.Buf8(n),r.next_out=0,r.avail_out=n),o=qr.inflate(r,oe.Z_NO_FLUSH),o===oe.Z_NEED_DICT&&i&&(o=qr.inflateSetDictionary(this.strm,i)),o===oe.Z_BUF_ERROR&&c===!0&&(o=oe.Z_OK,c=!1),o!==oe.Z_STREAM_END&&o!==oe.Z_OK)return this.onEnd(o),this.ended=!0,!1;r.next_out&&(r.avail_out===0||o===oe.Z_STREAM_END||r.avail_in===0&&(a===oe.Z_FINISH||a===oe.Z_SYNC_FLUSH))&&(this.options.to==="string"?(s=po.utf8border(r.output,r.next_out),l=r.next_out-s,f=po.buf2string(r.output,s),r.next_out=l,r.avail_out=n-l,l&&In.arraySet(r.output,r.output,s,l,0),this.onData(f)):this.onData(In.shrinkBuf(r.output,r.next_out))),r.avail_in===0&&r.avail_out===0&&(c=!0)}while((r.avail_in>0||r.avail_out===0)&&o!==oe.Z_STREAM_END);return o===oe.Z_STREAM_END&&(a=oe.Z_FINISH),a===oe.Z_FINISH?(o=qr.inflateEnd(this.strm),this.onEnd(o),this.ended=!0,o===oe.Z_OK):(a===oe.Z_SYNC_FLUSH&&(this.onEnd(oe.Z_OK),r.avail_out=0),!0)};ir.prototype.onData=function(e){this.chunks.push(e)};ir.prototype.onEnd=function(e){e===oe.Z_OK&&(this.options.to==="string"?this.result=this.chunks.join(""):this.result=In.flattenChunks(this.chunks)),this.chunks=[],this.err=e,this.msg=this.strm.msg};function Ms(e,t){var r=new ir(t);if(r.push(e,!0),r.err)throw r.msg||ks[r.err];return r.result}function K1(e,t){return t=t||{},t.raw=!0,Ms(e,t)}On.Inflate=ir;On.inflate=Ms;On.inflateRaw=K1;On.ungzip=Ms});var Yu=X((_5,Wu)=>{"use strict";var X1=mt().assign,Q1=Xc(),J1=Zu(),eb=Fs(),ju={};X1(ju,Q1,J1,eb);Wu.exports=ju});var Ku=X(()=>{});var Xu=X(Ls=>{Ls.read=function(e,t,r,n,i){var o,a,s=i*8-n-1,l=(1<<s)-1,f=l>>1,c=-7,u=r?i-1:0,d=r?-1:1,h=e[t+u];for(u+=d,o=h&(1<<-c)-1,h>>=-c,c+=s;c>0;o=o*256+e[t+u],u+=d,c-=8);for(a=o&(1<<-c)-1,o>>=-c,c+=n;c>0;a=a*256+e[t+u],u+=d,c-=8);if(o===0)o=1-f;else{if(o===l)return a?NaN:(h?-1:1)*(1/0);a=a+Math.pow(2,n),o=o-f}return(h?-1:1)*a*Math.pow(2,o-n)};Ls.write=function(e,t,r,n,i,o){var a,s,l,f=o*8-i-1,c=(1<<f)-1,u=c>>1,d=i===23?Math.pow(2,-24)-Math.pow(2,-77):0,h=n?0:o-1,g=n?1:-1,x=t<0||t===0&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(s=isNaN(t)?1:0,a=c):(a=Math.floor(Math.log(t)/Math.LN2),t*(l=Math.pow(2,-a))<1&&(a--,l*=2),a+u>=1?t+=d/l:t+=d*Math.pow(2,1-u),t*l>=2&&(a++,l/=2),a+u>=c?(s=0,a=c):a+u>=1?(s=(t*l-1)*Math.pow(2,i),a=a+u):(s=t*Math.pow(2,u-1)*Math.pow(2,i),a=0));i>=8;e[r+h]=s&255,h+=g,s/=256,i-=8);for(a=a<<i|s,f+=i;f>0;e[r+h]=a&255,h+=g,a/=256,f-=8);e[r+h-g]|=x*128}});var nd=X((U5,rd)=>{"use strict";rd.exports=W;var mo=Xu();function W(e){this.buf=ArrayBuffer.isView&&ArrayBuffer.isView(e)?e:new Uint8Array(e||0),this.pos=0,this.type=0,this.length=this.buf.length}W.Varint=0;W.Fixed64=1;W.Bytes=2;W.Fixed32=5;var Is=(1<<16)*(1<<16),Qu=1/Is,tb=12,td=typeof TextDecoder>"u"?null:new TextDecoder("utf-8");W.prototype={destroy:function(){this.buf=null},readFields:function(e,t,r){for(r=r||this.length;this.pos<r;){var n=this.readVarint(),i=n>>3,o=this.pos;this.type=n&7,e(i,t,this),this.pos===o&&this.skip(n)}return t},readMessage:function(e,t){return this.readFields(e,t,this.readVarint()+this.pos)},readFixed32:function(){var e=bo(this.buf,this.pos);return this.pos+=4,e},readSFixed32:function(){var e=ed(this.buf,this.pos);return this.pos+=4,e},readFixed64:function(){var e=bo(this.buf,this.pos)+bo(this.buf,this.pos+4)*Is;return this.pos+=8,e},readSFixed64:function(){var e=bo(this.buf,this.pos)+ed(this.buf,this.pos+4)*Is;return this.pos+=8,e},readFloat:function(){var e=mo.read(this.buf,this.pos,!0,23,4);return this.pos+=4,e},readDouble:function(){var e=mo.read(this.buf,this.pos,!0,52,8);return this.pos+=8,e},readVarint:function(e){var t=this.buf,r,n;return n=t[this.pos++],r=n&127,n<128||(n=t[this.pos++],r|=(n&127)<<7,n<128)||(n=t[this.pos++],r|=(n&127)<<14,n<128)||(n=t[this.pos++],r|=(n&127)<<21,n<128)?r:(n=t[this.pos],r|=(n&15)<<28,rb(r,e,this))},readVarint64:function(){return this.readVarint(!0)},readSVarint:function(){var e=this.readVarint();return e%2===1?(e+1)/-2:e/2},readBoolean:function(){return Boolean(this.readVarint())},readString:function(){var e=this.readVarint()+this.pos,t=this.pos;return this.pos=e,e-t>=tb&&td?mb(this.buf,t,e):gb(this.buf,t,e)},readBytes:function(){var e=this.readVarint()+this.pos,t=this.buf.subarray(this.pos,e);return this.pos=e,t},readPackedVarint:function(e,t){if(this.type!==W.Bytes)return e.push(this.readVarint(t));var r=wt(this);for(e=e||[];this.pos<r;)e.push(this.readVarint(t));return e},readPackedSVarint:function(e){if(this.type!==W.Bytes)return e.push(this.readSVarint());var t=wt(this);for(e=e||[];this.pos<t;)e.push(this.readSVarint());return e},readPackedBoolean:function(e){if(this.type!==W.Bytes)return e.push(this.readBoolean());var t=wt(this);for(e=e||[];this.pos<t;)e.push(this.readBoolean());return e},readPackedFloat:function(e){if(this.type!==W.Bytes)return e.push(this.readFloat());var t=wt(this);for(e=e||[];this.pos<t;)e.push(this.readFloat());return e},readPackedDouble:function(e){if(this.type!==W.Bytes)return e.push(this.readDouble());var t=wt(this);for(e=e||[];this.pos<t;)e.push(this.readDouble());return e},readPackedFixed32:function(e){if(this.type!==W.Bytes)return e.push(this.readFixed32());var t=wt(this);for(e=e||[];this.pos<t;)e.push(this.readFixed32());return e},readPackedSFixed32:function(e){if(this.type!==W.Bytes)return e.push(this.readSFixed32());var t=wt(this);for(e=e||[];this.pos<t;)e.push(this.readSFixed32());return e},readPackedFixed64:function(e){if(this.type!==W.Bytes)return e.push(this.readFixed64());var t=wt(this);for(e=e||[];this.pos<t;)e.push(this.readFixed64());return e},readPackedSFixed64:function(e){if(this.type!==W.Bytes)return e.push(this.readSFixed64());var t=wt(this);for(e=e||[];this.pos<t;)e.push(this.readSFixed64());return e},skip:function(e){var t=e&7;if(t===W.Varint)for(;this.buf[this.pos++]>127;);else if(t===W.Bytes)this.pos=this.readVarint()+this.pos;else if(t===W.Fixed32)this.pos+=4;else if(t===W.Fixed64)this.pos+=8;else throw new Error("Unimplemented type: "+t)},writeTag:function(e,t){this.writeVarint(e<<3|t)},realloc:function(e){for(var t=this.length||16;t<this.pos+e;)t*=2;if(t!==this.length){var r=new Uint8Array(t);r.set(this.buf),this.buf=r,this.length=t}},finish:function(){return this.length=this.pos,this.pos=0,this.buf.subarray(0,this.length)},writeFixed32:function(e){this.realloc(4),Hr(this.buf,e,this.pos),this.pos+=4},writeSFixed32:function(e){this.realloc(4),Hr(this.buf,e,this.pos),this.pos+=4},writeFixed64:function(e){this.realloc(8),Hr(this.buf,e&-1,this.pos),Hr(this.buf,Math.floor(e*Qu),this.pos+4),this.pos+=8},writeSFixed64:function(e){this.realloc(8),Hr(this.buf,e&-1,this.pos),Hr(this.buf,Math.floor(e*Qu),this.pos+4),this.pos+=8},writeVarint:function(e){if(e=+e||0,e>268435455||e<0){nb(e,this);return}this.realloc(4),this.buf[this.pos++]=e&127|(e>127?128:0),!(e<=127)&&(this.buf[this.pos++]=(e>>>=7)&127|(e>127?128:0),!(e<=127)&&(this.buf[this.pos++]=(e>>>=7)&127|(e>127?128:0),!(e<=127)&&(this.buf[this.pos++]=e>>>7&127)))},writeSVarint:function(e){this.writeVarint(e<0?-e*2-1:e*2)},writeBoolean:function(e){this.writeVarint(Boolean(e))},writeString:function(e){e=String(e),this.realloc(e.length*4),this.pos++;var t=this.pos;this.pos=bb(this.buf,e,this.pos);var r=this.pos-t;r>=128&&Ju(t,r,this),this.pos=t-1,this.writeVarint(r),this.pos+=r},writeFloat:function(e){this.realloc(4),mo.write(this.buf,e,this.pos,!0,23,4),this.pos+=4},writeDouble:function(e){this.realloc(8),mo.write(this.buf,e,this.pos,!0,52,8),this.pos+=8},writeBytes:function(e){var t=e.length;this.writeVarint(t),this.realloc(t);for(var r=0;r<t;r++)this.buf[this.pos++]=e[r]},writeRawMessage:function(e,t){this.pos++;var r=this.pos;e(t,this);var n=this.pos-r;n>=128&&Ju(r,n,this),this.pos=r-1,this.writeVarint(n),this.pos+=n},writeMessage:function(e,t,r){this.writeTag(e,W.Bytes),this.writeRawMessage(t,r)},writePackedVarint:function(e,t){t.length&&this.writeMessage(e,ab,t)},writePackedSVarint:function(e,t){t.length&&this.writeMessage(e,sb,t)},writePackedBoolean:function(e,t){t.length&&this.writeMessage(e,cb,t)},writePackedFloat:function(e,t){t.length&&this.writeMessage(e,fb,t)},writePackedDouble:function(e,t){t.length&&this.writeMessage(e,lb,t)},writePackedFixed32:function(e,t){t.length&&this.writeMessage(e,ub,t)},writePackedSFixed32:function(e,t){t.length&&this.writeMessage(e,db,t)},writePackedFixed64:function(e,t){t.length&&this.writeMessage(e,hb,t)},writePackedSFixed64:function(e,t){t.length&&this.writeMessage(e,pb,t)},writeBytesField:function(e,t){this.writeTag(e,W.Bytes),this.writeBytes(t)},writeFixed32Field:function(e,t){this.writeTag(e,W.Fixed32),this.writeFixed32(t)},writeSFixed32Field:function(e,t){this.writeTag(e,W.Fixed32),this.writeSFixed32(t)},writeFixed64Field:function(e,t){this.writeTag(e,W.Fixed64),this.writeFixed64(t)},writeSFixed64Field:function(e,t){this.writeTag(e,W.Fixed64),this.writeSFixed64(t)},writeVarintField:function(e,t){this.writeTag(e,W.Varint),this.writeVarint(t)},writeSVarintField:function(e,t){this.writeTag(e,W.Varint),this.writeSVarint(t)},writeStringField:function(e,t){this.writeTag(e,W.Bytes),this.writeString(t)},writeFloatField:function(e,t){this.writeTag(e,W.Fixed32),this.writeFloat(t)},writeDoubleField:function(e,t){this.writeTag(e,W.Fixed64),this.writeDouble(t)},writeBooleanField:function(e,t){this.writeVarintField(e,Boolean(t))}};function rb(e,t,r){var n=r.buf,i,o;if(o=n[r.pos++],i=(o&112)>>4,o<128||(o=n[r.pos++],i|=(o&127)<<3,o<128)||(o=n[r.pos++],i|=(o&127)<<10,o<128)||(o=n[r.pos++],i|=(o&127)<<17,o<128)||(o=n[r.pos++],i|=(o&127)<<24,o<128)||(o=n[r.pos++],i|=(o&1)<<31,o<128))return $r(e,i,t);throw new Error("Expected varint not more than 10 bytes")}function wt(e){return e.type===W.Bytes?e.readVarint()+e.pos:e.pos+1}function $r(e,t,r){return r?t*4294967296+(e>>>0):(t>>>0)*4294967296+(e>>>0)}function nb(e,t){var r,n;if(e>=0?(r=e%4294967296|0,n=e/4294967296|0):(r=~(-e%4294967296),n=~(-e/4294967296),r^4294967295?r=r+1|0:(r=0,n=n+1|0)),e>=18446744073709552e3||e<-18446744073709552e3)throw new Error("Given varint doesn't fit into 10 bytes");t.realloc(10),ib(r,n,t),ob(n,t)}function ib(e,t,r){r.buf[r.pos++]=e&127|128,e>>>=7,r.buf[r.pos++]=e&127|128,e>>>=7,r.buf[r.pos++]=e&127|128,e>>>=7,r.buf[r.pos++]=e&127|128,e>>>=7,r.buf[r.pos]=e&127}function ob(e,t){var r=(e&7)<<4;t.buf[t.pos++]|=r|((e>>>=3)?128:0),e&&(t.buf[t.pos++]=e&127|((e>>>=7)?128:0),e&&(t.buf[t.pos++]=e&127|((e>>>=7)?128:0),e&&(t.buf[t.pos++]=e&127|((e>>>=7)?128:0),e&&(t.buf[t.pos++]=e&127|((e>>>=7)?128:0),e&&(t.buf[t.pos++]=e&127)))))}function Ju(e,t,r){var n=t<=16383?1:t<=2097151?2:t<=268435455?3:Math.floor(Math.log(t)/(Math.LN2*7));r.realloc(n);for(var i=r.pos-1;i>=e;i--)r.buf[i+n]=r.buf[i]}function ab(e,t){for(var r=0;r<e.length;r++)t.writeVarint(e[r])}function sb(e,t){for(var r=0;r<e.length;r++)t.writeSVarint(e[r])}function fb(e,t){for(var r=0;r<e.length;r++)t.writeFloat(e[r])}function lb(e,t){for(var r=0;r<e.length;r++)t.writeDouble(e[r])}function cb(e,t){for(var r=0;r<e.length;r++)t.writeBoolean(e[r])}function ub(e,t){for(var r=0;r<e.length;r++)t.writeFixed32(e[r])}function db(e,t){for(var r=0;r<e.length;r++)t.writeSFixed32(e[r])}function hb(e,t){for(var r=0;r<e.length;r++)t.writeFixed64(e[r])}function pb(e,t){for(var r=0;r<e.length;r++)t.writeSFixed64(e[r])}function bo(e,t){return(e[t]|e[t+1]<<8|e[t+2]<<16)+e[t+3]*16777216}function Hr(e,t,r){e[r]=t,e[r+1]=t>>>8,e[r+2]=t>>>16,e[r+3]=t>>>24}function ed(e,t){return(e[t]|e[t+1]<<8|e[t+2]<<16)+(e[t+3]<<24)}function gb(e,t,r){for(var n="",i=t;i<r;){var o=e[i],a=null,s=o>239?4:o>223?3:o>191?2:1;if(i+s>r)break;var l,f,c;s===1?o<128&&(a=o):s===2?(l=e[i+1],(l&192)===128&&(a=(o&31)<<6|l&63,a<=127&&(a=null))):s===3?(l=e[i+1],f=e[i+2],(l&192)===128&&(f&192)===128&&(a=(o&15)<<12|(l&63)<<6|f&63,(a<=2047||a>=55296&&a<=57343)&&(a=null))):s===4&&(l=e[i+1],f=e[i+2],c=e[i+3],(l&192)===128&&(f&192)===128&&(c&192)===128&&(a=(o&15)<<18|(l&63)<<12|(f&63)<<6|c&63,(a<=65535||a>=1114112)&&(a=null))),a===null?(a=65533,s=1):a>65535&&(a-=65536,n+=String.fromCharCode(a>>>10&1023|55296),a=56320|a&1023),n+=String.fromCharCode(a),i+=s}return n}function mb(e,t,r){return td.decode(e.subarray(t,r))}function bb(e,t,r){for(var n=0,i,o;n<t.length;n++){if(i=t.charCodeAt(n),i>55295&&i<57344)if(o)if(i<56320){e[r++]=239,e[r++]=191,e[r++]=189,o=i;continue}else i=o-55296<<10|i-56320|65536,o=null;else{i>56319||n+1===t.length?(e[r++]=239,e[r++]=191,e[r++]=189):o=i;continue}else o&&(e[r++]=239,e[r++]=191,e[r++]=189,o=null);i<128?e[r++]=i:(i<2048?e[r++]=i>>6|192:(i<65536?e[r++]=i>>12|224:(e[r++]=i>>18|240,e[r++]=i>>12&63|128),e[r++]=i>>6&63|128),e[r++]=i&63|128)}return r}});var jd=X((e4,qs)=>{"use strict";qs.exports=Bo;qs.exports.default=Bo;function Bo(e,t,r){r=r||2;var n=t&&t.length,i=n?t[0]*r:e.length,o=$d(e,0,i,r,!0),a=[];if(!o||o.next===o.prev)return a;var s,l,f,c,u,d,h;if(n&&(o=Qb(e,t,o,r)),e.length>80*r){s=f=e[0],l=c=e[1];for(var g=r;g<i;g+=r)u=e[g],d=e[g+1],u<s&&(s=u),d<l&&(l=d),u>f&&(f=u),d>c&&(c=d);h=Math.max(f-s,c-l),h=h!==0?32767/h:0}return fi(o,a,r,s,l,h,0),a}function $d(e,t,r,n,i){var o,a;if(i===Us(e,t,r,n)>0)for(o=t;o<r;o+=n)a=Vd(o,e[o],e[o+1],a);else for(o=r-n;o>=t;o-=n)a=Vd(o,e[o],e[o+1],a);return a&&Ro(a,a.next)&&(ci(a),a=a.next),a}function ur(e,t){if(!e)return e;t||(t=e);var r=e,n;do if(n=!1,!r.steiner&&(Ro(r,r.next)||ee(r.prev,r,r.next)===0)){if(ci(r),r=t=r.prev,r===r.next)break;n=!0}else r=r.next;while(n||r!==t);return t}function fi(e,t,r,n,i,o,a){if(e){!a&&o&&ny(e,n,i,o);for(var s=e,l,f;e.prev!==e.next;){if(l=e.prev,f=e.next,o?Yb(e,n,i,o):Wb(e)){t.push(l.i/r|0),t.push(e.i/r|0),t.push(f.i/r|0),ci(e),e=f.next,s=f.next;continue}if(e=f,e===s){a?a===1?(e=Kb(ur(e),t,r),fi(e,t,r,n,i,o,2)):a===2&&Xb(e,t,r,n,i,o):fi(ur(e),t,r,n,i,o,1);break}}}}function Wb(e){var t=e.prev,r=e,n=e.next;if(ee(t,r,n)>=0)return!1;for(var i=t.x,o=r.x,a=n.x,s=t.y,l=r.y,f=n.y,c=i<o?i<a?i:a:o<a?o:a,u=s<l?s<f?s:f:l<f?l:f,d=i>o?i>a?i:a:o>a?o:a,h=s>l?s>f?s:f:l>f?l:f,g=n.next;g!==t;){if(g.x>=c&&g.x<=d&&g.y>=u&&g.y<=h&&Wr(i,s,o,l,a,f,g.x,g.y)&&ee(g.prev,g,g.next)>=0)return!1;g=g.next}return!0}function Yb(e,t,r,n){var i=e.prev,o=e,a=e.next;if(ee(i,o,a)>=0)return!1;for(var s=i.x,l=o.x,f=a.x,c=i.y,u=o.y,d=a.y,h=s<l?s<f?s:f:l<f?l:f,g=c<u?c<d?c:d:u<d?u:d,x=s>l?s>f?s:f:l>f?l:f,S=c>u?c>d?c:d:u>d?u:d,T=Ns(h,g,t,r,n),w=Ns(x,S,t,r,n),k=e.prevZ,I=e.nextZ;k&&k.z>=T&&I&&I.z<=w;){if(k.x>=h&&k.x<=x&&k.y>=g&&k.y<=S&&k!==i&&k!==a&&Wr(s,c,l,u,f,d,k.x,k.y)&&ee(k.prev,k,k.next)>=0||(k=k.prevZ,I.x>=h&&I.x<=x&&I.y>=g&&I.y<=S&&I!==i&&I!==a&&Wr(s,c,l,u,f,d,I.x,I.y)&&ee(I.prev,I,I.next)>=0))return!1;I=I.nextZ}for(;k&&k.z>=T;){if(k.x>=h&&k.x<=x&&k.y>=g&&k.y<=S&&k!==i&&k!==a&&Wr(s,c,l,u,f,d,k.x,k.y)&&ee(k.prev,k,k.next)>=0)return!1;k=k.prevZ}for(;I&&I.z<=w;){if(I.x>=h&&I.x<=x&&I.y>=g&&I.y<=S&&I!==i&&I!==a&&Wr(s,c,l,u,f,d,I.x,I.y)&&ee(I.prev,I,I.next)>=0)return!1;I=I.nextZ}return!0}function Kb(e,t,r){var n=e;do{var i=n.prev,o=n.next.next;!Ro(i,o)&&Hd(i,n,n.next,o)&&li(i,o)&&li(o,i)&&(t.push(i.i/r|0),t.push(n.i/r|0),t.push(o.i/r|0),ci(n),ci(n.next),n=e=o),n=n.next}while(n!==e);return ur(n)}function Xb(e,t,r,n,i,o){var a=e;do{for(var s=a.next.next;s!==a.prev;){if(a.i!==s.i&&ay(a,s)){var l=Zd(a,s);a=ur(a,a.next),l=ur(l,l.next),fi(a,t,r,n,i,o,0),fi(l,t,r,n,i,o,0);return}s=s.next}a=a.next}while(a!==e)}function Qb(e,t,r,n){var i=[],o,a,s,l,f;for(o=0,a=t.length;o<a;o++)s=t[o]*n,l=o<a-1?t[o+1]*n:e.length,f=$d(e,s,l,n,!1),f===f.next&&(f.steiner=!0),i.push(oy(f));for(i.sort(Jb),o=0;o<i.length;o++)r=ey(i[o],r);return r}function Jb(e,t){return e.x-t.x}function ey(e,t){var r=ty(e,t);if(!r)return t;var n=Zd(r,e);return ur(n,n.next),ur(r,r.next)}function ty(e,t){var r=t,n=e.x,i=e.y,o=-1/0,a;do{if(i<=r.y&&i>=r.next.y&&r.next.y!==r.y){var s=r.x+(i-r.y)*(r.next.x-r.x)/(r.next.y-r.y);if(s<=n&&s>o&&(o=s,a=r.x<r.next.x?r:r.next,s===n))return a}r=r.next}while(r!==t);if(!a)return null;var l=a,f=a.x,c=a.y,u=1/0,d;r=a;do n>=r.x&&r.x>=f&&n!==r.x&&Wr(i<c?n:o,i,f,c,i<c?o:n,i,r.x,r.y)&&(d=Math.abs(i-r.y)/(n-r.x),li(r,e)&&(d<u||d===u&&(r.x>a.x||r.x===a.x&&ry(a,r)))&&(a=r,u=d)),r=r.next;while(r!==l);return a}function ry(e,t){return ee(e.prev,e,t.prev)<0&&ee(t.next,e,e.next)<0}function ny(e,t,r,n){var i=e;do i.z===0&&(i.z=Ns(i.x,i.y,t,r,n)),i.prevZ=i.prev,i.nextZ=i.next,i=i.next;while(i!==e);i.prevZ.nextZ=null,i.prevZ=null,iy(i)}function iy(e){var t,r,n,i,o,a,s,l,f=1;do{for(r=e,e=null,o=null,a=0;r;){for(a++,n=r,s=0,t=0;t<f&&(s++,n=n.nextZ,!!n);t++);for(l=f;s>0||l>0&&n;)s!==0&&(l===0||!n||r.z<=n.z)?(i=r,r=r.nextZ,s--):(i=n,n=n.nextZ,l--),o?o.nextZ=i:e=i,i.prevZ=o,o=i;r=n}o.nextZ=null,f*=2}while(a>1);return e}function Ns(e,t,r,n,i){return e=(e-r)*i|0,t=(t-n)*i|0,e=(e|e<<8)&16711935,e=(e|e<<4)&252645135,e=(e|e<<2)&858993459,e=(e|e<<1)&1431655765,t=(t|t<<8)&16711935,t=(t|t<<4)&252645135,t=(t|t<<2)&858993459,t=(t|t<<1)&1431655765,e|t<<1}function oy(e){var t=e,r=e;do(t.x<r.x||t.x===r.x&&t.y<r.y)&&(r=t),t=t.next;while(t!==e);return r}function Wr(e,t,r,n,i,o,a,s){return(i-a)*(t-s)>=(e-a)*(o-s)&&(e-a)*(n-s)>=(r-a)*(t-s)&&(r-a)*(o-s)>=(i-a)*(n-s)}function ay(e,t){return e.next.i!==t.i&&e.prev.i!==t.i&&!sy(e,t)&&(li(e,t)&&li(t,e)&&fy(e,t)&&(ee(e.prev,e,t.prev)||ee(e,t.prev,t))||Ro(e,t)&&ee(e.prev,e,e.next)>0&&ee(t.prev,t,t.next)>0)}function ee(e,t,r){return(t.y-e.y)*(r.x-t.x)-(t.x-e.x)*(r.y-t.y)}function Ro(e,t){return e.x===t.x&&e.y===t.y}function Hd(e,t,r,n){var i=Oo(ee(e,t,r)),o=Oo(ee(e,t,n)),a=Oo(ee(r,n,e)),s=Oo(ee(r,n,t));return!!(i!==o&&a!==s||i===0&&Io(e,r,t)||o===0&&Io(e,n,t)||a===0&&Io(r,e,n)||s===0&&Io(r,t,n))}function Io(e,t,r){return t.x<=Math.max(e.x,r.x)&&t.x>=Math.min(e.x,r.x)&&t.y<=Math.max(e.y,r.y)&&t.y>=Math.min(e.y,r.y)}function Oo(e){return e>0?1:e<0?-1:0}function sy(e,t){var r=e;do{if(r.i!==e.i&&r.next.i!==e.i&&r.i!==t.i&&r.next.i!==t.i&&Hd(r,r.next,e,t))return!0;r=r.next}while(r!==e);return!1}function li(e,t){return ee(e.prev,e,e.next)<0?ee(e,t,e.next)>=0&&ee(e,e.prev,t)>=0:ee(e,t,e.prev)<0||ee(e,e.next,t)<0}function fy(e,t){var r=e,n=!1,i=(e.x+t.x)/2,o=(e.y+t.y)/2;do r.y>o!=r.next.y>o&&r.next.y!==r.y&&i<(r.next.x-r.x)*(o-r.y)/(r.next.y-r.y)+r.x&&(n=!n),r=r.next;while(r!==e);return n}function Zd(e,t){var r=new zs(e.i,e.x,e.y),n=new zs(t.i,t.x,t.y),i=e.next,o=t.prev;return e.next=t,t.prev=e,r.next=i,i.prev=r,n.next=r,r.prev=n,o.next=n,n.prev=o,n}function Vd(e,t,r,n){var i=new zs(e,t,r);return n?(i.next=n.next,i.prev=n,n.next.prev=i,n.next=i):(i.prev=i,i.next=i),i}function ci(e){e.next.prev=e.prev,e.prev.next=e.next,e.prevZ&&(e.prevZ.nextZ=e.nextZ),e.nextZ&&(e.nextZ.prevZ=e.prevZ)}function zs(e,t,r){this.i=e,this.x=t,this.y=r,this.prev=null,this.next=null,this.z=0,this.prevZ=null,this.nextZ=null,this.steiner=!1}Bo.deviation=function(e,t,r,n){var i=t&&t.length,o=i?t[0]*r:e.length,a=Math.abs(Us(e,0,o,r));if(i)for(var s=0,l=t.length;s<l;s++){var f=t[s]*r,c=s<l-1?t[s+1]*r:e.length;a-=Math.abs(Us(e,f,c,r))}var u=0;for(s=0;s<n.length;s+=3){var d=n[s]*r,h=n[s+1]*r,g=n[s+2]*r;u+=Math.abs((e[d]-e[g])*(e[h+1]-e[d+1])-(e[d]-e[h])*(e[g+1]-e[d+1]))}return a===0&&u===0?0:Math.abs((u-a)/a)};function Us(e,t,r,n){for(var i=0,o=t,a=r-n;o<r;o+=n)i+=(e[a]-e[o])*(e[o+1]+e[a+1]),a=o;return i}Bo.flatten=function(e){for(var t=e[0][0].length,r={vertices:[],holes:[],dimensions:t},n=0,i=0;i<e.length;i++){for(var o=0;o<e[i].length;o++)for(var a=0;a<t;a++)r.vertices.push(e[i][o][a]);i>0&&(n+=e[i-1].length,r.holes.push(n))}return r}});var eh=X((o4,Jd)=>{Jd.exports=globalThis.deck});var Pr={};Ga(Pr,{carto:()=>S_});var za={};Ga(za,{BASEMAP:()=>eg,CARTO_LAYERS:()=>E_,CARTO_SOURCES:()=>Ip,CartoAPIError:()=>Cr,ClusterTileLayer:()=>jn,H3TileLayer:()=>lr,HeatmapTileLayer:()=>ei,LayerFactory:()=>hl,PointLabelLayer:()=>ni,QuadbinTileLayer:()=>cr,RasterTileLayer:()=>si,SOURCE_DEFAULTS:()=>Oi,VectorTileLayer:()=>Kr,_GOOGLE_BASEMAPS:()=>Ra,_QuadbinLayer:()=>Eo,_RasterLayer:()=>Mo,_STYLE_LAYER_GROUPS:()=>fl,_SpatialIndexTileLayer:()=>Zr,_applyLayerGroupFilters:()=>Da,_fetchStyle:()=>Na,_getStyleUrl:()=>Xe,boundaryQuerySource:()=>Xf,boundaryTableSource:()=>Qf,colorBins:()=>cl,colorCategories:()=>ul,colorContinuous:()=>dl,fetchBasemapProps:()=>og,fetchMap:()=>ng,h3QuerySource:()=>Sa,h3TableSource:()=>Ta,h3TilesetSource:()=>tl,quadbinQuerySource:()=>Aa,quadbinTableSource:()=>Pa,quadbinTilesetSource:()=>rl,query:()=>Op,rasterSource:()=>Fa,vectorQuerySource:()=>ka,vectorTableSource:()=>Ma,vectorTilesetSource:()=>La});var hd=G(kt(),1),pd=G(pt(),1),gd=G(pn(),1);function yl(e,t,r){switch(e.type){case"Point":return pg(e,t,r);case"LineString":return hg(e,t,r);case"Polygon":return xl(e,t,r);default:let n=e;throw new Error(`Unsupported geometry type: ${n?.type}`)}}function xl(e,t=-1/0,r=1/0){let{positions:n}=e,i=e.polygonIndices.value.filter(l=>l>=t&&l<=r),o=e.primitivePolygonIndices.value.filter(l=>l>=t&&l<=r);if(!(i.length>2)){let l=[];for(let f=0;f<o.length-1;f++){let c=o[f],u=o[f+1],d=Vi(n,c,u);l.push(d)}return{type:"Polygon",coordinates:l}}let s=[];for(let l=0;l<i.length-1;l++){let f=i[l],c=i[l+1],u=xl(e,f,c).coordinates;s.push(u)}return{type:"MultiPolygon",coordinates:s}}function hg(e,t=-1/0,r=1/0){let{positions:n}=e,i=e.pathIndices.value.filter(s=>s>=t&&s<=r);if(!(i.length>2))return{type:"LineString",coordinates:Vi(n,i[0],i[1])};let a=[];for(let s=0;s<i.length-1;s++){let l=Vi(n,i[s],i[s+1]);a.push(l)}return{type:"MultiLineString",coordinates:a}}function pg(e,t,r){let{positions:n}=e,i=Vi(n,t,r);return i.length>1?{type:"MultiPoint",coordinates:i}:{type:"Point",coordinates:i[0]}}function Vi(e,t,r){t=t||0,r=r||e.value.length/e.size;let n=[];for(let i=t;i<r;i++){let o=Array();for(let a=i*e.size;a<(i+1)*e.size;a++)o.push(Number(e.value[a]));n.push(o)}return n}function Hi(e,t){let r=t?.globalFeatureId;return r!==void 0?gg(e,r):mg(e,t?.type)}function gg(e,t){let r=vl(e);for(let n of r){let i=0,o=n.featureIds.value[0];for(let a=0;a<n.featureIds.value.length;a++){let s=n.featureIds.value[a];if(s!==o){if(t===n.globalFeatureIds.value[i])return $i(n,i,a);i=a,o=s}}if(t===n.globalFeatureIds.value[i])return $i(n,i,n.featureIds.value.length)}throw new Error(`featureId:${t} not found`)}function mg(e,t){let r=vl(e,t);return bg(r)}function vl(e,t){let r=[];return e.points&&(e.points.type="Point",r.push(e.points)),e.lines&&(e.lines.type="LineString",r.push(e.lines)),e.polygons&&(e.polygons.type="Polygon",r.push(e.polygons)),r}function bg(e){let t=[];for(let r of e){if(r.featureIds.value.length===0)continue;let n=0,i=r.featureIds.value[0];for(let o=0;o<r.featureIds.value.length;o++){let a=r.featureIds.value[o];a!==i&&(t.push($i(r,n,o)),n=o,i=a)}t.push($i(r,n,r.featureIds.value.length))}return t}function $i(e,t,r){let n=yl(e,t,r),i=xg(e,t,r),o=yg(e,t,r);return{type:"Feature",geometry:n,properties:i,...o}}function yg(e,t=0,r){return e.fields&&e.fields[e.featureIds.value[t]]}function xg(e,t=0,r){let n=Object.assign({},e.properties[e.featureIds.value[t]]);for(let i in e.numericProps)n[i]=e.numericProps[i].value[t];return n}var Vn=G(Se(),1);var Wt=Math.PI,Sg=Wt/4,z_=Wt/180,_l=180/Wt,El=512;function Fe(e){let[t,r]=e,n=t/El*(2*Wt)-Wt,i=2*(Math.atan(Math.exp(r/El*(2*Wt)-Wt))-Sg);return[n*_l,i*_l]}var j_=Math.PI/180;var Dg=Math.PI/180,Ng=180/Math.PI;function Ml(e){var t=Cl(e[0]+1,e[2]),r=Cl(e[0],e[2]),n=Al(e[1]+1,e[2]),i=Al(e[1],e[2]);return[r,n,t,i]}function zg(e){var t=Ml(e),r={type:"Polygon",coordinates:[[[t[0],t[1]],[t[0],t[3]],[t[2],t[3]],[t[2],t[1]],[t[0],t[1]]]]};return r}function Cl(e,t){return e/Math.pow(2,t)*360-180}function Al(e,t){var r=Math.PI-2*Math.PI*e/Math.pow(2,t);return Ng*Math.atan(.5*(Math.exp(r)-Math.exp(-r)))}function $a(e,t,r){var n=Dl(e,t,r);return n[0]=Math.floor(n[0]),n[1]=Math.floor(n[1]),n}function Ll(e){return[[e[0]*2,e[1]*2,e[2]+1],[e[0]*2+1,e[1]*2,e[2]+1],[e[0]*2+1,e[1]*2+1,e[2]+1],[e[0]*2,e[1]*2+1,e[2]+1]]}function Il(e){return e[0]%2===0&&e[1]%2===0?[e[0]/2,e[1]/2,e[2]-1]:e[0]%2===0&&!e[1]%2===0?[e[0]/2,(e[1]-1)/2,e[2]-1]:!e[0]%2===0&&e[1]%2===0?[(e[0]-1)/2,e[1]/2,e[2]-1]:[(e[0]-1)/2,(e[1]-1)/2,e[2]-1]}function Ol(e){return Ll(Il(e))}function Ug(e,t){for(var r=Ol(e),n=0;n<r.length;n++)if(!Bl(t,r[n]))return!1;return!0}function Bl(e,t){for(var r=0;r<e.length;r++)if(Rl(e[r],t))return!0;return!1}function Rl(e,t){return e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]}function qg(e){for(var t="",r=e[2];r>0;r--){var n=0,i=1<<r-1;e[0]&i&&n++,e[1]&i&&(n+=2),t+=n.toString()}return t}function Gg(e){for(var t=0,r=0,n=e.length,i=n;i>0;i--){var o=1<<i-1;switch(e[n-i]){case"0":break;case"1":t|=o;break;case"2":r|=o;break;case"3":t|=o,r|=o;break}}return[t,r,n]}function Vg(e){var t=$a(e[0],e[1],32),r=$a(e[2],e[3],32),n=[t[0],t[1],r[0],r[1]],i=$g(n);if(i===0)return[0,0,0];var o=n[0]>>>32-i,a=n[1]>>>32-i;return[o,a,i]}function $g(e){for(var t=28,r=0;r<t;r++){var n=1<<32-(r+1);if((e[0]&n)!=(e[2]&n)||(e[1]&n)!=(e[3]&n))return r}return t}function Dl(e,t,r){var n=Math.sin(t*Dg),i=Math.pow(2,r),o=i*(e/360+.5),a=i*(.5-.25*Math.log((1+n)/(1-n))/Math.PI);return[o,a,r]}var Zi={tileToGeoJSON:zg,tileToBBOX:Ml,getChildren:Ll,getParent:Il,getSiblings:Ol,hasTile:Bl,hasSiblings:Ug,tilesEqual:Rl,tileToQuadkey:qg,quadkeyToTile:Gg,pointToTile:$a,bboxToTile:Vg,pointToTileFraction:Dl},Hg=Zg;function Zg(e,t){var r,n,i=e.coordinates,o=t.max_zoom,a={},s=[];if(e.type==="Point")return[Zi.pointToTile(i[0],i[1],o)];if(e.type==="MultiPoint")for(r=0;r<i.length;r++)n=Zi.pointToTile(i[r][0],i[r][1],o),a[Ue(n[0],n[1],n[2])]=!0;else if(e.type==="LineString")Ha(a,i,o);else if(e.type==="MultiLineString")for(r=0;r<i.length;r++)Ha(a,i[r],o);else if(e.type==="Polygon")Pl(a,s,i,o);else if(e.type==="MultiPolygon")for(r=0;r<i.length;r++)Pl(a,s,i[r],o);else throw new Error("Geometry type not implemented");if(t.min_zoom!==o){var l=s.length;for(Fl(a,s),r=0;r<l;r++){var f=s[r];a[Ue(f[0],f[1],f[2])]=!0}return jg(a,s,t)}return Fl(a,s),s}function jg(e,t,r){for(var n=[],i=r.max_zoom;i>r.min_zoom;i--){for(var o={},a=[],s=0;s<t.length;s++){var l=t[s];if(l[0]%2===0&&l[1]%2===0){var f=Ue(l[0]+1,l[1],i),c=Ue(l[0],l[1]+1,i),u=Ue(l[0]+1,l[1]+1,i);if(e[f]&&e[c]&&e[u]){e[Ue(l[0],l[1],l[2])]=!1,e[f]=!1,e[c]=!1,e[u]=!1;var d=[l[0]/2,l[1]/2,i-1];i-1===r.min_zoom?n.push(d):(o[Ue(l[0]/2,l[1]/2,i-1)]=!0,a.push(d))}}}for(s=0;s<t.length;s++)l=t[s],e[Ue(l[0],l[1],l[2])]&&n.push(l);e=o,t=a}return n}function Pl(e,t,r,n){for(var i=[],o=0;o<r.length;o++){var a=[];Ha(e,r[o],n,a);for(var s=0,l=a.length,f=l-1;s<l;f=s++){var c=(s+1)%l,u=a[s][1];(u>a[f][1]||u>a[c][1])&&(u<a[f][1]||u<a[c][1])&&u!==a[c][1]&&i.push(a[s])}}for(i.sort(Wg),o=0;o<i.length;o+=2){u=i[o][1];for(var d=i[o][0]+1;d<i[o+1][0];d++){var h=Ue(d,u,n);e[h]||t.push([d,u,n])}}}function Wg(e,t){return e[1]-t[1]||e[0]-t[0]}function Ha(e,t,r,n){for(var i,o,a=0;a<t.length-1;a++){var s=Zi.pointToTileFraction(t[a][0],t[a][1],r),l=Zi.pointToTileFraction(t[a+1][0],t[a+1][1],r),f=s[0],c=s[1],u=l[0],d=l[1],h=u-f,g=d-c;if(!(g===0&&h===0)){var x=h>0?1:-1,S=g>0?1:-1,T=Math.floor(f),w=Math.floor(c),k=h===0?1/0:Math.abs(((h>0?1:0)+T-f)/h),I=g===0?1/0:Math.abs(((g>0?1:0)+w-c)/g),L=Math.abs(x/h),R=Math.abs(S/g);for((T!==i||w!==o)&&(e[Ue(T,w,r)]=!0,n&&w!==o&&n.push([T,w]),i=T,o=w);k<1||I<1;)k<I?(k+=L,T+=x):(I+=R,w+=S),e[Ue(T,w,r)]=!0,n&&w!==o&&n.push([T,w]),i=T,o=w}}n&&w===n[0][1]&&n.pop()}function Fl(e,t){for(var r=Object.keys(e),n=0;n<r.length;n++)t.push(Yg(+r[n]))}function Ue(e,t,r){var n=2*(1<<r);return(n*t+e)*32+r}function Yg(e){var t=e%32,r=2*(1<<t),n=(e-t)/32,i=n%r,o=(n-i)/r%r;return[i,o,t]}var Nl=[0x5555555555555555n,0x3333333333333333n,0x0f0f0f0f0f0f0f0fn,0x00ff00ff00ff00ffn,0x0000ffff0000ffffn,0x00000000ffffffffn],zl=[0n,1n,2n,4n,8n,16n],kl=512;function Kg(e){let{x:t,y:r,z:n}=Yt(e),i=kl/(1<<n);return[t*i,kl-r*i,i]}function Xg(e,t){let[r,n,i]=Kg(e);return[[r,n],[r+t*i,n-t*i]]}function Qg(e,t=1){let[r,n]=Xg(e,t),[i,o]=Fe(r),[a,s]=Fe(n);return[a,o,a,s,i,s,i,o,a,o]}function Ul(e){return BigInt(`0x${e}`)}function gn(e){return e.toString(16)}function mn(e){if(e.z<0||e.z>26)throw new Error("Wrong zoom");let t=BigInt(e.z),r=BigInt(e.x)<<32n-t,n=BigInt(e.y)<<32n-t;for(let o=0;o<5;o++){let a=zl[5-o],s=Nl[4-o];r=(r|r<<a)&s,n=(n|n<<a)&s}return 0x4000000000000000n|1n<<59n|t<<52n|(r|n<<1n)>>12n|0xfffffffffffffn>>t*2n}function Yt(e){let t=e>>59n&7n,r=e>>57n&3n,n=e>>52n&0x1fn,i=(e&0xfffffffffffffn)<<12n;if(t!==1n&&r!==0n)throw new Error("Wrong mode");let o=i,a=i>>1n;for(let s=0;s<6;s++){let l=zl[s],f=Nl[s];o=(o|o>>l)&f,a=(a|a>>l)&f}return o=o>>32n-n,a=a>>32n-n,{z:Number(n),x:Number(o),y:Number(a)}}function gt(e){return e>>52n&0x1fn}function ji(e){let t=gt(e)-1n;return e&~(0x1fn<<52n)|t<<52n|0xfffffffffffffn>>t*2n}function ql(e,t){let r=Number(t);return Hg(e,{min_zoom:r,max_zoom:r}).map(([n,i,o])=>mn({x:n,y:i,z:o}))}function Gl(e){let t=Qg(e);return{type:"Polygon",coordinates:[[[t[0],t[1]],[t[2],t[3]],[t[4],t[5]],[t[6],t[7]],[t[0],t[1]]]]}}var Yi=G(Kt(),1),Zl=G(Se(),1);var $l=G(Se(),1);function ke(e,t){$l.log.assert(e,t)}function Hl(e,t){let{properties:r,numericProps:n}=e;return new Proxy(r[t]||{},{get(i,o){return o in n?n[o].value[t]:i[o]},has(i,o){return o in n||o in i},ownKeys(i){return[...Object.keys(n),...Reflect.ownKeys(i)]},getOwnPropertyDescriptor(i,o){return{enumerable:!0,configurable:!0}}})}function Mt(e,t){return`https://unpkg.com/@deck.gl/carto@${t}/dist/${e}-worker.js`}var bn=new Uint16Array,Za={positions:{value:new Float32Array,size:2},properties:[],numericProps:{},featureIds:{value:bn,size:1},globalFeatureIds:{value:bn,size:1}};function Wi(){return{shape:"binary-feature-collection",points:{type:"Point",...Za},lines:{type:"LineString",pathIndices:{value:bn,size:1},...Za},polygons:{type:"Polygon",polygonIndices:{value:bn,size:1},primitivePolygonIndices:{value:bn,size:1},...Za}}}function yn(e,t,r,n,i,o=2){return{type:"Point",positions:{value:new Float32Array(e),size:o},featureIds:{value:new Uint16Array(t),size:1},globalFeatureIds:{value:new Uint32Array(r),size:1},numericProps:n,properties:i}}function ja(e,t){let r={};return t&&Object.keys(t).forEach(n=>{r[n]={value:new Float32Array(e),size:1}}),r}function Wa(e,t,r,n){Object.keys(e).forEach(i=>{t[i].value[n]=e[i].value[r]})}function jl(e,t,r,n=[],i,o,a="quadbin"){if(!e.content)return!1;e.userData||(e.userData={});let s=t.get(r)?.[0];if(s){if(n.every(f=>f.name in s))return!1;t.clear()}let l={};for(let f of e.content){let c=f.id,u=typeof i=="function"?i(f,{}):i;for(let S=0;S<r-1;S++)if(a==="h3"){let T=(0,Yi.getResolution)(c);c=(0,Yi.cellToParent)(c,Math.max(0,T-1))}else c=ji(c);let d=String(c);if(!(d in l)){l[d]={id:c,count:0,position:[0,0]};for(let{name:S,aggregation:T}of n)T==="any"?l[d][S]=f.properties[S]:l[d][S]=0}let h=l[d].count;l[d].count+=typeof o=="function"?o(f,{}):o;let g=l[d].count,x=g-h;l[d].position[0]=(h*l[d].position[0]+x*u[0])/g,l[d].position[1]=(h*l[d].position[1]+x*u[1])/g;for(let{name:S,aggregation:T}of n){let w=l[d][S],k=f.properties[S];T==="average"?l[d][S]=(h*w+x*k)/g:T==="count"||T==="sum"?l[d][S]=w+k:T==="max"?l[d][S]=Math.max(w,k):T==="min"&&(l[d][S]=Math.min(w,k))}}return t.set(r,Object.values(l)),!0}function Wl(e){let t=[],r=["any","average","count","min","max","sum"];for(let n of Object.keys(e.content[0].properties)){let i=n.split("_").pop().toLowerCase();r.includes(i)||(Zl.log.warn(`No valid aggregation present in ${n} property`)(),i="any"),t.push({name:n,aggregation:i})}return t}function Yl(e,t){let r={};for(let{name:n,aggregation:i}of t)if(r[n]={min:1/0,max:-1/0},i!=="any")for(let o of e)r[n].min=Math.min(r[n].min,o[n]),r[n].max=Math.max(r[n].max,o[n]);return r}function Kl(e){let t=new Float32Array(e.length*2),r=new Uint16Array(e.length);for(let n=0;n<e.length;n++)t.set(e[n].position,2*n),r[n]=n;return{...Wi(),points:yn(t,r,r,{},e)}}var Xl=G(pt(),1);var et=class extends Xl._Tileset2D{getTileIndices(t){return super.getTileIndices(t).map(mn).map(r=>({q:r,i:gn(r)}))}getTileId({q:t,i:r}){return r||gn(t)}getTileMetadata({q:t}){return super.getTileMetadata(Yt(t))}getTileZoom({q:t}){return Number(gt(t))}getParentIndex({q:t}){return{q:ji(t)}}};var Jl=G(pt(),1),ie=G(Kt(),1),Ql=85.051128;function ec({west:e,north:t,east:r,south:n},i,o=1){let l=[[t,r],[n,r],[n,e],[t,e]].map(u=>(0,ie.latLngToCell)(u[0],u[1],i)).map(u=>Math.max(...(0,ie.originToDirectedEdges)(u).map(d=>(0,ie.edgeLength)(d,ie.UNITS.rads)))*180/Math.PI),f=Math.max(...l)*o,c=Math.min(180,f/Math.cos((t+n)/2*Math.PI/180));return{north:Math.min(t+f,Ql),east:r+c,south:Math.max(n-f,-Ql),west:e-c}}function tc({west:e,north:t,east:r,south:n},i){let o=Math.abs(r-e);if(o>180){let s=Math.ceil(o/180),l=[];for(let f=0;f<s;f++){let c=e+f*180,u=Math.min(c+179.9999999,r);l=l.concat(tc({west:c,north:t,east:u,south:n},i))}return[...new Set(l)]}return(0,ie.polygonToCells)([[t,r],[n,r],[n,e],[t,e],[t,r]],i)}function Jg(e){let t=(0,ie.cellToBoundary)(e),r=t.map(f=>f[0]),n=t.map(f=>f[1]),i=Math.min(...n),o=Math.min(...r),a=Math.max(...n),s=Math.max(...r);return ec({west:i,south:o,east:a,north:s},(0,ie.getResolution)(e),.12)}var em=2;function Fr(e,t){let r=Math.log2(t/512),n=2/3*(e.zoom-r),i=Math.log(1/Math.cos(Math.PI*e.latitude/180));return Math.max(0,Math.floor(n+i-em))}var Lt=class extends Jl._Tileset2D{getTileIndices({viewport:t,minZoom:r,maxZoom:n}){if(t.latitude===void 0)return[];let[i,o,a,s]=t.getBounds(),{tileSize:l}=this.opts,f=Fr(t,l),c;if(typeof r=="number"&&Number.isFinite(r)&&f<r)return[];if(typeof n=="number"&&Number.isFinite(n)&&f>n){f=n;let u=(0,ie.latLngToCell)(t.latitude,t.longitude,n);c=(0,ie.gridDisk)(u,1)}else{let u=ec({west:i,north:s,east:a,south:o},f);c=tc(u,f)}return c.map(u=>({i:u}))}getTileId({i:t}){return t}getTileMetadata({i:t}){return{bbox:Jg(t)}}getTileZoom({i:t}){return(0,ie.getResolution)(t)}getParentIndex(t){let r=(0,ie.getResolution)(t.i);return{i:(0,ie.cellToParent)(t.i,r-1)}}};var rc=512;function Ya(e){let{x:t,y:r,z:n}=Yt(e),i=rc/(1<<n);return[t*i,rc-r*i,i]}function tm(e,t){let[r,n,i]=Ya(e);return[[r,n],[r+t*i,n-t*i]]}function Ki(e,t=1){let[r,n]=tm(e,t),[i,o]=Fe(r),[a,s]=Fe(n);return[a,o,a,s,i,s,i,o,a,o]}var xo=G(Kt(),1);var tt={self:typeof self<"u"&&self,window:typeof window<"u"&&window,global:typeof global<"u"&&global,document:typeof document<"u"&&document},rm=tt.self||tt.window||tt.global||{},nm=tt.window||tt.self||tt.global||{},im=tt.global||tt.self||tt.window||{},om=tt.document||{};var kr=Boolean(typeof process!="object"||String(process)!=="[object process]"||process.browser);var nc=typeof process<"u"&&process.version&&/v([0-9]*)/.exec(process.version),am=nc&&parseFloat(nc[1])||0;var ic=e=>typeof SharedArrayBuffer<"u"&&e instanceof SharedArrayBuffer;function Ka(e){globalThis.loaders||={},globalThis.loaders.modules||={},Object.assign(globalThis.loaders.modules,e)}function oc(...e){return sm(e)}function sm(e){let t=e.map(o=>o instanceof ArrayBuffer?new Uint8Array(o):o),r=t.reduce((o,a)=>o+a.byteLength,0),n=new Uint8Array(r),i=0;for(let o of t)n.set(o,i),i+=o.byteLength;return n.buffer}async function Xa(e){let t=[];for await(let r of e)t.push(fm(r));return oc(...t)}function fm(e){if(e instanceof ArrayBuffer)return e;if(ArrayBuffer.isView(e)){let{buffer:t,byteOffset:r,byteLength:n}=e;return ac(t,r,n)}return ac(e)}function ac(e,t=0,r=e.byteLength-t){let n=new Uint8Array(e,t,r),i=new Uint8Array(n.length);return i.set(n),i.buffer}function sc(e){return e&&typeof e=="object"&&e.isBuffer}function It(e){if(sc(e))return e;if(e instanceof ArrayBuffer)return e;if(ic(e))return fc(e);if(ArrayBuffer.isView(e)){let t=e.buffer;return e.byteOffset===0&&e.byteLength===e.buffer.byteLength?t:t.slice(e.byteOffset,e.byteOffset+e.byteLength)}if(typeof e=="string"){let t=e;return new TextEncoder().encode(t).buffer}if(e&&typeof e=="object"&&e._toArrayBuffer)return e._toArrayBuffer();throw new Error("toArrayBuffer")}function fc(e,t=0,r=e.byteLength-t){let n=new Uint8Array(e,t,r),i=new Uint8Array(n.length);return i.set(n),i.buffer}function Mr(e){return t=>new Promise((r,n)=>e(t,(i,o)=>i?n(i):r(o)))}var Xi=class{constructor(t){this.compressBatches=this.compressBatches.bind(this),this.decompressBatches=this.decompressBatches.bind(this)}async preload(t={}){Ka(t)}async compress(t){return await this.preload(),this.compressSync(t)}async decompress(t,r){return await this.preload(),this.decompressSync(t,r)}compressSync(t){throw new Error(`${this.name}: sync compression not supported`)}decompressSync(t,r){throw new Error(`${this.name}: sync decompression not supported`)}async*compressBatches(t){let r=await this.concatenate(t);yield this.compress(r)}async*decompressBatches(t){let r=await this.concatenate(t);yield this.decompress(r)}concatenate(t){return Xa(t)}improveError(t){return t.message.includes(this.name)||(t.message=`${this.name} ${t.message}`),t}};var or=G(Yu(),1),vt=G(Ku(),1),go=class extends Xi{name="deflate";extensions=[];contentEncodings=["deflate"];isSupported=!0;options;_chunks=[];constructor(t={}){super(t),this.options=t}async compress(t){if(!kr&&this.options.deflate?.useZlib){let r=this.options.deflate?.gzip?await Mr(vt.default.gzip)(t):await Mr(vt.default.deflate)(t);return It(r)}return this.compressSync(t)}async decompress(t){if(!kr&&this.options.deflate?.useZlib){let r=this.options.deflate?.gzip?await Mr(vt.default.gunzip)(t):await Mr(vt.default.inflate)(t);return It(r)}return this.decompressSync(t)}compressSync(t){if(!kr&&this.options.deflate?.useZlib){let o=this.options.deflate?.gzip?vt.default.gzipSync(t):vt.default.deflateSync(t);return It(o)}let r=this.options?.deflate||{},n=new Uint8Array(t),i=this.options?.raw?or.default.deflateRaw:or.default.deflate;return It(i(n,r).buffer)}decompressSync(t){if(!kr&&this.options.deflate?.useZlib){let o=this.options.deflate?.gzip?vt.default.gunzipSync(t):vt.default.inflateSync(t);return It(o)}let r=this.options?.deflate||{},n=new Uint8Array(t),i=this.options?.raw?or.default.inflateRaw:or.default.inflate;return It(i(n,r).buffer)}async*compressBatches(t){let r=this.options?.deflate||{},n=new or.default.Deflate(r);yield*this.transformBatches(n,t)}async*decompressBatches(t){let r=this.options?.deflate||{},n=new or.default.Inflate(r);yield*this.transformBatches(n,t)}async*transformBatches(t,r){t.onData=this._onData.bind(this),t.onEnd=this._onEnd.bind(this);for await(let a of r){let s=new Uint8Array(a);if(!t.push(s,!1))throw new Error(`${this._getError()}write`);yield*this._getChunks()}let n=new Uint8Array(0),i=t.push(n,!0);yield*this._getChunks()}_onData(t){this._chunks.push(t)}_onEnd(t){if(t!==0)throw new Error(this._getError(t)+this._chunks.length)}_getChunks(){let t=this._chunks;return this._chunks=[],t}_getError(t=0){let r={2:"need dictionary",1:"stream end",0:"","-1":"file error","-2":"stream error","-3":"data error","-4":"insufficient memory","-5":"buffer error","-6":"incompatible version"};return`${this.name}: ${r[t]}`}};var Bn=class extends go{name="gzip";extensions=["gz","gzip"];contentEncodings=["gzip","x-gzip"];isSupported=!0;constructor(t){super({...t,deflate:{...t?.gzip,gzip:!0}})}};function ar(e,t,r,n){let i=t.type===2?t.readVarint()+t.pos:t.pos+1,o=t.buf.buffer.slice(t.pos,i);if(n?.compression==="gzip"){let s=new Bn().decompressSync(o);r.value=new e(s)}else r.value=new e(o);return t.pos=i,r.value}var Rn=class{static read(t,r){return t.readFields(Rn._readField,{key:"",value:null},r)}static _readField(t,r,n){t===1?r.key=n.readString():t===2&&(r.value=n.readString())}},Ve=class{static read(t,r){return t.readFields(Ve._readField,{},r)}static _readField(t,r,n){if(t===1){let{key:i,value:o}=Rn.read(n,n.readVarint()+n.pos);r[i]=o}}},sr=class{static read(t,r){let{value:n,size:i}=t.readFields(sr._readField,{value:[],size:0},r);return{value:n,size:i}}static _readField(t,r,n){t===1?ar(Float64Array,n,r):t===2&&(r.size=n.readVarint(!0))}},ye=class{static read(t,r){let{value:n,size:i}=t.readFields(ye._readField,{value:[],size:0},r);return{value:new Uint32Array(n),size:i}}static _readField(t,r,n){t===1?n.readPackedVarint(r.value):t===2&&(r.size=n.readVarint(!0))}},fr=class{static read(t,r){return t.readFields(fr._readField,{id:0},r)}static _readField(t,r,n){t===1&&(r.id=n.readVarint())}},Dn=class{static read(t,r){return t.readFields(Dn._readField,{value:[]},r)}static _readField(t,r,n){t===1&&ar(Float64Array,n,r)}},$e=class{static read(t,r){return t.readFields($e._readField,{key:"",value:null},r)}static _readField(t,r,n){t===1?r.key=n.readString():t===2&&(r.value=Dn.read(n,n.readVarint()+n.pos))}},Nn=class{static read(t,r){return t.readFields(Nn._readField,{positions:null,globalFeatureIds:null,featureIds:null,properties:[],numericProps:{},fields:[]},r)}static _readField(t,r,n){if(t===1)r.positions=sr.read(n,n.readVarint()+n.pos);else if(t===2)r.globalFeatureIds=ye.read(n,n.readVarint()+n.pos);else if(t===3)r.featureIds=ye.read(n,n.readVarint()+n.pos);else if(t===4)r.properties.push(Ve.read(n,n.readVarint()+n.pos));else if(t===5){let i=$e.read(n,n.readVarint()+n.pos);r.numericProps[i.key]=i.value}else t===6&&r.fields.push(fr.read(n,n.readVarint()+n.pos))}},zn=class{static read(t,r){return t.readFields(zn._readField,{positions:null,pathIndices:null,globalFeatureIds:null,featureIds:null,properties:[],numericProps:{},fields:[]},r)}static _readField(t,r,n){if(t===1)r.positions=sr.read(n,n.readVarint()+n.pos);else if(t===2)r.pathIndices=ye.read(n,n.readVarint()+n.pos);else if(t===3)r.globalFeatureIds=ye.read(n,n.readVarint()+n.pos);else if(t===4)r.featureIds=ye.read(n,n.readVarint()+n.pos);else if(t===5)r.properties.push(Ve.read(n,n.readVarint()+n.pos));else if(t===6){let i=$e.read(n,n.readVarint()+n.pos);r.numericProps[i.key]=i.value}else t===7&&r.fields.push(fr.read(n,n.readVarint()+n.pos))}},Un=class{static read(t,r){return t.readFields(Un._readField,{positions:null,polygonIndices:null,globalFeatureIds:null,featureIds:null,primitivePolygonIndices:null,triangles:null,properties:[],numericProps:{},fields:[]},r)}static _readField(t,r,n){if(t===1)r.positions=sr.read(n,n.readVarint()+n.pos);else if(t===2)r.polygonIndices=ye.read(n,n.readVarint()+n.pos);else if(t===3)r.globalFeatureIds=ye.read(n,n.readVarint()+n.pos);else if(t===4)r.featureIds=ye.read(n,n.readVarint()+n.pos);else if(t===5)r.primitivePolygonIndices=ye.read(n,n.readVarint()+n.pos);else if(t===6)r.triangles=ye.read(n,n.readVarint()+n.pos);else if(t===7)r.properties.push(Ve.read(n,n.readVarint()+n.pos));else if(t===8){let i=$e.read(n,n.readVarint()+n.pos);r.numericProps[i.key]=i.value}else t===9&&r.fields.push(fr.read(n,n.readVarint()+n.pos))}},Gr=class{static read(t,r){return t.readFields(Gr._readField,{points:null,lines:null,polygons:null},r)}static _readField(t,r,n){t===1?r.points=Nn.read(n,n.readVarint()+n.pos):t===2?r.lines=zn.read(n,n.readVarint()+n.pos):t===3&&(r.polygons=Un.read(n,n.readVarint()+n.pos))}};var qn=class{static read(t,r){return t.readFields(qn._readField,{value:[]},r)}static _readField(t,r,n){t===1&&ar(BigUint64Array,n,r)}},Gn=class{static read(t,r){return t.readFields(Gn._readField,{indices:null,properties:[],numericProps:{}},r)}static _readField(t,r,n){if(t===1)r.indices=qn.read(n,n.readVarint()+n.pos);else if(t===2)r.properties.push(Ve.read(n,n.readVarint()+n.pos));else if(t===3){let i=$e.read(n,n.readVarint()+n.pos);r.numericProps[i.key]=i.value}}},Vr=class{static read(t,r){return t.readFields(Vr._readField,{scheme:0,cells:null},r)}static _readField(t,r,n){t===1?r.scheme=n.readVarint():t===2&&(r.cells=Gn.read(n,n.readVarint()+n.pos))}};var id=G(nd(),1);function Ut(e,t){let r=new id.default(e);return t.read(r)}function od(e){let{cells:t,scheme:r}=e,n=t.indices.value.length,i=[];for(let o=0;o<n;o++){let a=r==="h3"?gn(t.indices.value[o]):t.indices.value[o],s={...t.properties[o]};for(let l of Object.keys(t.numericProps))s[l]=t.numericProps[l].value[o];i.push({id:a,properties:s})}return i}var sd="9.3.10",fd="cartoSpatialTile",yb={cartoSpatialTile:{scheme:"quadbin",workerUrl:Mt(fd,sd)}},xb={name:"CARTO Spatial Tile",version:sd,id:fd,module:"carto",extensions:["pbf"],mimeTypes:["application/vnd.carto-spatial-tile"],category:"geometry",parse:async(e,t)=>ad(e,t),parseSync:ad,worker:!0,options:yb};function ad(e,t){if(!e)return null;let r=Ut(e,Vr),{cells:n}=r,i=t?.cartoSpatialTile?.scheme;return od({cells:n,scheme:i})}var yo=xb;var ld=G(Se(),1),cd=G(Se(),1);function He(e,t,r=0){if(!e)return t;if(!t)return e;if(r>10)return t;let n={...e};for(let i in t){let o=t[i];o===e||o===t||(typeof o=="object"&&o!==null?n[i]=He(e[i],o,r+1):n[i]=o)}return n}function ud(e,t){let r={};for(let{geoid:n,...i}of t.properties)n in r?ld.log.warn("Duplicate geoid key in boundary mapping, using first occurance")():r[n]=i;for(let n of["points","lines","polygons"]){let i=e[n];if(i.positions.value.length===0)continue;i.properties=i.properties.map(({geoid:f})=>r[f]);let{positions:o,globalFeatureIds:a}=i,s=null;n==="lines"&&(s=i.pathIndices.value),n==="polygons"&&(s=i.polygonIndices.value);let l=o.value.length/o.size;for(let f in t.numericProps){let c=t.numericProps[f].value,u=c.constructor,d=new u(l);if(i.numericProps[f]={value:d,size:1},s)for(let h=0;h<s.length-1;h++){let g=s[h],x=s[h+1],S=a.value[g];d.fill(c[S],g,x)}else for(let h=0;h<l;h++){let g=a.value[h];d[h]=c[g]}}}return e}var Ce={type:"object",value:null,validate:(e,t)=>t.optional&&e===null||typeof e=="object"&&Array.isArray(e.tiles)&&e.tiles.every(r=>typeof r=="string"),equal:(e,t)=>(0,cd._deepEqual)(e,t,2),async:!0};(0,gd.registerLoaders)([yo]);function dd(e){if(e===Lt)return"h3";if(e===et)return"quadbin";throw new Error("Invalid tileset class")}var md={data:Ce,clusterLevel:{type:"number",value:5,min:1},getPosition:{type:"accessor",value:({id:e})=>{if(typeof e=="string"){let[t,r]=(0,xo.cellToLatLng)(e);return[r,t]}return Ki(e,.5).slice(2,4)}},getWeight:{type:"accessor",value:1},refinementStrategy:"no-overlap",tileSize:512},$n=class extends pd.TileLayer{initializeState(){super.initializeState(),this.state.aggregationCache=new WeakMap,this.state.scheme=dd(this.props.TilesetClass)}updateState(t){let{props:r}=t,n=dd(r.TilesetClass);this.state.scheme!==n&&(this.setState({scheme:n,tileset:null}),this.state.aggregationCache=new WeakMap),super.updateState(t)}renderLayers(){let t=this.state.tileset?.tiles.filter(h=>h.isLoaded&&h.content&&this.state.tileset.isTileVisible(h));if(!t?.length||!this.state.tileset)return null;t.sort((h,g)=>g.zoom-h.zoom);let{getPosition:r,getWeight:n}=this.props,{aggregationCache:i,scheme:o}=this.state,a=o==="h3",s=Wl(t[0]),l=[],f=!1,c=this._getAggregationLevels(t);for(let h of t){let g=i.get(h.content);g||(g=new Map,i.set(h.content,g));let x=jl(h,g,c,s,r,n,a?"h3":"quadbin");f||(f=x),l.push(...g.get(c))}l.sort((h,g)=>Number(g.count-h.count));let u=l?.map(h=>h.id);if(f||(f=!(0,Vn._deepEqual)(u,this.state.clusterIds,1)),this.setState({clusterIds:u}),f){let h=Yl(l,s),g=Kl(l);g.points.attributes={stats:h},this.setState({data:g})}let d={...this.props,id:"clusters",data:this.state.data,dataComparator:(h,g)=>{let x=h?.points?.properties?.map(T=>T.id),S=g?.points?.properties?.map(T=>T.id);return(0,Vn._deepEqual)(x,S,1)}};return new hd.GeoJsonLayer(this.getSubLayerProps(d))}getPickingInfo(t){let r=t.info;if(r.index!==-1){let{data:n}=t.sourceLayer.props;r.object=Hi(n,{globalFeatureId:r.index})}return r}_updateAutoHighlight(t){for(let r of this.getSubLayers())r.updateAutoHighlight(t)}filterSubLayer(){return!0}_getAggregationLevels(t){let r=this.state.scheme==="h3",n=t[0],i,o;r?(i=(0,xo.getResolution)(n.id),o=Fr(this.context.viewport,this.state.tileset.opts.tileSize)):(i=n.zoom,o=this.context.viewport.zoom);let a=Math.round(o-i);return Math.round(this.props.clusterLevel)-a}};$n.layerName="ClusterGeoJsonLayer";$n.defaultProps=md;var Hn=class extends Vn.CompositeLayer{getLoadOptions(){let t=this.props.data,r=t&&"scheme"in t?t.scheme:"quadbin";return He(super.getLoadOptions(),{fetch:{headers:{Authorization:`Bearer ${t.accessToken}`}},cartoSpatialTile:{scheme:r}})}renderLayers(){let t=this.props.data;if(!t)return null;let{tiles:r,maxresolution:n}=t,o=t&&"scheme"in t&&t.scheme==="h3"?Lt:et;return[new $n(this.props,{id:`cluster-geojson-layer-${this.props.id}`,data:r,TilesetClass:o,maxZoom:n,loadOptions:this.getLoadOptions()})]}};Hn.layerName="ClusterTileLayer";Hn.defaultProps=md;var jn=Hn;var xd=G(Se(),1),Os=G(pt(),1);var bd=G(pn(),1);var yd=G(pt(),1);(0,bd.registerLoaders)([yo]);function vb(e){return e!=null&&e!==""}var wb={tileSize:512},Wn=class extends yd.TileLayer{_updateAutoHighlight(t){let{hoveredFeatureId:r}=this.state,n=t.object,i=null;if(n&&(i=n.id),r!==i){let{highlightColor:o}=this.props;typeof o=="function"&&(o=o(t)),this.setState({highlightColor:o,hoveredFeatureId:i})}}getSubLayerPropsByTile(t){return{highlightedObjectIndex:this.getHighlightedObjectIndex(t),highlightColor:this.state.highlightColor}}getHighlightedObjectIndex(t){let{hoveredFeatureId:r}=this.state,n=t.content;return!vb(r)||!Array.isArray(n)||!this._featureInTile(t,r)?-1:n.findIndex(o=>o.id===r)}_featureInTile(t,r){let n=this.state.tileset,i=n.getTileZoom(t.index),o=t.index.q?"q":"i",a={[o]:r},s=n.getTileZoom(a);for(;!(s<=i);)a=n.getParentIndex(a),s=n.getTileZoom(a);return a[o]===t.index[o]}};Wn.layerName="SpatialIndexTileLayer";Wn.defaultProps=wb;var Zr=Wn;var _b=e=>{let{data:t}=e,{index:r}=e.tile;return!t||!t.length?null:new Os.H3HexagonLayer(e,{getHexagon:n=>n.id,centerHexagon:r,highPrecision:!0})},Eb={data:Ce,tileSize:512},Yn=class extends xd.CompositeLayer{initializeState(){Os.H3HexagonLayer._checkH3Lib()}getLoadOptions(){let t=this.props.data;return He(super.getLoadOptions(),{fetch:{headers:{Authorization:`Bearer ${t.accessToken}`}},cartoSpatialTile:{scheme:"h3"}})}renderLayers(){let t=this.props.data;if(!t)return null;let{tiles:r}=t,{minresolution:n,maxresolution:i}=t;this.props.minZoom&&(n=Math.max(n,Fr({zoom:this.props.minZoom,latitude:0},this.props.tileSize))),this.props.maxZoom&&(i=Math.min(i,Fr({zoom:this.props.maxZoom,latitude:0},this.props.tileSize)));let o=this.getSubLayerClass("spatial-index-tile",Zr);return new o(this.props,{id:`h3-tile-layer-${this.props.id}`,data:r,TilesetClass:Lt,renderSubLayers:_b,minZoom:n,maxZoom:i,loadOptions:this.getLoadOptions()})}};Yn.layerName="H3TileLayer";Yn.defaultProps=Eb;var lr=Yn;var To=G(Kt(),1),Co=G(Se(),1),Ed=G(kt(),1);var Sb=`layout(std140) uniform heatmapUniforms {
|
|
8
8
|
vec2 colorDomain;
|
|
9
9
|
vec2 delta;
|
|
10
10
|
float intensity;
|
|
@@ -166,7 +166,7 @@ vColor = vec4(color.rgb, color.a * layer.opacity);
|
|
|
166
166
|
}
|
|
167
167
|
DECKGL_FILTER_COLOR(vColor, geometry);
|
|
168
168
|
}
|
|
169
|
-
`;var zb={...Ds.ColumnLayer.defaultProps,extruded:!1,diskResolution:4,vertices:[[-.5,-.5],[.5,-.5],[.5,.5],[-.5,.5]]},ko=class extends _o(Ds.ColumnLayer){getShaders(){let t=super.getShaders(),r=this.props.data,n=r.data.blockSize??Math.sqrt(r.length);return{...t,defines:{...t.defines,BLOCK_WIDTH:n},vs:kd}}initializeState(){this.getAttributeManager().addInstanced({instanceElevations:{size:1,transition:!0,accessor:"getElevation"},instanceFillColors:{size:this.props.colorFormat.length,type:"unorm8",transition:!0,accessor:"getFillColor",defaultValue:[0,0,0,255]},instanceLineColors:{size:this.props.colorFormat.length,type:"unorm8",transition:!0,accessor:"getLineColor",defaultValue:[255,255,255,255]}})}};ko.layerName="RasterColumnLayer";function Ub(e,t){return e.data===t.data&&e.length===t.length}var ii=class extends Md.CompositeLayer{renderLayers(){let{data:t,getElevation:r,getFillColor:n,getLineColor:i,getLineWidth:o,tileIndex:a,updateTriggers:s}=this.props;if(!t||!a||t.length===0)return null;let l=t.blockSize??0,[f,c,u]=Ya(a),d=[f,c],h=u/l,g=this.getSubLayerClass("column",ko),{highlightedObjectIndex:x,highlightColor:S}=this.state;return new g(this.props,this.getSubLayerProps({id:"cell",updateTriggers:s,getElevation:this.getSubLayerAccessor(r),getFillColor:this.getSubLayerAccessor(n),getLineColor:this.getSubLayerAccessor(i),getLineWidth:this.getSubLayerAccessor(o)}),{data:{data:t,length:l*l},dataComparator:Ub,offset:d,lineWidthScale:h,highlightedObjectIndex:x,highlightColor:S})}getSubLayerAccessor(t){return typeof t!="function"?super.getSubLayerAccessor(t):(r,n)=>{let{data:i,index:o}=n,a=i.data,s=Hl(a.cells,o);return t({properties:s},n)}}getPickingInfo(t){let r=super.getPickingInfo(t);return r.index!==-1&&(r.object=this.getSubLayerAccessor(n=>n)(void 0,{data:this.props,index:r.index})),r}_updateAutoHighlight(t){let{highlightedObjectIndex:r}=this.state,n=-1;if(t.index!==-1&&(n=t.index),r!==n){let{highlightColor:i}=this.props;typeof i=="function"&&(i=i(t)),this.setState({highlightColor:i,highlightedObjectIndex:n})}}};ii.layerName="RasterLayer";ii.defaultProps=zb;var Mo=ii;var Dd=G(pt(),1);var Nd=G(pn(),1);var qb={uint8:Uint8Array,uint16:Uint16Array,uint32:Uint32Array,uint64:BigUint64Array,int8:Int8Array,int16:Int16Array,int32:Int32Array,int64:BigInt64Array,float32:Float32Array,float64:Float64Array},oi=class{static read(t,r){return t.readFields(oi._readField,{name:"",type:"",data:null},r)}static _readField(t,r,n){if(t===1)r.name=n.readString();else if(t===2)r.type=n.readString();else if(t===3){let i=qb[r.type];if(!i)throw Error(`Invalid data type: ${r.type}`);r.data={};let{compression:o}=qt;ar(i,n,r.data,{compression:o})}}},qt=class{static read(t,r){return t.readFields(qt._readField,{blockSize:0,bands:[]},r)}static _readField(t,r,n){t===1?r.blockSize=n.readVarint():t===2&&r.bands.push(oi.read(n,n.readVarint()+n.pos))}};var Id="9.3.9",Od="cartoRasterTile",Gb={cartoRasterTile:{metadata:null,workerUrl:Mt(Od,Id)}},Vb={name:"CARTO Raster Tile",version:Id,id:Od,module:"carto",extensions:["pbf"],mimeTypes:["application/vnd.carto-raster-tile"],category:"geometry",parse:async(e,t)=>Ld(e,t),parseSync:Ld,worker:!0,options:Gb};function Ld(e,t){let r=t?.cartoRasterTile?.metadata;if(!e||!r)return null;qt.compression=r.compression;let n=Ut(e,qt),{bands:i,blockSize:o}=n,a={};for(let s=0;s<i.length;s++){let{name:l,data:f}=i[s];a[l]=f}return{blockSize:o,cells:{numericProps:a,properties:[]}}}var Bd=Vb;(0,Nd.registerLoaders)([Bd]);var $b=e=>{let t=e.tile?.index?.q;return t?new Mo(e,{tileIndex:t}):null},Hb={data:Ce,refinementStrategy:"no-overlap",tileSize:512},Lo=class extends Kn(Dd.TileLayer,vd){filterSubLayer(t){let{tile:r}=t.layer.props;return r?super.filterSubLayer(t):!0}};Lo.layerName="PostProcessTileLayer";var ai=class extends Rd.CompositeLayer{getLoadOptions(){let t=this.props.data;return He(super.getLoadOptions(),{fetch:{headers:{Authorization:`Bearer ${t.accessToken}`}}})}renderLayers(){let t=this.props.data;if(!t)return null;let{tiles:r,minzoom:n,maxzoom:i,raster_metadata:o}=t,a=this.getSubLayerClass("tile",Lo),s=this.getLoadOptions();return new a(this.props,{id:`raster-tile-layer-${this.props.id}`,data:r,TilesetClass:et,renderSubLayers:$b,minZoom:n,maxZoom:i,loadOptions:{...s,cartoRasterTile:{...s?.cartoRasterTile,metadata:o}}})}};ai.layerName="RasterTileLayer";ai.defaultProps=Hb;var si=ai;var ah=G(pn(),1);var jr=class{static read(t,r){return t.readFields(jr._readField,{properties:[],numericProps:{}},r)}static _readField(t,r,n){if(t===1)r.properties.push(Ve.read(n,n.readVarint()+n.pos));else if(t===2){let i=$e.read(n,n.readVarint()+n.pos);r.numericProps[i.key]=i.value}}};var Ud="9.3.9",qd="cartoPropertiesTile",Zb={cartoPropertiesTile:{workerUrl:Mt(qd,Ud)}},jb={name:"CARTO Properties Tile",version:Ud,id:qd,module:"carto",extensions:["pbf"],mimeTypes:["application/vnd.carto-properties-tile"],category:"geometry",worker:!0,parse:async(e,t)=>zd(e,t),parseSync:zd,options:Zb};function zd(e,t){return e?Ut(e,jr):null}var Gd=jb;var Yd=G(jd(),1);var Kd="9.3.9",Xd="cartoVectorTile",ly={cartoVectorTile:{workerUrl:Mt(Xd,Kd)}},cy={name:"CARTO Vector Tile",version:Kd,id:Xd,module:"carto",extensions:["pbf"],mimeTypes:["application/vnd.carto-vector-tile"],category:"geometry",parse:async(e,t)=>Wd(e,t),parseSync:Wd,worker:!0,options:ly};function uy(e,t,{startPosition:r,endPosition:n,indices:i}){let o=e.positions.size,a=r*o,s=n*o,l=e.positions.value.subarray(a,s),f=i.slice(1).map(u=>u-r),c=(0,Yd.default)(l,f,o);for(let u=0,d=c.length;u<d;++u)t.push(r+c[u])}function dy(e){let{polygonIndices:t,primitivePolygonIndices:r}=e,n=[],i=0;for(let o=0;o<t.value.length-1;o++){let a=t.value[o],s=t.value[o+1],l=r.value.indexOf(s),f=r.value.subarray(i,l);i=l,uy(e,n,{startPosition:a,endPosition:s,indices:f})}e.triangles={value:new Uint32Array(n),size:1}}function Wd(e,t){if(!e)return null;let r=Ut(e,Gr);return r.polygons&&!r.polygons.triangles&&dy(r.polygons),r}var Qd=cy;var Do=G(eh(),1),Yr=G(pt(),1),sh=G(kt(),1);var th="_carto_bbox";function hy(e){if(typeof e!="string")return null;let t=e.split(",");return t.length!==4?null:t.map(Number)}function Gs(e){return Math.log(Math.tan(Math.PI/4+e*Math.PI/360))}function py(e,t,r){let n=(e[0]-t.west)/(t.east-t.west),i=r.west+n*(r.east-r.west),o=Gs(e[1]),a=Gs(t.north),s=Gs(t.south),l=(a-o)/(a-s),f=r.south+l*(r.north-r.south);return[i,f]}function nh(e,t){let r=t?t in e.numericProps:!1,n=new Map;for(let c=0;c<e.pathIndices.value.length-1;c++){let u=e.pathIndices.value[c],d=e.featureIds.value[u],h;t===void 0?h=d:r?h=e.numericProps[t].value[u]:e.properties[d]&&t in e.properties[d]?h=e.properties[d][t]:h=void 0;let g=xy(e,c);(!n.has(h)||g>n.get(h).length)&&n.set(h,{index:c,length:g})}let i=[],o=[],a=[],s=[],l=ja(n.size,e.numericProps),f=0;for(let[c,{index:u}]of n){let d=vy(e,u);i.push(...d);let h=e.pathIndices.value[u],g=e.featureIds.value[h];a.push(f),o.push(e.properties[g]),s.push(e.globalFeatureIds.value[h]),Wa(e.numericProps,l,h,f),f++}return yn(i,a,s,l,o)}function ih(e,t,r,n){let i=Boolean(n&&e.properties.length>0&&th in e.properties[0]),o=i?n:t,{west:a,south:s,east:l,north:f}=o,u=(l-a)*(f-s)*1e-4,d=[],h=[],g=[],x=[],S=ja(e.polygonIndices.value.length-1,e.numericProps),T=i&&n!==t,w=0,k=0,{extruded:I}=r;for(let L=0;L<e.polygonIndices.value.length-1;L++){let R=e.polygonIndices.value[L],N=e.polygonIndices.value[L+1],p=null,m=null;if(i){let b=e.featureIds.value[R],y=hy(e.properties[b][th]);if(y){let[v,E,F,_]=y;if((F-v)*(_-E)>=u){let P=[(v+F)/2,(E+_)/2];rh(P,n)&&(m=T?py(P,n,t):P)}}}else{if(gy(e,L)<u)continue;m=by(e,L)}if(m){let b=-1,y=[0,0],v=!1;for(;k<e.triangles.value.length;){let F=e.triangles.value[k];if(F>=N)break;if(v){k+=3;continue}let _=e.triangles.value[k+1],C=e.triangles.value[k+2],P=e.positions.value.subarray(F*e.positions.size,F*e.positions.size+e.positions.size),A=e.positions.value.subarray(_*e.positions.size,_*e.positions.size+e.positions.size),O=e.positions.value.subarray(C*e.positions.size,C*e.positions.size+e.positions.size);if(my(m,P,A,O))v=!0;else{let z=oh(P,A,O);z>b&&(b=z,y=[(P[0]+A[0]+O[0])/3,(P[1]+A[1]+O[1])/3])}k+=3}let E=v?m:y;rh(E,t)&&(p=E)}if(p){d.push(...p);let b=e.featureIds.value[R];if(I){let y=r.getElevation(void 0,{data:e,index:b});d.push(y*r.elevationScale)}h.push(e.properties[b]),g.push(w),x.push(e.globalFeatureIds.value[R]),Wa(e.numericProps,S,R,w),w++}}return e.numericProps&&Object.keys(S).forEach(L=>{S[L].value=S[L].value.slice(0,w)}),yn(d,g,x,S,h,I?3:2)}function gy(e,t){let{positions:{value:r,size:n},polygonIndices:{value:i},triangles:{value:o}}=e,a=i[t],s=i[t+1],l=0,f=0;for(;f<o.length&&!(o[f]>=a);)f+=3;for(;f<o.length;){let c=o[f];if(c>=s)break;let u=o[f+1],d=o[f+2],h=r.subarray(c*n,c*n+n),g=r.subarray(u*n,u*n+n),x=r.subarray(d*n,d*n+n);l+=oh(h,g,x),f+=3}return l}function rh([e,t],{west:r,east:n,south:i,north:o}){return e>=r&&e<n&&t>=i&&t<o}function my(e,t,r,n){let i=Math.abs((r[0]-t[0])*(n[1]-t[1])-(n[0]-t[0])*(r[1]-t[1]))/2,o=Math.abs((t[0]-e[0])*(r[1]-e[1])-(r[0]-e[0])*(t[1]-e[1]))/2,a=Math.abs((r[0]-e[0])*(n[1]-e[1])-(n[0]-e[0])*(r[1]-e[1]))/2,s=Math.abs((n[0]-e[0])*(t[1]-e[1])-(t[0]-e[0])*(n[1]-e[1]))/2;return Math.abs(i-(o+a+s))<1e-10}function oh([e,t],[r,n],[i,o]){return Math.abs((e*(n-o)+r*(o-t)+i*(t-n))/2)}function by(e,t){let{positions:{value:r,size:n}}=e,i=n*e.polygonIndices.value[t],o=n*e.polygonIndices.value[t+1],a=1/0,s=1/0,l=-1/0,f=-1/0;for(let c=i;c<o;c+=n){let[u,d]=r.subarray(c,c+2);a=Math.min(a,u),s=Math.min(s,d),l=Math.max(l,u),f=Math.max(f,d)}return[(a+l)/2,(s+f)/2]}function yy(e,t){let{positions:{value:r}}=e,[n,i,o,a]=r.subarray(t,t+4);return Math.sqrt(Math.pow(o-n,2)+Math.pow(a-i,2))}function xy(e,t){let{positions:{size:r}}=e,n=r*e.pathIndices.value[t],i=r*e.pathIndices.value[t+1],o=0;for(let a=n;a<i;a+=r)o+=yy(e,a);return o}function vy(e,t){let{positions:{value:r},pathIndices:{value:n}}=e,i=n[t]*2,a=(n[t+1]*2-i)/2;if(a===2){let[l,f,c,u]=r.subarray(i,i+4);return[(l+c)/2,(f+u)/2]}let s=i+Math.floor(a/2)*2;return[r[s],r[s+1]]}(0,ah.registerLoaders)([Gd,Qd]);var wy={west:0,east:1,south:0,north:1},_y={...Yr.MVTLayer.defaultProps,autoLabels:!1,data:Ce,dataComparator:Ce.equal,tileSize:512},ui=class extends Yr.MVTLayer{constructor(...t){super(...t)}initializeState(){super.initializeState(),this.setState({binary:!0})}updateState(t){let{props:r}=t;if(r.data){super.updateState(t);let i=new URL(r.data.tiles[0]).searchParams.get("formatTiles")==="mvt";this.setState({mvt:i})}}getLoadOptions(){let t=this.props.data;return He(super.getLoadOptions(),{fetch:{headers:{Authorization:`Bearer ${t.accessToken}`}},gis:{format:"binary"}})}async getTileData(t){let r=this.props.data,{tiles:n,properties_tiles:i}=r,o=(0,Yr._getURLFromTemplate)(n,t);if(!o)return Promise.reject("Invalid URL");let a=this.getLoadOptions(),{fetch:s}=this.props,{signal:l}=t,f=s(o,{propName:"data",layer:this,loadOptions:a,signal:l});if(!i)return await f;let c=(0,Yr._getURLFromTemplate)(i,t);if(!c)return Promise.reject("Invalid properties URL");let u=s(c,{propName:"data",layer:this,loadOptions:a,signal:l}),[d,h]=await Promise.all([f,u]);return d?h?ud(d,h):d:null}renderSubLayers(t){if(t.data===null)return null;let r=t.tile.bbox,n=[],i={"points-text":{type:ni,...t?._subLayerProps?.["points-text"],extensions:[new Do.CollisionFilterExtension,...t.extensions||[],...t?._subLayerProps?.["points-text"]?.extensions||[]]}};if(this.state.mvt){let o={...t,_subLayerProps:{...t._subLayerProps,...i}};n.push(super.renderSubLayers(o))}else{let{west:o,south:a,east:s,north:l}=r,f=[new Do.ClipExtension,...t.extensions||[]],c={clipBounds:[o,a,s,l]},u=h=>({[h]:{...c,...t?._subLayerProps?.[h],extensions:[...f,...t?._subLayerProps?.[h]?.extensions||[]]}}),d={...t,data:{...t.data,tileBbox:r},autoHighlight:!1,_subLayerProps:{...t._subLayerProps,...i,...u("polygons-fill"),...u("polygons-stroke"),...u("linestrings")}};n.push(new sh.GeoJsonLayer(d))}if(n[0]&&t.autoLabels){let o=Wi();t.data.lines&&t.data.lines.positions.value.length>0&&(o.points=nh(t.data.lines,typeof t.autoLabels=="object"?t.autoLabels.uniqueIdProperty:void 0)),t.data.polygons&&t.data.polygons.positions.value.length>0&&(o.points=ih(t.data.polygons,this.state.mvt?wy:r,t,r)),n.push(n[0].clone({id:`${t.id}-labels`,data:o,pickable:!1,autoHighlight:!1}))}return n}renderLayers(){let t=super.renderLayers();if(!this.props.autoLabels)return t;let r=(t||[]).flat().filter(Boolean);return r.sort((n,i)=>{let o=n.id.includes("labels"),a=i.id.includes("labels");return o&&!a?1:!o&&a?-1:0}),r.map(n=>n.id.includes("labels")?n.clone({highlightedObjectIndex:-1}):n)}_isWGS84(){return this.state.mvt?super._isWGS84():!0}};ui.layerName="VectorTileLayer";ui.defaultProps=_y;var Kr=ui;var Nf=G(Kt(),1);var xp=G(Kt(),1);var Vs=class{add(t,r,n){if(typeof arguments[0]!="string")for(let i in arguments[0])this.add(i,arguments[0][i],arguments[1]);else(Array.isArray(t)?t:[t]).forEach(function(i){this[i]=this[i]||[],r&&this[i][n?"unshift":"push"](r)},this)}run(t,r){this[t]=this[t]||[],this[t].forEach(function(n){n.call(r&&r.context?r.context:r,r)})}},$s=class{constructor(t){this.jsep=t,this.registered={}}register(...t){t.forEach(r=>{if(typeof r!="object"||!r.name||!r.init)throw new Error("Invalid JSEP plugin format");this.registered[r.name]||(r.init(this.jsep),this.registered[r.name]=r)})}},M=class{static get version(){return"1.4.0"}static toString(){return"JavaScript Expression Parser (JSEP) v"+M.version}static addUnaryOp(t){return M.max_unop_len=Math.max(t.length,M.max_unop_len),M.unary_ops[t]=1,M}static addBinaryOp(t,r,n){return M.max_binop_len=Math.max(t.length,M.max_binop_len),M.binary_ops[t]=r,n?M.right_associative.add(t):M.right_associative.delete(t),M}static addIdentifierChar(t){return M.additional_identifier_chars.add(t),M}static addLiteral(t,r){return M.literals[t]=r,M}static removeUnaryOp(t){return delete M.unary_ops[t],t.length===M.max_unop_len&&(M.max_unop_len=M.getMaxKeyLen(M.unary_ops)),M}static removeAllUnaryOps(){return M.unary_ops={},M.max_unop_len=0,M}static removeIdentifierChar(t){return M.additional_identifier_chars.delete(t),M}static removeBinaryOp(t){return delete M.binary_ops[t],t.length===M.max_binop_len&&(M.max_binop_len=M.getMaxKeyLen(M.binary_ops)),M.right_associative.delete(t),M}static removeAllBinaryOps(){return M.binary_ops={},M.max_binop_len=0,M}static removeLiteral(t){return delete M.literals[t],M}static removeAllLiterals(){return M.literals={},M}get char(){return this.expr.charAt(this.index)}get code(){return this.expr.charCodeAt(this.index)}constructor(t){this.expr=t,this.index=0}static parse(t){return new M(t).parse()}static getMaxKeyLen(t){return Math.max(0,...Object.keys(t).map(r=>r.length))}static isDecimalDigit(t){return t>=48&&t<=57}static binaryPrecedence(t){return M.binary_ops[t]||0}static isIdentifierStart(t){return t>=65&&t<=90||t>=97&&t<=122||t>=128&&!M.binary_ops[String.fromCharCode(t)]||M.additional_identifier_chars.has(String.fromCharCode(t))}static isIdentifierPart(t){return M.isIdentifierStart(t)||M.isDecimalDigit(t)}throwError(t){let r=new Error(t+" at character "+this.index);throw r.index=this.index,r.description=t,r}runHook(t,r){if(M.hooks[t]){let n={context:this,node:r};return M.hooks.run(t,n),n.node}return r}searchHook(t){if(M.hooks[t]){let r={context:this};return M.hooks[t].find(function(n){return n.call(r.context,r),r.node}),r.node}}gobbleSpaces(){let t=this.code;for(;t===M.SPACE_CODE||t===M.TAB_CODE||t===M.LF_CODE||t===M.CR_CODE;)t=this.expr.charCodeAt(++this.index);this.runHook("gobble-spaces")}parse(){this.runHook("before-all");let t=this.gobbleExpressions(),r=t.length===1?t[0]:{type:M.COMPOUND,body:t};return this.runHook("after-all",r)}gobbleExpressions(t){let r=[],n,i;for(;this.index<this.expr.length;)if(n=this.code,n===M.SEMCOL_CODE||n===M.COMMA_CODE)this.index++;else if(i=this.gobbleExpression())r.push(i);else if(this.index<this.expr.length){if(n===t)break;this.throwError('Unexpected "'+this.char+'"')}return r}gobbleExpression(){let t=this.searchHook("gobble-expression")||this.gobbleBinaryExpression();return this.gobbleSpaces(),this.runHook("after-expression",t)}gobbleBinaryOp(){this.gobbleSpaces();let t=this.expr.substr(this.index,M.max_binop_len),r=t.length;for(;r>0;){if(M.binary_ops.hasOwnProperty(t)&&(!M.isIdentifierStart(this.code)||this.index+t.length<this.expr.length&&!M.isIdentifierPart(this.expr.charCodeAt(this.index+t.length))))return this.index+=r,t;t=t.substr(0,--r)}return!1}gobbleBinaryExpression(){let t,r,n,i,o,a,s,l,f;if(a=this.gobbleToken(),!a||(r=this.gobbleBinaryOp(),!r))return a;for(o={value:r,prec:M.binaryPrecedence(r),right_a:M.right_associative.has(r)},s=this.gobbleToken(),s||this.throwError("Expected expression after "+r),i=[a,o,s];r=this.gobbleBinaryOp();){if(n=M.binaryPrecedence(r),n===0){this.index-=r.length;break}o={value:r,prec:n,right_a:M.right_associative.has(r)},f=r;let c=u=>o.right_a&&u.right_a?n>u.prec:n<=u.prec;for(;i.length>2&&c(i[i.length-2]);)s=i.pop(),r=i.pop().value,a=i.pop(),t={type:M.BINARY_EXP,operator:r,left:a,right:s},i.push(t);t=this.gobbleToken(),t||this.throwError("Expected expression after "+f),i.push(o,t)}for(l=i.length-1,t=i[l];l>1;)t={type:M.BINARY_EXP,operator:i[l-1].value,left:i[l-2],right:t},l-=2;return t}gobbleToken(){let t,r,n,i;if(this.gobbleSpaces(),i=this.searchHook("gobble-token"),i)return this.runHook("after-token",i);if(t=this.code,M.isDecimalDigit(t)||t===M.PERIOD_CODE)return this.gobbleNumericLiteral();if(t===M.SQUOTE_CODE||t===M.DQUOTE_CODE)i=this.gobbleStringLiteral();else if(t===M.OBRACK_CODE)i=this.gobbleArray();else{for(r=this.expr.substr(this.index,M.max_unop_len),n=r.length;n>0;){if(M.unary_ops.hasOwnProperty(r)&&(!M.isIdentifierStart(this.code)||this.index+r.length<this.expr.length&&!M.isIdentifierPart(this.expr.charCodeAt(this.index+r.length)))){this.index+=n;let o=this.gobbleToken();return o||this.throwError("missing unaryOp argument"),this.runHook("after-token",{type:M.UNARY_EXP,operator:r,argument:o,prefix:!0})}r=r.substr(0,--n)}M.isIdentifierStart(t)?(i=this.gobbleIdentifier(),M.literals.hasOwnProperty(i.name)?i={type:M.LITERAL,value:M.literals[i.name],raw:i.name}:i.name===M.this_str&&(i={type:M.THIS_EXP})):t===M.OPAREN_CODE&&(i=this.gobbleGroup())}return i?(i=this.gobbleTokenProperty(i),this.runHook("after-token",i)):this.runHook("after-token",!1)}gobbleTokenProperty(t){this.gobbleSpaces();let r=this.code;for(;r===M.PERIOD_CODE||r===M.OBRACK_CODE||r===M.OPAREN_CODE||r===M.QUMARK_CODE;){let n;if(r===M.QUMARK_CODE){if(this.expr.charCodeAt(this.index+1)!==M.PERIOD_CODE)break;n=!0,this.index+=2,this.gobbleSpaces(),r=this.code}this.index++,r===M.OBRACK_CODE?(t={type:M.MEMBER_EXP,computed:!0,object:t,property:this.gobbleExpression()},t.property||this.throwError('Unexpected "'+this.char+'"'),this.gobbleSpaces(),r=this.code,r!==M.CBRACK_CODE&&this.throwError("Unclosed ["),this.index++):r===M.OPAREN_CODE?t={type:M.CALL_EXP,arguments:this.gobbleArguments(M.CPAREN_CODE),callee:t}:(r===M.PERIOD_CODE||n)&&(n&&this.index--,this.gobbleSpaces(),t={type:M.MEMBER_EXP,computed:!1,object:t,property:this.gobbleIdentifier()}),n&&(t.optional=!0),this.gobbleSpaces(),r=this.code}return t}gobbleNumericLiteral(){let t="",r,n;for(;M.isDecimalDigit(this.code);)t+=this.expr.charAt(this.index++);if(this.code===M.PERIOD_CODE)for(t+=this.expr.charAt(this.index++);M.isDecimalDigit(this.code);)t+=this.expr.charAt(this.index++);if(r=this.char,r==="e"||r==="E"){for(t+=this.expr.charAt(this.index++),r=this.char,(r==="+"||r==="-")&&(t+=this.expr.charAt(this.index++));M.isDecimalDigit(this.code);)t+=this.expr.charAt(this.index++);M.isDecimalDigit(this.expr.charCodeAt(this.index-1))||this.throwError("Expected exponent ("+t+this.char+")")}return n=this.code,M.isIdentifierStart(n)?this.throwError("Variable names cannot start with a number ("+t+this.char+")"):(n===M.PERIOD_CODE||t.length===1&&t.charCodeAt(0)===M.PERIOD_CODE)&&this.throwError("Unexpected period"),{type:M.LITERAL,value:parseFloat(t),raw:t}}gobbleStringLiteral(){let t="",r=this.index,n=this.expr.charAt(this.index++),i=!1;for(;this.index<this.expr.length;){let o=this.expr.charAt(this.index++);if(o===n){i=!0;break}else if(o==="\\")switch(o=this.expr.charAt(this.index++),o){case"n":t+=`
|
|
169
|
+
`;var zb={...Ds.ColumnLayer.defaultProps,extruded:!1,diskResolution:4,vertices:[[-.5,-.5],[.5,-.5],[.5,.5],[-.5,.5]]},ko=class extends _o(Ds.ColumnLayer){getShaders(){let t=super.getShaders(),r=this.props.data,n=r.data.blockSize??Math.sqrt(r.length);return{...t,defines:{...t.defines,BLOCK_WIDTH:n},vs:kd}}initializeState(){this.getAttributeManager().addInstanced({instanceElevations:{size:1,transition:!0,accessor:"getElevation"},instanceFillColors:{size:this.props.colorFormat.length,type:"unorm8",transition:!0,accessor:"getFillColor",defaultValue:[0,0,0,255]},instanceLineColors:{size:this.props.colorFormat.length,type:"unorm8",transition:!0,accessor:"getLineColor",defaultValue:[255,255,255,255]}})}};ko.layerName="RasterColumnLayer";function Ub(e,t){return e.data===t.data&&e.length===t.length}var ii=class extends Md.CompositeLayer{renderLayers(){let{data:t,getElevation:r,getFillColor:n,getLineColor:i,getLineWidth:o,tileIndex:a,updateTriggers:s}=this.props;if(!t||!a||t.length===0)return null;let l=t.blockSize??0,[f,c,u]=Ya(a),d=[f,c],h=u/l,g=this.getSubLayerClass("column",ko),{highlightedObjectIndex:x,highlightColor:S}=this.state;return new g(this.props,this.getSubLayerProps({id:"cell",updateTriggers:s,getElevation:this.getSubLayerAccessor(r),getFillColor:this.getSubLayerAccessor(n),getLineColor:this.getSubLayerAccessor(i),getLineWidth:this.getSubLayerAccessor(o)}),{data:{data:t,length:l*l},dataComparator:Ub,offset:d,lineWidthScale:h,highlightedObjectIndex:x,highlightColor:S})}getSubLayerAccessor(t){return typeof t!="function"?super.getSubLayerAccessor(t):(r,n)=>{let{data:i,index:o}=n,a=i.data,s=Hl(a.cells,o);return t({properties:s},n)}}getPickingInfo(t){let r=super.getPickingInfo(t);return r.index!==-1&&(r.object=this.getSubLayerAccessor(n=>n)(void 0,{data:this.props,index:r.index})),r}_updateAutoHighlight(t){let{highlightedObjectIndex:r}=this.state,n=-1;if(t.index!==-1&&(n=t.index),r!==n){let{highlightColor:i}=this.props;typeof i=="function"&&(i=i(t)),this.setState({highlightColor:i,highlightedObjectIndex:n})}}};ii.layerName="RasterLayer";ii.defaultProps=zb;var Mo=ii;var Dd=G(pt(),1);var Nd=G(pn(),1);var qb={uint8:Uint8Array,uint16:Uint16Array,uint32:Uint32Array,uint64:BigUint64Array,int8:Int8Array,int16:Int16Array,int32:Int32Array,int64:BigInt64Array,float32:Float32Array,float64:Float64Array},oi=class{static read(t,r){return t.readFields(oi._readField,{name:"",type:"",data:null},r)}static _readField(t,r,n){if(t===1)r.name=n.readString();else if(t===2)r.type=n.readString();else if(t===3){let i=qb[r.type];if(!i)throw Error(`Invalid data type: ${r.type}`);r.data={};let{compression:o}=qt;ar(i,n,r.data,{compression:o})}}},qt=class{static read(t,r){return t.readFields(qt._readField,{blockSize:0,bands:[]},r)}static _readField(t,r,n){t===1?r.blockSize=n.readVarint():t===2&&r.bands.push(oi.read(n,n.readVarint()+n.pos))}};var Id="9.3.10",Od="cartoRasterTile",Gb={cartoRasterTile:{metadata:null,workerUrl:Mt(Od,Id)}},Vb={name:"CARTO Raster Tile",version:Id,id:Od,module:"carto",extensions:["pbf"],mimeTypes:["application/vnd.carto-raster-tile"],category:"geometry",parse:async(e,t)=>Ld(e,t),parseSync:Ld,worker:!0,options:Gb};function Ld(e,t){let r=t?.cartoRasterTile?.metadata;if(!e||!r)return null;qt.compression=r.compression;let n=Ut(e,qt),{bands:i,blockSize:o}=n,a={};for(let s=0;s<i.length;s++){let{name:l,data:f}=i[s];a[l]=f}return{blockSize:o,cells:{numericProps:a,properties:[]}}}var Bd=Vb;(0,Nd.registerLoaders)([Bd]);var $b=e=>{let t=e.tile?.index?.q;return t?new Mo(e,{tileIndex:t}):null},Hb={data:Ce,refinementStrategy:"no-overlap",tileSize:512},Lo=class extends Kn(Dd.TileLayer,vd){filterSubLayer(t){let{tile:r}=t.layer.props;return r?super.filterSubLayer(t):!0}};Lo.layerName="PostProcessTileLayer";var ai=class extends Rd.CompositeLayer{getLoadOptions(){let t=this.props.data;return He(super.getLoadOptions(),{fetch:{headers:{Authorization:`Bearer ${t.accessToken}`}}})}renderLayers(){let t=this.props.data;if(!t)return null;let{tiles:r,minzoom:n,maxzoom:i,raster_metadata:o}=t,a=this.getSubLayerClass("tile",Lo),s=this.getLoadOptions();return new a(this.props,{id:`raster-tile-layer-${this.props.id}`,data:r,TilesetClass:et,renderSubLayers:$b,minZoom:n,maxZoom:i,loadOptions:{...s,cartoRasterTile:{...s?.cartoRasterTile,metadata:o}}})}};ai.layerName="RasterTileLayer";ai.defaultProps=Hb;var si=ai;var ah=G(pn(),1);var jr=class{static read(t,r){return t.readFields(jr._readField,{properties:[],numericProps:{}},r)}static _readField(t,r,n){if(t===1)r.properties.push(Ve.read(n,n.readVarint()+n.pos));else if(t===2){let i=$e.read(n,n.readVarint()+n.pos);r.numericProps[i.key]=i.value}}};var Ud="9.3.10",qd="cartoPropertiesTile",Zb={cartoPropertiesTile:{workerUrl:Mt(qd,Ud)}},jb={name:"CARTO Properties Tile",version:Ud,id:qd,module:"carto",extensions:["pbf"],mimeTypes:["application/vnd.carto-properties-tile"],category:"geometry",worker:!0,parse:async(e,t)=>zd(e,t),parseSync:zd,options:Zb};function zd(e,t){return e?Ut(e,jr):null}var Gd=jb;var Yd=G(jd(),1);var Kd="9.3.10",Xd="cartoVectorTile",ly={cartoVectorTile:{workerUrl:Mt(Xd,Kd)}},cy={name:"CARTO Vector Tile",version:Kd,id:Xd,module:"carto",extensions:["pbf"],mimeTypes:["application/vnd.carto-vector-tile"],category:"geometry",parse:async(e,t)=>Wd(e,t),parseSync:Wd,worker:!0,options:ly};function uy(e,t,{startPosition:r,endPosition:n,indices:i}){let o=e.positions.size,a=r*o,s=n*o,l=e.positions.value.subarray(a,s),f=i.slice(1).map(u=>u-r),c=(0,Yd.default)(l,f,o);for(let u=0,d=c.length;u<d;++u)t.push(r+c[u])}function dy(e){let{polygonIndices:t,primitivePolygonIndices:r}=e,n=[],i=0;for(let o=0;o<t.value.length-1;o++){let a=t.value[o],s=t.value[o+1],l=r.value.indexOf(s),f=r.value.subarray(i,l);i=l,uy(e,n,{startPosition:a,endPosition:s,indices:f})}e.triangles={value:new Uint32Array(n),size:1}}function Wd(e,t){if(!e)return null;let r=Ut(e,Gr);return r.polygons&&!r.polygons.triangles&&dy(r.polygons),r}var Qd=cy;var Do=G(eh(),1),Yr=G(pt(),1),sh=G(kt(),1);var th="_carto_bbox";function hy(e){if(typeof e!="string")return null;let t=e.split(",");return t.length!==4?null:t.map(Number)}function Gs(e){return Math.log(Math.tan(Math.PI/4+e*Math.PI/360))}function py(e,t,r){let n=(e[0]-t.west)/(t.east-t.west),i=r.west+n*(r.east-r.west),o=Gs(e[1]),a=Gs(t.north),s=Gs(t.south),l=(a-o)/(a-s),f=r.south+l*(r.north-r.south);return[i,f]}function nh(e,t){let r=t?t in e.numericProps:!1,n=new Map;for(let c=0;c<e.pathIndices.value.length-1;c++){let u=e.pathIndices.value[c],d=e.featureIds.value[u],h;t===void 0?h=d:r?h=e.numericProps[t].value[u]:e.properties[d]&&t in e.properties[d]?h=e.properties[d][t]:h=void 0;let g=xy(e,c);(!n.has(h)||g>n.get(h).length)&&n.set(h,{index:c,length:g})}let i=[],o=[],a=[],s=[],l=ja(n.size,e.numericProps),f=0;for(let[c,{index:u}]of n){let d=vy(e,u);i.push(...d);let h=e.pathIndices.value[u],g=e.featureIds.value[h];a.push(f),o.push(e.properties[g]),s.push(e.globalFeatureIds.value[h]),Wa(e.numericProps,l,h,f),f++}return yn(i,a,s,l,o)}function ih(e,t,r,n){let i=Boolean(n&&e.properties.length>0&&th in e.properties[0]),o=i?n:t,{west:a,south:s,east:l,north:f}=o,u=(l-a)*(f-s)*1e-4,d=[],h=[],g=[],x=[],S=ja(e.polygonIndices.value.length-1,e.numericProps),T=i&&n!==t,w=0,k=0,{extruded:I}=r;for(let L=0;L<e.polygonIndices.value.length-1;L++){let R=e.polygonIndices.value[L],N=e.polygonIndices.value[L+1],p=null,m=null;if(i){let b=e.featureIds.value[R],y=hy(e.properties[b][th]);if(y){let[v,E,F,_]=y;if((F-v)*(_-E)>=u){let P=[(v+F)/2,(E+_)/2];rh(P,n)&&(m=T?py(P,n,t):P)}}}else{if(gy(e,L)<u)continue;m=by(e,L)}if(m){let b=-1,y=[0,0],v=!1;for(;k<e.triangles.value.length;){let F=e.triangles.value[k];if(F>=N)break;if(v){k+=3;continue}let _=e.triangles.value[k+1],C=e.triangles.value[k+2],P=e.positions.value.subarray(F*e.positions.size,F*e.positions.size+e.positions.size),A=e.positions.value.subarray(_*e.positions.size,_*e.positions.size+e.positions.size),O=e.positions.value.subarray(C*e.positions.size,C*e.positions.size+e.positions.size);if(my(m,P,A,O))v=!0;else{let z=oh(P,A,O);z>b&&(b=z,y=[(P[0]+A[0]+O[0])/3,(P[1]+A[1]+O[1])/3])}k+=3}let E=v?m:y;rh(E,t)&&(p=E)}if(p){d.push(...p);let b=e.featureIds.value[R];if(I){let y=r.getElevation(void 0,{data:e,index:b});d.push(y*r.elevationScale)}h.push(e.properties[b]),g.push(w),x.push(e.globalFeatureIds.value[R]),Wa(e.numericProps,S,R,w),w++}}return e.numericProps&&Object.keys(S).forEach(L=>{S[L].value=S[L].value.slice(0,w)}),yn(d,g,x,S,h,I?3:2)}function gy(e,t){let{positions:{value:r,size:n},polygonIndices:{value:i},triangles:{value:o}}=e,a=i[t],s=i[t+1],l=0,f=0;for(;f<o.length&&!(o[f]>=a);)f+=3;for(;f<o.length;){let c=o[f];if(c>=s)break;let u=o[f+1],d=o[f+2],h=r.subarray(c*n,c*n+n),g=r.subarray(u*n,u*n+n),x=r.subarray(d*n,d*n+n);l+=oh(h,g,x),f+=3}return l}function rh([e,t],{west:r,east:n,south:i,north:o}){return e>=r&&e<n&&t>=i&&t<o}function my(e,t,r,n){let i=Math.abs((r[0]-t[0])*(n[1]-t[1])-(n[0]-t[0])*(r[1]-t[1]))/2,o=Math.abs((t[0]-e[0])*(r[1]-e[1])-(r[0]-e[0])*(t[1]-e[1]))/2,a=Math.abs((r[0]-e[0])*(n[1]-e[1])-(n[0]-e[0])*(r[1]-e[1]))/2,s=Math.abs((n[0]-e[0])*(t[1]-e[1])-(t[0]-e[0])*(n[1]-e[1]))/2;return Math.abs(i-(o+a+s))<1e-10}function oh([e,t],[r,n],[i,o]){return Math.abs((e*(n-o)+r*(o-t)+i*(t-n))/2)}function by(e,t){let{positions:{value:r,size:n}}=e,i=n*e.polygonIndices.value[t],o=n*e.polygonIndices.value[t+1],a=1/0,s=1/0,l=-1/0,f=-1/0;for(let c=i;c<o;c+=n){let[u,d]=r.subarray(c,c+2);a=Math.min(a,u),s=Math.min(s,d),l=Math.max(l,u),f=Math.max(f,d)}return[(a+l)/2,(s+f)/2]}function yy(e,t){let{positions:{value:r}}=e,[n,i,o,a]=r.subarray(t,t+4);return Math.sqrt(Math.pow(o-n,2)+Math.pow(a-i,2))}function xy(e,t){let{positions:{size:r}}=e,n=r*e.pathIndices.value[t],i=r*e.pathIndices.value[t+1],o=0;for(let a=n;a<i;a+=r)o+=yy(e,a);return o}function vy(e,t){let{positions:{value:r},pathIndices:{value:n}}=e,i=n[t]*2,a=(n[t+1]*2-i)/2;if(a===2){let[l,f,c,u]=r.subarray(i,i+4);return[(l+c)/2,(f+u)/2]}let s=i+Math.floor(a/2)*2;return[r[s],r[s+1]]}(0,ah.registerLoaders)([Gd,Qd]);var wy={west:0,east:1,south:0,north:1},_y={...Yr.MVTLayer.defaultProps,autoLabels:!1,data:Ce,dataComparator:Ce.equal,tileSize:512},ui=class extends Yr.MVTLayer{constructor(...t){super(...t)}initializeState(){super.initializeState(),this.setState({binary:!0})}updateState(t){let{props:r}=t;if(r.data){super.updateState(t);let i=new URL(r.data.tiles[0]).searchParams.get("formatTiles")==="mvt";this.setState({mvt:i})}}getLoadOptions(){let t=this.props.data;return He(super.getLoadOptions(),{fetch:{headers:{Authorization:`Bearer ${t.accessToken}`}},gis:{format:"binary"}})}async getTileData(t){let r=this.props.data,{tiles:n,properties_tiles:i}=r,o=(0,Yr._getURLFromTemplate)(n,t);if(!o)return Promise.reject("Invalid URL");let a=this.getLoadOptions(),{fetch:s}=this.props,{signal:l}=t,f=s(o,{propName:"data",layer:this,loadOptions:a,signal:l});if(!i)return await f;let c=(0,Yr._getURLFromTemplate)(i,t);if(!c)return Promise.reject("Invalid properties URL");let u=s(c,{propName:"data",layer:this,loadOptions:a,signal:l}),[d,h]=await Promise.all([f,u]);return d?h?ud(d,h):d:null}renderSubLayers(t){if(t.data===null)return null;let r=t.tile.bbox,n=[],i={"points-text":{type:ni,...t?._subLayerProps?.["points-text"],extensions:[new Do.CollisionFilterExtension,...t.extensions||[],...t?._subLayerProps?.["points-text"]?.extensions||[]]}};if(this.state.mvt){let o={...t,_subLayerProps:{...t._subLayerProps,...i}};n.push(super.renderSubLayers(o))}else{let{west:o,south:a,east:s,north:l}=r,f=[new Do.ClipExtension,...t.extensions||[]],c={clipBounds:[o,a,s,l]},u=h=>({[h]:{...c,...t?._subLayerProps?.[h],extensions:[...f,...t?._subLayerProps?.[h]?.extensions||[]]}}),d={...t,data:{...t.data,tileBbox:r},autoHighlight:!1,_subLayerProps:{...t._subLayerProps,...i,...u("polygons-fill"),...u("polygons-stroke"),...u("linestrings")}};n.push(new sh.GeoJsonLayer(d))}if(n[0]&&t.autoLabels){let o=Wi();t.data.lines&&t.data.lines.positions.value.length>0&&(o.points=nh(t.data.lines,typeof t.autoLabels=="object"?t.autoLabels.uniqueIdProperty:void 0)),t.data.polygons&&t.data.polygons.positions.value.length>0&&(o.points=ih(t.data.polygons,this.state.mvt?wy:r,t,r)),n.push(n[0].clone({id:`${t.id}-labels`,data:o,pickable:!1,autoHighlight:!1}))}return n}renderLayers(){let t=super.renderLayers();if(!this.props.autoLabels)return t;let r=(t||[]).flat().filter(Boolean);return r.sort((n,i)=>{let o=n.id.includes("labels"),a=i.id.includes("labels");return o&&!a?1:!o&&a?-1:0}),r.map(n=>n.id.includes("labels")?n.clone({highlightedObjectIndex:-1}):n)}_isWGS84(){return this.state.mvt?super._isWGS84():!0}};ui.layerName="VectorTileLayer";ui.defaultProps=_y;var Kr=ui;var Nf=G(Kt(),1);var xp=G(Kt(),1);var Vs=class{add(t,r,n){if(typeof arguments[0]!="string")for(let i in arguments[0])this.add(i,arguments[0][i],arguments[1]);else(Array.isArray(t)?t:[t]).forEach(function(i){this[i]=this[i]||[],r&&this[i][n?"unshift":"push"](r)},this)}run(t,r){this[t]=this[t]||[],this[t].forEach(function(n){n.call(r&&r.context?r.context:r,r)})}},$s=class{constructor(t){this.jsep=t,this.registered={}}register(...t){t.forEach(r=>{if(typeof r!="object"||!r.name||!r.init)throw new Error("Invalid JSEP plugin format");this.registered[r.name]||(r.init(this.jsep),this.registered[r.name]=r)})}},M=class{static get version(){return"1.4.0"}static toString(){return"JavaScript Expression Parser (JSEP) v"+M.version}static addUnaryOp(t){return M.max_unop_len=Math.max(t.length,M.max_unop_len),M.unary_ops[t]=1,M}static addBinaryOp(t,r,n){return M.max_binop_len=Math.max(t.length,M.max_binop_len),M.binary_ops[t]=r,n?M.right_associative.add(t):M.right_associative.delete(t),M}static addIdentifierChar(t){return M.additional_identifier_chars.add(t),M}static addLiteral(t,r){return M.literals[t]=r,M}static removeUnaryOp(t){return delete M.unary_ops[t],t.length===M.max_unop_len&&(M.max_unop_len=M.getMaxKeyLen(M.unary_ops)),M}static removeAllUnaryOps(){return M.unary_ops={},M.max_unop_len=0,M}static removeIdentifierChar(t){return M.additional_identifier_chars.delete(t),M}static removeBinaryOp(t){return delete M.binary_ops[t],t.length===M.max_binop_len&&(M.max_binop_len=M.getMaxKeyLen(M.binary_ops)),M.right_associative.delete(t),M}static removeAllBinaryOps(){return M.binary_ops={},M.max_binop_len=0,M}static removeLiteral(t){return delete M.literals[t],M}static removeAllLiterals(){return M.literals={},M}get char(){return this.expr.charAt(this.index)}get code(){return this.expr.charCodeAt(this.index)}constructor(t){this.expr=t,this.index=0}static parse(t){return new M(t).parse()}static getMaxKeyLen(t){return Math.max(0,...Object.keys(t).map(r=>r.length))}static isDecimalDigit(t){return t>=48&&t<=57}static binaryPrecedence(t){return M.binary_ops[t]||0}static isIdentifierStart(t){return t>=65&&t<=90||t>=97&&t<=122||t>=128&&!M.binary_ops[String.fromCharCode(t)]||M.additional_identifier_chars.has(String.fromCharCode(t))}static isIdentifierPart(t){return M.isIdentifierStart(t)||M.isDecimalDigit(t)}throwError(t){let r=new Error(t+" at character "+this.index);throw r.index=this.index,r.description=t,r}runHook(t,r){if(M.hooks[t]){let n={context:this,node:r};return M.hooks.run(t,n),n.node}return r}searchHook(t){if(M.hooks[t]){let r={context:this};return M.hooks[t].find(function(n){return n.call(r.context,r),r.node}),r.node}}gobbleSpaces(){let t=this.code;for(;t===M.SPACE_CODE||t===M.TAB_CODE||t===M.LF_CODE||t===M.CR_CODE;)t=this.expr.charCodeAt(++this.index);this.runHook("gobble-spaces")}parse(){this.runHook("before-all");let t=this.gobbleExpressions(),r=t.length===1?t[0]:{type:M.COMPOUND,body:t};return this.runHook("after-all",r)}gobbleExpressions(t){let r=[],n,i;for(;this.index<this.expr.length;)if(n=this.code,n===M.SEMCOL_CODE||n===M.COMMA_CODE)this.index++;else if(i=this.gobbleExpression())r.push(i);else if(this.index<this.expr.length){if(n===t)break;this.throwError('Unexpected "'+this.char+'"')}return r}gobbleExpression(){let t=this.searchHook("gobble-expression")||this.gobbleBinaryExpression();return this.gobbleSpaces(),this.runHook("after-expression",t)}gobbleBinaryOp(){this.gobbleSpaces();let t=this.expr.substr(this.index,M.max_binop_len),r=t.length;for(;r>0;){if(M.binary_ops.hasOwnProperty(t)&&(!M.isIdentifierStart(this.code)||this.index+t.length<this.expr.length&&!M.isIdentifierPart(this.expr.charCodeAt(this.index+t.length))))return this.index+=r,t;t=t.substr(0,--r)}return!1}gobbleBinaryExpression(){let t,r,n,i,o,a,s,l,f;if(a=this.gobbleToken(),!a||(r=this.gobbleBinaryOp(),!r))return a;for(o={value:r,prec:M.binaryPrecedence(r),right_a:M.right_associative.has(r)},s=this.gobbleToken(),s||this.throwError("Expected expression after "+r),i=[a,o,s];r=this.gobbleBinaryOp();){if(n=M.binaryPrecedence(r),n===0){this.index-=r.length;break}o={value:r,prec:n,right_a:M.right_associative.has(r)},f=r;let c=u=>o.right_a&&u.right_a?n>u.prec:n<=u.prec;for(;i.length>2&&c(i[i.length-2]);)s=i.pop(),r=i.pop().value,a=i.pop(),t={type:M.BINARY_EXP,operator:r,left:a,right:s},i.push(t);t=this.gobbleToken(),t||this.throwError("Expected expression after "+f),i.push(o,t)}for(l=i.length-1,t=i[l];l>1;)t={type:M.BINARY_EXP,operator:i[l-1].value,left:i[l-2],right:t},l-=2;return t}gobbleToken(){let t,r,n,i;if(this.gobbleSpaces(),i=this.searchHook("gobble-token"),i)return this.runHook("after-token",i);if(t=this.code,M.isDecimalDigit(t)||t===M.PERIOD_CODE)return this.gobbleNumericLiteral();if(t===M.SQUOTE_CODE||t===M.DQUOTE_CODE)i=this.gobbleStringLiteral();else if(t===M.OBRACK_CODE)i=this.gobbleArray();else{for(r=this.expr.substr(this.index,M.max_unop_len),n=r.length;n>0;){if(M.unary_ops.hasOwnProperty(r)&&(!M.isIdentifierStart(this.code)||this.index+r.length<this.expr.length&&!M.isIdentifierPart(this.expr.charCodeAt(this.index+r.length)))){this.index+=n;let o=this.gobbleToken();return o||this.throwError("missing unaryOp argument"),this.runHook("after-token",{type:M.UNARY_EXP,operator:r,argument:o,prefix:!0})}r=r.substr(0,--n)}M.isIdentifierStart(t)?(i=this.gobbleIdentifier(),M.literals.hasOwnProperty(i.name)?i={type:M.LITERAL,value:M.literals[i.name],raw:i.name}:i.name===M.this_str&&(i={type:M.THIS_EXP})):t===M.OPAREN_CODE&&(i=this.gobbleGroup())}return i?(i=this.gobbleTokenProperty(i),this.runHook("after-token",i)):this.runHook("after-token",!1)}gobbleTokenProperty(t){this.gobbleSpaces();let r=this.code;for(;r===M.PERIOD_CODE||r===M.OBRACK_CODE||r===M.OPAREN_CODE||r===M.QUMARK_CODE;){let n;if(r===M.QUMARK_CODE){if(this.expr.charCodeAt(this.index+1)!==M.PERIOD_CODE)break;n=!0,this.index+=2,this.gobbleSpaces(),r=this.code}this.index++,r===M.OBRACK_CODE?(t={type:M.MEMBER_EXP,computed:!0,object:t,property:this.gobbleExpression()},t.property||this.throwError('Unexpected "'+this.char+'"'),this.gobbleSpaces(),r=this.code,r!==M.CBRACK_CODE&&this.throwError("Unclosed ["),this.index++):r===M.OPAREN_CODE?t={type:M.CALL_EXP,arguments:this.gobbleArguments(M.CPAREN_CODE),callee:t}:(r===M.PERIOD_CODE||n)&&(n&&this.index--,this.gobbleSpaces(),t={type:M.MEMBER_EXP,computed:!1,object:t,property:this.gobbleIdentifier()}),n&&(t.optional=!0),this.gobbleSpaces(),r=this.code}return t}gobbleNumericLiteral(){let t="",r,n;for(;M.isDecimalDigit(this.code);)t+=this.expr.charAt(this.index++);if(this.code===M.PERIOD_CODE)for(t+=this.expr.charAt(this.index++);M.isDecimalDigit(this.code);)t+=this.expr.charAt(this.index++);if(r=this.char,r==="e"||r==="E"){for(t+=this.expr.charAt(this.index++),r=this.char,(r==="+"||r==="-")&&(t+=this.expr.charAt(this.index++));M.isDecimalDigit(this.code);)t+=this.expr.charAt(this.index++);M.isDecimalDigit(this.expr.charCodeAt(this.index-1))||this.throwError("Expected exponent ("+t+this.char+")")}return n=this.code,M.isIdentifierStart(n)?this.throwError("Variable names cannot start with a number ("+t+this.char+")"):(n===M.PERIOD_CODE||t.length===1&&t.charCodeAt(0)===M.PERIOD_CODE)&&this.throwError("Unexpected period"),{type:M.LITERAL,value:parseFloat(t),raw:t}}gobbleStringLiteral(){let t="",r=this.index,n=this.expr.charAt(this.index++),i=!1;for(;this.index<this.expr.length;){let o=this.expr.charAt(this.index++);if(o===n){i=!0;break}else if(o==="\\")switch(o=this.expr.charAt(this.index++),o){case"n":t+=`
|
|
170
170
|
`;break;case"r":t+="\r";break;case"t":t+=" ";break;case"b":t+="\b";break;case"f":t+="\f";break;case"v":t+="\v";break;default:t+=o}else t+=o}return i||this.throwError('Unclosed quote after "'+t+'"'),{type:M.LITERAL,value:t,raw:this.expr.substring(r,this.index)}}gobbleIdentifier(){let t=this.code,r=this.index;for(M.isIdentifierStart(t)?this.index++:this.throwError("Unexpected "+this.char);this.index<this.expr.length&&(t=this.code,M.isIdentifierPart(t));)this.index++;return{type:M.IDENTIFIER,name:this.expr.slice(r,this.index)}}gobbleArguments(t){let r=[],n=!1,i=0;for(;this.index<this.expr.length;){this.gobbleSpaces();let o=this.code;if(o===t){n=!0,this.index++,t===M.CPAREN_CODE&&i&&i>=r.length&&this.throwError("Unexpected token "+String.fromCharCode(t));break}else if(o===M.COMMA_CODE){if(this.index++,i++,i!==r.length){if(t===M.CPAREN_CODE)this.throwError("Unexpected token ,");else if(t===M.CBRACK_CODE)for(let a=r.length;a<i;a++)r.push(null)}}else if(r.length!==i&&i!==0)this.throwError("Expected comma");else{let a=this.gobbleExpression();(!a||a.type===M.COMPOUND)&&this.throwError("Expected comma"),r.push(a)}}return n||this.throwError("Expected "+String.fromCharCode(t)),r}gobbleGroup(){this.index++;let t=this.gobbleExpressions(M.CPAREN_CODE);if(this.code===M.CPAREN_CODE)return this.index++,t.length===1?t[0]:t.length?{type:M.SEQUENCE_EXP,expressions:t}:!1;this.throwError("Unclosed (")}gobbleArray(){return this.index++,{type:M.ARRAY_EXP,elements:this.gobbleArguments(M.CBRACK_CODE)}}},Ey=new Vs;Object.assign(M,{hooks:Ey,plugins:new $s(M),COMPOUND:"Compound",SEQUENCE_EXP:"SequenceExpression",IDENTIFIER:"Identifier",MEMBER_EXP:"MemberExpression",LITERAL:"Literal",THIS_EXP:"ThisExpression",CALL_EXP:"CallExpression",UNARY_EXP:"UnaryExpression",BINARY_EXP:"BinaryExpression",ARRAY_EXP:"ArrayExpression",TAB_CODE:9,LF_CODE:10,CR_CODE:13,SPACE_CODE:32,PERIOD_CODE:46,COMMA_CODE:44,SQUOTE_CODE:39,DQUOTE_CODE:34,OPAREN_CODE:40,CPAREN_CODE:41,OBRACK_CODE:91,CBRACK_CODE:93,QUMARK_CODE:63,SEMCOL_CODE:59,COLON_CODE:58,unary_ops:{"-":1,"!":1,"~":1,"+":1},binary_ops:{"||":1,"??":1,"&&":2,"|":3,"^":4,"&":5,"==":6,"!=":6,"===":6,"!==":6,"<":7,">":7,"<=":7,">=":7,"<<":8,">>":8,">>>":8,"+":9,"-":9,"*":10,"/":10,"%":10,"**":11},right_associative:new Set(["**"]),additional_identifier_chars:new Set(["$","_"]),literals:{true:!0,false:!1,null:null},this_str:"this"});M.max_unop_len=M.getMaxKeyLen(M.unary_ops);M.max_binop_len=M.getMaxKeyLen(M.binary_ops);var Xr=e=>new M(e).parse(),Sy=Object.getOwnPropertyNames(class{});Object.getOwnPropertyNames(M).filter(e=>!Sy.includes(e)&&Xr[e]===void 0).forEach(e=>{Xr[e]=M[e]});Xr.Jsep=M;var Ty="ConditionalExpression",Cy={name:"ternary",init(e){e.hooks.add("after-expression",function(r){if(r.node&&this.code===e.QUMARK_CODE){this.index++;let n=r.node,i=this.gobbleExpression();if(i||this.throwError("Expected expression"),this.gobbleSpaces(),this.code===e.COLON_CODE){this.index++;let o=this.gobbleExpression();if(o||this.throwError("Expected expression"),r.node={type:Ty,test:n,consequent:i,alternate:o},n.operator&&e.binary_ops[n.operator]<=.9){let a=n;for(;a.right.operator&&e.binary_ops[a.right.operator]<=.9;)a=a.right;r.node.test=a.right,a.right=r.node,r.node=n}}else this.throwError("Expected :")}})}};Xr.plugins.register(Cy);function st(e,t){return e==null||t==null?NaN:e<t?-1:e>t?1:e>=t?0:NaN}function Hs(e,t){return e==null||t==null?NaN:t<e?-1:t>e?1:t>=e?0:NaN}function No(e){let t,r,n;e.length!==2?(t=st,r=(s,l)=>st(e(s),l),n=(s,l)=>e(s)-l):(t=e===st||e===Hs?e:Ay,r=e,n=e);function i(s,l,f=0,c=s.length){if(f<c){if(t(l,l)!==0)return c;do{let u=f+c>>>1;r(s[u],l)<0?f=u+1:c=u}while(f<c)}return f}function o(s,l,f=0,c=s.length){if(f<c){if(t(l,l)!==0)return c;do{let u=f+c>>>1;r(s[u],l)<=0?f=u+1:c=u}while(f<c)}return f}function a(s,l,f=0,c=s.length){let u=i(s,l,f,c-1);return u>f&&n(s[u-1],l)>-n(s[u],l)?u-1:u}return{left:i,center:a,right:o}}function Ay(){return 0}function di(e){return e===null?NaN:+e}var fh=No(st),lh=fh.right,Py=fh.left,Fy=No(di).center,_t=lh;var Qr=class extends Map{constructor(t,r=Ly){if(super(),Object.defineProperties(this,{_intern:{value:new Map},_key:{value:r}}),t!=null)for(let[n,i]of t)this.set(n,i)}get(t){return super.get(ch(this,t))}has(t){return super.has(ch(this,t))}set(t,r){return super.set(ky(this,t),r)}delete(t){return super.delete(My(this,t))}};function ch({_intern:e,_key:t},r){let n=t(r);return e.has(n)?e.get(n):r}function ky({_intern:e,_key:t},r){let n=t(r);return e.has(n)?e.get(n):(e.set(n,r),r)}function My({_intern:e,_key:t},r){let n=t(r);return e.has(n)&&(r=e.get(n),e.delete(n)),r}function Ly(e){return e!==null&&typeof e=="object"?e.valueOf():e}var Iy=Math.sqrt(50),Oy=Math.sqrt(10),By=Math.sqrt(2);function zo(e,t,r){let n=(t-e)/Math.max(0,r),i=Math.floor(Math.log10(n)),o=n/Math.pow(10,i),a=o>=Iy?10:o>=Oy?5:o>=By?2:1,s,l,f;return i<0?(f=Math.pow(10,-i)/a,s=Math.round(e*f),l=Math.round(t*f),s/f<e&&++s,l/f>t&&--l,f=-f):(f=Math.pow(10,i)*a,s=Math.round(e/f),l=Math.round(t/f),s*f<e&&++s,l*f>t&&--l),l<s&&.5<=r&&r<2?zo(e,t,r*2):[s,l,f]}function dr(e,t,r){if(t=+t,e=+e,r=+r,!(r>0))return[];if(e===t)return[e];let n=t<e,[i,o,a]=n?zo(t,e,r):zo(e,t,r);if(!(o>=i))return[];let s=o-i+1,l=new Array(s);if(n)if(a<0)for(let f=0;f<s;++f)l[f]=(o-f)/-a;else for(let f=0;f<s;++f)l[f]=(o-f)*a;else if(a<0)for(let f=0;f<s;++f)l[f]=(i+f)/-a;else for(let f=0;f<s;++f)l[f]=(i+f)*a;return l}function hi(e,t,r){return t=+t,e=+e,r=+r,zo(e,t,r)[2]}function Zs(e,t,r){t=+t,e=+e,r=+r;let n=t<e,i=n?hi(t,e,r):hi(e,t,r);return(n?-1:1)*(i<0?1/-i:i)}function js(e,t,r=di){if(!(!(n=e.length)||isNaN(t=+t))){if(t<=0||n<2)return+r(e[0],0,e);if(t>=1)return+r(e[n-1],n-1,e);var n,i=(n-1)*t,o=Math.floor(i),a=+r(e[o],o,e),s=+r(e[o+1],o+1,e);return a+(s-a)*(i-o)}}function Uo(e,t,r){e=+e,t=+t,r=(i=arguments.length)<2?(t=e,e=0,1):i<3?1:+r;for(var n=-1,i=Math.max(0,Math.ceil((t-e)/r))|0,o=new Array(i);++n<i;)o[n]=e+n*r;return o}function ue(e,t){switch(arguments.length){case 0:break;case 1:this.range(e);break;default:this.range(t).domain(e);break}return this}var Ws=Symbol("implicit");function hr(){var e=new Qr,t=[],r=[],n=Ws;function i(o){let a=e.get(o);if(a===void 0){if(n!==Ws)return n;e.set(o,a=t.push(o)-1)}return r[a%r.length]}return i.domain=function(o){if(!arguments.length)return t.slice();t=[],e=new Qr;for(let a of o)e.has(a)||e.set(a,t.push(a)-1);return i},i.range=function(o){return arguments.length?(r=Array.from(o),i):r.slice()},i.unknown=function(o){return arguments.length?(n=o,i):n},i.copy=function(){return hr(t,r).unknown(n)},ue.apply(i,arguments),i}function qo(){var e=hr().unknown(void 0),t=e.domain,r=e.range,n=0,i=1,o,a,s=!1,l=0,f=0,c=.5;delete e.unknown;function u(){var d=t().length,h=i<n,g=h?i:n,x=h?n:i;o=(x-g)/Math.max(1,d-l+f*2),s&&(o=Math.floor(o)),g+=(x-g-o*(d-l))*c,a=o*(1-l),s&&(g=Math.round(g),a=Math.round(a));var S=Uo(d).map(function(T){return g+o*T});return r(h?S.reverse():S)}return e.domain=function(d){return arguments.length?(t(d),u()):t()},e.range=function(d){return arguments.length?([n,i]=d,n=+n,i=+i,u()):[n,i]},e.rangeRound=function(d){return[n,i]=d,n=+n,i=+i,s=!0,u()},e.bandwidth=function(){return a},e.step=function(){return o},e.round=function(d){return arguments.length?(s=!!d,u()):s},e.padding=function(d){return arguments.length?(l=Math.min(1,f=+d),u()):l},e.paddingInner=function(d){return arguments.length?(l=Math.min(1,d),u()):l},e.paddingOuter=function(d){return arguments.length?(f=+d,u()):f},e.align=function(d){return arguments.length?(c=Math.max(0,Math.min(1,d)),u()):c},e.copy=function(){return qo(t(),[n,i]).round(s).paddingInner(l).paddingOuter(f).align(c)},ue.apply(u(),arguments)}function uh(e){var t=e.copy;return e.padding=e.paddingOuter,delete e.paddingInner,delete e.paddingOuter,e.copy=function(){return uh(t())},e}function Ys(){return uh(qo.apply(null,arguments).paddingInner(1))}function Go(e,t,r){e.prototype=t.prototype=r,r.constructor=e}function Ks(e,t){var r=Object.create(e.prototype);for(var n in t)r[n]=t[n];return r}function mi(){}var pi=.7,Ho=1/pi,Jr="\\s*([+-]?\\d+)\\s*",gi="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",ft="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",Ry=/^#([0-9a-f]{3,8})$/,Dy=new RegExp(`^rgb\\(${Jr},${Jr},${Jr}\\)$`),Ny=new RegExp(`^rgb\\(${ft},${ft},${ft}\\)$`),zy=new RegExp(`^rgba\\(${Jr},${Jr},${Jr},${gi}\\)$`),Uy=new RegExp(`^rgba\\(${ft},${ft},${ft},${gi}\\)$`),qy=new RegExp(`^hsl\\(${gi},${ft},${ft}\\)$`),Gy=new RegExp(`^hsla\\(${gi},${ft},${ft},${gi}\\)$`),dh={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074};Go(mi,Gt,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:hh,formatHex:hh,formatHex8:Vy,formatHsl:$y,formatRgb:ph,toString:ph});function hh(){return this.rgb().formatHex()}function Vy(){return this.rgb().formatHex8()}function $y(){return vh(this).formatHsl()}function ph(){return this.rgb().formatRgb()}function Gt(e){var t,r;return e=(e+"").trim().toLowerCase(),(t=Ry.exec(e))?(r=t[1].length,t=parseInt(t[1],16),r===6?gh(t):r===3?new xe(t>>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):r===8?Vo(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):r===4?Vo(t>>12&15|t>>8&240,t>>8&15|t>>4&240,t>>4&15|t&240,((t&15)<<4|t&15)/255):null):(t=Dy.exec(e))?new xe(t[1],t[2],t[3],1):(t=Ny.exec(e))?new xe(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=zy.exec(e))?Vo(t[1],t[2],t[3],t[4]):(t=Uy.exec(e))?Vo(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=qy.exec(e))?yh(t[1],t[2]/100,t[3]/100,1):(t=Gy.exec(e))?yh(t[1],t[2]/100,t[3]/100,t[4]):dh.hasOwnProperty(e)?gh(dh[e]):e==="transparent"?new xe(NaN,NaN,NaN,0):null}function gh(e){return new xe(e>>16&255,e>>8&255,e&255,1)}function Vo(e,t,r,n){return n<=0&&(e=t=r=NaN),new xe(e,t,r,n)}function Hy(e){return e instanceof mi||(e=Gt(e)),e?(e=e.rgb(),new xe(e.r,e.g,e.b,e.opacity)):new xe}function en(e,t,r,n){return arguments.length===1?Hy(e):new xe(e,t,r,n??1)}function xe(e,t,r,n){this.r=+e,this.g=+t,this.b=+r,this.opacity=+n}Go(xe,en,Ks(mi,{brighter(e){return e=e==null?Ho:Math.pow(Ho,e),new xe(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?pi:Math.pow(pi,e),new xe(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new xe(gr(this.r),gr(this.g),gr(this.b),Zo(this.opacity))},displayable(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:mh,formatHex:mh,formatHex8:Zy,formatRgb:bh,toString:bh}));function mh(){return`#${pr(this.r)}${pr(this.g)}${pr(this.b)}`}function Zy(){return`#${pr(this.r)}${pr(this.g)}${pr(this.b)}${pr((isNaN(this.opacity)?1:this.opacity)*255)}`}function bh(){let e=Zo(this.opacity);return`${e===1?"rgb(":"rgba("}${gr(this.r)}, ${gr(this.g)}, ${gr(this.b)}${e===1?")":`, ${e})`}`}function Zo(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function gr(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function pr(e){return e=gr(e),(e<16?"0":"")+e.toString(16)}function yh(e,t,r,n){return n<=0?e=t=r=NaN:r<=0||r>=1?e=t=NaN:t<=0&&(e=NaN),new Ze(e,t,r,n)}function vh(e){if(e instanceof Ze)return new Ze(e.h,e.s,e.l,e.opacity);if(e instanceof mi||(e=Gt(e)),!e)return new Ze;if(e instanceof Ze)return e;e=e.rgb();var t=e.r/255,r=e.g/255,n=e.b/255,i=Math.min(t,r,n),o=Math.max(t,r,n),a=NaN,s=o-i,l=(o+i)/2;return s?(t===o?a=(r-n)/s+(r<n)*6:r===o?a=(n-t)/s+2:a=(t-r)/s+4,s/=l<.5?o+i:2-o-i,a*=60):s=l>0&&l<1?0:a,new Ze(a,s,l,e.opacity)}function wh(e,t,r,n){return arguments.length===1?vh(e):new Ze(e,t,r,n??1)}function Ze(e,t,r,n){this.h=+e,this.s=+t,this.l=+r,this.opacity=+n}Go(Ze,wh,Ks(mi,{brighter(e){return e=e==null?Ho:Math.pow(Ho,e),new Ze(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?pi:Math.pow(pi,e),new Ze(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=this.h%360+(this.h<0)*360,t=isNaN(e)||isNaN(this.s)?0:this.s,r=this.l,n=r+(r<.5?r:1-r)*t,i=2*r-n;return new xe(Xs(e>=240?e-240:e+120,i,n),Xs(e,i,n),Xs(e<120?e+240:e-120,i,n),this.opacity)},clamp(){return new Ze(xh(this.h),$o(this.s),$o(this.l),Zo(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){let e=Zo(this.opacity);return`${e===1?"hsl(":"hsla("}${xh(this.h)}, ${$o(this.s)*100}%, ${$o(this.l)*100}%${e===1?")":`, ${e})`}`}}));function xh(e){return e=(e||0)%360,e<0?e+360:e}function $o(e){return Math.max(0,Math.min(1,e||0))}function Xs(e,t,r){return(e<60?t+(r-t)*e/60:e<180?r:e<240?t+(r-t)*(240-e)/60:t)*255}function Qs(e,t,r,n,i){var o=e*e,a=o*e;return((1-3*e+3*o-a)*t+(4-6*o+3*a)*r+(1+3*e+3*o-3*a)*n+a*i)/6}function _h(e){var t=e.length-1;return function(r){var n=r<=0?r=0:r>=1?(r=1,t-1):Math.floor(r*t),i=e[n],o=e[n+1],a=n>0?e[n-1]:2*i-o,s=n<t-1?e[n+2]:2*o-i;return Qs((r-n/t)*t,a,i,o,s)}}function Eh(e){var t=e.length;return function(r){var n=Math.floor(((r%=1)<0?++r:r)*t),i=e[(n+t-1)%t],o=e[n%t],a=e[(n+1)%t],s=e[(n+2)%t];return Qs((r-n/t)*t,i,o,a,s)}}var bi=e=>()=>e;function jy(e,t){return function(r){return e+r*t}}function Wy(e,t,r){return e=Math.pow(e,r),t=Math.pow(t,r)-e,r=1/r,function(n){return Math.pow(e+n*t,r)}}function Sh(e){return(e=+e)==1?jo:function(t,r){return r-t?Wy(t,r,e):bi(isNaN(t)?r:t)}}function jo(e,t){var r=t-e;return r?jy(e,r):bi(isNaN(e)?t:e)}var Js=function e(t){var r=Sh(t);function n(i,o){var a=r((i=en(i)).r,(o=en(o)).r),s=r(i.g,o.g),l=r(i.b,o.b),f=jo(i.opacity,o.opacity);return function(c){return i.r=a(c),i.g=s(c),i.b=l(c),i.opacity=f(c),i+""}}return n.gamma=e,n}(1);function Th(e){return function(t){var r=t.length,n=new Array(r),i=new Array(r),o=new Array(r),a,s;for(a=0;a<r;++a)s=en(t[a]),n[a]=s.r||0,i[a]=s.g||0,o[a]=s.b||0;return n=e(n),i=e(i),o=e(o),s.opacity=1,function(l){return s.r=n(l),s.g=i(l),s.b=o(l),s+""}}}var d9=Th(_h),h9=Th(Eh);function Ch(e,t){t||(t=[]);var r=e?Math.min(t.length,e.length):0,n=t.slice(),i;return function(o){for(i=0;i<r;++i)n[i]=e[i]*(1-o)+t[i]*o;return n}}function Ah(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}function Ph(e,t){var r=t?t.length:0,n=e?Math.min(r,e.length):0,i=new Array(n),o=new Array(r),a;for(a=0;a<n;++a)i[a]=mr(e[a],t[a]);for(;a<r;++a)o[a]=t[a];return function(s){for(a=0;a<n;++a)o[a]=i[a](s);return o}}function Fh(e,t){var r=new Date;return e=+e,t=+t,function(n){return r.setTime(e*(1-n)+t*n),r}}function Vt(e,t){return e=+e,t=+t,function(r){return e*(1-r)+t*r}}function kh(e,t){var r={},n={},i;(e===null||typeof e!="object")&&(e={}),(t===null||typeof t!="object")&&(t={});for(i in t)i in e?r[i]=mr(e[i],t[i]):n[i]=t[i];return function(o){for(i in r)n[i]=r[i](o);return n}}var tf=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,ef=new RegExp(tf.source,"g");function Yy(e){return function(){return e}}function Ky(e){return function(t){return e(t)+""}}function Mh(e,t){var r=tf.lastIndex=ef.lastIndex=0,n,i,o,a=-1,s=[],l=[];for(e=e+"",t=t+"";(n=tf.exec(e))&&(i=ef.exec(t));)(o=i.index)>r&&(o=t.slice(r,o),s[a]?s[a]+=o:s[++a]=o),(n=n[0])===(i=i[0])?s[a]?s[a]+=i:s[++a]=i:(s[++a]=null,l.push({i:a,x:Vt(n,i)})),r=ef.lastIndex;return r<t.length&&(o=t.slice(r),s[a]?s[a]+=o:s[++a]=o),s.length<2?l[0]?Ky(l[0].x):Yy(t):(t=l.length,function(f){for(var c=0,u;c<t;++c)s[(u=l[c]).i]=u.x(f);return s.join("")})}function mr(e,t){var r=typeof t,n;return t==null||r==="boolean"?bi(t):(r==="number"?Vt:r==="string"?(n=Gt(t))?(t=n,Js):Mh:t instanceof Gt?Js:t instanceof Date?Fh:Ah(t)?Ch:Array.isArray(t)?Ph:typeof t.valueOf!="function"&&typeof t.toString!="function"||isNaN(t)?kh:Vt)(e,t)}function rf(e,t){return e=+e,t=+t,function(r){return Math.round(e*(1-r)+t*r)}}function nf(e){return function(){return e}}function of(e){return+e}var Lh=[0,1];function je(e){return e}function af(e,t){return(t-=e=+e)?function(r){return(r-e)/t}:nf(isNaN(t)?NaN:.5)}function Xy(e,t){var r;return e>t&&(r=e,e=t,t=r),function(n){return Math.max(e,Math.min(t,n))}}function Qy(e,t,r){var n=e[0],i=e[1],o=t[0],a=t[1];return i<n?(n=af(i,n),o=r(a,o)):(n=af(n,i),o=r(o,a)),function(s){return o(n(s))}}function Jy(e,t,r){var n=Math.min(e.length,t.length)-1,i=new Array(n),o=new Array(n),a=-1;for(e[n]<e[0]&&(e=e.slice().reverse(),t=t.slice().reverse());++a<n;)i[a]=af(e[a],e[a+1]),o[a]=r(t[a],t[a+1]);return function(s){var l=_t(e,s,1,n)-1;return o[l](i[l](s))}}function tn(e,t){return t.domain(e.domain()).range(e.range()).interpolate(e.interpolate()).clamp(e.clamp()).unknown(e.unknown())}function yi(){var e=Lh,t=Lh,r=mr,n,i,o,a=je,s,l,f;function c(){var d=Math.min(e.length,t.length);return a!==je&&(a=Xy(e[0],e[d-1])),s=d>2?Jy:Qy,l=f=null,u}function u(d){return d==null||isNaN(d=+d)?o:(l||(l=s(e.map(n),t,r)))(n(a(d)))}return u.invert=function(d){return a(i((f||(f=s(t,e.map(n),Vt)))(d)))},u.domain=function(d){return arguments.length?(e=Array.from(d,of),c()):e.slice()},u.range=function(d){return arguments.length?(t=Array.from(d),c()):t.slice()},u.rangeRound=function(d){return t=Array.from(d),r=rf,c()},u.clamp=function(d){return arguments.length?(a=d?!0:je,c()):a!==je},u.interpolate=function(d){return arguments.length?(r=d,c()):r},u.unknown=function(d){return arguments.length?(o=d,u):o},function(d,h){return n=d,i=h,c()}}function sf(){return yi()(je,je)}function Ih(e){return Math.abs(e=Math.round(e))>=1e21?e.toLocaleString("en").replace(/,/g,""):e.toString(10)}function br(e,t){if((r=(e=t?e.toExponential(t-1):e.toExponential()).indexOf("e"))<0)return null;var r,n=e.slice(0,r);return[n.length>1?n[0]+n.slice(2):n,+e.slice(r+1)]}function lt(e){return e=br(Math.abs(e)),e?e[1]:NaN}function Oh(e,t){return function(r,n){for(var i=r.length,o=[],a=0,s=e[0],l=0;i>0&&s>0&&(l+s+1>n&&(s=Math.max(1,n-l)),o.push(r.substring(i-=s,i+s)),!((l+=s+1)>n));)s=e[a=(a+1)%e.length];return o.reverse().join(t)}}function Bh(e){return function(t){return t.replace(/[0-9]/g,function(r){return e[+r]})}}var ex=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function ct(e){if(!(t=ex.exec(e)))throw new Error("invalid format: "+e);var t;return new Wo({fill:t[1],align:t[2],sign:t[3],symbol:t[4],zero:t[5],width:t[6],comma:t[7],precision:t[8]&&t[8].slice(1),trim:t[9],type:t[10]})}ct.prototype=Wo.prototype;function Wo(e){this.fill=e.fill===void 0?" ":e.fill+"",this.align=e.align===void 0?">":e.align+"",this.sign=e.sign===void 0?"-":e.sign+"",this.symbol=e.symbol===void 0?"":e.symbol+"",this.zero=!!e.zero,this.width=e.width===void 0?void 0:+e.width,this.comma=!!e.comma,this.precision=e.precision===void 0?void 0:+e.precision,this.trim=!!e.trim,this.type=e.type===void 0?"":e.type+""}Wo.prototype.toString=function(){return this.fill+this.align+this.sign+this.symbol+(this.zero?"0":"")+(this.width===void 0?"":Math.max(1,this.width|0))+(this.comma?",":"")+(this.precision===void 0?"":"."+Math.max(0,this.precision|0))+(this.trim?"~":"")+this.type};function Rh(e){e:for(var t=e.length,r=1,n=-1,i;r<t;++r)switch(e[r]){case".":n=i=r;break;case"0":n===0&&(n=r),i=r;break;default:if(!+e[r])break e;n>0&&(n=0);break}return n>0?e.slice(0,n)+e.slice(i+1):e}var ff;function Dh(e,t){var r=br(e,t);if(!r)return e+"";var n=r[0],i=r[1],o=i-(ff=Math.max(-8,Math.min(8,Math.floor(i/3)))*3)+1,a=n.length;return o===a?n:o>a?n+new Array(o-a+1).join("0"):o>0?n.slice(0,o)+"."+n.slice(o):"0."+new Array(1-o).join("0")+br(e,Math.max(0,t+o-1))[0]}function lf(e,t){var r=br(e,t);if(!r)return e+"";var n=r[0],i=r[1];return i<0?"0."+new Array(-i).join("0")+n:n.length>i+1?n.slice(0,i+1)+"."+n.slice(i+1):n+new Array(i-n.length+2).join("0")}var cf={"%":(e,t)=>(e*100).toFixed(t),b:e=>Math.round(e).toString(2),c:e=>e+"",d:Ih,e:(e,t)=>e.toExponential(t),f:(e,t)=>e.toFixed(t),g:(e,t)=>e.toPrecision(t),o:e=>Math.round(e).toString(8),p:(e,t)=>lf(e*100,t),r:lf,s:Dh,X:e=>Math.round(e).toString(16).toUpperCase(),x:e=>Math.round(e).toString(16)};function uf(e){return e}var Nh=Array.prototype.map,zh=["y","z","a","f","p","n","\xB5","m","","k","M","G","T","P","E","Z","Y"];function Uh(e){var t=e.grouping===void 0||e.thousands===void 0?uf:Oh(Nh.call(e.grouping,Number),e.thousands+""),r=e.currency===void 0?"":e.currency[0]+"",n=e.currency===void 0?"":e.currency[1]+"",i=e.decimal===void 0?".":e.decimal+"",o=e.numerals===void 0?uf:Bh(Nh.call(e.numerals,String)),a=e.percent===void 0?"%":e.percent+"",s=e.minus===void 0?"\u2212":e.minus+"",l=e.nan===void 0?"NaN":e.nan+"";function f(u){u=ct(u);var d=u.fill,h=u.align,g=u.sign,x=u.symbol,S=u.zero,T=u.width,w=u.comma,k=u.precision,I=u.trim,L=u.type;L==="n"?(w=!0,L="g"):cf[L]||(k===void 0&&(k=12),I=!0,L="g"),(S||d==="0"&&h==="=")&&(S=!0,d="0",h="=");var R=x==="$"?r:x==="#"&&/[boxX]/.test(L)?"0"+L.toLowerCase():"",N=x==="$"?n:/[%p]/.test(L)?a:"",p=cf[L],m=/[defgprs%]/.test(L);k=k===void 0?6:/[gprs]/.test(L)?Math.max(1,Math.min(21,k)):Math.max(0,Math.min(20,k));function b(y){var v=R,E=N,F,_,C;if(L==="c")E=p(y)+E,y="";else{y=+y;var P=y<0||1/y<0;if(y=isNaN(y)?l:p(Math.abs(y),k),I&&(y=Rh(y)),P&&+y==0&&g!=="+"&&(P=!1),v=(P?g==="("?g:s:g==="-"||g==="("?"":g)+v,E=(L==="s"?zh[8+ff/3]:"")+E+(P&&g==="("?")":""),m){for(F=-1,_=y.length;++F<_;)if(C=y.charCodeAt(F),48>C||C>57){E=(C===46?i+y.slice(F+1):y.slice(F))+E,y=y.slice(0,F);break}}}w&&!S&&(y=t(y,1/0));var A=v.length+y.length+E.length,O=A<T?new Array(T-A+1).join(d):"";switch(w&&S&&(y=t(O+y,O.length?T-E.length:1/0),O=""),h){case"<":y=v+y+E+O;break;case"=":y=v+O+y+E;break;case"^":y=O.slice(0,A=O.length>>1)+v+y+E+O.slice(A);break;default:y=O+v+y+E;break}return o(y)}return b.toString=function(){return u+""},b}function c(u,d){var h=f((u=ct(u),u.type="f",u)),g=Math.max(-8,Math.min(8,Math.floor(lt(d)/3)))*3,x=Math.pow(10,-g),S=zh[8+g/3];return function(T){return h(x*T)+S}}return{format:f,formatPrefix:c}}var Yo,Et,Ko;df({thousands:",",grouping:[3],currency:["$",""]});function df(e){return Yo=Uh(e),Et=Yo.format,Ko=Yo.formatPrefix,Yo}function hf(e){return Math.max(0,-lt(Math.abs(e)))}function pf(e,t){return Math.max(0,Math.max(-8,Math.min(8,Math.floor(lt(t)/3)))*3-lt(Math.abs(e)))}function gf(e,t){return e=Math.abs(e),t=Math.abs(t)-e,Math.max(0,lt(t)-lt(e))+1}function mf(e,t,r,n){var i=Zs(e,t,r),o;switch(n=ct(n??",f"),n.type){case"s":{var a=Math.max(Math.abs(e),Math.abs(t));return n.precision==null&&!isNaN(o=pf(i,a))&&(n.precision=o),Ko(n,a)}case"":case"e":case"g":case"p":case"r":{n.precision==null&&!isNaN(o=gf(i,Math.max(Math.abs(e),Math.abs(t))))&&(n.precision=o-(n.type==="e"));break}case"f":case"%":{n.precision==null&&!isNaN(o=hf(i))&&(n.precision=o-(n.type==="%")*2);break}}return Et(n)}function xi(e){var t=e.domain;return e.ticks=function(r){var n=t();return dr(n[0],n[n.length-1],r??10)},e.tickFormat=function(r,n){var i=t();return mf(i[0],i[i.length-1],r??10,n)},e.nice=function(r){r==null&&(r=10);var n=t(),i=0,o=n.length-1,a=n[i],s=n[o],l,f,c=10;for(s<a&&(f=a,a=s,s=f,f=i,i=o,o=f);c-- >0;){if(f=hi(a,s,r),f===l)return n[i]=a,n[o]=s,t(n);if(f>0)a=Math.floor(a/f)*f,s=Math.ceil(s/f)*f;else if(f<0)a=Math.ceil(a*f)/f,s=Math.floor(s*f)/f;else break;l=f}return e},e}function yr(){var e=sf();return e.copy=function(){return tn(e,yr())},ue.apply(e,arguments),xi(e)}function bf(e,t){e=e.slice();var r=0,n=e.length-1,i=e[r],o=e[n],a;return o<i&&(a=r,r=n,n=a,a=i,i=o,o=a),e[r]=t.floor(i),e[n]=t.ceil(o),e}function qh(e){return Math.log(e)}function Gh(e){return Math.exp(e)}function tx(e){return-Math.log(-e)}function rx(e){return-Math.exp(-e)}function nx(e){return isFinite(e)?+("1e"+e):e<0?0:e}function ix(e){return e===10?nx:e===Math.E?Math.exp:t=>Math.pow(e,t)}function ox(e){return e===Math.E?Math.log:e===10&&Math.log10||e===2&&Math.log2||(e=Math.log(e),t=>Math.log(t)/e)}function Vh(e){return(t,r)=>-e(-t,r)}function ax(e){let t=e(qh,Gh),r=t.domain,n=10,i,o;function a(){return i=ox(n),o=ix(n),r()[0]<0?(i=Vh(i),o=Vh(o),e(tx,rx)):e(qh,Gh),t}return t.base=function(s){return arguments.length?(n=+s,a()):n},t.domain=function(s){return arguments.length?(r(s),a()):r()},t.ticks=s=>{let l=r(),f=l[0],c=l[l.length-1],u=c<f;u&&([f,c]=[c,f]);let d=i(f),h=i(c),g,x,S=s==null?10:+s,T=[];if(!(n%1)&&h-d<S){if(d=Math.floor(d),h=Math.ceil(h),f>0){for(;d<=h;++d)for(g=1;g<n;++g)if(x=d<0?g/o(-d):g*o(d),!(x<f)){if(x>c)break;T.push(x)}}else for(;d<=h;++d)for(g=n-1;g>=1;--g)if(x=d>0?g/o(-d):g*o(d),!(x<f)){if(x>c)break;T.push(x)}T.length*2<S&&(T=dr(f,c,S))}else T=dr(d,h,Math.min(h-d,S)).map(o);return u?T.reverse():T},t.tickFormat=(s,l)=>{if(s==null&&(s=10),l==null&&(l=n===10?"s":","),typeof l!="function"&&(!(n%1)&&(l=ct(l)).precision==null&&(l.trim=!0),l=Et(l)),s===1/0)return l;let f=Math.max(1,n*s/t.ticks().length);return c=>{let u=c/o(Math.round(i(c)));return u*n<n-.5&&(u*=n),u<=f?l(c):""}},t.nice=()=>r(bf(r(),{floor:s=>o(Math.floor(i(s))),ceil:s=>o(Math.ceil(i(s)))})),t}function vi(){let e=ax(yi()).domain([1,10]);return e.copy=()=>tn(e,vi()).base(e.base()),ue.apply(e,arguments),e}function $h(e){return function(t){return t<0?-Math.pow(-t,e):Math.pow(t,e)}}function sx(e){return e<0?-Math.sqrt(-e):Math.sqrt(e)}function fx(e){return e<0?-e*e:e*e}function lx(e){var t=e(je,je),r=1;function n(){return r===1?e(je,je):r===.5?e(sx,fx):e($h(r),$h(1/r))}return t.exponent=function(i){return arguments.length?(r=+i,n()):r},xi(t)}function Xo(){var e=lx(yi());return e.copy=function(){return tn(e,Xo()).exponent(e.exponent())},ue.apply(e,arguments),e}function yf(){return Xo.apply(null,arguments).exponent(.5)}function wi(){var e=[],t=[],r=[],n;function i(){var a=0,s=Math.max(1,t.length);for(r=new Array(s-1);++a<s;)r[a-1]=js(e,a/s);return o}function o(a){return a==null||isNaN(a=+a)?n:t[_t(r,a)]}return o.invertExtent=function(a){var s=t.indexOf(a);return s<0?[NaN,NaN]:[s>0?r[s-1]:e[0],s<r.length?r[s]:e[e.length-1]]},o.domain=function(a){if(!arguments.length)return e.slice();e=[];for(let s of a)s!=null&&!isNaN(s=+s)&&e.push(s);return e.sort(st),i()},o.range=function(a){return arguments.length?(t=Array.from(a),i()):t.slice()},o.unknown=function(a){return arguments.length?(n=a,o):n},o.quantiles=function(){return r.slice()},o.copy=function(){return wi().domain(e).range(t).unknown(n)},ue.apply(o,arguments)}function _i(){var e=0,t=1,r=1,n=[.5],i=[0,1],o;function a(l){return l!=null&&l<=l?i[_t(n,l,0,r)]:o}function s(){var l=-1;for(n=new Array(r);++l<r;)n[l]=((l+1)*t-(l-r)*e)/(r+1);return a}return a.domain=function(l){return arguments.length?([e,t]=l,e=+e,t=+t,s()):[e,t]},a.range=function(l){return arguments.length?(r=(i=Array.from(l)).length-1,s()):i.slice()},a.invertExtent=function(l){var f=i.indexOf(l);return f<0?[NaN,NaN]:f<1?[e,n[0]]:f>=r?[n[r-1],t]:[n[f-1],n[f]]},a.unknown=function(l){return arguments.length&&(o=l),a},a.thresholds=function(){return n.slice()},a.copy=function(){return _i().domain([e,t]).range(i).unknown(o)},ue.apply(xi(a),arguments)}function xr(){var e=[.5],t=[0,1],r,n=1;function i(o){return o!=null&&o<=o?t[_t(e,o,0,n)]:r}return i.domain=function(o){return arguments.length?(e=Array.from(o),n=Math.min(e.length,t.length-1),i):e.slice()},i.range=function(o){return arguments.length?(t=Array.from(o),n=Math.min(e.length,t.length-1),i):t.slice()},i.invertExtent=function(o){var a=t.indexOf(o);return[e[a-1],e[a]]},i.unknown=function(o){return arguments.length?(r=o,i):r},i.copy=function(){return xr().domain(e).range(t).unknown(r)},ue.apply(i,arguments)}var t6={},cx=Object.create,Gf=Object.defineProperty,ux=Object.getOwnPropertyDescriptor,N0=Object.getOwnPropertyNames,dx=Object.getPrototypeOf,hx=Object.prototype.hasOwnProperty,px=(e,t,r)=>t in e?Gf(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,gx=(e,t)=>function(){return t||(0,e[N0(e)[0]])((t={exports:{}}).exports,t),t.exports},mx=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of N0(t))!hx.call(e,i)&&i!==r&&Gf(e,i,{get:()=>t[i],enumerable:!(n=ux(t,i))||n.enumerable});return e},bx=(e,t,r)=>(r=e!=null?cx(dx(e)):{},mx(t||!e||!e.__esModule?Gf(r,"default",{value:e,enumerable:!0}):r,e)),D=(e,t,r)=>px(e,typeof t!="symbol"?t+"":t,r),yx=gx({"node_modules/thenby/thenBy.module.js"(e,t){"use strict";t.exports=function(){function r(a){return a}function n(a){return typeof a=="string"?a.toLowerCase():a}function i(a,s){if(s=typeof s=="object"?s:{direction:s},typeof a!="function"){var l=a;a=function(h){return h[l]?h[l]:""}}if(a.length===1){var f=a,c=s.ignoreCase?n:r,u=s.cmp||function(h,g){return h<g?-1:h>g?1:0};a=function(h,g){return u(c(f(h)),c(f(g)))}}let d={"-1":"",desc:""};return s.direction in d?function(h,g){return-a(h,g)}:a}function o(a,s){var l=typeof this=="function"&&!this.firstBy?this:!1,f=i(a,s),c=l?function(u,d){return l(u,d)||f(u,d)}:f;return c.thenBy=o,c}return o.firstBy=o,o}()}}),xx="deck-gl-carto";function Di(){return xx}var Vf=(e=>(e.IN="in",e.BETWEEN="between",e.CLOSED_OPEN="closed_open",e.TIME="time",e.STRING_SEARCH="stringSearch",e))(Vf||{}),z0=(e=>(e.V1="v1",e.V2="v2",e.V3="v3",e))(z0||{}),$f="https://gcp-us-east1.api.carto.com",U0={mapId:"tag-mapId"};var q0=(e=>(e.H3="h3",e.QUADBIN="quadbin",e))(q0||{});var vx=Object.freeze({h3:["h3","hex","h3id","hex_id","h3hex"],quadbin:["quadbin"]}),De={Count:"count",Avg:"avg",Min:"min",Max:"max",Sum:"sum",Custom:"custom"};function G0(e){return e.map(t=>t[0]===void 0||t[0]===null?[Number.MIN_SAFE_INTEGER,t[1]]:t[1]===void 0||t[1]===null?[t[0],Number.MAX_SAFE_INTEGER]:t)}var wx={in:_x,between:V0,time:Ex,closed_open:Sx,stringSearch:Tx};function _x(e,t){return e.includes(t)}function V0(e,t){let r=n=>{let[i,o]=n;return t>=i&&t<=o};return G0(e).some(r)}function Ex(e,t){let r=new Date(t).getTime();if(isFinite(r))return V0(e,r);throw new Error("Column used to filter by time isn't well formatted.")}function Sx(e,t){let r=n=>{let[i,o]=n;return t>=i&&t<o};return G0(e).some(r)}function Tx(e,t,r={}){let n=Hh(t,r),i=r.useRegExp?e:e.map(a=>{let s=Px(Hh(a,r));return r.mustStart&&(s=`^${s}`),r.mustEnd&&(s=`${s}$`),s}),o=new RegExp(i.join("|"),r.caseSensitive?"g":"gi");return!!n.match(o)}var Cx=/[.*+?^${}()|[\]\\]/g,Ax=/\p{Diacritic}/gu;function Px(e){return e.replace(Cx,"\\$&")}function Hh(e,t){let r=String(e);return t.keepSpecialCharacters||(r=r.normalize("NFD").replace(Ax,"")),r}var Fx={and:"every",or:"some"};function kx(e,t,r,n){let i=Fx[n];return e[i](o=>{let a=t[o],s=Object.keys(a);return!r||r[o]===null||r[o]===void 0?!1:s.every(l=>{let f=wx[l];if(!f)throw new Error(`"${l}" filter is not implemented.`);return f(a[l].values,r[o],a[l].params)})})}function Mx({filters:e={},type:t="boolean",filtersLogicalOperator:r="and"}){let n=Object.keys(e);return n.length?i=>{let o=i.properties||i,a=kx(n,e,o,r);return t==="number"?Number(a):a}:()=>t==="number"?1:!0}function Lx(e,t,r){return Object.keys(t).length?e.filter(Mx({filters:t,filtersLogicalOperator:r})):e}var Y=11102230246251565e-32,de=134217729,Ix=(3+8*Y)*Y;function xf(e,t,r,n,i){let o,a,s,l,f=t[0],c=n[0],u=0,d=0;c>f==c>-f?(o=f,f=t[++u]):(o=c,c=n[++d]);let h=0;if(u<e&&d<r)for(c>f==c>-f?(a=f+o,s=o-(a-f),f=t[++u]):(a=c+o,s=o-(a-c),c=n[++d]),o=a,s!==0&&(i[h++]=s);u<e&&d<r;)c>f==c>-f?(a=o+f,l=a-o,s=o-(a-l)+(f-l),f=t[++u]):(a=o+c,l=a-o,s=o-(a-l)+(c-l),c=n[++d]),o=a,s!==0&&(i[h++]=s);for(;u<e;)a=o+f,l=a-o,s=o-(a-l)+(f-l),f=t[++u],o=a,s!==0&&(i[h++]=s);for(;d<r;)a=o+c,l=a-o,s=o-(a-l)+(c-l),c=n[++d],o=a,s!==0&&(i[h++]=s);return(o!==0||h===0)&&(i[h++]=o),h}function Ox(e,t){let r=t[0];for(let n=1;n<e;n++)r+=t[n];return r}function B(e){return new Float64Array(e)}var Bx=(3+16*Y)*Y,Rx=(2+12*Y)*Y,Dx=(9+64*Y)*Y*Y,rn=B(4),Zh=B(8),jh=B(12),Wh=B(16),me=B(4);function Nx(e,t,r,n,i,o,a){let s,l,f,c,u,d,h,g,x,S,T,w,k,I,L,R,N,p,m=e-i,b=r-i,y=t-o,v=n-o;I=m*v,d=de*m,h=d-(d-m),g=m-h,d=de*v,x=d-(d-v),S=v-x,L=g*S-(I-h*x-g*x-h*S),R=y*b,d=de*y,h=d-(d-y),g=y-h,d=de*b,x=d-(d-b),S=b-x,N=g*S-(R-h*x-g*x-h*S),T=L-N,u=L-T,rn[0]=L-(T+u)+(u-N),w=I+T,u=w-I,k=I-(w-u)+(T-u),T=k-R,u=k-T,rn[1]=k-(T+u)+(u-R),p=w+T,u=p-w,rn[2]=w-(p-u)+(T-u),rn[3]=p;let E=Ox(4,rn),F=Rx*a;if(E>=F||-E>=F||(u=e-m,s=e-(m+u)+(u-i),u=r-b,f=r-(b+u)+(u-i),u=t-y,l=t-(y+u)+(u-o),u=n-v,c=n-(v+u)+(u-o),s===0&&l===0&&f===0&&c===0)||(F=Dx*a+Ix*Math.abs(E),E+=m*c+v*s-(y*f+b*l),E>=F||-E>=F))return E;I=s*v,d=de*s,h=d-(d-s),g=s-h,d=de*v,x=d-(d-v),S=v-x,L=g*S-(I-h*x-g*x-h*S),R=l*b,d=de*l,h=d-(d-l),g=l-h,d=de*b,x=d-(d-b),S=b-x,N=g*S-(R-h*x-g*x-h*S),T=L-N,u=L-T,me[0]=L-(T+u)+(u-N),w=I+T,u=w-I,k=I-(w-u)+(T-u),T=k-R,u=k-T,me[1]=k-(T+u)+(u-R),p=w+T,u=p-w,me[2]=w-(p-u)+(T-u),me[3]=p;let _=xf(4,rn,4,me,Zh);I=m*c,d=de*m,h=d-(d-m),g=m-h,d=de*c,x=d-(d-c),S=c-x,L=g*S-(I-h*x-g*x-h*S),R=y*f,d=de*y,h=d-(d-y),g=y-h,d=de*f,x=d-(d-f),S=f-x,N=g*S-(R-h*x-g*x-h*S),T=L-N,u=L-T,me[0]=L-(T+u)+(u-N),w=I+T,u=w-I,k=I-(w-u)+(T-u),T=k-R,u=k-T,me[1]=k-(T+u)+(u-R),p=w+T,u=p-w,me[2]=w-(p-u)+(T-u),me[3]=p;let C=xf(_,Zh,4,me,jh);I=s*c,d=de*s,h=d-(d-s),g=s-h,d=de*c,x=d-(d-c),S=c-x,L=g*S-(I-h*x-g*x-h*S),R=l*f,d=de*l,h=d-(d-l),g=l-h,d=de*f,x=d-(d-f),S=f-x,N=g*S-(R-h*x-g*x-h*S),T=L-N,u=L-T,me[0]=L-(T+u)+(u-N),w=I+T,u=w-I,k=I-(w-u)+(T-u),T=k-R,u=k-T,me[1]=k-(T+u)+(u-R),p=w+T,u=p-w,me[2]=w-(p-u)+(T-u),me[3]=p;let P=xf(C,jh,4,me,Wh);return Wh[P-1]}function zx(e,t,r,n,i,o){let a=(t-o)*(r-i),s=(e-i)*(n-o),l=a-s,f=Math.abs(a+s);return Math.abs(l)>=Bx*f?l:-Nx(e,t,r,n,i,o,f)}var gS=(7+56*Y)*Y,mS=(3+28*Y)*Y,bS=(26+288*Y)*Y*Y,yS=B(4),xS=B(4),vS=B(4),wS=B(4),_S=B(4),ES=B(4),SS=B(4),TS=B(4),CS=B(4),AS=B(8),PS=B(8),FS=B(8),kS=B(4),MS=B(8),LS=B(8),IS=B(8),OS=B(12),BS=B(192),RS=B(192),DS=(10+96*Y)*Y,NS=(4+48*Y)*Y,zS=(44+576*Y)*Y*Y,US=B(4),qS=B(4),GS=B(4),VS=B(4),$S=B(4),HS=B(4),ZS=B(4),jS=B(4),WS=B(8),YS=B(8),KS=B(8),XS=B(8),QS=B(8),JS=B(8),eT=B(8),tT=B(8),rT=B(8),nT=B(4),iT=B(4),oT=B(4),aT=B(8),sT=B(16),fT=B(16),lT=B(16),cT=B(32),uT=B(32),dT=B(48),hT=B(64),pT=B(1152),gT=B(1152),mT=(16+224*Y)*Y,bT=(5+72*Y)*Y,yT=(71+1408*Y)*Y*Y,xT=B(4),vT=B(4),wT=B(4),_T=B(4),ET=B(4),ST=B(4),TT=B(4),CT=B(4),AT=B(4),PT=B(4),FT=B(24),kT=B(24),MT=B(24),LT=B(24),IT=B(24),OT=B(24),BT=B(24),RT=B(24),DT=B(24),NT=B(24),zT=B(1152),UT=B(1152),qT=B(1152),GT=B(1152),VT=B(1152),$T=B(2304),HT=B(2304),ZT=B(3456),jT=B(5760),WT=B(8),YT=B(8),KT=B(8),XT=B(16),QT=B(24),JT=B(48),eC=B(48),tC=B(96),rC=B(192),nC=B(384),iC=B(384),oC=B(384),aC=B(768),sC=B(96),fC=B(96),lC=B(96),cC=B(1152);function Ux(e,t){var r,n,i=0,o,a,s,l,f,c,u,d=e[0],h=e[1],g=t.length;for(r=0;r<g;r++){n=0;var x=t[r],S=x.length-1;if(c=x[0],c[0]!==x[S][0]&&c[1]!==x[S][1])throw new Error("First and last coordinates in a ring must be the same");for(a=c[0]-d,s=c[1]-h,n;n<S;n++){if(u=x[n+1],l=u[0]-d,f=u[1]-h,s===0&&f===0){if(l<=0&&a>=0||a<=0&&l>=0)return 0}else if(f>=0&&s<=0||f<=0&&s>=0){if(o=zx(a,l,s,f,0,0),o===0)return 0;(o>0&&f>0&&s<=0||o<0&&f<=0&&s>0)&&i++}c=u,s=f,a=l}}return i%2!==0}var Ae=63710088e-1,uC={centimeters:Ae*100,centimetres:Ae*100,degrees:360/(2*Math.PI),feet:Ae*3.28084,inches:Ae*39.37,kilometers:Ae/1e3,kilometres:Ae/1e3,meters:Ae,metres:Ae,miles:Ae/1609.344,millimeters:Ae*1e3,millimetres:Ae*1e3,nauticalmiles:Ae/1852,radians:1,yards:Ae*1.0936};function _e(e,t,r={}){let n={type:"Feature"};return(r.id===0||r.id)&&(n.id=r.id),r.bbox&&(n.bbox=r.bbox),n.properties=t||{},n.geometry=e,n}function qx(e,t,r={}){if(!e)throw new Error("coordinates is required");if(!Array.isArray(e))throw new Error("coordinates must be an Array");if(e.length<2)throw new Error("coordinates must be at least 2 numbers long");if(!Yh(e[0])||!Yh(e[1]))throw new Error("coordinates must contain numbers");return _e({type:"Point",coordinates:e},t,r)}function Hf(e,t,r={}){for(let i of e){if(i.length<4)throw new Error("Each LinearRing of a Polygon must have 4 or more Positions.");if(i[i.length-1].length!==i[0].length)throw new Error("First and last Position are not equivalent.");for(let o=0;o<i[i.length-1].length;o++)if(i[i.length-1][o]!==i[0][o])throw new Error("First and last Position are not equivalent.")}return _e({type:"Polygon",coordinates:e},t,r)}function $0(e,t,r={}){if(e.length<2)throw new Error("coordinates must be an array of two or more positions");return _e({type:"LineString",coordinates:e},t,r)}function Li(e,t={}){let r={type:"FeatureCollection"};return t.id&&(r.id=t.id),t.bbox&&(r.bbox=t.bbox),r.features=e,r}function H0(e,t,r={}){return _e({type:"MultiLineString",coordinates:e},t,r)}function Z0(e,t,r={}){return _e({type:"MultiPolygon",coordinates:e},t,r)}function Yh(e){return!isNaN(e)&&e!==null&&!Array.isArray(e)}function j0(e){if(!e)throw new Error("coord is required");if(!Array.isArray(e)){if(e.type==="Feature"&&e.geometry!==null&&e.geometry.type==="Point")return[...e.geometry.coordinates];if(e.type==="Point")return[...e.coordinates]}if(Array.isArray(e)&&e.length>=2&&!Array.isArray(e[0])&&!Array.isArray(e[1]))return[...e];throw new Error("coord must be GeoJSON Point or an Array of numbers")}function ki(e){if(Array.isArray(e))return e;if(e.type==="Feature"){if(e.geometry!==null)return e.geometry.coordinates}else if(e.coordinates)return e.coordinates;throw new Error("coords must be GeoJSON Feature, Geometry Object or an Array")}function Pt(e){return e.type==="Feature"?e.geometry:e}function Gx(e,t){return e.type==="FeatureCollection"?"FeatureCollection":e.type==="GeometryCollection"?"GeometryCollection":e.type==="Feature"&&e.geometry!==null?e.geometry.type:e.type}function Ne(e,t,r={}){if(!e)throw new Error("point is required");if(!t)throw new Error("polygon is required");let n=j0(e),i=Pt(t),o=i.type,a=t.bbox,s=i.coordinates;if(a&&Vx(n,a)===!1)return!1;o==="Polygon"&&(s=[s]);let l=!1;for(var f=0;f<s.length;++f){let c=Ux(n,s[f]);if(c===0)return!r.ignoreBoundary;c&&(l=!0)}return l}function Vx(e,t){return t[0]<=e[0]&&t[1]<=e[1]&&t[2]>=e[0]&&t[3]>=e[1]}var W0=class{constructor(e=[],t=$x){if(this.data=e,this.length=this.data.length,this.compare=t,this.length>0)for(let r=(this.length>>1)-1;r>=0;r--)this._down(r)}push(e){this.data.push(e),this.length++,this._up(this.length-1)}pop(){if(this.length===0)return;let e=this.data[0],t=this.data.pop();return this.length--,this.length>0&&(this.data[0]=t,this._down(0)),e}peek(){return this.data[0]}_up(e){let{data:t,compare:r}=this,n=t[e];for(;e>0;){let i=e-1>>1,o=t[i];if(r(n,o)>=0)break;t[e]=o,e=i}t[e]=n}_down(e){let{data:t,compare:r}=this,n=this.length>>1,i=t[e];for(;e<n;){let o=(e<<1)+1,a=t[o],s=o+1;if(s<this.length&&r(t[s],a)<0&&(o=s,a=t[s]),r(a,i)>=0)break;t[e]=a,e=o}t[e]=i}};function $x(e,t){return e<t?-1:e>t?1:0}function Y0(e,t){return e.p.x>t.p.x?1:e.p.x<t.p.x?-1:e.p.y!==t.p.y?e.p.y>t.p.y?1:-1:1}function Hx(e,t){return e.rightSweepEvent.p.x>t.rightSweepEvent.p.x?1:e.rightSweepEvent.p.x<t.rightSweepEvent.p.x?-1:e.rightSweepEvent.p.y!==t.rightSweepEvent.p.y?e.rightSweepEvent.p.y<t.rightSweepEvent.p.y?1:-1:1}var Kh=class{constructor(e,t,r,n){this.p={x:e[0],y:e[1]},this.featureId=t,this.ringId=r,this.eventId=n,this.otherEvent=null,this.isLeftEndpoint=null}isSamePoint(e){return this.p.x===e.p.x&&this.p.y===e.p.y}};function Zx(e,t){if(e.type==="FeatureCollection"){let r=e.features;for(let n=0;n<r.length;n++)Xh(r[n],t)}else Xh(e,t)}var Qo=0,Jo=0,ea=0;function Xh(e,t){let r=e.type==="Feature"?e.geometry:e,n=r.coordinates;(r.type==="Polygon"||r.type==="MultiLineString")&&(n=[n]),r.type==="LineString"&&(n=[[n]]);for(let i=0;i<n.length;i++)for(let o=0;o<n[i].length;o++){let a=n[i][o][0],s=null;Jo=Jo+1;for(let l=0;l<n[i][o].length-1;l++){s=n[i][o][l+1];let f=new Kh(a,Qo,Jo,ea),c=new Kh(s,Qo,Jo,ea+1);f.otherEvent=c,c.otherEvent=f,Y0(f,c)>0?(c.isLeftEndpoint=!0,f.isLeftEndpoint=!1):(f.isLeftEndpoint=!0,c.isLeftEndpoint=!1),t.push(f),t.push(c),a=s,ea=ea+1}}Qo=Qo+1}var jx=class{constructor(e){this.leftSweepEvent=e,this.rightSweepEvent=e.otherEvent}};function Wx(e,t){if(e===null||t===null||e.leftSweepEvent.ringId===t.leftSweepEvent.ringId&&(e.rightSweepEvent.isSamePoint(t.leftSweepEvent)||e.rightSweepEvent.isSamePoint(t.leftSweepEvent)||e.rightSweepEvent.isSamePoint(t.rightSweepEvent)||e.leftSweepEvent.isSamePoint(t.leftSweepEvent)||e.leftSweepEvent.isSamePoint(t.rightSweepEvent)))return!1;let r=e.leftSweepEvent.p.x,n=e.leftSweepEvent.p.y,i=e.rightSweepEvent.p.x,o=e.rightSweepEvent.p.y,a=t.leftSweepEvent.p.x,s=t.leftSweepEvent.p.y,l=t.rightSweepEvent.p.x,f=t.rightSweepEvent.p.y,c=(f-s)*(i-r)-(l-a)*(o-n),u=(l-a)*(n-s)-(f-s)*(r-a),d=(i-r)*(n-s)-(o-n)*(r-a);if(c===0)return u===0&&d===0,!1;let h=u/c,g=d/c;if(h>=0&&h<=1&&g>=0&&g<=1){let x=r+h*(i-r),S=n+h*(o-n);return[x,S]}return!1}function Yx(e,t){t=t||!1;let r=[],n=new W0([],Hx);for(;e.length;){let i=e.pop();if(i.isLeftEndpoint){let o=new jx(i);for(let a=0;a<n.data.length;a++){let s=n.data[a];if(t&&s.leftSweepEvent.featureId===i.featureId)continue;let l=Wx(o,s);l!==!1&&r.push(l)}n.push(o)}else i.isLeftEndpoint===!1&&n.pop()}return r}function Kx(e,t){let r=new W0([],Y0);return Zx(e,r),Yx(r,t)}var Xx=Kx,Qx=Xx;function Zf(e,t,r={}){let{removeDuplicates:n=!0,ignoreSelfIntersections:i=!0}=r,o=[];e.type==="FeatureCollection"?o=o.concat(e.features):e.type==="Feature"?o.push(e):(e.type==="LineString"||e.type==="Polygon"||e.type==="MultiLineString"||e.type==="MultiPolygon")&&o.push(_e(e)),t.type==="FeatureCollection"?o=o.concat(t.features):t.type==="Feature"?o.push(t):(t.type==="LineString"||t.type==="Polygon"||t.type==="MultiLineString"||t.type==="MultiPolygon")&&o.push(_e(t));let a=Qx(Li(o),i),s=[];if(n){let l={};a.forEach(f=>{let c=f.join(",");l[c]||(l[c]=!0,s.push(f))})}else s=a;return Li(s.map(l=>qx(l)))}function K0(e,t,r){if(e!==null)for(var n,i,o,a,s,l,f,c=0,u=0,d,h=e.type,g=h==="FeatureCollection",x=h==="Feature",S=g?e.features.length:1,T=0;T<S;T++){f=g?e.features[T].geometry:x?e.geometry:e,d=f?f.type==="GeometryCollection":!1,s=d?f.geometries.length:1;for(var w=0;w<s;w++){var k=0,I=0;if(a=d?f.geometries[w]:f,a!==null){l=a.coordinates;var L=a.type;switch(c=r&&(L==="Polygon"||L==="MultiPolygon")?1:0,L){case null:break;case"Point":if(t(l,u,T,k,I)===!1)return!1;u++,k++;break;case"LineString":case"MultiPoint":for(n=0;n<l.length;n++){if(t(l[n],u,T,k,I)===!1)return!1;u++,L==="MultiPoint"&&k++}L==="LineString"&&k++;break;case"Polygon":case"MultiLineString":for(n=0;n<l.length;n++){for(i=0;i<l[n].length-c;i++){if(t(l[n][i],u,T,k,I)===!1)return!1;u++}L==="MultiLineString"&&k++,L==="Polygon"&&I++}L==="Polygon"&&k++;break;case"MultiPolygon":for(n=0;n<l.length;n++){for(I=0,i=0;i<l[n].length;i++){for(o=0;o<l[n][i].length-c;o++){if(t(l[n][i][o],u,T,k,I)===!1)return!1;u++}I++}k++}break;case"GeometryCollection":for(n=0;n<a.geometries.length;n++)if(K0(a.geometries[n],t,r)===!1)return!1;break;default:throw new Error("Unknown Geometry Type")}}}}}function X0(e,t){var r,n,i,o,a,s,l,f,c,u,d=0,h=e.type==="FeatureCollection",g=e.type==="Feature",x=h?e.features.length:1;for(r=0;r<x;r++){for(s=h?e.features[r].geometry:g?e.geometry:e,f=h?e.features[r].properties:g?e.properties:{},c=h?e.features[r].bbox:g?e.bbox:void 0,u=h?e.features[r].id:g?e.id:void 0,l=s?s.type==="GeometryCollection":!1,a=l?s.geometries.length:1,i=0;i<a;i++){if(o=l?s.geometries[i]:s,o===null){if(t(null,d,f,c,u)===!1)return!1;continue}switch(o.type){case"Point":case"LineString":case"MultiPoint":case"Polygon":case"MultiLineString":case"MultiPolygon":{if(t(o,d,f,c,u)===!1)return!1;break}case"GeometryCollection":{for(n=0;n<o.geometries.length;n++)if(t(o.geometries[n],d,f,c,u)===!1)return!1;break}default:throw new Error("Unknown Geometry Type")}}d++}}function la(e,t){X0(e,function(r,n,i,o,a){var s=r===null?null:r.type;switch(s){case null:case"Point":case"LineString":case"Polygon":return t(_e(r,i,{bbox:o,id:a}),n,0)===!1?!1:void 0}var l;switch(s){case"MultiPoint":l="Point";break;case"MultiLineString":l="LineString";break;case"MultiPolygon":l="Polygon";break}for(var f=0;f<r.coordinates.length;f++){var c=r.coordinates[f],u={type:l,coordinates:c};if(t(_e(u,i),n,f)===!1)return!1}})}function Ff(e,t={}){let r=Pt(e);switch(!t.properties&&e.type==="Feature"&&(t.properties=e.properties),r.type){case"Polygon":return Jx(r,t);case"MultiPolygon":return ev(r,t);default:throw new Error("invalid poly")}}function Jx(e,t={}){let n=Pt(e).coordinates,i=t.properties?t.properties:e.type==="Feature"?e.properties:{};return Q0(n,i)}function ev(e,t={}){let n=Pt(e).coordinates,i=t.properties?t.properties:e.type==="Feature"?e.properties:{},o=[];return n.forEach(a=>{o.push(Q0(a,i))}),Li(o)}function Q0(e,t){return e.length>1?H0(e,t):$0(e[0],t)}function tv(e,t,{ignoreSelfIntersections:r=!0}={ignoreSelfIntersections:!0}){let n=!0;return la(e,i=>{la(t,o=>{if(n===!1)return!1;n=rv(i.geometry,o.geometry,r)})}),n}function rv(e,t,r){switch(e.type){case"Point":switch(t.type){case"Point":return!av(e.coordinates,t.coordinates);case"LineString":return!Qh(t,e);case"Polygon":return!Ne(e,t)}break;case"LineString":switch(t.type){case"Point":return!Qh(e,t);case"LineString":return!nv(e,t,r);case"Polygon":return!Jh(t,e,r)}break;case"Polygon":switch(t.type){case"Point":return!Ne(t,e);case"LineString":return!Jh(e,t,r);case"Polygon":return!iv(t,e,r)}}return!1}function Qh(e,t){for(let r=0;r<e.coordinates.length-1;r++)if(ov(e.coordinates[r],e.coordinates[r+1],t.coordinates))return!0;return!1}function nv(e,t,r){return Zf(e,t,{ignoreSelfIntersections:r}).features.length>0}function Jh(e,t,r){for(let i of t.coordinates)if(Ne(i,e))return!0;return Zf(t,Ff(e),{ignoreSelfIntersections:r}).features.length>0}function iv(e,t,r){for(let i of e.coordinates[0])if(Ne(i,t))return!0;for(let i of t.coordinates[0])if(Ne(i,e))return!0;return Zf(Ff(e),Ff(t),{ignoreSelfIntersections:r}).features.length>0}function ov(e,t,r){let n=r[0]-e[0],i=r[1]-e[1],o=t[0]-e[0],a=t[1]-e[1];return n*a-i*o!==0?!1:Math.abs(o)>=Math.abs(a)?o>0?e[0]<=r[0]&&r[0]<=t[0]:t[0]<=r[0]&&r[0]<=e[0]:a>0?e[1]<=r[1]&&r[1]<=t[1]:t[1]<=r[1]&&r[1]<=e[1]}function av(e,t){return e[0]===t[0]&&e[1]===t[1]}function sv(e,t,{ignoreSelfIntersections:r=!0}={}){let n=!1;return la(e,i=>{la(t,o=>{if(n===!0)return!0;n=!tv(i.geometry,o.geometry,{ignoreSelfIntersections:r})})}),n}var J0=sv;function fv({geojson:e,spatialFilter:t,uniqueIdProperty:r}){let n=0,i=new Map;if(!t)return[];for(let o of e.features){let a=r?o.properties[r]:++n;!i.has(a)&&J0(t,o)&&i.set(a,o.properties)}return Array.from(i.values())}var dC=1/Math.PI*180,hC=1/180*Math.PI,lv={EPSILON:1e-12,debug:!1,precision:4,printTypes:!1,printDegrees:!1,printRowMajor:!0,_cartographicRadians:!1};globalThis.mathgl=globalThis.mathgl||{config:{...lv}};var pC=globalThis.mathgl.config;function cv(e){return Array.isArray(e)||ArrayBuffer.isView(e)&&!(e instanceof DataView)}function kf(e,t,r){return cv(e)?e.map((n,i)=>kf(n,t[i],r)):r*t+(1-r)*e}function e0(e,t){if(!e)throw new Error(t||"@math.gl/web-mercator: assertion failed.")}var Ke=Math.PI,ep=Ke/4,t0=Ke/180,r0=180/Ke,ca=512;function Mf(e){let[t,r]=e;e0(Number.isFinite(t)),e0(Number.isFinite(r)&&r>=-90&&r<=90,"invalid latitude");let n=t*t0,i=r*t0,o=ca*(n+Ke)/(2*Ke),a=ca*(Ke+Math.log(Math.tan(ep+i*.5)))/(2*Ke);return[o,a]}function uv(e){let[t,r]=e,n=t/ca*(2*Ke)-Ke,i=2*(Math.atan(Math.exp(r/ca*(2*Ke)-Ke))-ep);return[n*r0,i*r0]}var gC=Math.PI/180,dv={Point:tp,MultiPoint:pv,LineString:rp,MultiLineString:gv,Polygon:np,MultiPolygon:mv};function hv(e,t){let[r,n,i,o]=t,a=Mf([r,o]),s=Mf([i,n]),l=[a,s];if(e.type==="GeometryCollection")throw new Error("Unsupported geometry type GeometryCollection");let f=dv[e.type],c=f(e.coordinates,l);return{...e,coordinates:c}}function tp([e,t],[r,n]){let i=kf(r[0],n[0],e),o=kf(r[1],n[1],t);return uv([i,o])}function jf(e,t){return e.map(r=>tp(r,t))}function pv(e,t){return jf(e,t)}function rp(e,t){return jf(e,t)}function gv(e,t){return e.map(r=>rp(r,t))}function np(e,t){return e.map(r=>jf(r,t))}function mv(e,t){return e.map(r=>np(r,t))}function bv(e,t={}){let r=Number(e[0]),n=Number(e[1]),i=Number(e[2]),o=Number(e[3]);if(e.length===6)throw new Error("@turf/bbox-polygon does not support BBox with 6 positions");let a=[r,n];return Hf([[a,[i,n],[i,o],[r,o],a]],t.properties,{bbox:e,id:t.id})}var yv=bv;function ua(e,t={}){if(e.bbox!=null&&t.recompute!==!0)return e.bbox;let r=[1/0,1/0,-1/0,-1/0];return K0(e,n=>{r[0]>n[0]&&(r[0]=n[0]),r[1]>n[1]&&(r[1]=n[1]),r[2]<n[0]&&(r[2]=n[0]),r[3]<n[1]&&(r[3]=n[1])}),r}function da(e,t,r={}){let n=j0(e),i=ki(t);for(let o=0;o<i.length-1;o++){let a=!1;if(r.ignoreEndVertices&&(o===0&&(a="start"),o===i.length-2&&(a="end"),o===0&&o+1===i.length-1&&(a="both")),xv(i[o],i[o+1],n,a,typeof r.epsilon>"u"?null:r.epsilon))return!0}return!1}function xv(e,t,r,n,i){let o=r[0],a=r[1],s=e[0],l=e[1],f=t[0],c=t[1],u=r[0]-s,d=r[1]-l,h=f-s,g=c-l,x=u*g-d*h;if(i!==null){if(Math.abs(x)>i)return!1}else if(x!==0)return!1;if(Math.abs(h)===Math.abs(g)&&Math.abs(h)===0)return n?!1:r[0]===e[0]&&r[1]===e[1];if(n){if(n==="start")return Math.abs(h)>=Math.abs(g)?h>0?s<o&&o<=f:f<=o&&o<s:g>0?l<a&&a<=c:c<=a&&a<l;if(n==="end")return Math.abs(h)>=Math.abs(g)?h>0?s<=o&&o<f:f<o&&o<=s:g>0?l<=a&&a<c:c<a&&a<=l;if(n==="both")return Math.abs(h)>=Math.abs(g)?h>0?s<o&&o<f:f<o&&o<s:g>0?l<a&&a<c:c<a&&a<l}else return Math.abs(h)>=Math.abs(g)?h>0?s<=o&&o<=f:f<=o&&o<=s:g>0?l<=a&&a<=c:c<=a&&a<=l;return!1}function vv(e,t){var r=Pt(e),n=Pt(t),i=r.type,o=n.type;switch(i){case"Point":switch(o){case"MultiPoint":return wv(r,n);case"LineString":return da(r,n,{ignoreEndVertices:!0});case"Polygon":case"MultiPolygon":return Ne(r,n,{ignoreBoundary:!0});default:throw new Error("feature2 "+o+" geometry not supported")}case"MultiPoint":switch(o){case"MultiPoint":return _v(r,n);case"LineString":return Ev(r,n);case"Polygon":case"MultiPolygon":return Sv(r,n);default:throw new Error("feature2 "+o+" geometry not supported")}case"LineString":switch(o){case"LineString":return Tv(r,n);case"Polygon":case"MultiPolygon":return Cv(r,n);default:throw new Error("feature2 "+o+" geometry not supported")}case"Polygon":switch(o){case"Polygon":case"MultiPolygon":return Av(r,n);default:throw new Error("feature2 "+o+" geometry not supported")}default:throw new Error("feature1 "+i+" geometry not supported")}}function wv(e,t){var r,n=!1;for(r=0;r<t.coordinates.length;r++)if(op(t.coordinates[r],e.coordinates)){n=!0;break}return n}function _v(e,t){for(var r=0;r<e.coordinates.length;r++){for(var n=!1,i=0;i<t.coordinates.length;i++)op(e.coordinates[r],t.coordinates[i])&&(n=!0);if(!n)return!1}return!0}function Ev(e,t){for(var r=!1,n=0;n<e.coordinates.length;n++){if(!da(e.coordinates[n],t))return!1;r||(r=da(e.coordinates[n],t,{ignoreEndVertices:!0}))}return r}function Sv(e,t){for(var r=!0,n=!1,i=!1,o=0;o<e.coordinates.length;o++){if(i=Ne(e.coordinates[o],t),!i){r=!1;break}n||(i=Ne(e.coordinates[o],t,{ignoreBoundary:!0}))}return r&&i}function Tv(e,t){for(var r=0;r<e.coordinates.length;r++)if(!da(e.coordinates[r],t))return!1;return!0}function Cv(e,t){var r=ua(t),n=ua(e);if(!ip(r,n))return!1;for(var i=!1,o=0;o<e.coordinates.length;o++){if(!Ne(e.coordinates[o],t))return!1;if(i||(i=Ne(e.coordinates[o],t,{ignoreBoundary:!0})),!i&&o<e.coordinates.length-1){var a=Pv(e.coordinates[o],e.coordinates[o+1]);i=Ne(a,t,{ignoreBoundary:!0})}}return i}function Av(e,t){var r=ua(e),n=ua(t);if(!ip(n,r))return!1;for(var i=0;i<e.coordinates[0].length;i++)if(!Ne(e.coordinates[0][i],t))return!1;return!0}function ip(e,t){return!(e[0]>t[0]||e[2]<t[2]||e[1]>t[1]||e[3]<t[3])}function op(e,t){return e[0]===t[0]&&e[1]===t[1]}function Pv(e,t){return[(e[0]+t[0])/2,(e[1]+t[1])/2]}var ap=vv,Fv=/^-?(?:\d+(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?$/i,vf=Math.ceil,Be=Math.floor,ve="[BigNumber Error] ",n0=ve+"Number primitive has more than 15 significant digits: ",We=1e14,q=14,wf=9007199254740991,_f=[1,10,100,1e3,1e4,1e5,1e6,1e7,1e8,1e9,1e10,1e11,1e12,1e13],$t=1e7,fe=1e9;function sp(e){var t,r,n,i=w.prototype={constructor:w,toString:null,valueOf:null},o=new w(1),a=20,s=4,l=-7,f=21,c=-1e7,u=1e7,d=!1,h=1,g=0,x={prefix:"",groupSize:3,secondaryGroupSize:0,groupSeparator:",",decimalSeparator:".",fractionGroupSize:0,fractionGroupSeparator:"\xA0",suffix:""},S="0123456789abcdefghijklmnopqrstuvwxyz",T=!0;function w(p,m){var b,y,v,E,F,_,C,P,A=this;if(!(A instanceof w))return new w(p,m);if(m==null){if(p&&p._isBigNumber===!0){A.s=p.s,!p.c||p.e>u?A.c=A.e=null:p.e<c?A.c=[A.e=0]:(A.e=p.e,A.c=p.c.slice());return}if((_=typeof p=="number")&&p*0==0){if(A.s=1/p<0?(p=-p,-1):1,p===~~p){for(E=0,F=p;F>=10;F/=10,E++);E>u?A.c=A.e=null:(A.e=E,A.c=[p]);return}P=String(p)}else{if(!Fv.test(P=String(p)))return n(A,P,_);A.s=P.charCodeAt(0)==45?(P=P.slice(1),-1):1}(E=P.indexOf("."))>-1&&(P=P.replace(".","")),(F=P.search(/e/i))>0?(E<0&&(E=F),E+=+P.slice(F+1),P=P.substring(0,F)):E<0&&(E=P.length)}else{if(te(m,2,S.length,"Base"),m==10&&T)return A=new w(p),R(A,a+A.e+1,s);if(P=String(p),_=typeof p=="number"){if(p*0!=0)return n(A,P,_,m);if(A.s=1/p<0?(P=P.slice(1),-1):1,w.DEBUG&&P.replace(/^0\.0*|\./,"").length>15)throw Error(n0+p)}else A.s=P.charCodeAt(0)===45?(P=P.slice(1),-1):1;for(b=S.slice(0,m),E=F=0,C=P.length;F<C;F++)if(b.indexOf(y=P.charAt(F))<0){if(y=="."){if(F>E){E=C;continue}}else if(!v&&(P==P.toUpperCase()&&(P=P.toLowerCase())||P==P.toLowerCase()&&(P=P.toUpperCase()))){v=!0,F=-1,E=0;continue}return n(A,String(p),_,m)}_=!1,P=r(P,m,10,A.s),(E=P.indexOf("."))>-1?P=P.replace(".",""):E=P.length}for(F=0;P.charCodeAt(F)===48;F++);for(C=P.length;P.charCodeAt(--C)===48;);if(P=P.slice(F,++C)){if(C-=F,_&&w.DEBUG&&C>15&&(p>wf||p!==Be(p)))throw Error(n0+A.s*p);if((E=E-F-1)>u)A.c=A.e=null;else if(E<c)A.c=[A.e=0];else{if(A.e=E,A.c=[],F=(E+1)%q,E<0&&(F+=q),F<C){for(F&&A.c.push(+P.slice(0,F)),C-=q;F<C;)A.c.push(+P.slice(F,F+=q));F=q-(P=P.slice(F)).length}else F-=C;for(;F--;P+="0");A.c.push(+P)}}else A.c=[A.e=0]}w.clone=sp,w.ROUND_UP=0,w.ROUND_DOWN=1,w.ROUND_CEIL=2,w.ROUND_FLOOR=3,w.ROUND_HALF_UP=4,w.ROUND_HALF_DOWN=5,w.ROUND_HALF_EVEN=6,w.ROUND_HALF_CEIL=7,w.ROUND_HALF_FLOOR=8,w.EUCLID=9,w.config=w.set=function(p){var m,b;if(p!=null)if(typeof p=="object"){if(p.hasOwnProperty(m="DECIMAL_PLACES")&&(b=p[m],te(b,0,fe,m),a=b),p.hasOwnProperty(m="ROUNDING_MODE")&&(b=p[m],te(b,0,8,m),s=b),p.hasOwnProperty(m="EXPONENTIAL_AT")&&(b=p[m],b&&b.pop?(te(b[0],-fe,0,m),te(b[1],0,fe,m),l=b[0],f=b[1]):(te(b,-fe,fe,m),l=-(f=b<0?-b:b))),p.hasOwnProperty(m="RANGE"))if(b=p[m],b&&b.pop)te(b[0],-fe,-1,m),te(b[1],1,fe,m),c=b[0],u=b[1];else if(te(b,-fe,fe,m),b)c=-(u=b<0?-b:b);else throw Error(ve+m+" cannot be zero: "+b);if(p.hasOwnProperty(m="CRYPTO"))if(b=p[m],b===!!b)if(b)if(typeof crypto<"u"&&crypto&&(crypto.getRandomValues||crypto.randomBytes))d=b;else throw d=!b,Error(ve+"crypto unavailable");else d=b;else throw Error(ve+m+" not true or false: "+b);if(p.hasOwnProperty(m="MODULO_MODE")&&(b=p[m],te(b,0,9,m),h=b),p.hasOwnProperty(m="POW_PRECISION")&&(b=p[m],te(b,0,fe,m),g=b),p.hasOwnProperty(m="FORMAT"))if(b=p[m],typeof b=="object")x=b;else throw Error(ve+m+" not an object: "+b);if(p.hasOwnProperty(m="ALPHABET"))if(b=p[m],typeof b=="string"&&!/^.?$|[+\-.\s]|(.).*\1/.test(b))T=b.slice(0,10)=="0123456789",S=b;else throw Error(ve+m+" invalid: "+b)}else throw Error(ve+"Object expected: "+p);return{DECIMAL_PLACES:a,ROUNDING_MODE:s,EXPONENTIAL_AT:[l,f],RANGE:[c,u],CRYPTO:d,MODULO_MODE:h,POW_PRECISION:g,FORMAT:x,ALPHABET:S}},w.isBigNumber=function(p){if(!p||p._isBigNumber!==!0)return!1;if(!w.DEBUG)return!0;var m,b,y=p.c,v=p.e,E=p.s;e:if({}.toString.call(y)=="[object Array]"){if((E===1||E===-1)&&v>=-fe&&v<=fe&&v===Be(v)){if(y[0]===0){if(v===0&&y.length===1)return!0;break e}if(m=(v+1)%q,m<1&&(m+=q),String(y[0]).length==m){for(m=0;m<y.length;m++)if(b=y[m],b<0||b>=We||b!==Be(b))break e;if(b!==0)return!0}}}else if(y===null&&v===null&&(E===null||E===1||E===-1))return!0;throw Error(ve+"Invalid BigNumber: "+p)},w.maximum=w.max=function(){return I(arguments,-1)},w.minimum=w.min=function(){return I(arguments,1)},w.random=function(){var p=9007199254740992,m=Math.random()*p&2097151?function(){return Be(Math.random()*p)}:function(){return(Math.random()*1073741824|0)*8388608+(Math.random()*8388608|0)};return function(b){var y,v,E,F,_,C=0,P=[],A=new w(o);if(b==null?b=a:te(b,0,fe),F=vf(b/q),d)if(crypto.getRandomValues){for(y=crypto.getRandomValues(new Uint32Array(F*=2));C<F;)_=y[C]*131072+(y[C+1]>>>11),_>=9e15?(v=crypto.getRandomValues(new Uint32Array(2)),y[C]=v[0],y[C+1]=v[1]):(P.push(_%1e14),C+=2);C=F/2}else if(crypto.randomBytes){for(y=crypto.randomBytes(F*=7);C<F;)_=(y[C]&31)*281474976710656+y[C+1]*1099511627776+y[C+2]*4294967296+y[C+3]*16777216+(y[C+4]<<16)+(y[C+5]<<8)+y[C+6],_>=9e15?crypto.randomBytes(7).copy(y,C):(P.push(_%1e14),C+=7);C=F/7}else throw d=!1,Error(ve+"crypto unavailable");if(!d)for(;C<F;)_=m(),_<9e15&&(P[C++]=_%1e14);for(F=P[--C],b%=q,F&&b&&(_=_f[q-b],P[C]=Be(F/_)*_);P[C]===0;P.pop(),C--);if(C<0)P=[E=0];else{for(E=-1;P[0]===0;P.splice(0,1),E-=q);for(C=1,_=P[0];_>=10;_/=10,C++);C<q&&(E-=q-C)}return A.e=E,A.c=P,A}}(),w.sum=function(){for(var p=1,m=arguments,b=new w(m[0]);p<m.length;)b=b.plus(m[p++]);return b},r=function(){var p="0123456789";function m(b,y,v,E){for(var F,_=[0],C,P=0,A=b.length;P<A;){for(C=_.length;C--;_[C]*=y);for(_[0]+=E.indexOf(b.charAt(P++)),F=0;F<_.length;F++)_[F]>v-1&&(_[F+1]==null&&(_[F+1]=0),_[F+1]+=_[F]/v|0,_[F]%=v)}return _.reverse()}return function(b,y,v,E,F){var _,C,P,A,O,z,U,Z,re=b.indexOf("."),ae=a,H=s;for(re>=0&&(A=g,g=0,b=b.replace(".",""),Z=new w(y),z=Z.pow(b.length-re),g=A,Z.c=m(St(Oe(z.c),z.e,"0"),10,v,p),Z.e=Z.c.length),U=m(b,y,v,F?(_=S,p):(_=p,S)),P=A=U.length;U[--A]==0;U.pop());if(!U[0])return _.charAt(0);if(re<0?--P:(z.c=U,z.e=P,z.s=E,z=t(z,Z,ae,H,v),U=z.c,O=z.r,P=z.e),C=P+ae+1,re=U[C],A=v/2,O=O||C<0||U[C+1]!=null,O=H<4?(re!=null||O)&&(H==0||H==(z.s<0?3:2)):re>A||re==A&&(H==4||O||H==6&&U[C-1]&1||H==(z.s<0?8:7)),C<1||!U[0])b=O?St(_.charAt(1),-ae,_.charAt(0)):_.charAt(0);else{if(U.length=C,O)for(--v;++U[--C]>v;)U[C]=0,C||(++P,U=[1].concat(U));for(A=U.length;!U[--A];);for(re=0,b="";re<=A;b+=_.charAt(U[re++]));b=St(b,P,_.charAt(0))}return b}}(),t=function(){function p(y,v,E){var F,_,C,P,A=0,O=y.length,z=v%$t,U=v/$t|0;for(y=y.slice();O--;)C=y[O]%$t,P=y[O]/$t|0,F=U*C+P*z,_=z*C+F%$t*$t+A,A=(_/E|0)+(F/$t|0)+U*P,y[O]=_%E;return A&&(y=[A].concat(y)),y}function m(y,v,E,F){var _,C;if(E!=F)C=E>F?1:-1;else for(_=C=0;_<E;_++)if(y[_]!=v[_]){C=y[_]>v[_]?1:-1;break}return C}function b(y,v,E,F){for(var _=0;E--;)y[E]-=_,_=y[E]<v[E]?1:0,y[E]=_*F+y[E]-v[E];for(;!y[0]&&y.length>1;y.splice(0,1));}return function(y,v,E,F,_){var C,P,A,O,z,U,Z,re,ae,H,K,ce,Ui,Ua,qa,Qe,hn,Pe=y.s==v.s?1:-1,he=y.c,ne=v.c;if(!he||!he[0]||!ne||!ne[0])return new w(!y.s||!v.s||(he?ne&&he[0]==ne[0]:!ne)?NaN:he&&he[0]==0||!ne?Pe*0:Pe/0);for(re=new w(Pe),ae=re.c=[],P=y.e-v.e,Pe=E+P+1,_||(_=We,P=Re(y.e/q)-Re(v.e/q),Pe=Pe/q|0),A=0;ne[A]==(he[A]||0);A++);if(ne[A]>(he[A]||0)&&P--,Pe<0)ae.push(1),O=!0;else{for(Ua=he.length,Qe=ne.length,A=0,Pe+=2,z=Be(_/(ne[0]+1)),z>1&&(ne=p(ne,z,_),he=p(he,z,_),Qe=ne.length,Ua=he.length),Ui=Qe,H=he.slice(0,Qe),K=H.length;K<Qe;H[K++]=0);hn=ne.slice(),hn=[0].concat(hn),qa=ne[0],ne[1]>=_/2&&qa++;do{if(z=0,C=m(ne,H,Qe,K),C<0){if(ce=H[0],Qe!=K&&(ce=ce*_+(H[1]||0)),z=Be(ce/qa),z>1)for(z>=_&&(z=_-1),U=p(ne,z,_),Z=U.length,K=H.length;m(U,H,Z,K)==1;)z--,b(U,Qe<Z?hn:ne,Z,_),Z=U.length,C=1;else z==0&&(C=z=1),U=ne.slice(),Z=U.length;if(Z<K&&(U=[0].concat(U)),b(H,U,K,_),K=H.length,C==-1)for(;m(ne,H,Qe,K)<1;)z++,b(H,Qe<K?hn:ne,K,_),K=H.length}else C===0&&(z++,H=[0]);ae[A++]=z,H[0]?H[K++]=he[Ui]||0:(H=[he[Ui]],K=1)}while((Ui++<Ua||H[0]!=null)&&Pe--);O=H[0]!=null,ae[0]||ae.splice(0,1)}if(_==We){for(A=1,Pe=ae[0];Pe>=10;Pe/=10,A++);R(re,E+(re.e=A+P*q-1)+1,F,O)}else re.e=P,re.r=+O;return re}}();function k(p,m,b,y){var v,E,F,_,C;if(b==null?b=s:te(b,0,8),!p.c)return p.toString();if(v=p.c[0],F=p.e,m==null)C=Oe(p.c),C=y==1||y==2&&(F<=l||F>=f)?ra(C,F):St(C,F,"0");else if(p=R(new w(p),m,b),E=p.e,C=Oe(p.c),_=C.length,y==1||y==2&&(m<=E||E<=l)){for(;_<m;C+="0",_++);C=ra(C,E)}else if(m-=F,C=St(C,E,"0"),E+1>_){if(--m>0)for(C+=".";m--;C+="0");}else if(m+=E-_,m>0)for(E+1==_&&(C+=".");m--;C+="0");return p.s<0&&v?"-"+C:C}function I(p,m){for(var b,y,v=1,E=new w(p[0]);v<p.length;v++)y=new w(p[v]),(!y.s||(b=vr(E,y))===m||b===0&&E.s===m)&&(E=y);return E}function L(p,m,b){for(var y=1,v=m.length;!m[--v];m.pop());for(v=m[0];v>=10;v/=10,y++);return(b=y+b*q-1)>u?p.c=p.e=null:b<c?p.c=[p.e=0]:(p.e=b,p.c=m),p}n=function(){var p=/^(-?)0([xbo])(?=\w[\w.]*$)/i,m=/^([^.]+)\.$/,b=/^\.([^.]+)$/,y=/^-?(Infinity|NaN)$/,v=/^\s*\+(?=[\w.])|^\s+|\s+$/g;return function(E,F,_,C){var P,A=_?F:F.replace(v,"");if(y.test(A))E.s=isNaN(A)?null:A<0?-1:1;else{if(!_&&(A=A.replace(p,function(O,z,U){return P=(U=U.toLowerCase())=="x"?16:U=="b"?2:8,!C||C==P?z:O}),C&&(P=C,A=A.replace(m,"$1").replace(b,"0.$1")),F!=A))return new w(A,P);if(w.DEBUG)throw Error(ve+"Not a"+(C?" base "+C:"")+" number: "+F);E.s=null}E.c=E.e=null}}();function R(p,m,b,y){var v,E,F,_,C,P,A,O=p.c,z=_f;if(O){e:{for(v=1,_=O[0];_>=10;_/=10,v++);if(E=m-v,E<0)E+=q,F=m,C=O[P=0],A=Be(C/z[v-F-1]%10);else if(P=vf((E+1)/q),P>=O.length)if(y){for(;O.length<=P;O.push(0));C=A=0,v=1,E%=q,F=E-q+1}else break e;else{for(C=_=O[P],v=1;_>=10;_/=10,v++);E%=q,F=E-q+v,A=F<0?0:Be(C/z[v-F-1]%10)}if(y=y||m<0||O[P+1]!=null||(F<0?C:C%z[v-F-1]),y=b<4?(A||y)&&(b==0||b==(p.s<0?3:2)):A>5||A==5&&(b==4||y||b==6&&(E>0?F>0?C/z[v-F]:0:O[P-1])%10&1||b==(p.s<0?8:7)),m<1||!O[0])return O.length=0,y?(m-=p.e+1,O[0]=z[(q-m%q)%q],p.e=-m||0):O[0]=p.e=0,p;if(E==0?(O.length=P,_=1,P--):(O.length=P+1,_=z[q-E],O[P]=F>0?Be(C/z[v-F]%z[F])*_:0),y)for(;;)if(P==0){for(E=1,F=O[0];F>=10;F/=10,E++);for(F=O[0]+=_,_=1;F>=10;F/=10,_++);E!=_&&(p.e++,O[0]==We&&(O[0]=1));break}else{if(O[P]+=_,O[P]!=We)break;O[P--]=0,_=1}for(E=O.length;O[--E]===0;O.pop());}p.e>u?p.c=p.e=null:p.e<c&&(p.c=[p.e=0])}return p}function N(p){var m,b=p.e;return b===null?p.toString():(m=Oe(p.c),m=b<=l||b>=f?ra(m,b):St(m,b,"0"),p.s<0?"-"+m:m)}return i.absoluteValue=i.abs=function(){var p=new w(this);return p.s<0&&(p.s=1),p},i.comparedTo=function(p,m){return vr(this,new w(p,m))},i.decimalPlaces=i.dp=function(p,m){var b,y,v,E=this;if(p!=null)return te(p,0,fe),m==null?m=s:te(m,0,8),R(new w(E),p+E.e+1,m);if(!(b=E.c))return null;if(y=((v=b.length-1)-Re(this.e/q))*q,v=b[v])for(;v%10==0;v/=10,y--);return y<0&&(y=0),y},i.dividedBy=i.div=function(p,m){return t(this,new w(p,m),a,s)},i.dividedToIntegerBy=i.idiv=function(p,m){return t(this,new w(p,m),0,1)},i.exponentiatedBy=i.pow=function(p,m){var b,y,v,E,F,_,C,P,A,O=this;if(p=new w(p),p.c&&!p.isInteger())throw Error(ve+"Exponent not an integer: "+N(p));if(m!=null&&(m=new w(m)),_=p.e>14,!O.c||!O.c[0]||O.c[0]==1&&!O.e&&O.c.length==1||!p.c||!p.c[0])return A=new w(Math.pow(+N(O),_?p.s*(2-ta(p)):+N(p))),m?A.mod(m):A;if(C=p.s<0,m){if(m.c?!m.c[0]:!m.s)return new w(NaN);y=!C&&O.isInteger()&&m.isInteger(),y&&(O=O.mod(m))}else{if(p.e>9&&(O.e>0||O.e<-1||(O.e==0?O.c[0]>1||_&&O.c[1]>=24e7:O.c[0]<8e13||_&&O.c[0]<=9999975e7)))return E=O.s<0&&ta(p)?-0:0,O.e>-1&&(E=1/E),new w(C?1/E:E);g&&(E=vf(g/q+2))}for(_?(b=new w(.5),C&&(p.s=1),P=ta(p)):(v=Math.abs(+N(p)),P=v%2),A=new w(o);;){if(P){if(A=A.times(O),!A.c)break;E?A.c.length>E&&(A.c.length=E):y&&(A=A.mod(m))}if(v){if(v=Be(v/2),v===0)break;P=v%2}else if(p=p.times(b),R(p,p.e+1,1),p.e>14)P=ta(p);else{if(v=+N(p),v===0)break;P=v%2}O=O.times(O),E?O.c&&O.c.length>E&&(O.c.length=E):y&&(O=O.mod(m))}return y?A:(C&&(A=o.div(A)),m?A.mod(m):E?R(A,g,s,F):A)},i.integerValue=function(p){var m=new w(this);return p==null?p=s:te(p,0,8),R(m,m.e+1,p)},i.isEqualTo=i.eq=function(p,m){return vr(this,new w(p,m))===0},i.isFinite=function(){return!!this.c},i.isGreaterThan=i.gt=function(p,m){return vr(this,new w(p,m))>0},i.isGreaterThanOrEqualTo=i.gte=function(p,m){return(m=vr(this,new w(p,m)))===1||m===0},i.isInteger=function(){return!!this.c&&Re(this.e/q)>this.c.length-2},i.isLessThan=i.lt=function(p,m){return vr(this,new w(p,m))<0},i.isLessThanOrEqualTo=i.lte=function(p,m){return(m=vr(this,new w(p,m)))===-1||m===0},i.isNaN=function(){return!this.s},i.isNegative=function(){return this.s<0},i.isPositive=function(){return this.s>0},i.isZero=function(){return!!this.c&&this.c[0]==0},i.minus=function(p,m){var b,y,v,E,F=this,_=F.s;if(p=new w(p,m),m=p.s,!_||!m)return new w(NaN);if(_!=m)return p.s=-m,F.plus(p);var C=F.e/q,P=p.e/q,A=F.c,O=p.c;if(!C||!P){if(!A||!O)return A?(p.s=-m,p):new w(O?F:NaN);if(!A[0]||!O[0])return O[0]?(p.s=-m,p):new w(A[0]?F:s==3?-0:0)}if(C=Re(C),P=Re(P),A=A.slice(),_=C-P){for((E=_<0)?(_=-_,v=A):(P=C,v=O),v.reverse(),m=_;m--;v.push(0));v.reverse()}else for(y=(E=(_=A.length)<(m=O.length))?_:m,_=m=0;m<y;m++)if(A[m]!=O[m]){E=A[m]<O[m];break}if(E&&(v=A,A=O,O=v,p.s=-p.s),m=(y=O.length)-(b=A.length),m>0)for(;m--;A[b++]=0);for(m=We-1;y>_;){if(A[--y]<O[y]){for(b=y;b&&!A[--b];A[b]=m);--A[b],A[y]+=We}A[y]-=O[y]}for(;A[0]==0;A.splice(0,1),--P);return A[0]?L(p,A,P):(p.s=s==3?-1:1,p.c=[p.e=0],p)},i.modulo=i.mod=function(p,m){var b,y,v=this;return p=new w(p,m),!v.c||!p.s||p.c&&!p.c[0]?new w(NaN):!p.c||v.c&&!v.c[0]?new w(v):(h==9?(y=p.s,p.s=1,b=t(v,p,0,3),p.s=y,b.s*=y):b=t(v,p,0,h),p=v.minus(b.times(p)),!p.c[0]&&h==1&&(p.s=v.s),p)},i.multipliedBy=i.times=function(p,m){var b,y,v,E,F,_,C,P,A,O,z,U,Z,re,ae,H=this,K=H.c,ce=(p=new w(p,m)).c;if(!K||!ce||!K[0]||!ce[0])return!H.s||!p.s||K&&!K[0]&&!ce||ce&&!ce[0]&&!K?p.c=p.e=p.s=null:(p.s*=H.s,!K||!ce?p.c=p.e=null:(p.c=[0],p.e=0)),p;for(y=Re(H.e/q)+Re(p.e/q),p.s*=H.s,C=K.length,O=ce.length,C<O&&(Z=K,K=ce,ce=Z,v=C,C=O,O=v),v=C+O,Z=[];v--;Z.push(0));for(re=We,ae=$t,v=O;--v>=0;){for(b=0,z=ce[v]%ae,U=ce[v]/ae|0,F=C,E=v+F;E>v;)P=K[--F]%ae,A=K[F]/ae|0,_=U*P+A*z,P=z*P+_%ae*ae+Z[E]+b,b=(P/re|0)+(_/ae|0)+U*A,Z[E--]=P%re;Z[E]=b}return b?++y:Z.splice(0,1),L(p,Z,y)},i.negated=function(){var p=new w(this);return p.s=-p.s||null,p},i.plus=function(p,m){var b,y=this,v=y.s;if(p=new w(p,m),m=p.s,!v||!m)return new w(NaN);if(v!=m)return p.s=-m,y.minus(p);var E=y.e/q,F=p.e/q,_=y.c,C=p.c;if(!E||!F){if(!_||!C)return new w(v/0);if(!_[0]||!C[0])return C[0]?p:new w(_[0]?y:v*0)}if(E=Re(E),F=Re(F),_=_.slice(),v=E-F){for(v>0?(F=E,b=C):(v=-v,b=_),b.reverse();v--;b.push(0));b.reverse()}for(v=_.length,m=C.length,v-m<0&&(b=C,C=_,_=b,m=v),v=0;m;)v=(_[--m]=_[m]+C[m]+v)/We|0,_[m]=We===_[m]?0:_[m]%We;return v&&(_=[v].concat(_),++F),L(p,_,F)},i.precision=i.sd=function(p,m){var b,y,v,E=this;if(p!=null&&p!==!!p)return te(p,1,fe),m==null?m=s:te(m,0,8),R(new w(E),p,m);if(!(b=E.c))return null;if(v=b.length-1,y=v*q+1,v=b[v]){for(;v%10==0;v/=10,y--);for(v=b[0];v>=10;v/=10,y++);}return p&&E.e+1>y&&(y=E.e+1),y},i.shiftedBy=function(p){return te(p,-wf,wf),this.times("1e"+p)},i.squareRoot=i.sqrt=function(){var p,m,b,y,v,E=this,F=E.c,_=E.s,C=E.e,P=a+4,A=new w("0.5");if(_!==1||!F||!F[0])return new w(!_||_<0&&(!F||F[0])?NaN:F?E:1/0);if(_=Math.sqrt(+N(E)),_==0||_==1/0?(m=Oe(F),(m.length+C)%2==0&&(m+="0"),_=Math.sqrt(+m),C=Re((C+1)/2)-(C<0||C%2),_==1/0?m="5e"+C:(m=_.toExponential(),m=m.slice(0,m.indexOf("e")+1)+C),b=new w(m)):b=new w(_+""),b.c[0]){for(C=b.e,_=C+P,_<3&&(_=0);;)if(v=b,b=A.times(v.plus(t(E,v,P,1))),Oe(v.c).slice(0,_)===(m=Oe(b.c)).slice(0,_))if(b.e<C&&--_,m=m.slice(_-3,_+1),m=="9999"||!y&&m=="4999"){if(!y&&(R(v,v.e+a+2,0),v.times(v).eq(E))){b=v;break}P+=4,_+=4,y=1}else{(!+m||!+m.slice(1)&&m.charAt(0)=="5")&&(R(b,b.e+a+2,1),p=!b.times(b).eq(E));break}}return R(b,b.e+a+1,s,p)},i.toExponential=function(p,m){return p!=null&&(te(p,0,fe),p++),k(this,p,m,1)},i.toFixed=function(p,m){return p!=null&&(te(p,0,fe),p=p+this.e+1),k(this,p,m)},i.toFormat=function(p,m,b){var y,v=this;if(b==null)p!=null&&m&&typeof m=="object"?(b=m,m=null):p&&typeof p=="object"?(b=p,p=m=null):b=x;else if(typeof b!="object")throw Error(ve+"Argument not an object: "+b);if(y=v.toFixed(p,m),v.c){var E,F=y.split("."),_=+b.groupSize,C=+b.secondaryGroupSize,P=b.groupSeparator||"",A=F[0],O=F[1],z=v.s<0,U=z?A.slice(1):A,Z=U.length;if(C&&(E=_,_=C,C=E,Z-=E),_>0&&Z>0){for(E=Z%_||_,A=U.substr(0,E);E<Z;E+=_)A+=P+U.substr(E,_);C>0&&(A+=P+U.slice(E)),z&&(A="-"+A)}y=O?A+(b.decimalSeparator||"")+((C=+b.fractionGroupSize)?O.replace(new RegExp("\\d{"+C+"}\\B","g"),"$&"+(b.fractionGroupSeparator||"")):O):A}return(b.prefix||"")+y+(b.suffix||"")},i.toFraction=function(p){var m,b,y,v,E,F,_,C,P,A,O,z,U=this,Z=U.c;if(p!=null&&(_=new w(p),!_.isInteger()&&(_.c||_.s!==1)||_.lt(o)))throw Error(ve+"Argument "+(_.isInteger()?"out of range: ":"not an integer: ")+N(_));if(!Z)return new w(U);for(m=new w(o),P=b=new w(o),y=C=new w(o),z=Oe(Z),E=m.e=z.length-U.e-1,m.c[0]=_f[(F=E%q)<0?q+F:F],p=!p||_.comparedTo(m)>0?E>0?m:P:_,F=u,u=1/0,_=new w(z),C.c[0]=0;A=t(_,m,0,1),v=b.plus(A.times(y)),v.comparedTo(p)!=1;)b=y,y=v,P=C.plus(A.times(v=P)),C=v,m=_.minus(A.times(v=m)),_=v;return v=t(p.minus(b),y,0,1),C=C.plus(v.times(P)),b=b.plus(v.times(y)),C.s=P.s=U.s,E=E*2,O=t(P,y,E,s).minus(U).abs().comparedTo(t(C,b,E,s).minus(U).abs())<1?[P,y]:[C,b],u=F,O},i.toNumber=function(){return+N(this)},i.toPrecision=function(p,m){return p!=null&&te(p,1,fe),k(this,p,m,2)},i.toString=function(p){var m,b=this,y=b.s,v=b.e;return v===null?y?(m="Infinity",y<0&&(m="-"+m)):m="NaN":(p==null?m=v<=l||v>=f?ra(Oe(b.c),v):St(Oe(b.c),v,"0"):p===10&&T?(b=R(new w(b),a+v+1,s),m=St(Oe(b.c),b.e,"0")):(te(p,2,S.length,"Base"),m=r(St(Oe(b.c),v,"0"),10,p,y,!0)),y<0&&b.c[0]&&(m="-"+m)),m},i.valueOf=i.toJSON=function(){return N(this)},i._isBigNumber=!0,i[Symbol.toStringTag]="BigNumber",i[Symbol.for("nodejs.util.inspect.custom")]=i.valueOf,e!=null&&w.set(e),w}function Re(e){var t=e|0;return e>0||e===t?t:t-1}function Oe(e){for(var t,r,n=1,i=e.length,o=e[0]+"";n<i;){for(t=e[n++]+"",r=q-t.length;r--;t="0"+t);o+=t}for(i=o.length;o.charCodeAt(--i)===48;);return o.slice(0,i+1||1)}function vr(e,t){var r,n,i=e.c,o=t.c,a=e.s,s=t.s,l=e.e,f=t.e;if(!a||!s)return null;if(r=i&&!i[0],n=o&&!o[0],r||n)return r?n?0:-s:a;if(a!=s)return a;if(r=a<0,n=l==f,!i||!o)return n?0:!i^r?1:-1;if(!n)return l>f^r?1:-1;for(s=(l=i.length)<(f=o.length)?l:f,a=0;a<s;a++)if(i[a]!=o[a])return i[a]>o[a]^r?1:-1;return l==f?0:l>f^r?1:-1}function te(e,t,r,n){if(e<t||e>r||e!==Be(e))throw Error(ve+(n||"Argument")+(typeof e=="number"?e<t||e>r?" out of range: ":" not an integer: ":" not a primitive number: ")+String(e))}function ta(e){var t=e.c.length-1;return Re(e.e/q)==t&&e.c[t]%2!=0}function ra(e,t){return(e.length>1?e.charAt(0)+"."+e.slice(1):e)+(t<0?"e":"e+")+t}function St(e,t,r){var n,i;if(t<0){for(i=r+".";++t;i+=r);e=i+e}else if(n=e.length,++t>n){for(i=r,t-=n;--t;i+=r);e+=i}else t<n&&(e=e.slice(0,t)+"."+e.slice(t));return e}var kv=sp(),dt=kv,Mv=class{constructor(e){D(this,"key"),D(this,"left",null),D(this,"right",null),this.key=e}},Ei=class extends Mv{constructor(e){super(e)}},Lv=class{constructor(){D(this,"size",0),D(this,"modificationCount",0),D(this,"splayCount",0)}splay(e){let t=this.root;if(t==null)return this.compare(e,e),-1;let r=null,n=null,i=null,o=null,a=t,s=this.compare,l;for(;;)if(l=s(a.key,e),l>0){let f=a.left;if(f==null||(l=s(f.key,e),l>0&&(a.left=f.right,f.right=a,a=f,f=a.left,f==null)))break;r==null?n=a:r.left=a,r=a,a=f}else if(l<0){let f=a.right;if(f==null||(l=s(f.key,e),l<0&&(a.right=f.left,f.left=a,a=f,f=a.right,f==null)))break;i==null?o=a:i.right=a,i=a,a=f}else break;return i!=null&&(i.right=a.left,a.left=o),r!=null&&(r.left=a.right,a.right=n),this.root!==a&&(this.root=a,this.splayCount++),l}splayMin(e){let t=e,r=t.left;for(;r!=null;){let n=r;t.left=n.right,n.right=t,t=n,r=t.left}return t}splayMax(e){let t=e,r=t.right;for(;r!=null;){let n=r;t.right=n.left,n.left=t,t=n,r=t.right}return t}_delete(e){if(this.root==null||this.splay(e)!=0)return null;let r=this.root,n=r,i=r.left;if(this.size--,i==null)this.root=r.right;else{let o=r.right;r=this.splayMax(i),r.right=o,this.root=r}return this.modificationCount++,n}addNewRoot(e,t){this.size++,this.modificationCount++;let r=this.root;if(r==null){this.root=e;return}t<0?(e.left=r,e.right=r.right,r.right=null):(e.right=r,e.left=r.left,r.left=null),this.root=e}_first(){let e=this.root;return e==null?null:(this.root=this.splayMin(e),this.root)}_last(){let e=this.root;return e==null?null:(this.root=this.splayMax(e),this.root)}clear(){this.root=null,this.size=0,this.modificationCount++}has(e){return this.validKey(e)&&this.splay(e)==0}defaultCompare(){return(e,t)=>e<t?-1:e>t?1:0}wrap(){return{getRoot:()=>this.root,setRoot:e=>{this.root=e},getSize:()=>this.size,getModificationCount:()=>this.modificationCount,getSplayCount:()=>this.splayCount,setSplayCount:e=>{this.splayCount=e},splay:e=>this.splay(e),has:e=>this.has(e)}}},i0,o0,ha=class Ci extends Lv{constructor(t,r){super(),D(this,"root",null),D(this,"compare"),D(this,"validKey"),D(this,i0,"[object Set]"),this.compare=t??this.defaultCompare(),this.validKey=r??(n=>n!=null&&n!=null)}delete(t){return this.validKey(t)?this._delete(t)!=null:!1}deleteAll(t){for(let r of t)this.delete(r)}forEach(t){let r=this[Symbol.iterator](),n;for(;n=r.next(),!n.done;)t(n.value,n.value,this)}add(t){let r=this.splay(t);return r!=0&&this.addNewRoot(new Ei(t),r),this}addAndReturn(t){let r=this.splay(t);return r!=0&&this.addNewRoot(new Ei(t),r),this.root.key}addAll(t){for(let r of t)this.add(r)}isEmpty(){return this.root==null}isNotEmpty(){return this.root!=null}single(){if(this.size==0)throw"Bad state: No element";if(this.size>1)throw"Bad state: Too many element";return this.root.key}first(){if(this.size==0)throw"Bad state: No element";return this._first().key}last(){if(this.size==0)throw"Bad state: No element";return this._last().key}lastBefore(t){if(t==null)throw"Invalid arguments(s)";if(this.root==null)return null;if(this.splay(t)<0)return this.root.key;let n=this.root.left;if(n==null)return null;let i=n.right;for(;i!=null;)n=i,i=n.right;return n.key}firstAfter(t){if(t==null)throw"Invalid arguments(s)";if(this.root==null)return null;if(this.splay(t)>0)return this.root.key;let n=this.root.right;if(n==null)return null;let i=n.left;for(;i!=null;)n=i,i=n.left;return n.key}retainAll(t){let r=new Ci(this.compare,this.validKey),n=this.modificationCount;for(let i of t){if(n!=this.modificationCount)throw"Concurrent modification during iteration.";this.validKey(i)&&this.splay(i)==0&&r.add(this.root.key)}r.size!=this.size&&(this.root=r.root,this.size=r.size,this.modificationCount++)}lookup(t){return!this.validKey(t)||this.splay(t)!=0?null:this.root.key}intersection(t){let r=new Ci(this.compare,this.validKey);for(let n of this)t.has(n)&&r.add(n);return r}difference(t){let r=new Ci(this.compare,this.validKey);for(let n of this)t.has(n)||r.add(n);return r}union(t){let r=this.clone();return r.addAll(t),r}clone(){let t=new Ci(this.compare,this.validKey);return t.size=this.size,t.root=this.copyNode(this.root),t}copyNode(t){if(t==null)return null;function r(i,o){let a,s;do{if(a=i.left,s=i.right,a!=null){let l=new Ei(a.key);o.left=l,r(a,l)}if(s!=null){let l=new Ei(s.key);o.right=l,i=s,o=l}}while(s!=null)}let n=new Ei(t.key);return r(t,n),n}toSet(){return this.clone()}entries(){return new Ov(this.wrap())}keys(){return this[Symbol.iterator]()}values(){return this[Symbol.iterator]()}[(o0=Symbol.iterator,i0=Symbol.toStringTag,o0)](){return new Iv(this.wrap())}},fp=class{constructor(e){D(this,"tree"),D(this,"path",new Array),D(this,"modificationCount",null),D(this,"splayCount"),this.tree=e,this.splayCount=e.getSplayCount()}[Symbol.iterator](){return this}next(){return this.moveNext()?{done:!1,value:this.current()}:{done:!0,value:null}}current(){if(!this.path.length)return null;let e=this.path[this.path.length-1];return this.getValue(e)}rebuildPath(e){this.path.splice(0,this.path.length),this.tree.splay(e),this.path.push(this.tree.getRoot()),this.splayCount=this.tree.getSplayCount()}findLeftMostDescendent(e){for(;e!=null;)this.path.push(e),e=e.left}moveNext(){if(this.modificationCount!=this.tree.getModificationCount()){if(this.modificationCount==null){this.modificationCount=this.tree.getModificationCount();let r=this.tree.getRoot();for(;r!=null;)this.path.push(r),r=r.left;return this.path.length>0}throw"Concurrent modification during iteration."}if(!this.path.length)return!1;this.splayCount!=this.tree.getSplayCount()&&this.rebuildPath(this.path[this.path.length-1].key);let e=this.path[this.path.length-1],t=e.right;if(t!=null){for(;t!=null;)this.path.push(t),t=t.left;return!0}for(this.path.pop();this.path.length&&this.path[this.path.length-1].right===e;)e=this.path.pop();return this.path.length>0}},Iv=class extends fp{getValue(e){return e.key}},Ov=class extends fp{getValue(e){return[e.key,e.key]}},lp=e=>()=>e,Lf=e=>{let t=e?(r,n)=>n.minus(r).abs().isLessThanOrEqualTo(e):lp(!1);return(r,n)=>t(r,n)?0:r.comparedTo(n)};function Bv(e){let t=e?(r,n,i,o,a)=>r.exponentiatedBy(2).isLessThanOrEqualTo(o.minus(n).exponentiatedBy(2).plus(a.minus(i).exponentiatedBy(2)).times(e)):lp(!1);return(r,n,i)=>{let o=r.x,a=r.y,s=i.x,l=i.y,f=a.minus(l).times(n.x.minus(s)).minus(o.minus(s).times(n.y.minus(l)));return t(f,o,a,s,l)?0:f.comparedTo(0)}}var Rv=e=>e,Dv=e=>{if(e){let t=new ha(Lf(e)),r=new ha(Lf(e)),n=(o,a)=>a.addAndReturn(o),i=o=>({x:n(o.x,t),y:n(o.y,r)});return i({x:new dt(0),y:new dt(0)}),i}return Rv},If=e=>({set:t=>{Ft=If(t)},reset:()=>If(e),compare:Lf(e),snap:Dv(e),orient:Bv(e)}),Ft=If(),Si=(e,t)=>e.ll.x.isLessThanOrEqualTo(t.x)&&t.x.isLessThanOrEqualTo(e.ur.x)&&e.ll.y.isLessThanOrEqualTo(t.y)&&t.y.isLessThanOrEqualTo(e.ur.y),Of=(e,t)=>{if(t.ur.x.isLessThan(e.ll.x)||e.ur.x.isLessThan(t.ll.x)||t.ur.y.isLessThan(e.ll.y)||e.ur.y.isLessThan(t.ll.y))return null;let r=e.ll.x.isLessThan(t.ll.x)?t.ll.x:e.ll.x,n=e.ur.x.isLessThan(t.ur.x)?e.ur.x:t.ur.x,i=e.ll.y.isLessThan(t.ll.y)?t.ll.y:e.ll.y,o=e.ur.y.isLessThan(t.ur.y)?e.ur.y:t.ur.y;return{ll:{x:r,y:i},ur:{x:n,y:o}}},sa=(e,t)=>e.x.times(t.y).minus(e.y.times(t.x)),cp=(e,t)=>e.x.times(t.x).plus(e.y.times(t.y)),pa=e=>cp(e,e).sqrt(),Nv=(e,t,r)=>{let n={x:t.x.minus(e.x),y:t.y.minus(e.y)},i={x:r.x.minus(e.x),y:r.y.minus(e.y)};return sa(i,n).div(pa(i)).div(pa(n))},zv=(e,t,r)=>{let n={x:t.x.minus(e.x),y:t.y.minus(e.y)},i={x:r.x.minus(e.x),y:r.y.minus(e.y)};return cp(i,n).div(pa(i)).div(pa(n))},a0=(e,t,r)=>t.y.isZero()?null:{x:e.x.plus(t.x.div(t.y).times(r.minus(e.y))),y:r},s0=(e,t,r)=>t.x.isZero()?null:{x:r,y:e.y.plus(t.y.div(t.x).times(r.minus(e.x)))},Uv=(e,t,r,n)=>{if(t.x.isZero())return s0(r,n,e.x);if(n.x.isZero())return s0(e,t,r.x);if(t.y.isZero())return a0(r,n,e.y);if(n.y.isZero())return a0(e,t,r.y);let i=sa(t,n);if(i.isZero())return null;let o={x:r.x.minus(e.x),y:r.y.minus(e.y)},a=sa(o,t).div(i),s=sa(o,n).div(i),l=e.x.plus(s.times(t.x)),f=r.x.plus(a.times(n.x)),c=e.y.plus(s.times(t.y)),u=r.y.plus(a.times(n.y)),d=l.plus(f).div(2),h=c.plus(u).div(2);return{x:d,y:h}},ut=class up{constructor(t,r){D(this,"point"),D(this,"isLeft"),D(this,"segment"),D(this,"otherSE"),D(this,"consumedBy"),t.events===void 0?t.events=[this]:t.events.push(this),this.point=t,this.isLeft=r}static compare(t,r){let n=up.comparePoints(t.point,r.point);return n!==0?n:(t.point!==r.point&&t.link(r),t.isLeft!==r.isLeft?t.isLeft?1:-1:ga.compare(t.segment,r.segment))}static comparePoints(t,r){return t.x.isLessThan(r.x)?-1:t.x.isGreaterThan(r.x)?1:t.y.isLessThan(r.y)?-1:t.y.isGreaterThan(r.y)?1:0}link(t){if(t.point===this.point)throw new Error("Tried to link already linked events");let r=t.point.events;for(let n=0,i=r.length;n<i;n++){let o=r[n];this.point.events.push(o),o.point=this.point}this.checkForConsuming()}checkForConsuming(){let t=this.point.events.length;for(let r=0;r<t;r++){let n=this.point.events[r];if(n.segment.consumedBy===void 0)for(let i=r+1;i<t;i++){let o=this.point.events[i];o.consumedBy===void 0&&n.otherSE.point.events===o.otherSE.point.events&&n.segment.consume(o.segment)}}}getAvailableLinkedEvents(){let t=[];for(let r=0,n=this.point.events.length;r<n;r++){let i=this.point.events[r];i!==this&&!i.segment.ringOut&&i.segment.isInResult()&&t.push(i)}return t}getLeftmostComparator(t){let r=new Map,n=i=>{let o=i.otherSE;r.set(i,{sine:Nv(this.point,t.point,o.point),cosine:zv(this.point,t.point,o.point)})};return(i,o)=>{r.has(i)||n(i),r.has(o)||n(o);let{sine:a,cosine:s}=r.get(i),{sine:l,cosine:f}=r.get(o);return a.isGreaterThanOrEqualTo(0)&&l.isGreaterThanOrEqualTo(0)?s.isLessThan(f)?1:s.isGreaterThan(f)?-1:0:a.isLessThan(0)&&l.isLessThan(0)?s.isLessThan(f)?-1:s.isGreaterThan(f)?1:0:l.isLessThan(a)?-1:l.isGreaterThan(a)?1:0}}},qv=class Bf{constructor(t){D(this,"events"),D(this,"poly"),D(this,"_isExteriorRing"),D(this,"_enclosingRing"),this.events=t;for(let r=0,n=t.length;r<n;r++)t[r].segment.ringOut=this;this.poly=null}static factory(t){let r=[];for(let n=0,i=t.length;n<i;n++){let o=t[n];if(!o.isInResult()||o.ringOut)continue;let a=null,s=o.leftSE,l=o.rightSE,f=[s],c=s.point,u=[];for(;a=s,s=l,f.push(s),s.point!==c;)for(;;){let d=s.getAvailableLinkedEvents();if(d.length===0){let x=f[0].point,S=f[f.length-1].point;throw new Error(`Unable to complete output ring starting at [${x.x}, ${x.y}]. Last matching segment found ends at [${S.x}, ${S.y}].`)}if(d.length===1){l=d[0].otherSE;break}let h=null;for(let x=0,S=u.length;x<S;x++)if(u[x].point===s.point){h=x;break}if(h!==null){let x=u.splice(h)[0],S=f.splice(x.index);S.unshift(S[0].otherSE),r.push(new Bf(S.reverse()));continue}u.push({index:f.length,point:s.point});let g=s.getLeftmostComparator(a);l=d.sort(g)[0].otherSE;break}r.push(new Bf(f))}return r}getGeom(){let t=this.events[0].point,r=[t];for(let f=1,c=this.events.length-1;f<c;f++){let u=this.events[f].point,d=this.events[f+1].point;Ft.orient(u,t,d)!==0&&(r.push(u),t=u)}if(r.length===1)return null;let n=r[0],i=r[1];Ft.orient(n,t,i)===0&&r.shift(),r.push(r[0]);let o=this.isExteriorRing()?1:-1,a=this.isExteriorRing()?0:r.length-1,s=this.isExteriorRing()?r.length:-1,l=[];for(let f=a;f!=s;f+=o)l.push([r[f].x.toNumber(),r[f].y.toNumber()]);return l}isExteriorRing(){if(this._isExteriorRing===void 0){let t=this.enclosingRing();this._isExteriorRing=t?!t.isExteriorRing():!0}return this._isExteriorRing}enclosingRing(){return this._enclosingRing===void 0&&(this._enclosingRing=this._calcEnclosingRing()),this._enclosingRing}_calcEnclosingRing(){let t=this.events[0];for(let i=1,o=this.events.length;i<o;i++){let a=this.events[i];ut.compare(t,a)>0&&(t=a)}let r=t.segment.prevInResult(),n=r?r.prevInResult():null;for(;;){if(!r)return null;if(!n)return r.ringOut;if(n.ringOut!==r.ringOut)return n.ringOut?.enclosingRing()!==r.ringOut?r.ringOut:r.ringOut?.enclosingRing();r=n.prevInResult(),n=r?r.prevInResult():null}}},f0=class{constructor(e){D(this,"exteriorRing"),D(this,"interiorRings"),this.exteriorRing=e,e.poly=this,this.interiorRings=[]}addInterior(e){this.interiorRings.push(e),e.poly=this}getGeom(){let e=this.exteriorRing.getGeom();if(e===null)return null;let t=[e];for(let r=0,n=this.interiorRings.length;r<n;r++){let i=this.interiorRings[r].getGeom();i!==null&&t.push(i)}return t}},Gv=class{constructor(e){D(this,"rings"),D(this,"polys"),this.rings=e,this.polys=this._composePolys(e)}getGeom(){let e=[];for(let t=0,r=this.polys.length;t<r;t++){let n=this.polys[t].getGeom();n!==null&&e.push(n)}return e}_composePolys(e){let t=[];for(let r=0,n=e.length;r<n;r++){let i=e[r];if(!i.poly)if(i.isExteriorRing())t.push(new f0(i));else{let o=i.enclosingRing();o?.poly||t.push(new f0(o)),o?.poly?.addInterior(i)}}return t}},Vv=class{constructor(e,t=ga.compare){D(this,"queue"),D(this,"tree"),D(this,"segments"),this.queue=e,this.tree=new ha(t),this.segments=[]}process(e){let t=e.segment,r=[];if(e.consumedBy)return e.isLeft?this.queue.delete(e.otherSE):this.tree.delete(t),r;e.isLeft&&this.tree.add(t);let n=t,i=t;do n=this.tree.lastBefore(n);while(n!=null&&n.consumedBy!=null);do i=this.tree.firstAfter(i);while(i!=null&&i.consumedBy!=null);if(e.isLeft){let o=null;if(n){let s=n.getIntersection(t);if(s!==null&&(t.isAnEndpoint(s)||(o=s),!n.isAnEndpoint(s))){let l=this._splitSafely(n,s);for(let f=0,c=l.length;f<c;f++)r.push(l[f])}}let a=null;if(i){let s=i.getIntersection(t);if(s!==null&&(t.isAnEndpoint(s)||(a=s),!i.isAnEndpoint(s))){let l=this._splitSafely(i,s);for(let f=0,c=l.length;f<c;f++)r.push(l[f])}}if(o!==null||a!==null){let s=null;o===null?s=a:a===null?s=o:s=ut.comparePoints(o,a)<=0?o:a,this.queue.delete(t.rightSE),r.push(t.rightSE);let l=t.split(s);for(let f=0,c=l.length;f<c;f++)r.push(l[f])}r.length>0?(this.tree.delete(t),r.push(e)):(this.segments.push(t),t.prev=n)}else{if(n&&i){let o=n.getIntersection(i);if(o!==null){if(!n.isAnEndpoint(o)){let a=this._splitSafely(n,o);for(let s=0,l=a.length;s<l;s++)r.push(a[s])}if(!i.isAnEndpoint(o)){let a=this._splitSafely(i,o);for(let s=0,l=a.length;s<l;s++)r.push(a[s])}}}this.tree.delete(t)}return r}_splitSafely(e,t){this.tree.delete(e);let r=e.rightSE;this.queue.delete(r);let n=e.split(t);return n.push(r),e.consumedBy===void 0&&this.tree.add(e),n}},$v=class{constructor(){D(this,"type"),D(this,"numMultiPolys")}run(e,t,r){Ai.type=e;let n=[new c0(t,!0)];for(let f=0,c=r.length;f<c;f++)n.push(new c0(r[f],!1));if(Ai.numMultiPolys=n.length,Ai.type==="difference"){let f=n[0],c=1;for(;c<n.length;)Of(n[c].bbox,f.bbox)!==null?c++:n.splice(c,1)}if(Ai.type==="intersection")for(let f=0,c=n.length;f<c;f++){let u=n[f];for(let d=f+1,h=n.length;d<h;d++)if(Of(u.bbox,n[d].bbox)===null)return[]}let i=new ha(ut.compare);for(let f=0,c=n.length;f<c;f++){let u=n[f].getSweepEvents();for(let d=0,h=u.length;d<h;d++)i.add(u[d])}let o=new Vv(i),a=null;for(i.size!=0&&(a=i.first(),i.delete(a));a;){let f=o.process(a);for(let c=0,u=f.length;c<u;c++){let d=f[c];d.consumedBy===void 0&&i.add(d)}i.size!=0?(a=i.first(),i.delete(a)):a=null}Ft.reset();let s=qv.factory(o.segments);return new Gv(s).getGeom()}},Ai=new $v,Rf=Ai,Hv=0,ga=class fa{constructor(t,r,n,i){D(this,"id"),D(this,"leftSE"),D(this,"rightSE"),D(this,"rings"),D(this,"windings"),D(this,"ringOut"),D(this,"consumedBy"),D(this,"prev"),D(this,"_prevInResult"),D(this,"_beforeState"),D(this,"_afterState"),D(this,"_isInResult"),this.id=++Hv,this.leftSE=t,t.segment=this,t.otherSE=r,this.rightSE=r,r.segment=this,r.otherSE=t,this.rings=n,this.windings=i}static compare(t,r){let n=t.leftSE.point.x,i=r.leftSE.point.x,o=t.rightSE.point.x,a=r.rightSE.point.x;if(a.isLessThan(n))return 1;if(o.isLessThan(i))return-1;let s=t.leftSE.point.y,l=r.leftSE.point.y,f=t.rightSE.point.y,c=r.rightSE.point.y;if(n.isLessThan(i)){if(l.isLessThan(s)&&l.isLessThan(f))return 1;if(l.isGreaterThan(s)&&l.isGreaterThan(f))return-1;let u=t.comparePoint(r.leftSE.point);if(u<0)return 1;if(u>0)return-1;let d=r.comparePoint(t.rightSE.point);return d!==0?d:-1}if(n.isGreaterThan(i)){if(s.isLessThan(l)&&s.isLessThan(c))return-1;if(s.isGreaterThan(l)&&s.isGreaterThan(c))return 1;let u=r.comparePoint(t.leftSE.point);if(u!==0)return u;let d=t.comparePoint(r.rightSE.point);return d<0?1:d>0?-1:1}if(s.isLessThan(l))return-1;if(s.isGreaterThan(l))return 1;if(o.isLessThan(a)){let u=r.comparePoint(t.rightSE.point);if(u!==0)return u}if(o.isGreaterThan(a)){let u=t.comparePoint(r.rightSE.point);if(u<0)return 1;if(u>0)return-1}if(!o.eq(a)){let u=f.minus(s),d=o.minus(n),h=c.minus(l),g=a.minus(i);if(u.isGreaterThan(d)&&h.isLessThan(g))return 1;if(u.isLessThan(d)&&h.isGreaterThan(g))return-1}return o.isGreaterThan(a)?1:o.isLessThan(a)||f.isLessThan(c)?-1:f.isGreaterThan(c)?1:t.id<r.id?-1:t.id>r.id?1:0}static fromRing(t,r,n){let i,o,a,s=ut.comparePoints(t,r);if(s<0)i=t,o=r,a=1;else if(s>0)i=r,o=t,a=-1;else throw new Error(`Tried to create degenerate segment at [${t.x}, ${t.y}]`);let l=new ut(i,!0),f=new ut(o,!1);return new fa(l,f,[n],[a])}replaceRightSE(t){this.rightSE=t,this.rightSE.segment=this,this.rightSE.otherSE=this.leftSE,this.leftSE.otherSE=this.rightSE}bbox(){let t=this.leftSE.point.y,r=this.rightSE.point.y;return{ll:{x:this.leftSE.point.x,y:t.isLessThan(r)?t:r},ur:{x:this.rightSE.point.x,y:t.isGreaterThan(r)?t:r}}}vector(){return{x:this.rightSE.point.x.minus(this.leftSE.point.x),y:this.rightSE.point.y.minus(this.leftSE.point.y)}}isAnEndpoint(t){return t.x.eq(this.leftSE.point.x)&&t.y.eq(this.leftSE.point.y)||t.x.eq(this.rightSE.point.x)&&t.y.eq(this.rightSE.point.y)}comparePoint(t){return Ft.orient(this.leftSE.point,t,this.rightSE.point)}getIntersection(t){let r=this.bbox(),n=t.bbox(),i=Of(r,n);if(i===null)return null;let o=this.leftSE.point,a=this.rightSE.point,s=t.leftSE.point,l=t.rightSE.point,f=Si(r,s)&&this.comparePoint(s)===0,c=Si(n,o)&&t.comparePoint(o)===0,u=Si(r,l)&&this.comparePoint(l)===0,d=Si(n,a)&&t.comparePoint(a)===0;if(c&&f)return d&&!u?a:!d&&u?l:null;if(c)return u&&o.x.eq(l.x)&&o.y.eq(l.y)?null:o;if(f)return d&&a.x.eq(s.x)&&a.y.eq(s.y)?null:s;if(d&&u)return null;if(d)return a;if(u)return l;let h=Uv(o,this.vector(),s,t.vector());return h===null||!Si(i,h)?null:Ft.snap(h)}split(t){let r=[],n=t.events!==void 0,i=new ut(t,!0),o=new ut(t,!1),a=this.rightSE;this.replaceRightSE(o),r.push(o),r.push(i);let s=new fa(i,a,this.rings.slice(),this.windings.slice());return ut.comparePoints(s.leftSE.point,s.rightSE.point)>0&&s.swapEvents(),ut.comparePoints(this.leftSE.point,this.rightSE.point)>0&&this.swapEvents(),n&&(i.checkForConsuming(),o.checkForConsuming()),r}swapEvents(){let t=this.rightSE;this.rightSE=this.leftSE,this.leftSE=t,this.leftSE.isLeft=!0,this.rightSE.isLeft=!1;for(let r=0,n=this.windings.length;r<n;r++)this.windings[r]*=-1}consume(t){let r=this,n=t;for(;r.consumedBy;)r=r.consumedBy;for(;n.consumedBy;)n=n.consumedBy;let i=fa.compare(r,n);if(i!==0){if(i>0){let o=r;r=n,n=o}if(r.prev===n){let o=r;r=n,n=o}for(let o=0,a=n.rings.length;o<a;o++){let s=n.rings[o],l=n.windings[o],f=r.rings.indexOf(s);f===-1?(r.rings.push(s),r.windings.push(l)):r.windings[f]+=l}n.rings=null,n.windings=null,n.consumedBy=r,n.leftSE.consumedBy=r.leftSE,n.rightSE.consumedBy=r.rightSE}}prevInResult(){return this._prevInResult!==void 0?this._prevInResult:(this.prev?this.prev.isInResult()?this._prevInResult=this.prev:this._prevInResult=this.prev.prevInResult():this._prevInResult=null,this._prevInResult)}beforeState(){if(this._beforeState!==void 0)return this._beforeState;if(!this.prev)this._beforeState={rings:[],windings:[],multiPolys:[]};else{let t=this.prev.consumedBy||this.prev;this._beforeState=t.afterState()}return this._beforeState}afterState(){if(this._afterState!==void 0)return this._afterState;let t=this.beforeState();this._afterState={rings:t.rings.slice(0),windings:t.windings.slice(0),multiPolys:[]};let r=this._afterState.rings,n=this._afterState.windings,i=this._afterState.multiPolys;for(let s=0,l=this.rings.length;s<l;s++){let f=this.rings[s],c=this.windings[s],u=r.indexOf(f);u===-1?(r.push(f),n.push(c)):n[u]+=c}let o=[],a=[];for(let s=0,l=r.length;s<l;s++){if(n[s]===0)continue;let f=r[s],c=f.poly;if(a.indexOf(c)===-1)if(f.isExterior)o.push(c);else{a.indexOf(c)===-1&&a.push(c);let u=o.indexOf(f.poly);u!==-1&&o.splice(u,1)}}for(let s=0,l=o.length;s<l;s++){let f=o[s].multiPoly;i.indexOf(f)===-1&&i.push(f)}return this._afterState}isInResult(){if(this.consumedBy)return!1;if(this._isInResult!==void 0)return this._isInResult;let t=this.beforeState().multiPolys,r=this.afterState().multiPolys;switch(Rf.type){case"union":{let n=t.length===0,i=r.length===0;this._isInResult=n!==i;break}case"intersection":{let n,i;t.length<r.length?(n=t.length,i=r.length):(n=r.length,i=t.length),this._isInResult=i===Rf.numMultiPolys&&n<i;break}case"xor":{let n=Math.abs(t.length-r.length);this._isInResult=n%2===1;break}case"difference":{let n=i=>i.length===1&&i[0].isSubject;this._isInResult=n(t)!==n(r);break}}return this._isInResult}},l0=class{constructor(e,t,r){if(D(this,"poly"),D(this,"isExterior"),D(this,"segments"),D(this,"bbox"),!Array.isArray(e)||e.length===0)throw new Error("Input geometry is not a valid Polygon or MultiPolygon");if(this.poly=t,this.isExterior=r,this.segments=[],typeof e[0][0]!="number"||typeof e[0][1]!="number")throw new Error("Input geometry is not a valid Polygon or MultiPolygon");let n=Ft.snap({x:new dt(e[0][0]),y:new dt(e[0][1])});this.bbox={ll:{x:n.x,y:n.y},ur:{x:n.x,y:n.y}};let i=n;for(let o=1,a=e.length;o<a;o++){if(typeof e[o][0]!="number"||typeof e[o][1]!="number")throw new Error("Input geometry is not a valid Polygon or MultiPolygon");let s=Ft.snap({x:new dt(e[o][0]),y:new dt(e[o][1])});s.x.eq(i.x)&&s.y.eq(i.y)||(this.segments.push(ga.fromRing(i,s,this)),s.x.isLessThan(this.bbox.ll.x)&&(this.bbox.ll.x=s.x),s.y.isLessThan(this.bbox.ll.y)&&(this.bbox.ll.y=s.y),s.x.isGreaterThan(this.bbox.ur.x)&&(this.bbox.ur.x=s.x),s.y.isGreaterThan(this.bbox.ur.y)&&(this.bbox.ur.y=s.y),i=s)}(!n.x.eq(i.x)||!n.y.eq(i.y))&&this.segments.push(ga.fromRing(i,n,this))}getSweepEvents(){let e=[];for(let t=0,r=this.segments.length;t<r;t++){let n=this.segments[t];e.push(n.leftSE),e.push(n.rightSE)}return e}},Zv=class{constructor(e,t){if(D(this,"multiPoly"),D(this,"exteriorRing"),D(this,"interiorRings"),D(this,"bbox"),!Array.isArray(e))throw new Error("Input geometry is not a valid Polygon or MultiPolygon");this.exteriorRing=new l0(e[0],this,!0),this.bbox={ll:{x:this.exteriorRing.bbox.ll.x,y:this.exteriorRing.bbox.ll.y},ur:{x:this.exteriorRing.bbox.ur.x,y:this.exteriorRing.bbox.ur.y}},this.interiorRings=[];for(let r=1,n=e.length;r<n;r++){let i=new l0(e[r],this,!1);i.bbox.ll.x.isLessThan(this.bbox.ll.x)&&(this.bbox.ll.x=i.bbox.ll.x),i.bbox.ll.y.isLessThan(this.bbox.ll.y)&&(this.bbox.ll.y=i.bbox.ll.y),i.bbox.ur.x.isGreaterThan(this.bbox.ur.x)&&(this.bbox.ur.x=i.bbox.ur.x),i.bbox.ur.y.isGreaterThan(this.bbox.ur.y)&&(this.bbox.ur.y=i.bbox.ur.y),this.interiorRings.push(i)}this.multiPoly=t}getSweepEvents(){let e=this.exteriorRing.getSweepEvents();for(let t=0,r=this.interiorRings.length;t<r;t++){let n=this.interiorRings[t].getSweepEvents();for(let i=0,o=n.length;i<o;i++)e.push(n[i])}return e}},c0=class{constructor(e,t){if(D(this,"isSubject"),D(this,"polys"),D(this,"bbox"),!Array.isArray(e))throw new Error("Input geometry is not a valid Polygon or MultiPolygon");try{typeof e[0][0][0]=="number"&&(e=[e])}catch{}this.polys=[],this.bbox={ll:{x:new dt(Number.POSITIVE_INFINITY),y:new dt(Number.POSITIVE_INFINITY)},ur:{x:new dt(Number.NEGATIVE_INFINITY),y:new dt(Number.NEGATIVE_INFINITY)}};for(let r=0,n=e.length;r<n;r++){let i=new Zv(e[r],this);i.bbox.ll.x.isLessThan(this.bbox.ll.x)&&(this.bbox.ll.x=i.bbox.ll.x),i.bbox.ll.y.isLessThan(this.bbox.ll.y)&&(this.bbox.ll.y=i.bbox.ll.y),i.bbox.ur.x.isGreaterThan(this.bbox.ur.x)&&(this.bbox.ur.x=i.bbox.ur.x),i.bbox.ur.y.isGreaterThan(this.bbox.ur.y)&&(this.bbox.ur.y=i.bbox.ur.y),this.polys.push(i)}this.isSubject=t}getSweepEvents(){let e=[];for(let t=0,r=this.polys.length;t<r;t++){let n=this.polys[t].getSweepEvents();for(let i=0,o=n.length;i<o;i++)e.push(n[i])}return e}};var jv=(e,...t)=>Rf.run("intersection",e,t),mC=Ft.set;function Wv(e,t={}){let r=[];if(X0(e,i=>{r.push(i.coordinates)}),r.length<2)throw new Error("Must specify at least 2 geometries");let n=jv(r[0],...r.slice(1));return n.length===0?null:n.length===1?Hf(n[0],t.properties):Z0(n,t.properties)}var dp=Wv,Yv={Point:hp,MultiPoint:Xv,LineString:pp,MultiLineString:Qv,Polygon:gp,MultiPolygon:Jv};function Kv(e,t){let[r,n,i,o]=t,a=Df([r,o]),s=Df([i,n]),l=[a,s];if(e.type==="GeometryCollection")throw new Error("Unsupported geometry type GeometryCollection");let f=Yv[e.type],c=f(e.coordinates,l);return{...e,coordinates:c}}function hp([e,t],[r,n]){let i=u0(r[0],n[0],e),o=u0(r[1],n[1],t);return[i,o]}function Wf(e,t){return e.map(r=>hp(Df(r),t))}function Xv(e,t){return Wf(e,t)}function pp(e,t){return Wf(e,t)}function Qv(e,t){return e.map(r=>pp(r,t))}function gp(e,t){return e.map(r=>Wf(r,t))}function Jv(e,t){return e.map(r=>gp(r,t))}function Df(e){return Mf(e)}function u0(e,t,r){return(r-e)/(t-e)}function e2(e,t,r){var n=e.length,i=on(e[0],t),o=[],a,s,l;let f,c;for(r||(r=[]),a=1;a<n;a++){for(f=e[a-1],c=e[a],s=l=on(c,t);;)if(i|s){if(i&s)break;i?(f=zf(f,c,i,t),i=on(f,t)):(c=zf(f,c,s,t),s=on(c,t))}else{o.push(f),s!==l?(o.push(c),a<n-1&&(r.push(o),o=[])):a===n-1&&o.push(c);break}i=l}return o.length&&r.push(o),r}function t2(e,t){var r,n,i,o,a,s,l;for(n=1;n<=8;n*=2){for(r=[],i=e[e.length-1],o=!(on(i,t)&n),a=0;a<e.length;a++)s=e[a],l=!(on(s,t)&n),l!==o&&r.push(zf(i,s,n,t)),l&&r.push(s),i=s,o=l;if(e=r,!e.length)break}return r}function zf(e,t,r,n){return r&8?[e[0]+(t[0]-e[0])*(n[3]-e[1])/(t[1]-e[1]),n[3]]:r&4?[e[0]+(t[0]-e[0])*(n[1]-e[1])/(t[1]-e[1]),n[1]]:r&2?[n[2],e[1]+(t[1]-e[1])*(n[2]-e[0])/(t[0]-e[0])]:r&1?[n[0],e[1]+(t[1]-e[1])*(n[0]-e[0])/(t[0]-e[0])]:null}function on(e,t){var r=0;return e[0]<t[0]?r|=1:e[0]>t[2]&&(r|=2),e[1]<t[1]?r|=4:e[1]>t[3]&&(r|=8),r}function r2(e,t){let r=Pt(e),n=r.type,i=e.type==="Feature"?e.properties:{},o=r.coordinates;switch(n){case"LineString":case"MultiLineString":{let a=[];return n==="LineString"&&(o=[o]),o.forEach(s=>{e2(s,t,a)}),a.length===1?$0(a[0],i):H0(a,i)}case"Polygon":return Hf(d0(o,t),i);case"MultiPolygon":return Z0(o.map(a=>d0(a,t)),i);default:throw new Error("geometry "+n+" not supported")}}function d0(e,t){let r=[];for(let n of e){let i=t2(n,t);i.length>0&&((i[0][0]!==i[i.length-1][0]||i[0][1]!==i[i.length-1][1])&&i.push(i[0]),i.length>=4&&r.push(i))}return r}var h0=r2;function n2(e,t,r){let n=yv(e);if(!r||ap(n,r))return!0;let i=dp(Li([n,_e(r)]));return i?t==="mvt"?Kv(i.geometry,e):i.geometry:!1}function i2(e,t,r){return mp(e,t,r)}function mp(e,t,r){let n=Gl(e);if(!r||ap(n,r))return!0;let i=dp(Li([_e(n),_e(r)]));if(!i)return!1;let o=ql(i.geometry,t);return new Set(o)}var o2=[-180,-90,0,90],a2=[0,-90,180,90];function s2(e,t){if(!t)return!0;let r=_e(t),n=(0,Nf.polygonToCells)(h0(r,o2).geometry.coordinates,e,!0),i=(0,Nf.polygonToCells)(h0(r,a2).geometry.coordinates,e,!0);return new Set(n.concat(i))}var f2="__geomValue";function l2({tiles:e,tileFormat:t,spatialFilter:r,uniqueIdProperty:n,options:i}){let o=new Map;for(let a of e){if(a.isVisible===!1||!a.data)continue;let s=[a.bbox.west,a.bbox.south,a.bbox.east,a.bbox.north],l=n2(s,t,r);if(l===!1)continue;let f=l===!0?void 0:l;Sf({map:o,spatialFilter:f,data:a.data.points,type:"Point",bbox:s,tileFormat:t,uniqueIdProperty:n,options:i}),Sf({map:o,spatialFilter:f,data:a.data.lines,type:"LineString",bbox:s,tileFormat:t,uniqueIdProperty:n,options:i}),Sf({map:o,spatialFilter:f,data:a.data.polygons,type:"Polygon",bbox:s,tileFormat:t,uniqueIdProperty:n,options:i})}return Array.from(o.values())}function bp({map:e,data:t,startIndex:r,endIndex:n,type:i,bbox:o,tileFormat:a,uniqueIdProperty:s,storeGeometry:l,spatialFilter:f}){let c=d2(t,r),u=p2(c,s,e);if(!u||e.has(u))return;let d=null;if(l||f){let{positions:g}=t,x=m2(r,n,g);d=g2(x,i)}if(d&&f&&!J0(d,f))return;let h=h2(c);l&&d&&(h[f2]=a==="mvt"?hv(d,o):d),e.set(u,h)}function c2({map:e,data:t,spatialFilter:r,type:n,bbox:i,tileFormat:o,uniqueIdProperty:a,options:s}){let l=yp(t,n),f=s?.storeGeometry||!1;for(let c=0;c<l.length-1;c++){let u=l[c],d=l[c+1];bp({map:e,data:t,startIndex:u,endIndex:d,type:n,bbox:i,tileFormat:o,uniqueIdProperty:a,storeGeometry:f,spatialFilter:r})}}function yp(e,t){let r;switch(t){case"Polygon":r=e.primitivePolygonIndices;break;case"LineString":r=e.pathIndices;break;case"Point":r=y2(e);break;default:throw new Error(`Unsupported geometry type: ${t}`)}return r.value}function u2(e,t){return e.featureIds.value[t]}function d2(e,t){let r=u2(e,t),{properties:n,numericProps:i,fields:o}=e,a={uniqueId:o?.[r]?.id,properties:n[r],numericProps:{}};for(let s in i)a.numericProps[s]=i[s].value[t];return a}function h2(e){let{properties:t,numericProps:r}=e;return Object.assign({},t,r)}function p2(e,t,r){if(t)return Ef(e,t);if(e.uniqueId)return e.uniqueId;let n=r.size+1;return Ef(e,"cartodb_id")||Ef(e,"geoid")||n}function Ef(e,t){let{properties:r,numericProps:n}=e;return n[t]||r[t]}function g2(e,t){switch(t){case"Polygon":return{type:"Polygon",coordinates:[e]};case"LineString":return{type:"LineString",coordinates:e};case"Point":return{type:"Point",coordinates:e[0]};default:throw new Error("Invalid geometry type")}}function m2(e,t,r){let n=[];for(let i=e;i<t;i++)n.push(Array.from(r.value.subarray(i*r.size,(i+1)*r.size)));return n}function Sf({map:e,spatialFilter:t,data:r,type:n,bbox:i,tileFormat:o,uniqueIdProperty:a,options:s}){r?.properties.length&&(t?c2({map:e,data:r,spatialFilter:t,type:n,bbox:i,tileFormat:o,uniqueIdProperty:a,options:s}):b2({map:e,data:r,type:n,bbox:i,tileFormat:o,uniqueIdProperty:a,options:s}))}function b2({map:e,data:t,type:r,bbox:n,tileFormat:i,uniqueIdProperty:o,options:a}){let s=yp(t,r),l=a?.storeGeometry||!1;for(let f=0;f<s.length-1;f++){let c=s[f],u=s[f+1];bp({map:e,data:t,startIndex:c,endIndex:u,type:r,bbox:n,tileFormat:i,uniqueIdProperty:o,storeGeometry:l})}}function y2(e){let t=e.featureIds.value,r=t[t.length-1],n=t.constructor,i={value:new n(t.length+1),size:1};return i.value.set(t),i.value.set([r+1],t.length),i}function x2({tiles:e,spatialFilter:t,spatialDataColumn:r,spatialDataType:n}){let i=new Map,o=_2(n),a=w2(e,o),s=r||o;if(!a)return[];let l;o==="h3"&&(l=s2(a,t));for(let f of e)if(!(f.isVisible===!1||!f.data)){if(o==="quadbin"){let c=v2(f,o);l=mp(c,a,t)}l&&f.data.forEach(c=>{(l===!0||l.has(c.id))&&i.set(c.id,{...c.properties,[s]:c.id})})}return Array.from(i.values())}function v2(e,t){return t==="quadbin"?e.index.q:e.id}function w2(e,t){let r=e.find(n=>n.data?.length)?.data;if(r){if(t==="quadbin")return Number(gt(r[0].id));if(t==="h3")return(0,xp.getResolution)(r[0].id)}}function _2(e){switch(e){case"h3":return"h3";case"quadbin":return"quadbin";default:throw new Error("Unexpected spatial data type")}}var E2="3.4",Tr="geom",vp=7e3,fn=.5,S2=1,Yf=4,Kf=6,wp="__aggregationValue",T2=`1 AS ${wp}`;function C2({tiles:e,...t}){let r={};for(let s of t.rasterMetadata.bands)r[s.name]={...s,nodata:Number(s.nodata)};if(e=e.filter(P2),e.length===0)return[];let n=gt(e[0].index.q),i=e[0].data.blockSize,o=n+BigInt(Math.log2(i)),a=new Map;for(let s of e){let l=s.index.q,f=i2(l,o,t.spatialFilter);if(f===!1)continue;let c=F2(l,o);for(let u=0;u<c.length;u++){if(f!==!0&&!f.has(c[u]))continue;let d={},h=!1;for(let g in s.data.cells.numericProps){let x=s.data.cells.numericProps[g].value[u],S=r[g];k2(x,S.nodata)&&(d[g]=s.data.cells.numericProps[g].value[u],h=!0)}h&&a.set(c[u],d)}}return Array.from(a.values())}function A2(e){return!!e.data?.cells}function P2(e){return!!(e.isVisible&&e.data?.cells?.numericProps)}function F2(e,t){let r=Yt(e),n=Number(t),i=2**(n-r.z),o=r.x*i,a=r.y*i,s=[];for(let l=0,f=i**2;l<f;l++){let c=o+l%i,u=a+Math.floor(l/i);s.push(mn({x:c,y:u,z:n}))}return s}function k2(e,t){return Number.isNaN(e)?!1:t!==e}var vC=new Set(Object.values(Vf));function At(e){return Array.isArray(e)?e.map(t=>At(t)):typeof e!="object"?e:Object.entries(e).reduce((t,[r,n])=>(t[r.toLowerCase()]=typeof n=="object"&&n?At(n):n,t),{})}function J(e,t){if(!e)throw new Error(t)}var _p=class Pi extends Error{constructor(t){super(`${Pi.NAME}: ${t}`),this.name=Pi.NAME}static is(t){return t instanceof Pi||t.message?.includes(Pi.NAME)}};D(_p,"NAME","InvalidColumnError");var Uf=_p;function Ep(e){for(let t in e)return!1;return!0}var M2=e=>e!==null&&typeof e=="object",Sp=e=>M2(e)&&e.constructor==={}.constructor;function L2(e,...t){for(let r of t)for(let n in r)r[n]!==void 0&&(e[n]=r[n]);return e}function xa(e,t,r){let n=r.find(i=>i.name===t);return n&&n.type==="geometry"?"geo":e}function I2({tiles:e,spatialFilter:t,uniqueIdProperty:r,tileFormat:n,spatialDataColumn:i=Tr,spatialDataType:o,rasterMetadata:a,storeGeometry:s=!1}){return o==="geo"?l2({tiles:e,tileFormat:n,spatialFilter:t,uniqueIdProperty:r,options:{storeGeometry:s}}):e.some(A2)?(J(a,"Missing raster metadata"),C2({tiles:e,spatialFilter:t,spatialDataColumn:i,spatialDataType:o,rasterMetadata:a})):x2({tiles:e,spatialFilter:t,spatialDataColumn:i,spatialDataType:o})}var Cr=class extends Error{constructor(e,t,r,n){let i="Failed to connect";r&&(i="Server returned: ",r.status===400?i+="Bad request":r.status===401||r.status===403?i+="Unauthorized access":r.status===404?i+="Not found":i+="Error",i+=` (${r.status}):`),i+=` ${e.message||e}`;let o=`${t.requestType} API request failed`;o+=`
|
|
171
171
|
${i}`;for(let a of Object.keys(t))a!=="requestType"&&(o+=`
|
|
172
172
|
${O2(a)}: ${t[a]}`);o+=`
|