zip-no-worker-inflate.min.js 54 KB

1
  1. ((e,t)=>{"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).zip={})})(this,(function(e){"use strict";const{Array:t,Object:n,String:i,BigInt:r,Math:a,Date:s,Map:o,URL:l,Error:c,Uint8Array:d,Uint16Array:u,Uint32Array:f,DataView:h,Blob:_,Promise:w,TextEncoder:p,TextDecoder:g,FileReader:b,document:y,crypto:x,btoa:m}=globalThis,k=-2,v=-3,R=-5,S=[0,1,3,7,15,31,63,127,255,511,1023,2047,4095,8191,16383,32767,65535],z=[96,7,256,0,8,80,0,8,16,84,8,115,82,7,31,0,8,112,0,8,48,0,9,192,80,7,10,0,8,96,0,8,32,0,9,160,0,8,0,0,8,128,0,8,64,0,9,224,80,7,6,0,8,88,0,8,24,0,9,144,83,7,59,0,8,120,0,8,56,0,9,208,81,7,17,0,8,104,0,8,40,0,9,176,0,8,8,0,8,136,0,8,72,0,9,240,80,7,4,0,8,84,0,8,20,85,8,227,83,7,43,0,8,116,0,8,52,0,9,200,81,7,13,0,8,100,0,8,36,0,9,168,0,8,4,0,8,132,0,8,68,0,9,232,80,7,8,0,8,92,0,8,28,0,9,152,84,7,83,0,8,124,0,8,60,0,9,216,82,7,23,0,8,108,0,8,44,0,9,184,0,8,12,0,8,140,0,8,76,0,9,248,80,7,3,0,8,82,0,8,18,85,8,163,83,7,35,0,8,114,0,8,50,0,9,196,81,7,11,0,8,98,0,8,34,0,9,164,0,8,2,0,8,130,0,8,66,0,9,228,80,7,7,0,8,90,0,8,26,0,9,148,84,7,67,0,8,122,0,8,58,0,9,212,82,7,19,0,8,106,0,8,42,0,9,180,0,8,10,0,8,138,0,8,74,0,9,244,80,7,5,0,8,86,0,8,22,192,8,0,83,7,51,0,8,118,0,8,54,0,9,204,81,7,15,0,8,102,0,8,38,0,9,172,0,8,6,0,8,134,0,8,70,0,9,236,80,7,9,0,8,94,0,8,30,0,9,156,84,7,99,0,8,126,0,8,62,0,9,220,82,7,27,0,8,110,0,8,46,0,9,188,0,8,14,0,8,142,0,8,78,0,9,252,96,7,256,0,8,81,0,8,17,85,8,131,82,7,31,0,8,113,0,8,49,0,9,194,80,7,10,0,8,97,0,8,33,0,9,162,0,8,1,0,8,129,0,8,65,0,9,226,80,7,6,0,8,89,0,8,25,0,9,146,83,7,59,0,8,121,0,8,57,0,9,210,81,7,17,0,8,105,0,8,41,0,9,178,0,8,9,0,8,137,0,8,73,0,9,242,80,7,4,0,8,85,0,8,21,80,8,258,83,7,43,0,8,117,0,8,53,0,9,202,81,7,13,0,8,101,0,8,37,0,9,170,0,8,5,0,8,133,0,8,69,0,9,234,80,7,8,0,8,93,0,8,29,0,9,154,84,7,83,0,8,125,0,8,61,0,9,218,82,7,23,0,8,109,0,8,45,0,9,186,0,8,13,0,8,141,0,8,77,0,9,250,80,7,3,0,8,83,0,8,19,85,8,195,83,7,35,0,8,115,0,8,51,0,9,198,81,7,11,0,8,99,0,8,35,0,9,166,0,8,3,0,8,131,0,8,67,0,9,230,80,7,7,0,8,91,0,8,27,0,9,150,84,7,67,0,8,123,0,8,59,0,9,214,82,7,19,0,8,107,0,8,43,0,9,182,0,8,11,0,8,139,0,8,75,0,9,246,80,7,5,0,8,87,0,8,23,192,8,0,83,7,51,0,8,119,0,8,55,0,9,206,81,7,15,0,8,103,0,8,39,0,9,174,0,8,7,0,8,135,0,8,71,0,9,238,80,7,9,0,8,95,0,8,31,0,9,158,84,7,99,0,8,127,0,8,63,0,9,222,82,7,27,0,8,111,0,8,47,0,9,190,0,8,15,0,8,143,0,8,79,0,9,254,96,7,256,0,8,80,0,8,16,84,8,115,82,7,31,0,8,112,0,8,48,0,9,193,80,7,10,0,8,96,0,8,32,0,9,161,0,8,0,0,8,128,0,8,64,0,9,225,80,7,6,0,8,88,0,8,24,0,9,145,83,7,59,0,8,120,0,8,56,0,9,209,81,7,17,0,8,104,0,8,40,0,9,177,0,8,8,0,8,136,0,8,72,0,9,241,80,7,4,0,8,84,0,8,20,85,8,227,83,7,43,0,8,116,0,8,52,0,9,201,81,7,13,0,8,100,0,8,36,0,9,169,0,8,4,0,8,132,0,8,68,0,9,233,80,7,8,0,8,92,0,8,28,0,9,153,84,7,83,0,8,124,0,8,60,0,9,217,82,7,23,0,8,108,0,8,44,0,9,185,0,8,12,0,8,140,0,8,76,0,9,249,80,7,3,0,8,82,0,8,18,85,8,163,83,7,35,0,8,114,0,8,50,0,9,197,81,7,11,0,8,98,0,8,34,0,9,165,0,8,2,0,8,130,0,8,66,0,9,229,80,7,7,0,8,90,0,8,26,0,9,149,84,7,67,0,8,122,0,8,58,0,9,213,82,7,19,0,8,106,0,8,42,0,9,181,0,8,10,0,8,138,0,8,74,0,9,245,80,7,5,0,8,86,0,8,22,192,8,0,83,7,51,0,8,118,0,8,54,0,9,205,81,7,15,0,8,102,0,8,38,0,9,173,0,8,6,0,8,134,0,8,70,0,9,237,80,7,9,0,8,94,0,8,30,0,9,157,84,7,99,0,8,126,0,8,62,0,9,221,82,7,27,0,8,110,0,8,46,0,9,189,0,8,14,0,8,142,0,8,78,0,9,253,96,7,256,0,8,81,0,8,17,85,8,131,82,7,31,0,8,113,0,8,49,0,9,195,80,7,10,0,8,97,0,8,33,0,9,163,0,8,1,0,8,129,0,8,65,0,9,227,80,7,6,0,8,89,0,8,25,0,9,147,83,7,59,0,8,121,0,8,57,0,9,211,81,7,17,0,8,105,0,8,41,0,9,179,0,8,9,0,8,137,0,8,73,0,9,243,80,7,4,0,8,85,0,8,21,80,8,258,83,7,43,0,8,117,0,8,53,0,9,203,81,7,13,0,8,101,0,8,37,0,9,171,0,8,5,0,8,133,0,8,69,0,9,235,80,7,8,0,8,93,0,8,29,0,9,155,84,7,83,0,8,125,0,8,61,0,9,219,82,7,23,0,8,109,0,8,45,0,9,187,0,8,13,0,8,141,0,8,77,0,9,251,80,7,3,0,8,83,0,8,19,85,8,195,83,7,35,0,8,115,0,8,51,0,9,199,81,7,11,0,8,99,0,8,35,0,9,167,0,8,3,0,8,131,0,8,67,0,9,231,80,7,7,0,8,91,0,8,27,0,9,151,84,7,67,0,8,123,0,8,59,0,9,215,82,7,19,0,8,107,0,8,43,0,9,183,0,8,11,0,8,139,0,8,75,0,9,247,80,7,5,0,8,87,0,8,23,192,8,0,83,7,51,0,8,119,0,8,55,0,9,207,81,7,15,0,8,103,0,8,39,0,9,175,0,8,7,0,8,135,0,8,71,0,9,239,80,7,9,0,8,95,0,8,31,0,9,159,84,7,99,0,8,127,0,8,63,0,9,223,82,7,27,0,8,111,0,8,47,0,9,191,0,8,15,0,8,143,0,8,79,0,9,255],A=[80,5,1,87,5,257,83,5,17,91,5,4097,81,5,5,89,5,1025,85,5,65,93,5,16385,80,5,3,88,5,513,84,5,33,92,5,8193,82,5,9,90,5,2049,86,5,129,192,5,24577,80,5,2,87,5,385,83,5,25,91,5,6145,81,5,7,89,5,1537,85,5,97,93,5,24577,80,5,4,88,5,769,84,5,49,92,5,12289,82,5,13,90,5,3073,86,5,193,192,5,24577],E=[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],T=[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,112,112],U=[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],F=[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];function D(){let e,t,n,i,r,a;function s(e,t,s,o,l,c,d,u,f,h,_){let w,p,g,b,y,x,m,k,S,z,A,E,T,U,F;z=0,y=s;do{n[e[t+z]]++,z++,y--}while(0!==y);if(n[0]==s)return d[0]=-1,u[0]=0,0;for(k=u[0],x=1;15>=x&&0===n[x];x++);for(m=x,x>k&&(k=x),y=15;0!==y&&0===n[y];y--);for(g=y,k>y&&(k=y),u[0]=k,U=1<<x;y>x;x++,U<<=1)if(0>(U-=n[x]))return v;if(0>(U-=n[y]))return v;for(n[y]+=U,a[1]=x=0,z=1,T=2;0!=--y;)a[T]=x+=n[z],T++,z++;y=0,z=0;do{0!==(x=e[t+z])&&(_[a[x]++]=y),z++}while(++y<s);for(s=a[g],a[0]=y=0,z=0,b=-1,E=-k,r[0]=0,A=0,F=0;g>=m;m++)for(w=n[m];0!=w--;){for(;m>E+k;){if(b++,E+=k,F=g-E,F=F>k?k:F,(p=1<<(x=m-E))>w+1&&(p-=w+1,T=m,F>x))for(;++x<F&&(p<<=1)>n[++T];)p-=n[T];if(F=1<<x,h[0]+F>1440)return v;r[b]=A=h[0],h[0]+=F,0!==b?(a[b]=y,i[0]=x,i[1]=k,x=y>>>E-k,i[2]=A-r[b-1]-x,f.set(i,3*(r[b-1]+x))):d[0]=A}for(i[1]=m-E,s>z?_[z]<o?(i[0]=256>_[z]?0:96,i[2]=_[z++]):(i[0]=c[_[z]-o]+16+64,i[2]=l[_[z++]-o]):i[0]=192,p=1<<m-E,x=y>>>E;F>x;x+=p)f.set(i,3*(A+x));for(x=1<<m-1;0!=(y&x);x>>>=1)y^=x;for(y^=x,S=(1<<E)-1;(y&S)!=a[b];)b--,E-=k,S=(1<<E)-1}return 0!==U&&1!=g?R:0}function o(s){let o;for(e||(e=[],t=[],n=new Int32Array(16),i=[],r=new Int32Array(15),a=new Int32Array(16)),t.length<s&&(t=[]),o=0;s>o;o++)t[o]=0;for(o=0;16>o;o++)n[o]=0;for(o=0;3>o;o++)i[o]=0;r.set(n.subarray(0,15),0),a.set(n.subarray(0,16),0)}this.inflate_trees_bits=(n,i,r,a,l)=>{let c;return o(19),e[0]=0,c=s(n,0,19,19,null,null,r,i,a,e,t),c==v?l.msg="oversubscribed dynamic bit lengths tree":c!=R&&0!==i[0]||(l.msg="incomplete dynamic bit lengths tree",c=v),c},this.inflate_trees_dynamic=(n,i,r,a,l,c,d,u,f)=>{let h;return o(288),e[0]=0,h=s(r,0,n,257,E,T,c,a,u,e,t),0!=h||0===a[0]?(h==v?f.msg="oversubscribed literal/length tree":-4!=h&&(f.msg="incomplete literal/length tree",h=v),h):(o(288),h=s(r,n,i,0,U,F,d,l,u,e,t),0!=h||0===l[0]&&n>257?(h==v?f.msg="oversubscribed distance tree":h==R?(f.msg="incomplete distance tree",h=v):-4!=h&&(f.msg="empty distance tree with lengths",h=v),h):0)}}function C(){const e=this;let t,n,i,r,a=0,s=0,o=0,l=0,c=0,d=0,u=0,f=0,h=0,_=0;function w(e,t,n,i,r,a,s,o){let l,c,d,u,f,h,_,w,p,g,b,y,x,m,k,R;_=o.next_in_index,w=o.avail_in,f=s.bitb,h=s.bitk,p=s.write,g=p<s.read?s.read-p-1:s.end-p,b=S[e],y=S[t];do{for(;20>h;)w--,f|=(255&o.read_byte(_++))<<h,h+=8;if(l=f&b,c=n,d=i,R=3*(d+l),0!==(u=c[R]))for(;;){if(f>>=c[R+1],h-=c[R+1],0!=(16&u)){for(u&=15,x=c[R+2]+(f&S[u]),f>>=u,h-=u;15>h;)w--,f|=(255&o.read_byte(_++))<<h,h+=8;for(l=f&y,c=r,d=a,R=3*(d+l),u=c[R];;){if(f>>=c[R+1],h-=c[R+1],0!=(16&u)){for(u&=15;u>h;)w--,f|=(255&o.read_byte(_++))<<h,h+=8;if(m=c[R+2]+(f&S[u]),f>>=u,h-=u,g-=x,m>p){k=p-m;do{k+=s.end}while(0>k);if(u=s.end-k,x>u){if(x-=u,p-k>0&&u>p-k)do{s.win[p++]=s.win[k++]}while(0!=--u);else s.win.set(s.win.subarray(k,k+u),p),p+=u,k+=u,u=0;k=0}}else k=p-m,p-k>0&&2>p-k?(s.win[p++]=s.win[k++],s.win[p++]=s.win[k++],x-=2):(s.win.set(s.win.subarray(k,k+2),p),p+=2,k+=2,x-=2);if(p-k>0&&x>p-k)do{s.win[p++]=s.win[k++]}while(0!=--x);else s.win.set(s.win.subarray(k,k+x),p),p+=x,k+=x,x=0;break}if(0!=(64&u))return o.msg="invalid distance code",x=o.avail_in-w,x=x>h>>3?h>>3:x,w+=x,_-=x,h-=x<<3,s.bitb=f,s.bitk=h,o.avail_in=w,o.total_in+=_-o.next_in_index,o.next_in_index=_,s.write=p,v;l+=c[R+2],l+=f&S[u],R=3*(d+l),u=c[R]}break}if(0!=(64&u))return 0!=(32&u)?(x=o.avail_in-w,x=x>h>>3?h>>3:x,w+=x,_-=x,h-=x<<3,s.bitb=f,s.bitk=h,o.avail_in=w,o.total_in+=_-o.next_in_index,o.next_in_index=_,s.write=p,1):(o.msg="invalid literal/length code",x=o.avail_in-w,x=x>h>>3?h>>3:x,w+=x,_-=x,h-=x<<3,s.bitb=f,s.bitk=h,o.avail_in=w,o.total_in+=_-o.next_in_index,o.next_in_index=_,s.write=p,v);if(l+=c[R+2],l+=f&S[u],R=3*(d+l),0===(u=c[R])){f>>=c[R+1],h-=c[R+1],s.win[p++]=c[R+2],g--;break}}else f>>=c[R+1],h-=c[R+1],s.win[p++]=c[R+2],g--}while(g>=258&&w>=10);return x=o.avail_in-w,x=x>h>>3?h>>3:x,w+=x,_-=x,h-=x<<3,s.bitb=f,s.bitk=h,o.avail_in=w,o.total_in+=_-o.next_in_index,o.next_in_index=_,s.write=p,0}e.init=(e,a,s,o,l,c)=>{t=0,u=e,f=a,i=s,h=o,r=l,_=c,n=null},e.proc=(e,p,g)=>{let b,y,x,m,R,z,A,E=0,T=0,U=0;for(U=p.next_in_index,m=p.avail_in,E=e.bitb,T=e.bitk,R=e.write,z=R<e.read?e.read-R-1:e.end-R;;)switch(t){case 0:if(z>=258&&m>=10&&(e.bitb=E,e.bitk=T,p.avail_in=m,p.total_in+=U-p.next_in_index,p.next_in_index=U,e.write=R,g=w(u,f,i,h,r,_,e,p),U=p.next_in_index,m=p.avail_in,E=e.bitb,T=e.bitk,R=e.write,z=R<e.read?e.read-R-1:e.end-R,0!=g)){t=1==g?7:9;break}o=u,n=i,s=h,t=1;case 1:for(b=o;b>T;){if(0===m)return e.bitb=E,e.bitk=T,p.avail_in=m,p.total_in+=U-p.next_in_index,p.next_in_index=U,e.write=R,e.inflate_flush(p,g);g=0,m--,E|=(255&p.read_byte(U++))<<T,T+=8}if(y=3*(s+(E&S[b])),E>>>=n[y+1],T-=n[y+1],x=n[y],0===x){l=n[y+2],t=6;break}if(0!=(16&x)){c=15&x,a=n[y+2],t=2;break}if(0==(64&x)){o=x,s=y/3+n[y+2];break}if(0!=(32&x)){t=7;break}return t=9,p.msg="invalid literal/length code",g=v,e.bitb=E,e.bitk=T,p.avail_in=m,p.total_in+=U-p.next_in_index,p.next_in_index=U,e.write=R,e.inflate_flush(p,g);case 2:for(b=c;b>T;){if(0===m)return e.bitb=E,e.bitk=T,p.avail_in=m,p.total_in+=U-p.next_in_index,p.next_in_index=U,e.write=R,e.inflate_flush(p,g);g=0,m--,E|=(255&p.read_byte(U++))<<T,T+=8}a+=E&S[b],E>>=b,T-=b,o=f,n=r,s=_,t=3;case 3:for(b=o;b>T;){if(0===m)return e.bitb=E,e.bitk=T,p.avail_in=m,p.total_in+=U-p.next_in_index,p.next_in_index=U,e.write=R,e.inflate_flush(p,g);g=0,m--,E|=(255&p.read_byte(U++))<<T,T+=8}if(y=3*(s+(E&S[b])),E>>=n[y+1],T-=n[y+1],x=n[y],0!=(16&x)){c=15&x,d=n[y+2],t=4;break}if(0==(64&x)){o=x,s=y/3+n[y+2];break}return t=9,p.msg="invalid distance code",g=v,e.bitb=E,e.bitk=T,p.avail_in=m,p.total_in+=U-p.next_in_index,p.next_in_index=U,e.write=R,e.inflate_flush(p,g);case 4:for(b=c;b>T;){if(0===m)return e.bitb=E,e.bitk=T,p.avail_in=m,p.total_in+=U-p.next_in_index,p.next_in_index=U,e.write=R,e.inflate_flush(p,g);g=0,m--,E|=(255&p.read_byte(U++))<<T,T+=8}d+=E&S[b],E>>=b,T-=b,t=5;case 5:for(A=R-d;0>A;)A+=e.end;for(;0!==a;){if(0===z&&(R==e.end&&0!==e.read&&(R=0,z=R<e.read?e.read-R-1:e.end-R),0===z&&(e.write=R,g=e.inflate_flush(p,g),R=e.write,z=R<e.read?e.read-R-1:e.end-R,R==e.end&&0!==e.read&&(R=0,z=R<e.read?e.read-R-1:e.end-R),0===z)))return e.bitb=E,e.bitk=T,p.avail_in=m,p.total_in+=U-p.next_in_index,p.next_in_index=U,e.write=R,e.inflate_flush(p,g);e.win[R++]=e.win[A++],z--,A==e.end&&(A=0),a--}t=0;break;case 6:if(0===z&&(R==e.end&&0!==e.read&&(R=0,z=R<e.read?e.read-R-1:e.end-R),0===z&&(e.write=R,g=e.inflate_flush(p,g),R=e.write,z=R<e.read?e.read-R-1:e.end-R,R==e.end&&0!==e.read&&(R=0,z=R<e.read?e.read-R-1:e.end-R),0===z)))return e.bitb=E,e.bitk=T,p.avail_in=m,p.total_in+=U-p.next_in_index,p.next_in_index=U,e.write=R,e.inflate_flush(p,g);g=0,e.win[R++]=l,z--,t=0;break;case 7:if(T>7&&(T-=8,m++,U--),e.write=R,g=e.inflate_flush(p,g),R=e.write,z=R<e.read?e.read-R-1:e.end-R,e.read!=e.write)return e.bitb=E,e.bitk=T,p.avail_in=m,p.total_in+=U-p.next_in_index,p.next_in_index=U,e.write=R,e.inflate_flush(p,g);t=8;case 8:return g=1,e.bitb=E,e.bitk=T,p.avail_in=m,p.total_in+=U-p.next_in_index,p.next_in_index=U,e.write=R,e.inflate_flush(p,g);case 9:return g=v,e.bitb=E,e.bitk=T,p.avail_in=m,p.total_in+=U-p.next_in_index,p.next_in_index=U,e.write=R,e.inflate_flush(p,g);default:return g=k,e.bitb=E,e.bitk=T,p.avail_in=m,p.total_in+=U-p.next_in_index,p.next_in_index=U,e.write=R,e.inflate_flush(p,g)}},e.free=()=>{}}D.inflate_trees_fixed=(e,t,n,i)=>(e[0]=9,t[0]=5,n[0]=z,i[0]=A,0);const B=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15];function W(e,t){const n=this;let i,r=0,a=0,s=0,o=0;const l=[0],c=[0],u=new C;let f=0,h=new Int32Array(4320);const _=new D;n.bitk=0,n.bitb=0,n.win=new d(t),n.end=t,n.read=0,n.write=0,n.reset=(e,t)=>{t&&(t[0]=0),6==r&&u.free(e),r=0,n.bitk=0,n.bitb=0,n.read=n.write=0},n.reset(e,null),n.inflate_flush=(e,t)=>{let i,r,a;return r=e.next_out_index,a=n.read,i=(a>n.write?n.end:n.write)-a,i>e.avail_out&&(i=e.avail_out),0!==i&&t==R&&(t=0),e.avail_out-=i,e.total_out+=i,e.next_out.set(n.win.subarray(a,a+i),r),r+=i,a+=i,a==n.end&&(a=0,n.write==n.end&&(n.write=0),i=n.write-a,i>e.avail_out&&(i=e.avail_out),0!==i&&t==R&&(t=0),e.avail_out-=i,e.total_out+=i,e.next_out.set(n.win.subarray(a,a+i),r),r+=i,a+=i),e.next_out_index=r,n.read=a,t},n.proc=(e,t)=>{let d,w,p,g,b,y,x,m;for(g=e.next_in_index,b=e.avail_in,w=n.bitb,p=n.bitk,y=n.write,x=y<n.read?n.read-y-1:n.end-y;;){let R,z,A,E,T,U,F,C;switch(r){case 0:for(;3>p;){if(0===b)return n.bitb=w,n.bitk=p,e.avail_in=b,e.total_in+=g-e.next_in_index,e.next_in_index=g,n.write=y,n.inflate_flush(e,t);t=0,b--,w|=(255&e.read_byte(g++))<<p,p+=8}switch(d=7&w,f=1&d,d>>>1){case 0:w>>>=3,p-=3,d=7&p,w>>>=d,p-=d,r=1;break;case 1:R=[],z=[],A=[[]],E=[[]],D.inflate_trees_fixed(R,z,A,E),u.init(R[0],z[0],A[0],0,E[0],0),w>>>=3,p-=3,r=6;break;case 2:w>>>=3,p-=3,r=3;break;case 3:return w>>>=3,p-=3,r=9,e.msg="invalid block type",t=v,n.bitb=w,n.bitk=p,e.avail_in=b,e.total_in+=g-e.next_in_index,e.next_in_index=g,n.write=y,n.inflate_flush(e,t)}break;case 1:for(;32>p;){if(0===b)return n.bitb=w,n.bitk=p,e.avail_in=b,e.total_in+=g-e.next_in_index,e.next_in_index=g,n.write=y,n.inflate_flush(e,t);t=0,b--,w|=(255&e.read_byte(g++))<<p,p+=8}if((~w>>>16&65535)!=(65535&w))return r=9,e.msg="invalid stored block lengths",t=v,n.bitb=w,n.bitk=p,e.avail_in=b,e.total_in+=g-e.next_in_index,e.next_in_index=g,n.write=y,n.inflate_flush(e,t);a=65535&w,w=p=0,r=0!==a?2:0!==f?7:0;break;case 2:if(0===b)return n.bitb=w,n.bitk=p,e.avail_in=b,e.total_in+=g-e.next_in_index,e.next_in_index=g,n.write=y,n.inflate_flush(e,t);if(0===x&&(y==n.end&&0!==n.read&&(y=0,x=y<n.read?n.read-y-1:n.end-y),0===x&&(n.write=y,t=n.inflate_flush(e,t),y=n.write,x=y<n.read?n.read-y-1:n.end-y,y==n.end&&0!==n.read&&(y=0,x=y<n.read?n.read-y-1:n.end-y),0===x)))return n.bitb=w,n.bitk=p,e.avail_in=b,e.total_in+=g-e.next_in_index,e.next_in_index=g,n.write=y,n.inflate_flush(e,t);if(t=0,d=a,d>b&&(d=b),d>x&&(d=x),n.win.set(e.read_buf(g,d),y),g+=d,b-=d,y+=d,x-=d,0!=(a-=d))break;r=0!==f?7:0;break;case 3:for(;14>p;){if(0===b)return n.bitb=w,n.bitk=p,e.avail_in=b,e.total_in+=g-e.next_in_index,e.next_in_index=g,n.write=y,n.inflate_flush(e,t);t=0,b--,w|=(255&e.read_byte(g++))<<p,p+=8}if(s=d=16383&w,(31&d)>29||(d>>5&31)>29)return r=9,e.msg="too many length or distance symbols",t=v,n.bitb=w,n.bitk=p,e.avail_in=b,e.total_in+=g-e.next_in_index,e.next_in_index=g,n.write=y,n.inflate_flush(e,t);if(d=258+(31&d)+(d>>5&31),!i||i.length<d)i=[];else for(m=0;d>m;m++)i[m]=0;w>>>=14,p-=14,o=0,r=4;case 4:for(;4+(s>>>10)>o;){for(;3>p;){if(0===b)return n.bitb=w,n.bitk=p,e.avail_in=b,e.total_in+=g-e.next_in_index,e.next_in_index=g,n.write=y,n.inflate_flush(e,t);t=0,b--,w|=(255&e.read_byte(g++))<<p,p+=8}i[B[o++]]=7&w,w>>>=3,p-=3}for(;19>o;)i[B[o++]]=0;if(l[0]=7,d=_.inflate_trees_bits(i,l,c,h,e),0!=d)return(t=d)==v&&(i=null,r=9),n.bitb=w,n.bitk=p,e.avail_in=b,e.total_in+=g-e.next_in_index,e.next_in_index=g,n.write=y,n.inflate_flush(e,t);o=0,r=5;case 5:for(;d=s,258+(31&d)+(d>>5&31)>o;){let a,u;for(d=l[0];d>p;){if(0===b)return n.bitb=w,n.bitk=p,e.avail_in=b,e.total_in+=g-e.next_in_index,e.next_in_index=g,n.write=y,n.inflate_flush(e,t);t=0,b--,w|=(255&e.read_byte(g++))<<p,p+=8}if(d=h[3*(c[0]+(w&S[d]))+1],u=h[3*(c[0]+(w&S[d]))+2],16>u)w>>>=d,p-=d,i[o++]=u;else{for(m=18==u?7:u-14,a=18==u?11:3;d+m>p;){if(0===b)return n.bitb=w,n.bitk=p,e.avail_in=b,e.total_in+=g-e.next_in_index,e.next_in_index=g,n.write=y,n.inflate_flush(e,t);t=0,b--,w|=(255&e.read_byte(g++))<<p,p+=8}if(w>>>=d,p-=d,a+=w&S[m],w>>>=m,p-=m,m=o,d=s,m+a>258+(31&d)+(d>>5&31)||16==u&&1>m)return i=null,r=9,e.msg="invalid bit length repeat",t=v,n.bitb=w,n.bitk=p,e.avail_in=b,e.total_in+=g-e.next_in_index,e.next_in_index=g,n.write=y,n.inflate_flush(e,t);u=16==u?i[m-1]:0;do{i[m++]=u}while(0!=--a);o=m}}if(c[0]=-1,T=[],U=[],F=[],C=[],T[0]=9,U[0]=6,d=s,d=_.inflate_trees_dynamic(257+(31&d),1+(d>>5&31),i,T,U,F,C,h,e),0!=d)return d==v&&(i=null,r=9),t=d,n.bitb=w,n.bitk=p,e.avail_in=b,e.total_in+=g-e.next_in_index,e.next_in_index=g,n.write=y,n.inflate_flush(e,t);u.init(T[0],U[0],h,F[0],h,C[0]),r=6;case 6:if(n.bitb=w,n.bitk=p,e.avail_in=b,e.total_in+=g-e.next_in_index,e.next_in_index=g,n.write=y,1!=(t=u.proc(n,e,t)))return n.inflate_flush(e,t);if(t=0,u.free(e),g=e.next_in_index,b=e.avail_in,w=n.bitb,p=n.bitk,y=n.write,x=y<n.read?n.read-y-1:n.end-y,0===f){r=0;break}r=7;case 7:if(n.write=y,t=n.inflate_flush(e,t),y=n.write,x=y<n.read?n.read-y-1:n.end-y,n.read!=n.write)return n.bitb=w,n.bitk=p,e.avail_in=b,e.total_in+=g-e.next_in_index,e.next_in_index=g,n.write=y,n.inflate_flush(e,t);r=8;case 8:return t=1,n.bitb=w,n.bitk=p,e.avail_in=b,e.total_in+=g-e.next_in_index,e.next_in_index=g,n.write=y,n.inflate_flush(e,t);case 9:return t=v,n.bitb=w,n.bitk=p,e.avail_in=b,e.total_in+=g-e.next_in_index,e.next_in_index=g,n.write=y,n.inflate_flush(e,t);default:return t=k,n.bitb=w,n.bitk=p,e.avail_in=b,e.total_in+=g-e.next_in_index,e.next_in_index=g,n.write=y,n.inflate_flush(e,t)}}},n.free=e=>{n.reset(e,null),n.win=null,h=null},n.set_dictionary=(e,t,i)=>{n.win.set(e.subarray(t,t+i),0),n.read=n.write=i},n.sync_point=()=>1==r?1:0}const I=13,L=[0,0,255,255];function H(){const e=this;function t(e){return e&&e.istate?(e.total_in=e.total_out=0,e.msg=null,e.istate.mode=7,e.istate.blocks.reset(e,null),0):k}e.mode=0,e.method=0,e.was=[0],e.need=0,e.marker=0,e.wbits=0,e.inflateEnd=t=>(e.blocks&&e.blocks.free(t),e.blocks=null,0),e.inflateInit=(n,i)=>(n.msg=null,e.blocks=null,8>i||i>15?(e.inflateEnd(n),k):(e.wbits=i,n.istate.blocks=new W(n,1<<i),t(n),0)),e.inflate=(e,t)=>{let n,i;if(!e||!e.istate||!e.next_in)return k;const r=e.istate;for(t=4==t?R:0,n=R;;)switch(r.mode){case 0:if(0===e.avail_in)return n;if(n=t,e.avail_in--,e.total_in++,8!=(15&(r.method=e.read_byte(e.next_in_index++)))){r.mode=I,e.msg="unknown compression method",r.marker=5;break}if(8+(r.method>>4)>r.wbits){r.mode=I,e.msg="invalid win size",r.marker=5;break}r.mode=1;case 1:if(0===e.avail_in)return n;if(n=t,e.avail_in--,e.total_in++,i=255&e.read_byte(e.next_in_index++),((r.method<<8)+i)%31!=0){r.mode=I,e.msg="incorrect header check",r.marker=5;break}if(0==(32&i)){r.mode=7;break}r.mode=2;case 2:if(0===e.avail_in)return n;n=t,e.avail_in--,e.total_in++,r.need=(255&e.read_byte(e.next_in_index++))<<24&4278190080,r.mode=3;case 3:if(0===e.avail_in)return n;n=t,e.avail_in--,e.total_in++,r.need+=(255&e.read_byte(e.next_in_index++))<<16&16711680,r.mode=4;case 4:if(0===e.avail_in)return n;n=t,e.avail_in--,e.total_in++,r.need+=(255&e.read_byte(e.next_in_index++))<<8&65280,r.mode=5;case 5:return 0===e.avail_in?n:(n=t,e.avail_in--,e.total_in++,r.need+=255&e.read_byte(e.next_in_index++),r.mode=6,2);case 6:return r.mode=I,e.msg="need dictionary",r.marker=0,k;case 7:if(n=r.blocks.proc(e,n),n==v){r.mode=I,r.marker=0;break}if(0==n&&(n=t),1!=n)return n;n=t,r.blocks.reset(e,r.was),r.mode=12;case 12:return e.avail_in=0,1;case I:return v;default:return k}},e.inflateSetDictionary=(e,t,n)=>{let i=0,r=n;if(!e||!e.istate||6!=e.istate.mode)return k;const a=e.istate;return r<1<<a.wbits||(r=(1<<a.wbits)-1,i=n-r),a.blocks.set_dictionary(t,i,r),a.mode=7,0},e.inflateSync=e=>{let n,i,r,a,s;if(!e||!e.istate)return k;const o=e.istate;if(o.mode!=I&&(o.mode=I,o.marker=0),0===(n=e.avail_in))return R;for(i=e.next_in_index,r=o.marker;0!==n&&4>r;)e.read_byte(i)==L[r]?r++:r=0!==e.read_byte(i)?0:4-r,i++,n--;return e.total_in+=i-e.next_in_index,e.next_in_index=i,e.avail_in=n,o.marker=r,4!=r?v:(a=e.total_in,s=e.total_out,t(e),e.total_in=a,e.total_out=s,o.mode=7,0)},e.inflateSyncPoint=e=>e&&e.istate&&e.istate.blocks?e.istate.blocks.sync_point():k}function M(){}M.prototype={inflateInit:function(e){const t=this;return t.istate=new H,e||(e=15),t.istate.inflateInit(t,e)},inflate:function(e){const t=this;return t.istate?t.istate.inflate(t,e):k},inflateEnd:function(){const e=this;if(!e.istate)return k;const t=e.istate.inflateEnd(e);return e.istate=null,t},inflateSync:function(){const e=this;return e.istate?e.istate.inflateSync(e):k},inflateSetDictionary:function(e,t){const n=this;return n.istate?n.istate.inflateSetDictionary(n,e,t):k},read_byte:function(e){return this.next_in[e]},read_buf:function(e,t){return this.next_in.subarray(e,e+t)}};const N={chunkSize:524288,maxWorkers:"undefined"!=typeof navigator&&navigator.hardwareConcurrency||2,terminateWorkerTimeout:5e3,useWebWorkers:!0,workerScripts:void 0},O=n.assign({},N);function V(e){if(void 0!==e.baseURL&&(O.baseURL=e.baseURL),void 0!==e.chunkSize&&(O.chunkSize=e.chunkSize),void 0!==e.maxWorkers&&(O.maxWorkers=e.maxWorkers),void 0!==e.terminateWorkerTimeout&&(O.terminateWorkerTimeout=e.terminateWorkerTimeout),void 0!==e.useWebWorkers&&(O.useWebWorkers=e.useWebWorkers),void 0!==e.Deflate&&(O.Deflate=e.Deflate),void 0!==e.Inflate&&(O.Inflate=e.Inflate),void 0!==e.workerScripts){if(e.workerScripts.deflate){if(!t.isArray(e.workerScripts.deflate))throw new c("workerScripts.deflate must be an array");O.workerScripts||(O.workerScripts={}),O.workerScripts.deflate=e.workerScripts.deflate}if(e.workerScripts.inflate){if(!t.isArray(e.workerScripts.inflate))throw new c("workerScripts.inflate must be an array");O.workerScripts||(O.workerScripts={}),O.workerScripts.inflate=e.workerScripts.inflate}}}const P=[];for(let e=0;256>e;e++){let t=e;for(let e=0;8>e;e++)1&t?t=t>>>1^3988292384:t>>>=1;P[e]=t}class q{constructor(e){this.crc=e||-1}append(e){let t=0|this.crc;for(let n=0,i=0|e.length;i>n;n++)t=t>>>8^P[255&(t^e[n])];this.crc=t}get(){return~this.crc}}const K={concat(e,t){if(0===e.length||0===t.length)return e.concat(t);const n=e[e.length-1],i=K.getPartial(n);return 32===i?e.concat(t):K._shiftRight(t,i,0|n,e.slice(0,e.length-1))},bitLength(e){const t=e.length;if(0===t)return 0;const n=e[t-1];return 32*(t-1)+K.getPartial(n)},clamp(e,t){if(32*e.length<t)return e;const n=(e=e.slice(0,a.ceil(t/32))).length;return t&=31,n>0&&t&&(e[n-1]=K.partial(t,e[n-1]&2147483648>>t-1,1)),e},partial:(e,t,n)=>32===e?t:(n?0|t:t<<32-e)+1099511627776*e,getPartial:e=>a.round(e/1099511627776)||32,_shiftRight(e,t,n,i){for(void 0===i&&(i=[]);t>=32;t-=32)i.push(n),n=0;if(0===t)return i.concat(e);for(let r=0;r<e.length;r++)i.push(n|e[r]>>>t),n=e[r]<<32-t;const r=e.length?e[e.length-1]:0,a=K.getPartial(r);return i.push(K.partial(t+a&31,t+a>32?n:i.pop(),1)),i}},G={bytes:{fromBits(e){const t=K.bitLength(e)/8,n=new d(t);let i;for(let r=0;t>r;r++)0==(3&r)&&(i=e[r/4]),n[r]=i>>>24,i<<=8;return n},toBits(e){const t=[];let n,i=0;for(n=0;n<e.length;n++)i=i<<8|e[n],3==(3&n)&&(t.push(i),i=0);return 3&n&&t.push(K.partial(8*(3&n),i)),t}}},Z={sha1:function(e){e?(this._h=e._h.slice(0),this._buffer=e._buffer.slice(0),this._length=e._length):this.reset()}};Z.sha1.prototype={blockSize:512,reset:function(){const e=this;return e._h=this._init.slice(0),e._buffer=[],e._length=0,e},update:function(e){const t=this;"string"==typeof e&&(e=G.utf8String.toBits(e));const n=t._buffer=K.concat(t._buffer,e),i=t._length,r=t._length=i+K.bitLength(e);if(r>9007199254740991)throw new c("Cannot hash more than 2^53 - 1 bits");const a=new f(n);let s=0;for(let e=t.blockSize+i-(t.blockSize+i&t.blockSize-1);r>=e;e+=t.blockSize)t._block(a.subarray(16*s,16*(s+1))),s+=1;return n.splice(0,16*s),t},finalize:function(){const e=this;let t=e._buffer;const n=e._h;t=K.concat(t,[K.partial(1,1)]);for(let e=t.length+2;15&e;e++)t.push(0);for(t.push(a.floor(e._length/4294967296)),t.push(0|e._length);t.length;)e._block(t.splice(0,16));return e.reset(),n},_init:[1732584193,4023233417,2562383102,271733878,3285377520],_key:[1518500249,1859775393,2400959708,3395469782],_f:(e,t,n,i)=>e>19?e>39?e>59?e>79?void 0:t^n^i:t&n|t&i|n&i:t^n^i:t&n|~t&i,_S:(e,t)=>t<<e|t>>>32-e,_block:function(e){const n=this,i=n._h,r=t(80);for(let t=0;16>t;t++)r[t]=e[t];let s=i[0],o=i[1],l=i[2],c=i[3],d=i[4];for(let e=0;79>=e;e++){16>e||(r[e]=n._S(1,r[e-3]^r[e-8]^r[e-14]^r[e-16]));const t=n._S(5,s)+n._f(e,o,l,c)+d+r[e]+n._key[a.floor(e/20)]|0;d=c,c=l,l=n._S(30,o),o=s,s=t}i[0]=i[0]+s|0,i[1]=i[1]+o|0,i[2]=i[2]+l|0,i[3]=i[3]+c|0,i[4]=i[4]+d|0}};const j={getRandomValues(e){const t=new f(e.buffer),n=e=>{let t=987654321;const n=4294967295;return()=>(t=36969*(65535&t)+(t>>16)&n,(((t<<16)+(e=18e3*(65535&e)+(e>>16)&n)&n)/4294967296+.5)*(a.random()>.5?1:-1))};for(let i,r=0;r<e.length;r+=4){const e=n(4294967296*(i||a.random()));i=987654071*e(),t[r/4]=4294967296*e()|0}return e}},X={importKey:e=>new X.hmacSha1(G.bytes.toBits(e)),pbkdf2(e,t,n,i){if(n=n||1e4,0>i||0>n)throw new c("invalid params to pbkdf2");const r=1+(i>>5)<<2;let a,s,o,l,d;const u=new ArrayBuffer(r),f=new h(u);let _=0;const w=K;for(t=G.bytes.toBits(t),d=1;(r||1)>_;d++){for(a=s=e.encrypt(w.concat(t,[d])),o=1;n>o;o++)for(s=e.encrypt(s),l=0;l<s.length;l++)a[l]^=s[l];for(o=0;(r||1)>_&&o<a.length;o++)f.setInt32(_,a[o]),_+=4}return u.slice(0,i/8)},hmacSha1:class{constructor(e){const t=this,n=t._hash=Z.sha1,i=[[],[]],r=n.prototype.blockSize/32;t._baseHash=[new n,new n],e.length>r&&(e=n.hash(e));for(let t=0;r>t;t++)i[0][t]=909522486^e[t],i[1][t]=1549556828^e[t];t._baseHash[0].update(i[0]),t._baseHash[1].update(i[1]),t._resultHash=new n(t._baseHash[0])}reset(){const e=this;e._resultHash=new e._hash(e._baseHash[0]),e._updated=!1}update(e){this._updated=!0,this._resultHash.update(e)}digest(){const e=this,t=e._resultHash.finalize(),n=new e._hash(e._baseHash[1]).update(t).finalize();return e.reset(),n}encrypt(e){if(this._updated)throw new c("encrypt on already updated hmac called!");return this.update(e),this.digest(e)}}},Y="Invalid pasword",J=16,Q={name:"PBKDF2"},$=n.assign({hash:{name:"HMAC"}},Q),ee=n.assign({iterations:1e3,hash:{name:"SHA-1"}},Q),te=["deriveBits"],ne=[8,12,16],ie=[16,24,32],re=10,ae=[0,0,0,0],se=void 0!==x,oe=se&&void 0!==x.subtle,le=G.bytes,ce=class{constructor(e){const t=this;t._tables=[[[],[],[],[],[]],[[],[],[],[],[]]],t._tables[0][0][0]||t._precompute();const n=t._tables[0][4],i=t._tables[1],r=e.length;let a,s,o,l=1;if(4!==r&&6!==r&&8!==r)throw new c("invalid aes key size");for(t._key=[s=e.slice(0),o=[]],a=r;4*r+28>a;a++){let e=s[a-1];(a%r==0||8===r&&a%r==4)&&(e=n[e>>>24]<<24^n[e>>16&255]<<16^n[e>>8&255]<<8^n[255&e],a%r==0&&(e=e<<8^e>>>24^l<<24,l=l<<1^283*(l>>7))),s[a]=s[a-r]^e}for(let e=0;a;e++,a--){const t=s[3&e?a:a-4];o[e]=4>=a||4>e?t:i[0][n[t>>>24]]^i[1][n[t>>16&255]]^i[2][n[t>>8&255]]^i[3][n[255&t]]}}encrypt(e){return this._crypt(e,0)}decrypt(e){return this._crypt(e,1)}_precompute(){const e=this._tables[0],t=this._tables[1],n=e[4],i=t[4],r=[],a=[];let s,o,l,c;for(let e=0;256>e;e++)a[(r[e]=e<<1^283*(e>>7))^e]=e;for(let d=s=0;!n[d];d^=o||1,s=a[s]||1){let a=s^s<<1^s<<2^s<<3^s<<4;a=a>>8^255&a^99,n[d]=a,i[a]=d,c=r[l=r[o=r[d]]];let u=16843009*c^65537*l^257*o^16843008*d,f=257*r[a]^16843008*a;for(let n=0;4>n;n++)e[n][d]=f=f<<24^f>>>8,t[n][a]=u=u<<24^u>>>8}for(let n=0;5>n;n++)e[n]=e[n].slice(0),t[n]=t[n].slice(0)}_crypt(e,t){if(4!==e.length)throw new c("invalid aes block size");const n=this._key[t],i=n.length/4-2,r=[0,0,0,0],a=this._tables[t],s=a[0],o=a[1],l=a[2],d=a[3],u=a[4];let f,h,_,w=e[0]^n[0],p=e[t?3:1]^n[1],g=e[2]^n[2],b=e[t?1:3]^n[3],y=4;for(let e=0;i>e;e++)f=s[w>>>24]^o[p>>16&255]^l[g>>8&255]^d[255&b]^n[y],h=s[p>>>24]^o[g>>16&255]^l[b>>8&255]^d[255&w]^n[y+1],_=s[g>>>24]^o[b>>16&255]^l[w>>8&255]^d[255&p]^n[y+2],b=s[b>>>24]^o[w>>16&255]^l[p>>8&255]^d[255&g]^n[y+3],y+=4,w=f,p=h,g=_;for(let e=0;4>e;e++)r[t?3&-e:e]=u[w>>>24]<<24^u[p>>16&255]<<16^u[g>>8&255]<<8^u[255&b]^n[y++],f=w,w=p,p=g,g=b,b=f;return r}},de=class{constructor(e,t){this._prf=e,this._initIv=t,this._iv=t}reset(){this._iv=this._initIv}update(e){return this.calculate(this._prf,e,this._iv)}incWord(e){if(255==(e>>24&255)){let t=e>>16&255,n=e>>8&255,i=255&e;255===t?(t=0,255===n?(n=0,255===i?i=0:++i):++n):++t,e=0,e+=t<<16,e+=n<<8,e+=i}else e+=1<<24;return e}incCounter(e){0===(e[0]=this.incWord(e[0]))&&(e[1]=this.incWord(e[1]))}calculate(e,t,n){let i;if(!(i=t.length))return[];const r=K.bitLength(t);for(let r=0;i>r;r+=4){this.incCounter(n);const i=e.encrypt(n);t[r]^=i[0],t[r+1]^=i[1],t[r+2]^=i[2],t[r+3]^=i[3]}return K.clamp(t,r)}},ue=X.hmacSha1;class fe{constructor(e,t,i){n.assign(this,{password:e,signed:t,strength:i-1,pendingInput:new d(0)})}async append(e){const n=this;if(n.password){const i=ge(e,0,ne[n.strength]+2);await(async(e,t,n)=>{await we(e,n,ge(t,0,ne[e.strength]));const i=ge(t,ne[e.strength]),r=e.keys.passwordVerification;if(r[0]!=i[0]||r[1]!=i[1])throw new c(Y)})(n,i,n.password),n.password=null,n.aesCtrGladman=new de(new ce(n.keys.key),t.from(ae)),n.hmac=new ue(n.keys.authentication),e=ge(e,ne[n.strength]+2)}return _e(n,e,new d(e.length-re-(e.length-re)%J),0,re,!0)}flush(){const e=this,t=e.pendingInput,n=ge(t,0,t.length-re),i=ge(t,t.length-re);let r=new d(0);if(n.length){const t=le.toBits(n);e.hmac.update(t);const i=e.aesCtrGladman.update(t);r=le.fromBits(i)}let a=!0;if(e.signed){const t=ge(le.fromBits(e.hmac.digest()),0,re);for(let e=0;re>e;e++)t[e]!=i[e]&&(a=!1)}return{valid:a,data:r}}}class he{constructor(e,t){n.assign(this,{password:e,strength:t-1,pendingInput:new d(0)})}async append(e){const n=this;let i=new d(0);n.password&&(i=await(async(e,t)=>{const n=(i=new d(ne[e.strength]),se&&"function"==typeof x.getRandomValues?x.getRandomValues(i):j.getRandomValues(i));var i;return await we(e,t,n),pe(n,e.keys.passwordVerification)})(n,n.password),n.password=null,n.aesCtrGladman=new de(new ce(n.keys.key),t.from(ae)),n.hmac=new ue(n.keys.authentication));const r=new d(i.length+e.length-e.length%J);return r.set(i,0),_e(n,e,r,i.length,0)}flush(){const e=this;let t=new d(0);if(e.pendingInput.length){const n=e.aesCtrGladman.update(le.toBits(e.pendingInput));e.hmac.update(n),t=le.fromBits(n)}const n=ge(le.fromBits(e.hmac.digest()),0,re);return{data:pe(t,n),signature:n}}}function _e(e,t,n,i,r,a){const s=t.length-r;let o;for(e.pendingInput.length&&(t=pe(e.pendingInput,t),n=((e,t)=>{if(t&&t>e.length){const n=e;(e=new d(t)).set(n,0)}return e})(n,s-s%J)),o=0;s-J>=o;o+=J){const r=le.toBits(ge(t,o,o+J));a&&e.hmac.update(r);const s=e.aesCtrGladman.update(r);a||e.hmac.update(s),n.set(le.fromBits(s),o+i)}return e.pendingInput=ge(t,o),n}async function we(e,t,i){const r=(e=>{if(void 0===p){const t=new d((e=unescape(encodeURIComponent(e))).length);for(let n=0;n<t.length;n++)t[n]=e.charCodeAt(n);return t}return(new p).encode(e)})(t),a=await((e,t,n,i,r)=>se&&oe&&"function"==typeof x.subtle.importKey?x.subtle.importKey("raw",t,n,!1,r):X.importKey(t))(0,r,$,0,te),s=await(async(e,t,n)=>se&&oe&&"function"==typeof x.subtle.deriveBits?await x.subtle.deriveBits(e,t,n):X.pbkdf2(t,e.salt,ee.iterations,n))(n.assign({salt:i},ee),a,8*(2*ie[e.strength]+2)),o=new d(s);e.keys={key:le.toBits(ge(o,0,ie[e.strength])),authentication:le.toBits(ge(o,ie[e.strength],2*ie[e.strength])),passwordVerification:ge(o,2*ie[e.strength])}}function pe(e,t){let n=e;return e.length+t.length&&(n=new d(e.length+t.length),n.set(e,0),n.set(t,e.length)),n}function ge(e,t,n){return e.subarray(t,n)}class be{constructor(e,t){n.assign(this,{password:e,passwordVerification:t}),ke(this,e)}append(e){const t=this;if(t.password){const n=xe(t,e.subarray(0,12));if(t.password=null,n[11]!=t.passwordVerification)throw new c(Y);e=e.subarray(12)}return xe(t,e)}flush(){return{valid:!0,data:new d(0)}}}class ye{constructor(e,t){n.assign(this,{password:e,passwordVerification:t}),ke(this,e)}append(e){const t=this;let n,i;if(t.password){t.password=null;const r=x.getRandomValues(new d(12));r[11]=t.passwordVerification,n=new d(e.length+r.length),n.set(me(t,r),0),i=12}else n=new d(e.length),i=0;return n.set(me(t,e),i),n}flush(){return{data:new d(0)}}}function xe(e,t){const n=new d(t.length);for(let i=0;i<t.length;i++)n[i]=Re(e)^t[i],ve(e,n[i]);return n}function me(e,t){const n=new d(t.length);for(let i=0;i<t.length;i++)n[i]=Re(e)^t[i],ve(e,t[i]);return n}function ke(e,t){e.keys=[305419896,591751049,878082192],e.crcKey0=new q(e.keys[0]),e.crcKey2=new q(e.keys[2]);for(let n=0;n<t.length;n++)ve(e,t.charCodeAt(n))}function ve(e,t){e.crcKey0.append([t]),e.keys[0]=~e.crcKey0.get(),e.keys[1]=ze(e.keys[1]+Se(e.keys[0])),e.keys[1]=ze(a.imul(e.keys[1],134775813)+1),e.crcKey2.append([e.keys[1]>>>24]),e.keys[2]=~e.crcKey2.get()}function Re(e){const t=2|e.keys[2];return Se(a.imul(t,1^t)>>>8)}function Se(e){return 255&e}function ze(e){return 4294967295&e}const Ae="inflate",Ee="Invalid signature";class Te{constructor(e,{signature:t,password:i,signed:r,compressed:a,zipCrypto:s,passwordVerification:o,encryptionStrength:l},{chunkSize:c}){const d=!!i;n.assign(this,{signature:t,encrypted:d,signed:r,compressed:a,inflate:a&&new e({chunkSize:c}),crc32:r&&new q,zipCrypto:s,decrypt:d&&s?new be(i,o):new fe(i,r,l)})}async append(e){const t=this;return t.encrypted&&e.length&&(e=await t.decrypt.append(e)),t.compressed&&e.length&&(e=await t.inflate.append(e)),(!t.encrypted||t.zipCrypto)&&t.signed&&e.length&&t.crc32.append(e),e}async flush(){const e=this;let t,n=new d(0);if(e.encrypted){const t=e.decrypt.flush();if(!t.valid)throw new c(Ee);n=t.data}if((!e.encrypted||e.zipCrypto)&&e.signed){const n=new h(new d(4).buffer);if(t=e.crc32.get(),n.setUint32(0,t),e.signature!=n.getUint32(0,!1))throw new c(Ee)}return e.compressed&&(n=await e.inflate.append(n)||new d(0),await e.inflate.flush()),{data:n,signature:t}}}class Ue{constructor(e,{encrypted:t,signed:i,compressed:r,level:a,zipCrypto:s,password:o,passwordVerification:l,encryptionStrength:c},{chunkSize:d}){n.assign(this,{encrypted:t,signed:i,compressed:r,deflate:r&&new e({level:a||5,chunkSize:d}),crc32:i&&new q,zipCrypto:s,encrypt:t&&s?new ye(o,l):new he(o,c)})}async append(e){const t=this;let n=e;return t.compressed&&e.length&&(n=await t.deflate.append(e)),t.encrypted&&n.length&&(n=await t.encrypt.append(n)),(!t.encrypted||t.zipCrypto)&&t.signed&&e.length&&t.crc32.append(e),n}async flush(){const e=this;let t,n=new d(0);if(e.compressed&&(n=await e.deflate.flush()||new d(0)),e.encrypted){n=await e.encrypt.append(n);const i=e.encrypt.flush();t=i.signature;const r=new d(n.length+i.data.length);r.set(n,0),r.set(i.data,n.length),n=r}return e.encrypted&&!e.zipCrypto||!e.signed||(t=e.crc32.get()),{data:n,signature:t}}}const Fe="init",De="append",Ce="flush";let Be=!0;var We=(e,t,i,r,a,s,o)=>(n.assign(e,{busy:!0,codecConstructor:t,options:n.assign({},i),scripts:o,terminate(){e.worker&&!e.busy&&(e.worker.terminate(),e.interface=null)},onTaskFinished(){e.busy=!1,a(e)}}),s?((e,t)=>{let n;const i={type:"module"};if(!e.interface){if(Be)try{e.worker=r({},t.baseURL)}catch(n){Be=!1,e.worker=r(i,t.baseURL)}else e.worker=r(i,t.baseURL);e.worker.addEventListener("message",(t=>{const i=t.data;if(n){const t=i.error,r=i.type;if(t){const i=new c(t.message);i.stack=t.stack,n.reject(i),n=null,e.onTaskFinished()}else if(r==Fe||r==Ce||r==De){const t=i.data;r==Ce?(n.resolve({data:new d(t),signature:i.signature}),n=null,e.onTaskFinished()):n.resolve(t&&new d(t))}}}),!1),e.interface={append:e=>a({type:De,data:e}),flush:()=>a({type:Ce}),abort(){e.onTaskFinished()}}}return e.interface;function r(t,n){let i,r;i=e.scripts[0],"function"==typeof i&&(i=i());try{r=new l(i,n)}catch(e){r=i}return new Worker(r,t)}async function a(i){if(!n){const n=e.options,i=e.scripts.slice(1);await s({scripts:i,type:Fe,options:n,config:{chunkSize:t.chunkSize}})}return s(i)}function s(t){const i=e.worker,r=new w(((e,t)=>n={resolve:e,reject:t}));try{if(t.data)try{t.data=t.data.buffer,i.postMessage(t,[t.data])}catch(e){i.postMessage(t)}else i.postMessage(t)}catch(t){n.reject(t),n=null,e.onTaskFinished()}return r}})(e,r):((e,t)=>{const n=((e,t,n)=>t.codecType.startsWith("deflate")?new Ue(e,t,n):t.codecType.startsWith(Ae)?new Te(e,t,n):void 0)(e.codecConstructor,e.options,t);return{async append(t){try{return await n.append(t)}catch(t){throw e.onTaskFinished(),t}},async flush(){try{return await n.flush()}finally{e.onTaskFinished()}},abort(){e.onTaskFinished()}}})(e,r));let Ie=[];const Le=[];function He(e){e.terminateTimeout&&(clearTimeout(e.terminateTimeout),e.terminateTimeout=null)}const Me="Abort error";function Ne(e,t){if(e&&e.aborted)throw t.abort(),new c(Me)}async function Oe(e,t){return t.length&&await e.writeUint8Array(t),t.length}const Ve="HTTP error ",Pe="HTTP Range not supported",qe="Reader is not seekable",Ke="text/plain",Ge="GET";class Ze{constructor(){this.size=0}init(){this.initialized=!0}}class je extends Ze{}class Xe extends Ze{writeUint8Array(e){this.size+=e.length}}class Ye extends je{constructor(e){super(),this.blob=e,this.size=e.size}async readUint8Array(e,t){if(this.blob.arrayBuffer)return new d(await this.blob.slice(e,e+t).arrayBuffer());{const n=new b;return new w(((i,r)=>{n.onload=e=>i(new d(e.target.result)),n.onerror=()=>r(n.error),n.readAsArrayBuffer(this.blob.slice(e,e+t))}))}}}function Je(e){e.pendingBlob=new _([],{type:e.contentType}),e.arrayBuffers=[]}function Qe(e){e.pendingBlob=new _([e.pendingBlob,...e.arrayBuffers],{type:e.contentType}),e.arrayBuffers=[]}class $e extends je{constructor(e,t){super(),this.url=e,this.preventHeadRequest=t.preventHeadRequest,this.useRangeHeader=t.useRangeHeader,this.forceRangeRequests=t.forceRangeRequests,this.options=n.assign({},t),delete this.options.preventHeadRequest,delete this.options.useRangeHeader,delete this.options.forceRangeRequests,delete this.options.useXHR}async init(){super.init(),await tt(this,ct,at)}readUint8Array(e,t){return nt(this,e,t,ct,at)}}class et extends je{constructor(e,t){super(),this.url=e,this.preventHeadRequest=t.preventHeadRequest,this.useRangeHeader=t.useRangeHeader,this.forceRangeRequests=t.forceRangeRequests,this.options=t}async init(){super.init(),await tt(this,dt,st)}readUint8Array(e,t){return nt(this,e,t,dt,st)}}async function tt(e,t,n){if((e=>{if(void 0!==y){const t=y.createElement("a");return t.href=e,"http:"==t.protocol||"https:"==t.protocol}return/^https?:\/\//i.test(e)})(e.url)&&(e.useRangeHeader||e.forceRangeRequests)){const i=await t(Ge,e,it(e));if(!e.forceRangeRequests&&"bytes"!=i.headers.get("Accept-Ranges"))throw new c(Pe);{let r;const a=i.headers.get("Content-Range");if(a){const e=a.trim().split(/\s*\/\s*/);if(e.length){const t=e[1];t&&"*"!=t&&(r=Number(t))}}void 0===r?await lt(e,t,n):e.size=r}}else await lt(e,t,n)}async function nt(e,t,n,i,r){if(e.useRangeHeader||e.forceRangeRequests){const r=await i(Ge,e,it(e,t,n));if(206!=r.status)throw new c(Pe);return new d(await r.arrayBuffer())}return e.data||await r(e,e.options),new d(e.data.subarray(t,t+n))}function it(e,t=0,i=1){return n.assign({},rt(e),{Range:"bytes="+t+"-"+(t+i-1)})}function rt(e){const t=e.options.headers;if(t)return Symbol.iterator in t?n.fromEntries(t):t}async function at(e){await ot(e,ct)}async function st(e){await ot(e,dt)}async function ot(e,t){const n=await t(Ge,e,rt(e));e.data=new d(await n.arrayBuffer()),e.size||(e.size=e.data.length)}async function lt(e,t,n){if(e.preventHeadRequest)await n(e,e.options);else{const i=(await t("HEAD",e,rt(e))).headers.get("Content-Length");i?e.size=Number(i):await n(e,e.options)}}async function ct(e,{options:t,url:i},r){const a=await fetch(i,n.assign({},t,{method:e,headers:r}));if(400>a.status)return a;throw new c(Ve+(a.statusText||a.status))}function dt(e,{url:t},i){return new w(((r,a)=>{const s=new XMLHttpRequest;if(s.addEventListener("load",(()=>{if(400>s.status){const e=[];s.getAllResponseHeaders().trim().split(/[\r\n]+/).forEach((t=>{const n=t.trim().split(/\s*:\s*/);n[0]=n[0].trim().replace(/^[a-z]|-[a-z]/g,(e=>e.toUpperCase())),e.push(n)})),r({status:s.status,arrayBuffer:()=>s.response,headers:new o(e)})}else a(new c(Ve+(s.statusText||s.status)))}),!1),s.addEventListener("error",(e=>a(e.detail.error)),!1),s.open(e,t),i)for(const e of n.entries(i))s.setRequestHeader(e[0],e[1]);s.responseType="arraybuffer",s.send()}))}class ut extends je{constructor(e,t={}){super(),this.url=e,t.useXHR?this.reader=new et(e,t):this.reader=new $e(e,t)}set size(e){}get size(){return this.reader.size}async init(){super.init(),await this.reader.init()}readUint8Array(e,t){return this.reader.readUint8Array(e,t)}}const ft=4294967295,ht=33639248,_t=101075792,wt="\0☺☻♥♦♣♠•◘○◙♂♀♪♫☼►◄↕‼¶§▬↨↑↓→←∟↔▲▼ !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~⌂ÇüéâäàåçêëèïîìÄÅÉæÆôöòûùÿÖÜ¢£¥₧ƒáíóúñѪº¿⌐¬½¼¡«»░▒▓│┤╡╢╖╕╣║╗╝╜╛┐└┴┬├─┼╞╟╚╔╩╦╠═╬╧╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀αßΓπΣσµτΦΘΩδ∞φε∩≡±≥≤⌠⌡÷≈°∙·√ⁿ²■ ".split("");function pt(e,t){if(t&&"cp437"==t.trim().toLowerCase())return(e=>{let t="";for(let n=0;n<e.length;n++)t+=wt[e[n]];return t})(e);if(void 0===g){const t=new b;return new w(((n,i)=>{t.onload=e=>n(e.target.result),t.onerror=()=>i(t.error),t.readAsText(new _([e]))}))}return new g(t).decode(e)}const gt=["filename","rawFilename","directory","encrypted","compressedSize","uncompressedSize","lastModDate","rawLastModDate","comment","rawComment","signature","extraField","rawExtraField","bitFlag","extraFieldZip64","extraFieldUnicodePath","extraFieldUnicodeComment","extraFieldAES","filenameUTF8","commentUTF8","offset","zip64","compressionMethod","extraFieldNTFS","lastAccessDate","creationDate","extraFieldExtendedTimestamp","version","versionMadeBy","msDosCompatible","internalFileAttribute","externalFileAttribute"];class bt{constructor(e){gt.forEach((t=>this[t]=e[t]))}}const yt="File format is not recognized",xt="End of central directory not found",mt="End of Zip64 central directory not found",kt="End of Zip64 central directory locator not found",vt="Central directory header not found",Rt="Local file header not found",St="Zip64 extra field not found",zt="File contains encrypted entry",At="Encryption method not supported",Et="Compression method not supported",Tt="utf-8",Ut="cp437",Ft=["uncompressedSize","compressedSize","offset"];class Dt{constructor(e,t,i){n.assign(this,{reader:e,config:t,options:i})}async getData(e,t,n={}){const i=this,{reader:r,offset:s,extraFieldAES:o,compressionMethod:l,config:d,bitFlag:u,signature:f,rawLastModDate:h,compressedSize:_}=i,p=i.localDirectory={};r.initialized||await r.init();let g=await qt(r,s,30);const b=Pt(g);let y=It(i,n,"password");if(y=y&&y.length&&y,o&&99!=o.originalCompressionMethod)throw new c(Et);if(0!=l&&8!=l)throw new c(Et);if(67324752!=Ot(b,0))throw new c(Rt);Ct(p,b,4),g=await qt(r,s,30+p.filenameLength+p.extraFieldLength),p.rawExtraField=g.subarray(30+p.filenameLength),await Bt(i,p,b,4),t.lastAccessDate=p.lastAccessDate,t.creationDate=p.creationDate;const x=i.encrypted&&p.encrypted,m=x&&!o;if(x){if(!m&&void 0===o.strength)throw new c(At);if(!y)throw new c(zt)}const k=await((e,t,n)=>{const i=!(!t.compressed&&!t.signed&&!t.encrypted)&&(t.useWebWorkers||void 0===t.useWebWorkers&&n.useWebWorkers),r=i&&n.workerScripts?n.workerScripts[t.codecType]:[];if(Ie.length<n.maxWorkers){const s={};return Ie.push(s),We(s,e,t,n,a,i,r)}{const s=Ie.find((e=>!e.busy));return s?(He(s),We(s,e,t,n,a,i,r)):new w((n=>Le.push({resolve:n,codecConstructor:e,options:t,webWorker:i,scripts:r})))}function a(e){if(Le.length){const[{resolve:t,codecConstructor:i,options:r,webWorker:s,scripts:o}]=Le.splice(0,1);t(We(e,i,r,n,a,s,o))}else e.worker?(He(e),Number.isFinite(n.terminateWorkerTimeout)&&n.terminateWorkerTimeout>=0&&(e.terminateTimeout=setTimeout((()=>{Ie=Ie.filter((t=>t!=e)),e.terminate()}),n.terminateWorkerTimeout))):Ie=Ie.filter((t=>t!=e))}})(d.Inflate,{codecType:Ae,password:y,zipCrypto:m,encryptionStrength:o&&o.strength,signed:It(i,n,"checkSignature"),passwordVerification:m&&(u.dataDescriptor?h>>>8&255:f>>>24&255),signature:f,compressed:0!=l,encrypted:x,useWebWorkers:It(i,n,"useWebWorkers")},d);e.initialized||await e.init();const v=It(i,n,"signal"),R=s+30+p.filenameLength+p.extraFieldLength;return await(async(e,t,n,i,r,s,o)=>{const l=a.max(s.chunkSize,64);return async function r(s=0,c=0){const d=o.signal,u=_;if(u>s){Ne(d,e);const f=await t.readUint8Array(s+i,a.min(l,u-s)),h=f.length;Ne(d,e);const _=await e.append(f);if(Ne(d,e),c+=await Oe(n,_),o.onprogress)try{o.onprogress(s+h,u)}catch(e){}return r(s+l,c)}{const t=await e.flush();return c+=await Oe(n,t.data),{signature:t.signature,length:c}}}()})(k,r,e,R,0,d,{onprogress:n.onprogress,signal:v}),e.getData()}}function Ct(e,t,i){const r=e.rawBitFlag=Nt(t,i+2),a=1==(1&r),s=Ot(t,i+6);n.assign(e,{encrypted:a,version:Nt(t,i),bitFlag:{level:(6&r)>>1,dataDescriptor:8==(8&r),languageEncodingFlag:2048==(2048&r)},rawLastModDate:s,lastModDate:Lt(s),filenameLength:Nt(t,i+22),extraFieldLength:Nt(t,i+24)})}async function Bt(e,t,i,r){const l=t.rawExtraField,u=t.extraField=new o,f=Pt(new d(l));let h=0;try{for(;h<l.length;){const e=Nt(f,h),t=Nt(f,h+2);u.set(e,{type:e,data:l.slice(h+4,h+4+t)}),h+=4+t}}catch(e){}const _=Nt(i,r+4);t.signature=Ot(i,r+10),t.uncompressedSize=Ot(i,r+18),t.compressedSize=Ot(i,r+14);const w=u.get(1);w&&(((e,t)=>{t.zip64=!0;const n=Pt(e.data);e.values=[];for(let t=0;t<a.floor(e.data.length/8);t++)e.values.push(Vt(n,0+8*t));const i=Ft.filter((e=>t[e]==ft));for(let t=0;t<i.length;t++)e[i[t]]=e.values[t];Ft.forEach((n=>{if(t[n]==ft){if(void 0===e[n])throw new c(St);t[n]=e[n]}}))})(w,t),t.extraFieldZip64=w);const p=u.get(28789);p&&(await Wt(p,"filename","rawFilename",t,e),t.extraFieldUnicodePath=p);const g=u.get(25461);g&&(await Wt(g,"comment","rawComment",t,e),t.extraFieldUnicodeComment=g);const b=u.get(39169);b?(((e,t,n)=>{const i=Pt(e.data);e.vendorVersion=Mt(i,0),e.vendorId=Mt(i,2);const r=Mt(i,4);e.strength=r,e.originalCompressionMethod=n,t.compressionMethod=e.compressionMethod=Nt(i,5)})(b,t,_),t.extraFieldAES=b):t.compressionMethod=_;const y=u.get(10);y&&(((e,t)=>{const i=Pt(e.data);let r,a=4;try{for(;a<e.data.length&&!r;){const t=Nt(i,a),n=Nt(i,a+2);1==t&&(r=e.data.slice(a+4,a+4+n)),a+=4+n}}catch(e){}try{if(r&&24==r.length){const i=Pt(r),a=i.getBigUint64(0,!0),s=i.getBigUint64(8,!0),o=i.getBigUint64(16,!0);n.assign(e,{rawLastModDate:a,rawLastAccessDate:s,rawCreationDate:o});const l={lastModDate:Ht(a),lastAccessDate:Ht(s),creationDate:Ht(o)};n.assign(e,l),n.assign(t,l)}}catch(e){}})(y,t),t.extraFieldNTFS=y);const x=u.get(21589);x&&(((e,t)=>{const n=Pt(e.data),i=Mt(n,0),r=[],a=[];1==(1&i)&&(r.push("lastModDate"),a.push("rawLastModDate")),2==(2&i)&&(r.push("lastAccessDate"),a.push("rawLastAccessDate")),4==(4&i)&&(r.push("creationDate"),a.push("rawCreationDate"));let o=1;r.forEach(((i,r)=>{if(e.data.length>=o+4){const l=Ot(n,o);t[i]=e[i]=new s(1e3*l);const c=a[r];e[c]=l}o+=4}))})(x,t),t.extraFieldExtendedTimestamp=x)}async function Wt(e,t,n,i,r){const a=Pt(e.data);e.version=Mt(a,0),e.signature=Ot(a,1);const s=new q;s.append(r[n]);const o=Pt(new d(4));o.setUint32(0,s.get(),!0),e[t]=await pt(e.data.subarray(5)),e.valid=!r.bitFlag.languageEncodingFlag&&e.signature==Ot(o,0),e.valid&&(i[t]=e[t],i[t+"UTF8"]=!0)}function It(e,t,n){return void 0===t[n]?e.options[n]:t[n]}function Lt(e){const t=(4294901760&e)>>16,n=65535&e;try{return new s(1980+((65024&t)>>9),((480&t)>>5)-1,31&t,(63488&n)>>11,(2016&n)>>5,2*(31&n),0)}catch(e){}}function Ht(e){return new s(Number(e/r(1e4)-r(116444736e5)))}function Mt(e,t){return e.getUint8(t)}function Nt(e,t){return e.getUint16(t,!0)}function Ot(e,t){return e.getUint32(t,!0)}function Vt(e,t){return Number(e.getBigUint64(t,!0))}function Pt(e){return new h(e.buffer)}function qt(e,t,n){return e.readUint8Array(t,n)}V({Inflate:function(e){const t=new M,n=e&&e.chunkSize?a.floor(2*e.chunkSize):131072,i=new d(n);let r=!1;t.inflateInit(),t.next_out=i,this.append=(e,a)=>{const s=[];let o,l,u=0,f=0,h=0;if(0!==e.length){t.next_in_index=0,t.next_in=e,t.avail_in=e.length;do{if(t.next_out_index=0,t.avail_out=n,0!==t.avail_in||r||(t.next_in_index=0,r=!0),o=t.inflate(0),r&&o===R){if(0!==t.avail_in)throw new c("inflating: bad input")}else if(0!==o&&1!==o)throw new c("inflating: "+t.msg);if((r||1===o)&&t.avail_in===e.length)throw new c("inflating: bad input");t.next_out_index&&(t.next_out_index===n?s.push(new d(i)):s.push(i.slice(0,t.next_out_index))),h+=t.next_out_index,a&&t.next_in_index>0&&t.next_in_index!=u&&(a(t.next_in_index),u=t.next_in_index)}while(t.avail_in>0||0===t.avail_out);return s.length>1?(l=new d(h),s.forEach((e=>{l.set(e,f),f+=e.length}))):l=s[0]||new d(0),l}},this.flush=()=>{t.inflateEnd()}}}),e.BlobReader=Ye,e.BlobWriter=class extends Xe{constructor(e){super(),this.contentType=e,this.arrayBuffersMaxlength=8,Je(this)}writeUint8Array(e){super.writeUint8Array(e),this.arrayBuffers.length==this.arrayBuffersMaxlength&&Qe(this),this.arrayBuffers.push(e.buffer)}getData(){return this.blob||(this.arrayBuffers.length&&Qe(this),this.blob=this.pendingBlob,Je(this)),this.blob}},e.Data64URIReader=class extends je{constructor(e){super(),this.dataURI=e;let t=e.length;for(;"="==e.charAt(t-1);)t--;this.dataStart=e.indexOf(",")+1,this.size=a.floor(.75*(t-this.dataStart))}readUint8Array(e,t){const n=new d(t),i=4*a.floor(e/3),r=atob(this.dataURI.substring(i+this.dataStart,4*a.ceil((e+t)/3)+this.dataStart)),s=e-3*a.floor(i/4);for(let e=s;s+t>e;e++)n[e-s]=r.charCodeAt(e);return n}},e.Data64URIWriter=class extends Xe{constructor(e){super(),this.data="data:"+(e||"")+";base64,",this.pending=[]}writeUint8Array(e){super.writeUint8Array(e);let t=0,n=this.pending;const r=this.pending.length;for(this.pending="",t=0;t<3*a.floor((r+e.length)/3)-r;t++)n+=i.fromCharCode(e[t]);for(;t<e.length;t++)this.pending+=i.fromCharCode(e[t]);n.length>2?this.data+=m(n):this.pending=n}getData(){return this.data+m(this.pending)}},e.ERR_ABORT=Me,e.ERR_BAD_FORMAT=yt,e.ERR_CENTRAL_DIRECTORY_NOT_FOUND=vt,e.ERR_ENCRYPTED=zt,e.ERR_EOCDR_LOCATOR_ZIP64_NOT_FOUND=kt,e.ERR_EOCDR_NOT_FOUND=xt,e.ERR_EOCDR_ZIP64_NOT_FOUND=mt,e.ERR_EXTRAFIELD_ZIP64_NOT_FOUND=St,e.ERR_HTTP_RANGE=Pe,e.ERR_INVALID_PASSWORD=Y,e.ERR_INVALID_SIGNATURE=Ee,e.ERR_LOCAL_FILE_HEADER_NOT_FOUND=Rt,e.ERR_NOT_SEEKABLE_READER=qe,e.ERR_UNSUPPORTED_COMPRESSION=Et,e.ERR_UNSUPPORTED_ENCRYPTION=At,e.HttpRangeReader=class extends ut{constructor(e,t={}){t.useRangeHeader=!0,super(e,t)}},e.HttpReader=ut,e.ReadableStreamReader=class{constructor(e){this.readableStream=e,this.reader=e.getReader(),this.size=1/0,this.index=0,this.currentSize=0,this.pendingValue=new d}init(){this.initialized=!0}async readUint8Array(e,t){if(this.index!=e)throw new c(qe);let n,i=new d(t),r=0;do{const e=await this.reader.read();let{value:a}=e;if(n=e.done,a?this.currentSize+=a.length:(a=this.pendingValue,this.pendingValue=new d),this.pendingValue.length){const e=new d(this.pendingValue.length+a.length);e.set(this.pendingValue),e.set(a,this.pendingValue.length),this.pendingValue=new d,a=e}r+a.length>t?(i.set(a.subarray(0,t),r),this.pendingValue=a.subarray(t),r+=t):(i.set(a,r),r+=a.length)}while(t>r&&!n);return n&&this.size==1/0&&(this.size=this.currentSize),this.size<t&&(i=i.slice(0,this.size),t=this.size),this.index+=t,i}},e.Reader=je,e.TextReader=class extends je{constructor(e){super(),this.blobReader=new Ye(new _([e],{type:Ke}))}init(){super.init(),this.blobReader.init(),this.size=this.blobReader.size}readUint8Array(e,t){return this.blobReader.readUint8Array(e,t)}},e.TextWriter=class extends Xe{constructor(e){super(),this.encoding=e,this.blob=new _([],{type:Ke})}writeUint8Array(e){super.writeUint8Array(e),this.blob=new _([this.blob,e.buffer],{type:Ke})}getData(){if(this.blob.text)return this.blob.text();{const e=new b;return new w(((t,n)=>{e.onload=e=>t(e.target.result),e.onerror=()=>n(e.error),e.readAsText(this.blob,this.encoding)}))}}},e.Uint8ArrayReader=class extends je{constructor(e){super(),this.array=e,this.size=e.length}readUint8Array(e,t){return this.array.slice(e,e+t)}},e.Uint8ArrayWriter=class extends Xe{constructor(){super(),this.array=new d(0)}writeUint8Array(e){super.writeUint8Array(e);const t=this.array;this.array=new d(t.length+e.length),this.array.set(t),this.array.set(e,t.length)}getData(){return this.array}},e.WritableStreamWriter=class extends Xe{constructor(e){super(),this.writableStream=e,this.writer=e.getWriter()}async writeUint8Array(e){return await this.writer.ready,this.writer.write(e)}async getData(){return await this.writer.ready,await this.writer.close(),this.writableStream}},e.Writer=Xe,e.ZipReader=class{constructor(e,t={}){n.assign(this,{reader:e,options:t,config:O})}async*getEntriesGenerator(e={}){const t=this,i=t.reader;if(i.initialized||await i.init(),22>i.size)throw new c(yt);const r=await(async(e,t,n)=>{const i=new d(4);return Pt(i).setUint32(0,101010256,!0),await r(22)||await r(a.min(1048582,n));async function r(t){const r=n-t,a=await qt(e,r,t);for(let e=a.length-22;e>=0;e--)if(a[e]==i[0]&&a[e+1]==i[1]&&a[e+2]==i[2]&&a[e+3]==i[3])return{offset:r+e,buffer:a.slice(e,e+22).buffer}}})(i,0,i.size);if(!r)throw new c(xt);const s=Pt(r);let o=Ot(s,12),l=Ot(s,16),u=Nt(s,8),f=0;if(l==ft||o==ft||65535==u){const e=Pt(await qt(i,r.offset-20,20));if(117853008!=Ot(e,0))throw new c(mt);l=Vt(e,8);let t=await qt(i,l,56),n=Pt(t);const a=r.offset-20-56;if(Ot(n,0)!=_t&&l!=a){const e=l;l=a,f=l-e,t=await qt(i,l,56),n=Pt(t)}if(Ot(n,0)!=_t)throw new c(kt);u=Vt(n,32),o=Vt(n,40),l-=o}if(0>l||l>=i.size)throw new c(yt);let h=0,_=await qt(i,l,o),p=Pt(_);if(o){const e=r.offset-o;if(Ot(p,h)!=ht&&l!=e){const t=l;l=e,f=l-t,_=await qt(i,l,o),p=Pt(_)}}if(0>l||l>=i.size)throw new c(yt);for(let r=0;u>r;r++){const a=new Dt(i,t.config,t.options);if(Ot(p,h)!=ht)throw new c(vt);Ct(a,p,h+6);const s=!!a.bitFlag.languageEncodingFlag,o=h+46,l=o+a.filenameLength,d=l+a.extraFieldLength,g=Nt(p,h+4),b=0==(0&g);n.assign(a,{versionMadeBy:g,msDosCompatible:b,compressedSize:0,uncompressedSize:0,commentLength:Nt(p,h+32),directory:b&&16==(16&Mt(p,h+38)),offset:Ot(p,h+42)+f,internalFileAttribute:Ot(p,h+34),externalFileAttribute:Ot(p,h+38),rawFilename:_.subarray(o,l),filenameUTF8:s,commentUTF8:s,rawExtraField:_.subarray(l,d)});const y=d+a.commentLength;a.rawComment=_.subarray(d,y);const x=It(t,e,"filenameEncoding"),m=It(t,e,"commentEncoding"),[k,v]=await w.all([pt(a.rawFilename,a.filenameUTF8?Tt:x||Ut),pt(a.rawComment,a.commentUTF8?Tt:m||Ut)]);a.filename=k,a.comment=v,!a.directory&&a.filename.endsWith("/")&&(a.directory=!0),await Bt(a,a,p,h+6);const R=new bt(a);if(R.getData=(e,t)=>a.getData(e,R,t),h=y,e.onprogress)try{e.onprogress(r+1,u,new bt(a))}catch(e){}yield R}return!0}async getEntries(e={}){const t=[],n=this.getEntriesGenerator(e);let i=n.next();for(;!(await i).done;)t.push((await i).value),i=n.next();return t}async close(){}},e.configure=V,e.getMimeType=()=>"application/octet-stream",e.terminateWorkers=()=>{Ie.forEach((e=>{He(e),e.terminate()}))},n.defineProperty(e,"__esModule",{value:!0})}));