@zip.js/zip.js 2.11.4 → 2.13.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (52) hide show
  1. package/deno.json +1 -1
  2. package/dist/zip-core-external.js +549 -139
  3. package/dist/zip-core-external.min.js +1 -1
  4. package/dist/zip-core.js +559 -136
  5. package/dist/zip-core.min.js +1 -1
  6. package/dist/zip-fs-core-external.js +615 -260
  7. package/dist/zip-fs-core-external.min.js +1 -1
  8. package/dist/zip-fs-core.js +628 -257
  9. package/dist/zip-fs-core.min.js +1 -1
  10. package/dist/zip-fs-external.js +615 -260
  11. package/dist/zip-fs-external.min.js +1 -1
  12. package/dist/zip-fs-native.js +630 -259
  13. package/dist/zip-fs-native.min.js +1 -1
  14. package/dist/zip-fs.js +631 -260
  15. package/dist/zip-fs.min.js +1 -1
  16. package/dist/zip-legacy.js +561 -138
  17. package/dist/zip-legacy.min.js +1 -1
  18. package/dist/zip-native.js +561 -138
  19. package/dist/zip-native.min.js +1 -1
  20. package/dist/zip-web-worker-native.js +1 -1
  21. package/dist/zip-web-worker.js +1 -1
  22. package/dist/zip.js +562 -139
  23. package/dist/zip.min.js +1 -1
  24. package/index-native.cjs +630 -259
  25. package/index-native.min.js +1 -1
  26. package/index.cjs +631 -260
  27. package/index.d.cts +474 -59
  28. package/index.d.ts +474 -59
  29. package/index.min.js +1 -1
  30. package/lib/core/codec-worker-web.js +72 -22
  31. package/lib/core/codec-worker.js +18 -5
  32. package/lib/core/configuration.js +20 -5
  33. package/lib/core/constants.js +2 -0
  34. package/lib/core/io.js +13 -5
  35. package/lib/core/options.js +16 -0
  36. package/lib/core/streams/codec-stream.js +6 -0
  37. package/lib/core/util/error.js +35 -0
  38. package/lib/core/util/warnings.js +42 -0
  39. package/lib/core/version.js +1 -1
  40. package/lib/core/web-worker-base.js +46 -9
  41. package/lib/core/web-worker-inline-native.js +1 -1
  42. package/lib/core/web-worker-inline-wasm.js +1 -1
  43. package/lib/core/zip-entry.js +49 -1
  44. package/lib/core/zip-fs.js +45 -133
  45. package/lib/core/zip-reader.js +115 -52
  46. package/lib/core/zip-writer.js +244 -57
  47. package/lib/zip-core-base.js +9 -3
  48. package/lib/zip-core-reader.js +2 -0
  49. package/lib/zip-core-writer.js +6 -1
  50. package/lib/zip-module-wasm-base.js +2 -2
  51. package/package.json +5 -3
  52. package/worker-message-property-names.js +1 -1
