@zip.js/zip.js 2.8.42 → 2.8.43
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 +111 -30
- package/dist/zip-core-external.min.js +1 -1
- package/dist/zip-core.js +111 -30
- package/dist/zip-core.min.js +1 -1
- package/dist/zip-fs-core-external.js +111 -30
- package/dist/zip-fs-core-external.min.js +1 -1
- package/dist/zip-fs-core.js +111 -30
- package/dist/zip-fs-core.min.js +1 -1
- package/dist/zip-fs-external.js +111 -30
- package/dist/zip-fs-external.min.js +1 -1
- package/dist/zip-fs-native.js +113 -32
- package/dist/zip-fs-native.min.js +1 -1
- package/dist/zip-fs.js +112 -31
- package/dist/zip-fs.min.js +1 -1
- package/dist/zip-legacy.js +113 -32
- package/dist/zip-legacy.min.js +1 -1
- package/dist/zip-native.js +113 -32
- 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 +112 -31
- package/dist/zip.min.js +1 -1
- package/index-native.cjs +113 -32
- package/index-native.min.js +1 -1
- package/index.cjs +112 -31
- package/index.min.js +1 -1
- package/lib/core/codec-worker.js +23 -2
- package/lib/core/streams/codec-stream.js +4 -2
- package/lib/core/streams/zip-entry-stream.js +90 -28
- package/lib/core/web-worker-inline-native.js +1 -1
- package/lib/core/web-worker-inline-wasm.js +1 -1
- package/lib/core/zip-writer.js +6 -3
- 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=21589,w=2048,p=16384,m=2048,h=1024,y="/",b=30,S=new Date(2107,11,31,23,59,58),g=new Date(1980,0,1),E=void 0,x=1/0,z="undefined",F="function",R=new Uint8Array;let A=2;try{typeof navigator!=z&&navigator.hardwareConcurrency&&(A=navigator.hardwareConcurrency)}catch{}const D={workerURI:"./core/web-worker-wasm.js",wasmURI:"./core/streams/zlib-wasm/zlib-streams.wasm",chunkSize:65536,maxWorkers:A,terminateWorkerTimeout:5e3,workerStarvationTimeout:5e3,workerStartupTimeout:5e3,useWebWorkers:!0,useCompressionStream:!0,transferStreams:!0,CompressionStream:typeof CompressionStream!=z&&CompressionStream,DecompressionStream:typeof DecompressionStream!=z&&DecompressionStream},U=["baseURI","wasmURI","workerURI","chunkSize","maxWorkers","terminateWorkerTimeout","workerStarvationTimeout","workerStartupTimeout","useCompressionStream","useWebWorkers","transferStreams","CompressionStream","DecompressionStream","CompressionStreamZlib","DecompressionStreamZlib"],T={...D};function O(){return T}function k(t){return Math.max(t.chunkSize,64)}function v(t){for(const e of U){const r=t[e];r!==E&&(T[e]=r)}}function M(t){for(const e of U){const r=t[e];r!==E&&(D[e]=r)}v(t)}function C(){for(const t of U)delete T[t];Object.assign(T,D)}const I="Invalid codec definition",N="Reserved compression method",j="Invalid codec module",P="string",_=[0,8,9,99],W=new Map,L=new Map;function B(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!=P||!n.length)throw Error(I);if(_.includes(r))throw Error(N);const c=typeof s==F||typeof i==F;if(!(c||typeof a==P&&a.length))throw Error(I);W.set(r,{compressionMethod:r,format:n,codecURI:a,versionNeeded:o}),c&&q(n,{CompressionStream:s,DecompressionStream:i})}function V(t){const e=W.get(t);if(e){let r;W.delete(t),W.forEach(t=>r=r||t.format==e.format),r||L.delete(e.format)}}function Z(t){return W.get(t)}function H(t){return L.get(t)}function q(t,e){const{CompressionStream:r,DecompressionStream:n}=e;if(typeof r!=F&&typeof n!=F)throw Error(j);L.set(t,{CompressionStream:r,DecompressionStream:n})}const K=[[],[],[],[],[],[],[],[]];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;K[0][t]=e}for(let t=0;256>t;t++)for(let e=1;8>e;e++){const r=K[e-1][t];K[e][t]=r>>>8^K[0][255&r]}const[Y,G,X,J,Q,$,tt,et]=K;class rt{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=et[255&t]^tt[t>>>8&255]^$[t>>>16&255]^Q[t>>>24&255]^J[255&r]^X[r>>>8&255]^G[r>>>16&255]^Y[r>>>24&255]}}for(;r>n;n++)e=e>>>8^Y[255&(e^t[n])];this.o=e}get(){return~this.o}}class nt extends TransformStream{constructor(){let t;const e=new rt;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 at(t){if(typeof TextEncoder==z){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 st(t,e){const r=new Uint8Array(t.length+e.length);return r.set(t),r.set(e,t.length),r}function it(t){return t.byteOffset||t.byteLength!=t.buffer.byteLength?new Uint8Array(t):t}function ot(t){return new DataView(t.buffer,t.byteOffset,t.byteLength)}const ct={concat(t,e){if(0===t.length||0===e.length)return t.concat(e);const r=t[t.length-1],n=ct.l(r);return 32===n?t.concat(e):ct.m(e,n,0|r,t.slice(0,t.length-1))},h(t){const e=t.length;if(0===e)return 0;const r=t[e-1];return 32*(e-1)+ct.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]=ct.F(e,t[r-1]&2147483648>>e-1,1)),t},F:(t,e,r)=>32===t?e:(r?0|e:e<<32-t)+1099511627776*t,l:t=>Math.round(t/1099511627776)||32,m(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=ct.l(a);return n.push(ct.F(e+s&31,e+s>32?r:n.pop(),1)),n}},lt={bytes:{R(t){const e=ct.h(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(ct.F(8*(3&r),n)),e}}},dt=class{constructor(t){const e=this;e.blockSize=512,e.D=[1732584193,4023233417,2562383102,271733878,3285377520],e.U=[1518500249,1859775393,2400959708,3395469782],t?(e.T=t.T.slice(0),e.O=t.O.slice(0),e.v=t.v):e.reset()}reset(){const t=this;return t.T=t.D.slice(0),t.O=[],t.v=0,t}update(t){const e=this;"string"==typeof t&&(t=lt.M.A(t));const r=e.O=ct.concat(e.O,t),n=e.v,a=e.v=n+ct.h(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.C(s.subarray(16*i,16*(i+1))),i+=1;return r.splice(0,16*i),e}I(){const t=this;let e=t.O;const r=t.T;e=ct.concat(e,[ct.F(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.C(e.splice(0,16));return t.reset(),r}N(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}C(t){const e=this,r=e.T,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.N(t,s,i,o)+c+n[t]+e.U[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}},ut={importKey:t=>new ut.P(lt.bytes.A(t)),_(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=ct;for(e=lt.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)},P:class{constructor(t){const e=this,r=e.W=dt,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.W(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.W(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)}}},ft=typeof crypto!=z&&typeof crypto.getRandomValues==F,wt="Invalid password",pt="Invalid signature",mt="zipjs-abort-check-password";function ht(t){if(ft)return crypto.getRandomValues(t);throw Error("Crypto API not supported")}const yt=16,bt={name:"PBKDF2"},St=Object.assign({hash:{name:"HMAC"}},bt),gt=Object.assign({iterations:1e3,hash:{name:"SHA-1"}},bt),Et=["deriveBits"],xt=[8,12,16],zt=[16,24,32],Ft=10,Rt=[0,0,0,0],At=typeof crypto!=z,Dt=At&&crypto.subtle,Ut=At&&typeof Dt!=z,Tt=lt.bytes,Ot=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,p=t[0]^r[0],m=t[e?3:1]^r[1],h=t[2]^r[2],y=t[e?1:3]^r[3],b=4;for(let t=0;n>t;t++)u=i[p>>>24]^o[m>>16&255]^c[h>>8&255]^l[255&y]^r[b],f=i[m>>>24]^o[h>>16&255]^c[y>>8&255]^l[255&p]^r[b+1],w=i[h>>>24]^o[y>>16&255]^c[p>>8&255]^l[255&m]^r[b+2],y=i[y>>>24]^o[p>>16&255]^c[m>>8&255]^l[255&h]^r[b+3],b+=4,p=u,m=f,h=w;for(let t=0;4>t;t++)a[e?3&-t:t]=d[p>>>24]<<24^d[m>>16&255]<<16^d[h>>8&255]<<8^d[255&y]^r[b++],u=p,p=m,m=h,h=y,y=u;return a}},kt=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=ct.h(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 ct.S(e,a)}},vt=ut.P;let Mt=At&&Ut&&typeof Dt.importKey==F,Ct=At&&Ut&&typeof Dt.deriveBits==F;class It extends TransformStream{constructor({password:t,rawPassword:e,encryptionStrength:r,checkPasswordOnly:n}){super({start(){jt(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 _t(t,e,r,Lt(n,0,xt[e])),s=Lt(n,xt[e]);if(a[0]!=s[0]||a[1]!=s[1])throw Error(wt)})(r,s,a,Lt(t,0,xt[s]+2)),t=Lt(t,xt[s]+2),n?e.error(Error(mt)):i()):await o;const c=new Uint8Array(t.length-Ft-(t.length-Ft)%yt);e.enqueue(Pt(r,t,c,0,Ft,!0))},async flush(t){const{st:e,it:r,pending:n,ready:a}=this;if(r&&e){await a;const s=Lt(n,0,n.length-Ft),i=Lt(n,n.length-Ft);let o=R;if(s.length){const t=Vt(Tt,s);r.update(t);const n=e.update(t);o=Bt(Tt,n)}const c=Lt(Bt(Tt,r.digest()),0,Ft);let l=n.length<Ft?1:0;for(let t=0;Ft>t;t++)l|=c[t]^i[t];if(l)throw Error(pt);t.enqueue(o)}}})}}class Nt extends TransformStream{constructor({password:t,rawPassword:e,encryptionStrength:r}){let n;super({start(){jt(this,t,e,r)},async transform(t,e){const r=this,{password:n,strength:a,nt:s,ready:i}=r;let o=R;n?(o=await(async(t,e,r)=>{const n=ht(new Uint8Array(xt[e]));return st(n,await _t(t,e,r,n))})(r,a,n),s()):await i;const c=new Uint8Array(o.length+t.length-t.length%yt);c.set(o,0),e.enqueue(Pt(r,t,c,o.length,0))},async flush(t){const{st:e,it:r,pending:a,ready:s}=this;if(r&&e){await s;let i=R;if(a.length){const t=e.update(Vt(Tt,a));r.update(t),i=Bt(Tt,t)}n.signature=Bt(Tt,r.digest()).slice(0,Ft),t.enqueue(st(i,n.signature))}}}),n=this}}function jt(t,e,r,n){Object.assign(t,{ready:new Promise(e=>t.nt=e),password:Wt(e,r),strength:n-1,pending:R})}function Pt(t,e,r,n,a,s){const{st:i,it:o,pending:c}=t;c.length&&(e=st(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%yt)),d=0;l-yt>=d;d+=yt){const t=Vt(Tt,Lt(e,d,d+yt));s&&o.update(t);const a=i.update(t);s||o.update(a),r.set(Bt(Tt,a),d+n)}return t.pending=Lt(e,d),r}async function _t(t,e,r,n){t.password=null;const a=await(async(t,e,r,n,a)=>{if(!Mt)return ut.importKey(e);try{return await Dt.importKey("raw",e,r,!1,a)}catch{return Mt=!1,ut.importKey(e)}})(0,r,St,0,Et),s=await(async(t,e,r)=>{if(!Ct)return ut._(e,t.salt,gt.iterations,r);try{return await Dt.deriveBits(t,e,r)}catch{return Ct=!1,ut._(e,t.salt,gt.iterations,r)}})(Object.assign({salt:n},gt),a,8*(2*zt[e]+2)),i=new Uint8Array(s),o=Vt(Tt,Lt(i,0,zt[e])),c=Vt(Tt,Lt(i,zt[e],2*zt[e])),l=Lt(i,2*zt[e]);return Object.assign(t,{keys:{key:o,ot:c,passwordVerification:l},st:new kt(new Ot(o),Array.from(Rt)),it:new vt(c)}),l}function Wt(t,e){return e===E?at(t):e}function Lt(t,e,r){return t.subarray(e,r)}function Bt(t,e){return t.R(e)}function Vt(t,e){return t.A(e)}class Zt 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=Kt(r,t.subarray(0,12));if(r.password=r.rawPassword=null,0!=(e[11]^r.passwordVerification))throw Error(wt);t=t.subarray(12)}n?e.error(Error(mt)):e.enqueue(Kt(r,t))}})}}class Ht 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=ht(new Uint8Array(12));e[11]=r.passwordVerification,n=new Uint8Array(t.length+e.length),n.set(Yt(r,e),0),a=12}else n=new Uint8Array(t.length),a=0;n.set(Yt(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 rt(n[0]),lt:new rt(n[2])}),r)for(let e=0;e<r.length;e++)Gt(t,r[e]);else for(let r=0;r<e.length;r++)Gt(t,e.charCodeAt(r))})(t,e,r)}function Kt(t,e){const r=new Uint8Array(e.length);for(let n=0;n<e.length;n++)r[n]=Xt(t)^e[n],Gt(t,r[n]);return r}function Yt(t,e){const r=new Uint8Array(e.length);for(let n=0;n<e.length;n++)r[n]=Xt(t)^e[n],Gt(t,e[n]);return r}function Gt(t,e){let[,r]=t.keys;t.ct.append([e]);const n=~t.ct.get();r=Qt(Math.imul(Qt(r+Jt(n)),134775813)+1),t.lt.append([r>>>24]);const a=~t.lt.get();t.keys=[n,r,a]}function Xt(t){const e=2|t.keys[2];return Jt(Math.imul(e,1^e)>>>8)}function Jt(t){return 255&t}function Qt(t){return 4294967295&t}function $t(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 te(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 ee="Invalid uncompressed size",re="Invalid compressed data",ne="deflate-raw",ae="gzip",se=[31,139,8];class ie extends TransformStream{constructor(t,{chunkSize:e,CompressionStreamZlib:r,CompressionStream:n}){super({});const{compressed:a,encrypted:s,useCompressionStream:i,zipCrypto:o,signed:c,level:l,deflate64:d,format:u,compressionMethod:f}=t,w=this;let p,m,h,y=super.readable;const b=u&&H(u),S=c&&a&&!d&&!b&&(!s||o)&&!(!i||!n);if(s&&!o||!c||S||(p=new nt,y=pe(y,p)),a)if(b)y=me(y,fe(b.CompressionStream,u,{level:l,chunkSize:e,compressionMethod:f}));else if(S)h=new oe,y=me(y,new n(ae)),y=pe(y,h);else try{y=we(y,i,{level:l,chunkSize:e},n,r)}catch(t){let e;try{e=new n(ae)}catch{throw t}y=me(y,e),y=pe(y,new oe)}s&&(o?y=pe(y,new Ht(t)):(m=new Nt(t),y=pe(y,m))),ue(w,y,()=>{let t;s&&!o&&(t=m.signature),s&&!o||!c||(t=S?h.signature:new DataView(p.value.buffer).getUint32(0)),w.signature=t})}}class oe 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=st(r,t));const s=a-8,i=Math.min(s,r.length);n.enqueue(st(r.subarray(0,i),t.subarray(0,s-i))),r=st(r.subarray(i),t.subarray(s-i))},flush(){const e=ot(r);t.signature=e.getUint32(0,!0),t.uncompressedSize=e.getUint32(4,!0)}}),t=this}}class ce extends TransformStream{constructor(t,e){super({start(t){const e=new Uint8Array(10);e.set(se),t.enqueue(e)},transform(t,e){e.enqueue(t)},flush(r){const n=new Uint8Array(8),a=ot(n);a.setUint32(0,t,!0),a.setUint32(4,e,!0),r.enqueue(n)}})}}class le extends TransformStream{constructor(t,{chunkSize:e,DecompressionStreamZlib:r,DecompressionStream:n}){super({});const{zipCrypto:a,encrypted:s,signed:i,signature:o,compressed:c,useCompressionStream:l,deflate64:d,format:u,compressionMethod:f,rawBitFlag:w,outputSize:p}=t;let m,h,y=super.readable;if(s&&(a?y=pe(y,new Zt(t)):(h=new It(t),y=pe(y,h))),c){const t=u&&H(u);if(t)y=me(y,fe(t.DecompressionStream,u,{chunkSize:e,compressionMethod:f,rawBitFlag:w,uncompressedSize:p}));else try{y=we(y,l,{chunkSize:e,deflate64:d},n,r)}catch(t){if(d||s&&!a||o===E||p===E)throw t;let e;try{e=new n(ae)}catch{throw t}y=pe(y,new ce(o,p)),y=me(y,e)}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(re);throw e.cause=t,e}const{value:n,done:a}=r;a?t.close():t.enqueue(n)},cancel:t=>e.cancel(t)})})(y)}s&&!a||!i||(m=new nt,y=pe(y,m)),ue(this,y,()=>{if((!s||a)&&i){const t=new DataView(m.value.buffer);if(o!=t.getUint32(0,!1))throw Error(pt)}})}}const de=new Map;function ue(t,e,r){e=pe(e,new TransformStream({flush:r})),Object.defineProperty(t,"readable",{get:()=>e})}function fe(t,e,r){if(!t)throw Error("Compression method not supported");return new t(e,r)}function we(t,e,r,n,a){const s=e&&n?n:a||n,i=r.deflate64?"deflate64-raw":ne;let o;try{o=new s(i,r)}catch(t){if(!e||!a||s==a)throw t;o=new a(i,r)}return me(t,o)}function pe(t,e){return $t(t).pipeThrough(e)}function me(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 he="data",ye="deflate",be="inflate";class Se extends TransformStream{constructor(t,e){super({});const r=this,{codecType:n}=t;let a;n.startsWith(ye)?a=ie:n.startsWith(be)&&(a=le),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!==E&&r.outputSize>t.outputSize))throw Error(ee)},flush(){const{signature:t}=i;Object.assign(r,{signature:t,inputSize:s})}});Object.defineProperty(r,"readable",{get:()=>o.pipeThrough(c).pipeThrough(i).pipeThrough(l)})}}class ge 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 Ee={type:"module"},xe="error";let ze,Fe,Re,Ae,De=!0;try{De=typeof structuredClone==F&&structuredClone(new DOMException("","AbortError")).code!==E}catch{}let Ue=()=>{};class Te{constructor(t,{readable:e,writable:r},{options:n,config:a,ut:s,useWebWorkers:i,transferStreams:o,workerURI:c},l){const{signal:d}=s;return Object.assign(t,{ft:!0,wt:(t.wt||0)+1,readable:e.pipeThrough(new ge(k(a))).pipeThrough(new Oe(s),{signal:d}),writable:r,options:Object.assign({},n),workerURI:c,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.gt=!0,t.ht.terminate(),e()),t.ft=!1,l(t)}}}),ze===E&&(ze=typeof Worker!=z),(i&&ze?Me:ve)(t,a)}}class Oe extends TransformStream{constructor({onstart:t,onprogress:e,size:r,onend:n}){let a=0;super({async start(){t&&await ke(t,r)},async transform(t,n){a+=t.length,e&&await ke(e,a,r),n.enqueue(t)},async flush(){n&&await ke(n,a)}})}}async function ke(t,...e){try{await t(...e)}catch{}}function ve(t,e){return{run:()=>Ce(t,e)}}function Me(t,e){const{baseURI:r,chunkSize:n,workerStartupTimeout:a}=e;let{wasmURI:s}=e;if(!t.bt){let i;typeof s==F&&(s=s());try{i=Ne(t.workerURI,r,t)}catch{return ze=!1,ve(t,e)}Object.assign(t,{ht:i,Et:!1,gt:!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,Ft: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,Ft:()=>e.abort()}})(t.writable);let d;try{d=_e({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.Et||!Number.isFinite(u)||0>u||(t.Rt=setTimeout(()=>(t=>{if(t.Rt=null,t.Et)return;const{zt:e,writer:r}=t;if(Ie(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){ze=!1;const{reader:r}=t;return r&&r.releaseLock(),t.reader=null,t.writer=null,Ce(t,e)}throw r}}}})}return t.bt}async function Ce({options:t,readable:e,writable:r,St:n},a){let s;try{if(t.compressed&&!t.format){const e=t.codecType.startsWith(ye),r=e?a.CompressionStreamZlib:a.DecompressionStreamZlib,n=e?a.CompressionStream:a.DecompressionStream;if(t.useCompressionStream){if(r&&r.Dt&&!(t=>{if(!t)return!1;let e=de.get(t);if(e===E){try{new t(ne),e=!0}catch{e=!1}de.set(t,e)}return e})(n))try{await Ue(a)}catch{}}else try{await Ue(a)}catch{r&&!r.Dt||(t.useCompressionStream=!0)}}s=new Se(t,a),await e.pipeThrough(s).pipeThrough(new ge(k(a))).pipeTo(r,{preventClose:!0,preventAbort:!0});const{signature:n,inputSize:i,outputSize:o}=s;return{signature:n,inputSize:i,outputSize:o}}catch(t){throw s&&(t.outputSize=s.outputSize),t}finally{n()}}function Ie(t){const{ht:e}=t;if(e)try{e.terminate()}catch{}t.bt=null}function Ne(t,e,r,n,a=!0){let s,i,o;if(Re===E||Fe!==t){const c=typeof t==F;i=c?t(a):t;const l=i.startsWith("data:"),d=i.startsWith("blob:");if(l||d){n===E&&(n=!1),n&&(o=Ee);try{s=new Worker(i,o)}catch(a){if(d)try{URL.revokeObjectURL(i)}catch{}if(c&&d)return Ne(t,e,r,n,!1);if(n)throw a;return Ne(t,e,r,!0,!1)}}else{n===E&&(n=!0),n&&(o=Ee);try{i=new URL(i,e)}catch{}try{s=new Worker(i,o)}catch(s){if(n)throw s;return Ne(t,e,r,!1,a)}}Fe=t,Re=i,Ae=o}else s=new Worker(Re,Ae);return s.addEventListener("message",t=>{r.Et=!0,je(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})),p(o)}else{if("pull"==r){const{value:t,done:r}=await o.read();w()||_e({type:he,value:t,done:r,messageId:a},e)}r==he&&(await c.ready,await c.write(new Uint8Array(n)),w()||_e({type:"ack",messageId:a},e)),"close"==r&&p(null,s)}}catch(i){w()||(Ie(e),p(i))}function p(t,e){w()||(t?d(t):l(e),c&&c.releaseLock(),u())}})(t,r)}),s.addEventListener(xe,t=>Pe(t,r)),s.addEventListener("messageerror",t=>Pe(t,r)),s}function je(t){const{Rt:e}=t;e&&(clearTimeout(e),t.Rt=null)}function Pe(t,e){t.preventDefault&&t.preventDefault(),je(e);const{Et:r,zt:n,writer:a,St:s}=e;if(Ie(e),r||(e.ht=null),n){let e=t.error||Error(t.message||xe);r||(e=Object.assign(Error(e.message||xe),{At:!0})),n(e),a&&a.releaseLock(),r&&s()}}function _e(t,{ht:e,writer:r,transferStreams:n,Et:a}){try{const{value:r,readable:s,writable:i}=t,o=[];if(r&&(t.value=it(r),o.push(t.value.buffer)),n&&De&&a?(s&&o.push(s),i&&o.push(i)):t.readable=t.writable=null,o.length)try{return e.postMessage(t,o),!0}catch{De=!1,t.readable=t.writable=null,e.postMessage(t)}else e.postMessage(t)}catch(t){throw r&&r.releaseLock(),t}}let We=[];const Le=[];let Be,Ve,Ze=0;async function He(t,e){const{options:r,config:n}=e,{transferStreams:a,useWebWorkers:s,useCompressionStream:i,compressed:o,signed:c,encrypted:l,format:d,codecURI:u}=r,{workerURI:f,maxWorkers:w}=n;d&&(u&&(r.codecURI=((t,e)=>{try{return new URL(t,e).toString()}catch{return t}})(u,n.baseURI)),await(async(t,e)=>{!L.has(t)&&e&&q(t,await(import(/* webpackIgnore: true */ /* @vite-ignore */e)))})(d,r.codecURI)),e.transferStreams=a||a===E&&n.transferStreams;const p=!o&&!c&&!l,m=d===E||!!r.codecURI;return e.useWebWorkers=!p&&m&&(s||s===E&&n.useWebWorkers),e.workerURI=e.useWebWorkers&&f?f:E,r.useCompressionStream=i||i===E&&n.useCompressionStream,(await(async()=>{const r=We.find(t=>!t.ft);if(r)return Xe(r),new Te(r,t,e,h);if(We.length<w){const r={Ut:Ze};return Ze++,We.push(r),new Te(r,t,e,h)}return new Promise(r=>{Le.push({resolve:r,stream:t,Tt:e}),Ve=n.workerStarvationTimeout,qe()})})()).run();function h(t){if(Ke(),Le.length){const[{resolve:e,stream:r,Tt:n}]=Le.splice(0,1);e(new Te(t,r,n,h)),qe()}else t.ht?(Xe(t),((t,e)=>{const{config:r}=e,{terminateWorkerTimeout:n}=r;Number.isFinite(n)&&n>=0&&(t.gt?t.gt=!1:t.Ot=setTimeout(async()=>{We=We.filter(e=>e!=t);try{await t.terminate()}catch{}},n))})(t,e)):We=We.filter(e=>e!=t)}}function qe(){!Be&&Le.length&&Number.isFinite(Ve)&&Ve>=0&&(Be=setTimeout(Ye,Ve))}function Ke(){Be&&(clearTimeout(Be),Be=null)}function Ye(){if(Be=null,Le.length){const[{resolve:t,stream:e,Tt:r}]=Le.splice(0,1),n=Object.assign({},r,{useWebWorkers:!1,workerURI:E});t(new Te({},e,n,Ge)),qe()}}function Ge(){Ke(),qe()}function Xe(t){const{Ot:e}=t;e&&(clearTimeout(e),t.Ot=null)}const Je="HTTP error ",Qe="HTTP Range not supported",$e="HTTP resource changed",tr="Writer iterator completed too soon",er="Writer not initialized",rr="Content-Range",nr="Range",ar="GET",sr="bytes",ir=16777216,or="writable",cr=Symbol();class lr{constructor(){this.size=0}init(){this.initialized=!0}}class dr extends lr{get readable(){return this.createReadable()}createReadable({offset:t=0,size:e,chunkSize:r=k(O())}={}){const n=this;let a=0;return new ReadableStream({async pull(s){const i=e===E?r:Math.min(r,e-a),o=await qr(n,t+a,i);s.enqueue(o),a+r>e||e===E&&!o.length&&i?s.close():a+=r}})}}class ur extends lr{constructor(){super();const t=this,e=new WritableStream({write(e){if(!t.initialized)throw Error(er);return t.writeUint8Array(it(e))}});Object.defineProperty(t,or,{get:()=>e})}writeUint8Array(){}}class fr extends dr{constructor(t){super();let e=t.length;for(;"="==t.charAt(e-1);)e--;const r=t.indexOf(",")+1;Object.assign(this,{dataURI:t,kt:r,size:Math.floor(.75*(e-r))})}readUint8Array(t,e){const{kt: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 wr extends ur{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 pr,mr;class hr extends dr{constructor(t){super(),Object.assign(this,{blob:t,size:t.size}),mr||(mr=(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();pr=1==e}catch{pr=!1}})())}createReadable(t){const{blob:e,size:r}=this,{offset:n=0,size:a=r-n}=t||{};return n||r>a?pr?$t(e.slice(n,n+a).stream()):super.createReadable(t):$t(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 yr extends lr{constructor(t){super();const e=this,r=new TransformStream;if(Object.defineProperty(e,or,{get:()=>r.writable}),typeof Blob.prototype.stream!=F||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 br extends hr{constructor(t){super(new Blob([t],{type:"text/plain"}))}}class Sr extends yr{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 gr extends dr{constructor(t,e){super(),xr(this,t,e)}async init(){await zr(this,Ir,kr),super.init()}createReadable(t){const e=this,{useRangeHeader:r,forceRangeRequests:n,size:a}=e;if((r||n)&&a!==E){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(Qe);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=E,await t.cancel()})(),i||t.close())},cancel:t=>n&&n.cancel(t)});async function o(){const e=Math.min(t.maximumRangeSize,i),r=await Ir(ar,t,Tr(t,a,e));if(206!=r.status)throw Error(Qe);const o=r.headers.get(rr);if(o){const t=Number(o.trim().split(/[\s-]+/)[1]);if(!Number.isNaN(t)&&t!=a)throw Error(Qe)}Ur(t,r),Dr(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 Fr(this,t,e,Ir,kr)}}class Er extends dr{constructor(t,e){super(),xr(this,t,e)}async init(){await zr(this,Nr,vr),super.init()}readUint8Array(t,e){return Fr(this,t,e,Nr,vr)}}function xr(t,e,r){const{preventHeadRequest:n,useRangeHeader:a,forceRangeRequests:s,combineSizeEocd:i,checkResourceChanges:o=!0,maximumRangeSize:c=ir,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 zr(t,e,r){const{url:n,preventHeadRequest:a,useRangeHeader:s,forceRangeRequests:i,combineSizeEocd:o}=t;if((t=>{const{baseURI:e}=O(),{protocol:r}=new URL(t,e);return"http:"==r||"https:"==r})(n)&&(s||i)&&(void 0===a||a)){const n=await e(ar,t,Tr(t,o?-22:void 0)),a=n.headers.get("Accept-Ranges");if(!(i||a&&a.toLowerCase()==sr))throw Error(Qe);{if(o){const e=new Uint8Array(await n.arrayBuffer());206==n.status&&e.length==d&&(t.Mt=e)}Dr(t,n);const a=Rr(n);a===E?await Cr(t,e,r):t.size=a}}else await Cr(t,e,r)}async function Fr(t,e,r,n,a){const{useRangeHeader:s,forceRangeRequests:i,Mt: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(ar,t,Tr(t,e,r));if(206!=a.status)throw Error(Qe);const s=a.headers.get(rr);if(s){const t=Number(s.trim().split(/[\s-]+/)[1]);if(!Number.isNaN(t)&&t!=e)throw Error(Qe)}Ur(t,a),Dr(t,a);const i=new Uint8Array(await a.arrayBuffer());if(i.length!=r)throw Error(Qe);return i}return R}{const{data:n}=t;return n||await a(t,l),t.data.subarray(e,e+r)}}function Rr(t){const e=t.headers.get(rr);if(e){const t=e.trim().split(/\s*\/\s*/)[1];if(t&&"*"!=t){const e=Number(t);if(!Number.isNaN(e))return e}}}function Ar({headers:t}){return{Ct:t.get("Etag")||E,lastModified:t.get("Last-Modified")||E}}function Dr(t,e){const{checkResourceChanges:r,It:n}=t;r&&!n&&206==e.status&&(t.It=Ar(e))}function Ur(t,e){const{checkResourceChanges:r,It:n,size:a}=t;if(r){const t=Rr(e);if(t!==E&&a!==E&&t!=a)throw Error($e);if(n){const t=Ar(e);if(Object.entries(n).some(([e,r])=>r!==E&&t[e]!==E&&r!=t[e]))throw Error($e)}}}function Tr(t,e=0,r=1){return Object.assign({},Or(t),{[nr]:sr+"="+(0>e?e:e+"-"+(e+r-1))})}function Or({options:t}){const{headers:e}=t;if(e)return Symbol.iterator in e?Object.fromEntries(e):e}async function kr(t){await Mr(t,Ir)}async function vr(t){await Mr(t,Nr)}async function Mr(t,e){const r=await e(ar,t,Or(t));t.data=new Uint8Array(await r.arrayBuffer()),t.size=t.data.length}async function Cr(t,e,r){if(t.preventHeadRequest)await r(t,t.options);else{const n=await e("HEAD",t,Or(t)),a=n.headers.get("Content-Length");a&&!n.headers.get("Content-Encoding")?t.size=Number(a):await r(t,t.options)}}async function Ir(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(Qe):Error(Je+(s.statusText||s.status))}function Nr(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(Qe):Error(Je+(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 jr extends dr{constructor(t,e={}){super(),Object.assign(this,{url:t,reader:e.useXHR&&!e.fetch?new Er(t,e):new gr(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 Pr extends jr{constructor(t,e={}){super(t,Object.assign({},e,{useRangeHeader:!0}))}}class _r extends dr{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 Wr extends ur{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 Lr extends dr{constructor(t){super(),this.Nt=t}async init(){const t=this,{Nt:e}=t;t.jt=0,await Promise.all(e.map(t=>Hr(t))),t.Pt=e.map(e=>{const r=t.size;return t.size+=e.size,r}),super.init()}_t(t){const{Pt:e,size:r}=this,n=e[t];return n===E?r:n}async readUint8Array(t,e){const r=this,{Nt: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=st(await qr(o,i,s),await r.readUint8Array(t+s,e-s))}else a=await qr(o,i,e)}else a=R;return r.jt=Math.max(s,r.jt),a}}class Br extends lr{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===cr)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(tr);n=i,n.size=0,n.maxSize&&(r.maxSize=n.maxSize),r.availableSize=r.maxSize,await Hr(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,or,{get:()=>i})}async closeDisk(){const t=this.writable.getWriter();try{await t.ready,await t.write(cr)}finally{t.releaseLock()}}}class Vr{constructor(t){return Array.isArray(t)&&(t=new Lr(t)),(t instanceof ReadableStream||typeof t.getReader==F)&&(t={readable:$t(t)}),t}}class Zr{constructor(t){return t.writable===E&&typeof t.next==F&&(t=new Br(t)),(t instanceof WritableStream||typeof t.getWriter==F)&&(t={writable:te(t)}),t.size===E&&(t.size=0),t}}async function Hr(t,e){if(!t.init||t.initialized)return Promise.resolve();await t.init(e)}function qr(t,e,r){return t.readUint8Array(e,r)}const Kr="\0☺☻♥♦♣♠•◘○◙♂♀♪♫☼►◄↕‼¶§▬↨↑↓→←∟↔▲▼ !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~⌂ÇüéâäàåçêëèïîìÄÅÉæÆôöòûùÿÖÜ¢£¥₧ƒáíóúñѪº¿⌐¬½¼¡«»░▒▓│┤╡╢╖╕╣║╗╝╜╛┐└┴┬├─┼╞╟╚╔╩╦╠═╬╧╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀αßΓπΣσµτΦΘΩδ∞φε∩≡±≥≤⌠⌡÷≈°∙·√ⁿ²■ ".split("");function Yr(t,e){return e&&"cp437"==e.trim().toLowerCase()?(t=>{{let e="";for(let r=0;r<t.length;r++)e+=Kr[t[r]];return e}})(t):new TextDecoder(e,{ignoreBOM:!0}).decode(t)}const Gr="filename",Xr="rawFilename",Jr="comment",Qr="rawComment",$r="uncompressedSize",tn="compressedSize",en="offset",rn="diskNumberStart",nn="lastModDate",an="rawLastModDate",sn="lastAccessDate",on="creationDate",cn="rawCreationDate",ln="internalFileAttributes",dn="externalFileAttributes",un="msdosAttributesRaw",fn="msdosAttributes",wn="msDosCompatible",pn="zip64",mn="encrypted",hn="version",yn="versionMadeBy",bn="zipCrypto",Sn="directory",gn="executable",En="compressionMethod",xn="signature",zn="extraField",Fn="unixMode",Rn="setuid",An="setgid",Dn="sticky",Un=[Gr,Xr,$r,tn,nn,an,Jr,Qr,sn,on,cn,en,rn,ln,dn,un,fn,wn,pn,mn,hn,yn,bn,Sn,gn,En,xn,zn,"extraFieldUnix","extraFieldInfoZip","uid","gid",Fn,Rn,An,Dn,"bitFlag","filenameUTF8","commentUTF8","rawExtraField","extraFieldZip64","extraFieldUnicodePath","extraFieldUnicodeComment","extraFieldAES","extraFieldNTFS","extraFieldExtendedTimestamp"];class Tn{constructor(t){Un.forEach(e=>this[e]=t[e])}}const On="password",kn="rawPassword",vn="passThrough",Mn="signal",Cn="checkAmbiguity",In="useWebWorkers",Nn="useCompressionStream",jn="transferStreams",Pn="preventClose",_n="offset",Wn="usdz",Ln="strictness",Bn="strict",Vn="tolerant",Zn="File format is not recognized",Hn="End of central directory not found",qn="End of Zip64 central directory locator not found",Kn="Central directory header not found",Yn="Local file header not found",Gn="Zip64 extra field not found",Xn="File contains encrypted entry",Jn="Encryption method not supported",Qn="Compression method not supported",$n="Split zip file",ta="Overlapping entry found",ea="Ambiguous archive",ra="Encrypted central directory is not supported",na="utf-8",aa="cp437",sa=[[$r,t],[tn,t],[en,t],[rn,e]],ia={[e]:{Wt:va,bytes:4},[t]:{Wt:Ma,bytes:8}};class oa{constructor(t,e={}){Object.assign(this,{reader:new Vr(t),options:e,config:O(),Lt:new Map})}async*getEntriesGenerator(n={}){const s=this;let{reader:o}=s;const{config:f}=s;if(await Hr(o),o.size!==E&&o.readUint8Array||(o=new hr(await new Response(o.readable).blob()),await Hr(o)),o.size<d)throw Error(Zn);const w=ya(Da(s,n,Ln),Da(s,n,Cn)),b=w==Bn,S=w!=Vn,g=((t,r)=>t!==E?t:r==Bn?0:r==Vn?1/0:e)(Da(s,n,"maxAppendedDataSize"),w),{Bt:x,Vt:z}=await(async(t,e,r)=>{const{size:n}=t,a=Math.min(n,65557),s={count:ba};let i,o,c=0;for await(const[r,l,u,f,w]of xa(t,a)){const a=ka(r,f+20);if(w+d+a==n){const a=await Fa(t,r,l,f,w,n,s);if(a==Ea){if(i||(i=za(u,f,w)),c++,!e||c>1)break}else a!=ga||o||(o=za(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 xa(t,a)){const a=za(c,l,d);s||(s=a);const u=await Fa(t,e,o,l,d,n,r);if(u==Ea)return a;u!=ga||i||(i=a)}return i||s})(t,r,s)),{Bt:i,Vt:c}})(o,S,g);if(!x)throw va(ot(await qr(o,0,4)))==a?Error($n):Error(Hn);S&&z>1&&Aa("multiple end of central directory records");const F=ot(x);let A=va(F,12),D=va(F,16);const U=x.offset,T=ka(F,20),O=U+d+T;o.size-O>g&&Aa("appended data");let k=ka(F,4);const v=o.jt||0;let M,C,I,N=ka(F,6),j=ka(F,10),P=0;const _=D==t||A==t||j==e||N==e;if(D!=t&&N!=e&&(D+=ha(o,N)),_){const r=x.offset<u?R:await qr(o,x.offset-u,u),n=ot(r);if(r.length==u&&va(n,0)==l){D=ha(o,va(n,4))+Ma(n,8);let r=await qr(o,D,56),a=ot(r);const s=x.offset-u-56;if((56>r.length||va(a,0)!=c)&&D!=s&&s>=0){const t=D;D=s,D>t&&(P=D-t),r=await qr(o,D,56),a=ot(r)}if(56>r.length||va(a,0)!=c)throw Error(qn);C=!0,I=Ma(a,4)>44,k==e?k=va(a,16):b&&k!=va(a,16)&&Aa("mismatched zip64 end of central directory record"),N==e?N=va(a,20):b&&N!=va(a,20)&&Aa("mismatched zip64 end of central directory record"),j==e?j=Ma(a,32):b&&j!=Ma(a,32)&&Aa("mismatched zip64 end of central directory record"),A==t?A=Ma(a,40):b&&A!=Ma(a,40)&&Aa("mismatched zip64 end of central directory record"),D=ha(o,N)+Ma(a,48)+P}}const W=A,L=x.offset-(C?76:0);if(D<o.size||(P=o.size-D-A-d,D=o.size-A-d),v!=k)throw Error($n);if(0>D)throw Error(Zn);let B=0,V=await qr(o,D,A),Z=ot(V);if(A){if(4>V.length)throw Error(Zn);const t=L-A;if(D!=t&&N==k){let e=!(va(Z,B)==i);if(e||0>t||t+4>o.size||(e=va(ot(await qr(o,t,4)),0)==i),e){const e=D;D=t,D>e&&(P+=D-e),V=await qr(o,D,A),Z=ot(V)}}}const H=L-D;if(A==H||0>H||N!=k||(A=H,V=await qr(o,D,A),Z=ot(V)),0>D||D>=o.size)throw Error(Zn);M=D;const q=Da(s,n,"filenameEncoding"),K=Da(s,n,"commentEncoding"),Y=b?new Set:E;let G;for(let t=0;j>t;t++){const a=new la(o,f,s.options);if(B+46>V.length||va(Z,B)!=i){if(0==t&&(I||da(Z)))throw Error(ra);throw Error(Kn)}ua(a,Z,B+6);const c=!!a.bitFlag.languageEncodingFlag,l=B+46,d=l+a.filenameLength,u=d+a.extraFieldLength,w=ka(Z,B+4),S=!(w>>8),g=w>>8==3,x=V.subarray(l,d),z=ka(Z,B+32),F=u+z,R=V.subarray(u,F),A=c,D=c,U=va(Z,B+38),T=U&r,O={readOnly:!!(1&T),hidden:!!(2&T),system:!!(4&T),directory:!!(16&T),archive:!!(32&T)},k=va(Z,B+42),v=Da(s,n,"decodeText")||Yr,C=A?na:q||aa,N=D?na:K||aa;let _=v(x,C);_===E&&(_=Yr(x,C));let W=v(R,N);W===E&&(W=Yr(R,N)),Object.assign(a,{index:t,versionMadeBy:w,msDosCompatible:S,compressedSize:0,uncompressedSize:0,Zt:z,offset:k,diskNumberStart:ka(Z,B+34),internalFileAttributes:ka(Z,B+36),externalFileAttributes:U,msdosAttributesRaw:T,msdosAttributes:O,rawFilename:x,filenameUTF8:A,commentUTF8:D,rawExtraField:V.subarray(d,u),rawComment:R,filename:_,comment:W}),fa(a,a,Z,B+6),a.offset+=P,M=Math.min(ha(o,a.diskNumberStart)+a.offset,M),b&&(Y.has(a.filename)&&(G=!0),Y.add(a.filename));const L=a.externalFileAttributes>>16&e;a.unixMode===E&&16877&L&&(a.unixMode=L);const H=!!(a.unixMode&m),X=!!(a.unixMode&h),J=!!(512&a.unixMode),Q=a.unixMode!==E?!!(73&a.unixMode):g&&!!(73&L),$=a.unixMode!==E&&(61440&a.unixMode)==p,tt=(61440&L)==p;Object.assign(a,{setuid:H,setgid:X,sticky:J,unixExternalUpper:L,internalFileAttribute:a.internalFileAttributes,externalFileAttribute:a.externalFileAttributes,executable:Q,directory:$||tt||S&&O.directory||a.filename.endsWith(y)&&!a.uncompressedSize,zipCrypto:a.encrypted&&!a.extraFieldAES});const et=new Tn(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=F;const{onprogress:rt}=n;if(rt)try{await rt(t+1,j,new Tn(a))}catch{}yield et}b&&B!=W&&Aa("trailing central directory data"),G&&Aa("duplicate filename"),b&&(P||j&&M>0)&&Aa("prepended data");const X=Da(s,n,"extractPrependedData"),J=Da(s,n,"extractAppendedData");return X&&(s.prependedData=M>0?await qr(o,0,M):R),s.comment=T?await qr(o,U+d,T):R,J&&(s.appendedData=O<o.size?await qr(o,O,o.size-O):R),!0}async getEntries(t={}){const e=[];for await(const r of this.getEntriesGenerator(t))e.push(r);return e}async close(){}}class ca{constructor(t={}){const{readable:e,writable:r}=new TransformStream,n=new oa(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}}class la{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:p,config:m,bitFlag:h,rawBitFlag:y,signature:S,rawLastModDate:g,uncompressedSize:x,compressedSize:z}=o,{dataDescriptor:F}=h,A=e.localDirectory={},D=ha(c,u)+d,U=await qr(c,D,b),T=ot(U);let O=Da(o,i,On),k=Da(o,i,kn);const v=Da(o,i,vn);if(O=O&&O.length&&O,k=k&&k.length&&k,f&&99!=f.originalCompressionMethod)throw Error(Qn);if(U.length<b||va(T,0)!=n)throw Error(Yn);ua(A,T,4);const{extraFieldLength:M,filenameLength:C}=A,I=ya(Da(o,i,Ln),Da(o,i,Cn))==Bn;let N=R;if(I&&(C||M)){const t=await qr(c,D+b,C+M);N=t.subarray(0,C),A.rawExtraField=t.subarray(C)}else A.rawExtraField=M?await qr(c,D+b+C,M):R;fa(o,A,T,4,!0),I&&((t,e,r)=>{const{rawFilename:n}=t;(r.length!=n.length||r.some((t,e)=>t!=n[e]))&&Aa("mismatched local file header (filename)"),(2057&e.rawBitFlag)!=(2057&t.rawBitFlag)&&Aa("mismatched local file header (general purpose bit flag)"),e.compressionMethod!=t.compressionMethod&&Aa("mismatched local file header (compression method)"),e.bitFlag.dataDescriptor||!(e.signature||e.compressedSize||e.uncompressedSize)||e.signature==t.signature&&e.compressedSize==t.compressedSize&&e.uncompressedSize==t.uncompressedSize||Aa("mismatched local file header (signature or sizes)")})(o,A,N);const{lastAccessDate:j,creationDate:P}=A;j&&(e.lastAccessDate=j),P&&(e.creationDate=P);const _=o.encrypted&&A.encrypted&&!v,W=_&&!f;if(v||(e.zipCrypto=W),_&&!(64&~A.rawBitFlag))throw Error(Jn);const L=v?E:Z(p);if(0!=p&&8!=p&&9!=p&&!L&&!v)throw Error(Qn);if(_){if(!W&&(1>f.strength||f.strength>3))throw Error(Jn);if(!O&&!k)throw Error(Xn)}const B=D+b+C+M,V=z,H=$t(c.createReadable({offset:B,size:V})),q=Da(o,i,Mn),K=Da(o,i,"checkPasswordOnly");let Y=Da(o,i,"checkOverlappingEntry");const G=Da(o,i,"checkOverlappingEntryOnly");G&&(Y=!0);const{onstart:X,onprogress:J,onend:Q}=i,$=9==p;let tt=Da(o,i,Nn);$&&(tt=!1);const et={options:{codecType:be,password:O,rawPassword:k,zipCrypto:W,encryptionStrength:f&&f.strength,signed:Da(o,i,"checkSignature")&&!v,passwordVerification:W&&(F?g>>>8&r:S>>>24&r),outputSize:v?z:x,signature:S,compressed:0!=p&&!v,encrypted:_,useWebWorkers:Da(o,i,In),useCompressionStream:tt,transferStreams:Da(o,i,jn),deflate64:$,format:L?L.format:E,codecURI:L?L.codecURI:E,compressionMethod:p,rawBitFlag:y,checkPasswordOnly:K},config:m,ut:{signal:q,size:V,onstart:X,onprogress:J,onend:Q}};let rt;Y&&await(async({reader:t,Ht:e,index:r,offset:n,signature: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 qr(t,c+i,f+4);if(r.length==f+4&&va(ot(r),0)==s){const t=va(ot(r),4);let n,s;d?(n=Ma(ot(r),8),s=Ma(ot(r),16)):(n=va(ot(r),8),s=va(ot(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(ta);throw t.Kt=e.Ht,t}u.set(r,w)})({reader:c,Ht:e,index:l,offset:D,signature:S,compressedSize:z,uncompressedSize:x,qt:B,dataDescriptor:F||A.bitFlag.dataDescriptor,extraFieldZip64:w||A.extraFieldZip64,Lt:a});try{if(!G){K&&(t=new WritableStream),t=new Zr(t),await Hr(t,v?z:x),({writable:rt}=t);const{outputSize:e}=await He({readable:H,writable:rt},et);if(t.size+=e,e!=(v?z:x))throw Error(ee)}}catch(e){if(e.outputSize!==E&&(t.size+=e.outputSize),!K||e.message!=mt)throw e}finally{Da(o,i,Pn)||!rt||rt.locked||await rt.getWriter().close()}return K||G?E:t.getData?t.getData():rt}}function da(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 ua(t,e,r){const n=t.rawBitFlag=ka(e,r+2),a=!(1&~n),s=va(e,r+6);Object.assign(t,{encrypted:a,version:ka(e,r),bitFlag:{level:(6&n)>>1,dataDescriptor:!(8&~n),languageEncodingFlag:(n&w)==w},rawLastModDate:s,lastModDate:Ua(s),filenameLength:ka(e,r+22),extraFieldLength:ka(e,r+24)})}function fa(t,e,r,n,a){const{rawExtraField:s}=e,i=e.extraField=new Map,o=ot(s);let c=0;try{for(;c<s.length;){const t=ka(o,c),e=ka(o,c+2);i.set(t,{type:t,data:s.slice(c+4,c+4+e)}),c+=4+e}}catch{}const l=ka(r,n+4);Object.assign(e,{signature: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=ot(t.data),n=sa.filter(([t,r])=>e[t]==r),a=n.reduce((t,[,e])=>t+ia[e].bytes,0);if(t.data.length<a)throw Error(Gn);for(let a=0,s=0;a<n.length;a++){const[i,o]=n[a],c=ia[o];e[i]=t[i]=c.Wt(r,s),s+=c.bytes}})(d,e),e.extraFieldZip64=d);const u=i.get(28789);u&&(wa(u,Gr,Xr,e,t),e.extraFieldUnicodePath=u);const w=i.get(25461);w&&(wa(w,Jr,Qr,e,t),e.extraFieldUnicodeComment=w);const p=i.get(39169);p&&p.data.length>=7?(((t,e,r)=>{const n=ot(t.data),a=Oa(n,4);Object.assign(t,{Yt:Oa(n,0),vendorId:Oa(n,2),strength:a,originalCompressionMethod:r,compressionMethod:ka(n,5)}),e.compressionMethod=t.compressionMethod})(p,e,l),e.extraFieldAES=p):e.compressionMethod=l;const m=i.get(10);m&&(((t,e)=>{const r=ot(t.data);let n,a=4;try{for(;a<t.data.length&&!n;){const e=ka(r,a),s=ka(r,a+2);1==e&&(n=t.data.slice(a+4,a+4+s)),a+=4+s}}catch{}try{if(n&&24==n.length){const r=ot(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:Ta(a),lastAccessDate:Ta(s),creationDate:Ta(i)};Object.assign(t,o),Object.assign(e,o)}}catch{}})(m,e),e.extraFieldNTFS=m);const h=i.get(30805);if(h)pa(h,e,!1),e.extraFieldUnix=h;else{const t=i.get(30837);t&&(pa(t,e,!0),e.extraFieldInfoZip=t)}const y=i.get(f);y&&(((t,e,r)=>{if(!t.data.length)return;const n=ot(t.data),a=Oa(n,0),s=[],i=[];r?(1&~a||(s.push(nn),i.push(an)),2&~a||(s.push(sn),i.push("rawLastAccessDate")),4&~a||(s.push(on),i.push(cn))):5>t.data.length||(s.push(nn),i.push(an));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})})(y,e,a),e.extraFieldExtendedTimestamp=y);const b=i.get(6534);b&&(e.extraFieldUSDZ=b)}function wa(t,e,r,n,a){if(5>t.data.length)return void(t.valid=!1);const s=ot(t.data),i=new rt;i.append(a[r]);const o=ot(new Uint8Array(4));o.setUint32(0,i.get(),!0);const c=va(s,1);Object.assign(t,{version:Oa(s,0),[e]:Yr(t.data.subarray(5)),valid:!a.bitFlag.languageEncodingFlag&&c==va(o,0)}),t.valid&&(n[e]=t[e],n[e+"UTF8"]=!0)}function pa(t,e,r){try{const n=ot(t.data);let a,s;if(r){let e=0;const r=Oa(n,e++),i=Oa(n,e++);a=ma(t.data.subarray(e,e+i)),e+=i;const o=Oa(n,e++);s=ma(t.data.subarray(e,e+o)),Object.assign(t,{version:r,uid:a,gid:s})}else 4>t.data.length||(a=ka(n,0),s=ka(n,2),Object.assign(t,{uid:a,gid:s}));a!==E&&(e.uid=a),s!==E&&(e.gid=s)}catch{}}function ma(t){const e=new Uint8Array(4);return e.set(t,0),new DataView(e.buffer,e.byteOffset,4).getUint32(0,!0)}function ha(t,e){return t._t?t._t(e):0}function ya(t,e){return t===E?e?Bn:"balanced":t}const ba=64,Sa=0,ga=1,Ea=2;async function*xa(t,e){const r=t.size-e,n=await qr(t,r,e),a=ot(n);for(let t=n.length-d;t>=0;t--)va(a,t)==o&&(yield[a,r,n,t,r+t])}function za(t,e,r){return{offset:r,buffer:t.slice(e,e+d).buffer}}async function Fa(r,n,a,s,o,c,d){const f=ka(n,s+10),w=va(n,s+12),p=va(n,s+16);if(f==e||w==t||p==t)return await Ra(r,n,a,o-u,c,d)==l?Ea:Sa;if(!f&&!w)return ga;const m=ka(n,s+6);for(const t of[o-w,ha(r,m)+p])if(await Ra(r,n,a,t,c,d)==i)return Ea;return Sa}async function Ra(t,e,r,n,a,s){return 0>n||n+4>a?E:r>n?s.count>0?(s.count--,va(ot(await qr(t,n,4)),0)):E:va(e,n-r)}function Aa(t){const e=Error(ea);throw e.reason=t,e}function Da(t,e,r){return e[r]===E?t.options[r]:e[r]}function Ua(t){const r=(4294901760&t)>>16,n=t&e;try{return new Date(1980+((65024&r)>>9),((480&r)>>5)-1,31&r,(63488&n)>>11,(2016&n)>>5,2*(31&n),0)}catch{}}function Ta(t){return new Date(Number(t/BigInt(1e4)-BigInt(116444736e5)))}function Oa(t,e){return t.getUint8(e)}function ka(t,e){return t.getUint16(e,!0)}function va(t,e){return t.getUint32(e,!0)}function Ma(t,e){return Number(t.getBigUint64(e,!0))}var Ca=Object.freeze({__proto__:null,ERR_AMBIGUOUS_ARCHIVE:ea,ERR_BAD_FORMAT:Zn,ERR_CENTRAL_DIRECTORY_NOT_FOUND:Kn,ERR_ENCRYPTED:Xn,ERR_ENCRYPTED_CENTRAL_DIRECTORY:ra,ERR_EOCDR_LOCATOR_ZIP64_NOT_FOUND:qn,ERR_EOCDR_NOT_FOUND:Hn,ERR_EXTRAFIELD_ZIP64_NOT_FOUND:Gn,ERR_INVALID_COMPRESSED_DATA:re,ERR_INVALID_PASSWORD:wt,ERR_INVALID_SIGNATURE:pt,ERR_INVALID_UNCOMPRESSED_SIZE:ee,ERR_LOCAL_FILE_HEADER_NOT_FOUND:Yn,ERR_OVERLAPPING_ENTRY:ta,ERR_SPLIT_ZIP_FILE:$n,ERR_UNSUPPORTED_COMPRESSION:Qn,ERR_UNSUPPORTED_ENCRYPTION:Jn,ZipReader:oa,ZipReaderStream:ca});const Ia="File already exists",Na="Zip file comment exceeds 64KB",ja="File entry comment exceeds 64KB",Pa="File entry name exceeds 64KB",_a="Version exceeds 65535",Wa="The strength must equal 1, 2, or 3",La="Encryption is not supported in USDZ files",Ba="Extra field type exceeds 65535",Va="Extra field data exceeds 64KB",Za=-2147483648,Ha=2147483647,qa="Zip64 is not supported (set the 'zip64' option to 'true')",Ka="Undefined uncompressed size",Ya="Undefined reader",Ga="Zip file not empty",Xa=new Uint8Array([7,0,2,0,65,69,3,0,0]),Ja="infozip",Qa="unix";let $a=0;const ts=[];class es{constructor(t,e={}){t=new Zr(t);const{availableSize:r=x,maxSize:n=x}=t;Object.assign(this,{writer:t,Gt:r>0&&r!==x&&n>0&&n!==x,options:e,config:O(),files:new Map,Xt:new Set,offset:e[_n]===E?t.size||t.writable.size||0:e[_n],Jt:e[_n]===E?0:e[_n]-(t.size||t.writable.size||0),Qt:new Set,$t:0,te:E})}async prependZip(e){if(this.Xt.size)throw Error(Ga);e=new Vr(e),await Hr(e);const{ZipReader:r}=await Promise.resolve().then(()=>Ca),n=new r(e.readable),a=await n.getEntries();await n.close(),await Hr(this.writer),await e.readable.pipeTo(this.writer.writable,{preventClose:!0,preventAbort:!0}),this.writer.size=this.offset=e.size,this.Xt=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,ee:w,re:p,ne:m,ae:h,se:y,rawExtraField:b}=e;const{level:S,languageEncodingFlag:g,dataDescriptor:x}=o;w=w||R,p=p||R,m=m||R,h=h||R,y=y||R,b=b||R,e.extraFieldAES&&(f=99);const z=xs(w,p,m,h,y,b),F=u&&l>=t,A=u&&d>=t,D=-7&Fs(S,g,x,c,f)|S<<1,{ie:U,oe:T}=zs({version:r,bitFlag:D,compressionMethod:f,uncompressedSize:l,compressedSize:d,rawLastModDate:n,rawFilename:i,ce:A,le:F,extraFieldLength:z}),{signature:O}=e;return O!==E&&Ss(T,10,O),Object.assign(e,{le:F,ce:A,de:u&&e.offset>=t,diskNumberStart:0,ue:!1,ee:w,re:p,ne:m,ae:h,se:y,rawExtraField:b,extendedTimestamp:m.length>0||h.length>0,fe:1+(a?2:0)+(s?4:0),ie:U,oe:T}),[e.filename,e]}))}async add(i="",o,c={}){const l=this;c=Object.assign({},c);const{Qt:d,config:u}=l;let w,z;$a<u.maxWorkers?$a++:await new Promise(t=>ts.push(t));try{if(i=i.trim(),hs(l,c,Sn)&&!i.endsWith(y)&&(i+=y),l.Xt.has(i))throw Error(Ia);return l.Xt.add(i),z=!0,w=(async(i,o,c,l)=>{const d=((n,a,s)=>{a=a.trim();let i=hs(n,s,wn),o=hs(n,s,yn,i?20:768);const c=hs(n,s,gn),l=hs(n,s,"uid"),d=hs(n,s,"gid");let u=hs(n,s,Fn),f=hs(n,s,"unixExtraFieldType"),w=hs(n,s,Rn),b=hs(n,s,An),S=hs(n,s,Dn);if(l!==E&&(0>l||l>t))throw Error("Invalid uid (must be integer 0..2^32-1)");if(d!==E&&(0>d||d>t))throw Error("Invalid gid (must be integer 0..2^32-1)");if(u!==E&&(0>u||u>e))throw Error("Invalid UNIX mode (must be integer 0..65535)");if(f!==E&&f!==Ja&&f!==Qa)throw Error("Invalid unixExtraFieldType (must be 'infozip' or 'unix')");if(f===Qa&&(l!==E&&l>e||d!==E&&d>e))throw Error("uid/gid must be 0..65535 for unixExtraFieldType 'unix' (use 'infozip' for larger ids)");f!==E||l===E&&d===E||(f=Ja);let g=hs(n,s,un),x=hs(n,s,fn);const z=g!==E||x!==E;if(l!==E||d!==E||u!==E||f?(i=!1,o=o&e|768):z&&(i=!0,o&=r),g!==E&&(0>g||g>r))throw Error("Invalid msdosAttributesRaw (must be integer 0..255)");if(x&&"object"!=typeof x)throw Error("Invalid msdosAttributes (must be an object with boolean flags)");if(o>e)throw Error(_a);let F=hs(n,s,dn);const R=F!==E;R||(F=0),!s[Sn]&&a.endsWith(y)&&(s[Sn]=!0);const A=hs(n,s,Sn);let D;if(A?(a.endsWith(y)||(a+=y),R||(F=16,i||(F|=16877<<16))):i||R||(F=c?493<<16:27525120),!i){const t=u!==E||!!(w||b||S);D=F>>16&e,u=u===E?D:u&e,w?u|=m:w=!!(u&m),b?u|=h:b=!!(u&h),S?u|=512:S=!!(512&u),R&&!t||(A&&(u|=p),F=(u&e)<<16|F&e)}return({msdosAttributesRaw:g,msdosAttributes:x}=((t,e)=>{if(t!==E)t&=r;else if(e!==E){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===E&&(e={readOnly:!!(1&t),hidden:!!(2&t),system:!!(4&t),directory:!!(16&t),archive:!!(32&t)}),{msdosAttributesRaw:t,msdosAttributes:e}})(g,x)),z&&(F=F&t|g&r),{name:a,we:{versionMadeBy:o,msDosCompatible:i,externalFileAttributes:F,unixExternalUpper:D,uid:l,gid:d,unixMode:u,unixExtraFieldType:f,setuid:w,setgid:b,sticky:S,msdosAttributesRaw:g,msdosAttributes:x}}})(i,o,l);({name:o}=d);const u=((t,r,n)=>{const a=hs(t,n,"encodeText",at);let s=a(r);if(s===E&&(s=at(r)),xs(s)>e)throw Error(Pa);const i=n[Jr]||"";let o=a(i);if(o===E&&(o=at(i)),xs(o)>e)throw Error(ja);const c=hs(t,n,hn,20);if(c>e)throw Error(_a);const l=hs(t,n,nn,new Date),d=hs(t,n,sn),u=hs(t,n,on),f=hs(t,n,ln,0),w=hs(t,n,vn);let p,m;w||(p=hs(t,n,On),m=hs(t,n,kn));const h=hs(t,n,"encryptionStrength",3),y=hs(t,n,bn),b=hs(t,n,"extendedTimestamp",!0),S=hs(t,n,"ntfsTimestamp"),g=hs(t,n,"keepOrder",!0),x=hs(t,n,In),z=hs(t,n,jn),F=hs(t,n,"bufferedWrite"),A=hs(t,n,"createTempStream"),D=hs(t,n,"dataDescriptorSignature",!0),U=hs(t,n,Mn),T=hs(t,n,"useUnicodeFileNames",!0),O=hs(t,n,En),k=w||O===E?E:Z(O);if(!w&&O!==E&&0!==O&&8!==O&&!k)throw Error("Compression method not supported");let v=hs(t,n,"level");if(t.options[Wn]){if(p!==E||m!==E)throw Error(La);v===E&&O===E&&(v=0)}let M=hs(t,n,Nn),C=hs(t,n,"dataDescriptor");F&&C===E&&(C=!1),(C===E||y)&&(C=!0),v!==E&&6!=v&&(M=!1),M||k||t.config.CompressionStream!==E||t.config.CompressionStreamZlib!==E||(v=0);const I=hs(t,n,pn);if(!y&&(p!==E||m!==E)&&(1>h||h>3))throw Error(Wa);let N=R;const j=n[zn];if(j){let t=0,r=0;j.forEach(e=>t+=4+xs(e)),N=new Uint8Array(t);const n=ot(N);j.forEach((t,a)=>{if(a>e)throw Error(Ba);if(xs(t)>e)throw Error(Va);bs(n,r,a),bs(n,r+2,xs(t)),Es(N,t,r+4),r+=4+xs(t)})}return{comment:i,we:{rawFilename:s,rawComment:o,version:c,lastModDate:l,lastAccessDate:d,creationDate:u,internalFileAttributes:f,passThrough:w,password:p,rawPassword:m,encryptionStrength:h,zipCrypto:y,extendedTimestamp:b,ntfsTimestamp:S,keepOrder:g,useWebWorkers:x,transferStreams:z,bufferedWrite:F,createTempStream:A,dataDescriptorSignature:D,signal:U,useUnicodeFileNames:T,compressionMethod:O,format:k?k.format:E,codecURI:k?k.codecURI:E,pe:k?k.versionNeeded:E,level:v,useCompressionStream:M,dataDescriptor:C,zip64:I,rawExtraField:N}}})(i,o,l),{comment:w}=u,z=l[zn];let F;i.files.set(o,E);try{const w=await(async(e,r,{we:n},a)=>{const{passThrough:s,zipCrypto:i,password:o,rawPassword:c,encryptionStrength:l}=n;let{dataDescriptor:d,zip64:u,level:f,compressionMethod:w}=n,p=0,m=0;if(s){if(!r)throw Error(Ya);if(m=a[$r],m===E)throw Error(Ka)}const h=!0===u,y=hs(e,a,mn),b=!!r&&(!!(o&&xs(o)||c&&xs(c))||s&&y);r||(f=0,w=0);const S=b?i?12:16+4*l:0;r&&(r=new Vr(r),await Hr(r),s?(a.uncompressedSize=m,p=ys(m)+S):r.size===E?(d=!0,(u||u===E)&&(u=!0,m=p=4294967296)):(a.uncompressedSize=m=r.size,p=ys(m)+S));const g=h||m>=t,x=h||p>=t;if(g||x){if(!1===u)throw Error(qa);u=!0}return u=u||!1,{reader:r,we:{dataDescriptor:d,zip64:u,le:g,ce:x,uncompressedSize:m,level:f,compressionMethod:w,encrypted:b}}})(i,c,u,l);({reader:c}=w);const p=cs(i.writer),m=os(i.writer),h=(t=>{const{rawFilename:r,lastModDate:a,lastAccessDate:s,creationDate:i,level:o,zip64:c,zipCrypto:l,useUnicodeFileNames:d,dataDescriptor:u,directory:w,rawExtraField:p,encryptionStrength:m,extendedTimestamp:h,ntfsTimestamp:y,passThrough:x,encrypted:z,le:F,ce:A,uncompressedSize:D}=t;let{version:U,compressionMethod:T}=t;const O=!w&&(T===E?o===E||o>0:0!==T);let k;const v=x||!O,M=c&&(t.bufferedWrite||!u||!F&&!A||v),C=M||c&&u&&(F||A);if(c&&(F||A)){const t=20,e=is(t);if(e.uint16(1),e.uint16(t-4),k=e.array,M&&(e.me(D),v)){const t=z?l?12:16+4*m:0;e.me(x?0:D+t)}}else k=R;let I,N,j,P,_;if(z&&!l){const t=is(xs(Xa)+2);t.uint16(39169),t.bytes(Xa),I=t.array,I[8]=m}else I=R;if(h){const t=ws(a),e=ps(t);if(e){const e=9+(s?4:0)+(i?4:0),r=is(e);P=1+(s?2:0)+(i?4:0),r.uint16(f),r.uint16(e-4),r.uint8(P),r.uint32(t),s&&r.uint32(ms(ws(s))),i&&r.uint32(ms(ws(i))),j=r.array}else j=R;if(y===E?!e||s||i:y)try{const t=fs(a),e=is(36);e.uint16(10),e.uint16(32),e.he(4),e.uint16(1),e.uint16(24),e.me(t),e.me(fs(s)||t),e.me(fs(i)||t),N=e.array}catch{N=R}else N=R}else N=j=R;try{const{uid:r,gid:n,unixExtraFieldType:a}=t;if(a!=Ja||r===E&&n===E)if(a!=Qa||r===E&&n===E)_=R;else{const t=is(8);t.uint16(30805),t.uint16(4),t.uint16((r===E?0:r)&e),t.uint16((n===E?0:n)&e),_=t.array}else{const t=ss(r),e=ss(n),a=3+t.length+e.length,s=is(4+a);s.uint16(30837),s.uint16(a),s.uint8(1),s.uint8(t.length),s.bytes(t),s.uint8(e.length),s.bytes(e),_=s.array}}catch{_=R}T===E&&(T=O?8:0);const{pe:W}=t;O&&W!==E&&(U=U>W?U:W),c&&(U=U>45?U:45),z&&!l&&(U=U>51?U:51,I[9]=T,T=99);const L=C?xs(k):0,B=L+xs(I,j,N,_,p);if(B>e)throw Error(Va);const V=new Date(2e3*Math.ceil(a.getTime()/2e3)),{ie:Z,oe:H,rawLastModDate:q}=zs({version:U,bitFlag:Fs(o,d,u,z,T),compressionMethod:T,uncompressedSize:D,lastModDate:g>V?g:V>S?S:V,rawFilename:r,ce:A,le:F,extraFieldLength:B}),K=is(b+xs(r)+B),Y=K.array,G=ot(Y);return K.uint32(n),K.bytes(Z),K.bytes(r),C&&K.bytes(k),K.bytes(I),K.bytes(j),K.bytes(N),K.bytes(_),K.bytes(p),u&&(A||Ss(G,18,0),F||Ss(G,22,0)),{ye:Y,be:G,ie:Z,oe:H,lastModDate:a,rawLastModDate:q,encrypted:z,compressed:O,version:U,compressionMethod:T,fe:P,ee:R,Se:L,ne:j,ae:N,se:_,re:I,extraFieldLength:B}})(l=Object.assign({},l,d.we,u.we,w.we,{internalFileAttribute:u.we.internalFileAttributes,externalFileAttribute:d.we.externalFileAttributes,signature:l[xn],offset:i.offset-p,diskNumberStart:m})),y=(({zip64:t,dataDescriptor:e,dataDescriptorSignature:r})=>{let n,a=R,i=0,o=t?20:12;return r&&(o+=4),e&&(a=new Uint8Array(o),n=ot(a),r&&(i=4,Ss(n,0,s))),{ge:a,Ee:n,xe:i}})(l),z=xs(h.ye,y.ge);F=await(async(e,n,s,i,o)=>{const{files:c,writer:l}=e,{keepOrder:d,dataDescriptor:u,signal:f}=o,{ze:w}=i,p=e.options[Wn],m=e.te;let h,y,S,g,z,F,R,A={},D=0;c.set(n,A),e.te=A;try{let y;d&&(y=m&&m.lock,A.lock=new Promise(t=>S=t)),o.bufferedWrite||!d||e.Fe||e.$t||!u?(h=!0,e.$t++,R=o.createTempStream?await o.createTempStream():new TransformStream(E,E,{highWaterMark:x}),R.size=0,await Hr(l)):(R=l,await U()),await Hr(R);const O=cs(l);if(e.Gt){delete e.Gt;const t=new Uint8Array(4);Ss(ot(t),0,a),await us(l,t),e.offset+=4}p&&!h&&as(i,e.offset-O);const{ye:k}=w;h||(await y,await T());const v=os(l),M=ds(e,l);if(A.diskNumberStart=v,h||(z=!0,F=l.size,await us(R,k)),A=await(async(e,n,{diskNumberStart:a,lock:s},i,o,c)=>{const{ze:l,Re:d,Ae:u}=i,{ie:f,oe:w,lastModDate:p,rawLastModDate:m,encrypted:h,compressed:y,version:b,compressionMethod:S,ee:g,Se:x,ne:z,fe:F,ae:R,se:A,re:D}=l,{ge:U}=d,{rawFilename:T,lastAccessDate:O,creationDate:k,password:v,rawPassword:M,level:C,zip64:I,le:N,ce:j,zipCrypto:P,dataDescriptor:_,directory:W,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:pt}=c,mt={lock:s,versionMadeBy:B,zip64:I,directory:!!W,executable:!!L,filenameUTF8:!0,rawFilename:T,commentUTF8:!0,rawComment:V,ee:g,Se:x,ne:z,ae:R,se:A,re: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{signature:ht,uncompressedSize:yt}=c,bt=0;ft||(yt=0);const{writable:St}=n;if(e){const a=$t(e.createReadable?e.createReadable():e.readable),s=e.size,i={options:{codecType:ye,level:C,rawPassword:M,password:v,encryptionStrength:J,zipCrypto:h&&P,passwordVerification:h&&P&&m>>8&r,signed:!ft,compressed:y&&!ft,encrypted:h&&!ft,useWebWorkers:H,useCompressionStream:ut,transferStreams:q,format:wt,codecURI:pt,compressionMethod:S},config:o,ut:{signal:X,size:s,onstart:K,onprogress:Y,onend:G}};try{const e=await He({readable:a,writable:St},i);if(bt=e.outputSize,n.size+=bt,ft||(yt=e.inputSize,ht=e.signature),!j&&bt>=t||!N&&yt>=t)throw Error(qa)}catch(t){throw t.outputSize!==E&&(n.size+=t.outputSize),t}}return(({signature:t,compressedSize:e,uncompressedSize:r,ze:n,Re:a},{zip64:s,zipCrypto:i,dataDescriptor:o})=>{const{oe:c,encrypted:l}=n,{Ee:d,xe:u}=a;l&&!i||t===E||(Ss(c,10,t),o&&Ss(d,u,t)),s?o&&(gs(d,u+4,BigInt(e)),gs(d,u+12,BigInt(r))):(Ss(c,14,e),Ss(c,18,r),o&&(Ss(d,u+4,e),Ss(d,u+8,r)))})({signature:ht,compressedSize:bt,uncompressedSize:yt,ze:l,Re:d},c),_&&await us(n,U),Object.assign(mt,{uncompressedSize:yt,compressedSize:bt,lastModDate:p,rawLastModDate:m,creationDate:k,lastAccessDate:O,encrypted:h,zipCrypto:P,size:u+bt,compressionMethod:S,version:b,ie:f,oe:w,signature:ht,fe:F,le:N,ce:j}),mt})(s,R,A,i,e.config,o),h||(z=!1),c.set(n,A),A.filename=n,h){if(await Promise.all([R.writable.getWriter().close(),y]),await U(),g=!0,F=l.size,await T(),A.diskNumberStart=os(l),A.offset=ds(e,l),p){const t=i.Ae;as(i,e.offset-cs(l)),A.size+=i.Ae-t}(({rawFilename:t,encrypted:e,zip64:r,Se:n,signature:a,compressedSize:s,uncompressedSize:i,le:o,ce:c},l,{dataDescriptor:d})=>{if(d||(e||Ss(l,14,a),c||Ss(l,18,s),o||Ss(l,22,i)),r&&n){const e=b+xs(t)+4;gs(l,e,BigInt(i)),gs(l,e+8,BigInt(s))}})(A,w.be,o),await us(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=xs(t),D+=e}}),{preventClose:!0,preventAbort:!0,signal:r})}finally{n.releaseLock()}})(R.readable,l,f),l.size+=R.size,g=!1}else A.diskNumberStart=v,A.offset=M;return e.offset+=A.size,A}catch(t){if(g||z){if(e.hasCorruptedEntries=!0,t)try{t.corruptedEntry=!0}catch{}e.offset+=l.size-F,h&&(e.offset+=D)}throw c.delete(n),t}finally{if(h&&e.$t--,S&&S(),y&&y(),h&&R&&R.dispose)try{await R.dispose()}catch{}}async function U(){e.Fe=!0;const{De:t}=e;e.De=new Promise(t=>y=()=>{e.Fe=!1,t()}),await t}async function T(){ls(l,xs(w.ye))&&await l.closeDisk()}})(i,o,c,{ze:h,Re:y,Ae:z},l)}catch(t){throw i.files.delete(o),t}return Object.assign(F,{name:o,comment:w,extraField:z}),new Tn(F)})(l,i,o,c),d.add(w),await w}catch(t){throw z&&l.Xt.delete(i),t}finally{d.delete(w);const t=ts.shift();t?t():$a--}}remove(t){const{Xt:e,files:r}=this;if("string"==typeof t&&(t=r.get(t)),t&&t.filename!==E){const{filename:n}=t;if(e.has(n)&&r.has(n))return e.delete(n),r.delete(n),!0}return!1}async close(r=R,n={}){const{Qt:a,writer:s}=this,{writable:u}=s;if(xs(r)>e)throw Error(Na);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,re:s,rawComment:i,ae:o,se:c,rawExtraField:l,extendedTimestamp:d,fe:u,lastModDate:w,le:p,ce:m,uncompressedSize:h,compressedSize:y}=a,b=a.offset>=t,S=a.diskNumberStart>=e;let g,E;if(b||S||p||m){const t=4+(p?8:0)+(m?8:0)+(b?8:0)+(S?4:0),e=is(t);e.uint16(1),e.uint16(t-4),p&&e.me(h),m&&e.me(y),b&&e.me(a.offset),S&&e.uint32(a.diskNumberStart),g=e.array}else g=R;a.ee=g,a.de=b,a.ue=S;const x=ws(w);if(d&&ps(x)){const t=is(9);t.uint16(f),t.uint16(5),t.uint8(u),t.uint32(x),E=t.array}else E=R;a.ne=E;const z=xs(g,s,o,c,E,l);if(z>e)throw Error(Va);n+=46+xs(r,i)+z}return n})(r.files),u=await(async(r,n,a)=>{const{files:s,writer:o}=r,c=new Uint8Array(n);await Hr(o);let l=0,d=0,u=os(o),f=cs(o);for(const[r,n]of Array.from(s.values()).entries()){const{offset:w,rawFilename:p,ee:m,re:h,ne:y,ae:b,se:S,rawExtraField:g,rawComment:E,versionMadeBy:x,ie:z,oe:F,le:R,ce:A,ue:D,de:U,internalFileAttributes:T,externalFileAttributes:O,diskNumberStart:k,uncompressedSize:v,compressedSize:M}=n,C=xs(m,h,y,b,S,g),I=46+xs(p,E)+C;ls(o,l+I-d)&&(await us(o,c.slice(d,l)),d=l,await o.closeDisk()),0==r&&(u=os(o),f=cs(o)),R||Ss(F,18,v),A||Ss(F,14,M),(U||D)&&45>n.version&&bs(F,0,45);const N=is(I);if(N.uint32(i),N.uint16(x),N.bytes(z.subarray(0,24)),N.uint16(C),N.uint16(xs(E)),N.uint16(D?e:k),N.uint16(T),N.uint32(O),N.uint32(U?t:w),N.bytes(p),N.bytes(m),N.bytes(h),N.bytes(y),N.bytes(b),N.bytes(S),N.bytes(g),N.bytes(E),Es(c,N.array,l),l+=I,a.onprogress)try{await a.onprogress(r+1,s.size,new Tn(n))}catch{}}return await us(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{Te:f}=s,w=r.files.size,p=u.diskNumber,m=ds(r,u),h=os(i);ls(i,d)&&h++;let y=hs(r,a,pn);if(!(t>m&&t>f&&e>w&&e>h)){if(!1===y)throw Error(qa);y=!0}const b=xs(n);if(b>e)throw Error(Na);const S=is(y?98:d);ls(i,xs(S.array)+b)&&await i.closeDisk(),h=os(i),y&&(S.uint32(c),S.me(44),S.uint16(45),S.uint16(45),S.uint32(h),S.uint32(p),S.me(w),S.me(w),S.me(f),S.me(m),S.uint32(l),S.uint32(h),S.me(BigInt(ds(r,i))+BigInt(f)),S.uint32(h+1),hs(r,a,"supportZip64SplitFile",!0)&&(h=e,p=e),w=e,m=t,f=t),S.uint32(o),S.uint16(h),S.uint16(p),S.uint16(w),S.uint16(w),S.uint32(f),S.uint32(m),S.uint16(b),await us(i,S.array),b&&await us(i,n)})(r,n,a,{Ue:u,Te:s})})(this,r,n),hs(this,n,Pn)||await u.getWriter().close(),s.getData?s.getData():u}}class rs{constructor(t={}){const{readable:e,writable:r}=new TransformStream;this.readable=e,this.zipWriter=new es(r,t),this.Qt=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 ns(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 ns(this,this.zipWriter.add(t,r),t=>e.error(t)),n}async close(t,e={}){return await Promise.all(Array.from(this.Qt)),this.zipWriter.close(t,e)}}function ns(t,e,r){t.Qt.add(e),e.catch(t=>{try{r(t)}catch{}})}function as(t,e){const{ze:r}=t;let{ye:n,extraFieldLength:a}=r,s=64-(e+xs(n))%64;4>s&&(s+=64);const i=new Uint8Array(s),o=ot(i);bs(o,0,6534),bs(o,2,s-4);const c=n;r.ye=n=new Uint8Array(xs(c)+s),Es(n,c),Es(n,i,xs(c));const l=ot(n);bs(l,28,a+s),r.be=l,t.Ae+=s}function ss(t){if(t===E)return R;{const e=new Uint8Array(4);ot(e).setUint32(0,t,!0);let r=4;for(;r>1&&0===e[r-1];)r--;return e.subarray(0,r)}}function is(t){const e=new Uint8Array(t),r=ot(e);let n=0;return{array:e,uint8:t=>{((t,e,r)=>{t.setUint8(e,r)})(r,n,t),n+=1},uint16:t=>{bs(r,n,t),n+=2},uint32:t=>{Ss(r,n,t),n+=4},me:t=>{gs(r,n,BigInt(t)),n+=8},bytes:t=>{Es(e,t,n),n+=xs(t)},he:t=>n+=t}}function os(t){const{diskNumber:e=0}=t;return e}function cs(t){const{diskOffset:e=0}=t;return e}function ls(t,e){const{availableSize:r=x}=t;return e>r}function ds(t,{diskNumber:e=0,diskOffset:r=0}){return t.offset-r-(e?t.Jt:0)}async function us(t,e){const{writable:r}=t,n=r.getWriter();try{await n.ready,t.size+=xs(e),await n.write(e)}finally{n.releaseLock()}}function fs(t){if(t)return(BigInt(t.getTime())+BigInt(116444736e5))*BigInt(1e4)}function ws(t){return Math.floor(t.getTime()/1e3)}function ps(t){return t>=Za&&Ha>=t}function ms(t){return Math.min(Ha,Math.max(Za,t))}function hs(t,e,r,n){const a=e[r]===E?t.options[r]:e[r];return a===E?n:a}function ys(t){return t+5*(Math.floor(t/16383)+1)}function bs(t,e,r){t.setUint16(e,r,!0)}function Ss(t,e,r){t.setUint32(e,r,!0)}function gs(t,e,r){t.setBigUint64(e,r,!0)}function Es(t,e,r){t.set(e,r)}function xs(...t){let e=0;return t.forEach(t=>t&&(e+=t.length)),e}function zs({version:e,bitFlag:r,compressionMethod:n,uncompressedSize:a,compressedSize:s,lastModDate:i,rawLastModDate:o,rawFilename:c,ce:l,le:d,extraFieldLength:u}){const f=is(26),w=f.array,p=ot(w);if(f.uint16(e),f.uint16(r),f.uint16(n),o===E){const t=new Uint32Array(1),e=ot(t);bs(e,0,(i.getHours()<<6|i.getMinutes())<<5|i.getSeconds()/2),bs(e,2,(i.getFullYear()-1980<<4|i.getMonth()+1)<<5|i.getDate()),o=t[0]}return f.uint32(o),f.he(4),l||s!==E?f.uint32(l?t:s):f.he(4),d||a!==E?f.uint32(d?t:a):f.he(4),f.uint16(xs(c)),f.uint16(u),{ie:w,oe:p,rawLastModDate:o}}function Fs(t,e,r,n,a){let s=0;return e&&(s|=w),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 Rs(){return"application/octet-stream"}const As=1048576,Ds=".zip.js-temp";function Us(t={}){const{thresholdBytes:e=As,directoryName:r=Ds,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 Ts=1048576;function Os(t={}){const{thresholdBytes:e=Ts}=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 ks=1048576,vs=".zip.js-temp";function Ms(t={}){const{thresholdBytes:e=ks,directoryName:r=vs,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{M({baseURI:import.meta.url})}catch{}let Cs,Is,Ns,js,Ps;function _s(t,e,r={}){if(!Cs){const t=Error("WASM module not loaded");throw t.cause=Ps,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.Oe=Is(a),this.in=Is(s),this.inBufferSize=s,!this.Oe||!this.in)throw Error("allocation failed");if(this.ke=new Uint8Array(a),t?(this.ve=Cs.deflate_process,this.Me=Cs.deflate_last_consumed,this.Ce=Cs.deflate_end,this.Ie=Cs.deflate_new(),r="gzip"===e?Cs.deflate_init_gzip(this.Ie,n):"deflate-raw"===e?Cs.deflate_init_raw(this.Ie,n):Cs.deflate_init(this.Ie,n)):"deflate64-raw"===e?(this.ve=Cs.inflate9_process,this.Me=Cs.inflate9_last_consumed,this.Ce=Cs.inflate9_end,this.Ie=Cs.inflate9_new(),r=Cs.inflate9_init_raw(this.Ie)):(this.ve=Cs.inflate_process,this.Me=Cs.inflate_last_consumed,this.Ce=Cs.inflate_end,this.Ie=Cs.inflate_new(),r="deflate-raw"===e?Cs.inflate_init_raw(this.Ie):"gzip"===e?Cs.inflate_init_gzip(this.Ie):Cs.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.Me,c=this.Oe,l=this.ke;let d=0;for(;d<n.length;){const e=Math.min(n.length-d,32768);if((!this.in||this.inBufferSize<e)&&(this.in&&Ns&&(Ns(this.in),this.in=0),this.in=Is(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.Oe,i=this.ke;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.Ce&&(e=t.Ce(t.Ie)),t.Ie=0,t.in&&Ns&&Ns(t.in),t.in=0,t.Oe&&Ns&&Ns(t.Oe),t.Oe=0,e}}class Ws{constructor(t="deflate",e){return _s(!0,t,e)}}class Ls{constructor(t="deflate",e){return _s(!1,t,e)}}Ws.Dt=!0,Ls.Dt=!0;let Bs,Vs=!1;function Zs(){Bs=null,(async()=>{await Promise.allSettled(We.map(t=>(Xe(t),t.terminate()))),ze=E})(),Vs=!1,Cs=Is=Ns=js=Ps=null}(({Ne:t})=>{Ue=t})({Ne:t=>{if(!Bs){let{wasmURI:e}=t;typeof e==F&&(e=e()),Bs=(async(t,{baseURI:e})=>{if(!Vs)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(Cs=t,({malloc:Is,free:Ns,memory:js}=Cs),"function"!=typeof Is||"function"!=typeof Ns||!js)throw Cs=Is=Ns=js=null,Error("Invalid WASM module")})((await WebAssembly.instantiate(r)).instance.exports)})(t,e),Vs=!0}catch(t){throw(t=>{Ps=t})(t),t}})(e,t).catch(t=>{throw Bs=null,t})}return Bs}}),M({CompressionStreamZlib:Ws,DecompressionStreamZlib:Ls}),M({workerURI:new URL("./zip-web-worker.js",import.meta.url).href,wasmURI:new URL("./zip-module.wasm",import.meta.url).href});export{hr as BlobReader,yr as BlobWriter,fr as Data64URIReader,wr as Data64URIWriter,ea as ERR_AMBIGUOUS_ARCHIVE,Zn as ERR_BAD_FORMAT,Kn as ERR_CENTRAL_DIRECTORY_NOT_FOUND,Ia as ERR_DUPLICATED_NAME,Xn as ERR_ENCRYPTED,ra as ERR_ENCRYPTED_CENTRAL_DIRECTORY,qn as ERR_EOCDR_LOCATOR_ZIP64_NOT_FOUND,Hn as ERR_EOCDR_NOT_FOUND,Gn as ERR_EXTRAFIELD_ZIP64_NOT_FOUND,Qe as ERR_HTTP_RANGE,$e as ERR_HTTP_RESOURCE_CHANGED,I as ERR_INVALID_CODEC_DEFINITION,j as ERR_INVALID_CODEC_MODULE,Na as ERR_INVALID_COMMENT,re as ERR_INVALID_COMPRESSED_DATA,Wa as ERR_INVALID_ENCRYPTION_STRENGTH,ja as ERR_INVALID_ENTRY_COMMENT,Pa as ERR_INVALID_ENTRY_NAME,Va as ERR_INVALID_EXTRAFIELD_DATA,Ba as ERR_INVALID_EXTRAFIELD_TYPE,wt as ERR_INVALID_PASSWORD,pt as ERR_INVALID_SIGNATURE,ee as ERR_INVALID_UNCOMPRESSED_SIZE,_a as ERR_INVALID_VERSION,tr as ERR_ITERATOR_COMPLETED_TOO_SOON,Yn as ERR_LOCAL_FILE_HEADER_NOT_FOUND,ta as ERR_OVERLAPPING_ENTRY,N as ERR_RESERVED_COMPRESSION_METHOD,$n as ERR_SPLIT_ZIP_FILE,Ya as ERR_UNDEFINED_READER,Ka as ERR_UNDEFINED_UNCOMPRESSED_SIZE,Qn as ERR_UNSUPPORTED_COMPRESSION,Jn as ERR_UNSUPPORTED_ENCRYPTION,La as ERR_UNSUPPORTED_ENCRYPTION_USDZ,qa as ERR_UNSUPPORTED_FORMAT,er as ERR_WRITER_NOT_INITIALIZED,Ga as ERR_ZIP_NOT_EMPTY,Pr as HttpRangeReader,jr as HttpReader,dr as Reader,Lr as SplitDataReader,Br as SplitDataWriter,br as TextReader,Sr as TextWriter,_r as Uint8ArrayReader,Wr as Uint8ArrayWriter,ur as Writer,oa as ZipReader,ca as ZipReaderStream,es as ZipWriter,rs as ZipWriterStream,v as configure,Os as createBlobTempStream,Us as createOPFSTempStream,Ms as createSyncAccessHandleTempStream,Rs as getMimeType,B as registerCodec,C as resetConfiguration,Zs as terminateWorkers,V as unregisterCodec};
|
|
1
|
+
const t=4294967295,e=65535,r=255,n=67324752,a=134695760,s=a,o=33639248,i=101010256,c=101075792,l=117853008,d=22,u=20,f=21589,w=2048,p=16384,m=2048,h=1024,y="/",b=30,S=new Date(2107,11,31,23,59,58),E=new Date(1980,0,1),g=void 0,x=1/0,z="undefined",F="function",R=new Uint8Array;let A=2;try{typeof navigator!=z&&navigator.hardwareConcurrency&&(A=navigator.hardwareConcurrency)}catch{}const D={workerURI:"./core/web-worker-wasm.js",wasmURI:"./core/streams/zlib-wasm/zlib-streams.wasm",chunkSize:65536,maxWorkers:A,terminateWorkerTimeout:5e3,workerStarvationTimeout:5e3,workerStartupTimeout:5e3,useWebWorkers:!0,useCompressionStream:!0,transferStreams:!0,CompressionStream:typeof CompressionStream!=z&&CompressionStream,DecompressionStream:typeof DecompressionStream!=z&&DecompressionStream},U=["baseURI","wasmURI","workerURI","chunkSize","maxWorkers","terminateWorkerTimeout","workerStarvationTimeout","workerStartupTimeout","useCompressionStream","useWebWorkers","transferStreams","CompressionStream","DecompressionStream","CompressionStreamZlib","DecompressionStreamZlib"],T={...D};function O(){return T}function k(t){return Math.max(t.chunkSize,64)}function v(t){for(const e of U){const r=t[e];r!==g&&(T[e]=r)}}function M(t){for(const e of U){const r=t[e];r!==g&&(D[e]=r)}v(t)}function C(){for(const t of U)delete T[t];Object.assign(T,D)}const I="Invalid codec definition",N="Reserved compression method",j="Invalid codec module",P="string",_=[0,8,9,99],W=new Map,L=new Map;function B(t={}){const{compressionMethod:r,format:n,codecURI:a,CompressionStream:s,DecompressionStream:o,versionNeeded:i}=t;if(!Number.isInteger(r)||0>r||r>e||typeof n!=P||!n.length)throw Error(I);if(_.includes(r))throw Error(N);const c=typeof s==F||typeof o==F;if(!(c||typeof a==P&&a.length))throw Error(I);W.set(r,{compressionMethod:r,format:n,codecURI:a,versionNeeded:i}),c&&q(n,{CompressionStream:s,DecompressionStream:o})}function V(t){const e=W.get(t);if(e){let r;W.delete(t),W.forEach(t=>r=r||t.format==e.format),r||L.delete(e.format)}}function Z(t){return W.get(t)}function H(t){return L.get(t)}function q(t,e){const{CompressionStream:r,DecompressionStream:n}=e;if(typeof r!=F&&typeof n!=F)throw Error(j);L.set(t,{CompressionStream:r,DecompressionStream:n})}const K=[[],[],[],[],[],[],[],[]];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;K[0][t]=e}for(let t=0;256>t;t++)for(let e=1;8>e;e++){const r=K[e-1][t];K[e][t]=r>>>8^K[0][255&r]}const[Y,G,X,J,Q,$,tt,et]=K;class rt{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=et[255&t]^tt[t>>>8&255]^$[t>>>16&255]^Q[t>>>24&255]^J[255&r]^X[r>>>8&255]^G[r>>>16&255]^Y[r>>>24&255]}}for(;r>n;n++)e=e>>>8^Y[255&(e^t[n])];this.o=e}get(){return~this.o}}class nt extends TransformStream{constructor(){let t;const e=new rt;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 at(t){if(typeof TextEncoder==z){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 st(t,e){const r=new Uint8Array(t.length+e.length);return r.set(t),r.set(e,t.length),r}function ot(t){return t.byteOffset||t.byteLength!=t.buffer.byteLength?new Uint8Array(t):t}function it(t){return new DataView(t.buffer,t.byteOffset,t.byteLength)}const ct={concat(t,e){if(0===t.length||0===e.length)return t.concat(e);const r=t[t.length-1],n=ct.l(r);return 32===n?t.concat(e):ct.m(e,n,0|r,t.slice(0,t.length-1))},h(t){const e=t.length;if(0===e)return 0;const r=t[e-1];return 32*(e-1)+ct.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]=ct.F(e,t[r-1]&2147483648>>e-1,1)),t},F:(t,e,r)=>32===t?e:(r?0|e:e<<32-t)+1099511627776*t,l:t=>Math.round(t/1099511627776)||32,m(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=ct.l(a);return n.push(ct.F(e+s&31,e+s>32?r:n.pop(),1)),n}},lt={bytes:{R(t){const e=ct.h(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(ct.F(8*(3&r),n)),e}}},dt=class{constructor(t){const e=this;e.blockSize=512,e.D=[1732584193,4023233417,2562383102,271733878,3285377520],e.U=[1518500249,1859775393,2400959708,3395469782],t?(e.T=t.T.slice(0),e.O=t.O.slice(0),e.v=t.v):e.reset()}reset(){const t=this;return t.T=t.D.slice(0),t.O=[],t.v=0,t}update(t){const e=this;"string"==typeof t&&(t=lt.M.A(t));const r=e.O=ct.concat(e.O,t),n=e.v,a=e.v=n+ct.h(t);if(a>9007199254740991)throw Error("Cannot hash more than 2^53 - 1 bits");const s=new Uint32Array(r);let o=0;for(let t=e.blockSize+n-(e.blockSize+n&e.blockSize-1);a>=t;t+=e.blockSize)e.C(s.subarray(16*o,16*(o+1))),o+=1;return r.splice(0,16*o),e}I(){const t=this;let e=t.O;const r=t.T;e=ct.concat(e,[ct.F(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.C(e.splice(0,16));return t.reset(),r}N(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}C(t){const e=this,r=e.T,n=Array(80);for(let e=0;16>e;e++)n[e]=t[e];let a=r[0],s=r[1],o=r[2],i=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.N(t,s,o,i)+c+n[t]+e.U[Math.floor(t/20)]|0;c=i,i=o,o=e.j(30,s),s=a,a=r}r[0]=r[0]+a|0,r[1]=r[1]+s|0,r[2]=r[2]+o|0,r[3]=r[3]+i|0,r[4]=r[4]+c|0}},ut={importKey:t=>new ut.P(lt.bytes.A(t)),_(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,o,i,c,l;const d=new ArrayBuffer(a),u=new DataView(d);let f=0;const w=ct;for(e=lt.bytes.A(e),l=1;(a||1)>f;l++){for(s=o=t.encrypt(w.concat(e,[l])),i=1;r>i;i++)for(o=t.encrypt(o),c=0;c<o.length;c++)s[c]^=o[c];for(i=0;(a||1)>f&&i<s.length;i++)u.setInt32(f,s[i]),f+=4}return d.slice(0,n/8)},P:class{constructor(t){const e=this,r=e.W=dt,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.W(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.W(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)}}},ft=typeof crypto!=z&&typeof crypto.getRandomValues==F,wt="Invalid password",pt="Invalid signature",mt="zipjs-abort-check-password";function ht(t){if(ft)return crypto.getRandomValues(t);throw Error("Crypto API not supported")}const yt=16,bt={name:"PBKDF2"},St=Object.assign({hash:{name:"HMAC"}},bt),Et=Object.assign({iterations:1e3,hash:{name:"SHA-1"}},bt),gt=["deriveBits"],xt=[8,12,16],zt=[16,24,32],Ft=10,Rt=[0,0,0,0],At=typeof crypto!=z,Dt=At&&crypto.subtle,Ut=At&&typeof Dt!=z,Tt=lt.bytes,Ot=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,o,i,c=1;if(4!==a&&6!==a&&8!==a)throw Error("invalid aes key size");for(e.U=[o=t.slice(0),i=[]],s=a;4*a+28>s;s++){let t=o[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))),o[s]=o[s-a]^t}for(let t=0;s;t++,s--){const e=o[3&t?s:s-4];i[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 o,i,c,l;for(let t=0;256>t;t++)s[(a[t]=t<<1^283*(t>>7))^t]=t;for(let d=o=0;!r[d];d^=i||1,o=s[o]||1){let s=o^o<<1^o<<2^o<<3^o<<4;s=s>>8^255&s^99,r[d]=s,n[s]=d,l=a[c=a[i=a[d]]];let u=16843009*l^65537*c^257*i^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],o=s[0],i=s[1],c=s[2],l=s[3],d=s[4];let u,f,w,p=t[0]^r[0],m=t[e?3:1]^r[1],h=t[2]^r[2],y=t[e?1:3]^r[3],b=4;for(let t=0;n>t;t++)u=o[p>>>24]^i[m>>16&255]^c[h>>8&255]^l[255&y]^r[b],f=o[m>>>24]^i[h>>16&255]^c[y>>8&255]^l[255&p]^r[b+1],w=o[h>>>24]^i[y>>16&255]^c[p>>8&255]^l[255&m]^r[b+2],y=o[y>>>24]^i[p>>16&255]^c[m>>8&255]^l[255&h]^r[b+3],b+=4,p=u,m=f,h=w;for(let t=0;4>t;t++)a[e?3&-t:t]=d[p>>>24]<<24^d[m>>16&255]<<16^d[h>>8&255]<<8^d[255&y]^r[b++],u=p,p=m,m=h,h=y,y=u;return a}},kt=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=ct.h(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 ct.S(e,a)}},vt=ut.P;let Mt=At&&Ut&&typeof Dt.importKey==F,Ct=At&&Ut&&typeof Dt.deriveBits==F;class It extends TransformStream{constructor({password:t,rawPassword:e,encryptionStrength:r,checkPasswordOnly:n}){super({start(){jt(this,t,e,r)},async transform(t,e){const r=this,{password:a,strength:s,nt:o,ready:i}=r;a?(await(async(t,e,r,n)=>{const a=await _t(t,e,r,Lt(n,0,xt[e])),s=Lt(n,xt[e]);if(a[0]!=s[0]||a[1]!=s[1])throw Error(wt)})(r,s,a,Lt(t,0,xt[s]+2)),t=Lt(t,xt[s]+2),n?e.error(Error(mt)):o()):await i;const c=new Uint8Array(t.length-Ft-(t.length-Ft)%yt);e.enqueue(Pt(r,t,c,0,Ft,!0))},async flush(t){const{st:e,ot:r,pending:n,ready:a}=this;if(r&&e){await a;const s=Lt(n,0,n.length-Ft),o=Lt(n,n.length-Ft);let i=R;if(s.length){const t=Vt(Tt,s);r.update(t);const n=e.update(t);i=Bt(Tt,n)}const c=Lt(Bt(Tt,r.digest()),0,Ft);let l=n.length<Ft?1:0;for(let t=0;Ft>t;t++)l|=c[t]^o[t];if(l)throw Error(pt);t.enqueue(i)}}})}}class Nt extends TransformStream{constructor({password:t,rawPassword:e,encryptionStrength:r}){let n;super({start(){jt(this,t,e,r)},async transform(t,e){const r=this,{password:n,strength:a,nt:s,ready:o}=r;let i=R;n?(i=await(async(t,e,r)=>{const n=ht(new Uint8Array(xt[e]));return st(n,await _t(t,e,r,n))})(r,a,n),s()):await o;const c=new Uint8Array(i.length+t.length-t.length%yt);c.set(i,0),e.enqueue(Pt(r,t,c,i.length,0))},async flush(t){const{st:e,ot:r,pending:a,ready:s}=this;if(r&&e){await s;let o=R;if(a.length){const t=e.update(Vt(Tt,a));r.update(t),o=Bt(Tt,t)}n.signature=Bt(Tt,r.digest()).slice(0,Ft),t.enqueue(st(o,n.signature))}}}),n=this}}function jt(t,e,r,n){Object.assign(t,{ready:new Promise(e=>t.nt=e),password:Wt(e,r),strength:n-1,pending:R})}function Pt(t,e,r,n,a,s){const{st:o,ot:i,pending:c}=t;c.length&&(e=st(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%yt)),d=0;l-yt>=d;d+=yt){const t=Vt(Tt,Lt(e,d,d+yt));s&&i.update(t);const a=o.update(t);s||i.update(a),r.set(Bt(Tt,a),d+n)}return t.pending=Lt(e,d),r}async function _t(t,e,r,n){t.password=null;const a=await(async(t,e,r,n,a)=>{if(!Mt)return ut.importKey(e);try{return await Dt.importKey("raw",e,r,!1,a)}catch{return Mt=!1,ut.importKey(e)}})(0,r,St,0,gt),s=await(async(t,e,r)=>{if(!Ct)return ut._(e,t.salt,Et.iterations,r);try{return await Dt.deriveBits(t,e,r)}catch{return Ct=!1,ut._(e,t.salt,Et.iterations,r)}})(Object.assign({salt:n},Et),a,8*(2*zt[e]+2)),o=new Uint8Array(s),i=Vt(Tt,Lt(o,0,zt[e])),c=Vt(Tt,Lt(o,zt[e],2*zt[e])),l=Lt(o,2*zt[e]);return Object.assign(t,{keys:{key:i,it:c,passwordVerification:l},st:new kt(new Ot(i),Array.from(Rt)),ot:new vt(c)}),l}function Wt(t,e){return e===g?at(t):e}function Lt(t,e,r){return t.subarray(e,r)}function Bt(t,e){return t.R(e)}function Vt(t,e){return t.A(e)}class Zt 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=Kt(r,t.subarray(0,12));if(r.password=r.rawPassword=null,0!=(e[11]^r.passwordVerification))throw Error(wt);t=t.subarray(12)}n?e.error(Error(mt)):e.enqueue(Kt(r,t))}})}}class Ht 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=ht(new Uint8Array(12));e[11]=r.passwordVerification,n=new Uint8Array(t.length+e.length),n.set(Yt(r,e),0),a=12}else n=new Uint8Array(t.length),a=0;n.set(Yt(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 rt(n[0]),lt:new rt(n[2])}),r)for(let e=0;e<r.length;e++)Gt(t,r[e]);else for(let r=0;r<e.length;r++)Gt(t,e.charCodeAt(r))})(t,e,r)}function Kt(t,e){const r=new Uint8Array(e.length);for(let n=0;n<e.length;n++)r[n]=Xt(t)^e[n],Gt(t,r[n]);return r}function Yt(t,e){const r=new Uint8Array(e.length);for(let n=0;n<e.length;n++)r[n]=Xt(t)^e[n],Gt(t,e[n]);return r}function Gt(t,e){let[,r]=t.keys;t.ct.append([e]);const n=~t.ct.get();r=Qt(Math.imul(Qt(r+Jt(n)),134775813)+1),t.lt.append([r>>>24]);const a=~t.lt.get();t.keys=[n,r,a]}function Xt(t){const e=2|t.keys[2];return Jt(Math.imul(e,1^e)>>>8)}function Jt(t){return 255&t}function Qt(t){return 4294967295&t}function $t(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 te(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 ee="Invalid uncompressed size",re="Invalid compressed data",ne="deflate-raw",ae="gzip",se=[31,139,8];class oe extends TransformStream{constructor(t,{chunkSize:e,CompressionStreamZlib:r,CompressionStream:n}){super({});const{compressed:a,encrypted:s,useCompressionStream:o,zipCrypto:i,signed:c,level:l,deflate64:d,format:u,compressionMethod:f}=t,w=this;let p,m,h,y=super.readable;const b=u&&H(u),S=c&&a&&!d&&!b&&(!s||i)&&!(!o||!n);if(s&&!i||!c||S||(p=new nt,y=me(y,p)),a)if(b)y=he(y,we(b.CompressionStream,u,{level:l,chunkSize:e,compressionMethod:f}));else if(S)h=new ie,y=he(y,new n(ae)),y=me(y,h);else try{y=pe(y,o,{level:l,chunkSize:e},n,r)}catch(t){let e;try{e=new n(ae)}catch{throw t}y=he(y,e),y=me(y,new ie)}s&&(i?y=me(y,new Ht(t)):(m=new Nt(t),y=me(y,m))),fe(w,y,()=>{let t;s&&!i&&(t=m.signature),s&&!i||!c||(t=S?h.signature:new DataView(p.value.buffer).getUint32(0)),w.signature=t})}}class ie 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=st(r,t));const s=a-8,o=Math.min(s,r.length);n.enqueue(st(r.subarray(0,o),t.subarray(0,s-o))),r=st(r.subarray(o),t.subarray(s-o))},flush(){const e=it(r);t.signature=e.getUint32(0,!0),t.uncompressedSize=e.getUint32(4,!0)}}),t=this}}class ce extends TransformStream{constructor(t,{chunkSize:e,DecompressionStreamZlib:r,DecompressionStream:n}){super({});const{zipCrypto:a,encrypted:s,signed:o,signature:i,compressed:c,useCompressionStream:l,deflate64:d,format:u,compressionMethod:f,rawBitFlag:w,outputSize:p}=t;let m,h,y=super.readable;if(s&&(a?y=me(y,new Zt(t)):(h=new It(t),y=me(y,h))),c){const t=u&&H(u);if(t)y=he(y,we(t.DecompressionStream,u,{chunkSize:e,compressionMethod:f,rawBitFlag:w,uncompressedSize:p}));else try{y=pe(y,l,{chunkSize:e,deflate64:d},n,r)}catch(t){if(d||p===g)throw t;let e;try{e=new n(ae)}catch{throw t}y=((t,e,r)=>{const n=new rt;let a,s,o,i=0,c=!1;const l=new Promise((t,e)=>{s=t,o=e});l.catch(()=>{}),r||s();const d=new TransformStream({start(t){const e=new Uint8Array(10);e.set(se),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=it(e);a.setUint32(0,n.get(),!0),a.setUint32(4,r,!0),t.enqueue(e)},cancel(t){o(t)}}),u=new TransformStream({transform(t,e){n.append(t),i+=t.length,r>i?c&&f():s(),e.enqueue(t)},cancel(t){o(t)}});return t=me(t,d),me(t=he(t,e),u);function f(){w(),a=setTimeout(()=>o(Error(ee)),5e3)}function w(){clearTimeout(a)}})(y,e,p)}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(re);throw e.cause=t,e}const{value:n,done:a}=r;a?t.close():t.enqueue(n)},cancel:t=>e.cancel(t)})})(y)}s&&!a||!o||(m=new nt,y=me(y,m)),fe(this,y,()=>{if((!s||a)&&o){const t=new DataView(m.value.buffer);if(i!=t.getUint32(0,!1))throw Error(pt)}})}}const le=new Map;function de(t,e){if(!t)return!1;let r=le.get(t);r||(r=new Map,le.set(t,r));let n=r.get(e);if(n===g){try{new t(e),n=!0}catch{n=!1}r.set(e,n)}return n}function ue(t){return de(t,ne)}function fe(t,e,r){e=me(e,new TransformStream({flush:r})),Object.defineProperty(t,"readable",{get:()=>e})}function we(t,e,r){if(!t)throw Error("Compression method not supported");return new t(e,r)}function pe(t,e,r,n,a){const s=e&&n?n:a||n,o=r.deflate64?"deflate64-raw":ne;let i;try{i=new s(o,r)}catch(t){if(!e||!a||s==a)throw t;i=new a(o,r)}return he(t,i)}function me(t,e){return $t(t).pipeThrough(e)}function he(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 ye="data",be="deflate",Se="inflate";class Ee extends TransformStream{constructor(t,e){super({});const r=this,{codecType:n}=t;let a;n.startsWith(be)?a=oe:n.startsWith(Se)&&(a=ce),r.outputSize=0;let s=0;const o=new a(t,e),i=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!==g&&r.outputSize>t.outputSize))throw Error(ee)},flush(){const{signature:t}=o;Object.assign(r,{signature:t,inputSize:s})}});Object.defineProperty(r,"readable",{get:()=>i.pipeThrough(c).pipeThrough(o).pipeThrough(l)})}}class ge 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 xe={type:"module"},ze="error";let Fe,Re,Ae,De,Ue=!0;try{Ue=typeof structuredClone==F&&structuredClone(new DOMException("","AbortError")).code!==g}catch{}let Te=()=>{};class Oe{constructor(t,{readable:e,writable:r},{options:n,config:a,ut:s,useWebWorkers:o,transferStreams:i,workerURI:c},l){const{signal:d}=s;return Object.assign(t,{ft:!0,wt:(t.wt||0)+1,readable:e.pipeThrough(new ge(k(a))).pipeThrough(new ke(s),{signal:d}),writable:r,options:Object.assign({},n),workerURI:c,transferStreams:i,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,l(t)}}}),Fe===g&&(Fe=typeof Worker!=z),(o&&Fe?Ce:Me)(t,a)}}class ke extends TransformStream{constructor({onstart:t,onprogress:e,size:r,onend:n}){let a=0;super({async start(){t&&await ve(t,r)},async transform(t,n){a+=t.length,e&&await ve(e,a,r),n.enqueue(t)},async flush(){n&&await ve(n,a)}})}}async function ve(t,...e){try{await t(...e)}catch{}}function Me(t,e){return{run:()=>Ie(t,e)}}function Ce(t,e){const{baseURI:r,chunkSize:n,workerStartupTimeout:a}=e;let{wasmURI:s}=e;if(!t.bt){let o;typeof s==F&&(s=s());try{o=je(t.workerURI,r,t)}catch{return Fe=!1,Me(t,e)}Object.assign(t,{ht:o,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:o}=t,{writable:i,closed:c,Ft: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,Ft:()=>e.abort()}})(t.writable);let d;try{d=We({type:"start",options:o,config:e,readable:s,writable:i},t)}catch(e){l();try{await c}catch{}throw t.St(),e}d||Object.assign(t,{reader:s.getReader(),writer:i.getWriter()});const{workerStartupTimeout:u}=e;t.gt||!Number.isFinite(u)||0>u||(t.Rt=setTimeout(()=>(t=>{if(t.Rt=null,t.gt)return;const{zt:e,writer:r}=t;if(Ne(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&&!i.locked)try{await i.getWriter().close()}catch{}}})(t,{chunkSize:n,wasmURI:s,baseURI:r,workerStartupTimeout:a})}catch(r){if(r&&r.At){Fe=!1;const{reader:r}=t;return r&&r.releaseLock(),t.reader=null,t.writer=null,Ie(t,e)}throw r}}}})}return t.bt}async function Ie({options:t,readable:e,writable:r,St:n},a){let s;try{if(t.compressed&&!t.format){const e=t.codecType.startsWith(be),r=e?a.CompressionStreamZlib:a.DecompressionStreamZlib,n=e?a.CompressionStream:a.DecompressionStream;if(t.useCompressionStream){if(r&&r.Dt&&!ue(n))try{await Te(a)}catch{}}else try{await Te(a)}catch{r&&!r.Dt||(t.useCompressionStream=!0)}}s=new Ee(t,a),await e.pipeThrough(s).pipeThrough(new ge(k(a))).pipeTo(r,{preventClose:!0,preventAbort:!0});const{signature:n,inputSize:o,outputSize:i}=s;return{signature:n,inputSize:o,outputSize:i}}catch(t){throw s&&(t.outputSize=s.outputSize),t}finally{n()}}function Ne(t){const{ht:e}=t;if(e)try{e.terminate()}catch{}t.bt=null}function je(t,e,r,n,a=!0){let s,o,i;if(Ae===g||Re!==t){const c=typeof t==F;o=c?t(a):t;const l=o.startsWith("data:"),d=o.startsWith("blob:");if(l||d){n===g&&(n=!1),n&&(i=xe);try{s=new Worker(o,i)}catch(a){if(d)try{URL.revokeObjectURL(o)}catch{}if(c&&d)return je(t,e,r,n,!1);if(n)throw a;return je(t,e,r,!0,!1)}}else{n===g&&(n=!0),n&&(i=xe);try{o=new URL(o,e)}catch{}try{s=new Worker(o,i)}catch(s){if(n)throw s;return je(t,e,r,!1,a)}}Re=t,Ae=o,De=i}else s=new Worker(Ae,De);return s.addEventListener("message",t=>{r.gt=!0,Pe(r),(async({data:t},e)=>{const{type:r,value:n,messageId:a,result:s,error:o}=t,{reader:i,writer:c,xt:l,zt:d,St:u,wt:f}=e,w=()=>e.wt!=f;try{if(o){const{message:t,stack:e,code:r,name:n,outputSize:a,cause:s}=o,i=Error(t);Object.assign(i,{stack:e,code:r,name:n,outputSize:a}),s&&(i.cause=Object.assign(Error(s.message),{name:s.name})),p(i)}else{if("pull"==r){const{value:t,done:r}=await i.read();w()||We({type:ye,value:t,done:r,messageId:a},e)}r==ye&&(await c.ready,await c.write(new Uint8Array(n)),w()||We({type:"ack",messageId:a},e)),"close"==r&&p(null,s)}}catch(o){w()||(Ne(e),p(o))}function p(t,e){w()||(t?d(t):l(e),c&&c.releaseLock(),u())}})(t,r)}),s.addEventListener(ze,t=>_e(t,r)),s.addEventListener("messageerror",t=>_e(t,r)),s}function Pe(t){const{Rt:e}=t;e&&(clearTimeout(e),t.Rt=null)}function _e(t,e){t.preventDefault&&t.preventDefault(),Pe(e);const{gt:r,zt:n,writer:a,St:s}=e;if(Ne(e),r||(e.ht=null),n){let e=t.error||Error(t.message||ze);r||(e=Object.assign(Error(e.message||ze),{At:!0})),n(e),a&&a.releaseLock(),r&&s()}}function We(t,{ht:e,writer:r,transferStreams:n,gt:a}){try{const{value:r,readable:s,writable:o}=t,i=[];if(r&&(t.value=ot(r),i.push(t.value.buffer)),n&&Ue&&a?(s&&i.push(s),o&&i.push(o)):t.readable=t.writable=null,i.length)try{return e.postMessage(t,i),!0}catch{Ue=!1,t.readable=t.writable=null,e.postMessage(t)}else e.postMessage(t)}catch(t){throw r&&r.releaseLock(),t}}let Le=[];const Be=[];let Ve,Ze,He=0;async function qe(t,e){const{options:r,config:n}=e,{transferStreams:a,useWebWorkers:s,useCompressionStream:o,compressed:i,signed:c,encrypted:l,format:d,codecURI:u}=r,{workerURI:f,maxWorkers:w}=n;d&&(u&&(r.codecURI=((t,e)=>{try{return new URL(t,e).toString()}catch{return t}})(u,n.baseURI)),await(async(t,e)=>{!L.has(t)&&e&&q(t,await(import(/* webpackIgnore: true */ /* @vite-ignore */e)))})(d,r.codecURI)),e.transferStreams=a||a===g&&n.transferStreams;const p=!i&&!c&&!l,m=d===g||!!r.codecURI;return e.useWebWorkers=!p&&m&&(s||s===g&&n.useWebWorkers),e.workerURI=e.useWebWorkers&&f?f:g,r.useCompressionStream=o||o===g&&n.useCompressionStream,(await(async()=>{const r=Le.find(t=>!t.ft);if(r)return Je(r),new Oe(r,t,e,h);if(Le.length<w){const r={Ut:He};return He++,Le.push(r),new Oe(r,t,e,h)}return new Promise(r=>{Be.push({resolve:r,stream:t,Tt:e}),Ze=n.workerStarvationTimeout,Ke()})})()).run();function h(t){if(Ye(),Be.length){const[{resolve:e,stream:r,Tt:n}]=Be.splice(0,1);e(new Oe(t,r,n,h)),Ke()}else t.ht?(Je(t),((t,e)=>{const{config:r}=e,{terminateWorkerTimeout:n}=r;Number.isFinite(n)&&n>=0&&(t.Et?t.Et=!1:t.Ot=setTimeout(async()=>{Le=Le.filter(e=>e!=t);try{await t.terminate()}catch{}},n))})(t,e)):Le=Le.filter(e=>e!=t)}}function Ke(){!Ve&&Be.length&&Number.isFinite(Ze)&&Ze>=0&&(Ve=setTimeout(Ge,Ze))}function Ye(){Ve&&(clearTimeout(Ve),Ve=null)}function Ge(){if(Ve=null,Be.length){const[{resolve:t,stream:e,Tt:r}]=Be.splice(0,1),n=Object.assign({},r,{useWebWorkers:!1,workerURI:g});t(new Oe({},e,n,Xe)),Ke()}}function Xe(){Ye(),Ke()}function Je(t){const{Ot:e}=t;e&&(clearTimeout(e),t.Ot=null)}const Qe="HTTP error ",$e="HTTP Range not supported",tr="HTTP resource changed",er="Writer iterator completed too soon",rr="Writer not initialized",nr="Content-Range",ar="Range",sr="GET",or="bytes",ir=16777216,cr="writable",lr=Symbol();class dr{constructor(){this.size=0}init(){this.initialized=!0}}class ur extends dr{get readable(){return this.createReadable()}createReadable({offset:t=0,size:e,chunkSize:r=k(O())}={}){const n=this;let a=0;return new ReadableStream({async pull(s){const o=e===g?r:Math.min(r,e-a),i=await Kr(n,t+a,o);s.enqueue(i),a+r>e||e===g&&!i.length&&o?s.close():a+=r}})}}class fr extends dr{constructor(){super();const t=this,e=new WritableStream({write(e){if(!t.initialized)throw Error(rr);return t.writeUint8Array(ot(e))}});Object.defineProperty(t,cr,{get:()=>e})}writeUint8Array(){}}class wr extends ur{constructor(t){super();let e=t.length;for(;"="==t.charAt(e-1);)e--;const r=t.indexOf(",")+1;Object.assign(this,{dataURI:t,kt:r,size:Math.floor(.75*(e-r))})}readUint8Array(t,e){const{kt:r,dataURI:n}=this,a=new Uint8Array(e),s=4*Math.floor(t/3),o=atob(n.substring(s+r,4*Math.ceil((t+e)/3)+r)),i=t-3*Math.floor(s/4);let c=0;for(let t=i;i+e>t&&t<o.length;t++)a[t-i]=o.charCodeAt(t),c++;return c<a.length?a.subarray(0,c):a}}class pr extends fr{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 mr,hr;class yr extends ur{constructor(t){super(),Object.assign(this,{blob:t,size:t.size}),hr||(hr=(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();mr=1==e}catch{mr=!1}})())}createReadable(t){const{blob:e,size:r}=this,{offset:n=0,size:a=r-n}=t||{};return n||r>a?mr?$t(e.slice(n,n+a).stream()):super.createReadable(t):$t(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 br extends dr{constructor(t){super();const e=this,r=new TransformStream;if(Object.defineProperty(e,cr,{get:()=>r.writable}),typeof Blob.prototype.stream!=F||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 Sr extends yr{constructor(t){super(new Blob([t],{type:"text/plain"}))}}class Er extends br{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 gr extends ur{constructor(t,e){super(),zr(this,t,e)}async init(){await Fr(this,Nr,vr),super.init()}createReadable(t){const e=this,{useRangeHeader:r,forceRangeRequests:n,size:a}=e;if((r||n)&&a!==g){const{offset:r=0,size:n=a-r}=t||{};if(n>0&&a>r)return((t,e,r)=>{let n,a=e,s=0,o=r;return new ReadableStream({start:()=>i(),async pull(t){n||await i();const{value:e,done:r}=await n.read();if(r)throw Error($e);const a=e.length>s?e.subarray(0,s):e;s-=a.length,o-=a.length,a.length&&t.enqueue(a),s||(await(async()=>{const t=n;n=g,await t.cancel()})(),o||t.close())},cancel:t=>n&&n.cancel(t)});async function i(){const e=Math.min(t.maximumRangeSize,o),r=await Nr(sr,t,Or(t,a,e));if(206!=r.status)throw Error($e);const i=r.headers.get(nr);if(i){const t=Number(i.trim().split(/[\s-]+/)[1]);if(!Number.isNaN(t)&&t!=a)throw Error($e)}Tr(t,r),Ur(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 Rr(this,t,e,Nr,vr)}}class xr extends ur{constructor(t,e){super(),zr(this,t,e)}async init(){await Fr(this,jr,Mr),super.init()}readUint8Array(t,e){return Rr(this,t,e,jr,Mr)}}function zr(t,e,r){const{preventHeadRequest:n,useRangeHeader:a,forceRangeRequests:s,combineSizeEocd:o,checkResourceChanges:i=!0,maximumRangeSize:c=ir,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:o,checkResourceChanges:i,maximumRangeSize:c,fetch:l})}async function Fr(t,e,r){const{url:n,preventHeadRequest:a,useRangeHeader:s,forceRangeRequests:o,combineSizeEocd:i}=t;if((t=>{const{baseURI:e}=O(),{protocol:r}=new URL(t,e);return"http:"==r||"https:"==r})(n)&&(s||o)&&(void 0===a||a)){const n=await e(sr,t,Or(t,i?-22:void 0)),a=n.headers.get("Accept-Ranges");if(!(o||a&&a.toLowerCase()==or))throw Error($e);{if(i){const e=new Uint8Array(await n.arrayBuffer());206==n.status&&e.length==d&&(t.Mt=e)}Ur(t,n);const a=Ar(n);a===g?await Ir(t,e,r):t.size=a}}else await Ir(t,e,r)}async function Rr(t,e,r,n,a){const{useRangeHeader:s,forceRangeRequests:o,Mt:i,size:c,options:l}=t;if(s||o){if(i&&e==c-d&&r==d)return i;if(c>e&&0!==r){e+r>c&&(r=c-e);const a=await n(sr,t,Or(t,e,r));if(206!=a.status)throw Error($e);const s=a.headers.get(nr);if(s){const t=Number(s.trim().split(/[\s-]+/)[1]);if(!Number.isNaN(t)&&t!=e)throw Error($e)}Tr(t,a),Ur(t,a);const o=new Uint8Array(await a.arrayBuffer());if(o.length!=r)throw Error($e);return o}return R}{const{data:n}=t;return n||await a(t,l),t.data.subarray(e,e+r)}}function Ar(t){const e=t.headers.get(nr);if(e){const t=e.trim().split(/\s*\/\s*/)[1];if(t&&"*"!=t){const e=Number(t);if(!Number.isNaN(e))return e}}}function Dr({headers:t}){return{Ct:t.get("Etag")||g,lastModified:t.get("Last-Modified")||g}}function Ur(t,e){const{checkResourceChanges:r,It:n}=t;r&&!n&&206==e.status&&(t.It=Dr(e))}function Tr(t,e){const{checkResourceChanges:r,It:n,size:a}=t;if(r){const t=Ar(e);if(t!==g&&a!==g&&t!=a)throw Error(tr);if(n){const t=Dr(e);if(Object.entries(n).some(([e,r])=>r!==g&&t[e]!==g&&r!=t[e]))throw Error(tr)}}}function Or(t,e=0,r=1){return Object.assign({},kr(t),{[ar]:or+"="+(0>e?e:e+"-"+(e+r-1))})}function kr({options:t}){const{headers:e}=t;if(e)return Symbol.iterator in e?Object.fromEntries(e):e}async function vr(t){await Cr(t,Nr)}async function Mr(t){await Cr(t,jr)}async function Cr(t,e){const r=await e(sr,t,kr(t));t.data=new Uint8Array(await r.arrayBuffer()),t.size=t.data.length}async function Ir(t,e,r){if(t.preventHeadRequest)await r(t,t.options);else{const n=await e("HEAD",t,kr(t)),a=n.headers.get("Content-Length");a&&!n.headers.get("Content-Encoding")?t.size=Number(a):await r(t,t.options)}}async function Nr(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($e):Error(Qe+(s.statusText||s.status))}function jr(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($e):Error(Qe+(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 Pr extends ur{constructor(t,e={}){super(),Object.assign(this,{url:t,reader:e.useXHR&&!e.fetch?new xr(t,e):new gr(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 _r extends Pr{constructor(t,e={}){super(t,Object.assign({},e,{useRangeHeader:!0}))}}class Wr extends ur{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 Lr extends fr{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 Br extends ur{constructor(t){super(),this.Nt=t}async init(){const t=this,{Nt:e}=t;t.jt=0,await Promise.all(e.map(t=>qr(t))),t.Pt=e.map(e=>{const r=t.size;return t.size+=e.size,r}),super.init()}_t(t){const{Pt:e,size:r}=this,n=e[t];return n===g?r:n}async readUint8Array(t,e){const r=this,{Nt:n}=this;let a,s=0,o=t;for(;n[s]&&o>=n[s].size;)o-=n[s].size,s++;const i=n[s];if(i){const n=i.size;if(o+e>n){const s=n-o;a=st(await Kr(i,o,s),await r.readUint8Array(t+s,e-s))}else a=await Kr(i,o,e)}else a=R;return r.jt=Math.max(s,r.jt),a}}class Vr extends dr{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 o=new WritableStream({async write(e){if(e===lr)return void(s&&await c());const{availableSize:o}=r;if(s)e.length<o?await i(e):(await i(e.subarray(0,o)),await c(),e.length>o&&await this.write(e.subarray(o)));else{const{value:o,done:i}=await t.next();if(i&&!o)throw Error(er);n=o,n.size=0,n.maxSize&&(r.maxSize=n.maxSize),r.availableSize=r.maxSize,await qr(n),a=o.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 i(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,cr,{get:()=>o})}async closeDisk(){const t=this.writable.getWriter();try{await t.ready,await t.write(lr)}finally{t.releaseLock()}}}class Zr{constructor(t){return Array.isArray(t)&&(t=new Br(t)),(t instanceof ReadableStream||typeof t.getReader==F)&&(t={readable:$t(t)}),t}}class Hr{constructor(t){return t.writable===g&&typeof t.next==F&&(t=new Vr(t)),(t instanceof WritableStream||typeof t.getWriter==F)&&(t={writable:te(t)}),t.size===g&&(t.size=0),t}}async function qr(t,e){if(!t.init||t.initialized)return Promise.resolve();await t.init(e)}function Kr(t,e,r){return t.readUint8Array(e,r)}const Yr="\0☺☻♥♦♣♠•◘○◙♂♀♪♫☼►◄↕‼¶§▬↨↑↓→←∟↔▲▼ !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~⌂ÇüéâäàåçêëèïîìÄÅÉæÆôöòûùÿÖÜ¢£¥₧ƒáíóúñѪº¿⌐¬½¼¡«»░▒▓│┤╡╢╖╕╣║╗╝╜╛┐└┴┬├─┼╞╟╚╔╩╦╠═╬╧╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀αßΓπΣσµτΦΘΩδ∞φε∩≡±≥≤⌠⌡÷≈°∙·√ⁿ²■ ".split("");function Gr(t,e){return e&&"cp437"==e.trim().toLowerCase()?(t=>{{let e="";for(let r=0;r<t.length;r++)e+=Yr[t[r]];return e}})(t):new TextDecoder(e,{ignoreBOM:!0}).decode(t)}const Xr="filename",Jr="rawFilename",Qr="comment",$r="rawComment",tn="uncompressedSize",en="compressedSize",rn="offset",nn="diskNumberStart",an="lastModDate",sn="rawLastModDate",on="lastAccessDate",cn="creationDate",ln="rawCreationDate",dn="internalFileAttributes",un="externalFileAttributes",fn="msdosAttributesRaw",wn="msdosAttributes",pn="msDosCompatible",mn="zip64",hn="encrypted",yn="version",bn="versionMadeBy",Sn="zipCrypto",En="directory",gn="executable",xn="compressionMethod",zn="signature",Fn="extraField",Rn="unixMode",An="setuid",Dn="setgid",Un="sticky",Tn=[Xr,Jr,tn,en,an,sn,Qr,$r,on,cn,ln,rn,nn,dn,un,fn,wn,pn,mn,hn,yn,bn,Sn,En,gn,xn,zn,Fn,"extraFieldUnix","extraFieldInfoZip","uid","gid",Rn,An,Dn,Un,"bitFlag","filenameUTF8","commentUTF8","rawExtraField","extraFieldZip64","extraFieldUnicodePath","extraFieldUnicodeComment","extraFieldAES","extraFieldNTFS","extraFieldExtendedTimestamp"];class On{constructor(t){Tn.forEach(e=>this[e]=t[e])}}const kn="password",vn="rawPassword",Mn="passThrough",Cn="signal",In="checkAmbiguity",Nn="useWebWorkers",jn="useCompressionStream",Pn="transferStreams",_n="preventClose",Wn="offset",Ln="usdz",Bn="strictness",Vn="strict",Zn="tolerant",Hn="File format is not recognized",qn="End of central directory not found",Kn="End of Zip64 central directory locator not found",Yn="Central directory header not found",Gn="Local file header not found",Xn="Zip64 extra field not found",Jn="File contains encrypted entry",Qn="Encryption method not supported",$n="Compression method not supported",ta="Split zip file",ea="Overlapping entry found",ra="Ambiguous archive",na="Encrypted central directory is not supported",aa="utf-8",sa="cp437",oa=[[tn,t],[en,t],[rn,t],[nn,e]],ia={[e]:{Wt:Ma,bytes:4},[t]:{Wt:Ca,bytes:8}};class ca{constructor(t,e={}){Object.assign(this,{reader:new Zr(t),options:e,config:O(),Lt:new Map})}async*getEntriesGenerator(n={}){const s=this;let{reader:i}=s;const{config:f}=s;if(await qr(i),i.size!==g&&i.readUint8Array||(i=new yr(await new Response(i.readable).blob()),await qr(i)),i.size<d)throw Error(Hn);const w=ba(Ua(s,n,Bn),Ua(s,n,In)),b=w==Vn,S=w!=Zn,E=((t,r)=>t!==g?t:r==Vn?0:r==Zn?1/0:e)(Ua(s,n,"maxAppendedDataSize"),w),{Bt:x,Vt:z}=await(async(t,e,r)=>{const{size:n}=t,a=Math.min(n,65557),s={count:Sa};let o,i,c=0;for await(const[r,l,u,f,w]of za(t,a)){const a=va(r,f+20);if(w+d+a==n){const a=await Ra(t,r,l,f,w,n,s);if(a==xa){if(o||(o=Fa(u,f,w)),c++,!e||c>1)break}else a!=ga||i||(i=Fa(u,f,w))}}return o||(o=i),o||(o=await(async(t,e,r)=>{const{size:n}=t,a=Math.min(n,e==1/0?n:65557+e);let s,o;for await(const[e,i,c,l,d]of za(t,a)){const a=Fa(c,l,d);s||(s=a);const u=await Ra(t,e,i,l,d,n,r);if(u==xa)return a;u!=ga||o||(o=a)}return o||s})(t,r,s)),{Bt:o,Vt:c}})(i,S,E);if(!x)throw Ma(it(await Kr(i,0,4)))==a?Error(ta):Error(qn);S&&z>1&&Da("multiple end of central directory records");const F=it(x);let A=Ma(F,12),D=Ma(F,16);const U=x.offset,T=va(F,20),O=U+d+T;i.size-O>E&&Da("appended data");let k=va(F,4);const v=i.jt||0;let M,C,I,N=va(F,6),j=va(F,10),P=0;const _=D==t||A==t||j==e||N==e;if(D!=t&&N!=e&&(D+=ya(i,N)),_){const r=x.offset<u?R:await Kr(i,x.offset-u,u),n=it(r);if(r.length==u&&Ma(n,0)==l){D=ya(i,Ma(n,4))+Ca(n,8);let r=await Kr(i,D,56),a=it(r);const s=x.offset-u-56;if((56>r.length||Ma(a,0)!=c)&&D!=s&&s>=0){const t=D;D=s,D>t&&(P=D-t),r=await Kr(i,D,56),a=it(r)}if(56>r.length||Ma(a,0)!=c)throw Error(Kn);C=!0,I=Ca(a,4)>44,k==e?k=Ma(a,16):b&&k!=Ma(a,16)&&Da("mismatched zip64 end of central directory record"),N==e?N=Ma(a,20):b&&N!=Ma(a,20)&&Da("mismatched zip64 end of central directory record"),j==e?j=Ca(a,32):b&&j!=Ca(a,32)&&Da("mismatched zip64 end of central directory record"),A==t?A=Ca(a,40):b&&A!=Ca(a,40)&&Da("mismatched zip64 end of central directory record"),D=ya(i,N)+Ca(a,48)+P}}const W=A,L=x.offset-(C?76:0);if(D<i.size||(P=i.size-D-A-d,D=i.size-A-d),v!=k)throw Error(ta);if(0>D)throw Error(Hn);let B=0,V=await Kr(i,D,A),Z=it(V);if(A){if(4>V.length)throw Error(Hn);const t=L-A;if(D!=t&&N==k){let e=!(Ma(Z,B)==o);if(e||0>t||t+4>i.size||(e=Ma(it(await Kr(i,t,4)),0)==o),e){const e=D;D=t,D>e&&(P+=D-e),V=await Kr(i,D,A),Z=it(V)}}}const H=L-D;if(A==H||0>H||N!=k||(A=H,V=await Kr(i,D,A),Z=it(V)),0>D||D>=i.size)throw Error(Hn);M=D;const q=Ua(s,n,"filenameEncoding"),K=Ua(s,n,"commentEncoding"),Y=b?new Set:g;let G;for(let t=0;j>t;t++){const a=new da(i,f,s.options);if(B+46>V.length||Ma(Z,B)!=o){if(0==t&&(I||ua(Z)))throw Error(na);throw Error(Yn)}fa(a,Z,B+6);const c=!!a.bitFlag.languageEncodingFlag,l=B+46,d=l+a.filenameLength,u=d+a.extraFieldLength,w=va(Z,B+4),S=!(w>>8),E=w>>8==3,x=V.subarray(l,d),z=va(Z,B+32),F=u+z,R=V.subarray(u,F),A=c,D=c,U=Ma(Z,B+38),T=U&r,O={readOnly:!!(1&T),hidden:!!(2&T),system:!!(4&T),directory:!!(16&T),archive:!!(32&T)},k=Ma(Z,B+42),v=Ua(s,n,"decodeText")||Gr,C=A?aa:q||sa,N=D?aa:K||sa;let _=v(x,C);_===g&&(_=Gr(x,C));let W=v(R,N);W===g&&(W=Gr(R,N)),Object.assign(a,{index:t,versionMadeBy:w,msDosCompatible:S,compressedSize:0,uncompressedSize:0,Zt:z,offset:k,diskNumberStart:va(Z,B+34),internalFileAttributes:va(Z,B+36),externalFileAttributes:U,msdosAttributesRaw:T,msdosAttributes:O,rawFilename:x,filenameUTF8:A,commentUTF8:D,rawExtraField:V.subarray(d,u),rawComment:R,filename:_,comment:W}),wa(a,a,Z,B+6),a.offset+=P,M=Math.min(ya(i,a.diskNumberStart)+a.offset,M),b&&(Y.has(a.filename)&&(G=!0),Y.add(a.filename));const L=a.externalFileAttributes>>16&e;a.unixMode===g&&16877&L&&(a.unixMode=L);const H=!!(a.unixMode&m),X=!!(a.unixMode&h),J=!!(512&a.unixMode),Q=a.unixMode!==g?!!(73&a.unixMode):E&&!!(73&L),$=a.unixMode!==g&&(61440&a.unixMode)==p,tt=(61440&L)==p;Object.assign(a,{setuid:H,setgid:X,sticky:J,unixExternalUpper:L,internalFileAttribute:a.internalFileAttributes,externalFileAttribute:a.externalFileAttributes,executable:Q,directory:$||tt||S&&O.directory||a.filename.endsWith(y)&&!a.uncompressedSize,zipCrypto:a.encrypted&&!a.extraFieldAES});const et=new On(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=F;const{onprogress:rt}=n;if(rt)try{await rt(t+1,j,new On(a))}catch{}yield et}b&&B!=W&&Da("trailing central directory data"),G&&Da("duplicate filename"),b&&(P||j&&M>0)&&Da("prepended data");const X=Ua(s,n,"extractPrependedData"),J=Ua(s,n,"extractAppendedData");return X&&(s.prependedData=M>0?await Kr(i,0,M):R),s.comment=T?await Kr(i,U+d,T):R,J&&(s.appendedData=O<i.size?await Kr(i,O,i.size-O):R),!0}async getEntries(t={}){const e=[];for await(const r of this.getEntriesGenerator(t))e.push(r);return e}async close(){}}class la{constructor(t={}){const{readable:e,writable:r}=new TransformStream,n=new ca(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}}class da{constructor(t,e,r){Object.assign(this,{reader:t,config:e,options:r})}async getData(t,e,a,o={}){const i=this,{reader:c,index:l,offset:d,diskNumberStart:u,extraFieldAES:f,extraFieldZip64:w,compressionMethod:p,config:m,bitFlag:h,rawBitFlag:y,signature:S,rawLastModDate:E,uncompressedSize:x,compressedSize:z}=i,{dataDescriptor:F}=h,A=e.localDirectory={},D=ya(c,u)+d,U=await Kr(c,D,b),T=it(U);let O=Ua(i,o,kn),k=Ua(i,o,vn);const v=Ua(i,o,Mn);if(O=O&&O.length&&O,k=k&&k.length&&k,f&&99!=f.originalCompressionMethod)throw Error($n);if(U.length<b||Ma(T,0)!=n)throw Error(Gn);fa(A,T,4);const{extraFieldLength:M,filenameLength:C}=A,I=ba(Ua(i,o,Bn),Ua(i,o,In))==Vn;let N=R;if(I&&(C||M)){const t=await Kr(c,D+b,C+M);N=t.subarray(0,C),A.rawExtraField=t.subarray(C)}else A.rawExtraField=M?await Kr(c,D+b+C,M):R;wa(i,A,T,4,!0),I&&((t,e,r)=>{const{rawFilename:n}=t;(r.length!=n.length||r.some((t,e)=>t!=n[e]))&&Da("mismatched local file header (filename)"),(2057&e.rawBitFlag)!=(2057&t.rawBitFlag)&&Da("mismatched local file header (general purpose bit flag)"),e.compressionMethod!=t.compressionMethod&&Da("mismatched local file header (compression method)"),e.bitFlag.dataDescriptor||!(e.signature||e.compressedSize||e.uncompressedSize)||e.signature==t.signature&&e.compressedSize==t.compressedSize&&e.uncompressedSize==t.uncompressedSize||Da("mismatched local file header (signature or sizes)")})(i,A,N);const{lastAccessDate:j,creationDate:P}=A;j&&(e.lastAccessDate=j),P&&(e.creationDate=P);const _=i.encrypted&&A.encrypted&&!v,W=_&&!f;if(v||(e.zipCrypto=W),_&&!(64&~A.rawBitFlag))throw Error(Qn);const L=v?g:Z(p);if(0!=p&&8!=p&&9!=p&&!L&&!v)throw Error($n);if(_){if(!W&&(1>f.strength||f.strength>3))throw Error(Qn);if(!O&&!k)throw Error(Jn)}const B=D+b+C+M,V=z,H=$t(c.createReadable({offset:B,size:V})),q=Ua(i,o,Cn),K=Ua(i,o,"checkPasswordOnly");let Y=Ua(i,o,"checkOverlappingEntry");const G=Ua(i,o,"checkOverlappingEntryOnly");G&&(Y=!0);const{onstart:X,onprogress:J,onend:Q}=o,$=9==p;let tt=Ua(i,o,jn);$&&(tt=!1);const et={options:{codecType:Se,password:O,rawPassword:k,zipCrypto:W,encryptionStrength:f&&f.strength,signed:Ua(i,o,"checkSignature")&&!v,passwordVerification:W&&(F?E>>>8&r:S>>>24&r),outputSize:v?z:x,signature:S,compressed:0!=p&&!v,encrypted:_,useWebWorkers:Ua(i,o,Nn),useCompressionStream:tt,transferStreams:Ua(i,o,Pn),deflate64:$,format:L?L.format:g,codecURI:L?L.codecURI:g,compressionMethod:p,rawBitFlag:y,checkPasswordOnly:K},config:m,ut:{signal:q,size:V,onstart:X,onprogress:J,onend:Q}};let rt;Y&&await(async({reader:t,Ht:e,index:r,offset:n,signature:a,compressedSize:o,uncompressedSize:i,qt:c,dataDescriptor:l,extraFieldZip64:d,Lt:u})=>{let f=0;if(l&&(f=d?20:12),f){const r=await Kr(t,c+o,f+4);if(r.length==f+4&&Ma(it(r),0)==s){const t=Ma(it(r),4);let n,s;d?(n=Ca(it(r),8),s=Ca(it(r),16)):(n=Ma(it(r),8),s=Ma(it(r),12)),(e.encrypted&&!e.zipCrypto||t==a)&&n==o&&s==i&&(f+=4)}}const w={start:n,end:c+o+f,Ht:e};for(const[t,e]of u)if(t!=r&&w.start<e.end&&e.start<w.end){const t=Error(ea);throw t.Kt=e.Ht,t}u.set(r,w)})({reader:c,Ht:e,index:l,offset:D,signature:S,compressedSize:z,uncompressedSize:x,qt:B,dataDescriptor:F||A.bitFlag.dataDescriptor,extraFieldZip64:w||A.extraFieldZip64,Lt:a});try{if(!G){K&&(t=new WritableStream),t=new Hr(t),await qr(t,v?z:x),({writable:rt}=t);const{outputSize:e}=await qe({readable:H,writable:rt},et);if(t.size+=e,e!=(v?z:x))throw Error(ee)}}catch(e){if(e.outputSize!==g&&(t.size+=e.outputSize),!K||e.message!=mt)throw e}finally{Ua(i,o,_n)||!rt||rt.locked||await rt.getWriter().close()}return K||G?g:t.getData?t.getData():rt}}function ua(t){const e=Math.min(t.byteLength,1024)-3;for(let r=0;e>r;r++)if(134630224==Ma(t,r))return!0;return!1}function fa(t,e,r){const n=t.rawBitFlag=va(e,r+2),a=!(1&~n),s=Ma(e,r+6);Object.assign(t,{encrypted:a,version:va(e,r),bitFlag:{level:(6&n)>>1,dataDescriptor:!(8&~n),languageEncodingFlag:(n&w)==w},rawLastModDate:s,lastModDate:Ta(s),filenameLength:va(e,r+22),extraFieldLength:va(e,r+24)})}function wa(t,e,r,n,a){const{rawExtraField:s}=e,o=e.extraField=new Map,i=it(s);let c=0;try{for(;c<s.length;){const t=va(i,c),e=va(i,c+2);o.set(t,{type:t,data:s.slice(c+4,c+4+e)}),c+=4+e}}catch{}const l=va(r,n+4);Object.assign(e,{signature:Ma(r,n+10),compressedSize:Ma(r,n+14),uncompressedSize:Ma(r,n+18)});const d=o.get(1);d&&(((t,e)=>{e.zip64=!0;const r=it(t.data),n=oa.filter(([t,r])=>e[t]==r),a=n.reduce((t,[,e])=>t+ia[e].bytes,0);if(t.data.length<a)throw Error(Xn);for(let a=0,s=0;a<n.length;a++){const[o,i]=n[a],c=ia[i];e[o]=t[o]=c.Wt(r,s),s+=c.bytes}})(d,e),e.extraFieldZip64=d);const u=o.get(28789);u&&(pa(u,Xr,Jr,e,t),e.extraFieldUnicodePath=u);const w=o.get(25461);w&&(pa(w,Qr,$r,e,t),e.extraFieldUnicodeComment=w);const p=o.get(39169);p&&p.data.length>=7?(((t,e,r)=>{const n=it(t.data),a=ka(n,4);Object.assign(t,{Yt:ka(n,0),vendorId:ka(n,2),strength:a,originalCompressionMethod:r,compressionMethod:va(n,5)}),e.compressionMethod=t.compressionMethod})(p,e,l),e.extraFieldAES=p):e.compressionMethod=l;const m=o.get(10);m&&(((t,e)=>{const r=it(t.data);let n,a=4;try{for(;a<t.data.length&&!n;){const e=va(r,a),s=va(r,a+2);1==e&&(n=t.data.slice(a+4,a+4+s)),a+=4+s}}catch{}try{if(n&&24==n.length){const r=it(n),a=r.getBigUint64(0,!0),s=r.getBigUint64(8,!0),o=r.getBigUint64(16,!0);Object.assign(t,{rawLastModDate:a,rawLastAccessDate:s,rawCreationDate:o});const i={lastModDate:Oa(a),lastAccessDate:Oa(s),creationDate:Oa(o)};Object.assign(t,i),Object.assign(e,i)}}catch{}})(m,e),e.extraFieldNTFS=m);const h=o.get(30805);if(h)ma(h,e,!1),e.extraFieldUnix=h;else{const t=o.get(30837);t&&(ma(t,e,!0),e.extraFieldInfoZip=t)}const y=o.get(f);y&&(((t,e,r)=>{if(!t.data.length)return;const n=it(t.data),a=ka(n,0),s=[],o=[];r?(1&~a||(s.push(an),o.push(sn)),2&~a||(s.push(on),o.push("rawLastAccessDate")),4&~a||(s.push(cn),o.push(ln))):5>t.data.length||(s.push(an),o.push(sn));let i=1;s.forEach((r,a)=>{if(t.data.length>=i+4){const s=Ma(n,i);e[r]=t[r]=new Date(1e3*(0|s));const c=o[a];t[c]=s}i+=4})})(y,e,a),e.extraFieldExtendedTimestamp=y);const b=o.get(6534);b&&(e.extraFieldUSDZ=b)}function pa(t,e,r,n,a){if(5>t.data.length)return void(t.valid=!1);const s=it(t.data),o=new rt;o.append(a[r]);const i=it(new Uint8Array(4));i.setUint32(0,o.get(),!0);const c=Ma(s,1);Object.assign(t,{version:ka(s,0),[e]:Gr(t.data.subarray(5)),valid:!a.bitFlag.languageEncodingFlag&&c==Ma(i,0)}),t.valid&&(n[e]=t[e],n[e+"UTF8"]=!0)}function ma(t,e,r){try{const n=it(t.data);let a,s;if(r){let e=0;const r=ka(n,e++),o=ka(n,e++);a=ha(t.data.subarray(e,e+o)),e+=o;const i=ka(n,e++);s=ha(t.data.subarray(e,e+i)),Object.assign(t,{version:r,uid:a,gid:s})}else 4>t.data.length||(a=va(n,0),s=va(n,2),Object.assign(t,{uid:a,gid:s}));a!==g&&(e.uid=a),s!==g&&(e.gid=s)}catch{}}function ha(t){const e=new Uint8Array(4);return e.set(t,0),new DataView(e.buffer,e.byteOffset,4).getUint32(0,!0)}function ya(t,e){return t._t?t._t(e):0}function ba(t,e){return t===g?e?Vn:"balanced":t}const Sa=64,Ea=0,ga=1,xa=2;async function*za(t,e){const r=t.size-e,n=await Kr(t,r,e),a=it(n);for(let t=n.length-d;t>=0;t--)Ma(a,t)==i&&(yield[a,r,n,t,r+t])}function Fa(t,e,r){return{offset:r,buffer:t.slice(e,e+d).buffer}}async function Ra(r,n,a,s,i,c,d){const f=va(n,s+10),w=Ma(n,s+12),p=Ma(n,s+16);if(f==e||w==t||p==t)return await Aa(r,n,a,i-u,c,d)==l?xa:Ea;if(!f&&!w)return ga;const m=va(n,s+6);for(const t of[i-w,ya(r,m)+p])if(await Aa(r,n,a,t,c,d)==o)return xa;return Ea}async function Aa(t,e,r,n,a,s){return 0>n||n+4>a?g:r>n?s.count>0?(s.count--,Ma(it(await Kr(t,n,4)),0)):g:Ma(e,n-r)}function Da(t){const e=Error(ra);throw e.reason=t,e}function Ua(t,e,r){return e[r]===g?t.options[r]:e[r]}function Ta(t){const r=(4294901760&t)>>16,n=t&e;try{return new Date(1980+((65024&r)>>9),((480&r)>>5)-1,31&r,(63488&n)>>11,(2016&n)>>5,2*(31&n),0)}catch{}}function Oa(t){return new Date(Number(t/BigInt(1e4)-BigInt(116444736e5)))}function ka(t,e){return t.getUint8(e)}function va(t,e){return t.getUint16(e,!0)}function Ma(t,e){return t.getUint32(e,!0)}function Ca(t,e){return Number(t.getBigUint64(e,!0))}var Ia=Object.freeze({__proto__:null,ERR_AMBIGUOUS_ARCHIVE:ra,ERR_BAD_FORMAT:Hn,ERR_CENTRAL_DIRECTORY_NOT_FOUND:Yn,ERR_ENCRYPTED:Jn,ERR_ENCRYPTED_CENTRAL_DIRECTORY:na,ERR_EOCDR_LOCATOR_ZIP64_NOT_FOUND:Kn,ERR_EOCDR_NOT_FOUND:qn,ERR_EXTRAFIELD_ZIP64_NOT_FOUND:Xn,ERR_INVALID_COMPRESSED_DATA:re,ERR_INVALID_PASSWORD:wt,ERR_INVALID_SIGNATURE:pt,ERR_INVALID_UNCOMPRESSED_SIZE:ee,ERR_LOCAL_FILE_HEADER_NOT_FOUND:Gn,ERR_OVERLAPPING_ENTRY:ea,ERR_SPLIT_ZIP_FILE:ta,ERR_UNSUPPORTED_COMPRESSION:$n,ERR_UNSUPPORTED_ENCRYPTION:Qn,ZipReader:ca,ZipReaderStream:la});const Na="File already exists",ja="Zip file comment exceeds 64KB",Pa="File entry comment exceeds 64KB",_a="File entry name exceeds 64KB",Wa="Version exceeds 65535",La="The strength must equal 1, 2, or 3",Ba="Encryption is not supported in USDZ files",Va="Extra field type exceeds 65535",Za="Extra field data exceeds 64KB",Ha=-2147483648,qa=2147483647,Ka="Zip64 is not supported (set the 'zip64' option to 'true')",Ya="Undefined uncompressed size",Ga="Undefined reader",Xa="Zip file not empty",Ja=new Uint8Array([7,0,2,0,65,69,3,0,0]),Qa="infozip",$a="unix";let ts=0;const es=[];class rs{constructor(t,e={}){t=new Hr(t);const{availableSize:r=x,maxSize:n=x}=t;Object.assign(this,{writer:t,Gt:r>0&&r!==x&&n>0&&n!==x,options:e,config:O(),files:new Map,Xt:new Set,offset:e[Wn]===g?t.size||t.writable.size||0:e[Wn],Jt:e[Wn]===g?0:e[Wn]-(t.size||t.writable.size||0),Qt:new Set,$t:0,te:g})}async prependZip(e){if(this.Xt.size)throw Error(Xa);e=new Zr(e),await qr(e);const{ZipReader:r}=await Promise.resolve().then(()=>Ia),n=new r(e.readable),a=await n.getEntries();await n.close(),await qr(this.writer),await e.readable.pipeTo(this.writer.writable,{preventClose:!0,preventAbort:!0}),this.writer.size=this.offset=e.size,this.Xt=new Set(a.map(t=>t.filename)),this.files=new Map(a.map(e=>{const{version:r,rawLastModDate:n,lastAccessDate:a,creationDate:s,rawFilename:o,bitFlag:i,encrypted:c,uncompressedSize:l,compressedSize:d,zip64:u}=e;let{compressionMethod:f,ee:w,re:p,ne:m,ae:h,se:y,rawExtraField:b}=e;const{level:S,languageEncodingFlag:E,dataDescriptor:x}=i;w=w||R,p=p||R,m=m||R,h=h||R,y=y||R,b=b||R,e.extraFieldAES&&(f=99);const z=zs(w,p,m,h,y,b),F=u&&l>=t,A=u&&d>=t,D=-7&Rs(S,E,x,c,f)|S<<1,{oe:U,ie:T}=Fs({version:r,bitFlag:D,compressionMethod:f,uncompressedSize:l,compressedSize:d,rawLastModDate:n,rawFilename:o,ce:A,le:F,extraFieldLength:z}),{signature:O}=e;return O!==g&&Es(T,10,O),Object.assign(e,{le:F,ce:A,de:u&&e.offset>=t,diskNumberStart:0,ue:!1,ee:w,re:p,ne:m,ae:h,se:y,rawExtraField:b,extendedTimestamp:m.length>0||h.length>0,fe:1+(a?2:0)+(s?4:0),oe:U,ie:T}),[e.filename,e]}))}async add(o="",i,c={}){const l=this;c=Object.assign({},c);const{Qt:d,config:u}=l;let w,z;ts<u.maxWorkers?ts++:await new Promise(t=>es.push(t));try{if(o=o.trim(),ys(l,c,En)&&!o.endsWith(y)&&(o+=y),l.Xt.has(o))throw Error(Na);return l.Xt.add(o),z=!0,w=(async(o,i,c,l)=>{const d=((n,a,s)=>{a=a.trim();let o=ys(n,s,pn),i=ys(n,s,bn,o?20:768);const c=ys(n,s,gn),l=ys(n,s,"uid"),d=ys(n,s,"gid");let u=ys(n,s,Rn),f=ys(n,s,"unixExtraFieldType"),w=ys(n,s,An),b=ys(n,s,Dn),S=ys(n,s,Un);if(l!==g&&(0>l||l>t))throw Error("Invalid uid (must be integer 0..2^32-1)");if(d!==g&&(0>d||d>t))throw Error("Invalid gid (must be integer 0..2^32-1)");if(u!==g&&(0>u||u>e))throw Error("Invalid UNIX mode (must be integer 0..65535)");if(f!==g&&f!==Qa&&f!==$a)throw Error("Invalid unixExtraFieldType (must be 'infozip' or 'unix')");if(f===$a&&(l!==g&&l>e||d!==g&&d>e))throw Error("uid/gid must be 0..65535 for unixExtraFieldType 'unix' (use 'infozip' for larger ids)");f!==g||l===g&&d===g||(f=Qa);let E=ys(n,s,fn),x=ys(n,s,wn);const z=E!==g||x!==g;if(l!==g||d!==g||u!==g||f?(o=!1,i=i&e|768):z&&(o=!0,i&=r),E!==g&&(0>E||E>r))throw Error("Invalid msdosAttributesRaw (must be integer 0..255)");if(x&&"object"!=typeof x)throw Error("Invalid msdosAttributes (must be an object with boolean flags)");if(i>e)throw Error(Wa);let F=ys(n,s,un);const R=F!==g;R||(F=0),!s[En]&&a.endsWith(y)&&(s[En]=!0);const A=ys(n,s,En);let D;if(A?(a.endsWith(y)||(a+=y),R||(F=16,o||(F|=16877<<16))):o||R||(F=c?493<<16:27525120),!o){const t=u!==g||!!(w||b||S);D=F>>16&e,u=u===g?D:u&e,w?u|=m:w=!!(u&m),b?u|=h:b=!!(u&h),S?u|=512:S=!!(512&u),R&&!t||(A&&(u|=p),F=(u&e)<<16|F&e)}return({msdosAttributesRaw:E,msdosAttributes:x}=((t,e)=>{if(t!==g)t&=r;else if(e!==g){const{readOnly:n,hidden:a,system:s,directory:o,archive:i}=e;let c=0;n&&(c|=1),a&&(c|=2),s&&(c|=4),o&&(c|=16),i&&(c|=32),t=c&r}return e===g&&(e={readOnly:!!(1&t),hidden:!!(2&t),system:!!(4&t),directory:!!(16&t),archive:!!(32&t)}),{msdosAttributesRaw:t,msdosAttributes:e}})(E,x)),z&&(F=F&t|E&r),{name:a,we:{versionMadeBy:i,msDosCompatible:o,externalFileAttributes:F,unixExternalUpper:D,uid:l,gid:d,unixMode:u,unixExtraFieldType:f,setuid:w,setgid:b,sticky:S,msdosAttributesRaw:E,msdosAttributes:x}}})(o,i,l);({name:i}=d);const u=((t,r,n)=>{const a=ys(t,n,"encodeText",at);let s=a(r);if(s===g&&(s=at(r)),zs(s)>e)throw Error(_a);const o=n[Qr]||"";let i=a(o);if(i===g&&(i=at(o)),zs(i)>e)throw Error(Pa);const c=ys(t,n,yn,20);if(c>e)throw Error(Wa);const l=ys(t,n,an,new Date),d=ys(t,n,on),u=ys(t,n,cn),f=ys(t,n,dn,0),w=ys(t,n,Mn);let p,m;w||(p=ys(t,n,kn),m=ys(t,n,vn));const h=ys(t,n,"encryptionStrength",3),y=ys(t,n,Sn),b=ys(t,n,"extendedTimestamp",!0),S=ys(t,n,"ntfsTimestamp"),E=ys(t,n,"keepOrder",!0),x=ys(t,n,Nn),z=ys(t,n,Pn),F=ys(t,n,"bufferedWrite"),A=ys(t,n,"createTempStream"),D=ys(t,n,"dataDescriptorSignature",!0),U=ys(t,n,Cn),T=ys(t,n,"useUnicodeFileNames",!0),O=ys(t,n,xn),k=w||O===g?g:Z(O);if(!w&&O!==g&&0!==O&&8!==O&&!k)throw Error("Compression method not supported");let v=ys(t,n,"level");if(t.options[Ln]){if(p!==g||m!==g)throw Error(Ba);v===g&&O===g&&(v=0)}let M=ys(t,n,jn),C=ys(t,n,"dataDescriptor");F&&C===g&&(C=!1),(C===g||y)&&(C=!0),v!==g&&6!=v&&(M=!1);const I=ys(t,n,mn);if(!y&&(p!==g||m!==g)&&(1>h||h>3))throw Error(La);let N=R;const j=n[Fn];if(j){let t=0,r=0;j.forEach(e=>t+=4+zs(e)),N=new Uint8Array(t);const n=it(N);j.forEach((t,a)=>{if(a>e)throw Error(Va);if(zs(t)>e)throw Error(Za);Ss(n,r,a),Ss(n,r+2,zs(t)),xs(N,t,r+4),r+=4+zs(t)})}return{comment:o,we:{rawFilename:s,rawComment:i,version:c,lastModDate:l,lastAccessDate:d,creationDate:u,internalFileAttributes:f,passThrough:w,password:p,rawPassword:m,encryptionStrength:h,zipCrypto:y,extendedTimestamp:b,ntfsTimestamp:S,keepOrder:E,useWebWorkers:x,transferStreams:z,bufferedWrite:F,createTempStream:A,dataDescriptorSignature:D,signal:U,useUnicodeFileNames:T,compressionMethod:O,format:k?k.format:g,codecURI:k?k.codecURI:g,pe:k?k.versionNeeded:g,level:v,useCompressionStream:M,dataDescriptor:C,zip64:I,rawExtraField:N}}})(o,i,l),{comment:w}=u,z=l[Fn];let F;o.files.set(i,g);try{const{we:w}=u;0==w.level||w.compressionMethod!==g||w.passThrough||await(async t=>{const{CompressionStream:e,CompressionStreamZlib:r}=t;if(r&&!r.Dt)return!0;if(ue(e)||de(e,ae))return!0;if(r)try{return await Te(t),!0}catch{return!1}return!1})(o.config)||(w.level=0);const p=await(async(e,r,{we:n},a)=>{const{passThrough:s,zipCrypto:o,password:i,rawPassword:c,encryptionStrength:l}=n;let{dataDescriptor:d,zip64:u,level:f,compressionMethod:w}=n,p=0,m=0;if(s){if(!r)throw Error(Ga);if(m=a[tn],m===g)throw Error(Ya)}const h=!0===u,y=ys(e,a,hn),b=!!r&&(!!(i&&zs(i)||c&&zs(c))||s&&y);r||(f=0,w=0);const S=b?o?12:16+4*l:0;r&&(r=new Zr(r),await qr(r),s?(a.uncompressedSize=m,p=bs(m)+S):r.size===g?(d=!0,(u||u===g)&&(u=!0,m=p=4294967296)):(a.uncompressedSize=m=r.size,p=bs(m)+S));const E=h||m>=t,x=h||p>=t;if(E||x){if(!1===u)throw Error(Ka);u=!0}return u=u||!1,{reader:r,we:{dataDescriptor:d,zip64:u,le:E,ce:x,uncompressedSize:m,level:f,compressionMethod:w,encrypted:b}}})(o,c,u,l);({reader:c}=p);const m=ls(o.writer),h=cs(o.writer),y=(t=>{const{rawFilename:r,lastModDate:a,lastAccessDate:s,creationDate:o,level:i,zip64:c,zipCrypto:l,useUnicodeFileNames:d,dataDescriptor:u,directory:w,rawExtraField:p,encryptionStrength:m,extendedTimestamp:h,ntfsTimestamp:y,passThrough:x,encrypted:z,le:F,ce:A,uncompressedSize:D}=t;let{version:U,compressionMethod:T}=t;const O=!w&&(T===g?i===g||i>0:0!==T);let k;const v=x||!O,M=c&&(t.bufferedWrite||!u||!F&&!A||v),C=M||c&&u&&(F||A);if(c&&(F||A)){const t=20,e=is(t);if(e.uint16(1),e.uint16(t-4),k=e.array,M&&(e.me(D),v)){const t=z?l?12:16+4*m:0;e.me(x?0:D+t)}}else k=R;let I,N,j,P,_;if(z&&!l){const t=is(zs(Ja)+2);t.uint16(39169),t.bytes(Ja),I=t.array,I[8]=m}else I=R;if(h){const t=ps(a),e=ms(t);if(e){const e=9+(s?4:0)+(o?4:0),r=is(e);P=1+(s?2:0)+(o?4:0),r.uint16(f),r.uint16(e-4),r.uint8(P),r.uint32(t),s&&r.uint32(hs(ps(s))),o&&r.uint32(hs(ps(o))),j=r.array}else j=R;if(y===g?!e||s||o:y)try{const t=ws(a),e=is(36);e.uint16(10),e.uint16(32),e.he(4),e.uint16(1),e.uint16(24),e.me(t),e.me(ws(s)||t),e.me(ws(o)||t),N=e.array}catch{N=R}else N=R}else N=j=R;try{const{uid:r,gid:n,unixExtraFieldType:a}=t;if(a!=Qa||r===g&&n===g)if(a!=$a||r===g&&n===g)_=R;else{const t=is(8);t.uint16(30805),t.uint16(4),t.uint16((r===g?0:r)&e),t.uint16((n===g?0:n)&e),_=t.array}else{const t=os(r),e=os(n),a=3+t.length+e.length,s=is(4+a);s.uint16(30837),s.uint16(a),s.uint8(1),s.uint8(t.length),s.bytes(t),s.uint8(e.length),s.bytes(e),_=s.array}}catch{_=R}T===g&&(T=O?8:0);const{pe:W}=t;O&&W!==g&&(U=U>W?U:W),c&&(U=U>45?U:45),z&&!l&&(U=U>51?U:51,I[9]=T,T=99);const L=C?zs(k):0,B=L+zs(I,j,N,_,p);if(B>e)throw Error(Za);const V=new Date(2e3*Math.ceil(a.getTime()/2e3)),{oe:Z,ie:H,rawLastModDate:q}=Fs({version:U,bitFlag:Rs(i,d,u,z,T),compressionMethod:T,uncompressedSize:D,lastModDate:E>V?E:V>S?S:V,rawFilename:r,ce:A,le:F,extraFieldLength:B}),K=is(b+zs(r)+B),Y=K.array,G=it(Y);return K.uint32(n),K.bytes(Z),K.bytes(r),C&&K.bytes(k),K.bytes(I),K.bytes(j),K.bytes(N),K.bytes(_),K.bytes(p),u&&(A||Es(G,18,0),F||Es(G,22,0)),{ye:Y,be:G,oe:Z,ie:H,lastModDate:a,rawLastModDate:q,encrypted:z,compressed:O,version:U,compressionMethod:T,fe:P,ee:R,Se:L,ne:j,ae:N,se:_,re:I,extraFieldLength:B}})(l=Object.assign({},l,d.we,u.we,p.we,{internalFileAttribute:u.we.internalFileAttributes,externalFileAttribute:d.we.externalFileAttributes,signature:l[zn],offset:o.offset-m,diskNumberStart:h})),z=(({zip64:t,dataDescriptor:e,dataDescriptorSignature:r})=>{let n,a=R,o=0,i=t?20:12;return r&&(i+=4),e&&(a=new Uint8Array(i),n=it(a),r&&(o=4,Es(n,0,s))),{Ee:a,ge:n,xe:o}})(l),A=zs(y.ye,z.Ee);F=await(async(e,n,s,o,i)=>{const{files:c,writer:l}=e,{keepOrder:d,dataDescriptor:u,signal:f}=i,{ze:w}=o,p=e.options[Ln],m=e.te;let h,y,S,E,z,F,R,A={},D=0;c.set(n,A),e.te=A;try{let y;d&&(y=m&&m.lock,A.lock=new Promise(t=>S=t)),i.bufferedWrite||!d||e.Fe||e.$t||!u?(h=!0,e.$t++,R=i.createTempStream?await i.createTempStream():new TransformStream(g,g,{highWaterMark:x}),R.size=0,await qr(l)):(R=l,await U()),await qr(R);const O=ls(l);if(e.Gt){delete e.Gt;const t=new Uint8Array(4);Es(it(t),0,a),await fs(l,t),e.offset+=4}p&&!h&&ss(o,e.offset-O);const{ye:k}=w;h||(await y,await T());const v=cs(l),M=us(e,l);if(A.diskNumberStart=v,h||(z=!0,F=l.size,await fs(R,k)),A=await(async(e,n,{diskNumberStart:a,lock:s},o,i,c)=>{const{ze:l,Re:d,Ae:u}=o,{oe:f,ie:w,lastModDate:p,rawLastModDate:m,encrypted:h,compressed:y,version:b,compressionMethod:S,ee:E,Se:x,ne:z,fe:F,ae:R,se:A,re:D}=l,{Ee:U}=d,{rawFilename:T,lastAccessDate:O,creationDate:k,password:v,rawPassword:M,level:C,zip64:I,le:N,ce:j,zipCrypto:P,dataDescriptor:_,directory:W,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:ot,sticky:it,unixExternalUpper:ct,msdosAttributesRaw:lt,msdosAttributes:dt,useCompressionStream:ut,passThrough:ft,format:wt,codecURI:pt}=c,mt={lock:s,versionMadeBy:B,zip64:I,directory:!!W,executable:!!L,filenameUTF8:!0,rawFilename:T,commentUTF8:!0,rawComment:V,ee:E,Se:x,ne:z,ae:R,se:A,re:D,rawExtraField:Z,extendedTimestamp:Q,msDosCompatible:$,internalFileAttributes:tt,externalFileAttributes:et,diskNumberStart:a,uid:rt,gid:nt,unixMode:at,setuid:st,setgid:ot,sticky:it,unixExternalUpper:ct,msdosAttributesRaw:lt,msdosAttributes:dt};let{signature:ht,uncompressedSize:yt}=c,bt=0;ft||(yt=0);const{writable:St}=n;if(e){const a=$t(e.createReadable?e.createReadable():e.readable),s=e.size,o={options:{codecType:be,level:C,rawPassword:M,password:v,encryptionStrength:J,zipCrypto:h&&P,passwordVerification:h&&P&&m>>8&r,signed:!ft,compressed:y&&!ft,encrypted:h&&!ft,useWebWorkers:H,useCompressionStream:ut,transferStreams:q,format:wt,codecURI:pt,compressionMethod:S},config:i,ut:{signal:X,size:s,onstart:K,onprogress:Y,onend:G}};try{const e=await qe({readable:a,writable:St},o);if(bt=e.outputSize,n.size+=bt,ft||(yt=e.inputSize,ht=e.signature),!j&&bt>=t||!N&&yt>=t)throw Error(Ka)}catch(t){throw t.outputSize!==g&&(n.size+=t.outputSize),t}}return(({signature:t,compressedSize:e,uncompressedSize:r,ze:n,Re:a},{zip64:s,zipCrypto:o,dataDescriptor:i})=>{const{ie:c,encrypted:l}=n,{ge:d,xe:u}=a;l&&!o||t===g||(Es(c,10,t),i&&Es(d,u,t)),s?i&&(gs(d,u+4,BigInt(e)),gs(d,u+12,BigInt(r))):(Es(c,14,e),Es(c,18,r),i&&(Es(d,u+4,e),Es(d,u+8,r)))})({signature:ht,compressedSize:bt,uncompressedSize:yt,ze:l,Re:d},c),_&&await fs(n,U),Object.assign(mt,{uncompressedSize:yt,compressedSize:bt,lastModDate:p,rawLastModDate:m,creationDate:k,lastAccessDate:O,encrypted:h,zipCrypto:P,size:u+bt,compressionMethod:S,version:b,oe:f,ie:w,signature:ht,fe:F,le:N,ce:j}),mt})(s,R,A,o,e.config,i),h||(z=!1),c.set(n,A),A.filename=n,h){if(await Promise.all([R.writable.getWriter().close(),y]),await U(),E=!0,F=l.size,await T(),A.diskNumberStart=cs(l),A.offset=us(e,l),p){const t=o.Ae;ss(o,e.offset-ls(l)),A.size+=o.Ae-t}(({rawFilename:t,encrypted:e,zip64:r,Se:n,signature:a,compressedSize:s,uncompressedSize:o,le:i,ce:c},l,{dataDescriptor:d})=>{if(d||(e||Es(l,14,a),c||Es(l,18,s),i||Es(l,22,o)),r&&n){const e=b+zs(t)+4;gs(l,e,BigInt(o)),gs(l,e+8,BigInt(s))}})(A,w.be,i),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=zs(t),D+=e}}),{preventClose:!0,preventAbort:!0,signal:r})}finally{n.releaseLock()}})(R.readable,l,f),l.size+=R.size,E=!1}else A.diskNumberStart=v,A.offset=M;return e.offset+=A.size,A}catch(t){if(E||z){if(e.hasCorruptedEntries=!0,t)try{t.corruptedEntry=!0}catch{}e.offset+=l.size-F,h&&(e.offset+=D)}throw c.delete(n),t}finally{if(h&&e.$t--,S&&S(),y&&y(),h&&R&&R.dispose)try{await R.dispose()}catch{}}async function U(){e.Fe=!0;const{De:t}=e;e.De=new Promise(t=>y=()=>{e.Fe=!1,t()}),await t}async function T(){ds(l,zs(w.ye))&&await l.closeDisk()}})(o,i,c,{ze:y,Re:z,Ae:A},l)}catch(t){throw o.files.delete(i),t}return Object.assign(F,{name:i,comment:w,extraField:z}),new On(F)})(l,o,i,c),d.add(w),await w}catch(t){throw z&&l.Xt.delete(o),t}finally{d.delete(w);const t=es.shift();t?t():ts--}}remove(t){const{Xt:e,files:r}=this;if("string"==typeof t&&(t=r.get(t)),t&&t.filename!==g){const{filename:n}=t;if(e.has(n)&&r.has(n))return e.delete(n),r.delete(n),!0}return!1}async close(r=R,n={}){const{Qt:a,writer:s}=this,{writable:u}=s;if(zs(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,re:s,rawComment:o,ae:i,se:c,rawExtraField:l,extendedTimestamp:d,fe:u,lastModDate:w,le:p,ce:m,uncompressedSize:h,compressedSize:y}=a,b=a.offset>=t,S=a.diskNumberStart>=e;let E,g;if(b||S||p||m){const t=4+(p?8:0)+(m?8:0)+(b?8:0)+(S?4:0),e=is(t);e.uint16(1),e.uint16(t-4),p&&e.me(h),m&&e.me(y),b&&e.me(a.offset),S&&e.uint32(a.diskNumberStart),E=e.array}else E=R;a.ee=E,a.de=b,a.ue=S;const x=ps(w);if(d&&ms(x)){const t=is(9);t.uint16(f),t.uint16(5),t.uint8(u),t.uint32(x),g=t.array}else g=R;a.ne=g;const z=zs(E,s,i,c,g,l);if(z>e)throw Error(Za);n+=46+zs(r,o)+z}return n})(r.files),u=await(async(r,n,a)=>{const{files:s,writer:i}=r,c=new Uint8Array(n);await qr(i);let l=0,d=0,u=cs(i),f=ls(i);for(const[r,n]of Array.from(s.values()).entries()){const{offset:w,rawFilename:p,ee:m,re:h,ne:y,ae:b,se:S,rawExtraField:E,rawComment:g,versionMadeBy:x,oe:z,ie:F,le:R,ce:A,ue:D,de:U,internalFileAttributes:T,externalFileAttributes:O,diskNumberStart:k,uncompressedSize:v,compressedSize:M}=n,C=zs(m,h,y,b,S,E),I=46+zs(p,g)+C;ds(i,l+I-d)&&(await fs(i,c.slice(d,l)),d=l,await i.closeDisk()),0==r&&(u=cs(i),f=ls(i)),R||Es(F,18,v),A||Es(F,14,M),(U||D)&&45>n.version&&Ss(F,0,45);const N=is(I);if(N.uint32(o),N.uint16(x),N.bytes(z.subarray(0,24)),N.uint16(C),N.uint16(zs(g)),N.uint16(D?e:k),N.uint16(T),N.uint32(O),N.uint32(U?t:w),N.bytes(p),N.bytes(m),N.bytes(h),N.bytes(y),N.bytes(b),N.bytes(S),N.bytes(E),N.bytes(g),xs(c,N.array,l),l+=I,a.onprogress)try{await a.onprogress(r+1,s.size,new On(n))}catch{}}return await fs(i,d?c.slice(d):c),{diskNumber:u,diskOffset:f}})(r,s,a);await(async(r,n,a,s)=>{const{writer:o}=r,{Ue:u}=s;let{Te:f}=s,w=r.files.size,p=u.diskNumber,m=us(r,u),h=cs(o);ds(o,d)&&h++;let y=ys(r,a,mn);if(!(t>m&&t>f&&e>w&&e>h)){if(!1===y)throw Error(Ka);y=!0}const b=zs(n);if(b>e)throw Error(ja);const S=is(y?98:d);ds(o,zs(S.array)+b)&&await o.closeDisk(),h=cs(o),y&&(S.uint32(c),S.me(44),S.uint16(45),S.uint16(45),S.uint32(h),S.uint32(p),S.me(w),S.me(w),S.me(f),S.me(m),S.uint32(l),S.uint32(h),S.me(BigInt(us(r,o))+BigInt(f)),S.uint32(h+1),ys(r,a,"supportZip64SplitFile",!0)&&(h=e,p=e),w=e,m=t,f=t),S.uint32(i),S.uint16(h),S.uint16(p),S.uint16(w),S.uint16(w),S.uint32(f),S.uint32(m),S.uint16(b),await fs(o,S.array),b&&await fs(o,n)})(r,n,a,{Ue:u,Te:s})})(this,r,n),ys(this,n,_n)||await u.getWriter().close(),s.getData?s.getData():u}}class ns{constructor(t={}){const{readable:e,writable:r}=new TransformStream;this.readable=e,this.zipWriter=new rs(r,t),this.Qt=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 as(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 as(this,this.zipWriter.add(t,r),t=>e.error(t)),n}async close(t,e={}){return await Promise.all(Array.from(this.Qt)),this.zipWriter.close(t,e)}}function as(t,e,r){t.Qt.add(e),e.catch(t=>{try{r(t)}catch{}})}function ss(t,e){const{ze:r}=t;let{ye:n,extraFieldLength:a}=r,s=64-(e+zs(n))%64;4>s&&(s+=64);const o=new Uint8Array(s),i=it(o);Ss(i,0,6534),Ss(i,2,s-4);const c=n;r.ye=n=new Uint8Array(zs(c)+s),xs(n,c),xs(n,o,zs(c));const l=it(n);Ss(l,28,a+s),r.be=l,t.Ae+=s}function os(t){if(t===g)return R;{const e=new Uint8Array(4);it(e).setUint32(0,t,!0);let r=4;for(;r>1&&0===e[r-1];)r--;return e.subarray(0,r)}}function is(t){const e=new Uint8Array(t),r=it(e);let n=0;return{array:e,uint8:t=>{((t,e,r)=>{t.setUint8(e,r)})(r,n,t),n+=1},uint16:t=>{Ss(r,n,t),n+=2},uint32:t=>{Es(r,n,t),n+=4},me:t=>{gs(r,n,BigInt(t)),n+=8},bytes:t=>{xs(e,t,n),n+=zs(t)},he:t=>n+=t}}function cs(t){const{diskNumber:e=0}=t;return e}function ls(t){const{diskOffset:e=0}=t;return e}function ds(t,e){const{availableSize:r=x}=t;return e>r}function us(t,{diskNumber:e=0,diskOffset:r=0}){return t.offset-r-(e?t.Jt:0)}async function fs(t,e){const{writable:r}=t,n=r.getWriter();try{await n.ready,t.size+=zs(e),await n.write(e)}finally{n.releaseLock()}}function ws(t){if(t)return(BigInt(t.getTime())+BigInt(116444736e5))*BigInt(1e4)}function ps(t){return Math.floor(t.getTime()/1e3)}function ms(t){return t>=Ha&&qa>=t}function hs(t){return Math.min(qa,Math.max(Ha,t))}function ys(t,e,r,n){const a=e[r]===g?t.options[r]:e[r];return a===g?n:a}function bs(t){return t+5*(Math.floor(t/16383)+1)}function Ss(t,e,r){t.setUint16(e,r,!0)}function Es(t,e,r){t.setUint32(e,r,!0)}function gs(t,e,r){t.setBigUint64(e,r,!0)}function xs(t,e,r){t.set(e,r)}function zs(...t){let e=0;return t.forEach(t=>t&&(e+=t.length)),e}function Fs({version:e,bitFlag:r,compressionMethod:n,uncompressedSize:a,compressedSize:s,lastModDate:o,rawLastModDate:i,rawFilename:c,ce:l,le:d,extraFieldLength:u}){const f=is(26),w=f.array,p=it(w);if(f.uint16(e),f.uint16(r),f.uint16(n),i===g){const t=new Uint32Array(1),e=it(t);Ss(e,0,(o.getHours()<<6|o.getMinutes())<<5|o.getSeconds()/2),Ss(e,2,(o.getFullYear()-1980<<4|o.getMonth()+1)<<5|o.getDate()),i=t[0]}return f.uint32(i),f.he(4),l||s!==g?f.uint32(l?t:s):f.he(4),d||a!==g?f.uint32(d?t:a):f.he(4),f.uint16(zs(c)),f.uint16(u),{oe:w,ie:p,rawLastModDate:i}}function Rs(t,e,r,n,a){let s=0;return e&&(s|=w),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 As(){return"application/octet-stream"}const Ds=1048576,Us=".zip.js-temp";function Ts(t={}){const{thresholdBytes:e=Ds,directoryName:r=Us,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,o,i=0,c=!1;const l=new WritableStream({async write(o){c?await a.write(o):(t.push(o),i+=o.length,i>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(!o){const t=await n.getFile();o=t.stream().getReader()}const{value:t,done:r}=await o.read();r?e.close():e.enqueue(t)}else d<t.length?e.enqueue(t[d++]):e.close()},async cancel(t){o&&await o.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 Os=1048576;function ks(t={}){const{thresholdBytes:e=Os}=t;return()=>{const t=[];let r,n,a,s=0,o=!1;const i=new WritableStream({async write(a){o?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(),o=!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:i,readable:new ReadableStream({async pull(e){if(o){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 vs=1048576,Ms=".zip.js-temp";function Cs(t={}){const{thresholdBytes:e=vs,directoryName:r=Ms,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 o(){return s||(s=Promise.resolve(a()).then(t=>t.getDirectoryHandle(r,{create:!0}))),s}return()=>{const t=[];let r,n,a=0,s=!1,i=0,c=0;const l=new WritableStream({async write(c){s?(n.write(c,{at:i}),i+=c.length):(t.push(c),a+=c.length,a>e&&await(async()=>{const e=await o();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:i}),i+=e.length;t.length=0})())},close(){n&&n.flush()}});let d=0;return{writable:l,readable:new ReadableStream({pull(e){if(s){const t=i-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 o();await t.removeEntry(r)}catch{}r=null}t.length=0}}}}try{M({baseURI:import.meta.url})}catch{}let Is,Ns,js,Ps,_s;function Ws(t,e,r={}){if(!Is){const t=Error("WASM module not loaded");throw t.cause=_s,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.Oe=Ns(a),this.in=Ns(s),this.inBufferSize=s,!this.Oe||!this.in)throw Error("allocation failed");if(this.ke=new Uint8Array(a),t?(this.ve=Is.deflate_process,this.Me=Is.deflate_last_consumed,this.Ce=Is.deflate_end,this.Ie=Is.deflate_new(),r="gzip"===e?Is.deflate_init_gzip(this.Ie,n):"deflate-raw"===e?Is.deflate_init_raw(this.Ie,n):Is.deflate_init(this.Ie,n)):"deflate64-raw"===e?(this.ve=Is.inflate9_process,this.Me=Is.inflate9_last_consumed,this.Ce=Is.inflate9_end,this.Ie=Is.inflate9_new(),r=Is.inflate9_init_raw(this.Ie)):(this.ve=Is.inflate_process,this.Me=Is.inflate_last_consumed,this.Ce=Is.inflate_end,this.Ie=Is.inflate_new(),r="deflate-raw"===e?Is.inflate_init_raw(this.Ie):"gzip"===e?Is.inflate_init_gzip(this.Ie):Is.inflate_init(this.Ie)),0!==r)throw Error("init failed:"+r)}catch(t){throw o(this),t}},transform(e,r){try{const n=e,s=new Uint8Array(Ps.buffer),o=this.ve,i=this.Me,c=this.Oe,l=this.ke;let d=0;for(;d<n.length;){const e=Math.min(n.length-d,32768);if((!this.in||this.inBufferSize<e)&&(this.in&&js&&(js(this.in),this.in=0),this.in=Ns(e),this.inBufferSize=e,!this.in))throw Error("allocation failed");s.set(n.subarray(d,d+e),this.in);const u=o(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=i(this.Ie);if(0===w)break;d+=w}}catch(t){o(this),r.error(t)}},flush(e){try{const r=new Uint8Array(Ps.buffer),n=this.ve,s=this.Oe,o=this.ke;for(;;){const i=n(this.Ie,0,0,s,a,4),c=16777215&i,l=i>>24&255;if(!t){const t=128&l?l-256:l;if(0>t)throw Error("process error:"+t)}if(c&&(o.set(r.subarray(s,s+c),0),e.enqueue(o.slice(0,c))),1===l||0===c)break}}catch(t){e.error(t)}finally{const t=o(this);0!==t&&e.error(Error("end error:"+t))}},cancel(){o(this)}});function o(t){let e=0;return t.Ie&&t.Ce&&(e=t.Ce(t.Ie)),t.Ie=0,t.in&&js&&js(t.in),t.in=0,t.Oe&&js&&js(t.Oe),t.Oe=0,e}}class Ls{constructor(t="deflate",e){return Ws(!0,t,e)}}class Bs{constructor(t="deflate",e){return Ws(!1,t,e)}}Ls.Dt=!0,Bs.Dt=!0;let Vs,Zs=!1;function Hs(){Vs=null,(async()=>{await Promise.allSettled(Le.map(t=>(Je(t),t.terminate()))),Fe=g})(),Zs=!1,Is=Ns=js=Ps=_s=null}(({Ne:t})=>{Te=t})({Ne:t=>{if(!Vs){let{wasmURI:e}=t;typeof e==F&&(e=e()),Vs=(async(t,{baseURI:e})=>{if(!Zs)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(Is=t,({malloc:Ns,free:js,memory:Ps}=Is),"function"!=typeof Ns||"function"!=typeof js||!Ps)throw Is=Ns=js=Ps=null,Error("Invalid WASM module")})((await WebAssembly.instantiate(r)).instance.exports)})(t,e),Zs=!0}catch(t){throw(t=>{_s=t})(t),t}})(e,t).catch(t=>{throw Vs=null,t})}return Vs}}),M({CompressionStreamZlib:Ls,DecompressionStreamZlib:Bs}),M({workerURI:new URL("./zip-web-worker.js",import.meta.url).href,wasmURI:new URL("./zip-module.wasm",import.meta.url).href});export{yr as BlobReader,br as BlobWriter,wr as Data64URIReader,pr as Data64URIWriter,ra as ERR_AMBIGUOUS_ARCHIVE,Hn as ERR_BAD_FORMAT,Yn as ERR_CENTRAL_DIRECTORY_NOT_FOUND,Na as ERR_DUPLICATED_NAME,Jn as ERR_ENCRYPTED,na as ERR_ENCRYPTED_CENTRAL_DIRECTORY,Kn as ERR_EOCDR_LOCATOR_ZIP64_NOT_FOUND,qn as ERR_EOCDR_NOT_FOUND,Xn as ERR_EXTRAFIELD_ZIP64_NOT_FOUND,$e as ERR_HTTP_RANGE,tr as ERR_HTTP_RESOURCE_CHANGED,I as ERR_INVALID_CODEC_DEFINITION,j as ERR_INVALID_CODEC_MODULE,ja as ERR_INVALID_COMMENT,re as ERR_INVALID_COMPRESSED_DATA,La as ERR_INVALID_ENCRYPTION_STRENGTH,Pa as ERR_INVALID_ENTRY_COMMENT,_a as ERR_INVALID_ENTRY_NAME,Za as ERR_INVALID_EXTRAFIELD_DATA,Va as ERR_INVALID_EXTRAFIELD_TYPE,wt as ERR_INVALID_PASSWORD,pt as ERR_INVALID_SIGNATURE,ee as ERR_INVALID_UNCOMPRESSED_SIZE,Wa as ERR_INVALID_VERSION,er as ERR_ITERATOR_COMPLETED_TOO_SOON,Gn as ERR_LOCAL_FILE_HEADER_NOT_FOUND,ea as ERR_OVERLAPPING_ENTRY,N as ERR_RESERVED_COMPRESSION_METHOD,ta as ERR_SPLIT_ZIP_FILE,Ga as ERR_UNDEFINED_READER,Ya as ERR_UNDEFINED_UNCOMPRESSED_SIZE,$n as ERR_UNSUPPORTED_COMPRESSION,Qn as ERR_UNSUPPORTED_ENCRYPTION,Ba as ERR_UNSUPPORTED_ENCRYPTION_USDZ,Ka as ERR_UNSUPPORTED_FORMAT,rr as ERR_WRITER_NOT_INITIALIZED,Xa as ERR_ZIP_NOT_EMPTY,_r as HttpRangeReader,Pr as HttpReader,ur as Reader,Br as SplitDataReader,Vr as SplitDataWriter,Sr as TextReader,Er as TextWriter,Wr as Uint8ArrayReader,Lr as Uint8ArrayWriter,fr as Writer,ca as ZipReader,la as ZipReaderStream,rs as ZipWriter,ns as ZipWriterStream,v as configure,ks as createBlobTempStream,Ts as createOPFSTempStream,Cs as createSyncAccessHandleTempStream,As as getMimeType,B as registerCodec,C as resetConfiguration,Hs as terminateWorkers,V as unregisterCodec};
|
package/dist/zip-core.js
CHANGED
|
@@ -1931,6 +1931,7 @@
|
|
|
1931
1931
|
const GZIP_HEADER_LENGTH = 10;
|
|
1932
1932
|
const GZIP_TRAILER_LENGTH = 8;
|
|
1933
1933
|
const GZIP_HEADER_BYTES = [0x1f, 0x8b, 0x08];
|
|
1934
|
+
const GZIP_OUTPUT_STALL_TIMEOUT = 5000;
|
|
1934
1935
|
|
|
1935
1936
|
class DeflateStream extends TransformStream {
|
|
1936
1937
|
|
|
@@ -2031,26 +2032,73 @@
|
|
|
2031
2032
|
}
|
|
2032
2033
|
}
|
|
2033
2034
|
|
|
2034
|
-
|
|
2035
|
+
function pipeThroughGzipDecompressionStream(readable, gzipStream, outputSize) {
|
|
2036
|
+
const crc32 = new Crc32();
|
|
2037
|
+
let outputLength = 0;
|
|
2038
|
+
let inputDone = false;
|
|
2039
|
+
let watchdogTimeout;
|
|
2040
|
+
let resolveTrailerReady, rejectTrailerReady;
|
|
2041
|
+
const trailerReady = new Promise((resolve, reject) => {
|
|
2042
|
+
resolveTrailerReady = resolve;
|
|
2043
|
+
rejectTrailerReady = reject;
|
|
2044
|
+
});
|
|
2045
|
+
trailerReady.catch(() => { });
|
|
2046
|
+
if (!outputSize) {
|
|
2047
|
+
resolveTrailerReady();
|
|
2048
|
+
}
|
|
2049
|
+
const gzipWrapStream = new TransformStream({
|
|
2050
|
+
start(controller) {
|
|
2051
|
+
const header = new Uint8Array(GZIP_HEADER_LENGTH);
|
|
2052
|
+
header.set(GZIP_HEADER_BYTES);
|
|
2053
|
+
controller.enqueue(header);
|
|
2054
|
+
},
|
|
2055
|
+
transform(chunk, controller) {
|
|
2056
|
+
controller.enqueue(chunk);
|
|
2057
|
+
},
|
|
2058
|
+
async flush(controller) {
|
|
2059
|
+
inputDone = true;
|
|
2060
|
+
startWatchdog();
|
|
2061
|
+
try {
|
|
2062
|
+
await trailerReady;
|
|
2063
|
+
} finally {
|
|
2064
|
+
stopWatchdog();
|
|
2065
|
+
}
|
|
2066
|
+
const trailer = new Uint8Array(GZIP_TRAILER_LENGTH);
|
|
2067
|
+
const dataView = getDataView(trailer);
|
|
2068
|
+
dataView.setUint32(0, crc32.get(), true);
|
|
2069
|
+
dataView.setUint32(4, outputSize, true);
|
|
2070
|
+
controller.enqueue(trailer);
|
|
2071
|
+
},
|
|
2072
|
+
cancel(reason) {
|
|
2073
|
+
rejectTrailerReady(reason);
|
|
2074
|
+
}
|
|
2075
|
+
});
|
|
2076
|
+
const outputStream = new TransformStream({
|
|
2077
|
+
transform(chunk, controller) {
|
|
2078
|
+
crc32.append(chunk);
|
|
2079
|
+
outputLength += chunk.length;
|
|
2080
|
+
if (outputLength >= outputSize) {
|
|
2081
|
+
resolveTrailerReady();
|
|
2082
|
+
} else if (inputDone) {
|
|
2083
|
+
startWatchdog();
|
|
2084
|
+
}
|
|
2085
|
+
controller.enqueue(chunk);
|
|
2086
|
+
},
|
|
2087
|
+
cancel(reason) {
|
|
2088
|
+
rejectTrailerReady(reason);
|
|
2089
|
+
}
|
|
2090
|
+
});
|
|
2091
|
+
readable = pipeThrough(readable, gzipWrapStream);
|
|
2092
|
+
readable = pipeThroughBackpressured(readable, gzipStream);
|
|
2093
|
+
return pipeThrough(readable, outputStream);
|
|
2035
2094
|
|
|
2036
|
-
|
|
2037
|
-
|
|
2038
|
-
|
|
2039
|
-
|
|
2040
|
-
|
|
2041
|
-
|
|
2042
|
-
|
|
2043
|
-
transform(chunk, controller) {
|
|
2044
|
-
controller.enqueue(chunk);
|
|
2045
|
-
},
|
|
2046
|
-
flush(controller) {
|
|
2047
|
-
const trailer = new Uint8Array(GZIP_TRAILER_LENGTH);
|
|
2048
|
-
const dataView = getDataView(trailer);
|
|
2049
|
-
dataView.setUint32(0, signature, true);
|
|
2050
|
-
dataView.setUint32(4, uncompressedSize, true);
|
|
2051
|
-
controller.enqueue(trailer);
|
|
2052
|
-
}
|
|
2053
|
-
});
|
|
2095
|
+
function startWatchdog() {
|
|
2096
|
+
stopWatchdog();
|
|
2097
|
+
watchdogTimeout = setTimeout(() => rejectTrailerReady(new Error(ERR_INVALID_UNCOMPRESSED_SIZE)), GZIP_OUTPUT_STALL_TIMEOUT);
|
|
2098
|
+
}
|
|
2099
|
+
|
|
2100
|
+
function stopWatchdog() {
|
|
2101
|
+
clearTimeout(watchdogTimeout);
|
|
2054
2102
|
}
|
|
2055
2103
|
}
|
|
2056
2104
|
|
|
@@ -2077,7 +2125,7 @@
|
|
|
2077
2125
|
try {
|
|
2078
2126
|
readable = pipeThroughCompressionStream(readable, useCompressionStream, { chunkSize, deflate64 }, DecompressionStream, DecompressionStreamZlib);
|
|
2079
2127
|
} catch (error) {
|
|
2080
|
-
if (deflate64 ||
|
|
2128
|
+
if (deflate64 || outputSize === UNDEFINED_VALUE) {
|
|
2081
2129
|
throw error;
|
|
2082
2130
|
}
|
|
2083
2131
|
let gzipStream;
|
|
@@ -2086,8 +2134,7 @@
|
|
|
2086
2134
|
} catch {
|
|
2087
2135
|
throw error;
|
|
2088
2136
|
}
|
|
2089
|
-
readable =
|
|
2090
|
-
readable = pipeThroughBackpressured(readable, gzipStream);
|
|
2137
|
+
readable = pipeThroughGzipDecompressionStream(readable, gzipStream, outputSize);
|
|
2091
2138
|
}
|
|
2092
2139
|
}
|
|
2093
2140
|
readable = mapInflateStreamError(readable);
|
|
@@ -2107,25 +2154,38 @@
|
|
|
2107
2154
|
}
|
|
2108
2155
|
}
|
|
2109
2156
|
|
|
2110
|
-
const
|
|
2157
|
+
const formatSupportByStream = new Map();
|
|
2111
2158
|
|
|
2112
|
-
function
|
|
2159
|
+
function supportsFormat(StreamClass, format) {
|
|
2113
2160
|
if (!StreamClass) {
|
|
2114
2161
|
return false;
|
|
2115
2162
|
}
|
|
2116
|
-
let
|
|
2163
|
+
let supportByFormat = formatSupportByStream.get(StreamClass);
|
|
2164
|
+
if (!supportByFormat) {
|
|
2165
|
+
supportByFormat = new Map();
|
|
2166
|
+
formatSupportByStream.set(StreamClass, supportByFormat);
|
|
2167
|
+
}
|
|
2168
|
+
let supported = supportByFormat.get(format);
|
|
2117
2169
|
if (supported === UNDEFINED_VALUE) {
|
|
2118
2170
|
try {
|
|
2119
|
-
new StreamClass(
|
|
2171
|
+
new StreamClass(format);
|
|
2120
2172
|
supported = true;
|
|
2121
2173
|
} catch {
|
|
2122
2174
|
supported = false;
|
|
2123
2175
|
}
|
|
2124
|
-
|
|
2176
|
+
supportByFormat.set(format, supported);
|
|
2125
2177
|
}
|
|
2126
2178
|
return supported;
|
|
2127
2179
|
}
|
|
2128
2180
|
|
|
2181
|
+
function supportsDeflateRaw(StreamClass) {
|
|
2182
|
+
return supportsFormat(StreamClass, FORMAT_DEFLATE_RAW);
|
|
2183
|
+
}
|
|
2184
|
+
|
|
2185
|
+
function supportsGzip(StreamClass) {
|
|
2186
|
+
return supportsFormat(StreamClass, FORMAT_GZIP);
|
|
2187
|
+
}
|
|
2188
|
+
|
|
2129
2189
|
function setReadable(stream, readable, flush) {
|
|
2130
2190
|
readable = pipeThrough(readable, new TransformStream({ flush }));
|
|
2131
2191
|
Object.defineProperty(stream, "readable", {
|
|
@@ -2424,6 +2484,25 @@
|
|
|
2424
2484
|
}
|
|
2425
2485
|
let initModule = () => { };
|
|
2426
2486
|
|
|
2487
|
+
async function supportsDeflate(config) {
|
|
2488
|
+
const { CompressionStream: NativeStream, CompressionStreamZlib: ZlibStream } = config;
|
|
2489
|
+
if (ZlibStream && !ZlibStream.requiresModule) {
|
|
2490
|
+
return true;
|
|
2491
|
+
}
|
|
2492
|
+
if (supportsDeflateRaw(NativeStream) || supportsGzip(NativeStream)) {
|
|
2493
|
+
return true;
|
|
2494
|
+
}
|
|
2495
|
+
if (ZlibStream) {
|
|
2496
|
+
try {
|
|
2497
|
+
await initModule(config);
|
|
2498
|
+
return true;
|
|
2499
|
+
} catch {
|
|
2500
|
+
return false;
|
|
2501
|
+
}
|
|
2502
|
+
}
|
|
2503
|
+
return false;
|
|
2504
|
+
}
|
|
2505
|
+
|
|
2427
2506
|
function resetWebWorkerSupport() {
|
|
2428
2507
|
webWorkerSupported = UNDEFINED_VALUE;
|
|
2429
2508
|
}
|
|
@@ -5797,6 +5876,11 @@
|
|
|
5797
5876
|
zipWriter.files.set(name, UNDEFINED_VALUE);
|
|
5798
5877
|
let fileEntry;
|
|
5799
5878
|
try {
|
|
5879
|
+
const { resolvedOptions } = metadataInfo;
|
|
5880
|
+
if (resolvedOptions.level != 0 && resolvedOptions.compressionMethod === UNDEFINED_VALUE &&
|
|
5881
|
+
!resolvedOptions.passThrough && !(await supportsDeflate(zipWriter.config))) {
|
|
5882
|
+
resolvedOptions.level = 0;
|
|
5883
|
+
}
|
|
5800
5884
|
const sizesInfo = await resolveSizes(zipWriter, reader, metadataInfo, options);
|
|
5801
5885
|
({ reader } = sizesInfo);
|
|
5802
5886
|
const diskOffset = getDiskOffset(zipWriter.writer);
|
|
@@ -6017,9 +6101,6 @@
|
|
|
6017
6101
|
if (level !== UNDEFINED_VALUE && level != 6) {
|
|
6018
6102
|
useCompressionStream = false;
|
|
6019
6103
|
}
|
|
6020
|
-
if (!useCompressionStream && !registeredCodec && (zipWriter.config.CompressionStream === UNDEFINED_VALUE && zipWriter.config.CompressionStreamZlib === UNDEFINED_VALUE)) {
|
|
6021
|
-
level = 0;
|
|
6022
|
-
}
|
|
6023
6104
|
const zip64 = getOptionValue(zipWriter, options, PROPERTY_NAME_ZIP64);
|
|
6024
6105
|
if (!zipCrypto && (password !== UNDEFINED_VALUE || rawPassword !== UNDEFINED_VALUE) && !(encryptionStrength >= 1 && encryptionStrength <= 3)) {
|
|
6025
6106
|
throw new Error(ERR_INVALID_ENCRYPTION_STRENGTH);
|