@zip.js/zip.js 2.8.46 → 2.8.47
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/deno.json +1 -1
- package/dist/zip-core-external.js +85 -9
- package/dist/zip-core-external.min.js +1 -1
- package/dist/zip-core.js +95 -8
- package/dist/zip-core.min.js +1 -1
- package/dist/zip-fs-core-external.js +85 -9
- package/dist/zip-fs-core-external.min.js +1 -1
- package/dist/zip-fs-core.js +86 -8
- package/dist/zip-fs-core.min.js +1 -1
- package/dist/zip-fs-external.js +85 -9
- package/dist/zip-fs-external.min.js +1 -1
- package/dist/zip-fs-native.js +99 -10
- package/dist/zip-fs-native.min.js +1 -1
- package/dist/zip-fs.js +98 -9
- package/dist/zip-fs.min.js +1 -1
- package/dist/zip-legacy.js +97 -10
- package/dist/zip-legacy.min.js +1 -1
- package/dist/zip-native.js +97 -10
- package/dist/zip-native.min.js +1 -1
- package/dist/zip-web-worker-native.js +1 -1
- package/dist/zip-web-worker.js +1 -1
- package/dist/zip.js +96 -9
- package/dist/zip.min.js +1 -1
- package/index-native.cjs +99 -10
- package/index-native.min.js +1 -1
- package/index.cjs +98 -9
- package/index.d.cts +141 -0
- package/index.d.ts +141 -0
- package/index.min.js +1 -1
- package/lib/core/codec-pool.js +6 -3
- package/lib/core/codec-worker.js +2 -1
- package/lib/core/constants.js +2 -0
- package/lib/core/options.js +4 -0
- package/lib/core/streams/codec-stream.js +2 -0
- package/lib/core/streams/common-crypto.js +2 -1
- package/lib/core/streams/zip-entry-stream.js +4 -2
- package/lib/core/util/sync-access-handle-temp-stream.js +2 -1
- package/lib/core/web-worker-inline-native.js +1 -1
- package/lib/core/web-worker-inline-wasm.js +1 -1
- package/lib/core/zip-fs.js +1 -1
- package/lib/core/zip-reader.js +58 -5
- package/lib/core/zip-writer.js +43 -8
- package/lib/zip-core-base.js +2 -1
- package/lib/zip-core-reader.js +2 -1
- package/lib/zip-core-writer.js +10 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
const t=4294967295,e=65535,r=255,n=67324752,a=134695760,s=a,i=33639248,o=101010256,c=101075792,l=117853008,d=22,u=20,f=39169,w=21589,h=6534,p=30837,m=30805,y=2048,b=16384,S=2048,E=1024,g="/",x=30,z=new Date(2107,11,31,23,59,58),R=new Date(1980,0,1),F=void 0,A=1/0,D="undefined",U="function",O=new Uint8Array;let k=2;try{typeof navigator!=D&&navigator.hardwareConcurrency&&(k=navigator.hardwareConcurrency)}catch{}const T={workerURI:"./core/web-worker-wasm.js",wasmURI:"./core/streams/zlib-wasm/zlib-streams.wasm",chunkSize:65536,maxWorkers:k,terminateWorkerTimeout:5e3,workerStarvationTimeout:5e3,workerStartupTimeout:5e3,useWebWorkers:!0,useCompressionStream:!0,transferStreams:!0,CompressionStream:typeof CompressionStream!=D&&CompressionStream,DecompressionStream:typeof DecompressionStream!=D&&DecompressionStream},v=["baseURI","wasmURI","workerURI","createWorker","chunkSize","maxWorkers","terminateWorkerTimeout","workerStarvationTimeout","workerStartupTimeout","useCompressionStream","useWebWorkers","transferStreams","CompressionStream","DecompressionStream","CompressionStreamFallback","DecompressionStreamFallback"],C={...T};function M(){return C}function I(t){return Math.max(t.chunkSize,64)}function j(t){t=P(t);for(const e of v){const r=t[e];r!==F&&(C[e]=r)}}function P(t){const{CompressionStreamZlib:e,DecompressionStreamZlib:r}=t;if(e===F&&r===F)return t;const n=Object.assign({},t);return n.CompressionStreamFallback===F&&(n.CompressionStreamFallback=e),n.DecompressionStreamFallback===F&&(n.DecompressionStreamFallback=r),n}function N(t){t=P(t);for(const e of v){const r=t[e];r!==F&&(T[e]=r)}j(t)}function W(){for(const t of v)delete C[t];Object.assign(C,T)}const _="Invalid codec definition",L="Reserved compression method",B="Invalid codec module",V="string",Z=[0,8,9,99],H=new Map,q=new Map;function K(t={}){const{compressionMethod:r,format:n,codecURI:a,CompressionStream:s,DecompressionStream:i,versionNeeded:o}=t;if(!Number.isInteger(r)||0>r||r>e||typeof n!=V||!n.length)throw Error(_);if(Z.includes(r))throw Error(L);const c=typeof s==U||typeof i==U;if(!(c||typeof a==V&&a.length))throw Error(_);H.set(r,{compressionMethod:r,format:n,codecURI:a,versionNeeded:o}),c&&J(n,{CompressionStream:s,DecompressionStream:i})}function Y(t){const e=H.get(t);if(e){let r;H.delete(t),H.forEach(t=>r=r||t.format==e.format),r||q.delete(e.format)}}function G(t){return H.get(t)}function X(t){return q.get(t)}function J(t,e){const{CompressionStream:r,DecompressionStream:n}=e;if(typeof r!=U&&typeof n!=U)throw Error(B);q.set(t,{CompressionStream:r,DecompressionStream:n})}const Q=[[],[],[],[],[],[],[],[]];for(let t=0;256>t;t++){let e=t;for(let t=0;8>t;t++)e=1&e?e>>>1^3988292384:e>>>1;Q[0][t]=e}for(let t=0;256>t;t++)for(let e=1;8>e;e++){const r=Q[e-1][t];Q[e][t]=r>>>8^Q[0][255&r]}const[$,tt,et,rt,nt,at,st,it]=Q;class ot{constructor(t){this.o=t||-1}append(t){let e=0|this.o;const r=0|t.length;let n=0;if(r>=8&&t.buffer){const a=new DataView(t.buffer,t.byteOffset,r),s=r-8;for(;s>=n;n+=8){const t=e^a.getInt32(n,!0),r=a.getInt32(n+4,!0);e=it[255&t]^st[t>>>8&255]^at[t>>>16&255]^nt[t>>>24&255]^rt[255&r]^et[r>>>8&255]^tt[r>>>16&255]^$[r>>>24&255]}}for(;r>n;n++)e=e>>>8^$[255&(e^t[n])];this.o=e}get(){return~this.o}}class ct extends TransformStream{constructor(){let t;const e=new ot;super({transform(t,r){e.append(t),r.enqueue(t)},flush(){const r=new Uint8Array(4);new DataView(r.buffer).setUint32(0,e.get()),t.value=r}}),t=this}}function lt(t){if(typeof TextEncoder==D){t=unescape(encodeURIComponent(t));const e=new Uint8Array(t.length);for(let r=0;r<e.length;r++)e[r]=t.charCodeAt(r);return e}return(new TextEncoder).encode(t)}function dt(t,e){const r=new Uint8Array(t.length+e.length);return r.set(t),r.set(e,t.length),r}function ut(t){return t.byteOffset||t.byteLength!=t.buffer.byteLength?new Uint8Array(t):t}function ft(t){return new DataView(t.buffer,t.byteOffset,t.byteLength)}const wt={concat(t,e){if(0===t.length||0===e.length)return t.concat(e);const r=t[t.length-1],n=wt.l(r);return 32===n?t.concat(e):wt.h(e,n,0|r,t.slice(0,t.length-1))},m(t){const e=t.length;if(0===e)return 0;const r=t[e-1];return 32*(e-1)+wt.l(r)},S(t,e){if(32*t.length<e)return t;const r=(t=t.slice(0,Math.ceil(e/32))).length;return e&=31,r>0&&e&&(t[r-1]=wt.R(e,t[r-1]&2147483648>>e-1,1)),t},R:(t,e,r)=>32===t?e:(r?0|e:e<<32-t)+1099511627776*t,l:t=>Math.round(t/1099511627776)||32,h(t,e,r,n){for(void 0===n&&(n=[]);e>=32;e-=32)n.push(r),r=0;if(0===e)return n.concat(t);for(let a=0;a<t.length;a++)n.push(r|t[a]>>>e),r=t[a]<<32-e;const a=t.length?t[t.length-1]:0,s=wt.l(a);return n.push(wt.R(e+s&31,e+s>32?r:n.pop(),1)),n}},ht={bytes:{F(t){const e=wt.m(t)/8,r=new Uint8Array(e);let n;for(let a=0;e>a;a++)3&a||(n=t[a/4]),r[a]=n>>>24,n<<=8;return r},A(t){const e=[];let r,n=0;for(r=0;r<t.length;r++)n=n<<8|t[r],3&~r||(e.push(n),n=0);return 3&r&&e.push(wt.R(8*(3&r),n)),e}}},pt=class{constructor(t){const e=this;e.blockSize=512,e.D=[1732584193,4023233417,2562383102,271733878,3285377520],e.U=[1518500249,1859775393,2400959708,3395469782],t?(e.O=t.O.slice(0),e.T=t.T.slice(0),e.v=t.v):e.reset()}reset(){const t=this;return t.O=t.D.slice(0),t.T=[],t.v=0,t}update(t){const e=this;"string"==typeof t&&(t=ht.C.A(t));const r=e.T=wt.concat(e.T,t),n=e.v,a=e.v=n+wt.m(t);if(a>9007199254740991)throw Error("Cannot hash more than 2^53 - 1 bits");const s=new Uint32Array(r);let i=0;for(let t=e.blockSize+n-(e.blockSize+n&e.blockSize-1);a>=t;t+=e.blockSize)e.M(s.subarray(16*i,16*(i+1))),i+=1;return r.splice(0,16*i),e}I(){const t=this;let e=t.T;const r=t.O;e=wt.concat(e,[wt.R(1,1)]);for(let t=e.length+2;15&t;t++)e.push(0);for(e.push(Math.floor(t.v/4294967296)),e.push(0|t.v);e.length;)t.M(e.splice(0,16));return t.reset(),r}j(t,e,r,n){return t>19?t>39?t>59?t>79?void 0:e^r^n:e&r|e&n|r&n:e^r^n:e&r|~e&n}P(t,e){return e<<t|e>>>32-t}M(t){const e=this,r=e.O,n=Array(80);for(let e=0;16>e;e++)n[e]=t[e];let a=r[0],s=r[1],i=r[2],o=r[3],c=r[4];for(let t=0;79>=t;t++){16>t||(n[t]=e.P(1,n[t-3]^n[t-8]^n[t-14]^n[t-16]));const r=e.P(5,a)+e.j(t,s,i,o)+c+n[t]+e.U[Math.floor(t/20)]|0;c=o,o=i,i=e.P(30,s),s=a,a=r}r[0]=r[0]+a|0,r[1]=r[1]+s|0,r[2]=r[2]+i|0,r[3]=r[3]+o|0,r[4]=r[4]+c|0}},mt={importKey:t=>new mt.N(ht.bytes.A(t)),W(t,e,r,n){if(r=r||1e4,0>n||0>r)throw Error("invalid params to pbkdf2");const a=1+(n>>5)<<2;let s,i,o,c,l;const d=new ArrayBuffer(a),u=new DataView(d);let f=0;const w=wt;for(e=ht.bytes.A(e),l=1;(a||1)>f;l++){for(s=i=t.encrypt(w.concat(e,[l])),o=1;r>o;o++)for(i=t.encrypt(i),c=0;c<i.length;c++)s[c]^=i[c];for(o=0;(a||1)>f&&o<s.length;o++)u.setInt32(f,s[o]),f+=4}return d.slice(0,n/8)},N:class{constructor(t){const e=this,r=e._=pt,n=[[],[]];e.L=[new r,new r];const a=e.L[0].blockSize/32;t.length>a&&(t=(new r).update(t).I());for(let e=0;a>e;e++)n[0][e]=909522486^t[e],n[1][e]=1549556828^t[e];e.L[0].update(n[0]),e.L[1].update(n[1]),e.B=new r(e.L[0])}reset(){const t=this;t.B=new t._(t.L[0]),t.V=!1}update(t){this.V=!0,this.B.update(t)}digest(){const t=this,e=t.B.I(),r=new t._(t.L[1]).update(e).I();return t.reset(),r}encrypt(t){if(this.V)throw Error("encrypt on already updated hmac called!");return this.update(t),this.digest(t)}}},yt=typeof crypto!=D&&typeof crypto.getRandomValues==U,bt="Invalid password",St="Invalid signature",Et=St,gt="zipjs-abort-check-password";function xt(t){if(yt)return crypto.getRandomValues(t);throw Error("Crypto API not supported")}const zt=16,Rt={name:"PBKDF2"},Ft=Object.assign({hash:{name:"HMAC"}},Rt),At=Object.assign({iterations:1e3,hash:{name:"SHA-1"}},Rt),Dt=["deriveBits"],Ut=[8,12,16],Ot=[16,24,32],kt=10,Tt=[0,0,0,0],vt=typeof crypto!=D,Ct=vt&&crypto.subtle,Mt=vt&&typeof Ct!=D,It=ht.bytes,jt=class{constructor(t){const e=this;e.Z=[[[],[],[],[],[]],[[],[],[],[],[]]],e.Z[0][0][0]||e.H();const r=e.Z[0][4],n=e.Z[1],a=t.length;let s,i,o,c=1;if(4!==a&&6!==a&&8!==a)throw Error("invalid aes key size");for(e.U=[i=t.slice(0),o=[]],s=a;4*a+28>s;s++){let t=i[s-1];(s%a===0||8===a&&s%a===4)&&(t=r[t>>>24]<<24^r[t>>16&255]<<16^r[t>>8&255]<<8^r[255&t],s%a===0&&(t=t<<8^t>>>24^c<<24,c=c<<1^283*(c>>7))),i[s]=i[s-a]^t}for(let t=0;s;t++,s--){const e=i[3&t?s:s-4];o[t]=4>=s||4>t?e:n[0][r[e>>>24]]^n[1][r[e>>16&255]]^n[2][r[e>>8&255]]^n[3][r[255&e]]}}encrypt(t){return this.K(t,0)}decrypt(t){return this.K(t,1)}H(){const t=this.Z[0],e=this.Z[1],r=t[4],n=e[4],a=[],s=[];let i,o,c,l;for(let t=0;256>t;t++)s[(a[t]=t<<1^283*(t>>7))^t]=t;for(let d=i=0;!r[d];d^=o||1,i=s[i]||1){let s=i^i<<1^i<<2^i<<3^i<<4;s=s>>8^255&s^99,r[d]=s,n[s]=d,l=a[c=a[o=a[d]]];let u=16843009*l^65537*c^257*o^16843008*d,f=257*a[s]^16843008*s;for(let r=0;4>r;r++)t[r][d]=f=f<<24^f>>>8,e[r][s]=u=u<<24^u>>>8}for(let r=0;5>r;r++)t[r]=t[r].slice(0),e[r]=e[r].slice(0)}K(t,e){if(4!==t.length)throw Error("invalid aes block size");const r=this.U[e],n=r.length/4-2,a=[0,0,0,0],s=this.Z[e],i=s[0],o=s[1],c=s[2],l=s[3],d=s[4];let u,f,w,h=t[0]^r[0],p=t[e?3:1]^r[1],m=t[2]^r[2],y=t[e?1:3]^r[3],b=4;for(let t=0;n>t;t++)u=i[h>>>24]^o[p>>16&255]^c[m>>8&255]^l[255&y]^r[b],f=i[p>>>24]^o[m>>16&255]^c[y>>8&255]^l[255&h]^r[b+1],w=i[m>>>24]^o[y>>16&255]^c[h>>8&255]^l[255&p]^r[b+2],y=i[y>>>24]^o[h>>16&255]^c[p>>8&255]^l[255&m]^r[b+3],b+=4,h=u,p=f,m=w;for(let t=0;4>t;t++)a[e?3&-t:t]=d[h>>>24]<<24^d[p>>16&255]<<16^d[m>>8&255]<<8^d[255&y]^r[b++],u=h,h=p,p=m,m=y,y=u;return a}},Pt=class{constructor(t,e){this.Y=t,this.G=e,this.X=e}reset(){this.X=this.G}update(t){return this.J(this.Y,t,this.X)}$(t){if(255&~(t>>24))t+=1<<24;else{let e=t>>16&255,r=t>>8&255,n=255&t;255===e?(e=0,255===r?(r=0,255===n?n=0:++n):++r):++e,t=0,t+=e<<16,t+=r<<8,t+=n}return t}et(t){0===(t[0]=this.$(t[0]))&&(t[1]=this.$(t[1]))}J(t,e,r){let n;if(!(n=e.length))return[];const a=wt.m(e);for(let a=0;n>a;a+=4){this.et(r);const n=t.encrypt(r);e[a]^=n[0],e[a+1]^=n[1],e[a+2]^=n[2],e[a+3]^=n[3]}return wt.S(e,a)}},Nt=mt.N;let Wt=vt&&Mt&&typeof Ct.importKey==U,_t=vt&&Mt&&typeof Ct.deriveBits==U;class Lt extends TransformStream{constructor({password:t,rawPassword:e,encryptionStrength:r,checkPasswordOnly:n,checkAuthenticationCode:a=!0}){super({start(){Vt(this,t,e,r)},async transform(t,e){const r=this,{password:a,strength:s,nt:i,ready:o}=r;a?(await(async(t,e,r,n)=>{const a=await Ht(t,e,r,Kt(n,0,Ut[e])),s=Kt(n,Ut[e]);if(a[0]!=s[0]||a[1]!=s[1])throw Error(bt)})(r,s,a,Kt(t,0,Ut[s]+2)),t=Kt(t,Ut[s]+2),n?e.error(Error(gt)):i()):await o;const c=new Uint8Array(t.length-kt-(t.length-kt)%zt);e.enqueue(Zt(r,t,c,0,kt,!0))},async flush(t){const{st:e,it:r,pending:n,ready:s}=this;if(r&&e){await s;const i=Kt(n,0,n.length-kt),o=Kt(n,n.length-kt);let c=O;if(i.length){const t=Gt(It,i);r.update(t);const n=e.update(t);c=Yt(It,n)}const l=Kt(Yt(It,r.digest()),0,kt);let d=n.length<kt?1:0;for(let t=0;kt>t;t++)d|=l[t]^o[t];if(d&&a)throw Error(Et);t.enqueue(c)}}})}}class Bt extends TransformStream{constructor({password:t,rawPassword:e,encryptionStrength:r}){super({start(){Vt(this,t,e,r)},async transform(t,e){const r=this,{password:n,strength:a,nt:s,ready:i}=r;let o=O;n?(o=await(async(t,e,r)=>{const n=xt(new Uint8Array(Ut[e]));return dt(n,await Ht(t,e,r,n))})(r,a,n),s()):await i;const c=new Uint8Array(o.length+t.length-t.length%zt);c.set(o,0),e.enqueue(Zt(r,t,c,o.length,0))},async flush(t){const{st:e,it:r,pending:n,ready:a}=this;if(r&&e){await a;let s=O;if(n.length){const t=e.update(Gt(It,n));r.update(t),s=Yt(It,t)}const i=Yt(It,r.digest()).slice(0,kt);t.enqueue(dt(s,i))}}})}}function Vt(t,e,r,n){Object.assign(t,{ready:new Promise(e=>t.nt=e),password:qt(e,r),strength:n-1,pending:O})}function Zt(t,e,r,n,a,s){const{st:i,it:o,pending:c}=t;c.length&&(e=dt(c,e));const l=e.length-a;let d;for(r=((t,e)=>{if(e&&e>t.length){const r=t;(t=new Uint8Array(e)).set(r,0)}return t})(r,n+(l-l%zt)),d=0;l-zt>=d;d+=zt){const t=Gt(It,Kt(e,d,d+zt));s&&o.update(t);const a=i.update(t);s||o.update(a),r.set(Yt(It,a),d+n)}return t.pending=Kt(e,d),r}async function Ht(t,e,r,n){t.password=null;const a=await(async(t,e,r,n,a)=>{if(!Wt)return mt.importKey(e);try{return await Ct.importKey("raw",e,r,!1,a)}catch{return Wt=!1,mt.importKey(e)}})(0,r,Ft,0,Dt),s=await(async(t,e,r)=>{if(!_t)return mt.W(e,t.salt,At.iterations,r);try{return await Ct.deriveBits(t,e,r)}catch{return _t=!1,mt.W(e,t.salt,At.iterations,r)}})(Object.assign({salt:n},At),a,8*(2*Ot[e]+2)),i=new Uint8Array(s),o=Gt(It,Kt(i,0,Ot[e])),c=Gt(It,Kt(i,Ot[e],2*Ot[e])),l=Kt(i,2*Ot[e]);return Object.assign(t,{keys:{key:o,ot:c,passwordVerification:l},st:new Pt(new jt(o),Array.from(Tt)),it:new Nt(c)}),l}function qt(t,e){return e===F?lt(t):e}function Kt(t,e,r){return t.subarray(e,r)}function Yt(t,e){return t.F(e)}function Gt(t,e){return t.A(e)}class Xt extends TransformStream{constructor({password:t,rawPassword:e,passwordVerification:r,checkPasswordOnly:n}){super({start(){Qt(this,t,e,r)},transform(t,e){const r=this;if(r.password||r.rawPassword){const e=$t(r,t.subarray(0,12));if(r.password=r.rawPassword=null,0!=(e[11]^r.passwordVerification))throw Error(bt);t=t.subarray(12)}n?e.error(Error(gt)):e.enqueue($t(r,t))}})}}class Jt extends TransformStream{constructor({password:t,rawPassword:e,passwordVerification:r}){super({start(){Qt(this,t,e,r)},transform(t,e){const r=this;let n,a;if(r.password||r.rawPassword){r.password=r.rawPassword=null;const e=xt(new Uint8Array(12));e[11]=r.passwordVerification,n=new Uint8Array(t.length+e.length),n.set(te(r,e),0),a=12}else n=new Uint8Array(t.length),a=0;n.set(te(r,t),a),e.enqueue(n)}})}}function Qt(t,e,r,n){Object.assign(t,{password:e,rawPassword:r,passwordVerification:n}),((t,e,r)=>{const n=[305419896,591751049,878082192];if(Object.assign(t,{keys:n,ct:new ot(n[0]),lt:new ot(n[2])}),r)for(let e=0;e<r.length;e++)ee(t,r[e]);else for(let r=0;r<e.length;r++)ee(t,e.charCodeAt(r))})(t,e,r)}function $t(t,e){const r=new Uint8Array(e.length);for(let n=0;n<e.length;n++)r[n]=re(t)^e[n],ee(t,r[n]);return r}function te(t,e){const r=new Uint8Array(e.length);for(let n=0;n<e.length;n++)r[n]=re(t)^e[n],ee(t,e[n]);return r}function ee(t,e){let[,r]=t.keys;t.ct.append([e]);const n=~t.ct.get();r=ae(Math.imul(ae(r+ne(n)),134775813)+1),t.lt.append([r>>>24]);const a=~t.lt.get();t.keys=[n,r,a]}function re(t){const e=2|t.keys[2];return ne(Math.imul(e,1^e)>>>8)}function ne(t){return 255&t}function ae(t){return 4294967295&t}function se(t){if(t instanceof ReadableStream)return t;const e=t.getReader();return new ReadableStream({async pull(t){const{value:r,done:n}=await e.read();n?t.close():t.enqueue(r)},cancel:t=>e.cancel(t)})}function ie(t){if(t instanceof WritableStream)return t;const e=t.getWriter();return new WritableStream({write:t=>e.write(t),close:()=>e.close(),abort:t=>e.abort(t)})}const oe="Invalid uncompressed size",ce="Invalid compressed data",le=St,de="deflate-raw",ue="gzip",fe=[31,139,8];class we extends TransformStream{constructor(t,{chunkSize:e,CompressionStreamFallback:r,CompressionStream:n}){super({});const{compressed:a,encrypted:s,useCompressionStream:i,zipCrypto:o,computeCrc32:c,level:l,deflate64:d,format:u,compressionMethod:f}=t,w=this;let h,p,m,y=super.readable;const b=u&&X(u),S=c&&a&&!d&&!b&&(!s||o)&&!(!i||!n);if(s&&!o||!c||S||(h=new ct,y=xe(y,h)),a)if(b)y=ze(y,Ee(b.CompressionStream,u,{level:l,chunkSize:e,compressionMethod:f}));else if(S)m=new he,y=ze(y,new n(ue)),y=xe(y,m);else try{y=ge(y,i,{level:l,chunkSize:e},n,r)}catch(t){let e;try{e=new n(ue)}catch{throw t}y=ze(y,e),y=xe(y,new he)}s&&(o?y=xe(y,new Jt(t)):(p=new Bt(t),y=xe(y,p))),Se(w,y,()=>{s&&!o||!c||(w.crc32=S?m.crc32:new DataView(h.value.buffer).getUint32(0))})}}class he extends TransformStream{constructor(){let t,e=10,r=new Uint8Array(0);super({transform(t,n){if(e){const r=Math.min(e,t.length);if(e-=r,!(t=t.subarray(r)).length)return}const a=r.length+t.length;if(8>=a)return void(r=dt(r,t));const s=a-8,i=Math.min(s,r.length);n.enqueue(dt(r.subarray(0,i),t.subarray(0,s-i))),r=dt(r.subarray(i),t.subarray(s-i))},flush(){const e=ft(r);t.crc32=e.getUint32(0,!0),t.uncompressedSize=e.getUint32(4,!0)}}),t=this}}class pe extends TransformStream{constructor(t,{chunkSize:e,DecompressionStreamFallback:r,DecompressionStream:n}){super({});const{zipCrypto:a,encrypted:s,checkCrc32:i,crc32:o,compressed:c,useCompressionStream:l,deflate64:d,format:u,compressionMethod:f,rawBitFlag:w,outputSize:h}=t;let p,m,y=super.readable;if(s&&(a?y=xe(y,new Xt(t)):(m=new Lt(t),y=xe(y,m))),c){const t=u&&X(u);if(t)y=ze(y,Ee(t.DecompressionStream,u,{chunkSize:e,compressionMethod:f,rawBitFlag:w,uncompressedSize:h}));else try{y=ge(y,l,{chunkSize:e,deflate64:d},n,r)}catch(t){if(d||h===F)throw t;let e;try{e=new n(ue)}catch{throw t}y=((t,e,r)=>{const n=new ot;let a,s,i,o=0,c=!1;const l=new Promise((t,e)=>{s=t,i=e});l.catch(()=>{}),r||s();const d=new TransformStream({start(t){const e=new Uint8Array(10);e.set(fe),t.enqueue(e)},transform(t,e){e.enqueue(t)},async flush(t){c=!0,f();try{await l}finally{w()}const e=new Uint8Array(8),a=ft(e);a.setUint32(0,n.get(),!0),a.setUint32(4,r,!0),t.enqueue(e)},cancel(t){i(t)}}),u=new TransformStream({transform(t,e){n.append(t),o+=t.length,r>o?c&&f():s(),e.enqueue(t)},cancel(t){i(t)}});return t=xe(t,d),xe(t=ze(t,e),u);function f(){w(),a=setTimeout(()=>i(Error(oe)),5e3)}function w(){clearTimeout(a)}})(y,e,h)}y=(t=>{const e=t.getReader();return new ReadableStream({async pull(t){let r;try{r=await e.read()}catch(t){if(t&&t.message)throw t;const e=Error(ce);throw e.cause=t,e}const{value:n,done:a}=r;a?t.close():t.enqueue(n)},cancel:t=>e.cancel(t)})})(y)}i&&(p=new ct,y=xe(y,p)),Se(this,y,()=>{if(i){const t=new DataView(p.value.buffer);if(o!=t.getUint32(0,!1))throw Error(le)}})}}const me=new Map;function ye(t,e){if(!t)return!1;let r=me.get(t);r||(r=new Map,me.set(t,r));let n=r.get(e);if(n===F){try{new t(e),n=!0}catch{n=!1}r.set(e,n)}return n}function be(t){return ye(t,de)}function Se(t,e,r){e=xe(e,new TransformStream({flush:r})),Object.defineProperty(t,"readable",{get:()=>e})}function Ee(t,e,r){if(!t)throw Error("Compression method not supported");return new t(e,r)}function ge(t,e,r,n,a){const s=e&&n?n:a||n,i=r.deflate64?"deflate64-raw":de;let o;try{o=new s(i,r)}catch(t){if(!e||!a||s==a)throw t;o=new a(i,r)}return ze(t,o)}function xe(t,e){return se(t).pipeThrough(e)}function ze(t,e){const r=e.writable.getWriter(),n=t.getReader();return(async()=>{try{for(;;){await r.ready;const t=await n.read();if(t.done){await r.close();break}await r.write(t.value)}}catch(t){await(async(t,e)=>{try{await t.abort(e)}catch{}})(r,t),await(async(t,e)=>{try{await t.cancel(e)}catch{}})(n,t)}})(),e.readable}const Re="data",Fe="deflate",Ae="inflate";class De extends TransformStream{constructor(t,e){super({});const r=this,{codecType:n}=t;let a;n.startsWith(Fe)?a=we:n.startsWith(Ae)&&(a=pe),r.outputSize=0;let s=0;const i=new a(t,e),o=super.readable,c=new TransformStream({transform(t,e){t&&t.length&&(s+=t.length,e.enqueue(t))},flush(){Object.assign(r,{inputSize:s})}}),l=new TransformStream({transform(e,n){if(e&&e.length&&(n.enqueue(e),r.outputSize+=e.length,t.outputSize!==F&&r.outputSize>t.outputSize))throw Error(oe)},flush(){const{crc32:t}=i;Object.assign(r,{crc32:t,inputSize:s})}});Object.defineProperty(r,"readable",{get:()=>o.pipeThrough(c).pipeThrough(i).pipeThrough(l)})}}class Ue extends TransformStream{constructor(t){const e=[];let r=0;function n(){const n=new Uint8Array(t);let a=0;for(;t>a;){const r=e[0],s=t-a;r.length>s?(n.set(r.subarray(0,s),a),e[0]=r.subarray(s),a+=s):(n.set(r,a),a+=r.length,e.shift())}return r-=t,n}Number.isFinite(t)&&t>=1||(t=65536),super({transform(a,s){for(e.push(a),r+=a.length;r>t;)s.enqueue(n())},flush(t){r&&t.enqueue(((t,e)=>{const r=new Uint8Array(e);let n=0;for(const e of t)r.set(e,n),n+=e.length;return r})(e,r))}})}}const Oe={type:"module"},ke="error";let Te,ve,Ce,Me,Ie,je=!0;try{je=typeof structuredClone==U&&structuredClone(new DOMException("","AbortError")).code!==F}catch{}let Pe=()=>{};class Ne{constructor(t,{readable:e,writable:r},{options:n,config:a,ut:s,useWebWorkers:i,transferStreams:o,workerURI:c,createWorker:l},d){const{signal:u}=s;return Ie&&(l=F),Object.assign(t,{ft:!0,wt:(t.wt||0)+1,readable:e.pipeThrough(new Ue(I(a))).pipeThrough(new We(s),{signal:u}),writable:r,options:Object.assign({},n),workerURI:c,createWorker:l,transferStreams:o,terminate:()=>new Promise(e=>{const{ht:r,ft:n}=t;r?(n?t.yt=e:(r.terminate(),e()),t.bt=null):e()}),St(){if(t.ft){const{yt:e}=t;e&&(t.yt=null,t.Et=!0,t.ht.terminate(),e()),t.ft=!1,d(t)}}}),Te===F&&(Te=typeof Worker!=D),(i&&(Te&&c||l)?Be:Le)(t,a)}}class We extends TransformStream{constructor({onstart:t,onprogress:e,size:r,onend:n}){let a=0;super({async start(){t&&await _e(t,r)},async transform(t,n){a+=t.length,e&&await _e(e,a,r),n.enqueue(t)},async flush(){n&&await _e(n,a)}})}}async function _e(t,...e){try{await t(...e)}catch{}}function Le(t,e){return{run:()=>Ve(t,e)}}function Be(t,e){const{baseURI:r,chunkSize:n,workerStartupTimeout:a}=e;let{wasmURI:s}=e;if(!t.bt){let i;typeof s==U&&(s=s());try{i=He(t.workerURI,r,t)}catch{return t.createWorker?Ie=!0:Te=!1,Le(t,e)}Object.assign(t,{ht:i,gt:!1,Et:!1,bt:{run:async()=>{try{return await(async(t,e)=>{let r,n;const a=new Promise((t,e)=>{r=t,n=e});Object.assign(t,{reader:null,writer:null,xt:r,zt:n,result:a});const{readable:s,options:i}=t,{writable:o,closed:c,Rt:l}=(t=>{const e=new AbortController,{writable:r,readable:n}=new TransformStream,a=n.pipeTo(t,{preventClose:!0,preventAbort:!0,signal:e.signal});return a.catch(()=>{}),{writable:r,closed:a,Rt:()=>e.abort()}})(t.writable);let d;try{d=Ye({type:"start",options:i,config:e,readable:s,writable:o},t)}catch(e){l();try{await c}catch{}throw t.St(),e}d||Object.assign(t,{reader:s.getReader(),writer:o.getWriter()});const{workerStartupTimeout:u}=e;t.gt||!Number.isFinite(u)||0>u||(t.Ft=setTimeout(()=>(t=>{if(t.Ft=null,t.gt)return;const{zt:e,writer:r}=t;if(Ze(t),t.ht=null,e){const t=Error("Worker startup timeout");t.At=!0,e(t),r&&r.releaseLock()}})(t),u));try{const t=await a;return await f(),await c,t}catch(t){await f(),l();try{await c}catch{}throw t}async function f(){if(!d&&!o.locked)try{await o.getWriter().close()}catch{}}})(t,{chunkSize:n,wasmURI:s,baseURI:r,workerStartupTimeout:a})}catch(r){if(r&&r.At){t.createWorker?Ie=!0:Te=!1;const{reader:r}=t;return r&&r.releaseLock(),t.reader=null,t.writer=null,Ve(t,e)}throw r}}}})}return t.bt}async function Ve({options:t,readable:e,writable:r,St:n},a){let s;try{if(t.compressed&&!t.format){const e=t.codecType.startsWith(Fe),r=e?a.CompressionStreamFallback:a.DecompressionStreamFallback,n=e?a.CompressionStream:a.DecompressionStream;if(t.useCompressionStream){if(r&&r.Dt&&!be(n))try{await Pe(a)}catch{}}else try{await Pe(a)}catch{r&&!r.Dt||(t.useCompressionStream=!0)}}s=new De(t,a),await e.pipeThrough(s).pipeThrough(new Ue(I(a))).pipeTo(r,{preventClose:!0,preventAbort:!0});const{crc32:n,inputSize:i,outputSize:o}=s;return{crc32:n,inputSize:i,outputSize:o}}catch(t){throw s&&(t.outputSize=s.outputSize),t}finally{n()}}function Ze(t){const{ht:e}=t;if(e)try{e.terminate()}catch{}t.bt=null}function He(t,e,r,n,a=!0){const{createWorker:s}=r;let i,o,c;if(s)i=s();else if(Ce===F||ve!==t){const s=typeof t==U;o=s?t(a):t;const l=o.startsWith("data:"),d=o.startsWith("blob:");if(l||d){n===F&&(n=!1),n&&(c=Oe);try{i=new Worker(o,c)}catch(a){if(d)try{URL.revokeObjectURL(o)}catch{}if(s&&d)return He(t,e,r,n,!1);if(n)throw a;return He(t,e,r,!0,!1)}}else{n===F&&(n=!0),n&&(c=Oe);try{o=new URL(o,e)}catch{}try{i=new Worker(o,c)}catch(s){if(n)throw s;return He(t,e,r,!1,a)}}ve=t,Ce=o,Me=c}else i=new Worker(Ce,Me);return i.addEventListener("message",t=>{r.gt=!0,qe(r),(async({data:t},e)=>{const{type:r,value:n,messageId:a,result:s,error:i}=t,{reader:o,writer:c,xt:l,zt:d,St:u,wt:f}=e,w=()=>e.wt!=f;try{if(i){const{message:t,stack:e,code:r,name:n,outputSize:a,cause:s}=i,o=Error(t);Object.assign(o,{stack:e,code:r,name:n,outputSize:a}),s&&(o.cause=Object.assign(Error(s.message),{name:s.name})),h(o)}else{if("pull"==r){const{value:t,done:r}=await o.read();w()||Ye({type:Re,value:t,done:r,messageId:a},e)}r==Re&&(await c.ready,await c.write(new Uint8Array(n)),w()||Ye({type:"ack",messageId:a},e)),"close"==r&&h(null,s)}}catch(i){w()||(Ze(e),h(i))}function h(t,e){w()||(t?d(t):l(e),c&&c.releaseLock(),u())}})(t,r)}),i.addEventListener(ke,t=>Ke(t,r)),i.addEventListener("messageerror",t=>Ke(t,r)),i}function qe(t){const{Ft:e}=t;e&&(clearTimeout(e),t.Ft=null)}function Ke(t,e){t.preventDefault&&t.preventDefault(),qe(e);const{gt:r,zt:n,writer:a,St:s}=e;if(Ze(e),r||(e.ht=null),n){let e=t.error||Error(t.message||ke);r||(e=Object.assign(Error(e.message||ke),{At:!0})),n(e),a&&a.releaseLock(),r&&s()}}function Ye(t,{ht:e,writer:r,transferStreams:n,gt:a}){try{const{value:r,readable:s,writable:i}=t,o=[];if(r&&(t.value=ut(r),o.push(t.value.buffer)),n&&je&&a?(s&&o.push(s),i&&o.push(i)):t.readable=t.writable=null,o.length)try{return e.postMessage(t,o),!0}catch{je=!1,t.readable=t.writable=null,e.postMessage(t)}else e.postMessage(t)}catch(t){throw r&&r.releaseLock(),t}}let Ge=[];const Xe=[];let Je,Qe,$e=0;async function tr(t,e){const{options:r,config:n}=e,{transferStreams:a,useWebWorkers:s,useCompressionStream:i,compressed:o,checkCrc32:c,computeCrc32:l,encrypted:d,format:u,codecURI:f}=r,{workerURI:w,createWorker:h,maxWorkers:p}=n;u&&(f&&(r.codecURI=((t,e)=>{try{return new URL(t,e).toString()}catch{return t}})(f,n.baseURI)),await(async(t,e)=>{!q.has(t)&&e&&J(t,await(import(/* webpackIgnore: true */ /* @vite-ignore */e)))})(u,r.codecURI)),e.transferStreams=a||a===F&&n.transferStreams;const m=!(o||c||l||d),y=u===F||!!r.codecURI;return e.useWebWorkers=!m&&y&&(s||s===F&&n.useWebWorkers),e.workerURI=e.useWebWorkers&&w?w:F,e.createWorker=e.useWebWorkers&&h?h:F,r.useCompressionStream=i||i===F&&n.useCompressionStream,(await(async()=>{const r=Ge.find(t=>!t.ft);if(r)return sr(r),new Ne(r,t,e,b);if(Ge.length<p){const r={Ut:$e};return $e++,Ge.push(r),new Ne(r,t,e,b)}return new Promise(r=>{Xe.push({resolve:r,stream:t,Ot:e}),Qe=n.workerStarvationTimeout,er()})})()).run();function b(t){if(rr(),Xe.length){const[{resolve:e,stream:r,Ot:n}]=Xe.splice(0,1);e(new Ne(t,r,n,b)),er()}else t.ht?(sr(t),((t,e)=>{const{config:r}=e,{terminateWorkerTimeout:n}=r;Number.isFinite(n)&&n>=0&&(t.Et?t.Et=!1:t.kt=setTimeout(async()=>{Ge=Ge.filter(e=>e!=t);try{await t.terminate()}catch{}},n))})(t,e)):Ge=Ge.filter(e=>e!=t)}}function er(){!Je&&Xe.length&&Number.isFinite(Qe)&&Qe>=0&&(Je=setTimeout(nr,Qe))}function rr(){Je&&(clearTimeout(Je),Je=null)}function nr(){if(Je=null,Xe.length){const[{resolve:t,stream:e,Ot:r}]=Xe.splice(0,1),n=Object.assign({},r,{useWebWorkers:!1,workerURI:F,createWorker:F});t(new Ne({},e,n,ar)),er()}}function ar(){rr(),er()}function sr(t){const{kt:e}=t;e&&(clearTimeout(e),t.kt=null)}const ir="HTTP error ",or="HTTP Range not supported",cr="HTTP resource changed",lr="Writer iterator completed too soon",dr="Writer not initialized",ur="Content-Range",fr="Range",wr="GET",hr="bytes",pr=16777216,mr="writable",yr=Symbol();class br{constructor(){this.size=0}init(){this.initialized=!0}}class Sr extends br{get readable(){return this.createReadable()}createReadable({offset:t=0,size:e,chunkSize:r=I(M())}={}){const n=this;let a=0;return new ReadableStream({async pull(s){const i=e===F?r:Math.min(r,e-a),o=await en(n,t+a,i);s.enqueue(o),a+r>e||e===F&&!o.length&&i?s.close():a+=r}})}}class Er extends br{constructor(){super();const t=this,e=new WritableStream({write(e){if(!t.initialized)throw Error(dr);return t.writeUint8Array(ut(e))}});Object.defineProperty(t,mr,{get:()=>e})}writeUint8Array(){}}class gr extends Sr{constructor(t){super();let e=t.length;for(;"="==t.charAt(e-1);)e--;const r=t.indexOf(",")+1;Object.assign(this,{dataURI:t,Tt:r,size:Math.floor(.75*(e-r))})}readUint8Array(t,e){const{Tt:r,dataURI:n}=this,a=new Uint8Array(e),s=4*Math.floor(t/3),i=atob(n.substring(s+r,4*Math.ceil((t+e)/3)+r)),o=t-3*Math.floor(s/4);let c=0;for(let t=o;o+e>t&&t<i.length;t++)a[t-o]=i.charCodeAt(t),c++;return c<a.length?a.subarray(0,c):a}}class xr extends Er{constructor(t){super(),Object.assign(this,{data:"data:"+(t||"")+";base64,",pending:[]})}writeUint8Array(t){const e=this;let r,n=e.pending;const a=e.pending.length;for(e.pending="",r=0;r<3*Math.floor((a+t.length)/3)-a;r++)n+=String.fromCharCode(t[r]);for(;r<t.length;r++)e.pending+=String.fromCharCode(t[r]);n.length>2?e.data+=btoa(n):e.pending=n+e.pending}getData(){return this.data+btoa(this.pending)}}let zr,Rr;class Fr extends Sr{constructor(t){super(),Object.assign(this,{blob:t,size:t.size}),Rr||(Rr=(async()=>{try{const t=new Blob([new Uint8Array(3)]).slice(1,2).stream().getReader();let e=0,r=await t.read();for(;!r.done;)e+=r.value.length,r=await t.read();zr=1==e}catch{zr=!1}})())}createReadable(t){const{blob:e,size:r}=this,{offset:n=0,size:a=r-n}=t||{};return n||r>a?zr?se(e.slice(n,n+a).stream()):super.createReadable(t):se(e.stream())}async readUint8Array(t,e){const r=this,n=t+e,a=t||n<r.size?r.blob.slice(t,n):r.blob;let s=await a.arrayBuffer();return s.byteLength>e&&(s=s.slice(t,n)),new Uint8Array(s)}}class Ar extends br{constructor(t){super();const e=this,r=new TransformStream;if(Object.defineProperty(e,mr,{get:()=>r.writable}),typeof Blob.prototype.stream!=U||new Blob([]).stream()instanceof ReadableStream){const n=[];t&&n.push(["Content-Type",t]),e.blob=new Response(r.readable,{headers:n}).blob()}else{const n=[];e.blob=r.readable.pipeTo(new WritableStream({write(t){n.push(t)}})).then(()=>new Blob(n,{type:t}))}e.blob.catch(()=>{})}getData(){return this.blob}}class Dr extends Fr{constructor(t){super(new Blob([t],{type:"text/plain"}))}}class Ur extends Ar{constructor(t){super(t),Object.assign(this,{encoding:t,vt:!t||"utf-8"==t.toLowerCase()})}async getData(){const{encoding:t,vt:e}=this,r=await super.getData();if(r.text&&e)return r.text();{const e=new FileReader;return new Promise((n,a)=>{Object.assign(e,{onload:({target:t})=>n(t.result),onerror:()=>a(e.error)}),e.readAsText(r,t)})}}}class Or extends Sr{constructor(t,e){super(),Tr(this,t,e)}async init(){await vr(this,Zr,_r),super.init()}createReadable(t){const e=this,{useRangeHeader:r,forceRangeRequests:n,size:a}=e;if((r||n)&&a!==F){const{offset:r=0,size:n=a-r}=t||{};if(n>0&&a>r)return((t,e,r)=>{let n,a=e,s=0,i=r;return new ReadableStream({start:()=>o(),async pull(t){n||await o();const{value:e,done:r}=await n.read();if(r)throw Error(or);const a=e.length>s?e.subarray(0,s):e;s-=a.length,i-=a.length,a.length&&t.enqueue(a),s||(await(async()=>{const t=n;n=F,await t.cancel()})(),i||t.close())},cancel:t=>n&&n.cancel(t)});async function o(){const e=Math.min(t.maximumRangeSize,i),r=await Zr(wr,t,Nr(t,a,e));if(206!=r.status)throw Error(or);const o=r.headers.get(ur);if(o){const t=Number(o.trim().split(/[\s-]+/)[1]);if(!Number.isNaN(t)&&t!=a)throw Error(or)}Pr(t,r),jr(t,r),a+=e,s=e,n=r.body.getReader()}})(e,r,Math.min(n,a-r))}return super.createReadable(t)}readUint8Array(t,e){return Cr(this,t,e,Zr,_r)}}class kr extends Sr{constructor(t,e){super(),Tr(this,t,e)}async init(){await vr(this,Hr,Lr),super.init()}readUint8Array(t,e){return Cr(this,t,e,Hr,Lr)}}function Tr(t,e,r){const{preventHeadRequest:n,useRangeHeader:a,forceRangeRequests:s,combineSizeEocd:i,checkResourceChanges:o=!0,maximumRangeSize:c=pr,fetch:l}=r;delete(r=Object.assign({},r)).preventHeadRequest,delete r.useRangeHeader,delete r.forceRangeRequests,delete r.combineSizeEocd,delete r.checkResourceChanges,delete r.maximumRangeSize,delete r.useXHR,delete r.fetch,Object.assign(t,{url:e,options:r,preventHeadRequest:n,useRangeHeader:a,forceRangeRequests:s,combineSizeEocd:i,checkResourceChanges:o,maximumRangeSize:c,fetch:l})}async function vr(t,e,r){const{url:n,preventHeadRequest:a,useRangeHeader:s,forceRangeRequests:i,combineSizeEocd:o}=t;if((t=>{const{baseURI:e}=M(),{protocol:r}=new URL(t,e);return"http:"==r||"https:"==r})(n)&&(s||i)&&(void 0===a||a)){const n=await e(wr,t,Nr(t,o?-22:void 0)),a=n.headers.get("Accept-Ranges");if(!(i||a&&a.toLowerCase()==hr))throw Error(or);{if(o){const e=new Uint8Array(await n.arrayBuffer());206==n.status&&e.length==d&&(t.Ct=e)}jr(t,n);const a=Mr(n);a===F?await Vr(t,e,r):t.size=a}}else await Vr(t,e,r)}async function Cr(t,e,r,n,a){const{useRangeHeader:s,forceRangeRequests:i,Ct:o,size:c,options:l}=t;if(s||i){if(o&&e==c-d&&r==d)return o;if(c>e&&0!==r){e+r>c&&(r=c-e);const a=await n(wr,t,Nr(t,e,r));if(206!=a.status)throw Error(or);const s=a.headers.get(ur);if(s){const t=Number(s.trim().split(/[\s-]+/)[1]);if(!Number.isNaN(t)&&t!=e)throw Error(or)}Pr(t,a),jr(t,a);const i=new Uint8Array(await a.arrayBuffer());if(i.length!=r)throw Error(or);return i}return O}{const{data:n}=t;return n||await a(t,l),t.data.subarray(e,e+r)}}function Mr(t){const e=t.headers.get(ur);if(e){const t=e.trim().split(/\s*\/\s*/)[1];if(t&&"*"!=t){const e=Number(t);if(!Number.isNaN(e))return e}}}function Ir({headers:t}){return{Mt:t.get("Etag")||F,lastModified:t.get("Last-Modified")||F}}function jr(t,e){const{checkResourceChanges:r,It:n}=t;r&&!n&&206==e.status&&(t.It=Ir(e))}function Pr(t,e){const{checkResourceChanges:r,It:n,size:a}=t;if(r){const t=Mr(e);if(t!==F&&a!==F&&t!=a)throw Error(cr);if(n){const t=Ir(e);if(Object.entries(n).some(([e,r])=>r!==F&&t[e]!==F&&r!=t[e]))throw Error(cr)}}}function Nr(t,e=0,r=1){return Object.assign({},Wr(t),{[fr]:hr+"="+(0>e?e:e+"-"+(e+r-1))})}function Wr({options:t}){const{headers:e}=t;if(e)return Symbol.iterator in e?Object.fromEntries(e):e}async function _r(t){await Br(t,Zr)}async function Lr(t){await Br(t,Hr)}async function Br(t,e){const r=await e(wr,t,Wr(t));t.data=new Uint8Array(await r.arrayBuffer()),t.size=t.data.length}async function Vr(t,e,r){if(t.preventHeadRequest)await r(t,t.options);else{const n=await e("HEAD",t,Wr(t)),a=n.headers.get("Content-Length");a&&!n.headers.get("Content-Encoding")?t.size=Number(a):await r(t,t.options)}}async function Zr(t,{fetch:e=fetch,options:r,url:n},a){const s=await e(n,Object.assign({},r,{method:t,headers:a}));if(400>s.status)return s;throw 416==s.status?Error(or):Error(ir+(s.statusText||s.status))}function Hr(t,{url:e},r){return new Promise((n,a)=>{const s=new XMLHttpRequest;if(s.addEventListener("load",()=>{if(400>s.status){const t=[];s.getAllResponseHeaders().trim().split(/[\r\n]+/).forEach(e=>{const r=e.trim().split(/\s*:\s*/);r[0]=r[0].trim().replace(/^[a-z]|-[a-z]/g,t=>t.toUpperCase()),t.push(r)}),n({status:s.status,arrayBuffer:()=>s.response,headers:new Map(t)})}else a(416==s.status?Error(or):Error(ir+(s.statusText||s.status)))},!1),s.addEventListener("error",t=>a(t.detail?t.detail.error:Error("Network error")),!1),s.open(t,e),r)for(const t of Object.entries(r))s.setRequestHeader(t[0],t[1]);s.responseType="arraybuffer",s.send()})}class qr extends Sr{constructor(t,e={}){super(),Object.assign(this,{url:t,reader:e.useXHR&&!e.fetch?new kr(t,e):new Or(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 Kr extends qr{constructor(t,e={}){super(t,Object.assign({},e,{useRangeHeader:!0}))}}class Yr extends Sr{constructor(t){super(),t=new Uint8Array(t.buffer,t.byteOffset,t.byteLength),Object.assign(this,{array:t,size:t.length})}readUint8Array(t,e){return this.array.slice(t,t+e)}}class Gr extends Er{constructor(t){super(),this.defaultBufferSize=t||262144}init(t=0){Object.assign(this,{offset:0,array:new Uint8Array(t>0?t:this.defaultBufferSize)}),super.init()}writeUint8Array(t){const e=this,r=e.offset+t.length;if(r>e.array.length){let t=e.array.length?2*e.array.length:e.defaultBufferSize;for(;r>t;)t*=2;const n=e.array;e.array=new Uint8Array(t),e.array.set(n)}e.array.set(t,e.offset),e.offset+=t.length}getData(){return this.offset===this.array.length?this.array:this.array.slice(0,this.offset)}}class Xr extends Sr{constructor(t){super(),this.jt=t}async init(){const t=this,{jt:e}=t;t.Pt=0,await Promise.all(e.map(t=>tn(t))),t.Nt=e.map(e=>{const r=t.size;return t.size+=e.size,r}),super.init()}Wt(t){const{Nt:e,size:r}=this,n=e[t];return n===F?r:n}async readUint8Array(t,e){const r=this,{jt:n}=this;let a,s=0,i=t;for(;n[s]&&i>=n[s].size;)i-=n[s].size,s++;const o=n[s];if(o){const n=o.size;if(i+e>n){const s=n-i;a=dt(await en(o,i,s),await r.readUint8Array(t+s,e-s))}else a=await en(o,i,e)}else a=O;return r.Pt=Math.max(s,r.Pt),a}}class Jr extends br{constructor(t,e=4294967295){super();const r=this;let n,a,s;Object.assign(r,{diskNumber:0,diskOffset:0,size:0,maxSize:e,availableSize:e});const i=new WritableStream({async write(e){if(e===yr)return void(s&&await c());const{availableSize:i}=r;if(s)e.length<i?await o(e):(await o(e.subarray(0,i)),await c(),e.length>i&&await this.write(e.subarray(i)));else{const{value:i,done:o}=await t.next();if(o&&!i)throw Error(lr);n=i,n.size=0,n.maxSize&&(r.maxSize=n.maxSize),r.availableSize=r.maxSize,await tn(n),a=i.writable,s=a.getWriter(),await this.write(e)}},async close(){s&&(await s.ready,await l())},async abort(t){s&&await s.abort(t)}});async function o(t){const e=t.length;e&&(await s.ready,await s.write(t),n.size+=e,r.availableSize-=e)}async function c(){await l(),r.diskOffset+=n.size,r.diskNumber++,s=null,r.availableSize=r.maxSize}async function l(){await s.close()}Object.defineProperty(r,mr,{get:()=>i})}async closeDisk(){const t=this.writable.getWriter();try{await t.ready,await t.write(yr)}finally{t.releaseLock()}}}class Qr{constructor(t){return Array.isArray(t)&&(t=new Xr(t)),(t instanceof ReadableStream||typeof t.getReader==U)&&(t={readable:se(t)}),t}}class $r{constructor(t){return t.writable===F&&typeof t.next==U&&(t=new Jr(t)),(t instanceof WritableStream||typeof t.getWriter==U)&&(t={writable:ie(t)}),t.size===F&&(t.size=0),t}}async function tn(t,e){if(!t.init||t.initialized)return Promise.resolve();await t.init(e)}function en(t,e,r){return t.readUint8Array(e,r)}const rn="\0☺☻♥♦♣♠•◘○◙♂♀♪♫☼►◄↕‼¶§▬↨↑↓→←∟↔▲▼ !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~⌂ÇüéâäàåçêëèïîìÄÅÉæÆôöòûùÿÖÜ¢£¥₧ƒáíóúñѪº¿⌐¬½¼¡«»░▒▓│┤╡╢╖╕╣║╗╝╜╛┐└┴┬├─┼╞╟╚╔╩╦╠═╬╧╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀αßΓπΣσµτΦΘΩδ∞φε∩≡±≥≤⌠⌡÷≈°∙·√ⁿ²■ ".split("");function nn(t,e){return e&&"cp437"==e.trim().toLowerCase()?(t=>{{let e="";for(let r=0;r<t.length;r++)e+=rn[t[r]];return e}})(t):new TextDecoder(e,{ignoreBOM:!0}).decode(t)}const an="filename",sn="rawFilename",on="comment",cn="rawComment",ln="uncompressedSize",dn="compressedSize",un="offset",fn="diskNumberStart",wn="lastModDate",hn="rawLastModDate",pn="lastAccessDate",mn="rawLastAccessDate",yn="creationDate",bn="rawCreationDate",Sn="internalFileAttributes",En="externalFileAttributes",gn="msdosAttributesRaw",xn="msdosAttributes",zn="msDosCompatible",Rn="zip64",Fn="encrypted",An="version",Dn="versionMadeBy",Un="zipCrypto",On="directory",kn="executable",Tn="compressionMethod",vn="signature",Cn="extraField",Mn="unixMode",In="setuid",jn="setgid",Pn="sticky",Nn=[an,sn,ln,dn,wn,hn,on,cn,pn,mn,yn,bn,un,fn,Sn,En,gn,xn,zn,Rn,Fn,An,Dn,Un,On,kn,Tn,vn,"crc32",Cn,"extraFieldUnix","extraFieldInfoZip","extraFieldUnixType1","extraFieldPkwareUnix","uid","gid",Mn,In,jn,Pn,"bitFlag","filenameUTF8","commentUTF8","rawExtraField","extraFieldZip64","extraFieldUnicodePath","extraFieldUnicodeComment","extraFieldAES","extraFieldNTFS","extraFieldExtendedTimestamp","extraFieldUSDZ"];class Wn{constructor(t){Nn.forEach(e=>this[e]=t[e])}}const _n="password",Ln="rawPassword",Bn="passThrough",Vn="signal",Zn="checkAmbiguity",Hn="useWebWorkers",qn="useCompressionStream",Kn="transferStreams",Yn="preventClose",Gn="offset",Xn="usdz",Jn="strictness",Qn="strict",$n="tolerant",ta="File format is not recognized",ea="End of central directory not found",ra="End of Zip64 central directory locator not found",na="Central directory header not found",aa="Local file header not found",sa="Zip64 extra field not found",ia="File contains encrypted entry",oa="Encryption method not supported",ca="Compression method not supported",la="Split zip file",da="Overlapping entry found",ua="Ambiguous archive",fa="Encrypted central directory is not supported",wa="utf-8",ha="cp437",pa=[[ln,t],[dn,t],[un,t],[fn,e]],ma={[e]:{_t:Va,bytes:4},[t]:{_t:Za,bytes:8}};class ya{constructor(t,e={}){Object.assign(this,{reader:new Qr(t),options:e,config:M(),Lt:new Map})}async*getEntriesGenerator(n={}){const s=this;let{reader:o}=s;const{config:f}=s;if(await tn(o),o.size!==F&&o.readUint8Array||(o=new Fr(await new Response(o.readable).blob()),await tn(o)),o.size<d)throw Error(ta);const w=Ua(Na(s,n,Jn),Na(s,n,Zn)),h=w==Qn,p=w!=$n,m=((t,r)=>t!==F?t:r==Qn?0:r==$n?1/0:e)(Na(s,n,"maxAppendedDataSize"),w),{Bt:y,Vt:x}=await(async(t,e,r)=>{const{size:n}=t,a=Math.min(n,65557),s={count:Oa};let i,o,c=0;for await(const[r,l,u,f,w]of Ca(t,a)){const a=Ba(r,f+20);if(w+d+a==n){const a=await Ia(t,r,l,f,w,n,s);if(a==va){if(i||(i=Ma(u,f,w)),c++,!e||c>1)break}else a!=Ta||o||(o=Ma(u,f,w))}}return i||(i=o),i||(i=await(async(t,e,r)=>{const{size:n}=t,a=Math.min(n,e==1/0?n:65557+e);let s,i;for await(const[e,o,c,l,d]of Ca(t,a)){const a=Ma(c,l,d);s||(s=a);const u=await Ia(t,e,o,l,d,n,r);if(u==va)return a;u!=Ta||i||(i=a)}return i||s})(t,r,s)),{Bt:i,Vt:c}})(o,p,m);if(!y)throw Va(ft(await en(o,0,4)))==a?Error(la):Error(ea);p&&x>1&&Pa("multiple end of central directory records");const z=ft(y);let R=Va(z,12),A=Va(z,16);const D=y.offset,U=Ba(z,20),k=D+d+U;o.size-k>m&&Pa("appended data");let T=Ba(z,4);const v=o.Pt||0;let C,M,I,j=Ba(z,6),P=Ba(z,10),N=0;const W=A==t||R==t||P==e||j==e;if(A!=t&&j!=e&&(A+=Da(o,j)),W){const r=y.offset<u?O:await en(o,y.offset-u,u),n=ft(r);if(r.length==u&&Va(n,0)==l){A=Da(o,Va(n,4))+Za(n,8);let r=await en(o,A,56),a=ft(r);const s=y.offset-u-56;if((56>r.length||Va(a,0)!=c)&&A!=s&&s>=0){const t=A;A=s,A>t&&(N=A-t),r=await en(o,A,56),a=ft(r)}if(56>r.length||Va(a,0)!=c)throw Error(ra);M=!0,I=Za(a,4)>44,T==e?T=Va(a,16):h&&T!=Va(a,16)&&Pa("mismatched zip64 end of central directory record"),j==e?j=Va(a,20):h&&j!=Va(a,20)&&Pa("mismatched zip64 end of central directory record"),P==e?P=Za(a,32):h&&P!=Za(a,32)&&Pa("mismatched zip64 end of central directory record"),R==t?R=Za(a,40):h&&R!=Za(a,40)&&Pa("mismatched zip64 end of central directory record"),A=Da(o,j)+Za(a,48)+N}}const _=R,L=y.offset-(M?76:0);if(A<o.size||(N=o.size-A-R-d,A=o.size-R-d),v!=T)throw Error(la);if(0>A)throw Error(ta);let B=0,V=await en(o,A,R),Z=ft(V);if(R){if(4>V.length)throw Error(ta);const t=L-R;if(A!=t&&j==T){let e=!(Va(Z,B)==i);if(e||0>t||t+4>o.size||(e=Va(ft(await en(o,t,4)),0)==i),e){const e=A;A=t,A>e&&(N+=A-e),V=await en(o,A,R),Z=ft(V)}}}const H=L-A;if(R==H||0>H||j!=T||(R=H,V=await en(o,A,R),Z=ft(V)),0>A||A>=o.size)throw Error(ta);C=A;const q=Na(s,n,"filenameEncoding"),K=Na(s,n,"commentEncoding"),Y=h?new Set:F;let G;for(let t=0;P>t;t++){const a=new Sa(o,f,s.options);if(B+46>V.length||Va(Z,B)!=i){if(0==t&&(I||Ea(Z)))throw Error(fa);throw Error(na)}ga(a,Z,B+6);const c=!!a.bitFlag.languageEncodingFlag,l=B+46,d=l+a.filenameLength,u=d+a.extraFieldLength,w=Ba(Z,B+4),p=!(w>>8),m=w>>8==3,y=V.subarray(l,d),x=Ba(Z,B+32),z=u+x,R=V.subarray(u,z),A=c,D=c,U=Va(Z,B+38),O=U&r,k={readOnly:!!(1&O),hidden:!!(2&O),system:!!(4&O),directory:!!(16&O),archive:!!(32&O)},T=Va(Z,B+42),v=Na(s,n,"decodeText")||nn,M=A?wa:q||ha,j=D?wa:K||ha;let W=v(y,M);W===F&&(W=nn(y,M));let _=v(R,j);_===F&&(_=nn(R,j)),Object.assign(a,{index:t,versionMadeBy:w,msDosCompatible:p,compressedSize:0,uncompressedSize:0,Zt:x,offset:T,diskNumberStart:Ba(Z,B+34),internalFileAttributes:Ba(Z,B+36),externalFileAttributes:U,msdosAttributesRaw:O,msdosAttributes:k,rawFilename:y,filenameUTF8:A,commentUTF8:D,rawExtraField:V.subarray(d,u),rawComment:R,filename:W,comment:_}),xa(a,a,Z,B+6),a.offset+=N,C=Math.min(Da(o,a.diskNumberStart)+a.offset,C),h&&(Y.has(a.filename)&&(G=!0),Y.add(a.filename));const L=a.externalFileAttributes>>16&e;a.unixMode===F&&16877&L&&(a.unixMode=L);const H=!!(a.unixMode&S),X=!!(a.unixMode&E),J=!!(512&a.unixMode),Q=a.unixMode!==F?!!(73&a.unixMode):m&&!!(73&L),$=a.unixMode!==F&&(61440&a.unixMode)==b,tt=(61440&L)==b;Object.assign(a,{setuid:H,setgid:X,sticky:J,unixExternalUpper:L,internalFileAttribute:a.internalFileAttributes,externalFileAttribute:a.externalFileAttributes,executable:Q,directory:$||tt||p&&k.directory||a.filename.endsWith(g)&&!a.uncompressedSize,zipCrypto:a.encrypted&&!a.extraFieldAES});const et=new Wn(a);et.getData=(t,e)=>a.getData(t,et,s.Lt,e),et.arrayBuffer=async t=>{const e=new TransformStream,[r]=await Promise.all([new Response(e.readable).arrayBuffer(),a.getData(e,et,s.Lt,t)]);return r},B=z;const{onprogress:rt}=n;if(rt)try{await rt(t+1,P,new Wn(a))}catch{}yield et}h&&B!=_&&Pa("trailing central directory data"),G&&Pa("duplicate filename"),h&&(N||P&&C>0)&&Pa("prepended data");const X=Na(s,n,"extractPrependedData"),J=Na(s,n,"extractAppendedData");return X&&(s.prependedData=C>0?await en(o,0,C):O),s.comment=U?await en(o,D+d,U):O,J&&(s.appendedData=k<o.size?await en(o,k,o.size-k):O),!0}async getEntries(t={}){const e=[];for await(const r of this.getEntriesGenerator(t))e.push(r);return e}async close(){}}class ba{constructor(t={}){const{readable:e,writable:r}=new TransformStream,n=new ya(e,t).getEntriesGenerator();this.readable=new ReadableStream({async pull(t){const{done:e,value:r}=await n.next();if(e)return t.close();const a={...r,readable:(()=>{const{readable:t,writable:e}=new TransformStream;if(r.getData)return(async()=>{try{await r.getData(e)}catch(t){try{await e.abort(t)}catch{}}})(),t})()};delete a.getData,t.enqueue(a)}}),this.writable=r}}let Sa=class{constructor(t,e,r){Object.assign(this,{reader:t,config:e,options:r})}async getData(t,e,a,i={}){const o=this,{reader:c,index:l,offset:d,diskNumberStart:u,extraFieldAES:f,extraFieldZip64:w,compressionMethod:h,config:p,bitFlag:m,rawBitFlag:y,crc32:b,rawLastModDate:S,uncompressedSize:E,compressedSize:g}=o,{dataDescriptor:z}=m,R=e.localDirectory={},A=Da(c,u)+d,D=await en(c,A,x),U=ft(D);let k=Na(o,i,_n),T=Na(o,i,Ln);const v=Na(o,i,Bn);if(k=k&&k.length&&k,T=T&&T.length&&T,f&&99!=f.originalCompressionMethod)throw Error(ca);if(D.length<x||Va(U,0)!=n)throw Error(aa);ga(R,U,4);const{extraFieldLength:C,filenameLength:M}=R,I=Ua(Na(o,i,Jn),Na(o,i,Zn))==Qn;let j=O;if(I&&(M||C)){const t=await en(c,A+x,M+C);j=t.subarray(0,M),R.rawExtraField=t.subarray(M)}else R.rawExtraField=C?await en(c,A+x+M,C):O;xa(o,R,U,4,!0),I&&((t,e,r)=>{const{rawFilename:n}=t;(r.length!=n.length||r.some((t,e)=>t!=n[e]))&&Pa("mismatched local file header (filename)"),(2057&e.rawBitFlag)!=(2057&t.rawBitFlag)&&Pa("mismatched local file header (general purpose bit flag)"),e.compressionMethod!=t.compressionMethod&&Pa("mismatched local file header (compression method)"),e.bitFlag.dataDescriptor||!(e.crc32||e.compressedSize||e.uncompressedSize)||e.crc32==t.crc32&&e.compressedSize==t.compressedSize&&e.uncompressedSize==t.uncompressedSize||Pa("mismatched local file header (crc32 or sizes)")})(o,R,j);const{lastAccessDate:P,creationDate:N}=R;P&&(e.lastAccessDate=P),N&&(e.creationDate=N);const W=o.encrypted&&R.encrypted&&!v,_=W&&!f;if(v||(e.zipCrypto=_),W&&!(64&~R.rawBitFlag))throw Error(oa);const L=v?F:G(h);if(0!=h&&8!=h&&9!=h&&!L&&!v)throw Error(ca);if(W){if(!_&&(1>f.strength||f.strength>3))throw Error(oa);if(!k&&!T)throw Error(ia)}const B=A+x+M+C,V=g,Z=se(c.createReadable({offset:B,size:V})),H=Na(o,i,Vn),q=Na(o,i,"checkPasswordOnly");let K=Na(o,i,"checkOverlappingEntry");const Y=Na(o,i,"checkOverlappingEntryOnly");Y&&(K=!0);const{onstart:X,onprogress:J,onend:Q}=i,$=9==h;let tt=Na(o,i,qn);$&&(tt=!1);const et=Na(o,i,"checkCrc32"),rt=(et===F?Na(o,i,"checkSignature"):et)&&!v&&(!W||_||f&&1==f.vendorVersion),nt={options:{codecType:Ae,password:k,rawPassword:T,zipCrypto:_,encryptionStrength:f&&f.strength,checkCrc32:rt,checkAuthenticationCode:Na(o,i,"checkAuthenticationCode"),passwordVerification:_&&(z?S>>>8&r:b>>>24&r),outputSize:v?g:E,crc32:b,compressed:0!=h&&!v,encrypted:W,useWebWorkers:Na(o,i,Hn),useCompressionStream:tt,transferStreams:Na(o,i,Kn),deflate64:$,format:L?L.format:F,codecURI:L?L.codecURI:F,compressionMethod:h,rawBitFlag:y,checkPasswordOnly:q},config:p,ut:{signal:H,size:V,onstart:X,onprogress:J,onend:Q}};let at;K&&await(async({reader:t,Ht:e,index:r,offset:n,crc32:a,compressedSize:i,uncompressedSize:o,qt:c,dataDescriptor:l,extraFieldZip64:d,Lt:u})=>{let f=0;if(l&&(f=d?20:12),f){const r=await en(t,c+i,f+4);if(r.length==f+4&&Va(ft(r),0)==s){const t=Va(ft(r),4);let n,s;d?(n=Za(ft(r),8),s=Za(ft(r),16)):(n=Va(ft(r),8),s=Va(ft(r),12)),(e.encrypted&&!e.zipCrypto||t==a)&&n==i&&s==o&&(f+=4)}}const w={start:n,end:c+i+f,Ht:e};for(const[t,e]of u)if(t!=r&&w.start<e.end&&e.start<w.end){const t=Error(da);throw t.Kt=e.Ht,t}u.set(r,w)})({reader:c,Ht:e,index:l,offset:A,crc32:b,compressedSize:g,uncompressedSize:E,qt:B,dataDescriptor:z||R.bitFlag.dataDescriptor,extraFieldZip64:w||R.extraFieldZip64,Lt:a});try{if(!Y){q&&(t=new WritableStream),t=new $r(t),await tn(t,v?g:E),({writable:at}=t);const{outputSize:e}=await tr({readable:Z,writable:at},nt);if(t.size+=e,e!=(v?g:E))throw Error(oe)}}catch(e){if(e.outputSize!==F&&(t.size+=e.outputSize),!q||e.message!=gt)throw e}finally{Na(o,i,Yn)||!at||at.locked||await at.getWriter().close()}return q||Y?F:t.getData?t.getData():at}};function Ea(t){const e=Math.min(t.byteLength,1024)-3;for(let r=0;e>r;r++)if(134630224==Va(t,r))return!0;return!1}function ga(t,e,r){const n=t.rawBitFlag=Ba(e,r+2),a=!(1&~n),s=Va(e,r+6);Object.assign(t,{encrypted:a,version:Ba(e,r),bitFlag:{level:(6&n)>>1,dataDescriptor:!(8&~n),languageEncodingFlag:(n&y)==y},rawLastModDate:s,lastModDate:Wa(s),filenameLength:Ba(e,r+22),extraFieldLength:Ba(e,r+24)})}function xa(t,e,r,n,a){const{rawExtraField:s}=e,i=e.extraField=new Map,o=ft(s);let c=0;try{for(;c<s.length;){const t=Ba(o,c),e=Ba(o,c+2);i.set(t,{type:t,data:s.slice(c+4,c+4+e)}),c+=4+e}}catch{}const l=Ba(r,n+4);Object.assign(e,{signature:Va(r,n+10),crc32:Va(r,n+10),compressedSize:Va(r,n+14),uncompressedSize:Va(r,n+18)});const d=i.get(1);d&&(((t,e)=>{e.zip64=!0;const r=ft(t.data),n=pa.filter(([t,r])=>e[t]==r),a=n.reduce((t,[,e])=>t+ma[e].bytes,0);if(t.data.length<a)throw Error(sa);for(let a=0,s=0;a<n.length;a++){const[i,o]=n[a],c=ma[o];e[i]=t[i]=c._t(r,s),s+=c.bytes}})(d,e),e.extraFieldZip64=d);const u=i.get(28789);u&&(za(u,an,sn,e,t),e.extraFieldUnicodePath=u);const y=i.get(25461);y&&(za(y,on,cn,e,t),e.extraFieldUnicodeComment=y);const b=i.get(f);b&&b.data.length>=7?(((t,e,r)=>{const n=ft(t.data),a=La(n,4);Object.assign(t,{vendorVersion:La(n,0),vendorId:La(n,2),strength:a,originalCompressionMethod:r,compressionMethod:Ba(n,5)}),e.compressionMethod=t.compressionMethod,1!=t.vendorVersion&&(e.crc32=F)})(b,e,l),e.extraFieldAES=b):e.compressionMethod=l;const S=i.get(13);S&&(Ra(S,e),e.extraFieldPkwareUnix=S);const E=i.get(22613);E&&(Ra(E,e),e.extraFieldUnixType1=E);const g=i.get(10);g&&(((t,e)=>{const r=ft(t.data);let n,a=4;try{for(;a<t.data.length&&!n;){const e=Ba(r,a),s=Ba(r,a+2);1==e&&(n=t.data.slice(a+4,a+4+s)),a+=4+s}}catch{}if(n&&24==n.length){const r=ft(n),a=r.getBigUint64(0,!0),s=r.getBigUint64(8,!0),i=r.getBigUint64(16,!0);Object.assign(t,{rawLastModDate:a,rawLastAccessDate:s,rawCreationDate:i});const o={lastModDate:_a(a),lastAccessDate:_a(s),creationDate:_a(i)};Object.assign(t,o),Object.assign(e,o)}})(g,e),e.extraFieldNTFS=g);const x=i.get(m);if(x)Fa(x,e,!1),e.extraFieldUnix=x;else{const t=i.get(p);t&&(Fa(t,e,!0),e.extraFieldInfoZip=t)}const z=i.get(w);z&&(((t,e,r)=>{if(!t.data.length)return;const n=ft(t.data),a=La(n,0),s=[],i=[];r?(1&~a||(s.push(wn),i.push(hn)),2&~a||(s.push(pn),i.push(mn)),4&~a||(s.push(yn),i.push(bn))):5>t.data.length||(s.push(wn),i.push(hn));let o=1;s.forEach((r,a)=>{if(t.data.length>=o+4){const s=Va(n,o);e[r]=t[r]=new Date(1e3*(0|s));const c=i[a];t[c]=s}o+=4})})(z,e,a),e.extraFieldExtendedTimestamp=z);const R=i.get(h);R&&(e.extraFieldUSDZ=R)}function za(t,e,r,n,a){if(5>t.data.length)return void(t.valid=!1);const s=ft(t.data),i=new ot;i.append(a[r]);const o=ft(new Uint8Array(4));o.setUint32(0,i.get(),!0);const c=Va(s,1);Object.assign(t,{version:La(s,0),[e]:nn(t.data.subarray(5)),valid:!a.bitFlag.languageEncodingFlag&&c==Va(o,0)}),t.valid&&(n[e]=t[e],n[e+"UTF8"]=!0)}function Ra(t,e){if(8>t.data.length)return;const r=ft(t.data),n={lastAccessDate:new Date(1e3*Va(r,0)),lastModDate:new Date(1e3*Va(r,4))};12>t.data.length||(n.uid=Ba(r,8),n.gid=Ba(r,10)),Object.assign(t,n),Object.assign(e,n)}function Fa(t,e,r){try{const n=ft(t.data);let a,s;if(r){let e=0;const r=La(n,e++),i=La(n,e++);a=Aa(t.data.subarray(e,e+i)),e+=i;const o=La(n,e++);s=Aa(t.data.subarray(e,e+o)),Object.assign(t,{version:r,uid:a,gid:s})}else 4>t.data.length||(a=Ba(n,0),s=Ba(n,2),Object.assign(t,{uid:a,gid:s}));a!==F&&(e.uid=a),s!==F&&(e.gid=s)}catch{}}function Aa(t){const e=new Uint8Array(4);return e.set(t,0),new DataView(e.buffer,e.byteOffset,4).getUint32(0,!0)}function Da(t,e){return t.Wt?t.Wt(e):0}function Ua(t,e){return t===F?e?Qn:"balanced":t}const Oa=64,ka=0,Ta=1,va=2;async function*Ca(t,e){const r=t.size-e,n=await en(t,r,e),a=ft(n);for(let t=n.length-d;t>=0;t--)Va(a,t)==o&&(yield[a,r,n,t,r+t])}function Ma(t,e,r){return{offset:r,buffer:t.slice(e,e+d).buffer}}async function Ia(r,n,a,s,o,c,d){const f=Ba(n,s+10),w=Va(n,s+12),h=Va(n,s+16);if(f==e||w==t||h==t)return await ja(r,n,a,o-u,c,d)==l?va:ka;if(!f&&!w)return Ta;const p=Ba(n,s+6);for(const t of[o-w,Da(r,p)+h])if(await ja(r,n,a,t,c,d)==i)return va;return ka}async function ja(t,e,r,n,a,s){return 0>n||n+4>a?F:r>n?s.count>0?(s.count--,Va(ft(await en(t,n,4)),0)):F:Va(e,n-r)}function Pa(t){const e=Error(ua);throw e.reason=t,e}function Na(t,e,r){return e[r]===F?t.options[r]:e[r]}function Wa(t){const r=(4294901760&t)>>16,n=t&e;return new Date(1980+((65024&r)>>9),((480&r)>>5)-1,31&r,(63488&n)>>11,(2016&n)>>5,2*(31&n),0)}function _a(t){return new Date(Number(t/BigInt(1e4)-BigInt(116444736e5)))}function La(t,e){return t.getUint8(e)}function Ba(t,e){return t.getUint16(e,!0)}function Va(t,e){return t.getUint32(e,!0)}function Za(t,e){return Number(t.getBigUint64(e,!0))}var Ha=Object.freeze({__proto__:null,ERR_AMBIGUOUS_ARCHIVE:ua,ERR_BAD_FORMAT:ta,ERR_CENTRAL_DIRECTORY_NOT_FOUND:na,ERR_ENCRYPTED:ia,ERR_ENCRYPTED_CENTRAL_DIRECTORY:fa,ERR_EOCDR_LOCATOR_ZIP64_NOT_FOUND:ra,ERR_EOCDR_NOT_FOUND:ea,ERR_EXTRAFIELD_ZIP64_NOT_FOUND:sa,ERR_INVALID_AUTHENTICATION_CODE:Et,ERR_INVALID_COMPRESSED_DATA:ce,ERR_INVALID_CRC32:le,ERR_INVALID_PASSWORD:bt,ERR_INVALID_SIGNATURE:St,ERR_INVALID_UNCOMPRESSED_SIZE:oe,ERR_LOCAL_FILE_HEADER_NOT_FOUND:aa,ERR_OVERLAPPING_ENTRY:da,ERR_SPLIT_ZIP_FILE:la,ERR_UNSUPPORTED_COMPRESSION:ca,ERR_UNSUPPORTED_ENCRYPTION:oa,ZipReader:ya,ZipReaderStream:ba});const qa="File already exists",Ka="Zip file comment exceeds 64KB",Ya="File entry comment exceeds 64KB",Ga="File entry name exceeds 64KB",Xa="Version exceeds 65535",Ja="The strength must equal 1, 2, or 3",Qa="Encryption is not supported in USDZ files",$a="Extra field type exceeds 65535",ts="Extra field data exceeds 64KB",es=-2147483648,rs=2147483647,ns=BigInt(0),as=BigInt("0x7fffffffffffffff"),ss="Zip64 is not supported (set the 'zip64' option to 'true')",is="Undefined uncompressed size",os="Undefined reader",cs="Zip file not empty",ls=new Uint8Array([7,0,2,0,65,69,3,0,0]),ds="infozip",us="unix";let fs=0;const ws=[];class hs{constructor(t,e={}){t=new $r(t);const{availableSize:r=A,maxSize:n=A}=t;Object.assign(this,{writer:t,Yt:r>0&&r!==A&&n>0&&n!==A,options:e,config:M(),files:new Map,Gt:new Set,offset:e[Gn]===F?t.size||t.writable.size||0:e[Gn],Xt:e[Gn]===F?0:e[Gn]-(t.size||t.writable.size||0),Jt:new Set,Qt:0,$t:F})}async prependZip(e){if(this.Gt.size)throw Error(cs);e=new Qr(e),await tn(e);const{ZipReader:r}=await Promise.resolve().then(()=>Ha),n=new r(e.readable),a=await n.getEntries();await n.close(),await tn(this.writer),await e.readable.pipeTo(this.writer.writable,{preventClose:!0,preventAbort:!0}),this.writer.size=this.offset=e.size,this.Gt=new Set(a.map(t=>t.filename)),this.files=new Map(a.map(e=>{const{version:r,rawLastModDate:n,lastAccessDate:a,creationDate:s,rawFilename:i,bitFlag:o,encrypted:c,uncompressedSize:l,compressedSize:d,zip64:u}=e;let{compressionMethod:f,te:w,ee:h,re:p,ne:m,ae:y,rawExtraField:b}=e;const{level:S,languageEncodingFlag:E,dataDescriptor:g}=o;w=w||O,h=h||O,p=p||O,m=m||O,y=y||O,b=b||O,e.extraFieldAES&&(f=99);const x=js(w,h,p,m,y,b),z=u&&l>=t,R=u&&d>=t,A=-7&Ns(S,E,g,c,f)|S<<1,{se:D,ie:U}=Ps({version:r,bitFlag:A,compressionMethod:f,uncompressedSize:l,compressedSize:d,rawLastModDate:n,rawFilename:i,oe:R,ce:z,extraFieldLength:x}),{crc32:k}=e;return k!==F&&Cs(U,10,k),Object.assign(e,{ce:z,oe:R,le:u&&e.offset>=t,diskNumberStart:0,de:!1,te:w,ee:h,re:p,ne:m,ae:y,rawExtraField:b,extendedTimestamp:p.length>0||m.length>0,ue:1+(a?2:0)+(s?4:0),se:D,ie:U}),[e.filename,e]}))}async add(i="",o,c={}){const l=this;c=Object.assign({},c);const{Jt:d,config:u}=l;let h,y;fs<u.maxWorkers?fs++:await new Promise(t=>ws.push(t));try{if(i=i.trim(),ks(l,c,On)&&!i.endsWith(g)&&(i+=g),l.Gt.has(i))throw Error(qa);return l.Gt.add(i),y=!0,h=(async(i,o,c,l)=>{const d=((n,a,s)=>{a=a.trim();let i=ks(n,s,zn),o=ks(n,s,Dn,i?20:768);const c=ks(n,s,kn),l=ks(n,s,"uid"),d=ks(n,s,"gid");let u=ks(n,s,Mn),f=ks(n,s,"unixExtraFieldType"),w=ks(n,s,In),h=ks(n,s,jn),p=ks(n,s,Pn);if(l!==F&&(0>l||l>t))throw Error("Invalid uid (must be integer 0..2^32-1)");if(d!==F&&(0>d||d>t))throw Error("Invalid gid (must be integer 0..2^32-1)");if(u!==F&&(0>u||u>e))throw Error("Invalid UNIX mode (must be integer 0..65535)");if(f!==F&&f!==ds&&f!==us)throw Error("Invalid unixExtraFieldType (must be 'infozip' or 'unix')");if(f===us&&(l!==F&&l>e||d!==F&&d>e))throw Error("uid/gid must be 0..65535 for unixExtraFieldType 'unix' (use 'infozip' for larger ids)");f!==F||l===F&&d===F||(f=ds);let m=ks(n,s,gn),y=ks(n,s,xn);const x=m!==F||y!==F;if(l!==F||d!==F||u!==F||f?(i=!1,o=o&e|768):x&&(i=!0,o&=r),m!==F&&(0>m||m>r))throw Error("Invalid msdosAttributesRaw (must be integer 0..255)");if(y&&"object"!=typeof y)throw Error("Invalid msdosAttributes (must be an object with boolean flags)");if(o>e)throw Error(Xa);let z=ks(n,s,En);const R=z!==F;R||(z=0),!s[On]&&a.endsWith(g)&&(s[On]=!0);const A=ks(n,s,On);let D;if(A?(a.endsWith(g)||(a+=g),R||(z=16,i||(z|=16877<<16))):i||R||(z=c?493<<16:27525120),!i){const t=u!==F||!!(w||h||p);D=z>>16&e,u=u===F?D:u&e,w?u|=S:w=!!(u&S),h?u|=E:h=!!(u&E),p?u|=512:p=!!(512&u),R&&!t||(A&&(u|=b),z=(u&e)<<16|z&e)}return({msdosAttributesRaw:m,msdosAttributes:y}=((t,e)=>{if(t!==F)t&=r;else if(e!==F){const{readOnly:n,hidden:a,system:s,directory:i,archive:o}=e;let c=0;n&&(c|=1),a&&(c|=2),s&&(c|=4),i&&(c|=16),o&&(c|=32),t=c&r}return e===F&&(e={readOnly:!!(1&t),hidden:!!(2&t),system:!!(4&t),directory:!!(16&t),archive:!!(32&t)}),{msdosAttributesRaw:t,msdosAttributes:e}})(m,y)),x&&(z=z&t|m&r),{name:a,fe:{versionMadeBy:o,msDosCompatible:i,externalFileAttributes:z,unixExternalUpper:D,uid:l,gid:d,unixMode:u,unixExtraFieldType:f,setuid:w,setgid:h,sticky:p,msdosAttributesRaw:m,msdosAttributes:y}}})(i,o,l);({name:o}=d);const u=((t,r,n)=>{const a=ks(t,n,"encodeText",lt);let s=a(r);if(s===F&&(s=lt(r)),js(s)>e)throw Error(Ga);const i=n[on]||"";let o=a(i);if(o===F&&(o=lt(i)),js(o)>e)throw Error(Ya);const c=ks(t,n,An,20);if(c>e)throw Error(Xa);const l=ks(t,n,wn,new Date),d=ks(t,n,pn),u=ks(t,n,yn),f=ks(t,n,Sn,0),w=ks(t,n,Bn);let h,p;w||(h=ks(t,n,_n),p=ks(t,n,Ln));const m=ks(t,n,"encryptionStrength",3),y=ks(t,n,Un),b=ks(t,n,"extendedTimestamp",!0),S=ks(t,n,"ntfsTimestamp"),E=ks(t,n,"keepOrder",!0),g=ks(t,n,Hn),x=ks(t,n,Kn),z=ks(t,n,"bufferedWrite"),R=ks(t,n,"createTempStream"),A=ks(t,n,"dataDescriptorSignature",!0),D=ks(t,n,Vn),U=ks(t,n,"useUnicodeFileNames",!0),O=ks(t,n,Tn),k=w||O===F?F:G(O);if(!w&&O!==F&&0!==O&&8!==O&&!k)throw Error("Compression method not supported");let T=ks(t,n,"level");if(t.options[Xn]){if(h!==F||p!==F)throw Error(Qa);T===F&&O===F&&(T=0)}let v=ks(t,n,qn),C=ks(t,n,"dataDescriptor");z&&C===F&&(C=!1),(C===F||y)&&(C=!0),T!==F&&6!=T&&(v=!1);const M=ks(t,n,Rn);if(!y&&(h!==F||p!==F)&&(1>m||m>3))throw Error(Ja);const I=ys(n[Cn]),j=ys(n.localExtraField);return{comment:i,fe:{rawFilename:s,rawComment:o,version:c,lastModDate:l,lastAccessDate:d,creationDate:u,internalFileAttributes:f,passThrough:w,password:h,rawPassword:p,encryptionStrength:m,zipCrypto:y,extendedTimestamp:b,ntfsTimestamp:S,keepOrder:E,useWebWorkers:g,transferStreams:x,bufferedWrite:z,createTempStream:R,dataDescriptorSignature:A,signal:D,useUnicodeFileNames:U,compressionMethod:O,format:k?k.format:F,codecURI:k?k.codecURI:F,we:k?k.versionNeeded:F,level:T,useCompressionStream:v,dataDescriptor:C,zip64:M,rawExtraField:I,he:j}}})(i,o,l),{comment:h}=u,y=l[Cn];let D;i.files.set(o,F);try{const{fe:h}=u;0==h.level||h.compressionMethod!==F||h.passThrough||await(async t=>{const{CompressionStream:e,CompressionStreamFallback:r}=t;if(r&&!r.Dt)return!0;if(be(e)||ye(e,ue))return!0;if(r)try{return await Pe(t),!0}catch{return!1}return!1})(i.config)||(h.level=0);const y=await(async(e,r,{fe:n},a)=>{const{passThrough:s,zipCrypto:i,password:o,rawPassword:c,encryptionStrength:l}=n;let{dataDescriptor:d,zip64:u,level:f,compressionMethod:w}=n,h=0,p=0;if(s){if(!r)throw Error(os);if(p=a[ln],p===F)throw Error(is)}const m=!0===u,y=ks(e,a,Fn),b=!!r&&(!!(o&&js(o)||c&&js(c))||s&&y);r||(f=0,w=0);const S=b?i?12:16+4*l:0;r&&(r=new Qr(r),await tn(r),s?(a.uncompressedSize=p,h=Ts(p)+S):r.size===F?(d=!0,(u||u===F)&&(u=!0,p=h=4294967296)):(a.uncompressedSize=p=r.size,h=Ts(p)+S));const E=m||p>=t,g=m||h>=t;if(E||g){if(!1===u)throw Error(ss);u=!0}return u=u||!1,{reader:r,fe:{dataDescriptor:d,zip64:u,ce:E,oe:g,uncompressedSize:p,level:f,compressionMethod:w,encrypted:b}}})(i,c,u,l);({reader:c}=y);const b=xs(i.writer),S=gs(i.writer),E=(t=>{const{rawFilename:r,lastModDate:a,lastAccessDate:s,creationDate:i,level:o,zip64:c,zipCrypto:l,useUnicodeFileNames:d,dataDescriptor:u,directory:h,rawExtraField:y,he:b,encryptionStrength:S,extendedTimestamp:E,ntfsTimestamp:g,passThrough:A,encrypted:D,ce:U,oe:k,uncompressedSize:T,crc32:v}=t;let{version:C,compressionMethod:M}=t;const I=!h&&(M===F?o===F||o>0:0!==M);let j;const P=A||!I,N=c&&(t.bufferedWrite||!u||!U&&!k||P),W=N||c&&u&&(U||k);if(c&&(U||k)){const t=20,e=Es(t);if(e.uint16(1),e.uint16(t-4),j=e.array,N&&(e.pe(T),P)){const t=D?l?12:16+4*S:0;e.pe(A?0:T+t)}}else j=O;let _,L,B,V,Z;if(D&&!l){const t=Es(js(ls)+2);t.uint16(f),t.bytes(ls),_=t.array,_[8]=S}else _=O;if(E){const t=Ds(a),e=Us(t);if(e){const e=9+(s?4:0)+(i?4:0),r=Es(e);V=1+(s?2:0)+(i?4:0),r.uint16(w),r.uint16(e-4),r.uint8(V),r.uint32(t),s&&r.uint32(Os(Ds(s))),i&&r.uint32(Os(Ds(i))),B=r.array}else B=O;if(g===F?!e||s||i:g)try{const t=As(a),e=Es(36);e.uint16(10),e.uint16(32),e.me(4),e.uint16(1),e.uint16(24),e.pe(t),e.pe(s?As(s):t),e.pe(i?As(i):t),L=e.array}catch{L=O}else L=O}else L=B=O;try{const{uid:r,gid:n,unixExtraFieldType:a}=t;if(a!=ds||r===F&&n===F)if(a!=us||r===F&&n===F)Z=O;else{const t=Es(8);t.uint16(m),t.uint16(4),t.uint16((r===F?0:r)&e),t.uint16((n===F?0:n)&e),Z=t.array}else{const t=Ss(r),e=Ss(n),a=3+t.length+e.length,s=Es(4+a);s.uint16(p),s.uint16(a),s.uint8(1),s.uint8(t.length),s.bytes(t),s.uint8(e.length),s.bytes(e),Z=s.array}}catch{Z=O}M===F&&(M=I?8:0);const{we:H}=t;I&&H!==F&&(C=C>H?C:H),c&&(C=C>45?C:45),D&&!l&&(C=C>51?C:51,A&&v!==F&&(_[4]=1),_[9]=M,M=99);const q=W?js(j):0,K=q+js(_,B,L,Z,y,b);if(K>e)throw Error(ts);const Y=new Date(2e3*Math.ceil(Math.floor(a.getTime()/1e3)/2)),{se:G,ie:X,rawLastModDate:J}=Ps({version:C,bitFlag:Ns(o,d,u,D,M),compressionMethod:M,uncompressedSize:T,lastModDate:R>Y?R:Y>z?z:Y,rawFilename:r,oe:k,ce:U,extraFieldLength:K}),Q=Es(x+js(r)+K),$=Q.array,tt=ft($);return Q.uint32(n),Q.bytes(G),Q.bytes(r),W&&Q.bytes(j),Q.bytes(_),Q.bytes(B),Q.bytes(L),Q.bytes(Z),Q.bytes(y),Q.bytes(b),u&&(k||Cs(tt,18,0),U||Cs(tt,22,0)),{ye:$,be:tt,se:G,ie:X,lastModDate:a,rawLastModDate:J,encrypted:D,compressed:I,version:C,compressionMethod:M,ue:V,te:O,Se:q,re:B,ne:L,ae:Z,ee:_,extraFieldLength:K}})(l=Object.assign({},l,d.fe,u.fe,y.fe,{internalFileAttribute:u.fe.internalFileAttributes,externalFileAttribute:d.fe.externalFileAttributes,signature:l[vn],crc32:l.crc32===F?l[vn]:l.crc32,offset:i.offset-b,diskNumberStart:S})),g=(({zip64:t,dataDescriptor:e,dataDescriptorSignature:r})=>{let n,a=O,i=0,o=t?20:12;return r&&(o+=4),e&&(a=new Uint8Array(o),n=ft(a),r&&(i=4,Cs(n,0,s))),{Ee:a,ge:n,xe:i}})(l),U=js(E.ye,g.Ee);D=await(async(e,n,s,i,o)=>{const{files:c,writer:l}=e,{keepOrder:d,dataDescriptor:u,signal:f}=o,{ze:w}=i,h=e.options[Xn],p=e.$t;let m,y,b,S,E,g,z,R={},D=0;c.set(n,R),e.$t=R;try{let y;d&&(y=p&&p.lock,R.lock=new Promise(t=>b=t)),o.bufferedWrite||!d||e.Re||e.Qt||!u?(m=!0,e.Qt++,z=o.createTempStream?await o.createTempStream():new TransformStream(F,F,{highWaterMark:A}),z.size=0,await tn(l)):(z=l,await U()),await tn(z);const k=xs(l);if(e.Yt){delete e.Yt;const t=new Uint8Array(4);Cs(ft(t),0,a),await Fs(l,t),e.offset+=4}h&&!m&&bs(i,e.offset-k);const{ye:T}=w;m||(await y,await O());const v=gs(l),C=Rs(e,l);if(R.diskNumberStart=v,m||(E=!0,g=l.size,await Fs(z,T)),R=await(async(e,n,{diskNumberStart:a,lock:s},i,o,c)=>{const{ze:l,Fe:d,Ae:u}=i,{se:f,ie:w,lastModDate:h,rawLastModDate:p,encrypted:m,compressed:y,version:b,compressionMethod:S,te:E,Se:g,re:x,ue:z,ne:R,ae:A,ee:D}=l,{Ee:U}=d,{rawFilename:O,lastAccessDate:k,creationDate:T,password:v,rawPassword:C,level:M,zip64:I,ce:j,oe:P,zipCrypto:N,dataDescriptor:W,directory:_,executable:L,versionMadeBy:B,rawComment:V,rawExtraField:Z,useWebWorkers:H,transferStreams:q,onstart:K,onprogress:Y,onend:G,signal:X,encryptionStrength:J,extendedTimestamp:Q,msDosCompatible:$,internalFileAttributes:tt,externalFileAttributes:et,uid:rt,gid:nt,unixMode:at,setuid:st,setgid:it,sticky:ot,unixExternalUpper:ct,msdosAttributesRaw:lt,msdosAttributes:dt,useCompressionStream:ut,passThrough:ft,format:wt,codecURI:ht}=c,pt={lock:s,versionMadeBy:B,zip64:I,directory:!!_,executable:!!L,filenameUTF8:!0,rawFilename:O,commentUTF8:!0,rawComment:V,te:E,Se:g,re:x,ne:R,ae:A,ee:D,rawExtraField:Z,extendedTimestamp:Q,msDosCompatible:$,internalFileAttributes:tt,externalFileAttributes:et,diskNumberStart:a,uid:rt,gid:nt,unixMode:at,setuid:st,setgid:it,sticky:ot,unixExternalUpper:ct,msdosAttributesRaw:lt,msdosAttributes:dt};let{crc32:mt,uncompressedSize:yt}=c,bt=0;ft||(yt=0);const{writable:St}=n;if(e){const a=se(e.createReadable?e.createReadable():e.readable),s=e.size,i={options:{codecType:Fe,level:M,rawPassword:C,password:v,encryptionStrength:J,zipCrypto:m&&N,passwordVerification:m&&N&&p>>8&r,computeCrc32:!ft,compressed:y&&!ft,encrypted:m&&!ft,useWebWorkers:H,useCompressionStream:ut,transferStreams:q,format:wt,codecURI:ht,compressionMethod:S},config:o,ut:{signal:X,size:s,onstart:K,onprogress:Y,onend:G}};try{const e=await tr({readable:a,writable:St},i);if(bt=e.outputSize,n.size+=bt,ft||(yt=e.inputSize,m&&!N||(mt=e.crc32)),!P&&bt>=t||!j&&yt>=t)throw Error(ss)}catch(t){throw t.outputSize!==F&&(n.size+=t.outputSize),t}}return(({crc32:t,compressedSize:e,uncompressedSize:r,ze:n,Fe:a},{zip64:s,zipCrypto:i,passThrough:o,dataDescriptor:c})=>{const{ie:l,encrypted:d}=n,{ge:u,xe:f}=a;d&&!i&&!o||t===F||(Cs(l,10,t),c&&Cs(u,f,t)),s?c&&(Ms(u,f+4,BigInt(e)),Ms(u,f+12,BigInt(r))):(Cs(l,14,e),Cs(l,18,r),c&&(Cs(u,f+4,e),Cs(u,f+8,r)))})({crc32:mt,compressedSize:bt,uncompressedSize:yt,ze:l,Fe:d},c),W&&await Fs(n,U),Object.assign(pt,{uncompressedSize:yt,compressedSize:bt,lastModDate:h,rawLastModDate:p,creationDate:T,lastAccessDate:k,encrypted:m,zipCrypto:N,size:u+bt,compressionMethod:S,version:b,se:f,ie:w,signature:mt,crc32:!m||N||ft?mt:F,ue:z,ce:j,oe:P}),pt})(s,z,R,i,e.config,o),m||(E=!1),c.set(n,R),R.filename=n,m){if(await Promise.all([z.writable.getWriter().close(),y]),await U(),S=!0,g=l.size,await O(),R.diskNumberStart=gs(l),R.offset=Rs(e,l),h){const t=i.Ae;bs(i,e.offset-xs(l)),R.size+=i.Ae-t}(({rawFilename:t,encrypted:e,zip64:r,Se:n,crc32:a,compressedSize:s,uncompressedSize:i,ce:o,oe:c},l,{dataDescriptor:d,passThrough:u})=>{if(d||((!e||u&&a!==F)&&Cs(l,14,a),c||Cs(l,18,s),o||Cs(l,22,i)),r&&n){const e=x+js(t)+4;Ms(l,e,BigInt(i)),Ms(l,e+8,BigInt(s))}})(R,w.be,o),await Fs(l,w.ye),await(async(t,e,r)=>{const n=e.writable.getWriter();try{await t.pipeTo(new WritableStream({async write(t){var e;await n.ready,await n.write(t),e=js(t),D+=e}}),{preventClose:!0,preventAbort:!0,signal:r})}finally{n.releaseLock()}})(z.readable,l,f),l.size+=z.size,S=!1}else R.diskNumberStart=v,R.offset=C;return e.offset+=R.size,R}catch(t){if(S||E){if(e.hasCorruptedEntries=!0,t)try{t.corruptedEntry=!0}catch{}e.offset+=l.size-g,m&&(e.offset+=D)}throw c.delete(n),t}finally{if(m&&e.Qt--,b&&b(),y&&y(),m&&z&&z.dispose)try{await z.dispose()}catch{}}async function U(){e.Re=!0;const{De:t}=e;e.De=new Promise(t=>y=()=>{e.Re=!1,t()}),await t}async function O(){zs(l,js(w.ye))&&await l.closeDisk()}})(i,o,c,{ze:E,Fe:g,Ae:U},l)}catch(t){throw i.files.delete(o),t}return Object.assign(D,{name:o,comment:h,extraField:y}),new Wn(D)})(l,i,o,c),d.add(h),await h}catch(t){throw y&&l.Gt.delete(i),t}finally{d.delete(h);const t=ws.shift();t?t():fs--}}remove(t){const{Gt:e,files:r}=this;if("string"==typeof t&&(t=r.get(t)),t&&t.filename!==F){const{filename:n}=t;if(e.has(n)&&r.has(n))return e.delete(n),r.delete(n),!0}return!1}async close(r=O,n={}){const{Jt:a,writer:s}=this,{writable:u}=s;if(js(r)>e)throw Error(Ka);for(;a.size;)await Promise.allSettled(Array.from(a));return await(async(r,n,a)=>{const s=(r=>{let n=0;for(const[,a]of r){const{rawFilename:r,ee:s,rawComment:i,ne:o,ae:c,rawExtraField:l,extendedTimestamp:d,ue:u,lastModDate:f,ce:h,oe:p,uncompressedSize:m,compressedSize:y}=a,b=a.offset>=t,S=a.diskNumberStart>=e;let E,g;if(b||S||h||p){const t=4+(h?8:0)+(p?8:0)+(b?8:0)+(S?4:0),e=Es(t);e.uint16(1),e.uint16(t-4),h&&e.pe(m),p&&e.pe(y),b&&e.pe(a.offset),S&&e.uint32(a.diskNumberStart),E=e.array}else E=O;a.te=E,a.le=b,a.de=S;const x=Ds(f);if(d&&Us(x)){const t=Es(9);t.uint16(w),t.uint16(5),t.uint8(u),t.uint32(x),g=t.array}else g=O;a.re=g;const z=js(E,s,o,c,g,l);if(z>e)throw Error(ts);n+=46+js(r,i)+z}return n})(r.files),u=await(async(r,n,a)=>{const{files:s,writer:o}=r,c=new Uint8Array(n);await tn(o);let l=0,d=0,u=gs(o),f=xs(o);for(const[r,n]of Array.from(s.values()).entries()){const{offset:w,rawFilename:h,te:p,ee:m,re:y,ne:b,ae:S,rawExtraField:E,rawComment:g,versionMadeBy:x,se:z,ie:R,ce:F,oe:A,de:D,le:U,internalFileAttributes:O,externalFileAttributes:k,diskNumberStart:T,uncompressedSize:v,compressedSize:C}=n,M=js(p,m,y,b,S,E),I=46+js(h,g)+M;zs(o,l+I-d)&&(await Fs(o,c.slice(d,l)),d=l,await o.closeDisk()),0==r&&(u=gs(o),f=xs(o)),F||Cs(R,18,v),A||Cs(R,14,C),(U||D)&&45>n.version&&vs(R,0,45);const j=Es(I);if(j.uint32(i),j.uint16(x),j.bytes(z.subarray(0,24)),j.uint16(M),j.uint16(js(g)),j.uint16(D?e:T),j.uint16(O),j.uint32(k),j.uint32(U?t:w),j.bytes(h),j.bytes(p),j.bytes(m),j.bytes(y),j.bytes(b),j.bytes(S),j.bytes(E),j.bytes(g),Is(c,j.array,l),l+=I,a.onprogress)try{await a.onprogress(r+1,s.size,new Wn(n))}catch{}}return await Fs(o,d?c.slice(d):c),{diskNumber:u,diskOffset:f}})(r,s,a);await(async(r,n,a,s)=>{const{writer:i}=r,{Ue:u}=s;let{Oe:f}=s,w=r.files.size,h=u.diskNumber,p=Rs(r,u),m=gs(i);zs(i,d)&&m++;let y=ks(r,a,Rn);if(!(t>p&&t>f&&e>w&&e>m)){if(!1===y)throw Error(ss);y=!0}const b=js(n);if(b>e)throw Error(Ka);const S=Es(y?98:d);zs(i,js(S.array)+b)&&await i.closeDisk(),m=gs(i),y&&(S.uint32(c),S.pe(44),S.uint16(45),S.uint16(45),S.uint32(m),S.uint32(h),S.pe(w),S.pe(w),S.pe(f),S.pe(p),S.uint32(l),S.uint32(m),S.pe(BigInt(Rs(r,i))+BigInt(f)),S.uint32(m+1),ks(r,a,"supportZip64SplitFile",!0)&&(m=e,h=e),w=e,p=t,f=t),S.uint32(o),S.uint16(m),S.uint16(h),S.uint16(w),S.uint16(w),S.uint32(f),S.uint32(p),S.uint16(b),await Fs(i,S.array),b&&await Fs(i,n)})(r,n,a,{Ue:u,Oe:s})})(this,r,n),ks(this,n,Yn)||await u.getWriter().close(),s.getData?s.getData():u}}class ps{constructor(t={}){const{readable:e,writable:r}=new TransformStream;this.readable=e,this.zipWriter=new hs(r,t),this.Jt=new Set}transform(t){const e=this.zipWriter;let r;const{readable:n,writable:a}=new TransformStream({start(t){r=t},flush:()=>{(async()=>{try{await e.close()}catch(t){try{await e.writer.writable.abort(t)}catch{}}})()}});return ms(this,this.zipWriter.add(t,n),t=>r.error(t)),{readable:this.readable,writable:a}}writable(t){let e;const{readable:r,writable:n}=new TransformStream({start(t){e=t}});return ms(this,this.zipWriter.add(t,r),t=>e.error(t)),n}async close(t,e={}){return await Promise.all(Array.from(this.Jt)),this.zipWriter.close(t,e)}}function ms(t,e,r){t.Jt.add(e),e.catch(t=>{try{r(t)}catch{}})}function ys(t){if(!t)return O;let r=0,n=0;t.forEach(t=>r+=4+js(t));const a=new Uint8Array(r),s=ft(a);return t.forEach((t,r)=>{if(r>e)throw Error($a);if(js(t)>e)throw Error(ts);vs(s,n,r),vs(s,n+2,js(t)),Is(a,t,n+4),n+=4+js(t)}),a}function bs(t,e){const{ze:r}=t;let{ye:n,extraFieldLength:a}=r,s=64-(e+js(n))%64;4>s&&(s+=64);const i=new Uint8Array(s),o=ft(i);vs(o,0,h),vs(o,2,s-4);const c=n;r.ye=n=new Uint8Array(js(c)+s),Is(n,c),Is(n,i,js(c));const l=ft(n);vs(l,28,a+s),r.be=l,t.Ae+=s}function Ss(t){if(t===F)return O;{const e=new Uint8Array(4);ft(e).setUint32(0,t,!0);let r=4;for(;r>1&&0===e[r-1];)r--;return e.subarray(0,r)}}function Es(t){const e=new Uint8Array(t),r=ft(e);let n=0;return{array:e,uint8:t=>{((t,e,r)=>{t.setUint8(e,r)})(r,n,t),n+=1},uint16:t=>{vs(r,n,t),n+=2},uint32:t=>{Cs(r,n,t),n+=4},pe:t=>{Ms(r,n,BigInt(t)),n+=8},bytes:t=>{Is(e,t,n),n+=js(t)},me:t=>n+=t}}function gs(t){const{diskNumber:e=0}=t;return e}function xs(t){const{diskOffset:e=0}=t;return e}function zs(t,e){const{availableSize:r=A}=t;return e>r}function Rs(t,{diskNumber:e=0,diskOffset:r=0}){return t.offset-r-(e?t.Xt:0)}async function Fs(t,e){const{writable:r}=t,n=r.getWriter();try{await n.ready,t.size+=js(e),await n.write(e)}finally{n.releaseLock()}}function As(t){if(t){const e=(BigInt(t.getTime())+BigInt(116444736e5))*BigInt(1e4);return ns>e?ns:e>as?as:e}}function Ds(t){return Math.floor(t.getTime()/1e3)}function Us(t){return t>=es&&rs>=t}function Os(t){return Math.min(rs,Math.max(es,t))}function ks(t,e,r,n){const a=e[r]===F?t.options[r]:e[r];return a===F?n:a}function Ts(t){return t+5*(Math.floor(t/16383)+1)}function vs(t,e,r){t.setUint16(e,r,!0)}function Cs(t,e,r){t.setUint32(e,r,!0)}function Ms(t,e,r){t.setBigUint64(e,r,!0)}function Is(t,e,r){t.set(e,r)}function js(...t){let e=0;return t.forEach(t=>t&&(e+=t.length)),e}function Ps({version:e,bitFlag:r,compressionMethod:n,uncompressedSize:a,compressedSize:s,lastModDate:i,rawLastModDate:o,rawFilename:c,oe:l,ce:d,extraFieldLength:u}){const f=Es(26),w=f.array,h=ft(w);if(f.uint16(e),f.uint16(r),f.uint16(n),o===F){const t=new Uint32Array(1),e=ft(t);vs(e,0,(i.getHours()<<6|i.getMinutes())<<5|i.getSeconds()/2),vs(e,2,(i.getFullYear()-1980<<4|i.getMonth()+1)<<5|i.getDate()),o=t[0]}return f.uint32(o),f.me(4),l||s!==F?f.uint32(l?t:s):f.me(4),d||a!==F?f.uint32(d?t:a):f.me(4),f.uint16(js(c)),f.uint16(u),{se:w,ie:h,rawLastModDate:o}}function Ns(t,e,r,n,a){let s=0;return e&&(s|=y),r&&(s|=8),8!=a&&9!=a||(0>t||t>3||(s|=6),t>3&&5>=t&&(s|=4),9==t&&(s|=2)),n&&(s|=1),s}function Ws(){return"application/octet-stream"}const _s=1048576,Ls=".zip.js-temp";function Bs(t={}){const{thresholdBytes:e=_s,directoryName:r=Ls,getDirectory:n=()=>navigator.storage.getDirectory()}=t;let a;function s(){return a||(a=Promise.resolve(n()).then(t=>t.getDirectoryHandle(r,{create:!0}))),a}return()=>{const t=[];let r,n,a,i,o=0,c=!1;const l=new WritableStream({async write(i){c?await a.write(i):(t.push(i),o+=i.length,o>e&&await(async()=>{const e=await s();r=crypto.randomUUID(),n=await e.getFileHandle(r,{create:!0}),a=(await n.createWritable()).getWriter(),c=!0;for(const e of t)await a.write(e);t.length=0})())},async close(){a&&(await a.close(),a=null)}});let d=0;return{writable:l,readable:new ReadableStream({async pull(e){if(c){if(!i){const t=await n.getFile();i=t.stream().getReader()}const{value:t,done:r}=await i.read();r?e.close():e.enqueue(t)}else d<t.length?e.enqueue(t[d++]):e.close()},async cancel(t){i&&await i.cancel(t)}},{highWaterMark:0}),dispose:async()=>{if(a){try{await a.close()}catch{}a=null}if(r){try{const t=await s();await t.removeEntry(r)}catch{}n=r=null}t.length=0}}}}const Vs=1048576;function Zs(t={}){const{thresholdBytes:e=Vs}=t;return()=>{const t=[];let r,n,a,s=0,i=!1;const o=new WritableStream({async write(a){i?await r.write(a):(t.push(a),s+=a.length,s>e&&await(async()=>{const e=new TransformStream;n=new Response(e.readable).blob(),r=e.writable.getWriter(),i=!0;for(const e of t)await r.write(e);t.length=0})())},async close(){r&&(await r.close(),r=null)}});let c=0;return{writable:o,readable:new ReadableStream({async pull(e){if(i){if(!a){const t=await n;a=t.stream().getReader()}const{value:t,done:r}=await a.read();r?e.close():e.enqueue(t)}else c<t.length?e.enqueue(t[c++]):e.close()},async cancel(t){a&&await a.cancel(t)}},{highWaterMark:0}),dispose:async()=>{if(r){try{await r.abort()}catch{}r=null}n&&(n.catch(()=>{}),n=null),t.length=0}}}}const Hs=1048576,qs=".zip.js-temp";function Ks(t={}){const{thresholdBytes:e=Hs,directoryName:r=qs,getDirectory:n}=t;if(!(n||"undefined"!=typeof FileSystemFileHandle&&FileSystemFileHandle.prototype.createSyncAccessHandle))throw Error("createSyncAccessHandle is only available in dedicated workers");const a=n||(()=>navigator.storage.getDirectory());let s;function i(){return s||(s=Promise.resolve(a()).then(t=>t.getDirectoryHandle(r,{create:!0}))),s}return()=>{const t=[];let r,n,a=0,s=!1,o=0,c=0;const l=new WritableStream({async write(c){s?(n.write(c,{at:o}),o+=c.length):(t.push(c),a+=c.length,a>e&&await(async()=>{const e=await i();r=crypto.randomUUID();const a=await e.getFileHandle(r,{create:!0});n=await a.createSyncAccessHandle(),s=!0;for(const e of t)n.write(e,{at:o}),o+=e.length;t.length=0})())},close(){n&&n.flush()}});let d=0;return{writable:l,readable:new ReadableStream({pull(e){if(s){const t=o-c;if(0>=t)return void e.close();const r=new Uint8Array(Math.min(524288,t)),a=n.read(r,{at:c});a?(c+=a,e.enqueue(r.subarray(0,a))):e.close()}else d<t.length?e.enqueue(t[d++]):e.close()}},{highWaterMark:0}),dispose:async()=>{if(n){try{n.close()}catch{}n=null}if(r){try{const t=await i();await t.removeEntry(r)}catch{}r=null}t.length=0}}}}try{N({baseURI:import.meta.url})}catch{}let Ys,Gs,Xs,Js,Qs;function $s(t,e,r={}){if(!Ys){const t=Error("WASM module not loaded");throw t.cause=Qs,t}const n="number"==typeof r.level?r.level:-1,a="number"==typeof r.outBuffer?r.outBuffer:65536,s="number"==typeof r.inBufferSize?r.inBufferSize:65536;return new TransformStream({start(){try{let r;if(this.ke=Gs(a),this.in=Gs(s),this.inBufferSize=s,!this.ke||!this.in)throw Error("allocation failed");if(this.Te=new Uint8Array(a),t?(this.ve=Ys.deflate_process,this.Ce=Ys.deflate_last_consumed,this.Me=Ys.deflate_end,this.Ie=Ys.deflate_new(),r="gzip"===e?Ys.deflate_init_gzip(this.Ie,n):"deflate-raw"===e?Ys.deflate_init_raw(this.Ie,n):Ys.deflate_init(this.Ie,n)):"deflate64-raw"===e?(this.ve=Ys.inflate9_process,this.Ce=Ys.inflate9_last_consumed,this.Me=Ys.inflate9_end,this.Ie=Ys.inflate9_new(),r=Ys.inflate9_init_raw(this.Ie)):(this.ve=Ys.inflate_process,this.Ce=Ys.inflate_last_consumed,this.Me=Ys.inflate_end,this.Ie=Ys.inflate_new(),r="deflate-raw"===e?Ys.inflate_init_raw(this.Ie):"gzip"===e?Ys.inflate_init_gzip(this.Ie):Ys.inflate_init(this.Ie)),0!==r)throw Error("init failed:"+r)}catch(t){throw i(this),t}},transform(e,r){try{const n=e,s=new Uint8Array(Js.buffer),i=this.ve,o=this.Ce,c=this.ke,l=this.Te;let d=0;for(;d<n.length;){const e=Math.min(n.length-d,32768);if((!this.in||this.inBufferSize<e)&&(this.in&&Xs&&(Xs(this.in),this.in=0),this.in=Gs(e),this.inBufferSize=e,!this.in))throw Error("allocation failed");s.set(n.subarray(d,d+e),this.in);const u=i(this.Ie,this.in,e,c,a,0),f=16777215&u;if(f&&(l.set(s.subarray(c,c+f),0),r.enqueue(l.slice(0,f))),!t){const t=u>>24&255,e=128&t?t-256:t;if(0>e)throw Error("process error:"+e)}const w=o(this.Ie);if(0===w)break;d+=w}}catch(t){i(this),r.error(t)}},flush(e){try{const r=new Uint8Array(Js.buffer),n=this.ve,s=this.ke,i=this.Te;for(;;){const o=n(this.Ie,0,0,s,a,4),c=16777215&o,l=o>>24&255;if(!t){const t=128&l?l-256:l;if(0>t)throw Error("process error:"+t)}if(c&&(i.set(r.subarray(s,s+c),0),e.enqueue(i.slice(0,c))),1===l||0===c)break}}catch(t){e.error(t)}finally{const t=i(this);0!==t&&e.error(Error("end error:"+t))}},cancel(){i(this)}});function i(t){let e=0;return t.Ie&&t.Me&&(e=t.Me(t.Ie)),t.Ie=0,t.in&&Xs&&Xs(t.in),t.in=0,t.ke&&Xs&&Xs(t.ke),t.ke=0,e}}class ti{constructor(t="deflate",e){return $s(!0,t,e)}}class ei{constructor(t="deflate",e){return $s(!1,t,e)}}ti.Dt=!0,ei.Dt=!0;let ri,ni=!1;function ai(){ri=null,(async()=>{await Promise.allSettled(Ge.map(t=>(sr(t),t.terminate()))),Te=F,Ie=!1})(),ni=!1,Ys=Gs=Xs=Js=Qs=null}(({je:t})=>{Pe=t})({je:t=>{if(!ri){let{wasmURI:e}=t;typeof e==U&&(e=e()),ri=(async(t,{baseURI:e})=>{if(!ni)try{await(async(t,e)=>{let r,n;try{try{n=new URL(t,e)}catch{}const a=await fetch(n);r=await a.arrayBuffer()}catch(e){if(!t.startsWith("data:application/wasm;base64,"))throw e;r=(t=>{const e=t.split(",")[1],r=atob(e),n=r.length,a=new Uint8Array(n);for(let t=0;n>t;++t)a[t]=r.charCodeAt(t);return a.buffer})(t)}(t=>{if(Ys=t,({malloc:Gs,free:Xs,memory:Js}=Ys),"function"!=typeof Gs||"function"!=typeof Xs||!Js)throw Ys=Gs=Xs=Js=null,Error("Invalid WASM module")})((await WebAssembly.instantiate(r)).instance.exports)})(t,e),ni=!0}catch(t){throw(t=>{Qs=t})(t),t}})(e,t).catch(t=>{throw ri=null,t})}return ri}}),N({CompressionStreamFallback:ti,DecompressionStreamFallback:ei}),N({workerURI:new URL("./zip-web-worker.js",import.meta.url).href,wasmURI:new URL("./zip-module.wasm",import.meta.url).href});const si="Entry filename already exists",ii=new Set([1,f,10,w,28789,25461,h,p,m,22613,13]);class oi{constructor(t,e,r,n){const a=this;if(t.root&&n&&n.getChildByName(e))throw Error(si);r||(r={}),Object.assign(a,{fs:t,name:e,data:r.data,options:r.options,id:t.Pe++,parent:n,children:[],uncompressedSize:r.uncompressedSize||0,passThrough:r.passThrough}),!n&&t.root||(t.entries[a.id]=a),n&&a.parent.children.push(a)}moveTo(t){this.fs.move(this,t)}getFullname(){return this.getRelativeName()}getRelativeName(t=this.fs.root){let e=this.name,r=this.parent;for(;r&&r!=t;)e=(r.name?r.name+"/":"")+e,r=r.parent;return e}isDescendantOf(t){let e=this.parent;for(;e&&e.id!=t.id;)e=e.parent;return!!e}rename(t){const e=this.parent;if(e&&e.getChildByName(t))throw Error(si);this.name=t}}class ci extends oi{constructor(t,e,r,n){super(t,e,r,n);const a=this;a.Reader=r.Reader,a.Writer=r.Writer,r.getData&&(a.getData=r.getData)}clone(){return new ci(this.fs,this.name,this)}async getData(t,e={}){const r=this;if(!t||t.constructor==r.Writer&&r.data)return r.data;{const n=r.reader=hi(r.Reader,r.data,e),a=r.data?r.data.uncompressedSize:n.size;await Promise.all([tn(n),tn(t,a)]);const{readable:s}=n;return r.uncompressedSize=n.size,await s.pipeTo(t.writable),t.getData?t.getData():t.writable}}isPasswordProtected(){return!(!this.data||!this.data.encrypted)}async checkPassword(t,e={}){const r=this;if(!r.isPasswordProtected())return!0;try{return await r.data.getData(null,Object.assign({},e,{password:t,checkPasswordOnly:!0})),!0}catch(t){if(t.message==bt)return!1;throw t}}getText(t,e){return this.getData(new Ur(t),e)}getBlob(t,e){return this.getData(new Ar(t),e)}getData64URI(t,e){return this.getData(new xr(t),e)}getUint8Array(t){return this.getData(new Gr,t)}getWritable(t=new WritableStream,e){return this.getData({writable:t},e)}async getArrayBuffer(t){return ut(await this.getUint8Array(t)).buffer}replaceBlob(t){Object.assign(this,{data:t,Reader:Fr,Writer:Ar,reader:null})}replaceText(t){Object.assign(this,{data:t,Reader:Dr,Writer:Ur,reader:null})}replaceData64URI(t){Object.assign(this,{data:t,Reader:gr,Writer:xr,reader:null})}replaceUint8Array(t){Object.assign(this,{data:t,Reader:Yr,Writer:Gr,reader:null})}replaceReadable(t){Object.assign(this,{data:null,Reader:fi(t),Writer:null,reader:null})}}class li extends oi{constructor(t,e,r,n){super(t,e,r,n),this.directory=!0}clone(t){const e=this,r=new li(e.fs,e.name,e);return t&&(r.children=e.children.map(e=>{const n=e.clone(t);return n.parent=r,n})),r}addDirectory(t,e){return Ei(this,t,{options:e},!0)}addText(t,e,r={}){return Ei(this,t,{data:e,Reader:Dr,Writer:Ur,options:r,uncompressedSize:e.length})}addBlob(t,e,r={}){return Ei(this,t,{data:e,Reader:Fr,Writer:Ar,options:r,uncompressedSize:e.size})}addData64URI(t,e,r={}){let n=e.length;for(;"="==e.charAt(n-1);)n--;const a=e.indexOf(",")+1;return Ei(this,t,{data:e,Reader:gr,Writer:xr,options:r,uncompressedSize:Math.floor(.75*(n-a))})}addUint8Array(t,e,r={}){return Ei(this,t,{data:e,Reader:Yr,Writer:Gr,options:r,uncompressedSize:e.length})}addHttpContent(t,e,r={}){return Ei(this,t,{data:e,Reader:class extends qr{constructor(t){super(t,r)}},options:r})}addReadable(t,e,r={}){return Ei(this,t,{Reader:fi(e),options:r})}addFileSystemEntry(t,e={}){return yi(this,t,e)}addFileSystemHandle(t,e={}){return yi(this,t,e)}addFile(t,e={}){return(e=Object.assign({},e)).lastModDate||(e.lastModDate=new Date(t.lastModified)),Ei(this,t.name,{data:t,Reader:()=>({readable:t.stream(),size:t.size}),options:e,uncompressedSize:t.size})}Ne(t,e){return Ei(this,t,e)}importBlob(t,e){return this.importZip(new Fr(t),e)}importData64URI(t,e){return this.importZip(new gr(t),e)}importUint8Array(t,e){return this.importZip(new Yr(t),e)}importHttpContent(t,e){return this.importZip(new qr(t,e),e)}importReadable(t,e){return this.importZip({readable:t},e)}exportBlob(t={}){return this.exportZip(new Ar(t.mimeType||"application/zip"),t)}exportData64URI(t={}){return this.exportZip(new xr(t.mimeType||"application/zip"),t)}exportUint8Array(t={}){return this.exportZip(new Gr,t)}async exportWritable(t=new WritableStream,e={}){return await this.exportZip({writable:t},e),t}exportFileSystemHandle(t,e={}){return(async(t,e,r)=>{const n=ui([t],"uncompressedSize"),a=new Map;return await s(t,e),e;async function s(t,e){if(r.concurrent){const r=(await Promise.allSettled(t.children.map(t=>i(t,e)))).find(t=>"rejected"==t.status);if(r)throw r.reason}else for(const r of t.children)await i(r,e)}async function i(t,e){try{if(t.directory){const r=await e.getDirectoryHandle(t.name,{create:!0});await s(t,r)}else{const s=await e.getFileHandle(t.name,{create:!0}),i=await s.createWritable();await t.getData({writable:i},Object.assign({},r,{onprogress:async e=>{if(r.onprogress){a.set(t.id,e);try{await r.onprogress(Array.from(a.values()).reduce((t,e)=>t+e,0),n)}catch{}}}}))}}catch(e){throw Error(e.message+(t?" ("+t.name+")":""),{cause:e})}}})(this,t,e)}async importZip(t,e={}){await tn(t);const r=new ya(t,e),n=[],a=await r.getEntries();for(const t of a){let r=this;try{const a=t.filename.split("/"),s=a.pop();if(a.forEach(t=>{const e=r;if(r=r.getChildByName(t),r){if(!r.directory)throw Error(si)}else r=new li(this.fs,t,{data:null},e),n.push(r)}),t.directory){let e=r;if(s)if(e=r.getChildByName(s),e){if(!e.directory)throw Error(si)}else e=new li(this.fs,s,{data:null},r),n.push(e);e==this||e.data||(e.data=t)}else n.push(Ei(r,s,{data:t,Reader:wi(Object.assign({},e)),uncompressedSize:t.uncompressedSize,passThrough:e.passThrough}))}catch(e){try{e.cause={entry:t}}catch{}throw e}}return n}async exportZip(t,e={}){const r=this;(e=Object.assign({},e)).bufferedWrite===F&&(e.bufferedWrite=!0);const[n]=await Promise.all([pi(r,e.readerOptions),tn(t)]),a=new hs(t,e);return await(async(t,e,r,n,a)=>{const s=e,i=new Map;await async function t(e,o){async function c(o){const c=n.relativePath?o.getRelativeName(s):o.getFullname(),l=o.options||{};let d={};if(o.data instanceof Wn){const{externalFileAttributes:t,versionMadeBy:e,comment:r,lastModDate:a,creationDate:s,lastAccessDate:i,uncompressedSize:c,encrypted:l,zipCrypto:u,crc32:f,compressionMethod:w,extraFieldAES:h,internalFileAttributes:p,extraField:m,uid:y,gid:b}=o.data;d={externalFileAttributes:t,versionMadeBy:e,comment:r,lastModDate:a,creationDate:s,lastAccessDate:i,internalFileAttributes:p};const S=(t=>{if(t){const e=new Map;if(t.forEach((t,r)=>{ii.has(r)||e.set(r,t.data)}),e.size)return e}})(m);if(S&&(d.extraField=S),y===F&&b===F||Object.assign(d,{uid:y,gid:b,unixExtraFieldType:n.unixExtraFieldType||"infozip"}),o.passThrough){let t,e;0===w&&(t=0),h&&(e=h.strength),d=Object.assign(d,{passThrough:!0,encrypted:l,zipCrypto:u,crc32:f,uncompressedSize:c,level:t,encryptionStrength:e,compressionMethod:w})}}await e.add(c,a.get(o),Object.assign({},n,d,l,{directory:o.directory,onprogress:async t=>{if(n.onprogress){i.set(c,t);try{await n.onprogress(Array.from(i.values()).reduce((t,e)=>t+e),r)}catch{}}}})),await t(e,o)}await(async()=>{if(n.bufferedWrite){const t=(await Promise.allSettled(o.children.map(c))).find(t=>"rejected"==t.status);if(t)throw t.reason}else for(const t of o.children)await c(t)})()}(t,e)})(a,r,ui([r],"uncompressedSize"),e,n),await a.close(),t.getData?t.getData():t.writable}getChildByName(t){const e=this.children;for(let r=0;r<e.length;r++){const n=e[r];if(n.name==t)return n}}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 r=this.children;return!(await Promise.all(r.map(r=>r.checkPassword(t,e)))).includes(!1)}}const di={FS:class{constructor(){Si(this)}get children(){return this.root.children}remove(t){mi(t);const e=[t];for(;e.length;){const t=e.pop();this.entries[t.id]=null;for(const r of t.children)e.push(r)}t.parent=F}move(t,e){if(t==this.root)throw Error("Root directory cannot be moved");if(!e.directory)throw Error("Target entry is not a directory");if(e.isDescendantOf(t))throw Error("Entry is a ancestor of target entry");if(t!=e){const r=e.getChildByName(t.name);if(r){if(r!=t)throw Error(si)}else mi(t),t.parent=e,e.children.push(t),((t,e)=>{const r=[e];for(;r.length;){const e=r.pop();t.entries[e.id]=e;for(const t of e.children)r.push(t)}})(this,t)}}find(t){const e=t.split("/");let r=this.root;for(let t=0;r&&t<e.length;t++)r=r.getChildByName(e[t]);return r||(r=this.entries.find(e=>e&&(e==this.root||e.isDescendantOf(this.root))&&e.getRelativeName()==t)),r}getById(t){return this.entries[t]}getChildByName(t){return this.root.getChildByName(t)}addDirectory(t,e){return this.root.addDirectory(t,e)}addText(t,e,r){return this.root.addText(t,e,r)}addBlob(t,e,r){return this.root.addBlob(t,e,r)}addData64URI(t,e,r){return this.root.addData64URI(t,e,r)}addUint8Array(t,e,r){return this.root.addUint8Array(t,e,r)}addHttpContent(t,e,r){return this.root.addHttpContent(t,e,r)}addReadable(t,e,r){return this.root.addReadable(t,e,r)}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)}Ne(t,e){return this.root.Ne(t,e)}importBlob(t,e){return Si(this),this.root.importBlob(t,e)}importData64URI(t,e){return Si(this),this.root.importData64URI(t,e)}importUint8Array(t,e){return Si(this),this.root.importUint8Array(t,e)}importHttpContent(t,e){return Si(this),this.root.importHttpContent(t,e)}importReadable(t,e){return Si(this),this.root.importReadable(t,e)}importZip(t,e){return Si(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)}isPasswordProtected(){return this.root.isPasswordProtected()}checkPassword(t,e){return this.root.checkPassword(t,e)}},ZipDirectoryEntry:li,ZipFileEntry:ci};function ui(t,e){let r=0;const n=Array.from(t);for(;n.length;){const t=n.pop();r+=t[e]||0;for(const e of t.children)n.push(e)}return r}function fi(t){let e;return()=>{if(e)throw Error("Readable stream already consumed");return e=!0,{readable:t}}}function wi(t){return class extends Sr{constructor(t,e={}){super(),this.entry=t,this.options=e}async init(){const e=this;e.size=e.entry.uncompressedSize;const r=await e.entry.getData(new Ar,Object.assign({},t,e.options));e.data=r,e.We=new Fr(r),super.init()}readUint8Array(t,e){return this.We.readUint8Array(t,e)}}}function hi(t,e,r){return t.prototype?new t(e,r):t(e,r)}async function pi(t,e){const r=[],n=[t],a=new Map;for(;n.length;){const t=n.pop();for(const e of t.children)e.directory?n.push(e):r.push(e)}return await Promise.all(r.map(async t=>{const r=t.reader=hi(t.Reader,t.data,e);a.set(t,r);try{await tn(r)}catch(e){try{e.entryId=t.id,e.cause={entry:t}}catch{}throw e}r.size!==F&&(t.uncompressedSize=r.size)})),a}function mi(t){if(t.parent){const e=t.parent.children;e.forEach((r,n)=>{r.id==t.id&&e.splice(n,1)})}}function yi(t,e,r){return async function t(e,n,a){if(n)try{if((n.isFile||n.isDirectory)&&(n=await bi(n)),"file"==n.kind){const t=await n.getFile();a.push(e.Ne(t.name,{Reader:()=>({readable:t.stream(),size:t.size}),options:Object.assign({},{lastModDate:new Date(t.lastModified)},r),uncompressedSize:t.size}))}else if("directory"==n.kind){const r=e.addDirectory(n.name);a.push(r);for await(const e of n.values())await t(r,e,a)}}catch(t){const e=t.message+(n?" ("+n.name+")":"");throw Error(e,{cause:t})}return a}(t,e,[])}async function bi(t){const e={name:t.name};if(t.isFile&&(e.kind="file",e.getFile=()=>new Promise((e,r)=>t.file(e,r))),t.isDirectory){e.kind="directory";const r=await(async t=>{const e=[];function r(t,n,a){t.readEntries(async s=>{if(s.length){for(const t of s)e.push(await bi(t));r(t,n,a)}else n(e)},a)}return await new Promise((e,n)=>r(t.createReader(),e,n)),{[Symbol.iterator](){let t=0;return{next(){const r={value:e[t],done:t==e.length};return t++,r}}}}})(t);e.values=()=>r}return e}function Si(t){t.entries=[],t.Pe=0,t.root=new li(t)}function Ei(t,e,r,n){if(t.directory)return n?new li(t.fs,e,r,t):new ci(t.fs,e,r,t);throw Error("Parent entry is not a directory")}export{Fr as BlobReader,Ar as BlobWriter,gr as Data64URIReader,xr as Data64URIWriter,ua as ERR_AMBIGUOUS_ARCHIVE,ta as ERR_BAD_FORMAT,na as ERR_CENTRAL_DIRECTORY_NOT_FOUND,qa as ERR_DUPLICATED_NAME,ia as ERR_ENCRYPTED,fa as ERR_ENCRYPTED_CENTRAL_DIRECTORY,ra as ERR_EOCDR_LOCATOR_ZIP64_NOT_FOUND,ea as ERR_EOCDR_NOT_FOUND,sa as ERR_EXTRAFIELD_ZIP64_NOT_FOUND,or as ERR_HTTP_RANGE,cr as ERR_HTTP_RESOURCE_CHANGED,Et as ERR_INVALID_AUTHENTICATION_CODE,_ as ERR_INVALID_CODEC_DEFINITION,B as ERR_INVALID_CODEC_MODULE,Ka as ERR_INVALID_COMMENT,ce as ERR_INVALID_COMPRESSED_DATA,le as ERR_INVALID_CRC32,Ja as ERR_INVALID_ENCRYPTION_STRENGTH,Ya as ERR_INVALID_ENTRY_COMMENT,Ga as ERR_INVALID_ENTRY_NAME,ts as ERR_INVALID_EXTRAFIELD_DATA,$a as ERR_INVALID_EXTRAFIELD_TYPE,bt as ERR_INVALID_PASSWORD,St as ERR_INVALID_SIGNATURE,oe as ERR_INVALID_UNCOMPRESSED_SIZE,Xa as ERR_INVALID_VERSION,lr as ERR_ITERATOR_COMPLETED_TOO_SOON,aa as ERR_LOCAL_FILE_HEADER_NOT_FOUND,da as ERR_OVERLAPPING_ENTRY,L as ERR_RESERVED_COMPRESSION_METHOD,la as ERR_SPLIT_ZIP_FILE,os as ERR_UNDEFINED_READER,is as ERR_UNDEFINED_UNCOMPRESSED_SIZE,ca as ERR_UNSUPPORTED_COMPRESSION,oa as ERR_UNSUPPORTED_ENCRYPTION,Qa as ERR_UNSUPPORTED_ENCRYPTION_USDZ,ss as ERR_UNSUPPORTED_FORMAT,dr as ERR_WRITER_NOT_INITIALIZED,cs as ERR_ZIP_NOT_EMPTY,Kr as HttpRangeReader,qr as HttpReader,Sr as Reader,Xr as SplitDataReader,Jr as SplitDataWriter,Dr as TextReader,Ur as TextWriter,Yr as Uint8ArrayReader,Gr as Uint8ArrayWriter,Er as Writer,ya as ZipReader,ba as ZipReaderStream,hs as ZipWriter,ps as ZipWriterStream,j as configure,Zs as createBlobTempStream,Bs as createOPFSTempStream,Ks as createSyncAccessHandleTempStream,di as fs,Ws as getMimeType,K as registerCodec,W as resetConfiguration,ai as terminateWorkers,Y as unregisterCodec};
|
|
1
|
+
const t=4294967295,e=65535,r=255,n=67324752,a=134695760,s=a,i=84233040,o=33639248,c=101010256,l=101075792,d=117853008,u=22,f=20,w=56,h=39169,p=21589,m=6534,y=30837,b=30805,S=2048,E=16384,g=2048,x=1024,R="/",z=30,A=new Date(2107,11,31,23,59,58),F=new Date(1980,0,1),D=void 0,U=1/0,O="undefined",T="function",k=new Uint8Array;let C=2;try{typeof navigator!=O&&navigator.hardwareConcurrency&&(C=navigator.hardwareConcurrency)}catch{}const v={workerURI:"./core/web-worker-wasm.js",wasmURI:"./core/streams/zlib-wasm/zlib-streams.wasm",chunkSize:65536,maxWorkers:C,terminateWorkerTimeout:5e3,workerStarvationTimeout:5e3,workerStartupTimeout:5e3,useWebWorkers:!0,useCompressionStream:!0,transferStreams:!0,CompressionStream:typeof CompressionStream!=O&&CompressionStream,DecompressionStream:typeof DecompressionStream!=O&&DecompressionStream},M=["baseURI","wasmURI","workerURI","createWorker","chunkSize","maxWorkers","terminateWorkerTimeout","workerStarvationTimeout","workerStartupTimeout","useCompressionStream","useWebWorkers","transferStreams","CompressionStream","DecompressionStream","CompressionStreamFallback","DecompressionStreamFallback"],I={...v};function j(){return I}function N(t){return Math.max(t.chunkSize,64)}function P(t){t=W(t);for(const e of M){const r=t[e];r!==D&&(I[e]=r)}}function W(t){const{CompressionStreamZlib:e,DecompressionStreamZlib:r}=t;if(e===D&&r===D)return t;const n=Object.assign({},t);return n.CompressionStreamFallback===D&&(n.CompressionStreamFallback=e),n.DecompressionStreamFallback===D&&(n.DecompressionStreamFallback=r),n}function _(t){t=W(t);for(const e of M){const r=t[e];r!==D&&(v[e]=r)}P(t)}function L(){for(const t of M)delete I[t];Object.assign(I,v)}const B="Invalid codec definition",V="Reserved compression method",Z="Invalid codec module",H="string",q=[0,8,9,99],K=new Map,Y=new Map;function G(t={}){const{compressionMethod:r,format:n,codecURI:a,CompressionStream:s,DecompressionStream:i,versionNeeded:o}=t;if(!Number.isInteger(r)||0>r||r>e||typeof n!=H||!n.length)throw Error(B);if(q.includes(r))throw Error(V);const c=typeof s==T||typeof i==T;if(!(c||typeof a==H&&a.length))throw Error(B);K.set(r,{compressionMethod:r,format:n,codecURI:a,versionNeeded:o}),c&&$(n,{CompressionStream:s,DecompressionStream:i})}function X(t){const e=K.get(t);if(e){let r;K.delete(t),K.forEach(t=>r=r||t.format==e.format),r||Y.delete(e.format)}}function J(t){return K.get(t)}function Q(t){return Y.get(t)}function $(t,e){const{CompressionStream:r,DecompressionStream:n}=e;if(typeof r!=T&&typeof n!=T)throw Error(Z);Y.set(t,{CompressionStream:r,DecompressionStream:n})}const tt=[[],[],[],[],[],[],[],[]];for(let t=0;256>t;t++){let e=t;for(let t=0;8>t;t++)e=1&e?e>>>1^3988292384:e>>>1;tt[0][t]=e}for(let t=0;256>t;t++)for(let e=1;8>e;e++){const r=tt[e-1][t];tt[e][t]=r>>>8^tt[0][255&r]}const[et,rt,nt,at,st,it,ot,ct]=tt;class lt{constructor(t){this.o=t||-1}append(t){let e=0|this.o;const r=0|t.length;let n=0;if(r>=8&&t.buffer){const a=new DataView(t.buffer,t.byteOffset,r),s=r-8;for(;s>=n;n+=8){const t=e^a.getInt32(n,!0),r=a.getInt32(n+4,!0);e=ct[255&t]^ot[t>>>8&255]^it[t>>>16&255]^st[t>>>24&255]^at[255&r]^nt[r>>>8&255]^rt[r>>>16&255]^et[r>>>24&255]}}for(;r>n;n++)e=e>>>8^et[255&(e^t[n])];this.o=e}get(){return~this.o}}class dt extends TransformStream{constructor(){let t;const e=new lt;super({transform(t,r){e.append(t),r.enqueue(t)},flush(){const r=new Uint8Array(4);new DataView(r.buffer).setUint32(0,e.get()),t.value=r}}),t=this}}function ut(t){if(typeof TextEncoder==O){t=unescape(encodeURIComponent(t));const e=new Uint8Array(t.length);for(let r=0;r<e.length;r++)e[r]=t.charCodeAt(r);return e}return(new TextEncoder).encode(t)}function ft(t,e){const r=new Uint8Array(t.length+e.length);return r.set(t),r.set(e,t.length),r}function wt(t){return t.byteOffset||t.byteLength!=t.buffer.byteLength?new Uint8Array(t):t}function ht(t){return new DataView(t.buffer,t.byteOffset,t.byteLength)}const pt={concat(t,e){if(0===t.length||0===e.length)return t.concat(e);const r=t[t.length-1],n=pt.l(r);return 32===n?t.concat(e):pt.h(e,n,0|r,t.slice(0,t.length-1))},bitLength(t){const e=t.length;if(0===e)return 0;const r=t[e-1];return 32*(e-1)+pt.l(r)},m(t,e){if(32*t.length<e)return t;const r=(t=t.slice(0,Math.ceil(e/32))).length;return e&=31,r>0&&e&&(t[r-1]=pt.S(e,t[r-1]&2147483648>>e-1,1)),t},S:(t,e,r)=>32===t?e:(r?0|e:e<<32-t)+1099511627776*t,l:t=>Math.round(t/1099511627776)||32,h(t,e,r,n){for(void 0===n&&(n=[]);e>=32;e-=32)n.push(r),r=0;if(0===e)return n.concat(t);for(let a=0;a<t.length;a++)n.push(r|t[a]>>>e),r=t[a]<<32-e;const a=t.length?t[t.length-1]:0,s=pt.l(a);return n.push(pt.S(e+s&31,e+s>32?r:n.pop(),1)),n}},mt={bytes:{R(t){const e=pt.bitLength(t)/8,r=new Uint8Array(e);let n;for(let a=0;e>a;a++)3&a||(n=t[a/4]),r[a]=n>>>24,n<<=8;return r},A(t){const e=[];let r,n=0;for(r=0;r<t.length;r++)n=n<<8|t[r],3&~r||(e.push(n),n=0);return 3&r&&e.push(pt.S(8*(3&r),n)),e}}},yt=class{constructor(t){const e=this;e.blockSize=512,e.F=[1732584193,4023233417,2562383102,271733878,3285377520],e.D=[1518500249,1859775393,2400959708,3395469782],t?(e.U=t.U.slice(0),e.O=t.O.slice(0),e.T=t.T):e.reset()}reset(){const t=this;return t.U=t.F.slice(0),t.O=[],t.T=0,t}update(t){const e=this;"string"==typeof t&&(t=mt.C.A(t));const r=e.O=pt.concat(e.O,t),n=e.T,a=e.T=n+pt.bitLength(t);if(a>9007199254740991)throw Error("Cannot hash more than 2^53 - 1 bits");const s=new Uint32Array(r);let i=0;for(let t=e.blockSize+n-(e.blockSize+n&e.blockSize-1);a>=t;t+=e.blockSize)e.v(s.subarray(16*i,16*(i+1))),i+=1;return r.splice(0,16*i),e}M(){const t=this;let e=t.O;const r=t.U;e=pt.concat(e,[pt.S(1,1)]);for(let t=e.length+2;15&t;t++)e.push(0);for(e.push(Math.floor(t.T/4294967296)),e.push(0|t.T);e.length;)t.v(e.splice(0,16));return t.reset(),r}I(t,e,r,n){return t>19?t>39?t>59?t>79?void 0:e^r^n:e&r|e&n|r&n:e^r^n:e&r|~e&n}j(t,e){return e<<t|e>>>32-t}v(t){const e=this,r=e.U,n=Array(80);for(let e=0;16>e;e++)n[e]=t[e];let a=r[0],s=r[1],i=r[2],o=r[3],c=r[4];for(let t=0;79>=t;t++){16>t||(n[t]=e.j(1,n[t-3]^n[t-8]^n[t-14]^n[t-16]));const r=e.j(5,a)+e.I(t,s,i,o)+c+n[t]+e.D[Math.floor(t/20)]|0;c=o,o=i,i=e.j(30,s),s=a,a=r}r[0]=r[0]+a|0,r[1]=r[1]+s|0,r[2]=r[2]+i|0,r[3]=r[3]+o|0,r[4]=r[4]+c|0}},bt={importKey:t=>new bt.N(mt.bytes.A(t)),P(t,e,r,n){if(r=r||1e4,0>n||0>r)throw Error("invalid params to pbkdf2");const a=1+(n>>5)<<2;let s,i,o,c,l;const d=new ArrayBuffer(a),u=new DataView(d);let f=0;const w=pt;for(e=mt.bytes.A(e),l=1;(a||1)>f;l++){for(s=i=t.encrypt(w.concat(e,[l])),o=1;r>o;o++)for(i=t.encrypt(i),c=0;c<i.length;c++)s[c]^=i[c];for(o=0;(a||1)>f&&o<s.length;o++)u.setInt32(f,s[o]),f+=4}return d.slice(0,n/8)},N:class{constructor(t){const e=this,r=e.W=yt,n=[[],[]];e._=[new r,new r];const a=e._[0].blockSize/32;t.length>a&&(t=(new r).update(t).M());for(let e=0;a>e;e++)n[0][e]=909522486^t[e],n[1][e]=1549556828^t[e];e._[0].update(n[0]),e._[1].update(n[1]),e.L=new r(e._[0])}reset(){const t=this;t.L=new t.W(t._[0]),t.B=!1}update(t){this.B=!0,this.L.update(t)}digest(){const t=this,e=t.L.M(),r=new t.W(t._[1]).update(e).M();return t.reset(),r}encrypt(t){if(this.B)throw Error("encrypt on already updated hmac called!");return this.update(t),this.digest(t)}}},St=typeof crypto!=O&&typeof crypto.getRandomValues==T,Et="Invalid password",gt="Invalid signature",xt=gt,Rt="zipjs-abort-check-password",zt="Crypto API not supported";function At(t){if(St)return crypto.getRandomValues(t);throw Error(zt)}const Ft=16,Dt={name:"PBKDF2"},Ut=Object.assign({hash:{name:"HMAC"}},Dt),Ot=Object.assign({iterations:1e3,hash:{name:"SHA-1"}},Dt),Tt=["deriveBits"],kt=[8,12,16],Ct=[16,24,32],vt=10,Mt=[0,0,0,0],It=typeof crypto!=O,jt=It&&crypto.subtle,Nt=It&&typeof jt!=O,Pt=mt.bytes,Wt=class{constructor(t){const e=this;e.V=[[[],[],[],[],[]],[[],[],[],[],[]]],e.V[0][0][0]||e.Z();const r=e.V[0][4],n=e.V[1],a=t.length;let s,i,o,c=1;if(4!==a&&6!==a&&8!==a)throw Error("invalid aes key size");for(e.D=[i=t.slice(0),o=[]],s=a;4*a+28>s;s++){let t=i[s-1];(s%a===0||8===a&&s%a===4)&&(t=r[t>>>24]<<24^r[t>>16&255]<<16^r[t>>8&255]<<8^r[255&t],s%a===0&&(t=t<<8^t>>>24^c<<24,c=c<<1^283*(c>>7))),i[s]=i[s-a]^t}for(let t=0;s;t++,s--){const e=i[3&t?s:s-4];o[t]=4>=s||4>t?e:n[0][r[e>>>24]]^n[1][r[e>>16&255]]^n[2][r[e>>8&255]]^n[3][r[255&e]]}}encrypt(t){return this.H(t,0)}decrypt(t){return this.H(t,1)}Z(){const t=this.V[0],e=this.V[1],r=t[4],n=e[4],a=[],s=[];let i,o,c,l;for(let t=0;256>t;t++)s[(a[t]=t<<1^283*(t>>7))^t]=t;for(let d=i=0;!r[d];d^=o||1,i=s[i]||1){let s=i^i<<1^i<<2^i<<3^i<<4;s=s>>8^255&s^99,r[d]=s,n[s]=d,l=a[c=a[o=a[d]]];let u=16843009*l^65537*c^257*o^16843008*d,f=257*a[s]^16843008*s;for(let r=0;4>r;r++)t[r][d]=f=f<<24^f>>>8,e[r][s]=u=u<<24^u>>>8}for(let r=0;5>r;r++)t[r]=t[r].slice(0),e[r]=e[r].slice(0)}H(t,e){if(4!==t.length)throw Error("invalid aes block size");const r=this.D[e],n=r.length/4-2,a=[0,0,0,0],s=this.V[e],i=s[0],o=s[1],c=s[2],l=s[3],d=s[4];let u,f,w,h=t[0]^r[0],p=t[e?3:1]^r[1],m=t[2]^r[2],y=t[e?1:3]^r[3],b=4;for(let t=0;n>t;t++)u=i[h>>>24]^o[p>>16&255]^c[m>>8&255]^l[255&y]^r[b],f=i[p>>>24]^o[m>>16&255]^c[y>>8&255]^l[255&h]^r[b+1],w=i[m>>>24]^o[y>>16&255]^c[h>>8&255]^l[255&p]^r[b+2],y=i[y>>>24]^o[h>>16&255]^c[p>>8&255]^l[255&m]^r[b+3],b+=4,h=u,p=f,m=w;for(let t=0;4>t;t++)a[e?3&-t:t]=d[h>>>24]<<24^d[p>>16&255]<<16^d[m>>8&255]<<8^d[255&y]^r[b++],u=h,h=p,p=m,m=y,y=u;return a}},_t=class{constructor(t,e){this.K=t,this.Y=e,this.G=e}reset(){this.G=this.Y}update(t){return this.X(this.K,t,this.G)}J(t){if(255&~(t>>24))t+=1<<24;else{let e=t>>16&255,r=t>>8&255,n=255&t;255===e?(e=0,255===r?(r=0,255===n?n=0:++n):++r):++e,t=0,t+=e<<16,t+=r<<8,t+=n}return t}$(t){0===(t[0]=this.J(t[0]))&&(t[1]=this.J(t[1]))}X(t,e,r){let n;if(!(n=e.length))return[];const a=pt.bitLength(e);for(let a=0;n>a;a+=4){this.$(r);const n=t.encrypt(r);e[a]^=n[0],e[a+1]^=n[1],e[a+2]^=n[2],e[a+3]^=n[3]}return pt.m(e,a)}},Lt=bt.N;let Bt=It&&Nt&&typeof jt.importKey==T,Vt=It&&Nt&&typeof jt.deriveBits==T;class Zt extends TransformStream{constructor({password:t,rawPassword:e,encryptionStrength:r,checkPasswordOnly:n,checkAuthenticationCode:a=!0}){super({start(){qt(this,t,e,r)},async transform(t,e){const r=this,{password:a,strength:s,et:i,ready:o}=r;a?(await(async(t,e,r,n)=>{const a=await Yt(t,e,r,Xt(n,0,kt[e])),s=Xt(n,kt[e]);if(a[0]!=s[0]||a[1]!=s[1])throw Error(Et)})(r,s,a,Xt(t,0,kt[s]+2)),t=Xt(t,kt[s]+2),n?e.error(Error(Rt)):i()):await o;const c=new Uint8Array(t.length-vt-(t.length-vt)%Ft);e.enqueue(Kt(r,t,c,0,vt,!0))},async flush(t){const{nt:e,st:r,pending:n,ready:s}=this;if(r&&e){await s;const i=Xt(n,0,n.length-vt),o=Xt(n,n.length-vt);let c=k;if(i.length){const t=Qt(Pt,i);r.update(t);const n=e.update(t);c=Jt(Pt,n)}const l=Xt(Jt(Pt,r.digest()),0,vt);let d=n.length<vt?1:0;for(let t=0;vt>t;t++)d|=l[t]^o[t];if(d&&a)throw Error(xt);t.enqueue(c)}}})}}class Ht extends TransformStream{constructor({password:t,rawPassword:e,encryptionStrength:r}){super({start(){qt(this,t,e,r)},async transform(t,e){const r=this,{password:n,strength:a,et:s,ready:i}=r;let o=k;n?(o=await(async(t,e,r)=>{const n=At(new Uint8Array(kt[e]));return ft(n,await Yt(t,e,r,n))})(r,a,n),s()):await i;const c=new Uint8Array(o.length+t.length-t.length%Ft);c.set(o,0),e.enqueue(Kt(r,t,c,o.length,0))},async flush(t){const{nt:e,st:r,pending:n,ready:a}=this;if(r&&e){await a;let s=k;if(n.length){const t=e.update(Qt(Pt,n));r.update(t),s=Jt(Pt,t)}const i=Jt(Pt,r.digest()).slice(0,vt);t.enqueue(ft(s,i))}}})}}function qt(t,e,r,n){Object.assign(t,{ready:new Promise(e=>t.et=e),password:Gt(e,r),strength:n-1,pending:k})}function Kt(t,e,r,n,a,s){const{nt:i,st:o,pending:c}=t;c.length&&(e=ft(c,e));const l=e.length-a;let d;for(r=((t,e)=>{if(e&&e>t.length){const r=t;(t=new Uint8Array(e)).set(r,0)}return t})(r,n+(l-l%Ft)),d=0;l-Ft>=d;d+=Ft){const t=Qt(Pt,Xt(e,d,d+Ft));s&&o.update(t);const a=i.update(t);s||o.update(a),r.set(Jt(Pt,a),d+n)}return t.pending=Xt(e,d),r}async function Yt(t,e,r,n){t.password=null;const a=await(async(t,e,r,n,a)=>{if(!Bt)return bt.importKey(e);try{return await jt.importKey("raw",e,r,!1,a)}catch{return Bt=!1,bt.importKey(e)}})(0,r,Ut,0,Tt),s=await(async(t,e,r)=>{if(!Vt)return bt.P(e,t.salt,Ot.iterations,r);try{return await jt.deriveBits(t,e,r)}catch{return Vt=!1,bt.P(e,t.salt,Ot.iterations,r)}})(Object.assign({salt:n},Ot),a,8*(2*Ct[e]+2)),i=new Uint8Array(s),o=Qt(Pt,Xt(i,0,Ct[e])),c=Qt(Pt,Xt(i,Ct[e],2*Ct[e])),l=Xt(i,2*Ct[e]);return Object.assign(t,{keys:{key:o,it:c,passwordVerification:l},nt:new _t(new Wt(o),Array.from(Mt)),st:new Lt(c)}),l}function Gt(t,e){return e===D?ut(t):e}function Xt(t,e,r){return t.subarray(e,r)}function Jt(t,e){return t.R(e)}function Qt(t,e){return t.A(e)}class $t extends TransformStream{constructor({password:t,rawPassword:e,passwordVerification:r,checkPasswordOnly:n}){super({start(){ee(this,t,e,r)},transform(t,e){const r=this;if(r.password||r.rawPassword){const e=re(r,t.subarray(0,12));if(r.password=r.rawPassword=null,0!=(e[11]^r.passwordVerification))throw Error(Et);t=t.subarray(12)}n?e.error(Error(Rt)):e.enqueue(re(r,t))}})}}class te extends TransformStream{constructor({password:t,rawPassword:e,passwordVerification:r}){super({start(){ee(this,t,e,r)},transform(t,e){const r=this;let n,a;if(r.password||r.rawPassword){r.password=r.rawPassword=null;const e=At(new Uint8Array(12));e[11]=r.passwordVerification,n=new Uint8Array(t.length+e.length),n.set(ne(r,e),0),a=12}else n=new Uint8Array(t.length),a=0;n.set(ne(r,t),a),e.enqueue(n)}})}}function ee(t,e,r,n){Object.assign(t,{password:e,rawPassword:r,passwordVerification:n}),((t,e,r)=>{const n=[305419896,591751049,878082192];if(Object.assign(t,{keys:n,ot:new lt(n[0]),ct:new lt(n[2])}),r)for(let e=0;e<r.length;e++)ae(t,r[e]);else for(let r=0;r<e.length;r++)ae(t,e.charCodeAt(r))})(t,e,r)}function re(t,e){const r=new Uint8Array(e.length);for(let n=0;n<e.length;n++)r[n]=se(t)^e[n],ae(t,r[n]);return r}function ne(t,e){const r=new Uint8Array(e.length);for(let n=0;n<e.length;n++)r[n]=se(t)^e[n],ae(t,e[n]);return r}function ae(t,e){let[,r]=t.keys;t.ot.append([e]);const n=~t.ot.get();r=oe(Math.imul(oe(r+ie(n)),134775813)+1),t.ct.append([r>>>24]);const a=~t.ct.get();t.keys=[n,r,a]}function se(t){const e=2|t.keys[2];return ie(Math.imul(e,1^e)>>>8)}function ie(t){return 255&t}function oe(t){return 4294967295&t}function ce(t){if(t instanceof ReadableStream)return t;const e=t.getReader();return new ReadableStream({async pull(t){const{value:r,done:n}=await e.read();n?t.close():t.enqueue(r)},cancel:t=>e.cancel(t)})}function le(t){if(t instanceof WritableStream)return t;const e=t.getWriter();return new WritableStream({write:t=>e.write(t),close:()=>e.close(),abort:t=>e.abort(t)})}const de="Invalid uncompressed size",ue="Invalid compressed data",fe=gt,we="deflate-raw",he="gzip",pe=[31,139,8];class me extends TransformStream{constructor(t,{chunkSize:e,CompressionStreamFallback:r,CompressionStream:n}){super({});const{compressed:a,encrypted:s,useCompressionStream:i,zipCrypto:o,computeCrc32:c,level:l,deflate64:d,format:u,compressionMethod:f}=t,w=this;let h,p,m,y=super.readable;const b=u&&Q(u),S=c&&a&&!d&&!b&&(!s||o)&&!(!i||!n);if(s&&!o||!c||S||(h=new dt,y=Ae(y,h)),a)if(b)y=Fe(y,Re(b.CompressionStream,u,{level:l,chunkSize:e,compressionMethod:f}));else if(S)m=new ye,y=Fe(y,new n(he)),y=Ae(y,m);else try{y=ze(y,i,{level:l,chunkSize:e},n,r)}catch(t){let e;try{e=new n(he)}catch{throw t}y=Fe(y,e),y=Ae(y,new ye)}s&&(o?y=Ae(y,new te(t)):(p=new Ht(t),y=Ae(y,p))),xe(w,y,()=>{s&&!o||!c||(w.crc32=S?m.crc32:new DataView(h.value.buffer).getUint32(0))})}}class ye extends TransformStream{constructor(){let t,e=10,r=new Uint8Array(0);super({transform(t,n){if(e){const r=Math.min(e,t.length);if(e-=r,!(t=t.subarray(r)).length)return}const a=r.length+t.length;if(8>=a)return void(r=ft(r,t));const s=a-8,i=Math.min(s,r.length);n.enqueue(ft(r.subarray(0,i),t.subarray(0,s-i))),r=ft(r.subarray(i),t.subarray(s-i))},flush(){const e=ht(r);t.crc32=e.getUint32(0,!0),t.uncompressedSize=e.getUint32(4,!0)}}),t=this}}class be extends TransformStream{constructor(t,{chunkSize:e,DecompressionStreamFallback:r,DecompressionStream:n}){super({});const{zipCrypto:a,encrypted:s,checkCrc32:i,crc32:o,compressed:c,useCompressionStream:l,deflate64:d,format:u,compressionMethod:f,rawBitFlag:w,outputSize:h}=t;let p,m,y=super.readable;if(s&&(a?y=Ae(y,new $t(t)):(m=new Zt(t),y=Ae(y,m))),c){const t=u&&Q(u);if(t)y=Fe(y,Re(t.DecompressionStream,u,{chunkSize:e,compressionMethod:f,rawBitFlag:w,uncompressedSize:h}));else try{y=ze(y,l,{chunkSize:e,deflate64:d},n,r)}catch(t){if(d||h===D)throw t;let e;try{e=new n(he)}catch{throw t}y=((t,e,r)=>{const n=new lt;let a,s,i,o=0,c=!1;const l=new Promise((t,e)=>{s=t,i=e});l.catch(()=>{}),r||s();const d=new TransformStream({start(t){const e=new Uint8Array(10);e.set(pe),t.enqueue(e)},transform(t,e){e.enqueue(t)},async flush(t){c=!0,f();try{await l}finally{w()}const e=new Uint8Array(8),a=ht(e);a.setUint32(0,n.get(),!0),a.setUint32(4,r,!0),t.enqueue(e)},cancel(t){i(t)}}),u=new TransformStream({transform(t,e){n.append(t),o+=t.length,r>o?c&&f():s(),e.enqueue(t)},cancel(t){i(t)}});return t=Ae(t,d),Ae(t=Fe(t,e),u);function f(){w(),a=setTimeout(()=>i(Error(de)),5e3)}function w(){clearTimeout(a)}})(y,e,h)}y=(t=>{const e=t.getReader();return new ReadableStream({async pull(t){let r;try{r=await e.read()}catch(t){if(t&&t.message)throw t;const e=Error(ue);throw e.cause=t,e}const{value:n,done:a}=r;a?t.close():t.enqueue(n)},cancel:t=>e.cancel(t)})})(y)}i&&(p=new dt,y=Ae(y,p)),xe(this,y,()=>{if(i){const t=new DataView(p.value.buffer);if(o!=t.getUint32(0,!1))throw Error(fe)}})}}const Se=new Map;function Ee(t,e){if(!t)return!1;let r=Se.get(t);r||(r=new Map,Se.set(t,r));let n=r.get(e);if(n===D){try{new t(e),n=!0}catch{n=!1}r.set(e,n)}return n}function ge(t){return Ee(t,we)}function xe(t,e,r){e=Ae(e,new TransformStream({flush:r})),Object.defineProperty(t,"readable",{get:()=>e})}function Re(t,e,r){if(!t)throw Error("Compression method not supported");return new t(e,r)}function ze(t,e,r,n,a){const s=e&&n?n:a||n,i=r.deflate64?"deflate64-raw":we;let o;try{o=new s(i,r)}catch(t){if(!e||!a||s==a)throw t;o=new a(i,r)}return Fe(t,o)}function Ae(t,e){return ce(t).pipeThrough(e)}function Fe(t,e){const r=e.writable.getWriter(),n=t.getReader();return(async()=>{try{for(;;){await r.ready;const t=await n.read();if(t.done){await r.close();break}await r.write(t.value)}}catch(t){await(async(t,e)=>{try{await t.abort(e)}catch{}})(r,t),await(async(t,e)=>{try{await t.cancel(e)}catch{}})(n,t)}})(),e.readable}const De="data",Ue="deflate",Oe="inflate";class Te extends TransformStream{constructor(t,e){super({});const r=this,{codecType:n}=t;let a;n.startsWith(Ue)?a=me:n.startsWith(Oe)&&(a=be),r.outputSize=0;let s=0;const i=new a(t,e),o=super.readable,c=new TransformStream({transform(t,e){t&&t.length&&(s+=t.length,e.enqueue(t))},flush(){Object.assign(r,{inputSize:s})}}),l=new TransformStream({transform(e,n){if(e&&e.length&&(n.enqueue(e),r.outputSize+=e.length,t.outputSize!==D&&r.outputSize>t.outputSize))throw Error(de)},flush(){const{crc32:t}=i;Object.assign(r,{crc32:t,inputSize:s})}});Object.defineProperty(r,"readable",{get:()=>o.pipeThrough(c).pipeThrough(i).pipeThrough(l)})}}class ke extends TransformStream{constructor(t){const e=[];let r=0;function n(){const n=new Uint8Array(t);let a=0;for(;t>a;){const r=e[0],s=t-a;r.length>s?(n.set(r.subarray(0,s),a),e[0]=r.subarray(s),a+=s):(n.set(r,a),a+=r.length,e.shift())}return r-=t,n}Number.isFinite(t)&&t>=1||(t=65536),super({transform(a,s){for(e.push(a),r+=a.length;r>t;)s.enqueue(n())},flush(t){r&&t.enqueue(((t,e)=>{const r=new Uint8Array(e);let n=0;for(const e of t)r.set(e,n),n+=e.length;return r})(e,r))}})}}const Ce={type:"module"},ve="error",Me="Worker startup timeout";let Ie,je,Ne,Pe,We,_e=!0;try{_e=typeof structuredClone==T&&structuredClone(new DOMException("","AbortError")).code!==D}catch{}let Le=()=>{};class Be{constructor(t,{readable:e,writable:r},{options:n,config:a,lt:s,useWebWorkers:i,transferStreams:o,workerURI:c,createWorker:l},d){const{signal:u}=s;return We&&(l=D),Object.assign(t,{ut:!0,ft:(t.ft||0)+1,readable:e.pipeThrough(new ke(N(a))).pipeThrough(new Ve(s),{signal:u}),writable:r,options:Object.assign({},n),workerURI:c,createWorker:l,transferStreams:o,terminate:()=>new Promise(e=>{const{wt:r,ut:n}=t;r?(n?t.ht=e:(r.terminate(),e()),t.yt=null):e()}),bt(){if(t.ut){const{ht:e}=t;e&&(t.ht=null,t.St=!0,t.wt.terminate(),e()),t.ut=!1,d(t)}}}),Ie===D&&(Ie=typeof Worker!=O),(i&&(Ie&&c||l)?qe:He)(t,a)}}class Ve extends TransformStream{constructor({onstart:t,onprogress:e,size:r,onend:n}){let a=0;super({async start(){t&&await Ze(t,r)},async transform(t,n){a+=t.length,e&&await Ze(e,a,r),n.enqueue(t)},async flush(){n&&await Ze(n,a)}})}}async function Ze(t,...e){try{await t(...e)}catch{}}function He(t,e){return{run:()=>Ke(t,e)}}function qe(t,e){const{baseURI:r,chunkSize:n,workerStartupTimeout:a}=e;let{wasmURI:s}=e;if(!t.yt){let i;typeof s==T&&(s=s());try{i=Ge(t.workerURI,r,t)}catch{return t.createWorker?We=!0:Ie=!1,He(t,e)}Object.assign(t,{wt:i,Et:!1,St:!1,yt:{run:async()=>{try{return await(async(t,e)=>{let r,n;const a=new Promise((t,e)=>{r=t,n=e});Object.assign(t,{reader:null,writer:null,gt:r,xt:n,result:a});const{readable:s,options:i}=t,{writable:o,closed:c,Rt:l}=(t=>{const e=new AbortController,{writable:r,readable:n}=new TransformStream,a=n.pipeTo(t,{preventClose:!0,preventAbort:!0,signal:e.signal});return a.catch(()=>{}),{writable:r,closed:a,Rt:()=>e.abort()}})(t.writable);let d;try{d=Qe({type:"start",options:i,config:e,readable:s,writable:o},t)}catch(e){l();try{await c}catch{}throw t.bt(),e}d||Object.assign(t,{reader:s.getReader(),writer:o.getWriter()});const{workerStartupTimeout:u}=e;t.Et||!Number.isFinite(u)||0>u||(t.zt=setTimeout(()=>(t=>{if(t.zt=null,t.Et)return;const{xt:e,writer:r}=t;if(Ye(t),t.wt=null,e){const t=Error(Me);t.At=!0,e(t),r&&r.releaseLock()}})(t),u));try{const t=await a;return await f(),await c,t}catch(t){await f(),l();try{await c}catch{}throw t}async function f(){if(!d&&!o.locked)try{await o.getWriter().close()}catch{}}})(t,{chunkSize:n,wasmURI:s,baseURI:r,workerStartupTimeout:a})}catch(r){if(r&&r.At){t.createWorker?We=!0:Ie=!1;const{reader:r}=t;return r&&r.releaseLock(),t.reader=null,t.writer=null,Ke(t,e)}throw r}}}})}return t.yt}async function Ke({options:t,readable:e,writable:r,bt:n},a){let s;try{if(t.compressed&&!t.format){const e=t.codecType.startsWith(Ue),r=e?a.CompressionStreamFallback:a.DecompressionStreamFallback,n=e?a.CompressionStream:a.DecompressionStream;if(t.useCompressionStream){if(r&&r.Ft&&!ge(n))try{await Le(a)}catch{}}else try{await Le(a)}catch{r&&!r.Ft||(t.useCompressionStream=!0)}}s=new Te(t,a),await e.pipeThrough(s).pipeThrough(new ke(N(a))).pipeTo(r,{preventClose:!0,preventAbort:!0});const{crc32:n,inputSize:i,outputSize:o}=s;return{crc32:n,inputSize:i,outputSize:o}}catch(t){throw s&&(t.outputSize=s.outputSize),t}finally{n()}}function Ye(t){const{wt:e}=t;if(e)try{e.terminate()}catch{}t.yt=null}function Ge(t,e,r,n,a=!0){const{createWorker:s}=r;let i,o,c;if(s)i=s();else if(Ne===D||je!==t){const s=typeof t==T;o=s?t(a):t;const l=o.startsWith("data:"),d=o.startsWith("blob:");if(l||d){n===D&&(n=!1),n&&(c=Ce);try{i=new Worker(o,c)}catch(a){if(d)try{URL.revokeObjectURL(o)}catch{}if(s&&d)return Ge(t,e,r,n,!1);if(n)throw a;return Ge(t,e,r,!0,!1)}}else{n===D&&(n=!0),n&&(c=Ce);try{o=new URL(o,e)}catch{}try{i=new Worker(o,c)}catch(s){if(n)throw s;return Ge(t,e,r,!1,a)}}je=t,Ne=o,Pe=c}else i=new Worker(Ne,Pe);return i.addEventListener("message",t=>{r.Et=!0,Xe(r),(async({data:t},e)=>{const{type:r,value:n,messageId:a,result:s,error:i}=t,{reader:o,writer:c,gt:l,xt:d,bt:u,ft:f}=e,w=()=>e.ft!=f;try{if(i){const{message:t,stack:e,code:r,name:n,outputSize:a,cause:s}=i,o=Error(t);Object.assign(o,{stack:e,code:r,name:n,outputSize:a}),s&&(o.cause=Object.assign(Error(s.message),{name:s.name})),h(o)}else{if("pull"==r){const{value:t,done:r}=await o.read();w()||Qe({type:De,value:t,done:r,messageId:a},e)}r==De&&(await c.ready,await c.write(new Uint8Array(n)),w()||Qe({type:"ack",messageId:a},e)),"close"==r&&h(null,s)}}catch(i){w()||(Ye(e),h(i))}function h(t,e){w()||(t?d(t):l(e),c&&c.releaseLock(),u())}})(t,r)}),i.addEventListener(ve,t=>Je(t,r)),i.addEventListener("messageerror",t=>Je(t,r)),i}function Xe(t){const{zt:e}=t;e&&(clearTimeout(e),t.zt=null)}function Je(t,e){t.preventDefault&&t.preventDefault(),Xe(e);const{Et:r,xt:n,writer:a,bt:s}=e;if(Ye(e),r||(e.wt=null),n){let e=t.error||Error(t.message||ve);r||(e=Object.assign(Error(e.message||ve),{At:!0})),n(e),a&&a.releaseLock(),r&&s()}}function Qe(t,{wt:e,writer:r,transferStreams:n,Et:a}){try{const{value:r,readable:s,writable:i}=t,o=[];if(r&&(t.value=wt(r),o.push(t.value.buffer)),n&&_e&&a?(s&&o.push(s),i&&o.push(i)):t.readable=t.writable=null,o.length)try{return e.postMessage(t,o),!0}catch{_e=!1,t.readable=t.writable=null,e.postMessage(t)}else e.postMessage(t)}catch(t){throw r&&r.releaseLock(),t}}let $e=[];const tr=[];let er,rr,nr=0;async function ar(t,e){const{options:r,config:n}=e,{transferStreams:a,useWebWorkers:s,useCompressionStream:i,compressed:o,checkCrc32:c,computeCrc32:l,encrypted:d,format:u,codecURI:f}=r,{workerURI:w,createWorker:h,maxWorkers:p}=n;u&&(f&&(r.codecURI=((t,e)=>{try{return new URL(t,e).toString()}catch{return t}})(f,n.baseURI)),await(async(t,e)=>{!Y.has(t)&&e&&$(t,await(import(/* webpackIgnore: true */ /* @vite-ignore */e)))})(u,r.codecURI)),e.transferStreams=a||a===D&&n.transferStreams;const m=!(o||c||l||d),y=u===D||!!r.codecURI;return e.useWebWorkers=!m&&y&&(s||s===D&&n.useWebWorkers),e.workerURI=e.useWebWorkers&&w?w:D,e.createWorker=e.useWebWorkers&&h?h:D,r.useCompressionStream=i||i===D&&n.useCompressionStream,(await(async()=>{const r=$e.find(t=>!t.ut);if(r)return lr(r),new Be(r,t,e,b);if($e.length<p){const r={Dt:nr};return nr++,$e.push(r),new Be(r,t,e,b)}return new Promise(r=>{tr.push({resolve:r,stream:t,Ut:e}),rr=n.workerStarvationTimeout,sr()})})()).run();function b(t){if(ir(),tr.length){const[{resolve:e,stream:r,Ut:n}]=tr.splice(0,1);e(new Be(t,r,n,b)),sr()}else t.wt?(lr(t),((t,e)=>{const{config:r}=e,{terminateWorkerTimeout:n}=r;Number.isFinite(n)&&n>=0&&(t.St?t.St=!1:t.Ot=setTimeout(async()=>{$e=$e.filter(e=>e!=t);try{await t.terminate()}catch{}},n))})(t,e)):$e=$e.filter(e=>e!=t)}}function sr(){!er&&tr.length&&Number.isFinite(rr)&&rr>=0&&(er=setTimeout(or,rr))}function ir(){er&&(clearTimeout(er),er=null)}function or(){if(er=null,tr.length){const[{resolve:t,stream:e,Ut:r}]=tr.splice(0,1),n=Object.assign({},r,{useWebWorkers:!1,workerURI:D,createWorker:D});t(new Be({},e,n,cr)),sr()}}function cr(){ir(),sr()}function lr(t){const{Ot:e}=t;e&&(clearTimeout(e),t.Ot=null)}const dr="HTTP error ",ur="HTTP Range not supported",fr="HTTP resource changed",wr="Writer iterator completed too soon",hr="Writer not initialized",pr="Content-Range",mr="Range",yr="GET",br="bytes",Sr=16777216,Er="writable",gr=Symbol();class xr{constructor(){this.size=0}init(){this.initialized=!0}}class Rr extends xr{get readable(){return this.createReadable()}createReadable({offset:t=0,size:e,chunkSize:r=N(j())}={}){const n=this;let a=0;return new ReadableStream({async pull(s){const i=e===D?r:Math.min(r,e-a),o=await sn(n,t+a,i);s.enqueue(o),a+r>e||e===D&&!o.length&&i?s.close():a+=r}})}}class zr extends xr{constructor(){super();const t=this,e=new WritableStream({write(e){if(!t.initialized)throw Error(hr);return t.writeUint8Array(wt(e))}});Object.defineProperty(t,Er,{get:()=>e})}writeUint8Array(){}}class Ar extends Rr{constructor(t){super();let e=t.length;for(;"="==t.charAt(e-1);)e--;const r=t.indexOf(",")+1;Object.assign(this,{dataURI:t,Tt:r,size:Math.floor(.75*(e-r))})}readUint8Array(t,e){const{Tt:r,dataURI:n}=this,a=new Uint8Array(e),s=4*Math.floor(t/3),i=atob(n.substring(s+r,4*Math.ceil((t+e)/3)+r)),o=t-3*Math.floor(s/4);let c=0;for(let t=o;o+e>t&&t<i.length;t++)a[t-o]=i.charCodeAt(t),c++;return c<a.length?a.subarray(0,c):a}}class Fr extends zr{constructor(t){super(),Object.assign(this,{data:"data:"+(t||"")+";base64,",pending:[]})}writeUint8Array(t){const e=this;let r,n=e.pending;const a=e.pending.length;for(e.pending="",r=0;r<3*Math.floor((a+t.length)/3)-a;r++)n+=String.fromCharCode(t[r]);for(;r<t.length;r++)e.pending+=String.fromCharCode(t[r]);n.length>2?e.data+=btoa(n):e.pending=n+e.pending}getData(){return this.data+btoa(this.pending)}}let Dr,Ur;class Or extends Rr{constructor(t){super(),Object.assign(this,{blob:t,size:t.size}),Ur||(Ur=(async()=>{try{const t=new Blob([new Uint8Array(3)]).slice(1,2).stream().getReader();let e=0,r=await t.read();for(;!r.done;)e+=r.value.length,r=await t.read();Dr=1==e}catch{Dr=!1}})())}createReadable(t){const{blob:e,size:r}=this,{offset:n=0,size:a=r-n}=t||{};return n||r>a?Dr?ce(e.slice(n,n+a).stream()):super.createReadable(t):ce(e.stream())}async readUint8Array(t,e){const r=this,n=t+e,a=t||n<r.size?r.blob.slice(t,n):r.blob;let s=await a.arrayBuffer();return s.byteLength>e&&(s=s.slice(t,n)),new Uint8Array(s)}}class Tr extends xr{constructor(t){super();const e=this,r=new TransformStream;if(Object.defineProperty(e,Er,{get:()=>r.writable}),typeof Blob.prototype.stream!=T||new Blob([]).stream()instanceof ReadableStream){const n=[];t&&n.push(["Content-Type",t]),e.blob=new Response(r.readable,{headers:n}).blob()}else{const n=[];e.blob=r.readable.pipeTo(new WritableStream({write(t){n.push(t)}})).then(()=>new Blob(n,{type:t}))}e.blob.catch(()=>{})}getData(){return this.blob}}class kr extends Or{constructor(t){super(new Blob([t],{type:"text/plain"}))}}class Cr extends Tr{constructor(t){super(t),Object.assign(this,{encoding:t,kt:!t||"utf-8"==t.toLowerCase()})}async getData(){const{encoding:t,kt:e}=this,r=await super.getData();if(r.text&&e)return r.text();{const e=new FileReader;return new Promise((n,a)=>{Object.assign(e,{onload:({target:t})=>n(t.result),onerror:()=>a(e.error)}),e.readAsText(r,t)})}}}class vr extends Rr{constructor(t,e){super(),Ir(this,t,e)}async init(){await jr(this,Yr,Zr),super.init()}createReadable(t){const e=this,{useRangeHeader:r,forceRangeRequests:n,size:a}=e;if((r||n)&&a!==D){const{offset:r=0,size:n=a-r}=t||{};if(n>0&&a>r)return((t,e,r)=>{let n,a=e,s=0,i=r;return new ReadableStream({start:()=>o(),async pull(t){n||await o();const{value:e,done:r}=await n.read();if(r)throw Error(ur);const a=e.length>s?e.subarray(0,s):e;s-=a.length,i-=a.length,a.length&&t.enqueue(a),s||(await(async()=>{const t=n;n=D,await t.cancel()})(),i||t.close())},cancel:t=>n&&n.cancel(t)});async function o(){const e=Math.min(t.maximumRangeSize,i),r=await Yr(yr,t,Br(t,a,e));if(206!=r.status)throw Error(ur);const o=r.headers.get(pr);if(o){const t=Number(o.trim().split(/[\s-]+/)[1]);if(!Number.isNaN(t)&&t!=a)throw Error(ur)}Lr(t,r),_r(t,r),a+=e,s=e,n=r.body.getReader()}})(e,r,Math.min(n,a-r))}return super.createReadable(t)}readUint8Array(t,e){return Nr(this,t,e,Yr,Zr)}}class Mr extends Rr{constructor(t,e){super(),Ir(this,t,e)}async init(){await jr(this,Gr,Hr),super.init()}readUint8Array(t,e){return Nr(this,t,e,Gr,Hr)}}function Ir(t,e,r){const{preventHeadRequest:n,useRangeHeader:a,forceRangeRequests:s,combineSizeEocd:i,checkResourceChanges:o=!0,maximumRangeSize:c=Sr,fetch:l}=r;delete(r=Object.assign({},r)).preventHeadRequest,delete r.useRangeHeader,delete r.forceRangeRequests,delete r.combineSizeEocd,delete r.checkResourceChanges,delete r.maximumRangeSize,delete r.useXHR,delete r.fetch,Object.assign(t,{url:e,options:r,preventHeadRequest:n,useRangeHeader:a,forceRangeRequests:s,combineSizeEocd:i,checkResourceChanges:o,maximumRangeSize:c,fetch:l})}async function jr(t,e,r){const{url:n,preventHeadRequest:a,useRangeHeader:s,forceRangeRequests:i,combineSizeEocd:o}=t;if((t=>{const{baseURI:e}=j(),{protocol:r}=new URL(t,e);return"http:"==r||"https:"==r})(n)&&(s||i)&&(void 0===a||a)){const n=await e(yr,t,Br(t,o?-22:void 0)),a=n.headers.get("Accept-Ranges");if(!(i||a&&a.toLowerCase()==br))throw Error(ur);{if(o){const e=new Uint8Array(await n.arrayBuffer());206==n.status&&e.length==u&&(t.Ct=e)}_r(t,n);const a=Pr(n);a===D?await Kr(t,e,r):t.size=a}}else await Kr(t,e,r)}async function Nr(t,e,r,n,a){const{useRangeHeader:s,forceRangeRequests:i,Ct:o,size:c,options:l}=t;if(s||i){if(o&&e==c-u&&r==u)return o;if(c>e&&0!==r){e+r>c&&(r=c-e);const a=await n(yr,t,Br(t,e,r));if(206!=a.status)throw Error(ur);const s=a.headers.get(pr);if(s){const t=Number(s.trim().split(/[\s-]+/)[1]);if(!Number.isNaN(t)&&t!=e)throw Error(ur)}Lr(t,a),_r(t,a);const i=new Uint8Array(await a.arrayBuffer());if(i.length!=r)throw Error(ur);return i}return k}{const{data:n}=t;return n||await a(t,l),t.data.subarray(e,e+r)}}function Pr(t){const e=t.headers.get(pr);if(e){const t=e.trim().split(/\s*\/\s*/)[1];if(t&&"*"!=t){const e=Number(t);if(!Number.isNaN(e))return e}}}function Wr({headers:t}){return{vt:t.get("Etag")||D,lastModified:t.get("Last-Modified")||D}}function _r(t,e){const{checkResourceChanges:r,Mt:n}=t;r&&!n&&206==e.status&&(t.Mt=Wr(e))}function Lr(t,e){const{checkResourceChanges:r,Mt:n,size:a}=t;if(r){const t=Pr(e);if(t!==D&&a!==D&&t!=a)throw Error(fr);if(n){const t=Wr(e);if(Object.entries(n).some(([e,r])=>r!==D&&t[e]!==D&&r!=t[e]))throw Error(fr)}}}function Br(t,e=0,r=1){return Object.assign({},Vr(t),{[mr]:br+"="+(0>e?e:e+"-"+(e+r-1))})}function Vr({options:t}){const{headers:e}=t;if(e)return Symbol.iterator in e?Object.fromEntries(e):e}async function Zr(t){await qr(t,Yr)}async function Hr(t){await qr(t,Gr)}async function qr(t,e){const r=await e(yr,t,Vr(t));t.data=new Uint8Array(await r.arrayBuffer()),t.size=t.data.length}async function Kr(t,e,r){if(t.preventHeadRequest)await r(t,t.options);else{const n=await e("HEAD",t,Vr(t)),a=n.headers.get("Content-Length");a&&!n.headers.get("Content-Encoding")?t.size=Number(a):await r(t,t.options)}}async function Yr(t,{fetch:e=fetch,options:r,url:n},a){const s=await e(n,Object.assign({},r,{method:t,headers:a}));if(400>s.status)return s;throw 416==s.status?Error(ur):Error(dr+(s.statusText||s.status))}function Gr(t,{url:e},r){return new Promise((n,a)=>{const s=new XMLHttpRequest;if(s.addEventListener("load",()=>{if(400>s.status){const t=[];s.getAllResponseHeaders().trim().split(/[\r\n]+/).forEach(e=>{const r=e.trim().split(/\s*:\s*/);r[0]=r[0].trim().replace(/^[a-z]|-[a-z]/g,t=>t.toUpperCase()),t.push(r)}),n({status:s.status,arrayBuffer:()=>s.response,headers:new Map(t)})}else a(416==s.status?Error(ur):Error(dr+(s.statusText||s.status)))},!1),s.addEventListener("error",t=>a(t.detail?t.detail.error:Error("Network error")),!1),s.open(t,e),r)for(const t of Object.entries(r))s.setRequestHeader(t[0],t[1]);s.responseType="arraybuffer",s.send()})}class Xr extends Rr{constructor(t,e={}){super(),Object.assign(this,{url:t,reader:e.useXHR&&!e.fetch?new Mr(t,e):new vr(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 Jr extends Xr{constructor(t,e={}){super(t,Object.assign({},e,{useRangeHeader:!0}))}}class Qr extends Rr{constructor(t){super(),t=new Uint8Array(t.buffer,t.byteOffset,t.byteLength),Object.assign(this,{array:t,size:t.length})}readUint8Array(t,e){return this.array.slice(t,t+e)}}class $r extends zr{constructor(t){super(),this.defaultBufferSize=t||262144}init(t=0){Object.assign(this,{offset:0,array:new Uint8Array(t>0?t:this.defaultBufferSize)}),super.init()}writeUint8Array(t){const e=this,r=e.offset+t.length;if(r>e.array.length){let t=e.array.length?2*e.array.length:e.defaultBufferSize;for(;r>t;)t*=2;const n=e.array;e.array=new Uint8Array(t),e.array.set(n)}e.array.set(t,e.offset),e.offset+=t.length}getData(){return this.offset===this.array.length?this.array:this.array.slice(0,this.offset)}}class tn extends Rr{constructor(t){super(),this.It=t}async init(){const t=this,{It:e}=t;t.jt=0,await Promise.all(e.map(t=>an(t))),t.Nt=e.map(e=>{const r=t.size;return t.size+=e.size,r}),super.init()}Pt(t){const{Nt:e,size:r}=this,n=e[t];return n===D?r:n}async readUint8Array(t,e){const r=this,{It:n}=this;let a,s=0,i=t;for(;n[s]&&i>=n[s].size;)i-=n[s].size,s++;const o=n[s];if(o){const n=o.size;if(i+e>n){const s=n-i;a=ft(await sn(o,i,s),await r.readUint8Array(t+s,e-s))}else a=await sn(o,i,e)}else a=k;return r.jt=Math.max(s,r.jt),a}}class en extends xr{constructor(t,e=4294967295){super();const r=this;let n,a,s;Object.assign(r,{diskNumber:0,diskOffset:0,size:0,maxSize:e,availableSize:e});const i=new WritableStream({async write(e){if(e===gr)return void(s&&await c());const{availableSize:i}=r;if(s)e.length<i?await o(e):(await o(e.subarray(0,i)),await c(),e.length>i&&await this.write(e.subarray(i)));else{const{value:i,done:o}=await t.next();if(o&&!i)throw Error(wr);n=i,n.size=0,n.maxSize&&(r.maxSize=n.maxSize),r.availableSize=r.maxSize,await an(n),a=i.writable,s=a.getWriter(),await this.write(e)}},async close(){s&&(await s.ready,await l())},async abort(t){s&&await s.abort(t)}});async function o(t){const e=t.length;e&&(await s.ready,await s.write(t),n.size+=e,r.availableSize-=e)}async function c(){await l(),r.diskOffset+=n.size,r.diskNumber++,s=null,r.availableSize=r.maxSize}async function l(){await s.close()}Object.defineProperty(r,Er,{get:()=>i})}async closeDisk(){const t=this.writable.getWriter();try{await t.ready,await t.write(gr)}finally{t.releaseLock()}}}class rn{constructor(t){return Array.isArray(t)&&(t=new tn(t)),(t instanceof ReadableStream||typeof t.getReader==T)&&(t={readable:ce(t)}),t}}class nn{constructor(t){return t.writable===D&&typeof t.next==T&&(t=new en(t)),(t instanceof WritableStream||typeof t.getWriter==T)&&(t={writable:le(t)}),t.size===D&&(t.size=0),t}}async function an(t,e){if(!t.init||t.initialized)return Promise.resolve();await t.init(e)}function sn(t,e,r){return t.readUint8Array(e,r)}const on="\0☺☻♥♦♣♠•◘○◙♂♀♪♫☼►◄↕‼¶§▬↨↑↓→←∟↔▲▼ !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~⌂ÇüéâäàåçêëèïîìÄÅÉæÆôöòûùÿÖÜ¢£¥₧ƒáíóúñѪº¿⌐¬½¼¡«»░▒▓│┤╡╢╖╕╣║╗╝╜╛┐└┴┬├─┼╞╟╚╔╩╦╠═╬╧╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀αßΓπΣσµτΦΘΩδ∞φε∩≡±≥≤⌠⌡÷≈°∙·√ⁿ²■ ".split("");function cn(t,e){return e&&"cp437"==e.trim().toLowerCase()?(t=>{{let e="";for(let r=0;r<t.length;r++)e+=on[t[r]];return e}})(t):new TextDecoder(e,{ignoreBOM:!0}).decode(t)}const ln="filename",dn="rawFilename",un="comment",fn="rawComment",wn="uncompressedSize",hn="compressedSize",pn="offset",mn="diskNumberStart",yn="lastModDate",bn="rawLastModDate",Sn="lastAccessDate",En="rawLastAccessDate",gn="creationDate",xn="rawCreationDate",Rn="internalFileAttributes",zn="externalFileAttributes",An="msdosAttributesRaw",Fn="msdosAttributes",Dn="msDosCompatible",Un="zip64",On="encrypted",Tn="version",kn="versionMadeBy",Cn="zipCrypto",vn="directory",Mn="executable",In="compressionMethod",jn="signature",Nn="extraField",Pn="unixMode",Wn="setuid",_n="setgid",Ln="sticky",Bn=[ln,dn,wn,hn,yn,bn,un,fn,Sn,En,gn,xn,pn,mn,Rn,zn,An,Fn,Dn,Un,On,Tn,kn,Cn,vn,Mn,In,jn,"crc32",Nn,"extraFieldUnix","extraFieldInfoZip","extraFieldUnixType1","extraFieldPkwareUnix","uid","gid",Pn,Wn,_n,Ln,"bitFlag","filenameUTF8","commentUTF8","rawExtraField","extraFieldZip64","extraFieldUnicodePath","extraFieldUnicodeComment","extraFieldAES","extraFieldNTFS","extraFieldExtendedTimestamp","extraFieldUSDZ"];class Vn{constructor(t){Bn.forEach(e=>this[e]=t[e])}}const Zn="password",Hn="rawPassword",qn="passThrough",Kn="signal",Yn="checkAmbiguity",Gn="useWebWorkers",Xn="useCompressionStream",Jn="transferStreams",Qn="preventClose",$n="offset",ta="usdz",ea="strictness",ra="strict",na="tolerant",aa="File format is not recognized",sa="End of central directory not found",ia="End of Zip64 central directory locator not found",oa="Central directory header not found",ca="Local file header not found",la="Zip64 extra field not found",da="File contains encrypted entry",ua="Encryption method not supported",fa="Compression method not supported",wa="Split zip file",ha="Overlapping entry found",pa="Ambiguous archive",ma="Encrypted central directory is not supported",ya="utf-8",ba="cp437",Sa=[[wn,t],[hn,t],[pn,t],[mn,e]],Ea={[e]:{Wt:Ka,bytes:4},[t]:{Wt:Ya,bytes:8}};class ga{constructor(t,e={}){Object.assign(this,{reader:new rn(t),options:e,config:j(),_t:new Map})}async*getEntriesGenerator(n={}){const s=this;let{reader:c}=s;const{config:h}=s;if(await an(c),c.size!==D&&c.readUint8Array||(c=new Or(await new Response(c.readable).blob()),await an(c)),c.size<u)throw Error(aa);const p=Ca(Ba(s,n,ea),Ba(s,n,Yn)),m=p==ra,y=p!=na,b=((t,r)=>t!==D?t:r==ra?0:r==na?1/0:e)(Ba(s,n,"maxAppendedDataSize"),p),{Lt:S,Bt:z}=await(async(t,e,r)=>{const{size:n}=t,a=Math.min(n,65557),s={count:va};let i,o,c=0;for await(const[r,l,d,f,w]of Na(t,a)){const a=qa(r,f+20);if(w+u+a==n){const a=await Wa(t,r,l,f,w,n,s);if(a==ja){if(i||(i=Pa(d,f,w)),c++,!e||c>1)break}else a!=Ia||o||(o=Pa(d,f,w))}}return i||(i=o),i||(i=await(async(t,e,r)=>{const{size:n}=t,a=Math.min(n,e==1/0?n:65557+e);let s,i;for await(const[e,o,c,l,d]of Na(t,a)){const a=Pa(c,l,d);s||(s=a);const u=await Wa(t,e,o,l,d,n,r);if(u==ja)return a;u!=Ia||i||(i=a)}return i||s})(t,r,s)),{Lt:i,Bt:c}})(c,y,b);if(!S)throw Ka(ht(await sn(c,0,4)))==a?Error(wa):Error(sa);y&&z>1&&La("multiple end of central directory records");const A=ht(S);let F=Ka(A,12),U=Ka(A,16);const O=S.offset,T=qa(A,20),C=O+u+T;c.size-C>b&&La("appended data");let v=qa(A,4);const M=c.jt||0;let I,j,N,P,W=qa(A,6),_=qa(A,10),L=0;const B=U==t||F==t||_==e||W==e;if(U!=t&&W!=e&&(U+=ka(c,W)),B){const r=S.offset<f?k:await sn(c,S.offset-f,f),n=ht(r);if(r.length==f&&Ka(n,0)==d){U=ka(c,Ka(n,4))+Ya(n,8);let r=await sn(c,U,w),a=ht(r);const s=S.offset-f-w;if((r.length<w||Ka(a,0)!=l)&&U!=s&&s>=0){const t=U;U=s,U>t&&(L=U-t),r=await sn(c,U,w),a=ht(r)}if(r.length<w||Ka(a,0)!=l)throw Error(ia);if(j=!0,N=Ya(a,4)>44,N){const t=Math.min(Number(Ya(a,4))-44,c.size-U-w);t>0&&(P=(t=>{const e={rawExtensibleData:t};if(t.length>=28){const r=ht(t),n=qa(r,26);Object.assign(e,{compressionMethod:qa(r,0),compressedSize:Number(Ya(r,2)),uncompressedSize:Number(Ya(r,10)),encryptionAlgorithm:qa(r,18),bitLength:qa(r,20),flags:qa(r,22),hashAlgorithm:qa(r,24),hashData:t.subarray(28,28+n)})}return e})(await sn(c,U+w,t)))}v==e?v=Ka(a,16):m&&v!=Ka(a,16)&&La("mismatched zip64 end of central directory record"),W==e?W=Ka(a,20):m&&W!=Ka(a,20)&&La("mismatched zip64 end of central directory record"),_==e?_=Ya(a,32):m&&_!=Ya(a,32)&&La("mismatched zip64 end of central directory record"),F==t?F=Ya(a,40):m&&F!=Ya(a,40)&&La("mismatched zip64 end of central directory record"),U=ka(c,W)+Ya(a,48)+L}}let V=F;const Z=S.offset-(j?76:0);if(U<c.size||(L=c.size-U-F-u,U=c.size-F-u),M!=v)throw Error(wa);if(0>U)throw Error(aa);let H=0,q=await sn(c,U,F),K=ht(q);if(F){if(4>q.length)throw Error(aa);const t=Z-F;if(U!=t&&W==v){let e=!(Ka(K,H)==o);if(e||0>t||t+4>c.size||(e=Ka(ht(await sn(c,t,4)),0)==o),e){const e=U;U=t,U>e&&(L+=U-e),q=await sn(c,U,F),K=ht(q)}}}const Y=Z-U;if(F==Y||0>Y||W!=v||(F=Y,q=await sn(c,U,F),K=ht(q)),0>U||U>=c.size)throw Error(aa);s.directoryOffset=U,s.directoryLength=V;const G=Ba(s,n,"decryptCentralDirectory");let X;G&&_&&q.length>=4&&Ka(K,0)!=o&&(N||za(K))&&(q=await G(q,P),K=ht(q),V=q.length,X=!0),I=U;const J=Ba(s,n,"filenameEncoding"),Q=Ba(s,n,"commentEncoding"),$=m?new Set:D;let tt;for(let t=0;_>t;t++){const a=new Ra(c,h,s.options);if(H+46>q.length||Ka(K,H)!=o){if(0==t&&!X&&(N||za(K)))throw Error(ma);throw Error(oa)}Aa(a,K,H+6);const i=!!a.bitFlag.languageEncodingFlag,l=H+46,d=l+a.filenameLength,u=d+a.extraFieldLength,f=qa(K,H+4),w=!(f>>8),p=f>>8==3,y=q.subarray(l,d),b=qa(K,H+32),S=u+b,z=q.subarray(u,S),A=i,F=i,U=Ka(K,H+38),O=U&r,T={readOnly:!!(1&O),hidden:!!(2&O),system:!!(4&O),directory:!!(16&O),archive:!!(32&O)},k=Ka(K,H+42),C=Ba(s,n,"decodeText")||cn,v=A?ya:J||ba,M=F?ya:Q||ba;let j=C(y,v);j===D&&(j=cn(y,v));let P=C(z,M);P===D&&(P=cn(z,M)),Object.assign(a,{index:t,versionMadeBy:f,msDosCompatible:w,compressedSize:0,uncompressedSize:0,Vt:b,offset:k,diskNumberStart:qa(K,H+34),internalFileAttributes:qa(K,H+36),externalFileAttributes:U,msdosAttributesRaw:O,msdosAttributes:T,rawFilename:y,filenameUTF8:A,commentUTF8:F,rawExtraField:q.subarray(d,u),rawComment:z,filename:j,comment:P}),Fa(a,a,K,H+6),a.offset+=L,I=Math.min(ka(c,a.diskNumberStart)+a.offset,I),m&&($.has(a.filename)&&(tt=!0),$.add(a.filename));const W=a.externalFileAttributes>>16&e;a.unixMode===D&&16877&W&&(a.unixMode=W);const B=!!(a.unixMode&g),V=!!(a.unixMode&x),Z=!!(512&a.unixMode),Y=a.unixMode!==D?!!(73&a.unixMode):p&&!!(73&W),G=a.unixMode!==D&&(61440&a.unixMode)==E,et=(61440&W)==E;Object.assign(a,{setuid:B,setgid:V,sticky:Z,unixExternalUpper:W,internalFileAttribute:a.internalFileAttributes,externalFileAttribute:a.externalFileAttributes,executable:Y,directory:G||et||w&&T.directory||a.filename.endsWith(R)&&!a.uncompressedSize,zipCrypto:a.encrypted&&!a.extraFieldAES});const rt=new Vn(a);rt.getData=(t,e)=>a.getData(t,rt,s._t,e),rt.arrayBuffer=async t=>{const e=new TransformStream,[r]=await Promise.all([new Response(e.readable).arrayBuffer(),a.getData(e,rt,s._t,t)]);return r},H=S;const{onprogress:nt}=n;if(nt)try{await nt(t+1,_,new Vn(a))}catch{}yield rt}let et=H;if(H+6<=q.length&&Ka(K,H)==i){const t=qa(K,H+4);H+6+t>q.length||(s.digitalSignature=q.subarray(H+6,H+6+t),et=H+6+t)}m&&H!=V&&et!=V&&La("trailing central directory data"),tt&&La("duplicate filename"),m&&(L||_&&I>0)&&La("prepended data");const rt=Ba(s,n,"extractPrependedData"),nt=Ba(s,n,"extractAppendedData");return rt&&(s.prependedData=I>0?await sn(c,0,I):k),s.comment=T?await sn(c,O+u,T):k,nt&&(s.appendedData=C<c.size?await sn(c,C,c.size-C):k),!0}async getEntries(t={}){const e=[];for await(const r of this.getEntriesGenerator(t))e.push(r);return e}async close(){}}class xa{constructor(t={}){const{readable:e,writable:r}=new TransformStream,n=new ga(e,t).getEntriesGenerator();this.readable=new ReadableStream({async pull(t){const{done:e,value:r}=await n.next();if(e)return t.close();const a={...r,readable:(()=>{const{readable:t,writable:e}=new TransformStream;if(r.getData)return(async()=>{try{await r.getData(e)}catch(t){try{await e.abort(t)}catch{}}})(),t})()};delete a.getData,t.enqueue(a)}}),this.writable=r}}let Ra=class{constructor(t,e,r){Object.assign(this,{reader:t,config:e,options:r})}async getData(t,e,a,i={}){const o=this,{reader:c,index:l,offset:d,diskNumberStart:u,extraFieldAES:f,extraFieldZip64:w,compressionMethod:h,config:p,bitFlag:m,rawBitFlag:y,crc32:b,rawLastModDate:S,uncompressedSize:E,compressedSize:g}=o,{dataDescriptor:x}=m,R=e.localDirectory={},A=ka(c,u)+d,F=await sn(c,A,z),U=ht(F);let O=Ba(o,i,Zn),T=Ba(o,i,Hn);const C=Ba(o,i,qn);if(O=O&&O.length&&O,T=T&&T.length&&T,f&&99!=f.originalCompressionMethod)throw Error(fa);if(F.length<z||Ka(U,0)!=n)throw Error(ca);Aa(R,U,4);const{extraFieldLength:v,filenameLength:M}=R,I=Ca(Ba(o,i,ea),Ba(o,i,Yn))==ra;let j=k;if(I&&(M||v)){const t=await sn(c,A+z,M+v);j=t.subarray(0,M),R.rawExtraField=t.subarray(M)}else R.rawExtraField=v?await sn(c,A+z+M,v):k;Fa(o,R,U,4,!0),I&&((t,e,r)=>{const{rawFilename:n}=t;(r.length!=n.length||r.some((t,e)=>t!=n[e]))&&La("mismatched local file header (filename)"),(2057&e.rawBitFlag)!=(2057&t.rawBitFlag)&&La("mismatched local file header (general purpose bit flag)"),e.compressionMethod!=t.compressionMethod&&La("mismatched local file header (compression method)"),e.bitFlag.dataDescriptor||!(e.crc32||e.compressedSize||e.uncompressedSize)||e.crc32==t.crc32&&e.compressedSize==t.compressedSize&&e.uncompressedSize==t.uncompressedSize||La("mismatched local file header (crc32 or sizes)")})(o,R,j);const{lastAccessDate:N,creationDate:P}=R;N&&(e.lastAccessDate=N),P&&(e.creationDate=P);const W=o.encrypted&&R.encrypted&&!C,_=W&&!f;if(C||(e.zipCrypto=_),W&&!(64&~R.rawBitFlag))throw Error(ua);const L=C?D:J(h);if(0!=h&&8!=h&&9!=h&&!L&&!C)throw Error(fa);if(W){if(!_&&(1>f.strength||f.strength>3))throw Error(ua);if(!O&&!T)throw Error(da)}const B=A+z+M+v,V=g,Z=ce(c.createReadable({offset:B,size:V})),H=Ba(o,i,Kn),q=Ba(o,i,"checkPasswordOnly");let K=Ba(o,i,"checkOverlappingEntry");const Y=Ba(o,i,"checkOverlappingEntryOnly");Y&&(K=!0);const{onstart:G,onprogress:X,onend:Q}=i,$=9==h;let tt=Ba(o,i,Xn);$&&(tt=!1);const et=Ba(o,i,"checkCrc32"),rt=(et===D?Ba(o,i,"checkSignature"):et)&&!C&&(!W||_||f&&1==f.vendorVersion),nt={options:{codecType:Oe,password:O,rawPassword:T,zipCrypto:_,encryptionStrength:f&&f.strength,checkCrc32:rt,checkAuthenticationCode:Ba(o,i,"checkAuthenticationCode"),passwordVerification:_&&(x?S>>>8&r:b>>>24&r),outputSize:C?g:E,crc32:b,compressed:0!=h&&!C,encrypted:W,useWebWorkers:Ba(o,i,Gn),useCompressionStream:tt,transferStreams:Ba(o,i,Jn),deflate64:$,format:L?L.format:D,codecURI:L?L.codecURI:D,compressionMethod:h,rawBitFlag:y,checkPasswordOnly:q},config:p,lt:{signal:H,size:V,onstart:G,onprogress:X,onend:Q}};let at;K&&await(async({reader:t,Zt:e,index:r,offset:n,crc32:a,compressedSize:i,uncompressedSize:o,Ht:c,dataDescriptor:l,extraFieldZip64:d,_t:u})=>{let f=0;if(l&&(f=d?20:12),f){const r=await sn(t,c+i,f+4);if(r.length==f+4&&Ka(ht(r),0)==s){const t=Ka(ht(r),4);let n,s;d?(n=Ya(ht(r),8),s=Ya(ht(r),16)):(n=Ka(ht(r),8),s=Ka(ht(r),12)),(e.encrypted&&!e.zipCrypto||t==a)&&n==i&&s==o&&(f+=4)}}const w={start:n,end:c+i+f,Zt:e};for(const[t,e]of u)if(t!=r&&w.start<e.end&&e.start<w.end){const t=Error(ha);throw t.qt=e.Zt,t}u.set(r,w)})({reader:c,Zt:e,index:l,offset:A,crc32:b,compressedSize:g,uncompressedSize:E,Ht:B,dataDescriptor:x||R.bitFlag.dataDescriptor,extraFieldZip64:w||R.extraFieldZip64,_t:a});try{if(!Y){q&&(t=new WritableStream),t=new nn(t),await an(t,C?g:E),({writable:at}=t);const{outputSize:e}=await ar({readable:Z,writable:at},nt);if(t.size+=e,e!=(C?g:E))throw Error(de)}}catch(e){if(e.outputSize!==D&&(t.size+=e.outputSize),!q||e.message!=Rt)throw e}finally{Ba(o,i,Qn)||!at||at.locked||await at.getWriter().close()}return q||Y?D:t.getData?t.getData():at}};function za(t){const e=Math.min(t.byteLength,1024)-3;for(let r=0;e>r;r++)if(134630224==Ka(t,r))return!0;return!1}function Aa(t,e,r){const n=t.rawBitFlag=qa(e,r+2),a=!(1&~n),s=Ka(e,r+6);Object.assign(t,{encrypted:a,version:qa(e,r),bitFlag:{level:(6&n)>>1,dataDescriptor:!(8&~n),languageEncodingFlag:(n&S)==S},rawLastModDate:s,lastModDate:Va(s),filenameLength:qa(e,r+22),extraFieldLength:qa(e,r+24)})}function Fa(t,e,r,n,a){const{rawExtraField:s}=e,i=e.extraField=new Map,o=ht(s);let c=0;try{for(;c<s.length;){const t=qa(o,c),e=qa(o,c+2);i.set(t,{type:t,data:s.slice(c+4,c+4+e)}),c+=4+e}}catch{}const l=qa(r,n+4);Object.assign(e,{signature:Ka(r,n+10),crc32:Ka(r,n+10),compressedSize:Ka(r,n+14),uncompressedSize:Ka(r,n+18)});const d=i.get(1);d&&(((t,e)=>{e.zip64=!0;const r=ht(t.data),n=Sa.filter(([t,r])=>e[t]==r),a=n.reduce((t,[,e])=>t+Ea[e].bytes,0);if(t.data.length<a)throw Error(la);for(let a=0,s=0;a<n.length;a++){const[i,o]=n[a],c=Ea[o];e[i]=t[i]=c.Wt(r,s),s+=c.bytes}})(d,e),e.extraFieldZip64=d);const u=i.get(28789);u&&(Da(u,ln,dn,e,t),e.extraFieldUnicodePath=u);const f=i.get(25461);f&&(Da(f,un,fn,e,t),e.extraFieldUnicodeComment=f);const w=i.get(h);w&&w.data.length>=7?(((t,e,r)=>{const n=ht(t.data),a=Ha(n,4);Object.assign(t,{vendorVersion:Ha(n,0),vendorId:Ha(n,2),strength:a,originalCompressionMethod:r,compressionMethod:qa(n,5)}),e.compressionMethod=t.compressionMethod,1!=t.vendorVersion&&(e.crc32=D)})(w,e,l),e.extraFieldAES=w):e.compressionMethod=l;const S=i.get(13);S&&(Ua(S,e),e.extraFieldPkwareUnix=S);const E=i.get(22613);E&&(Ua(E,e),e.extraFieldUnixType1=E);const g=i.get(10);g&&(((t,e)=>{const r=ht(t.data);let n,a=4;try{for(;a<t.data.length&&!n;){const e=qa(r,a),s=qa(r,a+2);1==e&&(n=t.data.slice(a+4,a+4+s)),a+=4+s}}catch{}if(n&&24==n.length){const r=ht(n),a=r.getBigUint64(0,!0),s=r.getBigUint64(8,!0),i=r.getBigUint64(16,!0);Object.assign(t,{rawLastModDate:a,rawLastAccessDate:s,rawCreationDate:i});const o={lastModDate:Za(a),lastAccessDate:Za(s),creationDate:Za(i)};Object.assign(t,o),Object.assign(e,o)}})(g,e),e.extraFieldNTFS=g);const x=i.get(b);if(x)Oa(x,e,!1),e.extraFieldUnix=x;else{const t=i.get(y);t&&(Oa(t,e,!0),e.extraFieldInfoZip=t)}const R=i.get(p);R&&(((t,e,r)=>{if(!t.data.length)return;const n=ht(t.data),a=Ha(n,0),s=[],i=[];r?(1&~a||(s.push(yn),i.push(bn)),2&~a||(s.push(Sn),i.push(En)),4&~a||(s.push(gn),i.push(xn))):5>t.data.length||(s.push(yn),i.push(bn));let o=1;s.forEach((r,a)=>{if(t.data.length>=o+4){const s=Ka(n,o);e[r]=t[r]=new Date(1e3*(0|s));const c=i[a];t[c]=s}o+=4})})(R,e,a),e.extraFieldExtendedTimestamp=R);const z=i.get(m);z&&(e.extraFieldUSDZ=z)}function Da(t,e,r,n,a){if(5>t.data.length)return void(t.valid=!1);const s=ht(t.data),i=new lt;i.append(a[r]);const o=ht(new Uint8Array(4));o.setUint32(0,i.get(),!0);const c=Ka(s,1);Object.assign(t,{version:Ha(s,0),[e]:cn(t.data.subarray(5)),valid:!a.bitFlag.languageEncodingFlag&&c==Ka(o,0)}),t.valid&&(n[e]=t[e],n[e+"UTF8"]=!0)}function Ua(t,e){if(8>t.data.length)return;const r=ht(t.data),n={lastAccessDate:new Date(1e3*Ka(r,0)),lastModDate:new Date(1e3*Ka(r,4))};12>t.data.length||(n.uid=qa(r,8),n.gid=qa(r,10)),Object.assign(t,n),Object.assign(e,n)}function Oa(t,e,r){try{const n=ht(t.data);let a,s;if(r){let e=0;const r=Ha(n,e++),i=Ha(n,e++);a=Ta(t.data.subarray(e,e+i)),e+=i;const o=Ha(n,e++);s=Ta(t.data.subarray(e,e+o)),Object.assign(t,{version:r,uid:a,gid:s})}else 4>t.data.length||(a=qa(n,0),s=qa(n,2),Object.assign(t,{uid:a,gid:s}));a!==D&&(e.uid=a),s!==D&&(e.gid=s)}catch{}}function Ta(t){const e=new Uint8Array(4);return e.set(t,0),new DataView(e.buffer,e.byteOffset,4).getUint32(0,!0)}function ka(t,e){return t.Pt?t.Pt(e):0}function Ca(t,e){return t===D?e?ra:"balanced":t}const va=64,Ma=0,Ia=1,ja=2;async function*Na(t,e){const r=t.size-e,n=await sn(t,r,e),a=ht(n);for(let t=n.length-u;t>=0;t--)Ka(a,t)==c&&(yield[a,r,n,t,r+t])}function Pa(t,e,r){return{offset:r,buffer:t.slice(e,e+u).buffer}}async function Wa(r,n,a,s,i,c,l){const u=qa(n,s+10),w=Ka(n,s+12),h=Ka(n,s+16);if(u==e||w==t||h==t)return await _a(r,n,a,i-f,c,l)==d?ja:Ma;if(!u&&!w)return Ia;const p=qa(n,s+6);for(const t of[i-w,ka(r,p)+h])if(await _a(r,n,a,t,c,l)==o)return ja;return Ma}async function _a(t,e,r,n,a,s){return 0>n||n+4>a?D:r>n?s.count>0?(s.count--,Ka(ht(await sn(t,n,4)),0)):D:Ka(e,n-r)}function La(t){const e=Error(pa);throw e.reason=t,e}function Ba(t,e,r){return e[r]===D?t.options[r]:e[r]}function Va(t){const r=(4294901760&t)>>16,n=t&e;return new Date(1980+((65024&r)>>9),((480&r)>>5)-1,31&r,(63488&n)>>11,(2016&n)>>5,2*(31&n),0)}function Za(t){return new Date(Number(t/BigInt(1e4)-BigInt(116444736e5)))}function Ha(t,e){return t.getUint8(e)}function qa(t,e){return t.getUint16(e,!0)}function Ka(t,e){return t.getUint32(e,!0)}function Ya(t,e){return Number(t.getBigUint64(e,!0))}var Ga=Object.freeze({__proto__:null,ERR_AMBIGUOUS_ARCHIVE:pa,ERR_BAD_FORMAT:aa,ERR_CENTRAL_DIRECTORY_NOT_FOUND:oa,ERR_ENCRYPTED:da,ERR_ENCRYPTED_CENTRAL_DIRECTORY:ma,ERR_EOCDR_LOCATOR_ZIP64_NOT_FOUND:ia,ERR_EOCDR_NOT_FOUND:sa,ERR_EXTRAFIELD_ZIP64_NOT_FOUND:la,ERR_INVALID_AUTHENTICATION_CODE:xt,ERR_INVALID_COMPRESSED_DATA:ue,ERR_INVALID_CRC32:fe,ERR_INVALID_PASSWORD:Et,ERR_INVALID_SIGNATURE:gt,ERR_INVALID_UNCOMPRESSED_SIZE:de,ERR_LOCAL_FILE_HEADER_NOT_FOUND:ca,ERR_OVERLAPPING_ENTRY:ha,ERR_SPLIT_ZIP_FILE:wa,ERR_UNSUPPORTED_COMPRESSION:fa,ERR_UNSUPPORTED_ENCRYPTION:ua,ERR_WORKER_STARTUP_TIMEOUT:Me,ZipReader:ga,ZipReaderStream:xa});const Xa="File already exists",Ja="Zip file comment exceeds 64KB",Qa="File entry comment exceeds 64KB",$a="File entry name exceeds 64KB",ts="Version exceeds 65535",es="The strength must equal 1, 2, or 3",rs="Encryption is not supported in USDZ files",ns="Extra field type exceeds 65535",as="Extra field data exceeds 64KB",ss=-2147483648,is=2147483647,os=BigInt(0),cs=BigInt("0x7fffffffffffffff"),ls="Zip64 is not supported (set the 'zip64' option to 'true')",ds="Undefined uncompressed size",us="Undefined reader",fs="Zip file not empty",ws="Invalid uid (must be integer 0..2^32-1)",hs="Invalid gid (must be integer 0..2^32-1)",ps="Invalid UNIX mode (must be integer 0..65535)",ms="Invalid unixExtraFieldType (must be 'infozip' or 'unix')",ys="uid/gid must be 0..65535 for unixExtraFieldType 'unix' (use 'infozip' for larger ids)",bs="Invalid msdosAttributesRaw (must be integer 0..255)",Ss="Invalid msdosAttributes (must be an object with boolean flags)",Es="Signature data exceeds 64KB",gs=new Uint8Array([7,0,2,0,65,69,3,0,0]),xs="infozip",Rs="unix";let zs=0;const As=[];class Fs{constructor(t,e={}){t=new nn(t);const{availableSize:r=U,maxSize:n=U}=t;Object.assign(this,{writer:t,Kt:r>0&&r!==U&&n>0&&n!==U,options:e,config:j(),files:new Map,Yt:new Set,offset:e[$n]===D?t.size||t.writable.size||0:e[$n],Gt:e[$n]===D?0:e[$n]-(t.size||t.writable.size||0),Xt:new Set,Jt:0,Qt:D})}async prependZip(e){if(this.Yt.size)throw Error(fs);e=new rn(e),await an(e);const{ZipReader:r}=await Promise.resolve().then(()=>Ga),n=new r(e.readable),a=await n.getEntries();await n.close(),await an(this.writer),await e.readable.pipeTo(this.writer.writable,{preventClose:!0,preventAbort:!0}),this.writer.size=this.offset=e.size,this.Yt=new Set(a.map(t=>t.filename)),this.files=new Map(a.map(e=>{const{version:r,rawLastModDate:n,lastAccessDate:a,creationDate:s,rawFilename:i,bitFlag:o,encrypted:c,uncompressedSize:l,compressedSize:d,zip64:u}=e;let{compressionMethod:f,$t:w,te:h,ee:p,re:m,ne:y,rawExtraField:b}=e;const{level:S,languageEncodingFlag:E,dataDescriptor:g}=o;w=w||k,h=h||k,p=p||k,m=m||k,y=y||k,b=b||k,e.extraFieldAES&&(f=99);const x=Ys(w,h,p,m,y,b),R=u&&l>=t,z=u&&d>=t,A=-7&Xs(S,E,g,c,f)|S<<1,{ae:F,se:U}=Gs({version:r,bitFlag:A,compressionMethod:f,uncompressedSize:l,compressedSize:d,rawLastModDate:n,rawFilename:i,ie:z,oe:R,extraFieldLength:x}),{crc32:O}=e;return O!==D&&Hs(U,10,O),Object.assign(e,{oe:R,ie:z,ce:u&&e.offset>=t,diskNumberStart:0,le:!1,$t:w,te:h,ee:p,re:m,ne:y,rawExtraField:b,extendedTimestamp:p.length>0||m.length>0,de:1+(a?2:0)+(s?4:0),ae:F,se:U}),[e.filename,e]}))}async add(i="",o,c={}){const l=this;c=Object.assign({},c);const{Xt:d,config:u}=l;let f,w;zs<u.maxWorkers?zs++:await new Promise(t=>As.push(t));try{if(i=i.trim(),Bs(l,c,vn)&&!i.endsWith(R)&&(i+=R),l.Yt.has(i))throw Error(Xa);return l.Yt.add(i),w=!0,f=(async(i,o,c,l)=>{const d=((n,a,s)=>{a=a.trim();let i=Bs(n,s,Dn),o=Bs(n,s,kn,i?20:768);const c=Bs(n,s,Mn),l=Bs(n,s,"uid"),d=Bs(n,s,"gid");let u=Bs(n,s,Pn),f=Bs(n,s,"unixExtraFieldType"),w=Bs(n,s,Wn),h=Bs(n,s,_n),p=Bs(n,s,Ln);if(l!==D&&(0>l||l>t))throw Error(ws);if(d!==D&&(0>d||d>t))throw Error(hs);if(u!==D&&(0>u||u>e))throw Error(ps);if(f!==D&&f!==xs&&f!==Rs)throw Error(ms);if(f===Rs&&(l!==D&&l>e||d!==D&&d>e))throw Error(ys);f!==D||l===D&&d===D||(f=xs);let m=Bs(n,s,An),y=Bs(n,s,Fn);const b=m!==D||y!==D;if(l!==D||d!==D||u!==D||f?(i=!1,o=o&e|768):b&&(i=!0,o&=r),m!==D&&(0>m||m>r))throw Error(bs);if(y&&"object"!=typeof y)throw Error(Ss);if(o>e)throw Error(ts);let S=Bs(n,s,zn);const z=S!==D;z||(S=0),!s[vn]&&a.endsWith(R)&&(s[vn]=!0);const A=Bs(n,s,vn);let F;if(A?(a.endsWith(R)||(a+=R),z||(S=16,i||(S|=16877<<16))):i||z||(S=c?493<<16:27525120),!i){const t=u!==D||!!(w||h||p);F=S>>16&e,u=u===D?F:u&e,w?u|=g:w=!!(u&g),h?u|=x:h=!!(u&x),p?u|=512:p=!!(512&u),z&&!t||(A&&(u|=E),S=(u&e)<<16|S&e)}return({msdosAttributesRaw:m,msdosAttributes:y}=((t,e)=>{if(t!==D)t&=r;else if(e!==D){const{readOnly:n,hidden:a,system:s,directory:i,archive:o}=e;let c=0;n&&(c|=1),a&&(c|=2),s&&(c|=4),i&&(c|=16),o&&(c|=32),t=c&r}return e===D&&(e={readOnly:!!(1&t),hidden:!!(2&t),system:!!(4&t),directory:!!(16&t),archive:!!(32&t)}),{msdosAttributesRaw:t,msdosAttributes:e}})(m,y)),b&&(S=S&t|m&r),{name:a,ue:{versionMadeBy:o,msDosCompatible:i,externalFileAttributes:S,unixExternalUpper:F,uid:l,gid:d,unixMode:u,unixExtraFieldType:f,setuid:w,setgid:h,sticky:p,msdosAttributesRaw:m,msdosAttributes:y}}})(i,o,l);({name:o}=d);const u=((t,r,n)=>{const a=Bs(t,n,"encodeText",ut);let s=a(r);if(s===D&&(s=ut(r)),Ys(s)>e)throw Error($a);const i=n[un]||"";let o=a(i);if(o===D&&(o=ut(i)),Ys(o)>e)throw Error(Qa);const c=Bs(t,n,Tn,20);if(c>e)throw Error(ts);const l=Bs(t,n,yn,new Date),d=Bs(t,n,Sn),u=Bs(t,n,gn),f=Bs(t,n,Rn,0),w=Bs(t,n,qn);let h,p;w||(h=Bs(t,n,Zn),p=Bs(t,n,Hn));const m=Bs(t,n,"encryptionStrength",3),y=Bs(t,n,Cn),b=Bs(t,n,"extendedTimestamp",!0),S=Bs(t,n,"ntfsTimestamp"),E=Bs(t,n,"keepOrder",!0),g=Bs(t,n,Gn),x=Bs(t,n,Jn),R=Bs(t,n,"bufferedWrite"),z=Bs(t,n,"createTempStream"),A=Bs(t,n,"dataDescriptorSignature",!0),F=Bs(t,n,Kn),U=Bs(t,n,"useUnicodeFileNames",!0),O=Bs(t,n,In),T=w||O===D?D:J(O);if(!w&&O!==D&&0!==O&&8!==O&&!T)throw Error("Compression method not supported");let k=Bs(t,n,"level");if(t.options[ta]){if(h!==D||p!==D)throw Error(rs);k===D&&O===D&&(k=0)}let C=Bs(t,n,Xn),v=Bs(t,n,"dataDescriptor");R&&v===D&&(v=!1),(v===D||y)&&(v=!0),k!==D&&6!=k&&(C=!1);const M=Bs(t,n,Un);if(!y&&(h!==D||p!==D)&&(1>m||m>3))throw Error(es);const I=Os(n[Nn]),j=Os(n.localExtraField);return{comment:i,ue:{rawFilename:s,rawComment:o,version:c,lastModDate:l,lastAccessDate:d,creationDate:u,internalFileAttributes:f,passThrough:w,password:h,rawPassword:p,encryptionStrength:m,zipCrypto:y,extendedTimestamp:b,ntfsTimestamp:S,keepOrder:E,useWebWorkers:g,transferStreams:x,bufferedWrite:R,createTempStream:z,dataDescriptorSignature:A,signal:F,useUnicodeFileNames:U,compressionMethod:O,format:T?T.format:D,codecURI:T?T.codecURI:D,fe:T?T.versionNeeded:D,level:k,useCompressionStream:C,dataDescriptor:v,zip64:M,rawExtraField:I,we:j}}})(i,o,l),{comment:f}=u,w=l[Nn];let m;i.files.set(o,D);try{const{ue:f}=u;0==f.level||f.compressionMethod!==D||f.passThrough||await(async t=>{const{CompressionStream:e,CompressionStreamFallback:r}=t;if(r&&!r.Ft)return!0;if(ge(e)||Ee(e,he))return!0;if(r)try{return await Le(t),!0}catch{return!1}return!1})(i.config)||(f.level=0);const w=await(async(e,r,{ue:n},a)=>{const{passThrough:s,zipCrypto:i,password:o,rawPassword:c,encryptionStrength:l}=n;let{dataDescriptor:d,zip64:u,level:f,compressionMethod:w}=n,h=0,p=0;if(s){if(!r)throw Error(us);if(p=a[wn],p===D)throw Error(ds)}const m=!0===u,y=Bs(e,a,On),b=!!r&&(!!(o&&Ys(o)||c&&Ys(c))||s&&y);r||(f=0,w=0);const S=b?i?12:16+4*l:0;r&&(r=new rn(r),await an(r),s?(a.uncompressedSize=p,h=Vs(p)+S):r.size===D?(d=!0,(u||u===D)&&(u=!0,p=h=4294967296)):(a.uncompressedSize=p=r.size,h=Vs(p)+S));const E=m||p>=t,g=m||h>=t;if(E||g){if(!1===u)throw Error(ls);u=!0}return u=u||!1,{reader:r,ue:{dataDescriptor:d,zip64:u,oe:E,ie:g,uncompressedSize:p,level:f,compressionMethod:w,encrypted:b}}})(i,c,u,l);({reader:c}=w);const S=Ms(i.writer),E=vs(i.writer),g=(t=>{const{rawFilename:r,lastModDate:a,lastAccessDate:s,creationDate:i,level:o,zip64:c,zipCrypto:l,useUnicodeFileNames:d,dataDescriptor:u,directory:f,rawExtraField:w,we:m,encryptionStrength:S,extendedTimestamp:E,ntfsTimestamp:g,passThrough:x,encrypted:R,oe:U,ie:O,uncompressedSize:T,crc32:C}=t;let{version:v,compressionMethod:M}=t;const I=!f&&(M===D?o===D||o>0:0!==M);let j;const N=x||!I,P=c&&(t.bufferedWrite||!u||!U&&!O||N),W=P||c&&u&&(U||O);if(c&&(U||O)){const t=20,e=Cs(t);if(e.uint16(1),e.uint16(t-4),j=e.array,P&&(e.he(T),N)){const t=R?l?12:16+4*S:0;e.he(x?0:T+t)}}else j=k;let _,L,B,V,Z;if(R&&!l){const t=Cs(Ys(gs)+2);t.uint16(h),t.bytes(gs),_=t.array,_[8]=S}else _=k;if(E){const t=Ws(a),e=_s(t);if(e){const e=9+(s?4:0)+(i?4:0),r=Cs(e);V=1+(s?2:0)+(i?4:0),r.uint16(p),r.uint16(e-4),r.uint8(V),r.uint32(t),s&&r.uint32(Ls(Ws(s))),i&&r.uint32(Ls(Ws(i))),B=r.array}else B=k;if(g===D?!e||s||i:g)try{const t=Ps(a),e=Cs(36);e.uint16(10),e.uint16(32),e.pe(4),e.uint16(1),e.uint16(24),e.he(t),e.he(s?Ps(s):t),e.he(i?Ps(i):t),L=e.array}catch{L=k}else L=k}else L=B=k;try{const{uid:r,gid:n,unixExtraFieldType:a}=t;if(a!=xs||r===D&&n===D)if(a!=Rs||r===D&&n===D)Z=k;else{const t=Cs(8);t.uint16(b),t.uint16(4),t.uint16((r===D?0:r)&e),t.uint16((n===D?0:n)&e),Z=t.array}else{const t=ks(r),e=ks(n),a=3+t.length+e.length,s=Cs(4+a);s.uint16(y),s.uint16(a),s.uint8(1),s.uint8(t.length),s.bytes(t),s.uint8(e.length),s.bytes(e),Z=s.array}}catch{Z=k}M===D&&(M=I?8:0);const{fe:H}=t;I&&H!==D&&(v=v>H?v:H),c&&(v=v>45?v:45),R&&!l&&(v=v>51?v:51,x&&C!==D&&(_[4]=1),_[9]=M,M=99);const q=W?Ys(j):0,K=q+Ys(_,B,L,Z,w,m);if(K>e)throw Error(as);const Y=new Date(2e3*Math.ceil(Math.floor(a.getTime()/1e3)/2)),{ae:G,se:X,rawLastModDate:J}=Gs({version:v,bitFlag:Xs(o,d,u,R,M),compressionMethod:M,uncompressedSize:T,lastModDate:F>Y?F:Y>A?A:Y,rawFilename:r,ie:O,oe:U,extraFieldLength:K}),Q=Cs(z+Ys(r)+K),$=Q.array,tt=ht($);return Q.uint32(n),Q.bytes(G),Q.bytes(r),W&&Q.bytes(j),Q.bytes(_),Q.bytes(B),Q.bytes(L),Q.bytes(Z),Q.bytes(w),Q.bytes(m),u&&(O||Hs(tt,18,0),U||Hs(tt,22,0)),{me:$,ye:tt,ae:G,se:X,lastModDate:a,rawLastModDate:J,encrypted:R,compressed:I,version:v,compressionMethod:M,de:V,$t:k,be:q,ee:B,re:L,ne:Z,te:_,extraFieldLength:K}})(l=Object.assign({},l,d.ue,u.ue,w.ue,{internalFileAttribute:u.ue.internalFileAttributes,externalFileAttribute:d.ue.externalFileAttributes,signature:l[jn],crc32:l.crc32===D?l[jn]:l.crc32,offset:i.offset-S,diskNumberStart:E})),x=(({zip64:t,dataDescriptor:e,dataDescriptorSignature:r})=>{let n,a=k,i=0,o=t?20:12;return r&&(o+=4),e&&(a=new Uint8Array(o),n=ht(a),r&&(i=4,Hs(n,0,s))),{Se:a,Ee:n,ge:i}})(l),R=Ys(g.me,x.Se);m=await(async(e,n,s,i,o)=>{const{files:c,writer:l}=e,{keepOrder:d,dataDescriptor:u,signal:f}=o,{xe:w}=i,h=e.options[ta],p=e.Qt;let m,y,b,S,E,g,x,R={},A=0;c.set(n,R),e.Qt=R;try{let y;d&&(y=p&&p.lock,R.lock=new Promise(t=>b=t)),o.bufferedWrite||!d||e.Re||e.Jt||!u?(m=!0,e.Jt++,x=o.createTempStream?await o.createTempStream():new TransformStream(D,D,{highWaterMark:U}),x.size=0,await an(l)):(x=l,await F()),await an(x);const T=Ms(l);if(e.Kt){delete e.Kt;const t=new Uint8Array(4);Hs(ht(t),0,a),await Ns(l,t),e.offset+=4}h&&!m&&Ts(i,e.offset-T);const{me:k}=w;m||(await y,await O());const C=vs(l),v=js(e,l);if(R.diskNumberStart=C,m||(E=!0,g=l.size,await Ns(x,k)),R=await(async(e,n,{diskNumberStart:a,lock:s},i,o,c)=>{const{xe:l,ze:d,Ae:u}=i,{ae:f,se:w,lastModDate:h,rawLastModDate:p,encrypted:m,compressed:y,version:b,compressionMethod:S,$t:E,be:g,ee:x,de:R,re:z,ne:A,te:F}=l,{Se:U}=d,{rawFilename:O,lastAccessDate:T,creationDate:k,password:C,rawPassword:v,level:M,zip64:I,oe:j,ie:N,zipCrypto:P,dataDescriptor:W,directory:_,executable:L,versionMadeBy:B,rawComment:V,rawExtraField:Z,useWebWorkers:H,transferStreams:q,onstart:K,onprogress:Y,onend:G,signal:X,encryptionStrength:J,extendedTimestamp:Q,msDosCompatible:$,internalFileAttributes:tt,externalFileAttributes:et,uid:rt,gid:nt,unixMode:at,setuid:st,setgid:it,sticky:ot,unixExternalUpper:ct,msdosAttributesRaw:lt,msdosAttributes:dt,useCompressionStream:ut,passThrough:ft,format:wt,codecURI:ht}=c,pt={lock:s,versionMadeBy:B,zip64:I,directory:!!_,executable:!!L,filenameUTF8:!0,rawFilename:O,commentUTF8:!0,rawComment:V,$t:E,be:g,ee:x,re:z,ne:A,te:F,rawExtraField:Z,extendedTimestamp:Q,msDosCompatible:$,internalFileAttributes:tt,externalFileAttributes:et,diskNumberStart:a,uid:rt,gid:nt,unixMode:at,setuid:st,setgid:it,sticky:ot,unixExternalUpper:ct,msdosAttributesRaw:lt,msdosAttributes:dt};let{crc32:mt,uncompressedSize:yt}=c,bt=0;ft||(yt=0);const{writable:St}=n;if(e){const a=ce(e.createReadable?e.createReadable():e.readable),s=e.size,i={options:{codecType:Ue,level:M,rawPassword:v,password:C,encryptionStrength:J,zipCrypto:m&&P,passwordVerification:m&&P&&p>>8&r,computeCrc32:!ft,compressed:y&&!ft,encrypted:m&&!ft,useWebWorkers:H,useCompressionStream:ut,transferStreams:q,format:wt,codecURI:ht,compressionMethod:S},config:o,lt:{signal:X,size:s,onstart:K,onprogress:Y,onend:G}};try{const e=await ar({readable:a,writable:St},i);if(bt=e.outputSize,n.size+=bt,ft||(yt=e.inputSize,m&&!P||(mt=e.crc32)),!N&&bt>=t||!j&&yt>=t)throw Error(ls)}catch(t){throw t.outputSize!==D&&(n.size+=t.outputSize),t}}return(({crc32:t,compressedSize:e,uncompressedSize:r,xe:n,ze:a},{zip64:s,zipCrypto:i,passThrough:o,dataDescriptor:c})=>{const{se:l,encrypted:d}=n,{Ee:u,ge:f}=a;d&&!i&&!o||t===D||(Hs(l,10,t),c&&Hs(u,f,t)),s?c&&(qs(u,f+4,BigInt(e)),qs(u,f+12,BigInt(r))):(Hs(l,14,e),Hs(l,18,r),c&&(Hs(u,f+4,e),Hs(u,f+8,r)))})({crc32:mt,compressedSize:bt,uncompressedSize:yt,xe:l,ze:d},c),W&&await Ns(n,U),Object.assign(pt,{uncompressedSize:yt,compressedSize:bt,lastModDate:h,rawLastModDate:p,creationDate:k,lastAccessDate:T,encrypted:m,zipCrypto:P,size:u+bt,compressionMethod:S,version:b,ae:f,se:w,signature:mt,crc32:!m||P||ft?mt:D,de:R,oe:j,ie:N}),pt})(s,x,R,i,e.config,o),m||(E=!1),c.set(n,R),R.filename=n,m){if(await Promise.all([x.writable.getWriter().close(),y]),await F(),S=!0,g=l.size,await O(),R.diskNumberStart=vs(l),R.offset=js(e,l),h){const t=i.Ae;Ts(i,e.offset-Ms(l)),R.size+=i.Ae-t}(({rawFilename:t,encrypted:e,zip64:r,be:n,crc32:a,compressedSize:s,uncompressedSize:i,oe:o,ie:c},l,{dataDescriptor:d,passThrough:u})=>{if(d||((!e||u&&a!==D)&&Hs(l,14,a),c||Hs(l,18,s),o||Hs(l,22,i)),r&&n){const e=z+Ys(t)+4;qs(l,e,BigInt(i)),qs(l,e+8,BigInt(s))}})(R,w.ye,o),await Ns(l,w.me),await(async(t,e,r)=>{const n=e.writable.getWriter();try{await t.pipeTo(new WritableStream({async write(t){var e;await n.ready,await n.write(t),e=Ys(t),A+=e}}),{preventClose:!0,preventAbort:!0,signal:r})}finally{n.releaseLock()}})(x.readable,l,f),l.size+=x.size,S=!1}else R.diskNumberStart=C,R.offset=v;return e.offset+=R.size,R}catch(t){if(S||E){if(e.hasCorruptedEntries=!0,t)try{t.corruptedEntry=!0}catch{}e.offset+=l.size-g,m&&(e.offset+=A)}throw c.delete(n),t}finally{if(m&&e.Jt--,b&&b(),y&&y(),m&&x&&x.dispose)try{await x.dispose()}catch{}}async function F(){e.Re=!0;const{Fe:t}=e;e.Fe=new Promise(t=>y=()=>{e.Re=!1,t()}),await t}async function O(){Is(l,Ys(w.me))&&await l.closeDisk()}})(i,o,c,{xe:g,ze:x,Ae:R},l)}catch(t){throw i.files.delete(o),t}return Object.assign(m,{name:o,comment:f,extraField:w}),new Vn(m)})(l,i,o,c),d.add(f),await f}catch(t){throw w&&l.Yt.delete(i),t}finally{d.delete(f);const t=As.shift();t?t():zs--}}remove(t){const{Yt:e,files:r}=this;if("string"==typeof t&&(t=r.get(t)),t&&t.filename!==D){const{filename:n}=t;if(e.has(n)&&r.has(n))return e.delete(n),r.delete(n),!0}return!1}async close(r=k,n={}){const{Xt:a,writer:s}=this,{writable:f}=s;if(Ys(r)>e)throw Error(Ja);for(;a.size;)await Promise.allSettled(Array.from(a));return await(async(r,n,a)=>{const s=(r=>{let n=0;for(const[,a]of r){const{rawFilename:r,te:s,rawComment:i,re:o,ne:c,rawExtraField:l,extendedTimestamp:d,de:u,lastModDate:f,oe:w,ie:h,uncompressedSize:m,compressedSize:y}=a,b=a.offset>=t,S=a.diskNumberStart>=e;let E,g;if(b||S||w||h){const t=4+(w?8:0)+(h?8:0)+(b?8:0)+(S?4:0),e=Cs(t);e.uint16(1),e.uint16(t-4),w&&e.he(m),h&&e.he(y),b&&e.he(a.offset),S&&e.uint32(a.diskNumberStart),E=e.array}else E=k;a.$t=E,a.ce=b,a.le=S;const x=Ws(f);if(d&&_s(x)){const t=Cs(9);t.uint16(p),t.uint16(5),t.uint8(u),t.uint32(x),g=t.array}else g=k;a.ee=g;const R=Ys(E,s,o,c,g,l);if(R>e)throw Error(as);n+=46+Ys(r,i)+R}return n})(r.files),{De:f,Ue:w}=await(async(r,n,a)=>{const{files:s,writer:i}=r,c=new Uint8Array(n);await an(i);let l=0,d=0,u=vs(i),f=Ms(i);for(const[r,n]of Array.from(s.values()).entries()){const{offset:w,rawFilename:h,$t:p,te:m,ee:y,re:b,ne:S,rawExtraField:E,rawComment:g,versionMadeBy:x,ae:R,se:z,oe:A,ie:F,le:D,ce:U,internalFileAttributes:O,externalFileAttributes:T,diskNumberStart:k,uncompressedSize:C,compressedSize:v}=n,M=Ys(p,m,y,b,S,E),I=46+Ys(h,g)+M;Is(i,l+I-d)&&(await Ns(i,c.slice(d,l)),d=l,await i.closeDisk()),0==r&&(u=vs(i),f=Ms(i)),A||Hs(z,18,C),F||Hs(z,14,v),(U||D)&&45>n.version&&Zs(z,0,45);const j=Cs(I);if(j.uint32(o),j.uint16(x),j.bytes(R.subarray(0,24)),j.uint16(M),j.uint16(Ys(g)),j.uint16(D?e:k),j.uint16(O),j.uint32(T),j.uint32(U?t:w),j.bytes(h),j.bytes(p),j.bytes(m),j.bytes(y),j.bytes(b),j.bytes(S),j.bytes(E),j.bytes(g),Ks(c,j.array,l),l+=I,a.onprogress)try{await a.onprogress(r+1,s.size,new Vn(n))}catch{}}return await Ns(i,d?c.slice(d):c),{De:{diskNumber:u,diskOffset:f},Ue:c}})(r,s,a),h=await(async(t,r,n)=>{const a=Bs(t,n,"signCentralDirectory");if(a){const n=await a(r),s=Ys(n);if(s>e)throw Error(Es);const o=Cs(6+s);return o.uint32(i),o.uint16(s),o.bytes(n),await Ns(t.writer,o.array),6+s}return 0})(r,w,a);await(async(r,n,a,s)=>{const{writer:i}=r,{De:o,Oe:f}=s;let{Te:w}=s,h=r.files.size,p=o.diskNumber,m=js(r,o),y=vs(i);Is(i,u)&&y++;let b=Bs(r,a,Un);if(!(t>m&&t>w&&e>h&&e>y)){if(!1===b)throw Error(ls);b=!0}const S=Ys(n);if(S>e)throw Error(Ja);const E=Cs(b?98:u);Is(i,Ys(E.array)+S)&&await i.closeDisk(),y=vs(i),b&&(E.uint32(l),E.he(44),E.uint16(45),E.uint16(45),E.uint32(y),E.uint32(p),E.he(h),E.he(h),E.he(w),E.he(m),E.uint32(d),E.uint32(y),E.he(BigInt(js(r,i))+BigInt(w)+BigInt(f)),E.uint32(y+1),Bs(r,a,"supportZip64SplitFile",!0)&&(y=e,p=e),h=e,m=t,w=t),E.uint32(c),E.uint16(y),E.uint16(p),E.uint16(h),E.uint16(h),E.uint32(w),E.uint32(m),E.uint16(S),await Ns(i,E.array),S&&await Ns(i,n)})(r,n,a,{De:f,Te:s,Oe:h})})(this,r,n),Bs(this,n,Qn)||await f.getWriter().close(),s.getData?s.getData():f}}class Ds{constructor(t={}){const{readable:e,writable:r}=new TransformStream;this.readable=e,this.zipWriter=new Fs(r,t),this.Xt=new Set}transform(t){const e=this.zipWriter;let r;const{readable:n,writable:a}=new TransformStream({start(t){r=t},flush:()=>{(async()=>{try{await e.close()}catch(t){try{await e.writer.writable.abort(t)}catch{}}})()}});return Us(this,this.zipWriter.add(t,n),t=>r.error(t)),{readable:this.readable,writable:a}}writable(t){let e;const{readable:r,writable:n}=new TransformStream({start(t){e=t}});return Us(this,this.zipWriter.add(t,r),t=>e.error(t)),n}async close(t,e={}){return await Promise.all(Array.from(this.Xt)),this.zipWriter.close(t,e)}}function Us(t,e,r){t.Xt.add(e),e.catch(t=>{try{r(t)}catch{}})}function Os(t){if(!t)return k;let r=0,n=0;t.forEach(t=>r+=4+Ys(t));const a=new Uint8Array(r),s=ht(a);return t.forEach((t,r)=>{if(r>e)throw Error(ns);if(Ys(t)>e)throw Error(as);Zs(s,n,r),Zs(s,n+2,Ys(t)),Ks(a,t,n+4),n+=4+Ys(t)}),a}function Ts(t,e){const{xe:r}=t;let{me:n,extraFieldLength:a}=r,s=64-(e+Ys(n))%64;4>s&&(s+=64);const i=new Uint8Array(s),o=ht(i);Zs(o,0,m),Zs(o,2,s-4);const c=n;r.me=n=new Uint8Array(Ys(c)+s),Ks(n,c),Ks(n,i,Ys(c));const l=ht(n);Zs(l,28,a+s),r.ye=l,t.Ae+=s}function ks(t){if(t===D)return k;{const e=new Uint8Array(4);ht(e).setUint32(0,t,!0);let r=4;for(;r>1&&0===e[r-1];)r--;return e.subarray(0,r)}}function Cs(t){const e=new Uint8Array(t),r=ht(e);let n=0;return{array:e,uint8:t=>{((t,e,r)=>{t.setUint8(e,r)})(r,n,t),n+=1},uint16:t=>{Zs(r,n,t),n+=2},uint32:t=>{Hs(r,n,t),n+=4},he:t=>{qs(r,n,BigInt(t)),n+=8},bytes:t=>{Ks(e,t,n),n+=Ys(t)},pe:t=>n+=t}}function vs(t){const{diskNumber:e=0}=t;return e}function Ms(t){const{diskOffset:e=0}=t;return e}function Is(t,e){const{availableSize:r=U}=t;return e>r}function js(t,{diskNumber:e=0,diskOffset:r=0}){return t.offset-r-(e?t.Gt:0)}async function Ns(t,e){const{writable:r}=t,n=r.getWriter();try{await n.ready,t.size+=Ys(e),await n.write(e)}finally{n.releaseLock()}}function Ps(t){if(t){const e=(BigInt(t.getTime())+BigInt(116444736e5))*BigInt(1e4);return os>e?os:e>cs?cs:e}}function Ws(t){return Math.floor(t.getTime()/1e3)}function _s(t){return t>=ss&&is>=t}function Ls(t){return Math.min(is,Math.max(ss,t))}function Bs(t,e,r,n){const a=e[r]===D?t.options[r]:e[r];return a===D?n:a}function Vs(t){return t+5*(Math.floor(t/16383)+1)}function Zs(t,e,r){t.setUint16(e,r,!0)}function Hs(t,e,r){t.setUint32(e,r,!0)}function qs(t,e,r){t.setBigUint64(e,r,!0)}function Ks(t,e,r){t.set(e,r)}function Ys(...t){let e=0;return t.forEach(t=>t&&(e+=t.length)),e}function Gs({version:e,bitFlag:r,compressionMethod:n,uncompressedSize:a,compressedSize:s,lastModDate:i,rawLastModDate:o,rawFilename:c,ie:l,oe:d,extraFieldLength:u}){const f=Cs(26),w=f.array,h=ht(w);if(f.uint16(e),f.uint16(r),f.uint16(n),o===D){const t=new Uint32Array(1),e=ht(t);Zs(e,0,(i.getHours()<<6|i.getMinutes())<<5|i.getSeconds()/2),Zs(e,2,(i.getFullYear()-1980<<4|i.getMonth()+1)<<5|i.getDate()),o=t[0]}return f.uint32(o),f.pe(4),l||s!==D?f.uint32(l?t:s):f.pe(4),d||a!==D?f.uint32(d?t:a):f.pe(4),f.uint16(Ys(c)),f.uint16(u),{ae:w,se:h,rawLastModDate:o}}function Xs(t,e,r,n,a){let s=0;return e&&(s|=S),r&&(s|=8),8!=a&&9!=a||(0>t||t>3||(s|=6),t>3&&5>=t&&(s|=4),9==t&&(s|=2)),n&&(s|=1),s}function Js(){return"application/octet-stream"}const Qs=1048576,$s=".zip.js-temp";function ti(t={}){const{thresholdBytes:e=Qs,directoryName:r=$s,getDirectory:n=()=>navigator.storage.getDirectory()}=t;let a;function s(){return a||(a=Promise.resolve(n()).then(t=>t.getDirectoryHandle(r,{create:!0}))),a}return()=>{const t=[];let r,n,a,i,o=0,c=!1;const l=new WritableStream({async write(i){c?await a.write(i):(t.push(i),o+=i.length,o>e&&await(async()=>{const e=await s();r=crypto.randomUUID(),n=await e.getFileHandle(r,{create:!0}),a=(await n.createWritable()).getWriter(),c=!0;for(const e of t)await a.write(e);t.length=0})())},async close(){a&&(await a.close(),a=null)}});let d=0;return{writable:l,readable:new ReadableStream({async pull(e){if(c){if(!i){const t=await n.getFile();i=t.stream().getReader()}const{value:t,done:r}=await i.read();r?e.close():e.enqueue(t)}else d<t.length?e.enqueue(t[d++]):e.close()},async cancel(t){i&&await i.cancel(t)}},{highWaterMark:0}),dispose:async()=>{if(a){try{await a.close()}catch{}a=null}if(r){try{const t=await s();await t.removeEntry(r)}catch{}n=r=null}t.length=0}}}}const ei=1048576;function ri(t={}){const{thresholdBytes:e=ei}=t;return()=>{const t=[];let r,n,a,s=0,i=!1;const o=new WritableStream({async write(a){i?await r.write(a):(t.push(a),s+=a.length,s>e&&await(async()=>{const e=new TransformStream;n=new Response(e.readable).blob(),r=e.writable.getWriter(),i=!0;for(const e of t)await r.write(e);t.length=0})())},async close(){r&&(await r.close(),r=null)}});let c=0;return{writable:o,readable:new ReadableStream({async pull(e){if(i){if(!a){const t=await n;a=t.stream().getReader()}const{value:t,done:r}=await a.read();r?e.close():e.enqueue(t)}else c<t.length?e.enqueue(t[c++]):e.close()},async cancel(t){a&&await a.cancel(t)}},{highWaterMark:0}),dispose:async()=>{if(r){try{await r.abort()}catch{}r=null}n&&(n.catch(()=>{}),n=null),t.length=0}}}}const ni=1048576,ai=".zip.js-temp",si="createSyncAccessHandle is only available in dedicated workers";function ii(t={}){const{thresholdBytes:e=ni,directoryName:r=ai,getDirectory:n}=t;if(!(n||"undefined"!=typeof FileSystemFileHandle&&FileSystemFileHandle.prototype.createSyncAccessHandle))throw Error(si);const a=n||(()=>navigator.storage.getDirectory());let s;function i(){return s||(s=Promise.resolve(a()).then(t=>t.getDirectoryHandle(r,{create:!0}))),s}return()=>{const t=[];let r,n,a=0,s=!1,o=0,c=0;const l=new WritableStream({async write(c){s?(n.write(c,{at:o}),o+=c.length):(t.push(c),a+=c.length,a>e&&await(async()=>{const e=await i();r=crypto.randomUUID();const a=await e.getFileHandle(r,{create:!0});n=await a.createSyncAccessHandle(),s=!0;for(const e of t)n.write(e,{at:o}),o+=e.length;t.length=0})())},close(){n&&n.flush()}});let d=0;return{writable:l,readable:new ReadableStream({pull(e){if(s){const t=o-c;if(0>=t)return void e.close();const r=new Uint8Array(Math.min(524288,t)),a=n.read(r,{at:c});a?(c+=a,e.enqueue(r.subarray(0,a))):e.close()}else d<t.length?e.enqueue(t[d++]):e.close()}},{highWaterMark:0}),dispose:async()=>{if(n){try{n.close()}catch{}n=null}if(r){try{const t=await i();await t.removeEntry(r)}catch{}r=null}t.length=0}}}}try{_({baseURI:import.meta.url})}catch{}let oi,ci,li,di,ui;function fi(t,e,r={}){if(!oi){const t=Error("WASM module not loaded");throw t.cause=ui,t}const n="number"==typeof r.level?r.level:-1,a="number"==typeof r.outBuffer?r.outBuffer:65536,s="number"==typeof r.inBufferSize?r.inBufferSize:65536;return new TransformStream({start(){try{let r;if(this.ke=ci(a),this.in=ci(s),this.inBufferSize=s,!this.ke||!this.in)throw Error("allocation failed");if(this.Ce=new Uint8Array(a),t?(this.ve=oi.deflate_process,this.Me=oi.deflate_last_consumed,this.Ie=oi.deflate_end,this.je=oi.deflate_new(),r="gzip"===e?oi.deflate_init_gzip(this.je,n):"deflate-raw"===e?oi.deflate_init_raw(this.je,n):oi.deflate_init(this.je,n)):"deflate64-raw"===e?(this.ve=oi.inflate9_process,this.Me=oi.inflate9_last_consumed,this.Ie=oi.inflate9_end,this.je=oi.inflate9_new(),r=oi.inflate9_init_raw(this.je)):(this.ve=oi.inflate_process,this.Me=oi.inflate_last_consumed,this.Ie=oi.inflate_end,this.je=oi.inflate_new(),r="deflate-raw"===e?oi.inflate_init_raw(this.je):"gzip"===e?oi.inflate_init_gzip(this.je):oi.inflate_init(this.je)),0!==r)throw Error("init failed:"+r)}catch(t){throw i(this),t}},transform(e,r){try{const n=e,s=new Uint8Array(di.buffer),i=this.ve,o=this.Me,c=this.ke,l=this.Ce;let d=0;for(;d<n.length;){const e=Math.min(n.length-d,32768);if((!this.in||this.inBufferSize<e)&&(this.in&&li&&(li(this.in),this.in=0),this.in=ci(e),this.inBufferSize=e,!this.in))throw Error("allocation failed");s.set(n.subarray(d,d+e),this.in);const u=i(this.je,this.in,e,c,a,0),f=16777215&u;if(f&&(l.set(s.subarray(c,c+f),0),r.enqueue(l.slice(0,f))),!t){const t=u>>24&255,e=128&t?t-256:t;if(0>e)throw Error("process error:"+e)}const w=o(this.je);if(0===w)break;d+=w}}catch(t){i(this),r.error(t)}},flush(e){try{const r=new Uint8Array(di.buffer),n=this.ve,s=this.ke,i=this.Ce;for(;;){const o=n(this.je,0,0,s,a,4),c=16777215&o,l=o>>24&255;if(!t){const t=128&l?l-256:l;if(0>t)throw Error("process error:"+t)}if(c&&(i.set(r.subarray(s,s+c),0),e.enqueue(i.slice(0,c))),1===l||0===c)break}}catch(t){e.error(t)}finally{const t=i(this);0!==t&&e.error(Error("end error:"+t))}},cancel(){i(this)}});function i(t){let e=0;return t.je&&t.Ie&&(e=t.Ie(t.je)),t.je=0,t.in&&li&&li(t.in),t.in=0,t.ke&&li&&li(t.ke),t.ke=0,e}}class wi{constructor(t="deflate",e){return fi(!0,t,e)}}class hi{constructor(t="deflate",e){return fi(!1,t,e)}}wi.Ft=!0,hi.Ft=!0;let pi,mi=!1;function yi(){pi=null,(async()=>{await Promise.allSettled($e.map(t=>(lr(t),t.terminate()))),Ie=D,We=!1})(),mi=!1,oi=ci=li=di=ui=null}(({Ne:t})=>{Le=t})({Ne:t=>{if(!pi){let{wasmURI:e}=t;typeof e==T&&(e=e()),pi=(async(t,{baseURI:e})=>{if(!mi)try{await(async(t,e)=>{let r,n;try{try{n=new URL(t,e)}catch{}const a=await fetch(n);r=await a.arrayBuffer()}catch(e){if(!t.startsWith("data:application/wasm;base64,"))throw e;r=(t=>{const e=t.split(",")[1],r=atob(e),n=r.length,a=new Uint8Array(n);for(let t=0;n>t;++t)a[t]=r.charCodeAt(t);return a.buffer})(t)}(t=>{if(oi=t,({malloc:ci,free:li,memory:di}=oi),"function"!=typeof ci||"function"!=typeof li||!di)throw oi=ci=li=di=null,Error("Invalid WASM module")})((await WebAssembly.instantiate(r)).instance.exports)})(t,e),mi=!0}catch(t){throw(t=>{ui=t})(t),t}})(e,t).catch(t=>{throw pi=null,t})}return pi}}),_({CompressionStreamFallback:wi,DecompressionStreamFallback:hi}),_({workerURI:new URL("./zip-web-worker.js",import.meta.url).href,wasmURI:new URL("./zip-module.wasm",import.meta.url).href});const bi="Entry filename already exists",Si="Readable stream already consumed",Ei=new Set([1,h,10,p,28789,25461,m,y,b,22613,13]);class gi{constructor(t,e,r,n){const a=this;if(t.root&&n&&n.getChildByName(e))throw Error(bi);r||(r={}),Object.assign(a,{fs:t,name:e,data:r.data,options:r.options,id:t.Pe++,parent:n,children:[],uncompressedSize:r.uncompressedSize||0,passThrough:r.passThrough}),!n&&t.root||(t.entries[a.id]=a),n&&a.parent.children.push(a)}moveTo(t){this.fs.move(this,t)}getFullname(){return this.getRelativeName()}getRelativeName(t=this.fs.root){let e=this.name,r=this.parent;for(;r&&r!=t;)e=(r.name?r.name+"/":"")+e,r=r.parent;return e}isDescendantOf(t){let e=this.parent;for(;e&&e.id!=t.id;)e=e.parent;return!!e}rename(t){const e=this.parent;if(e&&e.getChildByName(t))throw Error(bi);this.name=t}}class xi extends gi{constructor(t,e,r,n){super(t,e,r,n);const a=this;a.Reader=r.Reader,a.Writer=r.Writer,r.getData&&(a.getData=r.getData)}clone(){return new xi(this.fs,this.name,this)}async getData(t,e={}){const r=this;if(!t||t.constructor==r.Writer&&r.data)return r.data;{const n=r.reader=Ui(r.Reader,r.data,e),a=r.data?r.data.uncompressedSize:n.size;await Promise.all([an(n),an(t,a)]);const{readable:s}=n;return r.uncompressedSize=n.size,await s.pipeTo(t.writable),t.getData?t.getData():t.writable}}isPasswordProtected(){return!(!this.data||!this.data.encrypted)}async checkPassword(t,e={}){const r=this;if(!r.isPasswordProtected())return!0;try{return await r.data.getData(null,Object.assign({},e,{password:t,checkPasswordOnly:!0})),!0}catch(t){if(t.message==Et)return!1;throw t}}getText(t,e){return this.getData(new Cr(t),e)}getBlob(t,e){return this.getData(new Tr(t),e)}getData64URI(t,e){return this.getData(new Fr(t),e)}getUint8Array(t){return this.getData(new $r,t)}getWritable(t=new WritableStream,e){return this.getData({writable:t},e)}async getArrayBuffer(t){return wt(await this.getUint8Array(t)).buffer}replaceBlob(t){Object.assign(this,{data:t,Reader:Or,Writer:Tr,reader:null})}replaceText(t){Object.assign(this,{data:t,Reader:kr,Writer:Cr,reader:null})}replaceData64URI(t){Object.assign(this,{data:t,Reader:Ar,Writer:Fr,reader:null})}replaceUint8Array(t){Object.assign(this,{data:t,Reader:Qr,Writer:$r,reader:null})}replaceReadable(t){Object.assign(this,{data:null,Reader:Fi(t),Writer:null,reader:null})}}class Ri extends gi{constructor(t,e,r,n){super(t,e,r,n),this.directory=!0}clone(t){const e=this,r=new Ri(e.fs,e.name,e);return t&&(r.children=e.children.map(e=>{const n=e.clone(t);return n.parent=r,n})),r}addDirectory(t,e){return Mi(this,t,{options:e},!0)}addText(t,e,r={}){return Mi(this,t,{data:e,Reader:kr,Writer:Cr,options:r,uncompressedSize:e.length})}addBlob(t,e,r={}){return Mi(this,t,{data:e,Reader:Or,Writer:Tr,options:r,uncompressedSize:e.size})}addData64URI(t,e,r={}){let n=e.length;for(;"="==e.charAt(n-1);)n--;const a=e.indexOf(",")+1;return Mi(this,t,{data:e,Reader:Ar,Writer:Fr,options:r,uncompressedSize:Math.floor(.75*(n-a))})}addUint8Array(t,e,r={}){return Mi(this,t,{data:e,Reader:Qr,Writer:$r,options:r,uncompressedSize:e.length})}addHttpContent(t,e,r={}){return Mi(this,t,{data:e,Reader:class extends Xr{constructor(t){super(t,r)}},options:r})}addReadable(t,e,r={}){return Mi(this,t,{Reader:Fi(e),options:r})}addFileSystemEntry(t,e={}){return ki(this,t,e)}addFileSystemHandle(t,e={}){return ki(this,t,e)}addFile(t,e={}){return(e=Object.assign({},e)).lastModDate||(e.lastModDate=new Date(t.lastModified)),Mi(this,t.name,{data:t,Reader:()=>({readable:t.stream(),size:t.size}),options:e,uncompressedSize:t.size})}We(t,e){return Mi(this,t,e)}importBlob(t,e){return this.importZip(new Or(t),e)}importData64URI(t,e){return this.importZip(new Ar(t),e)}importUint8Array(t,e){return this.importZip(new Qr(t),e)}importHttpContent(t,e){return this.importZip(new Xr(t,e),e)}importReadable(t,e){return this.importZip({readable:t},e)}exportBlob(t={}){return this.exportZip(new Tr(t.mimeType||"application/zip"),t)}exportData64URI(t={}){return this.exportZip(new Fr(t.mimeType||"application/zip"),t)}exportUint8Array(t={}){return this.exportZip(new $r,t)}async exportWritable(t=new WritableStream,e={}){return await this.exportZip({writable:t},e),t}exportFileSystemHandle(t,e={}){return(async(t,e,r)=>{const n=Ai([t],"uncompressedSize"),a=new Map;return await s(t,e),e;async function s(t,e){if(r.concurrent){const r=(await Promise.allSettled(t.children.map(t=>i(t,e)))).find(t=>"rejected"==t.status);if(r)throw r.reason}else for(const r of t.children)await i(r,e)}async function i(t,e){try{if(t.directory){const r=await e.getDirectoryHandle(t.name,{create:!0});await s(t,r)}else{const s=await e.getFileHandle(t.name,{create:!0}),i=await s.createWritable();await t.getData({writable:i},Object.assign({},r,{onprogress:async e=>{if(r.onprogress){a.set(t.id,e);try{await r.onprogress(Array.from(a.values()).reduce((t,e)=>t+e,0),n)}catch{}}}}))}}catch(e){throw Error(e.message+(t?" ("+t.name+")":""),{cause:e})}}})(this,t,e)}async importZip(t,e={}){await an(t);const r=new ga(t,e),n=[],a=await r.getEntries();for(const t of a){let r=this;try{const a=t.filename.split("/"),s=a.pop();if(a.forEach(t=>{const e=r;if(r=r.getChildByName(t),r){if(!r.directory)throw Error(bi)}else r=new Ri(this.fs,t,{data:null},e),n.push(r)}),t.directory){let e=r;if(s)if(e=r.getChildByName(s),e){if(!e.directory)throw Error(bi)}else e=new Ri(this.fs,s,{data:null},r),n.push(e);e==this||e.data||(e.data=t)}else n.push(Mi(r,s,{data:t,Reader:Di(Object.assign({},e)),uncompressedSize:t.uncompressedSize,passThrough:e.passThrough}))}catch(e){try{e.cause={entry:t}}catch{}throw e}}return n}async exportZip(t,e={}){const r=this;(e=Object.assign({},e)).bufferedWrite===D&&(e.bufferedWrite=!0);const[n]=await Promise.all([Oi(r,e.readerOptions),an(t)]),a=new Fs(t,e);return await(async(t,e,r,n,a)=>{const s=e,i=new Map;await async function t(e,o){async function c(o){const c=n.relativePath?o.getRelativeName(s):o.getFullname(),l=o.options||{};let d={};if(o.data instanceof Vn){const{externalFileAttributes:t,versionMadeBy:e,comment:r,lastModDate:a,creationDate:s,lastAccessDate:i,uncompressedSize:c,encrypted:l,zipCrypto:u,crc32:f,compressionMethod:w,extraFieldAES:h,internalFileAttributes:p,extraField:m,uid:y,gid:b}=o.data;d={externalFileAttributes:t,versionMadeBy:e,comment:r,lastModDate:a,creationDate:s,lastAccessDate:i,internalFileAttributes:p};const S=(t=>{if(t){const e=new Map;if(t.forEach((t,r)=>{Ei.has(r)||e.set(r,t.data)}),e.size)return e}})(m);if(S&&(d.extraField=S),y===D&&b===D||Object.assign(d,{uid:y,gid:b,unixExtraFieldType:n.unixExtraFieldType||"infozip"}),o.passThrough){let t,e;0===w&&(t=0),h&&(e=h.strength),d=Object.assign(d,{passThrough:!0,encrypted:l,zipCrypto:u,crc32:f,uncompressedSize:c,level:t,encryptionStrength:e,compressionMethod:w})}}await e.add(c,a.get(o),Object.assign({},n,d,l,{directory:o.directory,onprogress:async t=>{if(n.onprogress){i.set(c,t);try{await n.onprogress(Array.from(i.values()).reduce((t,e)=>t+e),r)}catch{}}}})),await t(e,o)}await(async()=>{if(n.bufferedWrite){const t=(await Promise.allSettled(o.children.map(c))).find(t=>"rejected"==t.status);if(t)throw t.reason}else for(const t of o.children)await c(t)})()}(t,e)})(a,r,Ai([r],"uncompressedSize"),e,n),await a.close(),t.getData?t.getData():t.writable}getChildByName(t){const e=this.children;for(let r=0;r<e.length;r++){const n=e[r];if(n.name==t)return n}}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 r=this.children;return!(await Promise.all(r.map(r=>r.checkPassword(t,e)))).includes(!1)}}const zi={FS:class{constructor(){vi(this)}get children(){return this.root.children}remove(t){Ti(t);const e=[t];for(;e.length;){const t=e.pop();this.entries[t.id]=null;for(const r of t.children)e.push(r)}t.parent=D}move(t,e){if(t==this.root)throw Error("Root directory cannot be moved");if(!e.directory)throw Error("Target entry is not a directory");if(e.isDescendantOf(t))throw Error("Entry is a ancestor of target entry");if(t!=e){const r=e.getChildByName(t.name);if(r){if(r!=t)throw Error(bi)}else Ti(t),t.parent=e,e.children.push(t),((t,e)=>{const r=[e];for(;r.length;){const e=r.pop();t.entries[e.id]=e;for(const t of e.children)r.push(t)}})(this,t)}}find(t){const e=t.split("/");let r=this.root;for(let t=0;r&&t<e.length;t++)r=r.getChildByName(e[t]);return r||(r=this.entries.find(e=>e&&(e==this.root||e.isDescendantOf(this.root))&&e.getRelativeName()==t)),r}getById(t){return this.entries[t]}getChildByName(t){return this.root.getChildByName(t)}addDirectory(t,e){return this.root.addDirectory(t,e)}addText(t,e,r){return this.root.addText(t,e,r)}addBlob(t,e,r){return this.root.addBlob(t,e,r)}addData64URI(t,e,r){return this.root.addData64URI(t,e,r)}addUint8Array(t,e,r){return this.root.addUint8Array(t,e,r)}addHttpContent(t,e,r){return this.root.addHttpContent(t,e,r)}addReadable(t,e,r){return this.root.addReadable(t,e,r)}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)}We(t,e){return this.root.We(t,e)}importBlob(t,e){return vi(this),this.root.importBlob(t,e)}importData64URI(t,e){return vi(this),this.root.importData64URI(t,e)}importUint8Array(t,e){return vi(this),this.root.importUint8Array(t,e)}importHttpContent(t,e){return vi(this),this.root.importHttpContent(t,e)}importReadable(t,e){return vi(this),this.root.importReadable(t,e)}importZip(t,e){return vi(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)}isPasswordProtected(){return this.root.isPasswordProtected()}checkPassword(t,e){return this.root.checkPassword(t,e)}},ZipDirectoryEntry:Ri,ZipFileEntry:xi};function Ai(t,e){let r=0;const n=Array.from(t);for(;n.length;){const t=n.pop();r+=t[e]||0;for(const e of t.children)n.push(e)}return r}function Fi(t){let e;return()=>{if(e)throw Error(Si);return e=!0,{readable:t}}}function Di(t){return class extends Rr{constructor(t,e={}){super(),this.entry=t,this.options=e}async init(){const e=this;e.size=e.entry.uncompressedSize;const r=await e.entry.getData(new Tr,Object.assign({},t,e.options));e.data=r,e._e=new Or(r),super.init()}readUint8Array(t,e){return this._e.readUint8Array(t,e)}}}function Ui(t,e,r){return t.prototype?new t(e,r):t(e,r)}async function Oi(t,e){const r=[],n=[t],a=new Map;for(;n.length;){const t=n.pop();for(const e of t.children)e.directory?n.push(e):r.push(e)}return await Promise.all(r.map(async t=>{const r=t.reader=Ui(t.Reader,t.data,e);a.set(t,r);try{await an(r)}catch(e){try{e.entryId=t.id,e.cause={entry:t}}catch{}throw e}r.size!==D&&(t.uncompressedSize=r.size)})),a}function Ti(t){if(t.parent){const e=t.parent.children;e.forEach((r,n)=>{r.id==t.id&&e.splice(n,1)})}}function ki(t,e,r){return async function t(e,n,a){if(n)try{if((n.isFile||n.isDirectory)&&(n=await Ci(n)),"file"==n.kind){const t=await n.getFile();a.push(e.We(t.name,{Reader:()=>({readable:t.stream(),size:t.size}),options:Object.assign({},{lastModDate:new Date(t.lastModified)},r),uncompressedSize:t.size}))}else if("directory"==n.kind){const r=e.addDirectory(n.name);a.push(r);for await(const e of n.values())await t(r,e,a)}}catch(t){const e=t.message+(n?" ("+n.name+")":"");throw Error(e,{cause:t})}return a}(t,e,[])}async function Ci(t){const e={name:t.name};if(t.isFile&&(e.kind="file",e.getFile=()=>new Promise((e,r)=>t.file(e,r))),t.isDirectory){e.kind="directory";const r=await(async t=>{const e=[];function r(t,n,a){t.readEntries(async s=>{if(s.length){for(const t of s)e.push(await Ci(t));r(t,n,a)}else n(e)},a)}return await new Promise((e,n)=>r(t.createReader(),e,n)),{[Symbol.iterator](){let t=0;return{next(){const r={value:e[t],done:t==e.length};return t++,r}}}}})(t);e.values=()=>r}return e}function vi(t){t.entries=[],t.Pe=0,t.root=new Ri(t)}function Mi(t,e,r,n){if(t.directory)return n?new Ri(t.fs,e,r,t):new xi(t.fs,e,r,t);throw Error("Parent entry is not a directory")}export{Or as BlobReader,Tr as BlobWriter,Ar as Data64URIReader,Fr as Data64URIWriter,pa as ERR_AMBIGUOUS_ARCHIVE,aa as ERR_BAD_FORMAT,oa as ERR_CENTRAL_DIRECTORY_NOT_FOUND,Xa as ERR_DUPLICATED_NAME,da as ERR_ENCRYPTED,ma as ERR_ENCRYPTED_CENTRAL_DIRECTORY,bi as ERR_ENTRY_EXISTS,ia as ERR_EOCDR_LOCATOR_ZIP64_NOT_FOUND,sa as ERR_EOCDR_NOT_FOUND,la as ERR_EXTRAFIELD_ZIP64_NOT_FOUND,ur as ERR_HTTP_RANGE,fr as ERR_HTTP_RESOURCE_CHANGED,xt as ERR_INVALID_AUTHENTICATION_CODE,B as ERR_INVALID_CODEC_DEFINITION,Z as ERR_INVALID_CODEC_MODULE,Ja as ERR_INVALID_COMMENT,ue as ERR_INVALID_COMPRESSED_DATA,fe as ERR_INVALID_CRC32,es as ERR_INVALID_ENCRYPTION_STRENGTH,Qa as ERR_INVALID_ENTRY_COMMENT,$a as ERR_INVALID_ENTRY_NAME,as as ERR_INVALID_EXTRAFIELD_DATA,ns as ERR_INVALID_EXTRAFIELD_TYPE,hs as ERR_INVALID_GID,bs as ERR_INVALID_MSDOS_ATTRIBUTES,Ss as ERR_INVALID_MSDOS_DATA,Et as ERR_INVALID_PASSWORD,gt as ERR_INVALID_SIGNATURE,Es as ERR_INVALID_SIGNATURE_DATA,ws as ERR_INVALID_UID,de as ERR_INVALID_UNCOMPRESSED_SIZE,ms as ERR_INVALID_UNIX_EXTRA_FIELD_TYPE,ys as ERR_INVALID_UNIX_ID_SIZE,ps as ERR_INVALID_UNIX_MODE,ts as ERR_INVALID_VERSION,wr as ERR_ITERATOR_COMPLETED_TOO_SOON,ca as ERR_LOCAL_FILE_HEADER_NOT_FOUND,ha as ERR_OVERLAPPING_ENTRY,Si as ERR_READABLE_CONSUMED,V as ERR_RESERVED_COMPRESSION_METHOD,wa as ERR_SPLIT_ZIP_FILE,us as ERR_UNDEFINED_READER,ds as ERR_UNDEFINED_UNCOMPRESSED_SIZE,fa as ERR_UNSUPPORTED_COMPRESSION,si as ERR_UNSUPPORTED_CONTEXT,zt as ERR_UNSUPPORTED_CRYPTO_API,ua as ERR_UNSUPPORTED_ENCRYPTION,rs as ERR_UNSUPPORTED_ENCRYPTION_USDZ,ls as ERR_UNSUPPORTED_FORMAT,Me as ERR_WORKER_STARTUP_TIMEOUT,hr as ERR_WRITER_NOT_INITIALIZED,fs as ERR_ZIP_NOT_EMPTY,Jr as HttpRangeReader,Xr as HttpReader,Rr as Reader,tn as SplitDataReader,en as SplitDataWriter,kr as TextReader,Cr as TextWriter,Qr as Uint8ArrayReader,$r as Uint8ArrayWriter,zr as Writer,ga as ZipReader,xa as ZipReaderStream,Fs as ZipWriter,Ds as ZipWriterStream,P as configure,ri as createBlobTempStream,ti as createOPFSTempStream,ii as createSyncAccessHandleTempStream,zi as fs,Js as getMimeType,G as registerCodec,L as resetConfiguration,yi as terminateWorkers,X as unregisterCodec};
|