@@ -1 +1 @@
1
- !function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports):"function"==typeof define&&define.amd?define(["exports"],e):e((t="undefined"!=typeof globalThis?globalThis:t||self).zip={})}(this,function(t){"use strict";const{Array:e,Object:n,String:r,Number:o,BigInt:i,Math:s,Date:a,Map:c,Set:u,Response:l,URL:d,Error:f,Uint8Array:w,Uint16Array:p,Uint32Array:h,DataView:m,Blob:y,Promise:S,TextEncoder:b,TextDecoder:g,document:E,crypto:z,btoa:x,TransformStream:R,ReadableStream:D,WritableStream:F,CompressionStream:A,DecompressionStream:k,navigator:C,Worker:I,Symbol:T,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=new w,St="password",bt="rawPassword",gt="passThrough",Et="signal",zt="useWebWorkers",xt="useCompressionStream",Rt="transferStreams",Dt="preventClose",Ft="dataDescriptor",At="offset",kt="usdz",Ct="maxAppendedDataSize",It="signCentralDirectory",Tt="filename",vt="comment",_t="strict",Nt="balanced",Ut="tolerant",Ot="Invalid option (must be a function)",Mt="Invalid signal (must be an AbortSignal instance)",Lt="Invalid password (password must be a string, rawPassword must be a Uint8Array)",Bt="The operation was aborted",Wt="AbortError";function Pt(t){if(t&&typeof t!=pt)throw new f(Ot);return t}function Zt(t){if(t&&(typeof t.addEventListener!=pt||"boolean"!=typeof t.aborted))throw new f(Mt);return t||dt}function Ht(t){if(t&&t.aborted)throw t.reason===dt?new DOMException(Bt,Wt):t.reason}function Vt(t,e){if(t&&typeof t!=mt||e&&!(e instanceof w))throw new f(Lt)}function Gt(t,e,n){if(!o.isInteger(t)||t<0||t>e)throw new f(n)}function jt(t,e,n){t!==dt&&Gt(t,e,n)}function qt(t){return typeof t==mt&&t.trim()?o(t):t}const Kt="Invalid maxWorkers (must be an integer greater than 0)";let Yt=2;try{typeof C!=wt&&C.hardwareConcurrency&&(Yt=C.hardwareConcurrency)}catch{}const Xt={workerURI:"./core/web-worker-wasm.js",wasmURI:"./core/streams/zlib-wasm/zlib-streams.wasm",chunkSize:65536,maxWorkers:Yt,terminateWorkerTimeout:5e3,workerStarvationTimeout:5e3,workerStartupTimeout:5e3,useWebWorkers:!0,useCompressionStream:!0,transferStreams:!0,CompressionStream:typeof A!=wt&&A,DecompressionStream:typeof k!=wt&&k},Jt="maxWorkers",Qt=["chunkSize",Jt,"terminateWorkerTimeout","workerStarvationTimeout","workerStartupTimeout"],$t=["createWorker","CompressionStream","DecompressionStream","CompressionStreamFallback","DecompressionStreamFallback"],te=["baseURI","wasmURI","workerURI","useCompressionStream","useWebWorkers","transferStreams",...Qt,...$t],ee={...Xt};function ne(){return ee}function re(t){return oe(t.chunkSize)}function oe(t){return t=qt(t),o.isInteger(t)&&t>=1?s.max(t,64):65536}function ie(t){const e={};for(const n of te){const r=t[n];r!==dt&&(e[n]=se(n,r))}return e}function se(t,e){if(Qt.includes(t)){if(e=qt(e),t==Jt&&(!o.isInteger(e)||e<1))throw new f(Kt)}else $t.includes(t)&&Pt(e);return e}function ae(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 ce(t,e){const n=new w(t.length+e.length);return n.set(t),n.set(e,t.length),n}function ue(t){return t.byteOffset||t.byteLength!=t.buffer.byteLength?new w(t):t}function le(t){return new m(t.buffer,t.byteOffset,t.byteLength)}const de=[[],[],[],[],[],[],[],[]];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;de[0][t]=e}for(let t=0;t<256;t++)for(let e=1;e<8;e++){const n=de[e-1][t];de[e][t]=n>>>8^de[0][255&n]}const[fe,we,pe,he,me,ye,Se,be]=de;class ge{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=be[255&t]^Se[t>>>8&255]^ye[t>>>16&255]^me[t>>>24&255]^he[255&n]^pe[n>>>8&255]^we[n>>>16&255]^fe[n>>>24&255]}}for(;r<n;r++)e=e>>>8^fe[255&(e^t[r])];this.o=e}get(){return~this.o}}class Ee extends R{constructor(){let t;const e=new ge;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 ze(t){if(typeof b==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 b).encode(t)}const xe={concat(t,e){if(0===t.length||0===e.length)return t.concat(e);const n=t[t.length-1],r=xe.l(n);return 32===r?t.concat(e):xe.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)+xe.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]=xe.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=xe.l(o);return r.push(xe.S(e+i&31,e+i>32?n:r.pop(),1)),r}},Re={bytes:{R(t){const e=xe.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},D(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(xe.S(8*(3&n),r)),e}}},De=class{constructor(t){const e=this;e.blockSize=512,e.F=[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.F.slice(0),t.I=[],t.T=0,t}update(t){const e=this;"string"==typeof t&&(t=Re.v.D(t));const n=e.I=xe.concat(e.I,t),r=e.T,o=e.T=r+xe.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=xe.concat(e,[xe.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}},Fe={importKey:t=>new Fe.M(Re.bytes.D(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=xe;for(e=Re.bytes.D(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=De,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)}}},Ae=typeof z!=wt&&typeof z.getRandomValues==pt,ke="Invalid password",Ce="Invalid authentication code",Ie="zipjs-abort-check-password",Te="Crypto API not supported";function ve(t){if(Ae)return z.getRandomValues(t);throw new f(Te)}const _e=16,Ne={name:"PBKDF2"},Ue=n.assign({hash:{name:"HMAC"}},Ne),Oe=n.assign({iterations:1e3,hash:{name:"SHA-1"}},Ne),Me=["deriveBits"],Le=[8,12,16],Be=[16,24,32],We=10,Pe=[0,0,0,0],Ze=typeof z!=wt,He=Ze&&z.subtle,Ve=Ze&&typeof He!=wt,Ge=Re.bytes,je=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],b=4;for(let t=0;t<r;t++)d=s[h>>>24]^a[m>>16&255]^c[y>>8&255]^u[255&S]^n[b],w=s[m>>>24]^a[y>>16&255]^c[S>>8&255]^u[255&h]^n[b+1],p=s[y>>>24]^a[S>>16&255]^c[h>>8&255]^u[255&m]^n[b+2],S=s[S>>>24]^a[h>>16&255]^c[m>>8&255]^u[255&y]^n[b+3],b+=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[b++],d=h,h=m,m=y,y=S,S=d;return o}},qe=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=xe.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 xe.m(e,o)}},Ke=Fe.M;let Ye=Ze&&Ve&&typeof He.importKey==pt,Xe=Ze&&Ve&&typeof He.deriveBits==pt;class Je extends R{constructor({password:t,rawPassword:e,encryptionStrength:n,checkPasswordOnly:r,checkAuthenticationCode:o=!0}){super({start(){$e(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 en(t,e,n,rn(r,0,Le[e])),i=rn(r,Le[e]);if(o[0]!=i[0]||o[1]!=i[1])throw new f(ke)}(n,i,o,rn(t,0,Le[i]+2)),t=rn(t,Le[i]+2),r?e.error(new f(Ie)):s()):await a;const c=new w(t.length-We-(t.length-We)%_e);e.enqueue(tn(n,t,c,0,We,!0))},async flush(t){const{nt:e,ot:n,it:r,ready:i}=this;if(n&&e){await i;const s=rn(r,0,r.length-We),a=rn(r,r.length-We);let c=yt;if(s.length){const t=sn(Ge,s);n.update(t);const r=e.update(t);c=on(Ge,r)}const u=rn(on(Ge,n.digest()),0,We);let l=r.length<We?1:0;for(let t=0;t<We;t++)l|=u[t]^a[t];if(l&&o)throw new f(Ce);t.enqueue(c)}}})}}class Qe extends R{constructor({password:t,rawPassword:e,encryptionStrength:n}){super({start(){$e(this,t,e,n)},async transform(t,e){const n=this,{password:r,strength:o,et:i,ready:s}=n;let a=yt;r?(a=await async function(t,e,n){const r=ve(new w(Le[e]));return ce(r,await en(t,e,n,r))}(n,o,r),i()):await s;const c=new w(a.length+t.length-t.length%_e);c.set(a,0),e.enqueue(tn(n,t,c,a.length,0))},async flush(t){const{nt:e,ot:n,it:r,ready:o}=this;if(n&&e){await o;let i=yt;if(r.length){const t=e.update(sn(Ge,r));n.update(t),i=on(Ge,t)}const s=on(Ge,n.digest()).slice(0,We);t.enqueue(ce(i,s))}}})}}function $e(t,e,r,o){n.assign(t,{ready:new S(e=>t.et=e),password:nn(e,r),strength:o-1,it:yt})}function tn(t,e,n,r,o,i){const{nt:s,ot:a,it:c}=t;c.length&&(e=ce(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%_e)),l=0;l<=u-_e;l+=_e){const t=sn(Ge,rn(e,l,l+_e));i&&a.update(t);const o=s.update(t);i||a.update(o),n.set(on(Ge,o),l+r)}return t.it=rn(e,l),n}async function en(t,r,o,i){t.password=null;const s=await async function(t,e,n,r,o){if(!Ye)return Fe.importKey(e);try{return await He.importKey("raw",e,n,!1,o)}catch{return Ye=!1,Fe.importKey(e)}}(0,o,Ue,0,Me),a=await async function(t,e,n){if(!Xe)return Fe.L(e,t.salt,Oe.iterations,n);try{return await He.deriveBits(t,e,n)}catch{return Xe=!1,Fe.L(e,t.salt,Oe.iterations,n)}}(n.assign({salt:i},Oe),s,8*(2*Be[r]+2)),c=new w(a),u=sn(Ge,rn(c,0,Be[r])),l=sn(Ge,rn(c,Be[r],2*Be[r])),d=rn(c,2*Be[r]);return n.assign(t,{keys:{key:u,st:l,passwordVerification:d},nt:new qe(new je(u),e.from(Pe)),ot:new Ke(l)}),d}function nn(t,e){return e===dt?ze(t):e}function rn(t,e,n){return t.subarray(e,n)}function on(t,e){return t.R(e)}function sn(t,e){return t.D(e)}class an extends R{constructor({password:t,rawPassword:e,passwordVerification:n,checkPasswordOnly:r}){super({start(){un(this,t,e,n)},transform(t,e){const n=this;if(n.password||n.rawPassword){const e=ln(n,t.subarray(0,12));if(n.password=n.rawPassword=null,0!=(e[11]^n.passwordVerification))throw new f(ke);t=t.subarray(12)}r?e.error(new f(Ie)):e.enqueue(ln(n,t))}})}}class cn extends R{constructor({password:t,rawPassword:e,passwordVerification:n}){super({start(){un(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(dn(n,e),0),o=12}else r=new w(t.length),o=0;r.set(dn(n,t),o),e.enqueue(r)}})}}function un(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 ge(o[0]),ut:new ge(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 ln(t,e){const n=new w(e.length);for(let r=0;r<e.length;r++)n[r]=wn(t)^e[r],fn(t,n[r]);return n}function dn(t,e){const n=new w(e.length);for(let r=0;r<e.length;r++)n[r]=wn(t)^e[r],fn(t,e[r]);return n}function fn(t,e){let[,n]=t.keys;t.ct.append([e]);const r=~t.ct.get();n=hn(s.imul(hn(n+pn(r)),134775813)+1),t.ut.append([n>>>24]);const o=~t.ut.get();t.keys=[r,n,o]}function wn(t){const e=2|t.keys[2];return pn(s.imul(e,1^e)>>>8)}function pn(t){return 255&t}function hn(t){return 4294967295&t}function mn(t){if(t instanceof D)return t;const e=t.getReader();return new D({async pull(t){const{value:n,done:r}=await e.read();r?t.close():t.enqueue(n)},cancel:t=>e.cancel(t)})}function yn(t,e){t=mn(t);const n=e?{type:e}:{};if(typeof y.prototype.stream!=pt||new y([]).stream()instanceof D)return new l(t).blob().then(t=>e?new y([t],n):t);const r=[];return t.pipeTo(new F({write(t){r.push(t)}})).then(()=>new y(r,n))}function Sn(t){if(t instanceof F)return t;const e=t.getWriter();return new F({write:t=>e.write(t),close:()=>e.close(),abort:t=>e.abort(t)})}const bn="Invalid codec definition",gn="Reserved compression method",En="Invalid codec module",zn="Compression method not supported",xn=[0,8,9,99],Rn=new c,Dn=new c;function Fn(t){return Rn.get(t)}function An(){return e.from(Rn.values(),t=>n.assign({},t,Dn.get(t.format)))}function kn(t){return Dn.get(t)}function Cn(t,e){const{CompressionStream:n,DecompressionStream:r}=e;if(typeof n!=pt&&typeof r!=pt)throw new f(En);Dn.set(t,{CompressionStream:n,DecompressionStream:r})}const In="Invalid uncompressed size",Tn="Invalid compressed data",vn="Invalid CRC32",_n="deflate-raw",Nn="deflate64-raw",Un="gzip",On=[31,139,8];class Mn 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,b=super.readable;const g=d&&kn(d),E=c&&o&&!l&&!g&&(!i||a)&&Boolean(s&&r);if(i&&!a||!c||E||(h=new Ee,b=jn(b,h)),o)if(g)b=qn(b,Vn(g.CompressionStream,d,{level:u,chunkSize:e,compressionMethod:f,uncompressedSize:w}));else if(E)S=new Ln,b=qn(b,new r(Un)),b=jn(b,S);else try{b=Gn(b,s,{level:u,chunkSize:e},r,n)}catch(t){let e;try{e=new r(Un)}catch{throw t}b=qn(b,e),b=jn(b,new Ln)}i&&(a?b=jn(b,new cn(t)):(y=new Qe(t),b=jn(b,y))),Hn(p,b,()=>{i&&!a||!c||(p.crc32=E?S.crc32:new m(h.value.buffer).getUint32(0))})}}class Ln 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=ce(n,t));const i=o-8,a=s.min(i,n.length);r.enqueue(ce(n.subarray(0,a),t.subarray(0,i-a))),n=ce(n.subarray(a),t.subarray(i-a))},flush(){const e=le(n);t.crc32=e.getUint32(0,!0),t.uncompressedSize=e.getUint32(4,!0)}}),t=this}}class Bn 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 b,g,E=super.readable;if(i&&(o?E=jn(E,new an(t)):(g=new Je(t),E=jn(E,g))),c){const t=d&&kn(d);if(t)E=qn(E,Vn(t.DecompressionStream,d,{chunkSize:e,compressionMethod:p,rawBitFlag:h,uncompressedSize:y}));else try{E=Gn(E,u,{chunkSize:e,deflate64:l},r,n)}catch(t){if(l||y===dt)throw t;let e;try{e=new r(Un)}catch{throw t}E=function(t,e,n){const r=new ge;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(On),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=le(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=jn(t,l),jn(t=qn(t,e),d);function p(){h(),o=v(()=>s(new f(In)),5e3)}function h(){_(o)}}(E,e,y)}E=function(t){const e=t.getReader();return new D({async pull(t){let n;try{n=await e.read()}catch(t){if(t&&t.message)throw t;const e=new f(Tn);throw e.cause=t,e}const{value:r,done:o}=n;o?t.close():t.enqueue(r)},cancel:t=>e.cancel(t)})}(E)}s&&(b=new Ee,E=jn(E,b)),Hn(this,E,()=>{if(s){const t=new m(b.value.buffer);if(a!=t.getUint32(0,!1))throw new f(vn)}})}}const Wn=new c;function Pn(t,e){if(!t)return!1;let n=Wn.get(t);n||(n=new c,Wn.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 Zn(t){return Pn(t,_n)}function Hn(t,e,r){e=jn(e,new R({flush:r})),n.defineProperty(t,"readable",{get:()=>e})}function Vn(t,e,n){if(!t)throw new f(zn);return new t(e,n)}function Gn(t,e,n,r,o){const i=e&&r?r:o||r,s=n.deflate64?Nn:_n;let a;try{a=new i(s,n)}catch(t){if(!e||!o||i==o)throw t;a=new o(s,n)}return qn(t,a)}function jn(t,e){return mn(t).pipeThrough(e)}function qn(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 Kn="data",Yn="deflate",Xn="inflate";class Jn extends R{constructor(t,e){super({});const r=this,{codecType:o}=t;let i;o.startsWith(Yn)?i=Mn:o.startsWith(Xn)&&(i=Bn),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(In)},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 Qn extends R{constructor(t){const e=[];let n=0;function r(){const r=new w(t);let o=0;for(;o<t;){const n=e[0],i=t-o;n.length<=i?(r.set(n,o),o+=n.length,e.shift()):(r.set(n.subarray(0,i),o),e[0]=n.subarray(i),o+=i)}return n-=t,r}(!o.isFinite(t)||t<1)&&(t=65536),super({transform(o,i){for(e.push(o),n+=o.length;n>t;)i.enqueue(r())},flush(t){n&&t.enqueue(function(t,e){const n=new w(e);let r=0;for(const e of t)n.set(e,r),r+=e.length;return n}(e,n))}})}}const $n="Worker startup timeout";let tr,er,nr;async function rr(t){const{CompressionStream:e,CompressionStreamFallback:n}=t;if(n&&!n.lt)return!0;if(Zn(e)||Pn(e,Un))return!0;if(n)try{return await void 0,!0}catch{return!1}return!1}function or(t){t.createWorker?er=!0:tr=!1}class ir{constructor(t,{readable:e,writable:r},{options:o,config:i,ft:s,useWebWorkers:a,transferStreams:c,workerURI:u,createWorker:l},d){const{signal:f}=s;return er&&(l=dt),n.assign(t,{wt:!0,ht:(t.ht||0)+1,readable:e.pipeThrough(new Qn(re(i))).pipeThrough(new sr(s),{signal:f}),writable:r,options:n.assign({},o),workerURI:u,createWorker:l,transferStreams:c,terminate:()=>new S(e=>{const{yt:n,wt:r}=t;n?(r?t.St=e:(n.terminate(),e()),t.bt=null):e()}),gt(){if(t.wt){const{St:e}=t;e&&(t.St=null,t.Et=!0,t.yt.terminate(),e()),t.wt=!1,d(t)}}}),tr===dt&&(tr=typeof I!=wt),(a&&nr&&(tr&&u||l)?nr:cr)(t,i)}}class sr extends R{constructor({onstart:t,onprogress:e,size:n,onend:r}){let o=0;super({async start(){t&&await ar(t,n)},async transform(t,r){o+=t.length,e&&await ar(e,o,n),r.enqueue(t)},async flush(){r&&await ar(r,o)}})}}async function ar(t,...e){try{await t(...e)}catch{}}function cr(t,e){return{run:()=>ur(t,e)}}async function ur({options:t,readable:e,writable:n,gt:r},o){let i;try{if(t.compressed&&!t.format){const e=t.codecType.startsWith(Yn),n=e?o.CompressionStreamFallback:o.DecompressionStreamFallback,r=e?o.CompressionStream:o.DecompressionStream;if(t.useCompressionStream){if(n&&n.lt&&!Zn(r))try{await void 0}catch{}}else try{await void 0}catch{n&&!n.lt||(t.useCompressionStream=!0)}}i=new Jn(t,o),await e.pipeThrough(i).pipeThrough(new Qn(re(o))).pipeTo(n,{preventClose:!0,preventAbort:!0});const{crc32:r,inputSize:s,outputSize:a}=i;return{crc32:r,inputSize:s,outputSize:a}}catch(t){throw i&&(t.outputSize=i.outputSize),t}finally{r()}}const lr={type:"module"},dr="error";let fr,wr,pr,hr=!0;try{hr=typeof N==pt&&N(new DOMException("","AbortError")).code!==dt}catch{}var mr;function yr(t){const{reader:e}=t;e&&e.releaseLock(),t.reader=null,t.writer=null}function Sr(t){const{yt:e}=t;if(e)try{e.terminate()}catch{}t.bt=null}function br(t,e,r,o,i=!0){const{createWorker:s}=r;let a,c,u;if(s)a=s();else if(wr===dt||fr!==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=lr);try{a=new I(c,u)}catch(i){if(l)try{d.revokeObjectURL(c)}catch{}if(n&&l)return br(t,e,r,o,!1);if(o)throw i;return br(t,e,r,!0,!1)}}else{o===dt&&(o=!0),o&&(u=lr);try{c=new d(c,e)}catch{}try{a=new I(c,u)}catch(n){if(o)return br(t,e,r,!1,i);throw n}}fr=t,wr=c,pr=u}else a=new I(wr,pr);return a.addEventListener("message",t=>{r.zt=!0,gr(r),async function({data:t},e){const{type:r,value:o,messageId:i,result:s,error:a}=t,{reader:c,writer:u,xt:l,Rt:d,gt:p,ht:h}=e,m=()=>e.ht!=h;try{if(a){const{message:t,stack:e,code:r,name:o,outputSize:i,cause:s,codecImportFailed:c}=a,u=new f(t);n.assign(u,{stack:e,code:r,name:o,outputSize:i}),s&&(u.cause=n.assign(new f(s.message),{name:s.name})),c&&(u.codecImportFailed=!0),y(u)}else{if("pull"==r){const{value:t,done:n}=await c.read();m()||zr({type:Kn,value:t,done:n,messageId:i},e)}r==Kn&&(await u.ready,await u.write(new w(o)),m()||zr({type:"ack",messageId:i},e)),"close"==r&&y(null,s)}}catch(a){m()||(Sr(e),y(a))}function y(t,e){m()||(t?d(t):l(e),u&&u.releaseLock(),t&&t.codecImportFailed||p())}}(t,r)}),a.addEventListener(dr,t=>Er(t,r)),a.addEventListener("messageerror",t=>Er(t,r)),a}function gr(t){const{Dt:e}=t;e&&(_(e),t.Dt=null)}function Er(t,e){t.preventDefault&&t.preventDefault(),gr(e);const{zt:r,Rt:o,writer:i,gt:s}=e;Sr(e),r||(e.yt=null);let a=t.error||new f(t.message||dr);r||(a=n.assign(new f(a.message||dr),{Ft:!0}),e.At=a),o&&(o(a),i&&i.releaseLock(),r&&s())}function zr(t,{yt:e,writer:n,transferStreams:r,zt:o}){try{const{value:n,readable:i,writable:s}=t,a=[];if(n&&(t.value=ue(n),a.push(t.value.buffer)),r&&hr&&o?(i&&a.push(i),s&&a.push(s)):t.readable=t.writable=null,a.length)try{return e.postMessage(t,a),!0}catch{hr=!1,t.readable=t.writable=null,e.postMessage(t)}else e.postMessage(t)}catch(t){throw n&&n.releaseLock(),t}}mr=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=br(t.workerURI,r,t)}catch{return or(t),cr(t,e)}n.assign(t,{yt:c,zt:!1,Et:!1,At:null,bt:{run:async()=>{try{return await async function(t,e){if(!t.yt){const{At:e}=t;t.At=null;const n=e||new f($n);throw n.Ft=!0,n}let r,i;const s=new S((t,e)=>{r=t,i=e});n.assign(t,{reader:null,writer:null,xt:r,Rt:i,result:s});const{readable:a,options:c}=t,{writable:u,closed:l,kt:d}=function(t){const e=new AbortController,{writable:n,readable:r}=new R,o=r.pipeTo(t,{preventClose:!0,preventAbort:!0,signal:e.signal});return o.catch(()=>{}),{writable:n,closed:o,kt:()=>e.abort()}}(t.writable);let w;try{w=zr({type:"start",options:c,config:e,readable:a,writable:u},t)}catch(e){d();try{await l}catch{}throw t.gt(),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{Rt:e,writer:n}=t;if(Sr(t),t.yt=null,e){const t=new f($n);t.Ft=!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.Ft)return or(t),yr(t),ur(t,e);if(n&&n.codecImportFailed){if(t.reader)return yr(t),ur(t,e);t.gt()}throw n}}}})}return t.bt},nr=mr;let xr=[];const Rr=[];let Dr,Fr,Ar=0;async function kr(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){!Dn.has(t)&&e&&Cn(t,await(import(/* webpackIgnore: true */ /* @vite-ignore */e)))}(w,n.codecURI)),e.transferStreams=!w&&(i||i===dt&&r.transferStreams);const b=!(c||u||l||f),g=w===dt||Boolean(n.codecURI);return e.useWebWorkers=!b&&g&&(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=xr.find(t=>!t.wt);if(n)return _r(n),new ir(n,t,e,E);if(xr.length<y){const n={Ct:Ar};return Ar++,xr.push(n),new ir(n,t,e,E)}return new S(n=>{Rr.push({resolve:n,stream:t,It:e}),Fr=r.workerStarvationTimeout,Cr()})}()).run();function E(t){if(Ir(),Rr.length){const[{resolve:e,stream:n,It:r}]=Rr.splice(0,1);e(new ir(t,n,r,E)),Cr()}else t.yt?(_r(t),function(t,e){const{config:n}=e,{terminateWorkerTimeout:r}=n;o.isFinite(r)&&r>=0&&(t.Et?t.Et=!1:t.Tt=v(async()=>{xr=xr.filter(e=>e!=t);try{await t.terminate()}catch{}},r))}(t,e)):xr=xr.filter(e=>e!=t)}}function Cr(){!Dr&&Rr.length&&o.isFinite(Fr)&&Fr>=0&&(Dr=v(Tr,Fr))}function Ir(){Dr&&(_(Dr),Dr=null)}function Tr(){if(Dr=null,Rr.length){const[{resolve:t,stream:e,It:r}]=Rr.splice(0,1),o=n.assign({},r,{useWebWorkers:!1,workerURI:dt,createWorker:dt});t(new ir({},e,o,vr)),Cr()}}function vr(){Ir(),Cr()}function _r(t){const{Tt:e}=t;e&&(_(e),t.Tt=null)}const Nr="\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 Ur(t,e){return Or(t,e,!0)}function Or(t,e,n){return e&&"cp437"==e.trim().toLowerCase()?function(t){let e="";for(let n=0;n<t.length;n++)e+=Nr[t[n]];return e}(t):new g(e,{ignoreBOM:n}).decode(t)}const Mr="HTTP error ",Lr="HTTP Range not supported",Br="HTTP resource changed",Wr="Writer iterator completed too soon",Pr="Writer not initialized",Zr="Content-Range",Hr="Range",Vr="GET",Gr="bytes",jr=16777216,qr="writable",Kr=T();class Yr{constructor(){this.size=0}init(){this.initialized=!0}}class Xr extends Yr{get readable(){return this.createReadable()}createReadable({offset:t=0,size:e,chunkSize:n=re(ne())}={}){const r=this;let o=0;return n=oe(n),new D({async pull(i){const a=e===dt?n:s.min(n,e-o),c=await Uo(r,t+o,a);c.length&&(i.enqueue(c),o+=c.length),(e!==dt&&o>=e||!c.length&&a)&&i.close()}})}}class Jr extends Yr{constructor(){super();const t=this,e=new F({write(e){if(!t.initialized)throw new f(Pr);return t.writeUint8Array(ue(e))}});n.defineProperty(t,qr,{get:()=>e})}writeUint8Array(){}}class Qr extends Xr{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 $r extends Jr{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+=x(o):e.Nt=o+e.Nt}getData(){return this.data+x(this.Nt)}}let to,eo;class no extends Xr{constructor(t){super(),n.assign(this,{Ut:t,size:t.size}),eo||(eo=(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();to=1==e}catch{to=!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 mn(e.stream());if(to)return mn(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 ro extends Yr{constructor(t){super();const e=this,r=new R;n.defineProperty(e,qr,{get:()=>r.writable}),e.contentType=t,e.Ot=yn(r.readable,t),e.Ot.catch(()=>{})}getData(){return this.Ot}}class oo extends no{constructor(t){super(new y([t],{type:"text/plain"}))}}function io(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 so extends ro{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 Or(t,e,!1)}(new w(await n.arrayBuffer()),t)}}class ao extends Xr{constructor(t,e){super(),uo(this,t,e)}async init(){await lo(this,xo,bo),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 D({start:()=>u(),async pull(t){r||await u();const{value:e,done:n}=await r.read();if(n)throw new f(Lr);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 xo(Vr,t,yo(t,i,e));if(206!=n.status)throw new f(Lr);const u=n.headers.get(Zr);if(u){const t=o(u.trim().split(/[\s-]+/)[1]);if(!o.isNaN(t)&&t!=i)throw new f(Lr)}mo(t,n),ho(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,xo,bo)}}class co extends Xr{constructor(t,e){super(),uo(this,t,e)}async init(){await lo(this,Ro,go),super.init()}readUint8Array(t,e){return fo(this,t,e,Ro,go)}}function uo(t,e,r){const{preventHeadRequest:o,useRangeHeader:i,forceRangeRequests:s,combineSizeEocd:a,checkResourceChanges:c=!0,maximumRangeSize:u=jr,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 lo(t,e,n){const{url:r,preventHeadRequest:o,useRangeHeader:i,forceRangeRequests:s,combineSizeEocd:a}=t;if(function(t){const{baseURI:e}=ne(),{protocol:n}=new d(t,e);return"http:"==n||"https:"==n}(r)&&(i||s)&&(typeof o==wt||o)){const r=await e(Vr,t,yo(t,a?-22:void 0)),o=r.headers.get("Accept-Ranges");if(!(s||o&&o.toLowerCase()==Gr))throw new f(Lr);{if(a){const e=new w(await r.arrayBuffer());206==r.status&&e.length==K&&(t.Lt=e)}ho(t,r);const o=wo(r);o===dt?await zo(t,e,n):t.size=o}}else await zo(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 yt;{e+n>u&&(n=u-e);const i=await r(Vr,t,yo(t,e,n));if(206!=i.status)throw new f(Lr);const s=i.headers.get(Zr);if(s){const t=o(s.trim().split(/[\s-]+/)[1]);if(!o.isNaN(t)&&t!=e)throw new f(Lr)}mo(t,i),ho(t,i);const a=new w(await i.arrayBuffer());if(a.length!=n)throw new f(Lr);return a}}{const{data:r}=t;return r||await i(t,l),t.data.subarray(e,e+n)}}function wo(t){const e=t.headers.get(Zr);if(e){const t=e.trim().split(/\s*\/\s*/)[1];if(t&&"*"!=t){const e=o(t);if(!o.isNaN(e))return e}}}function po({headers:t}){return{Bt:t.get("Etag")||dt,lastModified:t.get("Last-Modified")||dt}}function ho(t,e){const{checkResourceChanges:n,Wt:r}=t;n&&!r&&206==e.status&&(t.Wt=po(e))}function mo(t,e){const{checkResourceChanges:r,Wt:o,size:i}=t;if(r){const t=wo(e);if(t!==dt&&i!==dt&&t!=i)throw new f(Br);if(o){const t=po(e);if(n.entries(o).some(([e,n])=>n!==dt&&t[e]!==dt&&n!=t[e]))throw new f(Br)}}}function yo(t,e=0,r=1){return n.assign({},So(t),{[Hr]:Gr+"="+(e<0?e:e+"-"+(e+r-1))})}function So({options:t}){const{headers:e}=t;if(e)return T.iterator in e?n.fromEntries(e):e}async function bo(t){await Eo(t,xo)}async function go(t){await Eo(t,Ro)}async function Eo(t,e){const n=await e(Vr,t,So(t));t.data=new w(await n.arrayBuffer()),t.size=t.data.length}async function zo(t,e,n){if(t.preventHeadRequest)await n(t,t.options);else{const r=await e("HEAD",t,So(t)),i=r.headers.get("Content-Length");i&&!r.headers.get("Content-Encoding")?t.size=o(i):await n(t,t.options)}}async function xo(t,{fetch:e=fetch,options:r,url:o},i){const s=await e(o,n.assign({},r,{method:t,headers:i}));if(s.status<400)return s;throw 416==s.status?new f(Lr):new f(Mr+(s.statusText||s.status))}function Ro(t,{url:e},r){return new S((o,i)=>{const s=new XMLHttpRequest;if(s.addEventListener("load",()=>{if(s.status<400){const t=[];s.getAllResponseHeaders().trim().split(/[\r\n]+/).forEach(e=>{const n=e.trim().split(/\s*:\s*/);n[0]=n[0].trim().replace(/^[a-z]|-[a-z]/g,t=>t.toUpperCase()),t.push(n)}),o({status:s.status,arrayBuffer:()=>s.response,headers:new c(t)})}else i(416==s.status?new f(Lr):new f(Mr+(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 Do extends Xr{constructor(t,e={}){super(),n.assign(this,{url:t,reader:e.useXHR&&!e.fetch?new co(t,e):new ao(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 Fo extends Xr{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 Ao extends Jr{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 ko extends Xr{constructor(t){super(),this.Ht=t}async init(){const t=this;t.Vt=0;const e=t.Ht=await S.all(t.Ht.map(No));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 Uo(c,a,e);else{const i=r-a;o=ce(await Uo(c,a,i),await n.readUint8Array(t+i,e-i))}}else o=yt;return n.Vt=s.max(i,n.Vt),o}}class Co extends Yr{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 F({async write(e){if(e===Kr)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(Wr);o=n,o.size=0,o.maxSize&&(r.maxSize=o.maxSize),r.availableSize=r.maxSize,await _o(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,qr,{get:()=>a})}async closeDisk(){const t=this.writable.getWriter();try{await t.ready,await t.write(Kr)}finally{t.releaseLock()}}}class Io{constructor(t){return e.isArray(t)&&(t=new ko(t)),(t instanceof D||typeof t.getReader==pt)&&(t={readable:mn(t)}),t}}class To{constructor(t){return t.writable===dt&&typeof t.next==pt&&(t=new Co(t)),(t instanceof F||typeof t.getWriter==pt)&&(t={writable:Sn(t)}),t.size===dt&&(t.size=0),t}}function vo(t){return Boolean(t&&t.getData)}async function _o(t,e){if(!t.init||t.initialized)return S.resolve();await t.init(e)}async function No(t){return t=new Io(t),await _o(t),t.size!==dt&&t.readUint8Array||(t=new no(await yn(t.readable)),await _o(t)),t}function Uo(t,e,n){return t.readUint8Array(e,n)}function Oo(t,e){return t.createReadable?t.createReadable(e):t.readUint8Array?Xr.prototype.createReadable.call(t,e):t.readable}const Mo="filename",Lo="rawFilename",Bo="comment",Wo="rawComment",Po="uncompressedSize",Zo="compressedSize",Ho="offset",Vo="diskNumberStart",Go="lastModDate",jo="rawLastModDate",qo="lastAccessDate",Ko="rawLastAccessDate",Yo="creationDate",Xo="rawCreationDate",Jo="internalFileAttributes",Qo="externalFileAttributes",$o="msdosAttributesRaw",ti="msdosAttributes",ei="msDosCompatible",ni="zip64",ri="encrypted",oi="version",ii="versionMadeBy",si="zipCrypto",ai="directory",ci="executable",ui="compressionMethod",li="signature",di="extraField",fi="unixMode",wi="setuid",pi="setgid",hi="sticky",mi=[Mo,Lo,Po,Zo,Go,jo,Bo,Wo,qo,Ko,Yo,Xo,Ho,Vo,Jo,Qo,$o,ti,ei,ni,ri,oi,ii,si,ai,ci,"symlink",ui,li,"crc32",di,"extraFieldUnix","extraFieldInfoZip","extraFieldUnixType1","extraFieldPkwareUnix","uid","gid",fi,"unixExternalUpper",wi,pi,hi,"bitFlag","rawBitFlag","filenameLength","extraFieldLength","filenameUTF8","commentUTF8","rawExtraField","extraFieldZip64","extraFieldUnicodePath","extraFieldUnicodeComment","extraFieldAES","extraFieldNTFS","extraFieldExtendedTimestamp","extraFieldUSDZ"];class yi{constructor(t){mi.forEach(e=>this[e]=t[e])}}const Si="File format is not recognized",bi="End of central directory not found",gi="End of Zip64 central directory locator not found",Ei="Central directory header not found",zi="Local file header not found",xi="Zip64 extra field not found",Ri="File contains encrypted entry",Di="Encryption method not supported",Fi="Split zip file",Ai="Overlapping entry found",ki="Entry data out of bounds",Ci="Ambiguous archive",Ii="Encrypted central directory is not supported",Ti="Unsafe filename",vi="Invalid strictness (must be 'strict', 'balanced' or 'tolerant')",_i="Invalid filenameValidation (must be 'strict', 'balanced' or 'tolerant')",Ni="Invalid maxAppendedDataSize (must be a number greater than or equal to 0)",Ui="64-bit value exceeds Number.MAX_SAFE_INTEGER",Oi="unsorted central directory",Mi="unknown version needed to extract",Li="compressed patched data",Bi="malformed extra field",Wi="unknown zip64 extensible data",Pi="wrapped entries count",Zi="appended data",Hi="prepended data",Vi="prepended central directory",Gi="trailing central directory data",ji="duplicate filename",qi="mismatched zip64 end of central directory record",Ki="mismatched local file header (general purpose bit flag)",Yi="mismatched local file header (compression method)",Xi="mismatched local file header (crc32 or sizes)",Ji=/^[a-zA-Z]:/,Qi="utf-8",$i="cp437",ts=[[Po,O],[Zo,O],[Ho,O],[Vo,M]],es={[M]:{qt:Ls,bytes:4},[O]:{qt:Bs,bytes:8}},ns=i(o.MAX_SAFE_INTEGER);class rs{constructor(t,e={}){n.assign(this,{reader:new Io(t),options:e,Kt:new c})}async*getEntriesGenerator(t={}){const e=this;let{reader:r}=e;if(await _o(r),r.size!==dt&&r.readUint8Array||(r=new no(await yn(r.readable)),await _o(r)),r.size<K)throw new f(Si);const o=e.warnings=[],i=gs(t,e.options),a=i==_t,c=i!=Ut,l=xs(vs(e,t,Ct),i),d=function(t,e){if(t===dt)return e;if(!bs(t))throw new f(_i);return t}(vs(e,t,"filenameValidation"),i),w=vs(e,t,"normalizeFilename"),{Yt:p,Xt:h}=await Rs(r,c,l);if(!p)throw await async function(t){return await Ss(t)==W}(r)?new f(Fi):new f(bi);c&&h>1&&Ts("multiple end of central directory records");const m=le(p);let y=Ls(m,12),S=Ls(m,16);const b=p.offset,g=Ms(m,20),E=b+K+g,z=r.size-E;z>l&&Ts(Zi),z>0&&Is(o,Zi);let x=Ms(m,4);const D=r.Vt||0;let F,A,k,C,I,T=Ms(m,6),v=Ms(m,10),_=0,N=X;const U=S==O||y==O||v==M||T==M;if(S!=O&&T!=M&&(S+=ys(r,T)),U){const t=p.offset>=Y?await Uo(r,p.offset-Y,Y):yt,e=le(t);if(t.length==Y&&Ls(e,0)==j){S=ys(r,Ls(e,4))+Bs(e,8);let t=await Uo(r,S,X),i=le(t);const c=p.offset-Y-X;if((t.length<X||Ls(i,0)!=G)&&S!=c&&c>=0){const e=S;S=c,S>e&&(_=S-e),t=await Uo(r,S,X),i=le(t)}if(t.length<X||Ls(i,0)!=G)throw new f(gi);if(k=!0,C=Bs(i,4)>44,C){const t=s.min(Bs(i,4)-44,r.size-S-X);t>0&&(N+=t,I=function(t){const e={rawExtensibleData:t};if(t.length>=28){const r=le(t),o=Ms(r,26);n.assign(e,{compressionMethod:Ms(r,0),compressedSize:Bs(r,2),uncompressedSize:Bs(r,10),encryptionAlgorithm:Ms(r,18),bitLength:Ms(r,20),flags:Ms(r,22),hashAlgorithm:Ms(r,24),hashData:t.subarray(28,28+o)})}return e}(await Uo(r,S+X,t)))}x==M?x=Ls(i,16):x!=Ls(i,16)&&Cs(a,o,qi),T==M?T=Ls(i,20):T!=Ls(i,20)&&Cs(a,o,qi),v==M?v=Bs(i,32):v!=Bs(i,32)&&Cs(a,o,qi),y==O?y=Bs(i,40):y!=Bs(i,40)&&Cs(a,o,qi),S=ys(r,T)+Bs(i,48)+_}}let B=y;const P=p.offset-(k?N+Y:0);if(S>=r.size&&(_=r.size-S-y-K,S=r.size-y-K),D!=x)throw new f(Fi);if(S<0)throw new f(Si);let Z=0,V=await Uo(r,S,y),J=le(V);if(y){if(V.length<4)throw new f(Si);const t=P-y;if(S!=t&&T==x){const e=Ls(J,Z)==H||Boolean(I&&I.compressedSize)||as(J);let n=!e;if(!n&&t>=0&&t+4<=r.size&&(n=Ls(le(await Uo(r,t,4)),0)==H),n){const n=S;S=t,S>n&&(_+=S-n,F=e),V=await Uo(r,S,y),J=le(V)}}}const Q=P-S;if(y!=Q&&Q>=0&&T==x&&(y=Q,V=await Uo(r,S,y),J=le(V)),S<0||S>=r.size)throw new f(Si);e.directoryOffset=S,e.directoryLength=B;const $=_s(e,t,"decryptCentralDirectory");let tt,et;if($&&v&&V.length>=4&&Ls(J,0)!=H&&(C||as(J))){const t=function(t,e,n){const r=t&&t.compressedSize?t.compressedSize:e;return r>0&&r<=n?r:n}(I,B,V.length);et=V.subarray(t),V=await $(V.subarray(0,t),I),J=le(V),B=V.length,tt=!0}I&&!tt&&(V.length<4||Ls(J,0)==H)&&Is(o,Wi),A=S;const nt=vs(e,t,"filenameEncoding"),ct=vs(e,t,"commentEncoding"),ut=new u;let lt,ft=-1;const wt=!a&&!k;!v&&wt&&(v=cs(J,V,Z),v&&Is(o,Pi));for(let i=0;i<v;i++){const a=new ss(r,e.options);if(Z+q>V.length||Ls(J,Z)!=H){if(0==i&&!tt&&(C||as(J)))throw new f(Ii);throw new f(Ei)}ls(a,J,Z+6);const c=Boolean(a.bitFlag.languageEncodingFlag),u=Z+q,l=u+a.filenameLength,p=l+a.extraFieldLength,h=Ms(J,Z+4),m=!(h>>8),y=h>>8==3,S=V.subarray(u,l),b=Ms(J,Z+32),g=p+b,E=V.subarray(p,g),z=c,x=c,D=Ls(J,Z+38),F=D&L,k={readOnly:Boolean(1&F),hidden:Boolean(2&F),system:Boolean(4&F),directory:Boolean(16&F),archive:Boolean(32&F)},I=Ls(J,Z+42),T=_s(e,t,"decodeText")||Ur,N=z?Qi:nt||$i,U=x?Qi:ct||$i;let O=T(S,N,Tt);if(O===dt&&(O=Ur(S,N)),w){const t=w(O);t!==dt&&(O=t)}if(zs(O,d)){const t=new f(Ti);throw t.filename=O,t}let B=T(E,U,vt);B===dt&&(B=Ur(E,U)),n.assign(a,{index:i,Jt:tt,versionMadeBy:h,msDosCompatible:m,zip64:!1,compressedSize:0,uncompressedSize:0,Qt:b,offset:I,diskNumberStart:Ms(J,Z+34),internalFileAttributes:Ms(J,Z+36),externalFileAttributes:D,msdosAttributesRaw:F,msdosAttributes:k,rawFilename:S,filenameUTF8:z,commentUTF8:x,rawExtraField:V.subarray(l,p),rawComment:E,filename:O,comment:B}),ds(a,a,J,Z+6)&&Is(o,Bi,O),a.offset+=_;const W=ys(r,a.diskNumberStart)+a.offset;A=s.min(W,A),W<ft&&Is(o,Oi,O),ft=W,(a.version&L)>63&&Is(o,Mi,O),32&~a.rawBitFlag||Is(o,Li,O),ut.has(a.filename)&&(lt=!0),ut.add(a.filename);const P=a.externalFileAttributes>>16&M;a.unixMode===dt&&16877&P&&(a.unixMode=P);const G=Boolean(a.unixMode&it),j=Boolean(a.unixMode&st),K=Boolean(512&a.unixMode),Y=40960==((a.unixMode===dt?P:a.unixMode)&rt),X=!Y&&(a.unixMode!==dt?!!(73&a.unixMode):y&&!!(73&P)),Q=a.unixMode!==dt&&(a.unixMode&rt)==ot,$=(P&rt)==ot;n.assign(a,{setuid:G,setgid:j,sticky:K,symlink:Y,unixExternalUpper:P,executable:X,directory:Q||$||m&&k.directory||a.filename.endsWith(at),zipCrypto:a.encrypted&&!a.extraFieldAES});const et=new yi(a);if(et.getData=(t,n)=>a.getData(t,et,e.Kt,n),et.arrayBuffer=async t=>{const n=new R,r=yn(n.readable).then(t=>t.arrayBuffer());return r.catch(()=>{}),await a.getData(n,et,e.Kt,t),r},Z=g,i==v-1&&wt){const t=cs(J,V,Z);t&&(v+=t,Is(o,Pi))}const{onprogress:pt}=t;if(pt)try{await pt(i+1,v,new yi(a))}catch{}yield et}let pt=Z,ht=us(V.subarray(Z))||(tt?us(et):dt);if(!ht&&!tt){const t=S+Z,e=s.min(P-t,65541);e>=6&&(ht=us(await Uo(r,t,e)))}ht&&(e.digitalSignature=ht,pt=Z+6+ht.length),(Z!=B&&pt!=B||!tt&&Z!=y&&pt!=y)&&Cs(a,o,Gi),lt&&Cs(a,o,ji);const mt=vs(e,t,"extractPrependedData"),St=vs(e,t,"extractAppendedData"),bt=(a||mt)&&v&&4==A&&await async function(t){const e=await Ss(t);return e==W||808471376==e}(r)?4:0;return a&&(_||v&&A>bt)&&Ts(Hi),(_||v&&A>4)&&Is(o,Hi),F&&Is(o,Vi),mt&&(e.prependedData=A>bt?await Uo(r,bt,A-bt):yt),e.comment=g?await Uo(r,b+K,g):yt,St&&(e.appendedData=E<r.size?await Uo(r,E,r.size-E):yt),!0}async getEntries(t={}){const e=[];for await(const n of this.getEntriesGenerator(t))e.push(n);return e}async close(){const{reader:t}=this;t.readUint8Array||!t.readable||t.readable.locked||await t.readable.cancel()}}class os{constructor(t={}){const{readable:e,writable:n}=new R,r=new rs(e,t).getEntriesGenerator();this.readable=new D({async pull(t){const{done:e,value:n}=await r.next();if(e)return t.close();const o=function(){const{readable:t,writable:e}=new R;if(n.getData)return async function(){try{await n.getData(e)}catch(t){try{await e.abort(t)}catch{}}}(),t}(),i={...n,readable:o};delete i.getData,t.enqueue(i)}}),this.writable=n}}async function is(t,e={}){if(t=new Io(t),await _o(t),t.size!==dt&&t.readUint8Array||(t=new no(await yn(t.readable)),await _o(t)),t.size<K)return!1;const n=gs(e,{}),r=n!=Ut,o=xs(e[Ct],n),{Yt:i,Xt:s}=await Rs(t,r,o);if(!i||n==_t&&s>1)return!1;const a=Ms(le(i),20),c=i.offset+K+a;return t.size-c<=o}let ss=class{constructor(t,e){n.assign(this,{reader:t,options:e})}async getData(t,e,n,r={}){const o=this,i=ne(),{reader:a,index:c,offset:u,diskNumberStart:l,extraFieldAES:d,extraFieldZip64:w,compressionMethod:p,bitFlag:h,rawBitFlag:m,crc32:y,rawLastModDate:S,uncompressedSize:b,compressedSize:g}=o,{dataDescriptor:E}=h,z=e.localDirectory={},x=e.warnings=[],R=ys(a,l)+u,D=await Uo(a,R,ct),A=le(D);let k=vs(o,r,St),C=vs(o,r,bt);const I=vs(o,r,gt);if(Vt(k,C),k=k&&k.length&&k,C=C&&C.length&&C,d&&99!=d.originalCompressionMethod)throw new f(zn);if(D.length<ct||Ls(A,0)!=B)throw new f(zi);ls(z,A,4);const{extraFieldLength:T,filenameLength:v}=z,_=z.dataOffset=R+ct+v+T,N=vs(o,r,"checkLocalDirectory"),U=gs(r,o.options),O=function(t,e){return t===dt?e!=Ut:Boolean(t)}(N,U),M=function(t,e){return t===dt?e==_t:Boolean(t)}(N,U);let W=yt;if(M&&(v||T)){const t=await Uo(a,R+ct,v+T);W=t.subarray(0,v),z.rawExtraField=t.subarray(v)}else z.rawExtraField=T?await Uo(a,R+ct+v,T):yt;M&&(z.rawFilename=W),ds(o,z,A,4,!0)&&Is(x,Bi),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])||Cs(s,o,"mismatched local file header (filename)"),(2057&e.rawBitFlag)!=(2057&t.rawBitFlag)&&Cs(s,o,Ki),e.compressionMethod!=t.compressionMethod&&Cs(s,o,Yi),e.bitFlag.dataDescriptor||a||!(e.crc32||e.compressedSize||e.uncompressedSize)||e.crc32==t.crc32&&e.compressedSize==t.compressedSize&&e.uncompressedSize==t.uncompressedSize||Cs(s,o,Xi)}(o,z,W,M,O?dt:x);const{lastAccessDate:Z,creationDate:H,uid:V,gid:G}=z;Z&&(e.lastAccessDate=Z),H&&(e.creationDate=H),V!==dt&&e.uid===dt&&(e.uid=V),G!==dt&&e.gid===dt&&(e.gid=G);const j=o.encrypted&&z.encrypted&&!I,q=j&&!d;if(I||(e.zipCrypto=q),j&&!(64&~z.rawBitFlag))throw new f(Di);const K=I?dt:Fn(p);if(0!=p&&8!=p&&9!=p&&!K&&!I)throw new f(zn);if(j){if(!q&&(d.strength<1||d.strength>3))throw new f(Di);if(!k&&!C)throw new f(Ri)}if(_+g>a.size)throw new f(ki);const Y=g,X=mn(a.createReadable({offset:_,size:Y})),J=Zt(vs(o,r,Et));Ht(J);const Q=vs(o,r,"checkPasswordOnly");let $=vs(o,r,"checkOverlappingEntry");const tt=vs(o,r,"checkOverlappingEntryOnly");tt&&($=!0);const{onstart:et,onprogress:nt,onend:rt}=r,ot=0!=p&&!I,it=I?g:b,st=9==p;let at=vs(o,r,xt);st&&(at=!1);const ut=vs(o,r,"checkCrc32"),lt=(ut===dt?vs(o,r,"checkSignature"):ut)&&!I&&(!j||q||d&&1==d.vendorVersion),ft={options:{codecType:Xn,password:k,rawPassword:C,zipCrypto:q,encryptionStrength:d&&d.strength,checkCrc32:lt,checkAuthenticationCode:vs(o,r,"checkAuthenticationCode"),passwordVerification:q&&(E?S>>>8&L:y>>>24&L),outputSize:it,crc32:y,compressed:ot,encrypted:j,useWebWorkers:vs(o,r,zt),useCompressionStream:at,transferStreams:vs(o,r,Rt),deflate64:st,format:K?K.format:dt,codecURI:K?K.codecURI:dt,compressionMethod:p,rawBitFlag:m,checkPasswordOnly:Q},config:i,ft:{signal:J,size:Y,onstart:et,onprogress:nt,onend:rt}};let wt,pt;$&&await async function({reader:t,$t:e,index:n,offset:r,crc32:o,compressedSize:i,uncompressedSize:s,dataOffset:a,dataDescriptor:c,extraFieldZip64:u,Kt:l}){let d=0;if(c&&(d=u?20:12),d){const n=await Uo(t,a+i,d+4),r=le(n);let c=n.length==d+4&&Ls(r,0)==P;if(c){const t=ms(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=ms(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(Ai);throw t.overlappingEntry=e.$t,t}l.set(n,w)}({reader:a,$t:e,index:c,offset:R,crc32:y,compressedSize:g,uncompressedSize:b,dataOffset:_,dataDescriptor:E||z.bitFlag.dataDescriptor,extraFieldZip64:w||z.extraFieldZip64,Kt:n});try{if(!tt){Q&&(t=new F),t=new To(t),await _o(t,function(t,e,n){return s.min(t,n?1032*e:e)}(it,g,ot)),({writable:wt}=t);const{outputSize:e}=await kr({readable:X,writable:wt},ft);if(t.size+=e,e!=it)throw new f(In)}}catch(e){if(e.outputSize!==dt&&(t.size+=e.outputSize),!Q||e.message!=Ie)throw pt=e,e}finally{if((vo(t)||!vs(o,r,Dt))&&wt&&!wt.locked){const t=wt.getWriter();if(pt)try{await t.abort(pt)}catch{}else await t.close()}}return Q||tt?dt:t.getData?t.getData():wt}};function as(t){const e=s.min(t.byteLength,1024)-3;for(let n=0;n<e;n++)if(134630224==Ls(t,n))return!0;return!1}function cs(t,e,n){let r=0;for(;n+q<=e.length&&Ls(t,n)==H;)n+=q+Ms(t,n+28)+Ms(t,n+30)+Ms(t,n+32),r++;return r%65536?0:r}function us(t){if(t.length>=6){const e=le(t);if(Ls(e,0)==Z){const n=Ms(e,4);if(6+n<=t.length)return t.subarray(6,6+n)}}}function ls(t,e,r){const o=t.rawBitFlag=Ms(e,r+2),i=!(1&~o),s=Ls(e,r+6);n.assign(t,{encrypted:i,version:Ms(e,r),bitFlag:{level:(6&o)>>1,dataDescriptor:!(8&~o),languageEncodingFlag:(o&nt)==nt},rawLastModDate:s,lastModDate:Ns(s),filenameLength:Ms(e,r+22),extraFieldLength:Ms(e,r+24)})}function ds(t,e,r,o,i){const{rawExtraField:s}=e,u=e.extraField=new c,l=le(s);let d=0,w=!1;try{for(;d<s.length;){const t=Ms(l,d),e=Ms(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=Ms(r,o+4);n.assign(e,{signature:Ls(r,o+10),crc32:Ls(r,o+10),compressedSize:Ls(r,o+14),uncompressedSize:Ls(r,o+18)});const h=u.get(1);h&&(function(t,e){e.zip64=!0;const n=le(t.data),r=ts.filter(([t,n])=>e[t]==n),o=r.reduce((t,[,e])=>t+es[e].bytes,0);if(t.data.length<o)throw new f(xi);for(let o=0,i=0;o<r.length;o++){const[s,a]=r[o],c=es[a];e[s]=t[s]=c.qt(n,i),i+=c.bytes}}(h,e),e.extraFieldZip64=h);const m=u.get(28789);m&&(fs(m,Mo,Lo,e,t),e.extraFieldUnicodePath=m);const y=u.get(25461);y&&(fs(y,Bo,Wo,e,t),e.extraFieldUnicodeComment=y);const S=u.get(J);S&&S.data.length>=7?(function(t,e,r){const o=le(t.data),i=Os(o,4);n.assign(t,{vendorVersion:Os(o,0),vendorId:Os(o,2),strength:i,originalCompressionMethod:r,compressionMethod:Ms(o,5)}),e.compressionMethod=t.compressionMethod,1!=t.vendorVersion&&(e.crc32=dt)}(S,e,p),e.extraFieldAES=S):e.compressionMethod=p;const b=u.get(13);b&&(ws(b,e),e.extraFieldPkwareUnix=b);const g=u.get(22613);g&&(ws(g,e),e.extraFieldUnixType1=g);const E=u.get(10);E&&(function(t,e){const r=le(t.data);let o,i=4;try{for(;i<t.data.length&&!o;){const e=Ms(r,i),n=Ms(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=le(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:Us(i),lastAccessDate:Us(s),creationDate:Us(a)};n.assign(t,c),n.assign(e,c,{rawLastAccessDate:s,rawCreationDate:a})}}(E,e),e.extraFieldNTFS=E);const z=u.get(et);let x;if(z&&(x=ps(z,e,!1),e.extraFieldUnix=z),!x){const t=u.get(tt);t&&(ps(t,e,!0),e.extraFieldInfoZip=t)}const R=u.get(Q);R&&(function(t,e,n){if(!t.data.length)return;const r=le(t.data),o=Os(r,0),i=[],s=[];n?(1&~o||(i.push(Go),s.push(jo)),2&~o||(i.push(qo),s.push(Ko)),4&~o||(i.push(Yo),s.push(Xo))):t.data.length>=5&&(i.push(Go),s.push(jo));let c=1;i.forEach((n,o)=>{if(t.data.length>=c+4){const i=Ls(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 D=u.get($);return D&&(e.extraFieldUSDZ=D),w}function fs(t,e,r,o,i){if(t.data.length<5)return void(t.valid=!1);const s=le(t.data),a=new ge;a.append(i[r]);const c=le(new w(4));c.setUint32(0,a.get(),!0);const u=Ls(s,1),l=Os(s,0);n.assign(t,{version:l,[e]:Ur(t.data.subarray(5)),valid:1==l&&!i.bitFlag.languageEncodingFlag&&u==Ls(c,0)}),t.valid&&(o[e]=t[e],o[e+"UTF8"]=!0)}function ws(t,e){if(t.data.length<8)return;const r=le(t.data),o={lastAccessDate:new a(1e3*(0|Ls(r,0))),lastModDate:new a(1e3*(0|Ls(r,4)))};t.data.length>=12&&(o.uid=Ms(r,8),o.gid=Ms(r,10)),n.assign(t,o),n.assign(e,o)}function ps(t,e,r){try{const o=le(t.data);let i,s;if(r){let e=0;const r=Os(o,e++),a=Os(o,e++);i=hs(t.data.subarray(e,e+a)),e+=a;const c=Os(o,e++);s=hs(t.data.subarray(e,e+c)),n.assign(t,{version:r,uid:i,gid:s})}else t.data.length>=4&&(i=Ms(o,0),s=Ms(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 hs(t){const e=new w(4);return e.set(t,0),new m(e.buffer,e.byteOffset,4).getUint32(0,!0)}function ms(t,e,n){const r=Ls(t,e);let o,i;return n?(o=Bs(t,e+4),i=Bs(t,e+12)):(o=Ls(t,e+4),i=Ls(t,e+8)),{crc32:r,compressedSize:o,uncompressedSize:i}}function ys(t,e){return t.jt?t.jt(e):0}async function Ss(t){return Ls(le(await Uo(t,0,4)))}function bs(t){return t===_t||t===Nt||t===Ut}function gs(t,e){return Es(t,Es(e,Nt))}function Es(t,e){const n=t.strictness;if(n!==dt){if(!bs(n))throw new f(vi);return n}const r=t.checkAmbiguity;return r===dt?e:r?_t:e==Ut?Ut:Nt}function zs(t,e){if(e==Ut)return!1;const n=t.split("/");return n.length>1&&""===n[n.length-1]&&n.pop(),!!(n.includes("..")||t.startsWith("/")||t.startsWith("\\\\")||Ji.test(t))||e==_t&&(n.includes(".")||n.includes(""))}function xs(t,e){if(t!==dt){const e=qt(t);if("number"!=typeof e||o.isNaN(e)||e<0)throw new f(Ni);return e}return e==_t?0:e==Ut?1/0:M}async function Rs(t,e,n){const{size:r}=t,o=s.min(r,65557),i={count:64};let a,c,u=0;for await(const[n,s,l,d,f]of Ds(t,o)){const o=Ms(n,d+20);if(f+K+o==r){const o=await As(t,n,s,d,f,r,i);if(2==o){if(a||(a=Fs(l,d,f)),u++,!e||u>1)break}else 1!=o||c||(c=Fs(l,d,f))}}return a||(a=c),a||(a=await async function(t,e,n){const{size:r}=t,o=s.min(r,e==1/0?r:65557+e);let i,a;for await(const[e,s,c,u,l]of Ds(t,o)){const o=Fs(c,u,l);i||(i=o);const d=await As(t,e,s,u,l,r,n);if(2==d)return o;1!=d||a||(a=o)}return a||i}(t,n,i)),{Yt:a,Xt:u}}async function*Ds(t,e){const n=t.size-e,r=await Uo(t,n,e),o=le(r);for(let t=r.length-K;t>=0;t--)Ls(o,t)==V&&(yield[o,n,r,t,n+t])}function Fs(t,e,n){return{offset:n,buffer:t.slice(e,e+K).buffer}}async function As(t,e,n,r,o,i,s){const a=Ms(e,r+10),c=Ls(e,r+12),u=Ls(e,r+16);if(a==M||c==O||u==O)return await ks(t,e,n,o-Y,i,s)==j?2:0;if(!a&&!c)return 1;const l=Ms(e,r+6);for(const r of[o-c,ys(t,l)+u])if(await ks(t,e,n,r,i,s)==H)return 2;return 0}async function ks(t,e,n,r,o,i){return r<0||r+4>o?dt:r>=n?Ls(e,r-n):i.count>0?(i.count--,Ls(le(await Uo(t,r,4)),0)):dt}function Cs(t,e,n){t?Ts(n):Is(e,n)}function Is(t,e,n){if(!t.some(t=>t.reason==e)){const r={reason:e};n!==dt&&(r.filename=n),t.push(r)}}function Ts(t){const e=new f(Ci);throw e.reason=t,e}function vs(t,e,n){return e[n]===dt?t.options[n]:e[n]}function _s(t,e,n){return Pt(vs(t,e,n))}function Ns(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 Us(t){return new a(o(t/i(1e4)-i(116444736e5)))}function Os(t,e){return t.getUint8(e)}function Ms(t,e){return t.getUint16(e,!0)}function Ls(t,e){return t.getUint32(e,!0)}function Bs(t,e){const n=t.getBigUint64(e,!0);if(n>ns)throw new f(Ui);return o(n)}var Ws=n.freeze({__proto__:null,ERR_AMBIGUOUS_ARCHIVE:Ci,ERR_BAD_FORMAT:Si,ERR_CENTRAL_DIRECTORY_NOT_FOUND:Ei,ERR_ENCRYPTED:Ri,ERR_ENCRYPTED_CENTRAL_DIRECTORY:Ii,ERR_ENTRY_DATA_OUT_OF_BOUNDS:ki,ERR_EOCDR_LOCATOR_ZIP64_NOT_FOUND:gi,ERR_EOCDR_NOT_FOUND:bi,ERR_EXTRAFIELD_ZIP64_NOT_FOUND:xi,ERR_INVALID_AUTHENTICATION_CODE:Ce,ERR_INVALID_COMPRESSED_DATA:Tn,ERR_INVALID_CRC32:vn,ERR_INVALID_FILENAME_VALIDATION:_i,ERR_INVALID_MAX_APPENDED_DATA_SIZE:Ni,ERR_INVALID_PASSWORD:ke,ERR_INVALID_STRICTNESS:vi,ERR_INVALID_UNCOMPRESSED_SIZE:In,ERR_LOCAL_FILE_HEADER_NOT_FOUND:zi,ERR_OVERLAPPING_ENTRY:Ai,ERR_SPLIT_ZIP_FILE:Fi,ERR_UNSAFE_FILENAME:Ti,ERR_UNSUPPORTED_COMPRESSION:zn,ERR_UNSUPPORTED_ENCRYPTION:Di,ERR_UNSUPPORTED_UINT64:Ui,ERR_WORKER_STARTUP_TIMEOUT:$n,WARNING_APPENDED_DATA:Zi,WARNING_COMPRESSED_PATCHED_DATA:Li,WARNING_DUPLICATE_FILENAME:ji,WARNING_MALFORMED_EXTRA_FIELD:Bi,WARNING_MISMATCHED_LOCAL_FILE_HEADER_BIT_FLAG:Ki,WARNING_MISMATCHED_LOCAL_FILE_HEADER_COMPRESSION_METHOD:Yi,WARNING_MISMATCHED_LOCAL_FILE_HEADER_CRC32_OR_SIZES:Xi,WARNING_MISMATCHED_ZIP64_END_OF_CENTRAL_DIRECTORY:qi,WARNING_PREPENDED_CENTRAL_DIRECTORY:Vi,WARNING_PREPENDED_DATA:Hi,WARNING_TRAILING_CENTRAL_DIRECTORY_DATA:Gi,WARNING_UNKNOWN_VERSION:Mi,WARNING_UNKNOWN_ZIP64_EXTENSIBLE_DATA:Wi,WARNING_UNSORTED_CENTRAL_DIRECTORY:Oi,WARNING_WRAPPED_ENTRIES_COUNT:Pi,ZipReader:rs,ZipReaderStream:os,isZipFile:is});const Ps="File already exists",Zs="Zip file comment exceeds 64KB",Hs="Invalid zip file comment (must be a Uint8Array)",Vs="File entry comment exceeds 64KB",Gs="Invalid file entry comment (must be a string)",js="Invalid date (must be a valid Date instance)",qs="File entry name exceeds 64KB",Ks="Version exceeds 65535",Ys="The strength must equal 1, 2, or 3",Xs="Encryption is not supported in USDZ files",Js="Split zip files are not supported in USDZ files",Qs="Encryption is not supported when the 'passThrough' option is set",$s="Invalid extra field (must be a Map)",ta="Invalid extra field type (must be integer 0..65535)",ea="Invalid extra field data (must be a Uint8Array)",na="Extra field data exceeds 64KB",ra=-2147483648,oa=2147483647,ia=i(0),sa=i("0x7fffffffffffffff"),aa="Zip64 is not supported (set the 'zip64' option to 'true')",ca="Undefined uncompressed size",ua="Undefined compression method",la="Undetermined size",da="Undefined reader",fa="Invalid reader (must be a Reader instance, a ReadableStream instance, or an object with a 'readable' property)",wa="Zip file not empty",pa="Invalid uid (must be integer 0..2^32-1)",ha="Invalid gid (must be integer 0..2^32-1)",ma="Invalid UNIX mode (must be integer 0..65535)",ya="Invalid unixExtraFieldType (must be 'infozip' or 'unix')",Sa="uid/gid must be 0..65535 for unixExtraFieldType 'unix' (use 'infozip' for larger ids)",ba="Invalid msdosAttributesRaw (must be integer 0..255)",ga="Invalid msdosAttributes (must be an object with boolean flags)",Ea="Invalid level (must be integer 0..9)",za="Signature data exceeds 64KB",xa=new w([7,0,2,0,65,69,3,0,0]),Ra="infozip",Da="unix";let Fa=0;const Aa=[];class ka{constructor(t,e={}){t=new To(t);const{availableSize:r=ft,maxSize:o=ft}=t,i=r>0&&r!==ft&&o>0&&o!==ft;if(i&&e[kt])throw new f(Js);n.assign(this,{writer:t,te:i,options:e,ee:new c,ne:new u,offset:e[At]===dt?t.size||t.writable.size||0:e[At],re:e[At]===dt?0:e[At]-(t.size||t.writable.size||0),oe:new u,ie:[],se:0,ae:0,ce:dt})}prependZip(t){return Ia(this,async function(t,e){if(t.ne.size)throw new f(wa);await t.ue(e)}(this,t))}appendZip(t){return Ia(this,this.ue(t))}async ue(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 Io(t),await _o(t),t.size!==dt&&t.readUint8Array||(t=new no(await yn(t.readable)),await _o(t));const{ZipReader:o}=await S.resolve().then(function(){return Ws}),a=new o(t),u=await a.getEntries();await a.close(),await _o(r.writer);const{directoryOffset:w}=a;u.forEach(({filename:t})=>{if(i.has(t))throw new f(Ps);i.add(t),l.push(t)}),r.le=!0;const{de:p}=r;r.de=new S(t=>d=()=>{r.le=!1,t()}),await p,r.te&&(delete r.te,await async function(t){return le(await Uo(t,0,4)).getUint32(0,!0)==W}(t)||(await $a(r.writer,Ja()),r.offset+=4));const h=await async function(t,n,r,o){const{writer:i}=t,s=new c;if(i.closeDisk){const a=e.from(r).sort((t,e)=>Xa(n,t)-Xa(n,e));let c=0;for(const e of a){const r=Xa(n,e);await Ka(t,n,c,r-c),Ga(i,await Ya(n,r))&&await i.closeDisk(),s.set(e,{offset:ja(t,i),diskNumberStart:Ha(i)}),c=r}await Ka(t,n,c,o-c)}else{const e=t.offset;await Ka(t,n,0,o),r.forEach(t=>s.set(t,{offset:e+Xa(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=qa(f||yt),t.extraFieldAES&&(d=99);const y=mc(f),S=Boolean(l)&&l.uncompressedSize!==dt,b=Boolean(l)&&l.compressedSize!==dt,g=-7&Sc(w,p,m,a,d)|w<<1,{fe:E,we:z}=yc({version:e,bitFlag:g,compressionMethod:d,uncompressedSize:c,compressedSize:u,rawLastModDate:r,rawFilename:o,pe:b,he:S,extraFieldLength:y}),{crc32:x}=t;x!==dt&&wc(z,10,x);const{offset:R,diskNumberStart:D}=h.get(t);n.assign(t,{me:!0,he:S,pe:b,offset:R,diskNumberStart:D,ye:!1,Se:yt,be:yt,ge:yt,Ee:yt,ze:yt,rawExtraField:f,xe:yt,extendedTimestamp:!1,fe:E,we:z}),s.set(t.filename,t)})}catch(t){throw l.forEach(t=>i.delete(t)),t}finally{a(),o.delete(u),d&&d()}}add(t="",e,r={}){const o=this,{oe:s}=o,a=async function(t,e,r,o){if(ic(t,o=n.assign({},o),ai)&&!e.endsWith(at)&&(e+=at),t.ne.has(e))throw new f(Ps);t.ne.add(e),Fa<ne().maxWorkers?Fa++:await new S(t=>Aa.push(t));try{return await async function(t,e,r,o){const s=_a(t,e,o);({name:e}=s);const a=Na(t,e,o),{comment:c}=a,u=o[di];t.ee.set(e,dt);const l=t.ce,d={};let w,p;a.Re.keepOrder&&(d.De=new S(t=>w=t)),t.ce=d;try{const{Re:c}=a;0==c.level||c.compressionMethod!==dt||c.passThrough||await rr(ne())||(c.level=0);const u=await async function(t,e,{Re:r},o){if(r.passThrough&&!e&&!ic(t,o,ai))throw new f(da);let i;if(e){if(e=new Io(e),await _o(e),!e.readable&&!e.readUint8Array)throw new f(fa);({size:i}=e)}return n.assign({reader:e},Oa(t,Boolean(e),i,r,o))}(t,r,a,o);({reader:r}=u);const h=Va(t.writer),m=Ha(t.writer),y=Ma(o=n.assign({},o,s.Re,a.Re,u.Re,{signature:o[li],crc32:o.crc32===dt?o[li]:o.crc32,offset:t.offset-h,diskNumberStart:m,[kt]:t.options[kt]})),b=Wa(o),g=mc(y.Fe,b.Ae);p=await async function(t,e,r,o,s){const{ee:a,writer:c}=t,{keepOrder:u,dataDescriptor:l,ke:d,signal:w}=s,{Ce:p,$t:h,Ie:m,Te:y}=o,b=t.options[kt];let g,E,z,x,D,F,A,k=h,C=0;const I=u&&m?m.De:dt;a.set(e,k);try{s.bufferedWrite||!u||t.le||t.se||t.ae||!l&&!d?(g=!0,t.se++,A=s.createTempStream?await s.createTempStream():new R(dt,dt,{highWaterMark:ft}),A.size=0,await _o(c)):(E=!0,t.ae++,A=c,await I,await T()),await _o(A);const h=Va(c);t.te&&!g&&await Qa(t,c),b&&!g&&La(o,t.offset-h);const{Fe:m}=p;g||await v();const y=Ha(c),z=ja(t,c);if(k.diskNumberStart=y,g||(D=!0,F=c.size,await $a(A,m)),k=await async function(t,e,{diskNumberStart:r,De:o},s,a,c){const{Ce:u,ve:l,_e:d}=s,{fe:w,we:p,lastModDate:h,rawLastModDate:m,encrypted:y,compressed:S,version:b,compressionMethod:g,Se:E,Ne:z,ge:x,Ue:R,Ee:D,ze:F,be:A}=u,{Ae:k}=l,{rawFilename:C,lastAccessDate:I,creationDate:T,password:v,rawPassword:_,level:N,zip64:U,me:M,he:B,pe:W,zipCrypto:P,dataDescriptor:Z,directory:H,executable:V,versionMadeBy:G,rawComment:j,rawExtraField:q,xe:K,useWebWorkers:Y,transferStreams:X,onstart:J,onprogress:Q,onend:$,signal:tt,encryptionStrength:et,extendedTimestamp:nt,msDosCompatible:rt,internalFileAttributes:ot,externalFileAttributes:it,uid:st,gid:at,unixMode:ct,symlink:ut,setuid:lt,setgid:ft,sticky:wt,unixExternalUpper:pt,msdosAttributesRaw:ht,msdosAttributes:mt,useCompressionStream:yt,passThrough:St,format:bt,codecURI:gt}=c,Et={De:o,versionMadeBy:G,zip64:U,me:M,directory:Boolean(H),executable:Boolean(V),filenameUTF8:!0,rawFilename:C,commentUTF8:!0,rawComment:j,Se:E,Ne:z,ge:x,Ee:D,ze:F,be:A,rawExtraField:q,xe:K,extendedTimestamp:nt,msDosCompatible:rt,internalFileAttributes:ot,externalFileAttributes:it,diskNumberStart:r,uid:st,gid:at,unixMode:ct,symlink:Boolean(ut),setuid:lt,setgid:ft,sticky:wt,unixExternalUpper:pt,msdosAttributesRaw:ht,msdosAttributes:mt};let{crc32:zt,uncompressedSize:xt}=c,Rt=0;St||(xt=0);const{writable:Dt}=e;if(t){const n=t.size,r=mn(Oo(t,{size:n})),o={options:{codecType:Yn,inputSize:n,level:N,rawPassword:_,password:v,encryptionStrength:et,zipCrypto:y&&P,passwordVerification:y&&P&&m>>8&L,computeCrc32:!St,compressed:S&&!St,encrypted:y&&!St,useWebWorkers:Y,useCompressionStream:yt,transferStreams:X,format:bt,codecURI:gt,compressionMethod:g},config:a,ft:{signal:tt,size:n,onstart:J,onprogress:Q,onend:$}};try{const t=await kr({readable:r,writable:Dt},o);if(Rt=t.outputSize,e.size+=Rt,St||(xt=t.inputSize,y&&!P||(zt=t.crc32)),!W&&Rt>=O||!B&&xt>=O)throw new f(aa)}catch(t){throw t.outputSize!==dt&&(e.size+=t.outputSize),t}}return function({crc32:t,compressedSize:e,uncompressedSize:n,Ce:r,ve:o},{zip64:s,zipCrypto:a,passThrough:c,dataDescriptor:u}){const{we:l,encrypted:d}=r,{Oe:f,Me:w}=o;d&&!a&&!c||t===dt||(wc(l,10,t),u&&wc(f,w,t)),s?u&&(pc(f,w+4,i(e)),pc(f,w+12,i(n))):(wc(l,14,e),wc(l,18,n),u&&(wc(f,w+4,e),wc(f,w+8,n)))}({crc32:zt,compressedSize:Rt,uncompressedSize:xt,Ce:u,ve:l},c),Z&&await $a(e,k),n.assign(Et,{uncompressedSize:xt,compressedSize:Rt,lastModDate:h,rawLastModDate:m,creationDate:T,lastAccessDate:I,encrypted:Boolean(y),zipCrypto:Boolean(P),size:d+Rt,compressionMethod:g,version:b,fe:w,we:p,signature:zt,crc32:!y||P||St?zt:dt,Ue:R,he:B,pe:W}),Et}(r,A,k,o,ne(),s),g||(D=!1),a.set(e,k),k.filename=e,g){if(await S.all([A.writable.getWriter().close(),I]),await T(),t.te&&await Qa(t,c),x=!0,F=c.size,await v(),k.diskNumberStart=Ha(c),k.offset=ja(t,c),b){const e=o._e;La(o,t.offset-Va(c)),k.size+=o._e-e}!function({rawFilename:t,encrypted:e,zip64:n,Ne:r,crc32:o,compressedSize:s,uncompressedSize:a,he:c,pe:u},l,{dataDescriptor:d,passThrough:f}){if(d||((!e||f&&o!==dt)&&wc(l,14,o),u||wc(l,18,s),c||wc(l,22,a)),n&&r){const e=ct+mc(t)+4;pc(l,e,i(a)),pc(l,e+8,i(s))}}(k,p.Le,s),await $a(c,p.Fe),await tc(A.readable,c,w,t=>C+=t),c.size+=A.size,x=!1}else k.diskNumberStart=y,k.offset=z;return t.offset+=k.size,k}catch(n){if(x||D){if(t.hasCorruptedEntries=!0,n)try{n.corruptedEntry=!0}catch{}t.offset+=c.size-F,g&&(t.offset+=C)}throw a.delete(e),n}finally{if(g&&t.se--,E&&t.ae--,y&&y(I),z&&z(),g&&A&&A.dispose)try{await A.dispose()}catch{}}async function T(){t.le=!0;const{de:e}=t;t.de=new S(e=>z=()=>{t.le=!1,e()}),await e}async function v(){Ga(c,mc(p.Fe))&&await c.closeDisk()}}(t,e,r,{Ce:y,ve:b,_e:g,$t:d,Ie:l,Te:w},o)}catch(n){throw t.ee.delete(e),n}finally{w&&w(l&&l.De)}return n.assign(p,{name:e,comment:c,extraField:u}),new yi(p)}(t,e,r,o)}catch(n){throw t.ne.delete(e),n}finally{const t=Aa.shift();t?t():Fa--}}(o,t,e,r);s.add(a);const c=()=>s.delete(a);return S.prototype.then.call(a,c,c),Ia(o,a)}remove(t){const{ne:e,ee:n}=this;if(typeof t==mt&&(t=n.get(t)),t&&t.filename!==dt){const{filename:r}=t;if(e.has(r)&&n.has(r))return e.delete(r),n.delete(r),!0}return!1}async close(t=yt,n={}){const r=this,{oe:o,writer:s}=this,{writable:a}=s;if(!(t instanceof w))throw new f(Hs);if(mc(t)>M)throw new f(Zs);for(;o.size;)await S.allSettled(e.from(o));await S.allSettled(r.ie.map(t=>t.Be));const c=r.ie.filter(t=>t.error&&!t.We);if(c.length){const t=c.map(t=>t.error);c.forEach(t=>t.We=!0);const[e]=t;try{e.entryErrors=t}catch{}throw e}return await async function(t,n,r){const{Pe:o,Ze:s}=Pa(t.ee),{He:a,Ve:c,Ge:u}=await async function(t,n,r){const{ee:o,writer:i}=t,s=new w(n);await _o(i);let a=0,c=0,u=Ha(i),l=Va(i),d=0;for(const[t,n]of e.from(o.values()).entries()){const{offset:e,rawFilename:f,Se:w,be:p,ge:h,Ee:m,ze:y,rawExtraField:S,xe:b,rawComment:g,versionMadeBy:E,fe:z,we:x,he:R,pe:D,ye:F,je:A,internalFileAttributes:k,externalFileAttributes:C,diskNumberStart:I,uncompressedSize:T,compressedSize:v}=n,_=mc(w,p,h,m,y,S,b),N=q+mc(f,g)+_;Ga(i,a+N-c)&&(await $a(i,s.slice(c,a)),c=a,d=0,await i.closeDisk()),0==t&&(u=Ha(i),l=Va(i)),R||wc(x,18,T),D||wc(x,14,v),(A||F)&&n.version<45&&fc(x,0,45);const U=Za(N);if(U.qe(H),U.Ke(E),U.Ye(z.subarray(0,24)),U.Ke(_),U.Ke(mc(g)),U.Ke(F?M:I),U.Ke(k),U.qe(C),U.qe(A?O:e),U.Ye(f),U.Ye(w),U.Ye(p),U.Ye(h),U.Ye(m),U.Ye(y),U.Ye(S),U.Ye(b),U.Ye(g),hc(s,U.Pt,a),a+=N,d++,r.onprogress)try{await r.onprogress(t+1,o.size,new yi(n))}catch{}}return await $a(i,c?s.slice(c):s),{He:{diskNumber:u,diskOffset:l},Ve:{diskNumber:Ha(i),Xe:d},Ge:s}}(t,o,r),l=await async function(t,e,n){const r=ac(t,n,It);if(r){const n=await r(e),o=mc(n);if(o>M)throw new f(za);const i=Za(6+o);i.qe(Z),i.Ke(o),i.Ye(n);const{writer:s}=t;return Ga(s,mc(i.Pt))&&await s.closeDisk(),await $a(s,i.Pt),6+o}return 0}(t,u,r);await async function(t,e,n,r){const{writer:o}=t,{He:s,Ve:a,Je:c,Ze:u}=r;let{Pe:l}=r,d=t.ee.size,w=s.diskNumber,p=ja(t,s);const h=mc(e);if(h>M)throw new f(Zs);let m=ic(t,n,ni),y=Ha(o);if(Ga(o,(m?98:K)+h)&&y++,p>=O||l>=O||d>=M||y>=M){if(!1===m)throw new f(aa);m=!0}else m===dt&&u&&(m=!0);const S=Za(m?98:K);Ga(o,mc(S.Pt)+h)&&await o.closeDisk(),y=Ha(o);let b=y==a.diskNumber?a.Xe:0;m&&(S.qe(G),S.Qe(44),S.Ke(45),S.Ke(45),S.qe(y),S.qe(w),S.Qe(b),S.Qe(d),S.Qe(l),S.Qe(p),S.qe(j),S.qe(y),S.Qe(i(ja(t,o))+i(l)+i(c)),S.qe(y+1),ic(t,n,"supportZip64SplitFile",!0)&&(y=M,w=M),b=M,d=M,p=O,l=O),S.qe(V),S.Ke(y),S.Ke(w),S.Ke(b),S.Ke(d),S.qe(l),S.qe(p),S.Ke(h),await $a(o,S.Pt),h&&await $a(o,e)}(t,n,r,{He:a,Ve:c,Pe:o,Je:l,Ze:s})}(r,t,n),!vo(s)&&ic(r,n,Dt)||await a.getWriter().close(),s.getData?s.getData():a}}class Ca extends S{then(t,e){const{$e:n}=this;return n&&(n.We=!0),super.then(t,e)}}function Ia(t,e){const n=new Ca((t,n)=>S.prototype.then.call(e,t,n)),r={};return n.$e=r,r.Be=S.prototype.then.call(n,dt,t=>r.error=t),t.ie.push(r),n}async function Ta(t,e){try{await t.writer.writable.abort(e)}catch{}}function va(t,e,n){t.oe.add(e),e.catch(t=>{try{n(t)}catch{}})}function _a(t,n,r){let o=ic(t,r,ei),i=ic(t,r,ii,o?20:768);const s=ic(t,r,ci),a=cc(t,r,"uid"),c=cc(t,r,"gid");let u=cc(t,r,fi),l=ic(t,r,"unixExtraFieldType"),d=ic(t,r,wi),w=ic(t,r,pi),p=ic(t,r,hi);if(jt(a,O,pa),jt(c,O,ha),jt(u,M,ma),l!==dt&&l!==Ra&&l!==Da)throw new f(ya);if(l===Da&&(a!==dt&&a>M||c!==dt&&c>M))throw new f(Sa);l!==dt||a===dt&&c===dt||(l=Ra);let h=cc(t,r,$o),m=ic(t,r,ti);const y=h!==dt||m!==dt;if(a!==dt||c!==dt||u!==dt||l||s?(o=!1,i=i&L|768):y&&(o=!0,i&=L),jt(h,L,ba),m&&(typeof m!==ht||e.isArray(m)))throw new f(ga);if(i>M)throw new f(Ks);let S=ic(t,r,Qo);const b=S!==dt;b||(S=0),!r[ai]&&n.endsWith(at)&&(r[ai]=!0);const g=ic(t,r,ai);if(g?(n.endsWith(at)||(n+=at),b||(S=16,o||(S|=16877<<16))):o||b||(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),b&&!t||(g?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,z=u!==dt&&40960==(u&rt);return{name:n,Re:{versionMadeBy:i,msDosCompatible:Boolean(o),externalFileAttributes:S,unixExternalUpper:E,uid:a,gid:c,unixMode:u,unixExtraFieldType:l,symlink:z,setuid:d,setgid:w,sticky:p,msdosAttributesRaw:h,msdosAttributes:m}}}function Na(t,e,n){const r=ac(t,n,"encodeText")||ze;let i=r(e,Tt);if(i===dt&&(i=ze(e)),mc(i)>M)throw new f(qs);const s=n[Bo]||"";if(typeof s!=mt)throw new f(Gs);let c=r(s,vt);if(c===dt&&(c=ze(s)),mc(c)>M)throw new f(Vs);const u=ic(t,n,oi);if(u!==dt&&u>M)throw new f(Ks);const l=sc(t,n,Go,new a),d=ic(t,n,jo),w=sc(t,n,qo),p=sc(t,n,Yo),h=ic(t,n,Jo,0),m=ic(t,n,gt),y=ic(t,n,St),S=ic(t,n,bt);Vt(y,S);const b=cc(t,n,"encryptionStrength",3),g=ic(t,n,si),E=ic(t,n,"extendedTimestamp",!0),z=ic(t,n,"ntfsTimestamp"),x=ic(t,n,"keepOrder",!0),R=ic(t,n,zt),D=ic(t,n,Rt),F=ic(t,n,"bufferedWrite"),A=ac(t,n,"createTempStream"),k=ic(t,n,"dataDescriptorSignature",!0),C=Zt(ic(t,n,Et));Ht(C);const I=ic(t,n,"useUnicodeFileNames",!0),T=ic(t,n,ui),v=m||T===dt?dt:Fn(T);if(!m&&T!==dt&&0!==T&&8!==T&&!v)throw new f(zn);let _=cc(t,n,"level");if(jt(_,9,Ea),t.options[kt]){if(y!==dt||S!==dt)throw new f(Xs);_===dt&&T===dt&&(_=0)}m&&(_=dt);let N=ic(t,n,xt),U=ic(t,n,Ft);F&&U===dt&&(U=!1),(U===dt||g&&!m)&&(U=!0),_!==dt&&6!=_&&(N=!1);const O=ic(t,n,ni);if(!(g||y===dt&&S===dt||o.isInteger(b)&&b>=1&&b<=3))throw new f(Ys);const L=Ua(n[di]),B=Ua(n.localExtraField),W=Ua(n.centralExtraField);return{comment:s,Re:{rawFilename:i,rawComment:c,version:u,lastModDate:l,rawLastModDate:d,lastAccessDate:w,creationDate:p,internalFileAttributes:h,passThrough:m,password:y,rawPassword:S,encryptionStrength:b,zipCrypto:g,extendedTimestamp:E,ntfsTimestamp:z,keepOrder:x,useWebWorkers:R,transferStreams:D,bufferedWrite:F,createTempStream:A,dataDescriptorSignature:k,signal:C,useUnicodeFileNames:I,compressionMethod:T,format:v?v.format:dt,codecURI:v?v.codecURI:dt,tn:v?v.versionNeeded:dt,level:_,useCompressionStream:N,dataDescriptor:U,zip64:O,rawExtraField:L,en:B,xe:W}}}function Ua(t){if(!t)return yt;if(!(t instanceof c))throw new f($s);let e=0,n=0;t.forEach((t,n)=>{if(Gt(n,M,ta),!(t instanceof w))throw new f(ea);if(mc(t)>M)throw new f(na);e+=4+mc(t)});const r=new w(e),o=le(r);return t.forEach((t,e)=>{fc(o,n,e),fc(o,n+2,mc(t)),hc(r,t,n+4),n+=4+mc(t)}),r}function Oa(t,e,n,r,o){const{passThrough:i,zipCrypto:s,password:a,rawPassword:c,encryptionStrength:u}=r;let{dataDescriptor:l,zip64:d,level:w,compressionMethod:p}=r,h=0,m=0,y=!1;if(i&&e){if(m=o[Po],m===dt)throw new f(ca);if(p===dt)throw new f(ua)}const S=!0===d,b=ic(t,o,ri);if(e&&i&&!b&&mc(a,c))throw new f(Qs);const g=e&&(Boolean(a&&mc(a)||c&&mc(c))||i&&b);e||(w=0,p=0);const E=g?s?12:16+4*u:0;e&&(i?(o.uncompressedSize=m,h=n===dt?uc(m)+E:n):n===dt?(l=!0,(d||d===dt)&&(d=y=!0,h=4294967296)):(o.uncompressedSize=m=n,h=(lc(p,w)?uc(m):m)+E));const z=!(g||e&&(0!==n||i)||lc(p,w));z&&!s&&ic(t,o,Ft)===dt&&(l=!1);const x=S||y||m>=O,R=S||h>=O;if(x||R){if(!1===d)throw new f(aa);d=!0}return d=d||!1,{nn:h,Re:{dataDescriptor:l,ke:z,zip64:d,me:S,rn:y,he:x,pe:R,uncompressedSize:m,level:w,compressionMethod:p,encrypted:g}}}function Ma(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,en:m,encryptionStrength:y,extendedTimestamp:S,ntfsTimestamp:b,passThrough:g,encrypted:E,he:z,pe:x,uncompressedSize:R,rn:D,crc32:F}=t;let{version:A,compressionMethod:k}=t;const C=!p&&lc(k,c);let I;const T=g||!C,v=u&&(t.bufferedWrite||!w||!z&&!x||T&&!D),_=v||u&&w&&(z||x);if(u&&(z||x)){const t=20,e=Za(t);if(e.Ke(1),e.Ke(t-4),I=e.Pt,v&&(e.Qe(R),T)){const t=E?l?12:16+4*y:0;e.Qe(g?0:R+t)}}else I=yt;let N,U,O,L,W;if(E&&!l){const t=Za(mc(xa)+2);t.Ke(J),t.Ye(xa),N=t.Pt,N[8]=y}else N=yt;if(S){const t=nc(n),e=rc(t);if(e){const e=9+(o?4:0)+(i?4:0),n=Za(e);L=1+(o?2:0)+(i?4:0),n.Ke(Q),n.Ke(e-4),n.sn(L),n.qe(t),o&&n.qe(oc(nc(o))),i&&n.qe(oc(nc(i))),O=n.Pt}else O=yt;if(b===dt?!e||Boolean(o||i):b)try{const t=ec(n),e=Za(36);e.Ke(10),e.Ke(32),e.an(4),e.Ke(1),e.Ke(24),e.Qe(t),e.Qe(o?ec(o):t),e.Qe(i?ec(i):t),U=e.Pt}catch{U=yt}else U=yt}else U=O=yt;try{const{uid:e,gid:n,unixExtraFieldType:r}=t;if(r!=Ra||e===dt&&n===dt)if(r!=Da||e===dt&&n===dt)W=yt;else{const t=Za(8);t.Ke(et),t.Ke(4),t.Ke((e===dt?0:e)&M),t.Ke((n===dt?0:n)&M),W=t.Pt}else{const t=Ba(e===dt?0:e),r=Ba(n===dt?0:n),o=3+t.length+r.length,i=Za(4+o);i.Ke(tt),i.Ke(o),i.sn(1),i.sn(t.length),i.Ye(t),i.sn(r.length),i.Ye(r),W=i.Pt}}catch{W=yt}k===dt&&(k=C?8:0),A===dt&&(A=0!=k||p||E?20:10);const{tn:P}=t;C&&P!==dt&&(A=A>P?A:P),u&&(A=A>45?A:45),E&&!l&&(A=A>51?A:51,g&&F!==dt&&(N[4]=1),fc(le(N),9,k),k=99);const Z=_?mc(I):0,H=Z+mc(N,O,U,W,h,m);if(H+(t[kt]?67:0)>M)throw new f(na);const V=new a(2e3*s.ceil(s.floor(n.getTime()/1e3)/2)),G=V<lt?lt:V>ut?ut:V,j=mc(O)?new a(1e3*nc(n)):mc(U)?n:G,{fe:q,we:K,rawLastModDate:Y}=yc({version:A,bitFlag:Sc(c,d,w,E,k),compressionMethod:k,uncompressedSize:R,lastModDate:G,rawLastModDate:r,rawFilename:e,pe:x,he:z,extraFieldLength:H}),X=Za(ct+mc(e)+H),$=X.Pt,nt=le($);return X.qe(B),X.Ye(q),X.Ye(e),_&&X.Ye(I),X.Ye(N),X.Ye(O),X.Ye(U),X.Ye(W),X.Ye(h),X.Ye(m),w&&(x||wc(nt,18,0),z||wc(nt,22,0)),{Fe:$,Le:nt,fe:q,we:K,lastModDate:j,rawLastModDate:Y,encrypted:E,compressed:C,version:A,compressionMethod:k,Ue:L,Se:yt,Ne:Z,ge:O,Ee:U,ze:W,be:N,extraFieldLength:H}}function La(t,e){const{Ce:n}=t;let{Fe:r,extraFieldLength:o}=n,i=64-(e+mc(r))%64;i<4&&(i+=64);const s=new w(i),a=le(s);fc(a,0,$),fc(a,2,i-4);const c=r;n.Fe=r=new w(mc(c)+i),hc(r,c),hc(r,s,mc(c));const u=le(r);fc(u,28,o+i),n.Le=u,t._e+=i}function Ba(t){const e=new w(4);le(e).setUint32(0,t,!0);let n=4;for(;n>1&&0===e[n-1];)n--;return e.subarray(0,n)}function Wa({zip64:t,dataDescriptor:e,dataDescriptorSignature:n}){let r,o=yt,i=0,s=t?20:12;return n&&(s+=4),e&&(o=new w(s),r=le(o),n&&(i=4,wc(r,0,P))),{Ae:o,Oe:r,Me:i}}function Pa(t){let e=0,n=!1;for(const[,r]of t){const{rawFilename:t,be:o,rawComment:i,Ee:s,ze:a,rawExtraField:c,xe:u,extendedTimestamp:l,Ue:d,lastModDate:w,me:p,uncompressedSize:h,compressedSize:m}=r;let{he:y,pe:S}=r;p||(y&&h<O&&(y=r.he=!1),S&&m<O&&(S=r.pe=!1)),n=n||y||S;const b=r.offset>=O,g=r.diskNumberStart>=M;let E,z;if(b||g||y||S){const t=4+(y?8:0)+(S?8:0)+(b?8:0)+(g?4:0),e=Za(t);e.Ke(1),e.Ke(t-4),y&&e.Qe(h),S&&e.Qe(m),b&&e.Qe(r.offset),g&&e.qe(r.diskNumberStart),E=e.Pt}else E=yt;r.Se=E,r.je=b,r.ye=g;const x=nc(w);if(l&&rc(x)){const t=Za(9);t.Ke(Q),t.Ke(5),t.sn(d),t.qe(x),z=t.Pt}else z=yt;r.ge=z;const R=mc(E,o,s,a,z,c,u);if(R>M)throw new f(na);e+=q+mc(t,i)+R}return{Pe:e,Ze:n}}function Za(t){const e=new w(t),n=le(e);let r=0;return{Pt:e,sn:t=>{!function(t,e,n){t.setUint8(e,n)}(n,r,t),r+=1},Ke:t=>{fc(n,r,t),r+=2},qe:t=>{wc(n,r,t),r+=4},Qe:t=>{pc(n,r,i(t)),r+=8},Ye:t=>{hc(e,t,r),r+=mc(t)},an:t=>r+=t}}function Ha(t){const{diskNumber:e=0}=t;return e}function Va(t){const{diskOffset:e=0}=t;return e}function Ga(t,e){const{availableSize:n=ft}=t;return e>n}function ja(t,{diskNumber:e=0,diskOffset:n=0}){return t.offset-n-(e?t.re:0)}function qa(t){const e=le(t);let n=0;for(;n+4<=mc(t);){const r=4+dc(e,n+2);if(1==dc(e,n))return qa(ce(t.subarray(0,n),t.subarray(s.min(n+r,mc(t)))));n+=r}return t}async function Ka(t,e,n,r){if(r>0){const{writer:o}=t;let i=0;try{await tc(Oo(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 Ya(t,e){const n=await Uo(t,e,ct);if(mc(n)<ct)return ct;const r=le(n);return ct+dc(r,26)+dc(r,28)}function Xa(t,{offset:e,diskNumberStart:n}){return e+(t.jt?t.jt(n):0)}function Ja(){const t=new w(4);return wc(le(t),0,W),t}async function Qa(t,e){delete t.te,await $a(e,Ja()),t.offset+=4}async function $a(t,e){const{writable:n}=t,r=n.getWriter();try{await r.ready,t.size+=mc(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 F({async write(t){await o.ready,await o.write(t),r(mc(t))}}),{preventClose:!0,preventAbort:!0,signal:n})}finally{o.releaseLock()}}function ec(t){if(t){const e=(i(t.getTime())+i(116444736e5))*i(1e4);return e<ia?ia:e>sa?sa:e}}function nc(t){return s.floor(t.getTime()/1e3)}function rc(t){return t>=ra&&t<=oa}function oc(t){return s.min(oa,s.max(ra,t))}function ic(t,e,n,r){const o=e[n]===dt?t.options[n]:e[n];return o===dt?r:o}function sc(t,e,n,r){const i=ic(t,e,n,r);if(null===i)return r;if(i!==dt&&(typeof i.getTime!=pt||o.isNaN(i.getTime())))throw new f(js);return i}function ac(t,e,n){return Pt(ic(t,e,n))}function cc(t,e,n,r){return qt(ic(t,e,n,r))}function uc(t){return t+5*(s.floor(t/16383)+1)}function lc(t,e){return t===dt?e===dt||e>0:0!==t}function dc(t,e){return t.getUint16(e,!0)}function fc(t,e,n){t.setUint16(e,n,!0)}function wc(t,e,n){t.setUint32(e,n,!0)}function pc(t,e,n){t.setBigUint64(e,n,!0)}function hc(t,e,n){t.set(e,n)}function mc(...t){let e=0;return t.forEach(t=>t&&(e+=t.length)),e}function yc({version:t,bitFlag:e,compressionMethod:n,uncompressedSize:r,compressedSize:o,lastModDate:i,rawLastModDate:s,rawFilename:a,pe:c,he:u,extraFieldLength:l}){const d=Za(26),f=d.Pt,w=le(f);if(d.Ke(t),d.Ke(e),d.Ke(n),s===dt){const t=new h(1),e=le(t);fc(e,0,(i.getHours()<<6|i.getMinutes())<<5|i.getSeconds()/2),fc(e,2,(i.getFullYear()-1980<<4|i.getMonth()+1)<<5|i.getDate()),s=t[0]}return d.qe(s),d.an(4),c||o!==dt?d.qe(c?O:o):d.an(4),u||r!==dt?d.qe(u?O:r):d.an(4),d.Ke(mc(a)),d.Ke(l),{fe:f,we:w,rawLastModDate:s}}function Sc(t,e,n,r,o){let i=0;return e&&(i|=nt),n&&(i|=8),8!=o&&9!=o||(t>=0&&t<=3&&(i|=6),t>3&&t<=5&&(i|=4),9==t&&(i|=2)),r&&(i|=1),i}function bc(t,e){if(!t)return!1;const{cn:n}=t;return n?n.includes(e):Pn(t,e)}const gc=1048576,Ec=".zip.js-temp",zc=1048576,xc=1048576,Rc=".zip.js-temp",Dc="createSyncAccessHandle is only available in dedicated workers";try{!function(t){const e=ie(ae(t));n.assign(Xt,e),n.assign(ee,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 Fc="Entry filename already exists",Ac="Duplicate entry filename in the imported zip file",kc='Invalid duplicates option (must be "throw", "keep-first" or "keep-last")',Cc="Entry is a ancestor of target entry",Ic="Readable stream already consumed",Tc="throw",vc="keep-first",_c="keep-last",Nc=new u([Tc,vc,_c]),Uc="Invalid passThrough option (use readerOptions.passThrough or set uncompressedSize for each entry)",Oc="Invalid readerOptions (must be an object)",Mc="The last modification date of an entry encrypted with ZipCrypto cannot be changed when passThrough is set",Lc="zipjs-abort-export",Bc=new u([1,J,10,Q,28789,25461,$,tt,et,22613,13]);class Wc{constructor(t,e,r,o){const i=this;if(t.root&&o&&o.getChildByName(e))throw new f(Fc);r||(r={}),n.assign(i,{fs:t,name:e,data:r.data,options:r.options&&n.assign({},r.options),id:t.un++,parent:o,children:[],uncompressedSize:r.uncompressedSize||0,ln:r.ln||r.uncompressedSize===dt,passThrough:r.passThrough,dn:r.dn||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=wu(t);r&&(t=r.pop(),n=pu(n,r,e));const o=n.getChildByName(t);if(o&&o!=e)throw new f(Fc);n!=e.parent&&(Qc(e),e.parent=n,n.children.push(e),du(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 Pc extends Wc{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 Pc(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==ro?e.type==n:t.constructor!=$r||e.startsWith("data:"+(n||"")+";base64,"))}(t,n.data))return n.data;{const r=n.reader=Xc(n.Reader,n.data,e),o=n.uncompressedSize||r.size;await S.all([_o(r),_o(t,o)]);const i=Zt(e.signal),s=function(t,e,n,r){const{onstart:o,onprogress:i,onend:s}=n,{readable:a}=e;return t.data instanceof yi||!o&&!i&&!s?a:mn(a).pipeThrough(new sr({onstart:o,onprogress:i,onend:s,size:e.size}),{signal:r})}(n,r,e,i),a=!vo(t)&&Boolean(e.preventClose);return n.uncompressedSize=r.size,await mn(s).pipeTo(Sn(t.writable),{signal:i,preventClose:a,preventAbort:a}),t.getData?t.getData():t.writable}}isPasswordProtected(){return Boolean(this.data&&this.data.encrypted)}async checkPassword(t,e={}){const r=this;if(!r.isPasswordProtected())return!0;try{return await r.data.getData(null,n.assign({},e,{password:t,checkPasswordOnly:!0})),!0}catch(t){if(t.message==ke)return!1;throw t}}getText(t,e){return this.getData(new so(t),e)}getBlob(t,e){return this.getData(new ro(t),e)}getData64URI(t,e){return this.getData(new $r(t),e)}getUint8Array(t){return this.getData(new Ao,t)}getWritable(t=new F,e){return this.getData({writable:t},e)}async getArrayBuffer(t){return ue(await this.getUint8Array(t)).buffer}replaceBlob(t){ru(this,{data:t,Reader:no,Writer:ro,uncompressedSize:t.size})}replaceText(t){ru(this,{data:t,Reader:oo,Writer:so,uncompressedSize:io(t)})}replaceData64URI(t){ru(this,{data:t,Reader:Qr,Writer:$r,uncompressedSize:ou(t)})}replaceUint8Array(t){ru(this,{data:t,Reader:Fo,Writer:Ao,uncompressedSize:t.length})}replaceReadable(t){ru(this,{data:null,Reader:Kc(t),Writer:null,uncompressedSize:dt})}}class Zc extends Wc{constructor(t,e,n,r){super(t,e,n,r),this.directory=!0}clone(t){const e=this,n=new Zc(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 fu(this,t,{options:e},!0)}addText(t,e,n={}){return fu(this,t,{data:e,Reader:oo,Writer:so,options:n,uncompressedSize:io(e)})}addBlob(t,e,n={}){return fu(this,t,{data:e,Reader:no,Writer:ro,options:n,uncompressedSize:e.size})}addData64URI(t,e,n={}){return fu(this,t,{data:e,Reader:Qr,Writer:$r,options:n,uncompressedSize:ou(e)})}addUint8Array(t,e,n={}){return fu(this,t,{data:e,Reader:Fo,Writer:Ao,options:n,uncompressedSize:e.length})}addHttpContent(t,e,n={}){return fu(this,t,{data:e,Reader:class extends Do{constructor(t){super(t,n)}},options:n})}addReadable(t,e,n={}){return fu(this,t,{Reader:Kc(e),options:n})}addFileSystemEntry(t,e={}){return au(this,t,e)}addFileSystemHandle(t,e={}){return au(this,t,e)}addFile(t,e={}){return(e=n.assign({},e)).lastModDate||(e.lastModDate=new a(t.lastModified)),fu(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 no(t),e)}importData64URI(t,e){return this.importZip(new Qr(t),e)}importUint8Array(t,e){return this.importZip(new Fo(t),e)}importHttpContent(t,e){return this.importZip(new Do(t,e),e)}importReadable(t,e){return this.importZip({readable:t},e)}exportBlob(t={}){return this.exportZip(new ro(t.mimeType||"application/zip"),t)}exportData64URI(t={}){return this.exportZip(new $r(t.mimeType||"application/zip"),t)}exportUint8Array(t={}){return this.exportZip(new Ao,t)}async exportWritable(t=new F,e={}){return await this.exportZip({writable:t},e),t}exportFileSystemHandle(t,e={}){return async function(t,e,r){const{onstart:o,onprogress:i,onend:s}=r,a=nu(r.readerOptions),c=new AbortController,{signal:u}=c,l=function(t,e){if(!Zt(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=Gc([t],t=>qc(t,d.passThrough)),p=[];let h=!1,m=0;try{o&&await ar(o,w),await b(t,e),s&&await ar(s,m)}catch(t){try{t.exportedEntryNames=p}catch{}throw t}finally{l()}return e;function y(t){const e=t.getWriter();return new F({async write(t){await e.write(t),m+=t.length,i&&await ar(i,m,w)},close:()=>e.close(),abort:t=>e.abort(t)})}async function b(t,e){if(r.concurrent){const n=(await S.allSettled(t.children.map(t=>g(t,e)))).filter(t=>"rejected"==t.status);if(n.length){const t=n.filter(t=>!$c(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 g(n,e)}async function g(e,n){if(u.aborted){if(h||$c(u.reason))return;throw u.reason===dt?new DOMException(Bt,Wt):u.reason}try{if(e.directory){const t=await n.getDirectoryHandle(e.name,{create:!0});await b(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(Lc):t}p.push(e.getRelativeName(t))}}catch(n){h=!0,c.abort(new f(Lc));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 _o(t),r=new rs(t,e));const o=function(t){if(t===dt)return Tc;if(Nc.has(t))return t;throw new f(kc)}(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==vc){c=!0;break}if(o!=_c)throw new f(Ac);this.fs.remove(r),r=new Zc(this.fs,t,{data:null},e),i.push(r)}}else r=new Zc(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==vc)continue;if(o!=_c)throw new f(Ac);this.fs.remove(e),e=dt}e||(e=new Zc(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==vc)continue;if(o!=_c)throw new f(Ac);this.fs.remove(s)}i.push(fu(r,a,{data:t,Reader:Yc(n.assign({},e)),uncompressedSize:e.passThrough?t.compressedSize:t.uncompressedSize,passThrough:e.passThrough}))}}catch(e){i.reverse().forEach(t=>this.fs.remove(t));try{e.cause={entry:t}}catch{}throw e}}return i}async exportZip(t,e={}){const r=this;(e=n.assign({},e)).bufferedWrite===dt&&(e.bufferedWrite=!0);const[o]=await S.all([Jc(r,nu(e.readerOptions)),_o(t)]),i=new ka(t,e);return await async function(t,e,r,o,i){const{onstart:s,onprogress:a,onend:c,onentryprogress:u}=o,l=e,d=Gc(e.children,t=>su(t)?0:1);let f=0,w=0;if(s&&await ar(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(su(e))return;const{name:s,fn:c}=tu(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 ar(a,f,r)}}));w++,u&&await ar(u,w,d,h)}c&&await ar(c,f)}(i,r,Gc([r],jc),e,o),await i.close(e.globalComment),t.getData?t.getData():t.writable}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=>!su(t)).map(n=>{const{name:r,fn:o}=tu(n,e,t);return{name:r,size:n.directory?0:eu(n,iu(n,t)),options:o}}),i=!t.bufferedWrite||o.every(t=>!1!==t.options.keepOrder)&&r.every(t=>su(t)||!t.children.length);return async function(t,e,r,o){const i={options:t};if(Pt(t[It]))throw new f(la);if(o!==dt&&!(o instanceof w))throw new f(Hs);const a=mc(o);if(a>M)throw new f(Zs);const u=t[kt],l=new c,d=t[At]===dt?0:t[At];let p=d,h=ft;for(const t of e){let{name:e}=t;const{size:r}=t,o=n.assign({},t.options);ic(i,o,ai)&&!e.endsWith(at)&&(e+=at);const a=_a(i,e,o);({name:e}=a);const{Re:c}=Na(i,e,o);0==c.level||c.compressionMethod!==dt||c.passThrough||await rr(ne())||(c.level=0);const d=!ic(i,o,ai);if(d&&r===dt)throw new f(la);const{nn:w,Re:m}=Oa(i,d,r,c,o);if(d&&!c.passThrough&&lc(m.compressionMethod,m.level))throw new f(la);const y=n.assign({},o,a.Re,c,m,{[kt]:u}),S=Ma(y),b=Wa(y),g={Ce:S,_e:mc(S.Fe,b.Ae)};u&&La(g,p);const E=d?w:0;l.set(e,n.assign({},y,S,{offset:p,diskNumberStart:0,compressedSize:E}));const z=g._e+E;h=s.min(h,z),p+=z}if(l.size>1&&(u||p-h>=O)&&!r)throw new f(la);const{Pe:m,Ze:y}=Pa(l);let S=ic(i,t,ni);if(p>=O||m>=O||l.size>=M){if(!1===S)throw new f(aa);S=!0}else S===dt&&y&&(S=!0);return p-d+m+a+(S?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 Hc{constructor(){uu(this)}get children(){return this.root.children}remove(t){Qc(t);const e=[t];for(;e.length;){const t=e.pop();this.entries[t.id]=null;for(const n of t.children)e.push(n)}t.parent=dt}move(t,e){if(t==this.root)throw new f("Root directory cannot be moved");if(!e.directory)throw new f("Target entry is not a directory");if(e.isDescendantOf(t))throw new f(Cc);if(t!=e){const n=e.getChildByName(t.name);if(n){if(n!=t)throw new f(Fc)}else Qc(t),t.parent=e,e.children.push(t),du(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 lu(this,n=>n.importBlob(t,e))}importData64URI(t,e){return lu(this,n=>n.importData64URI(t,e))}importUint8Array(t,e){return lu(this,n=>n.importUint8Array(t,e))}importHttpContent(t,e){return lu(this,n=>n.importHttpContent(t,e))}importReadable(t,e){return lu(this,n=>n.importReadable(t,e))}importZip(t,e){return lu(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 Vc={FS:Hc,ZipDirectoryEntry:Zc,ZipFileEntry:Pc};function Gc(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 jc(t){return t.uncompressedSize}function qc(t,e){const{data:n}=t;return e&&n instanceof yi?n.compressedSize:t.uncompressedSize}function Kc(t){let e;return function(){if(e)throw new f(Ic);return e=!0,{readable:t}}}function Yc(t){return class extends Xr{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 ro,n.assign(r,{checkPasswordOnly:!1,checkOverlappingEntry:i||o,checkOverlappingEntryOnly:!1,preventClose:!1}));e.data=s,e.wn=new no(s),e.size=s.size,super.init()}readUint8Array(t,e){return this.wn.readUint8Array(t,e)}}}function Xc(t,e,n){return t.prototype?new t(e,n):t(e,n)}async function Jc(t,e){const n=[],r=[t],o=new c;for(;r.length;){const t=r.pop();for(const e of t.children)e.directory?r.push(e):n.push(e)}return await S.all(n.map(async t=>{const n=t.reader=Xc(t.Reader,t.data,e);o.set(t,n);try{await _o(n)}catch(e){try{e.entryId=t.id,e.cause={entry:t}}catch{}throw e}n.size!==dt&&(t.uncompressedSize=n.size,t.ln=!1)})),o}function Qc(t){if(t.parent){const e=t.parent.children;e.forEach((n,r)=>{n.id==t.id&&e.splice(r,1)})}}function $c(t){return Boolean(t)&&t.message==Lc}function tu(t,e,r){const o=r.relativePath?t.getRelativeName(e):t.getFullname(),i=t.options||{};let u={},l={};if(t.data instanceof yi){const{externalFileAttributes:e,versionMadeBy:o,comment:d,lastModDate:w,rawLastModDate:p,creationDate:h,lastAccessDate:m,uncompressedSize:y,encrypted:S,zipCrypto:b,crc32:g,compressionMethod:E,extraFieldAES:z,internalFileAttributes:x,extraField:R,bitFlag:D,uid:F,gid:A}=t.data;u={externalFileAttributes:e,versionMadeBy:o,comment:d,lastModDate:w,creationDate:h,lastAccessDate:m,internalFileAttributes:x};const k=function(t){if(t){const e=new c;if(t.forEach((t,n)=>{Bc.has(n)||e.set(n,t.data)}),e.size)return e}}(R);if(k&&(u.extraField=k),F===dt&&A===dt||n.assign(u,{uid:F,gid:A,unixExtraFieldType:"infozip"}),iu(t,r)){let t;z&&(t=z.strength),l={passThrough:!0,encrypted:S,zipCrypto:b,crc32:g,uncompressedSize:y,encryptionStrength:t,compressionMethod:E},D&&(l.dataDescriptor=D.dataDescriptor);const e=i.lastModDate===dt?r.lastModDate:i.lastModDate;if(e===dt)l.rawLastModDate=p;else if(b&&(!D||D.dataDescriptor)&&e instanceof a&&function(t){let e=new a(2e3*s.ceil(s.floor(t.getTime()/1e3)/2));return e<lt?e=lt:e>ut&&(e=ut),(e.getHours()<<3|e.getMinutes()>>3)&L}(e)!=(p>>>8&L))throw new f(Mc)}}const d=n.assign({lastModDate:t.dn},u,r,i,l,{directory:t.directory});if(!t.directory&&d.passThrough&&d.uncompressedSize===dt)throw new f(Uc);return{name:o,fn:d}}function eu(t,e){const{reader:n}=t;return n&&n.size!==dt?n.size:t.ln?dt:qc(t,e)}function nu(t){if(t&&(typeof t!=ht||e.isArray(t)))throw new f(Oc);return t}function ru(t,e){const{uncompressedSize:r}=e;n.assign(t,e,{reader:null,passThrough:dt,uncompressedSize:r===dt?0:r,ln:r===dt})}function ou(t){let e=t.length;for(;"="==t.charAt(e-1);)e--;const n=t.indexOf(",")+1;return s.floor(.75*(e-n))}function iu(t,e){const{readerOptions:n}=e;return Boolean(!t.directory&&(t.passThrough||n&&n.passThrough))}function su(t){return t.directory&&null===t.data}function au(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 cu(o)),"file"==o.kind){const t=await o.getFile();i.push(fu(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 cu(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 cu(t));n(t,r,o)}else r(e)},o)}return await new S((e,r)=>n(t.createReader(),e,r)),{[T.iterator](){let t=0;return{next(){const n={value:e[t],done:t==e.length};return t++,n}}}}}(t);e.values=()=>n}return e}function uu(t){t.entries=[],t.un=0,t.root=new Zc(t)}function lu(t,e){const{entries:r,un:o,root:i}=t;return uu(t),e(t.root).catch(e=>{throw n.assign(t,{entries:r,un:o,root:i}),e})}function du(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 fu(t,e,n,r){if(t.directory){const o=wu(e);return o&&(e=o.pop(),t=pu(t,o)),r?new Zc(t.fs,e,n,t):new Pc(t.fs,e,n,t)}throw new f("Parent entry is not a directory")}function wu(t){if(t.includes("/")){const e=t.split("/").filter(t=>""!=t&&"."!=t);if(e.length)return e}}function pu(t,e,n){return e.forEach(e=>{const r=t;if(t=t.getChildByName(e)){if(!t.directory)throw new f(Fc);if(n&&(t==n||t.isDescendantOf(n)))throw new f(Cc)}else t=new Zc(r.fs,e,{data:null},r)}),t}t.BlobReader=no,t.BlobWriter=ro,t.Data64URIReader=Qr,t.Data64URIWriter=$r,t.ERR_ABORTED=Bt,t.ERR_AMBIGUOUS_ARCHIVE=Ci,t.ERR_BAD_FORMAT=Si,t.ERR_CENTRAL_DIRECTORY_NOT_FOUND=Ei,t.ERR_DUPLICATED_NAME=Ps,t.ERR_DUPLICATE_IMPORTED_ENTRY=Ac,t.ERR_ENCRYPTED=Ri,t.ERR_ENCRYPTED_CENTRAL_DIRECTORY=Ii,t.ERR_ENTRY_DATA_OUT_OF_BOUNDS=ki,t.ERR_ENTRY_EXISTS=Fc,t.ERR_EOCDR_LOCATOR_ZIP64_NOT_FOUND=gi,t.ERR_EOCDR_NOT_FOUND=bi,t.ERR_EXTRAFIELD_ZIP64_NOT_FOUND=xi,t.ERR_HTTP_RANGE=Lr,t.ERR_HTTP_RESOURCE_CHANGED=Br,t.ERR_INVALID_AUTHENTICATION_CODE=Ce,t.ERR_INVALID_CODEC_DEFINITION=bn,t.ERR_INVALID_CODEC_MODULE=En,t.ERR_INVALID_COMMENT=Zs,t.ERR_INVALID_COMMENT_TYPE=Hs,t.ERR_INVALID_COMPRESSED_DATA=Tn,t.ERR_INVALID_CRC32=vn,t.ERR_INVALID_DATE=js,t.ERR_INVALID_DUPLICATES=kc,t.ERR_INVALID_ENCRYPTION_STRENGTH=Ys,t.ERR_INVALID_ENTRY_COMMENT=Vs,t.ERR_INVALID_ENTRY_COMMENT_TYPE=Gs,t.ERR_INVALID_ENTRY_NAME=qs,t.ERR_INVALID_EXTRAFIELD=$s,t.ERR_INVALID_EXTRAFIELD_DATA=na,t.ERR_INVALID_EXTRAFIELD_DATA_TYPE=ea,t.ERR_INVALID_EXTRAFIELD_TYPE=ta,t.ERR_INVALID_FILENAME_VALIDATION=_i,t.ERR_INVALID_FUNCTION_OPTION=Ot,t.ERR_INVALID_GID=ha,t.ERR_INVALID_LEVEL=Ea,t.ERR_INVALID_MAX_APPENDED_DATA_SIZE=Ni,t.ERR_INVALID_MAX_WORKERS=Kt,t.ERR_INVALID_MSDOS_ATTRIBUTES=ba,t.ERR_INVALID_MSDOS_DATA=ga,t.ERR_INVALID_PASSWORD=ke,t.ERR_INVALID_PASSWORD_TYPE=Lt,t.ERR_INVALID_PASS_THROUGH=Uc,t.ERR_INVALID_READER=fa,t.ERR_INVALID_READER_OPTIONS=Oc,t.ERR_INVALID_SIGNAL=Mt,t.ERR_INVALID_SIGNATURE_DATA=za,t.ERR_INVALID_STRICTNESS=vi,t.ERR_INVALID_UID=pa,t.ERR_INVALID_UNCOMPRESSED_SIZE=In,t.ERR_INVALID_UNIX_EXTRA_FIELD_TYPE=ya,t.ERR_INVALID_UNIX_ID_SIZE=Sa,t.ERR_INVALID_UNIX_MODE=ma,t.ERR_INVALID_VERSION=Ks,t.ERR_ITERATOR_COMPLETED_TOO_SOON=Wr,t.ERR_LOCAL_FILE_HEADER_NOT_FOUND=zi,t.ERR_OVERLAPPING_ENTRY=Ai,t.ERR_READABLE_CONSUMED=Ic,t.ERR_RESERVED_COMPRESSION_METHOD=gn,t.ERR_SPLIT_ZIP_FILE=Fi,t.ERR_UNDEFINED_COMPRESSION_METHOD=ua,t.ERR_UNDEFINED_READER=da,t.ERR_UNDEFINED_UNCOMPRESSED_SIZE=ca,t.ERR_UNDETERMINED_SIZE=la,t.ERR_UNSAFE_FILENAME=Ti,t.ERR_UNSUPPORTED_COMPRESSION=zn,t.ERR_UNSUPPORTED_CONTEXT=Dc,t.ERR_UNSUPPORTED_CRYPTO_API=Te,t.ERR_UNSUPPORTED_ENCRYPTION=Di,t.ERR_UNSUPPORTED_ENCRYPTION_PASS_THROUGH=Qs,t.ERR_UNSUPPORTED_ENCRYPTION_USDZ=Xs,t.ERR_UNSUPPORTED_FORMAT=aa,t.ERR_UNSUPPORTED_SPLIT_USDZ=Js,t.ERR_UNSUPPORTED_UINT64=Ui,t.ERR_WORKER_STARTUP_TIMEOUT=$n,t.ERR_WRITER_NOT_INITIALIZED=Pr,t.ERR_ZIP_CRYPTO_LAST_MOD_DATE=Mc,t.ERR_ZIP_NOT_EMPTY=wa,t.HttpRangeReader=class extends Do{constructor(t,e={}){super(t,n.assign({},e,{useRangeHeader:!0}))}},t.HttpReader=Do,t.Reader=Xr,t.SplitDataReader=ko,t.SplitDataWriter=Co,t.TextReader=oo,t.TextWriter=so,t.Uint8ArrayReader=Fo,t.Uint8ArrayWriter=Ao,t.VERSION="2.11.4",t.WARNING_APPENDED_DATA=Zi,t.WARNING_COMPRESSED_PATCHED_DATA=Li,t.WARNING_DUPLICATE_FILENAME=ji,t.WARNING_MALFORMED_EXTRA_FIELD=Bi,t.WARNING_MISMATCHED_LOCAL_FILE_HEADER_BIT_FLAG=Ki,t.WARNING_MISMATCHED_LOCAL_FILE_HEADER_COMPRESSION_METHOD=Yi,t.WARNING_MISMATCHED_LOCAL_FILE_HEADER_CRC32_OR_SIZES=Xi,t.WARNING_MISMATCHED_ZIP64_END_OF_CENTRAL_DIRECTORY=qi,t.WARNING_PREPENDED_CENTRAL_DIRECTORY=Vi,t.WARNING_PREPENDED_DATA=Hi,t.WARNING_TRAILING_CENTRAL_DIRECTORY_DATA=Gi,t.WARNING_UNKNOWN_VERSION=Mi,t.WARNING_UNKNOWN_ZIP64_EXTENSIBLE_DATA=Wi,t.WARNING_UNSORTED_CENTRAL_DIRECTORY=Oi,t.WARNING_WRAPPED_ENTRIES_COUNT=Pi,t.Writer=Jr,t.ZipDirectoryEntry=Zc,t.ZipEntry=Wc,t.ZipFS=Hc,t.ZipFileEntry=Pc,t.ZipReader=rs,t.ZipReaderStream=os,t.ZipWriter=ka,t.ZipWriterStream=class{constructor(t={}){const{readable:e,writable:n}=new R;this.readable=e,this.zipWriter=new ka(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 Ta(e,t)}}()}});return va(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 va(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 Ta(r,t),t}try{return await r.close(t,n)}catch(t){throw await Ta(r,t),t}}},t.configure=function(t){n.assign(ee,ie(ae(t)))},t.createBlobTempStream=function(t={}){const{thresholdBytes:e=zc}=t;return function(){const t=[];let n,r,o,i=0,s=!1;const a=new F({async write(o){s?await n.write(o):(t.push(o),i+=o.length,i>e&&await async function(){const e=new R;r=yn(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 D({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=gc,directoryName:r=Ec,getDirectory:o=()=>C.storage.getDirectory()}=t;let i;function s(){return i||(i=S.resolve(o()).then(t=>t.getDirectoryHandle(r,{create:!0}))),i}return function(){const t=[];let r,o,i,a,c=0,u=!1;const l=new F({async write(a){u?await i.write(a):(t.push(a),c+=a.length,c>n&&await async function(){const n=await s();r=z.randomUUID?z.randomUUID():e.from(z.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 D({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=xc,directoryName:r=Rc,getDirectory:o}=t;if(!(o||"undefined"!=typeof FileSystemFileHandle&&FileSystemFileHandle.prototype.createSyncAccessHandle))throw new f(Dc);const i=o||(()=>C.storage.getDirectory());let a;function c(){return a||(a=S.resolve(i()).then(t=>t.getDirectoryHandle(r,{create:!0}))),a}return function(){const t=[];let r,o,i=0,a=!1,u=0,l=0;const d=new F({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=z.randomUUID?z.randomUUID():e.from(z.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 D({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=Vc,t.getMimeType=function(){return"application/octet-stream"},t.getRegisteredCodecs=An,t.getSupportedCompressionMethods=function(){const{CompressionStream:t,DecompressionStream:e,CompressionStreamFallback:n,DecompressionStreamFallback:r}=ne(),o=[{compressionMethod:0,compression:!0,decompression:!0,registered:!1},{compressionMethod:8,compression:bc(n,_n)||bc(t,_n)||bc(t,Un),decompression:bc(r,_n)||bc(e,_n)||bc(e,Un),registered:!1},{compressionMethod:9,compression:!1,decompression:bc(r,Nn)||bc(e,Nn),registered:!1}];for(const t of An()){const e=kn(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=is,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(bn);if(xn.includes(e))throw new f(gn);const c=typeof i==pt||typeof s==pt;if(!(c||typeof r==mt&&r.length))throw new f(bn);Rn.set(e,{compressionMethod:e,format:n,codecURI:r,versionNeeded:a}),c&&Cn(n,{CompressionStream:i,DecompressionStream:s})},t.resetConfiguration=function(){for(const t of te)delete ee[t];n.assign(ee,Xt)},t.terminateWorkers=async function(){await S.allSettled(xr.map(t=>(_r(t),t.terminate()))),tr=dt,er=!1},t.unregisterCodec=function(t){const e=Rn.get(t);if(e){let n;Rn.delete(t),Rn.forEach(t=>n=n||t.format==e.format),n||Dn.delete(e.format)}}});
1
+ !function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports):"function"==typeof define&&define.amd?define(["exports"],e):e((t="undefined"!=typeof globalThis?globalThis:t||self).zip={})}(this,function(t){"use strict";const{Array:e,Object:n,String:r,Number:o,BigInt:i,Math:s,Date:a,Map:c,Set:u,Response:l,URL:d,Error:f,Uint8Array:w,Uint16Array:p,Uint32Array:h,DataView:m,Blob:y,Promise:S,TextEncoder:g,TextDecoder:b,document:E,crypto:x,btoa: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)}}});