UNPKG

@signumjs/core

Version:

Principal package with functions and models for building Signum Network applications.

1 lines 264 kB
"use strict";var sig$=(()=>{var y0=Object.create;var Rn=Object.defineProperty;var A0=Object.getOwnPropertyDescriptor;var w0=Object.getOwnPropertyNames;var x0=Object.getPrototypeOf,v0=Object.prototype.hasOwnProperty;var Re=(e,t)=>()=>(e&&(t=e(e=0)),t);var Z=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),Bo=(e,t)=>{for(var r in t)Rn(e,r,{get:t[r],enumerable:!0})},In=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of w0(t))!v0.call(e,i)&&i!==r&&Rn(e,i,{get:()=>t[i],enumerable:!(n=A0(t,i))||n.enumerable});return e},ne=(e,t,r)=>(In(e,t,"default"),r&&In(r,t,"default")),ze=(e,t,r)=>(r=e!=null?y0(x0(e)):{},In(t||!e||!e.__esModule?Rn(r,"default",{value:e,enumerable:!0}):r,e)),Po=e=>In(Rn({},"__esModule",{value:!0}),e);var Rt=Z(je=>{"use strict";var _0=typeof Uint8Array<"u"&&typeof Uint16Array<"u"&&typeof Int32Array<"u";function b0(e,t){return Object.prototype.hasOwnProperty.call(e,t)}je.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)b0(r,n)&&(e[n]=r[n])}}return e};je.shrinkBuf=function(e,t){return e.length===t?e:e.subarray?e.subarray(0,t):(e.length=t,e)};var S0={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,s;for(n=0,t=0,r=e.length;t<r;t++)n+=e[t].length;for(s=new Uint8Array(n),i=0,t=0,r=e.length;t<r;t++)o=e[t],s.set(o,i),i+=o.length;return s}},T0={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)}};je.setTyped=function(e){e?(je.Buf8=Uint8Array,je.Buf16=Uint16Array,je.Buf32=Int32Array,je.assign(je,S0)):(je.Buf8=Array,je.Buf16=Array,je.Buf32=Array,je.assign(je,T0))};je.setTyped(_0)});var Oo=Z((RA,Su)=>{"use strict";function C0(e,t,r,n){for(var i=e&65535|0,o=e>>>16&65535|0,s=0;r!==0;){s=r>2e3?2e3:r,r-=s;do i=i+t[n++]|0,o=o+i|0;while(--s);i%=65521,o%=65521}return i|o<<16|0}Su.exports=C0});var Io=Z((NA,Tu)=>{"use strict";function E0(){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 F0=E0();function k0(e,t,r,n){var i=F0,o=n+r;e^=-1;for(var s=n;s<o;s++)e=e>>>8^i[(e^t[s])&255];return e^-1}Tu.exports=k0});var Eu=Z((DA,Cu)=>{"use strict";var Nn=30,B0=12;Cu.exports=function(t,r){var n,i,o,s,a,l,c,u,g,k,F,N,L,q,G,_,re,J,z,V,W,f,d,h,A;n=t.state,i=t.next_in,h=t.input,o=i+(t.avail_in-5),s=t.next_out,A=t.output,a=s-(r-t.avail_out),l=s+(t.avail_out-257),c=n.dmax,u=n.wsize,g=n.whave,k=n.wnext,F=n.window,N=n.hold,L=n.bits,q=n.lencode,G=n.distcode,_=(1<<n.lenbits)-1,re=(1<<n.distbits)-1;e:do{L<15&&(N+=h[i++]<<L,L+=8,N+=h[i++]<<L,L+=8),J=q[N&_];t:for(;;){if(z=J>>>24,N>>>=z,L-=z,z=J>>>16&255,z===0)A[s++]=J&65535;else if(z&16){V=J&65535,z&=15,z&&(L<z&&(N+=h[i++]<<L,L+=8),V+=N&(1<<z)-1,N>>>=z,L-=z),L<15&&(N+=h[i++]<<L,L+=8,N+=h[i++]<<L,L+=8),J=G[N&re];r:for(;;){if(z=J>>>24,N>>>=z,L-=z,z=J>>>16&255,z&16){if(W=J&65535,z&=15,L<z&&(N+=h[i++]<<L,L+=8,L<z&&(N+=h[i++]<<L,L+=8)),W+=N&(1<<z)-1,W>c){t.msg="invalid distance too far back",n.mode=Nn;break e}if(N>>>=z,L-=z,z=s-a,W>z){if(z=W-z,z>g&&n.sane){t.msg="invalid distance too far back",n.mode=Nn;break e}if(f=0,d=F,k===0){if(f+=u-z,z<V){V-=z;do A[s++]=F[f++];while(--z);f=s-W,d=A}}else if(k<z){if(f+=u+k-z,z-=k,z<V){V-=z;do A[s++]=F[f++];while(--z);if(f=0,k<V){z=k,V-=z;do A[s++]=F[f++];while(--z);f=s-W,d=A}}}else if(f+=k-z,z<V){V-=z;do A[s++]=F[f++];while(--z);f=s-W,d=A}for(;V>2;)A[s++]=d[f++],A[s++]=d[f++],A[s++]=d[f++],V-=3;V&&(A[s++]=d[f++],V>1&&(A[s++]=d[f++]))}else{f=s-W;do A[s++]=A[f++],A[s++]=A[f++],A[s++]=A[f++],V-=3;while(V>2);V&&(A[s++]=A[f++],V>1&&(A[s++]=A[f++]))}}else if(z&64){t.msg="invalid distance code",n.mode=Nn;break e}else{J=G[(J&65535)+(N&(1<<z)-1)];continue r}break}}else if(z&64)if(z&32){n.mode=B0;break e}else{t.msg="invalid literal/length code",n.mode=Nn;break e}else{J=q[(J&65535)+(N&(1<<z)-1)];continue t}break}}while(i<o&&s<l);V=L>>3,i-=V,L-=V<<3,N&=(1<<L)-1,t.next_in=i,t.next_out=s,t.avail_in=i<o?5+(o-i):5-(i-o),t.avail_out=s<l?257+(l-s):257-(s-l),n.hold=N,n.bits=L}});var Ru=Z((LA,Iu)=>{"use strict";var Fu=Rt(),yr=15,ku=852,Bu=592,Pu=0,Ro=1,Ou=2,P0=[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],O0=[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],I0=[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],R0=[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];Iu.exports=function(t,r,n,i,o,s,a,l){var c=l.bits,u=0,g=0,k=0,F=0,N=0,L=0,q=0,G=0,_=0,re=0,J,z,V,W,f,d=null,h=0,A,x=new Fu.Buf16(yr+1),C=new Fu.Buf16(yr+1),R=null,v=0,S,I,B;for(u=0;u<=yr;u++)x[u]=0;for(g=0;g<i;g++)x[r[n+g]]++;for(N=c,F=yr;F>=1&&x[F]===0;F--);if(N>F&&(N=F),F===0)return o[s++]=1<<24|64<<16|0,o[s++]=1<<24|64<<16|0,l.bits=1,0;for(k=1;k<F&&x[k]===0;k++);for(N<k&&(N=k),G=1,u=1;u<=yr;u++)if(G<<=1,G-=x[u],G<0)return-1;if(G>0&&(t===Pu||F!==1))return-1;for(C[1]=0,u=1;u<yr;u++)C[u+1]=C[u]+x[u];for(g=0;g<i;g++)r[n+g]!==0&&(a[C[r[n+g]]++]=g);if(t===Pu?(d=R=a,A=19):t===Ro?(d=P0,h-=257,R=O0,v-=257,A=256):(d=I0,R=R0,A=-1),re=0,g=0,u=k,f=s,L=N,q=0,V=-1,_=1<<N,W=_-1,t===Ro&&_>ku||t===Ou&&_>Bu)return 1;for(;;){S=u-q,a[g]<A?(I=0,B=a[g]):a[g]>A?(I=R[v+a[g]],B=d[h+a[g]]):(I=96,B=0),J=1<<u-q,z=1<<L,k=z;do z-=J,o[f+(re>>q)+z]=S<<24|I<<16|B|0;while(z!==0);for(J=1<<u-1;re&J;)J>>=1;if(J!==0?(re&=J-1,re+=J):re=0,g++,--x[u]===0){if(u===F)break;u=r[n+a[g]]}if(u>N&&(re&W)!==V){for(q===0&&(q=N),f+=k,L=u-q,G=1<<L;L+q<F&&(G-=x[L+q],!(G<=0));)L++,G<<=1;if(_+=1<<L,t===Ro&&_>ku||t===Ou&&_>Bu)return 1;V=re&W,o[V]=N<<24|L<<16|f-s|0}}return re!==0&&(o[f+re]=u-q<<24|64<<16|0),l.bits=N,0}});var ml=Z(at=>{"use strict";var Qe=Rt(),qo=Oo(),ht=Io(),N0=Eu(),Vr=Ru(),D0=0,sl=1,al=2,Nu=4,L0=5,Dn=6,Vt=0,U0=1,M0=2,et=-2,cl=-3,Ho=-4,q0=-5,Du=8,ul=1,Lu=2,Uu=3,Mu=4,qu=5,Hu=6,zu=7,ju=8,Gu=9,Ku=10,Mn=11,Tt=12,No=13,$u=14,Do=15,Vu=16,Zu=17,Qu=18,Wu=19,Ln=20,Un=21,Xu=22,Yu=23,Ju=24,el=25,tl=26,Lo=27,rl=28,nl=29,Se=30,zo=31,H0=32,z0=852,j0=592,G0=15,K0=G0;function il(e){return(e>>>24&255)+(e>>>8&65280)+((e&65280)<<8)+((e&255)<<24)}function $0(){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 Qe.Buf16(320),this.work=new Qe.Buf16(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}function ll(e){var t;return!e||!e.state?et:(t=e.state,e.total_in=e.total_out=t.total=0,e.msg="",t.wrap&&(e.adler=t.wrap&1),t.mode=ul,t.last=0,t.havedict=0,t.dmax=32768,t.head=null,t.hold=0,t.bits=0,t.lencode=t.lendyn=new Qe.Buf32(z0),t.distcode=t.distdyn=new Qe.Buf32(j0),t.sane=1,t.back=-1,Vt)}function fl(e){var t;return!e||!e.state?et:(t=e.state,t.wsize=0,t.whave=0,t.wnext=0,ll(e))}function dl(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))?et:(n.window!==null&&n.wbits!==t&&(n.window=null),n.wrap=r,n.wbits=t,fl(e))}function pl(e,t){var r,n;return e?(n=new $0,e.state=n,n.window=null,r=dl(e,t),r!==Vt&&(e.state=null),r):et}function V0(e){return pl(e,K0)}var ol=!0,Uo,Mo;function Z0(e){if(ol){var t;for(Uo=new Qe.Buf32(512),Mo=new Qe.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(Vr(sl,e.lens,0,288,Uo,0,e.work,{bits:9}),t=0;t<32;)e.lens[t++]=5;Vr(al,e.lens,0,32,Mo,0,e.work,{bits:5}),ol=!1}e.lencode=Uo,e.lenbits=9,e.distcode=Mo,e.distbits=5}function hl(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 Qe.Buf8(o.wsize)),n>=o.wsize?(Qe.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),Qe.arraySet(o.window,t,r-n,i,o.wnext),n-=i,n?(Qe.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 Q0(e,t){var r,n,i,o,s,a,l,c,u,g,k,F,N,L,q=0,G,_,re,J,z,V,W,f,d=new Qe.Buf8(4),h,A,x=[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 et;r=e.state,r.mode===Tt&&(r.mode=No),s=e.next_out,i=e.output,l=e.avail_out,o=e.next_in,n=e.input,a=e.avail_in,c=r.hold,u=r.bits,g=a,k=l,f=Vt;e:for(;;)switch(r.mode){case ul:if(r.wrap===0){r.mode=No;break}for(;u<16;){if(a===0)break e;a--,c+=n[o++]<<u,u+=8}if(r.wrap&2&&c===35615){r.check=0,d[0]=c&255,d[1]=c>>>8&255,r.check=ht(r.check,d,2,0),c=0,u=0,r.mode=Lu;break}if(r.flags=0,r.head&&(r.head.done=!1),!(r.wrap&1)||(((c&255)<<8)+(c>>8))%31){e.msg="incorrect header check",r.mode=Se;break}if((c&15)!==Du){e.msg="unknown compression method",r.mode=Se;break}if(c>>>=4,u-=4,W=(c&15)+8,r.wbits===0)r.wbits=W;else if(W>r.wbits){e.msg="invalid window size",r.mode=Se;break}r.dmax=1<<W,e.adler=r.check=1,r.mode=c&512?Ku:Tt,c=0,u=0;break;case Lu:for(;u<16;){if(a===0)break e;a--,c+=n[o++]<<u,u+=8}if(r.flags=c,(r.flags&255)!==Du){e.msg="unknown compression method",r.mode=Se;break}if(r.flags&57344){e.msg="unknown header flags set",r.mode=Se;break}r.head&&(r.head.text=c>>8&1),r.flags&512&&(d[0]=c&255,d[1]=c>>>8&255,r.check=ht(r.check,d,2,0)),c=0,u=0,r.mode=Uu;case Uu:for(;u<32;){if(a===0)break e;a--,c+=n[o++]<<u,u+=8}r.head&&(r.head.time=c),r.flags&512&&(d[0]=c&255,d[1]=c>>>8&255,d[2]=c>>>16&255,d[3]=c>>>24&255,r.check=ht(r.check,d,4,0)),c=0,u=0,r.mode=Mu;case Mu:for(;u<16;){if(a===0)break e;a--,c+=n[o++]<<u,u+=8}r.head&&(r.head.xflags=c&255,r.head.os=c>>8),r.flags&512&&(d[0]=c&255,d[1]=c>>>8&255,r.check=ht(r.check,d,2,0)),c=0,u=0,r.mode=qu;case qu:if(r.flags&1024){for(;u<16;){if(a===0)break e;a--,c+=n[o++]<<u,u+=8}r.length=c,r.head&&(r.head.extra_len=c),r.flags&512&&(d[0]=c&255,d[1]=c>>>8&255,r.check=ht(r.check,d,2,0)),c=0,u=0}else r.head&&(r.head.extra=null);r.mode=Hu;case Hu:if(r.flags&1024&&(F=r.length,F>a&&(F=a),F&&(r.head&&(W=r.head.extra_len-r.length,r.head.extra||(r.head.extra=new Array(r.head.extra_len)),Qe.arraySet(r.head.extra,n,o,F,W)),r.flags&512&&(r.check=ht(r.check,n,F,o)),a-=F,o+=F,r.length-=F),r.length))break e;r.length=0,r.mode=zu;case zu:if(r.flags&2048){if(a===0)break e;F=0;do W=n[o+F++],r.head&&W&&r.length<65536&&(r.head.name+=String.fromCharCode(W));while(W&&F<a);if(r.flags&512&&(r.check=ht(r.check,n,F,o)),a-=F,o+=F,W)break e}else r.head&&(r.head.name=null);r.length=0,r.mode=ju;case ju:if(r.flags&4096){if(a===0)break e;F=0;do W=n[o+F++],r.head&&W&&r.length<65536&&(r.head.comment+=String.fromCharCode(W));while(W&&F<a);if(r.flags&512&&(r.check=ht(r.check,n,F,o)),a-=F,o+=F,W)break e}else r.head&&(r.head.comment=null);r.mode=Gu;case Gu:if(r.flags&512){for(;u<16;){if(a===0)break e;a--,c+=n[o++]<<u,u+=8}if(c!==(r.check&65535)){e.msg="header crc mismatch",r.mode=Se;break}c=0,u=0}r.head&&(r.head.hcrc=r.flags>>9&1,r.head.done=!0),e.adler=r.check=0,r.mode=Tt;break;case Ku:for(;u<32;){if(a===0)break e;a--,c+=n[o++]<<u,u+=8}e.adler=r.check=il(c),c=0,u=0,r.mode=Mn;case Mn:if(r.havedict===0)return e.next_out=s,e.avail_out=l,e.next_in=o,e.avail_in=a,r.hold=c,r.bits=u,M0;e.adler=r.check=1,r.mode=Tt;case Tt:if(t===L0||t===Dn)break e;case No:if(r.last){c>>>=u&7,u-=u&7,r.mode=Lo;break}for(;u<3;){if(a===0)break e;a--,c+=n[o++]<<u,u+=8}switch(r.last=c&1,c>>>=1,u-=1,c&3){case 0:r.mode=$u;break;case 1:if(Z0(r),r.mode=Ln,t===Dn){c>>>=2,u-=2;break e}break;case 2:r.mode=Zu;break;case 3:e.msg="invalid block type",r.mode=Se}c>>>=2,u-=2;break;case $u:for(c>>>=u&7,u-=u&7;u<32;){if(a===0)break e;a--,c+=n[o++]<<u,u+=8}if((c&65535)!==(c>>>16^65535)){e.msg="invalid stored block lengths",r.mode=Se;break}if(r.length=c&65535,c=0,u=0,r.mode=Do,t===Dn)break e;case Do:r.mode=Vu;case Vu:if(F=r.length,F){if(F>a&&(F=a),F>l&&(F=l),F===0)break e;Qe.arraySet(i,n,o,F,s),a-=F,o+=F,l-=F,s+=F,r.length-=F;break}r.mode=Tt;break;case Zu:for(;u<14;){if(a===0)break e;a--,c+=n[o++]<<u,u+=8}if(r.nlen=(c&31)+257,c>>>=5,u-=5,r.ndist=(c&31)+1,c>>>=5,u-=5,r.ncode=(c&15)+4,c>>>=4,u-=4,r.nlen>286||r.ndist>30){e.msg="too many length or distance symbols",r.mode=Se;break}r.have=0,r.mode=Qu;case Qu:for(;r.have<r.ncode;){for(;u<3;){if(a===0)break e;a--,c+=n[o++]<<u,u+=8}r.lens[x[r.have++]]=c&7,c>>>=3,u-=3}for(;r.have<19;)r.lens[x[r.have++]]=0;if(r.lencode=r.lendyn,r.lenbits=7,h={bits:r.lenbits},f=Vr(D0,r.lens,0,19,r.lencode,0,r.work,h),r.lenbits=h.bits,f){e.msg="invalid code lengths set",r.mode=Se;break}r.have=0,r.mode=Wu;case Wu:for(;r.have<r.nlen+r.ndist;){for(;q=r.lencode[c&(1<<r.lenbits)-1],G=q>>>24,_=q>>>16&255,re=q&65535,!(G<=u);){if(a===0)break e;a--,c+=n[o++]<<u,u+=8}if(re<16)c>>>=G,u-=G,r.lens[r.have++]=re;else{if(re===16){for(A=G+2;u<A;){if(a===0)break e;a--,c+=n[o++]<<u,u+=8}if(c>>>=G,u-=G,r.have===0){e.msg="invalid bit length repeat",r.mode=Se;break}W=r.lens[r.have-1],F=3+(c&3),c>>>=2,u-=2}else if(re===17){for(A=G+3;u<A;){if(a===0)break e;a--,c+=n[o++]<<u,u+=8}c>>>=G,u-=G,W=0,F=3+(c&7),c>>>=3,u-=3}else{for(A=G+7;u<A;){if(a===0)break e;a--,c+=n[o++]<<u,u+=8}c>>>=G,u-=G,W=0,F=11+(c&127),c>>>=7,u-=7}if(r.have+F>r.nlen+r.ndist){e.msg="invalid bit length repeat",r.mode=Se;break}for(;F--;)r.lens[r.have++]=W}}if(r.mode===Se)break;if(r.lens[256]===0){e.msg="invalid code -- missing end-of-block",r.mode=Se;break}if(r.lenbits=9,h={bits:r.lenbits},f=Vr(sl,r.lens,0,r.nlen,r.lencode,0,r.work,h),r.lenbits=h.bits,f){e.msg="invalid literal/lengths set",r.mode=Se;break}if(r.distbits=6,r.distcode=r.distdyn,h={bits:r.distbits},f=Vr(al,r.lens,r.nlen,r.ndist,r.distcode,0,r.work,h),r.distbits=h.bits,f){e.msg="invalid distances set",r.mode=Se;break}if(r.mode=Ln,t===Dn)break e;case Ln:r.mode=Un;case Un:if(a>=6&&l>=258){e.next_out=s,e.avail_out=l,e.next_in=o,e.avail_in=a,r.hold=c,r.bits=u,N0(e,k),s=e.next_out,i=e.output,l=e.avail_out,o=e.next_in,n=e.input,a=e.avail_in,c=r.hold,u=r.bits,r.mode===Tt&&(r.back=-1);break}for(r.back=0;q=r.lencode[c&(1<<r.lenbits)-1],G=q>>>24,_=q>>>16&255,re=q&65535,!(G<=u);){if(a===0)break e;a--,c+=n[o++]<<u,u+=8}if(_&&!(_&240)){for(J=G,z=_,V=re;q=r.lencode[V+((c&(1<<J+z)-1)>>J)],G=q>>>24,_=q>>>16&255,re=q&65535,!(J+G<=u);){if(a===0)break e;a--,c+=n[o++]<<u,u+=8}c>>>=J,u-=J,r.back+=J}if(c>>>=G,u-=G,r.back+=G,r.length=re,_===0){r.mode=tl;break}if(_&32){r.back=-1,r.mode=Tt;break}if(_&64){e.msg="invalid literal/length code",r.mode=Se;break}r.extra=_&15,r.mode=Xu;case Xu:if(r.extra){for(A=r.extra;u<A;){if(a===0)break e;a--,c+=n[o++]<<u,u+=8}r.length+=c&(1<<r.extra)-1,c>>>=r.extra,u-=r.extra,r.back+=r.extra}r.was=r.length,r.mode=Yu;case Yu:for(;q=r.distcode[c&(1<<r.distbits)-1],G=q>>>24,_=q>>>16&255,re=q&65535,!(G<=u);){if(a===0)break e;a--,c+=n[o++]<<u,u+=8}if(!(_&240)){for(J=G,z=_,V=re;q=r.distcode[V+((c&(1<<J+z)-1)>>J)],G=q>>>24,_=q>>>16&255,re=q&65535,!(J+G<=u);){if(a===0)break e;a--,c+=n[o++]<<u,u+=8}c>>>=J,u-=J,r.back+=J}if(c>>>=G,u-=G,r.back+=G,_&64){e.msg="invalid distance code",r.mode=Se;break}r.offset=re,r.extra=_&15,r.mode=Ju;case Ju:if(r.extra){for(A=r.extra;u<A;){if(a===0)break e;a--,c+=n[o++]<<u,u+=8}r.offset+=c&(1<<r.extra)-1,c>>>=r.extra,u-=r.extra,r.back+=r.extra}if(r.offset>r.dmax){e.msg="invalid distance too far back",r.mode=Se;break}r.mode=el;case el:if(l===0)break e;if(F=k-l,r.offset>F){if(F=r.offset-F,F>r.whave&&r.sane){e.msg="invalid distance too far back",r.mode=Se;break}F>r.wnext?(F-=r.wnext,N=r.wsize-F):N=r.wnext-F,F>r.length&&(F=r.length),L=r.window}else L=i,N=s-r.offset,F=r.length;F>l&&(F=l),l-=F,r.length-=F;do i[s++]=L[N++];while(--F);r.length===0&&(r.mode=Un);break;case tl:if(l===0)break e;i[s++]=r.length,l--,r.mode=Un;break;case Lo:if(r.wrap){for(;u<32;){if(a===0)break e;a--,c|=n[o++]<<u,u+=8}if(k-=l,e.total_out+=k,r.total+=k,k&&(e.adler=r.check=r.flags?ht(r.check,i,k,s-k):qo(r.check,i,k,s-k)),k=l,(r.flags?c:il(c))!==r.check){e.msg="incorrect data check",r.mode=Se;break}c=0,u=0}r.mode=rl;case rl:if(r.wrap&&r.flags){for(;u<32;){if(a===0)break e;a--,c+=n[o++]<<u,u+=8}if(c!==(r.total&4294967295)){e.msg="incorrect length check",r.mode=Se;break}c=0,u=0}r.mode=nl;case nl:f=U0;break e;case Se:f=cl;break e;case zo:return Ho;case H0:default:return et}return e.next_out=s,e.avail_out=l,e.next_in=o,e.avail_in=a,r.hold=c,r.bits=u,(r.wsize||k!==e.avail_out&&r.mode<Se&&(r.mode<Lo||t!==Nu))&&hl(e,e.output,e.next_out,k-e.avail_out)?(r.mode=zo,Ho):(g-=e.avail_in,k-=e.avail_out,e.total_in+=g,e.total_out+=k,r.total+=k,r.wrap&&k&&(e.adler=r.check=r.flags?ht(r.check,i,k,e.next_out-k):qo(r.check,i,k,e.next_out-k)),e.data_type=r.bits+(r.last?64:0)+(r.mode===Tt?128:0)+(r.mode===Ln||r.mode===Do?256:0),(g===0&&k===0||t===Nu)&&f===Vt&&(f=q0),f)}function W0(e){if(!e||!e.state)return et;var t=e.state;return t.window&&(t.window=null),e.state=null,Vt}function X0(e,t){var r;return!e||!e.state||(r=e.state,!(r.wrap&2))?et:(r.head=t,t.done=!1,Vt)}function Y0(e,t){var r=t.length,n,i,o;return!e||!e.state||(n=e.state,n.wrap!==0&&n.mode!==Mn)?et:n.mode===Mn&&(i=1,i=qo(i,t,r,0),i!==n.check)?cl:(o=hl(e,t,r,r),o?(n.mode=zo,Ho):(n.havedict=1,Vt))}at.inflateReset=fl;at.inflateReset2=dl;at.inflateResetKeep=ll;at.inflateInit=V0;at.inflateInit2=pl;at.inflate=Q0;at.inflateEnd=W0;at.inflateGetHeader=X0;at.inflateSetDictionary=Y0;at.inflateInfo="pako inflate (from Nodeca project)"});var jo=Z(Ar=>{"use strict";var qn=Rt(),gl=!0,yl=!0;try{String.fromCharCode.apply(null,[0])}catch{gl=!1}try{String.fromCharCode.apply(null,new Uint8Array(1))}catch{yl=!1}var Zr=new qn.Buf8(256);for(Ct=0;Ct<256;Ct++)Zr[Ct]=Ct>=252?6:Ct>=248?5:Ct>=240?4:Ct>=224?3:Ct>=192?2:1;var Ct;Zr[254]=Zr[254]=1;Ar.string2buf=function(e){var t,r,n,i,o,s=e.length,a=0;for(i=0;i<s;i++)r=e.charCodeAt(i),(r&64512)===55296&&i+1<s&&(n=e.charCodeAt(i+1),(n&64512)===56320&&(r=65536+(r-55296<<10)+(n-56320),i++)),a+=r<128?1:r<2048?2:r<65536?3:4;for(t=new qn.Buf8(a),o=0,i=0;o<a;i++)r=e.charCodeAt(i),(r&64512)===55296&&i+1<s&&(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 Al(e,t){if(t<65534&&(e.subarray&&yl||!e.subarray&&gl))return String.fromCharCode.apply(null,qn.shrinkBuf(e,t));for(var r="",n=0;n<t;n++)r+=String.fromCharCode(e[n]);return r}Ar.buf2binstring=function(e){return Al(e,e.length)};Ar.binstring2buf=function(e){for(var t=new qn.Buf8(e.length),r=0,n=t.length;r<n;r++)t[r]=e.charCodeAt(r);return t};Ar.buf2string=function(e,t){var r,n,i,o,s=t||e.length,a=new Array(s*2);for(n=0,r=0;r<s;){if(i=e[r++],i<128){a[n++]=i;continue}if(o=Zr[i],o>4){a[n++]=65533,r+=o-1;continue}for(i&=o===2?31:o===3?15:7;o>1&&r<s;)i=i<<6|e[r++]&63,o--;if(o>1){a[n++]=65533;continue}i<65536?a[n++]=i:(i-=65536,a[n++]=55296|i>>10&1023,a[n++]=56320|i&1023)}return Al(a,n)};Ar.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+Zr[e[r]]>t?r:t}});var xl=Z((qA,wl)=>{"use strict";wl.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 Hn=Z((HA,vl)=>{"use strict";vl.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 Go=Z((zA,_l)=>{"use strict";function J0(){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}_l.exports=J0});var Sl=Z((jA,bl)=>{"use strict";function eh(){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}bl.exports=eh});var Cl=Z(Wr=>{"use strict";var wr=ml(),Qr=Rt(),zn=jo(),Fe=xl(),Ko=Hn(),th=Go(),rh=Sl(),Tl=Object.prototype.toString;function Zt(e){if(!(this instanceof Zt))return new Zt(e);this.options=Qr.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 th,this.strm.avail_out=0;var r=wr.inflateInit2(this.strm,t.windowBits);if(r!==Fe.Z_OK)throw new Error(Ko[r]);if(this.header=new rh,wr.inflateGetHeader(this.strm,this.header),t.dictionary&&(typeof t.dictionary=="string"?t.dictionary=zn.string2buf(t.dictionary):Tl.call(t.dictionary)==="[object ArrayBuffer]"&&(t.dictionary=new Uint8Array(t.dictionary)),t.raw&&(r=wr.inflateSetDictionary(this.strm,t.dictionary),r!==Fe.Z_OK)))throw new Error(Ko[r])}Zt.prototype.push=function(e,t){var r=this.strm,n=this.options.chunkSize,i=this.options.dictionary,o,s,a,l,c,u=!1;if(this.ended)return!1;s=t===~~t?t:t===!0?Fe.Z_FINISH:Fe.Z_NO_FLUSH,typeof e=="string"?r.input=zn.binstring2buf(e):Tl.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 Qr.Buf8(n),r.next_out=0,r.avail_out=n),o=wr.inflate(r,Fe.Z_NO_FLUSH),o===Fe.Z_NEED_DICT&&i&&(o=wr.inflateSetDictionary(this.strm,i)),o===Fe.Z_BUF_ERROR&&u===!0&&(o=Fe.Z_OK,u=!1),o!==Fe.Z_STREAM_END&&o!==Fe.Z_OK)return this.onEnd(o),this.ended=!0,!1;r.next_out&&(r.avail_out===0||o===Fe.Z_STREAM_END||r.avail_in===0&&(s===Fe.Z_FINISH||s===Fe.Z_SYNC_FLUSH))&&(this.options.to==="string"?(a=zn.utf8border(r.output,r.next_out),l=r.next_out-a,c=zn.buf2string(r.output,a),r.next_out=l,r.avail_out=n-l,l&&Qr.arraySet(r.output,r.output,a,l,0),this.onData(c)):this.onData(Qr.shrinkBuf(r.output,r.next_out))),r.avail_in===0&&r.avail_out===0&&(u=!0)}while((r.avail_in>0||r.avail_out===0)&&o!==Fe.Z_STREAM_END);return o===Fe.Z_STREAM_END&&(s=Fe.Z_FINISH),s===Fe.Z_FINISH?(o=wr.inflateEnd(this.strm),this.onEnd(o),this.ended=!0,o===Fe.Z_OK):(s===Fe.Z_SYNC_FLUSH&&(this.onEnd(Fe.Z_OK),r.avail_out=0),!0)};Zt.prototype.onData=function(e){this.chunks.push(e)};Zt.prototype.onEnd=function(e){e===Fe.Z_OK&&(this.options.to==="string"?this.result=this.chunks.join(""):this.result=Qr.flattenChunks(this.chunks)),this.chunks=[],this.err=e,this.msg=this.strm.msg};function $o(e,t){var r=new Zt(t);if(r.push(e,!0),r.err)throw r.msg||Ko[r.err];return r.result}function nh(e,t){return t=t||{},t.raw=!0,$o(e,t)}Wr.Inflate=Zt;Wr.inflate=$o;Wr.inflateRaw=nh;Wr.ungzip=$o});var kl=Z(jn=>{"use strict";jn.byteLength=oh;jn.toByteArray=ah;jn.fromByteArray=lh;var mt=[],tt=[],ih=typeof Uint8Array<"u"?Uint8Array:Array,Vo="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";for(Qt=0,El=Vo.length;Qt<El;++Qt)mt[Qt]=Vo[Qt],tt[Vo.charCodeAt(Qt)]=Qt;var Qt,El;tt[45]=62;tt[95]=63;function Fl(e){var t=e.length;if(t%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var r=e.indexOf("=");r===-1&&(r=t);var n=r===t?0:4-r%4;return[r,n]}function oh(e){var t=Fl(e),r=t[0],n=t[1];return(r+n)*3/4-n}function sh(e,t,r){return(t+r)*3/4-r}function ah(e){var t,r=Fl(e),n=r[0],i=r[1],o=new ih(sh(e,n,i)),s=0,a=i>0?n-4:n,l;for(l=0;l<a;l+=4)t=tt[e.charCodeAt(l)]<<18|tt[e.charCodeAt(l+1)]<<12|tt[e.charCodeAt(l+2)]<<6|tt[e.charCodeAt(l+3)],o[s++]=t>>16&255,o[s++]=t>>8&255,o[s++]=t&255;return i===2&&(t=tt[e.charCodeAt(l)]<<2|tt[e.charCodeAt(l+1)]>>4,o[s++]=t&255),i===1&&(t=tt[e.charCodeAt(l)]<<10|tt[e.charCodeAt(l+1)]<<4|tt[e.charCodeAt(l+2)]>>2,o[s++]=t>>8&255,o[s++]=t&255),o}function ch(e){return mt[e>>18&63]+mt[e>>12&63]+mt[e>>6&63]+mt[e&63]}function uh(e,t,r){for(var n,i=[],o=t;o<r;o+=3)n=(e[o]<<16&16711680)+(e[o+1]<<8&65280)+(e[o+2]&255),i.push(ch(n));return i.join("")}function lh(e){for(var t,r=e.length,n=r%3,i=[],o=16383,s=0,a=r-n;s<a;s+=o)i.push(uh(e,s,s+o>a?a:s+o));return n===1?(t=e[r-1],i.push(mt[t>>2]+mt[t<<4&63]+"==")):n===2&&(t=(e[r-2]<<8)+e[r-1],i.push(mt[t>>10]+mt[t>>4&63]+mt[t<<2&63]+"=")),i.join("")}});var Bl=Z(Zo=>{Zo.read=function(e,t,r,n,i){var o,s,a=i*8-n-1,l=(1<<a)-1,c=l>>1,u=-7,g=r?i-1:0,k=r?-1:1,F=e[t+g];for(g+=k,o=F&(1<<-u)-1,F>>=-u,u+=a;u>0;o=o*256+e[t+g],g+=k,u-=8);for(s=o&(1<<-u)-1,o>>=-u,u+=n;u>0;s=s*256+e[t+g],g+=k,u-=8);if(o===0)o=1-c;else{if(o===l)return s?NaN:(F?-1:1)*(1/0);s=s+Math.pow(2,n),o=o-c}return(F?-1:1)*s*Math.pow(2,o-n)};Zo.write=function(e,t,r,n,i,o){var s,a,l,c=o*8-i-1,u=(1<<c)-1,g=u>>1,k=i===23?Math.pow(2,-24)-Math.pow(2,-77):0,F=n?0:o-1,N=n?1:-1,L=t<0||t===0&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(a=isNaN(t)?1:0,s=u):(s=Math.floor(Math.log(t)/Math.LN2),t*(l=Math.pow(2,-s))<1&&(s--,l*=2),s+g>=1?t+=k/l:t+=k*Math.pow(2,1-g),t*l>=2&&(s++,l/=2),s+g>=u?(a=0,s=u):s+g>=1?(a=(t*l-1)*Math.pow(2,i),s=s+g):(a=t*Math.pow(2,g-1)*Math.pow(2,i),s=0));i>=8;e[r+F]=a&255,F+=N,a/=256,i-=8);for(s=s<<i|a,c+=i;c>0;e[r+F]=s&255,F+=N,s/=256,c-=8);e[r+F-N]|=L*128}});var Vl=Z(br=>{"use strict";var Qo=kl(),vr=Bl(),Pl=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;br.Buffer=j;br.SlowBuffer=gh;br.INSPECT_MAX_BYTES=50;var Gn=2147483647;br.kMaxLength=Gn;j.TYPED_ARRAY_SUPPORT=fh();!j.TYPED_ARRAY_SUPPORT&&typeof console<"u"&&typeof console.error=="function"&&console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support.");function fh(){try{let e=new Uint8Array(1),t={foo:function(){return 42}};return Object.setPrototypeOf(t,Uint8Array.prototype),Object.setPrototypeOf(e,t),e.foo()===42}catch{return!1}}Object.defineProperty(j.prototype,"parent",{enumerable:!0,get:function(){if(j.isBuffer(this))return this.buffer}});Object.defineProperty(j.prototype,"offset",{enumerable:!0,get:function(){if(j.isBuffer(this))return this.byteOffset}});function Et(e){if(e>Gn)throw new RangeError('The value "'+e+'" is invalid for option "size"');let t=new Uint8Array(e);return Object.setPrototypeOf(t,j.prototype),t}function j(e,t,r){if(typeof e=="number"){if(typeof t=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return Jo(e)}return Nl(e,t,r)}j.poolSize=8192;function Nl(e,t,r){if(typeof e=="string")return ph(e,t);if(ArrayBuffer.isView(e))return hh(e);if(e==null)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e);if(gt(e,ArrayBuffer)||e&&gt(e.buffer,ArrayBuffer)||typeof SharedArrayBuffer<"u"&&(gt(e,SharedArrayBuffer)||e&&gt(e.buffer,SharedArrayBuffer)))return Xo(e,t,r);if(typeof e=="number")throw new TypeError('The "value" argument must not be of type number. Received type number');let n=e.valueOf&&e.valueOf();if(n!=null&&n!==e)return j.from(n,t,r);let i=mh(e);if(i)return i;if(typeof Symbol<"u"&&Symbol.toPrimitive!=null&&typeof e[Symbol.toPrimitive]=="function")return j.from(e[Symbol.toPrimitive]("string"),t,r);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e)}j.from=function(e,t,r){return Nl(e,t,r)};Object.setPrototypeOf(j.prototype,Uint8Array.prototype);Object.setPrototypeOf(j,Uint8Array);function Dl(e){if(typeof e!="number")throw new TypeError('"size" argument must be of type number');if(e<0)throw new RangeError('The value "'+e+'" is invalid for option "size"')}function dh(e,t,r){return Dl(e),e<=0?Et(e):t!==void 0?typeof r=="string"?Et(e).fill(t,r):Et(e).fill(t):Et(e)}j.alloc=function(e,t,r){return dh(e,t,r)};function Jo(e){return Dl(e),Et(e<0?0:es(e)|0)}j.allocUnsafe=function(e){return Jo(e)};j.allocUnsafeSlow=function(e){return Jo(e)};function ph(e,t){if((typeof t!="string"||t==="")&&(t="utf8"),!j.isEncoding(t))throw new TypeError("Unknown encoding: "+t);let r=Ll(e,t)|0,n=Et(r),i=n.write(e,t);return i!==r&&(n=n.slice(0,i)),n}function Wo(e){let t=e.length<0?0:es(e.length)|0,r=Et(t);for(let n=0;n<t;n+=1)r[n]=e[n]&255;return r}function hh(e){if(gt(e,Uint8Array)){let t=new Uint8Array(e);return Xo(t.buffer,t.byteOffset,t.byteLength)}return Wo(e)}function Xo(e,t,r){if(t<0||e.byteLength<t)throw new RangeError('"offset" is outside of buffer bounds');if(e.byteLength<t+(r||0))throw new RangeError('"length" is outside of buffer bounds');let n;return t===void 0&&r===void 0?n=new Uint8Array(e):r===void 0?n=new Uint8Array(e,t):n=new Uint8Array(e,t,r),Object.setPrototypeOf(n,j.prototype),n}function mh(e){if(j.isBuffer(e)){let t=es(e.length)|0,r=Et(t);return r.length===0||e.copy(r,0,0,t),r}if(e.length!==void 0)return typeof e.length!="number"||rs(e.length)?Et(0):Wo(e);if(e.type==="Buffer"&&Array.isArray(e.data))return Wo(e.data)}function es(e){if(e>=Gn)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+Gn.toString(16)+" bytes");return e|0}function gh(e){return+e!=e&&(e=0),j.alloc(+e)}j.isBuffer=function(t){return t!=null&&t._isBuffer===!0&&t!==j.prototype};j.compare=function(t,r){if(gt(t,Uint8Array)&&(t=j.from(t,t.offset,t.byteLength)),gt(r,Uint8Array)&&(r=j.from(r,r.offset,r.byteLength)),!j.isBuffer(t)||!j.isBuffer(r))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(t===r)return 0;let n=t.length,i=r.length;for(let o=0,s=Math.min(n,i);o<s;++o)if(t[o]!==r[o]){n=t[o],i=r[o];break}return n<i?-1:i<n?1:0};j.isEncoding=function(t){switch(String(t).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}};j.concat=function(t,r){if(!Array.isArray(t))throw new TypeError('"list" argument must be an Array of Buffers');if(t.length===0)return j.alloc(0);let n;if(r===void 0)for(r=0,n=0;n<t.length;++n)r+=t[n].length;let i=j.allocUnsafe(r),o=0;for(n=0;n<t.length;++n){let s=t[n];if(gt(s,Uint8Array))o+s.length>i.length?(j.isBuffer(s)||(s=j.from(s)),s.copy(i,o)):Uint8Array.prototype.set.call(i,s,o);else if(j.isBuffer(s))s.copy(i,o);else throw new TypeError('"list" argument must be an Array of Buffers');o+=s.length}return i};function Ll(e,t){if(j.isBuffer(e))return e.length;if(ArrayBuffer.isView(e)||gt(e,ArrayBuffer))return e.byteLength;if(typeof e!="string")throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof e);let r=e.length,n=arguments.length>2&&arguments[2]===!0;if(!n&&r===0)return 0;let i=!1;for(;;)switch(t){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":return Yo(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return r*2;case"hex":return r>>>1;case"base64":return $l(e).length;default:if(i)return n?-1:Yo(e).length;t=(""+t).toLowerCase(),i=!0}}j.byteLength=Ll;function yh(e,t,r){let n=!1;if((t===void 0||t<0)&&(t=0),t>this.length||((r===void 0||r>this.length)&&(r=this.length),r<=0)||(r>>>=0,t>>>=0,r<=t))return"";for(e||(e="utf8");;)switch(e){case"hex":return Eh(this,t,r);case"utf8":case"utf-8":return Ml(this,t,r);case"ascii":return Th(this,t,r);case"latin1":case"binary":return Ch(this,t,r);case"base64":return bh(this,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return Fh(this,t,r);default:if(n)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),n=!0}}j.prototype._isBuffer=!0;function Wt(e,t,r){let n=e[t];e[t]=e[r],e[r]=n}j.prototype.swap16=function(){let t=this.length;if(t%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let r=0;r<t;r+=2)Wt(this,r,r+1);return this};j.prototype.swap32=function(){let t=this.length;if(t%4!==0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(let r=0;r<t;r+=4)Wt(this,r,r+3),Wt(this,r+1,r+2);return this};j.prototype.swap64=function(){let t=this.length;if(t%8!==0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(let r=0;r<t;r+=8)Wt(this,r,r+7),Wt(this,r+1,r+6),Wt(this,r+2,r+5),Wt(this,r+3,r+4);return this};j.prototype.toString=function(){let t=this.length;return t===0?"":arguments.length===0?Ml(this,0,t):yh.apply(this,arguments)};j.prototype.toLocaleString=j.prototype.toString;j.prototype.equals=function(t){if(!j.isBuffer(t))throw new TypeError("Argument must be a Buffer");return this===t?!0:j.compare(this,t)===0};j.prototype.inspect=function(){let t="",r=br.INSPECT_MAX_BYTES;return t=this.toString("hex",0,r).replace(/(.{2})/g,"$1 ").trim(),this.length>r&&(t+=" ... "),"<Buffer "+t+">"};Pl&&(j.prototype[Pl]=j.prototype.inspect);j.prototype.compare=function(t,r,n,i,o){if(gt(t,Uint8Array)&&(t=j.from(t,t.offset,t.byteLength)),!j.isBuffer(t))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof t);if(r===void 0&&(r=0),n===void 0&&(n=t?t.length:0),i===void 0&&(i=0),o===void 0&&(o=this.length),r<0||n>t.length||i<0||o>this.length)throw new RangeError("out of range index");if(i>=o&&r>=n)return 0;if(i>=o)return-1;if(r>=n)return 1;if(r>>>=0,n>>>=0,i>>>=0,o>>>=0,this===t)return 0;let s=o-i,a=n-r,l=Math.min(s,a),c=this.slice(i,o),u=t.slice(r,n);for(let g=0;g<l;++g)if(c[g]!==u[g]){s=c[g],a=u[g];break}return s<a?-1:a<s?1:0};function Ul(e,t,r,n,i){if(e.length===0)return-1;if(typeof r=="string"?(n=r,r=0):r>2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),r=+r,rs(r)&&(r=i?0:e.length-1),r<0&&(r=e.length+r),r>=e.length){if(i)return-1;r=e.length-1}else if(r<0)if(i)r=0;else return-1;if(typeof t=="string"&&(t=j.from(t,n)),j.isBuffer(t))return t.length===0?-1:Ol(e,t,r,n,i);if(typeof t=="number")return t=t&255,typeof Uint8Array.prototype.indexOf=="function"?i?Uint8Array.prototype.indexOf.call(e,t,r):Uint8Array.prototype.lastIndexOf.call(e,t,r):Ol(e,[t],r,n,i);throw new TypeError("val must be string, number or Buffer")}function Ol(e,t,r,n,i){let o=1,s=e.length,a=t.length;if(n!==void 0&&(n=String(n).toLowerCase(),n==="ucs2"||n==="ucs-2"||n==="utf16le"||n==="utf-16le")){if(e.length<2||t.length<2)return-1;o=2,s/=2,a/=2,r/=2}function l(u,g){return o===1?u[g]:u.readUInt16BE(g*o)}let c;if(i){let u=-1;for(c=r;c<s;c++)if(l(e,c)===l(t,u===-1?0:c-u)){if(u===-1&&(u=c),c-u+1===a)return u*o}else u!==-1&&(c-=c-u),u=-1}else for(r+a>s&&(r=s-a),c=r;c>=0;c--){let u=!0;for(let g=0;g<a;g++)if(l(e,c+g)!==l(t,g)){u=!1;break}if(u)return c}return-1}j.prototype.includes=function(t,r,n){return this.indexOf(t,r,n)!==-1};j.prototype.indexOf=function(t,r,n){return Ul(this,t,r,n,!0)};j.prototype.lastIndexOf=function(t,r,n){return Ul(this,t,r,n,!1)};function Ah(e,t,r,n){r=Number(r)||0;let i=e.length-r;n?(n=Number(n),n>i&&(n=i)):n=i;let o=t.length;n>o/2&&(n=o/2);let s;for(s=0;s<n;++s){let a=parseInt(t.substr(s*2,2),16);if(rs(a))return s;e[r+s]=a}return s}function wh(e,t,r,n){return Kn(Yo(t,e.length-r),e,r,n)}function xh(e,t,r,n){return Kn(Oh(t),e,r,n)}function vh(e,t,r,n){return Kn($l(t),e,r,n)}function _h(e,t,r,n){return Kn(Ih(t,e.length-r),e,r,n)}j.prototype.write=function(t,r,n,i){if(r===void 0)i="utf8",n=this.length,r=0;else if(n===void 0&&typeof r=="string")i=r,n=this.length,r=0;else if(isFinite(r))r=r>>>0,isFinite(n)?(n=n>>>0,i===void 0&&(i="utf8")):(i=n,n=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");let o=this.length-r;if((n===void 0||n>o)&&(n=o),t.length>0&&(n<0||r<0)||r>this.length)throw new RangeError("Attempt to write outside buffer bounds");i||(i="utf8");let s=!1;for(;;)switch(i){case"hex":return Ah(this,t,r,n);case"utf8":case"utf-8":return wh(this,t,r,n);case"ascii":case"latin1":case"binary":return xh(this,t,r,n);case"base64":return vh(this,t,r,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return _h(this,t,r,n);default:if(s)throw new TypeError("Unknown encoding: "+i);i=(""+i).toLowerCase(),s=!0}};j.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function bh(e,t,r){return t===0&&r===e.length?Qo.fromByteArray(e):Qo.fromByteArray(e.slice(t,r))}function Ml(e,t,r){r=Math.min(e.length,r);let n=[],i=t;for(;i<r;){let o=e[i],s=null,a=o>239?4:o>223?3:o>191?2:1;if(i+a<=r){let l,c,u,g;switch(a){case 1:o<128&&(s=o);break;case 2:l=e[i+1],(l&192)===128&&(g=(o&31)<<6|l&63,g>127&&(s=g));break;case 3:l=e[i+1],c=e[i+2],(l&192)===128&&(c&192)===128&&(g=(o&15)<<12|(l&63)<<6|c&63,g>2047&&(g<55296||g>57343)&&(s=g));break;case 4:l=e[i+1],c=e[i+2],u=e[i+3],(l&192)===128&&(c&192)===128&&(u&192)===128&&(g=(o&15)<<18|(l&63)<<12|(c&63)<<6|u&63,g>65535&&g<1114112&&(s=g))}}s===null?(s=65533,a=1):s>65535&&(s-=65536,n.push(s>>>10&1023|55296),s=56320|s&1023),n.push(s),i+=a}return Sh(n)}var Il=4096;function Sh(e){let t=e.length;if(t<=Il)return String.fromCharCode.apply(String,e);let r="",n=0;for(;n<t;)r+=String.fromCharCode.apply(String,e.slice(n,n+=Il));return r}function Th(e,t,r){let n="";r=Math.min(e.length,r);for(let i=t;i<r;++i)n+=String.fromCharCode(e[i]&127);return n}function Ch(e,t,r){let n="";r=Math.min(e.length,r);for(let i=t;i<r;++i)n+=String.fromCharCode(e[i]);return n}function Eh(e,t,r){let n=e.length;(!t||t<0)&&(t=0),(!r||r<0||r>n)&&(r=n);let i="";for(let o=t;o<r;++o)i+=Rh[e[o]];return i}function Fh(e,t,r){let n=e.slice(t,r),i="";for(let o=0;o<n.length-1;o+=2)i+=String.fromCharCode(n[o]+n[o+1]*256);return i}j.prototype.slice=function(t,r){let n=this.length;t=~~t,r=r===void 0?n:~~r,t<0?(t+=n,t<0&&(t=0)):t>n&&(t=n),r<0?(r+=n,r<0&&(r=0)):r>n&&(r=n),r<t&&(r=t);let i=this.subarray(t,r);return Object.setPrototypeOf(i,j.prototype),i};function Ne(e,t,r){if(e%1!==0||e<0)throw new RangeError("offset is not uint");if(e+t>r)throw new RangeError("Trying to access beyond buffer length")}j.prototype.readUintLE=j.prototype.readUIntLE=function(t,r,n){t=t>>>0,r=r>>>0,n||Ne(t,r,this.length);let i=this[t],o=1,s=0;for(;++s<r&&(o*=256);)i+=this[t+s]*o;return i};j.prototype.readUintBE=j.prototype.readUIntBE=function(t,r,n){t=t>>>0,r=r>>>0,n||Ne(t,r,this.length);let i=this[t+--r],o=1;for(;r>0&&(o*=256);)i+=this[t+--r]*o;return i};j.prototype.readUint8=j.prototype.readUInt8=function(t,r){return t=t>>>0,r||Ne(t,1,this.length),this[t]};j.prototype.readUint16LE=j.prototype.readUInt16LE=function(t,r){return t=t>>>0,r||Ne(t,2,this.length),this[t]|this[t+1]<<8};j.prototype.readUint16BE=j.prototype.readUInt16BE=function(t,r){return t=t>>>0,r||Ne(t,2,this.length),this[t]<<8|this[t+1]};j.prototype.readUint32LE=j.prototype.readUInt32LE=function(t,r){return t=t>>>0,r||Ne(t,4,this.length),(this[t]|this[t+1]<<8|this[t+2]<<16)+this[t+3]*16777216};j.prototype.readUint32BE=j.prototype.readUInt32BE=function(t,r){return t=t>>>0,r||Ne(t,4,this.length),this[t]*16777216+(this[t+1]<<16|this[t+2]<<8|this[t+3])};j.prototype.readBigUInt64LE=Nt(function(t){t=t>>>0,_r(t,"offset");let r=this[t],n=this[t+7];(r===void 0||n===void 0)&&Xr(t,this.length-8);let i=r+this[++t]*2**8+this[++t]*2**16+this[++t]*2**24,o=this[++t]+this[++t]*2**8+this[++t]*2**16+n*2**24;return BigInt(i)+(BigInt(o)<<BigInt(32))});j.prototype.readBigUInt64BE=Nt(function(t){t=t>>>0,_r(t,"offset");let r=this[t],n=this[t+7];(r===void 0||n===void 0)&&Xr(t,this.length-8);let i=r*2**24+this[++t]*2**16+this[++t]*2**8+this[++t],o=this[++t]*2**24+this[++t]*2**16+this[++t]*2**8+n;return(BigInt(i)<<BigInt(32))+BigInt(o)});j.prototype.readIntLE=function(t,r,n){t=t>>>0,r=r>>>0,n||Ne(t,r,this.length);let i=this[t],o=1,s=0;for(;++s<r&&(o*=256);)i+=this[t+s]*o;return o*=128,i>=o&&(i-=Math.pow(2,8*r)),i};j.prototype.readIntBE=function(t,r,n){t=t>>>0,r=r>>>0,n||Ne(t,r,this.length);let i=r,o=1,s=this[t+--i];for(;i>0&&(o*=256);)s+=this[t+--i]*o;return o*=128,s>=o&&(s-=Math.pow(2,8*r)),s};j.prototype.readInt8=function(t,r){return t=t>>>0,r||Ne(t,1,this.length),this[t]&128?(255-this[t]+1)*-1:this[t]};j.prototype.readInt16LE=function(t,r){t=t>>>0,r||Ne(t,2,this.length);let n=this[t]|this[t+1]<<8;return n&32768?n|4294901760:n};j.prototype.readInt16BE=function(t,r){t=t>>>0,r||Ne(t,2,this.length);let n=this[t+1]|this[t]<<8;return n&32768?n|4294901760:n};j.prototype.readInt32LE=function(t,r){return t=t>>>0,r||Ne(t,4,this.length),this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24};j.prototype.readInt32BE=function(t,r){return t=t>>>0,r||Ne(t,4,this.length),this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]};j.prototype.readBigInt64LE=Nt(function(t){t=t>>>0,_r(t,"offset");let r=this[t],n=this[t+7];(r===void 0||n===void 0)&&Xr(t,this.length-8);let i=this[t+4]+this[t+5]*2**8+this[t+6]*2**16+(n<<24);return(BigInt(i)<<BigInt(32))+BigInt(r+this[++t]*2**8+this[++t]*2**16+this[++t]*2**24)});j.prototype.readBigInt64BE=Nt(function(t){t=t>>>0,_r(t,"offset");let r=this[t],n=this[t+7];(r===void 0||n===void 0)&&Xr(t,this.length-8);let i=(r<<24)+this[++t]*2**16+this[++t]*2**8+this[++t];return(BigInt(i)<<BigInt(32))+BigInt(this[++t]*2**24+this[++t]*2**16+this[++t]*2**8+n)});j.prototype.readFloatLE=function(t,r){return t=t>>>0,r||Ne(t,4,this.length),vr.read(this,t,!0,23,4)};j.prototype.readFloatBE=function(t,r){return t=t>>>0,r||Ne(t,4,this.length),vr.read(this,t,!1,23,4)};j.prototype.readDoubleLE=function(t,r){return t=t>>>0,r||Ne(t,8,this.length),vr.read(this,t,!0,52,8)};j.prototype.readDoubleBE=function(t,r){return t=t>>>0,r||Ne(t,8,this.length),vr.read(this,t,!1,52,8)};function Ke(e,t,r,n,i,o){if(!j.isBuffer(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>i||t<o)throw new RangeError('"value" argument is out of bounds');if(r+n>e.length)throw new RangeError("Index out of range")}j.prototype.writeUintLE=j.prototype.writeUIntLE=function(t,r,n,i){if(t=+t,r=r>>>0,n=n>>>0,!i){let a=Math.pow(2,8*n)-1;Ke(this,t,r,n,a,0)}let o=1,s=0;for(this[r]=t&255;++s<n&&(o*=256);)this[r+s]=t/o&255;return r+n};j.prototype.writeUintBE=j.prototype.writeUIntBE=function(t,r,n,i){if(t=+t,r=r>>>0,n=n>>>0,!i){let a=Math.pow(2,8*n)-1;Ke(this,t,r,n,a,0)}let o=n-1,s=1;for(this[r+o]=t&255;--o>=0&&(s*=256);)this[r+o]=t/s&255;return r+n};j.prototype.writeUint8=j.prototype.writeUInt8=function(t,r,n){return t=+t,r=r>>>0,n||Ke(this,t,r,1,255,0),this[r]=t&255,r+1};j.prototype.writeUint16LE=j.prototype.writeUInt16LE=function(t,r,n){return t=+t,r=r>>>0,n||Ke(this,t,r,2,65535,0),this[r]=t&255,this[r+1]=t>>>8,r+2};j.prototype.writeUint16BE=j.prototype.writeUInt16BE=function(t,r,n){return t=+t,r=r>>>0,n||Ke(this,t,r,2,65535,0),this[r]=t>>>8,this[r+1]=t&255,r+2};j.prototype.writeUint32LE=j.prototype.writeUInt32LE=function(t,r,n){return t=+t,r=r>>>0,n||Ke(this,t,r,4,4294967295,0),this[r+3]=t>>>24,this[r+2]=t>>>16,this[r+1]=t>>>8,this[r]=t&255,r+4};j.prototype.writeUint32BE=j.prototype.writeUInt32BE=function(t,r,n){return t=+t,r=r>>>0,n||Ke(this,t,r,4,4294967295,0),this[r]=t>>>24,this[r+1]=t>>>16,this[r+2]=t>>>8,this[r+3]=t&255,r+4};function ql(e,t,r,n,i){Kl(t,n,i,e,r,7);let o=Number(t&BigInt(4294967295));e[r++]=o,o=o>>8,e[r++]=o,o=o>>8,e[r++]=o,o=o>>8,e[r++]=o;let s=Number(t>>BigInt(32)&BigInt(4294967295));return e[r++]=s,s=s>>8,e[r++]=s,s=s>>8,e[r++]=s,s=s>>8,e[r++]=s,r}function Hl(e,t,r,n,i){Kl(t,n,i,e,r,7);let o=Number(t&BigInt(4294967295));e[r+7]=o,o=o>>8,e[r+6]=o,o=o>>8,e[r+5]=o,o=o>>8,e[r+4]=o;let s=Number(t>>BigInt(32)&BigInt(4294967295));return e[r+3]=s,s=s>>8,e[r+2]=s,s=s>>8,e[r+1]=s,s=s>>8,e[r]=s,r+8}j.prototype.writeBigUInt64LE=Nt(function(t,r=0){return ql(this,t,r,BigInt(0),BigInt("0xffffffffffffffff"))});j.prototype.writeBigUInt64BE=Nt(function(t,r=0){return Hl(this,t,r,BigInt(0),BigInt("0xffffffffffffffff"))});j.prototype.writeIntLE=function(t,r,n,i){if(t=+t,r=r>>>0,!i){let l=Math.pow(2,8*n-1);Ke(this,t,r,n,l-1,-l)}let o=0,s=1,a=0;for(this[r]=t&255;++o<n&&(s*=256);)t<0&&a===0&&this[r+o-1]!==0&&(a=1),this[r+o]=(t/s>>0)-a&255;return r+n};j.prototype.writeIntBE=function(t,r,n,i){if(t=+t,r=r>>>0,!i){let l=Math.pow(2,8*n-1);Ke(this,t,r,n,l-1,-l)}let o=n-1,s=1,a=0;for(this[r+o]=t&255;--o>=0&&(s*=256);)t<0&&a===0&&this[r+o+1]!==0&&(a=1),this[r+o]=(t/s>>0)-a&255;return r+n};j.prototype.writeInt8=function(t,r,n){return t=+t,r=r>>>0,n||Ke(this,t,r,1,127,-128),t<0&&(t=255+t+1),this[r]=t&255,r+1};j.prototype.writeInt16LE=function(t,r,n){return t=+t,r=r>>>0,n||Ke(this,t,r,2,32767,-32768),this[r]=t&255,this[r+1]=t>>>8,r+2};j.prototype.writeInt16BE=function(t,r,n){return t=+t,r=r>>>0,n||Ke(this,t,r,2,32767,-32768),this[r]=t>>>8,this[r+1]=t&255,r+2};j.prototype.writeInt32LE=function(t,r,n){return t=+t,r=r>>>0,n||Ke(this,t,r,4,2147483647,-2147483648),this[r]=t&255,this[r+1]=t>>>8,this[r+2]=t>>>16,this[r+3]=t>>>24,r+4};j.prototype.writeInt32BE=function(t,r,n){return t=+t,r=r>>>0,n||Ke(this,t,r,4,2147483647,-2147483648),t<0&&(t=4294967295+t+1),this[r]=t>>>24,this[r+1]=t>>>16,this[r+2]=t>>>8,this[r+3]=t&255,r+4};j.prototype.writeBigInt64LE=Nt(function(t,r=0){return ql(this,t,r,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))});j.prototype.writeBigInt64BE=Nt(function(t,r=0){return Hl(this,t,r,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))});function zl(e,t,r,n,i,o){if(r+n>e.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function jl(e,t,r,n,i){return t=+t,r=r>>>0,i||zl(e,t,r,4,34028234663852886e22,-34028234663852886e22),vr.write(e,t,r,n,23,4),r+4}j.prototype.writeFloatLE=function(t,r,n){return jl(this,t,r,!0,n)};j.prototype.writeFloatBE=function(t,r,n){return jl(this,t,r,!1,n)};function Gl(e,t,r,n,i){return t=+t,r=r>>>0,i||zl(e,t,r,8,17976931348623157e292,-17976931348623157e292),vr.write(e,t,r,n,52,8),r+8}j.prototype.writeDoubleLE=function(t,r,n){return Gl(this,t,r,!0,n)};j.prototype.writeDoubleBE=function(t,r,n){return Gl(this,t,r,!1,n)};j.prototype.copy=function(t,r,n,i){if(!j.isBuffer(t))throw new TypeError("argument should be a Buffer");if(n||(n=0),!i&&i!==0&&(i=this.length),r>=t.length&&(r=t.length),r||(r=0),i>0&&i<n&&(i=n),i===n||t.length===0||this.length===0)return 0;if(r<0)throw new RangeError("targetStart out of bounds");if(n<0||n>=this.length)throw new RangeError("Index out of range");if(i<0)throw new RangeError("sourceEnd out of bounds");i>this.length&&(i=this.length),t.length-r<i-n&&(i=t.length-r+n);let o=i-n;return this===t&&typeof Uint8Array.prototype.copyWithin=="function"?this.copyWithin(r,n,i):Uint8Array.prototype.set.call(t,this.subarray(n,i),r),o};j.prototype.fill=function(t,r,n,i){if(typeof t=="string"){if(typeof r=="string"?(i=r,r=0,n=this.length):typeof n=="string"&&(i=n,n=this.length),i!==void 0&&typeof i!="string")throw new TypeError("encoding must be a string");if(typeof i=="string"&&!j.isEncoding(i))throw new TypeError("Unknown encoding: "+i);if(t.length===1){let s=t.charCodeAt(0);(i==="utf8"&&s<128||i==="latin1")&&(t=s)}}else typeof t=="number"?t=t&255:typeof t=="boolean"&&(t=Number(t));if(r<0||this.length<r||this.length<n)throw new RangeError("Out of range index");if(n<=r)return this;r=r>>>0,n=n===void 0?this.length:n>>>0,t||(t=0);let o;if(typeof t=="number")for(o=r;o<n;++o)this[o]=t;else{let s=j.isBuffer(t)?t:j.from(t,i),a=s.length;if(a===0)throw new TypeError('The value "'+t+'" is invalid for argument "value"');for(o=0;o<n-r;++o)this[o+r]=s[o%a]}return this};var xr={};function ts(e,t,r){xr[e]=class extends r{constructor(){super(),Object.defineProperty(this,"message",{value:t.apply(this,arguments),writable:!0,configurable:!0}),this.name=`${this.name} [${e}]`,this.stack,delete this.name}get code(){return e}set code(i){Object.defineProperty(this,"code",{configurable:!0,enumerable:!0,value:i,writable:!0})}toString(){return`${this.name} [${e}]: ${this.message}`}}}ts("ERR_BUFFER_OUT_OF_BOUNDS",function(e){return e?`${e} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"},RangeError);ts("ERR_INVALID_ARG_TYPE",function(e,t){return`The "${e}" argument must be of type number. Received type ${typeof t}`},TypeError);ts("ERR_OUT_OF_RANGE",function(e,t,r){let n=`The value of "${e}" is out of range.`,i=r;return Number.isInteger(r)&&Math.abs(r)>2**32?i=Rl(String(r)):typeof r=="bigint"&&(i=String(r),(r>BigInt(2)**BigInt(32)||r<-(BigInt(2)**BigInt(32)))&&(i=Rl(i)),i+="n"),n+=` It must be ${t}. Received ${i}`,n},RangeError);function Rl(e){let t="",r=e.length,n=e[0]==="-"?1:0;for(;r>=n+4;r-=3)t=`_${e.slice(r-3,r)}${t}`;return`${e.slice(0,r)}${t}`}function kh(e,t,r){_r(t,"offset"),(e[t]===void 0||e[t+r]===void 0)&&Xr(t,e.length-(r+1))}function Kl(e,t,r,n,i,o){if(e>r||e<t){let s=typeof t=="bigint"?"n":"",a;throw o>3?t===0||t===BigInt(0)?a=`>= 0${s} and < 2${s} ** ${(o+1)*8}${s}`:a=`>= -(2${s} ** ${(o+1)*8-1}${s}) and < 2 ** ${(o+1)*8-1}${s}`:a=`>= ${t}${s} and <= ${r}${s}`,new xr.ERR_OUT_OF_RANGE("value",a,e)}kh(n,i,o)}function _r(e,t){if(typeof e!="number")throw new xr.ERR_INVALID_ARG_TYPE(t,"number",e)}function Xr(e,t,r){throw Math.floor(e)!==e?(_r(e,r),new xr.ERR_OUT_OF_RANGE(r||"offset","an integer",e)):t<0?new xr.ERR_BUFFER_OUT_OF_BOUNDS:new xr.ERR_OUT_OF_RANGE(r||"offset",`>= ${r?1:0} and <= ${t}`,e)}var Bh=/[^+/0-9A-Za-z-_]/g;function Ph(e){if(e=e.split("=")[0],e=e.trim().replace(Bh,""),e.length<2)return"";for(;e.length%4!==0;)e=e+"=";return e}function Yo(e,t){t=t||1/0;let r,n=e.length,i=null,o=[];for(let s=0;s<n;++s){if(r=e.charCodeAt(s),r>55295&&r<57344){if(!i){if(r>56319){(t-=3)>-1&&o.push(239,191,189);continue}else if(s+1===n){(t-=3)>-1&&o.push(239,191,189);continue}i=r;continue}if(r<56320){(t-=3)>-1&&o.push(239,191,189),i=r;continue}r=(i-55296<<10|r-56320)+65536}else i&&(t-=3)>-1&&o.push(239,191,189);if(i=null,r<128){if((t-=1)<0)break;o.push(r)}else if(r<2048){if((t-=2)<0)break;o.push(r>>6|192,r&63|128)}else if(r<65536){if((t-=3)<0)break;o.push(r>>12|224,r>>6&63|128,r&63|128)}else if(r<1114112){if((t-=4)<0)break;o.push(r>>18|240,r>>12&63|128,r>>6&63|128,r&63|128)}else throw new Error("Invalid code point")}return o}function Oh(e){let t=[];for