@zip.js/zip.js 2.13.0 → 2.14.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/BENCHMARKS.md +46 -1
- package/deno.json +1 -1
- package/dist/zip-core-external.js +594 -935
- package/dist/zip-core-external.min.js +1 -1
- package/dist/zip-core.js +461 -908
- package/dist/zip-core.min.js +1 -1
- package/dist/zip-fs-core-external.js +601 -938
- package/dist/zip-fs-core-external.min.js +1 -1
- package/dist/zip-fs-core.js +468 -911
- package/dist/zip-fs-core.min.js +1 -1
- package/dist/zip-fs-external.js +601 -938
- package/dist/zip-fs-external.min.js +1 -1
- package/dist/zip-fs-native.js +470 -913
- package/dist/zip-fs-native.min.js +1 -1
- package/dist/zip-fs.js +604 -941
- package/dist/zip-fs.min.js +1 -1
- package/dist/zip-legacy.js +463 -910
- package/dist/zip-legacy.min.js +1 -1
- package/dist/zip-module.wasm +0 -0
- package/dist/zip-native.js +463 -910
- 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 +597 -938
- package/dist/zip.min.js +1 -1
- package/index-native.cjs +470 -913
- package/index-native.min.js +1 -1
- package/index.cjs +604 -941
- package/index.d.cts +58 -12
- package/index.d.ts +58 -12
- package/index.min.js +1 -1
- package/lib/core/codec-worker-web.js +35 -11
- package/lib/core/codec-worker.js +33 -23
- package/lib/core/io.js +29 -21
- package/lib/core/streams/aes-crypto-stream.js +58 -99
- package/lib/core/streams/codecs/aes-hmac-sha1.js +348 -0
- package/lib/core/streams/zlib-wasm/aes-hmac-sha1-wasm.js +106 -0
- package/lib/core/streams/zlib-wasm/zlib-streams-loader.js +4 -0
- package/lib/core/streams/zlib-wasm/zlib-streams.wasm +0 -0
- package/lib/core/version.js +1 -1
- package/lib/core/web-worker-base.js +15 -9
- package/lib/core/web-worker-inline-native.js +1 -1
- package/lib/core/web-worker-inline-wasm.js +1 -1
- package/lib/core/web-worker-wasm.js +2 -0
- package/lib/core/zip-fs.js +7 -3
- package/lib/core/zip-writer.js +1 -2
- package/lib/core/zlib-streams-inline.js +1 -1
- package/lib/zip-module-wasm-base.js +3 -1
- package/package.json +1 -1
- package/lib/core/streams/codecs/sjcl.js +0 -795
package/dist/zip-fs-core.min.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports):"function"==typeof define&&define.amd?define(["exports"],e):e((t="undefined"!=typeof globalThis?globalThis:t||self).zip={})}(this,function(t){"use strict";const{Array:e,Object:n,String:r,Number:o,BigInt:i,Math:s,Date:a,Map:c,Set:u,Response:l,URL:d,Error:f,Uint8Array:w,Uint16Array:p,Uint32Array:h,DataView:m,Blob:y,Promise:S,TextEncoder:g,TextDecoder:b,document:E,crypto:x,btoa:z,TransformStream:R,ReadableStream:F,WritableStream:D,CompressionStream:A,DecompressionStream:C,navigator:I,Worker:T,Symbol:k,setTimeout:v,clearTimeout:_,structuredClone:N}="undefined"!=typeof globalThis?globalThis:self;var U=void 0!==E?E.currentScript:null;const O=4294967295,M=65535,L=255,B=67324752,W=134695760,P=W,Z=84233040,H=33639248,V=101010256,G=101075792,j=117853008,q=46,K=22,Y=20,X=56,J=39169,Q=21589,$=6534,tt=30837,et=30805,nt=2048,rt=61440,ot=16384,it=2048,st=1024,at="/",ct=30,ut=new a(2107,11,31,23,59,58),lt=new a(1980,0,1),dt=void 0,ft=1/0,wt="undefined",pt="function",ht="object",mt="string",yt="boolean",St=new w,gt=k.asyncDispose||k(),bt="password",Et="rawPassword",xt="passThrough",zt="signal",Rt="useWebWorkers",Ft="useCompressionStream",Dt="transferStreams",At="preventClose",Ct="level",It="useUnicodeFileNames",Tt="dataDescriptor",kt="offset",vt="usdz",_t="maxAppendedDataSize",Nt="signCentralDirectory",Ut="entry",Ot="filename",Mt="comment",Lt="strict",Bt="balanced",Wt="tolerant",Pt="compressed",Zt="Invalid option (must be a function)",Ht="Invalid signal (must be an AbortSignal instance)",Vt="Invalid password (password must be a string, rawPassword must be a Uint8Array)",Gt="Invalid passThrough option (must be a boolean or 'compressed')",jt="The operation was aborted";function qt(t){if(t&&typeof t!=pt)throw new f(Zt);return t}function Kt(t){if(t&&(typeof t.addEventListener!=pt||typeof t.aborted!=yt))throw new f(Ht);return t||dt}function Yt(t){if(t&&t.aborted)throw t.reason===dt?new DOMException(jt,"AbortError"):t.reason}function Xt(t,e){if(t&&typeof t!=mt||e&&!(e instanceof w))throw new f(Vt)}function Jt(t){if(t!==dt&&typeof t!=yt&&t!==Pt)throw new f(Gt);return t}function Qt(t,e,n){if(!o.isInteger(t)||t<0||t>e)throw new f(n)}function $t(t,e,n){t!==dt&&Qt(t,e,n)}function te(t){return typeof t==mt&&t.trim()?o(t):t}const ee="Invalid maxWorkers (must be an integer greater than 0)",ne="Invalid baseURI (must be a string)",re="Invalid URI (must be a string or a function returning a string)";let oe=2;try{typeof I!=wt&&I.hardwareConcurrency&&(oe=I.hardwareConcurrency)}catch{}const ie={workerURI:"./core/web-worker-wasm.js",wasmURI:"./core/streams/zlib-wasm/zlib-streams.wasm",chunkSize:65536,maxWorkers:oe,terminateWorkerTimeout:5e3,workerStarvationTimeout:5e3,workerStartupTimeout:5e3,useWebWorkers:!0,useCompressionStream:!0,transferStreams:!0,CompressionStream:typeof A!=wt&&A,DecompressionStream:typeof C!=wt&&C},se="maxWorkers",ae="baseURI",ce=["wasmURI","workerURI"],ue=["chunkSize",se,"terminateWorkerTimeout","workerStarvationTimeout","workerStartupTimeout"],le=["createWorker","CompressionStream","DecompressionStream","CompressionStreamFallback","DecompressionStreamFallback"],de=[ae,...ce,"useCompressionStream","useWebWorkers","transferStreams",...ue,...le],fe={...ie};function we(){return fe}function pe(t){return he(t.chunkSize)}function he(t){return t=te(t),o.isInteger(t)&&t>=1?s.max(t,64):65536}function me(t){const e={};for(const n of de){const r=t[n];r!==dt&&(e[n]=ye(n,r))}return e}function ye(t,e){if(ue.includes(t)){if(e=te(e),t==se&&(!o.isInteger(e)||e<1))throw new f(ee)}else if(le.includes(t))qt(e);else if(t==ae){if(e&&typeof e!=mt)throw new f(ne)}else if(ce.includes(t)&&e&&typeof e!=mt&&typeof e!=pt)throw new f(re);return e}function Se(t){t=t||{};const{CompressionStreamZlib:e,DecompressionStreamZlib:r}=t;if(e===dt&&r===dt)return t;const o=n.assign({},t);return o.CompressionStreamFallback===dt&&(o.CompressionStreamFallback=e),o.DecompressionStreamFallback===dt&&(o.DecompressionStreamFallback=r),o}function ge(t,e){const n=new w(t.length+e.length);return n.set(t),n.set(e,t.length),n}function be(t){return t.byteOffset||t.byteLength!=t.buffer.byteLength?new w(t):t}function Ee(t){return new m(t.buffer,t.byteOffset,t.byteLength)}function xe(t){return Boolean(t)&&"object"==typeof t}const ze=[[],[],[],[],[],[],[],[]];for(let t=0;t<256;t++){let e=t;for(let t=0;t<8;t++)e=1&e?e>>>1^3988292384:e>>>1;ze[0][t]=e}for(let t=0;t<256;t++)for(let e=1;e<8;e++){const n=ze[e-1][t];ze[e][t]=n>>>8^ze[0][255&n]}const[Re,Fe,De,Ae,Ce,Ie,Te,ke]=ze;class ve{constructor(t){this.o=t||-1}append(t){let e=0|this.o;const n=0|t.length;let r=0;if(n>=8&&t.buffer){const o=new m(t.buffer,t.byteOffset,n),i=n-8;for(;r<=i;r+=8){const t=e^o.getInt32(r,!0),n=o.getInt32(r+4,!0);e=ke[255&t]^Te[t>>>8&255]^Ie[t>>>16&255]^Ce[t>>>24&255]^Ae[255&n]^De[n>>>8&255]^Fe[n>>>16&255]^Re[n>>>24&255]}}for(;r<n;r++)e=e>>>8^Re[255&(e^t[r])];this.o=e}get(){return~this.o}}class _e extends R{constructor(){let t;const e=new ve;super({transform(t,n){e.append(t),n.enqueue(t)},flush(){const n=new w(4);new m(n.buffer).setUint32(0,e.get()),t.value=n}}),t=this}}function Ne(t){if(typeof g==wt){t=unescape(encodeURIComponent(t));const e=new w(t.length);for(let n=0;n<e.length;n++)e[n]=t.charCodeAt(n);return e}return(new g).encode(t)}const Ue={concat(t,e){if(0===t.length||0===e.length)return t.concat(e);const n=t[t.length-1],r=Ue.l(n);return 32===r?t.concat(e):Ue.h(e,r,0|n,t.slice(0,t.length-1))},bitLength(t){const e=t.length;if(0===e)return 0;const n=t[e-1];return 32*(e-1)+Ue.l(n)},m(t,e){if(32*t.length<e)return t;const n=(t=t.slice(0,s.ceil(e/32))).length;return e&=31,n>0&&e&&(t[n-1]=Ue.S(e,t[n-1]&2147483648>>e-1,1)),t},S:(t,e,n)=>32===t?e:(n?0|e:e<<32-t)+1099511627776*t,l:t=>s.round(t/1099511627776)||32,h(t,e,n,r){for(void 0===r&&(r=[]);e>=32;e-=32)r.push(n),n=0;if(0===e)return r.concat(t);for(let o=0;o<t.length;o++)r.push(n|t[o]>>>e),n=t[o]<<32-e;const o=t.length?t[t.length-1]:0,i=Ue.l(o);return r.push(Ue.S(e+i&31,e+i>32?n:r.pop(),1)),r}},Oe={bytes:{R(t){const e=Ue.bitLength(t)/8,n=new w(e);let r;for(let o=0;o<e;o++)3&o||(r=t[o/4]),n[o]=r>>>24,r<<=8;return n},F(t){const e=[];let n,r=0;for(n=0;n<t.length;n++)r=r<<8|t[n],3&~n||(e.push(r),r=0);return 3&n&&e.push(Ue.S(8*(3&n),r)),e}}},Me=class{constructor(t){const e=this;e.blockSize=512,e.D=[1732584193,4023233417,2562383102,271733878,3285377520],e.A=[1518500249,1859775393,2400959708,3395469782],t?(e.C=t.C.slice(0),e.I=t.I.slice(0),e.T=t.T):e.reset()}reset(){const t=this;return t.C=t.D.slice(0),t.I=[],t.T=0,t}update(t){const e=this;"string"==typeof t&&(t=Oe.v.F(t));const n=e.I=Ue.concat(e.I,t),r=e.T,o=e.T=r+Ue.bitLength(t);if(o>9007199254740991)throw new f("Cannot hash more than 2^53 - 1 bits");const i=new h(n);let s=0;for(let t=e.blockSize+r-(e.blockSize+r&e.blockSize-1);t<=o;t+=e.blockSize)e._(i.subarray(16*s,16*(s+1))),s+=1;return n.splice(0,16*s),e}N(){const t=this;let e=t.I;const n=t.C;e=Ue.concat(e,[Ue.S(1,1)]);for(let t=e.length+2;15&t;t++)e.push(0);for(e.push(s.floor(t.T/4294967296)),e.push(0|t.T);e.length;)t._(e.splice(0,16));return t.reset(),n}U(t,e,n,r){return t<=19?e&n|~e&r:t<=39?e^n^r:t<=59?e&n|e&r|n&r:t<=79?e^n^r:void 0}O(t,e){return e<<t|e>>>32-t}_(t){const n=this,r=n.C,o=e(80);for(let e=0;e<16;e++)o[e]=t[e];let i=r[0],a=r[1],c=r[2],u=r[3],l=r[4];for(let t=0;t<=79;t++){t>=16&&(o[t]=n.O(1,o[t-3]^o[t-8]^o[t-14]^o[t-16]));const e=n.O(5,i)+n.U(t,a,c,u)+l+o[t]+n.A[s.floor(t/20)]|0;l=u,u=c,c=n.O(30,a),a=i,i=e}r[0]=r[0]+i|0,r[1]=r[1]+a|0,r[2]=r[2]+c|0,r[3]=r[3]+u|0,r[4]=r[4]+l|0}},Le={importKey:t=>new Le.M(Oe.bytes.F(t)),L(t,e,n,r){if(n=n||1e4,r<0||n<0)throw new f("invalid params to pbkdf2");const o=1+(r>>5)<<2;let i,s,a,c,u;const l=new ArrayBuffer(o),d=new m(l);let w=0;const p=Ue;for(e=Oe.bytes.F(e),u=1;w<(o||1);u++){for(i=s=t.encrypt(p.concat(e,[u])),a=1;a<n;a++)for(s=t.encrypt(s),c=0;c<s.length;c++)i[c]^=s[c];for(a=0;w<(o||1)&&a<i.length;a++)d.setInt32(w,i[a]),w+=4}return l.slice(0,r/8)},M:class{constructor(t){const e=this,n=e.B=Me,r=[[],[]];e.W=[new n,new n];const o=e.W[0].blockSize/32;t.length>o&&(t=(new n).update(t).N());for(let e=0;e<o;e++)r[0][e]=909522486^t[e],r[1][e]=1549556828^t[e];e.W[0].update(r[0]),e.W[1].update(r[1]),e.P=new n(e.W[0])}reset(){const t=this;t.P=new t.B(t.W[0]),t.Z=!1}update(t){this.Z=!0,this.P.update(t)}digest(){const t=this,e=t.P.N(),n=new t.B(t.W[1]).update(e).N();return t.reset(),n}encrypt(t){if(this.Z)throw new f("encrypt on already updated hmac called!");return this.update(t),this.digest(t)}}},Be=typeof x!=wt&&typeof x.getRandomValues==pt,We="Invalid password",Pe="Invalid authentication code",Ze="zipjs-abort-check-password",He="Crypto API not supported";function Ve(t){if(Be)return x.getRandomValues(t);throw new f(He)}const Ge=16,je={name:"PBKDF2"},qe=n.assign({hash:{name:"HMAC"}},je),Ke=n.assign({iterations:1e3,hash:{name:"SHA-1"}},je),Ye=["deriveBits"],Xe=[8,12,16],Je=[16,24,32],Qe=10,$e=[0,0,0,0],tn=typeof x!=wt,en=tn&&x.subtle,nn=tn&&typeof en!=wt,rn=Oe.bytes,on=class{constructor(t){const e=this;e.H=[[[],[],[],[],[]],[[],[],[],[],[]]],e.H[0][0][0]||e.V();const n=e.H[0][4],r=e.H[1],o=t.length;let i,s,a,c=1;if(4!==o&&6!==o&&8!==o)throw new f("invalid aes key size");for(e.A=[s=t.slice(0),a=[]],i=o;i<4*o+28;i++){let t=s[i-1];(i%o===0||8===o&&i%o===4)&&(t=n[t>>>24]<<24^n[t>>16&255]<<16^n[t>>8&255]<<8^n[255&t],i%o===0&&(t=t<<8^t>>>24^c<<24,c=c<<1^283*(c>>7))),s[i]=s[i-o]^t}for(let t=0;i;t++,i--){const e=s[3&t?i:i-4];a[t]=i<=4||t<4?e:r[0][n[e>>>24]]^r[1][n[e>>16&255]]^r[2][n[e>>8&255]]^r[3][n[255&e]]}}encrypt(t){return this.G(t,0)}decrypt(t){return this.G(t,1)}V(){const t=this.H[0],e=this.H[1],n=t[4],r=e[4],o=[],i=[];let s,a,c,u;for(let t=0;t<256;t++)i[(o[t]=t<<1^283*(t>>7))^t]=t;for(let l=s=0;!n[l];l^=a||1,s=i[s]||1){let i=s^s<<1^s<<2^s<<3^s<<4;i=i>>8^255&i^99,n[l]=i,r[i]=l,u=o[c=o[a=o[l]]];let d=16843009*u^65537*c^257*a^16843008*l,f=257*o[i]^16843008*i;for(let n=0;n<4;n++)t[n][l]=f=f<<24^f>>>8,e[n][i]=d=d<<24^d>>>8}for(let n=0;n<5;n++)t[n]=t[n].slice(0),e[n]=e[n].slice(0)}G(t,e){if(4!==t.length)throw new f("invalid aes block size");const n=this.A[e],r=n.length/4-2,o=[0,0,0,0],i=this.H[e],s=i[0],a=i[1],c=i[2],u=i[3],l=i[4];let d,w,p,h=t[0]^n[0],m=t[e?3:1]^n[1],y=t[2]^n[2],S=t[e?1:3]^n[3],g=4;for(let t=0;t<r;t++)d=s[h>>>24]^a[m>>16&255]^c[y>>8&255]^u[255&S]^n[g],w=s[m>>>24]^a[y>>16&255]^c[S>>8&255]^u[255&h]^n[g+1],p=s[y>>>24]^a[S>>16&255]^c[h>>8&255]^u[255&m]^n[g+2],S=s[S>>>24]^a[h>>16&255]^c[m>>8&255]^u[255&y]^n[g+3],g+=4,h=d,m=w,y=p;for(let t=0;t<4;t++)o[e?3&-t:t]=l[h>>>24]<<24^l[m>>16&255]<<16^l[y>>8&255]<<8^l[255&S]^n[g++],d=h,h=m,m=y,y=S,S=d;return o}},sn=class{constructor(t,e){this.j=t,this.K=e,this.Y=e}reset(){this.Y=this.K}update(t){return this.X(this.j,t,this.Y)}J(t){if(255&~(t>>24))t+=1<<24;else{let e=t>>16&255,n=t>>8&255,r=255&t;255===e?(e=0,255===n?(n=0,255===r?r=0:++r):++n):++e,t=0,t+=e<<16,t+=n<<8,t+=r}return t}$(t){0===(t[0]=this.J(t[0]))&&(t[1]=this.J(t[1]))}X(t,e,n){let r;if(!(r=e.length))return[];const o=Ue.bitLength(e);for(let o=0;o<r;o+=4){this.$(n);const r=t.encrypt(n);e[o]^=r[0],e[o+1]^=r[1],e[o+2]^=r[2],e[o+3]^=r[3]}return Ue.m(e,o)}},an=Le.M;let cn=tn&&nn&&typeof en.importKey==pt,un=tn&&nn&&typeof en.deriveBits==pt;class ln extends R{constructor({password:t,rawPassword:e,encryptionStrength:n,checkPasswordOnly:r,checkAuthenticationCode:o=!0}){super({start(){fn(this,t,e,n)},async transform(t,e){const n=this,{password:o,strength:i,et:s,ready:a}=n;o?(await async function(t,e,n,r){const o=await pn(t,e,n,mn(r,0,Xe[e])),i=mn(r,Xe[e]);if(o[0]!=i[0]||o[1]!=i[1])throw new f(We)}(n,i,o,mn(t,0,Xe[i]+2)),t=mn(t,Xe[i]+2),r?e.error(new f(Ze)):s()):await a;const c=new w(t.length-Qe-(t.length-Qe)%Ge);e.enqueue(wn(n,t,c,0,Qe,!0))},async flush(t){const{nt:e,ot:n,it:r,ready:i}=this;if(n&&e){await i;const s=mn(r,0,r.length-Qe),a=mn(r,r.length-Qe);let c=St;if(s.length){const t=Sn(rn,s);n.update(t);const r=e.update(t);c=yn(rn,r)}const u=mn(yn(rn,n.digest()),0,Qe);let l=r.length<Qe?1:0;for(let t=0;t<Qe;t++)l|=u[t]^a[t];if(l&&o)throw new f(Pe);t.enqueue(c)}}})}}class dn extends R{constructor({password:t,rawPassword:e,encryptionStrength:n}){super({start(){fn(this,t,e,n)},async transform(t,e){const n=this,{password:r,strength:o,et:i,ready:s}=n;let a=St;r?(a=await async function(t,e,n){const r=Ve(new w(Xe[e]));return ge(r,await pn(t,e,n,r))}(n,o,r),i()):await s;const c=new w(a.length+t.length-t.length%Ge);c.set(a,0),e.enqueue(wn(n,t,c,a.length,0))},async flush(t){const{nt:e,ot:n,it:r,ready:o}=this;if(n&&e){await o;let i=St;if(r.length){const t=e.update(Sn(rn,r));n.update(t),i=yn(rn,t)}const s=yn(rn,n.digest()).slice(0,Qe);t.enqueue(ge(i,s))}}})}}function fn(t,e,r,o){n.assign(t,{ready:new S(e=>t.et=e),password:hn(e,r),strength:o-1,it:St})}function wn(t,e,n,r,o,i){const{nt:s,ot:a,it:c}=t;c.length&&(e=ge(c,e));const u=e.length-o;let l;for(n=function(t,e){if(e&&e>t.length){const n=t;(t=new w(e)).set(n,0)}return t}(n,r+(u-u%Ge)),l=0;l<=u-Ge;l+=Ge){const t=Sn(rn,mn(e,l,l+Ge));i&&a.update(t);const o=s.update(t);i||a.update(o),n.set(yn(rn,o),l+r)}return t.it=mn(e,l),n}async function pn(t,r,o,i){t.password=null;const s=await async function(t,e,n,r,o){if(!cn)return Le.importKey(e);try{return await en.importKey("raw",e,n,!1,o)}catch{return cn=!1,Le.importKey(e)}}(0,o,qe,0,Ye),a=await async function(t,e,n){if(!un)return Le.L(e,t.salt,Ke.iterations,n);try{return await en.deriveBits(t,e,n)}catch{return un=!1,Le.L(e,t.salt,Ke.iterations,n)}}(n.assign({salt:i},Ke),s,8*(2*Je[r]+2)),c=new w(a),u=Sn(rn,mn(c,0,Je[r])),l=Sn(rn,mn(c,Je[r],2*Je[r])),d=mn(c,2*Je[r]);return n.assign(t,{keys:{key:u,st:l,passwordVerification:d},nt:new sn(new on(u),e.from($e)),ot:new an(l)}),d}function hn(t,e){return e===dt?Ne(t):e}function mn(t,e,n){return t.subarray(e,n)}function yn(t,e){return t.R(e)}function Sn(t,e){return t.F(e)}class gn extends R{constructor({password:t,rawPassword:e,passwordVerification:n,checkPasswordOnly:r}){super({start(){En(this,t,e,n)},transform(t,e){const n=this;if(n.password||n.rawPassword){const e=xn(n,t.subarray(0,12));if(n.password=n.rawPassword=null,0!=(e[11]^n.passwordVerification))throw new f(We);t=t.subarray(12)}r?e.error(new f(Ze)):e.enqueue(xn(n,t))}})}}class bn extends R{constructor({password:t,rawPassword:e,passwordVerification:n}){super({start(){En(this,t,e,n)},transform(t,e){const n=this;let r,o;if(n.password||n.rawPassword){n.password=n.rawPassword=null;const e=Ve(new w(12));e[11]=n.passwordVerification,r=new w(t.length+e.length),r.set(zn(n,e),0),o=12}else r=new w(t.length),o=0;r.set(zn(n,t),o),e.enqueue(r)}})}}function En(t,e,r,o){n.assign(t,{password:e,rawPassword:r,passwordVerification:o}),function(t,e,r){const o=[305419896,591751049,878082192];if(n.assign(t,{keys:o,ct:new ve(o[0]),ut:new ve(o[2])}),r)for(let e=0;e<r.length;e++)Rn(t,r[e]);else for(let n=0;n<e.length;n++)Rn(t,e.charCodeAt(n))}(t,e,r)}function xn(t,e){const n=new w(e.length);for(let r=0;r<e.length;r++)n[r]=Fn(t)^e[r],Rn(t,n[r]);return n}function zn(t,e){const n=new w(e.length);for(let r=0;r<e.length;r++)n[r]=Fn(t)^e[r],Rn(t,e[r]);return n}function Rn(t,e){let[,n]=t.keys;t.ct.append([e]);const r=~t.ct.get();n=An(s.imul(An(n+Dn(r)),134775813)+1),t.ut.append([n>>>24]);const o=~t.ut.get();t.keys=[r,n,o]}function Fn(t){const e=2|t.keys[2];return Dn(s.imul(e,1^e)>>>8)}function Dn(t){return 255&t}function An(t){return 4294967295&t}function Cn(t){if(t instanceof F)return t;const e=t.getReader();return new F({async pull(t){const{value:n,done:r}=await e.read();r?t.close():t.enqueue(n)},cancel:t=>e.cancel(t)})}function In(t,e){t=Cn(t);const n=e?{type:e}:{};if(typeof y.prototype.stream!=pt||new y([]).stream()instanceof F)return new l(t).blob().then(t=>e?new y([t],n):t);const r=[];return t.pipeTo(new D({write(t){r.push(t)}})).then(()=>new y(r,n))}function Tn(t){if(t instanceof D)return t;const e=t.getWriter();return new D({write:t=>e.write(t),close:()=>e.close(),abort:t=>e.abort(t)})}const kn="Invalid codec definition",vn="Reserved compression method",_n="Invalid codec module",Nn="Compression method not supported",Un=[0,8,9,99],On=new c,Mn=new c;function Ln(t){return On.get(t)}function Bn(){return e.from(On.values(),t=>n.assign({},t,Mn.get(t.format)))}function Wn(t){return Mn.get(t)}function Pn(t,e){const{CompressionStream:n,DecompressionStream:r}=e;if(typeof n!=pt&&typeof r!=pt)throw new f(_n);Mn.set(t,{CompressionStream:n,DecompressionStream:r})}const Zn="Invalid uncompressed size",Hn="Invalid compressed data",Vn="Invalid CRC32",Gn="deflate-raw",jn="deflate64-raw",qn="gzip",Kn=[31,139,8];class Yn extends R{constructor(t,{chunkSize:e,CompressionStreamFallback:n,CompressionStream:r}){super({});const{compressed:o,encrypted:i,useCompressionStream:s,zipCrypto:a,computeCrc32:c,level:u,deflate64:l,format:d,compressionMethod:f,inputSize:w}=t,p=this;let h,y,S,g=super.readable;const b=d&&Wn(d),E=c&&o&&!l&&!b&&(!i||a)&&Boolean(s&&r);if(i&&!a||!c||E||(h=new _e,g=or(g,h)),o)if(b)g=ir(g,nr(b.CompressionStream,d,{level:u,chunkSize:e,compressionMethod:f,uncompressedSize:w}));else if(E)S=new Xn,g=ir(g,new r(qn)),g=or(g,S);else try{g=rr(g,s,{level:u,chunkSize:e},r,n)}catch(t){let e;try{e=new r(qn)}catch{throw t}g=ir(g,e),g=or(g,new Xn)}i&&(a?g=or(g,new bn(t)):(y=new dn(t),g=or(g,y))),er(p,g,()=>{i&&!a||!c||(p.crc32=E?S.crc32:new m(h.value.buffer).getUint32(0))})}}class Xn extends R{constructor(){let t,e=10,n=new w(0);super({transform(t,r){if(e){const n=s.min(e,t.length);if(e-=n,!(t=t.subarray(n)).length)return}const o=n.length+t.length;if(o<=8)return void(n=ge(n,t));const i=o-8,a=s.min(i,n.length);r.enqueue(ge(n.subarray(0,a),t.subarray(0,i-a))),n=ge(n.subarray(a),t.subarray(i-a))},flush(){const e=Ee(n);t.crc32=e.getUint32(0,!0),t.uncompressedSize=e.getUint32(4,!0)}}),t=this}}class Jn extends R{constructor(t,{chunkSize:e,DecompressionStreamFallback:n,DecompressionStream:r}){super({});const{zipCrypto:o,encrypted:i,checkCrc32:s,crc32:a,compressed:c,useCompressionStream:u,deflate64:l,format:d,compressionMethod:p,rawBitFlag:h,outputSize:y}=t;let g,b,E=super.readable;if(i&&(o?E=or(E,new gn(t)):(b=new ln(t),E=or(E,b))),c){const t=d&&Wn(d);if(t)E=ir(E,nr(t.DecompressionStream,d,{chunkSize:e,compressionMethod:p,rawBitFlag:h,uncompressedSize:y}));else try{E=rr(E,u,{chunkSize:e,deflate64:l},r,n)}catch(t){if(l||y===dt)throw t;let e;try{e=new r(qn)}catch{throw t}E=function(t,e,n){const r=new ve;let o,i,s,a=0,c=!1;const u=new S((t,e)=>{i=t,s=e});u.catch(()=>{}),n||i();const l=new R({start(t){const e=new w(10);e.set(Kn),t.enqueue(e)},transform(t,e){e.enqueue(t)},async flush(t){c=!0,p();try{await u}finally{h()}const e=new w(8),o=Ee(e);o.setUint32(0,r.get(),!0),o.setUint32(4,n,!0),t.enqueue(e)},cancel(t){s(t)}}),d=new R({transform(t,e){r.append(t),a+=t.length,a>=n?i():c&&p(),e.enqueue(t)},cancel(t){s(t)}});return t=or(t,l),or(t=ir(t,e),d);function p(){h(),o=v(()=>s(new f(Zn)),5e3)}function h(){_(o)}}(E,e,y)}E=function(t){const e=t.getReader();return new F({async pull(t){let n;try{n=await e.read()}catch(t){if(t&&t.message)throw t;const e=new f(Hn);throw e.cause=t,e}const{value:r,done:o}=n;o?t.close():t.enqueue(r)},cancel:t=>e.cancel(t)})}(E)}s&&(g=new _e,E=or(E,g)),er(this,E,()=>{if(s){const t=new m(g.value.buffer);if(a!=t.getUint32(0,!1))throw new f(Vn)}})}}const Qn=new c;function $n(t,e){if(!t)return!1;let n=Qn.get(t);n||(n=new c,Qn.set(t,n));let r=n.get(e);if(r===dt){try{new t(e),r=!0}catch{r=!1}n.set(e,r)}return r}function tr(t){return $n(t,Gn)}function er(t,e,r){e=or(e,new R({flush:r})),n.defineProperty(t,"readable",{get:()=>e})}function nr(t,e,n){if(!t)throw new f(Nn);return new t(e,n)}function rr(t,e,n,r,o){const i=e&&r?r:o||r,s=n.deflate64?jn:Gn;let a;try{a=new i(s,n)}catch(t){if(!e||!o||i==o)throw t;a=new o(s,n)}return ir(t,a)}function or(t,e){return Cn(t).pipeThrough(e)}function ir(t,e){const n=e.writable.getWriter(),r=t.getReader();return async function(){try{for(;;){await n.ready;const t=await r.read();if(t.done){await n.close();break}await n.write(t.value)}}catch(t){await async function(t,e){try{await t.abort(e)}catch{}}(n,t),await async function(t,e){try{await t.cancel(e)}catch{}}(r,t)}}(),e.readable}const sr="data",ar="deflate",cr="inflate";class ur extends R{constructor(t,e){super({});const r=this,{codecType:o}=t;let i;o.startsWith(ar)?i=Yn:o.startsWith(cr)&&(i=Jn),r.outputSize=0;let s=0;const a=new i(t,e),c=super.readable,u=new R({transform(t,e){t&&t.length&&(s+=t.length,e.enqueue(t))},flush(){n.assign(r,{inputSize:s})}}),l=new R({transform(e,n){if(e&&e.length&&(n.enqueue(e),r.outputSize+=e.length,t.outputSize!==dt&&r.outputSize>t.outputSize))throw new f(Zn)},flush(){const{crc32:t}=a;n.assign(r,{crc32:t,inputSize:s})}});n.defineProperty(r,"readable",{get:()=>c.pipeThrough(u).pipeThrough(a).pipeThrough(l)})}}class lr extends R{constructor(t){const e=[];let r=0,i=0;function s(){const n=new w(t);let o=0;for(;o<t;){const r=e[0],i=t-o;r.length<=i?(n.set(r,o),o+=r.length,e.shift()):(n.set(r.subarray(0,i),o),e[0]=r.subarray(i),o+=i)}return r-=t,n}(!o.isFinite(t)||t<1)&&(t=65536),super({transform(n,o){for(e.push(n),r+=n.length;r>t;)i+=t,o.enqueue(s())},flush(t){r&&(i+=r,t.enqueue(function(t,e){const n=new w(e);let r=0;for(const e of t)n.set(e,r),r+=e.length;return n}(e,r)))}}),n.defineProperty(this,"outputSize",{get:()=>i})}}const dr="Worker startup timeout";let fr,wr,pr;async function hr(t){const{CompressionStream:e,CompressionStreamFallback:n}=t;if(n&&!n.lt)return!0;if(tr(e)||$n(e,qn))return!0;if(n)try{return await void 0,!0}catch{return!1}return!1}function mr(t){t.createWorker?wr=!0:fr=!1}class yr{constructor(t,{readable:e,writable:r},o,i){const{options:s,config:a,ft:c,useWebWorkers:u,transferStreams:l,workerURI:d}=o;let{createWorker:f}=o;const{signal:w}=c;return wr&&(f=dt),n.assign(t,{wt:!0,ht:(t.ht||0)+1,readable:e.pipeThrough(new lr(pe(a))).pipeThrough(new Sr(c),{signal:w}),writable:r,options:n.assign({},s),yt:o,workerURI:d,createWorker:f,transferStreams:l,terminate:()=>new S(e=>{const{St:n,wt:r}=t;n?(r?t.gt=e:(n.terminate(),e()),t.bt=null):e()}),Et(){if(t.wt){const{gt:e}=t;e&&(t.gt=null,t.xt=!0,t.St.terminate(),e()),t.wt=!1,i(t)}}}),fr===dt&&(fr=typeof T!=wt),(u&&pr&&(fr&&d||f)?pr:br)(t,a)}}class Sr extends R{constructor({onstart:t,onprogress:e,size:n,onend:r}){let o=0;super({async start(){t&&await gr(t,n)},async transform(t,r){o+=t.length,e&&await gr(e,o,n),r.enqueue(t)},async flush(){r&&await gr(r,o)}})}}async function gr(t,...e){try{await t(...e)}catch{}}function br(t,e){return{run:()=>Er(t,e)}}async function Er({options:t,readable:e,writable:n,Et:r,yt:o},i){let s,a;try{if(t.compressed&&!t.format){const e=t.codecType.startsWith(ar),n=e?i.CompressionStreamFallback:i.DecompressionStreamFallback,r=e?i.CompressionStream:i.DecompressionStream;if(t.useCompressionStream){if(n&&n.lt&&!tr(r))try{await void 0}catch{}}else try{await void 0}catch{n&&!n.lt||(t.useCompressionStream=!0)}}s=new ur(t,i),a=new lr(pe(i)),await e.pipeThrough(s).pipeThrough(a).pipeTo(n,{preventClose:!0,preventAbort:!0});const{crc32:r,inputSize:o,outputSize:c}=s;return{crc32:r,inputSize:o,outputSize:c}}catch(t){if(s){const e=a?a.outputSize:0;if(o.outputSize=e,xe(t))try{t.outputSize=e}catch{}}throw t}finally{r()}}const xr={type:"module"},zr="error";let Rr,Fr,Dr,Ar=!0;try{Ar=typeof N==pt&&N(new DOMException("","AbortError")).code!==dt}catch{}var Cr;function Ir(t){const{reader:e}=t;e&&e.releaseLock(),t.reader=null,t.writer=null}function Tr(t){const{St:e}=t;if(e)try{e.terminate()}catch{}t.bt=null}function kr(t,e,r,o,i=!0){const{createWorker:s}=r;let a,c,u;if(s)a=s();else if(Fr===dt||Rr!==t){const n=typeof t==pt;c=n?t(i):t;const s=c.startsWith("data:"),l=c.startsWith("blob:");if(s||l){o===dt&&(o=!1),o&&(u=xr);try{a=new T(c,u)}catch(i){if(l)try{d.revokeObjectURL(c)}catch{}if(n&&l)return kr(t,e,r,o,!1);if(o)throw i;return kr(t,e,r,!0,!1)}}else{o===dt&&(o=!0),o&&(u=xr);try{c=new d(c,e)}catch{}try{a=new T(c,u)}catch(n){if(o)return kr(t,e,r,!1,i);throw n}}Rr=t,Fr=c,Dr=u}else a=new T(Fr,Dr);return a.addEventListener("message",t=>{r.zt=!0,vr(r),async function({data:t},e){const{type:r,value:o,messageId:i,result:s,error:a,errorValue:c}=t,{reader:u,writer:l,Rt:d,Ft:p,Et:h,ht:m}=e,y=()=>e.ht!=m;try{if(a)a.outputSize!==dt&&(e.outputSize=a.outputSize),S(function(t,e){const{message:r,stack:o,code:i,name:s,outputSize:a,cause:c,codecImportFailed:u}=t;let l;if(e?l=e.value:(l=n.assign(new f(r),{stack:o,code:i,name:s}),c&&(l.cause=n.assign(new f(c.message),{name:c.name}))),xe(l))try{a!==dt&&(l.outputSize=a),u&&(l.codecImportFailed=!0),e&&(l.name!==s&&(l.name=s),l.code!==i&&(l.code=i))}catch{}return l}(a,c));else{if("pull"==r){const{value:t,done:n}=await u.read();y()||Nr({type:sr,value:t,done:n,messageId:i},e)}if(r==sr){const t=new w(o);await l.ready,await l.write(t),e.outputSize+=t.length,y()||Nr({type:"ack",messageId:i},e)}"close"==r&&function(t){y()||(d(t),g(),h())}(s)}}catch(a){y()||(Tr(e),S(a))}function S(t){y()||(p(t),g(),xe(t)&&t.codecImportFailed||h())}function g(){l&&l.releaseLock()}}(t,r)}),a.addEventListener(zr,t=>_r(t,r)),a.addEventListener("messageerror",t=>_r(t,r)),a}function vr(t){const{Dt:e}=t;e&&(_(e),t.Dt=null)}function _r(t,e){t.preventDefault&&t.preventDefault(),vr(e);const{zt:r,Ft:o,writer:i,Et:s}=e;Tr(e),r||(e.St=null);let a=t.error||new f(t.message||zr);r||(a=n.assign(new f(a.message||zr),{At:!0}),e.Ct=a),o&&(o(a),i&&i.releaseLock(),r&&s())}function Nr(t,{St:e,writer:n,transferStreams:r,zt:o}){try{const{value:n,readable:i,writable:s}=t,a=[];if(n&&(t.value=be(n),a.push(t.value.buffer)),r&&Ar&&o?(i&&a.push(i),s&&a.push(s)):t.readable=t.writable=null,a.length)try{return e.postMessage(t,a),!0}catch{Ar=!1,t.readable=t.writable=null,e.postMessage(t)}else e.postMessage(t)}catch(t){throw n&&n.releaseLock(),t}}Cr=function(t,e){const{baseURI:r,chunkSize:i,workerStartupTimeout:s}=e;let{wasmURI:a}=e;if(!t.bt){let c;typeof a==pt&&(a=a());try{c=kr(t.workerURI,r,t)}catch{return mr(t),br(t,e)}n.assign(t,{St:c,zt:!1,xt:!1,Ct:null,bt:{run:async()=>{try{return await async function(t,e){if(!t.St){const{Ct:e}=t;t.Ct=null;const n=e||new f(dr);throw n.At=!0,n}let r,i;const s=new S((e,n)=>{r=e,i=e=>{const{outputSize:r,yt:o}=t;if(o.outputSize=r,xe(e)&&e.outputSize===dt)try{e.outputSize=r}catch{}n(e)}});n.assign(t,{reader:null,writer:null,outputSize:0,Rt:r,Ft:i,result:s});const{readable:a,options:c}=t,{writable:u,closed:l,It:d}=function(t){const e=new AbortController,{writable:n,readable:r}=new R,o=r.pipeTo(t,{preventClose:!0,preventAbort:!0,signal:e.signal});return o.catch(()=>{}),{writable:n,closed:o,It:()=>e.abort()}}(t.writable);let w;try{w=Nr({type:"start",options:c,config:e,readable:a,writable:u},t)}catch(e){d();try{await l}catch{}throw t.Et(),e}w||n.assign(t,{reader:a.getReader(),writer:u.getWriter()});const{workerStartupTimeout:p}=e;!t.zt&&o.isFinite(p)&&p>=0&&(t.Dt=v(()=>function(t){if(t.Dt=null,t.zt)return;const{Ft:e,writer:n}=t;if(Tr(t),t.St=null,e){const t=new f(dr);t.At=!0,e(t),n&&n.releaseLock()}}(t),p));try{const t=await s;return await h(),await l,t}catch(t){await h(),d();try{await l}catch{}throw t}async function h(){if(!w&&!u.locked)try{await u.getWriter().close()}catch{}}}(t,{chunkSize:i,wasmURI:a,baseURI:r,workerStartupTimeout:s})}catch(n){if(n&&n.At)return mr(t),Ir(t),Er(t,e);if(n&&n.codecImportFailed){if(t.reader)return Ir(t),Er(t,e);t.Et()}throw n}}}})}return t.bt},pr=Cr;let Ur=[];const Or=[];let Mr,Lr,Br=0;async function Wr(t,e){const{options:n,config:r}=e,{transferStreams:i,useWebWorkers:s,useCompressionStream:a,compressed:c,checkCrc32:u,computeCrc32:l,encrypted:f,format:w,codecURI:p}=n,{workerURI:h,createWorker:m,maxWorkers:y}=r;w&&(p&&(n.codecURI=function(t,e){try{return new d(t,e).toString()}catch{return t}}(p,r.baseURI)),await async function(t,e){!Mn.has(t)&&e&&Pn(t,await(import(/* webpackIgnore: true */ /* @vite-ignore */e)))}(w,n.codecURI)),e.transferStreams=!w&&(i||i===dt&&r.transferStreams);const g=!(c||u||l||f),b=w===dt||Boolean(n.codecURI);return e.useWebWorkers=!g&&b&&(s||s===dt&&r.useWebWorkers),e.workerURI=e.useWebWorkers&&h?h:dt,e.createWorker=e.useWebWorkers&&m?m:dt,n.useCompressionStream=a||a===dt&&r.useCompressionStream,(await async function(){const n=Ur.find(t=>!t.wt);if(n)return Gr(n),new yr(n,t,e,E);if(Ur.length<y){const n={Tt:Br};return Br++,Ur.push(n),new yr(n,t,e,E)}return new S(n=>{Or.push({resolve:n,stream:t,yt:e}),Lr=r.workerStarvationTimeout,Pr()})}()).run();function E(t){if(Zr(),Or.length){const[{resolve:e,stream:n,yt:r}]=Or.splice(0,1);e(new yr(t,n,r,E)),Pr()}else t.St?(Gr(t),function(t,e){const{config:n}=e,{terminateWorkerTimeout:r}=n;o.isFinite(r)&&r>=0&&(t.xt?t.xt=!1:t.kt=v(async()=>{Ur=Ur.filter(e=>e!=t);try{await t.terminate()}catch{}},r))}(t,e)):Ur=Ur.filter(e=>e!=t)}}function Pr(){!Mr&&Or.length&&o.isFinite(Lr)&&Lr>=0&&(Mr=v(Hr,Lr))}function Zr(){Mr&&(_(Mr),Mr=null)}function Hr(){if(Mr=null,Or.length){const[{resolve:t,stream:e,yt:r}]=Or.splice(0,1),o=n.assign({},r,{useWebWorkers:!1,workerURI:dt,createWorker:dt});t(new yr({},e,o,Vr)),Pr()}}function Vr(){Zr(),Pr()}function Gr(t){const{kt:e}=t;e&&(_(e),t.kt=null)}const jr="\0\u263a\u263b\u2665\u2666\u2663\u2660\u2022\u25d8\u25cb\u25d9\u2642\u2640\u266a\u266b\u263c\u25ba\u25c4\u2195\u203c\xb6\xa7\u25ac\u21a8\u2191\u2193\u2192\u2190\u221f\u2194\u25b2\u25bc !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~\u2302\xc7\xfc\xe9\xe2\xe4\xe0\xe5\xe7\xea\xeb\xe8\xef\xee\xec\xc4\xc5\xc9\xe6\xc6\xf4\xf6\xf2\xfb\xf9\xff\xd6\xdc\xa2\xa3\xa5\u20a7\u0192\xe1\xed\xf3\xfa\xf1\xd1\xaa\xba\xbf\u2310\xac\xbd\xbc\xa1\xab\xbb\u2591\u2592\u2593\u2502\u2524\u2561\u2562\u2556\u2555\u2563\u2551\u2557\u255d\u255c\u255b\u2510\u2514\u2534\u252c\u251c\u2500\u253c\u255e\u255f\u255a\u2554\u2569\u2566\u2560\u2550\u256c\u2567\u2568\u2564\u2565\u2559\u2558\u2552\u2553\u256b\u256a\u2518\u250c\u2588\u2584\u258c\u2590\u2580\u03b1\xdf\u0393\u03c0\u03a3\u03c3\xb5\u03c4\u03a6\u0398\u03a9\u03b4\u221e\u03c6\u03b5\u2229\u2261\xb1\u2265\u2264\u2320\u2321\xf7\u2248\xb0\u2219\xb7\u221a\u207f\xb2\u25a0\xa0".split("");function qr(t,e){return Kr(t,e,!0)}function Kr(t,e,n){return e&&"cp437"==e.trim().toLowerCase()?function(t){let e="";for(let n=0;n<t.length;n++)e+=jr[t[n]];return e}(t):new b(e,{ignoreBOM:n}).decode(t)}const Yr="HTTP error ",Xr="HTTP Range not supported",Jr="HTTP resource changed",Qr="Writer iterator completed too soon",$r="Writer not initialized",to="Invalid writer (size must be writable)",eo="Content-Range",no="Range",ro="GET",oo="bytes",io=16777216,so="writable",ao=k();class co{constructor(){this.size=0}init(){this.initialized=!0}}class uo extends co{get readable(){return this.createReadable()}createReadable({offset:t=0,size:e,chunkSize:n=pe(we())}={}){const r=this;let o=0;return n=he(n),new F({async pull(i){const a=e===dt?n:s.min(n,e-o),c=await Ko(r,t+o,a);c.length&&(i.enqueue(c),o+=c.length),(e!==dt&&o>=e||!c.length&&a)&&i.close()}})}}class lo extends co{constructor(){super();const t=this,e=new D({write(e){if(!t.initialized)throw new f($r);return t.writeUint8Array(be(e))}});n.defineProperty(t,so,{get:()=>e})}writeUint8Array(){}}class fo extends uo{constructor(t){super();let e=t.length;for(;"="==t.charAt(e-1);)e--;const r=t.indexOf(",")+1;n.assign(this,{vt:t,_t:r,size:s.floor(.75*(e-r))})}readUint8Array(t,e){const{_t:n,vt:r}=this,o=new w(e),i=4*s.floor(t/3),a=atob(r.substring(i+n,4*s.ceil((t+e)/3)+n)),c=t-3*s.floor(i/4);let u=0;for(let t=c;t<c+e&&t<a.length;t++)o[t-c]=a.charCodeAt(t),u++;return u<o.length?o.subarray(0,u):o}}class wo extends lo{constructor(t){super(),n.assign(this,{contentType:t,data:"data:"+(t||"")+";base64,",Nt:""})}writeUint8Array(t){const e=this;let n,o=e.Nt;const i=e.Nt.length;for(e.Nt="",n=0;n<3*s.floor((i+t.length)/3)-i;n++)o+=r.fromCharCode(t[n]);for(;n<t.length;n++)e.Nt+=r.fromCharCode(t[n]);o.length>2?e.data+=z(o):e.Nt=o+e.Nt}getData(){return this.data+z(this.Nt)}}let po,ho;class mo extends uo{constructor(t){super(),n.assign(this,{Ut:t,size:t.size}),ho||(ho=(async()=>{try{const t=new y([new w(3)]).slice(1,2).stream().getReader();let e=0,n=await t.read();for(;!n.done;)e+=n.value.length,n=await t.read();po=1==e}catch{po=!1}})())}createReadable(t){const{Ut:e,size:n}=this,{offset:r=0,size:o=n-r}=t||{};if(typeof e.stream==pt){if(!r&&o>=n)return Cn(e.stream());if(po)return Cn(e.slice(r,r+o).stream())}return super.createReadable(t)}async readUint8Array(t,e){const n=this,r=t+e,o=!t&&r>=n.size?n.Ut:n.Ut.slice(t,r);let i=await o.arrayBuffer();return i.byteLength>e&&(i=i.slice(t,r)),new w(i)}}class yo extends co{constructor(t){super();const e=this,r=new R;n.defineProperty(e,so,{get:()=>r.writable}),e.contentType=t,e.Ot=In(r.readable,t),e.Ot.catch(()=>{})}getData(){return this.Ot}}class So extends mo{constructor(t){super(new y([t],{type:"text/plain"}))}}function go(t){let e=0;for(let n=0;n<t.length;n++){const r=t.charCodeAt(n);r<128?e+=1:r<2048?e+=2:r<55296||r>=57344?e+=3:r<56320&&56320==(64512&t.charCodeAt(n+1))?(e+=4,n++):e+=3}return e}class bo extends yo{constructor(t){super(),n.assign(this,{encoding:t,Mt:!t||"utf-8"==t.toLowerCase()})}async getData(){const{encoding:t,Mt:e}=this,n=await super.getData();return n.text&&e?n.text():function(t,e){return Kr(t,e,!1)}(new w(await n.arrayBuffer()),t)}}class Eo extends uo{constructor(t,e){super(),zo(this,t,e)}async init(){await Ro(this,Oo,vo),super.init()}createReadable(t){const e=this,{useRangeHeader:n,forceRangeRequests:r,size:i}=e;if((n||r)&&i!==dt){const{offset:n=0,size:r=i-n}=t||{};if(r>0&&n<i)return function(t,e,n){let r,i=e,a=0,c=n;return new F({start:()=>u(),async pull(t){r||await u();const{value:e,done:n}=await r.read();if(n)throw new f(Xr);const o=e.length>a?e.subarray(0,a):e;a-=o.length,c-=o.length,o.length&&t.enqueue(o),a||(await async function(){const t=r;r=dt,await t.cancel()}(),c||t.close())},cancel:t=>r&&r.cancel(t)});async function u(){const e=s.min(t.maximumRangeSize,c),n=await Oo(ro,t,To(t,i,e));if(206!=n.status)throw new f(Xr);const u=n.headers.get(eo);if(u){const t=o(u.trim().split(/[\s-]+/)[1]);if(!o.isNaN(t)&&t!=i)throw new f(Xr)}Io(t,n),Co(t,n),i+=e,a=e,r=n.body.getReader()}}(e,n,s.min(r,i-n))}return super.createReadable(t)}readUint8Array(t,e){return Fo(this,t,e,Oo,vo)}}class xo extends uo{constructor(t,e){super(),zo(this,t,e)}async init(){await Ro(this,Mo,_o),super.init()}readUint8Array(t,e){return Fo(this,t,e,Mo,_o)}}function zo(t,e,r){const{preventHeadRequest:o,useRangeHeader:i,forceRangeRequests:s,combineSizeEocd:a,checkResourceChanges:c=!0,maximumRangeSize:u=io,fetch:l}=r;delete(r=n.assign({},r)).preventHeadRequest,delete r.useRangeHeader,delete r.forceRangeRequests,delete r.combineSizeEocd,delete r.checkResourceChanges,delete r.maximumRangeSize,delete r.useXHR,delete r.fetch,n.assign(t,{url:e,options:r,preventHeadRequest:o,useRangeHeader:i,forceRangeRequests:s,combineSizeEocd:a,checkResourceChanges:c,maximumRangeSize:u,fetch:l})}async function Ro(t,e,n){const{url:r,preventHeadRequest:o,useRangeHeader:i,forceRangeRequests:s,combineSizeEocd:a}=t;if(function(t){const{baseURI:e}=we(),{protocol:n}=new d(t,e);return"http:"==n||"https:"==n}(r)&&(i||s)&&(typeof o==wt||o)){const r=await e(ro,t,To(t,a?-22:void 0)),o=r.headers.get("Accept-Ranges");if(!(s||o&&o.toLowerCase()==oo))throw new f(Xr);{if(a){const e=new w(await r.arrayBuffer());206==r.status&&e.length==K&&(t.Lt=e)}Co(t,r);const o=Do(r);o===dt?await Uo(t,e,n):t.size=o}}else await Uo(t,e,n)}async function Fo(t,e,n,r,i){const{useRangeHeader:s,forceRangeRequests:a,Lt:c,size:u,options:l}=t;if(s||a){if(c&&e==u-K&&n==K)return c;if(e>=u||0===n)return St;{e+n>u&&(n=u-e);const i=await r(ro,t,To(t,e,n));if(206!=i.status)throw new f(Xr);const s=i.headers.get(eo);if(s){const t=o(s.trim().split(/[\s-]+/)[1]);if(!o.isNaN(t)&&t!=e)throw new f(Xr)}Io(t,i),Co(t,i);const a=new w(await i.arrayBuffer());if(a.length!=n)throw new f(Xr);return a}}{const{data:r}=t;return r||await i(t,l),t.data.subarray(e,e+n)}}function Do(t){const e=t.headers.get(eo);if(e){const t=e.trim().split(/\s*\/\s*/)[1];if(t&&"*"!=t){const e=o(t);if(!o.isNaN(e))return e}}}function Ao({headers:t}){return{Bt:t.get("Etag")||dt,lastModified:t.get("Last-Modified")||dt}}function Co(t,e){const{checkResourceChanges:n,Wt:r}=t;n&&!r&&206==e.status&&(t.Wt=Ao(e))}function Io(t,e){const{checkResourceChanges:r,Wt:o,size:i}=t;if(r){const t=Do(e);if(t!==dt&&i!==dt&&t!=i)throw new f(Jr);if(o){const t=Ao(e);if(n.entries(o).some(([e,n])=>n!==dt&&t[e]!==dt&&n!=t[e]))throw new f(Jr)}}}function To(t,e=0,r=1){return n.assign({},ko(t),{[no]:oo+"="+(e<0?e:e+"-"+(e+r-1))})}function ko({options:t}){const{headers:e}=t;if(e)return k.iterator in e?n.fromEntries(e):e}async function vo(t){await No(t,Oo)}async function _o(t){await No(t,Mo)}async function No(t,e){const n=await e(ro,t,ko(t));t.data=new w(await n.arrayBuffer()),t.size=t.data.length}async function Uo(t,e,n){if(t.preventHeadRequest)await n(t,t.options);else{const r=await e("HEAD",t,ko(t)),i=r.headers.get("Content-Length");i&&!r.headers.get("Content-Encoding")?t.size=o(i):await n(t,t.options)}}async function Oo(t,{fetch:e=fetch,options:r,url:o},i){const s=await e(o,n.assign({},r,{method:t,headers:i}));if(s.status>=200&&s.status<=299)return s;throw 416==s.status?new f(Xr):new f(Yr+(s.statusText||s.status))}function Mo(t,{url:e},r){return new S((o,i)=>{const s=new XMLHttpRequest;if(s.addEventListener("load",()=>{if(s.status>=200&&s.status<=299){const t=[];s.getAllResponseHeaders().trim().split(/[\r\n]+/).forEach(e=>{const n=e.trim().split(/\s*:\s*/);n[0]=n[0].trim().replace(/^[a-z]|-[a-z]/g,t=>t.toUpperCase()),t.push(n)}),o({status:s.status,arrayBuffer:()=>s.response,headers:new c(t)})}else i(416==s.status?new f(Xr):new f(Yr+(s.statusText||s.status)))},!1),s.addEventListener("error",t=>i(t.detail?t.detail.error:new f("Network error")),!1),s.open(t,e),r)for(const t of n.entries(r))s.setRequestHeader(t[0],t[1]);s.responseType="arraybuffer",s.send()})}class Lo extends uo{constructor(t,e={}){super(),n.assign(this,{url:t,reader:e.useXHR&&!e.fetch?new xo(t,e):new Eo(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 Bo extends uo{constructor(t){super(),t=new w(t.buffer,t.byteOffset,t.byteLength),n.assign(this,{Pt:t,size:t.length})}readUint8Array(t,e){return this.Pt.slice(t,t+e)}}class Wo extends lo{constructor(t){super(),this.Zt=t||262144}init(t=0){n.assign(this,{offset:0,Pt:new w(t>0?t:this.Zt)}),super.init()}writeUint8Array(t){const e=this,n=e.offset+t.length;if(n>e.Pt.length){let t=e.Pt.length?2*e.Pt.length:e.Zt;for(;t<n;)t*=2;const r=e.Pt;e.Pt=new w(t),e.Pt.set(r)}e.Pt.set(t,e.offset),e.offset+=t.length}getData(){return this.offset===this.Pt.length?this.Pt:this.Pt.slice(0,this.offset)}}class Po extends uo{constructor(t){super(),this.Ht=t}async init(){const t=this;t.Vt=0;const e=t.Ht=await S.all(t.Ht.map(qo));t.Gt=e.map(e=>{const n=t.size;return t.size+=e.size,n}),super.init()}jt(t){const{Gt:e,size:n}=this,r=e[t];return r===dt?n:r}async readUint8Array(t,e){const n=this,{Ht:r}=this;let o,i=0,a=t;for(;r[i]&&a>=r[i].size;)a-=r[i].size,i++;const c=r[i];if(c){const r=c.size;if(a+e<=r)o=await Ko(c,a,e);else{const i=r-a;o=ge(await Ko(c,a,i),await n.readUint8Array(t+i,e-i))}}else o=St;return n.Vt=s.max(i,n.Vt),o}}class Zo extends co{constructor(t,e=4294967295){super();const r=this;let o,i,s;n.assign(r,{diskNumber:0,diskOffset:0,size:0,maxSize:e,availableSize:e});const a=new D({async write(e){if(e===ao)return void(s&&await u());const{availableSize:n}=r;if(s)e.length>=n?(await c(e.subarray(0,n)),await u(),e.length>n&&await this.write(e.subarray(n))):await c(e);else{const{value:n,done:a}=await t.next();if(a&&!n)throw new f(Qr);o=n,o.size=0,o.maxSize&&(r.maxSize=o.maxSize),r.availableSize=r.maxSize,await jo(o),i=n.writable,s=i.getWriter(),await this.write(e)}},async close(){s&&(await s.ready,await l())},async abort(t){s&&await s.abort(t)}});async function c(t){const e=t.length;e&&(await s.ready,await s.write(t),o.size+=e,r.availableSize-=e)}async function u(){await l(),r.diskOffset+=o.size,r.diskNumber++,s=null,r.availableSize=r.maxSize}async function l(){await s.close()}n.defineProperty(r,so,{get:()=>a})}async closeDisk(){const t=this.writable.getWriter();try{await t.ready,await t.write(ao)}finally{t.releaseLock()}}}class Ho{constructor(t){return e.isArray(t)&&(t=new Po(t)),(t instanceof F||typeof t.getReader==pt)&&(t={readable:Cn(t)}),t}}class Vo{constructor(t){t.writable===dt&&typeof t.next==pt&&(t=new Zo(t)),(t instanceof D||typeof t.getWriter==pt)&&(t={writable:Tn(t)});try{t.size=t.size===dt?0:t.size}catch{throw new f(to)}return t}}function Go(t){return Boolean(t&&t.getData)}async function jo(t,e){if(!t.init||t.initialized)return S.resolve();await t.init(e)}async function qo(t){return t=new Ho(t),await jo(t),t.size!==dt&&t.readUint8Array||(t=new mo(await In(t.readable)),await jo(t)),t}function Ko(t,e,n){return t.readUint8Array(e,n)}function Yo(t,e){return t.createReadable?t.createReadable(e):t.readUint8Array?uo.prototype.createReadable.call(t,e):t.readable}function Xo(t,e,n){if(!t.some(t=>t.reason==e)){const r={reason:e};n!==dt&&(r.filename=n),t.push(r)}}const Jo="filename",Qo="rawFilename",$o="comment",ti="rawComment",ei="uncompressedSize",ni="compressedSize",ri="offset",oi="diskNumberStart",ii="lastModDate",si="rawLastModDate",ai="lastAccessDate",ci="rawLastAccessDate",ui="creationDate",li="rawCreationDate",di="internalFileAttributes",fi="externalFileAttributes",wi="msdosAttributesRaw",pi="msdosAttributes",hi="msDosCompatible",mi="zip64",yi="encrypted",Si="version",gi="versionMadeBy",bi="zipCrypto",Ei="directory",xi="executable",zi="compressionMethod",Ri="signature",Fi="extraField",Di="unixMode",Ai="setuid",Ci="setgid",Ii="sticky",Ti=[Jo,Qo,ei,ni,ii,si,$o,ti,ai,ci,ui,li,ri,oi,di,fi,wi,pi,hi,mi,yi,Si,gi,bi,Ei,xi,"symlink",zi,Ri,"crc32",Fi,"extraFieldUnix","extraFieldInfoZip","extraFieldUnixType1","extraFieldPkwareUnix","uid","gid",Di,"unixExternalUpper",Ai,Ci,Ii,"bitFlag","rawBitFlag","filenameLength","extraFieldLength","filenameUTF8","commentUTF8","rawExtraField","extraFieldZip64","extraFieldUnicodePath","extraFieldUnicodeComment","extraFieldAES","extraFieldNTFS","extraFieldExtendedTimestamp","extraFieldUSDZ"];class ki{constructor(t){Ti.forEach(e=>this[e]=t[e])}}const vi=new u([1,J,10,Q,28789,25461,$,tt,et,22613,13]);function _i(t,e,n){return t?e?12:16+4*n:0}const Ni="File format is not recognized",Ui="End of central directory not found",Oi="End of Zip64 central directory locator not found",Mi="Central directory header not found",Li="Local file header not found",Bi="Zip64 extra field not found",Wi="File contains encrypted entry",Pi="Encryption method not supported",Zi="Split zip file",Hi="Overlapping entry found",Vi="Entry data out of bounds",Gi="Ambiguous archive",ji="Encrypted central directory is not supported",qi="Unsafe filename",Ki="Invalid strictness (must be 'strict', 'balanced' or 'tolerant')",Yi="Invalid filenameValidation (must be 'strict', 'balanced' or 'tolerant')",Xi="Invalid maxAppendedDataSize (must be a number greater than or equal to 0)",Ji="64-bit value exceeds Number.MAX_SAFE_INTEGER",Qi="unsorted central directory",$i="unknown version needed to extract",ts="compressed patched data",es="malformed extra field",ns="unknown zip64 extensible data",rs="wrapped entries count",os="appended data",is="prepended data",ss="prepended central directory",as="trailing central directory data",cs="duplicate filename",us="mismatched zip64 end of central directory record",ls="multiple end of central directory records",ds="mismatched local file header (filename)",fs="mismatched local file header (general purpose bit flag)",ws="mismatched local file header (compression method)",ps="mismatched local file header (crc32 or sizes)",hs=/^[a-zA-Z]:/,ms="utf-8",ys="cp437",Ss=[[ei,O],[ni,O],[ri,O],[oi,M]],gs={[M]:{qt:ea,bytes:4},[O]:{qt:na,bytes:8}},bs=i(o.MAX_SAFE_INTEGER);class Es{constructor(t,e={}){n.assign(this,{reader:new Ho(t),options:e,Kt:new c})}async*getEntriesGenerator(t={}){const e=this;let{reader:r}=e;if(await jo(r),r.size!==dt&&r.readUint8Array||(r=new mo(await In(r.readable)),await jo(r)),r.size<K)throw new f(Ni);const o=e.warnings=[],i=Ls(t,e.options),a=i==Lt,c=i!=Wt,l=Ps(Ys(e,t,_t),i),d=function(t,e){if(t===dt)return e;if(!Ms(t))throw new f(Yi);return t}(Ys(e,t,"filenameValidation"),i),w=Ys(e,t,"normalizeFilename"),{Yt:p,Xt:h}=await Zs(r,c,l);if(!p)throw await async function(t){return await Os(t)==W}(r)?new f(Zi):new f(Ui);c&&h>1&&Ks(ls);const m=Ee(p);let y=ea(m,12),S=ea(m,16);const g=p.offset,b=ta(m,20),E=g+K+b,x=r.size-E;x>l&&Ks(os),x>0&&Xo(o,os);let z=ta(m,4);const F=r.Vt||0;let D,A,C,I,T,k=ta(m,6),v=ta(m,10),_=0,N=X;const U=S==O||y==O||v==M||k==M;if(S!=O&&k!=M&&(S+=Us(r,k)),U){const t=p.offset>=Y?await Ko(r,p.offset-Y,Y):St,e=Ee(t);if(t.length==Y&&ea(e,0)==j){S=Us(r,ea(e,4))+na(e,8);let t=await Ko(r,S,X),i=Ee(t);const c=p.offset-Y-X;if((t.length<X||ea(i,0)!=G)&&S!=c&&c>=0){const e=S;S=c,S>e&&(_=S-e),t=await Ko(r,S,X),i=Ee(t)}if(t.length<X||ea(i,0)!=G)throw new f(Oi);if(C=!0,I=na(i,4)>44,I){const t=s.min(na(i,4)-44,r.size-S-X);t>0&&(N+=t,T=function(t){const e={rawExtensibleData:t};if(t.length>=28){const r=Ee(t),o=ta(r,26);n.assign(e,{compressionMethod:ta(r,0),compressedSize:na(r,2),uncompressedSize:na(r,10),encryptionAlgorithm:ta(r,18),bitLength:ta(r,20),flags:ta(r,22),hashAlgorithm:ta(r,24),hashData:t.subarray(28,28+o)})}return e}(await Ko(r,S+X,t)))}z==M?z=ea(i,16):z!=ea(i,16)&&qs(a,o,us),k==M?k=ea(i,20):k!=ea(i,20)&&qs(a,o,us),v==M?v=na(i,32):v!=na(i,32)&&qs(a,o,us),y==O?y=na(i,40):y!=na(i,40)&&qs(a,o,us),S=Us(r,k)+na(i,48)+_}}let B=y;const P=p.offset-(C?N+Y:0);if(S>=r.size&&(_=r.size-S-y-K,S=r.size-y-K),F!=z)throw new f(Zi);if(S<0)throw new f(Ni);let Z=0,V=await Ko(r,S,y),J=Ee(V);if(y){if(V.length<4)throw new f(Ni);const t=P-y;if(S!=t&&k==z){const e=ea(J,Z)==H||Boolean(T&&T.compressedSize)||Fs(J);let n=!e;if(!n&&t>=0&&t+4<=r.size&&(n=ea(Ee(await Ko(r,t,4)),0)==H),n){const n=S;S=t,S>n&&(_+=S-n,D=e),V=await Ko(r,S,y),J=Ee(V)}}}const Q=P-S;if(y!=Q&&Q>=0&&k==z&&(y=Q,V=await Ko(r,S,y),J=Ee(V)),S<0||S>=r.size)throw new f(Ni);e.directoryOffset=S,e.directoryLength=B;const $=Xs(e,t,"decryptCentralDirectory");let tt,et;if($&&v&&V.length>=4&&ea(J,0)!=H&&(I||Fs(J))){const t=function(t,e,n){const r=t&&t.compressedSize?t.compressedSize:e;return r>0&&r<=n?r:n}(T,B,V.length);et=V.subarray(t),V=await $(V.subarray(0,t),T),J=Ee(V),B=V.length,tt=!0}T&&!tt&&(V.length<4||ea(J,0)==H)&&Xo(o,ns),A=S;const nt=Ys(e,t,"filenameEncoding"),ct=Ys(e,t,"commentEncoding"),ut=new u;let lt,ft=-1;const wt=!a&&!C;!v&&wt&&(v=Ds(J,V,Z),v&&Xo(o,rs));for(let i=0;i<v;i++){const a=new Rs(r,e.options);if(Z+q>V.length||ea(J,Z)!=H){if(0==i&&!tt&&(I||Fs(J)))throw new f(ji);throw new f(Mi)}Cs(a,J,Z+6);const c=Boolean(a.bitFlag.languageEncodingFlag),u=Z+q,l=u+a.filenameLength,p=l+a.extraFieldLength,h=ta(J,Z+4),m=!(h>>8),y=h>>8==3,S=V.subarray(u,l),g=ta(J,Z+32),b=p+g,E=V.subarray(p,b),x=c,z=c,F=ea(J,Z+38),D=F&L,C={readOnly:Boolean(1&D),hidden:Boolean(2&D),system:Boolean(4&D),directory:Boolean(16&D),archive:Boolean(32&D)},T=ea(J,Z+42),k=Xs(e,t,"decodeText")||qr,N=x?ms:nt||ys,U=z?ms:ct||ys;let O=k(S,N,Ot);if(O===dt&&(O=qr(S,N)),w){const t=w(O);t!==dt&&(O=t)}if(Ws(O,d)){const t=new f(qi);throw t.filename=O,t}let B=k(E,U,Mt);B===dt&&(B=qr(E,U)),n.assign(a,{index:i,Jt:tt,versionMadeBy:h,msDosCompatible:m,zip64:!1,compressedSize:0,uncompressedSize:0,Qt:g,offset:T,diskNumberStart:ta(J,Z+34),internalFileAttributes:ta(J,Z+36),externalFileAttributes:F,msdosAttributesRaw:D,msdosAttributes:C,rawFilename:S,filenameUTF8:x,commentUTF8:z,rawExtraField:V.subarray(l,p),rawComment:E,filename:O,comment:B}),Is(a,a,J,Z+6)&&Xo(o,es,O),a.offset+=_;const W=Us(r,a.diskNumberStart)+a.offset;A=s.min(W,A),W<ft&&Xo(o,Qi,O),ft=W,(a.version&L)>63&&Xo(o,$i,O),32&~a.rawBitFlag||Xo(o,ts,O),ut.has(a.filename)&&(lt=!0),ut.add(a.filename);const P=a.externalFileAttributes>>16&M;a.unixMode===dt&&16877&P&&(a.unixMode=P);const G=Boolean(a.unixMode&it),j=Boolean(a.unixMode&st),K=Boolean(512&a.unixMode),Y=40960==((a.unixMode===dt?P:a.unixMode)&rt),X=!Y&&(a.unixMode!==dt?!!(73&a.unixMode):y&&!!(73&P)),Q=a.unixMode!==dt&&(a.unixMode&rt)==ot,$=(P&rt)==ot;n.assign(a,{setuid:G,setgid:j,sticky:K,symlink:Y,unixExternalUpper:P,executable:X,directory:Q||$||m&&C.directory||a.filename.endsWith(at),zipCrypto:a.encrypted&&!a.extraFieldAES});const et=new ki(a);if(et.getData=(t,n)=>a.getData(t,et,e.Kt,n),et.arrayBuffer=async t=>{const r=new R,o=In(r.readable).then(t=>t.arrayBuffer());return o.catch(()=>{}),await a.getData(r,et,e.Kt,n.assign({},t,{preventClose:!1})),o},Z=b,i==v-1&&wt){const t=Ds(J,V,Z);t&&(v+=t,Xo(o,rs))}const{onprogress:pt}=t;if(pt)try{await pt(i+1,v,new ki(a))}catch{}yield et}let pt=Z,ht=As(V.subarray(Z))||(tt?As(et):dt);if(!ht&&!tt){const t=S+Z,e=s.min(P-t,65541);e>=6&&(ht=As(await Ko(r,t,e)))}ht&&(e.digitalSignature=ht,pt=Z+6+ht.length),(Z!=B&&pt!=B||!tt&&Z!=y&&pt!=y)&&qs(a,o,as),lt&&qs(a,o,cs);const mt=Ys(e,t,"extractPrependedData"),yt=Ys(e,t,"extractAppendedData"),gt=(a||mt)&&v&&4==A&&await async function(t){const e=await Os(t);return e==W||808471376==e}(r)?4:0;return a&&(_||v&&A>gt)&&Ks(is),(_||v&&A>4)&&Xo(o,is),D&&Xo(o,ss),mt&&(e.prependedData=A>gt?await Ko(r,gt,A-gt):St),e.comment=b?await Ko(r,g+K,b):St,yt&&(e.appendedData=E<r.size?await Ko(r,E,r.size-E):St),!0}async getEntries(t={}){const e=[];for await(const n of this.getEntriesGenerator(t))e.push(n);return e}async close(){const{reader:t}=this;t.readUint8Array||!t.readable||t.readable.locked||await t.readable.cancel()}[gt](){return this.close()}}class xs{constructor(t={}){let r;const{readable:o,writable:i}=new R({start(t){r=t}}),s=new Es(o,t),a=s.getEntriesGenerator(),c=new u;this.readable=new F({async pull(t){const{done:e,value:r}=await a.next();if(e)return t.close();const o=function(t,e){const{readable:n,writable:r}=new R;let o;const i={cancel:async t=>{e.delete(i),await(o?o.cancel(t):n.cancel(t))}};return i.readable=new F({async pull(s){o||(o=n.getReader(),e.add(i),async function(){try{await t.getData(r,{preventClose:!1})}catch(t){try{await r.abort(t)}catch{}}finally{e.delete(i)}}());const{done:a,value:c}=await o.read();a?s.close():s.enqueue(c)},cancel:t=>i.cancel(t)},{highWaterMark:0}),i}(r,c),i={...r,readable:o.readable};delete i.getData,n.defineProperties(i,{localDirectory:{get:()=>r.localDirectory,enumerable:!0},warnings:{get:()=>r.warnings,enumerable:!0}}),t.enqueue(i)},async cancel(t){const n=e.from(c);c.clear(),r.error(t),await S.allSettled(n.map(e=>e.cancel(t))),await S.allSettled([a.return(),s.close()])}}),this.writable=i}}async function zs(t,e={}){if(t=new Ho(t),await jo(t),t.size!==dt&&t.readUint8Array||(t=new mo(await In(t.readable)),await jo(t)),t.size<K)return!1;const n=Ls(e,{}),r=n!=Wt,o=Ps(e[_t],n),{Yt:i,Xt:s}=await Zs(t,r,o);if(!i||n==Lt&&s>1)return!1;const a=ta(Ee(i),20),c=i.offset+K+a;return t.size-c<=o}let Rs=class{constructor(t,e){n.assign(this,{reader:t,options:e})}async getData(t,e,r,o={}){const i=this,a=we(),{reader:c,index:u,offset:l,diskNumberStart:d,extraFieldAES:w,extraFieldZip64:p,compressionMethod:h,bitFlag:m,rawBitFlag:y,crc32:S,rawLastModDate:g,uncompressedSize:b,compressedSize:E}=i,{dataDescriptor:x}=m,z=e.localDirectory={},R=e.warnings=[],F=Us(c,d)+l,A=await Ko(c,F,ct),C=Ee(A);let I=Ys(i,o,bt),T=Ys(i,o,Et);const k=Jt(Ys(i,o,xt)),v=Boolean(k),_=!0===k;if(Xt(I,T),I=I&&I.length&&I,T=T&&T.length&&T,w&&99!=w.originalCompressionMethod)throw new f(Nn);if(A.length<ct||ea(C,0)!=B)throw new f(Li);Cs(z,C,4);const{extraFieldLength:N,filenameLength:U}=z,O=z.dataOffset=F+ct+U+N,M=Ys(i,o,"checkLocalDirectory"),W=Ls(o,i.options),Z=function(t,e){return t===dt?e!=Wt:Boolean(t)}(M,W),H=Ys(i,o,"checkLocalFilename"),V=function(t,e){return t===dt?e==Lt:Boolean(t)}(H===dt?M:H,W);let G=St;if(V&&(U||N)){const t=await Ko(c,F+ct,U+N);G=t.subarray(0,U),z.rawExtraField=t.subarray(U)}else z.rawExtraField=N?await Ko(c,F+ct+U,N):St;V&&(z.rawFilename=G),Is(i,z,C,4,!0)&&Xo(R,es),function(t,e,n,r,o){const{rawFilename:i}=t,s=!o,a=t.Jt&&!(8192&~e.rawBitFlag);!r||a||n.length==i.length&&!n.some((t,e)=>t!=i[e])||qs(s,o,ds),(2057&e.rawBitFlag)!=(2057&t.rawBitFlag)&&qs(s,o,fs),e.compressionMethod!=t.compressionMethod&&qs(s,o,ws),e.bitFlag.dataDescriptor||a||!(e.crc32||e.compressedSize||e.uncompressedSize)||e.crc32==t.crc32&&e.compressedSize==t.compressedSize&&e.uncompressedSize==t.uncompressedSize||qs(s,o,ps)}(i,z,G,V,Z?dt:R);const{lastAccessDate:j,creationDate:q,uid:K,gid:Y}=z;j&&(e.lastAccessDate=j),q&&(e.creationDate=q),K!==dt&&e.uid===dt&&(e.uid=K),Y!==dt&&e.gid===dt&&(e.gid=Y);const X=Ys(i,o,"checkPasswordOnly"),J=i.encrypted&&z.encrypted&&(!_||X),Q=J&&!w;if(_||(e.zipCrypto=Q),J&&!(64&~z.rawBitFlag))throw new f(Pi);const $=v?dt:Ln(h);if(0!=h&&8!=h&&9!=h&&!$&&!v)throw new f(Nn);if(J){if(!Q&&(w.strength<1||w.strength>3))throw new f(Pi);if(!I&&!T)throw new f(Wi)}if(O+E>c.size)throw new f(Vi);const tt=E,et=Cn(c.createReadable({offset:O,size:tt})),nt=Kt(Ys(i,o,zt));Yt(nt);let rt=Ys(i,o,"checkOverlappingEntry");const ot=Ys(i,o,"checkOverlappingEntryOnly");ot&&(rt=!0);const{onstart:it,onprogress:st,onend:at}=o,ut=0!=h&&!v,lt=v?E-_i(J,Q,w&&w.strength):b,ft=9==h;let wt=Ys(i,o,Ft);ft&&(wt=!1);const pt=Ys(i,o,"checkCrc32"),ht=(pt===dt?Ys(i,o,"checkSignature"):pt)&&!v&&(!J||Q||w&&1==w.vendorVersion),mt={options:{codecType:cr,password:I,rawPassword:T,zipCrypto:Q,encryptionStrength:w&&w.strength,checkCrc32:ht,checkAuthenticationCode:Ys(i,o,"checkAuthenticationCode"),passwordVerification:Q&&(x?g>>>8&L:S>>>24&L),outputSize:lt,crc32:S,compressed:ut,encrypted:J,useWebWorkers:Ys(i,o,Rt),useCompressionStream:wt,transferStreams:Ys(i,o,Dt),deflate64:ft,format:$?$.format:dt,codecURI:$?$.codecURI:dt,compressionMethod:h,rawBitFlag:y,checkPasswordOnly:X},config:a,ft:{signal:nt,size:tt,onstart:it,onprogress:st,onend:at}};let yt,gt,Ct;rt&&await async function({reader:t,$t:e,index:n,offset:r,crc32:o,compressedSize:i,uncompressedSize:s,dataOffset:a,dataDescriptor:c,extraFieldZip64:u,Kt:l}){let d=0;if(c&&(d=u?20:12),d){const n=await Ko(t,a+i,d+4),r=Ee(n);let c=n.length==d+4&&ea(r,0)==P;if(c){const t=Ns(r,4,u);(e.encrypted&&!e.zipCrypto||t.crc32==o)&&t.compressedSize==i&&t.uncompressedSize==s?d+=4:c=!1}if(n.length>=d){const t=Ns(r,c?4:0,u);t.signature=c,e.localDirectory.dataDescriptor=t}}const w={start:r,end:a+i+d,$t:e};for(const[t,e]of l)if(t!=n&&w.start<e.end&&e.start<w.end){const t=new f(Hi);throw t.overlappingEntry=e.$t,t}l.set(n,w)}({reader:c,$t:e,index:u,offset:F,crc32:S,compressedSize:E,uncompressedSize:b,dataOffset:O,dataDescriptor:x||z.bitFlag.dataDescriptor,extraFieldZip64:p||z.extraFieldZip64,Kt:r});try{if(!ot){X&&(t=new D),t=new Vo(t),await jo(t,function(t,e,n){return s.min(t,n?1032*e:e)}(lt,E,ut)),({writable:yt}=t);const{outputSize:e}=await Wr({readable:et,writable:yt},mt);if(e!=lt)throw n.assign(new f(Zn),{outputSize:e});t.size+=e}}catch(e){const{outputSize:n}=mt;if(n!==dt?t.size+=n:xe(e)&&e.outputSize!==dt&&(t.size+=e.outputSize),!X||!xe(e)||e.message!=Ze)throw gt=e,Ct=!0,e}finally{if((Go(t)||!Ys(i,o,At))&&yt&&!yt.locked){const t=yt.getWriter();if(Ct)try{await t.abort(gt)}catch{}else await t.close()}}return X||ot?dt:t.getData?t.getData():yt}};function Fs(t){const e=s.min(t.byteLength,1024)-3;for(let n=0;n<e;n++)if(134630224==ea(t,n))return!0;return!1}function Ds(t,e,n){let r=0;for(;n+q<=e.length&&ea(t,n)==H;)n+=q+ta(t,n+28)+ta(t,n+30)+ta(t,n+32),r++;return r%65536?0:r}function As(t){if(t.length>=6){const e=Ee(t);if(ea(e,0)==Z){const n=ta(e,4);if(6+n<=t.length)return t.subarray(6,6+n)}}}function Cs(t,e,r){const o=t.rawBitFlag=ta(e,r+2),i=!(1&~o),s=ea(e,r+6);n.assign(t,{encrypted:i,version:ta(e,r),bitFlag:{level:(6&o)>>1,dataDescriptor:!(8&~o),languageEncodingFlag:(o&nt)==nt},rawLastModDate:s,lastModDate:Js(s),filenameLength:ta(e,r+22),extraFieldLength:ta(e,r+24)})}function Is(t,e,r,o,i){const{rawExtraField:s}=e,u=e.extraField=new c,l=Ee(s);let d=0,w=!1;try{for(;d<s.length;){const t=ta(l,d),e=ta(l,d+2);u.set(t,{type:t,data:s.slice(d+4,d+4+e)}),d+=4+e}}catch{w=!0}d>s.length&&(w=!0);const p=ta(r,o+4);n.assign(e,{signature:ea(r,o+10),crc32:ea(r,o+10),compressedSize:ea(r,o+14),uncompressedSize:ea(r,o+18)});const h=u.get(1);h&&(function(t,e){e.zip64=!0;const n=Ee(t.data),r=Ss.filter(([t,n])=>e[t]==n),o=r.reduce((t,[,e])=>t+gs[e].bytes,0);if(t.data.length<o)throw new f(Bi);for(let o=0,i=0;o<r.length;o++){const[s,a]=r[o],c=gs[a];e[s]=t[s]=c.qt(n,i),i+=c.bytes}}(h,e),e.extraFieldZip64=h);const m=u.get(28789);m&&(Ts(m,Jo,Qo,e,t),e.extraFieldUnicodePath=m);const y=u.get(25461);y&&(Ts(y,$o,ti,e,t),e.extraFieldUnicodeComment=y);const S=u.get(J);S&&S.data.length>=7?(function(t,e,r){const o=Ee(t.data),i=$s(o,4);n.assign(t,{vendorVersion:$s(o,0),vendorId:$s(o,2),strength:i,originalCompressionMethod:r,compressionMethod:ta(o,5)}),e.compressionMethod=t.compressionMethod,1!=t.vendorVersion&&(e.crc32=dt)}(S,e,p),e.extraFieldAES=S):e.compressionMethod=p;const g=u.get(13);g&&(ks(g,e),e.extraFieldPkwareUnix=g);const b=u.get(22613);b&&(ks(b,e),e.extraFieldUnixType1=b);const E=u.get(10);E&&(function(t,e){const r=Ee(t.data);let o,i=4;try{for(;i<t.data.length&&!o;){const e=ta(r,i),n=ta(r,i+2);1==e&&(o=t.data.slice(i+4,i+4+n)),i+=4+n}}catch{}if(o&&24==o.length){const r=Ee(o),i=r.getBigUint64(0,!0),s=r.getBigUint64(8,!0),a=r.getBigUint64(16,!0);n.assign(t,{rawLastModDate:i,rawLastAccessDate:s,rawCreationDate:a});const c={lastModDate:Qs(i),lastAccessDate:Qs(s),creationDate:Qs(a)};n.assign(t,c),n.assign(e,c,{rawLastAccessDate:s,rawCreationDate:a})}}(E,e),e.extraFieldNTFS=E);const x=u.get(et);let z;if(x&&(z=vs(x,e,!1),e.extraFieldUnix=x),!z){const t=u.get(tt);t&&(vs(t,e,!0),e.extraFieldInfoZip=t)}const R=u.get(Q);R&&(function(t,e,n){if(!t.data.length)return;const r=Ee(t.data),o=$s(r,0),i=[],s=[];n?(1&~o||(i.push(ii),s.push(si)),2&~o||(i.push(ai),s.push(ci)),4&~o||(i.push(ui),s.push(li))):t.data.length>=5&&(i.push(ii),s.push(si));let c=1;i.forEach((n,o)=>{if(t.data.length>=c+4){const i=ea(r,c);e[n]=t[n]=new a(1e3*(0|i));const u=s[o];t[u]=i}c+=4})}(R,e,i),e.extraFieldExtendedTimestamp=R);const F=u.get($);return F&&(e.extraFieldUSDZ=F),w}function Ts(t,e,r,o,i){if(t.data.length<5)return void(t.valid=!1);const s=Ee(t.data),a=new ve;a.append(i[r]);const c=Ee(new w(4));c.setUint32(0,a.get(),!0);const u=ea(s,1),l=$s(s,0);n.assign(t,{version:l,[e]:qr(t.data.subarray(5)),valid:1==l&&!i.bitFlag.languageEncodingFlag&&u==ea(c,0)}),t.valid&&(o[e]=t[e],o[e+"UTF8"]=!0)}function ks(t,e){if(t.data.length<8)return;const r=Ee(t.data),o={lastAccessDate:new a(1e3*(0|ea(r,0))),lastModDate:new a(1e3*(0|ea(r,4)))};t.data.length>=12&&(o.uid=ta(r,8),o.gid=ta(r,10)),n.assign(t,o),n.assign(e,o)}function vs(t,e,r){try{const o=Ee(t.data);let i,s;if(r){let e=0;const r=$s(o,e++),a=$s(o,e++);i=_s(t.data.subarray(e,e+a)),e+=a;const c=$s(o,e++);s=_s(t.data.subarray(e,e+c)),n.assign(t,{version:r,uid:i,gid:s})}else t.data.length>=4&&(i=ta(o,0),s=ta(o,2),n.assign(t,{uid:i,gid:s}));return i!==dt&&(e.uid=i),s!==dt&&(e.gid=s),i!==dt||s!==dt}catch{}}function _s(t){const e=new w(4);return e.set(t,0),new m(e.buffer,e.byteOffset,4).getUint32(0,!0)}function Ns(t,e,n){const r=ea(t,e);let o,i;return n?(o=na(t,e+4),i=na(t,e+12)):(o=ea(t,e+4),i=ea(t,e+8)),{crc32:r,compressedSize:o,uncompressedSize:i}}function Us(t,e){return t.jt?t.jt(e):0}async function Os(t){return ea(Ee(await Ko(t,0,4)))}function Ms(t){return t===Lt||t===Bt||t===Wt}function Ls(t,e){return Bs(t,Bs(e,Bt))}function Bs(t,e){const n=t.strictness;if(n!==dt){if(!Ms(n))throw new f(Ki);return n}const r=t.checkAmbiguity;return r===dt?e:r?Lt:e==Wt?Wt:Bt}function Ws(t,e){if(e==Wt)return!1;const n=t.split("/");return n.length>1&&""===n[n.length-1]&&n.pop(),!!(n.includes("..")||t.startsWith("/")||t.startsWith("\\\\")||hs.test(t))||e==Lt&&(n.includes(".")||n.includes(""))}function Ps(t,e){if(t!==dt){const e=te(t);if("number"!=typeof e||o.isNaN(e)||e<0)throw new f(Xi);return e}return e==Lt?0:e==Wt?1/0:M}async function Zs(t,e,n){const{size:r}=t,o=s.min(r,65557),i={count:64};let a,c,u=0;for await(const[n,s,l,d,f]of Hs(t,o)){const o=ta(n,d+20);if(f+K+o==r){const o=await Gs(t,n,s,d,f,r,i);if(2==o){if(a||(a=Vs(l,d,f)),u++,!e||u>1)break}else 1!=o||c||(c=Vs(l,d,f))}}return a||(a=c),a||(a=await async function(t,e,n){const{size:r}=t,o=s.min(r,e==1/0?r:65557+e);let i,a;for await(const[e,s,c,u,l]of Hs(t,o)){const o=Vs(c,u,l);i||(i=o);const d=await Gs(t,e,s,u,l,r,n);if(2==d)return o;1!=d||a||(a=o)}return a||i}(t,n,i)),{Yt:a,Xt:u}}async function*Hs(t,e){const n=t.size-e,r=await Ko(t,n,e),o=Ee(r);for(let t=r.length-K;t>=0;t--)ea(o,t)==V&&(yield[o,n,r,t,n+t])}function Vs(t,e,n){return{offset:n,buffer:t.slice(e,e+K).buffer}}async function Gs(t,e,n,r,o,i,s){const a=ta(e,r+10),c=ea(e,r+12),u=ea(e,r+16);if(a==M||c==O||u==O)return await js(t,e,n,o-Y,i,s)==j?2:0;if(!a&&!c)return 1;const l=ta(e,r+6);for(const r of[o-c,Us(t,l)+u])if(await js(t,e,n,r,i,s)==H)return 2;return 0}async function js(t,e,n,r,o,i){return r<0||r+4>o?dt:r>=n?ea(e,r-n):i.count>0?(i.count--,ea(Ee(await Ko(t,r,4)),0)):dt}function qs(t,e,n){t?Ks(n):Xo(e,n)}function Ks(t){const e=new f(Gi);throw e.reason=t,e}function Ys(t,e,n){return e[n]===dt?t.options[n]:e[n]}function Xs(t,e,n){return qt(Ys(t,e,n))}function Js(t){const e=(4294901760&t)>>16,n=t&M,r=new a(1980+((65024&e)>>9),((480&e)>>5)-1,31&e,(63488&n)>>11,(2016&n)>>5,2*(31&n),0);return r<lt?lt:r}function Qs(t){return new a(o(t/i(1e4)-i(116444736e5)))}function $s(t,e){return t.getUint8(e)}function ta(t,e){return t.getUint16(e,!0)}function ea(t,e){return t.getUint32(e,!0)}function na(t,e){const n=t.getBigUint64(e,!0);if(n>bs)throw new f(Ji);return o(n)}var ra=n.freeze({__proto__:null,ERR_AMBIGUOUS_ARCHIVE:Gi,ERR_BAD_FORMAT:Ni,ERR_CENTRAL_DIRECTORY_NOT_FOUND:Mi,ERR_ENCRYPTED:Wi,ERR_ENCRYPTED_CENTRAL_DIRECTORY:ji,ERR_ENTRY_DATA_OUT_OF_BOUNDS:Vi,ERR_EOCDR_LOCATOR_ZIP64_NOT_FOUND:Oi,ERR_EOCDR_NOT_FOUND:Ui,ERR_EXTRAFIELD_ZIP64_NOT_FOUND:Bi,ERR_INVALID_AUTHENTICATION_CODE:Pe,ERR_INVALID_COMPRESSED_DATA:Hn,ERR_INVALID_CRC32:Vn,ERR_INVALID_FILENAME_VALIDATION:Yi,ERR_INVALID_MAX_APPENDED_DATA_SIZE:Xi,ERR_INVALID_PASSWORD:We,ERR_INVALID_STRICTNESS:Ki,ERR_INVALID_UNCOMPRESSED_SIZE:Zn,ERR_LOCAL_FILE_HEADER_NOT_FOUND:Li,ERR_OVERLAPPING_ENTRY:Hi,ERR_SPLIT_ZIP_FILE:Zi,ERR_UNSAFE_FILENAME:qi,ERR_UNSUPPORTED_COMPRESSION:Nn,ERR_UNSUPPORTED_ENCRYPTION:Pi,ERR_UNSUPPORTED_UINT64:Ji,ERR_WORKER_STARTUP_TIMEOUT:dr,WARNING_APPENDED_DATA:os,WARNING_COMPRESSED_PATCHED_DATA:ts,WARNING_DUPLICATE_FILENAME:cs,WARNING_MALFORMED_EXTRA_FIELD:es,WARNING_MISMATCHED_LOCAL_FILE_HEADER_BIT_FLAG:fs,WARNING_MISMATCHED_LOCAL_FILE_HEADER_COMPRESSION_METHOD:ws,WARNING_MISMATCHED_LOCAL_FILE_HEADER_CRC32_OR_SIZES:ps,WARNING_MISMATCHED_LOCAL_FILE_HEADER_FILENAME:ds,WARNING_MISMATCHED_ZIP64_END_OF_CENTRAL_DIRECTORY:us,WARNING_MULTIPLE_END_OF_CENTRAL_DIRECTORY:ls,WARNING_PREPENDED_CENTRAL_DIRECTORY:ss,WARNING_PREPENDED_DATA:is,WARNING_TRAILING_CENTRAL_DIRECTORY_DATA:as,WARNING_UNKNOWN_VERSION:$i,WARNING_UNKNOWN_ZIP64_EXTENSIBLE_DATA:ns,WARNING_UNSORTED_CENTRAL_DIRECTORY:Qi,WARNING_WRAPPED_ENTRIES_COUNT:rs,ZipReader:Es,ZipReaderStream:xs,isZipFile:zs});const oa="File already exists",ia="Zip file comment exceeds 64KB",sa="Invalid zip file comment (must be a Uint8Array)",aa="File entry comment exceeds 64KB",ca="Invalid file entry comment (must be a string)",ua="Invalid date (must be a valid Date instance)",la="File entry name exceeds 64KB",da="Version exceeds 65535",fa="The strength must equal 1, 2, or 3",wa="Encryption is not supported in USDZ files",pa="Split zip files are not supported in USDZ files",ha="Encryption is not supported when the 'passThrough' option is set to true (use 'compressed' instead)",ma="Invalid extra field (must be a Map)",ya="Invalid extra field type (must be integer 0..65535)",Sa="Invalid extra field data (must be a Uint8Array)",ga="Extra field data exceeds 64KB",ba=-2147483648,Ea=2147483647,xa=i(0),za=i("0x7fffffffffffffff"),Ra="Zip64 is not supported (set the 'zip64' option to 'true')",Fa="Undefined uncompressed size",Da="Undefined compression method",Aa="Undefined CRC32",Ca="Undetermined size",Ia="Undefined reader",Ta="Invalid reader (must be a Reader instance, a ReadableStream instance, or an object with a 'readable' property)",ka="Zip file not empty",va="Invalid uid (must be integer 0..2^32-1)",_a="Invalid gid (must be integer 0..2^32-1)",Na="Invalid UNIX mode (must be integer 0..65535)",Ua="Invalid unixExtraFieldType (must be 'infozip' or 'unix')",Oa="uid/gid must be 0..65535 for unixExtraFieldType 'unix' (use 'infozip' for larger ids)",Ma="Invalid msdosAttributesRaw (must be integer 0..255)",La="Invalid msdosAttributes (must be an object with boolean flags)",Ba="Invalid level (must be integer 0..9)",Wa="Signature data exceeds 64KB",Pa="Invalid entry option (must be an entry returned by ZipReader#getEntries())",Za="The last modification date of an entry encrypted with ZipCrypto cannot be changed when passThrough is set",Ha="compression unavailable",Va="clamped last modification date",Ga=new w([7,0,2,0,65,69,3,0,0]),ja="infozip",qa="unix",Ka=[8,9,5,3];let Ya=0;const Xa=[];class Ja{constructor(t,e={}){t=new Vo(t);const{availableSize:r=ft,maxSize:o=ft}=t,i=r>0&&r!==ft&&o>0&&o!==ft;if(i&&e[vt])throw new f(pa);n.assign(this,{writer:t,te:i,options:e,ee:new c,ne:new u,offset:e[kt]===dt?t.size||t.writable.size||0:e[kt],re:e[kt]===dt?0:e[kt]-(t.size||t.writable.size||0),oe:new u,ie:[],warnings:[],se:0,ae:0,ce:dt,ue:!1})}prependZip(t){return tc(this,async function(t,e){if(t.ne.size)throw new f(ka);await t.le(e)}(this,t))}appendZip(t){return tc(this,this.le(t))}async le(t){const r=this,{oe:o,ne:i,ee:s}=r;for(;o.size;)await S.allSettled(e.from(o));let a;const u=new S(t=>a=t);o.add(u);const l=[];let d;try{t=new Ho(t),await jo(t),t.size!==dt&&t.readUint8Array||(t=new mo(await In(t.readable)),await jo(t));const{ZipReader:o}=await S.resolve().then(function(){return ra}),a=new o(t),u=await a.getEntries();await a.close(),await jo(r.writer);const{directoryOffset:w}=a;u.forEach(({filename:t})=>{if(i.has(t))throw new f(oa);i.add(t),l.push(t)}),r.de=!0;const{fe:p}=r;r.fe=new S(t=>d=()=>{r.de=!1,t()}),await p,r.te&&(delete r.te,await async function(t){return Ee(await Ko(t,0,4)).getUint32(0,!0)==W}(t)||(await Fc(r.writer,zc()),r.offset+=4));const h=await async function(t,n,r,o){const{writer:i}=t,s=new c;if(i.closeDisk){const a=e.from(r).sort((t,e)=>xc(n,t)-xc(n,e));let c=0;for(const e of a){const r=xc(n,e);await bc(t,n,c,r-c),yc(i,await Ec(n,r))&&await i.closeDisk(),s.set(e,{offset:Sc(t,i),diskNumberStart:hc(i)}),c=r}await bc(t,n,c,o-c)}else{const e=t.offset;await bc(t,n,0,o),r.forEach(t=>s.set(t,{offset:e+xc(n,t),diskNumberStart:0}))}return s}(r,t,u,w);u.forEach(t=>{const{version:e,rawLastModDate:r,rawFilename:o,bitFlag:i,encrypted:a,uncompressedSize:c,compressedSize:u,extraFieldZip64:l}=t;let{compressionMethod:d,rawExtraField:f}=t;const{level:w,languageEncodingFlag:p,dataDescriptor:m}=i;f=gc(f||St),t.extraFieldAES&&(d=99);const y=Pc(f),S=Boolean(l)&&l.uncompressedSize!==dt,g=Boolean(l)&&l.compressedSize!==dt,b=-7&Vc(w,p,m,a,d)|w<<1,{we:E,pe:x}=Zc({version:e,bitFlag:b,compressionMethod:d,uncompressedSize:c,compressedSize:u,rawLastModDate:r,rawFilename:o,he:g,me:S,extraFieldLength:y}),{crc32:z}=t;z!==dt&&Lc(x,10,z);const{offset:R,diskNumberStart:F}=h.get(t);n.assign(t,{ye:!0,me:S,he:g,offset:R,diskNumberStart:F,Se:!1,ge:St,be:St,Ee:St,xe:St,ze:St,rawExtraField:f,Re:St,extendedTimestamp:!1,we:E,pe:x}),s.set(t.filename,t)})}catch(t){throw l.forEach(t=>i.delete(t)),t}finally{a(),o.delete(u),d&&d()}}add(t="",e,r={}){const o=this,{oe:s}=o,a=async function(t,e,r,o){const s=(o=n.assign({},o))[Ut];if(s!==dt){const{Fe:e,De:r}=rc(s,Jt(Tc(t,o,xt)),Tc(t,o,ii));delete o[Ut],o=n.assign(e,r,o)}if(Tc(t,o,Ei)&&!e.endsWith(at)&&(e+=at),t.ne.has(e))throw new f(oa);t.ne.add(e),Ya<we().maxWorkers?Ya++:await new S(t=>Xa.push(t));try{return await async function(t,e,r,o){const s=oc(t,e,o);({name:e}=s);const a=ic(t,e,o),{comment:c}=a,u=o[Fi];t.ee.set(e,dt);const l=t.ce,d={};let w,p;a.Ae.keepOrder&&(d.Ce=new S(t=>w=t)),t.ce=d;try{const{Ae:c}=a;0==c.level||c.compressionMethod!==dt||c.Ie||await hr(we())||(c.level=0,Xo(t.warnings,Ha,e));const u=await async function(t,e,{Ae:r},o){if(r.Ie&&!e&&!Tc(t,o,Ei))throw new f(Ia);let i;if(e){if(e=new Ho(e),await jo(e),!e.readable&&!e.readUint8Array)throw new f(Ta);({size:i}=e)}return n.assign({reader:e},ac(t,Boolean(e),i,r,o))}(t,r,a,o);({reader:r}=u);const h=mc(t.writer),m=hc(t.writer);let y=o.crc32===dt?o[Ri]:o.crc32;const g=u.Ae.encrypted&&!c.zipCrypto;if(c.Ie&&!c.Te&&g&&(y=dt),c.Ie&&r&&!g&&y===dt)throw new f(Aa);const b=uc(o=n.assign({},o,s.Ae,a.Ae,u.Ae,{signature:o[Ri],crc32:y,offset:t.offset-h,diskNumberStart:m,[vt]:t.options[vt]}));b.ke&&Xo(t.warnings,Va,e);const E=fc(o),x=Pc(b.ve,E._e);p=await async function(t,e,r,o,s){const{ee:a,writer:c}=t,{keepOrder:u,dataDescriptor:l,Ne:d,signal:w}=s,{Ue:p,$t:h,Oe:m,Me:y}=o,g=t.options[vt];let b,E,x,z,F,D,A,C=h,I=0;const T=u&&m?m.Ce:dt;a.set(e,C);try{s.bufferedWrite||!u||t.de||t.se||t.ae||!l&&!d?(b=!0,t.se++,A=s.createTempStream?await s.createTempStream():new R(dt,dt,{highWaterMark:ft}),A.size=0,await jo(c)):(E=!0,t.ae++,A=c,await T,await k()),await jo(A);const h=mc(c);t.te&&!b&&await Rc(t,c),g&&!b&&lc(o,t.offset-h);const{ve:m}=p;b||await v();const y=hc(c),x=Sc(t,c);if(C.diskNumberStart=y,b||(F=!0,D=c.size,await Fc(A,m)),C=await async function(t,e,{diskNumberStart:r,Ce:o},s,a,c){const{Ue:u,Le:l,Be:d}=s,{we:w,pe:p,lastModDate:h,rawLastModDate:m,encrypted:y,compressed:S,version:g,compressionMethod:b,ge:E,We:x,Ee:z,Pe:R,Ze:F,xe:D,ze:A,be:C}=u,{_e:I}=l,{rawFilename:T,lastAccessDate:k,creationDate:v,password:_,rawPassword:N,level:U,useUnicodeFileNames:M,zip64:B,ye:W,me:P,he:Z,zipCrypto:H,dataDescriptor:V,directory:G,executable:j,versionMadeBy:q,rawComment:K,rawExtraField:Y,Re:X,useWebWorkers:J,transferStreams:Q,onstart:$,onprogress:tt,onend:et,signal:nt,encryptionStrength:rt,extendedTimestamp:ot,msDosCompatible:it,internalFileAttributes:st,externalFileAttributes:at,uid:ct,gid:ut,unixMode:lt,symlink:ft,setuid:wt,setgid:pt,sticky:ht,unixExternalUpper:mt,msdosAttributesRaw:yt,msdosAttributes:St,useCompressionStream:gt,Ie:bt,Te:Et,format:xt,codecURI:zt}=c,Rt={Ce:o,versionMadeBy:q,zip64:B,ye:W,directory:Boolean(G),executable:Boolean(j),filenameUTF8:Boolean(M),rawFilename:T,commentUTF8:Boolean(M),rawComment:K,ge:E,We:x,Ee:z,xe:D,ze:A,be:C,rawExtraField:Y,Re:X,extendedTimestamp:ot,msDosCompatible:it,internalFileAttributes:st,externalFileAttributes:at,diskNumberStart:r,uid:ct,gid:ut,unixMode:lt,symlink:Boolean(ft),setuid:wt,setgid:pt,sticky:ht,unixExternalUpper:mt,msdosAttributesRaw:yt,msdosAttributes:St};let{crc32:Ft,uncompressedSize:Dt}=c,At=0;bt||(Dt=0);const{writable:Ct}=e;if(t){const n=t.size,r=Cn(Yo(t,{size:n})),o={options:{codecType:ar,inputSize:n,level:U,rawPassword:N,password:_,encryptionStrength:rt,zipCrypto:y&&H,passwordVerification:y&&H&&m>>8&L,computeCrc32:!bt,compressed:S&&!bt,encrypted:y&&!Et,useWebWorkers:J,useCompressionStream:gt,transferStreams:Q,format:xt,codecURI:zt,compressionMethod:b},config:a,ft:{signal:nt,size:n,onstart:$,onprogress:tt,onend:et}};try{const t=await Wr({readable:r,writable:Ct},o);if(At=t.outputSize,e.size+=At,bt||(Dt=t.inputSize,y&&!H||(Ft=t.crc32)),!Z&&At>=O||!P&&Dt>=O)throw new f(Ra)}catch(t){const{outputSize:n}=o;throw n!==dt?e.size+=n:xe(t)&&t.outputSize!==dt&&(e.size+=t.outputSize),t}}return function({crc32:t,compressedSize:e,uncompressedSize:n,Ue:r,Le:o},{zip64:s,zipCrypto:a,Ie:c,dataDescriptor:u}){const{pe:l,encrypted:d}=r,{He:f,Ve:w}=o;d&&!a&&!c||t===dt||(Lc(l,10,t),u&&Lc(f,w,t)),s?u&&(Bc(f,w+4,i(e)),Bc(f,w+12,i(n))):(Lc(l,14,e),Lc(l,18,n),u&&(Lc(f,w+4,e),Lc(f,w+8,n)))}({crc32:Ft,compressedSize:At,uncompressedSize:Dt,Ue:u,Le:l},c),V&&await Fc(e,I),n.assign(Rt,{uncompressedSize:Dt,compressedSize:At,lastModDate:h,rawLastModDate:m,creationDate:v,lastAccessDate:k,encrypted:Boolean(y),zipCrypto:Boolean(H),size:d+At,compressionMethod:b,version:g,we:w,pe:p,signature:Ft,crc32:!y||H||bt?Ft:dt,Pe:R,Ze:F,me:P,he:Z}),Rt}(r,A,C,o,we(),s),b||(F=!1),a.set(e,C),C.filename=e,b){if(await S.all([A.writable.getWriter().close(),T]),await k(),t.te&&await Rc(t,c),z=!0,D=c.size,await v(),C.diskNumberStart=hc(c),C.offset=Sc(t,c),g){const e=o.Be;lc(o,t.offset-mc(c)),C.size+=o.Be-e}!function({rawFilename:t,encrypted:e,zip64:n,We:r,crc32:o,compressedSize:s,uncompressedSize:a,me:c,he:u},l,{dataDescriptor:d,Ie:f}){if(d||((!e||f&&o!==dt)&&Lc(l,14,o),u||Lc(l,18,s),c||Lc(l,22,a)),n&&r){const e=ct+Pc(t)+4;Bc(l,e,i(a)),Bc(l,e+8,i(s))}}(C,p.Ge,s),await Fc(c,p.ve),await Dc(A.readable,c,w,t=>I+=t),c.size+=A.size,z=!1}else C.diskNumberStart=y,C.offset=x;return t.offset+=C.size,C}catch(n){if(z||F){if(t.hasCorruptedEntries=!0,n)try{n.corruptedEntry=!0}catch{}t.offset+=c.size-D,b&&(t.offset+=I)}throw a.delete(e),n}finally{if(b&&t.se--,E&&t.ae--,y&&y(T),x&&x(),b&&A&&A.dispose)try{await A.dispose()}catch{}}async function k(){t.de=!0;const{fe:e}=t;t.fe=new S(e=>x=()=>{t.de=!1,e()}),await e}async function v(){yc(c,Pc(p.ve))&&await c.closeDisk()}}(t,e,r,{Ue:b,Le:E,Be:x,$t:d,Oe:l,Me:w},o)}catch(n){throw t.ee.delete(e),n}finally{w&&w(l&&l.Ce)}return n.assign(p,{name:e,comment:c,extraField:u}),new ki(p)}(t,e,r,o)}catch(n){throw t.ne.delete(e),n}finally{const t=Xa.shift();t?t():Ya--}}(o,t,e,r);s.add(a);const c=()=>s.delete(a);return S.prototype.then.call(a,c,c),tc(o,a)}remove(t){const{ne:e,ee:n}=this;if(typeof t==mt&&(t=n.get(t)),t&&t.filename!==dt){const{filename:r}=t;if(e.has(r)&&n.has(r))return e.delete(r),n.delete(r),!0}return!1}async close(t=St,n={}){const r=this,{oe:o,writer:s}=this,{writable:a}=s;if(r.ue)return $a(s);if(!(t instanceof w))throw new f(sa);if(Pc(t)>M)throw new f(ia);for(;o.size;)await S.allSettled(e.from(o));await S.allSettled(r.ie.map(t=>t.je));const c=r.ie.filter(t=>t.qe&&!t.Ke);if(c.length){const t=c.map(t=>t.error);c.forEach(t=>t.Ke=!0);const[e]=t;try{e.entryErrors=t}catch{}throw e}return await async function(t,n,r){const{Ye:o,Xe:s}=wc(t.ee),{Je:a,Qe:c,$e:u}=await async function(t,n,r){const{ee:o,writer:i}=t,s=new w(n);await jo(i);let a=0,c=0,u=hc(i),l=mc(i),d=0;for(const[t,n]of e.from(o.values()).entries()){const{offset:e,rawFilename:f,ge:w,be:p,Ee:h,xe:m,ze:y,rawExtraField:S,Re:g,rawComment:b,versionMadeBy:E,we:x,pe:z,me:R,he:F,Se:D,tn:A,internalFileAttributes:C,externalFileAttributes:I,diskNumberStart:T,uncompressedSize:k,compressedSize:v}=n,_=Pc(w,p,h,m,y,S,g),N=q+Pc(f,b)+_;yc(i,a+N-c)&&(await Fc(i,s.slice(c,a)),c=a,d=0,await i.closeDisk()),0==t&&(u=hc(i),l=mc(i)),R||Lc(z,18,k),F||Lc(z,14,v),(A||D)&&n.version<45&&Mc(z,0,45);const U=pc(N);if(U.en(H),U.nn(E),U.rn(x.subarray(0,24)),U.nn(_),U.nn(Pc(b)),U.nn(D?M:T),U.nn(C),U.en(I),U.en(A?O:e),U.rn(f),U.rn(w),U.rn(p),U.rn(h),U.rn(m),U.rn(y),U.rn(S),U.rn(g),U.rn(b),Wc(s,U.Pt,a),a+=N,d++,r.onprogress)try{await r.onprogress(t+1,o.size,new ki(n))}catch{}}return await Fc(i,c?s.slice(c):s),{Je:{diskNumber:u,diskOffset:l},Qe:{diskNumber:hc(i),sn:d},$e:s}}(t,o,r),l=await async function(t,e,n){const r=vc(t,n,Nt);if(r){const n=await r(e),o=Pc(n);if(o>M)throw new f(Wa);const i=pc(6+o);i.en(Z),i.nn(o),i.rn(n);const{writer:s}=t;return yc(s,Pc(i.Pt))&&await s.closeDisk(),await Fc(s,i.Pt),6+o}return 0}(t,u,r);await async function(t,e,n,r){const{writer:o}=t,{Je:s,Qe:a,an:c,Xe:u}=r;let{Ye:l}=r,d=t.ee.size,w=s.diskNumber,p=Sc(t,s);const h=Pc(e);if(h>M)throw new f(ia);let m=Tc(t,n,mi),y=hc(o);if(yc(o,(m?98:K)+h)&&y++,p>=O||l>=O||d>=M||y>=M){if(!1===m)throw new f(Ra);m=!0}else m===dt&&u&&(m=!0);const S=pc(m?98:K);yc(o,Pc(S.Pt)+h)&&await o.closeDisk(),y=hc(o);let g=y==a.diskNumber?a.sn:0;m&&(S.en(G),S.cn(44),S.nn(45),S.nn(45),S.en(y),S.en(w),S.cn(g),S.cn(d),S.cn(l),S.cn(p),S.en(j),S.en(y),S.cn(i(Sc(t,o))+i(l)+i(c)),S.en(y+1),Tc(t,n,"supportZip64SplitFile",!0)&&(y=M,w=M),g=M,d=M,p=O,l=O),S.en(V),S.nn(y),S.nn(w),S.nn(g),S.nn(d),S.en(l),S.en(p),S.nn(h),await Fc(o,S.Pt),h&&await Fc(o,e)}(t,n,r,{Je:a,Qe:c,Ye:o,an:l,Xe:s})}(r,t,n),r.ue=!0,!Go(s)&&Tc(r,n,At)||await a.getWriter().close(),$a(s)}[gt](){return this.close()}}class Qa extends S{then(t,e){const{un:n}=this;return n&&(n.Ke=!0),super.then(t,e)}}function $a(t){return t.getData?t.getData():t.writable}function tc(t,e){const r=new Qa((t,n)=>S.prototype.then.call(e,t,n)),o={};return r.un=o,o.je=S.prototype.then.call(r,dt,t=>n.assign(o,{qe:!0,error:t})),t.ie.push(o),r}async function ec(t,e){try{await t.writer.writable.abort(e)}catch{}}function nc(t,e,n){t.oe.add(e),e.catch(t=>{try{n(t)}catch{}})}function rc(t,r,o){if(null===t||typeof t!=ht||e.isArray(t))throw new f(Pa);const{externalFileAttributes:i,versionMadeBy:u,comment:l,lastModDate:d,rawLastModDate:w,creationDate:p,lastAccessDate:h,uncompressedSize:m,encrypted:y,zipCrypto:S,crc32:g,compressionMethod:b,extraFieldAES:E,extraFieldUnix:x,internalFileAttributes:z,extraField:R,bitFlag:F,directory:D,uid:A,gid:C}=t,I={externalFileAttributes:i,versionMadeBy:u,comment:l,lastModDate:d,creationDate:p,lastAccessDate:h,internalFileAttributes:z,directory:D};F&&F.languageEncodingFlag&&(I[It]=!0);const T=function(t){if(t){const e=new c;if(t.forEach((t,n)=>{vi.has(n)||e.set(n,t.data)}),e.size)return e}}(R);T&&(I[Fi]=T),A===dt&&C===dt||n.assign(I,{uid:A,gid:C,unixExtraFieldType:x?qa:ja});const k={};if(r&&!D)if(n.assign(k,{uncompressedSize:m,crc32:g,compressionMethod:b}),r!==Pt&&n.assign(k,{encrypted:y,zipCrypto:S,encryptionStrength:E?E.strength:dt}),F&&(k.dataDescriptor=F.dataDescriptor,k[Ct]=Ka[F.level]),o===dt)k.rawLastModDate=w;else if(r!==Pt&&S&&(!F||F.dataDescriptor)&&o instanceof a&&function(t){let e=new a(2e3*s.ceil(s.floor(t.getTime()/1e3)/2));return e<lt?e=lt:e>ut&&(e=ut),(e.getHours()<<3|e.getMinutes()>>3)&L}(o)!=(w>>>8&L))throw new f(Za);return{Fe:I,De:k}}function oc(t,n,r){let o=Tc(t,r,hi),i=Tc(t,r,gi,o?20:768);const s=Tc(t,r,xi),a=_c(t,r,"uid"),c=_c(t,r,"gid");let u=_c(t,r,Di),l=Tc(t,r,"unixExtraFieldType"),d=Tc(t,r,Ai),w=Tc(t,r,Ci),p=Tc(t,r,Ii);if($t(a,O,va),$t(c,O,_a),$t(u,M,Na),l!==dt&&l!==ja&&l!==qa)throw new f(Ua);if(l===qa&&(a!==dt&&a>M||c!==dt&&c>M))throw new f(Oa);l!==dt||a===dt&&c===dt||(l=ja);let h=_c(t,r,wi),m=Tc(t,r,pi);const y=h!==dt||m!==dt;if(a!==dt||c!==dt||u!==dt||l||s?(o=!1,i=i&L|768):y&&(o=!0,i&=L),$t(h,L,Ma),m&&(typeof m!==ht||e.isArray(m)))throw new f(La);if(i>M)throw new f(da);let S=Tc(t,r,fi);const g=S!==dt;g||(S=0),!r[Ei]&&n.endsWith(at)&&(r[Ei]=!0);const b=Tc(t,r,Ei);if(b?(n.endsWith(at)||(n+=at),g||(S=16,o||(S|=16877<<16))):o||g||(S=s?493<<16:27525120),!o){const t=u!==dt||Boolean(d||w||p);u=u===dt?S>>16&M:u&M,d?u|=it:d=Boolean(u&it),w?u|=st:w=Boolean(u&st),p?u|=512:p=Boolean(512&u),g&&!t||(b?u=-61441&u|ot:u&rt||(u|=32768),S=(u&M)<<16|S&M)}({msdosAttributesRaw:h,msdosAttributes:m}=function(t,e){if(t!==dt)t&=L;else if(e!==dt){const{readOnly:n,hidden:r,system:o,directory:i,archive:s}=e;let a=0;n&&(a|=1),r&&(a|=2),o&&(a|=4),i&&(a|=16),s&&(a|=32),t=a&L}return e===dt&&(e={readOnly:Boolean(1&t),hidden:Boolean(2&t),system:Boolean(4&t),directory:Boolean(16&t),archive:Boolean(32&t)}),{msdosAttributesRaw:t,msdosAttributes:e}}(h,m)),y&&(S=S&O|h&L);const E=S>>16&M,x=u!==dt&&40960==(u&rt);return{name:n,Ae:{versionMadeBy:i,msDosCompatible:Boolean(o),externalFileAttributes:S,unixExternalUpper:E,uid:a,gid:c,unixMode:u,unixExtraFieldType:l,symlink:x,setuid:d,setgid:w,sticky:p,msdosAttributesRaw:h,msdosAttributes:m}}}function ic(t,e,n){const r=vc(t,n,"encodeText")||Ne;let i=r(e,Ot);if(i===dt&&(i=Ne(e)),Pc(i)>M)throw new f(la);const s=n[$o]||"";if(typeof s!=mt)throw new f(ca);let c=r(s,Mt);if(c===dt&&(c=Ne(s)),Pc(c)>M)throw new f(aa);const u=Tc(t,n,Si);if(u!==dt&&u>M)throw new f(da);const l=kc(t,n,ii,new a),d=Tc(t,n,si),w=kc(t,n,ai),p=kc(t,n,ui),h=Tc(t,n,di,0),m=Jt(Tc(t,n,xt)),y=Boolean(m),S=!0===m,g=Tc(t,n,bt),b=Tc(t,n,Et);Xt(g,b);const E=_c(t,n,"encryptionStrength",3),x=Tc(t,n,bi),z=Tc(t,n,"extendedTimestamp",!0),R=Tc(t,n,"ntfsTimestamp"),F=Tc(t,n,"keepOrder",!0),D=Tc(t,n,Rt),A=Tc(t,n,Dt),C=Tc(t,n,"bufferedWrite"),I=vc(t,n,"createTempStream"),T=Tc(t,n,"dataDescriptorSignature",!0),k=Kt(Tc(t,n,zt));Yt(k);const v=Tc(t,n,It,!Hc(i)||!Hc(c)),_=Tc(t,n,zi),N=y||_===dt?dt:Ln(_);if(!y&&_!==dt&&0!==_&&8!==_&&!N)throw new f(Nn);let U=_c(t,n,Ct);if($t(U,9,Ba),t.options[vt]){if(g!==dt||b!==dt)throw new f(wa);U===dt&&_===dt&&(U=0)}y&&(U=te(n[Ct]));let O=Tc(t,n,Ft),L=Tc(t,n,Tt);C&&L===dt&&(L=!1),(L===dt||x&&!S)&&(L=!0),U!==dt&&6!=U&&(O=!1);const B=Tc(t,n,mi);if(!(x||g===dt&&b===dt||o.isInteger(E)&&E>=1&&E<=3))throw new f(fa);const W=sc(n[Fi]),P=sc(n.localExtraField),Z=sc(n.centralExtraField);return{comment:s,Ae:{rawFilename:i,rawComment:c,version:u,lastModDate:l,rawLastModDate:d,lastAccessDate:w,creationDate:p,internalFileAttributes:h,Ie:y,Te:S,password:g,rawPassword:b,encryptionStrength:E,zipCrypto:x,extendedTimestamp:z,ntfsTimestamp:R,keepOrder:F,useWebWorkers:D,transferStreams:A,bufferedWrite:C,createTempStream:I,dataDescriptorSignature:T,signal:k,useUnicodeFileNames:v,compressionMethod:_,format:N?N.format:dt,codecURI:N?N.codecURI:dt,ln:N?N.versionNeeded:dt,level:U,useCompressionStream:O,dataDescriptor:L,zip64:B,rawExtraField:W,dn:P,Re:Z}}}function sc(t){if(!t)return St;if(!(t instanceof c))throw new f(ma);let e=0,n=0;t.forEach((t,n)=>{if(Qt(n,M,ya),!(t instanceof w))throw new f(Sa);if(Pc(t)>M)throw new f(ga);e+=4+Pc(t)});const r=new w(e),o=Ee(r);return t.forEach((t,e)=>{Mc(o,n,e),Mc(o,n+2,Pc(t)),Wc(r,t,n+4),n+=4+Pc(t)}),r}function ac(t,e,n,r,o){const{Ie:i,Te:s,zipCrypto:a,password:c,rawPassword:u,encryptionStrength:l}=r;let{dataDescriptor:d,zip64:w,level:p,compressionMethod:h}=r,m=0,y=0,S=!1;if(i&&e){if(y=o[ei],y===dt)throw new f(Fa);if(h===dt)throw new f(Da)}const g=!0===w,b=Tc(t,o,yi);if(e&&s&&!b&&Pc(c,u))throw new f(ha);const E=e&&(Boolean(c&&Pc(c)||u&&Pc(u))||s&&b);e||(p=0,h=0);const x=_i(E,a,l);e&&(i?(o.uncompressedSize=y,m=n===dt?Nc(y)+x:n+(s?0:x)):n===dt?(d=!0,(w||w===dt)&&(w=S=!0,m=4294967296)):(o.uncompressedSize=y=n,m=(Uc(h,p)?Nc(y):y)+x));const z=!(E||e&&(0!==n||i)||Uc(h,p));z&&!a&&Tc(t,o,Tt)===dt&&(d=!1);const R=g||S||y>=O,F=g||m>=O;if(R||F){if(!1===w)throw new f(Ra);w=!0}return w=w||!1,{fn:m,Ae:{dataDescriptor:d,Ne:z,zip64:w,ye:g,wn:S,me:R,he:F,uncompressedSize:y,level:p,compressionMethod:h,encrypted:E}}}function cc(t,e,n){const r=t.slice().sort((t,e)=>n?e-t:t-e);let o=e,i=0;for(const t of r){if(o>=O)break;o+=t,i++}return i}function uc(t){const{rawFilename:e,lastModDate:n,rawLastModDate:r,lastAccessDate:o,creationDate:i,level:c,zip64:u,zipCrypto:l,useUnicodeFileNames:d,dataDescriptor:w,directory:p,rawExtraField:h,dn:m,encryptionStrength:y,extendedTimestamp:S,ntfsTimestamp:g,Ie:b,encrypted:E,me:x,he:z,uncompressedSize:R,wn:F,crc32:D}=t;let{version:A,compressionMethod:C}=t;const I=!p&&Uc(C,c);let T;const k=b||!I,v=u&&(t.bufferedWrite||!w||!x&&!z||k&&!F),_=v||u&&w&&(x||z);if(u&&(x||z)){const t=20,e=pc(t);if(e.nn(1),e.nn(t-4),T=e.Pt,v&&(e.cn(R),k)){const t=_i(E,l,y);e.cn(b?0:R+t)}}else T=St;let N,U,O,L,W;if(E&&!l){const t=pc(Pc(Ga)+2);t.nn(J),t.rn(Ga),N=t.Pt,N[8]=y}else N=St;if(S){const t=Cc(n),e=(P=t)>=ba&&P<=Ea;if(e){const e=9+(o?4:0)+(i?4:0),n=pc(e);L=1+(o?2:0)+(i?4:0),W=t,n.nn(Q),n.nn(e-4),n.pn(L),n.en(t),o&&n.en(Ic(Cc(o))),i&&n.en(Ic(Cc(i))),O=n.Pt}else O=St;if(g===dt?!e||Boolean(o||i):g)try{const t=Ac(n),e=pc(36);e.nn(10),e.nn(32),e.hn(4),e.nn(1),e.nn(24),e.cn(t),e.cn(o?Ac(o):t),e.cn(i?Ac(i):t),U=e.Pt}catch{U=St}else U=St}else U=O=St;var P;let Z;try{const{uid:e,gid:n,unixExtraFieldType:r}=t;if(r!=ja||e===dt&&n===dt)if(r!=qa||e===dt&&n===dt)Z=St;else{const t=pc(8);t.nn(et),t.nn(4),t.nn((e===dt?0:e)&M),t.nn((n===dt?0:n)&M),Z=t.Pt}else{const t=dc(e===dt?0:e),r=dc(n===dt?0:n),o=3+t.length+r.length,i=pc(4+o);i.nn(tt),i.nn(o),i.pn(1),i.pn(t.length),i.rn(t),i.pn(r.length),i.rn(r),Z=i.Pt}}catch{Z=St}C===dt&&(C=I?8:0),A===dt&&(A=0!=C||p||E?20:10);const{ln:H}=t;I&&H!==dt&&(A=A>H?A:H),u&&(A=A>45?A:45),E&&!l&&(A=A>51?A:51,b&&D!==dt&&(N[4]=1),Mc(Ee(N),9,C),C=99);const V=_?Pc(T):0,G=V+Pc(N,O,U,Z,h,m);if(G+(t[vt]?67:0)>M)throw new f(ga);const j=new a(2e3*s.ceil(s.floor(n.getTime()/1e3)/2)),q=j<lt?lt:j>ut?ut:j,K=Pc(O)?new a(1e3*Cc(n)):Pc(U)?n:q,{we:Y,pe:X,rawLastModDate:$}=Zc({version:A,bitFlag:Vc(c,d,w,E,C),compressionMethod:C,uncompressedSize:R,lastModDate:q,rawLastModDate:r,rawFilename:e,he:z,me:x,extraFieldLength:G}),nt=pc(ct+Pc(e)+G),rt=nt.Pt,ot=Ee(rt);return nt.en(B),nt.rn(Y),nt.rn(e),_&&nt.rn(T),nt.rn(N),nt.rn(O),nt.rn(U),nt.rn(Z),nt.rn(h),nt.rn(m),w&&(z||Lc(ot,18,0),x||Lc(ot,22,0)),{ve:rt,Ge:ot,we:Y,pe:X,lastModDate:K,ke:K===q&&j.getTime()!=q.getTime(),rawLastModDate:$,encrypted:E,compressed:I,version:A,compressionMethod:C,Pe:L,Ze:W,ge:St,We:V,Ee:O,xe:U,ze:Z,be:N,extraFieldLength:G}}function lc(t,e){const{Ue:n}=t;let{ve:r,extraFieldLength:o}=n,i=64-(e+Pc(r))%64;i<4&&(i+=64);const s=new w(i),a=Ee(s);Mc(a,0,$),Mc(a,2,i-4);const c=r;n.ve=r=new w(Pc(c)+i),Wc(r,c),Wc(r,s,Pc(c));const u=Ee(r);Mc(u,28,o+i),n.Ge=u,t.Be+=i}function dc(t){const e=new w(4);Ee(e).setUint32(0,t,!0);let n=4;for(;n>1&&0===e[n-1];)n--;return e.subarray(0,n)}function fc({zip64:t,dataDescriptor:e,dataDescriptorSignature:n}){let r,o=St,i=0,s=t?20:12;return n&&(s+=4),e&&(o=new w(s),r=Ee(o),n&&(i=4,Lc(r,0,P))),{_e:o,He:r,Ve:i}}function wc(t){let e=0,n=!1;for(const[,r]of t){const{rawFilename:t,be:o,rawComment:i,xe:s,ze:a,rawExtraField:c,Re:u,Pe:l,Ze:d,ye:w,uncompressedSize:p,compressedSize:h}=r;let{me:m,he:y}=r;w||(m&&p<O&&(m=r.me=!1),y&&h<O&&(y=r.he=!1)),n=n||m||y;const S=r.offset>=O,g=r.diskNumberStart>=M;let b,E;if(S||g||m||y){const t=4+(m?8:0)+(y?8:0)+(S?8:0)+(g?4:0),e=pc(t);e.nn(1),e.nn(t-4),m&&e.cn(p),y&&e.cn(h),S&&e.cn(r.offset),g&&e.en(r.diskNumberStart),b=e.Pt}else b=St;if(r.ge=b,r.tn=S,r.Se=g,d===dt)E=St;else{const t=pc(9);t.nn(Q),t.nn(5),t.pn(l),t.en(d),E=t.Pt}r.Ee=E;const x=Pc(b,o,s,a,E,c,u);if(x>M)throw new f(ga);e+=q+Pc(t,i)+x}return{Ye:e,Xe:n}}function pc(t){const e=new w(t),n=Ee(e);let r=0;return{Pt:e,pn:t=>{!function(t,e,n){t.setUint8(e,n)}(n,r,t),r+=1},nn:t=>{Mc(n,r,t),r+=2},en:t=>{Lc(n,r,t),r+=4},cn:t=>{Bc(n,r,i(t)),r+=8},rn:t=>{Wc(e,t,r),r+=Pc(t)},hn:t=>r+=t}}function hc(t){const{diskNumber:e=0}=t;return e}function mc(t){const{diskOffset:e=0}=t;return e}function yc(t,e){const{availableSize:n=ft}=t;return e>n}function Sc(t,{diskNumber:e=0,diskOffset:n=0}){return t.offset-n-(e?t.re:0)}function gc(t){const e=Ee(t);let n=0;for(;n+4<=Pc(t);){const r=4+Oc(e,n+2);if(1==Oc(e,n))return gc(ge(t.subarray(0,n),t.subarray(s.min(n+r,Pc(t)))));n+=r}return t}async function bc(t,e,n,r){if(r>0){const{writer:o}=t;let i=0;try{await Dc(Yo(e,{offset:n,size:r}),o,dt,t=>i+=t)}catch(e){t.hasCorruptedEntries=!0;try{e.corruptedEntry=!0}catch{}throw e}finally{o.size+=i,t.offset+=i}}}async function Ec(t,e){const n=await Ko(t,e,ct);if(Pc(n)<ct)return ct;const r=Ee(n);return ct+Oc(r,26)+Oc(r,28)}function xc(t,{offset:e,diskNumberStart:n}){return e+(t.jt?t.jt(n):0)}function zc(){const t=new w(4);return Lc(Ee(t),0,W),t}async function Rc(t,e){delete t.te,await Fc(e,zc()),t.offset+=4}async function Fc(t,e){const{writable:n}=t,r=n.getWriter();try{await r.ready,t.size+=Pc(e),await r.write(e)}finally{r.releaseLock()}}async function Dc(t,e,n,r){const o=e.writable.getWriter();try{await t.pipeTo(new D({async write(t){await o.ready,await o.write(t),r(Pc(t))}}),{preventClose:!0,preventAbort:!0,signal:n})}finally{o.releaseLock()}}function Ac(t){if(t){const e=(i(t.getTime())+i(116444736e5))*i(1e4);return e<xa?xa:e>za?za:e}}function Cc(t){return s.floor(t.getTime()/1e3)}function Ic(t){return s.min(Ea,s.max(ba,t))}function Tc(t,e,n,r){const o=e[n]===dt?t.options[n]:e[n];return o===dt?r:o}function kc(t,e,n,r){const i=Tc(t,e,n,r);if(null===i)return r;if(i!==dt&&(typeof i.getTime!=pt||o.isNaN(i.getTime())))throw new f(ua);return i}function vc(t,e,n){return qt(Tc(t,e,n))}function _c(t,e,n,r){return te(Tc(t,e,n,r))}function Nc(t){return t+5*(s.floor(t/16383)+1)}function Uc(t,e){return t===dt?e===dt||e>0:0!==t}function Oc(t,e){return t.getUint16(e,!0)}function Mc(t,e,n){t.setUint16(e,n,!0)}function Lc(t,e,n){t.setUint32(e,n,!0)}function Bc(t,e,n){t.setBigUint64(e,n,!0)}function Wc(t,e,n){t.set(e,n)}function Pc(...t){let e=0;return t.forEach(t=>t&&(e+=t.length)),e}function Zc({version:t,bitFlag:e,compressionMethod:n,uncompressedSize:r,compressedSize:o,lastModDate:i,rawLastModDate:s,rawFilename:a,he:c,me:u,extraFieldLength:l}){const d=pc(26),f=d.Pt,w=Ee(f);if(d.nn(t),d.nn(e),d.nn(n),s===dt){const t=new h(1),e=Ee(t);Mc(e,0,(i.getHours()<<6|i.getMinutes())<<5|i.getSeconds()/2),Mc(e,2,(i.getFullYear()-1980<<4|i.getMonth()+1)<<5|i.getDate()),s=t[0]}return d.en(s),d.hn(4),c||o!==dt?d.en(c?O:o):d.hn(4),u||r!==dt?d.en(u?O:r):d.hn(4),d.nn(Pc(a)),d.nn(l),{we:f,pe:w,rawLastModDate:s}}function Hc(t){return t.every(t=>t>=32&&t<=126)}function Vc(t,e,n,r,o){let i=0;return e&&(i|=nt),n&&(i|=8),8!=o&&9!=o||(t>=0&&t<=3&&(i|=6),t>3&&t<=5&&(i|=4),9==t&&(i|=2)),r&&(i|=1),i}function Gc(t,e){if(!t)return!1;const{yn:n}=t;return n?n.includes(e):$n(t,e)}const jc=1048576,qc=".zip.js-temp",Kc=1048576,Yc=1048576,Xc=".zip.js-temp",Jc="createSyncAccessHandle is only available in dedicated workers";try{!function(t){const e=me(Se(t));n.assign(ie,e),n.assign(fe,e)}({baseURI:void 0===E&&"undefined"==typeof location?require("url").pathToFileURL(__filename).href:void 0===E?location.href:U&&"SCRIPT"===U.tagName.toUpperCase()&&U.src||new d("zip-fs-core.min.js",E.baseURI).href})}catch{}const Qc="Entry filename already exists",$c="Duplicate entry filename in the imported zip file",tu='Invalid duplicates option (must be "throw", "keep-first" or "keep-last")',eu="Entry is an ancestor of target entry",nu="Root directory cannot be moved",ru="Target entry is not a directory",ou="Parent entry is not a directory",iu="Readable stream already consumed",su="throw",au="keep-first",cu="keep-last",uu=new u([su,au,cu]),lu="Invalid passThrough option (use readerOptions.passThrough or set uncompressedSize for each entry)",du="Invalid readerOptions (must be an object)",fu="The 'compressed' passThrough option is only supported by Entry#getData() and ZipWriter#add()",wu="zipjs-abort-export";class pu{constructor(t,e,r,o){const i=this;if(t.root&&o&&o.getChildByName(e))throw new f(Qc);r||(r={}),n.assign(i,{fs:t,name:e,data:r.data,options:r.options&&n.assign({},r.options),id:t.Sn++,parent:o,children:[],uncompressedSize:r.uncompressedSize||0,gn:r.gn||r.uncompressedSize===dt,passThrough:r.passThrough,bn:r.bn||new a}),!o&&t.root||(t.entries[i.id]=i),o&&i.parent.children.push(i)}getFullname(){return this.getRelativeName()}getRelativeName(t=this.fs.root){let e=this.name,n=this.parent;for(;n&&n!=t;)e=(n.name?n.name+"/":"")+e,n=n.parent;return e}isDescendantOf(t){let e=this.parent;for(;e&&e.id!=t.id;)e=e.parent;return Boolean(e)}rename(t){const e=this;let n=e.parent;if(n){const r=Zu(t);r&&(t=r.pop(),n=Hu(n,r,e));const o=n.getChildByName(t);if(o&&o!=e)throw new f(Qc);n!=e.parent&&(Du(e),e.parent=n,n.children.push(e),Wu(e.fs,e))}e.name=t}setOptions(t){const e=n.assign({},this.options,t);this.options=n.fromEntries(n.entries(e).filter(([,t])=>t!==dt))}}class hu extends pu{constructor(t,e,n,r){super(t,e,n,r);const o=this;o.Reader=n.Reader,o.Writer=n.Writer,n.getData&&(o.getData=n.getData)}clone(){return new hu(this.fs,this.name,this)}async getData(t,e={}){const n=this;if(!t||t.constructor==n.Writer&&n.data&&function(t,e){const{contentType:n}=t;return n===dt||(t.constructor==yo?e.type==n:t.constructor!=wo||e.startsWith("data:"+(n||"")+";base64,"))}(t,n.data))return n.data;{const r=n.reader=Ru(n.Reader,n.data,e),o=n.uncompressedSize||r.size;await S.all([jo(r),jo(t,o)]);const i=Kt(e.signal),s=function(t,e,n,r){const{onstart:o,onprogress:i,onend:s}=n,{readable:a}=e;return t.data instanceof ki||!o&&!i&&!s?a:Cn(a).pipeThrough(new Sr({onstart:o,onprogress:i,onend:s,size:e.size}),{signal:r})}(n,r,e,i),a=!Go(t)&&Boolean(e.preventClose);return n.uncompressedSize=r.size,await Cn(s).pipeTo(Tn(t.writable),{signal:i,preventClose:a,preventAbort:a}),t.getData?t.getData():t.writable}}isPasswordProtected(){return Boolean(this.data&&this.data.encrypted)}async checkPassword(t,e={}){const r=this;if(!r.isPasswordProtected())return!0;try{return await r.data.getData(null,n.assign({},e,{password:t,checkPasswordOnly:!0})),!0}catch(t){if(xe(t)&&t.message==We)return!1;throw t}}getText(t,e){return this.getData(new bo(t),e)}getBlob(t,e){return this.getData(new yo(t),e)}getData64URI(t,e){return this.getData(new wo(t),e)}getUint8Array(t){return this.getData(new Wo,t)}getWritable(t=new D,e){return this.getData({writable:t},e)}async getArrayBuffer(t){return be(await this.getUint8Array(t)).buffer}replaceBlob(t){vu(this,{data:t,Reader:mo,Writer:yo,uncompressedSize:t.size})}replaceText(t){vu(this,{data:t,Reader:So,Writer:bo,uncompressedSize:go(t)})}replaceData64URI(t){vu(this,{data:t,Reader:fo,Writer:wo,uncompressedSize:_u(t)})}replaceUint8Array(t){vu(this,{data:t,Reader:Bo,Writer:Wo,uncompressedSize:t.length})}replaceReadable(t){vu(this,{data:null,Reader:xu(t),Writer:null,uncompressedSize:dt})}}class mu extends pu{constructor(t,e,n,r){super(t,e,n,r),this.directory=!0}clone(t){const e=this,n=new mu(e.fs,e.name,e);return t&&(n.children=e.children.map(e=>{const r=e.clone(t);return r.parent=n,r})),n}addDirectory(t,e){return Pu(this,t,{options:e},!0)}addText(t,e,n={}){return Pu(this,t,{data:e,Reader:So,Writer:bo,options:n,uncompressedSize:go(e)})}addBlob(t,e,n={}){return Pu(this,t,{data:e,Reader:mo,Writer:yo,options:n,uncompressedSize:e.size})}addData64URI(t,e,n={}){return Pu(this,t,{data:e,Reader:fo,Writer:wo,options:n,uncompressedSize:_u(e)})}addUint8Array(t,e,n={}){return Pu(this,t,{data:e,Reader:Bo,Writer:Wo,options:n,uncompressedSize:e.length})}addHttpContent(t,e,n={}){return Pu(this,t,{data:e,Reader:class extends Lo{constructor(t){super(t,n)}},options:n})}addReadable(t,e,n={}){return Pu(this,t,{Reader:xu(e),options:n})}addFileSystemEntry(t,e={}){return Ou(this,t,e)}addFileSystemHandle(t,e={}){return Ou(this,t,e)}addFile(t,e={}){return(e=n.assign({},e)).lastModDate||(e.lastModDate=new a(t.lastModified)),Pu(this,t.name,{data:t,Reader:function(){return{readable:t.stream(),size:t.size}},options:e,uncompressedSize:t.size})}importBlob(t,e){return this.importZip(new mo(t),e)}importData64URI(t,e){return this.importZip(new fo(t),e)}importUint8Array(t,e){return this.importZip(new Bo(t),e)}importHttpContent(t,e){return this.importZip(new Lo(t,e),e)}importReadable(t,e){return this.importZip({readable:t},e)}exportBlob(t={}){return this.exportZip(new yo(t.mimeType||"application/zip"),t)}exportData64URI(t={}){return this.exportZip(new wo(t.mimeType||"application/zip"),t)}exportUint8Array(t={}){return this.exportZip(new Wo,t)}async exportWritable(t=new D,e={}){return await this.exportZip({writable:t},e),t}exportFileSystemHandle(t,e={}){return async function(t,e,r){const{onstart:o,onprogress:i,onend:s}=r;ku(r.passThrough);const a=Tu(r.readerOptions),c=new AbortController,{signal:u}=c,l=function(t,e){if(!Kt(t))return()=>{};if(t.aborted)return e.abort(t.reason),()=>{};const n=()=>e.abort(t.reason);return t.addEventListener("abort",n,{once:!0}),()=>t.removeEventListener("abort",n)}(r.signal,c),d=n.assign({},r,a,{signal:u,onstart:dt,onprogress:dt,onend:dt,preventClose:!1}),w=gu([t],t=>Eu(t,d.passThrough)),p=[];let h=!1,m=0;try{o&&await gr(o,w),await g(t,e),s&&await gr(s,m)}catch(t){try{t.exportedEntryNames=p}catch{}throw t}finally{l()}return e;function y(t){const e=t.getWriter();return new D({async write(t){await e.write(t),m+=t.length,i&&await gr(i,m,w)},close:()=>e.close(),abort:t=>e.abort(t)})}async function g(t,e){if(r.concurrent){const n=(await S.allSettled(t.children.map(t=>b(t,e)))).filter(t=>"rejected"==t.status);if(n.length){const t=n.filter(t=>!Au(t.reason));throw function(t){const[e]=t,n=t.slice(1).flatMap(t=>[t,...t&&t.entryErrors||[]]).filter(t=>t!==e);if(n.length)try{e.entryErrors=[...e.entryErrors||[],...n]}catch{}return e}((t.length?t:n).map(t=>t.reason))}}else for(const n of t.children)await b(n,e)}async function b(e,n){if(u.aborted){if(h||Au(u.reason))return;Yt(u)}try{if(e.directory){const t=await n.getDirectoryHandle(e.name,{create:!0});await g(e,t)}else{const r=await n.getFileHandle(e.name,{create:!0}),o=await r.createWritable();try{await e.getData({writable:y(o)},d)}catch(t){throw h?new f(wu):t}p.push(e.getRelativeName(t))}}catch(n){h=!0,c.abort(new f(wu));try{n.entryName===dt&&(n.entryName=e.getRelativeName(t),n.entryId=e.id)}catch{}throw n}}}(this,t,e)}async importZip(t,e={}){let r;t&&typeof t.getEntries==pt?(r=t,e=n.assign({},r.options,e)):(await jo(t),r=new Es(t,e)),ku(e.passThrough);const o=function(t){if(t===dt)return su;if(uu.has(t))return t;throw new f(tu)}(e.duplicates),i=[],s=await r.getEntries(e);for(const t of s){let r=this;try{const s=t.filename.split("/").filter(t=>""!=t&&"."!=t),a=s.pop();let c=!1;for(const t of s){const e=r;if(r=r.getChildByName(t),r){if(!r.directory){if(o==au){c=!0;break}if(o!=cu)throw new f($c);this.fs.remove(r),r=new mu(this.fs,t,{data:null},e),i.push(r)}}else r=new mu(this.fs,t,{data:null},e),i.push(r)}if(c)continue;if(t.directory){let e=r;if(a){if(e=r.getChildByName(a),e&&!e.directory){if(o==au)continue;if(o!=cu)throw new f($c);this.fs.remove(e),e=dt}e||(e=new mu(this.fs,a,{data:null},r),i.push(e))}e==this||e.data||(e.data=t)}else{const s=r.getChildByName(a);if(s){if(o==au)continue;if(o!=cu)throw new f($c);this.fs.remove(s)}i.push(Pu(r,a,{data:t,Reader:zu(n.assign({},e)),uncompressedSize:e.passThrough?t.compressedSize:t.uncompressedSize,passThrough:e.passThrough}))}}catch(e){i.reverse().forEach(t=>this.fs.remove(t));try{e.cause={entry:t}}catch{}throw e}}return i}async exportZip(t,e={}){const r=this,o=Boolean(t)&&typeof t.add==pt;e=n.assign({},e),o||e.bufferedWrite!==dt||(e.bufferedWrite=!0);const[i]=await S.all([Fu(r,Tu(e.readerOptions)),o?dt:jo(t)]),s=o?t:new Ja(t,e);return await async function(t,e,r,o,i){const{onstart:s,onprogress:a,onend:c,onentryprogress:u}=o,l=e,d=gu(e.children,t=>Uu(t)?0:1);let f=0,w=0;if(s&&await gr(s,r),o.bufferedWrite)await async function t(e){const n=(await S.allSettled(e.children.map(async e=>{await p(e),await t(e)}))).find(t=>"rejected"==t.status);if(n)throw n.reason}(e);else for(const t of e.getChildren({recursive:!0}))await p(t);async function p(e){if(Uu(e))return;const{name:s,Fe:c}=Cu(e,l,o);let p=0;const h=await t.add(s,i.get(e),n.assign(c,{onstart:dt,onend:dt,onprogress:async t=>{f+=t-p,p=t,a&&await gr(a,f,r)}}));w++,u&&await gr(u,w,d,h)}c&&await gr(c,f)}(s,r,gu([r],bu),e,i),o?s:(await s.close(e.globalComment),t.getData?t.getData():t.writable)}async getExportedSize(t={}){const e=this;Tu((t=n.assign({},t)).readerOptions),t.bufferedWrite===dt&&(t.bufferedWrite=!0);const r=e.getChildren({recursive:!0}),o=r.filter(t=>!Uu(t)).map(n=>{const{name:r,Fe:o}=Cu(n,e,t);return{name:r,size:n.directory?0:Iu(n,Nu(n,t)),options:o}}),i=!t.bufferedWrite||o.every(t=>!1!==t.options.keepOrder)&&r.every(t=>Uu(t)||!t.children.length);return await async function(t,e,r,o){const i={options:t};if(qt(t[Nt]))throw new f(Ca);if(o!==dt&&!(o instanceof w))throw new f(sa);const a=Pc(o);if(a>M)throw new f(ia);const l=t[vt],d=new c,p=t[kt]===dt?0:t[kt];let h=p,m=ft;const y=[],S=new u;for(const t of e){let{name:e}=t;const{size:r}=t,o=n.assign({},t.options);Tc(i,o,Ei)&&!e.endsWith(at)&&(e+=at);const a=oc(i,e,o);({name:e}=a);const{Ae:c}=ic(i,e,o);0==c.level||c.compressionMethod!==dt||c.Ie||await hr(we())||(c.level=0);const u=!Tc(i,o,Ei);if(u&&r===dt)throw new f(Ca);const{fn:w,Ae:p}=ac(i,u,r,c,o);if(u&&!c.Ie&&Uc(p.compressionMethod,p.level))throw new f(Ca);const g=n.assign({},o,a.Ae,c,p,{[vt]:l}),b=uc(g),E=fc(g),x={Ue:b,Be:Pc(b.ve,E._e)};l&&lc(x,h);const z=u?w:0;d.set(e,n.assign({},g,b,{offset:h,diskNumberStart:0,compressedSize:z}));const R=x.Be+z;y.push(R),S.add(Boolean(g.ye||g.uncompressedSize>=O||z>=O)),m=s.min(m,R),h+=R}if(d.size>1&&(l||h-m>=O&&(S.size>1||cc(y,p,!0)!=cc(y,p,!1)))&&!r)throw new f(Ca);const{Ye:g,Xe:b}=wc(d);let E=Tc(i,t,mi);if(h>=O||g>=O||d.size>=M){if(!1===E)throw new f(Ra);E=!0}else E===dt&&b&&(E=!0);return h-p+g+a+(E?98:K)}(t,o,i,t.globalComment)}getChildByName(t){const e=this.children;for(let n=0;n<e.length;n++){const r=e[n];if(r.name==t)return r}}getChildren(t={}){return function(t,e){const n=[],r=[t];let o=0;for(;o<r.length;)for(const t of r[o++].children)n.push(t),e&&r.push(t);return n}(this,t.recursive)}isPasswordProtected(){const t=this.children;for(let e=0;e<t.length;e++)if(t[e].isPasswordProtected())return!0;return!1}async checkPassword(t,e={}){const n=this.children;return!(await S.all(n.map(n=>n.checkPassword(t,e)))).includes(!1)}}class yu{constructor(){Lu(this)}get children(){return this.root.children}remove(t){Du(t);const e=[t];for(;e.length;){const t=e.pop();this.entries[t.id]=null;for(const n of t.children)e.push(n)}t.parent=dt}move(t,e){if(t==this.root)throw new f(nu);if(!e.directory)throw new f(ru);if(e.isDescendantOf(t))throw new f(eu);if(t!=e){const n=e.getChildByName(t.name);if(n){if(n!=t)throw new f(Qc)}else Du(t),t.parent=e,e.children.push(t),Wu(this,t)}}find(t){const e=t.split("/");let n=this.root;for(let t=0;n&&t<e.length;t++)n=n.directory?n.getChildByName(e[t]):dt;return n||(n=this.entries.find(e=>e&&(e==this.root||e.isDescendantOf(this.root))&&e.getRelativeName()==t)),n}getById(t){return this.entries[t]}getChildByName(t){return this.root.getChildByName(t)}getChildren(t){return this.root.getChildren(t)}addDirectory(t,e){return this.root.addDirectory(t,e)}addText(t,e,n){return this.root.addText(t,e,n)}addBlob(t,e,n){return this.root.addBlob(t,e,n)}addData64URI(t,e,n){return this.root.addData64URI(t,e,n)}addUint8Array(t,e,n){return this.root.addUint8Array(t,e,n)}addHttpContent(t,e,n){return this.root.addHttpContent(t,e,n)}addReadable(t,e,n){return this.root.addReadable(t,e,n)}addFileSystemEntry(t,e){return this.root.addFileSystemEntry(t,e)}addFileSystemHandle(t,e){return this.root.addFileSystemHandle(t,e)}addFile(t,e){return this.root.addFile(t,e)}importBlob(t,e){return Bu(this,n=>n.importBlob(t,e))}importData64URI(t,e){return Bu(this,n=>n.importData64URI(t,e))}importUint8Array(t,e){return Bu(this,n=>n.importUint8Array(t,e))}importHttpContent(t,e){return Bu(this,n=>n.importHttpContent(t,e))}importReadable(t,e){return Bu(this,n=>n.importReadable(t,e))}importZip(t,e){return Bu(this,n=>n.importZip(t,e))}exportBlob(t){return this.root.exportBlob(t)}exportData64URI(t){return this.root.exportData64URI(t)}exportUint8Array(t){return this.root.exportUint8Array(t)}exportWritable(t,e){return this.root.exportWritable(t,e)}exportFileSystemHandle(t,e){return this.root.exportFileSystemHandle(t,e)}exportZip(t,e){return this.root.exportZip(t,e)}getExportedSize(t){return this.root.getExportedSize(t)}isPasswordProtected(){return this.root.isPasswordProtected()}checkPassword(t,e){return this.root.checkPassword(t,e)}}const Su={FS:yu,ZipDirectoryEntry:mu,ZipFileEntry:hu};function gu(t,n){let r=0;const o=e.from(t);for(;o.length;){const t=o.pop();r+=n(t)||0;for(const e of t.children)o.push(e)}return r}function bu(t){return t.uncompressedSize}function Eu(t,e){const{data:n}=t;return e&&n instanceof ki?n.compressedSize:t.uncompressedSize}function xu(t){let e;return function(){if(e)throw new f(iu);return e=!0,{readable:t}}}function zu(t){return class extends uo{constructor(t,e={}){super(),this.entry=t,this.options=e}async init(){const e=this,r=n.assign({},t,e.options),{checkOverlappingEntry:o,checkOverlappingEntryOnly:i}=r,s=await e.entry.getData(new yo,n.assign(r,{checkPasswordOnly:!1,checkOverlappingEntry:i||o,checkOverlappingEntryOnly:!1,preventClose:!1}));e.data=s,e.En=new mo(s),e.size=s.size,super.init()}readUint8Array(t,e){return this.En.readUint8Array(t,e)}}}function Ru(t,e,n){return t.prototype?new t(e,n):t(e,n)}async function Fu(t,e){const n=[],r=[t],o=new c;for(;r.length;){const t=r.pop();for(const e of t.children)e.directory?r.push(e):n.push(e)}return await S.all(n.map(async t=>{const n=t.reader=Ru(t.Reader,t.data,e);o.set(t,n);try{await jo(n)}catch(e){try{e.entryId=t.id,e.cause={entry:t}}catch{}throw e}n.size!==dt&&(t.uncompressedSize=n.size,t.gn=!1)})),o}function Du(t){if(t.parent){const e=t.parent.children;e.forEach((n,r)=>{n.id==t.id&&e.splice(r,1)})}}function Au(t){return Boolean(t)&&t.message==wu}function Cu(t,e,r){const o=r.relativePath?t.getRelativeName(e):t.getFullname(),i=t.options||{};let s={},a={};if(t.data instanceof ki){const e=Nu(t,r),n=i.lastModDate===dt?r.lastModDate:i.lastModDate;({Fe:s,De:a}=rc(t.data,e,n)),e&&(a.passThrough=!0)}const c=n.assign({lastModDate:t.bn},s,r,i,a,{directory:t.directory});if(!t.directory&&c.passThrough&&c.uncompressedSize===dt)throw new f(lu);return{name:o,Fe:c}}function Iu(t,e){const{reader:n}=t;return n&&n.size!==dt?n.size:t.gn?dt:Eu(t,e)}function Tu(t){if(t&&(typeof t!=ht||e.isArray(t)))throw new f(du);return t&&ku(t.passThrough),t}function ku(t){if(Jt(t)===Pt)throw new f(fu)}function vu(t,e){const{uncompressedSize:r}=e;n.assign(t,e,{reader:null,passThrough:dt,uncompressedSize:r===dt?0:r,gn:r===dt})}function _u(t){let e=t.length;for(;"="==t.charAt(e-1);)e--;const n=t.indexOf(",")+1;return s.floor(.75*(e-n))}function Nu(t,e){const{readerOptions:n}=e;return Boolean(!t.directory&&(t.passThrough||n&&n.passThrough))}function Uu(t){return t.directory&&null===t.data}function Ou(t,e,r){return async function t(e,o,i,s=""){if(o){const c=s?s+"/"+o.name:o.name;try{if((o.isFile||o.isDirectory)&&(o=await Mu(o)),"file"==o.kind){const t=await o.getFile();i.push(Pu(e,t.name,{Reader:function(){return{readable:t.stream(),size:t.size}},options:n.assign({},{lastModDate:new a(t.lastModified)},r),uncompressedSize:t.size}))}else if("directory"==o.kind){const n=e.addDirectory(o.name,r);i.push(n);for await(const e of o.values())await t(n,e,i,c)}}catch(t){try{t.entryName===dt&&(t.entryName=c)}catch{}throw t}}return i}(t,e,[])}async function Mu(t){const e={name:t.name};if(t.isFile&&(e.kind="file",e.getFile=()=>new S((e,n)=>t.file(e,n))),t.isDirectory){e.kind="directory";const n=await async function(t){const e=[];function n(t,r,o){t.readEntries(async i=>{if(i.length){for(const t of i)e.push(await Mu(t));n(t,r,o)}else r(e)},o)}return await new S((e,r)=>n(t.createReader(),e,r)),{[k.iterator](){let t=0;return{next(){const n={value:e[t],done:t==e.length};return t++,n}}}}}(t);e.values=()=>n}return e}function Lu(t){t.entries=[],t.Sn=0,t.root=new mu(t)}function Bu(t,e){const{entries:r,Sn:o,root:i}=t;return Lu(t),e(t.root).catch(e=>{throw n.assign(t,{entries:r,Sn:o,root:i}),e})}function Wu(t,e){const n=[e];for(;n.length;){const e=n.pop();t.entries[e.id]=e;for(const t of e.children)n.push(t)}}function Pu(t,e,n,r){if(t.directory){const o=Zu(e);return o&&(e=o.pop(),t=Hu(t,o)),r?new mu(t.fs,e,n,t):new hu(t.fs,e,n,t)}throw new f(ou)}function Zu(t){if(t.includes("/")){const e=t.split("/").filter(t=>""!=t&&"."!=t);if(e.length)return e}}function Hu(t,e,n){return e.forEach(e=>{const r=t;if(t=t.getChildByName(e)){if(!t.directory)throw new f(Qc);if(n&&(t==n||t.isDescendantOf(n)))throw new f(eu)}else t=new mu(r.fs,e,{data:null},r)}),t}t.BlobReader=mo,t.BlobWriter=yo,t.Data64URIReader=fo,t.Data64URIWriter=wo,t.ERR_ABORTED=jt,t.ERR_AMBIGUOUS_ARCHIVE=Gi,t.ERR_ANCESTOR_ENTRY=eu,t.ERR_BAD_FORMAT=Ni,t.ERR_CENTRAL_DIRECTORY_NOT_FOUND=Mi,t.ERR_DUPLICATED_NAME=oa,t.ERR_DUPLICATE_IMPORTED_ENTRY=$c,t.ERR_ENCRYPTED=Wi,t.ERR_ENCRYPTED_CENTRAL_DIRECTORY=ji,t.ERR_ENTRY_DATA_OUT_OF_BOUNDS=Vi,t.ERR_ENTRY_EXISTS=Qc,t.ERR_EOCDR_LOCATOR_ZIP64_NOT_FOUND=Oi,t.ERR_EOCDR_NOT_FOUND=Ui,t.ERR_EXTRAFIELD_ZIP64_NOT_FOUND=Bi,t.ERR_HTTP_RANGE=Xr,t.ERR_HTTP_RESOURCE_CHANGED=Jr,t.ERR_HTTP_STATUS=Yr,t.ERR_INVALID_AUTHENTICATION_CODE=Pe,t.ERR_INVALID_BASE_URI=ne,t.ERR_INVALID_CODEC_DEFINITION=kn,t.ERR_INVALID_CODEC_MODULE=_n,t.ERR_INVALID_COMMENT=ia,t.ERR_INVALID_COMMENT_TYPE=sa,t.ERR_INVALID_COMPRESSED_DATA=Hn,t.ERR_INVALID_CRC32=Vn,t.ERR_INVALID_DATE=ua,t.ERR_INVALID_DUPLICATES=tu,t.ERR_INVALID_ENCRYPTION_STRENGTH=fa,t.ERR_INVALID_ENTRY=Pa,t.ERR_INVALID_ENTRY_COMMENT=aa,t.ERR_INVALID_ENTRY_COMMENT_TYPE=ca,t.ERR_INVALID_ENTRY_NAME=la,t.ERR_INVALID_EXTRAFIELD=ma,t.ERR_INVALID_EXTRAFIELD_DATA=ga,t.ERR_INVALID_EXTRAFIELD_DATA_TYPE=Sa,t.ERR_INVALID_EXTRAFIELD_TYPE=ya,t.ERR_INVALID_FILENAME_VALIDATION=Yi,t.ERR_INVALID_FUNCTION_OPTION=Zt,t.ERR_INVALID_GID=_a,t.ERR_INVALID_LEVEL=Ba,t.ERR_INVALID_MAX_APPENDED_DATA_SIZE=Xi,t.ERR_INVALID_MAX_WORKERS=ee,t.ERR_INVALID_MSDOS_ATTRIBUTES=Ma,t.ERR_INVALID_MSDOS_DATA=La,t.ERR_INVALID_PASSWORD=We,t.ERR_INVALID_PASSWORD_TYPE=Vt,t.ERR_INVALID_PASS_THROUGH=lu,t.ERR_INVALID_PASS_THROUGH_VALUE=Gt,t.ERR_INVALID_READER=Ta,t.ERR_INVALID_READER_OPTIONS=du,t.ERR_INVALID_SIGNAL=Ht,t.ERR_INVALID_SIGNATURE_DATA=Wa,t.ERR_INVALID_STRICTNESS=Ki,t.ERR_INVALID_UID=va,t.ERR_INVALID_UNCOMPRESSED_SIZE=Zn,t.ERR_INVALID_UNIX_EXTRA_FIELD_TYPE=Ua,t.ERR_INVALID_UNIX_ID_SIZE=Oa,t.ERR_INVALID_UNIX_MODE=Na,t.ERR_INVALID_URI=re,t.ERR_INVALID_VERSION=da,t.ERR_ITERATOR_COMPLETED_TOO_SOON=Qr,t.ERR_LOCAL_FILE_HEADER_NOT_FOUND=Li,t.ERR_OVERLAPPING_ENTRY=Hi,t.ERR_PARENT_NOT_DIRECTORY=ou,t.ERR_READABLE_CONSUMED=iu,t.ERR_RESERVED_COMPRESSION_METHOD=vn,t.ERR_ROOT_DIRECTORY_NOT_MOVABLE=nu,t.ERR_SPLIT_ZIP_FILE=Zi,t.ERR_TARGET_NOT_DIRECTORY=ru,t.ERR_UNDEFINED_COMPRESSION_METHOD=Da,t.ERR_UNDEFINED_CRC32=Aa,t.ERR_UNDEFINED_READER=Ia,t.ERR_UNDEFINED_UNCOMPRESSED_SIZE=Fa,t.ERR_UNDETERMINED_SIZE=Ca,t.ERR_UNSAFE_FILENAME=qi,t.ERR_UNSUPPORTED_COMPRESSION=Nn,t.ERR_UNSUPPORTED_CONTEXT=Jc,t.ERR_UNSUPPORTED_CRYPTO_API=He,t.ERR_UNSUPPORTED_ENCRYPTION=Pi,t.ERR_UNSUPPORTED_ENCRYPTION_PASS_THROUGH=ha,t.ERR_UNSUPPORTED_ENCRYPTION_USDZ=wa,t.ERR_UNSUPPORTED_FORMAT=Ra,t.ERR_UNSUPPORTED_PASS_THROUGH_VALUE=fu,t.ERR_UNSUPPORTED_SPLIT_USDZ=pa,t.ERR_UNSUPPORTED_UINT64=Ji,t.ERR_WORKER_STARTUP_TIMEOUT=dr,t.ERR_WRITER_NOT_INITIALIZED=$r,t.ERR_WRITER_SIZE_NOT_WRITABLE=to,t.ERR_ZIP_CRYPTO_LAST_MOD_DATE=Za,t.ERR_ZIP_NOT_EMPTY=ka,t.HttpRangeReader=class extends Lo{constructor(t,e={}){super(t,n.assign({},e,{useRangeHeader:!0}))}},t.HttpReader=Lo,t.Reader=uo,t.SplitDataReader=Po,t.SplitDataWriter=Zo,t.TextReader=So,t.TextWriter=bo,t.Uint8ArrayReader=Bo,t.Uint8ArrayWriter=Wo,t.VERSION="2.13.0",t.WARNING_APPENDED_DATA=os,t.WARNING_CLAMPED_LAST_MODIFICATION_DATE=Va,t.WARNING_COMPRESSED_PATCHED_DATA=ts,t.WARNING_COMPRESSION_UNAVAILABLE=Ha,t.WARNING_DUPLICATE_FILENAME=cs,t.WARNING_MALFORMED_EXTRA_FIELD=es,t.WARNING_MISMATCHED_LOCAL_FILE_HEADER_BIT_FLAG=fs,t.WARNING_MISMATCHED_LOCAL_FILE_HEADER_COMPRESSION_METHOD=ws,t.WARNING_MISMATCHED_LOCAL_FILE_HEADER_CRC32_OR_SIZES=ps,t.WARNING_MISMATCHED_LOCAL_FILE_HEADER_FILENAME=ds,t.WARNING_MISMATCHED_ZIP64_END_OF_CENTRAL_DIRECTORY=us,t.WARNING_MULTIPLE_END_OF_CENTRAL_DIRECTORY=ls,t.WARNING_PREPENDED_CENTRAL_DIRECTORY=ss,t.WARNING_PREPENDED_DATA=is,t.WARNING_TRAILING_CENTRAL_DIRECTORY_DATA=as,t.WARNING_UNKNOWN_VERSION=$i,t.WARNING_UNKNOWN_ZIP64_EXTENSIBLE_DATA=ns,t.WARNING_UNSORTED_CENTRAL_DIRECTORY=Qi,t.WARNING_WRAPPED_ENTRIES_COUNT=rs,t.Writer=lo,t.ZipDirectoryEntry=mu,t.ZipEntry=pu,t.ZipFS=yu,t.ZipFileEntry=hu,t.ZipReader=Es,t.ZipReaderStream=xs,t.ZipWriter=Ja,t.ZipWriterStream=class{constructor(t={}){const{readable:e,writable:n}=new R;this.readable=e,this.zipWriter=new Ja(n,t),this.oe=new u}transform(t){const e=this.zipWriter;let n;const{readable:r,writable:o}=new R({start(t){n=t},flush:()=>{!async function(){try{await e.close()}catch(t){await ec(e,t)}}()}});return nc(this,this.zipWriter.add(t,r),t=>n.error(t)),{readable:this.readable,writable:o}}writable(t){let e;const{readable:n,writable:r}=new R({start(t){e=t}});return nc(this,this.zipWriter.add(t,n),t=>e.error(t)),r}async close(t,n={}){const{zipWriter:r}=this,o=(await S.allSettled(e.from(this.oe))).filter(t=>"rejected"==t.status).map(t=>t.reason);if(o.length){const[t]=o;try{t.entryErrors=o}catch{}throw await ec(r,t),t}try{return await r.close(t,n)}catch(t){throw await ec(r,t),t}}},t.configure=function(t){n.assign(fe,me(Se(t)))},t.createBlobTempStream=function(t={}){const{thresholdBytes:e=Kc}=t;return function(){const t=[];let n,r,o,i=0,s=!1;const a=new D({async write(o){s?await n.write(o):(t.push(o),i+=o.length,i>e&&await async function(){const e=new R;r=In(e.readable),n=e.writable.getWriter(),s=!0;for(const e of t)await n.write(e);t.length=0}())},async close(){n&&(await n.close(),n=null)}});let c=0;return{writable:a,readable:new F({async pull(e){if(s){if(!o){const t=await r;o=t.stream().getReader()}const{value:t,done:n}=await o.read();n?e.close():e.enqueue(t)}else c<t.length?e.enqueue(t[c++]):e.close()},async cancel(t){o&&await o.cancel(t)}},{highWaterMark:0}),dispose:async function(){if(n){try{await n.abort()}catch{}n=null}r&&(r.catch(()=>{}),r=null),t.length=0}}}},t.createOPFSTempStream=function(t={}){const{thresholdBytes:n=jc,directoryName:r=qc,getDirectory:o=()=>I.storage.getDirectory()}=t;let i;function s(){return i||(i=S.resolve(o()).then(t=>t.getDirectoryHandle(r,{create:!0}))),i}return function(){const t=[];let r,o,i,a,c=0,u=!1;const l=new D({async write(a){u?await i.write(a):(t.push(a),c+=a.length,c>n&&await async function(){const n=await s();r=x.randomUUID?x.randomUUID():e.from(x.getRandomValues(new w(16)),t=>t.toString(16).padStart(2,"0")).join(""),o=await n.getFileHandle(r,{create:!0}),i=(await o.createWritable()).getWriter(),u=!0;for(const e of t)await i.write(e);t.length=0}())},async close(){i&&(await i.close(),i=null)}});let d=0;return{writable:l,readable:new F({async pull(e){if(u){if(!a){const t=await o.getFile();a=t.stream().getReader()}const{value:t,done:n}=await a.read();n?e.close():e.enqueue(t)}else d<t.length?e.enqueue(t[d++]):e.close()},async cancel(t){a&&await a.cancel(t)}},{highWaterMark:0}),dispose:async function(){if(i){try{await i.close()}catch{}i=null}if(r){try{const t=await s();await t.removeEntry(r)}catch{}o=r=null}t.length=0}}}},t.createSyncAccessHandleTempStream=function(t={}){const{thresholdBytes:n=Yc,directoryName:r=Xc,getDirectory:o}=t;if(!(o||"undefined"!=typeof FileSystemFileHandle&&FileSystemFileHandle.prototype.createSyncAccessHandle))throw new f(Jc);const i=o||(()=>I.storage.getDirectory());let a;function c(){return a||(a=S.resolve(i()).then(t=>t.getDirectoryHandle(r,{create:!0}))),a}return function(){const t=[];let r,o,i=0,a=!1,u=0,l=0;const d=new D({async write(s){a?(o.write(s,{at:u}),u+=s.length):(t.push(s),i+=s.length,i>n&&await async function(){const n=await c();r=x.randomUUID?x.randomUUID():e.from(x.getRandomValues(new w(16)),t=>t.toString(16).padStart(2,"0")).join("");const i=await n.getFileHandle(r,{create:!0});o=await i.createSyncAccessHandle(),a=!0;for(const e of t)o.write(e,{at:u}),u+=e.length;t.length=0}())},close(){o&&o.flush()}});let f=0;return{writable:d,readable:new F({pull(e){if(a){const t=u-l;if(t<=0)return void e.close();const n=new w(s.min(524288,t)),r=o.read(n,{at:l});r?(l+=r,e.enqueue(n.subarray(0,r))):e.close()}else f<t.length?e.enqueue(t[f++]):e.close()}},{highWaterMark:0}),dispose:async function(){if(o){try{o.close()}catch{}o=null}if(r){try{const t=await c();await t.removeEntry(r)}catch{}r=null}t.length=0}}}},t.fs=Su,t.getMimeType=function(){return"application/octet-stream"},t.getRegisteredCodecs=Bn,t.getSupportedCompressionMethods=function(){const{CompressionStream:t,DecompressionStream:e,CompressionStreamFallback:n,DecompressionStreamFallback:r}=we(),o=[{compressionMethod:0,compression:!0,decompression:!0,registered:!1},{compressionMethod:8,compression:Gc(n,Gn)||Gc(t,Gn)||Gc(t,qn),decompression:Gc(r,Gn)||Gc(e,Gn)||Gc(e,qn),registered:!1},{compressionMethod:9,compression:!1,decompression:Gc(r,jn)||Gc(e,jn),registered:!1}];for(const t of Bn()){const e=Wn(t.format);o.push({compressionMethod:t.compressionMethod,compression:e?typeof e.CompressionStream==pt:dt,decompression:e?typeof e.DecompressionStream==pt:dt,registered:!0})}return o},t.isZipFile=zs,t.registerCodec=function(t={}){const{compressionMethod:e,format:n,codecURI:r,CompressionStream:i,DecompressionStream:s,versionNeeded:a}=t;if(!o.isInteger(e)||e<0||e>M||typeof n!=mt||!n.length)throw new f(kn);if(Un.includes(e))throw new f(vn);const c=typeof i==pt||typeof s==pt;if(!(c||typeof r==mt&&r.length))throw new f(kn);On.set(e,{compressionMethod:e,format:n,codecURI:r,versionNeeded:a}),c&&Pn(n,{CompressionStream:i,DecompressionStream:s})},t.resetConfiguration=function(){for(const t of de)delete fe[t];n.assign(fe,ie)},t.terminateWorkers=async function(){await S.allSettled(Ur.map(t=>(Gr(t),t.terminate()))),fr=dt,wr=!1},t.unregisterCodec=function(t){const e=On.get(t);if(e){let n;On.delete(t),On.forEach(t=>n=n||t.format==e.format),n||Mn.delete(e.format)}}});
|
|
1
|
+
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports):"function"==typeof define&&define.amd?define(["exports"],e):e((t="undefined"!=typeof globalThis?globalThis:t||self).zip={})}(this,function(t){"use strict";const{Array:e,Object:n,String:r,Number:o,BigInt:i,Math:s,Date:a,Map:c,Set:u,Response:l,URL:d,Error:f,Uint8Array:w,Uint16Array:p,Uint32Array:h,DataView:m,Blob:y,Promise:g,TextEncoder:S,TextDecoder:E,document:b,crypto:x,btoa:z,TransformStream:R,ReadableStream:F,WritableStream:D,CompressionStream:A,DecompressionStream:I,navigator:C,Worker:T,Symbol:k,setTimeout:v,clearTimeout:_,structuredClone:N}="undefined"!=typeof globalThis?globalThis:self;var U=void 0!==b?b.currentScript:null;const O=4294967295,M=65535,L=255,B=67324752,W=134695760,P=W,Z=84233040,H=33639248,V=101010256,G=101075792,j=117853008,q=46,Y=22,K=20,X=56,J=39169,Q=21589,$=6534,tt=30837,et=30805,nt=2048,rt=61440,ot=16384,it=2048,st=1024,at="/",ct=30,ut=new a(2107,11,31,23,59,58),lt=new a(1980,0,1),dt=void 0,ft=1/0,wt="undefined",pt="function",ht="object",mt="string",yt="boolean",gt=new w,St=k.asyncDispose||k(),Et="password",bt="rawPassword",xt="passThrough",zt="signal",Rt="useWebWorkers",Ft="useCompressionStream",Dt="transferStreams",At="preventClose",It="level",Ct="useUnicodeFileNames",Tt="dataDescriptor",kt="offset",vt="usdz",_t="maxAppendedDataSize",Nt="signCentralDirectory",Ut="entry",Ot="filename",Mt="comment",Lt="strict",Bt="balanced",Wt="tolerant",Pt="compressed",Zt="Invalid option (must be a function)",Ht="Invalid signal (must be an AbortSignal instance)",Vt="Invalid password (password must be a string, rawPassword must be a Uint8Array)",Gt="Invalid passThrough option (must be a boolean or 'compressed')",jt="The operation was aborted";function qt(t){if(t&&typeof t!=pt)throw new f(Zt);return t}function Yt(t){if(t&&(typeof t.addEventListener!=pt||typeof t.aborted!=yt))throw new f(Ht);return t||dt}function Kt(t){if(t&&t.aborted)throw t.reason===dt?new DOMException(jt,"AbortError"):t.reason}function Xt(t,e){if(t&&typeof t!=mt||e&&!(e instanceof w))throw new f(Vt)}function Jt(t){if(t!==dt&&typeof t!=yt&&t!==Pt)throw new f(Gt);return t}function Qt(t,e,n){if(!o.isInteger(t)||t<0||t>e)throw new f(n)}function $t(t,e,n){t!==dt&&Qt(t,e,n)}function te(t){return typeof t==mt&&t.trim()?o(t):t}const ee="Invalid maxWorkers (must be an integer greater than 0)",ne="Invalid baseURI (must be a string)",re="Invalid URI (must be a string or a function returning a string)";let oe=2;try{typeof C!=wt&&C.hardwareConcurrency&&(oe=C.hardwareConcurrency)}catch{}const ie={workerURI:"./core/web-worker-wasm.js",wasmURI:"./core/streams/zlib-wasm/zlib-streams.wasm",chunkSize:65536,maxWorkers:oe,terminateWorkerTimeout:5e3,workerStarvationTimeout:5e3,workerStartupTimeout:5e3,useWebWorkers:!0,useCompressionStream:!0,transferStreams:!0,CompressionStream:typeof A!=wt&&A,DecompressionStream:typeof I!=wt&&I},se="maxWorkers",ae="baseURI",ce=["wasmURI","workerURI"],ue=["chunkSize",se,"terminateWorkerTimeout","workerStarvationTimeout","workerStartupTimeout"],le=["createWorker","CompressionStream","DecompressionStream","CompressionStreamFallback","DecompressionStreamFallback"],de=[ae,...ce,"useCompressionStream","useWebWorkers","transferStreams",...ue,...le],fe={...ie};function we(){return fe}function pe(t){return he(t.chunkSize)}function he(t){return t=te(t),o.isInteger(t)&&t>=1?s.max(t,64):65536}function me(t){const e={};for(const n of de){const r=t[n];r!==dt&&(e[n]=ye(n,r))}return e}function ye(t,e){if(ue.includes(t)){if(e=te(e),t==se&&(!o.isInteger(e)||e<1))throw new f(ee)}else if(le.includes(t))qt(e);else if(t==ae){if(e&&typeof e!=mt)throw new f(ne)}else if(ce.includes(t)&&e&&typeof e!=mt&&typeof e!=pt)throw new f(re);return e}function ge(t){t=t||{};const{CompressionStreamZlib:e,DecompressionStreamZlib:r}=t;if(e===dt&&r===dt)return t;const o=n.assign({},t);return o.CompressionStreamFallback===dt&&(o.CompressionStreamFallback=e),o.DecompressionStreamFallback===dt&&(o.DecompressionStreamFallback=r),o}function Se(t,e){const n=new w(t.length+e.length);return n.set(t),n.set(e,t.length),n}function Ee(t){return t.byteOffset||t.byteLength!=t.buffer.byteLength?new w(t):t}function be(t){return new m(t.buffer,t.byteOffset,t.byteLength)}function xe(t){return Boolean(t)&&"object"==typeof t}const ze=[[],[],[],[],[],[],[],[]];for(let t=0;t<256;t++){let e=t;for(let t=0;t<8;t++)e=1&e?e>>>1^3988292384:e>>>1;ze[0][t]=e}for(let t=0;t<256;t++)for(let e=1;e<8;e++){const n=ze[e-1][t];ze[e][t]=n>>>8^ze[0][255&n]}const[Re,Fe,De,Ae,Ie,Ce,Te,ke]=ze;class ve{constructor(t){this.o=t||-1}append(t){let e=0|this.o;const n=0|t.length;let r=0;if(n>=8&&t.buffer){const o=new m(t.buffer,t.byteOffset,n),i=n-8;for(;r<=i;r+=8){const t=e^o.getInt32(r,!0),n=o.getInt32(r+4,!0);e=ke[255&t]^Te[t>>>8&255]^Ce[t>>>16&255]^Ie[t>>>24&255]^Ae[255&n]^De[n>>>8&255]^Fe[n>>>16&255]^Re[n>>>24&255]}}for(;r<n;r++)e=e>>>8^Re[255&(e^t[r])];this.o=e}get(){return~this.o}}class _e extends R{constructor(){let t;const e=new ve;super({transform(t,n){e.append(t),n.enqueue(t)},flush(){const n=new w(4);new m(n.buffer).setUint32(0,e.get()),t.value=n}}),t=this}}function Ne(t){if(typeof S==wt){t=unescape(encodeURIComponent(t));const e=new w(t.length);for(let n=0;n<e.length;n++)e[n]=t.charCodeAt(n);return e}return(new S).encode(t)}const Ue=64,Oe=20,Me=new w([128]),Le=new w(1),Be=new Int32Array([1732584193,4023233417,2562383102,271733878,3285377520]),We=new w(256),Pe=new Int32Array(256),Ze=new Int32Array(256),He=new Int32Array(256),Ve=new Int32Array(256);let Ge=!1;function je(t){const e=function(){const t=new Int32Array(Be),e=new Int32Array(80),n=new w(Ue),r=new m(n.buffer),o=new w(8);let i=0,a=0;return{update:c,digest:function(){const e=8*a,n=s.floor(e/4294967296),r=e>>>0;for(c(Me,0,1);56!=i;)c(Le,0,1);o[0]=n>>>24,o[1]=n>>>16,o[2]=n>>>8,o[3]=n,o[4]=r>>>24,o[5]=r>>>16,o[6]=r>>>8,o[7]=r,c(o,0,8);const u=new w(Oe),l=new m(u.buffer);for(let e=0;e<t.length;e++)l.setInt32(4*e,t[e]);return t.set(Be),i=0,a=0,u}};function c(t,e,o){const s=e+o;if(a+=o,i){for(;e<s&&i<Ue;)n[i++]=t[e++];i==Ue&&(u(r,0),i=0)}if(e+Ue<=s){const n=new m(t.buffer,t.byteOffset,t.byteLength);for(;e+Ue<=s;e+=Ue)u(n,e)}for(;e<s;)n[i++]=t[e++]}function u(n,r){for(let t=0;t<16;t++)e[t]=n.getInt32(r+4*t);for(let t=16;t<80;t++){const n=e[t-3]^e[t-8]^e[t-14]^e[t-16];e[t]=n<<1|n>>>31}let o,i=t[0],s=t[1],a=t[2],c=t[3],u=t[4];for(let t=0;t<20;t++)o=(i<<5|i>>>27)+(s&a|~s&c)+u+1518500249+e[t]|0,u=c,c=a,a=s<<30|s>>>2,s=i,i=o;for(let t=20;t<40;t++)o=(i<<5|i>>>27)+(s^a^c)+u+1859775393+e[t]|0,u=c,c=a,a=s<<30|s>>>2,s=i,i=o;for(let t=40;t<60;t++)o=(i<<5|i>>>27)+(s&a|s&c|a&c)+u+2400959708+e[t]|0,u=c,c=a,a=s<<30|s>>>2,s=i,i=o;for(let t=60;t<80;t++)o=(i<<5|i>>>27)+(s^a^c)+u+3395469782+e[t]|0,u=c,c=a,a=s<<30|s>>>2,s=i,i=o;t[0]=t[0]+i|0,t[1]=t[1]+s|0,t[2]=t[2]+a|0,t[3]=t[3]+c|0,t[4]=t[4]+u|0}}(),n=new w(Ue),r=new w(Ue);t.length>Ue&&(e.update(t,0,t.length),t=e.digest());for(let e=0;e<Ue;e++){const o=e<t.length?t[e]:0;n[e]=54^o,r[e]=92^o}return e.update(n,0,Ue),{update(t,n,r){e.update(t,n,r)},digest(){const t=e.digest();e.update(r,0,Ue),e.update(t,0,Oe);const o=e.digest();return e.update(n,0,Ue),o}}}function qe(t){return We[t>>>24]<<24|We[t>>>16&255]<<16|We[t>>>8&255]<<8|We[255&t]}function Ye(t){return 255&(t<<1^27*(t>>7))}const Ke=typeof x!=wt&&typeof x.getRandomValues==pt,Xe="Invalid password",Je="Invalid authentication code",Qe="zipjs-abort-check-password",$e="Crypto API not supported";function tn(t){if(Ke)return x.getRandomValues(t);throw new f($e)}const en={name:"PBKDF2"},nn=n.assign({hash:{name:"HMAC"}},en),rn=n.assign({iterations:1e3,hash:{name:"SHA-1"}},en),on=["deriveBits"],sn=[8,12,16],an=[16,24,32],cn=10,un=typeof x!=wt,ln=un&&x.subtle;let dn=un&&typeof ln!=wt&&typeof ln.importKey==pt&&typeof ln.deriveBits==pt;class fn extends R{constructor({password:t,rawPassword:e,encryptionStrength:n,checkPasswordOnly:r,checkAuthenticationCode:o=!0}){super({start(){pn(this,t,e,n)},async transform(t,e){const n=this,{password:o,strength:i,l:s,ready:a}=n;o?(await async function(t,e,n,r){const o=await yn(t,e,n,Sn(r,0,sn[e])),i=Sn(r,sn[e]);if(o[0]!=i[0]||o[1]!=i[1])throw mn(t),new f(Xe)}(n,i,o,Sn(t,0,sn[i]+2)),t=Sn(t,sn[i]+2),r?(mn(n),e.error(new f(Qe))):s()):await a;const c=new w(t.length-cn-(t.length-cn)%16);e.enqueue(hn(n,t,c,0,cn,!0))},async flush(t){const{h:e,m:n,ready:r}=this;if(e){await r;const i=Sn(n,n.length-cn),s=new w(Sn(n,0,n.length-cn));e.process(s,!0);const a=e.digest();let c=n.length<cn?1:0;for(let t=0;t<cn;t++)c|=a[t]^i[t];if(c&&o)throw new f(Je);t.enqueue(s)}},cancel(){mn(this)}})}}class wn extends R{constructor({password:t,rawPassword:e,encryptionStrength:n}){super({start(){pn(this,t,e,n)},async transform(t,e){const n=this,{password:r,strength:o,l:i,ready:s}=n;let a=gt;r?(a=await async function(t,e,n){const r=tn(new w(sn[e]));return Se(r,await yn(t,e,n,r))}(n,o,r),i()):await s;const c=new w(a.length+t.length-t.length%16);c.set(a,0),e.enqueue(hn(n,t,c,a.length,0,!1))},async flush(t){const{h:e,m:n,ready:r}=this;if(e){await r;const o=new w(n);e.process(o,!1);const i=Sn(e.digest(),0,cn);t.enqueue(Se(o,i))}},cancel(){mn(this)}})}}function pn(t,e,r,o){n.assign(t,{ready:new g(e=>t.l=e),password:gn(e,r),strength:o-1,m:gt})}function hn(t,e,n,r,o,i){const{h:s,m:a}=t;a.length&&(e=Se(a,e));const c=e.length-o,u=c-c%16;if(n=function(t,e){if(e&&e>t.length){const n=t;(t=new w(e)).set(n,0)}return t}(n,r+u),u){const t=Sn(n,r,r+u);t.set(Sn(e,0,u)),s.process(t,i)}return t.m=Sn(e,u),n}function mn({h:t}){t&&t.dispose&&t.dispose()}async function yn(t,e,r,o){t.password=null;const i=an[e],a=await async function(t,e,r){if(dn)try{const o=await ln.importKey("raw",t,nn,!1,on);return new w(await ln.deriveBits(n.assign({salt:e},rn),o,8*r))}catch{dn=!1}return function(t,e,n,r){const o=je(t),i=new w(r),a=new w(e.length+4),c=new m(a.buffer);a.set(e);for(let t=1,n=0;n<r;t++,n+=Oe){c.setUint32(e.length,t),o.update(a,0,a.length);let u=o.digest();const l=u.slice();for(let t=1;t<1e3;t++){o.update(u,0,Oe),u=o.digest();for(let t=0;t<Oe;t++)l[t]^=u[t]}i.set(l.subarray(0,s.min(Oe,r-n)),n)}return i}(t,e,0,r)}(r,o,2*i+2);return t.h=function(t,e){!function(){if(!Ge){let t=1,e=1;do{t=255&(t^t<<1^(128&t?27:0)),e=255&(e^e<<1),e=255&(e^e<<2),e=255&(e^e<<4),128&e&&(e^=9),We[t]=255&(e^(e<<1|e>>7)^(e<<2|e>>6)^(e<<3|e>>5)^(e<<4|e>>4)^99)}while(1!=t);We[0]=99;for(let t=0;t<256;t++){const e=We[t],n=Ye(e),r=n<<24|e<<16|e<<8|n^e;Pe[t]=r,Ze[t]=r>>>8|r<<24,He[t]=r>>>16|r<<16,Ve[t]=r>>>24|r<<8}Ge=!0}}();const n=new Int32Array(60),r=function(t,e){const n=t.length>>2,r=n+6,o=4*(r+1);let i=1;for(let r=0;r<n;r++)e[r]=t[4*r]<<24|t[4*r+1]<<16|t[4*r+2]<<8|t[4*r+3];for(let t=n;t<o;t++){let r=e[t-1];t%n==0?(r=qe(r<<8|r>>>24)^i<<24,i=Ye(i)):n>6&&t%n==4&&(r=qe(r)),e[t]=e[t-n]^r}return r}(t,n),o=new w(16),i=new Int32Array(4),s=je(e);return{process(t,e){e&&s.update(t,0,t.length),function(t){const e=new m(t.buffer,t.byteOffset,t.byteLength),n=t.length;let r=0;for(;r+16<=n;r+=16)a(),e.setInt32(r,e.getInt32(r)^i[0]),e.setInt32(r+4,e.getInt32(r+4)^i[1]),e.setInt32(r+8,e.getInt32(r+8)^i[2]),e.setInt32(r+12,e.getInt32(r+12)^i[3]);if(r<n){a();for(let e=0;r<n;r++,e++)t[r]^=i[e>>2]>>>24-8*(3&e)}}(t),e||s.update(t,0,t.length)},digest:()=>s.digest()};function a(){for(let t=0;t<16&&(o[t]++,0===o[t]);t++);let t=(o[0]<<24|o[1]<<16|o[2]<<8|o[3])^n[0],e=(o[4]<<24|o[5]<<16|o[6]<<8|o[7])^n[1],s=(o[8]<<24|o[9]<<16|o[10]<<8|o[11])^n[2],a=(o[12]<<24|o[13]<<16|o[14]<<8|o[15])^n[3],c=4;for(let o=1;o<r;o++,c+=4){const r=Pe[t>>>24]^Ze[e>>>16&255]^He[s>>>8&255]^Ve[255&a]^n[c],o=Pe[e>>>24]^Ze[s>>>16&255]^He[a>>>8&255]^Ve[255&t]^n[c+1],i=Pe[s>>>24]^Ze[a>>>16&255]^He[t>>>8&255]^Ve[255&e]^n[c+2],u=Pe[a>>>24]^Ze[t>>>16&255]^He[e>>>8&255]^Ve[255&s]^n[c+3];t=r,e=o,s=i,a=u}i[0]=(We[t>>>24]<<24|We[e>>>16&255]<<16|We[s>>>8&255]<<8|We[255&a])^n[c],i[1]=(We[e>>>24]<<24|We[s>>>16&255]<<16|We[a>>>8&255]<<8|We[255&t])^n[c+1],i[2]=(We[s>>>24]<<24|We[a>>>16&255]<<16|We[t>>>8&255]<<8|We[255&e])^n[c+2],i[3]=(We[a>>>24]<<24|We[t>>>16&255]<<16|We[e>>>8&255]<<8|We[255&s])^n[c+3]}}(Sn(a,0,i),Sn(a,i,2*i)),Sn(a,2*i)}function gn(t,e){return e===dt?Ne(t):e}function Sn(t,e,n){return t.subarray(e,n)}class En extends R{constructor({password:t,rawPassword:e,passwordVerification:n,checkPasswordOnly:r}){super({start(){xn(this,t,e,n)},transform(t,e){const n=this;if(n.password||n.rawPassword){const e=zn(n,t.subarray(0,12));if(n.password=n.rawPassword=null,0!=(e[11]^n.passwordVerification))throw new f(Xe);t=t.subarray(12)}r?e.error(new f(Qe)):e.enqueue(zn(n,t))}})}}class bn extends R{constructor({password:t,rawPassword:e,passwordVerification:n}){super({start(){xn(this,t,e,n)},transform(t,e){const n=this;let r,o;if(n.password||n.rawPassword){n.password=n.rawPassword=null;const e=tn(new w(12));e[11]=n.passwordVerification,r=new w(t.length+e.length),r.set(Rn(n,e),0),o=12}else r=new w(t.length),o=0;r.set(Rn(n,t),o),e.enqueue(r)}})}}function xn(t,e,r,o){n.assign(t,{password:e,rawPassword:r,passwordVerification:o}),function(t,e,r){const o=[305419896,591751049,878082192];if(n.assign(t,{keys:o,S:new ve(o[0]),R:new ve(o[2])}),r)for(let e=0;e<r.length;e++)Fn(t,r[e]);else for(let n=0;n<e.length;n++)Fn(t,e.charCodeAt(n))}(t,e,r)}function zn(t,e){const n=new w(e.length);for(let r=0;r<e.length;r++)n[r]=Dn(t)^e[r],Fn(t,n[r]);return n}function Rn(t,e){const n=new w(e.length);for(let r=0;r<e.length;r++)n[r]=Dn(t)^e[r],Fn(t,e[r]);return n}function Fn(t,e){let[,n]=t.keys;t.S.append([e]);const r=~t.S.get();n=In(s.imul(In(n+An(r)),134775813)+1),t.R.append([n>>>24]);const o=~t.R.get();t.keys=[r,n,o]}function Dn(t){const e=2|t.keys[2];return An(s.imul(e,1^e)>>>8)}function An(t){return 255&t}function In(t){return 4294967295&t}function Cn(t){if(t instanceof F)return t;const e=t.getReader();return new F({async pull(t){const{value:n,done:r}=await e.read();r?t.close():t.enqueue(n)},cancel:t=>e.cancel(t)})}function Tn(t,e){t=Cn(t);const n=e?{type:e}:{};if(typeof y.prototype.stream!=pt||new y([]).stream()instanceof F)return new l(t).blob().then(t=>e?new y([t],n):t);const r=[];return t.pipeTo(new D({write(t){r.push(t)}})).then(()=>new y(r,n))}function kn(t){if(t instanceof D)return t;const e=t.getWriter();return new D({write:t=>e.write(t),close:()=>e.close(),abort:t=>e.abort(t)})}const vn="Invalid codec definition",_n="Reserved compression method",Nn="Invalid codec module",Un="Compression method not supported",On=[0,8,9,99],Mn=new c,Ln=new c;function Bn(t){return Mn.get(t)}function Wn(){return e.from(Mn.values(),t=>n.assign({},t,Ln.get(t.format)))}function Pn(t){return Ln.get(t)}function Zn(t,e){const{CompressionStream:n,DecompressionStream:r}=e;if(typeof n!=pt&&typeof r!=pt)throw new f(Nn);Ln.set(t,{CompressionStream:n,DecompressionStream:r})}const Hn="Invalid uncompressed size",Vn="Invalid compressed data",Gn="Invalid CRC32",jn="deflate-raw",qn="deflate64-raw",Yn="gzip",Kn=[31,139,8];class Xn extends R{constructor(t,{chunkSize:e,CompressionStreamFallback:n,CompressionStream:r}){super({});const{compressed:o,encrypted:i,useCompressionStream:s,zipCrypto:a,computeCrc32:c,level:u,deflate64:l,format:d,compressionMethod:f,inputSize:w}=t,p=this;let h,y,g,S=super.readable;const E=d&&Pn(d),b=c&&o&&!l&&!E&&(!i||a)&&Boolean(s&&r);if(i&&!a||!c||b||(h=new _e,S=ir(S,h)),o)if(E)S=sr(S,rr(E.CompressionStream,d,{level:u,chunkSize:e,compressionMethod:f,uncompressedSize:w}));else if(b)g=new Jn,S=sr(S,new r(Yn)),S=ir(S,g);else try{S=or(S,s,{level:u,chunkSize:e},r,n)}catch(t){let e;try{e=new r(Yn)}catch{throw t}S=sr(S,e),S=ir(S,new Jn)}i&&(a?S=ir(S,new bn(t)):(y=new wn(t),S=ir(S,y))),nr(p,S,()=>{i&&!a||!c||(p.crc32=b?g.crc32:new m(h.value.buffer).getUint32(0))})}}class Jn extends R{constructor(){let t,e=10,n=new w(0);super({transform(t,r){if(e){const n=s.min(e,t.length);if(e-=n,!(t=t.subarray(n)).length)return}const o=n.length+t.length;if(o<=8)return void(n=Se(n,t));const i=o-8,a=s.min(i,n.length);r.enqueue(Se(n.subarray(0,a),t.subarray(0,i-a))),n=Se(n.subarray(a),t.subarray(i-a))},flush(){const e=be(n);t.crc32=e.getUint32(0,!0),t.uncompressedSize=e.getUint32(4,!0)}}),t=this}}class Qn extends R{constructor(t,{chunkSize:e,DecompressionStreamFallback:n,DecompressionStream:r}){super({});const{zipCrypto:o,encrypted:i,checkCrc32:s,crc32:a,compressed:c,useCompressionStream:u,deflate64:l,format:d,compressionMethod:p,rawBitFlag:h,outputSize:y}=t;let S,E,b=super.readable;if(i&&(o?b=ir(b,new En(t)):(E=new fn(t),b=ir(b,E))),c){const t=d&&Pn(d);if(t)b=sr(b,rr(t.DecompressionStream,d,{chunkSize:e,compressionMethod:p,rawBitFlag:h,uncompressedSize:y}));else try{b=or(b,u,{chunkSize:e,deflate64:l},r,n)}catch(t){if(l||y===dt)throw t;let e;try{e=new r(Yn)}catch{throw t}b=function(t,e,n){const r=new ve;let o,i,s,a=0,c=!1;const u=new g((t,e)=>{i=t,s=e});u.catch(()=>{}),n||i();const l=new R({start(t){const e=new w(10);e.set(Kn),t.enqueue(e)},transform(t,e){e.enqueue(t)},async flush(t){c=!0,p();try{await u}finally{h()}const e=new w(8),o=be(e);o.setUint32(0,r.get(),!0),o.setUint32(4,n,!0),t.enqueue(e)},cancel(t){s(t)}}),d=new R({transform(t,e){r.append(t),a+=t.length,a>=n?i():c&&p(),e.enqueue(t)},cancel(t){s(t)}});return t=ir(t,l),ir(t=sr(t,e),d);function p(){h(),o=v(()=>s(new f(Hn)),5e3)}function h(){_(o)}}(b,e,y)}b=function(t){const e=t.getReader();return new F({async pull(t){let n;try{n=await e.read()}catch(t){if(t&&t.message)throw t;const e=new f(Vn);throw e.cause=t,e}const{value:r,done:o}=n;o?t.close():t.enqueue(r)},cancel:t=>e.cancel(t)})}(b)}s&&(S=new _e,b=ir(b,S)),nr(this,b,()=>{if(s){const t=new m(S.value.buffer);if(a!=t.getUint32(0,!1))throw new f(Gn)}})}}const $n=new c;function tr(t,e){if(!t)return!1;let n=$n.get(t);n||(n=new c,$n.set(t,n));let r=n.get(e);if(r===dt){try{new t(e),r=!0}catch{r=!1}n.set(e,r)}return r}function er(t){return tr(t,jn)}function nr(t,e,r){e=ir(e,new R({flush:r})),n.defineProperty(t,"readable",{get:()=>e})}function rr(t,e,n){if(!t)throw new f(Un);return new t(e,n)}function or(t,e,n,r,o){const i=e&&r?r:o||r,s=n.deflate64?qn:jn;let a;try{a=new i(s,n)}catch(t){if(!e||!o||i==o)throw t;a=new o(s,n)}return sr(t,a)}function ir(t,e){return Cn(t).pipeThrough(e)}function sr(t,e){const n=e.writable.getWriter(),r=t.getReader();return async function(){try{for(;;){await n.ready;const t=await r.read();if(t.done){await n.close();break}await n.write(t.value)}}catch(t){await async function(t,e){try{await t.abort(e)}catch{}}(n,t),await async function(t,e){try{await t.cancel(e)}catch{}}(r,t)}}(),e.readable}const ar="data",cr="deflate",ur="inflate";class lr extends R{constructor(t,e){super({});const r=this,{codecType:o}=t;let i;o.startsWith(cr)?i=Xn:o.startsWith(ur)&&(i=Qn),r.outputSize=0;let s=0;const a=new i(t,e),c=super.readable,u=new R({transform(t,e){t&&t.length&&(s+=t.length,e.enqueue(t))},flush(){n.assign(r,{inputSize:s})}}),l=new R({transform(e,n){if(e&&e.length&&(n.enqueue(e),r.outputSize+=e.length,t.outputSize!==dt&&r.outputSize>t.outputSize))throw new f(Hn)},flush(){const{crc32:t}=a;n.assign(r,{crc32:t,inputSize:s})}});n.defineProperty(r,"readable",{get:()=>c.pipeThrough(u).pipeThrough(a).pipeThrough(l)})}}class dr extends R{constructor(t){const e=[];let r=0,i=0;function s(){const n=new w(t);let o=0;for(;o<t;){const r=e[0],i=t-o;r.length<=i?(n.set(r,o),o+=r.length,e.shift()):(n.set(r.subarray(0,i),o),e[0]=r.subarray(i),o+=i)}return r-=t,n}(!o.isFinite(t)||t<1)&&(t=65536),super({transform(n,o){for(e.push(n),r+=n.length;r>t;)i+=t,o.enqueue(s())},flush(t){r&&(i+=r,t.enqueue(function(t,e){const n=new w(e);let r=0;for(const e of t)n.set(e,r),r+=e.length;return n}(e,r)))}}),n.defineProperty(this,"outputSize",{get:()=>i})}}const fr="Worker startup timeout";let wr,pr,hr,mr=()=>{};async function yr(t){const{CompressionStream:e,CompressionStreamFallback:n}=t;return!(!n||n.F)||!(!er(e)&&(r=e,!tr(r,Yn)))||!!n&&await gr();var r}async function gr(){if(mr)try{return await void 0,!0}catch{}return!1}function Sr(t){t.createWorker?pr=!0:wr=!1}class Er{constructor(t,{readable:e,writable:r},o,i){const{options:s,config:a,D:c,useWebWorkers:u,transferStreams:l,workerURI:d}=o;let{createWorker:f}=o;const{signal:w}=c;return pr&&(f=dt),n.assign(t,{A:!0,I:(t.I||0)+1,readable:e.pipeThrough(new dr(pe(a))).pipeThrough(new br(c),{signal:w}),writable:r,options:n.assign({},s),C:o,workerURI:d,createWorker:f,transferStreams:l,terminate:()=>new g(e=>{const{T:n,A:r}=t;r?t.v=e:(n&&(n.terminate(),t.T=null),e()),t._=null}),N(){if(t.A){const{v:e,T:n}=t;e&&(t.v=null,n&&(t.U=!0,n.terminate()),e()),t.A=!1,i(t)}}}),wr===dt&&(wr=typeof T!=wt),(u&&hr&&(wr&&d||f)?hr:zr)(t,a)}}class br extends R{constructor({onstart:t,onprogress:e,size:n,onend:r}){let o=0;super({async start(){t&&await xr(t,n)},async transform(t,r){o+=t.length,e&&await xr(e,o,n),r.enqueue(t)},async flush(){r&&await xr(r,o)}})}}async function xr(t,...e){try{await t(...e)}catch{}}function zr(t,e){return{run:()=>Rr(t,e)}}async function Rr({options:t,readable:e,writable:n,N:r,C:o},i){let s,a,c;try{if(t.compressed&&!t.format){const e=t.codecType.startsWith(cr),n=e?i.CompressionStreamFallback:i.DecompressionStreamFallback,r=e?i.CompressionStream:i.DecompressionStream;t.useCompressionStream?n&&n.F&&!er(r)&&await u():await u()||n&&!n.F||(t.useCompressionStream=!0)}t.encrypted&&!t.zipCrypto&&await u(),s=new lr(t,i),a=new dr(pe(i)),await e.pipeThrough(s).pipeThrough(a).pipeTo(n,{preventClose:!0,preventAbort:!0});const{crc32:r,inputSize:o,outputSize:c}=s;return{crc32:r,inputSize:o,outputSize:c}}catch(t){if(s){const e=a?a.outputSize:0;if(o.outputSize=e,xe(t))try{t.outputSize=e}catch{}}throw t}finally{r()}function u(){return c||(c=gr()),c}}const Fr={type:"module"},Dr="error";let Ar,Ir,Cr,Tr=!0;try{Tr=typeof N==pt&&N(new DOMException("","AbortError")).code!==dt}catch{}var kr;function vr(t){const{reader:e}=t;e&&e.releaseLock(),t.reader=null,t.writer=null}function _r(t){const{T:e}=t;if(e)try{e.terminate()}catch{}t._=null}function Nr(t,e,r,o,i=!0){const{createWorker:s}=r;let a,c,u;if(s)a=s();else if(Ir===dt||Ar!==t){const n=typeof t==pt;c=n?t(i):t;const s=c.startsWith("data:"),l=c.startsWith("blob:");if(s||l){o===dt&&(o=!1),o&&(u=Fr);try{a=new T(c,u)}catch(i){if(l)try{d.revokeObjectURL(c)}catch{}if(n&&l)return Nr(t,e,r,o,!1);if(o)throw i;return Nr(t,e,r,!0,!1)}}else{o===dt&&(o=!0),o&&(u=Fr);try{c=new d(c,e)}catch{}try{a=new T(c,u)}catch(n){if(o)return Nr(t,e,r,!1,i);throw n}}Ar=t,Ir=c,Cr=u}else a=new T(Ir,Cr);return a.addEventListener("message",t=>{r.O=!0,Ur(r),async function({data:t},e){const{type:r,value:o,messageId:i,result:s,error:a,errorValue:c}=t,{reader:u,writer:l,M:d,L:p,N:h,I:m}=e,y=()=>e.I!=m;try{if(a)g(function(t,e){const{message:r,stack:o,code:i,name:s,outputSize:a,cause:c,codecImportFailed:u}=t;let l;if(e?l=e.value:(l=n.assign(new f(r),{stack:o,code:i,name:s}),c&&(l.cause=n.assign(new f(c.message),{name:c.name}))),xe(l))try{a!==dt&&(l.outputSize=a),u&&(l.codecImportFailed=!0),e&&(l.name!==s&&(l.name=s),l.code!==i&&(l.code=i))}catch{}return l}(a,c));else{if("pull"==r){const{value:t,done:n}=await u.read();y()||Mr({type:ar,value:t,done:n,messageId:i},e)}if(r==ar){const t=new w(o);await l.ready,await l.write(t),y()||Mr({type:"ack",messageId:i},e)}"close"==r&&function(t){y()||(d(t),S(),h())}(s)}}catch(a){y()||(_r(e),g(a))}function g(t){y()||(p(t),S(),xe(t)&&t.codecImportFailed||h())}function S(){l&&l.releaseLock()}}(t,r)}),a.addEventListener(Dr,t=>Or(t,r)),a.addEventListener("messageerror",t=>Or(t,r)),a}function Ur(t){const{B:e}=t;e&&(_(e),t.B=null)}function Or(t,e){t.preventDefault&&t.preventDefault(),Ur(e);const{O:r,L:o,writer:i,N:s}=e;_r(e),r||(e.T=null);let a=t.error||new f(t.message||Dr);r||(a=n.assign(new f(a.message||Dr),{W:!0}),e.P=a),o&&(o(a),i&&i.releaseLock(),r&&s())}function Mr(t,{T:e,writer:n,transferStreams:r,O:o}){try{const{value:n,readable:i,writable:s}=t,a=[];if(n&&(t.value=Ee(n),a.push(t.value.buffer)),r&&Tr&&o?(i&&a.push(i),s&&a.push(s)):t.readable=t.writable=null,a.length)try{return e.postMessage(t,a),!0}catch{Tr=!1,t.readable=t.writable=null,e.postMessage(t)}else e.postMessage(t)}catch(t){throw n&&n.releaseLock(),t}}kr=function(t,e){const{baseURI:r,chunkSize:i,workerStartupTimeout:s}=e;let{wasmURI:a}=e;if(!t._){let c;typeof a==pt&&(a=a());try{c=Nr(t.workerURI,r,t)}catch{return Sr(t),zr(t,e)}n.assign(t,{T:c,O:!1,U:!1,P:null,_:{run:async()=>{try{return await async function(t,e){if(!t.T){const{P:e}=t;t.P=null;const n=e||new f(fr);throw n.W=!0,n}let r,i;const s=new g((e,n)=>{r=e,i=e=>{const{outputSize:r,C:o}=t;if(o.outputSize=r,xe(e))try{e.outputSize=r}catch{}n(e)}});n.assign(t,{reader:null,writer:null,outputSize:0,Z:!1,H:null,M:r,L:i,result:s});const{readable:a,options:c}=t,{writable:u,closed:l,V:d}=function(t,e){const r=new AbortController;let o;const{writable:i,readable:s}=new R({transform(t,n){e.outputSize+=t.length,n.enqueue(t)}}),a=s.pipeTo(t,{preventClose:!0,preventAbort:!0,signal:r.signal});return a.catch(t=>{o||n.assign(e,{Z:!0,H:t})}),{writable:i,closed:a,V:()=>{o=!0,r.abort()}}}(t.writable,t);let w;try{w=Mr({type:"start",options:c,config:e,readable:a,writable:u},t)}catch(e){d();try{await l}catch{}throw t.N(),e}w||n.assign(t,{reader:a.getReader(),writer:u.getWriter()});const{workerStartupTimeout:p}=e;!t.O&&o.isFinite(p)&&p>=0&&(t.B=v(()=>function(t){if(t.B=null,t.O)return;const{L:e,writer:n}=t;if(_r(t),t.T=null,e){const t=new f(fr);t.W=!0,e(t),n&&n.releaseLock()}}(t),p));try{const t=await s;return await h(),await l,t}catch(e){await h(),d();try{await l}catch{}const{outputSize:n,C:r,Z:o,H:i}=t;r.outputSize=n;const s=xe(e)&&(e.codecImportFailed||e.W),a=o&&!s?i:e;if(xe(a))try{a.outputSize=n}catch{}throw a}async function h(){if(!w&&!u.locked)try{await u.getWriter().close()}catch{}}}(t,{chunkSize:i,wasmURI:a,baseURI:r,workerStartupTimeout:s})}catch(n){if(n&&n.W)return Sr(t),vr(t),Rr(t,e);if(n&&n.codecImportFailed){if(t.reader)return vr(t),Rr(t,e);t.N()}throw n}}}})}return t._},hr=kr;let Lr=[];const Br=[];let Wr,Pr,Zr=0;async function Hr(t,e){const{options:n,config:r}=e,{transferStreams:i,useWebWorkers:s,useCompressionStream:a,compressed:c,checkCrc32:u,computeCrc32:l,encrypted:f,format:w,codecURI:p}=n,{workerURI:h,createWorker:m,maxWorkers:y}=r;w&&(p&&(n.codecURI=function(t,e){try{return new d(t,e).toString()}catch{return t}}(p,r.baseURI)),await async function(t,e){!Ln.has(t)&&e&&Zn(t,await(import(/* webpackIgnore: true */ /* @vite-ignore */e)))}(w,n.codecURI)),e.transferStreams=!w&&(i||i===dt&&r.transferStreams);const S=!(c||u||l||f),E=w===dt||Boolean(n.codecURI);return e.useWebWorkers=!S&&E&&(s||s===dt&&r.useWebWorkers),e.workerURI=e.useWebWorkers&&h?h:dt,e.createWorker=e.useWebWorkers&&m?m:dt,n.useCompressionStream=a||a===dt&&r.useCompressionStream,(await async function(){const n=Lr.find(t=>!t.A);if(n)return Yr(n),new Er(n,t,e,b);if(Lr.length<y){const n={G:Zr};return Zr++,Lr.push(n),new Er(n,t,e,b)}return new g(n=>{Br.push({resolve:n,stream:t,C:e}),Pr=r.workerStarvationTimeout,Vr()})}()).run();function b(t){if(Gr(),Br.length){const[{resolve:e,stream:n,C:r}]=Br.splice(0,1);e(new Er(t,n,r,b)),Vr()}else t.T?(Yr(t),function(t,e){const{config:n}=e,{terminateWorkerTimeout:r}=n;o.isFinite(r)&&r>=0&&(t.U?t.U=!1:t.j=v(async()=>{Lr=Lr.filter(e=>e!=t);try{await t.terminate()}catch{}},r))}(t,e)):Lr=Lr.filter(e=>e!=t)}}function Vr(){!Wr&&Br.length&&o.isFinite(Pr)&&Pr>=0&&(Wr=v(jr,Pr))}function Gr(){Wr&&(_(Wr),Wr=null)}function jr(){if(Wr=null,Br.length){const[{resolve:t,stream:e,C:r}]=Br.splice(0,1),o=n.assign({},r,{useWebWorkers:!1,workerURI:dt,createWorker:dt});t(new Er({},e,o,qr)),Vr()}}function qr(){Gr(),Vr()}function Yr(t){const{j:e}=t;e&&(_(e),t.j=null)}const Kr="\0\u263a\u263b\u2665\u2666\u2663\u2660\u2022\u25d8\u25cb\u25d9\u2642\u2640\u266a\u266b\u263c\u25ba\u25c4\u2195\u203c\xb6\xa7\u25ac\u21a8\u2191\u2193\u2192\u2190\u221f\u2194\u25b2\u25bc !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~\u2302\xc7\xfc\xe9\xe2\xe4\xe0\xe5\xe7\xea\xeb\xe8\xef\xee\xec\xc4\xc5\xc9\xe6\xc6\xf4\xf6\xf2\xfb\xf9\xff\xd6\xdc\xa2\xa3\xa5\u20a7\u0192\xe1\xed\xf3\xfa\xf1\xd1\xaa\xba\xbf\u2310\xac\xbd\xbc\xa1\xab\xbb\u2591\u2592\u2593\u2502\u2524\u2561\u2562\u2556\u2555\u2563\u2551\u2557\u255d\u255c\u255b\u2510\u2514\u2534\u252c\u251c\u2500\u253c\u255e\u255f\u255a\u2554\u2569\u2566\u2560\u2550\u256c\u2567\u2568\u2564\u2565\u2559\u2558\u2552\u2553\u256b\u256a\u2518\u250c\u2588\u2584\u258c\u2590\u2580\u03b1\xdf\u0393\u03c0\u03a3\u03c3\xb5\u03c4\u03a6\u0398\u03a9\u03b4\u221e\u03c6\u03b5\u2229\u2261\xb1\u2265\u2264\u2320\u2321\xf7\u2248\xb0\u2219\xb7\u221a\u207f\xb2\u25a0\xa0".split("");function Xr(t,e){return Jr(t,e,!0)}function Jr(t,e,n){return e&&"cp437"==e.trim().toLowerCase()?function(t){let e="";for(let n=0;n<t.length;n++)e+=Kr[t[n]];return e}(t):new E(e,{ignoreBOM:n}).decode(t)}const Qr="HTTP error ",$r="HTTP Range not supported",to="HTTP resource changed",eo="Writer iterator completed too soon",no="Writer not initialized",ro="Invalid writer (size must be writable)",oo="Content-Range",io="Range",so="GET",ao="bytes",co=16777216,uo="writable",lo=k();class fo{constructor(){this.size=0}init(){this.initialized=!0}}class wo extends fo{get readable(){return this.createReadable()}createReadable({offset:t=0,size:e,chunkSize:n=pe(we())}={}){const r=this;let o=0;return n=he(n),new F({async pull(i){const a=e===dt?n:s.min(n,e-o),c=await Qo(r,t+o,a);c.length&&(i.enqueue(c),o+=c.length),(e!==dt&&o>=e||!c.length&&a)&&i.close()}})}}class po extends fo{constructor(){super();const t=this,e=new D({write(e){if(!t.initialized)throw new f(no);return t.writeUint8Array(Ee(e))}});n.defineProperty(t,uo,{get:()=>e})}writeUint8Array(){}}class ho extends wo{constructor(t){super();let e=t.length;for(;"="==t.charAt(e-1);)e--;const r=t.indexOf(",")+1;n.assign(this,{Y:t,K:r,size:s.floor(.75*(e-r))})}readUint8Array(t,e){const{K:n,Y:r}=this,o=new w(e),i=4*s.floor(t/3),a=atob(r.substring(i+n,4*s.ceil((t+e)/3)+n)),c=t-3*s.floor(i/4);let u=0;for(let t=c;t<c+e&&t<a.length;t++)o[t-c]=a.charCodeAt(t),u++;return u<o.length?o.subarray(0,u):o}}class mo extends po{constructor(t){super(),n.assign(this,{contentType:t,data:"data:"+(t||"")+";base64,",X:""})}writeUint8Array(t){const e=this;let n,o=e.X;const i=e.X.length;for(e.X="",n=0;n<3*s.floor((i+t.length)/3)-i;n++)o+=r.fromCharCode(t[n]);for(;n<t.length;n++)e.X+=r.fromCharCode(t[n]);o.length>2?e.data+=z(o):e.X=o+e.X}getData(){return this.data+z(this.X)}}let yo,go;class So extends wo{constructor(t){super(),n.assign(this,{J:t,size:t.size}),go||(go=(async()=>{try{const t=new y([new w(3)]).slice(1,2).stream().getReader();let e=0,n=await t.read();for(;!n.done;)e+=n.value.length,n=await t.read();yo=1==e}catch{yo=!1}})())}createReadable(t){const{J:e,size:n}=this,{offset:r=0,size:o=n-r}=t||{};if(typeof e.stream==pt){if(!r&&o>=n)return Cn(e.stream());if(yo)return Cn(e.slice(r,r+o).stream())}return super.createReadable(t)}async readUint8Array(t,e){const n=this,r=t+e,o=!t&&r>=n.size?n.J:n.J.slice(t,r);let i=await o.arrayBuffer();return i.byteLength>e&&(i=i.slice(t,r)),new w(i)}}class Eo extends fo{constructor(t){super();const e=this,r=new R;n.defineProperty(e,uo,{get:()=>r.writable}),e.contentType=t,e.$=Tn(r.readable,t),e.$.catch(()=>{})}getData(){return this.$}}class bo extends So{constructor(t){super(new y([t],{type:"text/plain"}))}}function xo(t){let e=0;for(let n=0;n<t.length;n++){const r=t.charCodeAt(n);r<128?e+=1:r<2048?e+=2:r<55296||r>=57344?e+=3:r<56320&&56320==(64512&t.charCodeAt(n+1))?(e+=4,n++):e+=3}return e}class zo extends Eo{constructor(t){super(),n.assign(this,{encoding:t,et:!t||"utf-8"==t.toLowerCase()})}async getData(){const{encoding:t,et:e}=this,n=await super.getData();return n.text&&e?n.text():function(t,e){return Jr(t,e,!1)}(new w(await n.arrayBuffer()),t)}}class Ro extends wo{constructor(t,e){super(),Do(this,t,e)}async init(){await Ao(this,Wo,Oo),super.init()}createReadable(t){const e=this,{useRangeHeader:n,forceRangeRequests:r,size:o}=e;if((n||r)&&o!==dt){const{offset:n=0,size:r=o-n}=t||{};if(r>0&&n<o)return function(t,e,n){let r,o=e,i=0,a=n;return new F({start:()=>c(),async pull(t){r||await c();const{value:e,done:n}=await r.read();if(n)throw new f($r);const o=e.length>i?e.subarray(0,i):e;i-=o.length,a-=o.length,o.length&&t.enqueue(o),i||(await async function(){const t=r;r=dt,await t.cancel()}(),a||t.close())},cancel:t=>r&&r.cancel(t)});async function c(){const e=s.min(t.maximumRangeSize,a),n=await Wo(so,t,No(t,o,e));if(206!=n.status)throw new f($r);const c=Co(n);if(c!==dt&&c!=o)throw new f($r);_o(t,n),vo(t,n),o+=e,i=e,r=n.body.getReader()}}(e,n,s.min(r,o-n))}return super.createReadable(t)}readUint8Array(t,e){return Io(this,t,e,Wo,Oo)}}class Fo extends wo{constructor(t,e){super(),Do(this,t,e)}async init(){await Ao(this,Po,Mo),super.init()}readUint8Array(t,e){return Io(this,t,e,Po,Mo)}}function Do(t,e,r){const{preventHeadRequest:o,useRangeHeader:i,forceRangeRequests:s,combineSizeEocd:a,checkResourceChanges:c=!0,maximumRangeSize:u=co,fetch:l}=r;delete(r=n.assign({},r)).preventHeadRequest,delete r.useRangeHeader,delete r.forceRangeRequests,delete r.combineSizeEocd,delete r.checkResourceChanges,delete r.maximumRangeSize,delete r.useXHR,delete r.fetch,n.assign(t,{url:e,options:r,preventHeadRequest:o,useRangeHeader:i,forceRangeRequests:s,combineSizeEocd:a,checkResourceChanges:c,maximumRangeSize:u,fetch:l})}async function Ao(t,e,n){const{url:r,preventHeadRequest:o,useRangeHeader:i,forceRangeRequests:s,combineSizeEocd:a}=t;if(function(t){const{baseURI:e}=we(),{protocol:n}=new d(t,e);return"http:"==n||"https:"==n}(r)&&(i||s)&&(typeof o==wt||o)){const r=await e(so,t,No(t,a?-65557:void 0)),o=r.headers.get("Accept-Ranges");if(!(s||o&&o.toLowerCase()==ao))throw new f($r);{let o;a&&206==r.status&&(o=new w(await r.arrayBuffer())),vo(t,r);const i=To(r);i===dt?await Bo(t,e,n):t.size=i,o&&o.length&&Co(r)===t.size-o.length&&(t.nt=o)}}else await Bo(t,e,n)}async function Io(t,e,n,r,o){const{useRangeHeader:i,forceRangeRequests:s,nt:a,size:c,options:u}=t;if(i||s){if(e>=c||0===n)return gt;{if(e+n>c&&(n=c-e),a&&e>=c-a.length){const t=e-(c-a.length);return a.slice(t,t+n)}const o=await r(so,t,No(t,e,n));if(206!=o.status)throw new f($r);const i=Co(o);if(i!==dt&&i!=e)throw new f($r);_o(t,o),vo(t,o);const s=new w(await o.arrayBuffer());if(s.length!=n)throw new f($r);return s}}{const{data:r}=t;return r||await o(t,u),t.data.subarray(e,e+n)}}function Co(t){const e=t.headers.get(oo);if(e){const t=o(e.trim().split(/[\s-]+/)[1]);if(!o.isNaN(t))return t}}function To(t){const e=t.headers.get(oo);if(e){const t=e.trim().split(/\s*\/\s*/)[1];if(t&&"*"!=t){const e=o(t);if(!o.isNaN(e))return e}}}function ko({headers:t}){return{ot:t.get("Etag")||dt,lastModified:t.get("Last-Modified")||dt}}function vo(t,e){const{checkResourceChanges:n,it:r}=t;n&&!r&&206==e.status&&(t.it=ko(e))}function _o(t,e){const{checkResourceChanges:r,it:o,size:i}=t;if(r){const t=To(e);if(t!==dt&&i!==dt&&t!=i)throw new f(to);if(o){const t=ko(e);if(n.entries(o).some(([e,n])=>n!==dt&&t[e]!==dt&&n!=t[e]))throw new f(to)}}}function No(t,e=0,r=1){return n.assign({},Uo(t),{[io]:ao+"="+(e<0?e:e+"-"+(e+r-1))})}function Uo({options:t}){const{headers:e}=t;if(e)return k.iterator in e?n.fromEntries(e):e}async function Oo(t){await Lo(t,Wo)}async function Mo(t){await Lo(t,Po)}async function Lo(t,e){const n=await e(so,t,Uo(t));t.data=new w(await n.arrayBuffer()),t.size=t.data.length}async function Bo(t,e,n){if(t.preventHeadRequest)await n(t,t.options);else{const r=await e("HEAD",t,Uo(t)),i=r.headers.get("Content-Length");i&&!r.headers.get("Content-Encoding")?t.size=o(i):await n(t,t.options)}}async function Wo(t,{fetch:e=fetch,options:r,url:o},i){const s=await e(o,n.assign({},r,{method:t,headers:i}));if(s.status>=200&&s.status<=299)return s;throw 416==s.status?new f($r):new f(Qr+(s.statusText||s.status))}function Po(t,{url:e},r){return new g((o,i)=>{const s=new XMLHttpRequest;if(s.addEventListener("load",()=>{if(s.status>=200&&s.status<=299){const t=[];s.getAllResponseHeaders().trim().split(/[\r\n]+/).forEach(e=>{const n=e.trim().split(/\s*:\s*/);n[0]=n[0].trim().replace(/^[a-z]|-[a-z]/g,t=>t.toUpperCase()),t.push(n)}),o({status:s.status,arrayBuffer:()=>s.response,headers:new c(t)})}else i(416==s.status?new f($r):new f(Qr+(s.statusText||s.status)))},!1),s.addEventListener("error",t=>i(t.detail?t.detail.error:new f("Network error")),!1),s.open(t,e),r)for(const t of n.entries(r))s.setRequestHeader(t[0],t[1]);s.responseType="arraybuffer",s.send()})}class Zo extends wo{constructor(t,e={}){super(),n.assign(this,{url:t,reader:e.useXHR&&!e.fetch?new Fo(t,e):new Ro(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 Ho extends wo{constructor(t){super(),t=new w(t.buffer,t.byteOffset,t.byteLength),n.assign(this,{st:t,size:t.length})}readUint8Array(t,e){return this.st.slice(t,t+e)}}class Vo extends po{constructor(t){super(),this.ct=t||262144}init(t=0){n.assign(this,{offset:0,st:new w(t>0?t:this.ct)}),super.init()}writeUint8Array(t){const e=this,n=e.offset+t.length;if(n>e.st.length){let t=e.st.length?2*e.st.length:e.ct;for(;t<n;)t*=2;const r=e.st;e.st=new w(t),e.st.set(r)}e.st.set(t,e.offset),e.offset+=t.length}getData(){return this.offset===this.st.length?this.st:this.st.slice(0,this.offset)}}class Go extends wo{constructor(t){super(),this.ut=t}async init(){const t=this;t.lt=0;const e=t.ut=await g.all(t.ut.map(Jo));t.ft=e.map(e=>{const n=t.size;return t.size+=e.size,n}),super.init()}wt(t){const{ft:e,size:n}=this,r=e[t];return r===dt?n:r}async readUint8Array(t,e){const n=this,{ut:r}=this;let o,i=0,a=t;for(;r[i]&&a>=r[i].size;)a-=r[i].size,i++;const c=r[i];if(c){const r=c.size;if(a+e<=r)o=await Qo(c,a,e);else{const i=r-a;o=Se(await Qo(c,a,i),await n.readUint8Array(t+i,e-i))}}else o=gt;return n.lt=s.max(i,n.lt),o}}class jo extends fo{constructor(t,e=4294967295){super();const r=this;let o,i,s;n.assign(r,{diskNumber:0,diskOffset:0,size:0,maxSize:e,availableSize:e});const a=new D({async write(e){if(e===lo)return void(s&&await u());const{availableSize:n}=r;if(s)e.length>=n?(await c(e.subarray(0,n)),await u(),e.length>n&&await this.write(e.subarray(n))):await c(e);else{const{value:n,done:a}=await t.next();if(a&&!n)throw new f(eo);o=n,o.size=0,o.maxSize&&(r.maxSize=o.maxSize),r.availableSize=r.maxSize,await Xo(o),i=n.writable,s=i.getWriter(),await this.write(e)}},async close(){s&&(await s.ready,await l())},async abort(t){s&&await s.abort(t)}});async function c(t){const e=t.length;e&&(await s.ready,await s.write(t),o.size+=e,r.availableSize-=e)}async function u(){await l(),r.diskOffset+=o.size,r.diskNumber++,s=null,r.availableSize=r.maxSize}async function l(){await s.close()}n.defineProperty(r,uo,{get:()=>a})}async closeDisk(){const t=this.writable.getWriter();try{await t.ready,await t.write(lo)}finally{t.releaseLock()}}}class qo{constructor(t){return e.isArray(t)&&(t=new Go(t)),(t instanceof F||typeof t.getReader==pt)&&(t={readable:Cn(t)}),t}}class Yo{constructor(t){t.writable===dt&&typeof t.next==pt&&(t=new jo(t)),(t instanceof D||typeof t.getWriter==pt)&&(t={writable:kn(t)});try{t.size=t.size===dt?0:t.size}catch{throw new f(ro)}return t}}function Ko(t){return Boolean(t&&t.getData)}async function Xo(t,e){if(!t.init||t.initialized)return g.resolve();await t.init(e)}async function Jo(t){return t=new qo(t),await Xo(t),t.size!==dt&&t.readUint8Array||(t=new So(await Tn(t.readable)),await Xo(t)),t}function Qo(t,e,n){return t.readUint8Array(e,n)}function $o(t,e){return t.createReadable?t.createReadable(e):t.readUint8Array?wo.prototype.createReadable.call(t,e):t.readable}function ti(t,e,n){if(!t.some(t=>t.reason==e)){const r={reason:e};n!==dt&&(r.filename=n),t.push(r)}}const ei="filename",ni="rawFilename",ri="comment",oi="rawComment",ii="uncompressedSize",si="compressedSize",ai="offset",ci="diskNumberStart",ui="lastModDate",li="rawLastModDate",di="lastAccessDate",fi="rawLastAccessDate",wi="creationDate",pi="rawCreationDate",hi="internalFileAttributes",mi="externalFileAttributes",yi="msdosAttributesRaw",gi="msdosAttributes",Si="msDosCompatible",Ei="zip64",bi="encrypted",xi="version",zi="versionMadeBy",Ri="zipCrypto",Fi="directory",Di="executable",Ai="compressionMethod",Ii="signature",Ci="extraField",Ti="unixMode",ki="setuid",vi="setgid",_i="sticky",Ni=[ei,ni,ii,si,ui,li,ri,oi,di,fi,wi,pi,ai,ci,hi,mi,yi,gi,Si,Ei,bi,xi,zi,Ri,Fi,Di,"symlink",Ai,Ii,"crc32",Ci,"extraFieldUnix","extraFieldInfoZip","extraFieldUnixType1","extraFieldPkwareUnix","uid","gid",Ti,"unixExternalUpper",ki,vi,_i,"bitFlag","rawBitFlag","filenameLength","extraFieldLength","filenameUTF8","commentUTF8","rawExtraField","extraFieldZip64","extraFieldUnicodePath","extraFieldUnicodeComment","extraFieldAES","extraFieldNTFS","extraFieldExtendedTimestamp","extraFieldUSDZ"];class Ui{constructor(t){Ni.forEach(e=>this[e]=t[e])}}const Oi=new u([1,J,10,Q,28789,25461,$,tt,et,22613,13]);function Mi(t,e,n){return t?e?12:16+4*n:0}const Li="File format is not recognized",Bi="End of central directory not found",Wi="End of Zip64 central directory locator not found",Pi="Central directory header not found",Zi="Local file header not found",Hi="Zip64 extra field not found",Vi="File contains encrypted entry",Gi="Encryption method not supported",ji="Split zip file",qi="Overlapping entry found",Yi="Entry data out of bounds",Ki="Ambiguous archive",Xi="Encrypted central directory is not supported",Ji="Unsafe filename",Qi="Invalid strictness (must be 'strict', 'balanced' or 'tolerant')",$i="Invalid filenameValidation (must be 'strict', 'balanced' or 'tolerant')",ts="Invalid maxAppendedDataSize (must be a number greater than or equal to 0)",es="64-bit value exceeds Number.MAX_SAFE_INTEGER",ns="unsorted central directory",rs="unknown version needed to extract",os="compressed patched data",is="malformed extra field",ss="unknown zip64 extensible data",as="wrapped entries count",cs="appended data",us="prepended data",ls="prepended central directory",ds="trailing central directory data",fs="duplicate filename",ws="mismatched zip64 end of central directory record",ps="multiple end of central directory records",hs="mismatched local file header (filename)",ms="mismatched local file header (general purpose bit flag)",ys="mismatched local file header (compression method)",gs="mismatched local file header (crc32 or sizes)",Ss=/^[a-zA-Z]:/,Es="utf-8",bs="cp437",xs=[[ii,O],[si,O],[ai,O],[ci,M]],zs={[M]:{ht:ia,bytes:4},[O]:{ht:sa,bytes:8}},Rs=i(o.MAX_SAFE_INTEGER);class Fs{constructor(t,e={}){n.assign(this,{reader:new qo(t),options:e,yt:new c})}async*getEntriesGenerator(t={}){const e=this;let{reader:r}=e;if(await Xo(r),r.size!==dt&&r.readUint8Array||(r=new So(await Tn(r.readable)),await Xo(r)),r.size<Y)throw new f(Li);const o=e.warnings=[],i=Zs(t,e.options),a=i==Lt,c=i!=Wt,l=Gs($s(e,t,_t),i),d=function(t,e){if(t===dt)return e;if(!Ps(t))throw new f($i);return t}($s(e,t,"filenameValidation"),i),w=$s(e,t,"normalizeFilename"),{gt:p,St:h}=await js(r,c,l);if(!p)throw await async function(t){return await Ws(t)==W}(r)?new f(ji):new f(Bi);c&&h>1&&Qs(ps);const m=be(p);let y=ia(m,12),g=ia(m,16);const S=p.offset,E=oa(m,20),b=S+Y+E,x=r.size-b;x>l&&Qs(cs),x>0&&ti(o,cs);let z=oa(m,4);const F=r.lt||0;let D,A,I,C,T,k=oa(m,6),v=oa(m,10),_=0,N=X;const U=g==O||y==O||v==M||k==M;if(g!=O&&k!=M&&(g+=Bs(r,k)),U){const t=p.offset>=K?await Qo(r,p.offset-K,K):gt,e=be(t);if(t.length==K&&ia(e,0)==j){g=Bs(r,ia(e,4))+sa(e,8);let t=await Qo(r,g,X),i=be(t);const c=p.offset-K-X;if((t.length<X||ia(i,0)!=G)&&g!=c&&c>=0){const e=g;g=c,g>e&&(_=g-e),t=await Qo(r,g,X),i=be(t)}if(t.length<X||ia(i,0)!=G)throw new f(Wi);if(I=!0,C=sa(i,4)>44,C){const t=s.min(sa(i,4)-44,r.size-g-X);t>0&&(N+=t,T=function(t){const e={rawExtensibleData:t};if(t.length>=28){const r=be(t),o=oa(r,26);n.assign(e,{compressionMethod:oa(r,0),compressedSize:sa(r,2),uncompressedSize:sa(r,10),encryptionAlgorithm:oa(r,18),bitLength:oa(r,20),flags:oa(r,22),hashAlgorithm:oa(r,24),hashData:t.subarray(28,28+o)})}return e}(await Qo(r,g+X,t)))}z==M?z=ia(i,16):z!=ia(i,16)&&Js(a,o,ws),k==M?k=ia(i,20):k!=ia(i,20)&&Js(a,o,ws),v==M?v=sa(i,32):v!=sa(i,32)&&Js(a,o,ws),y==O?y=sa(i,40):y!=sa(i,40)&&Js(a,o,ws),g=Bs(r,k)+sa(i,48)+_}}let B=y;const P=p.offset-(I?N+K:0);if(g>=r.size&&(_=r.size-g-y-Y,g=r.size-y-Y),F!=z)throw new f(ji);if(g<0)throw new f(Li);let Z=0,V=await Qo(r,g,y),J=be(V);if(y){if(V.length<4)throw new f(Li);const t=P-y;if(g!=t&&k==z){const e=ia(J,Z)==H||Boolean(T&&T.compressedSize)||Cs(J);let n=!e;if(!n&&t>=0&&t+4<=r.size&&(n=ia(be(await Qo(r,t,4)),0)==H),n){const n=g;g=t,g>n&&(_+=g-n,D=e),V=await Qo(r,g,y),J=be(V)}}}const Q=P-g;if(y!=Q&&Q>=0&&k==z&&(y=Q,V=await Qo(r,g,y),J=be(V)),g<0||g>=r.size)throw new f(Li);e.directoryOffset=g,e.directoryLength=B;const $=ta(e,t,"decryptCentralDirectory");let tt,et;if($&&v&&V.length>=4&&ia(J,0)!=H&&(C||Cs(J))){const t=function(t,e,n){const r=t&&t.compressedSize?t.compressedSize:e;return r>0&&r<=n?r:n}(T,B,V.length);et=V.subarray(t),V=await $(V.subarray(0,t),T),J=be(V),B=V.length,tt=!0}T&&!tt&&(V.length<4||ia(J,0)==H)&&ti(o,ss),A=g;const nt=$s(e,t,"filenameEncoding"),ct=$s(e,t,"commentEncoding"),ut=new u;let lt,ft=-1;const wt=!a&&!I;!v&&wt&&(v=Ts(J,V,Z),v&&ti(o,as));for(let i=0;i<v;i++){const a=new Is(r,e.options);if(Z+q>V.length||ia(J,Z)!=H){if(0==i&&!tt&&(C||Cs(J)))throw new f(Xi);throw new f(Pi)}vs(a,J,Z+6);const c=Boolean(a.bitFlag.languageEncodingFlag),u=Z+q,l=u+a.filenameLength,p=l+a.extraFieldLength,h=oa(J,Z+4),m=!(h>>8),y=h>>8==3,g=V.subarray(u,l),S=oa(J,Z+32),E=p+S,b=V.subarray(p,E),x=c,z=c,F=ia(J,Z+38),D=F&L,I={readOnly:Boolean(1&D),hidden:Boolean(2&D),system:Boolean(4&D),directory:Boolean(16&D),archive:Boolean(32&D)},T=ia(J,Z+42),k=ta(e,t,"decodeText")||Xr,N=x?Es:nt||bs,U=z?Es:ct||bs;let O=k(g,N,Ot);if(O===dt&&(O=Xr(g,N)),w){const t=w(O);t!==dt&&(O=t)}if(Vs(O,d)){const t=new f(Ji);throw t.filename=O,t}let B=k(b,U,Mt);B===dt&&(B=Xr(b,U)),n.assign(a,{index:i,Et:tt,versionMadeBy:h,msDosCompatible:m,zip64:!1,compressedSize:0,uncompressedSize:0,bt:S,offset:T,diskNumberStart:oa(J,Z+34),internalFileAttributes:oa(J,Z+36),externalFileAttributes:F,msdosAttributesRaw:D,msdosAttributes:I,rawFilename:g,filenameUTF8:x,commentUTF8:z,rawExtraField:V.subarray(l,p),rawComment:b,filename:O,comment:B}),_s(a,a,J,Z+6)&&ti(o,is,O),a.offset+=_;const W=Bs(r,a.diskNumberStart)+a.offset;A=s.min(W,A),W<ft&&ti(o,ns,O),ft=W,(a.version&L)>63&&ti(o,rs,O),32&~a.rawBitFlag||ti(o,os,O),ut.has(a.filename)&&(lt=!0),ut.add(a.filename);const P=a.externalFileAttributes>>16&M;a.unixMode===dt&&16877&P&&(a.unixMode=P);const G=Boolean(a.unixMode&it),j=Boolean(a.unixMode&st),Y=Boolean(512&a.unixMode),K=40960==((a.unixMode===dt?P:a.unixMode)&rt),X=!K&&(a.unixMode!==dt?!!(73&a.unixMode):y&&!!(73&P)),Q=a.unixMode!==dt&&(a.unixMode&rt)==ot,$=(P&rt)==ot;n.assign(a,{setuid:G,setgid:j,sticky:Y,symlink:K,unixExternalUpper:P,executable:X,directory:Q||$||m&&I.directory||a.filename.endsWith(at),zipCrypto:a.encrypted&&!a.extraFieldAES});const et=new Ui(a);if(et.getData=(t,n)=>a.getData(t,et,e.yt,n),et.arrayBuffer=async t=>{const r=new R,o=Tn(r.readable).then(t=>t.arrayBuffer());return o.catch(()=>{}),await a.getData(r,et,e.yt,n.assign({},t,{preventClose:!1})),o},Z=E,i==v-1&&wt){const t=Ts(J,V,Z);t&&(v+=t,ti(o,as))}const{onprogress:pt}=t;if(pt)try{await pt(i+1,v,new Ui(a))}catch{}yield et}let pt=Z,ht=ks(V.subarray(Z))||(tt?ks(et):dt);if(!ht&&!tt){const t=g+Z,e=s.min(P-t,65541);e>=6&&(ht=ks(await Qo(r,t,e)))}ht&&(e.digitalSignature=ht,pt=Z+6+ht.length),(Z!=B&&pt!=B||!tt&&Z!=y&&pt!=y)&&Js(a,o,ds),lt&&Js(a,o,fs);const mt=$s(e,t,"extractPrependedData"),yt=$s(e,t,"extractAppendedData"),St=(a||mt)&&v&&4==A&&await async function(t){const e=await Ws(t);return e==W||808471376==e}(r)?4:0;return a&&(_||v&&A>St)&&Qs(us),(_||v&&A>4)&&ti(o,us),D&&ti(o,ls),mt&&(e.prependedData=A>St?await Qo(r,St,A-St):gt),e.comment=E?await Qo(r,S+Y,E):gt,yt&&(e.appendedData=b<r.size?await Qo(r,b,r.size-b):gt),!0}async getEntries(t={}){const e=[];for await(const n of this.getEntriesGenerator(t))e.push(n);return e}async close(){const{reader:t}=this;t.readUint8Array||!t.readable||t.readable.locked||await t.readable.cancel()}[St](){return this.close()}}class Ds{constructor(t={}){let r;const{readable:o,writable:i}=new R({start(t){r=t}}),s=new Fs(o,t),a=s.getEntriesGenerator(),c=new u;this.readable=new F({async pull(t){const{done:e,value:r}=await a.next();if(e)return t.close();const o=function(t,e){const{readable:n,writable:r}=new R;let o;const i={cancel:async t=>{e.delete(i),await(o?o.cancel(t):n.cancel(t))}};return i.readable=new F({async pull(s){o||(o=n.getReader(),e.add(i),async function(){try{await t.getData(r,{preventClose:!1})}catch(t){try{await r.abort(t)}catch{}}finally{e.delete(i)}}());const{done:a,value:c}=await o.read();a?s.close():s.enqueue(c)},cancel:t=>i.cancel(t)},{highWaterMark:0}),i}(r,c),i={...r,readable:o.readable};delete i.getData,n.defineProperties(i,{localDirectory:{get:()=>r.localDirectory,enumerable:!0},warnings:{get:()=>r.warnings,enumerable:!0}}),t.enqueue(i)},async cancel(t){const n=e.from(c);c.clear(),r.error(t),await g.allSettled(n.map(e=>e.cancel(t))),await g.allSettled([a.return(),s.close()])}}),this.writable=i}}async function As(t,e={}){if(t=new qo(t),await Xo(t),t.size!==dt&&t.readUint8Array||(t=new So(await Tn(t.readable)),await Xo(t)),t.size<Y)return!1;const n=Zs(e,{}),r=n!=Wt,o=Gs(e[_t],n),{gt:i,St:s}=await js(t,r,o);if(!i||n==Lt&&s>1)return!1;const a=oa(be(i),20),c=i.offset+Y+a;return t.size-c<=o}let Is=class{constructor(t,e){n.assign(this,{reader:t,options:e})}async getData(t,e,r,o={}){const i=this,a=we(),{reader:c,index:u,offset:l,diskNumberStart:d,extraFieldAES:w,extraFieldZip64:p,compressionMethod:h,bitFlag:m,rawBitFlag:y,crc32:g,rawLastModDate:S,uncompressedSize:E,compressedSize:b}=i,{dataDescriptor:x}=m,z=e.localDirectory={},R=e.warnings=[],F=Bs(c,d)+l,A=await Qo(c,F,ct),I=be(A);let C=$s(i,o,Et),T=$s(i,o,bt);const k=Jt($s(i,o,xt)),v=Boolean(k),_=!0===k;if(Xt(C,T),C=C&&C.length&&C,T=T&&T.length&&T,w&&99!=w.originalCompressionMethod)throw new f(Un);if(A.length<ct||ia(I,0)!=B)throw new f(Zi);vs(z,I,4);const{extraFieldLength:N,filenameLength:U}=z,O=z.dataOffset=F+ct+U+N,M=$s(i,o,"checkLocalDirectory"),W=Zs(o,i.options),Z=function(t,e){return t===dt?e!=Wt:Boolean(t)}(M,W),H=$s(i,o,"checkLocalFilename"),V=function(t,e){return t===dt?e==Lt:Boolean(t)}(H===dt?M:H,W);let G=gt;if(V&&(U||N)){const t=await Qo(c,F+ct,U+N);G=t.subarray(0,U),z.rawExtraField=t.subarray(U)}else z.rawExtraField=N?await Qo(c,F+ct+U,N):gt;V&&(z.rawFilename=G),_s(i,z,I,4,!0)&&ti(R,is),function(t,e,n,r,o){const{rawFilename:i}=t,s=!o,a=t.Et&&!(8192&~e.rawBitFlag);!r||a||n.length==i.length&&!n.some((t,e)=>t!=i[e])||Js(s,o,hs),(2057&e.rawBitFlag)!=(2057&t.rawBitFlag)&&Js(s,o,ms),e.compressionMethod!=t.compressionMethod&&Js(s,o,ys),e.bitFlag.dataDescriptor||a||!(e.crc32||e.compressedSize||e.uncompressedSize)||e.crc32==t.crc32&&e.compressedSize==t.compressedSize&&e.uncompressedSize==t.uncompressedSize||Js(s,o,gs)}(i,z,G,V,Z?dt:R);const{lastAccessDate:j,creationDate:q,uid:Y,gid:K}=z;j&&(e.lastAccessDate=j),q&&(e.creationDate=q),Y!==dt&&e.uid===dt&&(e.uid=Y),K!==dt&&e.gid===dt&&(e.gid=K);const X=$s(i,o,"checkPasswordOnly"),J=i.encrypted&&z.encrypted&&(!_||X),Q=J&&!w;if(_||(e.zipCrypto=Q),J&&!(64&~z.rawBitFlag))throw new f(Gi);const $=v?dt:Bn(h);if(0!=h&&8!=h&&9!=h&&!$&&!v)throw new f(Un);if(J){if(!Q&&(w.strength<1||w.strength>3))throw new f(Gi);if(!C&&!T)throw new f(Vi)}if(O+b>c.size)throw new f(Yi);const tt=b,et=Cn(c.createReadable({offset:O,size:tt})),nt=Yt($s(i,o,zt));Kt(nt);let rt=$s(i,o,"checkOverlappingEntry");const ot=$s(i,o,"checkOverlappingEntryOnly");ot&&(rt=!0);const{onstart:it,onprogress:st,onend:at}=o,ut=0!=h&&!v,lt=v?b-Mi(J,Q,w&&w.strength):E,ft=9==h;let wt=$s(i,o,Ft);ft&&(wt=!1);const pt=$s(i,o,"checkCrc32"),ht=(pt===dt?$s(i,o,"checkSignature"):pt)&&!v&&(!J||Q||w&&1==w.vendorVersion),mt={options:{codecType:ur,password:C,rawPassword:T,zipCrypto:Q,encryptionStrength:w&&w.strength,checkCrc32:ht,checkAuthenticationCode:$s(i,o,"checkAuthenticationCode"),passwordVerification:Q&&(x?S>>>8&L:g>>>24&L),outputSize:lt,crc32:g,compressed:ut,encrypted:J,useWebWorkers:$s(i,o,Rt),useCompressionStream:wt,transferStreams:$s(i,o,Dt),deflate64:ft,format:$?$.format:dt,codecURI:$?$.codecURI:dt,compressionMethod:h,rawBitFlag:y,checkPasswordOnly:X},config:a,D:{signal:nt,size:tt,onstart:it,onprogress:st,onend:at}};let yt,St,It;rt&&await async function({reader:t,xt:e,index:n,offset:r,crc32:o,compressedSize:i,uncompressedSize:s,dataOffset:a,dataDescriptor:c,extraFieldZip64:u,yt:l}){let d=0;if(c&&(d=u?20:12),d){const n=await Qo(t,a+i,d+4),r=be(n);let c=n.length==d+4&&ia(r,0)==P;if(c){const t=Ls(r,4,u);(e.encrypted&&!e.zipCrypto||t.crc32==o)&&t.compressedSize==i&&t.uncompressedSize==s?d+=4:c=!1}if(n.length>=d){const t=Ls(r,c?4:0,u);t.signature=c,e.localDirectory.dataDescriptor=t}}const w={start:r,end:a+i+d,xt:e};for(const[t,e]of l)if(t!=n&&w.start<e.end&&e.start<w.end){const t=new f(qi);throw t.overlappingEntry=e.xt,t}l.set(n,w)}({reader:c,xt:e,index:u,offset:F,crc32:g,compressedSize:b,uncompressedSize:E,dataOffset:O,dataDescriptor:x||z.bitFlag.dataDescriptor,extraFieldZip64:p||z.extraFieldZip64,yt:r});try{if(!ot){X&&(t=new D),t=new Yo(t),await Xo(t,function(t,e,n){return s.min(t,n?1032*e:e)}(lt,b,ut)),({writable:yt}=t);const{outputSize:e}=await Hr({readable:et,writable:yt},mt);if(e!=lt)throw n.assign(new f(Hn),{outputSize:e});t.size+=e}}catch(e){const{outputSize:n}=mt;if(n!==dt?t.size+=n:xe(e)&&e.outputSize!==dt&&(t.size+=e.outputSize),!X||!xe(e)||e.message!=Qe)throw St=e,It=!0,e}finally{if((Ko(t)||!$s(i,o,At))&&yt&&!yt.locked){const t=yt.getWriter();if(It)try{await t.abort(St)}catch{}else await t.close()}}return X||ot?dt:t.getData?t.getData():yt}};function Cs(t){const e=s.min(t.byteLength,1024)-3;for(let n=0;n<e;n++)if(134630224==ia(t,n))return!0;return!1}function Ts(t,e,n){let r=0;for(;n+q<=e.length&&ia(t,n)==H;)n+=q+oa(t,n+28)+oa(t,n+30)+oa(t,n+32),r++;return r%65536?0:r}function ks(t){if(t.length>=6){const e=be(t);if(ia(e,0)==Z){const n=oa(e,4);if(6+n<=t.length)return t.subarray(6,6+n)}}}function vs(t,e,r){const o=t.rawBitFlag=oa(e,r+2),i=!(1&~o),s=ia(e,r+6);n.assign(t,{encrypted:i,version:oa(e,r),bitFlag:{level:(6&o)>>1,dataDescriptor:!(8&~o),languageEncodingFlag:(o&nt)==nt},rawLastModDate:s,lastModDate:ea(s),filenameLength:oa(e,r+22),extraFieldLength:oa(e,r+24)})}function _s(t,e,r,o,i){const{rawExtraField:s}=e,u=e.extraField=new c,l=be(s);let d=0,w=!1;try{for(;d<s.length;){const t=oa(l,d),e=oa(l,d+2);u.set(t,{type:t,data:s.slice(d+4,d+4+e)}),d+=4+e}}catch{w=!0}d>s.length&&(w=!0);const p=oa(r,o+4);n.assign(e,{signature:ia(r,o+10),crc32:ia(r,o+10),compressedSize:ia(r,o+14),uncompressedSize:ia(r,o+18)});const h=u.get(1);h&&(function(t,e){e.zip64=!0;const n=be(t.data),r=xs.filter(([t,n])=>e[t]==n),o=r.reduce((t,[,e])=>t+zs[e].bytes,0);if(t.data.length<o)throw new f(Hi);for(let o=0,i=0;o<r.length;o++){const[s,a]=r[o],c=zs[a];e[s]=t[s]=c.ht(n,i),i+=c.bytes}}(h,e),e.extraFieldZip64=h);const m=u.get(28789);m&&(Ns(m,ei,ni,e,t),e.extraFieldUnicodePath=m);const y=u.get(25461);y&&(Ns(y,ri,oi,e,t),e.extraFieldUnicodeComment=y);const g=u.get(J);g&&g.data.length>=7?(function(t,e,r){const o=be(t.data),i=ra(o,4);n.assign(t,{vendorVersion:ra(o,0),vendorId:ra(o,2),strength:i,originalCompressionMethod:r,compressionMethod:oa(o,5)}),e.compressionMethod=t.compressionMethod,1!=t.vendorVersion&&(e.crc32=dt)}(g,e,p),e.extraFieldAES=g):e.compressionMethod=p;const S=u.get(13);S&&(Us(S,e),e.extraFieldPkwareUnix=S);const E=u.get(22613);E&&(Us(E,e),e.extraFieldUnixType1=E);const b=u.get(10);b&&(function(t,e){const r=be(t.data);let o,i=4;try{for(;i<t.data.length&&!o;){const e=oa(r,i),n=oa(r,i+2);1==e&&(o=t.data.slice(i+4,i+4+n)),i+=4+n}}catch{}if(o&&24==o.length){const r=be(o),i=r.getBigUint64(0,!0),s=r.getBigUint64(8,!0),a=r.getBigUint64(16,!0);n.assign(t,{rawLastModDate:i,rawLastAccessDate:s,rawCreationDate:a});const c={lastModDate:na(i),lastAccessDate:na(s),creationDate:na(a)};n.assign(t,c),n.assign(e,c,{rawLastAccessDate:s,rawCreationDate:a})}}(b,e),e.extraFieldNTFS=b);const x=u.get(et);let z;if(x&&(z=Os(x,e,!1),e.extraFieldUnix=x),!z){const t=u.get(tt);t&&(Os(t,e,!0),e.extraFieldInfoZip=t)}const R=u.get(Q);R&&(function(t,e,n){if(!t.data.length)return;const r=be(t.data),o=ra(r,0),i=[],s=[];n?(1&~o||(i.push(ui),s.push(li)),2&~o||(i.push(di),s.push(fi)),4&~o||(i.push(wi),s.push(pi))):t.data.length>=5&&(i.push(ui),s.push(li));let c=1;i.forEach((n,o)=>{if(t.data.length>=c+4){const i=ia(r,c);e[n]=t[n]=new a(1e3*(0|i));const u=s[o];t[u]=i}c+=4})}(R,e,i),e.extraFieldExtendedTimestamp=R);const F=u.get($);return F&&(e.extraFieldUSDZ=F),w}function Ns(t,e,r,o,i){if(t.data.length<5)return void(t.valid=!1);const s=be(t.data),a=new ve;a.append(i[r]);const c=be(new w(4));c.setUint32(0,a.get(),!0);const u=ia(s,1),l=ra(s,0);n.assign(t,{version:l,[e]:Xr(t.data.subarray(5)),valid:1==l&&!i.bitFlag.languageEncodingFlag&&u==ia(c,0)}),t.valid&&(o[e]=t[e],o[e+"UTF8"]=!0)}function Us(t,e){if(t.data.length<8)return;const r=be(t.data),o={lastAccessDate:new a(1e3*(0|ia(r,0))),lastModDate:new a(1e3*(0|ia(r,4)))};t.data.length>=12&&(o.uid=oa(r,8),o.gid=oa(r,10)),n.assign(t,o),n.assign(e,o)}function Os(t,e,r){try{const o=be(t.data);let i,s;if(r){let e=0;const r=ra(o,e++),a=ra(o,e++);i=Ms(t.data.subarray(e,e+a)),e+=a;const c=ra(o,e++);s=Ms(t.data.subarray(e,e+c)),n.assign(t,{version:r,uid:i,gid:s})}else t.data.length>=4&&(i=oa(o,0),s=oa(o,2),n.assign(t,{uid:i,gid:s}));return i!==dt&&(e.uid=i),s!==dt&&(e.gid=s),i!==dt||s!==dt}catch{}}function Ms(t){const e=new w(4);return e.set(t,0),new m(e.buffer,e.byteOffset,4).getUint32(0,!0)}function Ls(t,e,n){const r=ia(t,e);let o,i;return n?(o=sa(t,e+4),i=sa(t,e+12)):(o=ia(t,e+4),i=ia(t,e+8)),{crc32:r,compressedSize:o,uncompressedSize:i}}function Bs(t,e){return t.wt?t.wt(e):0}async function Ws(t){return ia(be(await Qo(t,0,4)))}function Ps(t){return t===Lt||t===Bt||t===Wt}function Zs(t,e){return Hs(t,Hs(e,Bt))}function Hs(t,e){const n=t.strictness;if(n!==dt){if(!Ps(n))throw new f(Qi);return n}const r=t.checkAmbiguity;return r===dt?e:r?Lt:e==Wt?Wt:Bt}function Vs(t,e){if(e==Wt)return!1;const n=t.split("/");return n.length>1&&""===n[n.length-1]&&n.pop(),!!(n.includes("..")||t.startsWith("/")||t.startsWith("\\\\")||Ss.test(t))||e==Lt&&(n.includes(".")||n.includes(""))}function Gs(t,e){if(t!==dt){const e=te(t);if("number"!=typeof e||o.isNaN(e)||e<0)throw new f(ts);return e}return e==Lt?0:e==Wt?1/0:M}async function js(t,e,n){const{size:r}=t,o=s.min(r,65557),i={count:64};let a,c,u=0;for await(const[n,s,l,d,f]of qs(t,o)){const o=oa(n,d+20);if(f+Y+o==r){const o=await Ks(t,n,s,d,f,r,i);if(2==o){if(a||(a=Ys(l,d,f)),u++,!e||u>1)break}else 1!=o||c||(c=Ys(l,d,f))}}return a||(a=c),a||(a=await async function(t,e,n){const{size:r}=t,o=s.min(r,e==1/0?r:65557+e);let i,a;for await(const[e,s,c,u,l]of qs(t,o)){const o=Ys(c,u,l);i||(i=o);const d=await Ks(t,e,s,u,l,r,n);if(2==d)return o;1!=d||a||(a=o)}return a||i}(t,n,i)),{gt:a,St:u}}async function*qs(t,e){const n=t.size-e,r=await Qo(t,n,e),o=be(r);for(let t=r.length-Y;t>=0;t--)ia(o,t)==V&&(yield[o,n,r,t,n+t])}function Ys(t,e,n){return{offset:n,buffer:t.slice(e,e+Y).buffer}}async function Ks(t,e,n,r,o,i,s){const a=oa(e,r+10),c=ia(e,r+12),u=ia(e,r+16);if(a==M||c==O||u==O)return await Xs(t,e,n,o-K,i,s)==j?2:0;if(!a&&!c)return 1;const l=oa(e,r+6);for(const r of[o-c,Bs(t,l)+u])if(await Xs(t,e,n,r,i,s)==H)return 2;return 0}async function Xs(t,e,n,r,o,i){return r<0||r+4>o?dt:r>=n?ia(e,r-n):i.count>0?(i.count--,ia(be(await Qo(t,r,4)),0)):dt}function Js(t,e,n){t?Qs(n):ti(e,n)}function Qs(t){const e=new f(Ki);throw e.reason=t,e}function $s(t,e,n){return e[n]===dt?t.options[n]:e[n]}function ta(t,e,n){return qt($s(t,e,n))}function ea(t){const e=(4294901760&t)>>16,n=t&M,r=new a(1980+((65024&e)>>9),((480&e)>>5)-1,31&e,(63488&n)>>11,(2016&n)>>5,2*(31&n),0);return r<lt?lt:r}function na(t){return new a(o(t/i(1e4)-i(116444736e5)))}function ra(t,e){return t.getUint8(e)}function oa(t,e){return t.getUint16(e,!0)}function ia(t,e){return t.getUint32(e,!0)}function sa(t,e){const n=t.getBigUint64(e,!0);if(n>Rs)throw new f(es);return o(n)}var aa=n.freeze({__proto__:null,ERR_AMBIGUOUS_ARCHIVE:Ki,ERR_BAD_FORMAT:Li,ERR_CENTRAL_DIRECTORY_NOT_FOUND:Pi,ERR_ENCRYPTED:Vi,ERR_ENCRYPTED_CENTRAL_DIRECTORY:Xi,ERR_ENTRY_DATA_OUT_OF_BOUNDS:Yi,ERR_EOCDR_LOCATOR_ZIP64_NOT_FOUND:Wi,ERR_EOCDR_NOT_FOUND:Bi,ERR_EXTRAFIELD_ZIP64_NOT_FOUND:Hi,ERR_INVALID_AUTHENTICATION_CODE:Je,ERR_INVALID_COMPRESSED_DATA:Vn,ERR_INVALID_CRC32:Gn,ERR_INVALID_FILENAME_VALIDATION:$i,ERR_INVALID_MAX_APPENDED_DATA_SIZE:ts,ERR_INVALID_PASSWORD:Xe,ERR_INVALID_STRICTNESS:Qi,ERR_INVALID_UNCOMPRESSED_SIZE:Hn,ERR_LOCAL_FILE_HEADER_NOT_FOUND:Zi,ERR_OVERLAPPING_ENTRY:qi,ERR_SPLIT_ZIP_FILE:ji,ERR_UNSAFE_FILENAME:Ji,ERR_UNSUPPORTED_COMPRESSION:Un,ERR_UNSUPPORTED_ENCRYPTION:Gi,ERR_UNSUPPORTED_UINT64:es,ERR_WORKER_STARTUP_TIMEOUT:fr,WARNING_APPENDED_DATA:cs,WARNING_COMPRESSED_PATCHED_DATA:os,WARNING_DUPLICATE_FILENAME:fs,WARNING_MALFORMED_EXTRA_FIELD:is,WARNING_MISMATCHED_LOCAL_FILE_HEADER_BIT_FLAG:ms,WARNING_MISMATCHED_LOCAL_FILE_HEADER_COMPRESSION_METHOD:ys,WARNING_MISMATCHED_LOCAL_FILE_HEADER_CRC32_OR_SIZES:gs,WARNING_MISMATCHED_LOCAL_FILE_HEADER_FILENAME:hs,WARNING_MISMATCHED_ZIP64_END_OF_CENTRAL_DIRECTORY:ws,WARNING_MULTIPLE_END_OF_CENTRAL_DIRECTORY:ps,WARNING_PREPENDED_CENTRAL_DIRECTORY:ls,WARNING_PREPENDED_DATA:us,WARNING_TRAILING_CENTRAL_DIRECTORY_DATA:ds,WARNING_UNKNOWN_VERSION:rs,WARNING_UNKNOWN_ZIP64_EXTENSIBLE_DATA:ss,WARNING_UNSORTED_CENTRAL_DIRECTORY:ns,WARNING_WRAPPED_ENTRIES_COUNT:as,ZipReader:Fs,ZipReaderStream:Ds,isZipFile:As});const ca="File already exists",ua="Zip file comment exceeds 64KB",la="Invalid zip file comment (must be a Uint8Array)",da="File entry comment exceeds 64KB",fa="Invalid file entry comment (must be a string)",wa="Invalid date (must be a valid Date instance)",pa="File entry name exceeds 64KB",ha="Version exceeds 65535",ma="The strength must equal 1, 2, or 3",ya="Encryption is not supported in USDZ files",ga="Split zip files are not supported in USDZ files",Sa="Encryption is not supported when the 'passThrough' option is set to true (use 'compressed' instead)",Ea="Invalid extra field (must be a Map)",ba="Invalid extra field type (must be integer 0..65535)",xa="Invalid extra field data (must be a Uint8Array)",za="Extra field data exceeds 64KB",Ra=-2147483648,Fa=2147483647,Da=i(0),Aa=i("0x7fffffffffffffff"),Ia="Zip64 is not supported (set the 'zip64' option to 'true')",Ca="Undefined uncompressed size",Ta="Undefined compression method",ka="Undefined CRC32",va="Undetermined size",_a="Undefined reader",Na="Invalid reader (must be a Reader instance, a ReadableStream instance, or an object with a 'readable' property)",Ua="Zip file not empty",Oa="Invalid uid (must be integer 0..2^32-1)",Ma="Invalid gid (must be integer 0..2^32-1)",La="Invalid UNIX mode (must be integer 0..65535)",Ba="Invalid unixExtraFieldType (must be 'infozip' or 'unix')",Wa="uid/gid must be 0..65535 for unixExtraFieldType 'unix' (use 'infozip' for larger ids)",Pa="Invalid msdosAttributesRaw (must be integer 0..255)",Za="Invalid msdosAttributes (must be an object with boolean flags)",Ha="Invalid level (must be integer 0..9)",Va="Signature data exceeds 64KB",Ga="Invalid entry option (must be an entry returned by ZipReader#getEntries())",ja="The last modification date of an entry encrypted with ZipCrypto cannot be changed when passThrough is set",qa="compression unavailable",Ya="clamped last modification date",Ka=new w([7,0,2,0,65,69,3,0,0]),Xa="infozip",Ja="unix",Qa=[8,9,5,3];let $a=0;const tc=[];class ec{constructor(t,e={}){t=new Yo(t);const{availableSize:r=ft,maxSize:o=ft}=t,i=r>0&&r!==ft&&o>0&&o!==ft;if(i&&e[vt])throw new f(ga);n.assign(this,{writer:t,zt:i,options:e,Rt:new c,Ft:new u,offset:e[kt]===dt?t.size||t.writable.size||0:e[kt],Dt:e[kt]===dt?0:e[kt]-(t.size||t.writable.size||0),At:new u,It:[],warnings:[],Ct:0,Tt:0,kt:dt,vt:!1})}prependZip(t){return oc(this,async function(t,e){if(t.Ft.size)throw new f(Ua);await t._t(e)}(this,t))}appendZip(t){return oc(this,this._t(t))}async _t(t){const r=this,{At:o,Ft:i,Rt:s}=r;for(;o.size;)await g.allSettled(e.from(o));let a;const u=new g(t=>a=t);o.add(u);const l=[];let d;try{t=new qo(t),await Xo(t),t.size!==dt&&t.readUint8Array||(t=new So(await Tn(t.readable)),await Xo(t));const{ZipReader:o}=await g.resolve().then(function(){return aa}),a=new o(t),u=await a.getEntries();await a.close(),await Xo(r.writer);const{directoryOffset:w}=a;u.forEach(({filename:t})=>{if(i.has(t))throw new f(ca);i.add(t),l.push(t)}),r.Nt=!0;const{Ut:p}=r;r.Ut=new g(t=>d=()=>{r.Nt=!1,t()}),await p,r.zt&&(delete r.zt,await async function(t){return be(await Qo(t,0,4)).getUint32(0,!0)==W}(t)||(await Cc(r.writer,Ac()),r.offset+=4));const h=await async function(t,n,r,o){const{writer:i}=t,s=new c;if(i.closeDisk){const a=e.from(r).sort((t,e)=>Dc(n,t)-Dc(n,e));let c=0;for(const e of a){const r=Dc(n,e);await Rc(t,n,c,r-c),bc(i,await Fc(n,r))&&await i.closeDisk(),s.set(e,{offset:xc(t,i),diskNumberStart:Sc(i)}),c=r}await Rc(t,n,c,o-c)}else{const e=t.offset;await Rc(t,n,0,o),r.forEach(t=>s.set(t,{offset:e+Dc(n,t),diskNumberStart:0}))}return s}(r,t,u,w);u.forEach(t=>{const{version:e,rawLastModDate:r,rawFilename:o,bitFlag:i,encrypted:a,uncompressedSize:c,compressedSize:u,extraFieldZip64:l}=t;let{compressionMethod:d,rawExtraField:f}=t;const{level:w,languageEncodingFlag:p,dataDescriptor:m}=i;f=zc(f||gt),t.extraFieldAES&&(d=99);const y=Gc(f),g=Boolean(l)&&l.uncompressedSize!==dt,S=Boolean(l)&&l.compressedSize!==dt,E=-7&Yc(w,p,m,a,d)|w<<1,{Ot:b,Mt:x}=jc({version:e,bitFlag:E,compressionMethod:d,uncompressedSize:c,compressedSize:u,rawLastModDate:r,rawFilename:o,Lt:S,Bt:g,extraFieldLength:y}),{crc32:z}=t;z!==dt&&Zc(x,10,z);const{offset:R,diskNumberStart:F}=h.get(t);n.assign(t,{Wt:!0,Bt:g,Lt:S,offset:R,diskNumberStart:F,Pt:!1,Zt:gt,Ht:gt,Vt:gt,Gt:gt,jt:gt,rawExtraField:f,qt:gt,Ot:b,Mt:x}),s.set(t.filename,t)})}catch(t){throw l.forEach(t=>i.delete(t)),t}finally{a(),o.delete(u),d&&d()}}add(t="",e,r={}){const o=this,{At:s}=o,a=async function(t,e,r,o){const s=(o=n.assign({},o))[Ut];if(s!==dt){const{Yt:e,Kt:r}=ac(s,Jt(Nc(t,o,xt)),Nc(t,o,ui));delete o[Ut],o=n.assign(e,r,o)}if(Nc(t,o,Fi)&&!e.endsWith(at)&&(e+=at),t.Ft.has(e))throw new f(ca);t.Ft.add(e),$a<we().maxWorkers?$a++:await new g(t=>tc.push(t));try{return await async function(t,e,r,o){const s=cc(t,e,o);({name:e}=s);const a=uc(t,e,o),{comment:c}=a,u=o[Ci];t.Rt.set(e,dt);const l=t.kt,d={};let w,p;a.Xt.keepOrder&&(d.Jt=new g(t=>w=t)),t.kt=d;try{const{Xt:c}=a;0==c.level||c.compressionMethod!==dt||c.Qt||await yr(we())||(c.level=0,ti(t.warnings,qa,e));const u=await async function(t,e,{Xt:r},o){if(r.Qt&&!e&&!Nc(t,o,Fi))throw new f(_a);let i;if(e){if(e=new qo(e),await Xo(e),!e.readable&&!e.readUint8Array)throw new f(Na);({size:i}=e)}return n.assign({reader:e},dc(t,Boolean(e),i,r,o))}(t,r,a,o);({reader:r}=u);const h=Ec(t.writer),m=Sc(t.writer);let y=o.crc32===dt?o[Ii]:o.crc32;const S=u.Xt.encrypted&&!c.zipCrypto;if(c.Qt&&!c.$t&&S&&(y=dt),c.Qt&&r&&!S&&y===dt)throw new f(ka);const E=wc(o=n.assign({},o,s.Xt,a.Xt,u.Xt,{signature:o[Ii],crc32:y,offset:t.offset-h,diskNumberStart:m,[vt]:t.options[vt]}));E.te&&ti(t.warnings,Ya,e);const b=mc(o),x=Gc(E.ee,b.ne);p=await async function(t,e,r,o,s){const{Rt:a,writer:c}=t,{keepOrder:u,dataDescriptor:l,re:d,signal:w}=s,{oe:p,xt:h,ie:m,se:y}=o,S=t.options[vt];let E,b,x,z,F,D,A,I=h,C=0;const T=u&&m?m.Jt:dt;a.set(e,I);try{s.bufferedWrite||!u||t.Nt||t.Ct||t.Tt||!l&&!d?(E=!0,t.Ct++,A=s.createTempStream?await s.createTempStream():new R(dt,dt,{highWaterMark:ft}),A.size=0,await Xo(c)):(b=!0,t.Tt++,A=c,await T,await k()),await Xo(A);const h=Ec(c);t.zt&&!E&&await Ic(t,c),S&&!E&&pc(o,t.offset-h);const{ee:m}=p;E||await v();const y=Sc(c),x=xc(t,c);if(I.diskNumberStart=y,E||(F=!0,D=c.size,await Cc(A,m)),I=await async function(t,e,{diskNumberStart:r,Jt:o},s,a,c){const{oe:u,ae:l,ce:d}=s,{Ot:w,Mt:p,lastModDate:h,rawLastModDate:m,encrypted:y,compressed:g,version:S,compressionMethod:E,Zt:b,ue:x,Vt:z,le:R,de:F,Gt:D,jt:A,Ht:I}=u,{ne:C}=l,{rawFilename:T,lastAccessDate:k,creationDate:v,password:_,rawPassword:N,level:U,useUnicodeFileNames:M,zip64:B,Wt:W,Bt:P,Lt:Z,zipCrypto:H,dataDescriptor:V,directory:G,executable:j,versionMadeBy:q,rawComment:Y,rawExtraField:K,qt:X,useWebWorkers:J,transferStreams:Q,onstart:$,onprogress:tt,onend:et,signal:nt,encryptionStrength:rt,extendedTimestamp:ot,msDosCompatible:it,internalFileAttributes:st,externalFileAttributes:at,uid:ct,gid:ut,unixMode:lt,symlink:ft,setuid:wt,setgid:pt,sticky:ht,unixExternalUpper:mt,msdosAttributesRaw:yt,msdosAttributes:gt,useCompressionStream:St,Qt:Et,$t:bt,format:xt,codecURI:zt}=c,Rt={Jt:o,versionMadeBy:q,zip64:B,Wt:W,directory:Boolean(G),executable:Boolean(j),filenameUTF8:Boolean(M),rawFilename:T,commentUTF8:Boolean(M),rawComment:Y,Zt:b,ue:x,Vt:z,Gt:D,jt:A,Ht:I,rawExtraField:K,qt:X,extendedTimestamp:ot,msDosCompatible:it,internalFileAttributes:st,externalFileAttributes:at,diskNumberStart:r,uid:ct,gid:ut,unixMode:lt,symlink:Boolean(ft),setuid:wt,setgid:pt,sticky:ht,unixExternalUpper:mt,msdosAttributesRaw:yt,msdosAttributes:gt};let{crc32:Ft,uncompressedSize:Dt}=c,At=0;Et||(Dt=0);const{writable:It}=e;if(t){const n=t.size,r=Cn($o(t,{size:n})),o={options:{codecType:cr,inputSize:n,level:U,rawPassword:N,password:_,encryptionStrength:rt,zipCrypto:y&&H,passwordVerification:y&&H&&m>>8&L,computeCrc32:!Et,compressed:g&&!Et,encrypted:y&&!bt,useWebWorkers:J,useCompressionStream:St,transferStreams:Q,format:xt,codecURI:zt,compressionMethod:E},config:a,D:{signal:nt,size:n,onstart:$,onprogress:tt,onend:et}};try{const t=await Hr({readable:r,writable:It},o);if(At=t.outputSize,e.size+=At,Et||(Dt=t.inputSize,y&&!H||(Ft=t.crc32)),!Z&&At>=O||!P&&Dt>=O)throw new f(Ia)}catch(t){const{outputSize:n}=o;throw n!==dt?e.size+=n:xe(t)&&t.outputSize!==dt&&(e.size+=t.outputSize),t}}return function({crc32:t,compressedSize:e,uncompressedSize:n,oe:r,ae:o},{zip64:s,zipCrypto:a,Qt:c,dataDescriptor:u}){const{Mt:l,encrypted:d}=r,{fe:f,we:w}=o;d&&!a&&!c||t===dt||(Zc(l,10,t),u&&Zc(f,w,t)),s?u&&(Hc(f,w+4,i(e)),Hc(f,w+12,i(n))):(Zc(l,14,e),Zc(l,18,n),u&&(Zc(f,w+4,e),Zc(f,w+8,n)))}({crc32:Ft,compressedSize:At,uncompressedSize:Dt,oe:u,ae:l},c),V&&await Cc(e,C),n.assign(Rt,{uncompressedSize:Dt,compressedSize:At,lastModDate:h,rawLastModDate:m,creationDate:v,lastAccessDate:k,encrypted:Boolean(y),zipCrypto:Boolean(H),size:d+At,compressionMethod:E,version:S,Ot:w,Mt:p,signature:Ft,crc32:!y||H||Et?Ft:dt,le:R,de:F,Bt:P,Lt:Z}),Rt}(r,A,I,o,we(),s),E||(F=!1),a.set(e,I),I.filename=e,E){if(await g.all([A.writable.getWriter().close(),T]),await k(),t.zt&&await Ic(t,c),z=!0,D=c.size,await v(),I.diskNumberStart=Sc(c),I.offset=xc(t,c),S){const e=o.ce;pc(o,t.offset-Ec(c)),I.size+=o.ce-e}!function({rawFilename:t,encrypted:e,zip64:n,ue:r,crc32:o,compressedSize:s,uncompressedSize:a,Bt:c,Lt:u},l,{dataDescriptor:d,Qt:f}){if(d||((!e||f&&o!==dt)&&Zc(l,14,o),u||Zc(l,18,s),c||Zc(l,22,a)),n&&r){const e=ct+Gc(t)+4;Hc(l,e,i(a)),Hc(l,e+8,i(s))}}(I,p.pe,s),await Cc(c,p.ee),await Tc(A.readable,c,w,t=>C+=t),c.size+=A.size,z=!1}else I.diskNumberStart=y,I.offset=x;return t.offset+=I.size,I}catch(n){if(z||F){if(t.hasCorruptedEntries=!0,n)try{n.corruptedEntry=!0}catch{}t.offset+=c.size-D,E&&(t.offset+=C)}throw a.delete(e),n}finally{if(E&&t.Ct--,b&&t.Tt--,y&&y(T),x&&x(),E&&A&&A.dispose)try{await A.dispose()}catch{}}async function k(){t.Nt=!0;const{Ut:e}=t;t.Ut=new g(e=>x=()=>{t.Nt=!1,e()}),await e}async function v(){bc(c,Gc(p.ee))&&await c.closeDisk()}}(t,e,r,{oe:E,ae:b,ce:x,xt:d,ie:l,se:w},o)}catch(n){throw t.Rt.delete(e),n}finally{w&&w(l&&l.Jt)}return n.assign(p,{name:e,comment:c,extraField:u}),new Ui(p)}(t,e,r,o)}catch(n){throw t.Ft.delete(e),n}finally{const t=tc.shift();t?t():$a--}}(o,t,e,r);s.add(a);const c=()=>s.delete(a);return g.prototype.then.call(a,c,c),oc(o,a)}remove(t){const{Ft:e,Rt:n}=this;if(typeof t==mt&&(t=n.get(t)),t&&t.filename!==dt){const{filename:r}=t;if(e.has(r)&&n.has(r))return e.delete(r),n.delete(r),!0}return!1}async close(t=gt,n={}){const r=this,{At:o,writer:s}=this,{writable:a}=s;if(r.vt)return rc(s);if(!(t instanceof w))throw new f(la);if(Gc(t)>M)throw new f(ua);for(;o.size;)await g.allSettled(e.from(o));await g.allSettled(r.It.map(t=>t.he));const c=r.It.filter(t=>t.me&&!t.ye);if(c.length){const t=c.map(t=>t.error);c.forEach(t=>t.ye=!0);const[e]=t;try{e.entryErrors=t}catch{}throw e}return await async function(t,n,r){const{ge:o,Se:s}=yc(t.Rt),{Ee:a,be:c,xe:u}=await async function(t,n,r){const{Rt:o,writer:i}=t,s=new w(n);await Xo(i);let a=0,c=0,u=Sc(i),l=Ec(i),d=0;for(const[t,n]of e.from(o.values()).entries()){const{offset:e,rawFilename:f,Zt:w,Ht:p,Vt:h,Gt:m,jt:y,rawExtraField:g,qt:S,rawComment:E,versionMadeBy:b,Ot:x,Mt:z,Bt:R,Lt:F,Pt:D,ze:A,internalFileAttributes:I,externalFileAttributes:C,diskNumberStart:T,uncompressedSize:k,compressedSize:v}=n,_=Gc(w,p,h,m,y,g,S),N=q+Gc(f,E)+_;bc(i,a+N-c)&&(await Cc(i,s.slice(c,a)),c=a,d=0,await i.closeDisk()),0==t&&(u=Sc(i),l=Ec(i)),R||Zc(z,18,k),F||Zc(z,14,v),(A||D)&&n.version<45&&Pc(z,0,45);const U=gc(N);if(U.Re(H),U.Fe(b),U.De(x.subarray(0,24)),U.Fe(_),U.Fe(Gc(E)),U.Fe(D?M:T),U.Fe(I),U.Re(C),U.Re(A?O:e),U.De(f),U.De(w),U.De(p),U.De(h),U.De(m),U.De(y),U.De(g),U.De(S),U.De(E),Vc(s,U.st,a),a+=N,d++,r.onprogress)try{await r.onprogress(t+1,o.size,new Ui(n))}catch{}}return await Cc(i,c?s.slice(c):s),{Ee:{diskNumber:u,diskOffset:l},be:{diskNumber:Sc(i),Ae:d},xe:s}}(t,o,r),l=await async function(t,e,n){const r=Oc(t,n,Nt);if(r){const n=await r(e),o=Gc(n);if(o>M)throw new f(Va);const i=gc(6+o);i.Re(Z),i.Fe(o),i.De(n);const{writer:s}=t;return bc(s,Gc(i.st))&&await s.closeDisk(),await Cc(s,i.st),6+o}return 0}(t,u,r);await async function(t,e,n,r){const{writer:o}=t,{Ee:s,be:a,Ie:c,Se:u}=r;let{ge:l}=r,d=t.Rt.size,w=s.diskNumber,p=xc(t,s);const h=Gc(e);if(h>M)throw new f(ua);let m=Nc(t,n,Ei),y=Sc(o);if(bc(o,(m?98:Y)+h)&&y++,p>=O||l>=O||d>=M||y>=M){if(!1===m)throw new f(Ia);m=!0}else m===dt&&u&&(m=!0);const g=gc(m?98:Y);bc(o,Gc(g.st)+h)&&await o.closeDisk(),y=Sc(o);let S=y==a.diskNumber?a.Ae:0;m&&(g.Re(G),g.Ce(44),g.Fe(45),g.Fe(45),g.Re(y),g.Re(w),g.Ce(S),g.Ce(d),g.Ce(l),g.Ce(p),g.Re(j),g.Re(y),g.Ce(i(xc(t,o))+i(l)+i(c)),g.Re(y+1),Nc(t,n,"supportZip64SplitFile",!0)&&(y=M,w=M),S=M,d=M,p=O,l=O),g.Re(V),g.Fe(y),g.Fe(w),g.Fe(S),g.Fe(d),g.Re(l),g.Re(p),g.Fe(h),await Cc(o,g.st),h&&await Cc(o,e)}(t,n,r,{Ee:a,be:c,ge:o,Ie:l,Se:s})}(r,t,n),r.vt=!0,!Ko(s)&&Nc(r,n,At)||await a.getWriter().close(),rc(s)}[St](){return this.close()}}class nc extends g{then(t,e){const{Te:n}=this;return n&&(n.ye=!0),super.then(t,e)}}function rc(t){return t.getData?t.getData():t.writable}function oc(t,e){const r=new nc((t,n)=>g.prototype.then.call(e,t,n)),o={};return r.Te=o,o.he=g.prototype.then.call(r,dt,t=>n.assign(o,{me:!0,error:t})),t.It.push(o),r}async function ic(t,e){try{await t.writer.writable.abort(e)}catch{}}function sc(t,e,n){t.At.add(e),e.catch(t=>{try{n(t)}catch{}})}function ac(t,r,o){if(null===t||typeof t!=ht||e.isArray(t))throw new f(Ga);const{externalFileAttributes:i,versionMadeBy:u,comment:l,lastModDate:d,rawLastModDate:w,creationDate:p,lastAccessDate:h,uncompressedSize:m,encrypted:y,zipCrypto:g,crc32:S,compressionMethod:E,extraFieldAES:b,extraFieldUnix:x,internalFileAttributes:z,extraField:R,bitFlag:F,directory:D,uid:A,gid:I}=t,C={externalFileAttributes:i,versionMadeBy:u,comment:l,lastModDate:d,creationDate:p,lastAccessDate:h,internalFileAttributes:z,directory:D};F&&F.languageEncodingFlag&&(C[Ct]=!0);const T=function(t){if(t){const e=new c;if(t.forEach((t,n)=>{Oi.has(n)||e.set(n,t.data)}),e.size)return e}}(R);T&&(C[Ci]=T),A===dt&&I===dt||n.assign(C,{uid:A,gid:I,unixExtraFieldType:x?Ja:Xa});const k={};if(r&&!D)if(n.assign(k,{uncompressedSize:m,crc32:S,compressionMethod:E}),r!==Pt&&n.assign(k,{encrypted:y,zipCrypto:g,encryptionStrength:b?b.strength:dt}),F&&(k.dataDescriptor=F.dataDescriptor,k[It]=Qa[F.level]),o===dt)k.rawLastModDate=w;else if(r!==Pt&&g&&(!F||F.dataDescriptor)&&o instanceof a&&function(t){let e=new a(2e3*s.ceil(s.floor(t.getTime()/1e3)/2));return e<lt?e=lt:e>ut&&(e=ut),(e.getHours()<<3|e.getMinutes()>>3)&L}(o)!=(w>>>8&L))throw new f(ja);return{Yt:C,Kt:k}}function cc(t,n,r){let o=Nc(t,r,Si),i=Nc(t,r,zi,o?20:768);const s=Nc(t,r,Di),a=Mc(t,r,"uid"),c=Mc(t,r,"gid");let u=Mc(t,r,Ti),l=Nc(t,r,"unixExtraFieldType"),d=Nc(t,r,ki),w=Nc(t,r,vi),p=Nc(t,r,_i);if($t(a,O,Oa),$t(c,O,Ma),$t(u,M,La),l!==dt&&l!==Xa&&l!==Ja)throw new f(Ba);if(l===Ja&&(a!==dt&&a>M||c!==dt&&c>M))throw new f(Wa);l!==dt||a===dt&&c===dt||(l=Xa);let h=Mc(t,r,yi),m=Nc(t,r,gi);const y=h!==dt||m!==dt;if(a!==dt||c!==dt||u!==dt||l||s?(o=!1,i=i&L|768):y&&(o=!0,i&=L),$t(h,L,Pa),m&&(typeof m!==ht||e.isArray(m)))throw new f(Za);if(i>M)throw new f(ha);let g=Nc(t,r,mi);const S=g!==dt;S||(g=0),!r[Fi]&&n.endsWith(at)&&(r[Fi]=!0);const E=Nc(t,r,Fi);if(E?(n.endsWith(at)||(n+=at),S||(g=16,o||(g|=16877<<16))):o||S||(g=s?493<<16:27525120),!o){const t=u!==dt||Boolean(d||w||p);u=u===dt?g>>16&M:u&M,d?u|=it:d=Boolean(u&it),w?u|=st:w=Boolean(u&st),p?u|=512:p=Boolean(512&u),S&&!t||(E?u=-61441&u|ot:u&rt||(u|=32768),g=(u&M)<<16|g&M)}({msdosAttributesRaw:h,msdosAttributes:m}=function(t,e){if(t!==dt)t&=L;else if(e!==dt){const{readOnly:n,hidden:r,system:o,directory:i,archive:s}=e;let a=0;n&&(a|=1),r&&(a|=2),o&&(a|=4),i&&(a|=16),s&&(a|=32),t=a&L}return e===dt&&(e={readOnly:Boolean(1&t),hidden:Boolean(2&t),system:Boolean(4&t),directory:Boolean(16&t),archive:Boolean(32&t)}),{msdosAttributesRaw:t,msdosAttributes:e}}(h,m)),y&&(g=g&O|h&L);const b=g>>16&M,x=u!==dt&&40960==(u&rt);return{name:n,Xt:{versionMadeBy:i,msDosCompatible:Boolean(o),externalFileAttributes:g,unixExternalUpper:b,uid:a,gid:c,unixMode:u,unixExtraFieldType:l,symlink:x,setuid:d,setgid:w,sticky:p,msdosAttributesRaw:h,msdosAttributes:m}}}function uc(t,e,n){const r=Oc(t,n,"encodeText")||Ne;let i=r(e,Ot);if(i===dt&&(i=Ne(e)),Gc(i)>M)throw new f(pa);const s=n[ri]||"";if(typeof s!=mt)throw new f(fa);let c=r(s,Mt);if(c===dt&&(c=Ne(s)),Gc(c)>M)throw new f(da);const u=Nc(t,n,xi);if(u!==dt&&u>M)throw new f(ha);const l=Uc(t,n,ui,new a),d=Nc(t,n,li),w=Uc(t,n,di),p=Uc(t,n,wi),h=Nc(t,n,hi,0),m=Jt(Nc(t,n,xt)),y=Boolean(m),g=!0===m,S=Nc(t,n,Et),E=Nc(t,n,bt);Xt(S,E);const b=Mc(t,n,"encryptionStrength",3),x=Nc(t,n,Ri),z=Nc(t,n,"extendedTimestamp",!0),R=Nc(t,n,"ntfsTimestamp"),F=Nc(t,n,"keepOrder",!0),D=Nc(t,n,Rt),A=Nc(t,n,Dt),I=Nc(t,n,"bufferedWrite"),C=Oc(t,n,"createTempStream"),T=Nc(t,n,"dataDescriptorSignature",!0),k=Yt(Nc(t,n,zt));Kt(k);const v=Nc(t,n,Ct,!qc(i)||!qc(c)),_=Nc(t,n,Ai),N=y||_===dt?dt:Bn(_);if(!y&&_!==dt&&0!==_&&8!==_&&!N)throw new f(Un);let U=Mc(t,n,It);if($t(U,9,Ha),t.options[vt]){if(S!==dt||E!==dt)throw new f(ya);U===dt&&_===dt&&(U=0)}y&&(U=te(n[It]));let O=Nc(t,n,Ft),L=Nc(t,n,Tt);I&&L===dt&&(L=!1),(L===dt||x&&!g)&&(L=!0),U!==dt&&6!=U&&(O=!1);const B=Nc(t,n,Ei);if(!(x||S===dt&&E===dt||o.isInteger(b)&&b>=1&&b<=3))throw new f(ma);const W=lc(n[Ci]),P=lc(n.localExtraField),Z=lc(n.centralExtraField);return{comment:s,Xt:{rawFilename:i,rawComment:c,version:u,lastModDate:l,rawLastModDate:d,lastAccessDate:w,creationDate:p,internalFileAttributes:h,Qt:y,$t:g,password:S,rawPassword:E,encryptionStrength:b,zipCrypto:x,extendedTimestamp:z,ntfsTimestamp:R,keepOrder:F,useWebWorkers:D,transferStreams:A,bufferedWrite:I,createTempStream:C,dataDescriptorSignature:T,signal:k,useUnicodeFileNames:v,compressionMethod:_,format:N?N.format:dt,codecURI:N?N.codecURI:dt,ke:N?N.versionNeeded:dt,level:U,useCompressionStream:O,dataDescriptor:L,zip64:B,rawExtraField:W,ve:P,qt:Z}}}function lc(t){if(!t)return gt;if(!(t instanceof c))throw new f(Ea);let e=0,n=0;t.forEach((t,n)=>{if(Qt(n,M,ba),!(t instanceof w))throw new f(xa);if(Gc(t)>M)throw new f(za);e+=4+Gc(t)});const r=new w(e),o=be(r);return t.forEach((t,e)=>{Pc(o,n,e),Pc(o,n+2,Gc(t)),Vc(r,t,n+4),n+=4+Gc(t)}),r}function dc(t,e,n,r,o){const{Qt:i,$t:s,zipCrypto:a,password:c,rawPassword:u,encryptionStrength:l}=r;let{dataDescriptor:d,zip64:w,level:p,compressionMethod:h}=r,m=0,y=0,g=!1;if(i&&e){if(y=o[ii],y===dt)throw new f(Ca);if(h===dt)throw new f(Ta)}const S=!0===w,E=Nc(t,o,bi);if(e&&s&&!E&&Gc(c,u))throw new f(Sa);const b=e&&(Boolean(c&&Gc(c)||u&&Gc(u))||s&&E);e||(p=0,h=0);const x=Mi(b,a,l);e&&(i?(o.uncompressedSize=y,m=n===dt?Lc(y)+x:n+(s?0:x)):n===dt?(d=!0,(w||w===dt)&&(w=g=!0,m=4294967296)):(o.uncompressedSize=y=n,m=(Bc(h,p)?Lc(y):y)+x));const z=!(b||e&&(0!==n||i)||Bc(h,p));z&&Nc(t,o,Tt)===dt&&(d=!1);const R=S||g||y>=O,F=S||m>=O;if(R||F){if(!1===w)throw new f(Ia);w=!0}return w=w||!1,{_e:m,Xt:{dataDescriptor:d,re:z,zip64:w,Wt:S,Ne:g,Bt:R,Lt:F,uncompressedSize:y,level:p,compressionMethod:h,encrypted:b}}}function fc(t,e,n){const r=t.slice().sort((t,e)=>n?e-t:t-e);let o=e,i=0;for(const t of r){if(o>=O)break;o+=t,i++}return i}function wc(t){const{rawFilename:e,lastModDate:n,rawLastModDate:r,lastAccessDate:o,creationDate:i,level:c,zip64:u,zipCrypto:l,useUnicodeFileNames:d,dataDescriptor:w,directory:p,rawExtraField:h,ve:m,encryptionStrength:y,extendedTimestamp:g,ntfsTimestamp:S,Qt:E,encrypted:b,Bt:x,Lt:z,uncompressedSize:R,Ne:F,crc32:D}=t;let{version:A,compressionMethod:I}=t;const C=!p&&Bc(I,c);let T;const k=E||!C,v=u&&(t.bufferedWrite||!w||!x&&!z||k&&!F),_=v||u&&w&&(x||z);if(u&&(x||z)){const t=20,e=gc(t);if(e.Fe(1),e.Fe(t-4),T=e.st,v&&(e.Ce(R),k)){const t=Mi(b,l,y);e.Ce(E?0:R+t)}}else T=gt;let N,U,O,L,W;if(b&&!l){const t=gc(Gc(Ka)+2);t.Fe(J),t.De(Ka),N=t.st,N[8]=y}else N=gt;if(g){const t=vc(n),e=(P=t)>=Ra&&P<=Fa;if(e){const e=9+(o?4:0)+(i?4:0),n=gc(e);L=1+(o?2:0)+(i?4:0),W=t,n.Fe(Q),n.Fe(e-4),n.Ue(L),n.Re(t),o&&n.Re(_c(vc(o))),i&&n.Re(_c(vc(i))),O=n.st}else O=gt;if(S===dt?!e||Boolean(o||i):S)try{const t=kc(n),e=gc(36);e.Fe(10),e.Fe(32),e.Oe(4),e.Fe(1),e.Fe(24),e.Ce(t),e.Ce(o?kc(o):t),e.Ce(i?kc(i):t),U=e.st}catch{U=gt}else U=gt}else U=O=gt;var P;let Z;try{const{uid:e,gid:n,unixExtraFieldType:r}=t;if(r!=Xa||e===dt&&n===dt)if(r!=Ja||e===dt&&n===dt)Z=gt;else{const t=gc(8);t.Fe(et),t.Fe(4),t.Fe((e===dt?0:e)&M),t.Fe((n===dt?0:n)&M),Z=t.st}else{const t=hc(e===dt?0:e),r=hc(n===dt?0:n),o=3+t.length+r.length,i=gc(4+o);i.Fe(tt),i.Fe(o),i.Ue(1),i.Ue(t.length),i.De(t),i.Ue(r.length),i.De(r),Z=i.st}}catch{Z=gt}I===dt&&(I=C?8:0),A===dt&&(A=0!=I||p||b?20:10);const{ke:H}=t;C&&H!==dt&&(A=A>H?A:H),u&&(A=A>45?A:45),b&&!l&&(A=A>51?A:51,E&&D!==dt&&(N[4]=1),Pc(be(N),9,I),I=99);const V=_?Gc(T):0,G=V+Gc(N,O,U,Z,h,m);if(G+(t[vt]?67:0)>M)throw new f(za);const j=new a(2e3*s.ceil(s.floor(n.getTime()/1e3)/2)),q=j<lt?lt:j>ut?ut:j,Y=Gc(O)?new a(1e3*vc(n)):Gc(U)?n:q,{Ot:K,Mt:X,rawLastModDate:$}=jc({version:A,bitFlag:Yc(c,d,w,b,I),compressionMethod:I,uncompressedSize:R,lastModDate:q,rawLastModDate:r,rawFilename:e,Lt:z,Bt:x,extraFieldLength:G}),nt=gc(ct+Gc(e)+G),rt=nt.st,ot=be(rt);return nt.Re(B),nt.De(K),nt.De(e),_&&nt.De(T),nt.De(N),nt.De(O),nt.De(U),nt.De(Z),nt.De(h),nt.De(m),w&&(z||Zc(ot,18,0),x||Zc(ot,22,0)),{ee:rt,pe:ot,Ot:K,Mt:X,lastModDate:Y,te:Y===q&&j.getTime()!=q.getTime(),rawLastModDate:$,encrypted:b,compressed:C,version:A,compressionMethod:I,le:L,de:W,Zt:gt,ue:V,Vt:O,Gt:U,jt:Z,Ht:N,extraFieldLength:G}}function pc(t,e){const{oe:n}=t;let{ee:r,extraFieldLength:o}=n,i=64-(e+Gc(r))%64;i<4&&(i+=64);const s=new w(i),a=be(s);Pc(a,0,$),Pc(a,2,i-4);const c=r;n.ee=r=new w(Gc(c)+i),Vc(r,c),Vc(r,s,Gc(c));const u=be(r);Pc(u,28,o+i),n.pe=u,t.ce+=i}function hc(t){const e=new w(4);be(e).setUint32(0,t,!0);let n=4;for(;n>1&&0===e[n-1];)n--;return e.subarray(0,n)}function mc({zip64:t,dataDescriptor:e,dataDescriptorSignature:n}){let r,o=gt,i=0,s=t?20:12;return n&&(s+=4),e&&(o=new w(s),r=be(o),n&&(i=4,Zc(r,0,P))),{ne:o,fe:r,we:i}}function yc(t){let e=0,n=!1;for(const[,r]of t){const{rawFilename:t,Ht:o,rawComment:i,Gt:s,jt:a,rawExtraField:c,qt:u,le:l,de:d,Wt:w,uncompressedSize:p,compressedSize:h}=r;let{Bt:m,Lt:y}=r;w||(m&&p<O&&(m=r.Bt=!1),y&&h<O&&(y=r.Lt=!1)),n=n||m||y;const g=r.offset>=O,S=r.diskNumberStart>=M;let E,b;if(g||S||m||y){const t=4+(m?8:0)+(y?8:0)+(g?8:0)+(S?4:0),e=gc(t);e.Fe(1),e.Fe(t-4),m&&e.Ce(p),y&&e.Ce(h),g&&e.Ce(r.offset),S&&e.Re(r.diskNumberStart),E=e.st}else E=gt;if(r.Zt=E,r.ze=g,r.Pt=S,d===dt)b=gt;else{const t=gc(9);t.Fe(Q),t.Fe(5),t.Ue(l),t.Re(d),b=t.st}r.Vt=b;const x=Gc(E,o,s,a,b,c,u);if(x>M)throw new f(za);e+=q+Gc(t,i)+x}return{ge:e,Se:n}}function gc(t){const e=new w(t),n=be(e);let r=0;return{st:e,Ue:t=>{!function(t,e,n){t.setUint8(e,n)}(n,r,t),r+=1},Fe:t=>{Pc(n,r,t),r+=2},Re:t=>{Zc(n,r,t),r+=4},Ce:t=>{Hc(n,r,i(t)),r+=8},De:t=>{Vc(e,t,r),r+=Gc(t)},Oe:t=>r+=t}}function Sc(t){const{diskNumber:e=0}=t;return e}function Ec(t){const{diskOffset:e=0}=t;return e}function bc(t,e){const{availableSize:n=ft}=t;return e>n}function xc(t,{diskNumber:e=0,diskOffset:n=0}){return t.offset-n-(e?t.Dt:0)}function zc(t){const e=be(t);let n=0;for(;n+4<=Gc(t);){const r=4+Wc(e,n+2);if(1==Wc(e,n))return zc(Se(t.subarray(0,n),t.subarray(s.min(n+r,Gc(t)))));n+=r}return t}async function Rc(t,e,n,r){if(r>0){const{writer:o}=t;let i=0;try{await Tc($o(e,{offset:n,size:r}),o,dt,t=>i+=t)}catch(e){t.hasCorruptedEntries=!0;try{e.corruptedEntry=!0}catch{}throw e}finally{o.size+=i,t.offset+=i}}}async function Fc(t,e){const n=await Qo(t,e,ct);if(Gc(n)<ct)return ct;const r=be(n);return ct+Wc(r,26)+Wc(r,28)}function Dc(t,{offset:e,diskNumberStart:n}){return e+(t.wt?t.wt(n):0)}function Ac(){const t=new w(4);return Zc(be(t),0,W),t}async function Ic(t,e){delete t.zt,await Cc(e,Ac()),t.offset+=4}async function Cc(t,e){const{writable:n}=t,r=n.getWriter();try{await r.ready,t.size+=Gc(e),await r.write(e)}finally{r.releaseLock()}}async function Tc(t,e,n,r){const o=e.writable.getWriter();try{await t.pipeTo(new D({async write(t){await o.ready,await o.write(t),r(Gc(t))}}),{preventClose:!0,preventAbort:!0,signal:n})}finally{o.releaseLock()}}function kc(t){if(t){const e=(i(t.getTime())+i(116444736e5))*i(1e4);return e<Da?Da:e>Aa?Aa:e}}function vc(t){return s.floor(t.getTime()/1e3)}function _c(t){return s.min(Fa,s.max(Ra,t))}function Nc(t,e,n,r){const o=e[n]===dt?t.options[n]:e[n];return o===dt?r:o}function Uc(t,e,n,r){const i=Nc(t,e,n,r);if(null===i)return r;if(i!==dt&&(typeof i.getTime!=pt||o.isNaN(i.getTime())))throw new f(wa);return i}function Oc(t,e,n){return qt(Nc(t,e,n))}function Mc(t,e,n,r){return te(Nc(t,e,n,r))}function Lc(t){return t+5*(s.floor(t/16383)+1)}function Bc(t,e){return t===dt?e===dt||e>0:0!==t}function Wc(t,e){return t.getUint16(e,!0)}function Pc(t,e,n){t.setUint16(e,n,!0)}function Zc(t,e,n){t.setUint32(e,n,!0)}function Hc(t,e,n){t.setBigUint64(e,n,!0)}function Vc(t,e,n){t.set(e,n)}function Gc(...t){let e=0;return t.forEach(t=>t&&(e+=t.length)),e}function jc({version:t,bitFlag:e,compressionMethod:n,uncompressedSize:r,compressedSize:o,lastModDate:i,rawLastModDate:s,rawFilename:a,Lt:c,Bt:u,extraFieldLength:l}){const d=gc(26),f=d.st,w=be(f);if(d.Fe(t),d.Fe(e),d.Fe(n),s===dt){const t=new h(1),e=be(t);Pc(e,0,(i.getHours()<<6|i.getMinutes())<<5|i.getSeconds()/2),Pc(e,2,(i.getFullYear()-1980<<4|i.getMonth()+1)<<5|i.getDate()),s=t[0]}return d.Re(s),d.Oe(4),c||o!==dt?d.Re(c?O:o):d.Oe(4),u||r!==dt?d.Re(u?O:r):d.Oe(4),d.Fe(Gc(a)),d.Fe(l),{Ot:f,Mt:w,rawLastModDate:s}}function qc(t){return t.every(t=>t>=32&&t<=126)}function Yc(t,e,n,r,o){let i=0;return e&&(i|=nt),n&&(i|=8),8!=o&&9!=o||(t>=0&&t<=3&&(i|=6),t>3&&t<=5&&(i|=4),9==t&&(i|=2)),r&&(i|=1),i}function Kc(t,e){if(!t)return!1;const{Me:n}=t;return n?n.includes(e):tr(t,e)}const Xc=1048576,Jc=".zip.js-temp",Qc=1048576,$c=1048576,tu=".zip.js-temp",eu="createSyncAccessHandle is only available in dedicated workers";try{!function(t){const e=me(ge(t));n.assign(ie,e),n.assign(fe,e)}({baseURI:void 0===b&&"undefined"==typeof location?require("url").pathToFileURL(__filename).href:void 0===b?location.href:U&&"SCRIPT"===U.tagName.toUpperCase()&&U.src||new d("zip-fs-core.min.js",b.baseURI).href})}catch{}const nu="Entry filename already exists",ru="Duplicate entry filename in the imported zip file",ou='Invalid duplicates option (must be "throw", "keep-first" or "keep-last")',iu="Entry is an ancestor of target entry",su="Root directory cannot be moved",au="Target entry is not a directory",cu="Parent entry is not a directory",uu="Readable stream already consumed",lu="throw",du="keep-first",fu="keep-last",wu=new u([lu,du,fu]),pu="Invalid passThrough option (use readerOptions.passThrough or set uncompressedSize for each entry)",hu="Invalid readerOptions (must be an object)",mu="The 'compressed' passThrough option is only supported by Entry#getData() and ZipWriter#add()",yu="zipjs-abort-export";class gu{constructor(t,e,r,o){const i=this;if(t.root&&o&&o.getChildByName(e))throw new f(nu);r||(r={}),n.assign(i,{fs:t,name:e,data:r.data,options:r.options&&n.assign({},r.options),id:t.Le++,parent:o,children:[],uncompressedSize:r.uncompressedSize||0,Be:r.Be||r.uncompressedSize===dt,passThrough:r.passThrough,We:r.We||new a}),!o&&t.root||(t.entries[i.id]=i),o&&i.parent.children.push(i)}getFullname(){return this.getRelativeName()}getRelativeName(t=this.fs.root){let e=this.name,n=this.parent;for(;n&&n!=t;)e=(n.name?n.name+"/":"")+e,n=n.parent;return e}isDescendantOf(t){let e=this.parent;for(;e&&e.id!=t.id;)e=e.parent;return Boolean(e)}rename(t){const e=this;let n=e.parent;if(n){const r=ju(t);r&&(t=r.pop(),n=qu(n,r,e));const o=n.getChildByName(t);if(o&&o!=e)throw new f(nu);n!=e.parent&&(Tu(e),e.parent=n,n.children.push(e),Vu(e.fs,e))}e.name=t}setOptions(t){const e=n.assign({},this.options,t);this.options=n.fromEntries(n.entries(e).filter(([,t])=>t!==dt))}}class Su extends gu{constructor(t,e,n,r){super(t,e,n,r);const o=this;o.Reader=n.Reader,o.Writer=n.Writer,n.getData&&(o.getData=n.getData)}clone(){return new Su(this.fs,this.name,this)}async getData(t,e={}){const n=this;if(!t||t.constructor==n.Writer&&n.data&&function(t,e){const{contentType:n}=t;return n===dt||(t.constructor==Eo?e.type==n:t.constructor!=mo||e.startsWith("data:"+(n||"")+";base64,"))}(t,n.data))return n.data;{const r=n.reader=Iu(n.Reader,n.data,e),o=n.uncompressedSize||r.size;await g.all([Xo(r),Xo(t,o)]);const i=Yt(e.signal),s=function(t,e,n,r){const{onstart:o,onprogress:i,onend:s}=n,{readable:a}=e;return t.data instanceof Ui||!o&&!i&&!s?a:Cn(a).pipeThrough(new br({onstart:o,onprogress:i,onend:s,size:e.size}),{signal:r})}(n,r,e,i),a=!Ko(t)&&Boolean(e.preventClose);return n.uncompressedSize=r.size,await Cn(s).pipeTo(kn(t.writable),{signal:i,preventClose:a,preventAbort:a}),t.getData?t.getData():t.writable}}isPasswordProtected(){return Boolean(this.data&&this.data.encrypted)}async checkPassword(t,e={}){const r=this;if(!r.isPasswordProtected())return!0;try{return await r.data.getData(null,n.assign({},e,{password:t,checkPasswordOnly:!0})),!0}catch(t){if(xe(t)&&t.message==Xe)return!1;throw t}}getText(t,e){return this.getData(new zo(t),e)}getBlob(t,e){return this.getData(new Eo(t),e)}getData64URI(t,e){return this.getData(new mo(t),e)}getUint8Array(t){return this.getData(new Vo,t)}getWritable(t=new D,e){return this.getData({writable:t},e)}async getArrayBuffer(t){return Ee(await this.getUint8Array(t)).buffer}replaceBlob(t){Ou(this,{data:t,Reader:So,Writer:Eo,uncompressedSize:t.size})}replaceText(t){Ou(this,{data:t,Reader:bo,Writer:zo,uncompressedSize:xo(t)})}replaceData64URI(t){Ou(this,{data:t,Reader:ho,Writer:mo,uncompressedSize:Mu(t)})}replaceUint8Array(t){Ou(this,{data:t,Reader:Ho,Writer:Vo,uncompressedSize:t.length})}replaceReadable(t){Ou(this,{data:null,Reader:Du(t),Writer:null,uncompressedSize:dt})}}class Eu extends gu{constructor(t,e,n,r){super(t,e,n,r),this.directory=!0}clone(t){const e=this,n=new Eu(e.fs,e.name,e);return t&&(n.children=e.children.map(e=>{const r=e.clone(t);return r.parent=n,r})),n}addDirectory(t,e){return Gu(this,t,{options:e},!0)}addText(t,e,n={}){return Gu(this,t,{data:e,Reader:bo,Writer:zo,options:n,uncompressedSize:xo(e)})}addBlob(t,e,n={}){return Gu(this,t,{data:e,Reader:So,Writer:Eo,options:n,uncompressedSize:e.size})}addData64URI(t,e,n={}){return Gu(this,t,{data:e,Reader:ho,Writer:mo,options:n,uncompressedSize:Mu(e)})}addUint8Array(t,e,n={}){return Gu(this,t,{data:e,Reader:Ho,Writer:Vo,options:n,uncompressedSize:e.length})}addHttpContent(t,e,n={}){return Gu(this,t,{data:e,Reader:class extends Zo{constructor(t){super(t,n)}},options:n})}addReadable(t,e,n={}){return Gu(this,t,{Reader:Du(e),options:n})}addFileSystemEntry(t,e={}){return Wu(this,t,e)}addFileSystemHandle(t,e={}){return Wu(this,t,e)}addFile(t,e={}){return(e=n.assign({},e)).lastModDate||(e.lastModDate=new a(t.lastModified)),Gu(this,t.name,{data:t,Reader:function(){return{readable:t.stream(),size:t.size}},options:e,uncompressedSize:t.size})}importBlob(t,e){return this.importZip(new So(t),e)}importData64URI(t,e){return this.importZip(new ho(t),e)}importUint8Array(t,e){return this.importZip(new Ho(t),e)}importHttpContent(t,e){return this.importZip(new Zo(t,e),e)}importReadable(t,e){return this.importZip({readable:t},e)}exportBlob(t={}){return this.exportZip(new Eo(t.mimeType||"application/zip"),t)}exportData64URI(t={}){return this.exportZip(new mo(t.mimeType||"application/zip"),t)}exportUint8Array(t={}){return this.exportZip(new Vo,t)}async exportWritable(t=new D,e={}){return await this.exportZip({writable:t},e),t}exportFileSystemHandle(t,e={}){return async function(t,e,r){const{onstart:o,onprogress:i,onend:s}=r;Uu(r.passThrough);const a=Nu(r.readerOptions),c=new AbortController,{signal:u}=c,l=function(t,e){if(!Yt(t))return()=>{};if(t.aborted)return e.abort(t.reason),()=>{};const n=()=>e.abort(t.reason);return t.addEventListener("abort",n,{once:!0}),()=>t.removeEventListener("abort",n)}(r.signal,c),d=n.assign({},r,a,{signal:u,onstart:dt,onprogress:dt,onend:dt,preventClose:!1}),w=zu([t],t=>Fu(t,d.passThrough)),p=[];let h=!1,m=0;try{o&&await xr(o,w),await S(t,e),s&&await xr(s,m)}catch(t){try{t.exportedEntryNames=p}catch{}throw t}finally{l()}return e;function y(t){const e=t.getWriter();return new D({async write(t){await e.write(t),m+=t.length,i&&await xr(i,m,w)},close:()=>e.close(),abort:t=>e.abort(t)})}async function S(t,e){if(r.concurrent){const n=(await g.allSettled(t.children.map(t=>E(t,e)))).filter(t=>"rejected"==t.status);if(n.length){const t=n.filter(t=>!ku(t.reason));throw function(t){const[e]=t,n=t.slice(1).flatMap(t=>[t,...t&&t.entryErrors||[]]).filter(t=>t!==e);if(n.length)try{e.entryErrors=[...e.entryErrors||[],...n]}catch{}return e}((t.length?t:n).map(t=>t.reason))}}else for(const n of t.children)await E(n,e)}async function E(e,n){if(u.aborted){if(h||ku(u.reason))return;Kt(u)}try{if(e.directory){const t=await n.getDirectoryHandle(e.name,{create:!0});await S(e,t)}else{const r=await n.getFileHandle(e.name,{create:!0}),o=await r.createWritable();try{await e.getData({writable:y(o)},d)}catch(t){throw h?new f(yu):t}p.push(e.getRelativeName(t))}}catch(n){h=!0,c.abort(new f(yu));try{n.entryName===dt&&(n.entryName=e.getRelativeName(t),n.entryId=e.id)}catch{}throw n}}}(this,t,e)}async importZip(t,e={}){let r;t&&typeof t.getEntries==pt?(r=t,e=n.assign({},r.options,e)):(await Xo(t),r=new Fs(t,e)),Uu(e.passThrough);const o=function(t){if(t===dt)return lu;if(wu.has(t))return t;throw new f(ou)}(e.duplicates),i=[],s=await r.getEntries(e);for(const t of s){let r=this;try{const s=t.filename.split("/").filter(t=>""!=t&&"."!=t),a=s.pop();let c=!1;for(const t of s){const e=r;if(r=r.getChildByName(t),r){if(!r.directory){if(o==du){c=!0;break}if(o!=fu)throw new f(ru);this.fs.remove(r),r=new Eu(this.fs,t,{data:null},e),i.push(r)}}else r=new Eu(this.fs,t,{data:null},e),i.push(r)}if(c)continue;if(t.directory){let e=r;if(a){if(e=r.getChildByName(a),e&&(!e.directory||e.data)){if(o==du)continue;if(o!=fu)throw new f(ru);e.directory?e.data=t:(this.fs.remove(e),e=dt)}e||(e=new Eu(this.fs,a,{data:null},r),i.push(e))}e==this||e.data||(e.data=t)}else{const s=r.getChildByName(a);if(s){if(o==du)continue;if(o!=fu)throw new f(ru);this.fs.remove(s)}i.push(Gu(r,a,{data:t,Reader:Au(n.assign({},e)),uncompressedSize:e.passThrough?t.compressedSize:t.uncompressedSize,passThrough:e.passThrough}))}}catch(e){i.reverse().forEach(t=>this.fs.remove(t));try{e.cause={entry:t}}catch{}throw e}}return i}async exportZip(t,e={}){const r=this,o=Boolean(t)&&typeof t.add==pt;e=n.assign({},e),o||e.bufferedWrite!==dt||(e.bufferedWrite=!0);const[i]=await g.all([Cu(r,Nu(e.readerOptions)),o?dt:Xo(t)]),s=o?t:new ec(t,e);return await async function(t,e,r,o,i){const{onstart:s,onprogress:a,onend:c,onentryprogress:u}=o,l=e,d=zu(e.children,t=>Bu(t)?0:1);let f=0,w=0;if(s&&await xr(s,r),o.bufferedWrite)await async function t(e){const n=(await g.allSettled(e.children.map(async e=>{await p(e),await t(e)}))).find(t=>"rejected"==t.status);if(n)throw n.reason}(e);else for(const t of e.getChildren({recursive:!0}))await p(t);async function p(e){if(Bu(e))return;const{name:s,Yt:c}=vu(e,l,o);let p=0;const h=await t.add(s,i.get(e),n.assign(c,{onstart:dt,onend:dt,onprogress:async t=>{f+=t-p,p=t,a&&await xr(a,f,r)}}));w++,u&&await xr(u,w,d,h)}c&&await xr(c,f)}(s,r,zu([r],Ru),e,i),o?s:(await s.close(e.globalComment),t.getData?t.getData():t.writable)}async getExportedSize(t={}){const e=this;Nu((t=n.assign({},t)).readerOptions),t.bufferedWrite===dt&&(t.bufferedWrite=!0);const r=e.getChildren({recursive:!0}),o=r.filter(t=>!Bu(t)).map(n=>{const{name:r,Yt:o}=vu(n,e,t);return{name:r,size:n.directory?0:_u(n,Lu(n,t)),options:o}}),i=!t.bufferedWrite||o.every(t=>!1!==t.options.keepOrder)&&r.every(t=>Bu(t)||!t.children.length);return await async function(t,e,r,o){const i={options:t};if(qt(t[Nt]))throw new f(va);if(o!==dt&&!(o instanceof w))throw new f(la);const a=Gc(o);if(a>M)throw new f(ua);const l=t[vt],d=new c,p=t[kt]===dt?0:t[kt];let h=p,m=ft;const y=[],g=new u;for(const t of e){let{name:e}=t;const{size:r}=t,o=n.assign({},t.options);Nc(i,o,Fi)&&!e.endsWith(at)&&(e+=at);const a=cc(i,e,o);({name:e}=a);const{Xt:c}=uc(i,e,o);0==c.level||c.compressionMethod!==dt||c.Qt||await yr(we())||(c.level=0);const u=!Nc(i,o,Fi);if(u&&r===dt)throw new f(va);const{_e:w,Xt:p}=dc(i,u,r,c,o);if(u&&!c.Qt&&Bc(p.compressionMethod,p.level))throw new f(va);const S=n.assign({},o,a.Xt,c,p,{[vt]:l}),E=wc(S),b=mc(S),x={oe:E,ce:Gc(E.ee,b.ne)};l&&pc(x,h);const z=u?w:0;d.set(e,n.assign({},S,E,{offset:h,diskNumberStart:0,compressedSize:z}));const R=x.ce+z;y.push(R),g.add(Boolean(S.Wt||S.uncompressedSize>=O||z>=O)),m=s.min(m,R),h+=R}if(d.size>1&&(l||h-m>=O&&(g.size>1||fc(y,p,!0)!=fc(y,p,!1)))&&!r)throw new f(va);const{ge:S,Se:E}=yc(d);let b=Nc(i,t,Ei);if(h>=O||S>=O||d.size>=M){if(!1===b)throw new f(Ia);b=!0}else b===dt&&E&&(b=!0);return h-p+S+a+(b?98:Y)}(t,o,i,t.globalComment)}getChildByName(t){const e=this.children;for(let n=0;n<e.length;n++){const r=e[n];if(r.name==t)return r}}getChildren(t={}){return function(t,e){const n=[],r=[t];let o=0;for(;o<r.length;)for(const t of r[o++].children)n.push(t),e&&r.push(t);return n}(this,t.recursive)}isPasswordProtected(){const t=this.children;for(let e=0;e<t.length;e++)if(t[e].isPasswordProtected())return!0;return!1}async checkPassword(t,e={}){const n=this.children;return!(await g.all(n.map(n=>n.checkPassword(t,e)))).includes(!1)}}class bu{constructor(){Zu(this)}get children(){return this.root.children}remove(t){Tu(t);const e=[t];for(;e.length;){const t=e.pop();this.entries[t.id]=null;for(const n of t.children)e.push(n)}t.parent=dt}move(t,e){if(t==this.root)throw new f(su);if(!e.directory)throw new f(au);if(e.isDescendantOf(t))throw new f(iu);if(t!=e){const n=e.getChildByName(t.name);if(n){if(n!=t)throw new f(nu)}else Tu(t),t.parent=e,e.children.push(t),Vu(this,t)}}find(t){const e=t.split("/");let n=this.root;for(let t=0;n&&t<e.length;t++)n=n.directory?n.getChildByName(e[t]):dt;return n||(n=this.entries.find(e=>e&&(e==this.root||e.isDescendantOf(this.root))&&e.getRelativeName()==t)),n}getById(t){return this.entries[t]}getChildByName(t){return this.root.getChildByName(t)}getChildren(t){return this.root.getChildren(t)}addDirectory(t,e){return this.root.addDirectory(t,e)}addText(t,e,n){return this.root.addText(t,e,n)}addBlob(t,e,n){return this.root.addBlob(t,e,n)}addData64URI(t,e,n){return this.root.addData64URI(t,e,n)}addUint8Array(t,e,n){return this.root.addUint8Array(t,e,n)}addHttpContent(t,e,n){return this.root.addHttpContent(t,e,n)}addReadable(t,e,n){return this.root.addReadable(t,e,n)}addFileSystemEntry(t,e){return this.root.addFileSystemEntry(t,e)}addFileSystemHandle(t,e){return this.root.addFileSystemHandle(t,e)}addFile(t,e){return this.root.addFile(t,e)}importBlob(t,e){return Hu(this,n=>n.importBlob(t,e))}importData64URI(t,e){return Hu(this,n=>n.importData64URI(t,e))}importUint8Array(t,e){return Hu(this,n=>n.importUint8Array(t,e))}importHttpContent(t,e){return Hu(this,n=>n.importHttpContent(t,e))}importReadable(t,e){return Hu(this,n=>n.importReadable(t,e))}importZip(t,e){return Hu(this,n=>n.importZip(t,e))}exportBlob(t){return this.root.exportBlob(t)}exportData64URI(t){return this.root.exportData64URI(t)}exportUint8Array(t){return this.root.exportUint8Array(t)}exportWritable(t,e){return this.root.exportWritable(t,e)}exportFileSystemHandle(t,e){return this.root.exportFileSystemHandle(t,e)}exportZip(t,e){return this.root.exportZip(t,e)}getExportedSize(t){return this.root.getExportedSize(t)}isPasswordProtected(){return this.root.isPasswordProtected()}checkPassword(t,e){return this.root.checkPassword(t,e)}}const xu={FS:bu,ZipDirectoryEntry:Eu,ZipFileEntry:Su};function zu(t,n){let r=0;const o=e.from(t);for(;o.length;){const t=o.pop();r+=n(t)||0;for(const e of t.children)o.push(e)}return r}function Ru(t){return t.uncompressedSize}function Fu(t,e){const{data:n}=t;return e&&n instanceof Ui?n.compressedSize:t.uncompressedSize}function Du(t){let e;return function(){if(e)throw new f(uu);return e=!0,{readable:t}}}function Au(t){return class extends wo{constructor(t,e={}){super(),this.entry=t,this.options=e}async init(){const e=this,r=n.assign({},t,e.options),{checkOverlappingEntry:o,checkOverlappingEntryOnly:i}=r,s=await e.entry.getData(new Eo,n.assign(r,{checkPasswordOnly:!1,checkOverlappingEntry:i||o,checkOverlappingEntryOnly:!1,preventClose:!1}));e.data=s,e.Pe=new So(s),e.size=s.size,super.init()}readUint8Array(t,e){return this.Pe.readUint8Array(t,e)}}}function Iu(t,e,n){return t.prototype?new t(e,n):t(e,n)}async function Cu(t,e){const n=[],r=[t],o=new c;for(;r.length;){const t=r.pop();for(const e of t.children)e.directory?r.push(e):n.push(e)}return await g.all(n.map(async t=>{const n=t.reader=Iu(t.Reader,t.data,e);o.set(t,n);try{await Xo(n)}catch(e){try{e.entryId=t.id,e.cause={entry:t}}catch{}throw e}n.size!==dt&&(t.uncompressedSize=n.size,t.Be=!1)})),o}function Tu(t){if(t.parent){const e=t.parent.children;e.forEach((n,r)=>{n.id==t.id&&e.splice(r,1)})}}function ku(t){return Boolean(t)&&t.message==yu}function vu(t,e,r){const o=r.relativePath?t.getRelativeName(e):t.getFullname(),i=t.options||{};let s={},a={};if(t.data instanceof Ui){const e=Lu(t,r),n=i.lastModDate===dt?r.lastModDate:i.lastModDate;({Yt:s,Kt:a}=ac(t.data,e,n)),e&&(a.passThrough=!0)}const c=n.assign({lastModDate:t.We},s,r,i,a,{directory:t.directory});if(!t.directory&&c.passThrough&&c.uncompressedSize===dt)throw new f(pu);return{name:o,Yt:c}}function _u(t,e){const{reader:n}=t;return n&&n.size!==dt?n.size:t.Be?dt:Fu(t,e)}function Nu(t){if(t&&(typeof t!=ht||e.isArray(t)))throw new f(hu);return t&&Uu(t.passThrough),t}function Uu(t){if(Jt(t)===Pt)throw new f(mu)}function Ou(t,e){const{uncompressedSize:r}=e;n.assign(t,e,{reader:null,passThrough:dt,uncompressedSize:r===dt?0:r,Be:r===dt})}function Mu(t){let e=t.length;for(;"="==t.charAt(e-1);)e--;const n=t.indexOf(",")+1;return s.floor(.75*(e-n))}function Lu(t,e){const{readerOptions:n}=e;return Boolean(!t.directory&&(t.passThrough||n&&n.passThrough))}function Bu(t){return t.directory&&null===t.data}function Wu(t,e,r){return async function t(e,o,i,s=""){if(o){const c=s?s+"/"+o.name:o.name;try{if((o.isFile||o.isDirectory)&&(o=await Pu(o)),"file"==o.kind){const t=await o.getFile();i.push(Gu(e,t.name,{Reader:function(){return{readable:t.stream(),size:t.size}},options:n.assign({},{lastModDate:new a(t.lastModified)},r),uncompressedSize:t.size}))}else if("directory"==o.kind){const n=e.addDirectory(o.name,r);i.push(n);for await(const e of o.values())await t(n,e,i,c)}}catch(t){try{t.entryName===dt&&(t.entryName=c)}catch{}throw t}}return i}(t,e,[])}async function Pu(t){const e={name:t.name};if(t.isFile&&(e.kind="file",e.getFile=()=>new g((e,n)=>t.file(e,n))),t.isDirectory){e.kind="directory";const n=await async function(t){const e=[];function n(t,r,o){t.readEntries(async i=>{if(i.length){for(const t of i)e.push(await Pu(t));n(t,r,o)}else r(e)},o)}return await new g((e,r)=>n(t.createReader(),e,r)),{[k.iterator](){let t=0;return{next(){const n={value:e[t],done:t==e.length};return t++,n}}}}}(t);e.values=()=>n}return e}function Zu(t){t.entries=[],t.Le=0,t.root=new Eu(t)}function Hu(t,e){const{entries:r,Le:o,root:i}=t;return Zu(t),e(t.root).catch(e=>{throw n.assign(t,{entries:r,Le:o,root:i}),e})}function Vu(t,e){const n=[e];for(;n.length;){const e=n.pop();t.entries[e.id]=e;for(const t of e.children)n.push(t)}}function Gu(t,e,n,r){if(t.directory){const o=ju(e);return o&&(e=o.pop(),t=qu(t,o)),r?new Eu(t.fs,e,n,t):new Su(t.fs,e,n,t)}throw new f(cu)}function ju(t){if(t.includes("/")){const e=t.split("/").filter(t=>""!=t&&"."!=t);if(e.length)return e}}function qu(t,e,n){return e.forEach(e=>{const r=t;if(t=t.getChildByName(e)){if(!t.directory)throw new f(nu);if(n&&(t==n||t.isDescendantOf(n)))throw new f(iu)}else t=new Eu(r.fs,e,{data:null},r)}),t}t.BlobReader=So,t.BlobWriter=Eo,t.Data64URIReader=ho,t.Data64URIWriter=mo,t.ERR_ABORTED=jt,t.ERR_AMBIGUOUS_ARCHIVE=Ki,t.ERR_ANCESTOR_ENTRY=iu,t.ERR_BAD_FORMAT=Li,t.ERR_CENTRAL_DIRECTORY_NOT_FOUND=Pi,t.ERR_DUPLICATED_NAME=ca,t.ERR_DUPLICATE_IMPORTED_ENTRY=ru,t.ERR_ENCRYPTED=Vi,t.ERR_ENCRYPTED_CENTRAL_DIRECTORY=Xi,t.ERR_ENTRY_DATA_OUT_OF_BOUNDS=Yi,t.ERR_ENTRY_EXISTS=nu,t.ERR_EOCDR_LOCATOR_ZIP64_NOT_FOUND=Wi,t.ERR_EOCDR_NOT_FOUND=Bi,t.ERR_EXTRAFIELD_ZIP64_NOT_FOUND=Hi,t.ERR_HTTP_RANGE=$r,t.ERR_HTTP_RESOURCE_CHANGED=to,t.ERR_HTTP_STATUS=Qr,t.ERR_INVALID_AUTHENTICATION_CODE=Je,t.ERR_INVALID_BASE_URI=ne,t.ERR_INVALID_CODEC_DEFINITION=vn,t.ERR_INVALID_CODEC_MODULE=Nn,t.ERR_INVALID_COMMENT=ua,t.ERR_INVALID_COMMENT_TYPE=la,t.ERR_INVALID_COMPRESSED_DATA=Vn,t.ERR_INVALID_CRC32=Gn,t.ERR_INVALID_DATE=wa,t.ERR_INVALID_DUPLICATES=ou,t.ERR_INVALID_ENCRYPTION_STRENGTH=ma,t.ERR_INVALID_ENTRY=Ga,t.ERR_INVALID_ENTRY_COMMENT=da,t.ERR_INVALID_ENTRY_COMMENT_TYPE=fa,t.ERR_INVALID_ENTRY_NAME=pa,t.ERR_INVALID_EXTRAFIELD=Ea,t.ERR_INVALID_EXTRAFIELD_DATA=za,t.ERR_INVALID_EXTRAFIELD_DATA_TYPE=xa,t.ERR_INVALID_EXTRAFIELD_TYPE=ba,t.ERR_INVALID_FILENAME_VALIDATION=$i,t.ERR_INVALID_FUNCTION_OPTION=Zt,t.ERR_INVALID_GID=Ma,t.ERR_INVALID_LEVEL=Ha,t.ERR_INVALID_MAX_APPENDED_DATA_SIZE=ts,t.ERR_INVALID_MAX_WORKERS=ee,t.ERR_INVALID_MSDOS_ATTRIBUTES=Pa,t.ERR_INVALID_MSDOS_DATA=Za,t.ERR_INVALID_PASSWORD=Xe,t.ERR_INVALID_PASSWORD_TYPE=Vt,t.ERR_INVALID_PASS_THROUGH=pu,t.ERR_INVALID_PASS_THROUGH_VALUE=Gt,t.ERR_INVALID_READER=Na,t.ERR_INVALID_READER_OPTIONS=hu,t.ERR_INVALID_SIGNAL=Ht,t.ERR_INVALID_SIGNATURE_DATA=Va,t.ERR_INVALID_STRICTNESS=Qi,t.ERR_INVALID_UID=Oa,t.ERR_INVALID_UNCOMPRESSED_SIZE=Hn,t.ERR_INVALID_UNIX_EXTRA_FIELD_TYPE=Ba,t.ERR_INVALID_UNIX_ID_SIZE=Wa,t.ERR_INVALID_UNIX_MODE=La,t.ERR_INVALID_URI=re,t.ERR_INVALID_VERSION=ha,t.ERR_ITERATOR_COMPLETED_TOO_SOON=eo,t.ERR_LOCAL_FILE_HEADER_NOT_FOUND=Zi,t.ERR_OVERLAPPING_ENTRY=qi,t.ERR_PARENT_NOT_DIRECTORY=cu,t.ERR_READABLE_CONSUMED=uu,t.ERR_RESERVED_COMPRESSION_METHOD=_n,t.ERR_ROOT_DIRECTORY_NOT_MOVABLE=su,t.ERR_SPLIT_ZIP_FILE=ji,t.ERR_TARGET_NOT_DIRECTORY=au,t.ERR_UNDEFINED_COMPRESSION_METHOD=Ta,t.ERR_UNDEFINED_CRC32=ka,t.ERR_UNDEFINED_READER=_a,t.ERR_UNDEFINED_UNCOMPRESSED_SIZE=Ca,t.ERR_UNDETERMINED_SIZE=va,t.ERR_UNSAFE_FILENAME=Ji,t.ERR_UNSUPPORTED_COMPRESSION=Un,t.ERR_UNSUPPORTED_CONTEXT=eu,t.ERR_UNSUPPORTED_CRYPTO_API=$e,t.ERR_UNSUPPORTED_ENCRYPTION=Gi,t.ERR_UNSUPPORTED_ENCRYPTION_PASS_THROUGH=Sa,t.ERR_UNSUPPORTED_ENCRYPTION_USDZ=ya,t.ERR_UNSUPPORTED_FORMAT=Ia,t.ERR_UNSUPPORTED_PASS_THROUGH_VALUE=mu,t.ERR_UNSUPPORTED_SPLIT_USDZ=ga,t.ERR_UNSUPPORTED_UINT64=es,t.ERR_WORKER_STARTUP_TIMEOUT=fr,t.ERR_WRITER_NOT_INITIALIZED=no,t.ERR_WRITER_SIZE_NOT_WRITABLE=ro,t.ERR_ZIP_CRYPTO_LAST_MOD_DATE=ja,t.ERR_ZIP_NOT_EMPTY=Ua,t.HttpRangeReader=class extends Zo{constructor(t,e={}){super(t,n.assign({},e,{useRangeHeader:!0}))}},t.HttpReader=Zo,t.Reader=wo,t.SplitDataReader=Go,t.SplitDataWriter=jo,t.TextReader=bo,t.TextWriter=zo,t.Uint8ArrayReader=Ho,t.Uint8ArrayWriter=Vo,t.VERSION="2.14.0",t.WARNING_APPENDED_DATA=cs,t.WARNING_CLAMPED_LAST_MODIFICATION_DATE=Ya,t.WARNING_COMPRESSED_PATCHED_DATA=os,t.WARNING_COMPRESSION_UNAVAILABLE=qa,t.WARNING_DUPLICATE_FILENAME=fs,t.WARNING_MALFORMED_EXTRA_FIELD=is,t.WARNING_MISMATCHED_LOCAL_FILE_HEADER_BIT_FLAG=ms,t.WARNING_MISMATCHED_LOCAL_FILE_HEADER_COMPRESSION_METHOD=ys,t.WARNING_MISMATCHED_LOCAL_FILE_HEADER_CRC32_OR_SIZES=gs,t.WARNING_MISMATCHED_LOCAL_FILE_HEADER_FILENAME=hs,t.WARNING_MISMATCHED_ZIP64_END_OF_CENTRAL_DIRECTORY=ws,t.WARNING_MULTIPLE_END_OF_CENTRAL_DIRECTORY=ps,t.WARNING_PREPENDED_CENTRAL_DIRECTORY=ls,t.WARNING_PREPENDED_DATA=us,t.WARNING_TRAILING_CENTRAL_DIRECTORY_DATA=ds,t.WARNING_UNKNOWN_VERSION=rs,t.WARNING_UNKNOWN_ZIP64_EXTENSIBLE_DATA=ss,t.WARNING_UNSORTED_CENTRAL_DIRECTORY=ns,t.WARNING_WRAPPED_ENTRIES_COUNT=as,t.Writer=po,t.ZipDirectoryEntry=Eu,t.ZipEntry=gu,t.ZipFS=bu,t.ZipFileEntry=Su,t.ZipReader=Fs,t.ZipReaderStream=Ds,t.ZipWriter=ec,t.ZipWriterStream=class{constructor(t={}){const{readable:e,writable:n}=new R;this.readable=e,this.zipWriter=new ec(n,t),this.At=new u}transform(t){const e=this.zipWriter;let n;const{readable:r,writable:o}=new R({start(t){n=t},flush:()=>{!async function(){try{await e.close()}catch(t){await ic(e,t)}}()}});return sc(this,this.zipWriter.add(t,r),t=>n.error(t)),{readable:this.readable,writable:o}}writable(t){let e;const{readable:n,writable:r}=new R({start(t){e=t}});return sc(this,this.zipWriter.add(t,n),t=>e.error(t)),r}async close(t,n={}){const{zipWriter:r}=this,o=(await g.allSettled(e.from(this.At))).filter(t=>"rejected"==t.status).map(t=>t.reason);if(o.length){const[t]=o;try{t.entryErrors=o}catch{}throw await ic(r,t),t}try{return await r.close(t,n)}catch(t){throw await ic(r,t),t}}},t.configure=function(t){n.assign(fe,me(ge(t)))},t.createBlobTempStream=function(t={}){const{thresholdBytes:e=Qc}=t;return function(){const t=[];let n,r,o,i=0,s=!1;const a=new D({async write(o){s?await n.write(o):(t.push(o),i+=o.length,i>e&&await async function(){const e=new R;r=Tn(e.readable),n=e.writable.getWriter(),s=!0;for(const e of t)await n.write(e);t.length=0}())},async close(){n&&(await n.close(),n=null)}});let c=0;return{writable:a,readable:new F({async pull(e){if(s){if(!o){const t=await r;o=t.stream().getReader()}const{value:t,done:n}=await o.read();n?e.close():e.enqueue(t)}else c<t.length?e.enqueue(t[c++]):e.close()},async cancel(t){o&&await o.cancel(t)}},{highWaterMark:0}),dispose:async function(){if(n){try{await n.abort()}catch{}n=null}r&&(r.catch(()=>{}),r=null),t.length=0}}}},t.createOPFSTempStream=function(t={}){const{thresholdBytes:n=Xc,directoryName:r=Jc,getDirectory:o=()=>C.storage.getDirectory()}=t;let i;function s(){return i||(i=g.resolve(o()).then(t=>t.getDirectoryHandle(r,{create:!0}))),i}return function(){const t=[];let r,o,i,a,c=0,u=!1;const l=new D({async write(a){u?await i.write(a):(t.push(a),c+=a.length,c>n&&await async function(){const n=await s();r=x.randomUUID?x.randomUUID():e.from(x.getRandomValues(new w(16)),t=>t.toString(16).padStart(2,"0")).join(""),o=await n.getFileHandle(r,{create:!0}),i=(await o.createWritable()).getWriter(),u=!0;for(const e of t)await i.write(e);t.length=0}())},async close(){i&&(await i.close(),i=null)}});let d=0;return{writable:l,readable:new F({async pull(e){if(u){if(!a){const t=await o.getFile();a=t.stream().getReader()}const{value:t,done:n}=await a.read();n?e.close():e.enqueue(t)}else d<t.length?e.enqueue(t[d++]):e.close()},async cancel(t){a&&await a.cancel(t)}},{highWaterMark:0}),dispose:async function(){if(i){try{await i.close()}catch{}i=null}if(r){try{const t=await s();await t.removeEntry(r)}catch{}o=r=null}t.length=0}}}},t.createSyncAccessHandleTempStream=function(t={}){const{thresholdBytes:n=$c,directoryName:r=tu,getDirectory:o}=t;if(!(o||"undefined"!=typeof FileSystemFileHandle&&FileSystemFileHandle.prototype.createSyncAccessHandle))throw new f(eu);const i=o||(()=>C.storage.getDirectory());let a;function c(){return a||(a=g.resolve(i()).then(t=>t.getDirectoryHandle(r,{create:!0}))),a}return function(){const t=[];let r,o,i=0,a=!1,u=0,l=0;const d=new D({async write(s){a?(o.write(s,{at:u}),u+=s.length):(t.push(s),i+=s.length,i>n&&await async function(){const n=await c();r=x.randomUUID?x.randomUUID():e.from(x.getRandomValues(new w(16)),t=>t.toString(16).padStart(2,"0")).join("");const i=await n.getFileHandle(r,{create:!0});o=await i.createSyncAccessHandle(),a=!0;for(const e of t)o.write(e,{at:u}),u+=e.length;t.length=0}())},close(){o&&o.flush()}});let f=0;return{writable:d,readable:new F({pull(e){if(a){const t=u-l;if(t<=0)return void e.close();const n=new w(s.min(524288,t)),r=o.read(n,{at:l});r?(l+=r,e.enqueue(n.subarray(0,r))):e.close()}else f<t.length?e.enqueue(t[f++]):e.close()}},{highWaterMark:0}),dispose:async function(){if(o){try{o.close()}catch{}o=null}if(r){try{const t=await c();await t.removeEntry(r)}catch{}r=null}t.length=0}}}},t.fs=xu,t.getMimeType=function(){return"application/octet-stream"},t.getRegisteredCodecs=Wn,t.getSupportedCompressionMethods=function(){const{CompressionStream:t,DecompressionStream:e,CompressionStreamFallback:n,DecompressionStreamFallback:r}=we(),o=[{compressionMethod:0,compression:!0,decompression:!0,registered:!1},{compressionMethod:8,compression:Kc(n,jn)||Kc(t,jn)||Kc(t,Yn),decompression:Kc(r,jn)||Kc(e,jn)||Kc(e,Yn),registered:!1},{compressionMethod:9,compression:!1,decompression:Kc(r,qn)||Kc(e,qn),registered:!1}];for(const t of Wn()){const e=Pn(t.format);o.push({compressionMethod:t.compressionMethod,compression:e?typeof e.CompressionStream==pt:dt,decompression:e?typeof e.DecompressionStream==pt:dt,registered:!0})}return o},t.isZipFile=As,t.registerCodec=function(t={}){const{compressionMethod:e,format:n,codecURI:r,CompressionStream:i,DecompressionStream:s,versionNeeded:a}=t;if(!o.isInteger(e)||e<0||e>M||typeof n!=mt||!n.length)throw new f(vn);if(On.includes(e))throw new f(_n);const c=typeof i==pt||typeof s==pt;if(!(c||typeof r==mt&&r.length))throw new f(vn);Mn.set(e,{compressionMethod:e,format:n,codecURI:r,versionNeeded:a}),c&&Zn(n,{CompressionStream:i,DecompressionStream:s})},t.resetConfiguration=function(){for(const t of de)delete fe[t];n.assign(fe,ie)},t.terminateWorkers=async function(){await g.allSettled(Lr.map(t=>(Yr(t),t.terminate()))),wr=dt,pr=!1},t.unregisterCodec=function(t){const e=Mn.get(t);if(e){let n;Mn.delete(t),Mn.forEach(t=>n=n||t.format==e.format),n||Ln.delete(e.format)}}});
|