@zip.js/zip.js 2.9.0 → 2.11.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (50) hide show
  1. package/README.md +40 -0
  2. package/deno.json +1 -1
  3. package/dist/zip-core-external.js +17 -46
  4. package/dist/zip-core-external.min.js +1 -1
  5. package/dist/zip-core.js +16 -46
  6. package/dist/zip-core.min.js +1 -1
  7. package/dist/zip-fs-core-external.js +170 -88
  8. package/dist/zip-fs-core-external.min.js +1 -1
  9. package/dist/zip-fs-core.js +171 -88
  10. package/dist/zip-fs-core.min.js +1 -1
  11. package/dist/zip-fs-external.js +170 -88
  12. package/dist/zip-fs-external.min.js +1 -1
  13. package/dist/zip-fs-native.js +174 -91
  14. package/dist/zip-fs-native.min.js +1 -1
  15. package/dist/zip-fs.js +175 -92
  16. package/dist/zip-fs.min.js +1 -1
  17. package/dist/zip-legacy.js +18 -48
  18. package/dist/zip-legacy.min.js +1 -1
  19. package/dist/zip-module.wasm +0 -0
  20. package/dist/zip-native.js +19 -49
  21. package/dist/zip-native.min.js +1 -1
  22. package/dist/zip-web-worker-native.js +1 -1
  23. package/dist/zip-web-worker.js +1 -1
  24. package/dist/zip.js +20 -50
  25. package/dist/zip.min.js +1 -1
  26. package/index-native.cjs +174 -91
  27. package/index-native.min.js +1 -1
  28. package/index.cjs +175 -92
  29. package/index.d.cts +92 -44
  30. package/index.d.ts +92 -44
  31. package/index.min.js +1 -1
  32. package/lib/core/codec-pool.js +0 -2
  33. package/lib/core/codec-registry.js +2 -0
  34. package/lib/core/streams/codec-stream.js +0 -2
  35. package/lib/core/streams/common-crypto.js +1 -3
  36. package/lib/core/streams/zip-entry-stream.js +2 -5
  37. package/lib/core/streams/zlib-js/zlib-streams.min.js +1 -1
  38. package/lib/core/streams/zlib-wasm/zlib-streams.js +1 -1
  39. package/lib/core/streams/zlib-wasm/zlib-streams.wasm +0 -0
  40. package/lib/core/util/decode-cp437.js +4 -11
  41. package/lib/core/version.js +1 -1
  42. package/lib/core/web-worker-inline-native.js +1 -1
  43. package/lib/core/web-worker-inline-wasm.js +1 -1
  44. package/lib/core/zip-entry.js +0 -6
  45. package/lib/core/zip-fs.js +155 -44
  46. package/lib/core/zip-reader.js +1 -6
  47. package/lib/core/zip-writer.js +4 -19
  48. package/lib/core/zlib-streams-inline.js +1 -1
  49. package/lib/zip-core-reader.js +0 -1
  50. package/package.json +1 -1
@@ -1 +1 @@
1
- !function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports):"function"==typeof define&&define.amd?define(["exports"],e):e((t="undefined"!=typeof globalThis?globalThis:t||self).zip={})}(this,function(t){"use strict";const{Array:e,Object:n,String:r,Number:o,BigInt:i,Math:s,Date:a,Map:c,Set:u,Response:l,URL:d,Error:f,Uint8Array:w,Uint16Array:p,Uint32Array:h,DataView:m,Blob:y,Promise:S,TextEncoder:g,TextDecoder:b,document:E,crypto:x,btoa:R,TransformStream:z,ReadableStream:F,WritableStream:D,CompressionStream:A,DecompressionStream:C,navigator:I,Worker:k,Symbol:T,setTimeout:v,clearTimeout:_,structuredClone:N}="undefined"!=typeof globalThis?globalThis:this||self;var U=void 0!==E?E.currentScript:null;const O=4294967295,M=65535,L=255,B=67324752,W=134695760,P=W,Z=84233040,H=33639248,V=101010256,G=101075792,j=117853008,q=46,K=22,Y=20,X=56,J=39169,Q=21589,$=6534,tt=30837,et=30805,nt=2048,rt=61440,ot=16384,it=2048,st=1024,at="/",ct=30,ut=new a(2107,11,31,23,59,58),lt=new a(1980,0,1),dt=void 0,ft=1/0,wt="undefined",pt="function",ht="object",mt="string",yt=new w,St="password",gt="rawPassword",bt="passThrough",Et="signal",xt="useWebWorkers",Rt="useCompressionStream",zt="transferStreams",Ft="preventClose",Dt="dataDescriptor",At="offset",Ct="usdz",It="maxAppendedDataSize",kt="signCentralDirectory",Tt="filename",vt="comment",_t="strict",Nt="balanced",Ut="tolerant",Ot="Invalid option (must be a function)",Mt="Invalid signal (must be an AbortSignal instance)",Lt="Invalid password (password must be a string, rawPassword must be a Uint8Array)";function Bt(t){if(t&&typeof t!=pt)throw new f(Ot);return t}function Wt(t){if(t&&(typeof t.addEventListener!=pt||"boolean"!=typeof t.aborted))throw new f(Mt);return t||dt}function Pt(t,e){if(t&&typeof t!=mt||e&&!(e instanceof w))throw new f(Lt)}function Zt(t,e,n){if(!o.isInteger(t)||t<0||t>e)throw new f(n)}function Ht(t,e,n){t!==dt&&Zt(t,e,n)}function Vt(t){return typeof t==mt&&t.trim()?o(t):t}const Gt="Invalid maxWorkers (must be an integer greater than 0)";let jt=2;try{typeof I!=wt&&I.hardwareConcurrency&&(jt=I.hardwareConcurrency)}catch{}const qt={workerURI:"./core/web-worker-wasm.js",wasmURI:"./core/streams/zlib-wasm/zlib-streams.wasm",chunkSize:65536,maxWorkers:jt,terminateWorkerTimeout:5e3,workerStarvationTimeout:5e3,workerStartupTimeout:5e3,useWebWorkers:!0,useCompressionStream:!0,transferStreams:!0,CompressionStream:typeof A!=wt&&A,DecompressionStream:typeof C!=wt&&C},Kt="maxWorkers",Yt=["chunkSize",Kt,"terminateWorkerTimeout","workerStarvationTimeout","workerStartupTimeout"],Xt=["createWorker","CompressionStream","DecompressionStream","CompressionStreamFallback","DecompressionStreamFallback"],Jt=["baseURI","wasmURI","workerURI","useCompressionStream","useWebWorkers","transferStreams",...Yt,...Xt],Qt={...qt};function $t(){return Qt}function te(t){return ee(t.chunkSize)}function ee(t){return t=Vt(t),o.isInteger(t)&&t>=1?s.max(t,64):65536}function ne(t){const e={};for(const n of Jt){const r=t[n];r!==dt&&(e[n]=re(n,r))}return e}function re(t,e){if(Yt.includes(t)){if(e=Vt(e),t==Kt&&(!o.isInteger(e)||e<1))throw new f(Gt)}else Xt.includes(t)&&Bt(e);return e}function oe(t){t=t||{};const{CompressionStreamZlib:e,DecompressionStreamZlib:r}=t;if(e===dt&&r===dt)return t;const o=n.assign({},t);return o.CompressionStreamFallback===dt&&(o.CompressionStreamFallback=e),o.DecompressionStreamFallback===dt&&(o.DecompressionStreamFallback=r),o}function ie(t,e){const n=new w(t.length+e.length);return n.set(t),n.set(e,t.length),n}function se(t){return t.byteOffset||t.byteLength!=t.buffer.byteLength?new w(t):t}function ae(t){return new m(t.buffer,t.byteOffset,t.byteLength)}const ce=[[],[],[],[],[],[],[],[]];for(let t=0;t<256;t++){let e=t;for(let t=0;t<8;t++)e=1&e?e>>>1^3988292384:e>>>1;ce[0][t]=e}for(let t=0;t<256;t++)for(let e=1;e<8;e++){const n=ce[e-1][t];ce[e][t]=n>>>8^ce[0][255&n]}const[ue,le,de,fe,we,pe,he,me]=ce;class ye{constructor(t){this.o=t||-1}append(t){let e=0|this.o;const n=0|t.length;let r=0;if(n>=8&&t.buffer){const o=new m(t.buffer,t.byteOffset,n),i=n-8;for(;r<=i;r+=8){const t=e^o.getInt32(r,!0),n=o.getInt32(r+4,!0);e=me[255&t]^he[t>>>8&255]^pe[t>>>16&255]^we[t>>>24&255]^fe[255&n]^de[n>>>8&255]^le[n>>>16&255]^ue[n>>>24&255]}}for(;r<n;r++)e=e>>>8^ue[255&(e^t[r])];this.o=e}get(){return~this.o}}class Se extends z{constructor(){let t;const e=new ye;super({transform(t,n){e.append(t),n.enqueue(t)},flush(){const n=new w(4);new m(n.buffer).setUint32(0,e.get()),t.value=n}}),t=this}}function ge(t){if(typeof g==wt){t=unescape(encodeURIComponent(t));const e=new w(t.length);for(let n=0;n<e.length;n++)e[n]=t.charCodeAt(n);return e}return(new g).encode(t)}const be={concat(t,e){if(0===t.length||0===e.length)return t.concat(e);const n=t[t.length-1],r=be.l(n);return 32===r?t.concat(e):be.h(e,r,0|n,t.slice(0,t.length-1))},bitLength(t){const e=t.length;if(0===e)return 0;const n=t[e-1];return 32*(e-1)+be.l(n)},m(t,e){if(32*t.length<e)return t;const n=(t=t.slice(0,s.ceil(e/32))).length;return e&=31,n>0&&e&&(t[n-1]=be.S(e,t[n-1]&2147483648>>e-1,1)),t},S:(t,e,n)=>32===t?e:(n?0|e:e<<32-t)+1099511627776*t,l:t=>s.round(t/1099511627776)||32,h(t,e,n,r){for(void 0===r&&(r=[]);e>=32;e-=32)r.push(n),n=0;if(0===e)return r.concat(t);for(let o=0;o<t.length;o++)r.push(n|t[o]>>>e),n=t[o]<<32-e;const o=t.length?t[t.length-1]:0,i=be.l(o);return r.push(be.S(e+i&31,e+i>32?n:r.pop(),1)),r}},Ee={bytes:{R(t){const e=be.bitLength(t)/8,n=new w(e);let r;for(let o=0;o<e;o++)3&o||(r=t[o/4]),n[o]=r>>>24,r<<=8;return n},F(t){const e=[];let n,r=0;for(n=0;n<t.length;n++)r=r<<8|t[n],3&~n||(e.push(r),r=0);return 3&n&&e.push(be.S(8*(3&n),r)),e}}},xe=class{constructor(t){const e=this;e.blockSize=512,e.D=[1732584193,4023233417,2562383102,271733878,3285377520],e.A=[1518500249,1859775393,2400959708,3395469782],t?(e.C=t.C.slice(0),e.I=t.I.slice(0),e.T=t.T):e.reset()}reset(){const t=this;return t.C=t.D.slice(0),t.I=[],t.T=0,t}update(t){const e=this;"string"==typeof t&&(t=Ee.v.F(t));const n=e.I=be.concat(e.I,t),r=e.T,o=e.T=r+be.bitLength(t);if(o>9007199254740991)throw new f("Cannot hash more than 2^53 - 1 bits");const i=new h(n);let s=0;for(let t=e.blockSize+r-(e.blockSize+r&e.blockSize-1);t<=o;t+=e.blockSize)e._(i.subarray(16*s,16*(s+1))),s+=1;return n.splice(0,16*s),e}N(){const t=this;let e=t.I;const n=t.C;e=be.concat(e,[be.S(1,1)]);for(let t=e.length+2;15&t;t++)e.push(0);for(e.push(s.floor(t.T/4294967296)),e.push(0|t.T);e.length;)t._(e.splice(0,16));return t.reset(),n}U(t,e,n,r){return t<=19?e&n|~e&r:t<=39?e^n^r:t<=59?e&n|e&r|n&r:t<=79?e^n^r:void 0}O(t,e){return e<<t|e>>>32-t}_(t){const n=this,r=n.C,o=e(80);for(let e=0;e<16;e++)o[e]=t[e];let i=r[0],a=r[1],c=r[2],u=r[3],l=r[4];for(let t=0;t<=79;t++){t>=16&&(o[t]=n.O(1,o[t-3]^o[t-8]^o[t-14]^o[t-16]));const e=n.O(5,i)+n.U(t,a,c,u)+l+o[t]+n.A[s.floor(t/20)]|0;l=u,u=c,c=n.O(30,a),a=i,i=e}r[0]=r[0]+i|0,r[1]=r[1]+a|0,r[2]=r[2]+c|0,r[3]=r[3]+u|0,r[4]=r[4]+l|0}},Re={importKey:t=>new Re.M(Ee.bytes.F(t)),L(t,e,n,r){if(n=n||1e4,r<0||n<0)throw new f("invalid params to pbkdf2");const o=1+(r>>5)<<2;let i,s,a,c,u;const l=new ArrayBuffer(o),d=new m(l);let w=0;const p=be;for(e=Ee.bytes.F(e),u=1;w<(o||1);u++){for(i=s=t.encrypt(p.concat(e,[u])),a=1;a<n;a++)for(s=t.encrypt(s),c=0;c<s.length;c++)i[c]^=s[c];for(a=0;w<(o||1)&&a<i.length;a++)d.setInt32(w,i[a]),w+=4}return l.slice(0,r/8)},M:class{constructor(t){const e=this,n=e.B=xe,r=[[],[]];e.W=[new n,new n];const o=e.W[0].blockSize/32;t.length>o&&(t=(new n).update(t).N());for(let e=0;e<o;e++)r[0][e]=909522486^t[e],r[1][e]=1549556828^t[e];e.W[0].update(r[0]),e.W[1].update(r[1]),e.P=new n(e.W[0])}reset(){const t=this;t.P=new t.B(t.W[0]),t.Z=!1}update(t){this.Z=!0,this.P.update(t)}digest(){const t=this,e=t.P.N(),n=new t.B(t.W[1]).update(e).N();return t.reset(),n}encrypt(t){if(this.Z)throw new f("encrypt on already updated hmac called!");return this.update(t),this.digest(t)}}},ze=typeof x!=wt&&typeof x.getRandomValues==pt,Fe="Invalid password",De="Invalid signature",Ae=De,Ce="zipjs-abort-check-password",Ie="Crypto API not supported";function ke(t){if(ze)return x.getRandomValues(t);throw new f(Ie)}const Te=16,ve={name:"PBKDF2"},_e=n.assign({hash:{name:"HMAC"}},ve),Ne=n.assign({iterations:1e3,hash:{name:"SHA-1"}},ve),Ue=["deriveBits"],Oe=[8,12,16],Me=[16,24,32],Le=10,Be=[0,0,0,0],We=typeof x!=wt,Pe=We&&x.subtle,Ze=We&&typeof Pe!=wt,He=Ee.bytes,Ve=class{constructor(t){const e=this;e.H=[[[],[],[],[],[]],[[],[],[],[],[]]],e.H[0][0][0]||e.V();const n=e.H[0][4],r=e.H[1],o=t.length;let i,s,a,c=1;if(4!==o&&6!==o&&8!==o)throw new f("invalid aes key size");for(e.A=[s=t.slice(0),a=[]],i=o;i<4*o+28;i++){let t=s[i-1];(i%o===0||8===o&&i%o===4)&&(t=n[t>>>24]<<24^n[t>>16&255]<<16^n[t>>8&255]<<8^n[255&t],i%o===0&&(t=t<<8^t>>>24^c<<24,c=c<<1^283*(c>>7))),s[i]=s[i-o]^t}for(let t=0;i;t++,i--){const e=s[3&t?i:i-4];a[t]=i<=4||t<4?e:r[0][n[e>>>24]]^r[1][n[e>>16&255]]^r[2][n[e>>8&255]]^r[3][n[255&e]]}}encrypt(t){return this.G(t,0)}decrypt(t){return this.G(t,1)}V(){const t=this.H[0],e=this.H[1],n=t[4],r=e[4],o=[],i=[];let s,a,c,u;for(let t=0;t<256;t++)i[(o[t]=t<<1^283*(t>>7))^t]=t;for(let l=s=0;!n[l];l^=a||1,s=i[s]||1){let i=s^s<<1^s<<2^s<<3^s<<4;i=i>>8^255&i^99,n[l]=i,r[i]=l,u=o[c=o[a=o[l]]];let d=16843009*u^65537*c^257*a^16843008*l,f=257*o[i]^16843008*i;for(let n=0;n<4;n++)t[n][l]=f=f<<24^f>>>8,e[n][i]=d=d<<24^d>>>8}for(let n=0;n<5;n++)t[n]=t[n].slice(0),e[n]=e[n].slice(0)}G(t,e){if(4!==t.length)throw new f("invalid aes block size");const n=this.A[e],r=n.length/4-2,o=[0,0,0,0],i=this.H[e],s=i[0],a=i[1],c=i[2],u=i[3],l=i[4];let d,w,p,h=t[0]^n[0],m=t[e?3:1]^n[1],y=t[2]^n[2],S=t[e?1:3]^n[3],g=4;for(let t=0;t<r;t++)d=s[h>>>24]^a[m>>16&255]^c[y>>8&255]^u[255&S]^n[g],w=s[m>>>24]^a[y>>16&255]^c[S>>8&255]^u[255&h]^n[g+1],p=s[y>>>24]^a[S>>16&255]^c[h>>8&255]^u[255&m]^n[g+2],S=s[S>>>24]^a[h>>16&255]^c[m>>8&255]^u[255&y]^n[g+3],g+=4,h=d,m=w,y=p;for(let t=0;t<4;t++)o[e?3&-t:t]=l[h>>>24]<<24^l[m>>16&255]<<16^l[y>>8&255]<<8^l[255&S]^n[g++],d=h,h=m,m=y,y=S,S=d;return o}},Ge=class{constructor(t,e){this.j=t,this.K=e,this.Y=e}reset(){this.Y=this.K}update(t){return this.X(this.j,t,this.Y)}J(t){if(255&~(t>>24))t+=1<<24;else{let e=t>>16&255,n=t>>8&255,r=255&t;255===e?(e=0,255===n?(n=0,255===r?r=0:++r):++n):++e,t=0,t+=e<<16,t+=n<<8,t+=r}return t}$(t){0===(t[0]=this.J(t[0]))&&(t[1]=this.J(t[1]))}X(t,e,n){let r;if(!(r=e.length))return[];const o=be.bitLength(e);for(let o=0;o<r;o+=4){this.$(n);const r=t.encrypt(n);e[o]^=r[0],e[o+1]^=r[1],e[o+2]^=r[2],e[o+3]^=r[3]}return be.m(e,o)}},je=Re.M;let qe=We&&Ze&&typeof Pe.importKey==pt,Ke=We&&Ze&&typeof Pe.deriveBits==pt;class Ye extends z{constructor({password:t,rawPassword:e,encryptionStrength:n,checkPasswordOnly:r,checkAuthenticationCode:o=!0}){super({start(){Je(this,t,e,n)},async transform(t,e){const n=this,{password:o,strength:i,et:s,ready:a}=n;o?(await async function(t,e,n,r){const o=await $e(t,e,n,en(r,0,Oe[e])),i=en(r,Oe[e]);if(o[0]!=i[0]||o[1]!=i[1])throw new f(Fe)}(n,i,o,en(t,0,Oe[i]+2)),t=en(t,Oe[i]+2),r?e.error(new f(Ce)):s()):await a;const c=new w(t.length-Le-(t.length-Le)%Te);e.enqueue(Qe(n,t,c,0,Le,!0))},async flush(t){const{nt:e,ot:n,it:r,ready:i}=this;if(n&&e){await i;const s=en(r,0,r.length-Le),a=en(r,r.length-Le);let c=yt;if(s.length){const t=rn(He,s);n.update(t);const r=e.update(t);c=nn(He,r)}const u=en(nn(He,n.digest()),0,Le);let l=r.length<Le?1:0;for(let t=0;t<Le;t++)l|=u[t]^a[t];if(l&&o)throw new f(Ae);t.enqueue(c)}}})}}class Xe extends z{constructor({password:t,rawPassword:e,encryptionStrength:n}){super({start(){Je(this,t,e,n)},async transform(t,e){const n=this,{password:r,strength:o,et:i,ready:s}=n;let a=yt;r?(a=await async function(t,e,n){const r=ke(new w(Oe[e]));return ie(r,await $e(t,e,n,r))}(n,o,r),i()):await s;const c=new w(a.length+t.length-t.length%Te);c.set(a,0),e.enqueue(Qe(n,t,c,a.length,0))},async flush(t){const{nt:e,ot:n,it:r,ready:o}=this;if(n&&e){await o;let i=yt;if(r.length){const t=e.update(rn(He,r));n.update(t),i=nn(He,t)}const s=nn(He,n.digest()).slice(0,Le);t.enqueue(ie(i,s))}}})}}function Je(t,e,r,o){n.assign(t,{ready:new S(e=>t.et=e),password:tn(e,r),strength:o-1,it:yt})}function Qe(t,e,n,r,o,i){const{nt:s,ot:a,it:c}=t;c.length&&(e=ie(c,e));const u=e.length-o;let l;for(n=function(t,e){if(e&&e>t.length){const n=t;(t=new w(e)).set(n,0)}return t}(n,r+(u-u%Te)),l=0;l<=u-Te;l+=Te){const t=rn(He,en(e,l,l+Te));i&&a.update(t);const o=s.update(t);i||a.update(o),n.set(nn(He,o),l+r)}return t.it=en(e,l),n}async function $e(t,r,o,i){t.password=null;const s=await async function(t,e,n,r,o){if(!qe)return Re.importKey(e);try{return await Pe.importKey("raw",e,n,!1,o)}catch{return qe=!1,Re.importKey(e)}}(0,o,_e,0,Ue),a=await async function(t,e,n){if(!Ke)return Re.L(e,t.salt,Ne.iterations,n);try{return await Pe.deriveBits(t,e,n)}catch{return Ke=!1,Re.L(e,t.salt,Ne.iterations,n)}}(n.assign({salt:i},Ne),s,8*(2*Me[r]+2)),c=new w(a),u=rn(He,en(c,0,Me[r])),l=rn(He,en(c,Me[r],2*Me[r])),d=en(c,2*Me[r]);return n.assign(t,{keys:{key:u,st:l,passwordVerification:d},nt:new Ge(new Ve(u),e.from(Be)),ot:new je(l)}),d}function tn(t,e){return e===dt?ge(t):e}function en(t,e,n){return t.subarray(e,n)}function nn(t,e){return t.R(e)}function rn(t,e){return t.F(e)}class on extends z{constructor({password:t,rawPassword:e,passwordVerification:n,checkPasswordOnly:r}){super({start(){an(this,t,e,n)},transform(t,e){const n=this;if(n.password||n.rawPassword){const e=cn(n,t.subarray(0,12));if(n.password=n.rawPassword=null,0!=(e[11]^n.passwordVerification))throw new f(Fe);t=t.subarray(12)}r?e.error(new f(Ce)):e.enqueue(cn(n,t))}})}}class sn extends z{constructor({password:t,rawPassword:e,passwordVerification:n}){super({start(){an(this,t,e,n)},transform(t,e){const n=this;let r,o;if(n.password||n.rawPassword){n.password=n.rawPassword=null;const e=ke(new w(12));e[11]=n.passwordVerification,r=new w(t.length+e.length),r.set(un(n,e),0),o=12}else r=new w(t.length),o=0;r.set(un(n,t),o),e.enqueue(r)}})}}function an(t,e,r,o){n.assign(t,{password:e,rawPassword:r,passwordVerification:o}),function(t,e,r){const o=[305419896,591751049,878082192];if(n.assign(t,{keys:o,ct:new ye(o[0]),ut:new ye(o[2])}),r)for(let e=0;e<r.length;e++)ln(t,r[e]);else for(let n=0;n<e.length;n++)ln(t,e.charCodeAt(n))}(t,e,r)}function cn(t,e){const n=new w(e.length);for(let r=0;r<e.length;r++)n[r]=dn(t)^e[r],ln(t,n[r]);return n}function un(t,e){const n=new w(e.length);for(let r=0;r<e.length;r++)n[r]=dn(t)^e[r],ln(t,e[r]);return n}function ln(t,e){let[,n]=t.keys;t.ct.append([e]);const r=~t.ct.get();n=wn(s.imul(wn(n+fn(r)),134775813)+1),t.ut.append([n>>>24]);const o=~t.ut.get();t.keys=[r,n,o]}function dn(t){const e=2|t.keys[2];return fn(s.imul(e,1^e)>>>8)}function fn(t){return 255&t}function wn(t){return 4294967295&t}function pn(t){if(t instanceof F)return t;const e=t.getReader();return new F({async pull(t){const{value:n,done:r}=await e.read();r?t.close():t.enqueue(n)},cancel:t=>e.cancel(t)})}function hn(t,e){t=pn(t);const n=e?{type:e}:{};if(typeof y.prototype.stream!=pt||new y([]).stream()instanceof F)return new l(t).blob().then(t=>e?new y([t],n):t);const r=[];return t.pipeTo(new D({write(t){r.push(t)}})).then(()=>new y(r,n))}function mn(t){if(t instanceof D)return t;const e=t.getWriter();return new D({write:t=>e.write(t),close:()=>e.close(),abort:t=>e.abort(t)})}const yn="Invalid codec definition",Sn="Reserved compression method",gn="Invalid codec module",bn=[0,8,9,99],En=new c,xn=new c;function Rn(t){return En.get(t)}function zn(){return e.from(En.values(),t=>n.assign({},t,xn.get(t.format)))}function Fn(t){return xn.get(t)}function Dn(t,e){const{CompressionStream:n,DecompressionStream:r}=e;if(typeof n!=pt&&typeof r!=pt)throw new f(gn);xn.set(t,{CompressionStream:n,DecompressionStream:r})}const An="Invalid uncompressed size",Cn="Invalid compressed data",In=De,kn="deflate-raw",Tn="deflate64-raw",vn="gzip",_n=[31,139,8];class Nn extends z{constructor(t,{chunkSize:e,CompressionStreamFallback:n,CompressionStream:r}){super({});const{compressed:o,encrypted:i,useCompressionStream:s,zipCrypto:a,computeCrc32:c,level:u,deflate64:l,format:d,compressionMethod:f,inputSize:w}=t,p=this;let h,y,S,g=super.readable;const b=d&&Fn(d),E=c&&o&&!l&&!b&&(!i||a)&&Boolean(s&&r);if(i&&!a||!c||E||(h=new Se,g=Hn(g,h)),o)if(b)g=Vn(g,Pn(b.CompressionStream,d,{level:u,chunkSize:e,compressionMethod:f,uncompressedSize:w}));else if(E)S=new Un,g=Vn(g,new r(vn)),g=Hn(g,S);else try{g=Zn(g,s,{level:u,chunkSize:e},r,n)}catch(t){let e;try{e=new r(vn)}catch{throw t}g=Vn(g,e),g=Hn(g,new Un)}i&&(a?g=Hn(g,new sn(t)):(y=new Xe(t),g=Hn(g,y))),Wn(p,g,()=>{i&&!a||!c||(p.crc32=E?S.crc32:new m(h.value.buffer).getUint32(0))})}}class Un extends z{constructor(){let t,e=10,n=new w(0);super({transform(t,r){if(e){const n=s.min(e,t.length);if(e-=n,!(t=t.subarray(n)).length)return}const o=n.length+t.length;if(o<=8)return void(n=ie(n,t));const i=o-8,a=s.min(i,n.length);r.enqueue(ie(n.subarray(0,a),t.subarray(0,i-a))),n=ie(n.subarray(a),t.subarray(i-a))},flush(){const e=ae(n);t.crc32=e.getUint32(0,!0),t.uncompressedSize=e.getUint32(4,!0)}}),t=this}}class On extends z{constructor(t,{chunkSize:e,DecompressionStreamFallback:n,DecompressionStream:r}){super({});const{zipCrypto:o,encrypted:i,checkCrc32:s,crc32:a,compressed:c,useCompressionStream:u,deflate64:l,format:d,compressionMethod:p,rawBitFlag:h,outputSize:y}=t;let g,b,E=super.readable;if(i&&(o?E=Hn(E,new on(t)):(b=new Ye(t),E=Hn(E,b))),c){const t=d&&Fn(d);if(t)E=Vn(E,Pn(t.DecompressionStream,d,{chunkSize:e,compressionMethod:p,rawBitFlag:h,uncompressedSize:y}));else try{E=Zn(E,u,{chunkSize:e,deflate64:l},r,n)}catch(t){if(l||y===dt)throw t;let e;try{e=new r(vn)}catch{throw t}E=function(t,e,n){const r=new ye;let o,i,s,a=0,c=!1;const u=new S((t,e)=>{i=t,s=e});u.catch(()=>{}),n||i();const l=new z({start(t){const e=new w(10);e.set(_n),t.enqueue(e)},transform(t,e){e.enqueue(t)},async flush(t){c=!0,p();try{await u}finally{h()}const e=new w(8),o=ae(e);o.setUint32(0,r.get(),!0),o.setUint32(4,n,!0),t.enqueue(e)},cancel(t){s(t)}}),d=new z({transform(t,e){r.append(t),a+=t.length,a>=n?i():c&&p(),e.enqueue(t)},cancel(t){s(t)}});return t=Hn(t,l),Hn(t=Vn(t,e),d);function p(){h(),o=v(()=>s(new f(An)),5e3)}function h(){_(o)}}(E,e,y)}E=function(t){const e=t.getReader();return new F({async pull(t){let n;try{n=await e.read()}catch(t){if(t&&t.message)throw t;const e=new f(Cn);throw e.cause=t,e}const{value:r,done:o}=n;o?t.close():t.enqueue(r)},cancel:t=>e.cancel(t)})}(E)}s&&(g=new Se,E=Hn(E,g)),Wn(this,E,()=>{if(s){const t=new m(g.value.buffer);if(a!=t.getUint32(0,!1))throw new f(In)}})}}const Mn=new c;function Ln(t,e){if(!t)return!1;let n=Mn.get(t);n||(n=new c,Mn.set(t,n));let r=n.get(e);if(r===dt){try{new t(e),r=!0}catch{r=!1}n.set(e,r)}return r}function Bn(t){return Ln(t,kn)}function Wn(t,e,r){e=Hn(e,new z({flush:r})),n.defineProperty(t,"readable",{get:()=>e})}function Pn(t,e,n){if(!t)throw new f("Compression method not supported");return new t(e,n)}function Zn(t,e,n,r,o){const i=e&&r?r:o||r,s=n.deflate64?Tn:kn;let a;try{a=new i(s,n)}catch(t){if(!e||!o||i==o)throw t;a=new o(s,n)}return Vn(t,a)}function Hn(t,e){return pn(t).pipeThrough(e)}function Vn(t,e){const n=e.writable.getWriter(),r=t.getReader();return async function(){try{for(;;){await n.ready;const t=await r.read();if(t.done){await n.close();break}await n.write(t.value)}}catch(t){await async function(t,e){try{await t.abort(e)}catch{}}(n,t),await async function(t,e){try{await t.cancel(e)}catch{}}(r,t)}}(),e.readable}const Gn="data",jn="deflate",qn="inflate";class Kn extends z{constructor(t,e){super({});const r=this,{codecType:o}=t;let i;o.startsWith(jn)?i=Nn:o.startsWith(qn)&&(i=On),r.outputSize=0;let s=0;const a=new i(t,e),c=super.readable,u=new z({transform(t,e){t&&t.length&&(s+=t.length,e.enqueue(t))},flush(){n.assign(r,{inputSize:s})}}),l=new z({transform(e,n){if(e&&e.length&&(n.enqueue(e),r.outputSize+=e.length,t.outputSize!==dt&&r.outputSize>t.outputSize))throw new f(An)},flush(){const{crc32:t}=a;n.assign(r,{crc32:t,inputSize:s})}});n.defineProperty(r,"readable",{get:()=>c.pipeThrough(u).pipeThrough(a).pipeThrough(l)})}}class Yn extends z{constructor(t){const e=[];let n=0;function r(){const r=new w(t);let o=0;for(;o<t;){const n=e[0],i=t-o;n.length<=i?(r.set(n,o),o+=n.length,e.shift()):(r.set(n.subarray(0,i),o),e[0]=n.subarray(i),o+=i)}return n-=t,r}(!o.isFinite(t)||t<1)&&(t=65536),super({transform(o,i){for(e.push(o),n+=o.length;n>t;)i.enqueue(r())},flush(t){n&&t.enqueue(function(t,e){const n=new w(e);let r=0;for(const e of t)n.set(e,r),r+=e.length;return n}(e,n))}})}}const Xn="Worker startup timeout";let Jn,Qn,$n;async function tr(t){const{CompressionStream:e,CompressionStreamFallback:n}=t;if(n&&!n.lt)return!0;if(Bn(e)||Ln(e,vn))return!0;if(n)try{return await void 0,!0}catch{return!1}return!1}function er(t){t.createWorker?Qn=!0:Jn=!1}class nr{constructor(t,{readable:e,writable:r},{options:o,config:i,ft:s,useWebWorkers:a,transferStreams:c,workerURI:u,createWorker:l},d){const{signal:f}=s;return Qn&&(l=dt),n.assign(t,{wt:!0,ht:(t.ht||0)+1,readable:e.pipeThrough(new Yn(te(i))).pipeThrough(new rr(s),{signal:f}),writable:r,options:n.assign({},o),workerURI:u,createWorker:l,transferStreams:c,terminate:()=>new S(e=>{const{yt:n,wt:r}=t;n?(r?t.St=e:(n.terminate(),e()),t.gt=null):e()}),bt(){if(t.wt){const{St:e}=t;e&&(t.St=null,t.Et=!0,t.yt.terminate(),e()),t.wt=!1,d(t)}}}),Jn===dt&&(Jn=typeof k!=wt),(a&&$n&&(Jn&&u||l)?$n:ir)(t,i)}}class rr extends z{constructor({onstart:t,onprogress:e,size:n,onend:r}){let o=0;super({async start(){t&&await or(t,n)},async transform(t,r){o+=t.length,e&&await or(e,o,n),r.enqueue(t)},async flush(){r&&await or(r,o)}})}}async function or(t,...e){try{await t(...e)}catch{}}function ir(t,e){return{run:()=>sr(t,e)}}async function sr({options:t,readable:e,writable:n,bt:r},o){let i;try{if(t.compressed&&!t.format){const e=t.codecType.startsWith(jn),n=e?o.CompressionStreamFallback:o.DecompressionStreamFallback,r=e?o.CompressionStream:o.DecompressionStream;if(t.useCompressionStream){if(n&&n.lt&&!Bn(r))try{await void 0}catch{}}else try{await void 0}catch{n&&!n.lt||(t.useCompressionStream=!0)}}i=new Kn(t,o),await e.pipeThrough(i).pipeThrough(new Yn(te(o))).pipeTo(n,{preventClose:!0,preventAbort:!0});const{crc32:r,inputSize:s,outputSize:a}=i;return{crc32:r,inputSize:s,outputSize:a}}catch(t){throw i&&(t.outputSize=i.outputSize),t}finally{r()}}const ar={type:"module"},cr="error";let ur,lr,dr,fr=!0;try{fr=typeof N==pt&&N(new DOMException("","AbortError")).code!==dt}catch{}var wr;function pr(t){const{reader:e}=t;e&&e.releaseLock(),t.reader=null,t.writer=null}function hr(t){const{yt:e}=t;if(e)try{e.terminate()}catch{}t.gt=null}function mr(t,e,r,o,i=!0){const{createWorker:s}=r;let a,c,u;if(s)a=s();else if(lr===dt||ur!==t){const n=typeof t==pt;c=n?t(i):t;const s=c.startsWith("data:"),l=c.startsWith("blob:");if(s||l){o===dt&&(o=!1),o&&(u=ar);try{a=new k(c,u)}catch(i){if(l)try{d.revokeObjectURL(c)}catch{}if(n&&l)return mr(t,e,r,o,!1);if(o)throw i;return mr(t,e,r,!0,!1)}}else{o===dt&&(o=!0),o&&(u=ar);try{c=new d(c,e)}catch{}try{a=new k(c,u)}catch(n){if(o)return mr(t,e,r,!1,i);throw n}}ur=t,lr=c,dr=u}else a=new k(lr,dr);return a.addEventListener("message",t=>{r.xt=!0,yr(r),async function({data:t},e){const{type:r,value:o,messageId:i,result:s,error:a}=t,{reader:c,writer:u,Rt:l,zt:d,bt:p,ht:h}=e,m=()=>e.ht!=h;try{if(a){const{message:t,stack:e,code:r,name:o,outputSize:i,cause:s,codecImportFailed:c}=a,u=new f(t);n.assign(u,{stack:e,code:r,name:o,outputSize:i}),s&&(u.cause=n.assign(new f(s.message),{name:s.name})),c&&(u.codecImportFailed=!0),y(u)}else{if("pull"==r){const{value:t,done:n}=await c.read();m()||gr({type:Gn,value:t,done:n,messageId:i},e)}r==Gn&&(await u.ready,await u.write(new w(o)),m()||gr({type:"ack",messageId:i},e)),"close"==r&&y(null,s)}}catch(a){m()||(hr(e),y(a))}function y(t,e){m()||(t?d(t):l(e),u&&u.releaseLock(),t&&t.codecImportFailed||p())}}(t,r)}),a.addEventListener(cr,t=>Sr(t,r)),a.addEventListener("messageerror",t=>Sr(t,r)),a}function yr(t){const{Ft:e}=t;e&&(_(e),t.Ft=null)}function Sr(t,e){t.preventDefault&&t.preventDefault(),yr(e);const{xt:r,zt:o,writer:i,bt:s}=e;hr(e),r||(e.yt=null);let a=t.error||new f(t.message||cr);r||(a=n.assign(new f(a.message||cr),{Dt:!0}),e.At=a),o&&(o(a),i&&i.releaseLock(),r&&s())}function gr(t,{yt:e,writer:n,transferStreams:r,xt:o}){try{const{value:n,readable:i,writable:s}=t,a=[];if(n&&(t.value=se(n),a.push(t.value.buffer)),r&&fr&&o?(i&&a.push(i),s&&a.push(s)):t.readable=t.writable=null,a.length)try{return e.postMessage(t,a),!0}catch{fr=!1,t.readable=t.writable=null,e.postMessage(t)}else e.postMessage(t)}catch(t){throw n&&n.releaseLock(),t}}wr=function(t,e){const{baseURI:r,chunkSize:i,workerStartupTimeout:s}=e;let{wasmURI:a}=e;if(!t.gt){let c;typeof a==pt&&(a=a());try{c=mr(t.workerURI,r,t)}catch{return er(t),ir(t,e)}n.assign(t,{yt:c,xt:!1,Et:!1,At:null,gt:{run:async()=>{try{return await async function(t,e){if(!t.yt){const{At:e}=t;t.At=null;const n=e||new f(Xn);throw n.Dt=!0,n}let r,i;const s=new S((t,e)=>{r=t,i=e});n.assign(t,{reader:null,writer:null,Rt:r,zt:i,result:s});const{readable:a,options:c}=t,{writable:u,closed:l,Ct:d}=function(t){const e=new AbortController,{writable:n,readable:r}=new z,o=r.pipeTo(t,{preventClose:!0,preventAbort:!0,signal:e.signal});return o.catch(()=>{}),{writable:n,closed:o,Ct:()=>e.abort()}}(t.writable);let w;try{w=gr({type:"start",options:c,config:e,readable:a,writable:u},t)}catch(e){d();try{await l}catch{}throw t.bt(),e}w||n.assign(t,{reader:a.getReader(),writer:u.getWriter()});const{workerStartupTimeout:p}=e;!t.xt&&o.isFinite(p)&&p>=0&&(t.Ft=v(()=>function(t){if(t.Ft=null,t.xt)return;const{zt:e,writer:n}=t;if(hr(t),t.yt=null,e){const t=new f(Xn);t.Dt=!0,e(t),n&&n.releaseLock()}}(t),p));try{const t=await s;return await h(),await l,t}catch(t){await h(),d();try{await l}catch{}throw t}async function h(){if(!w&&!u.locked)try{await u.getWriter().close()}catch{}}}(t,{chunkSize:i,wasmURI:a,baseURI:r,workerStartupTimeout:s})}catch(n){if(n&&n.Dt)return er(t),pr(t),sr(t,e);if(n&&n.codecImportFailed){if(t.reader)return pr(t),sr(t,e);t.bt()}throw n}}}})}return t.gt},$n=wr;let br=[];const Er=[];let xr,Rr,zr=0;async function Fr(t,e){const{options:n,config:r}=e,{transferStreams:i,useWebWorkers:s,useCompressionStream:a,compressed:c,checkCrc32:u,computeCrc32:l,encrypted:f,format:w,codecURI:p}=n,{workerURI:h,createWorker:m,maxWorkers:y}=r;w&&(p&&(n.codecURI=function(t,e){try{return new d(t,e).toString()}catch{return t}}(p,r.baseURI)),await async function(t,e){!xn.has(t)&&e&&Dn(t,await(import(/* webpackIgnore: true */ /* @vite-ignore */e)))}(w,n.codecURI)),e.transferStreams=!w&&(i||i===dt&&r.transferStreams);const g=!(c||u||l||f),b=w===dt||Boolean(n.codecURI);return e.useWebWorkers=!g&&b&&(s||s===dt&&r.useWebWorkers),e.workerURI=e.useWebWorkers&&h?h:dt,e.createWorker=e.useWebWorkers&&m?m:dt,n.useCompressionStream=a||a===dt&&r.useCompressionStream,(await async function(){const n=br.find(t=>!t.wt);if(n)return kr(n),new nr(n,t,e,E);if(br.length<y){const n={It:zr};return zr++,br.push(n),new nr(n,t,e,E)}return new S(n=>{Er.push({resolve:n,stream:t,kt:e}),Rr=r.workerStarvationTimeout,Dr()})}()).run();function E(t){if(Ar(),Er.length){const[{resolve:e,stream:n,kt:r}]=Er.splice(0,1);e(new nr(t,n,r,E)),Dr()}else t.yt?(kr(t),function(t,e){const{config:n}=e,{terminateWorkerTimeout:r}=n;o.isFinite(r)&&r>=0&&(t.Et?t.Et=!1:t.Tt=v(async()=>{br=br.filter(e=>e!=t);try{await t.terminate()}catch{}},r))}(t,e)):br=br.filter(e=>e!=t)}}function Dr(){!xr&&Er.length&&o.isFinite(Rr)&&Rr>=0&&(xr=v(Cr,Rr))}function Ar(){xr&&(_(xr),xr=null)}function Cr(){if(xr=null,Er.length){const[{resolve:t,stream:e,kt:r}]=Er.splice(0,1),o=n.assign({},r,{useWebWorkers:!1,workerURI:dt,createWorker:dt});t(new nr({},e,o,Ir)),Dr()}}function Ir(){Ar(),Dr()}function kr(t){const{Tt:e}=t;e&&(_(e),t.Tt=null)}const Tr="\0\u263a\u263b\u2665\u2666\u2663\u2660\u2022\u25d8\u25cb\u25d9\u2642\u2640\u266a\u266b\u263c\u25ba\u25c4\u2195\u203c\xb6\xa7\u25ac\u21a8\u2191\u2193\u2192\u2190\u221f\u2194\u25b2\u25bc !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~\u2302\xc7\xfc\xe9\xe2\xe4\xe0\xe5\xe7\xea\xeb\xe8\xef\xee\xec\xc4\xc5\xc9\xe6\xc6\xf4\xf6\xf2\xfb\xf9\xff\xd6\xdc\xa2\xa3\xa5\u20a7\u0192\xe1\xed\xf3\xfa\xf1\xd1\xaa\xba\xbf\u2310\xac\xbd\xbc\xa1\xab\xbb\u2591\u2592\u2593\u2502\u2524\u2561\u2562\u2556\u2555\u2563\u2551\u2557\u255d\u255c\u255b\u2510\u2514\u2534\u252c\u251c\u2500\u253c\u255e\u255f\u255a\u2554\u2569\u2566\u2560\u2550\u256c\u2567\u2568\u2564\u2565\u2559\u2558\u2552\u2553\u256b\u256a\u2518\u250c\u2588\u2584\u258c\u2590\u2580\u03b1\xdf\u0393\u03c0\u03a3\u03c3\xb5\u03c4\u03a6\u0398\u03a9\u03b4\u221e\u03c6\u03b5\u2229\u2261\xb1\u2265\u2264\u2320\u2321\xf7\u2248\xb0\u2219\xb7\u221a\u207f\xb2\u25a0\xa0".split(""),vr=256==Tr.length;function _r(t,e){return Nr(t,e,!0)}function Nr(t,e,n){return e&&"cp437"==e.trim().toLowerCase()?function(t){if(vr){let e="";for(let n=0;n<t.length;n++)e+=Tr[t[n]];return e}return(new b).decode(t)}(t):new b(e,{ignoreBOM:n}).decode(t)}const Ur="HTTP error ",Or="HTTP Range not supported",Mr="HTTP resource changed",Lr="Writer iterator completed too soon",Br="Writer not initialized",Wr="Content-Range",Pr="Range",Zr="GET",Hr="bytes",Vr=16777216,Gr="writable",jr=T();class qr{constructor(){this.size=0}init(){this.initialized=!0}}class Kr extends qr{get readable(){return this.createReadable()}createReadable({offset:t=0,size:e,chunkSize:n=te($t())}={}){const r=this;let o=0;return n=ee(n),new F({async pull(i){const a=e===dt?n:s.min(n,e-o),c=await _o(r,t+o,a);c.length&&i.enqueue(c),o+n>=e||!c.length&&a?i.close():o+=n}})}}class Yr extends qr{constructor(){super();const t=this,e=new D({write(e){if(!t.initialized)throw new f(Br);return t.writeUint8Array(se(e))}});n.defineProperty(t,Gr,{get:()=>e})}writeUint8Array(){}}class Xr extends Kr{constructor(t){super();let e=t.length;for(;"="==t.charAt(e-1);)e--;const r=t.indexOf(",")+1;n.assign(this,{vt:t,_t:r,size:s.floor(.75*(e-r))})}readUint8Array(t,e){const{_t:n,vt:r}=this,o=new w(e),i=4*s.floor(t/3),a=atob(r.substring(i+n,4*s.ceil((t+e)/3)+n)),c=t-3*s.floor(i/4);let u=0;for(let t=c;t<c+e&&t<a.length;t++)o[t-c]=a.charCodeAt(t),u++;return u<o.length?o.subarray(0,u):o}}class Jr extends Yr{constructor(t){super(),n.assign(this,{contentType:t,data:"data:"+(t||"")+";base64,",Nt:""})}writeUint8Array(t){const e=this;let n,o=e.Nt;const i=e.Nt.length;for(e.Nt="",n=0;n<3*s.floor((i+t.length)/3)-i;n++)o+=r.fromCharCode(t[n]);for(;n<t.length;n++)e.Nt+=r.fromCharCode(t[n]);o.length>2?e.data+=R(o):e.Nt=o+e.Nt}getData(){return this.data+R(this.Nt)}}let Qr,$r;class to extends Kr{constructor(t){super(),n.assign(this,{Ut:t,size:t.size}),$r||($r=(async()=>{try{const t=new y([new w(3)]).slice(1,2).stream().getReader();let e=0,n=await t.read();for(;!n.done;)e+=n.value.length,n=await t.read();Qr=1==e}catch{Qr=!1}})())}createReadable(t){const{Ut:e,size:n}=this,{offset:r=0,size:o=n-r}=t||{};return!r&&o>=n?pn(e.stream()):Qr?pn(e.slice(r,r+o).stream()):super.createReadable(t)}async readUint8Array(t,e){const n=this,r=t+e,o=!t&&r>=n.size?n.Ut:n.Ut.slice(t,r);let i=await o.arrayBuffer();return i.byteLength>e&&(i=i.slice(t,r)),new w(i)}}class eo extends qr{constructor(t){super();const e=this,r=new z;n.defineProperty(e,Gr,{get:()=>r.writable}),e.contentType=t,e.Ot=hn(r.readable,t),e.Ot.catch(()=>{})}getData(){return this.Ot}}class no extends to{constructor(t){super(new y([t],{type:"text/plain"}))}}function ro(t){let e=0;for(let n=0;n<t.length;n++){const r=t.charCodeAt(n);r<128?e+=1:r<2048?e+=2:r<55296||r>=57344?e+=3:r<56320&&56320==(64512&t.charCodeAt(n+1))?(e+=4,n++):e+=3}return e}class oo extends eo{constructor(t){super(),n.assign(this,{encoding:t,Mt:!t||"utf-8"==t.toLowerCase()})}async getData(){const{encoding:t,Mt:e}=this,n=await super.getData();return n.text&&e?n.text():function(t,e){return Nr(t,e,!1)}(new w(await n.arrayBuffer()),t)}}class io extends Kr{constructor(t,e){super(),ao(this,t,e)}async init(){await co(this,Eo,yo),super.init()}createReadable(t){const e=this,{useRangeHeader:n,forceRangeRequests:r,size:i}=e;if((n||r)&&i!==dt){const{offset:n=0,size:r=i-n}=t||{};if(r>0&&n<i)return function(t,e,n){let r,i=e,a=0,c=n;return new F({start:()=>u(),async pull(t){r||await u();const{value:e,done:n}=await r.read();if(n)throw new f(Or);const o=e.length>a?e.subarray(0,a):e;a-=o.length,c-=o.length,o.length&&t.enqueue(o),a||(await async function(){const t=r;r=dt,await t.cancel()}(),c||t.close())},cancel:t=>r&&r.cancel(t)});async function u(){const e=s.min(t.maximumRangeSize,c),n=await Eo(Zr,t,ho(t,i,e));if(206!=n.status)throw new f(Or);const u=n.headers.get(Wr);if(u){const t=o(u.trim().split(/[\s-]+/)[1]);if(!o.isNaN(t)&&t!=i)throw new f(Or)}po(t,n),wo(t,n),i+=e,a=e,r=n.body.getReader()}}(e,n,s.min(r,i-n))}return super.createReadable(t)}readUint8Array(t,e){return uo(this,t,e,Eo,yo)}}class so extends Kr{constructor(t,e){super(),ao(this,t,e)}async init(){await co(this,xo,So),super.init()}readUint8Array(t,e){return uo(this,t,e,xo,So)}}function ao(t,e,r){const{preventHeadRequest:o,useRangeHeader:i,forceRangeRequests:s,combineSizeEocd:a,checkResourceChanges:c=!0,maximumRangeSize:u=Vr,fetch:l}=r;delete(r=n.assign({},r)).preventHeadRequest,delete r.useRangeHeader,delete r.forceRangeRequests,delete r.combineSizeEocd,delete r.checkResourceChanges,delete r.maximumRangeSize,delete r.useXHR,delete r.fetch,n.assign(t,{url:e,options:r,preventHeadRequest:o,useRangeHeader:i,forceRangeRequests:s,combineSizeEocd:a,checkResourceChanges:c,maximumRangeSize:u,fetch:l})}async function co(t,e,n){const{url:r,preventHeadRequest:o,useRangeHeader:i,forceRangeRequests:s,combineSizeEocd:a}=t;if(function(t){const{baseURI:e}=$t(),{protocol:n}=new d(t,e);return"http:"==n||"https:"==n}(r)&&(i||s)&&(typeof o==wt||o)){const r=await e(Zr,t,ho(t,a?-22:void 0)),o=r.headers.get("Accept-Ranges");if(!(s||o&&o.toLowerCase()==Hr))throw new f(Or);{if(a){const e=new w(await r.arrayBuffer());206==r.status&&e.length==K&&(t.Lt=e)}wo(t,r);const o=lo(r);o===dt?await bo(t,e,n):t.size=o}}else await bo(t,e,n)}async function uo(t,e,n,r,i){const{useRangeHeader:s,forceRangeRequests:a,Lt:c,size:u,options:l}=t;if(s||a){if(c&&e==u-K&&n==K)return c;if(e>=u||0===n)return yt;{e+n>u&&(n=u-e);const i=await r(Zr,t,ho(t,e,n));if(206!=i.status)throw new f(Or);const s=i.headers.get(Wr);if(s){const t=o(s.trim().split(/[\s-]+/)[1]);if(!o.isNaN(t)&&t!=e)throw new f(Or)}po(t,i),wo(t,i);const a=new w(await i.arrayBuffer());if(a.length!=n)throw new f(Or);return a}}{const{data:r}=t;return r||await i(t,l),t.data.subarray(e,e+n)}}function lo(t){const e=t.headers.get(Wr);if(e){const t=e.trim().split(/\s*\/\s*/)[1];if(t&&"*"!=t){const e=o(t);if(!o.isNaN(e))return e}}}function fo({headers:t}){return{Bt:t.get("Etag")||dt,lastModified:t.get("Last-Modified")||dt}}function wo(t,e){const{checkResourceChanges:n,Wt:r}=t;n&&!r&&206==e.status&&(t.Wt=fo(e))}function po(t,e){const{checkResourceChanges:r,Wt:o,size:i}=t;if(r){const t=lo(e);if(t!==dt&&i!==dt&&t!=i)throw new f(Mr);if(o){const t=fo(e);if(n.entries(o).some(([e,n])=>n!==dt&&t[e]!==dt&&n!=t[e]))throw new f(Mr)}}}function ho(t,e=0,r=1){return n.assign({},mo(t),{[Pr]:Hr+"="+(e<0?e:e+"-"+(e+r-1))})}function mo({options:t}){const{headers:e}=t;if(e)return T.iterator in e?n.fromEntries(e):e}async function yo(t){await go(t,Eo)}async function So(t){await go(t,xo)}async function go(t,e){const n=await e(Zr,t,mo(t));t.data=new w(await n.arrayBuffer()),t.size=t.data.length}async function bo(t,e,n){if(t.preventHeadRequest)await n(t,t.options);else{const r=await e("HEAD",t,mo(t)),i=r.headers.get("Content-Length");i&&!r.headers.get("Content-Encoding")?t.size=o(i):await n(t,t.options)}}async function Eo(t,{fetch:e=fetch,options:r,url:o},i){const s=await e(o,n.assign({},r,{method:t,headers:i}));if(s.status<400)return s;throw 416==s.status?new f(Or):new f(Ur+(s.statusText||s.status))}function xo(t,{url:e},r){return new S((o,i)=>{const s=new XMLHttpRequest;if(s.addEventListener("load",()=>{if(s.status<400){const t=[];s.getAllResponseHeaders().trim().split(/[\r\n]+/).forEach(e=>{const n=e.trim().split(/\s*:\s*/);n[0]=n[0].trim().replace(/^[a-z]|-[a-z]/g,t=>t.toUpperCase()),t.push(n)}),o({status:s.status,arrayBuffer:()=>s.response,headers:new c(t)})}else i(416==s.status?new f(Or):new f(Ur+(s.statusText||s.status)))},!1),s.addEventListener("error",t=>i(t.detail?t.detail.error:new f("Network error")),!1),s.open(t,e),r)for(const t of n.entries(r))s.setRequestHeader(t[0],t[1]);s.responseType="arraybuffer",s.send()})}class Ro extends Kr{constructor(t,e={}){super(),n.assign(this,{url:t,reader:e.useXHR&&!e.fetch?new so(t,e):new io(t,e)})}set size(t){}get size(){return this.reader.size}async init(){await this.reader.init(),super.init()}createReadable(t){return this.reader.createReadable(t)}readUint8Array(t,e){return this.reader.readUint8Array(t,e)}}class zo extends Kr{constructor(t){super(),t=new w(t.buffer,t.byteOffset,t.byteLength),n.assign(this,{Pt:t,size:t.length})}readUint8Array(t,e){return this.Pt.slice(t,t+e)}}class Fo extends Yr{constructor(t){super(),this.Zt=t||262144}init(t=0){n.assign(this,{offset:0,Pt:new w(t>0?t:this.Zt)}),super.init()}writeUint8Array(t){const e=this,n=e.offset+t.length;if(n>e.Pt.length){let t=e.Pt.length?2*e.Pt.length:e.Zt;for(;t<n;)t*=2;const r=e.Pt;e.Pt=new w(t),e.Pt.set(r)}e.Pt.set(t,e.offset),e.offset+=t.length}getData(){return this.offset===this.Pt.length?this.Pt:this.Pt.slice(0,this.offset)}}class Do extends Kr{constructor(t){super(),this.Ht=t}async init(){const t=this;t.Vt=0;const e=t.Ht=await S.all(t.Ht.map(vo));t.Gt=e.map(e=>{const n=t.size;return t.size+=e.size,n}),super.init()}jt(t){const{Gt:e,size:n}=this,r=e[t];return r===dt?n:r}async readUint8Array(t,e){const n=this,{Ht:r}=this;let o,i=0,a=t;for(;r[i]&&a>=r[i].size;)a-=r[i].size,i++;const c=r[i];if(c){const r=c.size;if(a+e<=r)o=await _o(c,a,e);else{const i=r-a;o=ie(await _o(c,a,i),await n.readUint8Array(t+i,e-i))}}else o=yt;return n.Vt=s.max(i,n.Vt),o}}class Ao extends qr{constructor(t,e=4294967295){super();const r=this;let o,i,s;n.assign(r,{diskNumber:0,diskOffset:0,size:0,maxSize:e,availableSize:e});const a=new D({async write(e){if(e===jr)return void(s&&await u());const{availableSize:n}=r;if(s)e.length>=n?(await c(e.subarray(0,n)),await u(),e.length>n&&await this.write(e.subarray(n))):await c(e);else{const{value:n,done:a}=await t.next();if(a&&!n)throw new f(Lr);o=n,o.size=0,o.maxSize&&(r.maxSize=o.maxSize),r.availableSize=r.maxSize,await To(o),i=n.writable,s=i.getWriter(),await this.write(e)}},async close(){s&&(await s.ready,await l())},async abort(t){s&&await s.abort(t)}});async function c(t){const e=t.length;e&&(await s.ready,await s.write(t),o.size+=e,r.availableSize-=e)}async function u(){await l(),r.diskOffset+=o.size,r.diskNumber++,s=null,r.availableSize=r.maxSize}async function l(){await s.close()}n.defineProperty(r,Gr,{get:()=>a})}async closeDisk(){const t=this.writable.getWriter();try{await t.ready,await t.write(jr)}finally{t.releaseLock()}}}class Co{constructor(t){return e.isArray(t)&&(t=new Do(t)),(t instanceof F||typeof t.getReader==pt)&&(t={readable:pn(t)}),t}}class Io{constructor(t){return t.writable===dt&&typeof t.next==pt&&(t=new Ao(t)),(t instanceof D||typeof t.getWriter==pt)&&(t={writable:mn(t)}),t.size===dt&&(t.size=0),t}}function ko(t){return Boolean(t&&t.getData)}async function To(t,e){if(!t.init||t.initialized)return S.resolve();await t.init(e)}async function vo(t){return t=new Co(t),await To(t),t.size!==dt&&t.readUint8Array||(t=new to(await hn(t.readable)),await To(t)),t}function _o(t,e,n){return t.readUint8Array(e,n)}function No(t,e){return t.createReadable?t.createReadable(e):t.readUint8Array?Kr.prototype.createReadable.call(t,e):t.readable}const Uo="filename",Oo="rawFilename",Mo="comment",Lo="rawComment",Bo="uncompressedSize",Wo="compressedSize",Po="offset",Zo="diskNumberStart",Ho="lastModDate",Vo="rawLastModDate",Go="lastAccessDate",jo="rawLastAccessDate",qo="creationDate",Ko="rawCreationDate",Yo="internalFileAttributes",Xo="externalFileAttributes",Jo="internalFileAttribute",Qo="externalFileAttribute",$o="msdosAttributesRaw",ti="msdosAttributes",ei="msDosCompatible",ni="zip64",ri="encrypted",oi="version",ii="versionMadeBy",si="zipCrypto",ai="directory",ci="executable",ui="compressionMethod",li="signature",di="extraField",fi="unixMode",wi="setuid",pi="setgid",hi="sticky",mi=[Uo,Oo,Bo,Wo,Ho,Vo,Mo,Lo,Go,jo,qo,Ko,Po,Zo,Yo,Xo,Jo,Qo,$o,ti,ei,ni,ri,oi,ii,si,ai,ci,"symlink",ui,li,"crc32",di,"extraFieldUnix","extraFieldInfoZip","extraFieldUnixType1","extraFieldPkwareUnix","uid","gid",fi,"unixExternalUpper",wi,pi,hi,"bitFlag","rawBitFlag","filenameLength","extraFieldLength","filenameUTF8","commentUTF8","rawExtraField","extraFieldZip64","extraFieldUnicodePath","extraFieldUnicodeComment","extraFieldAES","extraFieldNTFS","extraFieldExtendedTimestamp","extraFieldUSDZ"];class yi{constructor(t){mi.forEach(e=>this[e]=t[e])}}const Si="File format is not recognized",gi="End of central directory not found",bi="End of Zip64 central directory locator not found",Ei="Central directory header not found",xi="Local file header not found",Ri="Zip64 extra field not found",zi="File contains encrypted entry",Fi="Encryption method not supported",Di="Compression method not supported",Ai="Split zip file",Ci="Overlapping entry found",Ii="Entry data out of bounds",ki="Ambiguous archive",Ti="Encrypted central directory is not supported",vi="Unsafe filename",_i="Invalid strictness (must be 'strict', 'balanced' or 'tolerant')",Ni="Invalid filenameValidation (must be 'strict', 'balanced' or 'tolerant')",Ui="Invalid maxAppendedDataSize (must be a number greater than or equal to 0)",Oi="64-bit value exceeds Number.MAX_SAFE_INTEGER",Mi="unsorted central directory",Li="unknown version needed to extract",Bi="compressed patched data",Wi="malformed extra field",Pi="unknown zip64 extensible data",Zi="wrapped entries count",Hi="appended data",Vi="prepended data",Gi="prepended central directory",ji="trailing central directory data",qi="duplicate filename",Ki="mismatched zip64 end of central directory record",Yi="mismatched local file header (general purpose bit flag)",Xi="mismatched local file header (compression method)",Ji="mismatched local file header (crc32 or sizes)",Qi=/^[a-zA-Z]:/,$i="utf-8",ts="cp437",es=[[Bo,O],[Wo,O],[Po,O],[Zo,M]],ns={[M]:{qt:Bs,bytes:4},[O]:{qt:Ws,bytes:8}},rs=i(o.MAX_SAFE_INTEGER);class os{constructor(t,e={}){n.assign(this,{reader:new Co(t),options:e,Kt:new c})}async*getEntriesGenerator(t={}){const e=this;let{reader:r}=e;if(await To(r),r.size!==dt&&r.readUint8Array||(r=new to(await hn(r.readable)),await To(r)),r.size<K)throw new f(Si);const o=e.warnings=[],i=Es(t,e.options),a=i==_t,c=i!=Ut,l=zs(_s(e,t,It),i),d=function(t,e){if(t===dt)return e;if(!bs(t))throw new f(Ni);return t}(_s(e,t,"filenameValidation"),i),w=_s(e,t,"normalizeFilename"),{Yt:p,Xt:h}=await Fs(r,c,l);if(!p)throw await async function(t){return await gs(t)==W}(r)?new f(Ai):new f(gi);c&&h>1&&vs("multiple end of central directory records");const m=ae(p);let y=Bs(m,12),S=Bs(m,16);const g=p.offset,b=Ls(m,20),E=g+K+b,x=r.size-E;x>l&&vs(Hi),x>0&&Ts(o,Hi);let R=Ls(m,4);const F=r.Vt||0;let D,A,C,I,k,T=Ls(m,6),v=Ls(m,10),_=0,N=X;const U=S==O||y==O||v==M||T==M;if(S!=O&&T!=M&&(S+=Ss(r,T)),U){const t=p.offset>=Y?await _o(r,p.offset-Y,Y):yt,e=ae(t);if(t.length==Y&&Bs(e,0)==j){S=Ss(r,Bs(e,4))+Ws(e,8);let t=await _o(r,S,X),i=ae(t);const c=p.offset-Y-X;if((t.length<X||Bs(i,0)!=G)&&S!=c&&c>=0){const e=S;S=c,S>e&&(_=S-e),t=await _o(r,S,X),i=ae(t)}if(t.length<X||Bs(i,0)!=G)throw new f(bi);if(C=!0,I=Ws(i,4)>44,I){const t=s.min(Ws(i,4)-44,r.size-S-X);t>0&&(N+=t,k=function(t){const e={rawExtensibleData:t};if(t.length>=28){const r=ae(t),o=Ls(r,26);n.assign(e,{compressionMethod:Ls(r,0),compressedSize:Ws(r,2),uncompressedSize:Ws(r,10),encryptionAlgorithm:Ls(r,18),bitLength:Ls(r,20),flags:Ls(r,22),hashAlgorithm:Ls(r,24),hashData:t.subarray(28,28+o)})}return e}(await _o(r,S+X,t)))}R==M?R=Bs(i,16):R!=Bs(i,16)&&ks(a,o,Ki),T==M?T=Bs(i,20):T!=Bs(i,20)&&ks(a,o,Ki),v==M?v=Ws(i,32):v!=Ws(i,32)&&ks(a,o,Ki),y==O?y=Ws(i,40):y!=Ws(i,40)&&ks(a,o,Ki),S=Ss(r,T)+Ws(i,48)+_}}let B=y;const P=p.offset-(C?N+Y:0);if(S>=r.size&&(_=r.size-S-y-K,S=r.size-y-K),F!=R)throw new f(Ai);if(S<0)throw new f(Si);let Z=0,V=await _o(r,S,y),J=ae(V);if(y){if(V.length<4)throw new f(Si);const t=P-y;if(S!=t&&T==R){const e=Bs(J,Z)==H||Boolean(k&&k.compressedSize)||cs(J);let n=!e;if(!n&&t>=0&&t+4<=r.size&&(n=Bs(ae(await _o(r,t,4)),0)==H),n){const n=S;S=t,S>n&&(_+=S-n,D=e),V=await _o(r,S,y),J=ae(V)}}}const Q=P-S;if(y!=Q&&Q>=0&&T==R&&(y=Q,V=await _o(r,S,y),J=ae(V)),S<0||S>=r.size)throw new f(Si);e.directoryOffset=S,e.directoryLength=B;const $=Ns(e,t,"decryptCentralDirectory");let tt,et;if($&&v&&V.length>=4&&Bs(J,0)!=H&&(I||cs(J))){const t=function(t,e,n){const r=t&&t.compressedSize?t.compressedSize:e;return r>0&&r<=n?r:n}(k,B,V.length);et=V.subarray(t),V=await $(V.subarray(0,t),k),J=ae(V),B=V.length,tt=!0}k&&!tt&&(V.length<4||Bs(J,0)==H)&&Ts(o,Pi),A=S;const nt=_s(e,t,"filenameEncoding"),ct=_s(e,t,"commentEncoding"),ut=new u;let lt,ft=-1;const wt=!a&&!C;!v&&wt&&(v=us(J,V,Z),v&&Ts(o,Zi));for(let i=0;i<v;i++){const a=new as(r,e.options);if(Z+q>V.length||Bs(J,Z)!=H){if(0==i&&!tt&&(I||cs(J)))throw new f(Ti);throw new f(Ei)}ds(a,J,Z+6);const c=Boolean(a.bitFlag.languageEncodingFlag),u=Z+q,l=u+a.filenameLength,p=l+a.extraFieldLength,h=Ls(J,Z+4),m=!(h>>8),y=h>>8==3,S=V.subarray(u,l),g=Ls(J,Z+32),b=p+g,E=V.subarray(p,b),x=c,R=c,F=Bs(J,Z+38),D=F&L,C={readOnly:Boolean(1&D),hidden:Boolean(2&D),system:Boolean(4&D),directory:Boolean(16&D),archive:Boolean(32&D)},k=Bs(J,Z+42),T=Ns(e,t,"decodeText")||_r,N=x?$i:nt||ts,U=R?$i:ct||ts;let O=T(S,N,Tt);if(O===dt&&(O=_r(S,N)),w){const t=w(O);t!==dt&&(O=t)}if(Rs(O,d)){const t=new f(vi);throw t.filename=O,t}let B=T(E,U,vt);B===dt&&(B=_r(E,U)),n.assign(a,{index:i,Jt:tt,versionMadeBy:h,msDosCompatible:m,zip64:!1,compressedSize:0,uncompressedSize:0,Qt:g,offset:k,diskNumberStart:Ls(J,Z+34),internalFileAttributes:Ls(J,Z+36),externalFileAttributes:F,msdosAttributesRaw:D,msdosAttributes:C,rawFilename:S,filenameUTF8:x,commentUTF8:R,rawExtraField:V.subarray(l,p),rawComment:E,filename:O,comment:B}),fs(a,a,J,Z+6)&&Ts(o,Wi,O),a.offset+=_;const W=Ss(r,a.diskNumberStart)+a.offset;A=s.min(W,A),W<ft&&Ts(o,Mi,O),ft=W,(a.version&L)>63&&Ts(o,Li,O),32&~a.rawBitFlag||Ts(o,Bi,O),ut.has(a.filename)&&(lt=!0),ut.add(a.filename);const P=a.externalFileAttributes>>16&M;a.unixMode===dt&&16877&P&&(a.unixMode=P);const G=Boolean(a.unixMode&it),j=Boolean(a.unixMode&st),K=Boolean(512&a.unixMode),Y=40960==((a.unixMode===dt?P:a.unixMode)&rt),X=!Y&&(a.unixMode!==dt?!!(73&a.unixMode):y&&!!(73&P)),Q=a.unixMode!==dt&&(a.unixMode&rt)==ot,$=(P&rt)==ot;n.assign(a,{setuid:G,setgid:j,sticky:K,symlink:Y,unixExternalUpper:P,internalFileAttribute:a.internalFileAttributes,externalFileAttribute:a.externalFileAttributes,executable:X,directory:Q||$||m&&C.directory||a.filename.endsWith(at),zipCrypto:a.encrypted&&!a.extraFieldAES});const et=new yi(a);if(et.getData=(t,n)=>a.getData(t,et,e.Kt,n),et.arrayBuffer=async t=>{const n=new z,r=hn(n.readable).then(t=>t.arrayBuffer());return r.catch(()=>{}),await a.getData(n,et,e.Kt,t),r},Z=b,i==v-1&&wt){const t=us(J,V,Z);t&&(v+=t,Ts(o,Zi))}const{onprogress:pt}=t;if(pt)try{await pt(i+1,v,new yi(a))}catch{}yield et}let pt=Z,ht=ls(V.subarray(Z))||(tt?ls(et):dt);if(!ht&&!tt){const t=S+Z,e=s.min(P-t,65541);e>=6&&(ht=ls(await _o(r,t,e)))}ht&&(e.digitalSignature=ht,pt=Z+6+ht.length),(Z!=B&&pt!=B||!tt&&Z!=y&&pt!=y)&&ks(a,o,ji),lt&&ks(a,o,qi);const mt=_s(e,t,"extractPrependedData"),St=_s(e,t,"extractAppendedData"),gt=(a||mt)&&v&&4==A&&await async function(t){const e=await gs(t);return e==W||808471376==e}(r)?4:0;return a&&(_||v&&A>gt)&&vs(Vi),(_||v&&A>4)&&Ts(o,Vi),D&&Ts(o,Gi),mt&&(e.prependedData=A>gt?await _o(r,gt,A-gt):yt),e.comment=b?await _o(r,g+K,b):yt,St&&(e.appendedData=E<r.size?await _o(r,E,r.size-E):yt),!0}async getEntries(t={}){const e=[];for await(const n of this.getEntriesGenerator(t))e.push(n);return e}async close(){const{reader:t}=this;t.readUint8Array||!t.readable||t.readable.locked||await t.readable.cancel()}}class is{constructor(t={}){const{readable:e,writable:n}=new z,r=new os(e,t).getEntriesGenerator();this.readable=new F({async pull(t){const{done:e,value:n}=await r.next();if(e)return t.close();const o={...n,readable:function(){const{readable:t,writable:e}=new z;if(n.getData)return async function(){try{await n.getData(e)}catch(t){try{await e.abort(t)}catch{}}}(),t}()};delete o.getData,t.enqueue(o)}}),this.writable=n}}async function ss(t,e={}){if(t=new Co(t),await To(t),t.size!==dt&&t.readUint8Array||(t=new to(await hn(t.readable)),await To(t)),t.size<K)return!1;const n=Es(e,{}),r=n!=Ut,o=zs(e[It],n),{Yt:i,Xt:s}=await Fs(t,r,o);if(!i||n==_t&&s>1)return!1;const a=Ls(ae(i),20),c=i.offset+K+a;return t.size-c<=o}let as=class{constructor(t,e){n.assign(this,{reader:t,options:e})}async getData(t,e,n,r={}){const o=this,i=$t(),{reader:a,index:c,offset:u,diskNumberStart:l,extraFieldAES:d,extraFieldZip64:w,compressionMethod:p,bitFlag:h,rawBitFlag:m,crc32:y,rawLastModDate:S,uncompressedSize:g,compressedSize:b}=o,{dataDescriptor:E}=h,x=e.localDirectory={},R=e.warnings=[],z=Ss(a,l)+u,F=await _o(a,z,ct),A=ae(F);let C=_s(o,r,St),I=_s(o,r,gt);const k=_s(o,r,bt);if(Pt(C,I),C=C&&C.length&&C,I=I&&I.length&&I,d&&99!=d.originalCompressionMethod)throw new f(Di);if(F.length<ct||Bs(A,0)!=B)throw new f(xi);ds(x,A,4);const{extraFieldLength:T,filenameLength:v}=x,_=x.dataOffset=z+ct+v+T,N=_s(o,r,"checkLocalDirectory"),U=Es(r,o.options),O=function(t,e){return t===dt?e!=Ut:Boolean(t)}(N,U),M=function(t,e){return t===dt?e==_t:Boolean(t)}(N,U);let W=yt;if(M&&(v||T)){const t=await _o(a,z+ct,v+T);W=t.subarray(0,v),x.rawExtraField=t.subarray(v)}else x.rawExtraField=T?await _o(a,z+ct+v,T):yt;M&&(x.rawFilename=W),fs(o,x,A,4,!0)&&Ts(R,Wi),function(t,e,n,r,o){const{rawFilename:i}=t,s=!o,a=t.Jt&&!(8192&~e.rawBitFlag);!r||a||n.length==i.length&&!n.some((t,e)=>t!=i[e])||ks(s,o,"mismatched local file header (filename)"),(2057&e.rawBitFlag)!=(2057&t.rawBitFlag)&&ks(s,o,Yi),e.compressionMethod!=t.compressionMethod&&ks(s,o,Xi),e.bitFlag.dataDescriptor||a||!(e.crc32||e.compressedSize||e.uncompressedSize)||e.crc32==t.crc32&&e.compressedSize==t.compressedSize&&e.uncompressedSize==t.uncompressedSize||ks(s,o,Ji)}(o,x,W,M,O?dt:R);const{lastAccessDate:Z,creationDate:H,uid:V,gid:G}=x;Z&&(e.lastAccessDate=Z),H&&(e.creationDate=H),V!==dt&&e.uid===dt&&(e.uid=V),G!==dt&&e.gid===dt&&(e.gid=G);const j=o.encrypted&&x.encrypted&&!k,q=j&&!d;if(k||(e.zipCrypto=q),j&&!(64&~x.rawBitFlag))throw new f(Fi);const K=k?dt:Rn(p);if(0!=p&&8!=p&&9!=p&&!K&&!k)throw new f(Di);if(j){if(!q&&(d.strength<1||d.strength>3))throw new f(Fi);if(!C&&!I)throw new f(zi)}if(_+b>a.size)throw new f(Ii);const Y=b,X=pn(a.createReadable({offset:_,size:Y})),J=Wt(_s(o,r,Et)),Q=_s(o,r,"checkPasswordOnly");let $=_s(o,r,"checkOverlappingEntry");const tt=_s(o,r,"checkOverlappingEntryOnly");tt&&($=!0);const{onstart:et,onprogress:nt,onend:rt}=r,ot=0!=p&&!k,it=k?b:g,st=9==p;let at=_s(o,r,Rt);st&&(at=!1);const ut=_s(o,r,"checkCrc32"),lt=(ut===dt?_s(o,r,"checkSignature"):ut)&&!k&&(!j||q||d&&1==d.vendorVersion),ft={options:{codecType:qn,password:C,rawPassword:I,zipCrypto:q,encryptionStrength:d&&d.strength,checkCrc32:lt,checkAuthenticationCode:_s(o,r,"checkAuthenticationCode"),passwordVerification:q&&(E?S>>>8&L:y>>>24&L),outputSize:it,crc32:y,compressed:ot,encrypted:j,useWebWorkers:_s(o,r,xt),useCompressionStream:at,transferStreams:_s(o,r,zt),deflate64:st,format:K?K.format:dt,codecURI:K?K.codecURI:dt,compressionMethod:p,rawBitFlag:m,checkPasswordOnly:Q},config:i,ft:{signal:J,size:Y,onstart:et,onprogress:nt,onend:rt}};let wt,pt;$&&await async function({reader:t,$t:e,index:n,offset:r,crc32:o,compressedSize:i,uncompressedSize:s,dataOffset:a,dataDescriptor:c,extraFieldZip64:u,Kt:l}){let d=0;if(c&&(d=u?20:12),d){const n=await _o(t,a+i,d+4),r=ae(n);let c=n.length==d+4&&Bs(r,0)==P;if(c){const t=ys(r,4,u);(e.encrypted&&!e.zipCrypto||t.crc32==o)&&t.compressedSize==i&&t.uncompressedSize==s?d+=4:c=!1}if(n.length>=d){const t=ys(r,c?4:0,u);t.signature=c,e.localDirectory.dataDescriptor=t}}const w={start:r,end:a+i+d,$t:e};for(const[t,e]of l)if(t!=n&&w.start<e.end&&e.start<w.end){const t=new f(Ci);throw t.overlappingEntry=e.$t,t}l.set(n,w)}({reader:a,$t:e,index:c,offset:z,crc32:y,compressedSize:b,uncompressedSize:g,dataOffset:_,dataDescriptor:E||x.bitFlag.dataDescriptor,extraFieldZip64:w||x.extraFieldZip64,Kt:n});try{if(!tt){Q&&(t=new D),t=new Io(t),await To(t,function(t,e,n){return s.min(t,n?1032*e:e)}(it,b,ot)),({writable:wt}=t);const{outputSize:e}=await Fr({readable:X,writable:wt},ft);if(t.size+=e,e!=it)throw new f(An)}}catch(e){if(e.outputSize!==dt&&(t.size+=e.outputSize),!Q||e.message!=Ce)throw pt=e,e}finally{if((ko(t)||!_s(o,r,Ft))&&wt&&!wt.locked){const t=wt.getWriter();if(pt)try{await t.abort(pt)}catch{}else await t.close()}}return Q||tt?dt:t.getData?t.getData():wt}};function cs(t){const e=s.min(t.byteLength,1024)-3;for(let n=0;n<e;n++)if(134630224==Bs(t,n))return!0;return!1}function us(t,e,n){let r=0;for(;n+q<=e.length&&Bs(t,n)==H;)n+=q+Ls(t,n+28)+Ls(t,n+30)+Ls(t,n+32),r++;return r%65536?0:r}function ls(t){if(t.length>=6){const e=ae(t);if(Bs(e,0)==Z){const n=Ls(e,4);if(6+n<=t.length)return t.subarray(6,6+n)}}}function ds(t,e,r){const o=t.rawBitFlag=Ls(e,r+2),i=!(1&~o),s=Bs(e,r+6);n.assign(t,{encrypted:i,version:Ls(e,r),bitFlag:{level:(6&o)>>1,dataDescriptor:!(8&~o),languageEncodingFlag:(o&nt)==nt},rawLastModDate:s,lastModDate:Us(s),filenameLength:Ls(e,r+22),extraFieldLength:Ls(e,r+24)})}function fs(t,e,r,o,i){const{rawExtraField:s}=e,u=e.extraField=new c,l=ae(s);let d=0,w=!1;try{for(;d<s.length;){const t=Ls(l,d),e=Ls(l,d+2);u.set(t,{type:t,data:s.slice(d+4,d+4+e)}),d+=4+e}}catch{w=!0}d>s.length&&(w=!0);const p=Ls(r,o+4);n.assign(e,{signature:Bs(r,o+10),crc32:Bs(r,o+10),compressedSize:Bs(r,o+14),uncompressedSize:Bs(r,o+18)});const h=u.get(1);h&&(function(t,e){e.zip64=!0;const n=ae(t.data),r=es.filter(([t,n])=>e[t]==n),o=r.reduce((t,[,e])=>t+ns[e].bytes,0);if(t.data.length<o)throw new f(Ri);for(let o=0,i=0;o<r.length;o++){const[s,a]=r[o],c=ns[a];e[s]=t[s]=c.qt(n,i),i+=c.bytes}}(h,e),e.extraFieldZip64=h);const m=u.get(28789);m&&(ws(m,Uo,Oo,e,t),e.extraFieldUnicodePath=m);const y=u.get(25461);y&&(ws(y,Mo,Lo,e,t),e.extraFieldUnicodeComment=y);const S=u.get(J);S&&S.data.length>=7?(function(t,e,r){const o=ae(t.data),i=Ms(o,4);n.assign(t,{vendorVersion:Ms(o,0),vendorId:Ms(o,2),strength:i,originalCompressionMethod:r,compressionMethod:Ls(o,5)}),e.compressionMethod=t.compressionMethod,1!=t.vendorVersion&&(e.crc32=dt)}(S,e,p),e.extraFieldAES=S):e.compressionMethod=p;const g=u.get(13);g&&(ps(g,e),e.extraFieldPkwareUnix=g);const b=u.get(22613);b&&(ps(b,e),e.extraFieldUnixType1=b);const E=u.get(10);E&&(function(t,e){const r=ae(t.data);let o,i=4;try{for(;i<t.data.length&&!o;){const e=Ls(r,i),n=Ls(r,i+2);1==e&&(o=t.data.slice(i+4,i+4+n)),i+=4+n}}catch{}if(o&&24==o.length){const r=ae(o),i=r.getBigUint64(0,!0),s=r.getBigUint64(8,!0),a=r.getBigUint64(16,!0);n.assign(t,{rawLastModDate:i,rawLastAccessDate:s,rawCreationDate:a});const c={lastModDate:Os(i),lastAccessDate:Os(s),creationDate:Os(a)};n.assign(t,c),n.assign(e,c,{rawLastAccessDate:s,rawCreationDate:a})}}(E,e),e.extraFieldNTFS=E);const x=u.get(et);let R;if(x&&(R=hs(x,e,!1),e.extraFieldUnix=x),!R){const t=u.get(tt);t&&(hs(t,e,!0),e.extraFieldInfoZip=t)}const z=u.get(Q);z&&(function(t,e,n){if(!t.data.length)return;const r=ae(t.data),o=Ms(r,0),i=[],s=[];n?(1&~o||(i.push(Ho),s.push(Vo)),2&~o||(i.push(Go),s.push(jo)),4&~o||(i.push(qo),s.push(Ko))):t.data.length>=5&&(i.push(Ho),s.push(Vo));let c=1;i.forEach((n,o)=>{if(t.data.length>=c+4){const i=Bs(r,c);e[n]=t[n]=new a(1e3*(0|i));const u=s[o];t[u]=i}c+=4})}(z,e,i),e.extraFieldExtendedTimestamp=z);const F=u.get($);return F&&(e.extraFieldUSDZ=F),w}function ws(t,e,r,o,i){if(t.data.length<5)return void(t.valid=!1);const s=ae(t.data),a=new ye;a.append(i[r]);const c=ae(new w(4));c.setUint32(0,a.get(),!0);const u=Bs(s,1),l=Ms(s,0);n.assign(t,{version:l,[e]:_r(t.data.subarray(5)),valid:1==l&&!i.bitFlag.languageEncodingFlag&&u==Bs(c,0)}),t.valid&&(o[e]=t[e],o[e+"UTF8"]=!0)}function ps(t,e){if(t.data.length<8)return;const r=ae(t.data),o={lastAccessDate:new a(1e3*(0|Bs(r,0))),lastModDate:new a(1e3*(0|Bs(r,4)))};t.data.length>=12&&(o.uid=Ls(r,8),o.gid=Ls(r,10)),n.assign(t,o),n.assign(e,o)}function hs(t,e,r){try{const o=ae(t.data);let i,s;if(r){let e=0;const r=Ms(o,e++),a=Ms(o,e++);i=ms(t.data.subarray(e,e+a)),e+=a;const c=Ms(o,e++);s=ms(t.data.subarray(e,e+c)),n.assign(t,{version:r,uid:i,gid:s})}else t.data.length>=4&&(i=Ls(o,0),s=Ls(o,2),n.assign(t,{uid:i,gid:s}));return i!==dt&&(e.uid=i),s!==dt&&(e.gid=s),i!==dt||s!==dt}catch{}}function ms(t){const e=new w(4);return e.set(t,0),new m(e.buffer,e.byteOffset,4).getUint32(0,!0)}function ys(t,e,n){const r=Bs(t,e);let o,i;return n?(o=Ws(t,e+4),i=Ws(t,e+12)):(o=Bs(t,e+4),i=Bs(t,e+8)),{crc32:r,compressedSize:o,uncompressedSize:i}}function Ss(t,e){return t.jt?t.jt(e):0}async function gs(t){return Bs(ae(await _o(t,0,4)))}function bs(t){return t===_t||t===Nt||t===Ut}function Es(t,e){return xs(t,xs(e,Nt))}function xs(t,e){const n=t.strictness;if(n!==dt){if(!bs(n))throw new f(_i);return n}const r=t.checkAmbiguity;return r===dt?e:r?_t:e==Ut?Ut:Nt}function Rs(t,e){if(e==Ut)return!1;const n=t.split("/");return n.length>1&&""===n[n.length-1]&&n.pop(),!!(n.includes("..")||t.startsWith("/")||t.startsWith("\\\\")||Qi.test(t))||e==_t&&(n.includes(".")||n.includes(""))}function zs(t,e){if(t!==dt){const e=Vt(t);if("number"!=typeof e||o.isNaN(e)||e<0)throw new f(Ui);return e}return e==_t?0:e==Ut?1/0:M}async function Fs(t,e,n){const{size:r}=t,o=s.min(r,65557),i={count:64};let a,c,u=0;for await(const[n,s,l,d,f]of Ds(t,o)){const o=Ls(n,d+20);if(f+K+o==r){const o=await Cs(t,n,s,d,f,r,i);if(2==o){if(a||(a=As(l,d,f)),u++,!e||u>1)break}else 1!=o||c||(c=As(l,d,f))}}return a||(a=c),a||(a=await async function(t,e,n){const{size:r}=t,o=s.min(r,e==1/0?r:65557+e);let i,a;for await(const[e,s,c,u,l]of Ds(t,o)){const o=As(c,u,l);i||(i=o);const d=await Cs(t,e,s,u,l,r,n);if(2==d)return o;1!=d||a||(a=o)}return a||i}(t,n,i)),{Yt:a,Xt:u}}async function*Ds(t,e){const n=t.size-e,r=await _o(t,n,e),o=ae(r);for(let t=r.length-K;t>=0;t--)Bs(o,t)==V&&(yield[o,n,r,t,n+t])}function As(t,e,n){return{offset:n,buffer:t.slice(e,e+K).buffer}}async function Cs(t,e,n,r,o,i,s){const a=Ls(e,r+10),c=Bs(e,r+12),u=Bs(e,r+16);if(a==M||c==O||u==O)return await Is(t,e,n,o-Y,i,s)==j?2:0;if(!a&&!c)return 1;const l=Ls(e,r+6);for(const r of[o-c,Ss(t,l)+u])if(await Is(t,e,n,r,i,s)==H)return 2;return 0}async function Is(t,e,n,r,o,i){return r<0||r+4>o?dt:r>=n?Bs(e,r-n):i.count>0?(i.count--,Bs(ae(await _o(t,r,4)),0)):dt}function ks(t,e,n){t?vs(n):Ts(e,n)}function Ts(t,e,n){if(!t.some(t=>t.reason==e)){const r={reason:e};n!==dt&&(r.filename=n),t.push(r)}}function vs(t){const e=new f(ki);throw e.reason=t,e}function _s(t,e,n){return e[n]===dt?t.options[n]:e[n]}function Ns(t,e,n){return Bt(_s(t,e,n))}function Us(t){const e=(4294901760&t)>>16,n=t&M,r=new a(1980+((65024&e)>>9),((480&e)>>5)-1,31&e,(63488&n)>>11,(2016&n)>>5,2*(31&n),0);return r<lt?lt:r}function Os(t){return new a(o(t/i(1e4)-i(116444736e5)))}function Ms(t,e){return t.getUint8(e)}function Ls(t,e){return t.getUint16(e,!0)}function Bs(t,e){return t.getUint32(e,!0)}function Ws(t,e){const n=t.getBigUint64(e,!0);if(n>rs)throw new f(Oi);return o(n)}var Ps=n.freeze({__proto__:null,ERR_AMBIGUOUS_ARCHIVE:ki,ERR_BAD_FORMAT:Si,ERR_CENTRAL_DIRECTORY_NOT_FOUND:Ei,ERR_ENCRYPTED:zi,ERR_ENCRYPTED_CENTRAL_DIRECTORY:Ti,ERR_ENTRY_DATA_OUT_OF_BOUNDS:Ii,ERR_EOCDR_LOCATOR_ZIP64_NOT_FOUND:bi,ERR_EOCDR_NOT_FOUND:gi,ERR_EXTRAFIELD_ZIP64_NOT_FOUND:Ri,ERR_INVALID_AUTHENTICATION_CODE:Ae,ERR_INVALID_COMPRESSED_DATA:Cn,ERR_INVALID_CRC32:In,ERR_INVALID_FILENAME_VALIDATION:Ni,ERR_INVALID_MAX_APPENDED_DATA_SIZE:Ui,ERR_INVALID_PASSWORD:Fe,ERR_INVALID_SIGNATURE:De,ERR_INVALID_STRICTNESS:_i,ERR_INVALID_UNCOMPRESSED_SIZE:An,ERR_LOCAL_FILE_HEADER_NOT_FOUND:xi,ERR_OVERLAPPING_ENTRY:Ci,ERR_SPLIT_ZIP_FILE:Ai,ERR_UNSAFE_FILENAME:vi,ERR_UNSUPPORTED_COMPRESSION:Di,ERR_UNSUPPORTED_ENCRYPTION:Fi,ERR_UNSUPPORTED_UINT64:Oi,ERR_WORKER_STARTUP_TIMEOUT:Xn,WARNING_APPENDED_DATA:Hi,WARNING_COMPRESSED_PATCHED_DATA:Bi,WARNING_DUPLICATE_FILENAME:qi,WARNING_MALFORMED_EXTRA_FIELD:Wi,WARNING_MISMATCHED_LOCAL_FILE_HEADER_BIT_FLAG:Yi,WARNING_MISMATCHED_LOCAL_FILE_HEADER_COMPRESSION_METHOD:Xi,WARNING_MISMATCHED_LOCAL_FILE_HEADER_CRC32_OR_SIZES:Ji,WARNING_MISMATCHED_ZIP64_END_OF_CENTRAL_DIRECTORY:Ki,WARNING_PREPENDED_CENTRAL_DIRECTORY:Gi,WARNING_PREPENDED_DATA:Vi,WARNING_TRAILING_CENTRAL_DIRECTORY_DATA:ji,WARNING_UNKNOWN_VERSION:Li,WARNING_UNKNOWN_ZIP64_EXTENSIBLE_DATA:Pi,WARNING_UNSORTED_CENTRAL_DIRECTORY:Mi,WARNING_WRAPPED_ENTRIES_COUNT:Zi,ZipReader:os,ZipReaderStream:is,isZipFile:ss});const Zs="File already exists",Hs="Zip file comment exceeds 64KB",Vs="Invalid zip file comment (must be a Uint8Array)",Gs="File entry comment exceeds 64KB",js="Invalid file entry comment (must be a string)",qs="Invalid date (must be a valid Date instance)",Ks="File entry name exceeds 64KB",Ys="Version exceeds 65535",Xs="The strength must equal 1, 2, or 3",Js="Encryption is not supported in USDZ files",Qs="Encryption is not supported when the 'passThrough' option is set",$s="Invalid extra field (must be a Map)",ta="Invalid extra field type (must be integer 0..65535)",ea="Invalid extra field data (must be a Uint8Array)",na="Extra field data exceeds 64KB",ra=-2147483648,oa=2147483647,ia=i(0),sa=i("0x7fffffffffffffff"),aa="Zip64 is not supported (set the 'zip64' option to 'true')",ca="Undefined uncompressed size",ua="Undefined compression method",la="Undetermined size",da="Undefined reader",fa="Zip file not empty",wa="Invalid uid (must be integer 0..2^32-1)",pa="Invalid gid (must be integer 0..2^32-1)",ha="Invalid UNIX mode (must be integer 0..65535)",ma="Invalid unixExtraFieldType (must be 'infozip' or 'unix')",ya="uid/gid must be 0..65535 for unixExtraFieldType 'unix' (use 'infozip' for larger ids)",Sa="Invalid msdosAttributesRaw (must be integer 0..255)",ga="Invalid msdosAttributes (must be an object with boolean flags)",ba="Invalid level (must be integer 0..9)",Ea="Signature data exceeds 64KB",xa=new w([7,0,2,0,65,69,3,0,0]),Ra="infozip",za="unix";let Fa=0;const Da=[];class Aa{constructor(t,e={}){t=new Io(t);const{availableSize:r=ft,maxSize:o=ft}=t,i=r>0&&r!==ft&&o>0&&o!==ft;n.assign(this,{writer:t,te:i,options:e,ee:new c,ne:new u,offset:e[At]===dt?t.size||t.writable.size||0:e[At],re:e[At]===dt?0:e[At]-(t.size||t.writable.size||0),oe:new u,ie:[],se:0,ae:dt})}prependZip(t){return Ia(this,async function(t,e){if(t.ne.size)throw new f(fa);await t.ce(e)}(this,t))}appendZip(t){return Ia(this,this.ce(t))}async ce(t){const r=this,{oe:o,ne:i,ee:s}=r;for(;o.size;)await S.allSettled(e.from(o));let a;const u=new S(t=>a=t);o.add(u);const l=[];let d;try{t=new Co(t),await To(t),t.size!==dt&&t.readUint8Array||(t=new to(await hn(t.readable)),await To(t));const{ZipReader:o}=await S.resolve().then(function(){return Ps}),a=new o(t),u=await a.getEntries();await a.close(),await To(r.writer);const{directoryOffset:w}=a;u.forEach(({filename:t})=>{if(i.has(t))throw new f(Zs);i.add(t),l.push(t)}),r.ue=!0;const{le:p}=r;r.le=new S(t=>d=()=>{r.ue=!1,t()}),await p,r.te&&(delete r.te,await async function(t){return ae(await _o(t,0,4)).getUint32(0,!0)==W}(t)||(await Qa(r.writer,Xa()),r.offset+=4));const h=await async function(t,n,r,o){const{writer:i}=t,s=new c;if(i.closeDisk){const a=e.from(r).sort((t,e)=>Ya(n,t)-Ya(n,e));let c=0;for(const e of a){const r=Ya(n,e);await qa(t,n,c,r-c),Va(i,await Ka(n,r))&&await i.closeDisk(),s.set(e,{offset:Ga(t,i),diskNumberStart:Za(i)}),c=r}await qa(t,n,c,o-c)}else{const e=t.offset;await qa(t,n,0,o),r.forEach(t=>s.set(t,{offset:e+Ya(n,t),diskNumberStart:0}))}return s}(r,t,u,w);u.forEach(t=>{const{version:e,rawLastModDate:r,rawFilename:o,bitFlag:i,encrypted:a,uncompressedSize:c,compressedSize:u,extraFieldZip64:l}=t;let{compressionMethod:d,rawExtraField:f}=t;const{level:w,languageEncodingFlag:p,dataDescriptor:m}=i;f=ja(f||yt),t.extraFieldAES&&(d=99);const y=yc(f),S=Boolean(l)&&l.uncompressedSize!==dt,g=Boolean(l)&&l.compressedSize!==dt,b=-7&gc(w,p,m,a,d)|w<<1,{de:E,fe:x}=Sc({version:e,bitFlag:b,compressionMethod:d,uncompressedSize:c,compressedSize:u,rawLastModDate:r,rawFilename:o,we:g,pe:S,extraFieldLength:y}),{crc32:R}=t;R!==dt&&pc(x,10,R);const{offset:z,diskNumberStart:F}=h.get(t);n.assign(t,{pe:S,we:g,offset:z,diskNumberStart:F,he:!1,me:yt,ye:yt,Se:yt,ge:yt,be:yt,rawExtraField:f,Ee:yt,extendedTimestamp:!1,de:E,fe:x}),s.set(t.filename,t)})}catch(t){throw l.forEach(t=>i.delete(t)),t}finally{a(),o.delete(u),d&&d()}}add(t="",e,r={}){const o=this,{oe:s}=o,a=async function(t,e,r,o){if(oc(t,o=n.assign({},o),ai)&&!e.endsWith(at)&&(e+=at),t.ne.has(e))throw new f(Zs);t.ne.add(e),Fa<$t().maxWorkers?Fa++:await new S(t=>Da.push(t));try{return await async function(t,e,r,o){const s=va(t,e,o);({name:e}=s);const a=_a(t,e,o),{comment:c}=a,u=o[di];t.ee.set(e,dt);const l=t.ae,d={};let w,p;a.xe.keepOrder&&(d.Re=new S(t=>w=t)),t.ae=d;try{const{xe:c}=a;0==c.level||c.compressionMethod!==dt||c.passThrough||await tr($t())||(c.level=0);const u=await async function(t,e,{xe:r},o){if(r.passThrough&&!e&&!oc(t,o,ai))throw new f(da);let i;return e&&(e=new Co(e),await To(e),({size:i}=e)),n.assign({reader:e},Ua(t,Boolean(e),i,r,o))}(t,r,a,o);({reader:r}=u);const h=Ha(t.writer),m=Za(t.writer),y=Oa(o=n.assign({},o,s.xe,a.xe,u.xe,{signature:o[li],crc32:o.crc32===dt?o[li]:o.crc32,offset:t.offset-h,diskNumberStart:m,[Ct]:t.options[Ct]})),g=Ba(o),b=yc(y.ze,g.Fe);p=await async function(t,e,r,o,s){const{ee:a,writer:c}=t,{keepOrder:u,dataDescriptor:l,De:d,signal:w}=s,{Ae:p,$t:h,Ce:m,Ie:y}=o,g=t.options[Ct];let b,E,x,R,F,D,A=h,C=0;const I=u&&m?m.Re:dt;a.set(e,A);try{s.bufferedWrite||!u||t.ue||t.se||!l&&!d?(b=!0,t.se++,D=s.createTempStream?await s.createTempStream():new z(dt,dt,{highWaterMark:ft}),D.size=0,await To(c)):(D=c,await I,await k()),await To(D);const h=Ha(c);t.te&&!b&&await Ja(t,c),g&&!b&&Ma(o,t.offset-h);const{ze:m}=p;b||await T();const y=Za(c),E=Ga(t,c);if(A.diskNumberStart=y,b||(R=!0,F=c.size,await Qa(D,m)),A=await async function(t,e,{diskNumberStart:r,Re:o},s,a,c){const{Ae:u,ke:l,Te:d}=s,{de:w,fe:p,lastModDate:h,rawLastModDate:m,encrypted:y,compressed:S,version:g,compressionMethod:b,me:E,ve:x,Se:R,_e:z,ge:F,be:D,ye:A}=u,{Fe:C}=l,{rawFilename:I,lastAccessDate:k,creationDate:T,password:v,rawPassword:_,level:N,zip64:U,pe:M,we:B,zipCrypto:W,dataDescriptor:P,directory:Z,executable:H,versionMadeBy:V,rawComment:G,rawExtraField:j,Ee:q,useWebWorkers:K,transferStreams:Y,onstart:X,onprogress:J,onend:Q,signal:$,encryptionStrength:tt,extendedTimestamp:et,msDosCompatible:nt,internalFileAttributes:rt,externalFileAttributes:ot,uid:it,gid:st,unixMode:at,symlink:ct,setuid:ut,setgid:lt,sticky:ft,unixExternalUpper:wt,msdosAttributesRaw:pt,msdosAttributes:ht,useCompressionStream:mt,passThrough:yt,format:St,codecURI:gt}=c,bt={Re:o,versionMadeBy:V,zip64:U,directory:Boolean(Z),executable:Boolean(H),filenameUTF8:!0,rawFilename:I,commentUTF8:!0,rawComment:G,me:E,ve:x,Se:R,ge:F,be:D,ye:A,rawExtraField:j,Ee:q,extendedTimestamp:et,msDosCompatible:nt,internalFileAttributes:rt,externalFileAttributes:ot,diskNumberStart:r,uid:it,gid:st,unixMode:at,symlink:Boolean(ct),setuid:ut,setgid:lt,sticky:ft,unixExternalUpper:wt,msdosAttributesRaw:pt,msdosAttributes:ht};let{crc32:Et,uncompressedSize:xt}=c,Rt=0;yt||(xt=0);const{writable:zt}=e;if(t){const n=pn(No(t)),r=t.size,o={options:{codecType:jn,inputSize:r,level:N,rawPassword:_,password:v,encryptionStrength:tt,zipCrypto:y&&W,passwordVerification:y&&W&&m>>8&L,computeCrc32:!yt,compressed:S&&!yt,encrypted:y&&!yt,useWebWorkers:K,useCompressionStream:mt,transferStreams:Y,format:St,codecURI:gt,compressionMethod:b},config:a,ft:{signal:$,size:r,onstart:X,onprogress:J,onend:Q}};try{const t=await Fr({readable:n,writable:zt},o);if(Rt=t.outputSize,e.size+=Rt,yt||(xt=t.inputSize,y&&!W||(Et=t.crc32)),!B&&Rt>=O||!M&&xt>=O)throw new f(aa)}catch(t){throw t.outputSize!==dt&&(e.size+=t.outputSize),t}}return function({crc32:t,compressedSize:e,uncompressedSize:n,Ae:r,ke:o},{zip64:s,zipCrypto:a,passThrough:c,dataDescriptor:u}){const{fe:l,encrypted:d}=r,{Ne:f,Ue:w}=o;d&&!a&&!c||t===dt||(pc(l,10,t),u&&pc(f,w,t)),s?u&&(hc(f,w+4,i(e)),hc(f,w+12,i(n))):(pc(l,14,e),pc(l,18,n),u&&(pc(f,w+4,e),pc(f,w+8,n)))}({crc32:Et,compressedSize:Rt,uncompressedSize:xt,Ae:u,ke:l},c),P&&await Qa(e,C),n.assign(bt,{uncompressedSize:xt,compressedSize:Rt,lastModDate:h,rawLastModDate:m,creationDate:T,lastAccessDate:k,encrypted:Boolean(y),zipCrypto:Boolean(W),size:d+Rt,compressionMethod:b,version:g,de:w,fe:p,signature:Et,crc32:!y||W||yt?Et:dt,_e:z,pe:M,we:B}),bt}(r,D,A,o,$t(),s),b||(R=!1),a.set(e,A),A.filename=e,b){if(await S.all([D.writable.getWriter().close(),I]),await k(),t.te&&await Ja(t,c),x=!0,F=c.size,await T(),A.diskNumberStart=Za(c),A.offset=Ga(t,c),g){const e=o.Te;Ma(o,t.offset-Ha(c)),A.size+=o.Te-e}!function({rawFilename:t,encrypted:e,zip64:n,ve:r,crc32:o,compressedSize:s,uncompressedSize:a,pe:c,we:u},l,{dataDescriptor:d,passThrough:f}){if(d||((!e||f&&o!==dt)&&pc(l,14,o),u||pc(l,18,s),c||pc(l,22,a)),n&&r){const e=ct+yc(t)+4;hc(l,e,i(a)),hc(l,e+8,i(s))}}(A,p.Oe,s),await Qa(c,p.ze),await $a(D.readable,c,w,t=>C+=t),c.size+=D.size,x=!1}else A.diskNumberStart=y,A.offset=E;return t.offset+=A.size,A}catch(n){if(x||R){if(t.hasCorruptedEntries=!0,n)try{n.corruptedEntry=!0}catch{}t.offset+=c.size-F,b&&(t.offset+=C)}throw a.delete(e),n}finally{if(b&&t.se--,y&&y(I),E&&E(),b&&D&&D.dispose)try{await D.dispose()}catch{}}async function k(){t.ue=!0;const{le:e}=t;t.le=new S(e=>E=()=>{t.ue=!1,e()}),await e}async function T(){Va(c,yc(p.ze))&&await c.closeDisk()}}(t,e,r,{Ae:y,ke:g,Te:b,$t:d,Ce:l,Ie:w},o)}catch(n){throw t.ee.delete(e),n}finally{w&&w(l&&l.Re)}return n.assign(p,{name:e,comment:c,extraField:u,[Jo]:p.internalFileAttributes,[Qo]:p.externalFileAttributes}),new yi(p)}(t,e,r,o)}catch(n){throw t.ne.delete(e),n}finally{const t=Da.shift();t?t():Fa--}}(o,t,e,r);s.add(a);const c=()=>s.delete(a);return S.prototype.then.call(a,c,c),Ia(o,a)}remove(t){const{ne:e,ee:n}=this;if(typeof t==mt&&(t=n.get(t)),t&&t.filename!==dt){const{filename:r}=t;if(e.has(r)&&n.has(r))return e.delete(r),n.delete(r),!0}return!1}async close(t=yt,n={}){const r=this,{oe:o,writer:s}=this,{writable:a}=s;if(!(t instanceof w))throw new f(Vs);if(yc(t)>M)throw new f(Hs);for(;o.size;)await S.allSettled(e.from(o));await S.allSettled(r.ie.map(t=>t.Me));const c=r.ie.filter(t=>t.error&&!t.Le);if(c.length){const t=c.map(t=>t.error);c.forEach(t=>t.Le=!0);const[e]=t;try{e.entryErrors=t}catch{}throw e}return await async function(t,n,r){const o=Wa(t.ee),{Be:s,We:a,Pe:c}=await async function(t,n,r){const{ee:o,writer:i}=t,s=new w(n);await To(i);let a=0,c=0,u=Za(i),l=Ha(i),d=0;for(const[t,n]of e.from(o.values()).entries()){const{offset:e,rawFilename:f,me:w,ye:p,Se:h,ge:m,be:y,rawExtraField:S,Ee:g,rawComment:b,versionMadeBy:E,de:x,fe:R,pe:z,we:F,he:D,Ze:A,internalFileAttributes:C,externalFileAttributes:I,diskNumberStart:k,uncompressedSize:T,compressedSize:v}=n,_=yc(w,p,h,m,y,S,g),N=q+yc(f,b)+_;Va(i,a+N-c)&&(await Qa(i,s.slice(c,a)),c=a,d=0,await i.closeDisk()),0==t&&(u=Za(i),l=Ha(i)),z||pc(R,18,T),F||pc(R,14,v),(A||D)&&n.version<45&&wc(R,0,45);const U=Pa(N);if(U.He(H),U.Ve(E),U.Ge(x.subarray(0,24)),U.Ve(_),U.Ve(yc(b)),U.Ve(D?M:k),U.Ve(C),U.He(I),U.He(A?O:e),U.Ge(f),U.Ge(w),U.Ge(p),U.Ge(h),U.Ge(m),U.Ge(y),U.Ge(S),U.Ge(g),U.Ge(b),mc(s,U.Pt,a),a+=N,d++,r.onprogress)try{await r.onprogress(t+1,o.size,new yi(n))}catch{}}return await Qa(i,c?s.slice(c):s),{Be:{diskNumber:u,diskOffset:l},We:{diskNumber:Za(i),je:d},Pe:s}}(t,o,r),u=await async function(t,e,n){const r=sc(t,n,kt);if(r){const n=await r(e),o=yc(n);if(o>M)throw new f(Ea);const i=Pa(6+o);i.He(Z),i.Ve(o),i.Ge(n);const{writer:s}=t;return Va(s,yc(i.Pt))&&await s.closeDisk(),await Qa(s,i.Pt),6+o}return 0}(t,c,r);await async function(t,e,n,r){const{writer:o}=t,{Be:s,We:a,qe:c}=r;let{Ke:u}=r,l=t.ee.size,d=s.diskNumber,w=Ga(t,s);const p=yc(e);if(p>M)throw new f(Hs);let h=oc(t,n,ni),m=Za(o);if(Va(o,(h?98:K)+p)&&m++,w>=O||u>=O||l>=M||m>=M){if(!1===h)throw new f(aa);h=!0}const y=Pa(h?98:K);Va(o,yc(y.Pt)+p)&&await o.closeDisk(),m=Za(o);let S=m==a.diskNumber?a.je:0;h&&(y.He(G),y.Ye(44),y.Ve(45),y.Ve(45),y.He(m),y.He(d),y.Ye(S),y.Ye(l),y.Ye(u),y.Ye(w),y.He(j),y.He(m),y.Ye(i(Ga(t,o))+i(u)+i(c)),y.He(m+1),oc(t,n,"supportZip64SplitFile",!0)&&(m=M,d=M),S=M,l=M,w=O,u=O),y.He(V),y.Ve(m),y.Ve(d),y.Ve(S),y.Ve(l),y.He(u),y.He(w),y.Ve(p),await Qa(o,y.Pt),p&&await Qa(o,e)}(t,n,r,{Be:s,We:a,Ke:o,qe:u})}(r,t,n),!ko(s)&&oc(r,n,Ft)||await a.getWriter().close(),s.getData?s.getData():a}}class Ca extends S{then(t,e){const{Xe:n}=this;return n&&(n.Le=!0),super.then(t,e)}}function Ia(t,e){const n=new Ca((t,n)=>S.prototype.then.call(e,t,n)),r={};return n.Xe=r,r.Me=S.prototype.then.call(n,dt,t=>r.error=t),t.ie.push(r),n}async function ka(t,e){try{await t.writer.writable.abort(e)}catch{}}function Ta(t,e,n){t.oe.add(e),e.catch(t=>{try{n(t)}catch{}})}function va(t,n,r){let o=oc(t,r,ei),i=oc(t,r,ii,o?20:768);const s=oc(t,r,ci),a=uc(t,r,"uid"),c=uc(t,r,"gid");let u=uc(t,r,fi),l=oc(t,r,"unixExtraFieldType"),d=oc(t,r,wi),w=oc(t,r,pi),p=oc(t,r,hi);if(Ht(a,O,wa),Ht(c,O,pa),Ht(u,M,ha),l!==dt&&l!==Ra&&l!==za)throw new f(ma);if(l===za&&(a!==dt&&a>M||c!==dt&&c>M))throw new f(ya);l!==dt||a===dt&&c===dt||(l=Ra);let h=uc(t,r,$o),m=oc(t,r,ti);const y=h!==dt||m!==dt;if(a!==dt||c!==dt||u!==dt||l||s?(o=!1,i=i&L|768):y&&(o=!0,i&=L),Ht(h,L,Sa),m&&(typeof m!==ht||e.isArray(m)))throw new f(ga);if(i>M)throw new f(Ys);let S=ac(t,r,Xo,Qo);const g=S!==dt;g||(S=0),!r[ai]&&n.endsWith(at)&&(r[ai]=!0);const b=oc(t,r,ai);if(b?(n.endsWith(at)||(n+=at),g||(S=16,o||(S|=16877<<16))):o||g||(S=s?493<<16:27525120),!o){const t=u!==dt||Boolean(d||w||p);u=u===dt?S>>16&M:u&M,d?u|=it:d=Boolean(u&it),w?u|=st:w=Boolean(u&st),p?u|=512:p=Boolean(512&u),g&&!t||(b?u=-61441&u|ot:u&rt||(u|=32768),S=(u&M)<<16|S&M)}({msdosAttributesRaw:h,msdosAttributes:m}=function(t,e){if(t!==dt)t&=L;else if(e!==dt){const{readOnly:n,hidden:r,system:o,directory:i,archive:s}=e;let a=0;n&&(a|=1),r&&(a|=2),o&&(a|=4),i&&(a|=16),s&&(a|=32),t=a&L}return e===dt&&(e={readOnly:Boolean(1&t),hidden:Boolean(2&t),system:Boolean(4&t),directory:Boolean(16&t),archive:Boolean(32&t)}),{msdosAttributesRaw:t,msdosAttributes:e}}(h,m)),y&&(S=S&O|h&L);const E=S>>16&M,x=u!==dt&&40960==(u&rt);return{name:n,xe:{versionMadeBy:i,msDosCompatible:Boolean(o),externalFileAttributes:S,unixExternalUpper:E,uid:a,gid:c,unixMode:u,unixExtraFieldType:l,symlink:x,setuid:d,setgid:w,sticky:p,msdosAttributesRaw:h,msdosAttributes:m}}}function _a(t,e,n){const r=sc(t,n,"encodeText")||ge;let i=r(e,Tt);if(i===dt&&(i=ge(e)),yc(i)>M)throw new f(Ks);const s=n[Mo]||"";if(typeof s!=mt)throw new f(js);let c=r(s,vt);if(c===dt&&(c=ge(s)),yc(c)>M)throw new f(Gs);const u=oc(t,n,oi);if(u!==dt&&u>M)throw new f(Ys);const l=ic(t,n,Ho,new a),d=oc(t,n,Vo),w=ic(t,n,Go),p=ic(t,n,qo),h=ac(t,n,Yo,Jo,0),m=oc(t,n,bt),y=oc(t,n,St),S=oc(t,n,gt);Pt(y,S);const g=uc(t,n,"encryptionStrength",3),b=oc(t,n,si),E=oc(t,n,"extendedTimestamp",!0),x=oc(t,n,"ntfsTimestamp"),R=oc(t,n,"keepOrder",!0),z=oc(t,n,xt),F=oc(t,n,zt),D=oc(t,n,"bufferedWrite"),A=sc(t,n,"createTempStream"),C=oc(t,n,"dataDescriptorSignature",!0),I=Wt(oc(t,n,Et)),k=oc(t,n,"useUnicodeFileNames",!0),T=oc(t,n,ui),v=m||T===dt?dt:Rn(T);if(!m&&T!==dt&&0!==T&&8!==T&&!v)throw new f("Compression method not supported");let _=uc(t,n,"level");if(Ht(_,9,ba),t.options[Ct]){if(y!==dt||S!==dt)throw new f(Js);_===dt&&T===dt&&(_=0)}m&&(_=dt);let N=oc(t,n,Rt),U=oc(t,n,Dt);D&&U===dt&&(U=!1),(U===dt||b&&!m)&&(U=!0),_!==dt&&6!=_&&(N=!1);const O=oc(t,n,ni);if(!(b||y===dt&&S===dt||o.isInteger(g)&&g>=1&&g<=3))throw new f(Xs);const L=Na(n[di]),B=Na(n.localExtraField),W=Na(n.centralExtraField);return{comment:s,xe:{rawFilename:i,rawComment:c,version:u,lastModDate:l,rawLastModDate:d,lastAccessDate:w,creationDate:p,internalFileAttributes:h,passThrough:m,password:y,rawPassword:S,encryptionStrength:g,zipCrypto:b,extendedTimestamp:E,ntfsTimestamp:x,keepOrder:R,useWebWorkers:z,transferStreams:F,bufferedWrite:D,createTempStream:A,dataDescriptorSignature:C,signal:I,useUnicodeFileNames:k,compressionMethod:T,format:v?v.format:dt,codecURI:v?v.codecURI:dt,Je:v?v.versionNeeded:dt,level:_,useCompressionStream:N,dataDescriptor:U,zip64:O,rawExtraField:L,Qe:B,Ee:W}}}function Na(t){if(!t)return yt;if(!(t instanceof c))throw new f($s);let e=0,n=0;t.forEach((t,n)=>{if(Zt(n,M,ta),!(t instanceof w))throw new f(ea);if(yc(t)>M)throw new f(na);e+=4+yc(t)});const r=new w(e),o=ae(r);return t.forEach((t,e)=>{wc(o,n,e),wc(o,n+2,yc(t)),mc(r,t,n+4),n+=4+yc(t)}),r}function Ua(t,e,n,r,o){const{passThrough:i,zipCrypto:s,password:a,rawPassword:c,encryptionStrength:u}=r;let{dataDescriptor:l,zip64:d,level:w,compressionMethod:p}=r,h=0,m=0;if(i&&e){if(m=o[Bo],m===dt)throw new f(ca);if(p===dt)throw new f(ua)}const y=!0===d,S=oc(t,o,ri);if(e&&i&&!S&&yc(a,c))throw new f(Qs);const g=e&&(Boolean(a&&yc(a)||c&&yc(c))||i&&S);e||(w=0,p=0);const b=g?s?12:16+4*u:0;e&&(i?(o.uncompressedSize=m,h=n===dt?lc(m)+b:n):n===dt?(l=!0,(d||d===dt)&&(d=!0,m=h=4294967296)):(o.uncompressedSize=m=n,h=(dc(p,w)?lc(m):m)+b));const E=!(g||e&&(0!==n||i)||dc(p,w));E&&!s&&oc(t,o,Dt)===dt&&(l=!1);const x=y||m>=O,R=y||h>=O;if(x||R){if(!1===d)throw new f(aa);d=!0}return d=d||!1,{$e:h,xe:{dataDescriptor:l,De:E,zip64:d,pe:x,we:R,uncompressedSize:m,level:w,compressionMethod:p,encrypted:g}}}function Oa(t){const{rawFilename:e,lastModDate:n,rawLastModDate:r,lastAccessDate:o,creationDate:i,level:c,zip64:u,zipCrypto:l,useUnicodeFileNames:d,dataDescriptor:w,directory:p,rawExtraField:h,Qe:m,encryptionStrength:y,extendedTimestamp:S,ntfsTimestamp:g,passThrough:b,encrypted:E,pe:x,we:R,uncompressedSize:z,crc32:F}=t;let{version:D,compressionMethod:A}=t;const C=!p&&dc(A,c);let I;const k=b||!C,T=u&&(t.bufferedWrite||!w||!x&&!R||k),v=T||u&&w&&(x||R);if(u&&(x||R)){const t=20,e=Pa(t);if(e.Ve(1),e.Ve(t-4),I=e.Pt,T&&(e.Ye(z),k)){const t=E?l?12:16+4*y:0;e.Ye(b?0:z+t)}}else I=yt;let _,N,U,O,L;if(E&&!l){const t=Pa(yc(xa)+2);t.Ve(J),t.Ge(xa),_=t.Pt,_[8]=y}else _=yt;if(S){const t=ec(n),e=nc(t);if(e){const e=9+(o?4:0)+(i?4:0),n=Pa(e);O=1+(o?2:0)+(i?4:0),n.Ve(Q),n.Ve(e-4),n.tn(O),n.He(t),o&&n.He(rc(ec(o))),i&&n.He(rc(ec(i))),U=n.Pt}else U=yt;if(g===dt?!e||Boolean(o||i):g)try{const t=tc(n),e=Pa(36);e.Ve(10),e.Ve(32),e.en(4),e.Ve(1),e.Ve(24),e.Ye(t),e.Ye(o?tc(o):t),e.Ye(i?tc(i):t),N=e.Pt}catch{N=yt}else N=yt}else N=U=yt;try{const{uid:e,gid:n,unixExtraFieldType:r}=t;if(r!=Ra||e===dt&&n===dt)if(r!=za||e===dt&&n===dt)L=yt;else{const t=Pa(8);t.Ve(et),t.Ve(4),t.Ve((e===dt?0:e)&M),t.Ve((n===dt?0:n)&M),L=t.Pt}else{const t=La(e===dt?0:e),r=La(n===dt?0:n),o=3+t.length+r.length,i=Pa(4+o);i.Ve(tt),i.Ve(o),i.tn(1),i.tn(t.length),i.Ge(t),i.tn(r.length),i.Ge(r),L=i.Pt}}catch{L=yt}A===dt&&(A=C?8:0),D===dt&&(D=0!=A||p||E?20:10);const{Je:W}=t;C&&W!==dt&&(D=D>W?D:W),u&&(D=D>45?D:45),E&&!l&&(D=D>51?D:51,b&&F!==dt&&(_[4]=1),wc(ae(_),9,A),A=99);const P=v?yc(I):0,Z=P+yc(_,U,N,L,h,m);if(Z+(t[Ct]?67:0)>M)throw new f(na);const H=new a(2e3*s.ceil(s.floor(n.getTime()/1e3)/2)),{de:V,fe:G,rawLastModDate:j}=Sc({version:D,bitFlag:gc(c,d,w,E,A),compressionMethod:A,uncompressedSize:z,lastModDate:H<lt?lt:H>ut?ut:H,rawLastModDate:r,rawFilename:e,we:R,pe:x,extraFieldLength:Z}),q=Pa(ct+yc(e)+Z),K=q.Pt,Y=ae(K);return q.He(B),q.Ge(V),q.Ge(e),v&&q.Ge(I),q.Ge(_),q.Ge(U),q.Ge(N),q.Ge(L),q.Ge(h),q.Ge(m),w&&(R||pc(Y,18,0),x||pc(Y,22,0)),{ze:K,Oe:Y,de:V,fe:G,lastModDate:n,rawLastModDate:j,encrypted:E,compressed:C,version:D,compressionMethod:A,_e:O,me:yt,ve:P,Se:U,ge:N,be:L,ye:_,extraFieldLength:Z}}function Ma(t,e){const{Ae:n}=t;let{ze:r,extraFieldLength:o}=n,i=64-(e+yc(r))%64;i<4&&(i+=64);const s=new w(i),a=ae(s);wc(a,0,$),wc(a,2,i-4);const c=r;n.ze=r=new w(yc(c)+i),mc(r,c),mc(r,s,yc(c));const u=ae(r);wc(u,28,o+i),n.Oe=u,t.Te+=i}function La(t){const e=new w(4);ae(e).setUint32(0,t,!0);let n=4;for(;n>1&&0===e[n-1];)n--;return e.subarray(0,n)}function Ba({zip64:t,dataDescriptor:e,dataDescriptorSignature:n}){let r,o=yt,i=0,s=t?20:12;return n&&(s+=4),e&&(o=new w(s),r=ae(o),n&&(i=4,pc(r,0,P))),{Fe:o,Ne:r,Ue:i}}function Wa(t){let e=0;for(const[,n]of t){const{rawFilename:t,ye:r,rawComment:o,ge:i,be:s,rawExtraField:a,Ee:c,extendedTimestamp:u,_e:l,lastModDate:d,pe:w,we:p,uncompressedSize:h,compressedSize:m}=n,y=n.offset>=O,S=n.diskNumberStart>=M;let g,b;if(y||S||w||p){const t=4+(w?8:0)+(p?8:0)+(y?8:0)+(S?4:0),e=Pa(t);e.Ve(1),e.Ve(t-4),w&&e.Ye(h),p&&e.Ye(m),y&&e.Ye(n.offset),S&&e.He(n.diskNumberStart),g=e.Pt}else g=yt;n.me=g,n.Ze=y,n.he=S;const E=ec(d);if(u&&nc(E)){const t=Pa(9);t.Ve(Q),t.Ve(5),t.tn(l),t.He(E),b=t.Pt}else b=yt;n.Se=b;const x=yc(g,r,i,s,b,a,c);if(x>M)throw new f(na);e+=q+yc(t,o)+x}return e}function Pa(t){const e=new w(t),n=ae(e);let r=0;return{Pt:e,tn:t=>{!function(t,e,n){t.setUint8(e,n)}(n,r,t),r+=1},Ve:t=>{wc(n,r,t),r+=2},He:t=>{pc(n,r,t),r+=4},Ye:t=>{hc(n,r,i(t)),r+=8},Ge:t=>{mc(e,t,r),r+=yc(t)},en:t=>r+=t}}function Za(t){const{diskNumber:e=0}=t;return e}function Ha(t){const{diskOffset:e=0}=t;return e}function Va(t,e){const{availableSize:n=ft}=t;return e>n}function Ga(t,{diskNumber:e=0,diskOffset:n=0}){return t.offset-n-(e?t.re:0)}function ja(t){const e=ae(t);let n=0;for(;n+4<=yc(t);){const r=4+fc(e,n+2);if(1==fc(e,n))return ja(ie(t.subarray(0,n),t.subarray(s.min(n+r,yc(t)))));n+=r}return t}async function qa(t,e,n,r){if(r>0){const{writer:o}=t;let i=0;try{await $a(No(e,{offset:n,size:r}),o,dt,t=>i+=t)}catch(e){t.hasCorruptedEntries=!0;try{e.corruptedEntry=!0}catch{}throw e}finally{o.size+=i,t.offset+=i}}}async function Ka(t,e){const n=await _o(t,e,ct);if(yc(n)<ct)return ct;const r=ae(n);return ct+fc(r,26)+fc(r,28)}function Ya(t,{offset:e,diskNumberStart:n}){return e+(t.jt?t.jt(n):0)}function Xa(){const t=new w(4);return pc(ae(t),0,W),t}async function Ja(t,e){delete t.te,await Qa(e,Xa()),t.offset+=4}async function Qa(t,e){const{writable:n}=t,r=n.getWriter();try{await r.ready,t.size+=yc(e),await r.write(e)}finally{r.releaseLock()}}async function $a(t,e,n,r){const o=e.writable.getWriter();try{await t.pipeTo(new D({async write(t){await o.ready,await o.write(t),r(yc(t))}}),{preventClose:!0,preventAbort:!0,signal:n})}finally{o.releaseLock()}}function tc(t){if(t){const e=(i(t.getTime())+i(116444736e5))*i(1e4);return e<ia?ia:e>sa?sa:e}}function ec(t){return s.floor(t.getTime()/1e3)}function nc(t){return t>=ra&&t<=oa}function rc(t){return s.min(oa,s.max(ra,t))}function oc(t,e,n,r){const o=e[n]===dt?t.options[n]:e[n];return o===dt?r:o}function ic(t,e,n,r){const i=oc(t,e,n,r);if(null===i)return r;if(i!==dt&&(typeof i.getTime!=pt||o.isNaN(i.getTime())))throw new f(qs);return i}function sc(t,e,n){return Bt(oc(t,e,n))}function ac(t,e,n,r,o){const i=cc(e,n,r),s=i===dt?cc(t.options,n,r):i;return s===dt?o:s}function cc(t,e,n){return t[e]===dt?t[n]:t[e]}function uc(t,e,n,r){return Vt(oc(t,e,n,r))}function lc(t){return t+5*(s.floor(t/16383)+1)}function dc(t,e){return t===dt?e===dt||e>0:0!==t}function fc(t,e){return t.getUint16(e,!0)}function wc(t,e,n){t.setUint16(e,n,!0)}function pc(t,e,n){t.setUint32(e,n,!0)}function hc(t,e,n){t.setBigUint64(e,n,!0)}function mc(t,e,n){t.set(e,n)}function yc(...t){let e=0;return t.forEach(t=>t&&(e+=t.length)),e}function Sc({version:t,bitFlag:e,compressionMethod:n,uncompressedSize:r,compressedSize:o,lastModDate:i,rawLastModDate:s,rawFilename:a,we:c,pe:u,extraFieldLength:l}){const d=Pa(26),f=d.Pt,w=ae(f);if(d.Ve(t),d.Ve(e),d.Ve(n),s===dt){const t=new h(1),e=ae(t);wc(e,0,(i.getHours()<<6|i.getMinutes())<<5|i.getSeconds()/2),wc(e,2,(i.getFullYear()-1980<<4|i.getMonth()+1)<<5|i.getDate()),s=t[0]}return d.He(s),d.en(4),c||o!==dt?d.He(c?O:o):d.en(4),u||r!==dt?d.He(u?O:r):d.en(4),d.Ve(yc(a)),d.Ve(l),{de:f,fe:w,rawLastModDate:s}}function gc(t,e,n,r,o){let i=0;return e&&(i|=nt),n&&(i|=8),8!=o&&9!=o||(t>=0&&t<=3&&(i|=6),t>3&&t<=5&&(i|=4),9==t&&(i|=2)),r&&(i|=1),i}function bc(t,e){if(!t)return!1;const{nn:n}=t;return n?n.includes(e):Ln(t,e)}const Ec=1048576,xc=".zip.js-temp",Rc=1048576,zc=1048576,Fc=".zip.js-temp",Dc="createSyncAccessHandle is only available in dedicated workers";try{!function(t){const e=ne(oe(t));n.assign(qt,e),n.assign(Qt,e)}({baseURI:void 0===E&&"undefined"==typeof location?require("url").pathToFileURL(__filename).href:void 0===E?location.href:U&&"SCRIPT"===U.tagName.toUpperCase()&&U.src||new d("zip-fs-core.min.js",E.baseURI).href})}catch{}const Ac="Entry filename already exists",Cc="Readable stream already consumed",Ic="Invalid passThrough option (use readerOptions.passThrough or set uncompressedSize for each entry)",kc="Invalid readerOptions (must be an object)",Tc="The last modification date of an entry encrypted with ZipCrypto cannot be changed when passThrough is set",vc="zipjs-abort-export",_c="The operation was aborted",Nc=new u([1,J,10,Q,28789,25461,$,tt,et,22613,13]);class Uc{constructor(t,e,r,o){const i=this;if(t.root&&o&&o.getChildByName(e))throw new f(Ac);r||(r={}),n.assign(i,{fs:t,name:e,data:r.data,options:r.options&&n.assign({},r.options),id:t.rn++,parent:o,children:[],uncompressedSize:r.uncompressedSize||0,sn:r.sn||r.uncompressedSize===dt,passThrough:r.passThrough,an:r.an||new a}),!o&&t.root||(t.entries[i.id]=i),o&&i.parent.children.push(i)}getFullname(){return this.getRelativeName()}getRelativeName(t=this.fs.root){let e=this.name,n=this.parent;for(;n&&n!=t;)e=(n.name?n.name+"/":"")+e,n=n.parent;return e}isDescendantOf(t){let e=this.parent;for(;e&&e.id!=t.id;)e=e.parent;return Boolean(e)}rename(t){const e=this.parent;if(e&&e.getChildByName(t))throw new f(Ac);this.name=t}setOptions(t){const e=n.assign({},this.options,t);this.options=n.fromEntries(n.entries(e).filter(([,t])=>t!==dt))}}class Oc extends Uc{constructor(t,e,n,r){super(t,e,n,r);const o=this;o.Reader=n.Reader,o.Writer=n.Writer,n.getData&&(o.getData=n.getData)}clone(){return new Oc(this.fs,this.name,this)}async getData(t,e={}){const n=this;if(!t||t.constructor==n.Writer&&n.data&&function(t,e){const{contentType:n}=t;return n===dt||(t.constructor==eo?e.type==n:t.constructor!=Jr||e.startsWith("data:"+(n||"")+";base64,"))}(t,n.data))return n.data;{const r=n.reader=Gc(n.Reader,n.data,e),o=n.uncompressedSize||r.size;await S.all([To(r),To(t,o)]);const i=Wt(e.signal),s=function(t,e,n,r){const{onstart:o,onprogress:i,onend:s}=n,{readable:a}=e;return t.data instanceof yi||!o&&!i&&!s?a:pn(a).pipeThrough(new rr({onstart:o,onprogress:i,onend:s,size:e.size}),{signal:r})}(n,r,e,i),a=!ko(t)&&Boolean(e.preventClose);return n.uncompressedSize=r.size,await pn(s).pipeTo(mn(t.writable),{signal:i,preventClose:a,preventAbort:a}),t.getData?t.getData():t.writable}}isPasswordProtected(){return Boolean(this.data&&this.data.encrypted)}async checkPassword(t,e={}){const r=this;if(!r.isPasswordProtected())return!0;try{return await r.data.getData(null,n.assign({},e,{password:t,checkPasswordOnly:!0})),!0}catch(t){if(t.message==Fe)return!1;throw t}}getText(t,e){return this.getData(new oo(t),e)}getBlob(t,e){return this.getData(new eo(t),e)}getData64URI(t,e){return this.getData(new Jr(t),e)}getUint8Array(t){return this.getData(new Fo,t)}getWritable(t=new D,e){return this.getData({writable:t},e)}async getArrayBuffer(t){return se(await this.getUint8Array(t)).buffer}replaceBlob(t){n.assign(this,{data:t,Reader:to,Writer:eo,reader:null})}replaceText(t){n.assign(this,{data:t,Reader:no,Writer:oo,reader:null})}replaceData64URI(t){n.assign(this,{data:t,Reader:Xr,Writer:Jr,reader:null})}replaceUint8Array(t){n.assign(this,{data:t,Reader:zo,Writer:Fo,reader:null})}replaceReadable(t){n.assign(this,{data:null,Reader:Hc(t),Writer:null,reader:null})}}class Mc extends Uc{constructor(t,e,n,r){super(t,e,n,r),this.directory=!0}clone(t){const e=this,n=new Mc(e.fs,e.name,e);return t&&(n.children=e.children.map(e=>{const r=e.clone(t);return r.parent=n,r})),n}addDirectory(t,e){return ru(this,t,{options:e},!0)}addText(t,e,n={}){return ru(this,t,{data:e,Reader:no,Writer:oo,options:n,uncompressedSize:ro(e)})}addBlob(t,e,n={}){return ru(this,t,{data:e,Reader:to,Writer:eo,options:n,uncompressedSize:e.size})}addData64URI(t,e,n={}){let r=e.length;for(;"="==e.charAt(r-1);)r--;const o=e.indexOf(",")+1;return ru(this,t,{data:e,Reader:Xr,Writer:Jr,options:n,uncompressedSize:s.floor(.75*(r-o))})}addUint8Array(t,e,n={}){return ru(this,t,{data:e,Reader:zo,Writer:Fo,options:n,uncompressedSize:e.length})}addHttpContent(t,e,n={}){return ru(this,t,{data:e,Reader:class extends Ro{constructor(t){super(t,n)}},options:n})}addReadable(t,e,n={}){return ru(this,t,{Reader:Hc(e),options:n})}addFileSystemEntry(t,e={}){return tu(this,t,e)}addFileSystemHandle(t,e={}){return tu(this,t,e)}addFile(t,e={}){return(e=n.assign({},e)).lastModDate||(e.lastModDate=new a(t.lastModified)),ru(this,t.name,{data:t,Reader:function(){return{readable:t.stream(),size:t.size}},options:e,uncompressedSize:t.size})}importBlob(t,e){return this.importZip(new to(t),e)}importData64URI(t,e){return this.importZip(new Xr(t),e)}importUint8Array(t,e){return this.importZip(new zo(t),e)}importHttpContent(t,e){return this.importZip(new Ro(t,e),e)}importReadable(t,e){return this.importZip({readable:t},e)}exportBlob(t={}){return this.exportZip(new eo(t.mimeType||"application/zip"),t)}exportData64URI(t={}){return this.exportZip(new Jr(t.mimeType||"application/zip"),t)}exportUint8Array(t={}){return this.exportZip(new Fo,t)}async exportWritable(t=new D,e={}){return await this.exportZip({writable:t},e),t}exportFileSystemHandle(t,e={}){return async function(t,e,r){const{onstart:o,onprogress:i,onend:s}=r,a=Jc(r.readerOptions),c=new AbortController,{signal:u}=c,l=function(t,e){if(!Wt(t))return()=>{};if(t.aborted)return e.abort(t.reason),()=>{};const n=()=>e.abort(t.reason);return t.addEventListener("abort",n,{once:!0}),()=>t.removeEventListener("abort",n)}(r.signal,c),d=n.assign({},r,a,{signal:u,onstart:dt,onprogress:dt,onend:dt,preventClose:!1}),w=Wc([t],t=>Zc(t,d.passThrough)),p=[];let h=!1,m=0;try{o&&await or(o,w),await g(t,e),s&&await or(s,m)}catch(t){try{t.exportedEntryNames=p}catch{}throw t}finally{l()}return e;function y(t){const e=t.getWriter();return new D({async write(t){await e.write(t),m+=t.length,i&&await or(i,m,w)},close:()=>e.close(),abort:t=>e.abort(t)})}async function g(t,e){if(r.concurrent){const n=(await S.allSettled(t.children.map(t=>b(t,e)))).filter(t=>"rejected"==t.status);if(n.length){const t=n.filter(t=>!Kc(t.reason));throw function(t){const[e]=t,n=t.slice(1).flatMap(t=>[t,...t&&t.entryErrors||[]]).filter(t=>t!==e);if(n.length)try{e.entryErrors=[...e.entryErrors||[],...n]}catch{}return e}((t.length?t:n).map(t=>t.reason))}}else for(const n of t.children)await b(n,e)}async function b(e,n){if(u.aborted){if(h||Kc(u.reason))return;throw u.reason===dt?new DOMException(_c,"AbortError"):u.reason}try{if(e.directory){const t=await n.getDirectoryHandle(e.name,{create:!0});await g(e,t)}else{const r=await n.getFileHandle(e.name,{create:!0}),o=await r.createWritable();try{await e.getData({writable:y(o)},d)}catch(t){throw h?new f(vc):t}p.push(e.getRelativeName(t))}}catch(n){h=!0,c.abort(new f(vc));try{n.entryName===dt&&(n.entryName=e.getRelativeName(t),n.entryId=e.id)}catch{}throw n}}}(this,t,e)}async importZip(t,e={}){let r;t&&typeof t.getEntries==pt?(r=t,e=n.assign({},r.options,e)):(await To(t),r=new os(t,e));const o=[],i=await r.getEntries(e);for(const t of i){let r=this;try{const i=t.filename.split("/").filter(t=>""!=t&&"."!=t),s=i.pop();if(i.forEach(t=>{const e=r;if(r=r.getChildByName(t),r){if(!r.directory)throw new f(Ac)}else r=new Mc(this.fs,t,{data:null},e),o.push(r)}),t.directory){let e=r;if(s)if(e=r.getChildByName(s),e){if(!e.directory)throw new f(Ac)}else e=new Mc(this.fs,s,{data:null},r),o.push(e);e==this||e.data||(e.data=t)}else o.push(ru(r,s,{data:t,Reader:Vc(n.assign({},e)),uncompressedSize:e.passThrough?t.compressedSize:t.uncompressedSize,passThrough:e.passThrough}))}catch(e){try{e.cause={entry:t}}catch{}throw e}}return o}async exportZip(t,e={}){const r=this;(e=n.assign({},e)).bufferedWrite===dt&&(e.bufferedWrite=!0);const[o]=await S.all([jc(r,Jc(e.readerOptions)),To(t)]),i=new Aa(t,e);return await async function(t,e,r,o,i){const{onstart:s,onprogress:a,onend:c,onentryprogress:u}=o,l=e,d=Wc(e.children,t=>$c(t)?0:1);let f=0,w=0;if(s&&await or(s,r),o.bufferedWrite)await async function t(e){const n=(await S.allSettled(e.children.map(async e=>{await p(e),await t(e)}))).find(t=>"rejected"==t.status);if(n)throw n.reason}(e);else for(const t of e.getChildren({recursive:!0}))await p(t);async function p(e){if($c(e))return;const{name:s,cn:c}=Yc(e,l,o);let p=0;const h=await t.add(s,i.get(e),n.assign(c,{onstart:dt,onend:dt,onprogress:async t=>{f+=t-p,p=t,a&&await or(a,f,r)}}));w++,u&&await or(u,w,d,h)}c&&await or(c,f)}(i,r,Wc([r],Pc),e,o),await i.close(e.globalComment),t.getData?t.getData():t.writable}getExportedSize(t={}){const e=this;Jc((t=n.assign({},t)).readerOptions),t.bufferedWrite===dt&&(t.bufferedWrite=!0);const r=e.getChildren({recursive:!0}).filter(t=>!$c(t)).map(n=>{const{name:r,cn:o}=Yc(n,e,t);return{name:r,size:n.directory?0:Xc(n,Qc(n,t)),options:o}}),o=!t.bufferedWrite||r.every(t=>!1!==t.options.keepOrder)&&e.children.every(t=>!t.children.length);return async function(t,e,r,o){const i={options:t};if(Bt(t[kt]))throw new f(la);if(o!==dt&&!(o instanceof w))throw new f(Vs);const a=yc(o);if(a>M)throw new f(Hs);const u=t[Ct],l=new c,d=t[At]===dt?0:t[At];let p=d,h=ft;for(const t of e){let{name:e}=t;const{size:r}=t,o=n.assign({},t.options);oc(i,o,ai)&&!e.endsWith(at)&&(e+=at);const a=va(i,e,o);({name:e}=a);const{xe:c}=_a(i,e,o);0==c.level||c.compressionMethod!==dt||c.passThrough||await tr($t())||(c.level=0);const d=!oc(i,o,ai);if(d&&r===dt)throw new f(la);const{$e:w,xe:m}=Ua(i,d,r,c,o);if(d&&!c.passThrough&&dc(m.compressionMethod,m.level))throw new f(la);const y=n.assign({},o,a.xe,c,m,{[Ct]:u}),S=Oa(y),g=Ba(y),b={Ae:S,Te:yc(S.ze,g.Fe)};u&&Ma(b,p);const E=d?w:0;l.set(e,n.assign({},y,S,{offset:p,diskNumberStart:0,compressedSize:E}));const x=b.Te+E;h=s.min(h,x),p+=x}if(l.size>1&&(u||p-h>=O)&&!r)throw new f(la);const m=Wa(l);let y=oc(i,t,ni);if(p>=O||m>=O||l.size>=M){if(!1===y)throw new f(aa);y=!0}return p-d+m+a+(y?98:K)}(t,r,o,t.globalComment)}getChildByName(t){const e=this.children;for(let n=0;n<e.length;n++){const r=e[n];if(r.name==t)return r}}getChildren(t={}){return function(t,e){const n=[],r=[t];let o=0;for(;o<r.length;)for(const t of r[o++].children)n.push(t),e&&r.push(t);return n}(this,t.recursive)}isPasswordProtected(){const t=this.children;for(let e=0;e<t.length;e++)if(t[e].isPasswordProtected())return!0;return!1}async checkPassword(t,e={}){const n=this.children;return!(await S.all(n.map(n=>n.checkPassword(t,e)))).includes(!1)}}class Lc{constructor(){nu(this)}get children(){return this.root.children}remove(t){qc(t);const e=[t];for(;e.length;){const t=e.pop();this.entries[t.id]=null;for(const n of t.children)e.push(n)}t.parent=dt}move(t,e){if(t==this.root)throw new f("Root directory cannot be moved");if(!e.directory)throw new f("Target entry is not a directory");if(e.isDescendantOf(t))throw new f("Entry is a ancestor of target entry");if(t!=e){const n=e.getChildByName(t.name);if(n){if(n!=t)throw new f(Ac)}else qc(t),t.parent=e,e.children.push(t),function(t,e){const n=[e];for(;n.length;){const e=n.pop();t.entries[e.id]=e;for(const t of e.children)n.push(t)}}(this,t)}}find(t){const e=t.split("/");let n=this.root;for(let t=0;n&&t<e.length;t++)n=n.getChildByName(e[t]);return n||(n=this.entries.find(e=>e&&(e==this.root||e.isDescendantOf(this.root))&&e.getRelativeName()==t)),n}getById(t){return this.entries[t]}getChildByName(t){return this.root.getChildByName(t)}getChildren(t){return this.root.getChildren(t)}addDirectory(t,e){return this.root.addDirectory(t,e)}addText(t,e,n){return this.root.addText(t,e,n)}addBlob(t,e,n){return this.root.addBlob(t,e,n)}addData64URI(t,e,n){return this.root.addData64URI(t,e,n)}addUint8Array(t,e,n){return this.root.addUint8Array(t,e,n)}addHttpContent(t,e,n){return this.root.addHttpContent(t,e,n)}addReadable(t,e,n){return this.root.addReadable(t,e,n)}addFileSystemEntry(t,e){return this.root.addFileSystemEntry(t,e)}addFileSystemHandle(t,e){return this.root.addFileSystemHandle(t,e)}addFile(t,e){return this.root.addFile(t,e)}importBlob(t,e){return nu(this),this.root.importBlob(t,e)}importData64URI(t,e){return nu(this),this.root.importData64URI(t,e)}importUint8Array(t,e){return nu(this),this.root.importUint8Array(t,e)}importHttpContent(t,e){return nu(this),this.root.importHttpContent(t,e)}importReadable(t,e){return nu(this),this.root.importReadable(t,e)}importZip(t,e){return nu(this),this.root.importZip(t,e)}exportBlob(t){return this.root.exportBlob(t)}exportData64URI(t){return this.root.exportData64URI(t)}exportUint8Array(t){return this.root.exportUint8Array(t)}exportWritable(t,e){return this.root.exportWritable(t,e)}exportFileSystemHandle(t,e){return this.root.exportFileSystemHandle(t,e)}exportZip(t,e){return this.root.exportZip(t,e)}getExportedSize(t){return this.root.getExportedSize(t)}isPasswordProtected(){return this.root.isPasswordProtected()}checkPassword(t,e){return this.root.checkPassword(t,e)}}const Bc={FS:Lc,ZipDirectoryEntry:Mc,ZipFileEntry:Oc};function Wc(t,n){let r=0;const o=e.from(t);for(;o.length;){const t=o.pop();r+=n(t)||0;for(const e of t.children)o.push(e)}return r}function Pc(t){return t.uncompressedSize}function Zc(t,e){const{data:n}=t;return e&&n instanceof yi?n.compressedSize:t.uncompressedSize}function Hc(t){let e;return function(){if(e)throw new f(Cc);return e=!0,{readable:t}}}function Vc(t){return class extends Kr{constructor(t,e={}){super(),this.entry=t,this.options=e}async init(){const e=this,r=n.assign({},t,e.options),{checkOverlappingEntry:o,checkOverlappingEntryOnly:i}=r,s=await e.entry.getData(new eo,n.assign(r,{checkPasswordOnly:!1,checkOverlappingEntry:i||o,checkOverlappingEntryOnly:!1,preventClose:!1}));e.data=s,e.un=new to(s),e.size=s.size,super.init()}readUint8Array(t,e){return this.un.readUint8Array(t,e)}}}function Gc(t,e,n){return t.prototype?new t(e,n):t(e,n)}async function jc(t,e){const n=[],r=[t],o=new c;for(;r.length;){const t=r.pop();for(const e of t.children)e.directory?r.push(e):n.push(e)}return await S.all(n.map(async t=>{const n=t.reader=Gc(t.Reader,t.data,e);o.set(t,n);try{await To(n)}catch(e){try{e.entryId=t.id,e.cause={entry:t}}catch{}throw e}n.size!==dt&&(t.uncompressedSize=n.size,t.sn=!1)})),o}function qc(t){if(t.parent){const e=t.parent.children;e.forEach((n,r)=>{n.id==t.id&&e.splice(r,1)})}}function Kc(t){return Boolean(t)&&t.message==vc}function Yc(t,e,r){const o=r.relativePath?t.getRelativeName(e):t.getFullname(),i=t.options||{};let u={},l={};if(t.data instanceof yi){const{externalFileAttributes:e,versionMadeBy:o,comment:d,lastModDate:w,rawLastModDate:p,creationDate:h,lastAccessDate:m,uncompressedSize:y,encrypted:S,zipCrypto:g,crc32:b,compressionMethod:E,extraFieldAES:x,internalFileAttributes:R,extraField:z,bitFlag:F,uid:D,gid:A}=t.data;u={externalFileAttributes:e,versionMadeBy:o,comment:d,lastModDate:w,creationDate:h,lastAccessDate:m,internalFileAttributes:R};const C=function(t){if(t){const e=new c;if(t.forEach((t,n)=>{Nc.has(n)||e.set(n,t.data)}),e.size)return e}}(z);if(C&&(u.extraField=C),D===dt&&A===dt||n.assign(u,{uid:D,gid:A,unixExtraFieldType:"infozip"}),Qc(t,r)){let t;x&&(t=x.strength),l={passThrough:!0,encrypted:S,zipCrypto:g,crc32:b,uncompressedSize:y,encryptionStrength:t,compressionMethod:E},F&&(l.dataDescriptor=F.dataDescriptor);const e=i.lastModDate===dt?r.lastModDate:i.lastModDate;if(e===dt)l.rawLastModDate=p;else if(g&&(!F||F.dataDescriptor)&&e instanceof a&&function(t){let e=new a(2e3*s.ceil(s.floor(t.getTime()/1e3)/2));return e<lt?e=lt:e>ut&&(e=ut),(e.getHours()<<3|e.getMinutes()>>3)&L}(e)!=(p>>>8&L))throw new f(Tc)}}const d=n.assign({lastModDate:t.an},u,r,i,l,{directory:t.directory});if(!t.directory&&d.passThrough&&d.uncompressedSize===dt)throw new f(Ic);return{name:o,cn:d}}function Xc(t,e){const{reader:n}=t;return n&&n.size!==dt?n.size:t.sn?dt:Zc(t,e)}function Jc(t){if(t&&(typeof t!=ht||e.isArray(t)))throw new f(kc);return t}function Qc(t,e){const{readerOptions:n}=e;return Boolean(!t.directory&&(t.passThrough||n&&n.passThrough))}function $c(t){return t.directory&&null===t.data}function tu(t,e,r){return async function t(e,o,i,s=""){if(o){const c=s?s+"/"+o.name:o.name;try{if((o.isFile||o.isDirectory)&&(o=await eu(o)),"file"==o.kind){const t=await o.getFile();i.push(ru(e,t.name,{Reader:function(){return{readable:t.stream(),size:t.size}},options:n.assign({},{lastModDate:new a(t.lastModified)},r),uncompressedSize:t.size}))}else if("directory"==o.kind){const n=e.addDirectory(o.name,r);i.push(n);for await(const e of o.values())await t(n,e,i,c)}}catch(t){try{t.entryName===dt&&(t.entryName=c)}catch{}throw t}}return i}(t,e,[])}async function eu(t){const e={name:t.name};if(t.isFile&&(e.kind="file",e.getFile=()=>new S((e,n)=>t.file(e,n))),t.isDirectory){e.kind="directory";const n=await async function(t){const e=[];function n(t,r,o){t.readEntries(async i=>{if(i.length){for(const t of i)e.push(await eu(t));n(t,r,o)}else r(e)},o)}return await new S((e,r)=>n(t.createReader(),e,r)),{[T.iterator](){let t=0;return{next(){const n={value:e[t],done:t==e.length};return t++,n}}}}}(t);e.values=()=>n}return e}function nu(t){t.entries=[],t.rn=0,t.root=new Mc(t)}function ru(t,e,n,r){if(t.directory)return r?new Mc(t.fs,e,n,t):new Oc(t.fs,e,n,t);throw new f("Parent entry is not a directory")}t.BlobReader=to,t.BlobWriter=eo,t.Data64URIReader=Xr,t.Data64URIWriter=Jr,t.ERR_ABORTED=_c,t.ERR_AMBIGUOUS_ARCHIVE=ki,t.ERR_BAD_FORMAT=Si,t.ERR_CENTRAL_DIRECTORY_NOT_FOUND=Ei,t.ERR_DUPLICATED_NAME=Zs,t.ERR_ENCRYPTED=zi,t.ERR_ENCRYPTED_CENTRAL_DIRECTORY=Ti,t.ERR_ENTRY_DATA_OUT_OF_BOUNDS=Ii,t.ERR_ENTRY_EXISTS=Ac,t.ERR_EOCDR_LOCATOR_ZIP64_NOT_FOUND=bi,t.ERR_EOCDR_NOT_FOUND=gi,t.ERR_EXTRAFIELD_ZIP64_NOT_FOUND=Ri,t.ERR_HTTP_RANGE=Or,t.ERR_HTTP_RESOURCE_CHANGED=Mr,t.ERR_INVALID_AUTHENTICATION_CODE=Ae,t.ERR_INVALID_CODEC_DEFINITION=yn,t.ERR_INVALID_CODEC_MODULE=gn,t.ERR_INVALID_COMMENT=Hs,t.ERR_INVALID_COMMENT_TYPE=Vs,t.ERR_INVALID_COMPRESSED_DATA=Cn,t.ERR_INVALID_CRC32=In,t.ERR_INVALID_DATE=qs,t.ERR_INVALID_ENCRYPTION_STRENGTH=Xs,t.ERR_INVALID_ENTRY_COMMENT=Gs,t.ERR_INVALID_ENTRY_COMMENT_TYPE=js,t.ERR_INVALID_ENTRY_NAME=Ks,t.ERR_INVALID_EXTRAFIELD=$s,t.ERR_INVALID_EXTRAFIELD_DATA=na,t.ERR_INVALID_EXTRAFIELD_DATA_TYPE=ea,t.ERR_INVALID_EXTRAFIELD_TYPE=ta,t.ERR_INVALID_FILENAME_VALIDATION=Ni,t.ERR_INVALID_FUNCTION_OPTION=Ot,t.ERR_INVALID_GID=pa,t.ERR_INVALID_LEVEL=ba,t.ERR_INVALID_MAX_APPENDED_DATA_SIZE=Ui,t.ERR_INVALID_MAX_WORKERS=Gt,t.ERR_INVALID_MSDOS_ATTRIBUTES=Sa,t.ERR_INVALID_MSDOS_DATA=ga,t.ERR_INVALID_PASSWORD=Fe,t.ERR_INVALID_PASSWORD_TYPE=Lt,t.ERR_INVALID_PASS_THROUGH=Ic,t.ERR_INVALID_READER_OPTIONS=kc,t.ERR_INVALID_SIGNAL=Mt,t.ERR_INVALID_SIGNATURE=De,t.ERR_INVALID_SIGNATURE_DATA=Ea,t.ERR_INVALID_STRICTNESS=_i,t.ERR_INVALID_UID=wa,t.ERR_INVALID_UNCOMPRESSED_SIZE=An,t.ERR_INVALID_UNIX_EXTRA_FIELD_TYPE=ma,t.ERR_INVALID_UNIX_ID_SIZE=ya,t.ERR_INVALID_UNIX_MODE=ha,t.ERR_INVALID_VERSION=Ys,t.ERR_ITERATOR_COMPLETED_TOO_SOON=Lr,t.ERR_LOCAL_FILE_HEADER_NOT_FOUND=xi,t.ERR_OVERLAPPING_ENTRY=Ci,t.ERR_READABLE_CONSUMED=Cc,t.ERR_RESERVED_COMPRESSION_METHOD=Sn,t.ERR_SPLIT_ZIP_FILE=Ai,t.ERR_UNDEFINED_COMPRESSION_METHOD=ua,t.ERR_UNDEFINED_READER=da,t.ERR_UNDEFINED_UNCOMPRESSED_SIZE=ca,t.ERR_UNDETERMINED_SIZE=la,t.ERR_UNSAFE_FILENAME=vi,t.ERR_UNSUPPORTED_COMPRESSION=Di,t.ERR_UNSUPPORTED_CONTEXT=Dc,t.ERR_UNSUPPORTED_CRYPTO_API=Ie,t.ERR_UNSUPPORTED_ENCRYPTION=Fi,t.ERR_UNSUPPORTED_ENCRYPTION_PASS_THROUGH=Qs,t.ERR_UNSUPPORTED_ENCRYPTION_USDZ=Js,t.ERR_UNSUPPORTED_FORMAT=aa,t.ERR_UNSUPPORTED_UINT64=Oi,t.ERR_WORKER_STARTUP_TIMEOUT=Xn,t.ERR_WRITER_NOT_INITIALIZED=Br,t.ERR_ZIP_CRYPTO_LAST_MOD_DATE=Tc,t.ERR_ZIP_NOT_EMPTY=fa,t.HttpRangeReader=class extends Ro{constructor(t,e={}){super(t,n.assign({},e,{useRangeHeader:!0}))}},t.HttpReader=Ro,t.Reader=Kr,t.SplitDataReader=Do,t.SplitDataWriter=Ao,t.TextReader=no,t.TextWriter=oo,t.Uint8ArrayReader=zo,t.Uint8ArrayWriter=Fo,t.VERSION="2.9.0",t.WARNING_APPENDED_DATA=Hi,t.WARNING_COMPRESSED_PATCHED_DATA=Bi,t.WARNING_DUPLICATE_FILENAME=qi,t.WARNING_MALFORMED_EXTRA_FIELD=Wi,t.WARNING_MISMATCHED_LOCAL_FILE_HEADER_BIT_FLAG=Yi,t.WARNING_MISMATCHED_LOCAL_FILE_HEADER_COMPRESSION_METHOD=Xi,t.WARNING_MISMATCHED_LOCAL_FILE_HEADER_CRC32_OR_SIZES=Ji,t.WARNING_MISMATCHED_ZIP64_END_OF_CENTRAL_DIRECTORY=Ki,t.WARNING_PREPENDED_CENTRAL_DIRECTORY=Gi,t.WARNING_PREPENDED_DATA=Vi,t.WARNING_TRAILING_CENTRAL_DIRECTORY_DATA=ji,t.WARNING_UNKNOWN_VERSION=Li,t.WARNING_UNKNOWN_ZIP64_EXTENSIBLE_DATA=Pi,t.WARNING_UNSORTED_CENTRAL_DIRECTORY=Mi,t.WARNING_WRAPPED_ENTRIES_COUNT=Zi,t.Writer=Yr,t.ZipDirectoryEntry=Mc,t.ZipEntry=Uc,t.ZipFS=Lc,t.ZipFileEntry=Oc,t.ZipReader=os,t.ZipReaderStream=is,t.ZipWriter=Aa,t.ZipWriterStream=class{constructor(t={}){const{readable:e,writable:n}=new z;this.readable=e,this.zipWriter=new Aa(n,t),this.oe=new u}transform(t){const e=this.zipWriter;let n;const{readable:r,writable:o}=new z({start(t){n=t},flush:()=>{!async function(){try{await e.close()}catch(t){await ka(e,t)}}()}});return Ta(this,this.zipWriter.add(t,r),t=>n.error(t)),{readable:this.readable,writable:o}}writable(t){let e;const{readable:n,writable:r}=new z({start(t){e=t}});return Ta(this,this.zipWriter.add(t,n),t=>e.error(t)),r}async close(t,n={}){const{zipWriter:r}=this,o=(await S.allSettled(e.from(this.oe))).filter(t=>"rejected"==t.status).map(t=>t.reason);if(o.length){const[t]=o;try{t.entryErrors=o}catch{}throw await ka(r,t),t}try{return await r.close(t,n)}catch(t){throw await ka(r,t),t}}},t.configure=function(t){n.assign(Qt,ne(oe(t)))},t.createBlobTempStream=function(t={}){const{thresholdBytes:e=Rc}=t;return function(){const t=[];let n,r,o,i=0,s=!1;const a=new D({async write(o){s?await n.write(o):(t.push(o),i+=o.length,i>e&&await async function(){const e=new z;r=hn(e.readable),n=e.writable.getWriter(),s=!0;for(const e of t)await n.write(e);t.length=0}())},async close(){n&&(await n.close(),n=null)}});let c=0;return{writable:a,readable:new F({async pull(e){if(s){if(!o){const t=await r;o=t.stream().getReader()}const{value:t,done:n}=await o.read();n?e.close():e.enqueue(t)}else c<t.length?e.enqueue(t[c++]):e.close()},async cancel(t){o&&await o.cancel(t)}},{highWaterMark:0}),dispose:async function(){if(n){try{await n.abort()}catch{}n=null}r&&(r.catch(()=>{}),r=null),t.length=0}}}},t.createOPFSTempStream=function(t={}){const{thresholdBytes:n=Ec,directoryName:r=xc,getDirectory:o=()=>I.storage.getDirectory()}=t;let i;function s(){return i||(i=S.resolve(o()).then(t=>t.getDirectoryHandle(r,{create:!0}))),i}return function(){const t=[];let r,o,i,a,c=0,u=!1;const l=new D({async write(a){u?await i.write(a):(t.push(a),c+=a.length,c>n&&await async function(){const n=await s();r=x.randomUUID?x.randomUUID():e.from(x.getRandomValues(new w(16)),t=>t.toString(16).padStart(2,"0")).join(""),o=await n.getFileHandle(r,{create:!0}),i=(await o.createWritable()).getWriter(),u=!0;for(const e of t)await i.write(e);t.length=0}())},async close(){i&&(await i.close(),i=null)}});let d=0;return{writable:l,readable:new F({async pull(e){if(u){if(!a){const t=await o.getFile();a=t.stream().getReader()}const{value:t,done:n}=await a.read();n?e.close():e.enqueue(t)}else d<t.length?e.enqueue(t[d++]):e.close()},async cancel(t){a&&await a.cancel(t)}},{highWaterMark:0}),dispose:async function(){if(i){try{await i.close()}catch{}i=null}if(r){try{const t=await s();await t.removeEntry(r)}catch{}o=r=null}t.length=0}}}},t.createSyncAccessHandleTempStream=function(t={}){const{thresholdBytes:n=zc,directoryName:r=Fc,getDirectory:o}=t;if(!(o||"undefined"!=typeof FileSystemFileHandle&&FileSystemFileHandle.prototype.createSyncAccessHandle))throw new f(Dc);const i=o||(()=>I.storage.getDirectory());let a;function c(){return a||(a=S.resolve(i()).then(t=>t.getDirectoryHandle(r,{create:!0}))),a}return function(){const t=[];let r,o,i=0,a=!1,u=0,l=0;const d=new D({async write(s){a?(o.write(s,{at:u}),u+=s.length):(t.push(s),i+=s.length,i>n&&await async function(){const n=await c();r=x.randomUUID?x.randomUUID():e.from(x.getRandomValues(new w(16)),t=>t.toString(16).padStart(2,"0")).join("");const i=await n.getFileHandle(r,{create:!0});o=await i.createSyncAccessHandle(),a=!0;for(const e of t)o.write(e,{at:u}),u+=e.length;t.length=0}())},close(){o&&o.flush()}});let f=0;return{writable:d,readable:new F({pull(e){if(a){const t=u-l;if(t<=0)return void e.close();const n=new w(s.min(524288,t)),r=o.read(n,{at:l});r?(l+=r,e.enqueue(n.subarray(0,r))):e.close()}else f<t.length?e.enqueue(t[f++]):e.close()}},{highWaterMark:0}),dispose:async function(){if(o){try{o.close()}catch{}o=null}if(r){try{const t=await c();await t.removeEntry(r)}catch{}r=null}t.length=0}}}},t.fs=Bc,t.getMimeType=function(){return"application/octet-stream"},t.getRegisteredCodecs=zn,t.getSupportedCompressionMethods=function(){const{CompressionStream:t,DecompressionStream:e,CompressionStreamFallback:n,DecompressionStreamFallback:r}=$t(),o=[{compressionMethod:0,compression:!0,decompression:!0,registered:!1},{compressionMethod:8,compression:bc(n,kn)||bc(t,kn)||bc(t,vn),decompression:bc(r,kn)||bc(e,kn)||bc(e,vn),registered:!1},{compressionMethod:9,compression:!1,decompression:bc(r,Tn)||bc(e,Tn),registered:!1}];for(const t of zn()){const e=Fn(t.format);o.push({compressionMethod:t.compressionMethod,compression:e?typeof e.CompressionStream==pt:dt,decompression:e?typeof e.DecompressionStream==pt:dt,registered:!0})}return o},t.isZipFile=ss,t.registerCodec=function(t={}){const{compressionMethod:e,format:n,codecURI:r,CompressionStream:i,DecompressionStream:s,versionNeeded:a}=t;if(!o.isInteger(e)||e<0||e>M||typeof n!=mt||!n.length)throw new f(yn);if(bn.includes(e))throw new f(Sn);const c=typeof i==pt||typeof s==pt;if(!(c||typeof r==mt&&r.length))throw new f(yn);En.set(e,{compressionMethod:e,format:n,codecURI:r,versionNeeded:a}),c&&Dn(n,{CompressionStream:i,DecompressionStream:s})},t.resetConfiguration=function(){for(const t of Jt)delete Qt[t];n.assign(Qt,qt)},t.terminateWorkers=async function(){await S.allSettled(br.map(t=>(kr(t),t.terminate()))),Jn=dt,Qn=!1},t.unregisterCodec=function(t){const e=En.get(t);if(e){let n;En.delete(t),En.forEach(t=>n=n||t.format==e.format),n||xn.delete(e.format)}}});
1
+ !function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports):"function"==typeof define&&define.amd?define(["exports"],e):e((t="undefined"!=typeof globalThis?globalThis:t||self).zip={})}(this,function(t){"use strict";const{Array:e,Object:n,String:r,Number:o,BigInt:i,Math:s,Date:a,Map:c,Set:u,Response:l,URL:d,Error:f,Uint8Array:w,Uint16Array:p,Uint32Array:h,DataView:m,Blob:y,Promise:S,TextEncoder:g,TextDecoder:b,document:E,crypto:x,btoa:R,TransformStream:z,ReadableStream:F,WritableStream:D,CompressionStream:A,DecompressionStream:k,navigator:C,Worker:I,Symbol:T,setTimeout:v,clearTimeout:_,structuredClone:N}="undefined"!=typeof globalThis?globalThis:this||self;var U=void 0!==E?E.currentScript:null;const O=4294967295,M=65535,L=255,B=67324752,W=134695760,P=W,Z=84233040,H=33639248,V=101010256,G=101075792,j=117853008,q=46,K=22,Y=20,X=56,J=39169,Q=21589,$=6534,tt=30837,et=30805,nt=2048,rt=61440,ot=16384,it=2048,st=1024,at="/",ct=30,ut=new a(2107,11,31,23,59,58),lt=new a(1980,0,1),dt=void 0,ft=1/0,wt="undefined",pt="function",ht="object",mt="string",yt=new w,St="password",gt="rawPassword",bt="passThrough",Et="signal",xt="useWebWorkers",Rt="useCompressionStream",zt="transferStreams",Ft="preventClose",Dt="dataDescriptor",At="offset",kt="usdz",Ct="maxAppendedDataSize",It="signCentralDirectory",Tt="filename",vt="comment",_t="strict",Nt="balanced",Ut="tolerant",Ot="Invalid option (must be a function)",Mt="Invalid signal (must be an AbortSignal instance)",Lt="Invalid password (password must be a string, rawPassword must be a Uint8Array)";function Bt(t){if(t&&typeof t!=pt)throw new f(Ot);return t}function Wt(t){if(t&&(typeof t.addEventListener!=pt||"boolean"!=typeof t.aborted))throw new f(Mt);return t||dt}function Pt(t,e){if(t&&typeof t!=mt||e&&!(e instanceof w))throw new f(Lt)}function Zt(t,e,n){if(!o.isInteger(t)||t<0||t>e)throw new f(n)}function Ht(t,e,n){t!==dt&&Zt(t,e,n)}function Vt(t){return typeof t==mt&&t.trim()?o(t):t}const Gt="Invalid maxWorkers (must be an integer greater than 0)";let jt=2;try{typeof C!=wt&&C.hardwareConcurrency&&(jt=C.hardwareConcurrency)}catch{}const qt={workerURI:"./core/web-worker-wasm.js",wasmURI:"./core/streams/zlib-wasm/zlib-streams.wasm",chunkSize:65536,maxWorkers:jt,terminateWorkerTimeout:5e3,workerStarvationTimeout:5e3,workerStartupTimeout:5e3,useWebWorkers:!0,useCompressionStream:!0,transferStreams:!0,CompressionStream:typeof A!=wt&&A,DecompressionStream:typeof k!=wt&&k},Kt="maxWorkers",Yt=["chunkSize",Kt,"terminateWorkerTimeout","workerStarvationTimeout","workerStartupTimeout"],Xt=["createWorker","CompressionStream","DecompressionStream","CompressionStreamFallback","DecompressionStreamFallback"],Jt=["baseURI","wasmURI","workerURI","useCompressionStream","useWebWorkers","transferStreams",...Yt,...Xt],Qt={...qt};function $t(){return Qt}function te(t){return ee(t.chunkSize)}function ee(t){return t=Vt(t),o.isInteger(t)&&t>=1?s.max(t,64):65536}function ne(t){const e={};for(const n of Jt){const r=t[n];r!==dt&&(e[n]=re(n,r))}return e}function re(t,e){if(Yt.includes(t)){if(e=Vt(e),t==Kt&&(!o.isInteger(e)||e<1))throw new f(Gt)}else Xt.includes(t)&&Bt(e);return e}function oe(t){t=t||{};const{CompressionStreamZlib:e,DecompressionStreamZlib:r}=t;if(e===dt&&r===dt)return t;const o=n.assign({},t);return o.CompressionStreamFallback===dt&&(o.CompressionStreamFallback=e),o.DecompressionStreamFallback===dt&&(o.DecompressionStreamFallback=r),o}function ie(t,e){const n=new w(t.length+e.length);return n.set(t),n.set(e,t.length),n}function se(t){return t.byteOffset||t.byteLength!=t.buffer.byteLength?new w(t):t}function ae(t){return new m(t.buffer,t.byteOffset,t.byteLength)}const ce=[[],[],[],[],[],[],[],[]];for(let t=0;t<256;t++){let e=t;for(let t=0;t<8;t++)e=1&e?e>>>1^3988292384:e>>>1;ce[0][t]=e}for(let t=0;t<256;t++)for(let e=1;e<8;e++){const n=ce[e-1][t];ce[e][t]=n>>>8^ce[0][255&n]}const[ue,le,de,fe,we,pe,he,me]=ce;class ye{constructor(t){this.o=t||-1}append(t){let e=0|this.o;const n=0|t.length;let r=0;if(n>=8&&t.buffer){const o=new m(t.buffer,t.byteOffset,n),i=n-8;for(;r<=i;r+=8){const t=e^o.getInt32(r,!0),n=o.getInt32(r+4,!0);e=me[255&t]^he[t>>>8&255]^pe[t>>>16&255]^we[t>>>24&255]^fe[255&n]^de[n>>>8&255]^le[n>>>16&255]^ue[n>>>24&255]}}for(;r<n;r++)e=e>>>8^ue[255&(e^t[r])];this.o=e}get(){return~this.o}}class Se extends z{constructor(){let t;const e=new ye;super({transform(t,n){e.append(t),n.enqueue(t)},flush(){const n=new w(4);new m(n.buffer).setUint32(0,e.get()),t.value=n}}),t=this}}function ge(t){if(typeof g==wt){t=unescape(encodeURIComponent(t));const e=new w(t.length);for(let n=0;n<e.length;n++)e[n]=t.charCodeAt(n);return e}return(new g).encode(t)}const be={concat(t,e){if(0===t.length||0===e.length)return t.concat(e);const n=t[t.length-1],r=be.l(n);return 32===r?t.concat(e):be.h(e,r,0|n,t.slice(0,t.length-1))},bitLength(t){const e=t.length;if(0===e)return 0;const n=t[e-1];return 32*(e-1)+be.l(n)},m(t,e){if(32*t.length<e)return t;const n=(t=t.slice(0,s.ceil(e/32))).length;return e&=31,n>0&&e&&(t[n-1]=be.S(e,t[n-1]&2147483648>>e-1,1)),t},S:(t,e,n)=>32===t?e:(n?0|e:e<<32-t)+1099511627776*t,l:t=>s.round(t/1099511627776)||32,h(t,e,n,r){for(void 0===r&&(r=[]);e>=32;e-=32)r.push(n),n=0;if(0===e)return r.concat(t);for(let o=0;o<t.length;o++)r.push(n|t[o]>>>e),n=t[o]<<32-e;const o=t.length?t[t.length-1]:0,i=be.l(o);return r.push(be.S(e+i&31,e+i>32?n:r.pop(),1)),r}},Ee={bytes:{R(t){const e=be.bitLength(t)/8,n=new w(e);let r;for(let o=0;o<e;o++)3&o||(r=t[o/4]),n[o]=r>>>24,r<<=8;return n},F(t){const e=[];let n,r=0;for(n=0;n<t.length;n++)r=r<<8|t[n],3&~n||(e.push(r),r=0);return 3&n&&e.push(be.S(8*(3&n),r)),e}}},xe=class{constructor(t){const e=this;e.blockSize=512,e.D=[1732584193,4023233417,2562383102,271733878,3285377520],e.A=[1518500249,1859775393,2400959708,3395469782],t?(e.C=t.C.slice(0),e.I=t.I.slice(0),e.T=t.T):e.reset()}reset(){const t=this;return t.C=t.D.slice(0),t.I=[],t.T=0,t}update(t){const e=this;"string"==typeof t&&(t=Ee.v.F(t));const n=e.I=be.concat(e.I,t),r=e.T,o=e.T=r+be.bitLength(t);if(o>9007199254740991)throw new f("Cannot hash more than 2^53 - 1 bits");const i=new h(n);let s=0;for(let t=e.blockSize+r-(e.blockSize+r&e.blockSize-1);t<=o;t+=e.blockSize)e._(i.subarray(16*s,16*(s+1))),s+=1;return n.splice(0,16*s),e}N(){const t=this;let e=t.I;const n=t.C;e=be.concat(e,[be.S(1,1)]);for(let t=e.length+2;15&t;t++)e.push(0);for(e.push(s.floor(t.T/4294967296)),e.push(0|t.T);e.length;)t._(e.splice(0,16));return t.reset(),n}U(t,e,n,r){return t<=19?e&n|~e&r:t<=39?e^n^r:t<=59?e&n|e&r|n&r:t<=79?e^n^r:void 0}O(t,e){return e<<t|e>>>32-t}_(t){const n=this,r=n.C,o=e(80);for(let e=0;e<16;e++)o[e]=t[e];let i=r[0],a=r[1],c=r[2],u=r[3],l=r[4];for(let t=0;t<=79;t++){t>=16&&(o[t]=n.O(1,o[t-3]^o[t-8]^o[t-14]^o[t-16]));const e=n.O(5,i)+n.U(t,a,c,u)+l+o[t]+n.A[s.floor(t/20)]|0;l=u,u=c,c=n.O(30,a),a=i,i=e}r[0]=r[0]+i|0,r[1]=r[1]+a|0,r[2]=r[2]+c|0,r[3]=r[3]+u|0,r[4]=r[4]+l|0}},Re={importKey:t=>new Re.M(Ee.bytes.F(t)),L(t,e,n,r){if(n=n||1e4,r<0||n<0)throw new f("invalid params to pbkdf2");const o=1+(r>>5)<<2;let i,s,a,c,u;const l=new ArrayBuffer(o),d=new m(l);let w=0;const p=be;for(e=Ee.bytes.F(e),u=1;w<(o||1);u++){for(i=s=t.encrypt(p.concat(e,[u])),a=1;a<n;a++)for(s=t.encrypt(s),c=0;c<s.length;c++)i[c]^=s[c];for(a=0;w<(o||1)&&a<i.length;a++)d.setInt32(w,i[a]),w+=4}return l.slice(0,r/8)},M:class{constructor(t){const e=this,n=e.B=xe,r=[[],[]];e.W=[new n,new n];const o=e.W[0].blockSize/32;t.length>o&&(t=(new n).update(t).N());for(let e=0;e<o;e++)r[0][e]=909522486^t[e],r[1][e]=1549556828^t[e];e.W[0].update(r[0]),e.W[1].update(r[1]),e.P=new n(e.W[0])}reset(){const t=this;t.P=new t.B(t.W[0]),t.Z=!1}update(t){this.Z=!0,this.P.update(t)}digest(){const t=this,e=t.P.N(),n=new t.B(t.W[1]).update(e).N();return t.reset(),n}encrypt(t){if(this.Z)throw new f("encrypt on already updated hmac called!");return this.update(t),this.digest(t)}}},ze=typeof x!=wt&&typeof x.getRandomValues==pt,Fe="Invalid password",De="Invalid authentication code",Ae="zipjs-abort-check-password",ke="Crypto API not supported";function Ce(t){if(ze)return x.getRandomValues(t);throw new f(ke)}const Ie=16,Te={name:"PBKDF2"},ve=n.assign({hash:{name:"HMAC"}},Te),_e=n.assign({iterations:1e3,hash:{name:"SHA-1"}},Te),Ne=["deriveBits"],Ue=[8,12,16],Oe=[16,24,32],Me=10,Le=[0,0,0,0],Be=typeof x!=wt,We=Be&&x.subtle,Pe=Be&&typeof We!=wt,Ze=Ee.bytes,He=class{constructor(t){const e=this;e.H=[[[],[],[],[],[]],[[],[],[],[],[]]],e.H[0][0][0]||e.V();const n=e.H[0][4],r=e.H[1],o=t.length;let i,s,a,c=1;if(4!==o&&6!==o&&8!==o)throw new f("invalid aes key size");for(e.A=[s=t.slice(0),a=[]],i=o;i<4*o+28;i++){let t=s[i-1];(i%o===0||8===o&&i%o===4)&&(t=n[t>>>24]<<24^n[t>>16&255]<<16^n[t>>8&255]<<8^n[255&t],i%o===0&&(t=t<<8^t>>>24^c<<24,c=c<<1^283*(c>>7))),s[i]=s[i-o]^t}for(let t=0;i;t++,i--){const e=s[3&t?i:i-4];a[t]=i<=4||t<4?e:r[0][n[e>>>24]]^r[1][n[e>>16&255]]^r[2][n[e>>8&255]]^r[3][n[255&e]]}}encrypt(t){return this.G(t,0)}decrypt(t){return this.G(t,1)}V(){const t=this.H[0],e=this.H[1],n=t[4],r=e[4],o=[],i=[];let s,a,c,u;for(let t=0;t<256;t++)i[(o[t]=t<<1^283*(t>>7))^t]=t;for(let l=s=0;!n[l];l^=a||1,s=i[s]||1){let i=s^s<<1^s<<2^s<<3^s<<4;i=i>>8^255&i^99,n[l]=i,r[i]=l,u=o[c=o[a=o[l]]];let d=16843009*u^65537*c^257*a^16843008*l,f=257*o[i]^16843008*i;for(let n=0;n<4;n++)t[n][l]=f=f<<24^f>>>8,e[n][i]=d=d<<24^d>>>8}for(let n=0;n<5;n++)t[n]=t[n].slice(0),e[n]=e[n].slice(0)}G(t,e){if(4!==t.length)throw new f("invalid aes block size");const n=this.A[e],r=n.length/4-2,o=[0,0,0,0],i=this.H[e],s=i[0],a=i[1],c=i[2],u=i[3],l=i[4];let d,w,p,h=t[0]^n[0],m=t[e?3:1]^n[1],y=t[2]^n[2],S=t[e?1:3]^n[3],g=4;for(let t=0;t<r;t++)d=s[h>>>24]^a[m>>16&255]^c[y>>8&255]^u[255&S]^n[g],w=s[m>>>24]^a[y>>16&255]^c[S>>8&255]^u[255&h]^n[g+1],p=s[y>>>24]^a[S>>16&255]^c[h>>8&255]^u[255&m]^n[g+2],S=s[S>>>24]^a[h>>16&255]^c[m>>8&255]^u[255&y]^n[g+3],g+=4,h=d,m=w,y=p;for(let t=0;t<4;t++)o[e?3&-t:t]=l[h>>>24]<<24^l[m>>16&255]<<16^l[y>>8&255]<<8^l[255&S]^n[g++],d=h,h=m,m=y,y=S,S=d;return o}},Ve=class{constructor(t,e){this.j=t,this.K=e,this.Y=e}reset(){this.Y=this.K}update(t){return this.X(this.j,t,this.Y)}J(t){if(255&~(t>>24))t+=1<<24;else{let e=t>>16&255,n=t>>8&255,r=255&t;255===e?(e=0,255===n?(n=0,255===r?r=0:++r):++n):++e,t=0,t+=e<<16,t+=n<<8,t+=r}return t}$(t){0===(t[0]=this.J(t[0]))&&(t[1]=this.J(t[1]))}X(t,e,n){let r;if(!(r=e.length))return[];const o=be.bitLength(e);for(let o=0;o<r;o+=4){this.$(n);const r=t.encrypt(n);e[o]^=r[0],e[o+1]^=r[1],e[o+2]^=r[2],e[o+3]^=r[3]}return be.m(e,o)}},Ge=Re.M;let je=Be&&Pe&&typeof We.importKey==pt,qe=Be&&Pe&&typeof We.deriveBits==pt;class Ke extends z{constructor({password:t,rawPassword:e,encryptionStrength:n,checkPasswordOnly:r,checkAuthenticationCode:o=!0}){super({start(){Xe(this,t,e,n)},async transform(t,e){const n=this,{password:o,strength:i,et:s,ready:a}=n;o?(await async function(t,e,n,r){const o=await Qe(t,e,n,tn(r,0,Ue[e])),i=tn(r,Ue[e]);if(o[0]!=i[0]||o[1]!=i[1])throw new f(Fe)}(n,i,o,tn(t,0,Ue[i]+2)),t=tn(t,Ue[i]+2),r?e.error(new f(Ae)):s()):await a;const c=new w(t.length-Me-(t.length-Me)%Ie);e.enqueue(Je(n,t,c,0,Me,!0))},async flush(t){const{nt:e,ot:n,it:r,ready:i}=this;if(n&&e){await i;const s=tn(r,0,r.length-Me),a=tn(r,r.length-Me);let c=yt;if(s.length){const t=nn(Ze,s);n.update(t);const r=e.update(t);c=en(Ze,r)}const u=tn(en(Ze,n.digest()),0,Me);let l=r.length<Me?1:0;for(let t=0;t<Me;t++)l|=u[t]^a[t];if(l&&o)throw new f(De);t.enqueue(c)}}})}}class Ye extends z{constructor({password:t,rawPassword:e,encryptionStrength:n}){super({start(){Xe(this,t,e,n)},async transform(t,e){const n=this,{password:r,strength:o,et:i,ready:s}=n;let a=yt;r?(a=await async function(t,e,n){const r=Ce(new w(Ue[e]));return ie(r,await Qe(t,e,n,r))}(n,o,r),i()):await s;const c=new w(a.length+t.length-t.length%Ie);c.set(a,0),e.enqueue(Je(n,t,c,a.length,0))},async flush(t){const{nt:e,ot:n,it:r,ready:o}=this;if(n&&e){await o;let i=yt;if(r.length){const t=e.update(nn(Ze,r));n.update(t),i=en(Ze,t)}const s=en(Ze,n.digest()).slice(0,Me);t.enqueue(ie(i,s))}}})}}function Xe(t,e,r,o){n.assign(t,{ready:new S(e=>t.et=e),password:$e(e,r),strength:o-1,it:yt})}function Je(t,e,n,r,o,i){const{nt:s,ot:a,it:c}=t;c.length&&(e=ie(c,e));const u=e.length-o;let l;for(n=function(t,e){if(e&&e>t.length){const n=t;(t=new w(e)).set(n,0)}return t}(n,r+(u-u%Ie)),l=0;l<=u-Ie;l+=Ie){const t=nn(Ze,tn(e,l,l+Ie));i&&a.update(t);const o=s.update(t);i||a.update(o),n.set(en(Ze,o),l+r)}return t.it=tn(e,l),n}async function Qe(t,r,o,i){t.password=null;const s=await async function(t,e,n,r,o){if(!je)return Re.importKey(e);try{return await We.importKey("raw",e,n,!1,o)}catch{return je=!1,Re.importKey(e)}}(0,o,ve,0,Ne),a=await async function(t,e,n){if(!qe)return Re.L(e,t.salt,_e.iterations,n);try{return await We.deriveBits(t,e,n)}catch{return qe=!1,Re.L(e,t.salt,_e.iterations,n)}}(n.assign({salt:i},_e),s,8*(2*Oe[r]+2)),c=new w(a),u=nn(Ze,tn(c,0,Oe[r])),l=nn(Ze,tn(c,Oe[r],2*Oe[r])),d=tn(c,2*Oe[r]);return n.assign(t,{keys:{key:u,st:l,passwordVerification:d},nt:new Ve(new He(u),e.from(Le)),ot:new Ge(l)}),d}function $e(t,e){return e===dt?ge(t):e}function tn(t,e,n){return t.subarray(e,n)}function en(t,e){return t.R(e)}function nn(t,e){return t.F(e)}class rn extends z{constructor({password:t,rawPassword:e,passwordVerification:n,checkPasswordOnly:r}){super({start(){sn(this,t,e,n)},transform(t,e){const n=this;if(n.password||n.rawPassword){const e=an(n,t.subarray(0,12));if(n.password=n.rawPassword=null,0!=(e[11]^n.passwordVerification))throw new f(Fe);t=t.subarray(12)}r?e.error(new f(Ae)):e.enqueue(an(n,t))}})}}class on extends z{constructor({password:t,rawPassword:e,passwordVerification:n}){super({start(){sn(this,t,e,n)},transform(t,e){const n=this;let r,o;if(n.password||n.rawPassword){n.password=n.rawPassword=null;const e=Ce(new w(12));e[11]=n.passwordVerification,r=new w(t.length+e.length),r.set(cn(n,e),0),o=12}else r=new w(t.length),o=0;r.set(cn(n,t),o),e.enqueue(r)}})}}function sn(t,e,r,o){n.assign(t,{password:e,rawPassword:r,passwordVerification:o}),function(t,e,r){const o=[305419896,591751049,878082192];if(n.assign(t,{keys:o,ct:new ye(o[0]),ut:new ye(o[2])}),r)for(let e=0;e<r.length;e++)un(t,r[e]);else for(let n=0;n<e.length;n++)un(t,e.charCodeAt(n))}(t,e,r)}function an(t,e){const n=new w(e.length);for(let r=0;r<e.length;r++)n[r]=ln(t)^e[r],un(t,n[r]);return n}function cn(t,e){const n=new w(e.length);for(let r=0;r<e.length;r++)n[r]=ln(t)^e[r],un(t,e[r]);return n}function un(t,e){let[,n]=t.keys;t.ct.append([e]);const r=~t.ct.get();n=fn(s.imul(fn(n+dn(r)),134775813)+1),t.ut.append([n>>>24]);const o=~t.ut.get();t.keys=[r,n,o]}function ln(t){const e=2|t.keys[2];return dn(s.imul(e,1^e)>>>8)}function dn(t){return 255&t}function fn(t){return 4294967295&t}function wn(t){if(t instanceof F)return t;const e=t.getReader();return new F({async pull(t){const{value:n,done:r}=await e.read();r?t.close():t.enqueue(n)},cancel:t=>e.cancel(t)})}function pn(t,e){t=wn(t);const n=e?{type:e}:{};if(typeof y.prototype.stream!=pt||new y([]).stream()instanceof F)return new l(t).blob().then(t=>e?new y([t],n):t);const r=[];return t.pipeTo(new D({write(t){r.push(t)}})).then(()=>new y(r,n))}function hn(t){if(t instanceof D)return t;const e=t.getWriter();return new D({write:t=>e.write(t),close:()=>e.close(),abort:t=>e.abort(t)})}const mn="Invalid codec definition",yn="Reserved compression method",Sn="Invalid codec module",gn="Compression method not supported",bn=[0,8,9,99],En=new c,xn=new c;function Rn(t){return En.get(t)}function zn(){return e.from(En.values(),t=>n.assign({},t,xn.get(t.format)))}function Fn(t){return xn.get(t)}function Dn(t,e){const{CompressionStream:n,DecompressionStream:r}=e;if(typeof n!=pt&&typeof r!=pt)throw new f(Sn);xn.set(t,{CompressionStream:n,DecompressionStream:r})}const An="Invalid uncompressed size",kn="Invalid compressed data",Cn="Invalid CRC32",In="deflate-raw",Tn="deflate64-raw",vn="gzip",_n=[31,139,8];class Nn extends z{constructor(t,{chunkSize:e,CompressionStreamFallback:n,CompressionStream:r}){super({});const{compressed:o,encrypted:i,useCompressionStream:s,zipCrypto:a,computeCrc32:c,level:u,deflate64:l,format:d,compressionMethod:f,inputSize:w}=t,p=this;let h,y,S,g=super.readable;const b=d&&Fn(d),E=c&&o&&!l&&!b&&(!i||a)&&Boolean(s&&r);if(i&&!a||!c||E||(h=new Se,g=Hn(g,h)),o)if(b)g=Vn(g,Pn(b.CompressionStream,d,{level:u,chunkSize:e,compressionMethod:f,uncompressedSize:w}));else if(E)S=new Un,g=Vn(g,new r(vn)),g=Hn(g,S);else try{g=Zn(g,s,{level:u,chunkSize:e},r,n)}catch(t){let e;try{e=new r(vn)}catch{throw t}g=Vn(g,e),g=Hn(g,new Un)}i&&(a?g=Hn(g,new on(t)):(y=new Ye(t),g=Hn(g,y))),Wn(p,g,()=>{i&&!a||!c||(p.crc32=E?S.crc32:new m(h.value.buffer).getUint32(0))})}}class Un extends z{constructor(){let t,e=10,n=new w(0);super({transform(t,r){if(e){const n=s.min(e,t.length);if(e-=n,!(t=t.subarray(n)).length)return}const o=n.length+t.length;if(o<=8)return void(n=ie(n,t));const i=o-8,a=s.min(i,n.length);r.enqueue(ie(n.subarray(0,a),t.subarray(0,i-a))),n=ie(n.subarray(a),t.subarray(i-a))},flush(){const e=ae(n);t.crc32=e.getUint32(0,!0),t.uncompressedSize=e.getUint32(4,!0)}}),t=this}}class On extends z{constructor(t,{chunkSize:e,DecompressionStreamFallback:n,DecompressionStream:r}){super({});const{zipCrypto:o,encrypted:i,checkCrc32:s,crc32:a,compressed:c,useCompressionStream:u,deflate64:l,format:d,compressionMethod:p,rawBitFlag:h,outputSize:y}=t;let g,b,E=super.readable;if(i&&(o?E=Hn(E,new rn(t)):(b=new Ke(t),E=Hn(E,b))),c){const t=d&&Fn(d);if(t)E=Vn(E,Pn(t.DecompressionStream,d,{chunkSize:e,compressionMethod:p,rawBitFlag:h,uncompressedSize:y}));else try{E=Zn(E,u,{chunkSize:e,deflate64:l},r,n)}catch(t){if(l||y===dt)throw t;let e;try{e=new r(vn)}catch{throw t}E=function(t,e,n){const r=new ye;let o,i,s,a=0,c=!1;const u=new S((t,e)=>{i=t,s=e});u.catch(()=>{}),n||i();const l=new z({start(t){const e=new w(10);e.set(_n),t.enqueue(e)},transform(t,e){e.enqueue(t)},async flush(t){c=!0,p();try{await u}finally{h()}const e=new w(8),o=ae(e);o.setUint32(0,r.get(),!0),o.setUint32(4,n,!0),t.enqueue(e)},cancel(t){s(t)}}),d=new z({transform(t,e){r.append(t),a+=t.length,a>=n?i():c&&p(),e.enqueue(t)},cancel(t){s(t)}});return t=Hn(t,l),Hn(t=Vn(t,e),d);function p(){h(),o=v(()=>s(new f(An)),5e3)}function h(){_(o)}}(E,e,y)}E=function(t){const e=t.getReader();return new F({async pull(t){let n;try{n=await e.read()}catch(t){if(t&&t.message)throw t;const e=new f(kn);throw e.cause=t,e}const{value:r,done:o}=n;o?t.close():t.enqueue(r)},cancel:t=>e.cancel(t)})}(E)}s&&(g=new Se,E=Hn(E,g)),Wn(this,E,()=>{if(s){const t=new m(g.value.buffer);if(a!=t.getUint32(0,!1))throw new f(Cn)}})}}const Mn=new c;function Ln(t,e){if(!t)return!1;let n=Mn.get(t);n||(n=new c,Mn.set(t,n));let r=n.get(e);if(r===dt){try{new t(e),r=!0}catch{r=!1}n.set(e,r)}return r}function Bn(t){return Ln(t,In)}function Wn(t,e,r){e=Hn(e,new z({flush:r})),n.defineProperty(t,"readable",{get:()=>e})}function Pn(t,e,n){if(!t)throw new f(gn);return new t(e,n)}function Zn(t,e,n,r,o){const i=e&&r?r:o||r,s=n.deflate64?Tn:In;let a;try{a=new i(s,n)}catch(t){if(!e||!o||i==o)throw t;a=new o(s,n)}return Vn(t,a)}function Hn(t,e){return wn(t).pipeThrough(e)}function Vn(t,e){const n=e.writable.getWriter(),r=t.getReader();return async function(){try{for(;;){await n.ready;const t=await r.read();if(t.done){await n.close();break}await n.write(t.value)}}catch(t){await async function(t,e){try{await t.abort(e)}catch{}}(n,t),await async function(t,e){try{await t.cancel(e)}catch{}}(r,t)}}(),e.readable}const Gn="data",jn="deflate",qn="inflate";class Kn extends z{constructor(t,e){super({});const r=this,{codecType:o}=t;let i;o.startsWith(jn)?i=Nn:o.startsWith(qn)&&(i=On),r.outputSize=0;let s=0;const a=new i(t,e),c=super.readable,u=new z({transform(t,e){t&&t.length&&(s+=t.length,e.enqueue(t))},flush(){n.assign(r,{inputSize:s})}}),l=new z({transform(e,n){if(e&&e.length&&(n.enqueue(e),r.outputSize+=e.length,t.outputSize!==dt&&r.outputSize>t.outputSize))throw new f(An)},flush(){const{crc32:t}=a;n.assign(r,{crc32:t,inputSize:s})}});n.defineProperty(r,"readable",{get:()=>c.pipeThrough(u).pipeThrough(a).pipeThrough(l)})}}class Yn extends z{constructor(t){const e=[];let n=0;function r(){const r=new w(t);let o=0;for(;o<t;){const n=e[0],i=t-o;n.length<=i?(r.set(n,o),o+=n.length,e.shift()):(r.set(n.subarray(0,i),o),e[0]=n.subarray(i),o+=i)}return n-=t,r}(!o.isFinite(t)||t<1)&&(t=65536),super({transform(o,i){for(e.push(o),n+=o.length;n>t;)i.enqueue(r())},flush(t){n&&t.enqueue(function(t,e){const n=new w(e);let r=0;for(const e of t)n.set(e,r),r+=e.length;return n}(e,n))}})}}const Xn="Worker startup timeout";let Jn,Qn,$n;async function tr(t){const{CompressionStream:e,CompressionStreamFallback:n}=t;if(n&&!n.lt)return!0;if(Bn(e)||Ln(e,vn))return!0;if(n)try{return await void 0,!0}catch{return!1}return!1}function er(t){t.createWorker?Qn=!0:Jn=!1}class nr{constructor(t,{readable:e,writable:r},{options:o,config:i,ft:s,useWebWorkers:a,transferStreams:c,workerURI:u,createWorker:l},d){const{signal:f}=s;return Qn&&(l=dt),n.assign(t,{wt:!0,ht:(t.ht||0)+1,readable:e.pipeThrough(new Yn(te(i))).pipeThrough(new rr(s),{signal:f}),writable:r,options:n.assign({},o),workerURI:u,createWorker:l,transferStreams:c,terminate:()=>new S(e=>{const{yt:n,wt:r}=t;n?(r?t.St=e:(n.terminate(),e()),t.gt=null):e()}),bt(){if(t.wt){const{St:e}=t;e&&(t.St=null,t.Et=!0,t.yt.terminate(),e()),t.wt=!1,d(t)}}}),Jn===dt&&(Jn=typeof I!=wt),(a&&$n&&(Jn&&u||l)?$n:ir)(t,i)}}class rr extends z{constructor({onstart:t,onprogress:e,size:n,onend:r}){let o=0;super({async start(){t&&await or(t,n)},async transform(t,r){o+=t.length,e&&await or(e,o,n),r.enqueue(t)},async flush(){r&&await or(r,o)}})}}async function or(t,...e){try{await t(...e)}catch{}}function ir(t,e){return{run:()=>sr(t,e)}}async function sr({options:t,readable:e,writable:n,bt:r},o){let i;try{if(t.compressed&&!t.format){const e=t.codecType.startsWith(jn),n=e?o.CompressionStreamFallback:o.DecompressionStreamFallback,r=e?o.CompressionStream:o.DecompressionStream;if(t.useCompressionStream){if(n&&n.lt&&!Bn(r))try{await void 0}catch{}}else try{await void 0}catch{n&&!n.lt||(t.useCompressionStream=!0)}}i=new Kn(t,o),await e.pipeThrough(i).pipeThrough(new Yn(te(o))).pipeTo(n,{preventClose:!0,preventAbort:!0});const{crc32:r,inputSize:s,outputSize:a}=i;return{crc32:r,inputSize:s,outputSize:a}}catch(t){throw i&&(t.outputSize=i.outputSize),t}finally{r()}}const ar={type:"module"},cr="error";let ur,lr,dr,fr=!0;try{fr=typeof N==pt&&N(new DOMException("","AbortError")).code!==dt}catch{}var wr;function pr(t){const{reader:e}=t;e&&e.releaseLock(),t.reader=null,t.writer=null}function hr(t){const{yt:e}=t;if(e)try{e.terminate()}catch{}t.gt=null}function mr(t,e,r,o,i=!0){const{createWorker:s}=r;let a,c,u;if(s)a=s();else if(lr===dt||ur!==t){const n=typeof t==pt;c=n?t(i):t;const s=c.startsWith("data:"),l=c.startsWith("blob:");if(s||l){o===dt&&(o=!1),o&&(u=ar);try{a=new I(c,u)}catch(i){if(l)try{d.revokeObjectURL(c)}catch{}if(n&&l)return mr(t,e,r,o,!1);if(o)throw i;return mr(t,e,r,!0,!1)}}else{o===dt&&(o=!0),o&&(u=ar);try{c=new d(c,e)}catch{}try{a=new I(c,u)}catch(n){if(o)return mr(t,e,r,!1,i);throw n}}ur=t,lr=c,dr=u}else a=new I(lr,dr);return a.addEventListener("message",t=>{r.xt=!0,yr(r),async function({data:t},e){const{type:r,value:o,messageId:i,result:s,error:a}=t,{reader:c,writer:u,Rt:l,zt:d,bt:p,ht:h}=e,m=()=>e.ht!=h;try{if(a){const{message:t,stack:e,code:r,name:o,outputSize:i,cause:s,codecImportFailed:c}=a,u=new f(t);n.assign(u,{stack:e,code:r,name:o,outputSize:i}),s&&(u.cause=n.assign(new f(s.message),{name:s.name})),c&&(u.codecImportFailed=!0),y(u)}else{if("pull"==r){const{value:t,done:n}=await c.read();m()||gr({type:Gn,value:t,done:n,messageId:i},e)}r==Gn&&(await u.ready,await u.write(new w(o)),m()||gr({type:"ack",messageId:i},e)),"close"==r&&y(null,s)}}catch(a){m()||(hr(e),y(a))}function y(t,e){m()||(t?d(t):l(e),u&&u.releaseLock(),t&&t.codecImportFailed||p())}}(t,r)}),a.addEventListener(cr,t=>Sr(t,r)),a.addEventListener("messageerror",t=>Sr(t,r)),a}function yr(t){const{Ft:e}=t;e&&(_(e),t.Ft=null)}function Sr(t,e){t.preventDefault&&t.preventDefault(),yr(e);const{xt:r,zt:o,writer:i,bt:s}=e;hr(e),r||(e.yt=null);let a=t.error||new f(t.message||cr);r||(a=n.assign(new f(a.message||cr),{Dt:!0}),e.At=a),o&&(o(a),i&&i.releaseLock(),r&&s())}function gr(t,{yt:e,writer:n,transferStreams:r,xt:o}){try{const{value:n,readable:i,writable:s}=t,a=[];if(n&&(t.value=se(n),a.push(t.value.buffer)),r&&fr&&o?(i&&a.push(i),s&&a.push(s)):t.readable=t.writable=null,a.length)try{return e.postMessage(t,a),!0}catch{fr=!1,t.readable=t.writable=null,e.postMessage(t)}else e.postMessage(t)}catch(t){throw n&&n.releaseLock(),t}}wr=function(t,e){const{baseURI:r,chunkSize:i,workerStartupTimeout:s}=e;let{wasmURI:a}=e;if(!t.gt){let c;typeof a==pt&&(a=a());try{c=mr(t.workerURI,r,t)}catch{return er(t),ir(t,e)}n.assign(t,{yt:c,xt:!1,Et:!1,At:null,gt:{run:async()=>{try{return await async function(t,e){if(!t.yt){const{At:e}=t;t.At=null;const n=e||new f(Xn);throw n.Dt=!0,n}let r,i;const s=new S((t,e)=>{r=t,i=e});n.assign(t,{reader:null,writer:null,Rt:r,zt:i,result:s});const{readable:a,options:c}=t,{writable:u,closed:l,kt:d}=function(t){const e=new AbortController,{writable:n,readable:r}=new z,o=r.pipeTo(t,{preventClose:!0,preventAbort:!0,signal:e.signal});return o.catch(()=>{}),{writable:n,closed:o,kt:()=>e.abort()}}(t.writable);let w;try{w=gr({type:"start",options:c,config:e,readable:a,writable:u},t)}catch(e){d();try{await l}catch{}throw t.bt(),e}w||n.assign(t,{reader:a.getReader(),writer:u.getWriter()});const{workerStartupTimeout:p}=e;!t.xt&&o.isFinite(p)&&p>=0&&(t.Ft=v(()=>function(t){if(t.Ft=null,t.xt)return;const{zt:e,writer:n}=t;if(hr(t),t.yt=null,e){const t=new f(Xn);t.Dt=!0,e(t),n&&n.releaseLock()}}(t),p));try{const t=await s;return await h(),await l,t}catch(t){await h(),d();try{await l}catch{}throw t}async function h(){if(!w&&!u.locked)try{await u.getWriter().close()}catch{}}}(t,{chunkSize:i,wasmURI:a,baseURI:r,workerStartupTimeout:s})}catch(n){if(n&&n.Dt)return er(t),pr(t),sr(t,e);if(n&&n.codecImportFailed){if(t.reader)return pr(t),sr(t,e);t.bt()}throw n}}}})}return t.gt},$n=wr;let br=[];const Er=[];let xr,Rr,zr=0;async function Fr(t,e){const{options:n,config:r}=e,{transferStreams:i,useWebWorkers:s,useCompressionStream:a,compressed:c,checkCrc32:u,computeCrc32:l,encrypted:f,format:w,codecURI:p}=n,{workerURI:h,createWorker:m,maxWorkers:y}=r;w&&(p&&(n.codecURI=function(t,e){try{return new d(t,e).toString()}catch{return t}}(p,r.baseURI)),await async function(t,e){!xn.has(t)&&e&&Dn(t,await(import(/* webpackIgnore: true */ /* @vite-ignore */e)))}(w,n.codecURI)),e.transferStreams=!w&&(i||i===dt&&r.transferStreams);const g=!(c||u||l||f),b=w===dt||Boolean(n.codecURI);return e.useWebWorkers=!g&&b&&(s||s===dt&&r.useWebWorkers),e.workerURI=e.useWebWorkers&&h?h:dt,e.createWorker=e.useWebWorkers&&m?m:dt,n.useCompressionStream=a||a===dt&&r.useCompressionStream,(await async function(){const n=br.find(t=>!t.wt);if(n)return Ir(n),new nr(n,t,e,E);if(br.length<y){const n={Ct:zr};return zr++,br.push(n),new nr(n,t,e,E)}return new S(n=>{Er.push({resolve:n,stream:t,It:e}),Rr=r.workerStarvationTimeout,Dr()})}()).run();function E(t){if(Ar(),Er.length){const[{resolve:e,stream:n,It:r}]=Er.splice(0,1);e(new nr(t,n,r,E)),Dr()}else t.yt?(Ir(t),function(t,e){const{config:n}=e,{terminateWorkerTimeout:r}=n;o.isFinite(r)&&r>=0&&(t.Et?t.Et=!1:t.Tt=v(async()=>{br=br.filter(e=>e!=t);try{await t.terminate()}catch{}},r))}(t,e)):br=br.filter(e=>e!=t)}}function Dr(){!xr&&Er.length&&o.isFinite(Rr)&&Rr>=0&&(xr=v(kr,Rr))}function Ar(){xr&&(_(xr),xr=null)}function kr(){if(xr=null,Er.length){const[{resolve:t,stream:e,It:r}]=Er.splice(0,1),o=n.assign({},r,{useWebWorkers:!1,workerURI:dt,createWorker:dt});t(new nr({},e,o,Cr)),Dr()}}function Cr(){Ar(),Dr()}function Ir(t){const{Tt:e}=t;e&&(_(e),t.Tt=null)}const Tr="\0\u263a\u263b\u2665\u2666\u2663\u2660\u2022\u25d8\u25cb\u25d9\u2642\u2640\u266a\u266b\u263c\u25ba\u25c4\u2195\u203c\xb6\xa7\u25ac\u21a8\u2191\u2193\u2192\u2190\u221f\u2194\u25b2\u25bc !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~\u2302\xc7\xfc\xe9\xe2\xe4\xe0\xe5\xe7\xea\xeb\xe8\xef\xee\xec\xc4\xc5\xc9\xe6\xc6\xf4\xf6\xf2\xfb\xf9\xff\xd6\xdc\xa2\xa3\xa5\u20a7\u0192\xe1\xed\xf3\xfa\xf1\xd1\xaa\xba\xbf\u2310\xac\xbd\xbc\xa1\xab\xbb\u2591\u2592\u2593\u2502\u2524\u2561\u2562\u2556\u2555\u2563\u2551\u2557\u255d\u255c\u255b\u2510\u2514\u2534\u252c\u251c\u2500\u253c\u255e\u255f\u255a\u2554\u2569\u2566\u2560\u2550\u256c\u2567\u2568\u2564\u2565\u2559\u2558\u2552\u2553\u256b\u256a\u2518\u250c\u2588\u2584\u258c\u2590\u2580\u03b1\xdf\u0393\u03c0\u03a3\u03c3\xb5\u03c4\u03a6\u0398\u03a9\u03b4\u221e\u03c6\u03b5\u2229\u2261\xb1\u2265\u2264\u2320\u2321\xf7\u2248\xb0\u2219\xb7\u221a\u207f\xb2\u25a0\xa0".split("");function vr(t,e){return _r(t,e,!0)}function _r(t,e,n){return e&&"cp437"==e.trim().toLowerCase()?function(t){let e="";for(let n=0;n<t.length;n++)e+=Tr[t[n]];return e}(t):new b(e,{ignoreBOM:n}).decode(t)}const Nr="HTTP error ",Ur="HTTP Range not supported",Or="HTTP resource changed",Mr="Writer iterator completed too soon",Lr="Writer not initialized",Br="Content-Range",Wr="Range",Pr="GET",Zr="bytes",Hr=16777216,Vr="writable",Gr=T();class jr{constructor(){this.size=0}init(){this.initialized=!0}}class qr extends jr{get readable(){return this.createReadable()}createReadable({offset:t=0,size:e,chunkSize:n=te($t())}={}){const r=this;let o=0;return n=ee(n),new F({async pull(i){const a=e===dt?n:s.min(n,e-o),c=await vo(r,t+o,a);c.length&&i.enqueue(c),o+n>=e||!c.length&&a?i.close():o+=n}})}}class Kr extends jr{constructor(){super();const t=this,e=new D({write(e){if(!t.initialized)throw new f(Lr);return t.writeUint8Array(se(e))}});n.defineProperty(t,Vr,{get:()=>e})}writeUint8Array(){}}class Yr extends qr{constructor(t){super();let e=t.length;for(;"="==t.charAt(e-1);)e--;const r=t.indexOf(",")+1;n.assign(this,{vt:t,_t:r,size:s.floor(.75*(e-r))})}readUint8Array(t,e){const{_t:n,vt:r}=this,o=new w(e),i=4*s.floor(t/3),a=atob(r.substring(i+n,4*s.ceil((t+e)/3)+n)),c=t-3*s.floor(i/4);let u=0;for(let t=c;t<c+e&&t<a.length;t++)o[t-c]=a.charCodeAt(t),u++;return u<o.length?o.subarray(0,u):o}}class Xr extends Kr{constructor(t){super(),n.assign(this,{contentType:t,data:"data:"+(t||"")+";base64,",Nt:""})}writeUint8Array(t){const e=this;let n,o=e.Nt;const i=e.Nt.length;for(e.Nt="",n=0;n<3*s.floor((i+t.length)/3)-i;n++)o+=r.fromCharCode(t[n]);for(;n<t.length;n++)e.Nt+=r.fromCharCode(t[n]);o.length>2?e.data+=R(o):e.Nt=o+e.Nt}getData(){return this.data+R(this.Nt)}}let Jr,Qr;class $r extends qr{constructor(t){super(),n.assign(this,{Ut:t,size:t.size}),Qr||(Qr=(async()=>{try{const t=new y([new w(3)]).slice(1,2).stream().getReader();let e=0,n=await t.read();for(;!n.done;)e+=n.value.length,n=await t.read();Jr=1==e}catch{Jr=!1}})())}createReadable(t){const{Ut:e,size:n}=this,{offset:r=0,size:o=n-r}=t||{};return!r&&o>=n?wn(e.stream()):Jr?wn(e.slice(r,r+o).stream()):super.createReadable(t)}async readUint8Array(t,e){const n=this,r=t+e,o=!t&&r>=n.size?n.Ut:n.Ut.slice(t,r);let i=await o.arrayBuffer();return i.byteLength>e&&(i=i.slice(t,r)),new w(i)}}class to extends jr{constructor(t){super();const e=this,r=new z;n.defineProperty(e,Vr,{get:()=>r.writable}),e.contentType=t,e.Ot=pn(r.readable,t),e.Ot.catch(()=>{})}getData(){return this.Ot}}class eo extends $r{constructor(t){super(new y([t],{type:"text/plain"}))}}function no(t){let e=0;for(let n=0;n<t.length;n++){const r=t.charCodeAt(n);r<128?e+=1:r<2048?e+=2:r<55296||r>=57344?e+=3:r<56320&&56320==(64512&t.charCodeAt(n+1))?(e+=4,n++):e+=3}return e}class ro extends to{constructor(t){super(),n.assign(this,{encoding:t,Mt:!t||"utf-8"==t.toLowerCase()})}async getData(){const{encoding:t,Mt:e}=this,n=await super.getData();return n.text&&e?n.text():function(t,e){return _r(t,e,!1)}(new w(await n.arrayBuffer()),t)}}class oo extends qr{constructor(t,e){super(),so(this,t,e)}async init(){await ao(this,bo,mo),super.init()}createReadable(t){const e=this,{useRangeHeader:n,forceRangeRequests:r,size:i}=e;if((n||r)&&i!==dt){const{offset:n=0,size:r=i-n}=t||{};if(r>0&&n<i)return function(t,e,n){let r,i=e,a=0,c=n;return new F({start:()=>u(),async pull(t){r||await u();const{value:e,done:n}=await r.read();if(n)throw new f(Ur);const o=e.length>a?e.subarray(0,a):e;a-=o.length,c-=o.length,o.length&&t.enqueue(o),a||(await async function(){const t=r;r=dt,await t.cancel()}(),c||t.close())},cancel:t=>r&&r.cancel(t)});async function u(){const e=s.min(t.maximumRangeSize,c),n=await bo(Pr,t,po(t,i,e));if(206!=n.status)throw new f(Ur);const u=n.headers.get(Br);if(u){const t=o(u.trim().split(/[\s-]+/)[1]);if(!o.isNaN(t)&&t!=i)throw new f(Ur)}wo(t,n),fo(t,n),i+=e,a=e,r=n.body.getReader()}}(e,n,s.min(r,i-n))}return super.createReadable(t)}readUint8Array(t,e){return co(this,t,e,bo,mo)}}class io extends qr{constructor(t,e){super(),so(this,t,e)}async init(){await ao(this,Eo,yo),super.init()}readUint8Array(t,e){return co(this,t,e,Eo,yo)}}function so(t,e,r){const{preventHeadRequest:o,useRangeHeader:i,forceRangeRequests:s,combineSizeEocd:a,checkResourceChanges:c=!0,maximumRangeSize:u=Hr,fetch:l}=r;delete(r=n.assign({},r)).preventHeadRequest,delete r.useRangeHeader,delete r.forceRangeRequests,delete r.combineSizeEocd,delete r.checkResourceChanges,delete r.maximumRangeSize,delete r.useXHR,delete r.fetch,n.assign(t,{url:e,options:r,preventHeadRequest:o,useRangeHeader:i,forceRangeRequests:s,combineSizeEocd:a,checkResourceChanges:c,maximumRangeSize:u,fetch:l})}async function ao(t,e,n){const{url:r,preventHeadRequest:o,useRangeHeader:i,forceRangeRequests:s,combineSizeEocd:a}=t;if(function(t){const{baseURI:e}=$t(),{protocol:n}=new d(t,e);return"http:"==n||"https:"==n}(r)&&(i||s)&&(typeof o==wt||o)){const r=await e(Pr,t,po(t,a?-22:void 0)),o=r.headers.get("Accept-Ranges");if(!(s||o&&o.toLowerCase()==Zr))throw new f(Ur);{if(a){const e=new w(await r.arrayBuffer());206==r.status&&e.length==K&&(t.Lt=e)}fo(t,r);const o=uo(r);o===dt?await go(t,e,n):t.size=o}}else await go(t,e,n)}async function co(t,e,n,r,i){const{useRangeHeader:s,forceRangeRequests:a,Lt:c,size:u,options:l}=t;if(s||a){if(c&&e==u-K&&n==K)return c;if(e>=u||0===n)return yt;{e+n>u&&(n=u-e);const i=await r(Pr,t,po(t,e,n));if(206!=i.status)throw new f(Ur);const s=i.headers.get(Br);if(s){const t=o(s.trim().split(/[\s-]+/)[1]);if(!o.isNaN(t)&&t!=e)throw new f(Ur)}wo(t,i),fo(t,i);const a=new w(await i.arrayBuffer());if(a.length!=n)throw new f(Ur);return a}}{const{data:r}=t;return r||await i(t,l),t.data.subarray(e,e+n)}}function uo(t){const e=t.headers.get(Br);if(e){const t=e.trim().split(/\s*\/\s*/)[1];if(t&&"*"!=t){const e=o(t);if(!o.isNaN(e))return e}}}function lo({headers:t}){return{Bt:t.get("Etag")||dt,lastModified:t.get("Last-Modified")||dt}}function fo(t,e){const{checkResourceChanges:n,Wt:r}=t;n&&!r&&206==e.status&&(t.Wt=lo(e))}function wo(t,e){const{checkResourceChanges:r,Wt:o,size:i}=t;if(r){const t=uo(e);if(t!==dt&&i!==dt&&t!=i)throw new f(Or);if(o){const t=lo(e);if(n.entries(o).some(([e,n])=>n!==dt&&t[e]!==dt&&n!=t[e]))throw new f(Or)}}}function po(t,e=0,r=1){return n.assign({},ho(t),{[Wr]:Zr+"="+(e<0?e:e+"-"+(e+r-1))})}function ho({options:t}){const{headers:e}=t;if(e)return T.iterator in e?n.fromEntries(e):e}async function mo(t){await So(t,bo)}async function yo(t){await So(t,Eo)}async function So(t,e){const n=await e(Pr,t,ho(t));t.data=new w(await n.arrayBuffer()),t.size=t.data.length}async function go(t,e,n){if(t.preventHeadRequest)await n(t,t.options);else{const r=await e("HEAD",t,ho(t)),i=r.headers.get("Content-Length");i&&!r.headers.get("Content-Encoding")?t.size=o(i):await n(t,t.options)}}async function bo(t,{fetch:e=fetch,options:r,url:o},i){const s=await e(o,n.assign({},r,{method:t,headers:i}));if(s.status<400)return s;throw 416==s.status?new f(Ur):new f(Nr+(s.statusText||s.status))}function Eo(t,{url:e},r){return new S((o,i)=>{const s=new XMLHttpRequest;if(s.addEventListener("load",()=>{if(s.status<400){const t=[];s.getAllResponseHeaders().trim().split(/[\r\n]+/).forEach(e=>{const n=e.trim().split(/\s*:\s*/);n[0]=n[0].trim().replace(/^[a-z]|-[a-z]/g,t=>t.toUpperCase()),t.push(n)}),o({status:s.status,arrayBuffer:()=>s.response,headers:new c(t)})}else i(416==s.status?new f(Ur):new f(Nr+(s.statusText||s.status)))},!1),s.addEventListener("error",t=>i(t.detail?t.detail.error:new f("Network error")),!1),s.open(t,e),r)for(const t of n.entries(r))s.setRequestHeader(t[0],t[1]);s.responseType="arraybuffer",s.send()})}class xo extends qr{constructor(t,e={}){super(),n.assign(this,{url:t,reader:e.useXHR&&!e.fetch?new io(t,e):new oo(t,e)})}set size(t){}get size(){return this.reader.size}async init(){await this.reader.init(),super.init()}createReadable(t){return this.reader.createReadable(t)}readUint8Array(t,e){return this.reader.readUint8Array(t,e)}}class Ro extends qr{constructor(t){super(),t=new w(t.buffer,t.byteOffset,t.byteLength),n.assign(this,{Pt:t,size:t.length})}readUint8Array(t,e){return this.Pt.slice(t,t+e)}}class zo extends Kr{constructor(t){super(),this.Zt=t||262144}init(t=0){n.assign(this,{offset:0,Pt:new w(t>0?t:this.Zt)}),super.init()}writeUint8Array(t){const e=this,n=e.offset+t.length;if(n>e.Pt.length){let t=e.Pt.length?2*e.Pt.length:e.Zt;for(;t<n;)t*=2;const r=e.Pt;e.Pt=new w(t),e.Pt.set(r)}e.Pt.set(t,e.offset),e.offset+=t.length}getData(){return this.offset===this.Pt.length?this.Pt:this.Pt.slice(0,this.offset)}}class Fo extends qr{constructor(t){super(),this.Ht=t}async init(){const t=this;t.Vt=0;const e=t.Ht=await S.all(t.Ht.map(To));t.Gt=e.map(e=>{const n=t.size;return t.size+=e.size,n}),super.init()}jt(t){const{Gt:e,size:n}=this,r=e[t];return r===dt?n:r}async readUint8Array(t,e){const n=this,{Ht:r}=this;let o,i=0,a=t;for(;r[i]&&a>=r[i].size;)a-=r[i].size,i++;const c=r[i];if(c){const r=c.size;if(a+e<=r)o=await vo(c,a,e);else{const i=r-a;o=ie(await vo(c,a,i),await n.readUint8Array(t+i,e-i))}}else o=yt;return n.Vt=s.max(i,n.Vt),o}}class Do extends jr{constructor(t,e=4294967295){super();const r=this;let o,i,s;n.assign(r,{diskNumber:0,diskOffset:0,size:0,maxSize:e,availableSize:e});const a=new D({async write(e){if(e===Gr)return void(s&&await u());const{availableSize:n}=r;if(s)e.length>=n?(await c(e.subarray(0,n)),await u(),e.length>n&&await this.write(e.subarray(n))):await c(e);else{const{value:n,done:a}=await t.next();if(a&&!n)throw new f(Mr);o=n,o.size=0,o.maxSize&&(r.maxSize=o.maxSize),r.availableSize=r.maxSize,await Io(o),i=n.writable,s=i.getWriter(),await this.write(e)}},async close(){s&&(await s.ready,await l())},async abort(t){s&&await s.abort(t)}});async function c(t){const e=t.length;e&&(await s.ready,await s.write(t),o.size+=e,r.availableSize-=e)}async function u(){await l(),r.diskOffset+=o.size,r.diskNumber++,s=null,r.availableSize=r.maxSize}async function l(){await s.close()}n.defineProperty(r,Vr,{get:()=>a})}async closeDisk(){const t=this.writable.getWriter();try{await t.ready,await t.write(Gr)}finally{t.releaseLock()}}}class Ao{constructor(t){return e.isArray(t)&&(t=new Fo(t)),(t instanceof F||typeof t.getReader==pt)&&(t={readable:wn(t)}),t}}class ko{constructor(t){return t.writable===dt&&typeof t.next==pt&&(t=new Do(t)),(t instanceof D||typeof t.getWriter==pt)&&(t={writable:hn(t)}),t.size===dt&&(t.size=0),t}}function Co(t){return Boolean(t&&t.getData)}async function Io(t,e){if(!t.init||t.initialized)return S.resolve();await t.init(e)}async function To(t){return t=new Ao(t),await Io(t),t.size!==dt&&t.readUint8Array||(t=new $r(await pn(t.readable)),await Io(t)),t}function vo(t,e,n){return t.readUint8Array(e,n)}function _o(t,e){return t.createReadable?t.createReadable(e):t.readUint8Array?qr.prototype.createReadable.call(t,e):t.readable}const No="filename",Uo="rawFilename",Oo="comment",Mo="rawComment",Lo="uncompressedSize",Bo="compressedSize",Wo="offset",Po="diskNumberStart",Zo="lastModDate",Ho="rawLastModDate",Vo="lastAccessDate",Go="rawLastAccessDate",jo="creationDate",qo="rawCreationDate",Ko="internalFileAttributes",Yo="externalFileAttributes",Xo="msdosAttributesRaw",Jo="msdosAttributes",Qo="msDosCompatible",$o="zip64",ti="encrypted",ei="version",ni="versionMadeBy",ri="zipCrypto",oi="directory",ii="executable",si="compressionMethod",ai="signature",ci="extraField",ui="unixMode",li="setuid",di="setgid",fi="sticky",wi=[No,Uo,Lo,Bo,Zo,Ho,Oo,Mo,Vo,Go,jo,qo,Wo,Po,Ko,Yo,Xo,Jo,Qo,$o,ti,ei,ni,ri,oi,ii,"symlink",si,ai,"crc32",ci,"extraFieldUnix","extraFieldInfoZip","extraFieldUnixType1","extraFieldPkwareUnix","uid","gid",ui,"unixExternalUpper",li,di,fi,"bitFlag","rawBitFlag","filenameLength","extraFieldLength","filenameUTF8","commentUTF8","rawExtraField","extraFieldZip64","extraFieldUnicodePath","extraFieldUnicodeComment","extraFieldAES","extraFieldNTFS","extraFieldExtendedTimestamp","extraFieldUSDZ"];class pi{constructor(t){wi.forEach(e=>this[e]=t[e])}}const hi="File format is not recognized",mi="End of central directory not found",yi="End of Zip64 central directory locator not found",Si="Central directory header not found",gi="Local file header not found",bi="Zip64 extra field not found",Ei="File contains encrypted entry",xi="Encryption method not supported",Ri="Split zip file",zi="Overlapping entry found",Fi="Entry data out of bounds",Di="Ambiguous archive",Ai="Encrypted central directory is not supported",ki="Unsafe filename",Ci="Invalid strictness (must be 'strict', 'balanced' or 'tolerant')",Ii="Invalid filenameValidation (must be 'strict', 'balanced' or 'tolerant')",Ti="Invalid maxAppendedDataSize (must be a number greater than or equal to 0)",vi="64-bit value exceeds Number.MAX_SAFE_INTEGER",_i="unsorted central directory",Ni="unknown version needed to extract",Ui="compressed patched data",Oi="malformed extra field",Mi="unknown zip64 extensible data",Li="wrapped entries count",Bi="appended data",Wi="prepended data",Pi="prepended central directory",Zi="trailing central directory data",Hi="duplicate filename",Vi="mismatched zip64 end of central directory record",Gi="mismatched local file header (general purpose bit flag)",ji="mismatched local file header (compression method)",qi="mismatched local file header (crc32 or sizes)",Ki=/^[a-zA-Z]:/,Yi="utf-8",Xi="cp437",Ji=[[Lo,O],[Bo,O],[Wo,O],[Po,M]],Qi={[M]:{qt:Us,bytes:4},[O]:{qt:Os,bytes:8}},$i=i(o.MAX_SAFE_INTEGER);class ts{constructor(t,e={}){n.assign(this,{reader:new Ao(t),options:e,Kt:new c})}async*getEntriesGenerator(t={}){const e=this;let{reader:r}=e;if(await Io(r),r.size!==dt&&r.readUint8Array||(r=new $r(await pn(r.readable)),await Io(r)),r.size<K)throw new f(hi);const o=e.warnings=[],i=ys(t,e.options),a=i==_t,c=i!=Ut,l=bs(Cs(e,t,Ct),i),d=function(t,e){if(t===dt)return e;if(!ms(t))throw new f(Ii);return t}(Cs(e,t,"filenameValidation"),i),w=Cs(e,t,"normalizeFilename"),{Yt:p,Xt:h}=await Es(r,c,l);if(!p)throw await async function(t){return await hs(t)==W}(r)?new f(Ri):new f(mi);c&&h>1&&ks("multiple end of central directory records");const m=ae(p);let y=Us(m,12),S=Us(m,16);const g=p.offset,b=Ns(m,20),E=g+K+b,x=r.size-E;x>l&&ks(Bi),x>0&&As(o,Bi);let R=Ns(m,4);const F=r.Vt||0;let D,A,k,C,I,T=Ns(m,6),v=Ns(m,10),_=0,N=X;const U=S==O||y==O||v==M||T==M;if(S!=O&&T!=M&&(S+=ps(r,T)),U){const t=p.offset>=Y?await vo(r,p.offset-Y,Y):yt,e=ae(t);if(t.length==Y&&Us(e,0)==j){S=ps(r,Us(e,4))+Os(e,8);let t=await vo(r,S,X),i=ae(t);const c=p.offset-Y-X;if((t.length<X||Us(i,0)!=G)&&S!=c&&c>=0){const e=S;S=c,S>e&&(_=S-e),t=await vo(r,S,X),i=ae(t)}if(t.length<X||Us(i,0)!=G)throw new f(yi);if(k=!0,C=Os(i,4)>44,C){const t=s.min(Os(i,4)-44,r.size-S-X);t>0&&(N+=t,I=function(t){const e={rawExtensibleData:t};if(t.length>=28){const r=ae(t),o=Ns(r,26);n.assign(e,{compressionMethod:Ns(r,0),compressedSize:Os(r,2),uncompressedSize:Os(r,10),encryptionAlgorithm:Ns(r,18),bitLength:Ns(r,20),flags:Ns(r,22),hashAlgorithm:Ns(r,24),hashData:t.subarray(28,28+o)})}return e}(await vo(r,S+X,t)))}R==M?R=Us(i,16):R!=Us(i,16)&&Ds(a,o,Vi),T==M?T=Us(i,20):T!=Us(i,20)&&Ds(a,o,Vi),v==M?v=Os(i,32):v!=Os(i,32)&&Ds(a,o,Vi),y==O?y=Os(i,40):y!=Os(i,40)&&Ds(a,o,Vi),S=ps(r,T)+Os(i,48)+_}}let B=y;const P=p.offset-(k?N+Y:0);if(S>=r.size&&(_=r.size-S-y-K,S=r.size-y-K),F!=R)throw new f(Ri);if(S<0)throw new f(hi);let Z=0,V=await vo(r,S,y),J=ae(V);if(y){if(V.length<4)throw new f(hi);const t=P-y;if(S!=t&&T==R){const e=Us(J,Z)==H||Boolean(I&&I.compressedSize)||os(J);let n=!e;if(!n&&t>=0&&t+4<=r.size&&(n=Us(ae(await vo(r,t,4)),0)==H),n){const n=S;S=t,S>n&&(_+=S-n,D=e),V=await vo(r,S,y),J=ae(V)}}}const Q=P-S;if(y!=Q&&Q>=0&&T==R&&(y=Q,V=await vo(r,S,y),J=ae(V)),S<0||S>=r.size)throw new f(hi);e.directoryOffset=S,e.directoryLength=B;const $=Is(e,t,"decryptCentralDirectory");let tt,et;if($&&v&&V.length>=4&&Us(J,0)!=H&&(C||os(J))){const t=function(t,e,n){const r=t&&t.compressedSize?t.compressedSize:e;return r>0&&r<=n?r:n}(I,B,V.length);et=V.subarray(t),V=await $(V.subarray(0,t),I),J=ae(V),B=V.length,tt=!0}I&&!tt&&(V.length<4||Us(J,0)==H)&&As(o,Mi),A=S;const nt=Cs(e,t,"filenameEncoding"),ct=Cs(e,t,"commentEncoding"),ut=new u;let lt,ft=-1;const wt=!a&&!k;!v&&wt&&(v=is(J,V,Z),v&&As(o,Li));for(let i=0;i<v;i++){const a=new rs(r,e.options);if(Z+q>V.length||Us(J,Z)!=H){if(0==i&&!tt&&(C||os(J)))throw new f(Ai);throw new f(Si)}as(a,J,Z+6);const c=Boolean(a.bitFlag.languageEncodingFlag),u=Z+q,l=u+a.filenameLength,p=l+a.extraFieldLength,h=Ns(J,Z+4),m=!(h>>8),y=h>>8==3,S=V.subarray(u,l),g=Ns(J,Z+32),b=p+g,E=V.subarray(p,b),x=c,R=c,F=Us(J,Z+38),D=F&L,k={readOnly:Boolean(1&D),hidden:Boolean(2&D),system:Boolean(4&D),directory:Boolean(16&D),archive:Boolean(32&D)},I=Us(J,Z+42),T=Is(e,t,"decodeText")||vr,N=x?Yi:nt||Xi,U=R?Yi:ct||Xi;let O=T(S,N,Tt);if(O===dt&&(O=vr(S,N)),w){const t=w(O);t!==dt&&(O=t)}if(gs(O,d)){const t=new f(ki);throw t.filename=O,t}let B=T(E,U,vt);B===dt&&(B=vr(E,U)),n.assign(a,{index:i,Jt:tt,versionMadeBy:h,msDosCompatible:m,zip64:!1,compressedSize:0,uncompressedSize:0,Qt:g,offset:I,diskNumberStart:Ns(J,Z+34),internalFileAttributes:Ns(J,Z+36),externalFileAttributes:F,msdosAttributesRaw:D,msdosAttributes:k,rawFilename:S,filenameUTF8:x,commentUTF8:R,rawExtraField:V.subarray(l,p),rawComment:E,filename:O,comment:B}),cs(a,a,J,Z+6)&&As(o,Oi,O),a.offset+=_;const W=ps(r,a.diskNumberStart)+a.offset;A=s.min(W,A),W<ft&&As(o,_i,O),ft=W,(a.version&L)>63&&As(o,Ni,O),32&~a.rawBitFlag||As(o,Ui,O),ut.has(a.filename)&&(lt=!0),ut.add(a.filename);const P=a.externalFileAttributes>>16&M;a.unixMode===dt&&16877&P&&(a.unixMode=P);const G=Boolean(a.unixMode&it),j=Boolean(a.unixMode&st),K=Boolean(512&a.unixMode),Y=40960==((a.unixMode===dt?P:a.unixMode)&rt),X=!Y&&(a.unixMode!==dt?!!(73&a.unixMode):y&&!!(73&P)),Q=a.unixMode!==dt&&(a.unixMode&rt)==ot,$=(P&rt)==ot;n.assign(a,{setuid:G,setgid:j,sticky:K,symlink:Y,unixExternalUpper:P,executable:X,directory:Q||$||m&&k.directory||a.filename.endsWith(at),zipCrypto:a.encrypted&&!a.extraFieldAES});const et=new pi(a);if(et.getData=(t,n)=>a.getData(t,et,e.Kt,n),et.arrayBuffer=async t=>{const n=new z,r=pn(n.readable).then(t=>t.arrayBuffer());return r.catch(()=>{}),await a.getData(n,et,e.Kt,t),r},Z=b,i==v-1&&wt){const t=is(J,V,Z);t&&(v+=t,As(o,Li))}const{onprogress:pt}=t;if(pt)try{await pt(i+1,v,new pi(a))}catch{}yield et}let pt=Z,ht=ss(V.subarray(Z))||(tt?ss(et):dt);if(!ht&&!tt){const t=S+Z,e=s.min(P-t,65541);e>=6&&(ht=ss(await vo(r,t,e)))}ht&&(e.digitalSignature=ht,pt=Z+6+ht.length),(Z!=B&&pt!=B||!tt&&Z!=y&&pt!=y)&&Ds(a,o,Zi),lt&&Ds(a,o,Hi);const mt=Cs(e,t,"extractPrependedData"),St=Cs(e,t,"extractAppendedData"),gt=(a||mt)&&v&&4==A&&await async function(t){const e=await hs(t);return e==W||808471376==e}(r)?4:0;return a&&(_||v&&A>gt)&&ks(Wi),(_||v&&A>4)&&As(o,Wi),D&&As(o,Pi),mt&&(e.prependedData=A>gt?await vo(r,gt,A-gt):yt),e.comment=b?await vo(r,g+K,b):yt,St&&(e.appendedData=E<r.size?await vo(r,E,r.size-E):yt),!0}async getEntries(t={}){const e=[];for await(const n of this.getEntriesGenerator(t))e.push(n);return e}async close(){const{reader:t}=this;t.readUint8Array||!t.readable||t.readable.locked||await t.readable.cancel()}}class es{constructor(t={}){const{readable:e,writable:n}=new z,r=new ts(e,t).getEntriesGenerator();this.readable=new F({async pull(t){const{done:e,value:n}=await r.next();if(e)return t.close();const o={...n,readable:function(){const{readable:t,writable:e}=new z;if(n.getData)return async function(){try{await n.getData(e)}catch(t){try{await e.abort(t)}catch{}}}(),t}()};delete o.getData,t.enqueue(o)}}),this.writable=n}}async function ns(t,e={}){if(t=new Ao(t),await Io(t),t.size!==dt&&t.readUint8Array||(t=new $r(await pn(t.readable)),await Io(t)),t.size<K)return!1;const n=ys(e,{}),r=n!=Ut,o=bs(e[Ct],n),{Yt:i,Xt:s}=await Es(t,r,o);if(!i||n==_t&&s>1)return!1;const a=Ns(ae(i),20),c=i.offset+K+a;return t.size-c<=o}let rs=class{constructor(t,e){n.assign(this,{reader:t,options:e})}async getData(t,e,n,r={}){const o=this,i=$t(),{reader:a,index:c,offset:u,diskNumberStart:l,extraFieldAES:d,extraFieldZip64:w,compressionMethod:p,bitFlag:h,rawBitFlag:m,crc32:y,rawLastModDate:S,uncompressedSize:g,compressedSize:b}=o,{dataDescriptor:E}=h,x=e.localDirectory={},R=e.warnings=[],z=ps(a,l)+u,F=await vo(a,z,ct),A=ae(F);let k=Cs(o,r,St),C=Cs(o,r,gt);const I=Cs(o,r,bt);if(Pt(k,C),k=k&&k.length&&k,C=C&&C.length&&C,d&&99!=d.originalCompressionMethod)throw new f(gn);if(F.length<ct||Us(A,0)!=B)throw new f(gi);as(x,A,4);const{extraFieldLength:T,filenameLength:v}=x,_=x.dataOffset=z+ct+v+T,N=Cs(o,r,"checkLocalDirectory"),U=ys(r,o.options),O=function(t,e){return t===dt?e!=Ut:Boolean(t)}(N,U),M=function(t,e){return t===dt?e==_t:Boolean(t)}(N,U);let W=yt;if(M&&(v||T)){const t=await vo(a,z+ct,v+T);W=t.subarray(0,v),x.rawExtraField=t.subarray(v)}else x.rawExtraField=T?await vo(a,z+ct+v,T):yt;M&&(x.rawFilename=W),cs(o,x,A,4,!0)&&As(R,Oi),function(t,e,n,r,o){const{rawFilename:i}=t,s=!o,a=t.Jt&&!(8192&~e.rawBitFlag);!r||a||n.length==i.length&&!n.some((t,e)=>t!=i[e])||Ds(s,o,"mismatched local file header (filename)"),(2057&e.rawBitFlag)!=(2057&t.rawBitFlag)&&Ds(s,o,Gi),e.compressionMethod!=t.compressionMethod&&Ds(s,o,ji),e.bitFlag.dataDescriptor||a||!(e.crc32||e.compressedSize||e.uncompressedSize)||e.crc32==t.crc32&&e.compressedSize==t.compressedSize&&e.uncompressedSize==t.uncompressedSize||Ds(s,o,qi)}(o,x,W,M,O?dt:R);const{lastAccessDate:Z,creationDate:H,uid:V,gid:G}=x;Z&&(e.lastAccessDate=Z),H&&(e.creationDate=H),V!==dt&&e.uid===dt&&(e.uid=V),G!==dt&&e.gid===dt&&(e.gid=G);const j=o.encrypted&&x.encrypted&&!I,q=j&&!d;if(I||(e.zipCrypto=q),j&&!(64&~x.rawBitFlag))throw new f(xi);const K=I?dt:Rn(p);if(0!=p&&8!=p&&9!=p&&!K&&!I)throw new f(gn);if(j){if(!q&&(d.strength<1||d.strength>3))throw new f(xi);if(!k&&!C)throw new f(Ei)}if(_+b>a.size)throw new f(Fi);const Y=b,X=wn(a.createReadable({offset:_,size:Y})),J=Wt(Cs(o,r,Et)),Q=Cs(o,r,"checkPasswordOnly");let $=Cs(o,r,"checkOverlappingEntry");const tt=Cs(o,r,"checkOverlappingEntryOnly");tt&&($=!0);const{onstart:et,onprogress:nt,onend:rt}=r,ot=0!=p&&!I,it=I?b:g,st=9==p;let at=Cs(o,r,Rt);st&&(at=!1);const ut=Cs(o,r,"checkCrc32"),lt=(ut===dt?Cs(o,r,"checkSignature"):ut)&&!I&&(!j||q||d&&1==d.vendorVersion),ft={options:{codecType:qn,password:k,rawPassword:C,zipCrypto:q,encryptionStrength:d&&d.strength,checkCrc32:lt,checkAuthenticationCode:Cs(o,r,"checkAuthenticationCode"),passwordVerification:q&&(E?S>>>8&L:y>>>24&L),outputSize:it,crc32:y,compressed:ot,encrypted:j,useWebWorkers:Cs(o,r,xt),useCompressionStream:at,transferStreams:Cs(o,r,zt),deflate64:st,format:K?K.format:dt,codecURI:K?K.codecURI:dt,compressionMethod:p,rawBitFlag:m,checkPasswordOnly:Q},config:i,ft:{signal:J,size:Y,onstart:et,onprogress:nt,onend:rt}};let wt,pt;$&&await async function({reader:t,$t:e,index:n,offset:r,crc32:o,compressedSize:i,uncompressedSize:s,dataOffset:a,dataDescriptor:c,extraFieldZip64:u,Kt:l}){let d=0;if(c&&(d=u?20:12),d){const n=await vo(t,a+i,d+4),r=ae(n);let c=n.length==d+4&&Us(r,0)==P;if(c){const t=ws(r,4,u);(e.encrypted&&!e.zipCrypto||t.crc32==o)&&t.compressedSize==i&&t.uncompressedSize==s?d+=4:c=!1}if(n.length>=d){const t=ws(r,c?4:0,u);t.signature=c,e.localDirectory.dataDescriptor=t}}const w={start:r,end:a+i+d,$t:e};for(const[t,e]of l)if(t!=n&&w.start<e.end&&e.start<w.end){const t=new f(zi);throw t.overlappingEntry=e.$t,t}l.set(n,w)}({reader:a,$t:e,index:c,offset:z,crc32:y,compressedSize:b,uncompressedSize:g,dataOffset:_,dataDescriptor:E||x.bitFlag.dataDescriptor,extraFieldZip64:w||x.extraFieldZip64,Kt:n});try{if(!tt){Q&&(t=new D),t=new ko(t),await Io(t,function(t,e,n){return s.min(t,n?1032*e:e)}(it,b,ot)),({writable:wt}=t);const{outputSize:e}=await Fr({readable:X,writable:wt},ft);if(t.size+=e,e!=it)throw new f(An)}}catch(e){if(e.outputSize!==dt&&(t.size+=e.outputSize),!Q||e.message!=Ae)throw pt=e,e}finally{if((Co(t)||!Cs(o,r,Ft))&&wt&&!wt.locked){const t=wt.getWriter();if(pt)try{await t.abort(pt)}catch{}else await t.close()}}return Q||tt?dt:t.getData?t.getData():wt}};function os(t){const e=s.min(t.byteLength,1024)-3;for(let n=0;n<e;n++)if(134630224==Us(t,n))return!0;return!1}function is(t,e,n){let r=0;for(;n+q<=e.length&&Us(t,n)==H;)n+=q+Ns(t,n+28)+Ns(t,n+30)+Ns(t,n+32),r++;return r%65536?0:r}function ss(t){if(t.length>=6){const e=ae(t);if(Us(e,0)==Z){const n=Ns(e,4);if(6+n<=t.length)return t.subarray(6,6+n)}}}function as(t,e,r){const o=t.rawBitFlag=Ns(e,r+2),i=!(1&~o),s=Us(e,r+6);n.assign(t,{encrypted:i,version:Ns(e,r),bitFlag:{level:(6&o)>>1,dataDescriptor:!(8&~o),languageEncodingFlag:(o&nt)==nt},rawLastModDate:s,lastModDate:Ts(s),filenameLength:Ns(e,r+22),extraFieldLength:Ns(e,r+24)})}function cs(t,e,r,o,i){const{rawExtraField:s}=e,u=e.extraField=new c,l=ae(s);let d=0,w=!1;try{for(;d<s.length;){const t=Ns(l,d),e=Ns(l,d+2);u.set(t,{type:t,data:s.slice(d+4,d+4+e)}),d+=4+e}}catch{w=!0}d>s.length&&(w=!0);const p=Ns(r,o+4);n.assign(e,{signature:Us(r,o+10),crc32:Us(r,o+10),compressedSize:Us(r,o+14),uncompressedSize:Us(r,o+18)});const h=u.get(1);h&&(function(t,e){e.zip64=!0;const n=ae(t.data),r=Ji.filter(([t,n])=>e[t]==n),o=r.reduce((t,[,e])=>t+Qi[e].bytes,0);if(t.data.length<o)throw new f(bi);for(let o=0,i=0;o<r.length;o++){const[s,a]=r[o],c=Qi[a];e[s]=t[s]=c.qt(n,i),i+=c.bytes}}(h,e),e.extraFieldZip64=h);const m=u.get(28789);m&&(us(m,No,Uo,e,t),e.extraFieldUnicodePath=m);const y=u.get(25461);y&&(us(y,Oo,Mo,e,t),e.extraFieldUnicodeComment=y);const S=u.get(J);S&&S.data.length>=7?(function(t,e,r){const o=ae(t.data),i=_s(o,4);n.assign(t,{vendorVersion:_s(o,0),vendorId:_s(o,2),strength:i,originalCompressionMethod:r,compressionMethod:Ns(o,5)}),e.compressionMethod=t.compressionMethod,1!=t.vendorVersion&&(e.crc32=dt)}(S,e,p),e.extraFieldAES=S):e.compressionMethod=p;const g=u.get(13);g&&(ls(g,e),e.extraFieldPkwareUnix=g);const b=u.get(22613);b&&(ls(b,e),e.extraFieldUnixType1=b);const E=u.get(10);E&&(function(t,e){const r=ae(t.data);let o,i=4;try{for(;i<t.data.length&&!o;){const e=Ns(r,i),n=Ns(r,i+2);1==e&&(o=t.data.slice(i+4,i+4+n)),i+=4+n}}catch{}if(o&&24==o.length){const r=ae(o),i=r.getBigUint64(0,!0),s=r.getBigUint64(8,!0),a=r.getBigUint64(16,!0);n.assign(t,{rawLastModDate:i,rawLastAccessDate:s,rawCreationDate:a});const c={lastModDate:vs(i),lastAccessDate:vs(s),creationDate:vs(a)};n.assign(t,c),n.assign(e,c,{rawLastAccessDate:s,rawCreationDate:a})}}(E,e),e.extraFieldNTFS=E);const x=u.get(et);let R;if(x&&(R=ds(x,e,!1),e.extraFieldUnix=x),!R){const t=u.get(tt);t&&(ds(t,e,!0),e.extraFieldInfoZip=t)}const z=u.get(Q);z&&(function(t,e,n){if(!t.data.length)return;const r=ae(t.data),o=_s(r,0),i=[],s=[];n?(1&~o||(i.push(Zo),s.push(Ho)),2&~o||(i.push(Vo),s.push(Go)),4&~o||(i.push(jo),s.push(qo))):t.data.length>=5&&(i.push(Zo),s.push(Ho));let c=1;i.forEach((n,o)=>{if(t.data.length>=c+4){const i=Us(r,c);e[n]=t[n]=new a(1e3*(0|i));const u=s[o];t[u]=i}c+=4})}(z,e,i),e.extraFieldExtendedTimestamp=z);const F=u.get($);return F&&(e.extraFieldUSDZ=F),w}function us(t,e,r,o,i){if(t.data.length<5)return void(t.valid=!1);const s=ae(t.data),a=new ye;a.append(i[r]);const c=ae(new w(4));c.setUint32(0,a.get(),!0);const u=Us(s,1),l=_s(s,0);n.assign(t,{version:l,[e]:vr(t.data.subarray(5)),valid:1==l&&!i.bitFlag.languageEncodingFlag&&u==Us(c,0)}),t.valid&&(o[e]=t[e],o[e+"UTF8"]=!0)}function ls(t,e){if(t.data.length<8)return;const r=ae(t.data),o={lastAccessDate:new a(1e3*(0|Us(r,0))),lastModDate:new a(1e3*(0|Us(r,4)))};t.data.length>=12&&(o.uid=Ns(r,8),o.gid=Ns(r,10)),n.assign(t,o),n.assign(e,o)}function ds(t,e,r){try{const o=ae(t.data);let i,s;if(r){let e=0;const r=_s(o,e++),a=_s(o,e++);i=fs(t.data.subarray(e,e+a)),e+=a;const c=_s(o,e++);s=fs(t.data.subarray(e,e+c)),n.assign(t,{version:r,uid:i,gid:s})}else t.data.length>=4&&(i=Ns(o,0),s=Ns(o,2),n.assign(t,{uid:i,gid:s}));return i!==dt&&(e.uid=i),s!==dt&&(e.gid=s),i!==dt||s!==dt}catch{}}function fs(t){const e=new w(4);return e.set(t,0),new m(e.buffer,e.byteOffset,4).getUint32(0,!0)}function ws(t,e,n){const r=Us(t,e);let o,i;return n?(o=Os(t,e+4),i=Os(t,e+12)):(o=Us(t,e+4),i=Us(t,e+8)),{crc32:r,compressedSize:o,uncompressedSize:i}}function ps(t,e){return t.jt?t.jt(e):0}async function hs(t){return Us(ae(await vo(t,0,4)))}function ms(t){return t===_t||t===Nt||t===Ut}function ys(t,e){return Ss(t,Ss(e,Nt))}function Ss(t,e){const n=t.strictness;if(n!==dt){if(!ms(n))throw new f(Ci);return n}const r=t.checkAmbiguity;return r===dt?e:r?_t:e==Ut?Ut:Nt}function gs(t,e){if(e==Ut)return!1;const n=t.split("/");return n.length>1&&""===n[n.length-1]&&n.pop(),!!(n.includes("..")||t.startsWith("/")||t.startsWith("\\\\")||Ki.test(t))||e==_t&&(n.includes(".")||n.includes(""))}function bs(t,e){if(t!==dt){const e=Vt(t);if("number"!=typeof e||o.isNaN(e)||e<0)throw new f(Ti);return e}return e==_t?0:e==Ut?1/0:M}async function Es(t,e,n){const{size:r}=t,o=s.min(r,65557),i={count:64};let a,c,u=0;for await(const[n,s,l,d,f]of xs(t,o)){const o=Ns(n,d+20);if(f+K+o==r){const o=await zs(t,n,s,d,f,r,i);if(2==o){if(a||(a=Rs(l,d,f)),u++,!e||u>1)break}else 1!=o||c||(c=Rs(l,d,f))}}return a||(a=c),a||(a=await async function(t,e,n){const{size:r}=t,o=s.min(r,e==1/0?r:65557+e);let i,a;for await(const[e,s,c,u,l]of xs(t,o)){const o=Rs(c,u,l);i||(i=o);const d=await zs(t,e,s,u,l,r,n);if(2==d)return o;1!=d||a||(a=o)}return a||i}(t,n,i)),{Yt:a,Xt:u}}async function*xs(t,e){const n=t.size-e,r=await vo(t,n,e),o=ae(r);for(let t=r.length-K;t>=0;t--)Us(o,t)==V&&(yield[o,n,r,t,n+t])}function Rs(t,e,n){return{offset:n,buffer:t.slice(e,e+K).buffer}}async function zs(t,e,n,r,o,i,s){const a=Ns(e,r+10),c=Us(e,r+12),u=Us(e,r+16);if(a==M||c==O||u==O)return await Fs(t,e,n,o-Y,i,s)==j?2:0;if(!a&&!c)return 1;const l=Ns(e,r+6);for(const r of[o-c,ps(t,l)+u])if(await Fs(t,e,n,r,i,s)==H)return 2;return 0}async function Fs(t,e,n,r,o,i){return r<0||r+4>o?dt:r>=n?Us(e,r-n):i.count>0?(i.count--,Us(ae(await vo(t,r,4)),0)):dt}function Ds(t,e,n){t?ks(n):As(e,n)}function As(t,e,n){if(!t.some(t=>t.reason==e)){const r={reason:e};n!==dt&&(r.filename=n),t.push(r)}}function ks(t){const e=new f(Di);throw e.reason=t,e}function Cs(t,e,n){return e[n]===dt?t.options[n]:e[n]}function Is(t,e,n){return Bt(Cs(t,e,n))}function Ts(t){const e=(4294901760&t)>>16,n=t&M,r=new a(1980+((65024&e)>>9),((480&e)>>5)-1,31&e,(63488&n)>>11,(2016&n)>>5,2*(31&n),0);return r<lt?lt:r}function vs(t){return new a(o(t/i(1e4)-i(116444736e5)))}function _s(t,e){return t.getUint8(e)}function Ns(t,e){return t.getUint16(e,!0)}function Us(t,e){return t.getUint32(e,!0)}function Os(t,e){const n=t.getBigUint64(e,!0);if(n>$i)throw new f(vi);return o(n)}var Ms=n.freeze({__proto__:null,ERR_AMBIGUOUS_ARCHIVE:Di,ERR_BAD_FORMAT:hi,ERR_CENTRAL_DIRECTORY_NOT_FOUND:Si,ERR_ENCRYPTED:Ei,ERR_ENCRYPTED_CENTRAL_DIRECTORY:Ai,ERR_ENTRY_DATA_OUT_OF_BOUNDS:Fi,ERR_EOCDR_LOCATOR_ZIP64_NOT_FOUND:yi,ERR_EOCDR_NOT_FOUND:mi,ERR_EXTRAFIELD_ZIP64_NOT_FOUND:bi,ERR_INVALID_AUTHENTICATION_CODE:De,ERR_INVALID_COMPRESSED_DATA:kn,ERR_INVALID_CRC32:Cn,ERR_INVALID_FILENAME_VALIDATION:Ii,ERR_INVALID_MAX_APPENDED_DATA_SIZE:Ti,ERR_INVALID_PASSWORD:Fe,ERR_INVALID_STRICTNESS:Ci,ERR_INVALID_UNCOMPRESSED_SIZE:An,ERR_LOCAL_FILE_HEADER_NOT_FOUND:gi,ERR_OVERLAPPING_ENTRY:zi,ERR_SPLIT_ZIP_FILE:Ri,ERR_UNSAFE_FILENAME:ki,ERR_UNSUPPORTED_COMPRESSION:gn,ERR_UNSUPPORTED_ENCRYPTION:xi,ERR_UNSUPPORTED_UINT64:vi,ERR_WORKER_STARTUP_TIMEOUT:Xn,WARNING_APPENDED_DATA:Bi,WARNING_COMPRESSED_PATCHED_DATA:Ui,WARNING_DUPLICATE_FILENAME:Hi,WARNING_MALFORMED_EXTRA_FIELD:Oi,WARNING_MISMATCHED_LOCAL_FILE_HEADER_BIT_FLAG:Gi,WARNING_MISMATCHED_LOCAL_FILE_HEADER_COMPRESSION_METHOD:ji,WARNING_MISMATCHED_LOCAL_FILE_HEADER_CRC32_OR_SIZES:qi,WARNING_MISMATCHED_ZIP64_END_OF_CENTRAL_DIRECTORY:Vi,WARNING_PREPENDED_CENTRAL_DIRECTORY:Pi,WARNING_PREPENDED_DATA:Wi,WARNING_TRAILING_CENTRAL_DIRECTORY_DATA:Zi,WARNING_UNKNOWN_VERSION:Ni,WARNING_UNKNOWN_ZIP64_EXTENSIBLE_DATA:Mi,WARNING_UNSORTED_CENTRAL_DIRECTORY:_i,WARNING_WRAPPED_ENTRIES_COUNT:Li,ZipReader:ts,ZipReaderStream:es,isZipFile:ns});const Ls="File already exists",Bs="Zip file comment exceeds 64KB",Ws="Invalid zip file comment (must be a Uint8Array)",Ps="File entry comment exceeds 64KB",Zs="Invalid file entry comment (must be a string)",Hs="Invalid date (must be a valid Date instance)",Vs="File entry name exceeds 64KB",Gs="Version exceeds 65535",js="The strength must equal 1, 2, or 3",qs="Encryption is not supported in USDZ files",Ks="Encryption is not supported when the 'passThrough' option is set",Ys="Invalid extra field (must be a Map)",Xs="Invalid extra field type (must be integer 0..65535)",Js="Invalid extra field data (must be a Uint8Array)",Qs="Extra field data exceeds 64KB",$s=-2147483648,ta=2147483647,ea=i(0),na=i("0x7fffffffffffffff"),ra="Zip64 is not supported (set the 'zip64' option to 'true')",oa="Undefined uncompressed size",ia="Undefined compression method",sa="Undetermined size",aa="Undefined reader",ca="Zip file not empty",ua="Invalid uid (must be integer 0..2^32-1)",la="Invalid gid (must be integer 0..2^32-1)",da="Invalid UNIX mode (must be integer 0..65535)",fa="Invalid unixExtraFieldType (must be 'infozip' or 'unix')",wa="uid/gid must be 0..65535 for unixExtraFieldType 'unix' (use 'infozip' for larger ids)",pa="Invalid msdosAttributesRaw (must be integer 0..255)",ha="Invalid msdosAttributes (must be an object with boolean flags)",ma="Invalid level (must be integer 0..9)",ya="Signature data exceeds 64KB",Sa=new w([7,0,2,0,65,69,3,0,0]),ga="infozip",ba="unix";let Ea=0;const xa=[];class Ra{constructor(t,e={}){t=new ko(t);const{availableSize:r=ft,maxSize:o=ft}=t,i=r>0&&r!==ft&&o>0&&o!==ft;n.assign(this,{writer:t,te:i,options:e,ee:new c,ne:new u,offset:e[At]===dt?t.size||t.writable.size||0:e[At],re:e[At]===dt?0:e[At]-(t.size||t.writable.size||0),oe:new u,ie:[],se:0,ae:dt})}prependZip(t){return Fa(this,async function(t,e){if(t.ne.size)throw new f(ca);await t.ce(e)}(this,t))}appendZip(t){return Fa(this,this.ce(t))}async ce(t){const r=this,{oe:o,ne:i,ee:s}=r;for(;o.size;)await S.allSettled(e.from(o));let a;const u=new S(t=>a=t);o.add(u);const l=[];let d;try{t=new Ao(t),await Io(t),t.size!==dt&&t.readUint8Array||(t=new $r(await pn(t.readable)),await Io(t));const{ZipReader:o}=await S.resolve().then(function(){return Ms}),a=new o(t),u=await a.getEntries();await a.close(),await Io(r.writer);const{directoryOffset:w}=a;u.forEach(({filename:t})=>{if(i.has(t))throw new f(Ls);i.add(t),l.push(t)}),r.ue=!0;const{le:p}=r;r.le=new S(t=>d=()=>{r.ue=!1,t()}),await p,r.te&&(delete r.te,await async function(t){return ae(await vo(t,0,4)).getUint32(0,!0)==W}(t)||(await Ka(r.writer,ja()),r.offset+=4));const h=await async function(t,n,r,o){const{writer:i}=t,s=new c;if(i.closeDisk){const a=e.from(r).sort((t,e)=>Ga(n,t)-Ga(n,e));let c=0;for(const e of a){const r=Ga(n,e);await Ha(t,n,c,r-c),Wa(i,await Va(n,r))&&await i.closeDisk(),s.set(e,{offset:Pa(t,i),diskNumberStart:La(i)}),c=r}await Ha(t,n,c,o-c)}else{const e=t.offset;await Ha(t,n,0,o),r.forEach(t=>s.set(t,{offset:e+Ga(n,t),diskNumberStart:0}))}return s}(r,t,u,w);u.forEach(t=>{const{version:e,rawLastModDate:r,rawFilename:o,bitFlag:i,encrypted:a,uncompressedSize:c,compressedSize:u,extraFieldZip64:l}=t;let{compressionMethod:d,rawExtraField:f}=t;const{level:w,languageEncodingFlag:p,dataDescriptor:m}=i;f=Za(f||yt),t.extraFieldAES&&(d=99);const y=dc(f),S=Boolean(l)&&l.uncompressedSize!==dt,g=Boolean(l)&&l.compressedSize!==dt,b=-7&wc(w,p,m,a,d)|w<<1,{de:E,fe:x}=fc({version:e,bitFlag:b,compressionMethod:d,uncompressedSize:c,compressedSize:u,rawLastModDate:r,rawFilename:o,we:g,pe:S,extraFieldLength:y}),{crc32:R}=t;R!==dt&&cc(x,10,R);const{offset:z,diskNumberStart:F}=h.get(t);n.assign(t,{pe:S,we:g,offset:z,diskNumberStart:F,he:!1,me:yt,ye:yt,Se:yt,ge:yt,be:yt,rawExtraField:f,Ee:yt,extendedTimestamp:!1,de:E,fe:x}),s.set(t.filename,t)})}catch(t){throw l.forEach(t=>i.delete(t)),t}finally{a(),o.delete(u),d&&d()}}add(t="",e,r={}){const o=this,{oe:s}=o,a=async function(t,e,r,o){if(tc(t,o=n.assign({},o),oi)&&!e.endsWith(at)&&(e+=at),t.ne.has(e))throw new f(Ls);t.ne.add(e),Ea<$t().maxWorkers?Ea++:await new S(t=>xa.push(t));try{return await async function(t,e,r,o){const s=ka(t,e,o);({name:e}=s);const a=Ca(t,e,o),{comment:c}=a,u=o[ci];t.ee.set(e,dt);const l=t.ae,d={};let w,p;a.xe.keepOrder&&(d.Re=new S(t=>w=t)),t.ae=d;try{const{xe:c}=a;0==c.level||c.compressionMethod!==dt||c.passThrough||await tr($t())||(c.level=0);const u=await async function(t,e,{xe:r},o){if(r.passThrough&&!e&&!tc(t,o,oi))throw new f(aa);let i;return e&&(e=new Ao(e),await Io(e),({size:i}=e)),n.assign({reader:e},Ta(t,Boolean(e),i,r,o))}(t,r,a,o);({reader:r}=u);const h=Ba(t.writer),m=La(t.writer),y=va(o=n.assign({},o,s.xe,a.xe,u.xe,{signature:o[ai],crc32:o.crc32===dt?o[ai]:o.crc32,offset:t.offset-h,diskNumberStart:m,[kt]:t.options[kt]})),g=Ua(o),b=dc(y.ze,g.Fe);p=await async function(t,e,r,o,s){const{ee:a,writer:c}=t,{keepOrder:u,dataDescriptor:l,De:d,signal:w}=s,{Ae:p,$t:h,ke:m,Ce:y}=o,g=t.options[kt];let b,E,x,R,F,D,A=h,k=0;const C=u&&m?m.Re:dt;a.set(e,A);try{s.bufferedWrite||!u||t.ue||t.se||!l&&!d?(b=!0,t.se++,D=s.createTempStream?await s.createTempStream():new z(dt,dt,{highWaterMark:ft}),D.size=0,await Io(c)):(D=c,await C,await I()),await Io(D);const h=Ba(c);t.te&&!b&&await qa(t,c),g&&!b&&_a(o,t.offset-h);const{ze:m}=p;b||await T();const y=La(c),E=Pa(t,c);if(A.diskNumberStart=y,b||(R=!0,F=c.size,await Ka(D,m)),A=await async function(t,e,{diskNumberStart:r,Re:o},s,a,c){const{Ae:u,Ie:l,Te:d}=s,{de:w,fe:p,lastModDate:h,rawLastModDate:m,encrypted:y,compressed:S,version:g,compressionMethod:b,me:E,ve:x,Se:R,_e:z,ge:F,be:D,ye:A}=u,{Fe:k}=l,{rawFilename:C,lastAccessDate:I,creationDate:T,password:v,rawPassword:_,level:N,zip64:U,pe:M,we:B,zipCrypto:W,dataDescriptor:P,directory:Z,executable:H,versionMadeBy:V,rawComment:G,rawExtraField:j,Ee:q,useWebWorkers:K,transferStreams:Y,onstart:X,onprogress:J,onend:Q,signal:$,encryptionStrength:tt,extendedTimestamp:et,msDosCompatible:nt,internalFileAttributes:rt,externalFileAttributes:ot,uid:it,gid:st,unixMode:at,symlink:ct,setuid:ut,setgid:lt,sticky:ft,unixExternalUpper:wt,msdosAttributesRaw:pt,msdosAttributes:ht,useCompressionStream:mt,passThrough:yt,format:St,codecURI:gt}=c,bt={Re:o,versionMadeBy:V,zip64:U,directory:Boolean(Z),executable:Boolean(H),filenameUTF8:!0,rawFilename:C,commentUTF8:!0,rawComment:G,me:E,ve:x,Se:R,ge:F,be:D,ye:A,rawExtraField:j,Ee:q,extendedTimestamp:et,msDosCompatible:nt,internalFileAttributes:rt,externalFileAttributes:ot,diskNumberStart:r,uid:it,gid:st,unixMode:at,symlink:Boolean(ct),setuid:ut,setgid:lt,sticky:ft,unixExternalUpper:wt,msdosAttributesRaw:pt,msdosAttributes:ht};let{crc32:Et,uncompressedSize:xt}=c,Rt=0;yt||(xt=0);const{writable:zt}=e;if(t){const n=wn(_o(t)),r=t.size,o={options:{codecType:jn,inputSize:r,level:N,rawPassword:_,password:v,encryptionStrength:tt,zipCrypto:y&&W,passwordVerification:y&&W&&m>>8&L,computeCrc32:!yt,compressed:S&&!yt,encrypted:y&&!yt,useWebWorkers:K,useCompressionStream:mt,transferStreams:Y,format:St,codecURI:gt,compressionMethod:b},config:a,ft:{signal:$,size:r,onstart:X,onprogress:J,onend:Q}};try{const t=await Fr({readable:n,writable:zt},o);if(Rt=t.outputSize,e.size+=Rt,yt||(xt=t.inputSize,y&&!W||(Et=t.crc32)),!B&&Rt>=O||!M&&xt>=O)throw new f(ra)}catch(t){throw t.outputSize!==dt&&(e.size+=t.outputSize),t}}return function({crc32:t,compressedSize:e,uncompressedSize:n,Ae:r,Ie:o},{zip64:s,zipCrypto:a,passThrough:c,dataDescriptor:u}){const{fe:l,encrypted:d}=r,{Ne:f,Ue:w}=o;d&&!a&&!c||t===dt||(cc(l,10,t),u&&cc(f,w,t)),s?u&&(uc(f,w+4,i(e)),uc(f,w+12,i(n))):(cc(l,14,e),cc(l,18,n),u&&(cc(f,w+4,e),cc(f,w+8,n)))}({crc32:Et,compressedSize:Rt,uncompressedSize:xt,Ae:u,Ie:l},c),P&&await Ka(e,k),n.assign(bt,{uncompressedSize:xt,compressedSize:Rt,lastModDate:h,rawLastModDate:m,creationDate:T,lastAccessDate:I,encrypted:Boolean(y),zipCrypto:Boolean(W),size:d+Rt,compressionMethod:b,version:g,de:w,fe:p,signature:Et,crc32:!y||W||yt?Et:dt,_e:z,pe:M,we:B}),bt}(r,D,A,o,$t(),s),b||(R=!1),a.set(e,A),A.filename=e,b){if(await S.all([D.writable.getWriter().close(),C]),await I(),t.te&&await qa(t,c),x=!0,F=c.size,await T(),A.diskNumberStart=La(c),A.offset=Pa(t,c),g){const e=o.Te;_a(o,t.offset-Ba(c)),A.size+=o.Te-e}!function({rawFilename:t,encrypted:e,zip64:n,ve:r,crc32:o,compressedSize:s,uncompressedSize:a,pe:c,we:u},l,{dataDescriptor:d,passThrough:f}){if(d||((!e||f&&o!==dt)&&cc(l,14,o),u||cc(l,18,s),c||cc(l,22,a)),n&&r){const e=ct+dc(t)+4;uc(l,e,i(a)),uc(l,e+8,i(s))}}(A,p.Oe,s),await Ka(c,p.ze),await Ya(D.readable,c,w,t=>k+=t),c.size+=D.size,x=!1}else A.diskNumberStart=y,A.offset=E;return t.offset+=A.size,A}catch(n){if(x||R){if(t.hasCorruptedEntries=!0,n)try{n.corruptedEntry=!0}catch{}t.offset+=c.size-F,b&&(t.offset+=k)}throw a.delete(e),n}finally{if(b&&t.se--,y&&y(C),E&&E(),b&&D&&D.dispose)try{await D.dispose()}catch{}}async function I(){t.ue=!0;const{le:e}=t;t.le=new S(e=>E=()=>{t.ue=!1,e()}),await e}async function T(){Wa(c,dc(p.ze))&&await c.closeDisk()}}(t,e,r,{Ae:y,Ie:g,Te:b,$t:d,ke:l,Ce:w},o)}catch(n){throw t.ee.delete(e),n}finally{w&&w(l&&l.Re)}return n.assign(p,{name:e,comment:c,extraField:u}),new pi(p)}(t,e,r,o)}catch(n){throw t.ne.delete(e),n}finally{const t=xa.shift();t?t():Ea--}}(o,t,e,r);s.add(a);const c=()=>s.delete(a);return S.prototype.then.call(a,c,c),Fa(o,a)}remove(t){const{ne:e,ee:n}=this;if(typeof t==mt&&(t=n.get(t)),t&&t.filename!==dt){const{filename:r}=t;if(e.has(r)&&n.has(r))return e.delete(r),n.delete(r),!0}return!1}async close(t=yt,n={}){const r=this,{oe:o,writer:s}=this,{writable:a}=s;if(!(t instanceof w))throw new f(Ws);if(dc(t)>M)throw new f(Bs);for(;o.size;)await S.allSettled(e.from(o));await S.allSettled(r.ie.map(t=>t.Me));const c=r.ie.filter(t=>t.error&&!t.Le);if(c.length){const t=c.map(t=>t.error);c.forEach(t=>t.Le=!0);const[e]=t;try{e.entryErrors=t}catch{}throw e}return await async function(t,n,r){const o=Oa(t.ee),{Be:s,We:a,Pe:c}=await async function(t,n,r){const{ee:o,writer:i}=t,s=new w(n);await Io(i);let a=0,c=0,u=La(i),l=Ba(i),d=0;for(const[t,n]of e.from(o.values()).entries()){const{offset:e,rawFilename:f,me:w,ye:p,Se:h,ge:m,be:y,rawExtraField:S,Ee:g,rawComment:b,versionMadeBy:E,de:x,fe:R,pe:z,we:F,he:D,Ze:A,internalFileAttributes:k,externalFileAttributes:C,diskNumberStart:I,uncompressedSize:T,compressedSize:v}=n,_=dc(w,p,h,m,y,S,g),N=q+dc(f,b)+_;Wa(i,a+N-c)&&(await Ka(i,s.slice(c,a)),c=a,d=0,await i.closeDisk()),0==t&&(u=La(i),l=Ba(i)),z||cc(R,18,T),F||cc(R,14,v),(A||D)&&n.version<45&&ac(R,0,45);const U=Ma(N);if(U.He(H),U.Ve(E),U.Ge(x.subarray(0,24)),U.Ve(_),U.Ve(dc(b)),U.Ve(D?M:I),U.Ve(k),U.He(C),U.He(A?O:e),U.Ge(f),U.Ge(w),U.Ge(p),U.Ge(h),U.Ge(m),U.Ge(y),U.Ge(S),U.Ge(g),U.Ge(b),lc(s,U.Pt,a),a+=N,d++,r.onprogress)try{await r.onprogress(t+1,o.size,new pi(n))}catch{}}return await Ka(i,c?s.slice(c):s),{Be:{diskNumber:u,diskOffset:l},We:{diskNumber:La(i),je:d},Pe:s}}(t,o,r),u=await async function(t,e,n){const r=nc(t,n,It);if(r){const n=await r(e),o=dc(n);if(o>M)throw new f(ya);const i=Ma(6+o);i.He(Z),i.Ve(o),i.Ge(n);const{writer:s}=t;return Wa(s,dc(i.Pt))&&await s.closeDisk(),await Ka(s,i.Pt),6+o}return 0}(t,c,r);await async function(t,e,n,r){const{writer:o}=t,{Be:s,We:a,qe:c}=r;let{Ke:u}=r,l=t.ee.size,d=s.diskNumber,w=Pa(t,s);const p=dc(e);if(p>M)throw new f(Bs);let h=tc(t,n,$o),m=La(o);if(Wa(o,(h?98:K)+p)&&m++,w>=O||u>=O||l>=M||m>=M){if(!1===h)throw new f(ra);h=!0}const y=Ma(h?98:K);Wa(o,dc(y.Pt)+p)&&await o.closeDisk(),m=La(o);let S=m==a.diskNumber?a.je:0;h&&(y.He(G),y.Ye(44),y.Ve(45),y.Ve(45),y.He(m),y.He(d),y.Ye(S),y.Ye(l),y.Ye(u),y.Ye(w),y.He(j),y.He(m),y.Ye(i(Pa(t,o))+i(u)+i(c)),y.He(m+1),tc(t,n,"supportZip64SplitFile",!0)&&(m=M,d=M),S=M,l=M,w=O,u=O),y.He(V),y.Ve(m),y.Ve(d),y.Ve(S),y.Ve(l),y.He(u),y.He(w),y.Ve(p),await Ka(o,y.Pt),p&&await Ka(o,e)}(t,n,r,{Be:s,We:a,Ke:o,qe:u})}(r,t,n),!Co(s)&&tc(r,n,Ft)||await a.getWriter().close(),s.getData?s.getData():a}}class za extends S{then(t,e){const{Xe:n}=this;return n&&(n.Le=!0),super.then(t,e)}}function Fa(t,e){const n=new za((t,n)=>S.prototype.then.call(e,t,n)),r={};return n.Xe=r,r.Me=S.prototype.then.call(n,dt,t=>r.error=t),t.ie.push(r),n}async function Da(t,e){try{await t.writer.writable.abort(e)}catch{}}function Aa(t,e,n){t.oe.add(e),e.catch(t=>{try{n(t)}catch{}})}function ka(t,n,r){let o=tc(t,r,Qo),i=tc(t,r,ni,o?20:768);const s=tc(t,r,ii),a=rc(t,r,"uid"),c=rc(t,r,"gid");let u=rc(t,r,ui),l=tc(t,r,"unixExtraFieldType"),d=tc(t,r,li),w=tc(t,r,di),p=tc(t,r,fi);if(Ht(a,O,ua),Ht(c,O,la),Ht(u,M,da),l!==dt&&l!==ga&&l!==ba)throw new f(fa);if(l===ba&&(a!==dt&&a>M||c!==dt&&c>M))throw new f(wa);l!==dt||a===dt&&c===dt||(l=ga);let h=rc(t,r,Xo),m=tc(t,r,Jo);const y=h!==dt||m!==dt;if(a!==dt||c!==dt||u!==dt||l||s?(o=!1,i=i&L|768):y&&(o=!0,i&=L),Ht(h,L,pa),m&&(typeof m!==ht||e.isArray(m)))throw new f(ha);if(i>M)throw new f(Gs);let S=tc(t,r,Yo);const g=S!==dt;g||(S=0),!r[oi]&&n.endsWith(at)&&(r[oi]=!0);const b=tc(t,r,oi);if(b?(n.endsWith(at)||(n+=at),g||(S=16,o||(S|=16877<<16))):o||g||(S=s?493<<16:27525120),!o){const t=u!==dt||Boolean(d||w||p);u=u===dt?S>>16&M:u&M,d?u|=it:d=Boolean(u&it),w?u|=st:w=Boolean(u&st),p?u|=512:p=Boolean(512&u),g&&!t||(b?u=-61441&u|ot:u&rt||(u|=32768),S=(u&M)<<16|S&M)}({msdosAttributesRaw:h,msdosAttributes:m}=function(t,e){if(t!==dt)t&=L;else if(e!==dt){const{readOnly:n,hidden:r,system:o,directory:i,archive:s}=e;let a=0;n&&(a|=1),r&&(a|=2),o&&(a|=4),i&&(a|=16),s&&(a|=32),t=a&L}return e===dt&&(e={readOnly:Boolean(1&t),hidden:Boolean(2&t),system:Boolean(4&t),directory:Boolean(16&t),archive:Boolean(32&t)}),{msdosAttributesRaw:t,msdosAttributes:e}}(h,m)),y&&(S=S&O|h&L);const E=S>>16&M,x=u!==dt&&40960==(u&rt);return{name:n,xe:{versionMadeBy:i,msDosCompatible:Boolean(o),externalFileAttributes:S,unixExternalUpper:E,uid:a,gid:c,unixMode:u,unixExtraFieldType:l,symlink:x,setuid:d,setgid:w,sticky:p,msdosAttributesRaw:h,msdosAttributes:m}}}function Ca(t,e,n){const r=nc(t,n,"encodeText")||ge;let i=r(e,Tt);if(i===dt&&(i=ge(e)),dc(i)>M)throw new f(Vs);const s=n[Oo]||"";if(typeof s!=mt)throw new f(Zs);let c=r(s,vt);if(c===dt&&(c=ge(s)),dc(c)>M)throw new f(Ps);const u=tc(t,n,ei);if(u!==dt&&u>M)throw new f(Gs);const l=ec(t,n,Zo,new a),d=tc(t,n,Ho),w=ec(t,n,Vo),p=ec(t,n,jo),h=tc(t,n,Ko,0),m=tc(t,n,bt),y=tc(t,n,St),S=tc(t,n,gt);Pt(y,S);const g=rc(t,n,"encryptionStrength",3),b=tc(t,n,ri),E=tc(t,n,"extendedTimestamp",!0),x=tc(t,n,"ntfsTimestamp"),R=tc(t,n,"keepOrder",!0),z=tc(t,n,xt),F=tc(t,n,zt),D=tc(t,n,"bufferedWrite"),A=nc(t,n,"createTempStream"),k=tc(t,n,"dataDescriptorSignature",!0),C=Wt(tc(t,n,Et)),I=tc(t,n,"useUnicodeFileNames",!0),T=tc(t,n,si),v=m||T===dt?dt:Rn(T);if(!m&&T!==dt&&0!==T&&8!==T&&!v)throw new f(gn);let _=rc(t,n,"level");if(Ht(_,9,ma),t.options[kt]){if(y!==dt||S!==dt)throw new f(qs);_===dt&&T===dt&&(_=0)}m&&(_=dt);let N=tc(t,n,Rt),U=tc(t,n,Dt);D&&U===dt&&(U=!1),(U===dt||b&&!m)&&(U=!0),_!==dt&&6!=_&&(N=!1);const O=tc(t,n,$o);if(!(b||y===dt&&S===dt||o.isInteger(g)&&g>=1&&g<=3))throw new f(js);const L=Ia(n[ci]),B=Ia(n.localExtraField),W=Ia(n.centralExtraField);return{comment:s,xe:{rawFilename:i,rawComment:c,version:u,lastModDate:l,rawLastModDate:d,lastAccessDate:w,creationDate:p,internalFileAttributes:h,passThrough:m,password:y,rawPassword:S,encryptionStrength:g,zipCrypto:b,extendedTimestamp:E,ntfsTimestamp:x,keepOrder:R,useWebWorkers:z,transferStreams:F,bufferedWrite:D,createTempStream:A,dataDescriptorSignature:k,signal:C,useUnicodeFileNames:I,compressionMethod:T,format:v?v.format:dt,codecURI:v?v.codecURI:dt,Je:v?v.versionNeeded:dt,level:_,useCompressionStream:N,dataDescriptor:U,zip64:O,rawExtraField:L,Qe:B,Ee:W}}}function Ia(t){if(!t)return yt;if(!(t instanceof c))throw new f(Ys);let e=0,n=0;t.forEach((t,n)=>{if(Zt(n,M,Xs),!(t instanceof w))throw new f(Js);if(dc(t)>M)throw new f(Qs);e+=4+dc(t)});const r=new w(e),o=ae(r);return t.forEach((t,e)=>{ac(o,n,e),ac(o,n+2,dc(t)),lc(r,t,n+4),n+=4+dc(t)}),r}function Ta(t,e,n,r,o){const{passThrough:i,zipCrypto:s,password:a,rawPassword:c,encryptionStrength:u}=r;let{dataDescriptor:l,zip64:d,level:w,compressionMethod:p}=r,h=0,m=0;if(i&&e){if(m=o[Lo],m===dt)throw new f(oa);if(p===dt)throw new f(ia)}const y=!0===d,S=tc(t,o,ti);if(e&&i&&!S&&dc(a,c))throw new f(Ks);const g=e&&(Boolean(a&&dc(a)||c&&dc(c))||i&&S);e||(w=0,p=0);const b=g?s?12:16+4*u:0;e&&(i?(o.uncompressedSize=m,h=n===dt?oc(m)+b:n):n===dt?(l=!0,(d||d===dt)&&(d=!0,m=h=4294967296)):(o.uncompressedSize=m=n,h=(ic(p,w)?oc(m):m)+b));const E=!(g||e&&(0!==n||i)||ic(p,w));E&&!s&&tc(t,o,Dt)===dt&&(l=!1);const x=y||m>=O,R=y||h>=O;if(x||R){if(!1===d)throw new f(ra);d=!0}return d=d||!1,{$e:h,xe:{dataDescriptor:l,De:E,zip64:d,pe:x,we:R,uncompressedSize:m,level:w,compressionMethod:p,encrypted:g}}}function va(t){const{rawFilename:e,lastModDate:n,rawLastModDate:r,lastAccessDate:o,creationDate:i,level:c,zip64:u,zipCrypto:l,useUnicodeFileNames:d,dataDescriptor:w,directory:p,rawExtraField:h,Qe:m,encryptionStrength:y,extendedTimestamp:S,ntfsTimestamp:g,passThrough:b,encrypted:E,pe:x,we:R,uncompressedSize:z,crc32:F}=t;let{version:D,compressionMethod:A}=t;const k=!p&&ic(A,c);let C;const I=b||!k,T=u&&(t.bufferedWrite||!w||!x&&!R||I),v=T||u&&w&&(x||R);if(u&&(x||R)){const t=20,e=Ma(t);if(e.Ve(1),e.Ve(t-4),C=e.Pt,T&&(e.Ye(z),I)){const t=E?l?12:16+4*y:0;e.Ye(b?0:z+t)}}else C=yt;let _,N,U,O,L;if(E&&!l){const t=Ma(dc(Sa)+2);t.Ve(J),t.Ge(Sa),_=t.Pt,_[8]=y}else _=yt;if(S){const t=Ja(n),e=Qa(t);if(e){const e=9+(o?4:0)+(i?4:0),n=Ma(e);O=1+(o?2:0)+(i?4:0),n.Ve(Q),n.Ve(e-4),n.tn(O),n.He(t),o&&n.He($a(Ja(o))),i&&n.He($a(Ja(i))),U=n.Pt}else U=yt;if(g===dt?!e||Boolean(o||i):g)try{const t=Xa(n),e=Ma(36);e.Ve(10),e.Ve(32),e.en(4),e.Ve(1),e.Ve(24),e.Ye(t),e.Ye(o?Xa(o):t),e.Ye(i?Xa(i):t),N=e.Pt}catch{N=yt}else N=yt}else N=U=yt;try{const{uid:e,gid:n,unixExtraFieldType:r}=t;if(r!=ga||e===dt&&n===dt)if(r!=ba||e===dt&&n===dt)L=yt;else{const t=Ma(8);t.Ve(et),t.Ve(4),t.Ve((e===dt?0:e)&M),t.Ve((n===dt?0:n)&M),L=t.Pt}else{const t=Na(e===dt?0:e),r=Na(n===dt?0:n),o=3+t.length+r.length,i=Ma(4+o);i.Ve(tt),i.Ve(o),i.tn(1),i.tn(t.length),i.Ge(t),i.tn(r.length),i.Ge(r),L=i.Pt}}catch{L=yt}A===dt&&(A=k?8:0),D===dt&&(D=0!=A||p||E?20:10);const{Je:W}=t;k&&W!==dt&&(D=D>W?D:W),u&&(D=D>45?D:45),E&&!l&&(D=D>51?D:51,b&&F!==dt&&(_[4]=1),ac(ae(_),9,A),A=99);const P=v?dc(C):0,Z=P+dc(_,U,N,L,h,m);if(Z+(t[kt]?67:0)>M)throw new f(Qs);const H=new a(2e3*s.ceil(s.floor(n.getTime()/1e3)/2)),{de:V,fe:G,rawLastModDate:j}=fc({version:D,bitFlag:wc(c,d,w,E,A),compressionMethod:A,uncompressedSize:z,lastModDate:H<lt?lt:H>ut?ut:H,rawLastModDate:r,rawFilename:e,we:R,pe:x,extraFieldLength:Z}),q=Ma(ct+dc(e)+Z),K=q.Pt,Y=ae(K);return q.He(B),q.Ge(V),q.Ge(e),v&&q.Ge(C),q.Ge(_),q.Ge(U),q.Ge(N),q.Ge(L),q.Ge(h),q.Ge(m),w&&(R||cc(Y,18,0),x||cc(Y,22,0)),{ze:K,Oe:Y,de:V,fe:G,lastModDate:n,rawLastModDate:j,encrypted:E,compressed:k,version:D,compressionMethod:A,_e:O,me:yt,ve:P,Se:U,ge:N,be:L,ye:_,extraFieldLength:Z}}function _a(t,e){const{Ae:n}=t;let{ze:r,extraFieldLength:o}=n,i=64-(e+dc(r))%64;i<4&&(i+=64);const s=new w(i),a=ae(s);ac(a,0,$),ac(a,2,i-4);const c=r;n.ze=r=new w(dc(c)+i),lc(r,c),lc(r,s,dc(c));const u=ae(r);ac(u,28,o+i),n.Oe=u,t.Te+=i}function Na(t){const e=new w(4);ae(e).setUint32(0,t,!0);let n=4;for(;n>1&&0===e[n-1];)n--;return e.subarray(0,n)}function Ua({zip64:t,dataDescriptor:e,dataDescriptorSignature:n}){let r,o=yt,i=0,s=t?20:12;return n&&(s+=4),e&&(o=new w(s),r=ae(o),n&&(i=4,cc(r,0,P))),{Fe:o,Ne:r,Ue:i}}function Oa(t){let e=0;for(const[,n]of t){const{rawFilename:t,ye:r,rawComment:o,ge:i,be:s,rawExtraField:a,Ee:c,extendedTimestamp:u,_e:l,lastModDate:d,pe:w,we:p,uncompressedSize:h,compressedSize:m}=n,y=n.offset>=O,S=n.diskNumberStart>=M;let g,b;if(y||S||w||p){const t=4+(w?8:0)+(p?8:0)+(y?8:0)+(S?4:0),e=Ma(t);e.Ve(1),e.Ve(t-4),w&&e.Ye(h),p&&e.Ye(m),y&&e.Ye(n.offset),S&&e.He(n.diskNumberStart),g=e.Pt}else g=yt;n.me=g,n.Ze=y,n.he=S;const E=Ja(d);if(u&&Qa(E)){const t=Ma(9);t.Ve(Q),t.Ve(5),t.tn(l),t.He(E),b=t.Pt}else b=yt;n.Se=b;const x=dc(g,r,i,s,b,a,c);if(x>M)throw new f(Qs);e+=q+dc(t,o)+x}return e}function Ma(t){const e=new w(t),n=ae(e);let r=0;return{Pt:e,tn:t=>{!function(t,e,n){t.setUint8(e,n)}(n,r,t),r+=1},Ve:t=>{ac(n,r,t),r+=2},He:t=>{cc(n,r,t),r+=4},Ye:t=>{uc(n,r,i(t)),r+=8},Ge:t=>{lc(e,t,r),r+=dc(t)},en:t=>r+=t}}function La(t){const{diskNumber:e=0}=t;return e}function Ba(t){const{diskOffset:e=0}=t;return e}function Wa(t,e){const{availableSize:n=ft}=t;return e>n}function Pa(t,{diskNumber:e=0,diskOffset:n=0}){return t.offset-n-(e?t.re:0)}function Za(t){const e=ae(t);let n=0;for(;n+4<=dc(t);){const r=4+sc(e,n+2);if(1==sc(e,n))return Za(ie(t.subarray(0,n),t.subarray(s.min(n+r,dc(t)))));n+=r}return t}async function Ha(t,e,n,r){if(r>0){const{writer:o}=t;let i=0;try{await Ya(_o(e,{offset:n,size:r}),o,dt,t=>i+=t)}catch(e){t.hasCorruptedEntries=!0;try{e.corruptedEntry=!0}catch{}throw e}finally{o.size+=i,t.offset+=i}}}async function Va(t,e){const n=await vo(t,e,ct);if(dc(n)<ct)return ct;const r=ae(n);return ct+sc(r,26)+sc(r,28)}function Ga(t,{offset:e,diskNumberStart:n}){return e+(t.jt?t.jt(n):0)}function ja(){const t=new w(4);return cc(ae(t),0,W),t}async function qa(t,e){delete t.te,await Ka(e,ja()),t.offset+=4}async function Ka(t,e){const{writable:n}=t,r=n.getWriter();try{await r.ready,t.size+=dc(e),await r.write(e)}finally{r.releaseLock()}}async function Ya(t,e,n,r){const o=e.writable.getWriter();try{await t.pipeTo(new D({async write(t){await o.ready,await o.write(t),r(dc(t))}}),{preventClose:!0,preventAbort:!0,signal:n})}finally{o.releaseLock()}}function Xa(t){if(t){const e=(i(t.getTime())+i(116444736e5))*i(1e4);return e<ea?ea:e>na?na:e}}function Ja(t){return s.floor(t.getTime()/1e3)}function Qa(t){return t>=$s&&t<=ta}function $a(t){return s.min(ta,s.max($s,t))}function tc(t,e,n,r){const o=e[n]===dt?t.options[n]:e[n];return o===dt?r:o}function ec(t,e,n,r){const i=tc(t,e,n,r);if(null===i)return r;if(i!==dt&&(typeof i.getTime!=pt||o.isNaN(i.getTime())))throw new f(Hs);return i}function nc(t,e,n){return Bt(tc(t,e,n))}function rc(t,e,n,r){return Vt(tc(t,e,n,r))}function oc(t){return t+5*(s.floor(t/16383)+1)}function ic(t,e){return t===dt?e===dt||e>0:0!==t}function sc(t,e){return t.getUint16(e,!0)}function ac(t,e,n){t.setUint16(e,n,!0)}function cc(t,e,n){t.setUint32(e,n,!0)}function uc(t,e,n){t.setBigUint64(e,n,!0)}function lc(t,e,n){t.set(e,n)}function dc(...t){let e=0;return t.forEach(t=>t&&(e+=t.length)),e}function fc({version:t,bitFlag:e,compressionMethod:n,uncompressedSize:r,compressedSize:o,lastModDate:i,rawLastModDate:s,rawFilename:a,we:c,pe:u,extraFieldLength:l}){const d=Ma(26),f=d.Pt,w=ae(f);if(d.Ve(t),d.Ve(e),d.Ve(n),s===dt){const t=new h(1),e=ae(t);ac(e,0,(i.getHours()<<6|i.getMinutes())<<5|i.getSeconds()/2),ac(e,2,(i.getFullYear()-1980<<4|i.getMonth()+1)<<5|i.getDate()),s=t[0]}return d.He(s),d.en(4),c||o!==dt?d.He(c?O:o):d.en(4),u||r!==dt?d.He(u?O:r):d.en(4),d.Ve(dc(a)),d.Ve(l),{de:f,fe:w,rawLastModDate:s}}function wc(t,e,n,r,o){let i=0;return e&&(i|=nt),n&&(i|=8),8!=o&&9!=o||(t>=0&&t<=3&&(i|=6),t>3&&t<=5&&(i|=4),9==t&&(i|=2)),r&&(i|=1),i}function pc(t,e){if(!t)return!1;const{nn:n}=t;return n?n.includes(e):Ln(t,e)}const hc=1048576,mc=".zip.js-temp",yc=1048576,Sc=1048576,gc=".zip.js-temp",bc="createSyncAccessHandle is only available in dedicated workers";try{!function(t){const e=ne(oe(t));n.assign(qt,e),n.assign(Qt,e)}({baseURI:void 0===E&&"undefined"==typeof location?require("url").pathToFileURL(__filename).href:void 0===E?location.href:U&&"SCRIPT"===U.tagName.toUpperCase()&&U.src||new d("zip-fs-core.min.js",E.baseURI).href})}catch{}const Ec="Entry filename already exists",xc="Duplicate entry filename in the imported zip file",Rc='Invalid duplicates option (must be "throw", "keep-first" or "keep-last")',zc="Entry is a ancestor of target entry",Fc="Readable stream already consumed",Dc="throw",Ac="keep-first",kc="keep-last",Cc=new u([Dc,Ac,kc]),Ic="Invalid passThrough option (use readerOptions.passThrough or set uncompressedSize for each entry)",Tc="Invalid readerOptions (must be an object)",vc="The last modification date of an entry encrypted with ZipCrypto cannot be changed when passThrough is set",_c="zipjs-abort-export",Nc="The operation was aborted",Uc=new u([1,J,10,Q,28789,25461,$,tt,et,22613,13]);class Oc{constructor(t,e,r,o){const i=this;if(t.root&&o&&o.getChildByName(e))throw new f(Ec);r||(r={}),n.assign(i,{fs:t,name:e,data:r.data,options:r.options&&n.assign({},r.options),id:t.rn++,parent:o,children:[],uncompressedSize:r.uncompressedSize||0,sn:r.sn||r.uncompressedSize===dt,passThrough:r.passThrough,an:r.an||new a}),!o&&t.root||(t.entries[i.id]=i),o&&i.parent.children.push(i)}getFullname(){return this.getRelativeName()}getRelativeName(t=this.fs.root){let e=this.name,n=this.parent;for(;n&&n!=t;)e=(n.name?n.name+"/":"")+e,n=n.parent;return e}isDescendantOf(t){let e=this.parent;for(;e&&e.id!=t.id;)e=e.parent;return Boolean(e)}rename(t){const e=this;let n=e.parent;if(n){const r=uu(t);r&&(t=r.pop(),n=lu(n,r,e));const o=n.getChildByName(t);if(o&&o!=e)throw new f(Ec);n!=e.parent&&(Kc(e),e.parent=n,n.children.push(e),au(e.fs,e))}e.name=t}setOptions(t){const e=n.assign({},this.options,t);this.options=n.fromEntries(n.entries(e).filter(([,t])=>t!==dt))}}class Mc extends Oc{constructor(t,e,n,r){super(t,e,n,r);const o=this;o.Reader=n.Reader,o.Writer=n.Writer,n.getData&&(o.getData=n.getData)}clone(){return new Mc(this.fs,this.name,this)}async getData(t,e={}){const n=this;if(!t||t.constructor==n.Writer&&n.data&&function(t,e){const{contentType:n}=t;return n===dt||(t.constructor==to?e.type==n:t.constructor!=Xr||e.startsWith("data:"+(n||"")+";base64,"))}(t,n.data))return n.data;{const r=n.reader=jc(n.Reader,n.data,e),o=n.uncompressedSize||r.size;await S.all([Io(r),Io(t,o)]);const i=Wt(e.signal),s=function(t,e,n,r){const{onstart:o,onprogress:i,onend:s}=n,{readable:a}=e;return t.data instanceof pi||!o&&!i&&!s?a:wn(a).pipeThrough(new rr({onstart:o,onprogress:i,onend:s,size:e.size}),{signal:r})}(n,r,e,i),a=!Co(t)&&Boolean(e.preventClose);return n.uncompressedSize=r.size,await wn(s).pipeTo(hn(t.writable),{signal:i,preventClose:a,preventAbort:a}),t.getData?t.getData():t.writable}}isPasswordProtected(){return Boolean(this.data&&this.data.encrypted)}async checkPassword(t,e={}){const r=this;if(!r.isPasswordProtected())return!0;try{return await r.data.getData(null,n.assign({},e,{password:t,checkPasswordOnly:!0})),!0}catch(t){if(t.message==Fe)return!1;throw t}}getText(t,e){return this.getData(new ro(t),e)}getBlob(t,e){return this.getData(new to(t),e)}getData64URI(t,e){return this.getData(new Xr(t),e)}getUint8Array(t){return this.getData(new zo,t)}getWritable(t=new D,e){return this.getData({writable:t},e)}async getArrayBuffer(t){return se(await this.getUint8Array(t)).buffer}replaceBlob(t){$c(this,{data:t,Reader:$r,Writer:to,uncompressedSize:t.size})}replaceText(t){$c(this,{data:t,Reader:eo,Writer:ro,uncompressedSize:no(t)})}replaceData64URI(t){$c(this,{data:t,Reader:Yr,Writer:Xr,uncompressedSize:tu(t)})}replaceUint8Array(t){$c(this,{data:t,Reader:Ro,Writer:zo,uncompressedSize:t.length})}replaceReadable(t){$c(this,{data:null,Reader:Vc(t),Writer:null,uncompressedSize:dt})}}class Lc extends Oc{constructor(t,e,n,r){super(t,e,n,r),this.directory=!0}clone(t){const e=this,n=new Lc(e.fs,e.name,e);return t&&(n.children=e.children.map(e=>{const r=e.clone(t);return r.parent=n,r})),n}addDirectory(t,e){return cu(this,t,{options:e},!0)}addText(t,e,n={}){return cu(this,t,{data:e,Reader:eo,Writer:ro,options:n,uncompressedSize:no(e)})}addBlob(t,e,n={}){return cu(this,t,{data:e,Reader:$r,Writer:to,options:n,uncompressedSize:e.size})}addData64URI(t,e,n={}){return cu(this,t,{data:e,Reader:Yr,Writer:Xr,options:n,uncompressedSize:tu(e)})}addUint8Array(t,e,n={}){return cu(this,t,{data:e,Reader:Ro,Writer:zo,options:n,uncompressedSize:e.length})}addHttpContent(t,e,n={}){return cu(this,t,{data:e,Reader:class extends xo{constructor(t){super(t,n)}},options:n})}addReadable(t,e,n={}){return cu(this,t,{Reader:Vc(e),options:n})}addFileSystemEntry(t,e={}){return ru(this,t,e)}addFileSystemHandle(t,e={}){return ru(this,t,e)}addFile(t,e={}){return(e=n.assign({},e)).lastModDate||(e.lastModDate=new a(t.lastModified)),cu(this,t.name,{data:t,Reader:function(){return{readable:t.stream(),size:t.size}},options:e,uncompressedSize:t.size})}importBlob(t,e){return this.importZip(new $r(t),e)}importData64URI(t,e){return this.importZip(new Yr(t),e)}importUint8Array(t,e){return this.importZip(new Ro(t),e)}importHttpContent(t,e){return this.importZip(new xo(t,e),e)}importReadable(t,e){return this.importZip({readable:t},e)}exportBlob(t={}){return this.exportZip(new to(t.mimeType||"application/zip"),t)}exportData64URI(t={}){return this.exportZip(new Xr(t.mimeType||"application/zip"),t)}exportUint8Array(t={}){return this.exportZip(new zo,t)}async exportWritable(t=new D,e={}){return await this.exportZip({writable:t},e),t}exportFileSystemHandle(t,e={}){return async function(t,e,r){const{onstart:o,onprogress:i,onend:s}=r,a=Qc(r.readerOptions),c=new AbortController,{signal:u}=c,l=function(t,e){if(!Wt(t))return()=>{};if(t.aborted)return e.abort(t.reason),()=>{};const n=()=>e.abort(t.reason);return t.addEventListener("abort",n,{once:!0}),()=>t.removeEventListener("abort",n)}(r.signal,c),d=n.assign({},r,a,{signal:u,onstart:dt,onprogress:dt,onend:dt,preventClose:!1}),w=Pc([t],t=>Hc(t,d.passThrough)),p=[];let h=!1,m=0;try{o&&await or(o,w),await g(t,e),s&&await or(s,m)}catch(t){try{t.exportedEntryNames=p}catch{}throw t}finally{l()}return e;function y(t){const e=t.getWriter();return new D({async write(t){await e.write(t),m+=t.length,i&&await or(i,m,w)},close:()=>e.close(),abort:t=>e.abort(t)})}async function g(t,e){if(r.concurrent){const n=(await S.allSettled(t.children.map(t=>b(t,e)))).filter(t=>"rejected"==t.status);if(n.length){const t=n.filter(t=>!Yc(t.reason));throw function(t){const[e]=t,n=t.slice(1).flatMap(t=>[t,...t&&t.entryErrors||[]]).filter(t=>t!==e);if(n.length)try{e.entryErrors=[...e.entryErrors||[],...n]}catch{}return e}((t.length?t:n).map(t=>t.reason))}}else for(const n of t.children)await b(n,e)}async function b(e,n){if(u.aborted){if(h||Yc(u.reason))return;throw u.reason===dt?new DOMException(Nc,"AbortError"):u.reason}try{if(e.directory){const t=await n.getDirectoryHandle(e.name,{create:!0});await g(e,t)}else{const r=await n.getFileHandle(e.name,{create:!0}),o=await r.createWritable();try{await e.getData({writable:y(o)},d)}catch(t){throw h?new f(_c):t}p.push(e.getRelativeName(t))}}catch(n){h=!0,c.abort(new f(_c));try{n.entryName===dt&&(n.entryName=e.getRelativeName(t),n.entryId=e.id)}catch{}throw n}}}(this,t,e)}async importZip(t,e={}){let r;t&&typeof t.getEntries==pt?(r=t,e=n.assign({},r.options,e)):(await Io(t),r=new ts(t,e));const o=function(t){if(t===dt)return Dc;if(Cc.has(t))return t;throw new f(Rc)}(e.duplicates),i=[],s=await r.getEntries(e);for(const t of s){let r=this;try{const s=t.filename.split("/").filter(t=>""!=t&&"."!=t),a=s.pop();let c=!1;for(const t of s){const e=r;if(r=r.getChildByName(t),r){if(!r.directory){if(o==Ac){c=!0;break}if(o!=kc)throw new f(xc);this.fs.remove(r),r=new Lc(this.fs,t,{data:null},e),i.push(r)}}else r=new Lc(this.fs,t,{data:null},e),i.push(r)}if(c)continue;if(t.directory){let e=r;if(a){if(e=r.getChildByName(a),e&&!e.directory){if(o==Ac)continue;if(o!=kc)throw new f(xc);this.fs.remove(e),e=dt}e||(e=new Lc(this.fs,a,{data:null},r),i.push(e))}e==this||e.data||(e.data=t)}else{const s=r.getChildByName(a);if(s){if(o==Ac)continue;if(o!=kc)throw new f(xc);this.fs.remove(s)}i.push(cu(r,a,{data:t,Reader:Gc(n.assign({},e)),uncompressedSize:e.passThrough?t.compressedSize:t.uncompressedSize,passThrough:e.passThrough}))}}catch(e){i.reverse().forEach(t=>this.fs.remove(t));try{e.cause={entry:t}}catch{}throw e}}return i}async exportZip(t,e={}){const r=this;(e=n.assign({},e)).bufferedWrite===dt&&(e.bufferedWrite=!0);const[o]=await S.all([qc(r,Qc(e.readerOptions)),Io(t)]),i=new Ra(t,e);return await async function(t,e,r,o,i){const{onstart:s,onprogress:a,onend:c,onentryprogress:u}=o,l=e,d=Pc(e.children,t=>nu(t)?0:1);let f=0,w=0;if(s&&await or(s,r),o.bufferedWrite)await async function t(e){const n=(await S.allSettled(e.children.map(async e=>{await p(e),await t(e)}))).find(t=>"rejected"==t.status);if(n)throw n.reason}(e);else for(const t of e.getChildren({recursive:!0}))await p(t);async function p(e){if(nu(e))return;const{name:s,cn:c}=Xc(e,l,o);let p=0;const h=await t.add(s,i.get(e),n.assign(c,{onstart:dt,onend:dt,onprogress:async t=>{f+=t-p,p=t,a&&await or(a,f,r)}}));w++,u&&await or(u,w,d,h)}c&&await or(c,f)}(i,r,Pc([r],Zc),e,o),await i.close(e.globalComment),t.getData?t.getData():t.writable}getExportedSize(t={}){const e=this;Qc((t=n.assign({},t)).readerOptions),t.bufferedWrite===dt&&(t.bufferedWrite=!0);const r=e.getChildren({recursive:!0}).filter(t=>!nu(t)).map(n=>{const{name:r,cn:o}=Xc(n,e,t);return{name:r,size:n.directory?0:Jc(n,eu(n,t)),options:o}}),o=!t.bufferedWrite||r.every(t=>!1!==t.options.keepOrder)&&e.children.every(t=>!t.children.length);return async function(t,e,r,o){const i={options:t};if(Bt(t[It]))throw new f(sa);if(o!==dt&&!(o instanceof w))throw new f(Ws);const a=dc(o);if(a>M)throw new f(Bs);const u=t[kt],l=new c,d=t[At]===dt?0:t[At];let p=d,h=ft;for(const t of e){let{name:e}=t;const{size:r}=t,o=n.assign({},t.options);tc(i,o,oi)&&!e.endsWith(at)&&(e+=at);const a=ka(i,e,o);({name:e}=a);const{xe:c}=Ca(i,e,o);0==c.level||c.compressionMethod!==dt||c.passThrough||await tr($t())||(c.level=0);const d=!tc(i,o,oi);if(d&&r===dt)throw new f(sa);const{$e:w,xe:m}=Ta(i,d,r,c,o);if(d&&!c.passThrough&&ic(m.compressionMethod,m.level))throw new f(sa);const y=n.assign({},o,a.xe,c,m,{[kt]:u}),S=va(y),g=Ua(y),b={Ae:S,Te:dc(S.ze,g.Fe)};u&&_a(b,p);const E=d?w:0;l.set(e,n.assign({},y,S,{offset:p,diskNumberStart:0,compressedSize:E}));const x=b.Te+E;h=s.min(h,x),p+=x}if(l.size>1&&(u||p-h>=O)&&!r)throw new f(sa);const m=Oa(l);let y=tc(i,t,$o);if(p>=O||m>=O||l.size>=M){if(!1===y)throw new f(ra);y=!0}return p-d+m+a+(y?98:K)}(t,r,o,t.globalComment)}getChildByName(t){const e=this.children;for(let n=0;n<e.length;n++){const r=e[n];if(r.name==t)return r}}getChildren(t={}){return function(t,e){const n=[],r=[t];let o=0;for(;o<r.length;)for(const t of r[o++].children)n.push(t),e&&r.push(t);return n}(this,t.recursive)}isPasswordProtected(){const t=this.children;for(let e=0;e<t.length;e++)if(t[e].isPasswordProtected())return!0;return!1}async checkPassword(t,e={}){const n=this.children;return!(await S.all(n.map(n=>n.checkPassword(t,e)))).includes(!1)}}class Bc{constructor(){iu(this)}get children(){return this.root.children}remove(t){Kc(t);const e=[t];for(;e.length;){const t=e.pop();this.entries[t.id]=null;for(const n of t.children)e.push(n)}t.parent=dt}move(t,e){if(t==this.root)throw new f("Root directory cannot be moved");if(!e.directory)throw new f("Target entry is not a directory");if(e.isDescendantOf(t))throw new f(zc);if(t!=e){const n=e.getChildByName(t.name);if(n){if(n!=t)throw new f(Ec)}else Kc(t),t.parent=e,e.children.push(t),au(this,t)}}find(t){const e=t.split("/");let n=this.root;for(let t=0;n&&t<e.length;t++)n=n.directory?n.getChildByName(e[t]):dt;return n||(n=this.entries.find(e=>e&&(e==this.root||e.isDescendantOf(this.root))&&e.getRelativeName()==t)),n}getById(t){return this.entries[t]}getChildByName(t){return this.root.getChildByName(t)}getChildren(t){return this.root.getChildren(t)}addDirectory(t,e){return this.root.addDirectory(t,e)}addText(t,e,n){return this.root.addText(t,e,n)}addBlob(t,e,n){return this.root.addBlob(t,e,n)}addData64URI(t,e,n){return this.root.addData64URI(t,e,n)}addUint8Array(t,e,n){return this.root.addUint8Array(t,e,n)}addHttpContent(t,e,n){return this.root.addHttpContent(t,e,n)}addReadable(t,e,n){return this.root.addReadable(t,e,n)}addFileSystemEntry(t,e){return this.root.addFileSystemEntry(t,e)}addFileSystemHandle(t,e){return this.root.addFileSystemHandle(t,e)}addFile(t,e){return this.root.addFile(t,e)}importBlob(t,e){return su(this,n=>n.importBlob(t,e))}importData64URI(t,e){return su(this,n=>n.importData64URI(t,e))}importUint8Array(t,e){return su(this,n=>n.importUint8Array(t,e))}importHttpContent(t,e){return su(this,n=>n.importHttpContent(t,e))}importReadable(t,e){return su(this,n=>n.importReadable(t,e))}importZip(t,e){return su(this,n=>n.importZip(t,e))}exportBlob(t){return this.root.exportBlob(t)}exportData64URI(t){return this.root.exportData64URI(t)}exportUint8Array(t){return this.root.exportUint8Array(t)}exportWritable(t,e){return this.root.exportWritable(t,e)}exportFileSystemHandle(t,e){return this.root.exportFileSystemHandle(t,e)}exportZip(t,e){return this.root.exportZip(t,e)}getExportedSize(t){return this.root.getExportedSize(t)}isPasswordProtected(){return this.root.isPasswordProtected()}checkPassword(t,e){return this.root.checkPassword(t,e)}}const Wc={FS:Bc,ZipDirectoryEntry:Lc,ZipFileEntry:Mc};function Pc(t,n){let r=0;const o=e.from(t);for(;o.length;){const t=o.pop();r+=n(t)||0;for(const e of t.children)o.push(e)}return r}function Zc(t){return t.uncompressedSize}function Hc(t,e){const{data:n}=t;return e&&n instanceof pi?n.compressedSize:t.uncompressedSize}function Vc(t){let e;return function(){if(e)throw new f(Fc);return e=!0,{readable:t}}}function Gc(t){return class extends qr{constructor(t,e={}){super(),this.entry=t,this.options=e}async init(){const e=this,r=n.assign({},t,e.options),{checkOverlappingEntry:o,checkOverlappingEntryOnly:i}=r,s=await e.entry.getData(new to,n.assign(r,{checkPasswordOnly:!1,checkOverlappingEntry:i||o,checkOverlappingEntryOnly:!1,preventClose:!1}));e.data=s,e.un=new $r(s),e.size=s.size,super.init()}readUint8Array(t,e){return this.un.readUint8Array(t,e)}}}function jc(t,e,n){return t.prototype?new t(e,n):t(e,n)}async function qc(t,e){const n=[],r=[t],o=new c;for(;r.length;){const t=r.pop();for(const e of t.children)e.directory?r.push(e):n.push(e)}return await S.all(n.map(async t=>{const n=t.reader=jc(t.Reader,t.data,e);o.set(t,n);try{await Io(n)}catch(e){try{e.entryId=t.id,e.cause={entry:t}}catch{}throw e}n.size!==dt&&(t.uncompressedSize=n.size,t.sn=!1)})),o}function Kc(t){if(t.parent){const e=t.parent.children;e.forEach((n,r)=>{n.id==t.id&&e.splice(r,1)})}}function Yc(t){return Boolean(t)&&t.message==_c}function Xc(t,e,r){const o=r.relativePath?t.getRelativeName(e):t.getFullname(),i=t.options||{};let u={},l={};if(t.data instanceof pi){const{externalFileAttributes:e,versionMadeBy:o,comment:d,lastModDate:w,rawLastModDate:p,creationDate:h,lastAccessDate:m,uncompressedSize:y,encrypted:S,zipCrypto:g,crc32:b,compressionMethod:E,extraFieldAES:x,internalFileAttributes:R,extraField:z,bitFlag:F,uid:D,gid:A}=t.data;u={externalFileAttributes:e,versionMadeBy:o,comment:d,lastModDate:w,creationDate:h,lastAccessDate:m,internalFileAttributes:R};const k=function(t){if(t){const e=new c;if(t.forEach((t,n)=>{Uc.has(n)||e.set(n,t.data)}),e.size)return e}}(z);if(k&&(u.extraField=k),D===dt&&A===dt||n.assign(u,{uid:D,gid:A,unixExtraFieldType:"infozip"}),eu(t,r)){let t;x&&(t=x.strength),l={passThrough:!0,encrypted:S,zipCrypto:g,crc32:b,uncompressedSize:y,encryptionStrength:t,compressionMethod:E},F&&(l.dataDescriptor=F.dataDescriptor);const e=i.lastModDate===dt?r.lastModDate:i.lastModDate;if(e===dt)l.rawLastModDate=p;else if(g&&(!F||F.dataDescriptor)&&e instanceof a&&function(t){let e=new a(2e3*s.ceil(s.floor(t.getTime()/1e3)/2));return e<lt?e=lt:e>ut&&(e=ut),(e.getHours()<<3|e.getMinutes()>>3)&L}(e)!=(p>>>8&L))throw new f(vc)}}const d=n.assign({lastModDate:t.an},u,r,i,l,{directory:t.directory});if(!t.directory&&d.passThrough&&d.uncompressedSize===dt)throw new f(Ic);return{name:o,cn:d}}function Jc(t,e){const{reader:n}=t;return n&&n.size!==dt?n.size:t.sn?dt:Hc(t,e)}function Qc(t){if(t&&(typeof t!=ht||e.isArray(t)))throw new f(Tc);return t}function $c(t,e){const{uncompressedSize:r}=e;n.assign(t,e,{reader:null,passThrough:dt,uncompressedSize:r===dt?0:r,sn:r===dt})}function tu(t){let e=t.length;for(;"="==t.charAt(e-1);)e--;const n=t.indexOf(",")+1;return s.floor(.75*(e-n))}function eu(t,e){const{readerOptions:n}=e;return Boolean(!t.directory&&(t.passThrough||n&&n.passThrough))}function nu(t){return t.directory&&null===t.data}function ru(t,e,r){return async function t(e,o,i,s=""){if(o){const c=s?s+"/"+o.name:o.name;try{if((o.isFile||o.isDirectory)&&(o=await ou(o)),"file"==o.kind){const t=await o.getFile();i.push(cu(e,t.name,{Reader:function(){return{readable:t.stream(),size:t.size}},options:n.assign({},{lastModDate:new a(t.lastModified)},r),uncompressedSize:t.size}))}else if("directory"==o.kind){const n=e.addDirectory(o.name,r);i.push(n);for await(const e of o.values())await t(n,e,i,c)}}catch(t){try{t.entryName===dt&&(t.entryName=c)}catch{}throw t}}return i}(t,e,[])}async function ou(t){const e={name:t.name};if(t.isFile&&(e.kind="file",e.getFile=()=>new S((e,n)=>t.file(e,n))),t.isDirectory){e.kind="directory";const n=await async function(t){const e=[];function n(t,r,o){t.readEntries(async i=>{if(i.length){for(const t of i)e.push(await ou(t));n(t,r,o)}else r(e)},o)}return await new S((e,r)=>n(t.createReader(),e,r)),{[T.iterator](){let t=0;return{next(){const n={value:e[t],done:t==e.length};return t++,n}}}}}(t);e.values=()=>n}return e}function iu(t){t.entries=[],t.rn=0,t.root=new Lc(t)}function su(t,e){const{entries:r,rn:o,root:i}=t;return iu(t),e(t.root).catch(e=>{throw n.assign(t,{entries:r,rn:o,root:i}),e})}function au(t,e){const n=[e];for(;n.length;){const e=n.pop();t.entries[e.id]=e;for(const t of e.children)n.push(t)}}function cu(t,e,n,r){if(t.directory){const o=uu(e);return o&&(e=o.pop(),t=lu(t,o)),r?new Lc(t.fs,e,n,t):new Mc(t.fs,e,n,t)}throw new f("Parent entry is not a directory")}function uu(t){if(t.includes("/")){const e=t.split("/").filter(t=>""!=t&&"."!=t);if(e.length)return e}}function lu(t,e,n){return e.forEach(e=>{const r=t;if(t=t.getChildByName(e)){if(!t.directory)throw new f(Ec);if(n&&(t==n||t.isDescendantOf(n)))throw new f(zc)}else t=new Lc(r.fs,e,{data:null},r)}),t}t.BlobReader=$r,t.BlobWriter=to,t.Data64URIReader=Yr,t.Data64URIWriter=Xr,t.ERR_ABORTED=Nc,t.ERR_AMBIGUOUS_ARCHIVE=Di,t.ERR_BAD_FORMAT=hi,t.ERR_CENTRAL_DIRECTORY_NOT_FOUND=Si,t.ERR_DUPLICATED_NAME=Ls,t.ERR_DUPLICATE_IMPORTED_ENTRY=xc,t.ERR_ENCRYPTED=Ei,t.ERR_ENCRYPTED_CENTRAL_DIRECTORY=Ai,t.ERR_ENTRY_DATA_OUT_OF_BOUNDS=Fi,t.ERR_ENTRY_EXISTS=Ec,t.ERR_EOCDR_LOCATOR_ZIP64_NOT_FOUND=yi,t.ERR_EOCDR_NOT_FOUND=mi,t.ERR_EXTRAFIELD_ZIP64_NOT_FOUND=bi,t.ERR_HTTP_RANGE=Ur,t.ERR_HTTP_RESOURCE_CHANGED=Or,t.ERR_INVALID_AUTHENTICATION_CODE=De,t.ERR_INVALID_CODEC_DEFINITION=mn,t.ERR_INVALID_CODEC_MODULE=Sn,t.ERR_INVALID_COMMENT=Bs,t.ERR_INVALID_COMMENT_TYPE=Ws,t.ERR_INVALID_COMPRESSED_DATA=kn,t.ERR_INVALID_CRC32=Cn,t.ERR_INVALID_DATE=Hs,t.ERR_INVALID_DUPLICATES=Rc,t.ERR_INVALID_ENCRYPTION_STRENGTH=js,t.ERR_INVALID_ENTRY_COMMENT=Ps,t.ERR_INVALID_ENTRY_COMMENT_TYPE=Zs,t.ERR_INVALID_ENTRY_NAME=Vs,t.ERR_INVALID_EXTRAFIELD=Ys,t.ERR_INVALID_EXTRAFIELD_DATA=Qs,t.ERR_INVALID_EXTRAFIELD_DATA_TYPE=Js,t.ERR_INVALID_EXTRAFIELD_TYPE=Xs,t.ERR_INVALID_FILENAME_VALIDATION=Ii,t.ERR_INVALID_FUNCTION_OPTION=Ot,t.ERR_INVALID_GID=la,t.ERR_INVALID_LEVEL=ma,t.ERR_INVALID_MAX_APPENDED_DATA_SIZE=Ti,t.ERR_INVALID_MAX_WORKERS=Gt,t.ERR_INVALID_MSDOS_ATTRIBUTES=pa,t.ERR_INVALID_MSDOS_DATA=ha,t.ERR_INVALID_PASSWORD=Fe,t.ERR_INVALID_PASSWORD_TYPE=Lt,t.ERR_INVALID_PASS_THROUGH=Ic,t.ERR_INVALID_READER_OPTIONS=Tc,t.ERR_INVALID_SIGNAL=Mt,t.ERR_INVALID_SIGNATURE_DATA=ya,t.ERR_INVALID_STRICTNESS=Ci,t.ERR_INVALID_UID=ua,t.ERR_INVALID_UNCOMPRESSED_SIZE=An,t.ERR_INVALID_UNIX_EXTRA_FIELD_TYPE=fa,t.ERR_INVALID_UNIX_ID_SIZE=wa,t.ERR_INVALID_UNIX_MODE=da,t.ERR_INVALID_VERSION=Gs,t.ERR_ITERATOR_COMPLETED_TOO_SOON=Mr,t.ERR_LOCAL_FILE_HEADER_NOT_FOUND=gi,t.ERR_OVERLAPPING_ENTRY=zi,t.ERR_READABLE_CONSUMED=Fc,t.ERR_RESERVED_COMPRESSION_METHOD=yn,t.ERR_SPLIT_ZIP_FILE=Ri,t.ERR_UNDEFINED_COMPRESSION_METHOD=ia,t.ERR_UNDEFINED_READER=aa,t.ERR_UNDEFINED_UNCOMPRESSED_SIZE=oa,t.ERR_UNDETERMINED_SIZE=sa,t.ERR_UNSAFE_FILENAME=ki,t.ERR_UNSUPPORTED_COMPRESSION=gn,t.ERR_UNSUPPORTED_CONTEXT=bc,t.ERR_UNSUPPORTED_CRYPTO_API=ke,t.ERR_UNSUPPORTED_ENCRYPTION=xi,t.ERR_UNSUPPORTED_ENCRYPTION_PASS_THROUGH=Ks,t.ERR_UNSUPPORTED_ENCRYPTION_USDZ=qs,t.ERR_UNSUPPORTED_FORMAT=ra,t.ERR_UNSUPPORTED_UINT64=vi,t.ERR_WORKER_STARTUP_TIMEOUT=Xn,t.ERR_WRITER_NOT_INITIALIZED=Lr,t.ERR_ZIP_CRYPTO_LAST_MOD_DATE=vc,t.ERR_ZIP_NOT_EMPTY=ca,t.HttpRangeReader=class extends xo{constructor(t,e={}){super(t,n.assign({},e,{useRangeHeader:!0}))}},t.HttpReader=xo,t.Reader=qr,t.SplitDataReader=Fo,t.SplitDataWriter=Do,t.TextReader=eo,t.TextWriter=ro,t.Uint8ArrayReader=Ro,t.Uint8ArrayWriter=zo,t.VERSION="2.11.0",t.WARNING_APPENDED_DATA=Bi,t.WARNING_COMPRESSED_PATCHED_DATA=Ui,t.WARNING_DUPLICATE_FILENAME=Hi,t.WARNING_MALFORMED_EXTRA_FIELD=Oi,t.WARNING_MISMATCHED_LOCAL_FILE_HEADER_BIT_FLAG=Gi,t.WARNING_MISMATCHED_LOCAL_FILE_HEADER_COMPRESSION_METHOD=ji,t.WARNING_MISMATCHED_LOCAL_FILE_HEADER_CRC32_OR_SIZES=qi,t.WARNING_MISMATCHED_ZIP64_END_OF_CENTRAL_DIRECTORY=Vi,t.WARNING_PREPENDED_CENTRAL_DIRECTORY=Pi,t.WARNING_PREPENDED_DATA=Wi,t.WARNING_TRAILING_CENTRAL_DIRECTORY_DATA=Zi,t.WARNING_UNKNOWN_VERSION=Ni,t.WARNING_UNKNOWN_ZIP64_EXTENSIBLE_DATA=Mi,t.WARNING_UNSORTED_CENTRAL_DIRECTORY=_i,t.WARNING_WRAPPED_ENTRIES_COUNT=Li,t.Writer=Kr,t.ZipDirectoryEntry=Lc,t.ZipEntry=Oc,t.ZipFS=Bc,t.ZipFileEntry=Mc,t.ZipReader=ts,t.ZipReaderStream=es,t.ZipWriter=Ra,t.ZipWriterStream=class{constructor(t={}){const{readable:e,writable:n}=new z;this.readable=e,this.zipWriter=new Ra(n,t),this.oe=new u}transform(t){const e=this.zipWriter;let n;const{readable:r,writable:o}=new z({start(t){n=t},flush:()=>{!async function(){try{await e.close()}catch(t){await Da(e,t)}}()}});return Aa(this,this.zipWriter.add(t,r),t=>n.error(t)),{readable:this.readable,writable:o}}writable(t){let e;const{readable:n,writable:r}=new z({start(t){e=t}});return Aa(this,this.zipWriter.add(t,n),t=>e.error(t)),r}async close(t,n={}){const{zipWriter:r}=this,o=(await S.allSettled(e.from(this.oe))).filter(t=>"rejected"==t.status).map(t=>t.reason);if(o.length){const[t]=o;try{t.entryErrors=o}catch{}throw await Da(r,t),t}try{return await r.close(t,n)}catch(t){throw await Da(r,t),t}}},t.configure=function(t){n.assign(Qt,ne(oe(t)))},t.createBlobTempStream=function(t={}){const{thresholdBytes:e=yc}=t;return function(){const t=[];let n,r,o,i=0,s=!1;const a=new D({async write(o){s?await n.write(o):(t.push(o),i+=o.length,i>e&&await async function(){const e=new z;r=pn(e.readable),n=e.writable.getWriter(),s=!0;for(const e of t)await n.write(e);t.length=0}())},async close(){n&&(await n.close(),n=null)}});let c=0;return{writable:a,readable:new F({async pull(e){if(s){if(!o){const t=await r;o=t.stream().getReader()}const{value:t,done:n}=await o.read();n?e.close():e.enqueue(t)}else c<t.length?e.enqueue(t[c++]):e.close()},async cancel(t){o&&await o.cancel(t)}},{highWaterMark:0}),dispose:async function(){if(n){try{await n.abort()}catch{}n=null}r&&(r.catch(()=>{}),r=null),t.length=0}}}},t.createOPFSTempStream=function(t={}){const{thresholdBytes:n=hc,directoryName:r=mc,getDirectory:o=()=>C.storage.getDirectory()}=t;let i;function s(){return i||(i=S.resolve(o()).then(t=>t.getDirectoryHandle(r,{create:!0}))),i}return function(){const t=[];let r,o,i,a,c=0,u=!1;const l=new D({async write(a){u?await i.write(a):(t.push(a),c+=a.length,c>n&&await async function(){const n=await s();r=x.randomUUID?x.randomUUID():e.from(x.getRandomValues(new w(16)),t=>t.toString(16).padStart(2,"0")).join(""),o=await n.getFileHandle(r,{create:!0}),i=(await o.createWritable()).getWriter(),u=!0;for(const e of t)await i.write(e);t.length=0}())},async close(){i&&(await i.close(),i=null)}});let d=0;return{writable:l,readable:new F({async pull(e){if(u){if(!a){const t=await o.getFile();a=t.stream().getReader()}const{value:t,done:n}=await a.read();n?e.close():e.enqueue(t)}else d<t.length?e.enqueue(t[d++]):e.close()},async cancel(t){a&&await a.cancel(t)}},{highWaterMark:0}),dispose:async function(){if(i){try{await i.close()}catch{}i=null}if(r){try{const t=await s();await t.removeEntry(r)}catch{}o=r=null}t.length=0}}}},t.createSyncAccessHandleTempStream=function(t={}){const{thresholdBytes:n=Sc,directoryName:r=gc,getDirectory:o}=t;if(!(o||"undefined"!=typeof FileSystemFileHandle&&FileSystemFileHandle.prototype.createSyncAccessHandle))throw new f(bc);const i=o||(()=>C.storage.getDirectory());let a;function c(){return a||(a=S.resolve(i()).then(t=>t.getDirectoryHandle(r,{create:!0}))),a}return function(){const t=[];let r,o,i=0,a=!1,u=0,l=0;const d=new D({async write(s){a?(o.write(s,{at:u}),u+=s.length):(t.push(s),i+=s.length,i>n&&await async function(){const n=await c();r=x.randomUUID?x.randomUUID():e.from(x.getRandomValues(new w(16)),t=>t.toString(16).padStart(2,"0")).join("");const i=await n.getFileHandle(r,{create:!0});o=await i.createSyncAccessHandle(),a=!0;for(const e of t)o.write(e,{at:u}),u+=e.length;t.length=0}())},close(){o&&o.flush()}});let f=0;return{writable:d,readable:new F({pull(e){if(a){const t=u-l;if(t<=0)return void e.close();const n=new w(s.min(524288,t)),r=o.read(n,{at:l});r?(l+=r,e.enqueue(n.subarray(0,r))):e.close()}else f<t.length?e.enqueue(t[f++]):e.close()}},{highWaterMark:0}),dispose:async function(){if(o){try{o.close()}catch{}o=null}if(r){try{const t=await c();await t.removeEntry(r)}catch{}r=null}t.length=0}}}},t.fs=Wc,t.getMimeType=function(){return"application/octet-stream"},t.getRegisteredCodecs=zn,t.getSupportedCompressionMethods=function(){const{CompressionStream:t,DecompressionStream:e,CompressionStreamFallback:n,DecompressionStreamFallback:r}=$t(),o=[{compressionMethod:0,compression:!0,decompression:!0,registered:!1},{compressionMethod:8,compression:pc(n,In)||pc(t,In)||pc(t,vn),decompression:pc(r,In)||pc(e,In)||pc(e,vn),registered:!1},{compressionMethod:9,compression:!1,decompression:pc(r,Tn)||pc(e,Tn),registered:!1}];for(const t of zn()){const e=Fn(t.format);o.push({compressionMethod:t.compressionMethod,compression:e?typeof e.CompressionStream==pt:dt,decompression:e?typeof e.DecompressionStream==pt:dt,registered:!0})}return o},t.isZipFile=ns,t.registerCodec=function(t={}){const{compressionMethod:e,format:n,codecURI:r,CompressionStream:i,DecompressionStream:s,versionNeeded:a}=t;if(!o.isInteger(e)||e<0||e>M||typeof n!=mt||!n.length)throw new f(mn);if(bn.includes(e))throw new f(yn);const c=typeof i==pt||typeof s==pt;if(!(c||typeof r==mt&&r.length))throw new f(mn);En.set(e,{compressionMethod:e,format:n,codecURI:r,versionNeeded:a}),c&&Dn(n,{CompressionStream:i,DecompressionStream:s})},t.resetConfiguration=function(){for(const t of Jt)delete Qt[t];n.assign(Qt,qt)},t.terminateWorkers=async function(){await S.allSettled(br.map(t=>(Ir(t),t.terminate()))),Jn=dt,Qn=!1},t.unregisterCodec=function(t){const e=En.get(t);if(e){let n;En.delete(t),En.forEach(t=>n=n||t.format==e.format),n||xn.delete(e.format)}}});