@zip.js/zip.js 2.20.0 → 2.21.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/deno.json +1 -1
- package/dist/zip-core-external.js +327 -211
- package/dist/zip-core-external.min.js +1 -1
- package/dist/zip-core.js +327 -211
- package/dist/zip-core.min.js +1 -1
- package/dist/zip-fs-core-external.js +327 -211
- package/dist/zip-fs-core-external.min.js +1 -1
- package/dist/zip-fs-core.js +327 -211
- package/dist/zip-fs-core.min.js +1 -1
- package/dist/zip-fs-external.js +327 -211
- package/dist/zip-fs-external.min.js +1 -1
- package/dist/zip-fs-native.js +327 -211
- package/dist/zip-fs-native.min.js +1 -1
- package/dist/zip-fs.js +327 -211
- package/dist/zip-fs.min.js +1 -1
- package/dist/zip-legacy.js +327 -211
- package/dist/zip-legacy.min.js +1 -1
- package/dist/zip-native.js +327 -211
- package/dist/zip-native.min.js +1 -1
- package/dist/zip.js +327 -211
- package/dist/zip.min.js +1 -1
- package/index-native.cjs +327 -211
- package/index-native.min.js +1 -1
- package/index.cjs +327 -211
- package/index.d.cts +62 -29
- package/index.d.ts +62 -29
- package/index.min.js +1 -1
- package/lib/core/constants.js +7 -0
- package/lib/core/version.js +1 -1
- package/lib/core/zip-reader.js +156 -69
- package/lib/core/zip-writer.js +172 -142
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
const t=4294967295,e=65535,r=255,n=67324752,o=134695760,a=o,i=84233040,s=33639248,c=101010256,u=101075792,l=117853008,f=46,w=22,d=20,p=56,h=39169,m=21589,y=6534,b=30837,E=30805,S=2048,g=61440,A=16384,R=2048,x=1024,z="/",D=30,F=new Date(2107,11,31,23,59,58),O=new Date(1980,0,1),I=void 0,U=1/0,T="undefined",C="function",k="object",v="string",M="boolean",N=new Uint8Array,_=Symbol.asyncDispose||Symbol(),P="password",j="rawPassword",B="passThrough",L="signal",W="useWebWorkers",Z="useCompressionStream",V="preventClose",H="level",G="useUnicodeFileNames",q="dataDescriptor",Y="offset",K="usdz",X="maxAppendedDataSize",$="signCentralDirectory",J="entry",Q="filename",tt="comment",et="strict",rt="balanced",nt="tolerant",ot="compressed",at="Invalid option (must be a function)",it="Invalid signal (must be an AbortSignal instance)",st="Invalid password (password must be a string, rawPassword must be a Uint8Array)",ct="Invalid passThrough option (must be a boolean or 'compressed')",ut="The operation was aborted";function lt(t){if(t&&typeof t!=C)throw new Error(at);return t}function ft(t){if(t&&(typeof t.addEventListener!=C||typeof t.aborted!=M))throw new Error(it);return t||I}function wt(t){if(t&&t.aborted)throw t.reason===I?new DOMException(ut,"AbortError"):t.reason}function dt(t,e){if(t&&typeof t!=v||e&&!(e instanceof Uint8Array))throw new Error(st)}function pt(t){if(t!==I&&typeof t!=M&&t!==ot)throw new Error(ct);return t}function ht(t,e,r){if(!Number.isInteger(t)||t<0||t>e)throw new Error(r)}function mt(t,e,r){t!==I&&ht(t,e,r)}function yt(t){return typeof t==v&&t.trim()?Number(t):t}const bt=262144,Et="Invalid maxWorkers (must be an integer greater than 0)",St="Invalid baseURI (must be a string)",gt="Invalid URI (must be a string or a function returning a string)";let At=2;try{typeof navigator!=T&&navigator.hardwareConcurrency&&(At=navigator.hardwareConcurrency)}catch{}const Rt={workerURI:"./core/web-worker-wasm.js",wasmURI:"./core/streams/zlib-wasm/zlib-streams.wasm",chunkSize:bt,maxWorkers:At,terminateWorkerTimeout:5e3,workerStarvationTimeout:5e3,workerStartupTimeout:5e3,useWebWorkers:!0,useCompressionStream:!0,transferStreams:!0,CompressionStream:typeof CompressionStream!=T&&CompressionStream,DecompressionStream:typeof DecompressionStream!=T&&DecompressionStream},xt="maxWorkers",zt="baseURI",Dt=["wasmURI","workerURI"],Ft=["chunkSize",xt,"terminateWorkerTimeout","workerStarvationTimeout","workerStartupTimeout"],Ot=["createWorker","CompressionStream","DecompressionStream","CompressionStreamFallback","DecompressionStreamFallback"],It=[zt,...Dt,"useCompressionStream","useWebWorkers","transferStreams",...Ft,...Ot],Ut={...Rt};function Tt(){return Ut}function Ct(t){return kt(t.chunkSize)}function kt(t){return t=yt(t),Number.isInteger(t)&&t>=1?Math.max(t,64):bt}function vt(t){Object.assign(Ut,Mt(_t(t)))}function Mt(t){const e={};for(const r of It){const n=t[r];n!==I&&(e[r]=Nt(r,n))}return e}function Nt(t,e){if(Ft.includes(t)){if(e=yt(e),t==xt&&(!Number.isInteger(e)||e<1))throw new Error(Et)}else if(Ot.includes(t))lt(e);else if(t==zt){if(e&&typeof e!=v)throw new Error(St)}else if(Dt.includes(t)&&e&&typeof e!=v&&typeof e!=C)throw new Error(gt);return e}function _t(t){t=t||{};const{CompressionStreamZlib:e,DecompressionStreamZlib:r}=t;if(e===I&&r===I)return t;const n=Object.assign({},t);return n.CompressionStreamFallback===I&&(n.CompressionStreamFallback=e),n.DecompressionStreamFallback===I&&(n.DecompressionStreamFallback=r),n}function Pt(t){const e=Mt(_t(t));Object.assign(Rt,e),Object.assign(Ut,e)}function jt(){for(const t of It)delete Ut[t];Object.assign(Ut,Rt)}function Bt(t,e){const r=new Uint8Array(t.length+e.length);return r.set(t),r.set(e,t.length),r}function Lt(t){return t.byteOffset||t.byteLength!=t.buffer.byteLength?new Uint8Array(t):t}function Wt(t){return new DataView(t.buffer,t.byteOffset,t.byteLength)}function Zt(t){return Boolean(t)&&"object"==typeof t}const Vt=[[],[],[],[],[],[],[],[]];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;Vt[0][t]=e}for(let t=0;t<256;t++)for(let e=1;e<8;e++){const r=Vt[e-1][t];Vt[e][t]=r>>>8^Vt[0][255&r]}const[Ht,Gt,qt,Yt,Kt,Xt,$t,Jt]=Vt;class Qt{constructor(t){this.o=t||-1}append(t){let e=0|this.o;const r=0|t.length;let n=0;if(r>=8&&t.buffer){const o=new DataView(t.buffer,t.byteOffset,r),a=r-8;for(;n<=a;n+=8){const t=e^o.getInt32(n,!0),r=o.getInt32(n+4,!0);e=Jt[255&t]^$t[t>>>8&255]^Xt[t>>>16&255]^Kt[t>>>24&255]^Yt[255&r]^qt[r>>>8&255]^Gt[r>>>16&255]^Ht[r>>>24&255]}}for(;n<r;n++)e=e>>>8^Ht[255&(e^t[n])];this.o=e}get(){return~this.o}}class te extends TransformStream{constructor(){let t;const e=new Qt;super({transform(t,r){e.append(t),r.enqueue(t)},flush(){const r=new Uint8Array(4);new DataView(r.buffer).setUint32(0,e.get()),t.value=r}}),t=this}}function ee(t){if(typeof TextEncoder==T){t=unescape(encodeURIComponent(t));const e=new Uint8Array(t.length);for(let r=0;r<e.length;r++)e[r]=t.charCodeAt(r);return e}return(new TextEncoder).encode(t)}const re=64,ne=20,oe=new Uint8Array([128]),ae=new Uint8Array(1),ie=new Int32Array([1732584193,4023233417,2562383102,271733878,3285377520]),se=new Uint8Array(256),ce=new Int32Array(256),ue=new Int32Array(256),le=new Int32Array(256),fe=new Int32Array(256);let we=!1;function de(t,e){!function(){if(!we){let t=1,e=1;do{t=255&(t^t<<1^(128&t?27:0)),e=255&(e^e<<1),e=255&(e^e<<2),e=255&(e^e<<4),128&e&&(e^=9),se[t]=255&(e^(e<<1|e>>7)^(e<<2|e>>6)^(e<<3|e>>5)^(e<<4|e>>4)^99)}while(1!=t);se[0]=99;for(let t=0;t<256;t++){const e=se[t],r=ye(e),n=r<<24|e<<16|e<<8|r^e;ce[t]=n,ue[t]=n>>>8|n<<24,le[t]=n>>>16|n<<16,fe[t]=n>>>24|n<<8}we=!0}}();const r=new Int32Array(60),n=function(t,e){const r=t.length>>2,n=r+6,o=4*(n+1);let a=1;for(let n=0;n<r;n++)e[n]=t[4*n]<<24|t[4*n+1]<<16|t[4*n+2]<<8|t[4*n+3];for(let t=r;t<o;t++){let n=e[t-1];t%r==0?(n=he(n<<8|n>>>24)^a<<24,a=ye(a)):r>6&&t%r==4&&(n=he(n)),e[t]=e[t-r]^n}return n}(t,r),o=new Int32Array(4),a=pe(e);let i=0,s=0,c=0,u=0;return{process(t,e){e&&a.update(t,0,t.length),function(t){const e=new DataView(t.buffer,t.byteOffset,t.byteLength),r=t.length;let n=0;for(;n+16<=r;n+=16)l(),e.setInt32(n,e.getInt32(n)^o[0]),e.setInt32(n+4,e.getInt32(n+4)^o[1]),e.setInt32(n+8,e.getInt32(n+8)^o[2]),e.setInt32(n+12,e.getInt32(n+12)^o[3]);if(n<r){l();for(let e=0;n<r;n++,e++)t[n]^=o[e>>2]>>>24-8*(3&e)}}(t),e||a.update(t,0,t.length)},digest:()=>a.digest()};function l(){i=i+1|0,i||(s=s+1|0,s||(c=c+1|0,c||(u=u+1|0)));let t=me(i)^r[0],e=me(s)^r[1],a=me(c)^r[2],l=me(u)^r[3],f=ce[t>>>24]^ue[e>>>16&255]^le[a>>>8&255]^fe[255&l]^r[4],w=ce[e>>>24]^ue[a>>>16&255]^le[l>>>8&255]^fe[255&t]^r[5],d=ce[a>>>24]^ue[l>>>16&255]^le[t>>>8&255]^fe[255&e]^r[6],p=ce[l>>>24]^ue[t>>>16&255]^le[e>>>8&255]^fe[255&a]^r[7];t=ce[f>>>24]^ue[w>>>16&255]^le[d>>>8&255]^fe[255&p]^r[8],e=ce[w>>>24]^ue[d>>>16&255]^le[p>>>8&255]^fe[255&f]^r[9],a=ce[d>>>24]^ue[p>>>16&255]^le[f>>>8&255]^fe[255&w]^r[10],l=ce[p>>>24]^ue[f>>>16&255]^le[w>>>8&255]^fe[255&d]^r[11],f=ce[t>>>24]^ue[e>>>16&255]^le[a>>>8&255]^fe[255&l]^r[12],w=ce[e>>>24]^ue[a>>>16&255]^le[l>>>8&255]^fe[255&t]^r[13],d=ce[a>>>24]^ue[l>>>16&255]^le[t>>>8&255]^fe[255&e]^r[14],p=ce[l>>>24]^ue[t>>>16&255]^le[e>>>8&255]^fe[255&a]^r[15],t=ce[f>>>24]^ue[w>>>16&255]^le[d>>>8&255]^fe[255&p]^r[16],e=ce[w>>>24]^ue[d>>>16&255]^le[p>>>8&255]^fe[255&f]^r[17],a=ce[d>>>24]^ue[p>>>16&255]^le[f>>>8&255]^fe[255&w]^r[18],l=ce[p>>>24]^ue[f>>>16&255]^le[w>>>8&255]^fe[255&d]^r[19],f=ce[t>>>24]^ue[e>>>16&255]^le[a>>>8&255]^fe[255&l]^r[20],w=ce[e>>>24]^ue[a>>>16&255]^le[l>>>8&255]^fe[255&t]^r[21],d=ce[a>>>24]^ue[l>>>16&255]^le[t>>>8&255]^fe[255&e]^r[22],p=ce[l>>>24]^ue[t>>>16&255]^le[e>>>8&255]^fe[255&a]^r[23],t=ce[f>>>24]^ue[w>>>16&255]^le[d>>>8&255]^fe[255&p]^r[24],e=ce[w>>>24]^ue[d>>>16&255]^le[p>>>8&255]^fe[255&f]^r[25],a=ce[d>>>24]^ue[p>>>16&255]^le[f>>>8&255]^fe[255&w]^r[26],l=ce[p>>>24]^ue[f>>>16&255]^le[w>>>8&255]^fe[255&d]^r[27],f=ce[t>>>24]^ue[e>>>16&255]^le[a>>>8&255]^fe[255&l]^r[28],w=ce[e>>>24]^ue[a>>>16&255]^le[l>>>8&255]^fe[255&t]^r[29],d=ce[a>>>24]^ue[l>>>16&255]^le[t>>>8&255]^fe[255&e]^r[30],p=ce[l>>>24]^ue[t>>>16&255]^le[e>>>8&255]^fe[255&a]^r[31],t=ce[f>>>24]^ue[w>>>16&255]^le[d>>>8&255]^fe[255&p]^r[32],e=ce[w>>>24]^ue[d>>>16&255]^le[p>>>8&255]^fe[255&f]^r[33],a=ce[d>>>24]^ue[p>>>16&255]^le[f>>>8&255]^fe[255&w]^r[34],l=ce[p>>>24]^ue[f>>>16&255]^le[w>>>8&255]^fe[255&d]^r[35],f=ce[t>>>24]^ue[e>>>16&255]^le[a>>>8&255]^fe[255&l]^r[36],w=ce[e>>>24]^ue[a>>>16&255]^le[l>>>8&255]^fe[255&t]^r[37],d=ce[a>>>24]^ue[l>>>16&255]^le[t>>>8&255]^fe[255&e]^r[38],p=ce[l>>>24]^ue[t>>>16&255]^le[e>>>8&255]^fe[255&a]^r[39];let h=40;n>10&&(t=ce[f>>>24]^ue[w>>>16&255]^le[d>>>8&255]^fe[255&p]^r[40],e=ce[w>>>24]^ue[d>>>16&255]^le[p>>>8&255]^fe[255&f]^r[41],a=ce[d>>>24]^ue[p>>>16&255]^le[f>>>8&255]^fe[255&w]^r[42],l=ce[p>>>24]^ue[f>>>16&255]^le[w>>>8&255]^fe[255&d]^r[43],f=ce[t>>>24]^ue[e>>>16&255]^le[a>>>8&255]^fe[255&l]^r[44],w=ce[e>>>24]^ue[a>>>16&255]^le[l>>>8&255]^fe[255&t]^r[45],d=ce[a>>>24]^ue[l>>>16&255]^le[t>>>8&255]^fe[255&e]^r[46],p=ce[l>>>24]^ue[t>>>16&255]^le[e>>>8&255]^fe[255&a]^r[47],h=48),n>12&&(t=ce[f>>>24]^ue[w>>>16&255]^le[d>>>8&255]^fe[255&p]^r[48],e=ce[w>>>24]^ue[d>>>16&255]^le[p>>>8&255]^fe[255&f]^r[49],a=ce[d>>>24]^ue[p>>>16&255]^le[f>>>8&255]^fe[255&w]^r[50],l=ce[p>>>24]^ue[f>>>16&255]^le[w>>>8&255]^fe[255&d]^r[51],f=ce[t>>>24]^ue[e>>>16&255]^le[a>>>8&255]^fe[255&l]^r[52],w=ce[e>>>24]^ue[a>>>16&255]^le[l>>>8&255]^fe[255&t]^r[53],d=ce[a>>>24]^ue[l>>>16&255]^le[t>>>8&255]^fe[255&e]^r[54],p=ce[l>>>24]^ue[t>>>16&255]^le[e>>>8&255]^fe[255&a]^r[55],h=56),o[0]=(se[f>>>24]<<24|se[w>>>16&255]<<16|se[d>>>8&255]<<8|se[255&p])^r[h],o[1]=(se[w>>>24]<<24|se[d>>>16&255]<<16|se[p>>>8&255]<<8|se[255&f])^r[h+1],o[2]=(se[d>>>24]<<24|se[p>>>16&255]<<16|se[f>>>8&255]<<8|se[255&w])^r[h+2],o[3]=(se[p>>>24]<<24|se[f>>>16&255]<<16|se[w>>>8&255]<<8|se[255&d])^r[h+3]}}function pe(t){const e=function(){const t=new Int32Array(ie),e=new Int32Array(16),r=new Uint8Array(re),n=new DataView(r.buffer),o=new Uint8Array(8);let a=0,i=0;return{update:s,digest:function(){const e=8*i,r=Math.floor(e/4294967296),n=e>>>0;for(s(oe,0,1);56!=a;)s(ae,0,1);o[0]=r>>>24,o[1]=r>>>16,o[2]=r>>>8,o[3]=r,o[4]=n>>>24,o[5]=n>>>16,o[6]=n>>>8,o[7]=n,s(o,0,8);const c=new Uint8Array(ne),u=new DataView(c.buffer);for(let e=0;e<t.length;e++)u.setInt32(4*e,t[e]);return t.set(ie),a=0,i=0,c}};function s(t,e,o){const s=e+o;if(i+=o,a){for(;e<s&&a<re;)r[a++]=t[e++];a==re&&(c(n,0),a=0)}if(e+re<=s){const r=new DataView(t.buffer,t.byteOffset,t.byteLength);for(;e+re<=s;e+=re)c(r,e)}for(;e<s;)r[a++]=t[e++]}function c(r,n){for(let t=0;t<16;t++)e[t]=r.getInt32(n+4*t);let o,a=t[0],i=t[1],s=t[2],c=t[3],u=t[4];for(let t=0;t<15;t+=5)u=(a<<5|a>>>27)+((s^c)&i^c)+u+1518500249+e[t]|0,i=i<<30|i>>>2,c=(u<<5|u>>>27)+((i^s)&a^s)+c+1518500249+e[t+1]|0,a=a<<30|a>>>2,s=(c<<5|c>>>27)+((a^i)&u^i)+s+1518500249+e[t+2]|0,u=u<<30|u>>>2,i=(s<<5|s>>>27)+((u^a)&c^a)+i+1518500249+e[t+3]|0,c=c<<30|c>>>2,a=(i<<5|i>>>27)+((c^u)&s^u)+a+1518500249+e[t+4]|0,s=s<<30|s>>>2;u=(a<<5|a>>>27)+((s^c)&i^c)+u+1518500249+e[15]|0,i=i<<30|i>>>2,o=e[13]^e[8]^e[2]^e[0],o=o<<1|o>>>31,e[0]=o,c=(u<<5|u>>>27)+((i^s)&a^s)+c+1518500249+o|0,a=a<<30|a>>>2,o=e[14]^e[9]^e[3]^e[1],o=o<<1|o>>>31,e[1]=o,s=(c<<5|c>>>27)+((a^i)&u^i)+s+1518500249+o|0,u=u<<30|u>>>2,o=e[15]^e[10]^e[4]^e[2],o=o<<1|o>>>31,e[2]=o,i=(s<<5|s>>>27)+((u^a)&c^a)+i+1518500249+o|0,c=c<<30|c>>>2,o=e[0]^e[11]^e[5]^e[3],o=o<<1|o>>>31,e[3]=o,a=(i<<5|i>>>27)+((c^u)&s^u)+a+1518500249+o|0,s=s<<30|s>>>2;for(let t=20;t<40;t+=5)o=e[t-3&15]^e[t-8&15]^e[t-14&15]^e[15&t],o=o<<1|o>>>31,e[15&t]=o,u=(a<<5|a>>>27)+(i^s^c)+u+1859775393+o|0,i=i<<30|i>>>2,o=e[t-2&15]^e[t-7&15]^e[t-13&15]^e[t+1&15],o=o<<1|o>>>31,e[t+1&15]=o,c=(u<<5|u>>>27)+(a^i^s)+c+1859775393+o|0,a=a<<30|a>>>2,o=e[t-1&15]^e[t-6&15]^e[t-12&15]^e[t+2&15],o=o<<1|o>>>31,e[t+2&15]=o,s=(c<<5|c>>>27)+(u^a^i)+s+1859775393+o|0,u=u<<30|u>>>2,o=e[15&t]^e[t-5&15]^e[t-11&15]^e[t+3&15],o=o<<1|o>>>31,e[t+3&15]=o,i=(s<<5|s>>>27)+(c^u^a)+i+1859775393+o|0,c=c<<30|c>>>2,o=e[t+1&15]^e[t-4&15]^e[t-10&15]^e[t+4&15],o=o<<1|o>>>31,e[t+4&15]=o,a=(i<<5|i>>>27)+(s^c^u)+a+1859775393+o|0,s=s<<30|s>>>2;for(let t=40;t<60;t+=5)o=e[t-3&15]^e[t-8&15]^e[t-14&15]^e[15&t],o=o<<1|o>>>31,e[15&t]=o,u=(a<<5|a>>>27)+(i&s|(i|s)&c)+u+2400959708+o|0,i=i<<30|i>>>2,o=e[t-2&15]^e[t-7&15]^e[t-13&15]^e[t+1&15],o=o<<1|o>>>31,e[t+1&15]=o,c=(u<<5|u>>>27)+(a&i|(a|i)&s)+c+2400959708+o|0,a=a<<30|a>>>2,o=e[t-1&15]^e[t-6&15]^e[t-12&15]^e[t+2&15],o=o<<1|o>>>31,e[t+2&15]=o,s=(c<<5|c>>>27)+(u&a|(u|a)&i)+s+2400959708+o|0,u=u<<30|u>>>2,o=e[15&t]^e[t-5&15]^e[t-11&15]^e[t+3&15],o=o<<1|o>>>31,e[t+3&15]=o,i=(s<<5|s>>>27)+(c&u|(c|u)&a)+i+2400959708+o|0,c=c<<30|c>>>2,o=e[t+1&15]^e[t-4&15]^e[t-10&15]^e[t+4&15],o=o<<1|o>>>31,e[t+4&15]=o,a=(i<<5|i>>>27)+(s&c|(s|c)&u)+a+2400959708+o|0,s=s<<30|s>>>2;for(let t=60;t<80;t+=5)o=e[t-3&15]^e[t-8&15]^e[t-14&15]^e[15&t],o=o<<1|o>>>31,e[15&t]=o,u=(a<<5|a>>>27)+(i^s^c)+u+3395469782+o|0,i=i<<30|i>>>2,o=e[t-2&15]^e[t-7&15]^e[t-13&15]^e[t+1&15],o=o<<1|o>>>31,e[t+1&15]=o,c=(u<<5|u>>>27)+(a^i^s)+c+3395469782+o|0,a=a<<30|a>>>2,o=e[t-1&15]^e[t-6&15]^e[t-12&15]^e[t+2&15],o=o<<1|o>>>31,e[t+2&15]=o,s=(c<<5|c>>>27)+(u^a^i)+s+3395469782+o|0,u=u<<30|u>>>2,o=e[15&t]^e[t-5&15]^e[t-11&15]^e[t+3&15],o=o<<1|o>>>31,e[t+3&15]=o,i=(s<<5|s>>>27)+(c^u^a)+i+3395469782+o|0,c=c<<30|c>>>2,o=e[t+1&15]^e[t-4&15]^e[t-10&15]^e[t+4&15],o=o<<1|o>>>31,e[t+4&15]=o,a=(i<<5|i>>>27)+(s^c^u)+a+3395469782+o|0,s=s<<30|s>>>2;t[0]=t[0]+a|0,t[1]=t[1]+i|0,t[2]=t[2]+s|0,t[3]=t[3]+c|0,t[4]=t[4]+u|0}}(),r=new Uint8Array(re),n=new Uint8Array(re);t.length>re&&(e.update(t,0,t.length),t=e.digest());for(let e=0;e<re;e++){const o=e<t.length?t[e]:0;r[e]=54^o,n[e]=92^o}return e.update(r,0,re),{update(t,r,n){e.update(t,r,n)},digest(){const t=e.digest();e.update(n,0,re),e.update(t,0,ne);const o=e.digest();return e.update(r,0,re),o}}}function he(t){return se[t>>>24]<<24|se[t>>>16&255]<<16|se[t>>>8&255]<<8|se[255&t]}function me(t){return t<<24|(65280&t)<<8|t>>>8&65280|t>>>24}function ye(t){return 255&(t<<1^27*(t>>7))}const be=typeof crypto!=T&&typeof crypto.getRandomValues==C,Ee="Invalid password",Se="Invalid authentication code",ge="zipjs-abort-check-password",Ae="Crypto API not supported";function Re(t){if(be)return crypto.getRandomValues(t);throw new Error(Ae)}const xe={name:"PBKDF2"},ze=Object.assign({hash:{name:"HMAC"}},xe),De=Object.assign({iterations:1e3,hash:{name:"SHA-1"}},xe),Fe=["deriveBits"],Oe=[8,12,16],Ie=[16,24,32],Ue=10,Te=typeof crypto!=T,Ce=Te&&crypto.subtle;let ke=Te&&typeof Ce!=T&&typeof Ce.importKey==C&&typeof Ce.deriveBits==C,ve=de;class Me extends TransformStream{constructor({password:t,rawPassword:e,encryptionStrength:r,checkPasswordOnly:n,checkAuthenticationCode:o=!0}){const a={};super({start(){_e(a,t,e,r)},async transform(t,e){const{password:r,strength:o,l:i,ready:s}=a;if(r?(await async function(t,e,r,n){const o=await Le(t,e,r,Ze(n,0,Oe[e])),a=Ze(n,Oe[e]);if(o[0]!=a[0]||o[1]!=a[1])throw Be(t),new Error(Ee)}(a,o,r,Ze(t,0,Oe[o]+2)),t=Ze(t,Oe[o]+2),n?(Be(a),e.error(new Error(ge))):i()):await s,a.h)return;const c=new Uint8Array(t.length-Ue-(t.length-Ue)%16);e.enqueue(je(a,t,c,0,Ue,!0))},async flush(t){const{m:e,S:r,ready:n}=a;if(e){if(await n,a.h)return;const i=Ze(r,r.length-Ue),s=new Uint8Array(Ze(r,0,r.length-Ue));e.process(s,!0);const c=e.digest();let u=r.length<Ue?1:0;for(let t=0;t<Ue;t++)u|=c[t]^i[t];if(u&&o)return void t.error(new Error(Se));t.enqueue(s)}}}),Pe(this,a)}}class Ne extends TransformStream{constructor({password:t,rawPassword:e,encryptionStrength:r}){const n={};super({start(){_e(n,t,e,r)},async transform(t,e){const{password:r,strength:o,l:a,ready:i}=n;let s=N;if(r?(s=await async function(t,e,r){const n=Re(new Uint8Array(Oe[e]));return Bt(n,await Le(t,e,r,n))}(n,o,r),a()):await i,n.h)return;const c=new Uint8Array(s.length+t.length-t.length%16);c.set(s,0),e.enqueue(je(n,t,c,s.length,0,!1))},async flush(t){const{m:e,S:r,ready:o}=n;if(e){if(await o,n.h)return;const a=new Uint8Array(r);e.process(a,!1);const i=Ze(e.digest(),0,Ue);t.enqueue(Bt(a,i))}}}),Pe(this,n)}}function _e(t,e,r,n){Object.assign(t,{ready:new Promise(e=>t.l=e),password:We(e,r),strength:n-1,S:N,h:!1})}function Pe(t,e){const r=t.readable.getReader(),n=new ReadableStream({async pull(t){try{const{value:e,done:n}=await r.read();n?t.close():t.enqueue(e)}catch(t){throw Be(e),r.cancel(t).catch(()=>{}),t}},cancel:t=>(Be(e),r.cancel(t))});Object.defineProperty(t,"readable",{get:()=>n})}function je(t,e,r,n,o,a){const{m:i,S:s}=t;s.length&&(e=Bt(s,e));const c=e.length-o,u=c-c%16;if(r=function(t,e){if(e&&e>t.length){const r=t;(t=new Uint8Array(e)).set(r,0)}return t}(r,n+u),u){const t=Ze(r,n,n+u);t.set(Ze(e,0,u)),i.process(t,a)}return t.S=Ze(e,u),r}function Be(t){const{m:e}=t;t.h=!0,e&&e.dispose&&e.dispose()}async function Le(t,e,r,n){t.password=null;const o=Ie[e],a=await async function(t,e,r){if(ke)try{const n=await Ce.importKey("raw",t,ze,!1,Fe);return new Uint8Array(await Ce.deriveBits(Object.assign({salt:e},De),n,8*r))}catch{ke=!1}return function(t,e,r,n){const o=pe(t),a=new Uint8Array(n),i=new Uint8Array(e.length+4),s=new DataView(i.buffer);i.set(e);for(let t=1,r=0;r<n;t++,r+=ne){s.setUint32(e.length,t),o.update(i,0,i.length);let c=o.digest();const u=c.slice();for(let t=1;t<1e3;t++){o.update(c,0,ne),c=o.digest();for(let t=0;t<ne;t++)u[t]^=c[t]}a.set(u.subarray(0,Math.min(ne,n-r)),r)}return a}(t,e,0,r)}(r,n,2*o+2);return t.m=ve(Ze(a,0,o),Ze(a,o,2*o)),t.h&&Be(t),Ze(a,2*o)}function We(t,e){return e===I?ee(t):e}function Ze(t,e,r){return t.subarray(e,r)}class Ve extends TransformStream{constructor({password:t,rawPassword:e,passwordVerification:r,checkPasswordOnly:n}){super({start(){Ge(this,t,e,r)},transform(t,e){const r=this;if(r.password||r.rawPassword){const e=qe(r,t.subarray(0,12));if(r.password=r.rawPassword=null,0!=(e[11]^r.passwordVerification))throw new Error(Ee);t=t.subarray(12)}n?e.error(new Error(ge)):e.enqueue(qe(r,t))}})}}class He extends TransformStream{constructor({password:t,rawPassword:e,passwordVerification:r}){super({start(){Ge(this,t,e,r)},transform(t,e){const r=this;let n,o;if(r.password||r.rawPassword){r.password=r.rawPassword=null;const e=Re(new Uint8Array(12));e[11]=r.passwordVerification,n=new Uint8Array(t.length+e.length),n.set(Ye(r,e),0),o=12}else n=new Uint8Array(t.length),o=0;n.set(Ye(r,t),o),e.enqueue(n)}})}}function Ge(t,e,r,n){Object.assign(t,{password:e,rawPassword:r,passwordVerification:n}),function(t,e,r){const n=[305419896,591751049,878082192];if(Object.assign(t,{A:n,R:new Qt(n[0]),D:new Qt(n[2])}),r)for(let e=0;e<r.length;e++)Ke(t,r[e]);else for(let r=0;r<e.length;r++)Ke(t,e.charCodeAt(r))}(t,e,r)}function qe(t,e){const r=new Uint8Array(e.length);for(let n=0;n<e.length;n++)r[n]=Xe(t)^e[n],Ke(t,r[n]);return r}function Ye(t,e){const r=new Uint8Array(e.length);for(let n=0;n<e.length;n++)r[n]=Xe(t)^e[n],Ke(t,e[n]);return r}function Ke(t,e){let[,r]=t.A;t.R.append([e]);const n=~t.R.get();r=Je(Math.imul(Je(r+$e(n)),134775813)+1),t.D.append([r>>>24]);const o=~t.D.get();t.A=[n,r,o]}function Xe(t){const e=2|t.A[2];return $e(Math.imul(e,1^e)>>>8)}function $e(t){return 255&t}function Je(t){return 4294967295&t}function Qe(t){if(t instanceof ReadableStream)return t;const e=t.getReader();return new ReadableStream({async pull(t){try{const{value:r,done:n}=await e.read();n?t.close():t.enqueue(r)}catch(t){throw e.cancel(t).catch(()=>{}),t}},cancel:t=>e.cancel(t)})}function tr(t,e){t=Qe(t);const r=e?{type:e}:{};if(typeof Blob.prototype.stream!=C||new Blob([]).stream()instanceof ReadableStream)return new Response(t).blob().then(t=>e?new Blob([t],r):t);const n=[];return t.pipeTo(new WritableStream({write(t){n.push(t)}})).then(()=>new Blob(n,r))}function er(t){if(t instanceof WritableStream)return t;const e=t.getWriter();return new WritableStream({write:t=>e.write(t),close:()=>e.close(),abort:t=>e.abort(t)})}const rr="Invalid codec definition",nr="Reserved compression method",or="Invalid codec module",ar="Compression method not supported",ir=[0,8,9,99],sr=new Map,cr=new Map;function ur(t={}){const{compressionMethod:r,format:n,codecURI:o,CompressionStream:a,DecompressionStream:i,versionNeeded:s}=t;if(!Number.isInteger(r)||r<0||r>e||typeof n!=v||!n.length)throw new Error(rr);if(ir.includes(r))throw new Error(nr);const c=typeof a==C||typeof i==C;if(!(c||typeof o==v&&o.length))throw new Error(rr);sr.set(r,{compressionMethod:r,format:n,codecURI:o,versionNeeded:s}),c&&pr(n,{CompressionStream:a,DecompressionStream:i})}function lr(t){const e=sr.get(t);if(e){let r;sr.delete(t),sr.forEach(t=>r=r||t.format==e.format),r||cr.delete(e.format)}}function fr(t){return sr.get(t)}function wr(){return Array.from(sr.values(),t=>Object.assign({},t,cr.get(t.format)))}function dr(t){return cr.get(t)}function pr(t,e){const{CompressionStream:r,DecompressionStream:n}=e;if(typeof r!=C&&typeof n!=C)throw new Error(or);cr.set(t,{CompressionStream:r,DecompressionStream:n})}const hr="Invalid uncompressed size",mr="Invalid compressed data",yr="Codec out of memory",br="Invalid CRC32",Er="deflate-raw",Sr="deflate64-raw",gr="gzip",Ar=[31,139,8];class Rr extends TransformStream{constructor(t,{chunkSize:e,CompressionStreamFallback:r,CompressionStream:n}){super({});const{compressed:o,encrypted:a,useCompressionStream:i,zipCrypto:s,computeCrc32:c,level:u,deflate64:l,format:f,compressionMethod:w,inputSize:d}=t,p=this;let h,m,y,b=super.readable;const E=f&&dr(f),S=Tr(i,n,r),g=c&&o&&!l&&!E&&(!a||s)&&Boolean(S);if(a&&!s||!c||g||(h=new te,b=kr(b,h)),o)if(E)b=vr(b,Ur(E.CompressionStream,f,{level:u,chunkSize:e,compressionMethod:w,uncompressedSize:d}));else if(g)y=new xr,b=vr(b,new S(gr,{level:u,chunkSize:e})),b=kr(b,y);else try{b=Cr(b,i,{level:u,chunkSize:e},n,r)}catch(t){if(!i&&r)throw jr(t);let e;try{e=new n(gr)}catch{throw jr(t)}b=vr(b,e),b=kr(b,new xr)}a&&(s?b=kr(b,new He(t)):(m=new Ne(t),b=kr(b,m))),Ir(p,b,()=>{a&&!s||!c||(p.crc32=g?y.crc32:new DataView(h.value.buffer).getUint32(0))})}}class xr extends TransformStream{constructor(){let t,e=10,r=new Uint8Array(0);super({transform(t,n){if(e){const r=Math.min(e,t.length);if(e-=r,!(t=t.subarray(r)).length)return}const o=r.length+t.length;if(o<=8)return void(r=Bt(r,t));const a=o-8,i=Math.min(a,r.length);n.enqueue(Bt(r.subarray(0,i),t.subarray(0,a-i))),r=Bt(r.subarray(i),t.subarray(a-i))},flush(){const e=Wt(r);t.crc32=e.getUint32(0,!0),t.uncompressedSize=e.getUint32(4,!0)}}),t=this}}class zr extends TransformStream{constructor(t,{chunkSize:e,DecompressionStreamFallback:r,DecompressionStream:n}){super({});const{zipCrypto:o,encrypted:a,checkCrc32:i,crc32:s,compressed:c,useCompressionStream:u,deflate64:l,format:f,compressionMethod:w,rawBitFlag:d,outputSize:p}=t;let h,m,y,b=super.readable;if(a&&(o?b=kr(b,new Ve(t)):(m=new Me(t),b=kr(b,m))),c){const t=new Set,o=f&&dr(f);let a;if(o)b=vr(b,Ur(o.DecompressionStream,f,{chunkSize:e,compressionMethod:w,rawBitFlag:d,uncompressedSize:p}),t);else{const o=Tr(u,n,r);if(i&&!l&&s!==I&&p!==I&&o)try{a=new o(gr,{chunkSize:e})}catch{a=I}if(!a)try{b=Cr(b,u,{chunkSize:e,deflate64:l},n,r,t)}catch(t){if(l||p===I||!u&&r)throw jr(t);try{a=new n(gr)}catch{throw jr(t)}}}a?(y=!0,b=function(t,e,r,n,o){const a=e.writable.getWriter(),i=e.readable.getReader(),s=n===I?new Qt:I;let c,u,l=0,f=!1,w=!1;const d=new ReadableStream({start(t){u=t},pull(){m()},cancel:t=>(w=!0,m(),i.cancel(t))});return async function(){const e=t.getReader();try{const t=new Uint8Array(10);for(t.set(Ar),await a.write(t);;){await h(),await a.ready;const{value:t,done:r}=await _r(e,o);if(r)break;await a.write(t)}s&&await a.write(new Uint8Array(0));const i=new Uint8Array(8),c=Wt(i);c.setUint32(0,s?s.get():n,!0),c.setUint32(4,r,!0),f=!0,await a.write(i),await a.close()}catch(t){await Mr(a,t),await Nr(e,t)}}(),async function(){try{for(;;){const{value:t,done:e}=await p();if(e)break;if(l+=t.length,l>r)throw new Error(hr);s&&s.append(t),u.enqueue(t)}w||(w=!0,u.close())}catch(t){!function(t){w||(w=!0,u.error(t),m())}(t),await Nr(i,t)}}(),d;function p(){return i.read().catch(t=>{if(f){if(!s)throw Lr(t,br);if(l!=r)throw Lr(t,hr);return{done:!0}}throw Pr(t,o)})}function h(){if(!w&&u.desiredSize<=0)return new Promise(t=>c=t)}function m(){if(c){const t=c;c=I,t()}}}(b,a,p,s,t)):b=function(t,e){const r=t.getReader();return new ReadableStream({async pull(t){try{const{value:e,done:n}=await r.read();n?t.close():t.enqueue(e)}catch(t){throw await Nr(r,t),Pr(t,e)}},cancel:t=>r.cancel(t)})}(b,t)}i&&!y&&(h=new te,b=kr(b,h)),Ir(this,b,()=>{if(h){const t=new DataView(h.value.buffer).getUint32(0,!1);if(s!=t)throw new Error(br)}})}}const Dr=new Map;function Fr(t,e){if(!t)return!1;let r=Dr.get(t);r||(r=new Map,Dr.set(t,r));let n=r.get(e);if(n===I){try{new t(e),n=!0}catch{n=!1}r.set(e,n)}return n}function Or(t){return Fr(t,Er)}function Ir(t,e,r){e=kr(e,new TransformStream({flush:r})),Object.defineProperty(t,"readable",{get:()=>e})}function Ur(t,e,r){if(!t)throw new Error(ar);return new t(e,r)}function Tr(t,e,r){return t&&e?e:r&&r.requiresModule?r:void 0}function Cr(t,e,r,n,o,a){const i=e&&n?n:o||n,s=r.deflate64?Sr:Er;let c;try{c=new i(s,r)}catch(t){if(!e||!o||i==o)throw t;c=new o(s,r)}return vr(t,c,a)}function kr(t,e){return Qe(t).pipeThrough(e)}function vr(t,e,r){const n=e.writable.getWriter(),o=t.getReader();return async function(){try{for(;;){await n.ready;const t=await _r(o,r);if(t.done){await n.close();break}await n.write(t.value)}}catch(t){await Mr(n,t),await Nr(o,t)}}(),e.readable}async function Mr(t,e){try{await t.abort(e)}catch{}}async function Nr(t,e){try{await t.cancel(e)}catch{}}function _r(t,e){const r=t.read();return e?r.catch(t=>{throw e.add(t),t}):r}function Pr(t,e){return e.has(t)?t:Lr(t,Br(t)?yr:mr)}function jr(t){return Br(t)?Lr(t,yr):t}function Br(t){return Zt(t)&&"Z_MEM_ERROR"==t.code}function Lr(t,e){const r=new Error(e);return r.cause=t,r}const Wr="data",Zr="deflate",Vr="inflate";class Hr extends TransformStream{constructor(t,e){super({});const r=this,{codecType:n}=t;let o;n.startsWith(Zr)?o=Rr:n.startsWith(Vr)&&(o=zr),r.outputSize=0;let a=0;const i=new o(t,e),s=super.readable,c=new TransformStream({transform(t,e){t&&t.length&&(a+=t.length,e.enqueue(t))},flush(){Object.assign(r,{inputSize:a})}}),u=new TransformStream({transform(e,n){if(e&&e.length&&(n.enqueue(e),r.outputSize+=e.length,t.outputSize!==I&&r.outputSize>t.outputSize))throw new Error(hr)},flush(){const{crc32:t}=i;Object.assign(r,{crc32:t,inputSize:a})}});Object.defineProperty(r,"readable",{get:()=>s.pipeThrough(c).pipeThrough(i).pipeThrough(u)})}}class Gr extends TransformStream{constructor(t){const e=[];let r=0,n=0;function o(){const n=new Uint8Array(t);let o=0;for(;o<t;){const r=e[0],a=t-o;r.length<=a?(n.set(r,o),o+=r.length,e.shift()):(n.set(r.subarray(0,a),o),e[0]=r.subarray(a),o+=a)}return r-=t,n}(!Number.isFinite(t)||t<1)&&(t=262144),super({transform(a,i){for(e.push(a),r+=a.length;r>t;)n+=t,i.enqueue(o())},flush(t){r&&(n+=r,t.enqueue(function(t,e){const r=new Uint8Array(e);let n=0;for(const e of t)r.set(e,n),n+=e.length;return r}(e,r)))}}),Object.defineProperty(this,"outputSize",{get:()=>n})}}const qr="Worker startup timeout";let Yr,Kr,Xr,$r=()=>{};async function Jr(t){const{CompressionStream:e,CompressionStreamFallback:r}=t;return!(!r||r.requiresModule)||!(!Or(e)&&(n=e,!Fr(n,gr)))||!!r&&await Qr(t);var n}async function Qr(t){if($r)try{return await $r(t),!0}catch{}return!1}function tn(t){t.createWorker?Kr=!0:Yr=!1}class en{constructor(t,{readable:e,writable:r},n,o){const{options:a,config:i,F:s,useWebWorkers:c,workerURI:u}=n;let{createWorker:l}=n;const{signal:f}=s;return Kr&&(l=I),Object.assign(t,{O:!0,I:(t.I||0)+1,readable:e.pipeThrough(new Gr(Ct(i))).pipeThrough(new rn(s),{signal:f}),writable:r,options:Object.assign({},a),U:n,workerURI:u,createWorker:l,terminate:()=>new Promise(e=>{const{T:r,O:n}=t;n?(t.C=t.C||[],t.C.push(e)):(r&&(r.terminate(),t.T=null),e()),t.v=null}),M(){if(t.O){const{C:e,T:r}=t;e&&(t.C=null,r&&(t.N=!0,r.terminate())),t.O=!1;const n=o(t);e&&e.forEach(t=>t(n))}}}),Yr===I&&(Yr=typeof Worker!=T),(c&&Xr&&(Yr&&u||l)?Xr:on)(t,i)}}class rn extends TransformStream{constructor({onstart:t,onprogress:e,size:r,onend:n}){let o=0;super({async start(){t&&await nn(t,r)},async transform(t,n){o+=t.length,e&&await nn(e,o,r),n.enqueue(t)},async flush(){n&&await nn(n,o)}})}}async function nn(t,...e){try{await t(...e)}catch{}}function on(t,e){return{run:()=>an(t,e)}}async function an({options:t,readable:e,writable:r,M:n,U:o},a){let i,s,c;try{if(t.compressed&&!t.format){const e=t.codecType.startsWith(Zr),r=e?a.CompressionStreamFallback:a.DecompressionStreamFallback,n=e?a.CompressionStream:a.DecompressionStream;t.useCompressionStream?r&&r.requiresModule&&!Or(n)&&await u():await u()||r&&!r.requiresModule||(t.useCompressionStream=!0)}t.encrypted&&!t.zipCrypto&&await u(),i=new Hr(t,a),s=new Gr(Ct(a));const{signal:n}=o.F;await e.pipeThrough(i).pipeThrough(s).pipeTo(r,{preventClose:!0,preventAbort:!0,signal:n});const{crc32:c,inputSize:l,outputSize:f}=i;return{crc32:c,inputSize:l,outputSize:f}}catch(t){if(i){const e=s?s.outputSize:0;if(o.outputSize=e,Zt(t))try{t.outputSize=e}catch{}}throw t}finally{n()}function u(){return c||(c=Qr(a)),c}}const sn={type:"module"},cn="error",un="abort";let ln,fn,wn;var dn;function pn(t){const{reader:e}=t;e&&e.releaseLock(),t.reader=null,t.writer=null}function hn(t){const{T:e}=t;if(e)try{e.terminate()}catch{}t.v=null}function mn(t,e,r,n,o=!0){const{createWorker:a}=r;let i,s,c;if(a)i=a();else if(fn===I||ln!==t){const a=typeof t==C;s=a?t(o):t;const u=s.startsWith("data:"),l=s.startsWith("blob:");if(u||l){n===I&&(n=!1),n&&(c=sn);try{i=new Worker(s,c)}catch(o){if(l)try{URL.revokeObjectURL(s)}catch{}if(a&&l)return mn(t,e,r,n,!1);if(n)throw o;return mn(t,e,r,!0,!1)}}else{n===I&&(n=!0),n&&(c=sn);try{s=new URL(s,e)}catch{}try{i=new Worker(s,c)}catch(a){if(n)return mn(t,e,r,!1,o);throw a}}ln=t,fn=s,wn=c}else i=new Worker(fn,wn);return i.addEventListener("message",t=>{r._=!0,yn(r),async function({data:t},e){const{type:r,value:n,messageId:o,result:a,error:i,errorValue:s}=t,{reader:c,writer:u,P:l,j:f,M:w,I:d}=e,p=()=>e.I!=d;try{if(i)h(function(t,e){const{message:r,stack:n,code:o,name:a,outputSize:i,cause:s,codecImportFailed:c}=t;let u;if(u=e?e.value:Object.assign(new Error(r),{stack:n,code:o,name:a}),Zt(u))try{i!==I&&(u.outputSize=i),c&&(u.codecImportFailed=!0),s&&(Zt(u.cause)||(u.cause=Object.assign(new Error(s.message),{name:s.name})),s.code!==I&&u.cause.code!==s.code&&(u.cause.code=s.code)),e&&(u.name!==a&&(u.name=a),u.code!==o&&(u.code=o))}catch{}return u}(i,s));else{if("pull"==r){const{value:t,done:r}=await c.read();p()||En({type:Wr,value:t,done:r,messageId:o},e)}if(r==Wr){const t=new Uint8Array(n);await u.ready,await u.write(t),p()||En({type:"ack",messageId:o},e)}"close"==r&&function(t){p()||(l(t),m(),w())}(a)}}catch(i){p()||(hn(e),h(i))}function h(t){p()||(f(t),m(),Zt(t)&&t.codecImportFailed||w())}function m(){u&&u.releaseLock()}}(t,r)}),i.addEventListener(cn,t=>bn(t,r)),i.addEventListener("messageerror",t=>bn(t,r)),i}function yn(t){const{B:e}=t;e&&(clearTimeout(e),t.B=null)}function bn(t,e){t.preventDefault&&t.preventDefault(),yn(e);const{_:r,j:n,writer:o,M:a}=e;hn(e),r||(e.T=null);let i=t.error||new Error(t.message||cn);r||(i=Object.assign(new Error(i.message||cn),{L:!0}),e.W=i),n&&(n(i),o&&o.releaseLock(),r&&a())}function En(t,{T:e,writer:r}){try{const{value:r}=t;if(r){t.value=Lt(r);try{e.postMessage(t,[t.value.buffer])}catch{e.postMessage(t)}}else e.postMessage(t)}catch(t){throw r&&r.releaseLock(),t}}dn=function(t,e){const{baseURI:r,chunkSize:n,workerStartupTimeout:o}=e;let{wasmURI:a}=e;if(!t.v){let i;typeof a==C&&(a=a());try{i=mn(t.workerURI,r,t)}catch{return tn(t),on(t,e)}Object.assign(t,{T:i,_:!1,N:!1,W:null,v:{run:async()=>{try{return await async function(t,e){if(!t.T){const{W:e}=t;t.W=null;const r=e||new Error(qr);throw r.L=!0,r}let r,n;const o=new Promise((e,o)=>{r=e,n=e=>{const{outputSize:r,U:n}=t;if(n.outputSize=r,Zt(e))try{e.outputSize=r}catch{}o(e)}});Object.assign(t,{reader:null,writer:null,outputSize:0,Z:!1,V:null,P:r,j:n,result:o});const{readable:a,options:i}=t,{writable:s,closed:c,H:u}=function(t,e){const r=new AbortController;let n;const{writable:o,readable:a}=new TransformStream({transform(t,r){e.outputSize+=t.length,r.enqueue(t)}}),i=a.pipeTo(t,{preventClose:!0,preventAbort:!0,signal:r.signal});i.catch(t=>{n||Object.assign(e,{Z:!0,V:t})});const{signal:s}=e.U.F;if(s){const t=()=>r.abort(s.reason),e=()=>s.removeEventListener(un,t);s.addEventListener(un,t),i.then(e,e)}return{writable:o,closed:i,H:()=>{n=!0,r.abort()}}}(t.writable,t);try{En({type:"start",options:i,config:e},t)}catch(e){u();try{await c}catch{}throw t.M(),e}Object.assign(t,{reader:a.getReader(),writer:s.getWriter()});const{workerStartupTimeout:l}=e;!t._&&Number.isFinite(l)&&l>=0&&(t.B=setTimeout(()=>function(t){if(t.B=null,t._)return;const{j:e,writer:r}=t;if(hn(t),t.T=null,e){const t=new Error(qr);t.L=!0,e(t),r&&r.releaseLock()}}(t),l));try{const t=await o;return await f(),await c,t}catch(e){await f(),u();try{await c}catch{}const{outputSize:r,U:n,Z:o,V:a}=t;n.outputSize=r;const i=Zt(e)&&(e.codecImportFailed||e.L),s=o&&!i?a:e;if(Zt(s))try{s.outputSize=r}catch{}throw s}async function f(){if(!s.locked)try{await s.getWriter().close()}catch{}}}(t,{chunkSize:n,wasmURI:a,baseURI:r,workerStartupTimeout:o})}catch(r){if(r&&r.L)return tn(t),pn(t),an(t,e);if(r&&r.codecImportFailed){if(t.reader)return pn(t),an(t,e);t.M()}throw r}}}})}return t.v},Xr=dn;let Sn=[];const gn=[];let An,Rn,xn=0;async function zn(t,e){const{options:r,config:n}=e,{useWebWorkers:o,useCompressionStream:a,compressed:i,checkCrc32:s,computeCrc32:c,encrypted:u,format:l,codecURI:f}=r,{workerURI:w,createWorker:d,maxWorkers:p}=n;l&&(f&&(r.codecURI=function(t,e){try{return new URL(t,e).toString()}catch{return t}}(f,n.baseURI)),await async function(t,e){!cr.has(t)&&e&&pr(t,await(import(/* webpackIgnore: true */ /* @vite-ignore */e)))}(l,r.codecURI));const h=!(i||s||c||u),m=l===I||Boolean(r.codecURI);return e.useWebWorkers=!h&&m&&(o||o===I&&n.useWebWorkers),e.workerURI=e.useWebWorkers&&w?w:I,e.createWorker=e.useWebWorkers&&d?d:I,r.useCompressionStream=a||a===I&&n.useCompressionStream,(await async function(){const r=Sn.find(t=>!t.O);if(r)return Cn(r),new en(r,t,e,y);if(Sn.length<p){const r={G:xn};return xn++,Sn.push(r),new en(r,t,e,y)}return new Promise(r=>{gn.push({resolve:r,stream:t,U:e}),Rn=n.workerStarvationTimeout,Dn()})}()).run();function y(t){if(Fn(),t.N)return t.N=!1,In();if(gn.length){const[{resolve:e,stream:r,U:n}]=gn.splice(0,1);e(new en(t,r,n,y)),Dn()}else t.T?(Cn(t),function(t,e){const{config:r}=e,{terminateWorkerTimeout:n}=r;Number.isFinite(n)&&n>=0&&(t.Y=setTimeout(async()=>{Sn=Sn.filter(e=>e!=t);try{await t.terminate()}catch{}},n))}(t,e)):Sn=Sn.filter(e=>e!=t)}}function Dn(){!An&&gn.length&&Number.isFinite(Rn)&&Rn>=0&&(An=setTimeout(On,Rn))}function Fn(){An&&(clearTimeout(An),An=null)}function On(){if(An=null,gn.length){const[{resolve:t,stream:e,U:r}]=gn.splice(0,1);t(new en({},e,Un(r),Tn)),Dn()}}function In(){const t=gn.splice(0).map(({resolve:t,stream:e,U:r})=>new Promise(n=>{t(new en({},e,Un(r),()=>{Tn(),n()}))}));return Fn(),Promise.all(t)}function Un(t){return Object.assign({},t,{useWebWorkers:!1,workerURI:I,createWorker:I})}function Tn(){Fn(),Dn()}function Cn(t){const{Y:e}=t;e&&(clearTimeout(e),t.Y=null)}const kn="\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 vn(t,e){return Nn(t,e,!0)}function Mn(t){if(!t.some(t=>t>127))return!1;try{return new TextDecoder("utf-8",{fatal:!0}).decode(t),!0}catch{return!1}}function Nn(t,e,r){return e&&"cp437"==e.trim().toLowerCase()?function(t){let e="";for(let r=0;r<t.length;r++)e+=kn[t[r]];return e}(t):new TextDecoder(e,{ignoreBOM:r}).decode(t)}const _n="HTTP error ",Pn="HTTP Range not supported",jn="HTTP resource changed",Bn="Writer iterator completed too soon",Ln="Writer not initialized",Wn="Invalid writer (size must be writable)",Zn="Content-Range",Vn="Range",Hn="GET",Gn="bytes",qn=16777216,Yn="writable",Kn=Symbol();class Xn{constructor(){this.size=0}init(){this.initialized=!0}}class $n extends Xn{get readable(){return this.createReadable()}createReadable({offset:t=0,size:e,chunkSize:r=Ct(Tt())}={}){const n=this;let o=0;return r=kt(r),new ReadableStream({async pull(a){const i=e===I?r:Math.min(r,e-o),s=await Po(n,t+o,i);s.length&&(a.enqueue(s),o+=s.length),(e!==I&&o>=e||!s.length&&i)&&a.close()}})}}class Jn extends Xn{constructor(){super();const t=this,e=new WritableStream({write(e){if(!t.initialized)throw new Error(Ln);return t.writeUint8Array(Lt(e))}});Object.defineProperty(t,Yn,{get:()=>e})}writeUint8Array(){}}class Qn extends $n{constructor(t){super();let e=t.length;for(;"="==t.charAt(e-1);)e--;const r=t.indexOf(",")+1;Object.assign(this,{K:t,X:r,size:Math.floor(.75*(e-r))})}readUint8Array(t,e){const{X:r,K:n}=this,o=new Uint8Array(e),a=4*Math.floor(t/3),i=atob(n.substring(a+r,4*Math.ceil((t+e)/3)+r)),s=t-3*Math.floor(a/4);let c=0;for(let t=s;t<s+e&&t<i.length;t++)o[t-s]=i.charCodeAt(t),c++;return c<o.length?o.subarray(0,c):o}}class to extends Jn{constructor(t){super(),Object.assign(this,{contentType:t,data:"data:"+(t||"")+";base64,",$:""})}writeUint8Array(t){const e=this;let r,n=e.$;const o=e.$.length;for(e.$="",r=0;r<3*Math.floor((o+t.length)/3)-o;r++)n+=String.fromCharCode(t[r]);for(;r<t.length;r++)e.$+=String.fromCharCode(t[r]);n.length>2?e.data+=btoa(n):e.$=n+e.$}getData(){return this.data+btoa(this.$)}}let eo,ro;class no extends $n{constructor(t){super(),Object.assign(this,{J:t,size:t.size}),ro||(ro=(async()=>{try{const t=new Blob([new Uint8Array(3)]).slice(1,2).stream().getReader();let e=0,r=await t.read();for(;!r.done;)e+=r.value.length,r=await t.read();eo=1==e}catch{eo=!1}})())}createReadable(t){const{J:e,size:r}=this,{offset:n=0,size:o=r-n}=t||{};if(typeof e.stream==C){if(!n&&o>=r)return Qe(e.stream());if(eo)return Qe(e.slice(n,n+o).stream())}return super.createReadable(t)}async readUint8Array(t,e){const r=this,n=t+e,o=!t&&n>=r.size?r.J:r.J.slice(t,n);let a=await o.arrayBuffer();return a.byteLength>e&&(a=a.slice(t,n)),new Uint8Array(a)}}class oo extends Xn{constructor(t){super();const e=this,r=new TransformStream;Object.defineProperty(e,Yn,{get:()=>r.writable}),e.contentType=t,e.et=tr(r.readable,t),e.et.catch(()=>{})}getData(){return this.et}}class ao extends no{constructor(t){super(new Blob([t],{type:"text/plain"}))}}function io(t){let e=0;for(let r=0;r<t.length;r++){const n=t.charCodeAt(r);n<128?e+=1:n<2048?e+=2:n<55296||n>=57344?e+=3:n<56320&&56320==(64512&t.charCodeAt(r+1))?(e+=4,r++):e+=3}return e}class so extends oo{constructor(t){super(),Object.assign(this,{encoding:t,nt:!t||"utf-8"==t.toLowerCase()})}async getData(){const{encoding:t,nt:e}=this,r=await super.getData();return r.text&&e?r.text():function(t,e){return Nn(t,e,!1)}(new Uint8Array(await r.arrayBuffer()),t)}}class co extends $n{constructor(t,e){super(),lo(this,t,e)}async init(){await fo(this,zo,go),super.init()}createReadable(t){const e=this,{useRangeHeader:r,forceRangeRequests:n,size:o,ot:a}=e;if((r||n)&&o!==I){const{offset:r=0,size:n=o-r}=t||{},i=a&&r>=o-a.length;if(n>0&&r<o&&!i)return function(t,e,r){let n,o=e,a=0,i=r;return new ReadableStream({start:()=>s(),async pull(t){n||await s();const{value:e,done:r}=await n.read();if(r)throw new Error(Pn);const o=e.length>a?e.subarray(0,a):e;a-=o.length,i-=o.length,o.length&&t.enqueue(o),a||(await async function(){const t=n;n=I,await t.cancel()}(),i||t.close())},cancel:t=>n&&n.cancel(t)});async function s(){const e=Math.min(t.maximumRangeSize,i),r=await zo(Hn,t,Eo(t,o,e));if(206!=r.status)throw new Error(Pn);const s=po(r);if(s!==I&&s!=o)throw new Error(Pn);bo(t,r),yo(t,r),o+=e,a=e,n=r.body.getReader()}}(e,r,Math.min(n,o-r))}return super.createReadable(t)}readUint8Array(t,e){return wo(this,t,e,zo,go)}}class uo extends $n{constructor(t,e){super(),lo(this,t,e)}async init(){await fo(this,Do,Ao),super.init()}readUint8Array(t,e){return wo(this,t,e,Do,Ao)}}function lo(t,e,r){const{preventHeadRequest:n,useRangeHeader:o,forceRangeRequests:a,combineSizeEocd:i,checkResourceChanges:s=!0,maximumRangeSize:c=qn,fetch:u}=r;delete(r=Object.assign({},r)).preventHeadRequest,delete r.useRangeHeader,delete r.forceRangeRequests,delete r.combineSizeEocd,delete r.checkResourceChanges,delete r.maximumRangeSize,delete r.useXHR,delete r.fetch,Object.assign(t,{url:e,options:r,preventHeadRequest:n,useRangeHeader:o,forceRangeRequests:a,combineSizeEocd:i,checkResourceChanges:s,maximumRangeSize:c,fetch:u})}async function fo(t,e,r){const{url:n,preventHeadRequest:o,useRangeHeader:a,forceRangeRequests:i,combineSizeEocd:s}=t;if(function(t){const{baseURI:e}=Tt(),{protocol:r}=new URL(t,e);return"http:"==r||"https:"==r}(n)&&(a||i)&&(typeof o==T||o)){const n=await e(Hn,t,Eo(t,s?-65557:void 0)),o=n.headers.get("Accept-Ranges");if(!(i||o&&o.toLowerCase()==Gn))throw new Error(Pn);{let o;s&&206==n.status&&(o=new Uint8Array(await n.arrayBuffer())),yo(t,n);const a=ho(n);a===I?await xo(t,e,r):t.size=a,o&&o.length&&po(n)===t.size-o.length&&(t.ot=o)}}else await xo(t,e,r)}async function wo(t,e,r,n,o){const{useRangeHeader:a,forceRangeRequests:i,ot:s,size:c,options:u}=t;if(a||i){if(e>=c||0===r)return N;{if(e+r>c&&(r=c-e),s&&e>=c-s.length){const t=e-(c-s.length);return s.slice(t,t+r)}const o=await n(Hn,t,Eo(t,e,r));if(206!=o.status)throw new Error(Pn);const a=po(o);if(a!==I&&a!=e)throw new Error(Pn);bo(t,o),yo(t,o);const i=new Uint8Array(await o.arrayBuffer());if(i.length!=r)throw new Error(Pn);return i}}{const{data:n}=t;return n||await o(t,u),t.data.subarray(e,e+r)}}function po(t){const e=t.headers.get(Zn);if(e){const t=Number(e.trim().split(/[\s-]+/)[1]);if(!Number.isNaN(t))return t}}function ho(t){const e=t.headers.get(Zn);if(e){const t=e.trim().split(/\s*\/\s*/)[1];if(t&&"*"!=t){const e=Number(t);if(!Number.isNaN(e))return e}}}function mo({headers:t}){return{it:t.get("Etag")||I,lastModified:t.get("Last-Modified")||I}}function yo(t,e){const{checkResourceChanges:r,st:n}=t;r&&!n&&206==e.status&&(t.st=mo(e))}function bo(t,e){const{checkResourceChanges:r,st:n,size:o}=t;if(r){const t=ho(e);if(t!==I&&o!==I&&t!=o)throw new Error(jn);if(n){const t=mo(e);if(Object.entries(n).some(([e,r])=>r!==I&&t[e]!==I&&r!=t[e]))throw new Error(jn)}}}function Eo(t,e=0,r=1){return Object.assign({},So(t),{[Vn]:Gn+"="+(e<0?e:e+"-"+(e+r-1))})}function So({options:t}){const{headers:e}=t;if(e)return Symbol.iterator in e?Object.fromEntries(e):e}async function go(t){await Ro(t,zo)}async function Ao(t){await Ro(t,Do)}async function Ro(t,e){const r=await e(Hn,t,So(t));t.data=new Uint8Array(await r.arrayBuffer()),t.size=t.data.length}async function xo(t,e,r){if(t.preventHeadRequest)await r(t,t.options);else{const n=await e("HEAD",t,So(t)),o=n.headers.get("Content-Length");o&&!n.headers.get("Content-Encoding")?t.size=Number(o):await r(t,t.options)}}async function zo(t,{fetch:e=fetch,options:r,url:n},o){const a=await e(n,Object.assign({},r,{method:t,headers:o}));if(a.status>=200&&a.status<=299)return a;throw 416==a.status?new Error(Pn):new Error(_n+(a.statusText||a.status))}function Do(t,{url:e},r){return new Promise((n,o)=>{const a=new XMLHttpRequest;if(a.addEventListener("load",()=>{if(a.status>=200&&a.status<=299){const t=[];a.getAllResponseHeaders().trim().split(/[\r\n]+/).forEach(e=>{const r=e.trim().split(/\s*:\s*/);r[0]=r[0].trim().replace(/^[a-z]|-[a-z]/g,t=>t.toUpperCase()),t.push(r)}),n({status:a.status,arrayBuffer:()=>a.response,headers:new Map(t)})}else o(416==a.status?new Error(Pn):new Error(_n+(a.statusText||a.status)))},!1),a.addEventListener("error",t=>o(t.detail?t.detail.error:new Error("Network error")),!1),a.open(t,e),r)for(const t of Object.entries(r))a.setRequestHeader(t[0],t[1]);a.responseType="arraybuffer",a.send()})}class Fo extends $n{constructor(t,e={}){super(),Object.assign(this,{url:t,reader:e.useXHR&&!e.fetch?new uo(t,e):new co(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 Oo extends Fo{constructor(t,e={}){super(t,Object.assign({},e,{useRangeHeader:!0}))}}class Io extends $n{constructor(t){super(),t=new Uint8Array(t.buffer,t.byteOffset,t.byteLength),Object.assign(this,{ct:t,size:t.length})}readUint8Array(t,e){return this.ct.slice(t,t+e)}}class Uo extends Jn{constructor(t){super(),this.ut=t||262144}init(t=0){Object.assign(this,{offset:0,ct:new Uint8Array(t>0?t:this.ut)}),super.init()}writeUint8Array(t){const e=this,r=e.offset+t.length;if(r>e.ct.length){let t=e.ct.length?2*e.ct.length:e.ut;for(;t<r;)t*=2;const n=e.ct;e.ct=new Uint8Array(t),e.ct.set(n)}e.ct.set(t,e.offset),e.offset+=t.length}getData(){return this.offset===this.ct.length?this.ct:this.ct.slice(0,this.offset)}}class To extends $n{constructor(t){super(),this.lt=t}async init(){const t=this;t.ft=0;const e=t.lt=await Promise.all(t.lt.map(_o));t.wt=e.map(e=>{const r=t.size;return t.size+=e.size,r}),super.init()}ht(t){const{wt:e,size:r}=this,n=e[t];return n===I?r:n}async readUint8Array(t,e){const r=this,{lt:n}=this;let o,a=0,i=t;for(;n[a]&&i>=n[a].size;)i-=n[a].size,a++;const s=n[a];if(s){const n=s.size;if(i+e<=n)o=await Po(s,i,e);else{const a=n-i;o=Bt(await Po(s,i,a),await r.readUint8Array(t+a,e-a))}}else o=N;return r.ft=Math.max(a,r.ft),o}}class Co extends Xn{constructor(t,e=4294967295){super();const r=this;let n,o,a;Object.assign(r,{diskNumber:0,diskOffset:0,size:0,maxSize:e,availableSize:e});const i=new WritableStream({async write(e){if(e===Kn)return void(a&&await c());const{availableSize:i}=r;if(a)e.length>=i?(await s(e.subarray(0,i)),await c(),e.length>i&&await this.write(e.subarray(i))):await s(e);else{const{value:i,done:s}=await t.next();if(s&&!i)throw new Error(Bn);n=i,n.size=0,n.maxSize&&(r.maxSize=n.maxSize),r.availableSize=r.maxSize,await No(n),o=i.writable,a=o.getWriter(),await this.write(e)}},async close(){a&&(await a.ready,await u())},async abort(t){a&&await a.abort(t)}});async function s(t){const e=t.length;e&&(await a.ready,await a.write(t),n.size+=e,r.availableSize-=e)}async function c(){await u(),r.diskOffset+=n.size,r.diskNumber++,a=null,r.availableSize=r.maxSize}async function u(){await a.close()}Object.defineProperty(r,Yn,{get:()=>i})}async closeDisk(){const t=this.writable.getWriter();try{await t.ready,await t.write(Kn)}finally{t.releaseLock()}}}class ko{constructor(t){return Array.isArray(t)&&(t=new To(t)),(t instanceof ReadableStream||typeof t.getReader==C)&&(t={readable:Qe(t)}),t}}class vo{constructor(t){t.writable===I&&typeof t.next==C&&(t=new Co(t)),(t instanceof WritableStream||typeof t.getWriter==C)&&(t={writable:er(t)});try{t.size=t.size===I?0:t.size}catch{throw new Error(Wn)}return t}}function Mo(t){return Boolean(t&&t.getData)}async function No(t,e){if(!t.init||t.initialized)return Promise.resolve();await t.init(e)}async function _o(t){return t=new ko(t),await No(t),t.size!==I&&t.readUint8Array||(t=new no(await tr(t.readable)),await No(t)),t}function Po(t,e,r){return t.readUint8Array(e,r)}function jo(t,e){return t.createReadable?t.createReadable(e):t.readUint8Array?$n.prototype.createReadable.call(t,e):t.readable}function Bo(t,e,r){if(!t.some(t=>t.reason==e)){const n={reason:e};r!==I&&(n.filename=r),t.push(n)}}const Lo="filename",Wo="rawFilename",Zo="comment",Vo="rawComment",Ho="uncompressedSize",Go="compressedSize",qo="offset",Yo="diskNumberStart",Ko="lastModDate",Xo="rawLastModDate",$o="lastAccessDate",Jo="rawLastAccessDate",Qo="creationDate",ta="rawCreationDate",ea="internalFileAttributes",ra="externalFileAttributes",na="msdosAttributesRaw",oa="msdosAttributes",aa="msDosCompatible",ia="zip64",sa="encrypted",ca="version",ua="versionMadeBy",la="zipCrypto",fa="directory",wa="executable",da="compressionMethod",pa="signature",ha="extraField",ma="unixMode",ya="setuid",ba="setgid",Ea="sticky",Sa=[Lo,Wo,Ho,Go,Ko,Xo,Zo,Vo,$o,Jo,Qo,ta,qo,Yo,ea,ra,na,oa,aa,ia,sa,ca,ua,la,fa,wa,"symlink",da,pa,"crc32",ha,"extraFieldUnix","extraFieldInfoZip","extraFieldUnixType1","extraFieldPkwareUnix","uid","gid",ma,"unixExternalUpper",ya,ba,Ea,"bitFlag","rawBitFlag","filenameLength","extraFieldLength","filenameUTF8","commentUTF8","rawExtraField","extraFieldZip64","extraFieldUnicodePath","extraFieldUnicodeComment","extraFieldAES","extraFieldNTFS","extraFieldExtendedTimestamp","extraFieldUSDZ"];class ga{constructor(t){Sa.forEach(e=>this[e]=t[e])}}const Aa=new Set([1,h,10,m,28789,25461,y,b,E,22613,13]);function Ra(t,e,r){return t?e?12:16+4*r:0}const xa="File format is not recognized",za="End of central directory not found",Da="End of Zip64 central directory locator not found",Fa="Central directory header not found",Oa="Local file header not found",Ia="Zip64 extra field not found",Ua="File contains encrypted entry",Ta="Encryption method not supported",Ca="Split zip file",ka="Overlapping entry found",va="Entry data out of bounds",Ma="Ambiguous archive",Na="Encrypted central directory is not supported",_a="Unsafe filename",Pa="Invalid strictness (must be 'strict', 'balanced' or 'tolerant')",ja="Invalid filenameValidation (must be 'strict', 'balanced' or 'tolerant')",Ba="Invalid maxAppendedDataSize (must be a number greater than or equal to 0)",La="64-bit value exceeds Number.MAX_SAFE_INTEGER",Wa="unsorted central directory",Za="unknown version needed to extract",Va="compressed patched data",Ha="malformed extra field",Ga="unknown zip64 extensible data",qa="wrapped entries count",Ya="appended data",Ka="prepended data",Xa="prepended central directory",$a="trailing central directory data",Ja="mismatched central directory offset",Qa="missing zip64 extra field",ti="duplicate filename",ei="mismatched zip64 end of central directory record",ri="multiple end of central directory records",ni="mismatched local file header (filename)",oi="mismatched local file header (general purpose bit flag)",ai="mismatched local file header (compression method)",ii="mismatched local file header (crc32 or sizes)",si=/^[a-zA-Z]:/,ci=/(^|[\\/])\.\.([\\/]|$)/,ui="utf-8",li="cp437",fi=[[Ho,t],[Go,t],[qo,t],[Yo,e]],wi={[e]:{yt:Ji,bytes:4},[t]:{yt:Qi,bytes:8}},di=BigInt(Number.MAX_SAFE_INTEGER);class pi{constructor(t,e={}){Object.assign(this,{reader:new ko(t),options:e,bt:{Et:new Set,St:[],gt:[]}})}async*getEntriesGenerator(a={}){const c=this;let{reader:h}=c;if(await No(h),h.size!==I&&h.readUint8Array||(h=new no(await tr(h.readable)),await No(h)),h.size<w)throw new Error(xa);const m=c.warnings=[],y=Mi(a,c.options),b=y==et,E=y!=nt,S=Pi(Gi(c,a,X),y),D=function(t,e){if(t===I)return e;if(!vi(t))throw new Error(ja);return t}(Gi(c,a,"filenameValidation"),y),F=Gi(c,a,"normalizeFilename"),{At:O,Rt:U}=await ji(h,E,S);if(!O)throw await async function(t){return await ki(t)==o}(h)?new Error(Ca):new Error(za);E&&U>1&&Hi(ri);const T=Wt(O);let C=Ji(T,12),k=Ji(T,16);const v=O.offset,M=$i(T,20),_=v+w+M,P=h.size-_;P>S&&Hi(Ya),P>0&&Bo(m,Ya);let j=$i(T,4);const B=h.ft||0;let L,W,Z,V,H,G=$i(T,6),q=$i(T,10),Y=0,K=p;const $=k==t||C==t||q==e||G==e;if(k!=t&&G!=e&&(k+=Ci(h,G)),$){const r=O.offset>=d?await Po(h,O.offset-d,d):N,n=Wt(r);if(r.length==d&&Ji(n,0)==l){k=Ci(h,Ji(n,4))+Qi(n,8);let r=await Po(h,k,p),o=Wt(r);const a=O.offset-d-p;if((r.length<p||Ji(o,0)!=u)&&k!=a&&a>=0){const t=k;k=a,k>t&&(Y=k-t),r=await Po(h,k,p),o=Wt(r)}if(r.length<p||Ji(o,0)!=u)throw new Error(Da);if(Z=!0,V=Qi(o,4)>44,V){const t=Math.min(Qi(o,4)-44,h.size-k-p);t>0&&(K+=t,H=function(t){const e={rawExtensibleData:t};if(t.length>=28){const r=Wt(t),n=$i(r,26);Object.assign(e,{compressionMethod:$i(r,0),compressedSize:Qi(r,2),uncompressedSize:Qi(r,10),encryptionAlgorithm:$i(r,18),bitLength:$i(r,20),flags:$i(r,22),hashAlgorithm:$i(r,24),hashData:t.subarray(28,28+n)})}return e}(await Po(h,k+p,t)))}j==e?j=Ji(o,16):j!=Ji(o,16)&&Vi(b,m,ei),G==e?G=Ji(o,20):G!=Ji(o,20)&&Vi(b,m,ei),q==e?q=Qi(o,32):q!=Qi(o,32)&&Vi(b,m,ei),C==t?C=Qi(o,40):C!=Qi(o,40)&&Vi(b,m,ei),k=Ci(h,G)+Qi(o,48)+Y}else if(k==t||C==t||G==e)throw new Error(Da)}let J=C;const rt=O.offset-(Z?K+d:0);if(k>=h.size&&(Y=h.size-k-C-w,k=h.size-C-w),B!=j)throw new Error(Ca);if(k<0)throw new Error(xa);let ot=0,at=await Po(h,k,C),it=Wt(at);if(C){if(at.length<4)throw new Error(xa);let t=rt-C;if(k!=t&&G==j){const e=Ji(it,ot)==s||Boolean(H&&H.compressedSize)||bi(it);let r=!e;if(t>=0&&t+4<=h.size){const n=await Si(h,t);if(e)r=n;else if(!n){const e=await async function(t,e){const r=Math.max(0,e-65541),n=await Po(t,r,e-r),o=Wt(n);for(let t=n.length-6;t>=0;t--)if(Ji(o,t)==i&&t+6+$i(o,t+4)==n.length)return r+t}(h,rt),r=e-C;e!==I&&r>=0&&await Si(h,r)&&(t=r)}}if(r){const r=k;if(k=t,at=await Po(h,k,C),it=Wt(at),k>r)Y+=k-r,L=e;else{Vi(b,m,Ja);const t=k-r;if(at.length>=f){const e=Ji(it,42);!await gi(h,e,n)&&await gi(h,e+t,n)&&(Y+=t)}}}}}const st=rt-k;if(C!=st&&st>=0&&G==j&&(C=st,at=await Po(h,k,C),it=Wt(at)),k<0||k>=h.size)throw new Error(xa);c.directoryOffset=k,c.directoryLength=J;const ct=qi(c,a,"decryptCentralDirectory");let ut,lt;if(ct&&q&&at.length>=4&&Ji(it,0)!=s&&(V||bi(it))){const t=function(t,e,r){const n=t&&t.compressedSize?t.compressedSize:e;return n>0&&n<=r?n:r}(H,J,at.length);lt=at.subarray(t),at=await ct(at.subarray(0,t),H),it=Wt(at),J=at.length,ut=!0}H&&!ut&&(at.length<4||Ji(it,0)==s)&&Bo(m,Ga),W=k;const ft=Gi(c,a,"filenameEncoding"),wt=Gi(c,a,"commentEncoding"),dt=new Set;let pt,ht=-1;const mt=!b&&!Z;!q&&mt&&(q=Ei(it,at,ot),q&&Bo(m,qa));for(let t=0;t<q;t++){const n=new yi(h,c.options);if(ot+f>at.length||Ji(it,ot)!=s){if(0==t&&!ut&&(V||bi(it)))throw new Error(Na);throw new Error(Fa)}Ri(n,it,ot+6);const o=Boolean(n.bitFlag.languageEncodingFlag),i=ot+f,u=i+n.filenameLength+n.extraFieldLength,l=$i(it,ot+4),w=!(l>>8),d=l>>8==3,p=$i(it,ot+32),y=u+p,E=new Uint8Array(at.subarray(i,y)),S=E.subarray(0,n.filenameLength),O=E.subarray(n.filenameLength+n.extraFieldLength),U=o||!ft&&Mn(S),T=o||!wt&&Mn(O),C=Ji(it,ot+38),k=C&r,v={readOnly:Boolean(1&k),hidden:Boolean(2&k),system:Boolean(4&k),directory:Boolean(16&k),archive:Boolean(32&k)},M=Ji(it,ot+42),N=qi(c,a,"decodeText")||vn,_=U?ui:ft||li,P=T?ui:wt||li;let j=N(S,_,Q);j===I&&(j=vn(S,_));let B,L=N(O,P,tt);L===I&&(L=vn(O,P)),Object.assign(n,{index:t,xt:ut,versionMadeBy:l,msDosCompatible:w,zip64:!1,compressedSize:0,uncompressedSize:0,zt:p,offset:M,diskNumberStart:$i(it,ot+34),internalFileAttributes:$i(it,ot+36),externalFileAttributes:C,msdosAttributesRaw:k,msdosAttributes:v,rawFilename:S,filenameUTF8:U,commentUTF8:T,rawExtraField:E.subarray(n.filenameLength,n.filenameLength+n.extraFieldLength),rawComment:O,filename:j,comment:L});try{B=xi(n,n,it,ot+6)}catch(t){if(b||t.message!=Ia)throw t;n.Dt=!0,Bo(m,Qa,n.filename)}if(j=n.filename,F){const t=F(j);t!==I&&(j=n.filename=t)}if(_i(j,D)){const t=new Error(_a);throw t.filename=j,t}B&&Bo(m,Ha,j),n.offset+=Y;const Z=Ci(h,n.diskNumberStart)+n.offset;W=Math.min(Z,W),Z<ht&&Bo(m,Wa,j),ht=Z,(n.version&r)>63&&Bo(m,Za,j),32&~n.rawBitFlag||Bo(m,Va,j),dt.has(n.filename)&&(pt=!0),dt.add(n.filename);const H=n.externalFileAttributes>>16&e;n.unixMode===I&&16877&H&&(n.unixMode=H);const G=Boolean(n.unixMode&R),K=Boolean(n.unixMode&x),X=Boolean(512&n.unixMode),$=40960==((n.unixMode===I?H:n.unixMode)&g),J=n.unixMode!==I&&(n.unixMode&g)==A||(H&g)==A||w&&v.directory||n.filename.endsWith(z),et=!$&&!J&&(n.unixMode!==I?!!(73&n.unixMode):d&&!!(73&H));Object.assign(n,{setuid:G,setgid:K,sticky:X,symlink:$,unixExternalUpper:H,executable:et,directory:J,zipCrypto:n.encrypted&&!n.extraFieldAES});const rt=new ga(n);if(rt.getData=(t,e)=>n.getData(t,rt,c.bt,e),rt.arrayBuffer=async t=>{const e=new TransformStream,r=tr(e.readable).then(t=>t.arrayBuffer());return r.catch(()=>{}),await n.getData(e,rt,c.bt,Object.assign({},t,{preventClose:!1})),r},ot=y,t==q-1&&mt){const t=Ei(it,at,ot);t&&(q+=t,Bo(m,qa))}const{onprogress:nt}=a;if(nt)try{await nt(t+1,q,new ga(n))}catch{}yield rt}let yt=ot,bt=Ai(at.subarray(ot))||(ut?Ai(lt):I);if(!bt&&!ut){const t=k+ot,e=Math.min(rt-t,65541);e>=6&&(bt=Ai(await Po(h,t,e)))}bt&&(c.digitalSignature=bt,yt=ot+6+bt.length),(ot!=J&&yt!=J||!ut&&ot!=C&&yt!=C)&&Vi(b,m,$a),pt&&Vi(b,m,ti);const Et=Gi(c,a,"extractPrependedData"),St=Gi(c,a,"extractAppendedData"),gt=(b||Et)&&q&&4==W&&await async function(t){const e=await ki(t);return e==o||808471376==e}(h)?4:0;return b&&(Y>0||q&&W>gt)&&Hi(Ka),(Y>0||q&&W>4)&&Bo(m,Ka),L&&Bo(m,Xa),Et&&(c.prependedData=W>gt?await Po(h,gt,W-gt):N),c.comment=M?await Po(h,v+w,M):N,St&&(c.appendedData=_<h.size?await Po(h,_,h.size-_):N),!0}async getEntries(t={}){const e=[];for await(const r of this.getEntriesGenerator(t))e.push(r);return e}async close(){const{reader:t}=this;t.readUint8Array||!t.readable||t.readable.locked||await t.readable.cancel()}[_](){return this.close()}}class hi{constructor(t={}){let e;const{readable:r,writable:n}=new TransformStream({start(t){e=t}}),o=new pi(r,t),a=o.getEntriesGenerator(),i=new Set;this.readable=new ReadableStream({async pull(t){const{done:e,value:r}=await a.next();if(e)return t.close();const n=function(t,e){const{readable:r,writable:n}=new TransformStream;let o;const a={cancel:async t=>{e.delete(a),await(o?o.cancel(t):r.cancel(t))}};return a.readable=new ReadableStream({async pull(i){o||(o=r.getReader(),e.add(a),async function(){try{await t.getData(n,{preventClose:!1})}catch(t){try{await n.abort(t)}catch{}}finally{e.delete(a)}}());const{done:s,value:c}=await o.read();s?i.close():i.enqueue(c)},cancel:t=>a.cancel(t)},{highWaterMark:0}),a}(r,i),o={...r,readable:n.readable};delete o.getData,Object.defineProperties(o,{localDirectory:{get:()=>r.localDirectory,enumerable:!0},warnings:{get:()=>r.warnings,enumerable:!0}}),t.enqueue(o)},async cancel(t){const r=Array.from(i);i.clear(),e.error(t),await Promise.allSettled(r.map(e=>e.cancel(t))),await Promise.allSettled([a.return(),o.close()])}}),this.writable=n}}async function mi(t,e={}){if(t=new ko(t),await No(t),t.size!==I&&t.readUint8Array||(t=new no(await tr(t.readable)),await No(t)),t.size<w)return!1;const r=Mi(e,{}),n=r!=nt,o=Pi(e[X],r),{At:a,Rt:i}=await ji(t,n,o);if(!a||r==et&&i>1)return!1;const s=$i(Wt(a),20),c=a.offset+w+s;return t.size-c<=o}let yi=class{constructor(t,e){Object.assign(this,{reader:t,options:e})}async getData(t,e,o,a={}){const i=this;if(i.Dt)throw new Error(Ia);const s=Tt(),{reader:c,index:u,offset:l,diskNumberStart:f,extraFieldAES:w,extraFieldZip64:d,compressionMethod:p,bitFlag:h,rawBitFlag:m,crc32:y,rawLastModDate:b,uncompressedSize:E,compressedSize:S}=i,{dataDescriptor:g}=h,A=e.localDirectory={},R=e.warnings=[],x=Ci(c,f)+l,z=await Po(c,x,D),F=Wt(z);let O=Gi(i,a,P),U=Gi(i,a,j);const T=pt(Gi(i,a,B)),C=Boolean(T),k=!0===T;if(dt(O,U),O=O&&O.length?O:I,U=U&&U.length?U:I,w&&99!=w.originalCompressionMethod)throw new Error(ar);if(z.length<D||Ji(F,0)!=n)throw new Error(Oa);Ri(A,F,4);const{extraFieldLength:v,filenameLength:M}=A,_=A.dataOffset=x+D+M+v,H=Gi(i,a,"checkLocalDirectory"),G=Mi(a,i.options),q=function(t,e){return t===I?e!=nt:Boolean(t)}(H,G),Y=Gi(i,a,"checkLocalFilename"),K=function(t,e){return t===I?e==et:Boolean(t)}(Y===I?H:Y,G);let X=N;if(K&&(M||v)){const t=await Po(c,x+D,M+v);X=t.subarray(0,M),A.rawExtraField=t.subarray(M)}else A.rawExtraField=v?await Po(c,x+D+M,v):N;K&&(A.rawFilename=X),xi(i,A,F,4,!0)&&Bo(R,Ha),function(t,e,r,n,o){const{rawFilename:a}=t,i=!o,s=t.xt&&!(8192&~e.rawBitFlag);!n||s||r.length==a.length&&!r.some((t,e)=>t!=a[e])||Vi(i,o,ni),(2121&e.rawBitFlag)!=(2121&t.rawBitFlag)&&Vi(i,o,oi),e.compressionMethod!=t.compressionMethod&&Vi(i,o,ai),e.bitFlag.dataDescriptor||s||!(e.crc32||e.compressedSize||e.uncompressedSize)||e.crc32==t.crc32&&e.compressedSize==t.compressedSize&&e.uncompressedSize==t.uncompressedSize||Vi(i,o,ii)}(i,A,X,K,q?I:R);const{lastAccessDate:$,creationDate:J,uid:Q,gid:tt}=A;$&&(e.lastAccessDate=$),J&&(e.creationDate=J),Q!==I&&e.uid===I&&(e.uid=Q),tt!==I&&e.gid===I&&(e.gid=tt);const rt=Gi(i,a,"checkPasswordOnly"),ot=i.encrypted&&(!k||rt),at=ot&&!w;if(k||(e.zipCrypto=at),ot&&!(64&~i.rawBitFlag))throw new Error(Ta);const it=C?I:fr(p);if(0!=p&&8!=p&&9!=p&&!it&&!C)throw new Error(ar);if(ot){if(!at&&(w.strength<1||w.strength>3))throw new Error(Ta);if(!O&&!U)throw new Error(Ua)}if(_+S>c.size)throw new Error(va);const st=S,ct=ft(Gi(i,a,L));wt(ct);let ut=Gi(i,a,"checkOverlappingEntry");const lt=Gi(i,a,"checkOverlappingEntryOnly");lt&&(ut=!0);const{onstart:ht,onprogress:mt,onend:yt}=a,bt=0!=p&&!C,Et=C?S-Ra(ot,at,w&&w.strength):E,St=9==p;let gt=Gi(i,a,Z);St&&(gt=!1);const At=Gi(i,a,"checkCrc32"),Rt=(At===I?Gi(i,a,"checkSignature"):At)&&!C&&(!ot||at||w&&1==w.vendorVersion),xt={options:{codecType:Vr,password:O,rawPassword:U,zipCrypto:at,encryptionStrength:w&&w.strength,checkCrc32:Rt,checkAuthenticationCode:Gi(i,a,"checkAuthenticationCode"),passwordVerification:at&&(g?b>>>8&r:y>>>24&r),outputSize:Et,crc32:y,compressed:bt,encrypted:ot,useWebWorkers:Gi(i,a,W),useCompressionStream:gt,deflate64:St,format:it?it.format:I,codecURI:it?it.codecURI:I,compressionMethod:p,rawBitFlag:m,checkPasswordOnly:rt},config:s,F:{signal:ct,size:st,onstart:ht,onprogress:mt,onend:yt}};let zt,Dt,Ft;ut&&await async function({reader:t,Ft:e,index:r,offset:n,crc32:o,compressedSize:a,uncompressedSize:i,dataOffset:s,dataDescriptor:c,extraFieldZip64:u,bt:l}){let f=0;if(c){const r=Boolean(u),n=Wt(await Po(t,s+a,24)),c=[[r,!0],[r,!1],[!r,!0],[!r,!1]].map(([t,e])=>Ui(n,t,e)).filter(t=>t&&t.compressedSize==a&&t.uncompressedSize==i),l=c.find(t=>t.crc32==o)||c[0]||Ui(n,r,!0)||Ui(n,r,!1);l?(e.localDirectory.dataDescriptor=l,f=Ti(l.zip64,l.signature)):f=Ti(r,!1)}const w={start:n,end:s+a+f,Ft:e},{Et:d,St:p,gt:h}=l;if(!d.has(r)){const t=function(t,e){let r=0,n=t.length;for(;r<n;){const o=r+n>>>1;t[o].start<e.start?r=o+1:n=o}const o=t[r-1],a=t[r];return o&&Ii(e,o)?o:a&&Ii(e,a)?a:void 0}(p,w)||h.find(t=>Ii(w,t));if(t){const e=new Error(ka);throw e.overlappingEntry=t.Ft,e}d.add(r),h.push(w),h.length*h.length>p.length&&(h.sort((t,e)=>t.start-e.start),l.St=function(t,e){const r=[];let n=0,o=0;for(;n<t.length||o<e.length;)o==e.length||n<t.length&&t[n].start<e[o].start?r.push(t[n++]):r.push(e[o++]);return r}(p,h),h.length=0)}}({reader:c,Ft:e,index:u,offset:x,crc32:y,compressedSize:S,uncompressedSize:E,dataOffset:_,dataDescriptor:g||A.bitFlag.dataDescriptor,extraFieldZip64:d||A.extraFieldZip64,bt:o});try{if(!lt){rt&&(t=new WritableStream),t=new vo(t),await No(t,function(t,e,r){return Math.min(t,r?1032*e:e)}(Et,S,bt)),({writable:zt}=t);const e=Qe(c.createReadable({offset:_,size:st})),{outputSize:r}=await zn({readable:e,writable:zt},xt);if(wt(ct),r!=Et)throw Object.assign(new Error(hr),{outputSize:r});t.size+=r}}catch(e){const{outputSize:r}=xt;if(r!==I?t.size+=r:Zt(e)&&e.outputSize!==I&&(t.size+=e.outputSize),!rt||!Zt(e)||e.message!=ge)throw Dt=e,Ft=!0,e}finally{if((Mo(t)||!Gi(i,a,V))&&zt&&!zt.locked){const t=zt.getWriter();if(Ft)try{await t.abort(Dt)}catch{}else await t.close()}}return rt||lt?I:t.getData?t.getData():zt}};function bi(t){const e=Math.min(t.byteLength,1024)-3;for(let r=0;r<e;r++)if(134630224==Ji(t,r))return!0;return!1}function Ei(t,e,r){let n=0;for(;r+f<=e.length&&Ji(t,r)==s;)r+=f+$i(t,r+28)+$i(t,r+30)+$i(t,r+32),n++;return n%65536?0:n}function Si(t,e){return gi(t,e,s)}async function gi(t,e,r){return!(e<0||e+4>t.size)&&Ji(Wt(await Po(t,e,4)),0)==r}function Ai(t){if(t.length>=6){const e=Wt(t);if(Ji(e,0)==i){const r=$i(e,4);if(6+r<=t.length)return new Uint8Array(t.subarray(6,6+r))}}}function Ri(t,e,r){const n=t.rawBitFlag=$i(e,r+2),o=!(1&~n),a=Ji(e,r+6);Object.assign(t,{encrypted:o,version:$i(e,r),bitFlag:{level:(6&n)>>1,dataDescriptor:!(8&~n),languageEncodingFlag:(n&S)==S},rawLastModDate:a,lastModDate:Yi(a),filenameLength:$i(e,r+22),extraFieldLength:$i(e,r+24)})}function xi(t,e,r,n,o){const{rawExtraField:a}=e,i=e.extraField=new Map,s=Wt(a);let c=0,u=!1;try{for(;c<a.length;){const t=$i(s,c),e=$i(s,c+2);i.set(t,{type:t,data:a.slice(c+4,c+4+e)}),c+=4+e}}catch{u=!0}c>a.length&&(u=!0);const l=$i(r,n+4);Object.assign(e,{signature:Ji(r,n+10),crc32:Ji(r,n+10),compressedSize:Ji(r,n+14),uncompressedSize:Ji(r,n+18)});const f=i.get(1);if(f)(function(t,e,r){e.zip64=!0;const n=Wt(t.data),o=fi.filter(([t,r])=>e[t]==r),a=o.reduce((t,[,e])=>t+wi[e].bytes,0);if(t.data.length<a){if(r)return!1;throw new Error(Ia)}const i=[];try{for(let t=0,e=0;t<o.length;t++){const[,r]=o[t],a=wi[r];i.push(a.yt(n,e)),e+=a.bytes}}catch(t){if(r)return!1;throw t}return o.forEach(([r],n)=>{e[r]=t[r]=i[n]}),!0})(f,e,o)||(u=!0),e.extraFieldZip64=f;else if(fi.some(([t,r])=>e[t]==r)){if(!o)throw new Error(Ia);u=!0}const w=i.get(28789);w&&(zi(w,Lo,Wo,e,t),e.extraFieldUnicodePath=w);const d=i.get(25461);d&&(zi(d,Zo,Vo,e,t),e.extraFieldUnicodeComment=d);const p=i.get(h);p&&(99==l||e.encrypted)&&p.data.length>=7?(function(t,e,r){const n=Wt(t.data),o=Xi(n,4);Object.assign(t,{vendorVersion:Xi(n,0),vendorId:Xi(n,2),strength:o,originalCompressionMethod:r,compressionMethod:$i(n,5)}),e.compressionMethod=t.compressionMethod,1!=t.vendorVersion&&(e.crc32=I)}(p,e,l),e.extraFieldAES=p):(p&&(u=!0),e.compressionMethod=l);const S=i.get(13);S&&(Di(S,e),e.extraFieldPkwareUnix=S);const g=i.get(22613);g&&(Di(g,e),e.extraFieldUnixType1=g);const A=i.get(m);A&&(function(t,e,r){if(!t.data.length)return;const n=Wt(t.data),o=Xi(n,0),a=[],i=[];r?(1&~o||(a.push(Ko),i.push(Xo)),2&~o||(a.push($o),i.push(Jo)),4&~o||(a.push(Qo),i.push(ta))):t.data.length>=5&&(a.push(Ko),i.push(Xo));let s=1;a.forEach((r,o)=>{if(t.data.length>=s+4){const a=Ji(n,s);e[r]=t[r]=new Date(1e3*(0|a));const c=i[o];t[c]=a}s+=4})}(A,e,o),e.extraFieldExtendedTimestamp=A);const R=i.get(10);R&&(function(t,e){const r=Wt(t.data);let n,o=4;try{for(;o<t.data.length&&!n;){const e=$i(r,o),a=$i(r,o+2);1==e&&(n=t.data.slice(o+4,o+4+a)),o+=4+a}}catch{}if(n&&24==n.length){const r=Wt(n),o=r.getBigUint64(0,!0),a=r.getBigUint64(8,!0),i=r.getBigUint64(16,!0);Object.assign(t,{rawLastModDate:o,rawLastAccessDate:a,rawCreationDate:i});const s={lastModDate:Ki(o),lastAccessDate:Ki(a),creationDate:Ki(i)};Object.assign(t,s),Object.assign(e,s,{rawLastAccessDate:a,rawCreationDate:i})}}(R,e),e.extraFieldNTFS=R);const x=i.get(b);let z;x&&(z=Fi(x,e,!0),e.extraFieldInfoZip=x);const D=i.get(E);D&&(Fi(D,z?{}:e,!1),e.extraFieldUnix=D);const F=i.get(y);return F&&(e.extraFieldUSDZ=F),u}function zi(t,e,r,n,o){if(t.data.length<5)return void(t.valid=!1);const a=Wt(t.data),i=new Qt;i.append(o[r]);const s=Wt(new Uint8Array(4));s.setUint32(0,i.get(),!0);const c=Ji(a,1),u=Xi(a,0);Object.assign(t,{version:u,[e]:vn(t.data.subarray(5)),valid:1==u&&!o.bitFlag.languageEncodingFlag&&c==Ji(s,0)}),t.valid&&(n[e]=t[e],n[e+"UTF8"]=!0)}function Di(t,e){if(t.data.length<8)return;const r=Wt(t.data),n={lastAccessDate:new Date(1e3*(0|Ji(r,0))),lastModDate:new Date(1e3*(0|Ji(r,4)))};t.data.length>=12&&(n.uid=$i(r,8),n.gid=$i(r,10)),Object.assign(t,n),Object.assign(e,n)}function Fi(t,e,r){try{const n=Wt(t.data);let o,a;if(r){let e=0;const r=Xi(n,e++),i=Xi(n,e++);o=Oi(t.data.subarray(e,e+i)),e+=i;const s=Xi(n,e++);a=Oi(t.data.subarray(e,e+s)),Object.assign(t,{version:r,uid:o,gid:a})}else t.data.length>=4&&(o=$i(n,0),a=$i(n,2),Object.assign(t,{uid:o,gid:a}));return o!==I&&(e.uid=o),a!==I&&(e.gid=a),o!==I||a!==I}catch{}}function Oi(t){const e=new Uint8Array(4);return e.set(t,0),new DataView(e.buffer,e.byteOffset,4).getUint32(0,!0)}function Ii(t,e){return t.start<e.end&&e.start<t.end}function Ui(t,e,r){const n=r?4:0;if(t.byteLength<Ti(e,r)||r&&Ji(t,0)!=a)return I;const o=Ji(t,n);let i,s;try{e?(i=Qi(t,n+4),s=Qi(t,n+12)):(i=Ji(t,n+4),s=Ji(t,n+8))}catch{return I}return{signature:r,zip64:e,crc32:o,compressedSize:i,uncompressedSize:s}}function Ti(t,e){return(t?20:12)+(e?4:0)}function Ci(t,e){return t.ht?t.ht(e):0}async function ki(t){return Ji(Wt(await Po(t,0,4)))}function vi(t){return t===et||t===rt||t===nt}function Mi(t,e){return Ni(t,Ni(e,rt))}function Ni(t,e){const r=t.strictness;if(r!==I){if(!vi(r))throw new Error(Pa);return r}const n=t.checkAmbiguity;return n===I?e:n?et:e==nt?nt:rt}function _i(t,e){if(e==nt)return!1;const r=t.split("/");return r.length>1&&""===r[r.length-1]&&r.pop(),!!(ci.test(t)||t.startsWith("/")||t.startsWith("\\")||si.test(t))||e==et&&(r.includes(".")||r.includes("")||t.includes("\0"))}function Pi(t,r){if(t!==I){const e=yt(t);if("number"!=typeof e||Number.isNaN(e)||e<0)throw new Error(Ba);return e}return r==et?0:r==nt?1/0:e}async function ji(t,e,r){const{size:n}=t,o=Math.min(n,65557),a={Ot:64};let i,s,c=0;for await(const[r,u,l,f,d]of Bi(t,o)){const o=$i(r,f+20);if(d+w+o==n){const o=await Wi(t,r,u,f,d,n,a);if(2==o){if(i||(i=Li(l,f,d)),c++,!e||c>1)break}else 1!=o||s||(s=Li(l,f,d))}}return i||(i=s),i||(i=await async function(t,e,r){const{size:n}=t,o=Math.min(n,e==1/0?n:65557+e);let a,i;for await(const[e,s,c,u,l]of Bi(t,o)){const o=Li(c,u,l);a||(a=o);const f=await Wi(t,e,s,u,l,n,r);if(2==f)return o;1!=f||i||(i=o)}return i||a}(t,r,a)),{At:i,Rt:c}}async function*Bi(t,e){const r=t.size-e,n=await Po(t,r,e),o=Wt(n);for(let t=n.length-w;t>=0;t--)Ji(o,t)==c&&(yield[o,r,n,t,r+t])}function Li(t,e,r){return{offset:r,buffer:new Uint8Array(t.subarray(e,e+w)).buffer}}async function Wi(r,n,o,a,i,c,u){const f=$i(n,a+10),w=Ji(n,a+12),p=Ji(n,a+16);if(f==e||w==t||p==t)return await Zi(r,n,o,i-d,c,u)==l?2:0;if(!f&&!w)return 1;const h=$i(n,a+6);for(const t of[i-w,Ci(r,h)+p])if(await Zi(r,n,o,t,c,u)==s)return 2;return 0}async function Zi(t,e,r,n,o,a){return n<0||n+4>o?I:n>=r?Ji(e,n-r):a.Ot>0?(a.Ot--,Ji(Wt(await Po(t,n,4)),0)):I}function Vi(t,e,r){t?Hi(r):Bo(e,r)}function Hi(t){const e=new Error(Ma);throw e.reason=t,e}function Gi(t,e,r){return e[r]===I?t.options[r]:e[r]}function qi(t,e,r){return lt(Gi(t,e,r))}function Yi(t){const r=(4294901760&t)>>16,n=t&e,o=new Date(1980+((65024&r)>>9),((480&r)>>5)-1,31&r,(63488&n)>>11,(2016&n)>>5,2*(31&n),0);return o<O?O:o}function Ki(t){return new Date(Number(t/BigInt(1e4)-BigInt(116444736e5)))}function Xi(t,e){return t.getUint8(e)}function $i(t,e){return t.getUint16(e,!0)}function Ji(t,e){return t.getUint32(e,!0)}function Qi(t,e){const r=t.getBigUint64(e,!0);if(r>di)throw new Error(La);return Number(r)}var ts=Object.freeze({__proto__:null,ERR_AMBIGUOUS_ARCHIVE:Ma,ERR_BAD_FORMAT:xa,ERR_CENTRAL_DIRECTORY_NOT_FOUND:Fa,ERR_CODEC_OUT_OF_MEMORY:yr,ERR_ENCRYPTED:Ua,ERR_ENCRYPTED_CENTRAL_DIRECTORY:Na,ERR_ENTRY_DATA_OUT_OF_BOUNDS:va,ERR_EOCDR_LOCATOR_ZIP64_NOT_FOUND:Da,ERR_EOCDR_NOT_FOUND:za,ERR_EXTRAFIELD_ZIP64_NOT_FOUND:Ia,ERR_INVALID_AUTHENTICATION_CODE:Se,ERR_INVALID_COMPRESSED_DATA:mr,ERR_INVALID_CRC32:br,ERR_INVALID_FILENAME_VALIDATION:ja,ERR_INVALID_MAX_APPENDED_DATA_SIZE:Ba,ERR_INVALID_PASSWORD:Ee,ERR_INVALID_STRICTNESS:Pa,ERR_INVALID_UNCOMPRESSED_SIZE:hr,ERR_LOCAL_FILE_HEADER_NOT_FOUND:Oa,ERR_OVERLAPPING_ENTRY:ka,ERR_SPLIT_ZIP_FILE:Ca,ERR_UNSAFE_FILENAME:_a,ERR_UNSUPPORTED_COMPRESSION:ar,ERR_UNSUPPORTED_ENCRYPTION:Ta,ERR_UNSUPPORTED_UINT64:La,ERR_WORKER_STARTUP_TIMEOUT:qr,WARNING_APPENDED_DATA:Ya,WARNING_COMPRESSED_PATCHED_DATA:Va,WARNING_DUPLICATE_FILENAME:ti,WARNING_MALFORMED_EXTRA_FIELD:Ha,WARNING_MISMATCHED_CENTRAL_DIRECTORY_OFFSET:Ja,WARNING_MISMATCHED_LOCAL_FILE_HEADER_BIT_FLAG:oi,WARNING_MISMATCHED_LOCAL_FILE_HEADER_COMPRESSION_METHOD:ai,WARNING_MISMATCHED_LOCAL_FILE_HEADER_CRC32_OR_SIZES:ii,WARNING_MISMATCHED_LOCAL_FILE_HEADER_FILENAME:ni,WARNING_MISMATCHED_ZIP64_END_OF_CENTRAL_DIRECTORY:ei,WARNING_MISSING_ZIP64_EXTRA_FIELD:Qa,WARNING_MULTIPLE_END_OF_CENTRAL_DIRECTORY:ri,WARNING_PREPENDED_CENTRAL_DIRECTORY:Xa,WARNING_PREPENDED_DATA:Ka,WARNING_TRAILING_CENTRAL_DIRECTORY_DATA:$a,WARNING_UNKNOWN_VERSION:Za,WARNING_UNKNOWN_ZIP64_EXTENSIBLE_DATA:Ga,WARNING_UNSORTED_CENTRAL_DIRECTORY:Wa,WARNING_WRAPPED_ENTRIES_COUNT:qa,ZipReader:pi,ZipReaderStream:hi,isZipFile:mi});const es="File already exists",rs="Zip file comment exceeds 64KB",ns="Invalid zip file comment (must be a Uint8Array)",os="File entry comment exceeds 64KB",as="Invalid file entry comment (must be a string)",is="Invalid date (must be a valid Date instance)",ss="File entry name exceeds 64KB",cs="Version exceeds 65535",us="The strength must equal 1, 2, or 3",ls="Encryption is not supported in USDZ files",fs="Split zip files are not supported in USDZ files",ws="Encryption is not supported when the 'passThrough' option is set to true (use 'compressed' instead)",ds="Invalid extra field (must be a Map)",ps="Invalid extra field type (must be integer 0..65535)",hs="Invalid extra field data (must be a Uint8Array)",ms="Extra field data exceeds 64KB",ys=-2147483648,bs=2147483647,Es=BigInt(0),Ss=BigInt("0x7fffffffffffffff"),gs="Zip64 is not supported (set the 'zip64' option to 'true')",As="Undefined uncompressed size",Rs="Undefined compression method",xs="Undefined CRC32",zs="Undetermined size",Ds="Undefined reader",Fs="Invalid reader (must be a Reader instance, a ReadableStream instance, or an object with a 'readable' property)",Os="Zip file not empty",Is="Invalid uid (must be integer 0..2^32-1)",Us="Invalid gid (must be integer 0..2^32-1)",Ts="Invalid UNIX mode (must be integer 0..65535)",Cs="Invalid unixExtraFieldType (must be 'infozip' or 'unix')",ks="uid/gid must be 0..65535 for unixExtraFieldType 'unix' (use 'infozip' for larger ids)",vs="Invalid msdosAttributesRaw (must be integer 0..255)",Ms="Invalid msdosAttributes (must be an object with boolean flags)",Ns="Invalid level (must be integer 0..9)",_s="Signature data exceeds 64KB",Ps="Invalid entry option (must be an entry returned by ZipReader#getEntries())",js="The last modification date of an entry encrypted with ZipCrypto cannot be changed when passThrough is set",Bs="compression unavailable",Ls="clamped last modification date",Ws=new Uint8Array([7,0,2,0,65,69,3,0,0]),Zs="infozip",Vs="unix",Hs=[8,9,5,3];let Gs=0;const qs=[];class Ys{constructor(t,e={}){t=new vo(t);const{availableSize:r=U,maxSize:n=U}=t,o=r>0&&r!==U&&n>0&&n!==U;if(o&&e[K])throw new Error(fs);Object.assign(this,{writer:t,It:o,options:e,Ut:new Map,Tt:new Set,offset:e[Y]===I?t.size||t.writable.size||0:e[Y],Ct:e[Y]===I?0:e[Y]-(t.size||t.writable.size||0),kt:new Set,vt:[],warnings:[],Mt:0,Nt:0,_t:I,Pt:!1})}prependZip(t){return Js(this,async function(t,e){if(t.Tt.size)throw new Error(Os);await t.jt(e)}(this,t))}appendZip(t,e={}){return Js(this,this.jt(t,e))}async jt(t,e={}){const r=this,{kt:n,Tt:a,Ut:i}=r,s=lt(e.filter);for(;n.size;)await Promise.allSettled(Array.from(n));let c;const u=new Promise(t=>c=t);n.add(u);const l=[];let f;try{t=new ko(t),await No(t),t.size!==I&&t.readUint8Array||(t=new no(await tr(t.readable)),await No(t));const{ZipReader:e}=await Promise.resolve().then(function(){return ts}),n=new e(t),c=await n.getEntries(),u=[];for(const t of c)s&&!await s(t)||u.push(t);await n.close(),await No(r.writer);const{directoryOffset:w}=n;u.forEach(({filename:t})=>{if(a.has(t))throw new Error(es);a.add(t),l.push(t)}),r.Bt=!0;const{Lt:d}=r;r.Lt=new Promise(t=>f=()=>{r.Bt=!1,t()}),await d,r.It&&(delete r.It,await async function(t){return Wt(await Po(t,0,4)).getUint32(0,!0)==o}(t)||(await Rc(r.writer,gc()),r.offset+=4));const p=await async function(t,e,r,n,o,a){const{writer:i}=t,s=new Map;if(i.closeDisk||a){const c=Array.from(r).sort((t,r)=>Sc(e,t)-Sc(e,r)),u=function(t,e,r){const n=new Array(e.length);let o=r;for(let r=e.length-1;r>=0;r--){const a=Sc(t,e[r]),i=e[r+1];i&&Sc(t,i)>a&&(o=Sc(t,i)),n[r]=o}return n}(e,c,o),l=new Set(n);let f,w=0;for(let r=0;r<c.length;r++){const n=c[r];if(l.has(n)){const o=Sc(e,n);o<w?s.set(n,f):(a||await bc(t,e,w,o-w),i.closeDisk&&hc(i,await Ec(e,o))&&await i.closeDisk(),f={offset:mc(t,i),diskNumberStart:dc(i)},s.set(n,f),await bc(t,e,o,u[r]-o),w=u[r])}}a||await bc(t,e,w,o-w)}else{const n=t.offset;await bc(t,e,0,o),r.forEach(t=>s.set(t,{offset:n+Sc(e,t),diskNumberStart:0}))}return s}(r,t,c,u,w,Boolean(s));u.forEach(t=>{const{version:e,rawLastModDate:r,rawFilename:n,bitFlag:o,encrypted:a,uncompressedSize:s,compressedSize:c,extraFieldZip64:u}=t;let{compressionMethod:l,rawExtraField:f}=t;const{level:w,languageEncodingFlag:d,dataDescriptor:h}=o;f=yc(f||N),t.extraFieldAES&&(l=99);const m=jc(f),y=Boolean(u)&&u.uncompressedSize!==I,b=Boolean(u)&&u.compressedSize!==I,E=-7&Wc(w,d,h,a,l)|w<<1,{Wt:S,Zt:g}=Bc({version:e,bitFlag:E,compressionMethod:l,uncompressedSize:s,compressedSize:c,rawLastModDate:r,rawFilename:n,Vt:b,Ht:y,extraFieldLength:m}),{crc32:A}=t;A!==I&&Nc(g,10,A);const{offset:R,diskNumberStart:x}=p.get(t);Object.assign(t,{Gt:!0,Ht:y,Vt:b,offset:R,diskNumberStart:x,qt:!1,Yt:N,Kt:N,Xt:N,$t:N,Jt:N,Qt:N,rawExtraField:f,te:N,Wt:S,Zt:g}),i.set(t.filename,t)})}catch(t){throw l.forEach(t=>a.delete(t)),t}finally{c(),n.delete(u),f&&f()}}add(e="",n,o={}){const a=this,{kt:i}=a,s=async function(e,n,o,a){const i=(a=Object.assign({},a))[J];if(i!==I){const{ee:t,re:r}=ec(i,pt(Oc(e,a,B)),Oc(e,a,Ko));delete a[J],a=Object.assign(t,r,a)}if(Oc(e,a,fa)&&!n.endsWith(z)&&(n+=z),e.Tt.has(n))throw new Error(es);e.Tt.add(n),Gs<Tt().maxWorkers?Gs++:await new Promise(t=>qs.push(t));try{return await async function(e,n,o,a){const i=rc(e,n,a);({name:n}=i);const s=nc(e,n,a),{comment:c}=s,u=a[ha];e.Ut.set(n,I);const l=e._t,f={};let w,d;s.ne.keepOrder&&(f.oe=new Promise(t=>w=t)),e._t=f;try{const{ne:c}=s;0==c.level||c.compressionMethod!==I||c.ae||await Jr(Tt())||(c.level=0,Bo(e.warnings,Bs,n));const u=await async function(t,e,{ne:r},n){if(r.ae&&!e&&!Oc(t,n,fa))throw new Error(Ds);let o;if(e){if(e=new ko(e),await No(e),!e.readUint8Array&&!e.readable)throw new Error(Fs);({size:o}=e)}return Object.assign({reader:e},ac(t,Boolean(e),o,r,n))}(e,o,s,a);({reader:o}=u);const p=pc(e.writer),h=dc(e.writer);let m=a.crc32===I?a[pa]:a.crc32;const y=u.ne.encrypted&&!c.zipCrypto;if(c.ae&&!c.ie&&y&&(m=I),c.ae&&o&&!y&&m===I)throw new Error(xs);const b=sc(a=Object.assign({},a,i.ne,s.ne,u.ne,{signature:a[pa],crc32:m,offset:e.offset-p,diskNumberStart:h,[K]:e.options[K]}));b.se&&Bo(e.warnings,Ls,n);const E=lc(a),S=jc(b.ce,E.ue);d=await async function(e,n,o,a,i){const{Ut:s,writer:c}=e,{keepOrder:u,dataDescriptor:l,le:f,signal:w}=i,{fe:d,Ft:p,we:h,de:m}=a,y=e.options[K];let b,E,S,g,A,R,x,z=p,F=0;const O=u&&h?h.oe:I;s.set(n,z);try{i.bufferedWrite||!u||e.Bt||e.Mt||e.Nt||!l&&!f?(b=!0,e.Mt++,x=i.createTempStream?await i.createTempStream():new TransformStream(I,I,{highWaterMark:U}),x.size=0,await No(c)):(E=!0,e.Nt++,x=c,await O,await T()),await No(x);const p=pc(c);e.It&&!b&&await Ac(e,c),y&&!b&&cc(a,e.offset-p);const{ce:h}=d;b||await C();const m=dc(c),S=mc(e,c);if(z.diskNumberStart=m,b||(A=!0,R=c.size,await Rc(x,h)),z=await async function(e,n,{diskNumberStart:o,oe:a},i,s,c){const{fe:u,pe:l,he:f}=i,{Wt:w,Zt:d,lastModDate:p,rawLastModDate:h,encrypted:m,compressed:y,version:b,compressionMethod:E,Yt:S,me:g,Xt:A,ye:R,be:x,$t:z,Jt:D,Qt:F,Kt:O}=u,{ue:U}=l,{rawFilename:T,lastAccessDate:C,creationDate:k,password:v,rawPassword:M,level:N,useUnicodeFileNames:_,zip64:P,Gt:j,Ht:B,Vt:L,zipCrypto:W,dataDescriptor:Z,directory:V,executable:H,versionMadeBy:G,rawComment:q,rawExtraField:Y,te:K,useWebWorkers:X,onstart:$,onprogress:J,onend:Q,signal:tt,encryptionStrength:et,extendedTimestamp:rt,msDosCompatible:nt,internalFileAttributes:ot,externalFileAttributes:at,uid:it,gid:st,unixMode:ct,symlink:ut,setuid:lt,setgid:ft,sticky:dt,unixExternalUpper:pt,msdosAttributesRaw:ht,msdosAttributes:mt,useCompressionStream:yt,ae:bt,ie:Et,format:St,codecURI:gt}=c,At={oe:a,versionMadeBy:G,zip64:P,Gt:j,directory:Boolean(V),executable:Boolean(H),filenameUTF8:Boolean(_),rawFilename:T,commentUTF8:Boolean(_),rawComment:q,Yt:S,me:g,Xt:A,$t:z,Jt:D,Qt:F,Kt:O,rawExtraField:Y,te:K,extendedTimestamp:rt,msDosCompatible:nt,internalFileAttributes:ot,externalFileAttributes:at,diskNumberStart:o,uid:it,gid:st,unixMode:ct,symlink:Boolean(ut),setuid:lt,setgid:ft,sticky:dt,unixExternalUpper:pt,msdosAttributesRaw:ht,msdosAttributes:mt};let{crc32:Rt,uncompressedSize:xt}=c,zt=0;bt||(xt=0);const{writable:Dt}=n;if(e){const o=e.size,a=Qe(jo(e,{size:o})),i={options:{codecType:Zr,inputSize:o,level:N,rawPassword:M,password:v,encryptionStrength:et,zipCrypto:m&&W,passwordVerification:m&&W&&h>>8&r,computeCrc32:!bt,compressed:y&&!bt,encrypted:m&&!Et,useWebWorkers:X,useCompressionStream:yt,format:St,codecURI:gt,compressionMethod:E},config:s,F:{signal:tt,size:o,onstart:$,onprogress:J,onend:Q}};try{const e=await zn({readable:a,writable:Dt},i);if(zt=e.outputSize,n.size+=zt,wt(tt),bt||(xt=e.inputSize,m&&!W||(Rt=e.crc32)),!L&&zt>=t||!B&&xt>=t)throw new Error(gs)}catch(t){const{outputSize:e}=i;throw e!==I?n.size+=e:Zt(t)&&t.outputSize!==I&&(n.size+=t.outputSize),t}}return function({crc32:t,compressedSize:e,uncompressedSize:r,fe:n,pe:o},{zip64:a,zipCrypto:i,ae:s,dataDescriptor:c}){const{Zt:u,encrypted:l}=n,{Ee:f,Se:w}=o;l&&!i&&!s||t===I||(Nc(u,10,t),c&&Nc(f,w,t)),a?c&&(_c(f,w+4,BigInt(e)),_c(f,w+12,BigInt(r))):(Nc(u,14,e),Nc(u,18,r),c&&(Nc(f,w+4,e),Nc(f,w+8,r)))}({crc32:Rt,compressedSize:zt,uncompressedSize:xt,fe:u,pe:l},c),Z&&await Rc(n,U),Object.assign(At,{uncompressedSize:xt,compressedSize:zt,lastModDate:p,rawLastModDate:h,creationDate:k,lastAccessDate:C,encrypted:Boolean(m),zipCrypto:Boolean(W),size:f+zt,compressionMethod:E,version:b,Wt:w,Zt:d,signature:Rt,crc32:!m||W||bt?Rt:I,ye:R,be:x,Ht:B,Vt:L}),At}(o,x,z,a,Tt(),i),b||(A=!1),s.set(n,z),z.filename=n,b){if(await Promise.all([x.writable.getWriter().close(),O]),await T(),e.It&&await Ac(e,c),g=!0,R=c.size,await C(),z.diskNumberStart=dc(c),z.offset=mc(e,c),y){const t=a.he;cc(a,e.offset-pc(c)),z.size+=a.he-t}!function({rawFilename:t,encrypted:e,zip64:r,me:n,crc32:o,compressedSize:a,uncompressedSize:i,Ht:s,Vt:c},u,{dataDescriptor:l,ae:f}){if(l||((!e||f&&o!==I)&&Nc(u,14,o),c||Nc(u,18,a),s||Nc(u,22,i)),r&&n){const e=D+jc(t)+4;_c(u,e,BigInt(i)),_c(u,e+8,BigInt(a))}}(z,d.ge,i),await Rc(c,d.ce),await xc(x.readable,c,w,t=>F+=t),c.size+=x.size,g=!1}else z.diskNumberStart=m,z.offset=S;return e.offset+=z.size,z}catch(t){if(g||A){if(e.hasCorruptedEntries=!0,t)try{t.corruptedEntry=!0}catch{}e.offset+=c.size-R,b&&(e.offset+=F)}throw s.delete(n),t}finally{if(b&&e.Mt--,E&&e.Nt--,m&&m(O),S&&S(),b&&x&&x.dispose)try{await x.dispose()}catch{}}async function T(){e.Bt=!0;const{Lt:t}=e;e.Lt=new Promise(t=>S=()=>{e.Bt=!1,t()}),await t}async function C(){hc(c,jc(d.ce))&&await c.closeDisk()}}(e,n,o,{fe:b,pe:E,he:S,Ft:f,we:l,de:w},a)}catch(t){throw e.Ut.delete(n),t}finally{w&&w(l&&l.oe)}return Object.assign(d,{name:n,comment:c,extraField:u}),new ga(d)}(e,n,o,a)}catch(t){throw e.Tt.delete(n),t}finally{const t=qs.shift();t?t():Gs--}}(a,e,n,o);i.add(s);const c=()=>i.delete(s);return Promise.prototype.then.call(s,c,c),Js(a,s)}remove(t){const{Tt:e,Ut:r}=this;if(typeof t==v&&(t=r.get(t)),t&&t.filename!==I){const{filename:n}=t;if(e.has(n)&&r.has(n))return e.delete(n),r.delete(n),!0}return!1}async close(r=N,n={}){const o=this,{kt:a,writer:d}=this,{writable:p}=d;if(o.Pt)return $s(d);if(!(r instanceof Uint8Array))throw new Error(ns);if(jc(r)>e)throw new Error(rs);for(;a.size;)await Promise.allSettled(Array.from(a));await Promise.allSettled(o.vt.map(t=>t.Ae));const h=o.vt.filter(t=>t.Re&&!t.xe);if(h.length){const t=h.map(t=>t.error);h.forEach(t=>t.xe=!0);const[e]=t;try{e.entryErrors=t}catch{}throw e}return await async function(r,n,o){const{ze:a,De:d}=fc(r.Ut),{Fe:p,Oe:h,Ie:m}=await async function(r,n,o){const{Ut:a,writer:i}=r,c=new Uint8Array(n);await No(i);let u=0,l=0,w=dc(i),d=pc(i),p=0;for(const[r,n]of Array.from(a.values()).entries()){const{offset:h,rawFilename:m,Yt:y,Kt:b,Xt:E,$t:S,Qt:g,rawExtraField:A,te:R,rawComment:x,versionMadeBy:z,Wt:D,Zt:F,Ht:O,Vt:I,qt:U,Ue:T,internalFileAttributes:C,externalFileAttributes:k,diskNumberStart:v,uncompressedSize:M,compressedSize:N}=n,_=jc(y,b,E,S,g,A,R),P=f+jc(m,x)+_;hc(i,u+P-l)&&(await Rc(i,c.slice(l,u)),l=u,p=0,await i.closeDisk()),0==r&&(w=dc(i),d=pc(i)),O||Nc(F,18,M),I||Nc(F,14,N),(T||U)&&n.version<45&&Mc(F,0,45);const j=wc(P);if(j.Te(s),j.Ce(z),j.ke(D.subarray(0,24)),j.Ce(_),j.Ce(jc(x)),j.Ce(U?e:v),j.Ce(C),j.Te(k),j.Te(T?t:h),j.ke(m),j.ke(y),j.ke(b),j.ke(E),j.ke(S),j.ke(g),j.ke(A),j.ke(R),j.ke(x),Pc(c,j.ct,u),u+=P,p++,o.onprogress)try{await o.onprogress(r+1,a.size,new ga(n))}catch{}}return await Rc(i,l?c.slice(l):c),{Fe:{diskNumber:w,diskOffset:d},Oe:{diskNumber:dc(i),ve:p},Ie:c}}(r,a,o),y=await async function(t,r,n){const o=Uc(t,n,$);if(o){const n=await o(r),a=jc(n);if(a>e)throw new Error(_s);const s=wc(6+a);s.Te(i),s.Ce(a),s.ke(n);const{writer:c}=t;return hc(c,jc(s.ct))&&await c.closeDisk(),await Rc(c,s.ct),6+a}return 0}(r,m,o);await async function(r,n,o,a){const{writer:i}=r,{Fe:s,Oe:f,Me:d,De:p}=a;let{ze:h}=a,m=r.Ut.size,y=s.diskNumber,b=mc(r,s);const E=jc(n);if(E>e)throw new Error(rs);let S=Oc(r,o,ia),g=dc(i);if(hc(i,(S?98:w)+E)&&g++,b>=t||h>=t||m>=e||g>=e){if(!1===S)throw new Error(gs);S=!0}else S===I&&p&&(S=!0);const A=wc(S?98:w);hc(i,jc(A.ct)+E)&&await i.closeDisk(),g=dc(i);let R=g==f.diskNumber?f.ve:0;S&&(A.Te(u),A.Ne(44),A.Ce(45),A.Ce(45),A.Te(g),A.Te(y),A.Ne(R),A.Ne(m),A.Ne(h),A.Ne(b),A.Te(l),A.Te(g),A.Ne(BigInt(mc(r,i))+BigInt(h)+BigInt(d)),A.Te(g+1),Oc(r,o,"supportZip64SplitFile",!0)&&(g=e,y=e),R=e,m=e,b=t,h=t),A.Te(c),A.Ce(g),A.Ce(y),A.Ce(R),A.Ce(m),A.Te(h),A.Te(b),A.Ce(E),await Rc(i,A.ct),E&&await Rc(i,n)}(r,n,o,{Fe:p,Oe:h,ze:a,Me:y,De:d})}(o,r,n),o.Pt=!0,!Mo(d)&&Oc(o,n,V)||await p.getWriter().close(),$s(d)}[_](){return this.close()}}class Ks{constructor(t={}){const{readable:e,writable:r}=new TransformStream;this.readable=e,this.zipWriter=new Ys(r,t),this.kt=new Set}transform(t){const e=this.zipWriter;let r;const{readable:n,writable:o}=new TransformStream({start(t){r=t},flush:()=>{!async function(){try{await e.close()}catch(t){await Qs(e,t)}}()}});return tc(this,this.zipWriter.add(t,n),t=>r.error(t)),{readable:this.readable,writable:o}}writable(t){let e;const{readable:r,writable:n}=new TransformStream({start(t){e=t}});return tc(this,this.zipWriter.add(t,r),t=>e.error(t)),n}async close(t,e={}){const{zipWriter:r}=this,n=(await Promise.allSettled(Array.from(this.kt))).filter(t=>"rejected"==t.status).map(t=>t.reason);if(n.length){const[t]=n;try{t.entryErrors=n}catch{}throw await Qs(r,t),t}try{return await r.close(t,e)}catch(t){throw await Qs(r,t),t}}}class Xs extends Promise{then(t,e){const{_e:r}=this;return r&&(r.xe=!0),super.then(t,e)}}function $s(t){return t.getData?t.getData():t.writable}function Js(t,e){const r=new Xs((t,r)=>Promise.prototype.then.call(e,t,r)),n={};return r._e=n,n.Ae=Promise.prototype.then.call(r,I,t=>Object.assign(n,{Re:!0,error:t})),t.vt.push(n),r}async function Qs(t,e){try{await t.writer.writable.abort(e)}catch{}}function tc(t,e,r){t.kt.add(e),e.catch(t=>{try{r(t)}catch{}})}function ec(t,e,n){if(null===t||typeof t!=k||Array.isArray(t))throw new Error(Ps);const{externalFileAttributes:o,versionMadeBy:a,comment:i,lastModDate:s,rawLastModDate:c,creationDate:u,lastAccessDate:l,uncompressedSize:f,encrypted:w,zipCrypto:d,crc32:p,compressionMethod:h,extraFieldAES:m,extraFieldUnix:y,internalFileAttributes:b,extraField:E,bitFlag:S,directory:g,uid:A,gid:R}=t,x={externalFileAttributes:o,versionMadeBy:a,comment:i,lastModDate:s,creationDate:u,lastAccessDate:l,internalFileAttributes:b,directory:g};S&&S.languageEncodingFlag&&(x[G]=!0);const z=function(t){if(t){const e=new Map;if(t.forEach((t,r)=>{Aa.has(r)||e.set(r,t.data)}),e.size)return e}}(E);z&&(x[ha]=z),A===I&&R===I||Object.assign(x,{uid:A,gid:R,unixExtraFieldType:y?Vs:Zs});const D={};if(e&&!g)if(Object.assign(D,{uncompressedSize:f,crc32:p,compressionMethod:h}),e!==ot&&Object.assign(D,{encrypted:w,zipCrypto:d,encryptionStrength:m?m.strength:I}),S&&(D.dataDescriptor=S.dataDescriptor,D[H]=Hs[S.level]),n===I)D.rawLastModDate=c;else if(e!==ot&&d&&(!S||S.dataDescriptor)&&n instanceof Date&&function(t){let e=new Date(2e3*Math.ceil(Math.floor(t.getTime()/1e3)/2));return e<O?e=O:e>F&&(e=F),(e.getHours()<<3|e.getMinutes()>>3)&r}(n)!=(c>>>8&r))throw new Error(js);return{ee:x,re:D}}function rc(n,o,a){let i=Oc(n,a,aa),s=Oc(n,a,ua,i?20:768);const c=Oc(n,a,wa),u=Tc(n,a,"uid"),l=Tc(n,a,"gid");let f=Tc(n,a,ma),w=Oc(n,a,"unixExtraFieldType"),d=Oc(n,a,ya),p=Oc(n,a,ba),h=Oc(n,a,Ea);if(mt(u,t,Is),mt(l,t,Us),mt(f,e,Ts),w!==I&&w!==Zs&&w!==Vs)throw new Error(Cs);if(w===Vs&&(u!==I&&u>e||l!==I&&l>e))throw new Error(ks);w!==I||u===I&&l===I||(w=Zs);let m=Tc(n,a,na),y=Oc(n,a,oa);const b=m!==I||y!==I;if(u!==I||l!==I||f!==I||w||c?(i=!1,s=s&r|768):b&&(i=!0,s&=r),mt(m,r,vs),y&&(typeof y!==k||Array.isArray(y)))throw new Error(Ms);if(s>e)throw new Error(cs);let E=Oc(n,a,ra);const S=E!==I;S||(E=0),!a[fa]&&o.endsWith(z)&&(a[fa]=!0);const D=Oc(n,a,fa);if(D?(o.endsWith(z)||(o+=z),S||(E=16,i||(E|=16877<<16))):i||S||(E=c?493<<16:27525120),!i){const t=f!==I||Boolean(d||p||h);f=f===I?E>>16&e:f&e,d?f|=R:d=Boolean(f&R),p?f|=x:p=Boolean(f&x),h?f|=512:h=Boolean(512&f),S&&!t||(D?f=-61441&f|A:f&g||(f|=32768),E=(f&e)<<16|E&e)}({msdosAttributesRaw:m,msdosAttributes:y}=function(t,e){if(t!==I)t&=r;else if(e!==I){const{readOnly:n,hidden:o,system:a,directory:i,archive:s}=e;let c=0;n&&(c|=1),o&&(c|=2),a&&(c|=4),i&&(c|=16),s&&(c|=32),t=c&r}return e===I&&(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}}(m,y)),b&&(E=E&t|m&r);const F=E>>16&e,O=f!==I&&40960==(f&g);return{name:o,ne:{versionMadeBy:s,msDosCompatible:Boolean(i),externalFileAttributes:E,unixExternalUpper:F,uid:u,gid:l,unixMode:f,unixExtraFieldType:w,symlink:O,setuid:d,setgid:p,sticky:h,msdosAttributesRaw:m,msdosAttributes:y}}}function nc(t,r,n){const o=Uc(t,n,"encodeText")||ee;let a=o(r,Q);if(a===I&&(a=ee(r)),jc(a)>e)throw new Error(ss);const i=n[Zo]||"";if(typeof i!=v)throw new Error(as);let s=o(i,tt);if(s===I&&(s=ee(i)),jc(s)>e)throw new Error(os);const c=Oc(t,n,ca);if(c!==I&&c>e)throw new Error(cs);const u=Ic(t,n,Ko,new Date),l=Oc(t,n,Xo),f=Ic(t,n,$o),w=Ic(t,n,Qo),d=Oc(t,n,ea,0),p=pt(Oc(t,n,B)),h=Boolean(p),m=!0===p;let y=Oc(t,n,P),b=Oc(t,n,j);dt(y,b),y=y&&y.length?y:I,b=b&&b.length?b:I;const E=Tc(t,n,"encryptionStrength",3),S=Oc(t,n,la),g=Oc(t,n,"extendedTimestamp",!0),A=Oc(t,n,"ntfsTimestamp"),R=Oc(t,n,"keepOrder",!0),x=Oc(t,n,W),z=Oc(t,n,"bufferedWrite"),D=Uc(t,n,"createTempStream"),F=Oc(t,n,"dataDescriptorSignature",!0),O=ft(Oc(t,n,L));wt(O);const U=Oc(t,n,G,!Lc(a)||!Lc(s)),T=Oc(t,n,da),C=h||T===I?I:fr(T);if(!h&&T!==I&&0!==T&&8!==T&&!C)throw new Error(ar);let k=Tc(t,n,H);if(mt(k,9,Ns),t.options[K]){if(y!==I||b!==I)throw new Error(ls);k===I&&T===I&&(k=0)}h&&(k=yt(n[H]));let M=Oc(t,n,Z),N=Oc(t,n,q);z&&N===I&&(N=!1),(N===I||S&&!m)&&(N=!0),k!==I&&6!=k&&(M=!1);const _=Oc(t,n,ia);if(!(S||y===I&&b===I||Number.isInteger(E)&&E>=1&&E<=3))throw new Error(us);const V=oc(n[ha]),Y=oc(n.localExtraField),X=oc(n.centralExtraField);return{comment:i,ne:{rawFilename:a,rawComment:s,version:c,lastModDate:u,rawLastModDate:l,lastAccessDate:f,creationDate:w,internalFileAttributes:d,ae:h,ie:m,password:y,rawPassword:b,encryptionStrength:E,zipCrypto:S,extendedTimestamp:g,ntfsTimestamp:A,keepOrder:R,useWebWorkers:x,bufferedWrite:z,createTempStream:D,dataDescriptorSignature:F,signal:O,useUnicodeFileNames:U,compressionMethod:T,format:C?C.format:I,codecURI:C?C.codecURI:I,Pe:C?C.versionNeeded:I,level:k,useCompressionStream:M,dataDescriptor:N,zip64:_,rawExtraField:V,je:Y,te:X}}}function oc(t){if(!t)return N;if(!(t instanceof Map))throw new Error(ds);let r=0,n=0;t.forEach((t,n)=>{if(ht(n,e,ps),!(t instanceof Uint8Array))throw new Error(hs);if(jc(t)>e)throw new Error(ms);r+=4+jc(t)});const o=new Uint8Array(r),a=Wt(o);return t.forEach((t,e)=>{Mc(a,n,e),Mc(a,n+2,jc(t)),Pc(o,t,n+4),n+=4+jc(t)}),o}function ac(e,r,n,o,a){const{ae:i,ie:s,zipCrypto:c,password:u,rawPassword:l,encryptionStrength:f}=o;let{dataDescriptor:w,zip64:d,level:p,compressionMethod:h}=o,m=0,y=0,b=!1;if(i&&r){if(y=a[Ho],y===I)throw new Error(As);if(h===I)throw new Error(Rs)}const E=!0===d,S=Oc(e,a,sa);if(r&&s&&!S&&jc(u,l))throw new Error(ws);const g=r&&(Boolean(u&&jc(u)||l&&jc(l))||s&&S);r||(p=0,h=0);const A=Ra(g,c,f);r&&(i?(a.uncompressedSize=y,m=n===I?Cc(y)+A:n+(s?0:A)):n===I?(w=!0,(d||d===I)&&(d=b=!0,m=4294967296)):(a.uncompressedSize=y=n,m=(kc(h,p)?Cc(y):y)+A));const R=!(g||r&&(0!==n||i)||kc(h,p));R&&Oc(e,a,q)===I&&(w=!1);const x=E||b||y>=t,z=E||m>=t;if(x||z){if(!1===d)throw new Error(gs);d=!0}return d=d||!1,{Be:m,ne:{dataDescriptor:w,le:R,zip64:d,Gt:E,Le:b,Ht:x,Vt:z,uncompressedSize:y,level:p,compressionMethod:h,encrypted:g}}}function ic(e,r,n){const o=e.slice().sort((t,e)=>n?e-t:t-e);let a=r,i=0;for(const e of o){if(a>=t)break;a+=e,i++}return i}function sc(t){const{rawFilename:r,lastModDate:o,rawLastModDate:a,lastAccessDate:i,creationDate:s,level:c,zip64:u,zipCrypto:l,useUnicodeFileNames:f,dataDescriptor:w,directory:d,rawExtraField:p,je:y,encryptionStrength:S,extendedTimestamp:g,ntfsTimestamp:A,ae:R,encrypted:x,Ht:z,Vt:U,uncompressedSize:T,Le:C,crc32:k}=t;let{version:v,compressionMethod:M}=t;const _=!d&&kc(M,c);let P;const j=R||!_,B=u&&(t.bufferedWrite||!w||!z&&!U||j&&!C),L=B||u&&w&&(z||U);if(u&&(z||U)){const t=20,e=wc(t);if(e.Ce(1),e.Ce(t-4),P=e.ct,B&&(e.Ne(T),j)){const t=Ra(x,l,S);e.Ne(R?0:T+t)}}else P=N;let W,Z,V,H,G;if(x&&!l){const t=wc(jc(Ws)+2);t.Ce(h),t.ke(Ws),W=t.ct,W[8]=S}else W=N;if(g){const t=Dc(o),e=(q=t)>=ys&&q<=bs;if(e){const e=9+(i?4:0)+(s?4:0),r=wc(e);H=1+(i?2:0)+(s?4:0),G=t,r.Ce(m),r.Ce(e-4),r.We(H),r.Te(t),i&&r.Te(Fc(Dc(i))),s&&r.Te(Fc(Dc(s))),V=r.ct}else V=N;if(A===I?!e||Boolean(i||s):A)try{const t=zc(o),e=wc(36);e.Ce(10),e.Ce(32),e.Ze(4),e.Ce(1),e.Ce(24),e.Ne(t),e.Ne(i?zc(i):t),e.Ne(s?zc(s):t),Z=e.ct}catch{Z=N}else Z=N}else Z=V=N;var q;let Y,X;try{const{uid:r,gid:n,unixExtraFieldType:o}=t;if(o!=Zs||r===I&&n===I)if(o!=Vs||r===I&&n===I)Y=X=N;else{const t=wc(8);t.Ce(E),t.Ce(4),t.Ce((r===I?0:r)&e),t.Ce((n===I?0:n)&e),Y=t.ct;const o=wc(4);o.Ce(E),o.Ce(0),X=o.ct}else{const t=uc(r===I?0:r),e=uc(n===I?0:n),o=3+t.length+e.length,a=wc(4+o);a.Ce(b),a.Ce(o),a.We(1),a.We(t.length),a.ke(t),a.We(e.length),a.ke(e),Y=X=a.ct}}catch{Y=X=N}M===I&&(M=_?8:0),v===I&&(v=0!=M||d||x?20:10);const{Pe:$}=t;_&&$!==I&&(v=v>$?v:$),u&&(v=v>45?v:45),x&&!l&&(v=v>51?v:51,R&&k!==I&&(W[4]=1),Mc(Wt(W),9,M),M=99);const J=L?jc(P):0,Q=J+jc(W,V,Z,Y,p,y);if(Q+(t[K]?67:0)>e)throw new Error(ms);const tt=new Date(2e3*Math.ceil(Math.floor(o.getTime()/1e3)/2)),et=tt<O?O:tt>F?F:tt,rt=jc(V)?new Date(1e3*Dc(o)):jc(Z)?o:et,{Wt:nt,Zt:ot,rawLastModDate:at}=Bc({version:v,bitFlag:Wc(c,f,w,x,M),compressionMethod:M,uncompressedSize:T,lastModDate:et,rawLastModDate:a,rawFilename:r,Vt:U,Ht:z,extraFieldLength:Q}),it=wc(D+jc(r)+Q),st=it.ct,ct=Wt(st);return it.Te(n),it.ke(nt),it.ke(r),L&&it.ke(P),it.ke(W),it.ke(V),it.ke(Z),it.ke(Y),it.ke(p),it.ke(y),w&&(U||Nc(ct,18,0),z||Nc(ct,22,0)),{ce:st,ge:ct,Wt:nt,Zt:ot,lastModDate:rt,se:rt===et&&tt.getTime()!=et.getTime(),rawLastModDate:at,encrypted:x,compressed:_,version:v,compressionMethod:M,ye:H,be:G,Yt:N,me:J,Xt:V,$t:Z,Jt:Y,Qt:X,Kt:W,extraFieldLength:Q}}function cc(t,e){const{fe:r}=t;let{ce:n,extraFieldLength:o}=r,a=64-(e+jc(n))%64;a<4&&(a+=64);const i=new Uint8Array(a),s=Wt(i);Mc(s,0,y),Mc(s,2,a-4);const c=n;r.ce=n=new Uint8Array(jc(c)+a),Pc(n,c),Pc(n,i,jc(c));const u=Wt(n);Mc(u,28,o+a),r.ge=u,t.he+=a}function uc(t){const e=new Uint8Array(4);Wt(e).setUint32(0,t,!0);let r=4;for(;r>1&&0===e[r-1];)r--;return e.subarray(0,r)}function lc({zip64:t,dataDescriptor:e,dataDescriptorSignature:r}){let n,o=N,i=0,s=t?20:12;return r&&(s+=4),e&&(o=new Uint8Array(s),n=Wt(o),r&&(i=4,Nc(n,0,a))),{ue:o,Ee:n,Se:i}}function fc(r){let n=0,o=!1;for(const[,a]of r){const{rawFilename:r,Kt:i,rawComment:s,$t:c,Qt:u,rawExtraField:l,te:w,ye:d,be:p,Gt:h,uncompressedSize:y,compressedSize:b}=a;let{Ht:E,Vt:S}=a;h||(E&&y<t&&(E=a.Ht=!1),S&&b<t&&(S=a.Vt=!1)),o=o||E||S;const g=a.offset>=t,A=a.diskNumberStart>=e;let R,x;if(g||A||E||S){const t=4+(E?8:0)+(S?8:0)+(g?8:0)+(A?4:0),e=wc(t);e.Ce(1),e.Ce(t-4),E&&e.Ne(y),S&&e.Ne(b),g&&e.Ne(a.offset),A&&e.Te(a.diskNumberStart),R=e.ct}else R=N;if(a.Yt=R,a.Ue=g,a.qt=A,p===I)x=N;else{const t=wc(9);t.Ce(m),t.Ce(5),t.We(d),t.Te(p),x=t.ct}a.Xt=x;const z=jc(R,i,c,u,x,l,w);if(z>e)throw new Error(ms);n+=f+jc(r,s)+z}return{ze:n,De:o}}function wc(t){const e=new Uint8Array(t),r=Wt(e);let n=0;return{ct:e,We:t=>{!function(t,e,r){t.setUint8(e,r)}(r,n,t),n+=1},Ce:t=>{Mc(r,n,t),n+=2},Te:t=>{Nc(r,n,t),n+=4},Ne:t=>{_c(r,n,BigInt(t)),n+=8},ke:t=>{Pc(e,t,n),n+=jc(t)},Ze:t=>n+=t}}function dc(t){const{diskNumber:e=0}=t;return e}function pc(t){const{diskOffset:e=0}=t;return e}function hc(t,e){const{availableSize:r=U}=t;return e>r}function mc(t,{diskNumber:e=0,diskOffset:r=0}){return t.offset-r-(e?t.Ct:0)}function yc(t){const e=Wt(t);let r=0;for(;r+4<=jc(t);){const n=4+vc(e,r+2);if(1==vc(e,r))return yc(Bt(t.subarray(0,r),t.subarray(Math.min(r+n,jc(t)))));r+=n}return t}async function bc(t,e,r,n){if(n>0){const{writer:o}=t;let a=0;try{await xc(jo(e,{offset:r,size:n}),o,I,t=>a+=t)}catch(e){t.hasCorruptedEntries=!0;try{e.corruptedEntry=!0}catch{}throw e}finally{o.size+=a,t.offset+=a}}}async function Ec(t,e){const r=await Po(t,e,D);if(jc(r)<D)return D;const n=Wt(r);return D+vc(n,26)+vc(n,28)}function Sc(t,{offset:e,diskNumberStart:r}){return e+(t.ht?t.ht(r):0)}function gc(){const t=new Uint8Array(4);return Nc(Wt(t),0,o),t}async function Ac(t,e){delete t.It,await Rc(e,gc()),t.offset+=4}async function Rc(t,e){const{writable:r}=t,n=r.getWriter();try{await n.ready,t.size+=jc(e),await n.write(e)}finally{n.releaseLock()}}async function xc(t,e,r,n){const o=e.writable.getWriter();try{await t.pipeTo(new WritableStream({async write(t){await o.ready,await o.write(t),n(jc(t))}}),{preventClose:!0,preventAbort:!0,signal:r})}finally{o.releaseLock()}}function zc(t){if(t){const e=(BigInt(t.getTime())+BigInt(116444736e5))*BigInt(1e4);return e<Es?Es:e>Ss?Ss:e}}function Dc(t){return Math.floor(t.getTime()/1e3)}function Fc(t){return Math.min(bs,Math.max(ys,t))}function Oc(t,e,r,n){const o=e[r]===I?t.options[r]:e[r];return o===I?n:o}function Ic(t,e,r,n){const o=Oc(t,e,r,n);if(null===o)return n;if(o!==I&&(typeof o.getTime!=C||Number.isNaN(o.getTime())))throw new Error(is);return o}function Uc(t,e,r){return lt(Oc(t,e,r))}function Tc(t,e,r,n){return yt(Oc(t,e,r,n))}function Cc(t){return t+5*(Math.floor(t/16383)+1)}function kc(t,e){return t===I?e===I||e>0:0!==t}function vc(t,e){return t.getUint16(e,!0)}function Mc(t,e,r){t.setUint16(e,r,!0)}function Nc(t,e,r){t.setUint32(e,r,!0)}function _c(t,e,r){t.setBigUint64(e,r,!0)}function Pc(t,e,r){t.set(e,r)}function jc(...t){let e=0;return t.forEach(t=>t&&(e+=t.length)),e}function Bc({version:e,bitFlag:r,compressionMethod:n,uncompressedSize:o,compressedSize:a,lastModDate:i,rawLastModDate:s,rawFilename:c,Vt:u,Ht:l,extraFieldLength:f}){const w=wc(26),d=w.ct,p=Wt(d);if(w.Ce(e),w.Ce(r),w.Ce(n),s===I){const t=new Uint32Array(1),e=Wt(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 w.Te(s),w.Ze(4),u||a!==I?w.Te(u?t:a):w.Ze(4),l||o!==I?w.Te(l?t:o):w.Ze(4),w.Ce(jc(c)),w.Ce(f),{Wt:d,Zt:p,rawLastModDate:s}}function Lc(t){return t.every(t=>t>=32&&t<=126)}function Wc(t,e,r,n,o){let a=0;return e&&(a|=S),r&&(a|=8),8!=o&&9!=o||(t>=0&&t<=3&&(a|=6),t>3&&t<=5&&(a|=4),9==t&&(a|=2)),n&&(a|=1),a}function Zc(){return"application/octet-stream"}function Vc(){const{CompressionStream:t,DecompressionStream:e,CompressionStreamFallback:r,DecompressionStreamFallback:n}=Tt(),o=[{compressionMethod:0,compression:!0,decompression:!0,registered:!1},{compressionMethod:8,compression:Hc(r,Er)||Hc(t,Er)||Hc(t,gr),decompression:Hc(n,Er)||Hc(e,Er)||Hc(e,gr),registered:!1},{compressionMethod:9,compression:!1,decompression:Hc(n,Sr)||Hc(e,Sr),registered:!1}];for(const t of wr()){const e=dr(t.format);o.push({compressionMethod:t.compressionMethod,compression:e?typeof e.CompressionStream==C:I,decompression:e?typeof e.DecompressionStream==C:I,registered:!0})}return o}function Hc(t,e){if(!t)return!1;const{supportedFormats:r}=t;return r?r.includes(e):Fr(t,e)}const Gc="2.20.0",qc=1048576,Yc=".zip.js-temp";function Kc(t={}){const{thresholdBytes:e=qc,directoryName:r=Yc,getDirectory:n=()=>navigator.storage.getDirectory()}=t;let o;function a(){return o||(o=Promise.resolve(n()).then(t=>t.getDirectoryHandle(r,{create:!0}))),o}return function(){const t=[];let r,n,o,i,s=0,c=!1;const u=new WritableStream({async write(i){c?await o.write(i):(t.push(i),s+=i.length,s>e&&await async function(){const e=await a();r=crypto.randomUUID?crypto.randomUUID():Array.from(crypto.getRandomValues(new Uint8Array(16)),t=>t.toString(16).padStart(2,"0")).join(""),n=await e.getFileHandle(r,{create:!0}),o=(await n.createWritable()).getWriter(),c=!0;for(const e of t)await o.write(e);t.length=0}())},async close(){o&&(await o.close(),o=null)}});let l=0;return{writable:u,readable:new ReadableStream({async pull(e){if(c){if(!i){const t=await n.getFile();i=t.stream().getReader()}const{value:t,done:r}=await i.read();r?e.close():e.enqueue(t)}else l<t.length?e.enqueue(t[l++]):e.close()},async cancel(t){i&&await i.cancel(t)}},{highWaterMark:0}),dispose:async function(){if(o){try{await o.close()}catch{}o=null}if(r){try{const t=await a();await t.removeEntry(r)}catch{}n=r=null}t.length=0}}}}const Xc=1048576;function $c(t={}){const{thresholdBytes:e=Xc}=t;return function(){const t=[];let r,n,o,a=0,i=!1;const s=new WritableStream({async write(o){i?await r.write(o):(t.push(o),a+=o.length,a>e&&await async function(){const e=new TransformStream;n=tr(e.readable),r=e.writable.getWriter(),i=!0;for(const e of t)await r.write(e);t.length=0}())},async close(){r&&(await r.close(),r=null)}});let c=0;return{writable:s,readable:new ReadableStream({async pull(e){if(i){if(!o){const t=await n;o=t.stream().getReader()}const{value:t,done:r}=await o.read();r?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(r){try{await r.abort()}catch{}r=null}n&&(n.catch(()=>{}),n=null),t.length=0}}}}const Jc=1048576,Qc=".zip.js-temp",tu="createSyncAccessHandle is only available in dedicated workers";function eu(t={}){const{thresholdBytes:e=Jc,directoryName:r=Qc,getDirectory:n}=t;if(!(n||"undefined"!=typeof FileSystemFileHandle&&FileSystemFileHandle.prototype.createSyncAccessHandle))throw new Error(tu);const o=n||(()=>navigator.storage.getDirectory());let a;function i(){return a||(a=Promise.resolve(o()).then(t=>t.getDirectoryHandle(r,{create:!0}))),a}return function(){const t=[];let r,n,o=0,a=!1,s=0,c=0;const u=new WritableStream({async write(c){a?(n.write(c,{at:s}),s+=c.length):(t.push(c),o+=c.length,o>e&&await async function(){const e=await i();r=crypto.randomUUID?crypto.randomUUID():Array.from(crypto.getRandomValues(new Uint8Array(16)),t=>t.toString(16).padStart(2,"0")).join("");const o=await e.getFileHandle(r,{create:!0});n=await o.createSyncAccessHandle(),a=!0;for(const e of t)n.write(e,{at:s}),s+=e.length;t.length=0}())},close(){n&&n.flush()}});let l=0;const f=new ReadableStream({pull(e){if(a){const t=s-c;if(t<=0)return void e.close();const r=new Uint8Array(Math.min(524288,t)),o=n.read(r,{at:c});o?(c+=o,e.enqueue(r.subarray(0,o))):e.close()}else l<t.length?e.enqueue(t[l++]):e.close()}},{highWaterMark:0});return{writable:u,readable:f,dispose:async function(){if(n){try{n.close()}catch{}n=null}if(r){try{const t=await i();await t.removeEntry(r)}catch{}r=null}t.length=0}}}}try{Pt({baseURI:import.meta.url})}catch{}const ru="deflate",nu="deflate-raw",ou="deflate64-raw",au="gzip",iu=[ru,nu,au],su=[ru,nu,au,ou];let cu,uu,lu,fu,wu;function du(t,e){return-4===e&&(t.code="Z_MEM_ERROR"),t}function pu(t,e,r={}){if(!(t?iu:su).includes(e))throw new TypeError("Unsupported format: "+e);if(!cu){const t=new Error("WASM module not loaded");throw t.cause=wu,t}const n="number"==typeof r.level?r.level:-1,o="number"==typeof r.outBuffer?r.outBuffer:65536,a="number"==typeof r.inBufferSize?r.inBufferSize:65536,i={Ve:0,in:0,inBufferSize:0,He:0,Ge:!1};let s,c,u,l,f=!0,w=!1;return function(){try{let r;if(i.Ve=uu(o),i.in=uu(a),i.inBufferSize=a,!i.Ve||!i.in)throw du(new Error("allocation failed"),-4);if(t?(i.qe=cu.deflate_process,i.Ye=cu.deflate_last_consumed,i.Ke=cu.deflate_end,i.He=cu.deflate_new(),r=e===au?cu.deflate_init_gzip(i.He,n):e===nu?cu.deflate_init_raw(i.He,n):cu.deflate_init(i.He,n)):e===ou?(i.qe=cu.inflate9_process,i.Ye=cu.inflate9_last_consumed,i.Ke=cu.inflate9_end,i.He=cu.inflate9_new(),r=cu.inflate9_init_raw(i.He)):(i.qe=cu.inflate_process,i.Ye=cu.inflate_last_consumed,i.Ke=cu.inflate_end,i.He=cu.inflate_new(),r=e===nu?cu.inflate_init_raw(i.He):e===au?cu.inflate_init_gzip(i.He):cu.inflate_init(i.He)),0!==r)throw du(new Error("init failed:"+r),r)}catch(t){throw h(i),t}}(),{readable:new ReadableStream({start(t){s=t},pull(){f=!1,p()},cancel(t){w=!0,l=t,h(i),c.error(t),p()}},{highWaterMark:0}),writable:new WritableStream({start(t){c=t},async write(t){if(f&&await new Promise(t=>u=t),w)throw l;try{!function(t){const e=new Uint8Array(fu.buffer),r=i.qe,n=i.Ye,a=i.Ve;let s=0;for(;s<t.length;){if(i.Ge)throw new Error("trailing data after the end of the stream");const c=Math.min(t.length-s,32768);if((!i.in||i.inBufferSize<c)&&(i.in&&lu&&(lu(i.in),i.in=0),i.in=uu(c),i.inBufferSize=c,!i.in))throw du(new Error("allocation failed"),-4);e.set(t.subarray(s,s+c),i.in);const u=r(i.He,i.in,c,a,o,0),l=u>>24&255,f=128&l?l-256:l;if(f<0)throw du(new Error("process error:"+f),f);const w=16777215&u;w&&d(e.slice(a,a+w));const p=n(i.He);if(1===l)i.Ge=!0;else if(0===p&&0===w)break;s+=p}}(t)}catch(t){throw h(i),s.error(t),t}},close(){if(w)return;try{!function(){const t=new Uint8Array(fu.buffer),e=i.qe,r=i.Ve;for(;;){const n=e(i.He,0,0,r,o,4),a=n>>24&255,s=128&a?a-256:a;if(s<0)throw du(new Error("process error:"+s),s);const c=16777215&n;if(c&&d(t.slice(r,r+c)),1===a||0===c)break}}()}catch(t){throw h(i),s.error(t),t}const t=h(i);if(0!==t){const e=du(new Error("end error:"+t),t);throw s.error(e),e}s.close()},abort(t){h(i),s.error(t)}},{highWaterMark:1})};function d(t){f=!0,s.enqueue(t)}function p(){if(u){const t=u;u=null,t()}}function h(t){let e=0;return t.He&&t.Ke&&(e=t.Ke(t.He)),t.He=0,t.in&&lu&&lu(t.in),t.in=0,t.Ve&&lu&&lu(t.Ve),t.Ve=0,e}}class hu{constructor(t=ru,e){return pu(!0,t,e)}}class mu{constructor(t=ru,e){return pu(!1,t,e)}}hu.requiresModule=!0,mu.requiresModule=!0,hu.supportedFormats=iu,mu.supportedFormats=su;const yu=65536;let bu,Eu;function Su(t){return new Uint8Array(t.memory.buffer)}let gu,Au=!1;var Ru;async function xu(){await async function(){await Promise.allSettled([In(),...Sn.map(t=>(Cn(t),t.terminate()))]),Yr=I,Kr=!1}(),gu=null,Au=!1,cu=uu=lu=fu=wu=null,bu=null,Eu=0}Ru=function(t,e){const r=bu;let n=r?function(t,e,r){Eu||(Eu=t.malloc(yu));const n=Eu?t.aes_hmac_new():0;if(n){const o=Su(t);if(o.set(e,Eu),o.set(r,Eu+e.length),t.aes_hmac_init(n,Eu,e.length,Eu+e.length,r.length))return t.aes_hmac_end(n,0),0}return n}(r,t,e):0;if(!n)return de(t,e);const o=Eu;return{process(t,e){for(let a=0;a<t.length;a+=yu){const i=t.subarray(a,a+yu),s=Su(r);s.set(i,o),r.aes_hmac_process(n,o,i.length,e?1:0),i.set(s.subarray(o,o+i.length))}},digest:()=>(r.aes_hmac_end(n,o),n=0,Su(r).slice(o,o+20)),dispose(){n&&(r.aes_hmac_end(n,0),n=0)}}},ve=Ru||de,function({Xe:t}){$r=t}({Xe:t=>{if(!gu){let{wasmURI:e}=t;typeof e==C&&(e=e()),gu=async function(t,{baseURI:e}){if(!Au)try{await async function(t,e){let r,n;try{try{n=new URL(t,e)}catch{}const o=await fetch(n);r=await o.arrayBuffer()}catch(e){if(!t.startsWith("data:application/wasm;base64,"))throw e;r=function(t){const e=t.split(",")[1],r=atob(e),n=r.length,o=new Uint8Array(n);for(let t=0;t<n;++t)o[t]=r.charCodeAt(t);return o.buffer}(t)}const o=await WebAssembly.instantiate(r);var a;(function(t){if(cu=t,({malloc:uu,free:lu,memory:fu}=cu),"function"!=typeof uu||"function"!=typeof lu||!fu)throw cu=uu=lu=fu=null,new Error("Invalid WASM module")})(o.instance.exports),typeof(a=o.instance.exports).aes_hmac_new==C&&(bu=a,Eu=0)}(t,e),Au=!0}catch(t){throw function(t){wu=t}(t),t}}(e,t).catch(t=>{throw gu=null,t})}return gu}}),Pt({CompressionStreamFallback:hu,DecompressionStreamFallback:mu}),Pt({workerURI:new URL("./zip-web-worker.js",import.meta.url).href,wasmURI:new URL("./zip-module.wasm",import.meta.url).href});const zu="Entry filename already exists",Du="Duplicate entry filename in the imported zip file",Fu='Invalid duplicates option (must be "throw", "keep-first" or "keep-last")',Ou="Entry is an ancestor of target entry",Iu="Root directory cannot be moved",Uu="Target entry is not a directory",Tu="Parent entry is not a directory",Cu="Readable stream already consumed",ku="throw",vu="keep-first",Mu="keep-last",Nu=new Set([ku,vu,Mu]),_u="Invalid passThrough option (use readerOptions.passThrough or set uncompressedSize for each entry)",Pu="Invalid readerOptions (must be an object)",ju="The 'compressed' passThrough option is only supported by Entry#getData() and ZipWriter#add()",Bu="Invalid passwords option (must be an array of strings)",Lu="Invalid requestPassword option (must be a function returning a string or undefined)",Wu="zipjs-abort-export",Zu=new Uint8Array(0),Vu=new Set([br,hr,mr]);class Hu{constructor(t,e,r,n){const o=this;if(t.root&&n&&n.getChildByName(e))throw new Error(zu);r||(r={}),Object.assign(o,{fs:t,name:e,data:r.data,options:r.options&&Object.assign({},r.options),id:t.$e++,parent:n,children:[],uncompressedSize:r.uncompressedSize||0,Je:r.Je||r.uncompressedSize===I,passThrough:r.passThrough,Qe:r.Qe||new Date}),!n&&t.root||(t.entries[o.id]=o),n&&o.parent.children.push(o)}getFullname(){return this.getRelativeName()}getRelativeName(t=this.fs.root){let e=this.name,r=this.parent;for(;r&&r!=t;)e=(r.name?r.name+"/":"")+e,r=r.parent;return e}isDescendantOf(t){let e=this.parent;for(;e&&e.id!=t.id;)e=e.parent;return Boolean(e)}rename(t){const e=this;let r=e.parent;if(r){const n=Rl(t);n&&(t=n.pop(),r=xl(r,n,e));const o=r.getChildByName(t);if(o&&o!=e)throw new Error(zu);r!=e.parent&&(nl(e),e.parent=r,r.children.push(e),gl(e.fs,e))}e.name=t}setOptions(t){const e=Object.assign({},this.options,t);this.options=Object.fromEntries(Object.entries(e).filter(([,t])=>t!==I))}}class Gu extends Hu{constructor(t,e,r,n){super(t,e,r,n);const o=this;o.Reader=r.Reader,o.Writer=r.Writer,r.getData&&(o.getData=r.getData)}clone(){return new Gu(this.fs,this.name,this)}async getData(t,e={}){const r=this;if(!t||t.constructor==r.Writer&&r.data&&function(t,e){const{contentType:r}=t;return r===I||(t.constructor==oo?e.type==r:t.constructor!=to||e.startsWith("data:"+(r||"")+";base64,"))}(t,r.data))return r.data;{const n=r.reader=el(r.Reader,r.data,e),o=r.uncompressedSize||n.size;await Promise.all([No(n),No(t,o)]);const a=ft(e.signal),i=function(t,e,r,n){const{onstart:o,onprogress:a,onend:i}=r,{readable:s}=e;return t.data instanceof ga||!o&&!a&&!i?s:Qe(s).pipeThrough(new rn({onstart:o,onprogress:a,onend:i,size:e.size}),{signal:n})}(r,n,e,a),s=!Mo(t)&&Boolean(e.preventClose);return r.uncompressedSize=n.size,await Qe(i).pipeTo(er(t.writable),{signal:a,preventClose:s,preventAbort:s}),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,Object.assign({},e,{password:t,checkPasswordOnly:!0})),!0}catch(t){if(Zt(t)&&t.message==Ee)return!1;throw t}}getText(t,e){return this.getData(new so(t),e)}getBlob(t,e){return this.getData(new oo(t),e)}getData64URI(t,e){return this.getData(new to(t),e)}getUint8Array(t){return this.getData(new Uo,t)}getWritable(t=new WritableStream,e){return this.getData({writable:t},e)}async getArrayBuffer(t){return Lt(await this.getUint8Array(t)).buffer}replaceBlob(t){dl(this,{data:t,Reader:no,Writer:oo,uncompressedSize:t.size})}replaceText(t){dl(this,{data:t,Reader:ao,Writer:so,uncompressedSize:io(t)})}replaceData64URI(t){dl(this,{data:t,Reader:Qn,Writer:to,uncompressedSize:pl(t)})}replaceUint8Array(t){dl(this,{data:t,Reader:Io,Writer:Uo,uncompressedSize:t.length})}replaceReadable(t){dl(this,{data:null,Reader:Qu(t),Writer:null,uncompressedSize:I})}}class qu extends Hu{constructor(t,e,r,n){super(t,e,r,n),this.directory=!0}clone(t){const e=this,r=new qu(e.fs,e.name,e);return t&&(r.children=e.children.map(e=>{const n=e.clone(t);return n.parent=r,n})),r}addDirectory(t,e){return Al(this,t,{options:e},!0)}addText(t,e,r={}){return Al(this,t,{data:e,Reader:ao,Writer:so,options:r,uncompressedSize:io(e)})}addBlob(t,e,r={}){return Al(this,t,{data:e,Reader:no,Writer:oo,options:r,uncompressedSize:e.size})}addData64URI(t,e,r={}){return Al(this,t,{data:e,Reader:Qn,Writer:to,options:r,uncompressedSize:pl(e)})}addUint8Array(t,e,r={}){return Al(this,t,{data:e,Reader:Io,Writer:Uo,options:r,uncompressedSize:e.length})}addHttpContent(t,e,r={}){return Al(this,t,{data:e,Reader:class extends Fo{constructor(t){super(t,r)}},options:r})}addReadable(t,e,r={}){return Al(this,t,{Reader:Qu(e),options:r})}addFileSystemEntry(t,e={}){return yl(this,t,e)}addFileSystemHandle(t,e={}){return yl(this,t,e)}addFile(t,e={}){return(e=Object.assign({},e)).lastModDate||(e.lastModDate=new Date(t.lastModified)),Al(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 Qn(t),e)}importUint8Array(t,e){return this.importZip(new Io(t),e)}importHttpContent(t,e){return this.importZip(new Fo(t,e),e)}importReadable(t,e){return this.importZip({readable:t},e)}exportBlob(t={}){return this.exportZip(new oo(t.mimeType||"application/zip"),t)}exportData64URI(t={}){return this.exportZip(new to(t.mimeType||"application/zip"),t)}exportUint8Array(t={}){return this.exportZip(new Uo,t)}async exportWritable(t=new WritableStream,e={}){return await this.exportZip({writable:t},e),t}exportFileSystemHandle(t,e={}){return async function(t,e,r){const{onstart:n,onprogress:o,onend:a}=r;wl(r.passThrough),cl(r);const i=sl(r.readerOptions),s=new AbortController,{signal:c}=s,u=function(t,e){if(!ft(t))return()=>{};if(t.aborted)return e.abort(t.reason),()=>{};const r=()=>e.abort(t.reason);return t.addEventListener("abort",r,{once:!0}),()=>t.removeEventListener("abort",r)}(r.signal,s),l=Object.assign({},r,i,{signal:c,onstart:I,onprogress:I,onend:I,preventClose:!1}),f=Xu([t],t=>Ju(t,l.passThrough)),w=[];let d=!1,p=0;try{n&&await nn(n,f),await m(t,e),a&&await nn(a,p)}catch(t){try{t.exportedEntryNames=w}catch{}throw t}finally{u()}return e;function h(t){const e=t.getWriter();return new WritableStream({async write(t){await e.write(t),p+=t.length,o&&await nn(o,p,f)},close:()=>e.close(),abort:t=>e.abort(t)})}async function m(t,e){if(r.concurrent){const r=(await Promise.allSettled(t.children.map(t=>y(t,e)))).filter(t=>"rejected"==t.status);if(r.length){const t=r.filter(t=>!ol(t.reason));throw function(t){const[e]=t,r=t.slice(1).flatMap(t=>[t,...t&&t.entryErrors||[]]).filter(t=>t!==e);if(r.length)try{e.entryErrors=[...e.entryErrors||[],...r]}catch{}return e}((t.length?t:r).map(t=>t.reason))}}else for(const r of t.children)await y(r,e)}async function y(e,r){if(c.aborted){if(d||ol(c.reason))return;wt(c)}try{if(e.directory){const t=await r.getDirectoryHandle(e.name,{create:!0});await m(e,t)}else{const n=await r.getFileHandle(e.name,{create:!0}),o=await n.createWritable();try{await e.getData({writable:h(o)},l)}catch(t){throw d?new Error(Wu):t}w.push(e.getRelativeName(t))}}catch(r){d=!0,s.abort(new Error(Wu));try{r.entryName===I&&(r.entryName=e.getRelativeName(t),r.entryId=e.id)}catch{}throw r}}}(this,t,e)}async importZip(t,e={}){let r;t&&typeof t.getEntries==C?(r=t,e=Object.assign({},r.options,e)):(await No(t),r=new pi(t,e)),wl(e.passThrough),cl(e);const n=function(t){if(t===I)return ku;if(Nu.has(t))return t;throw new Error(Fu)}(e.duplicates),o=[],a={er:[]},i=await r.getEntries(e);for(const t of i){let r=this;try{const i=t.filename.split("/").filter(t=>""!=t&&"."!=t),s=i.pop();let c=!1;for(const t of i){const e=r;if(r=r.getChildByName(t),r){if(!r.directory){if(n==vu){c=!0;break}if(n!=Mu)throw new Error(Du);this.fs.remove(r),r=new qu(this.fs,t,{data:null},e),o.push(r)}}else r=new qu(this.fs,t,{data:null},e),o.push(r)}if(c)continue;if(t.directory){let e=r;if(s){if(e=r.getChildByName(s),e&&(!e.directory||e.data)){if(n==vu)continue;if(n!=Mu)throw new Error(Du);e.directory?e.data=t:(this.fs.remove(e),e=I)}e||(e=new qu(this.fs,s,{data:null},r),o.push(e))}e==this||e.data||(e.data=t)}else{const i=r.getChildByName(s);if(i){if(n==vu)continue;if(n!=Mu)throw new Error(Du);this.fs.remove(i)}o.push(Al(r,s,{data:t,Reader:tl(Object.assign({},e),a),uncompressedSize:e.passThrough?t.compressedSize:t.uncompressedSize,passThrough:e.passThrough}))}}catch(e){o.reverse().forEach(t=>this.fs.remove(t));try{e.cause={entry:t}}catch{}throw e}}return o}async exportZip(t,e={}){const r=this,n=Boolean(t)&&typeof t.add==C;e=Object.assign({},e),n||e.bufferedWrite!==I||(e.bufferedWrite=!0);const[o]=await Promise.all([rl(r,sl(e.readerOptions)),n?I:No(t)]),a=n?t:new Ys(t,e);return await async function(t,e,r,n,o){const{onstart:a,onprogress:i,onend:s,onentryprogress:c}=n,u=e,l=Xu(e.children,t=>ml(t)?0:1);let f=0,w=0;if(a&&await nn(a,r),n.bufferedWrite)await async function t(e){const r=(await Promise.allSettled(e.children.map(async e=>{await d(e),await t(e)}))).find(t=>"rejected"==t.status);if(r)throw r.reason}(e);else for(const t of e.getChildren({recursive:!0}))await d(t);async function d(e){if(ml(e))return;const{name:a,ee:s}=al(e,u,n);let d=0;const p=await t.add(a,o.get(e),Object.assign(s,{onstart:I,onend:I,onprogress:async t=>{f+=t-d,d=t,i&&await nn(i,f,r)}}));w++,c&&await nn(c,w,l,p)}s&&await nn(s,f)}(a,r,Xu([r],$u),e,o),n?a:(await a.close(e.globalComment),t.getData?t.getData():t.writable)}async getExportedSize(r={}){const n=this;sl((r=Object.assign({},r)).readerOptions),r.bufferedWrite===I&&(r.bufferedWrite=!0);const o=n.getChildren({recursive:!0}),a=o.filter(t=>!ml(t)).map(t=>{const{name:e,ee:o}=al(t,n,r);return{name:e,size:t.directory?0:il(t,hl(t,r)),options:o}}),i=!r.bufferedWrite||a.every(t=>!1!==t.options.keepOrder)&&o.every(t=>ml(t)||!t.children.length);return await async function(r,n,o,a){const i={options:r};if(lt(r[$]))throw new Error(zs);if(a!==I&&!(a instanceof Uint8Array))throw new Error(ns);const s=jc(a);if(s>e)throw new Error(rs);const c=r[K],u=new Map,l=r[Y]===I?0:r[Y];let f=l,d=U;const p=[],h=new Set;for(const e of n){let{name:r}=e;const{size:n}=e,o=Object.assign({},e.options);Oc(i,o,fa)&&!r.endsWith(z)&&(r+=z);const a=rc(i,r,o);({name:r}=a);const{ne:s}=nc(i,r,o);0==s.level||s.compressionMethod!==I||s.ae||await Jr(Tt())||(s.level=0);const l=!Oc(i,o,fa);if(l&&n===I)throw new Error(zs);const{Be:w,ne:m}=ac(i,l,n,s,o);if(l&&!s.ae&&kc(m.compressionMethod,m.level))throw new Error(zs);const y=Object.assign({},o,a.ne,s,m,{[K]:c}),b=sc(y),E=lc(y),S={fe:b,he:jc(b.ce,E.ue)};c&&cc(S,f);const g=l?w:0;u.set(r,Object.assign({},y,b,{offset:f,diskNumberStart:0,compressedSize:g}));const A=S.he+g;p.push(A),h.add(Boolean(y.Gt||y.uncompressedSize>=t||g>=t)),d=Math.min(d,A),f+=A}if(u.size>1&&(c||f-d>=t&&(h.size>1||ic(p,l,!0)!=ic(p,l,!1)))&&!o)throw new Error(zs);const{ze:m,De:y}=fc(u);let b=Oc(i,r,ia);if(f>=t||m>=t||u.size>=e){if(!1===b)throw new Error(gs);b=!0}else b===I&&y&&(b=!0);return f-l+m+s+(b?98:w)}(r,a,i,r.globalComment)}getChildByName(t){const e=this.children;for(let r=0;r<e.length;r++){const n=e[r];if(n.name==t)return n}}getChildren(t={}){return function(t,e){const r=[],n=[t];let o=0;for(;o<n.length;)for(const t of n[o++].children)r.push(t),e&&n.push(t);return r}(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 r=this.children;return!(await Promise.all(r.map(r=>r.checkPassword(t,e)))).includes(!1)}}class Yu{constructor(){El(this)}get children(){return this.root.children}remove(t){nl(t);const e=[t];for(;e.length;){const t=e.pop();this.entries[t.id]=null;for(const r of t.children)e.push(r)}t.parent=I}move(t,e){if(t==this.root)throw new Error(Iu);if(!e.directory)throw new Error(Uu);if(e.isDescendantOf(t))throw new Error(Ou);if(t!=e){const r=e.getChildByName(t.name);if(r){if(r!=t)throw new Error(zu)}else nl(t),t.parent=e,e.children.push(t),gl(this,t)}}find(t){const e=t.split("/");let r=this.root;for(let t=0;r&&t<e.length;t++)r=r.directory?r.getChildByName(e[t]):I;return r||(r=this.entries.find(e=>e&&(e==this.root||e.isDescendantOf(this.root))&&e.getRelativeName()==t)),r}getById(t){return this.entries[t]}getChildByName(t){return this.root.getChildByName(t)}getChildren(t){return this.root.getChildren(t)}addDirectory(t,e){return this.root.addDirectory(t,e)}addText(t,e,r){return this.root.addText(t,e,r)}addBlob(t,e,r){return this.root.addBlob(t,e,r)}addData64URI(t,e,r){return this.root.addData64URI(t,e,r)}addUint8Array(t,e,r){return this.root.addUint8Array(t,e,r)}addHttpContent(t,e,r){return this.root.addHttpContent(t,e,r)}addReadable(t,e,r){return this.root.addReadable(t,e,r)}addFileSystemEntry(t,e){return this.root.addFileSystemEntry(t,e)}addFileSystemHandle(t,e){return this.root.addFileSystemHandle(t,e)}addFile(t,e){return this.root.addFile(t,e)}importBlob(t,e){return Sl(this,r=>r.importBlob(t,e))}importData64URI(t,e){return Sl(this,r=>r.importData64URI(t,e))}importUint8Array(t,e){return Sl(this,r=>r.importUint8Array(t,e))}importHttpContent(t,e){return Sl(this,r=>r.importHttpContent(t,e))}importReadable(t,e){return Sl(this,r=>r.importReadable(t,e))}importZip(t,e){return Sl(this,r=>r.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 Ku={FS:Yu,ZipDirectoryEntry:qu,ZipFileEntry:Gu};function Xu(t,e){let r=0;const n=Array.from(t);for(;n.length;){const t=n.pop();r+=e(t)||0;for(const e of t.children)n.push(e)}return r}function $u(t){return t.uncompressedSize}function Ju(t,e){const{data:r}=t;return e&&r instanceof ga?r.compressedSize:t.uncompressedSize}function Qu(t){let e;return function(){if(e)throw new Error(Cu);return e=!0,{readable:t}}}function tl(t,e){return class extends $n{constructor(t,e={}){super(),this.entry=t,this.options=e}async init(){const r=this,n=Object.assign({},t,r.options),{checkOverlappingEntry:o,checkOverlappingEntryOnly:a}=n,i=await async function(t,e,r){cl(e);const{passwords:n,requestPassword:o,signal:a}=e;if(delete(e=Object.assign({},e)).passwords,delete e.requestPassword,!t.encrypted||e.passThrough||!n&&!o)return t.getData(new oo,e);const i=new Set;let s;for(;;){for(const t of ll(e,r,n))if(!i.has(t.key)){const e=await u(t);if(e.done)return e.data;s=e.error}if(!o)break;if(r.rr){await r.rr;continue}let a;r.rr=new Promise(t=>a=t);try{const e=await o(t,s);if(e===I||null===e)break;if(typeof e!=v)throw new Error(Lu);const r=await u(fl(e));if(r.done)return r.data;s=r.error}finally{r.rr=I,a()}}if(!i.size)throw new Error(Ua);const c=new Error(Ee);throw c.cause=s,c;async function u(n){i.add(n.key);const o=Object.assign({},e,n.options);if(t.zipCrypto){o.checkCrc32=!0;try{await t.getData(null,Object.assign({},o,{checkPasswordOnly:!0}))}catch(t){if(ul(t))return{done:!1,error:t};throw t}}try{const e=await t.getData(new oo,o);return function(t,e){const{er:r}=t,n=r.findIndex(t=>t.key===e.key);-1!=n&&r.splice(n,1),r.unshift(e)}(r,n),{done:!0,data:e}}catch(e){if(function(t,e){return Boolean(e&&e.aborted)||Zt(t)&&"AbortError"==t.name}(e,a)||!function(t,e){return ul(t)||e.zipCrypto&&Zt(t)&&Vu.has(t.message)}(e,t))throw e;return{done:!1,error:e}}}}(r.entry,Object.assign(n,{checkPasswordOnly:!1,checkOverlappingEntry:a||o,checkOverlappingEntryOnly:!1,preventClose:!1}),e);r.data=i,r.nr=new no(i),r.size=i.size,super.init()}readUint8Array(t,e){return this.nr.readUint8Array(t,e)}}}function el(t,e,r){return t.prototype?new t(e,r):t(e,r)}async function rl(t,e){const r=[],n=[t],o=new Map;for(;n.length;){const t=n.pop();for(const e of t.children)e.directory?n.push(e):r.push(e)}return await Promise.all(r.map(async r=>{const n=r.reader=el(r.Reader,r.data,e);o.set(r,n);try{await No(n)}catch(e){try{e.entry=r,e.entryId=r.id,e.entryName=r.getRelativeName(t)}catch{}throw e}n.size!==I&&(r.uncompressedSize=n.size,r.Je=!1)})),o}function nl(t){if(t.parent){const e=t.parent.children;e.forEach((r,n)=>{r.id==t.id&&e.splice(n,1)})}}function ol(t){return Boolean(t)&&t.message==Wu}function al(t,e,r){const n=r.relativePath?t.getRelativeName(e):t.getFullname(),o=t.options||{};let a={},i={};if(t.data instanceof ga){const e=hl(t,r),n=o.lastModDate===I?r.lastModDate:o.lastModDate;({ee:a,re:i}=ec(t.data,e,n)),e&&(i.passThrough=!0)}const s=Object.assign({lastModDate:t.Qe},a,r,o,i,{directory:t.directory});if(!t.directory&&s.passThrough&&s.uncompressedSize===I)throw new Error(_u);return{name:n,ee:s}}function il(t,e){const{reader:r}=t;return r&&r.size!==I?r.size:t.Je?I:Ju(t,e)}function sl(t){if(t&&(typeof t!=k||Array.isArray(t)))throw new Error(Pu);return t&&(wl(t.passThrough),cl(t)),t}function cl(t){const{passwords:e,requestPassword:r}=t;if(e&&(!Array.isArray(e)||e.some(t=>typeof t!=v)))throw new Error(Bu);if(r&&typeof r!=C)throw new Error(Lu)}function ul(t){return Zt(t)&&t.message==Ee}function ll(t,e,r){const n=[],{password:o,rawPassword:a}=t;return a&&a.length&&n.push({key:a,options:{password:"",rawPassword:a}}),o&&n.push(fl(o)),n.push(...e.er),r&&n.push(...r.filter(t=>t).map(fl)),n}function fl(t){return{key:t,options:{password:t,rawPassword:Zu}}}function wl(t){if(pt(t)===ot)throw new Error(ju)}function dl(t,e){const{uncompressedSize:r}=e;Object.assign(t,e,{reader:null,passThrough:I,uncompressedSize:r===I?0:r,Je:r===I})}function pl(t){let e=t.length;for(;"="==t.charAt(e-1);)e--;const r=t.indexOf(",")+1;return Math.floor(.75*(e-r))}function hl(t,e){const{readerOptions:r}=e;return Boolean(!t.directory&&(t.passThrough||r&&r.passThrough))}function ml(t){return t.directory&&null===t.data}function yl(t,e,r){return async function t(e,n,o,a=""){if(n){const i=a?a+"/"+n.name:n.name;try{if((n.isFile||n.isDirectory)&&(n=await bl(n)),"file"==n.kind){const t=await n.getFile();o.push(Al(e,t.name,{Reader:function(){return{readable:t.stream(),size:t.size}},options:Object.assign({},{lastModDate:new Date(t.lastModified)},r),uncompressedSize:t.size}))}else if("directory"==n.kind){const a=e.addDirectory(n.name,r);o.push(a);for await(const e of n.values())await t(a,e,o,i)}}catch(t){try{t.entryName===I&&(t.entryName=i)}catch{}throw t}}return o}(t,e,[])}async function bl(t){const e={name:t.name};if(t.isFile&&(e.kind="file",e.getFile=()=>new Promise((e,r)=>t.file(e,r))),t.isDirectory){e.kind="directory";const r=await async function(t){const e=[];function r(t,n,o){t.readEntries(async a=>{if(a.length){for(const t of a)e.push(await bl(t));r(t,n,o)}else n(e)},o)}return await new Promise((e,n)=>r(t.createReader(),e,n)),{[Symbol.iterator](){let t=0;return{next(){const r={value:e[t],done:t==e.length};return t++,r}}}}}(t);e.values=()=>r}return e}function El(t){t.entries=[],t.$e=0,t.root=new qu(t)}function Sl(t,e){const{entries:r,$e:n,root:o}=t;return El(t),e(t.root).catch(e=>{throw Object.assign(t,{entries:r,$e:n,root:o}),e})}function gl(t,e){const r=[e];for(;r.length;){const e=r.pop();t.entries[e.id]=e;for(const t of e.children)r.push(t)}}function Al(t,e,r,n){if(t.directory){const o=Rl(e);return o&&(e=o.pop(),t=xl(t,o)),n?new qu(t.fs,e,r,t):new Gu(t.fs,e,r,t)}throw new Error(Tu)}function Rl(t){if(t.includes("/")){const e=t.split("/").filter(t=>""!=t&&"."!=t);if(e.length)return e}}function xl(t,e,r){return e.forEach(e=>{const n=t;if(t=t.getChildByName(e)){if(!t.directory)throw new Error(zu);if(r&&(t==r||t.isDescendantOf(r)))throw new Error(Ou)}else t=new qu(n.fs,e,{data:null},n)}),t}export{no as BlobReader,oo as BlobWriter,Qn as Data64URIReader,to as Data64URIWriter,ut as ERR_ABORTED,Ma as ERR_AMBIGUOUS_ARCHIVE,Ou as ERR_ANCESTOR_ENTRY,xa as ERR_BAD_FORMAT,Fa as ERR_CENTRAL_DIRECTORY_NOT_FOUND,yr as ERR_CODEC_OUT_OF_MEMORY,es as ERR_DUPLICATED_NAME,Du as ERR_DUPLICATE_IMPORTED_ENTRY,Ua as ERR_ENCRYPTED,Na as ERR_ENCRYPTED_CENTRAL_DIRECTORY,va as ERR_ENTRY_DATA_OUT_OF_BOUNDS,zu as ERR_ENTRY_EXISTS,Da as ERR_EOCDR_LOCATOR_ZIP64_NOT_FOUND,za as ERR_EOCDR_NOT_FOUND,Ia as ERR_EXTRAFIELD_ZIP64_NOT_FOUND,Pn as ERR_HTTP_RANGE,jn as ERR_HTTP_RESOURCE_CHANGED,_n as ERR_HTTP_STATUS,Se as ERR_INVALID_AUTHENTICATION_CODE,St as ERR_INVALID_BASE_URI,rr as ERR_INVALID_CODEC_DEFINITION,or as ERR_INVALID_CODEC_MODULE,rs as ERR_INVALID_COMMENT,ns as ERR_INVALID_COMMENT_TYPE,mr as ERR_INVALID_COMPRESSED_DATA,br as ERR_INVALID_CRC32,is as ERR_INVALID_DATE,Fu as ERR_INVALID_DUPLICATES,us as ERR_INVALID_ENCRYPTION_STRENGTH,Ps as ERR_INVALID_ENTRY,os as ERR_INVALID_ENTRY_COMMENT,as as ERR_INVALID_ENTRY_COMMENT_TYPE,ss as ERR_INVALID_ENTRY_NAME,ds as ERR_INVALID_EXTRAFIELD,ms as ERR_INVALID_EXTRAFIELD_DATA,hs as ERR_INVALID_EXTRAFIELD_DATA_TYPE,ps as ERR_INVALID_EXTRAFIELD_TYPE,ja as ERR_INVALID_FILENAME_VALIDATION,at as ERR_INVALID_FUNCTION_OPTION,Us as ERR_INVALID_GID,Ns as ERR_INVALID_LEVEL,Ba as ERR_INVALID_MAX_APPENDED_DATA_SIZE,Et as ERR_INVALID_MAX_WORKERS,vs as ERR_INVALID_MSDOS_ATTRIBUTES,Ms as ERR_INVALID_MSDOS_DATA,Ee as ERR_INVALID_PASSWORD,Bu as ERR_INVALID_PASSWORDS,st as ERR_INVALID_PASSWORD_TYPE,_u as ERR_INVALID_PASS_THROUGH,ct as ERR_INVALID_PASS_THROUGH_VALUE,Fs as ERR_INVALID_READER,Pu as ERR_INVALID_READER_OPTIONS,Lu as ERR_INVALID_REQUEST_PASSWORD,it as ERR_INVALID_SIGNAL,_s as ERR_INVALID_SIGNATURE_DATA,Pa as ERR_INVALID_STRICTNESS,Is as ERR_INVALID_UID,hr as ERR_INVALID_UNCOMPRESSED_SIZE,Cs as ERR_INVALID_UNIX_EXTRA_FIELD_TYPE,ks as ERR_INVALID_UNIX_ID_SIZE,Ts as ERR_INVALID_UNIX_MODE,gt as ERR_INVALID_URI,cs as ERR_INVALID_VERSION,Bn as ERR_ITERATOR_COMPLETED_TOO_SOON,Oa as ERR_LOCAL_FILE_HEADER_NOT_FOUND,ka as ERR_OVERLAPPING_ENTRY,Tu as ERR_PARENT_NOT_DIRECTORY,Cu as ERR_READABLE_CONSUMED,nr as ERR_RESERVED_COMPRESSION_METHOD,Iu as ERR_ROOT_DIRECTORY_NOT_MOVABLE,Ca as ERR_SPLIT_ZIP_FILE,Uu as ERR_TARGET_NOT_DIRECTORY,Rs as ERR_UNDEFINED_COMPRESSION_METHOD,xs as ERR_UNDEFINED_CRC32,Ds as ERR_UNDEFINED_READER,As as ERR_UNDEFINED_UNCOMPRESSED_SIZE,zs as ERR_UNDETERMINED_SIZE,_a as ERR_UNSAFE_FILENAME,ar as ERR_UNSUPPORTED_COMPRESSION,tu as ERR_UNSUPPORTED_CONTEXT,Ae as ERR_UNSUPPORTED_CRYPTO_API,Ta as ERR_UNSUPPORTED_ENCRYPTION,ws as ERR_UNSUPPORTED_ENCRYPTION_PASS_THROUGH,ls as ERR_UNSUPPORTED_ENCRYPTION_USDZ,gs as ERR_UNSUPPORTED_FORMAT,ju as ERR_UNSUPPORTED_PASS_THROUGH_VALUE,fs as ERR_UNSUPPORTED_SPLIT_USDZ,La as ERR_UNSUPPORTED_UINT64,qr as ERR_WORKER_STARTUP_TIMEOUT,Ln as ERR_WRITER_NOT_INITIALIZED,Wn as ERR_WRITER_SIZE_NOT_WRITABLE,js as ERR_ZIP_CRYPTO_LAST_MOD_DATE,Os as ERR_ZIP_NOT_EMPTY,Oo as HttpRangeReader,Fo as HttpReader,$n as Reader,To as SplitDataReader,Co as SplitDataWriter,ao as TextReader,so as TextWriter,Io as Uint8ArrayReader,Uo as Uint8ArrayWriter,Gc as VERSION,Ya as WARNING_APPENDED_DATA,Ls as WARNING_CLAMPED_LAST_MODIFICATION_DATE,Va as WARNING_COMPRESSED_PATCHED_DATA,Bs as WARNING_COMPRESSION_UNAVAILABLE,ti as WARNING_DUPLICATE_FILENAME,Ha as WARNING_MALFORMED_EXTRA_FIELD,Ja as WARNING_MISMATCHED_CENTRAL_DIRECTORY_OFFSET,oi as WARNING_MISMATCHED_LOCAL_FILE_HEADER_BIT_FLAG,ai as WARNING_MISMATCHED_LOCAL_FILE_HEADER_COMPRESSION_METHOD,ii as WARNING_MISMATCHED_LOCAL_FILE_HEADER_CRC32_OR_SIZES,ni as WARNING_MISMATCHED_LOCAL_FILE_HEADER_FILENAME,ei as WARNING_MISMATCHED_ZIP64_END_OF_CENTRAL_DIRECTORY,Qa as WARNING_MISSING_ZIP64_EXTRA_FIELD,ri as WARNING_MULTIPLE_END_OF_CENTRAL_DIRECTORY,Xa as WARNING_PREPENDED_CENTRAL_DIRECTORY,Ka as WARNING_PREPENDED_DATA,$a as WARNING_TRAILING_CENTRAL_DIRECTORY_DATA,Za as WARNING_UNKNOWN_VERSION,Ga as WARNING_UNKNOWN_ZIP64_EXTENSIBLE_DATA,Wa as WARNING_UNSORTED_CENTRAL_DIRECTORY,qa as WARNING_WRAPPED_ENTRIES_COUNT,Jn as Writer,qu as ZipDirectoryEntry,Hu as ZipEntry,Yu as ZipFS,Gu as ZipFileEntry,pi as ZipReader,hi as ZipReaderStream,Ys as ZipWriter,Ks as ZipWriterStream,vt as configure,$c as createBlobTempStream,Kc as createOPFSTempStream,eu as createSyncAccessHandleTempStream,Ku as fs,Zc as getMimeType,wr as getRegisteredCodecs,Vc as getSupportedCompressionMethods,mi as isZipFile,ur as registerCodec,jt as resetConfiguration,xu as terminateWorkers,lr as unregisterCodec};
|
|
1
|
+
const t=4294967295,e=65535,r=255,n=67324752,o=134695760,a=o,i=84233040,s=33639248,c=101010256,u=101075792,l=117853008,f=46,w=22,d=20,p=56,h=39169,m=21589,y=6534,E=30837,b=30805,S=2048,g=8192,A=61440,R=16384,z=2048,x=1024,D="/",F=30,O=new Date(2107,11,31,23,59,58),I=new Date(1980,0,1),U=void 0,T=1/0,k="Local file header not found",C="Overlapping entry found",M="Zip64 extra field not found",v="undefined",N="function",_="object",j="string",P="boolean",B=new Uint8Array,L=Symbol.asyncDispose||Symbol(),W="password",Z="rawPassword",V="passThrough",H="signal",G="checkAmbiguity",q="useWebWorkers",Y="useCompressionStream",K="preventClose",X="level",$="useUnicodeFileNames",J="dataDescriptor",Q="offset",tt="usdz",et="strictness",rt="maxAppendedDataSize",nt="signCentralDirectory",ot="entry",at="filename",it="comment",st="strict",ct="balanced",ut="tolerant",lt="compressed",ft="Invalid option (must be a function)",wt="Invalid signal (must be an AbortSignal instance)",dt="Invalid password (password must be a string, rawPassword must be a Uint8Array)",pt="Invalid passThrough option (must be a boolean or 'compressed')",ht="The operation was aborted";function mt(t){if(t&&typeof t!=N)throw new Error(ft);return t}function yt(t){if(t&&(typeof t.addEventListener!=N||typeof t.aborted!=P))throw new Error(wt);return t||U}function Et(t){if(t&&t.aborted)throw t.reason===U?new DOMException(ht,"AbortError"):t.reason}function bt(t,e){if(t&&typeof t!=j||e&&!(e instanceof Uint8Array))throw new Error(dt)}function St(t){if(t!==U&&typeof t!=P&&t!==lt)throw new Error(pt);return t}function gt(t,e,r){if(!Number.isInteger(t)||t<0||t>e)throw new Error(r)}function At(t,e,r){t!==U&>(t,e,r)}function Rt(t){return typeof t==j&&t.trim()?Number(t):t}const zt=262144,xt="Invalid maxWorkers (must be an integer greater than 0)",Dt="Invalid baseURI (must be a string)",Ft="Invalid URI (must be a string or a function returning a string)";let Ot=2;try{typeof navigator!=v&&navigator.hardwareConcurrency&&(Ot=navigator.hardwareConcurrency)}catch{}const It={workerURI:"./core/web-worker-wasm.js",wasmURI:"./core/streams/zlib-wasm/zlib-streams.wasm",chunkSize:zt,maxWorkers:Ot,terminateWorkerTimeout:5e3,workerStarvationTimeout:5e3,workerStartupTimeout:5e3,useWebWorkers:!0,useCompressionStream:!0,transferStreams:!0,CompressionStream:typeof CompressionStream!=v&&CompressionStream,DecompressionStream:typeof DecompressionStream!=v&&DecompressionStream},Ut="maxWorkers",Tt="baseURI",kt=["wasmURI","workerURI"],Ct=["chunkSize",Ut,"terminateWorkerTimeout","workerStarvationTimeout","workerStartupTimeout"],Mt=["createWorker","CompressionStream","DecompressionStream","CompressionStreamFallback","DecompressionStreamFallback"],vt=[Tt,...kt,"useCompressionStream","useWebWorkers","transferStreams",...Ct,...Mt],Nt={...It};function _t(){return Nt}function jt(t){return Pt(t.chunkSize)}function Pt(t){return t=Rt(t),Number.isInteger(t)&&t>=1?Math.max(t,64):zt}function Bt(t){Object.assign(Nt,Lt(Zt(t)))}function Lt(t){const e={};for(const r of vt){const n=t[r];n!==U&&(e[r]=Wt(r,n))}return e}function Wt(t,e){if(Ct.includes(t)){if(e=Rt(e),t==Ut&&(!Number.isInteger(e)||e<1))throw new Error(xt)}else if(Mt.includes(t))mt(e);else if(t==Tt){if(e&&typeof e!=j)throw new Error(Dt)}else if(kt.includes(t)&&e&&typeof e!=j&&typeof e!=N)throw new Error(Ft);return e}function Zt(t){t=t||{};const{CompressionStreamZlib:e,DecompressionStreamZlib:r}=t;if(e===U&&r===U)return t;const n=Object.assign({},t);return n.CompressionStreamFallback===U&&(n.CompressionStreamFallback=e),n.DecompressionStreamFallback===U&&(n.DecompressionStreamFallback=r),n}function Vt(t){const e=Lt(Zt(t));Object.assign(It,e),Object.assign(Nt,e)}function Ht(){for(const t of vt)delete Nt[t];Object.assign(Nt,It)}function Gt(t,e){const r=new Uint8Array(t.length+e.length);return r.set(t),r.set(e,t.length),r}function qt(t){return t.byteOffset||t.byteLength!=t.buffer.byteLength?new Uint8Array(t):t}function Yt(t){return new DataView(t.buffer,t.byteOffset,t.byteLength)}function Kt(t){return Boolean(t)&&"object"==typeof t}const Xt=[[],[],[],[],[],[],[],[]];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;Xt[0][t]=e}for(let t=0;t<256;t++)for(let e=1;e<8;e++){const r=Xt[e-1][t];Xt[e][t]=r>>>8^Xt[0][255&r]}const[$t,Jt,Qt,te,ee,re,ne,oe]=Xt;class ae{constructor(t){this.o=t||-1}append(t){let e=0|this.o;const r=0|t.length;let n=0;if(r>=8&&t.buffer){const o=new DataView(t.buffer,t.byteOffset,r),a=r-8;for(;n<=a;n+=8){const t=e^o.getInt32(n,!0),r=o.getInt32(n+4,!0);e=oe[255&t]^ne[t>>>8&255]^re[t>>>16&255]^ee[t>>>24&255]^te[255&r]^Qt[r>>>8&255]^Jt[r>>>16&255]^$t[r>>>24&255]}}for(;n<r;n++)e=e>>>8^$t[255&(e^t[n])];this.o=e}get(){return~this.o}}class ie extends TransformStream{constructor(){let t;const e=new ae;super({transform(t,r){e.append(t),r.enqueue(t)},flush(){const r=new Uint8Array(4);new DataView(r.buffer).setUint32(0,e.get()),t.value=r}}),t=this}}function se(t){if(typeof TextEncoder==v){t=unescape(encodeURIComponent(t));const e=new Uint8Array(t.length);for(let r=0;r<e.length;r++)e[r]=t.charCodeAt(r);return e}return(new TextEncoder).encode(t)}const ce=64,ue=20,le=new Uint8Array([128]),fe=new Uint8Array(1),we=new Int32Array([1732584193,4023233417,2562383102,271733878,3285377520]),de=new Uint8Array(256),pe=new Int32Array(256),he=new Int32Array(256),me=new Int32Array(256),ye=new Int32Array(256);let Ee=!1;function be(t,e){!function(){if(!Ee){let t=1,e=1;do{t=255&(t^t<<1^(128&t?27:0)),e=255&(e^e<<1),e=255&(e^e<<2),e=255&(e^e<<4),128&e&&(e^=9),de[t]=255&(e^(e<<1|e>>7)^(e<<2|e>>6)^(e<<3|e>>5)^(e<<4|e>>4)^99)}while(1!=t);de[0]=99;for(let t=0;t<256;t++){const e=de[t],r=Re(e),n=r<<24|e<<16|e<<8|r^e;pe[t]=n,he[t]=n>>>8|n<<24,me[t]=n>>>16|n<<16,ye[t]=n>>>24|n<<8}Ee=!0}}();const r=new Int32Array(60),n=function(t,e){const r=t.length>>2,n=r+6,o=4*(n+1);let a=1;for(let n=0;n<r;n++)e[n]=t[4*n]<<24|t[4*n+1]<<16|t[4*n+2]<<8|t[4*n+3];for(let t=r;t<o;t++){let n=e[t-1];t%r==0?(n=ge(n<<8|n>>>24)^a<<24,a=Re(a)):r>6&&t%r==4&&(n=ge(n)),e[t]=e[t-r]^n}return n}(t,r),o=new Int32Array(4),a=Se(e);let i=0,s=0,c=0,u=0;return{process(t,e){e&&a.update(t,0,t.length),function(t){const e=new DataView(t.buffer,t.byteOffset,t.byteLength),r=t.length;let n=0;for(;n+16<=r;n+=16)l(),e.setInt32(n,e.getInt32(n)^o[0]),e.setInt32(n+4,e.getInt32(n+4)^o[1]),e.setInt32(n+8,e.getInt32(n+8)^o[2]),e.setInt32(n+12,e.getInt32(n+12)^o[3]);if(n<r){l();for(let e=0;n<r;n++,e++)t[n]^=o[e>>2]>>>24-8*(3&e)}}(t),e||a.update(t,0,t.length)},digest:()=>a.digest()};function l(){i=i+1|0,i||(s=s+1|0,s||(c=c+1|0,c||(u=u+1|0)));let t=Ae(i)^r[0],e=Ae(s)^r[1],a=Ae(c)^r[2],l=Ae(u)^r[3],f=pe[t>>>24]^he[e>>>16&255]^me[a>>>8&255]^ye[255&l]^r[4],w=pe[e>>>24]^he[a>>>16&255]^me[l>>>8&255]^ye[255&t]^r[5],d=pe[a>>>24]^he[l>>>16&255]^me[t>>>8&255]^ye[255&e]^r[6],p=pe[l>>>24]^he[t>>>16&255]^me[e>>>8&255]^ye[255&a]^r[7];t=pe[f>>>24]^he[w>>>16&255]^me[d>>>8&255]^ye[255&p]^r[8],e=pe[w>>>24]^he[d>>>16&255]^me[p>>>8&255]^ye[255&f]^r[9],a=pe[d>>>24]^he[p>>>16&255]^me[f>>>8&255]^ye[255&w]^r[10],l=pe[p>>>24]^he[f>>>16&255]^me[w>>>8&255]^ye[255&d]^r[11],f=pe[t>>>24]^he[e>>>16&255]^me[a>>>8&255]^ye[255&l]^r[12],w=pe[e>>>24]^he[a>>>16&255]^me[l>>>8&255]^ye[255&t]^r[13],d=pe[a>>>24]^he[l>>>16&255]^me[t>>>8&255]^ye[255&e]^r[14],p=pe[l>>>24]^he[t>>>16&255]^me[e>>>8&255]^ye[255&a]^r[15],t=pe[f>>>24]^he[w>>>16&255]^me[d>>>8&255]^ye[255&p]^r[16],e=pe[w>>>24]^he[d>>>16&255]^me[p>>>8&255]^ye[255&f]^r[17],a=pe[d>>>24]^he[p>>>16&255]^me[f>>>8&255]^ye[255&w]^r[18],l=pe[p>>>24]^he[f>>>16&255]^me[w>>>8&255]^ye[255&d]^r[19],f=pe[t>>>24]^he[e>>>16&255]^me[a>>>8&255]^ye[255&l]^r[20],w=pe[e>>>24]^he[a>>>16&255]^me[l>>>8&255]^ye[255&t]^r[21],d=pe[a>>>24]^he[l>>>16&255]^me[t>>>8&255]^ye[255&e]^r[22],p=pe[l>>>24]^he[t>>>16&255]^me[e>>>8&255]^ye[255&a]^r[23],t=pe[f>>>24]^he[w>>>16&255]^me[d>>>8&255]^ye[255&p]^r[24],e=pe[w>>>24]^he[d>>>16&255]^me[p>>>8&255]^ye[255&f]^r[25],a=pe[d>>>24]^he[p>>>16&255]^me[f>>>8&255]^ye[255&w]^r[26],l=pe[p>>>24]^he[f>>>16&255]^me[w>>>8&255]^ye[255&d]^r[27],f=pe[t>>>24]^he[e>>>16&255]^me[a>>>8&255]^ye[255&l]^r[28],w=pe[e>>>24]^he[a>>>16&255]^me[l>>>8&255]^ye[255&t]^r[29],d=pe[a>>>24]^he[l>>>16&255]^me[t>>>8&255]^ye[255&e]^r[30],p=pe[l>>>24]^he[t>>>16&255]^me[e>>>8&255]^ye[255&a]^r[31],t=pe[f>>>24]^he[w>>>16&255]^me[d>>>8&255]^ye[255&p]^r[32],e=pe[w>>>24]^he[d>>>16&255]^me[p>>>8&255]^ye[255&f]^r[33],a=pe[d>>>24]^he[p>>>16&255]^me[f>>>8&255]^ye[255&w]^r[34],l=pe[p>>>24]^he[f>>>16&255]^me[w>>>8&255]^ye[255&d]^r[35],f=pe[t>>>24]^he[e>>>16&255]^me[a>>>8&255]^ye[255&l]^r[36],w=pe[e>>>24]^he[a>>>16&255]^me[l>>>8&255]^ye[255&t]^r[37],d=pe[a>>>24]^he[l>>>16&255]^me[t>>>8&255]^ye[255&e]^r[38],p=pe[l>>>24]^he[t>>>16&255]^me[e>>>8&255]^ye[255&a]^r[39];let h=40;n>10&&(t=pe[f>>>24]^he[w>>>16&255]^me[d>>>8&255]^ye[255&p]^r[40],e=pe[w>>>24]^he[d>>>16&255]^me[p>>>8&255]^ye[255&f]^r[41],a=pe[d>>>24]^he[p>>>16&255]^me[f>>>8&255]^ye[255&w]^r[42],l=pe[p>>>24]^he[f>>>16&255]^me[w>>>8&255]^ye[255&d]^r[43],f=pe[t>>>24]^he[e>>>16&255]^me[a>>>8&255]^ye[255&l]^r[44],w=pe[e>>>24]^he[a>>>16&255]^me[l>>>8&255]^ye[255&t]^r[45],d=pe[a>>>24]^he[l>>>16&255]^me[t>>>8&255]^ye[255&e]^r[46],p=pe[l>>>24]^he[t>>>16&255]^me[e>>>8&255]^ye[255&a]^r[47],h=48),n>12&&(t=pe[f>>>24]^he[w>>>16&255]^me[d>>>8&255]^ye[255&p]^r[48],e=pe[w>>>24]^he[d>>>16&255]^me[p>>>8&255]^ye[255&f]^r[49],a=pe[d>>>24]^he[p>>>16&255]^me[f>>>8&255]^ye[255&w]^r[50],l=pe[p>>>24]^he[f>>>16&255]^me[w>>>8&255]^ye[255&d]^r[51],f=pe[t>>>24]^he[e>>>16&255]^me[a>>>8&255]^ye[255&l]^r[52],w=pe[e>>>24]^he[a>>>16&255]^me[l>>>8&255]^ye[255&t]^r[53],d=pe[a>>>24]^he[l>>>16&255]^me[t>>>8&255]^ye[255&e]^r[54],p=pe[l>>>24]^he[t>>>16&255]^me[e>>>8&255]^ye[255&a]^r[55],h=56),o[0]=(de[f>>>24]<<24|de[w>>>16&255]<<16|de[d>>>8&255]<<8|de[255&p])^r[h],o[1]=(de[w>>>24]<<24|de[d>>>16&255]<<16|de[p>>>8&255]<<8|de[255&f])^r[h+1],o[2]=(de[d>>>24]<<24|de[p>>>16&255]<<16|de[f>>>8&255]<<8|de[255&w])^r[h+2],o[3]=(de[p>>>24]<<24|de[f>>>16&255]<<16|de[w>>>8&255]<<8|de[255&d])^r[h+3]}}function Se(t){const e=function(){const t=new Int32Array(we),e=new Int32Array(16),r=new Uint8Array(ce),n=new DataView(r.buffer),o=new Uint8Array(8);let a=0,i=0;return{update:s,digest:function(){const e=8*i,r=Math.floor(e/4294967296),n=e>>>0;for(s(le,0,1);56!=a;)s(fe,0,1);o[0]=r>>>24,o[1]=r>>>16,o[2]=r>>>8,o[3]=r,o[4]=n>>>24,o[5]=n>>>16,o[6]=n>>>8,o[7]=n,s(o,0,8);const c=new Uint8Array(ue),u=new DataView(c.buffer);for(let e=0;e<t.length;e++)u.setInt32(4*e,t[e]);return t.set(we),a=0,i=0,c}};function s(t,e,o){const s=e+o;if(i+=o,a){for(;e<s&&a<ce;)r[a++]=t[e++];a==ce&&(c(n,0),a=0)}if(e+ce<=s){const r=new DataView(t.buffer,t.byteOffset,t.byteLength);for(;e+ce<=s;e+=ce)c(r,e)}for(;e<s;)r[a++]=t[e++]}function c(r,n){for(let t=0;t<16;t++)e[t]=r.getInt32(n+4*t);let o,a=t[0],i=t[1],s=t[2],c=t[3],u=t[4];for(let t=0;t<15;t+=5)u=(a<<5|a>>>27)+((s^c)&i^c)+u+1518500249+e[t]|0,i=i<<30|i>>>2,c=(u<<5|u>>>27)+((i^s)&a^s)+c+1518500249+e[t+1]|0,a=a<<30|a>>>2,s=(c<<5|c>>>27)+((a^i)&u^i)+s+1518500249+e[t+2]|0,u=u<<30|u>>>2,i=(s<<5|s>>>27)+((u^a)&c^a)+i+1518500249+e[t+3]|0,c=c<<30|c>>>2,a=(i<<5|i>>>27)+((c^u)&s^u)+a+1518500249+e[t+4]|0,s=s<<30|s>>>2;u=(a<<5|a>>>27)+((s^c)&i^c)+u+1518500249+e[15]|0,i=i<<30|i>>>2,o=e[13]^e[8]^e[2]^e[0],o=o<<1|o>>>31,e[0]=o,c=(u<<5|u>>>27)+((i^s)&a^s)+c+1518500249+o|0,a=a<<30|a>>>2,o=e[14]^e[9]^e[3]^e[1],o=o<<1|o>>>31,e[1]=o,s=(c<<5|c>>>27)+((a^i)&u^i)+s+1518500249+o|0,u=u<<30|u>>>2,o=e[15]^e[10]^e[4]^e[2],o=o<<1|o>>>31,e[2]=o,i=(s<<5|s>>>27)+((u^a)&c^a)+i+1518500249+o|0,c=c<<30|c>>>2,o=e[0]^e[11]^e[5]^e[3],o=o<<1|o>>>31,e[3]=o,a=(i<<5|i>>>27)+((c^u)&s^u)+a+1518500249+o|0,s=s<<30|s>>>2;for(let t=20;t<40;t+=5)o=e[t-3&15]^e[t-8&15]^e[t-14&15]^e[15&t],o=o<<1|o>>>31,e[15&t]=o,u=(a<<5|a>>>27)+(i^s^c)+u+1859775393+o|0,i=i<<30|i>>>2,o=e[t-2&15]^e[t-7&15]^e[t-13&15]^e[t+1&15],o=o<<1|o>>>31,e[t+1&15]=o,c=(u<<5|u>>>27)+(a^i^s)+c+1859775393+o|0,a=a<<30|a>>>2,o=e[t-1&15]^e[t-6&15]^e[t-12&15]^e[t+2&15],o=o<<1|o>>>31,e[t+2&15]=o,s=(c<<5|c>>>27)+(u^a^i)+s+1859775393+o|0,u=u<<30|u>>>2,o=e[15&t]^e[t-5&15]^e[t-11&15]^e[t+3&15],o=o<<1|o>>>31,e[t+3&15]=o,i=(s<<5|s>>>27)+(c^u^a)+i+1859775393+o|0,c=c<<30|c>>>2,o=e[t+1&15]^e[t-4&15]^e[t-10&15]^e[t+4&15],o=o<<1|o>>>31,e[t+4&15]=o,a=(i<<5|i>>>27)+(s^c^u)+a+1859775393+o|0,s=s<<30|s>>>2;for(let t=40;t<60;t+=5)o=e[t-3&15]^e[t-8&15]^e[t-14&15]^e[15&t],o=o<<1|o>>>31,e[15&t]=o,u=(a<<5|a>>>27)+(i&s|(i|s)&c)+u+2400959708+o|0,i=i<<30|i>>>2,o=e[t-2&15]^e[t-7&15]^e[t-13&15]^e[t+1&15],o=o<<1|o>>>31,e[t+1&15]=o,c=(u<<5|u>>>27)+(a&i|(a|i)&s)+c+2400959708+o|0,a=a<<30|a>>>2,o=e[t-1&15]^e[t-6&15]^e[t-12&15]^e[t+2&15],o=o<<1|o>>>31,e[t+2&15]=o,s=(c<<5|c>>>27)+(u&a|(u|a)&i)+s+2400959708+o|0,u=u<<30|u>>>2,o=e[15&t]^e[t-5&15]^e[t-11&15]^e[t+3&15],o=o<<1|o>>>31,e[t+3&15]=o,i=(s<<5|s>>>27)+(c&u|(c|u)&a)+i+2400959708+o|0,c=c<<30|c>>>2,o=e[t+1&15]^e[t-4&15]^e[t-10&15]^e[t+4&15],o=o<<1|o>>>31,e[t+4&15]=o,a=(i<<5|i>>>27)+(s&c|(s|c)&u)+a+2400959708+o|0,s=s<<30|s>>>2;for(let t=60;t<80;t+=5)o=e[t-3&15]^e[t-8&15]^e[t-14&15]^e[15&t],o=o<<1|o>>>31,e[15&t]=o,u=(a<<5|a>>>27)+(i^s^c)+u+3395469782+o|0,i=i<<30|i>>>2,o=e[t-2&15]^e[t-7&15]^e[t-13&15]^e[t+1&15],o=o<<1|o>>>31,e[t+1&15]=o,c=(u<<5|u>>>27)+(a^i^s)+c+3395469782+o|0,a=a<<30|a>>>2,o=e[t-1&15]^e[t-6&15]^e[t-12&15]^e[t+2&15],o=o<<1|o>>>31,e[t+2&15]=o,s=(c<<5|c>>>27)+(u^a^i)+s+3395469782+o|0,u=u<<30|u>>>2,o=e[15&t]^e[t-5&15]^e[t-11&15]^e[t+3&15],o=o<<1|o>>>31,e[t+3&15]=o,i=(s<<5|s>>>27)+(c^u^a)+i+3395469782+o|0,c=c<<30|c>>>2,o=e[t+1&15]^e[t-4&15]^e[t-10&15]^e[t+4&15],o=o<<1|o>>>31,e[t+4&15]=o,a=(i<<5|i>>>27)+(s^c^u)+a+3395469782+o|0,s=s<<30|s>>>2;t[0]=t[0]+a|0,t[1]=t[1]+i|0,t[2]=t[2]+s|0,t[3]=t[3]+c|0,t[4]=t[4]+u|0}}(),r=new Uint8Array(ce),n=new Uint8Array(ce);t.length>ce&&(e.update(t,0,t.length),t=e.digest());for(let e=0;e<ce;e++){const o=e<t.length?t[e]:0;r[e]=54^o,n[e]=92^o}return e.update(r,0,ce),{update(t,r,n){e.update(t,r,n)},digest(){const t=e.digest();e.update(n,0,ce),e.update(t,0,ue);const o=e.digest();return e.update(r,0,ce),o}}}function ge(t){return de[t>>>24]<<24|de[t>>>16&255]<<16|de[t>>>8&255]<<8|de[255&t]}function Ae(t){return t<<24|(65280&t)<<8|t>>>8&65280|t>>>24}function Re(t){return 255&(t<<1^27*(t>>7))}const ze=typeof crypto!=v&&typeof crypto.getRandomValues==N,xe="Invalid password",De="Invalid authentication code",Fe="zipjs-abort-check-password",Oe="Crypto API not supported";function Ie(t){if(ze)return crypto.getRandomValues(t);throw new Error(Oe)}const Ue={name:"PBKDF2"},Te=Object.assign({hash:{name:"HMAC"}},Ue),ke=Object.assign({iterations:1e3,hash:{name:"SHA-1"}},Ue),Ce=["deriveBits"],Me=[8,12,16],ve=[16,24,32],Ne=10,_e=typeof crypto!=v,je=_e&&crypto.subtle;let Pe=_e&&typeof je!=v&&typeof je.importKey==N&&typeof je.deriveBits==N,Be=be;class Le extends TransformStream{constructor({password:t,rawPassword:e,encryptionStrength:r,checkPasswordOnly:n,checkAuthenticationCode:o=!0}){const a={};super({start(){Ze(a,t,e,r)},async transform(t,e){const{password:r,strength:o,l:i,ready:s}=a;if(r?(await async function(t,e,r,n){const o=await qe(t,e,r,Ke(n,0,Me[e])),a=Ke(n,Me[e]);if(o[0]!=a[0]||o[1]!=a[1])throw Ge(t),new Error(xe)}(a,o,r,Ke(t,0,Me[o]+2)),t=Ke(t,Me[o]+2),n?(Ge(a),e.error(new Error(Fe))):i()):await s,a.h)return;const c=new Uint8Array(t.length-Ne-(t.length-Ne)%16);e.enqueue(He(a,t,c,0,Ne,!0))},async flush(t){const{m:e,S:r,ready:n}=a;if(e){if(await n,a.h)return;const i=Ke(r,r.length-Ne),s=new Uint8Array(Ke(r,0,r.length-Ne));e.process(s,!0);const c=e.digest();let u=r.length<Ne?1:0;for(let t=0;t<Ne;t++)u|=c[t]^i[t];if(u&&o)return void t.error(new Error(De));t.enqueue(s)}}}),Ve(this,a)}}class We extends TransformStream{constructor({password:t,rawPassword:e,encryptionStrength:r}){const n={};super({start(){Ze(n,t,e,r)},async transform(t,e){const{password:r,strength:o,l:a,ready:i}=n;let s=B;if(r?(s=await async function(t,e,r){const n=Ie(new Uint8Array(Me[e]));return Gt(n,await qe(t,e,r,n))}(n,o,r),a()):await i,n.h)return;const c=new Uint8Array(s.length+t.length-t.length%16);c.set(s,0),e.enqueue(He(n,t,c,s.length,0,!1))},async flush(t){const{m:e,S:r,ready:o}=n;if(e){if(await o,n.h)return;const a=new Uint8Array(r);e.process(a,!1);const i=Ke(e.digest(),0,Ne);t.enqueue(Gt(a,i))}}}),Ve(this,n)}}function Ze(t,e,r,n){Object.assign(t,{ready:new Promise(e=>t.l=e),password:Ye(e,r),strength:n-1,S:B,h:!1})}function Ve(t,e){const r=t.readable.getReader(),n=new ReadableStream({async pull(t){try{const{value:e,done:n}=await r.read();n?t.close():t.enqueue(e)}catch(t){throw Ge(e),r.cancel(t).catch(()=>{}),t}},cancel:t=>(Ge(e),r.cancel(t))});Object.defineProperty(t,"readable",{get:()=>n})}function He(t,e,r,n,o,a){const{m:i,S:s}=t;s.length&&(e=Gt(s,e));const c=e.length-o,u=c-c%16;if(r=function(t,e){if(e&&e>t.length){const r=t;(t=new Uint8Array(e)).set(r,0)}return t}(r,n+u),u){const t=Ke(r,n,n+u);t.set(Ke(e,0,u)),i.process(t,a)}return t.S=Ke(e,u),r}function Ge(t){const{m:e}=t;t.h=!0,e&&e.dispose&&e.dispose()}async function qe(t,e,r,n){t.password=null;const o=ve[e],a=await async function(t,e,r){if(Pe)try{const n=await je.importKey("raw",t,Te,!1,Ce);return new Uint8Array(await je.deriveBits(Object.assign({salt:e},ke),n,8*r))}catch{Pe=!1}return function(t,e,r,n){const o=Se(t),a=new Uint8Array(n),i=new Uint8Array(e.length+4),s=new DataView(i.buffer);i.set(e);for(let t=1,r=0;r<n;t++,r+=ue){s.setUint32(e.length,t),o.update(i,0,i.length);let c=o.digest();const u=c.slice();for(let t=1;t<1e3;t++){o.update(c,0,ue),c=o.digest();for(let t=0;t<ue;t++)u[t]^=c[t]}a.set(u.subarray(0,Math.min(ue,n-r)),r)}return a}(t,e,0,r)}(r,n,2*o+2);return t.m=Be(Ke(a,0,o),Ke(a,o,2*o)),t.h&&Ge(t),Ke(a,2*o)}function Ye(t,e){return e===U?se(t):e}function Ke(t,e,r){return t.subarray(e,r)}class Xe extends TransformStream{constructor({password:t,rawPassword:e,passwordVerification:r,checkPasswordOnly:n}){super({start(){Je(this,t,e,r)},transform(t,e){const r=this;if(r.password||r.rawPassword){const e=Qe(r,t.subarray(0,12));if(r.password=r.rawPassword=null,0!=(e[11]^r.passwordVerification))throw new Error(xe);t=t.subarray(12)}n?e.error(new Error(Fe)):e.enqueue(Qe(r,t))}})}}class $e extends TransformStream{constructor({password:t,rawPassword:e,passwordVerification:r}){super({start(){Je(this,t,e,r)},transform(t,e){const r=this;let n,o;if(r.password||r.rawPassword){r.password=r.rawPassword=null;const e=Ie(new Uint8Array(12));e[11]=r.passwordVerification,n=new Uint8Array(t.length+e.length),n.set(tr(r,e),0),o=12}else n=new Uint8Array(t.length),o=0;n.set(tr(r,t),o),e.enqueue(n)}})}}function Je(t,e,r,n){Object.assign(t,{password:e,rawPassword:r,passwordVerification:n}),function(t,e,r){const n=[305419896,591751049,878082192];if(Object.assign(t,{A:n,R:new ae(n[0]),D:new ae(n[2])}),r)for(let e=0;e<r.length;e++)er(t,r[e]);else for(let r=0;r<e.length;r++)er(t,e.charCodeAt(r))}(t,e,r)}function Qe(t,e){const r=new Uint8Array(e.length);for(let n=0;n<e.length;n++)r[n]=rr(t)^e[n],er(t,r[n]);return r}function tr(t,e){const r=new Uint8Array(e.length);for(let n=0;n<e.length;n++)r[n]=rr(t)^e[n],er(t,e[n]);return r}function er(t,e){let[,r]=t.A;t.R.append([e]);const n=~t.R.get();r=or(Math.imul(or(r+nr(n)),134775813)+1),t.D.append([r>>>24]);const o=~t.D.get();t.A=[n,r,o]}function rr(t){const e=2|t.A[2];return nr(Math.imul(e,1^e)>>>8)}function nr(t){return 255&t}function or(t){return 4294967295&t}function ar(t){if(t instanceof ReadableStream)return t;const e=t.getReader();return new ReadableStream({async pull(t){try{const{value:r,done:n}=await e.read();n?t.close():t.enqueue(r)}catch(t){throw e.cancel(t).catch(()=>{}),t}},cancel:t=>e.cancel(t)})}function ir(t,e){t=ar(t);const r=e?{type:e}:{};if(typeof Blob.prototype.stream!=N||new Blob([]).stream()instanceof ReadableStream)return new Response(t).blob().then(t=>e?new Blob([t],r):t);const n=[];return t.pipeTo(new WritableStream({write(t){n.push(t)}})).then(()=>new Blob(n,r))}function sr(t){if(t instanceof WritableStream)return t;const e=t.getWriter();return new WritableStream({write:t=>e.write(t),close:()=>e.close(),abort:t=>e.abort(t)})}const cr="Invalid codec definition",ur="Reserved compression method",lr="Invalid codec module",fr="Compression method not supported",wr=[0,8,9,99],dr=new Map,pr=new Map;function hr(t={}){const{compressionMethod:r,format:n,codecURI:o,CompressionStream:a,DecompressionStream:i,versionNeeded:s}=t;if(!Number.isInteger(r)||r<0||r>e||typeof n!=j||!n.length)throw new Error(cr);if(wr.includes(r))throw new Error(ur);const c=typeof a==N||typeof i==N;if(!(c||typeof o==j&&o.length))throw new Error(cr);dr.set(r,{compressionMethod:r,format:n,codecURI:o,versionNeeded:s}),c&&Sr(n,{CompressionStream:a,DecompressionStream:i})}function mr(t){const e=dr.get(t);if(e){let r;dr.delete(t),dr.forEach(t=>r=r||t.format==e.format),r||pr.delete(e.format)}}function yr(t){return dr.get(t)}function Er(){return Array.from(dr.values(),t=>Object.assign({},t,pr.get(t.format)))}function br(t){return pr.get(t)}function Sr(t,e){const{CompressionStream:r,DecompressionStream:n}=e;if(typeof r!=N&&typeof n!=N)throw new Error(lr);pr.set(t,{CompressionStream:r,DecompressionStream:n})}const gr="Invalid uncompressed size",Ar="Invalid compressed data",Rr="Codec out of memory",zr="Invalid CRC32",xr="deflate-raw",Dr="deflate64-raw",Fr="gzip",Or=[31,139,8];class Ir extends TransformStream{constructor(t,{chunkSize:e,CompressionStreamFallback:r,CompressionStream:n}){super({});const{compressed:o,encrypted:a,useCompressionStream:i,zipCrypto:s,computeCrc32:c,level:u,deflate64:l,format:f,compressionMethod:w,inputSize:d}=t,p=this;let h,m,y,E=super.readable;const b=f&&br(f),S=_r(i,n,r),g=c&&o&&!l&&!b&&(!a||s)&&Boolean(S);if(a&&!s||!c||g||(h=new ie,E=Pr(E,h)),o)if(b)E=Br(E,Nr(b.CompressionStream,f,{level:u,chunkSize:e,compressionMethod:w,uncompressedSize:d}));else if(g)y=new Ur,E=Br(E,new S(Fr,{level:u,chunkSize:e})),E=Pr(E,y);else try{E=jr(E,i,{level:u,chunkSize:e},n,r)}catch(t){if(!i&&r)throw Hr(t);let e;try{e=new n(Fr)}catch{throw Hr(t)}E=Br(E,e),E=Pr(E,new Ur)}a&&(s?E=Pr(E,new $e(t)):(m=new We(t),E=Pr(E,m))),vr(p,E,()=>{a&&!s||!c||(p.crc32=g?y.crc32:new DataView(h.value.buffer).getUint32(0))})}}class Ur extends TransformStream{constructor(){let t,e=10,r=new Uint8Array(0);super({transform(t,n){if(e){const r=Math.min(e,t.length);if(e-=r,!(t=t.subarray(r)).length)return}const o=r.length+t.length;if(o<=8)return void(r=Gt(r,t));const a=o-8,i=Math.min(a,r.length);n.enqueue(Gt(r.subarray(0,i),t.subarray(0,a-i))),r=Gt(r.subarray(i),t.subarray(a-i))},flush(){const e=Yt(r);t.crc32=e.getUint32(0,!0),t.uncompressedSize=e.getUint32(4,!0)}}),t=this}}class Tr extends TransformStream{constructor(t,{chunkSize:e,DecompressionStreamFallback:r,DecompressionStream:n}){super({});const{zipCrypto:o,encrypted:a,checkCrc32:i,crc32:s,compressed:c,useCompressionStream:u,deflate64:l,format:f,compressionMethod:w,rawBitFlag:d,outputSize:p}=t;let h,m,y,E=super.readable;if(a&&(o?E=Pr(E,new Xe(t)):(m=new Le(t),E=Pr(E,m))),c){const t=new Set,o=f&&br(f);let a;if(o)E=Br(E,Nr(o.DecompressionStream,f,{chunkSize:e,compressionMethod:w,rawBitFlag:d,uncompressedSize:p}),t);else{const o=_r(u,n,r);if(i&&!l&&s!==U&&p!==U&&o)try{a=new o(Fr,{chunkSize:e})}catch{a=U}if(!a)try{E=jr(E,u,{chunkSize:e,deflate64:l},n,r,t)}catch(t){if(l||p===U||!u&&r)throw Hr(t);try{a=new n(Fr)}catch{throw Hr(t)}}}a?(y=!0,E=function(t,e,r,n,o){const a=e.writable.getWriter(),i=e.readable.getReader(),s=n===U?new ae:U;let c,u,l=0,f=!1,w=!1;const d=new ReadableStream({start(t){u=t},pull(){m()},cancel:t=>(w=!0,m(),i.cancel(t))});return async function(){const e=t.getReader();try{const t=new Uint8Array(10);for(t.set(Or),await a.write(t);;){await h(),await a.ready;const{value:t,done:r}=await Zr(e,o);if(r)break;await a.write(t)}s&&await a.write(new Uint8Array(0));const i=new Uint8Array(8),c=Yt(i);c.setUint32(0,s?s.get():n,!0),c.setUint32(4,r,!0),f=!0,await a.write(i),await a.close()}catch(t){await Lr(a,t),await Wr(e,t)}}(),async function(){try{for(;;){const{value:t,done:e}=await p();if(e)break;if(l+=t.length,l>r)throw new Error(gr);s&&s.append(t),u.enqueue(t)}w||(w=!0,u.close())}catch(t){!function(t){w||(w=!0,u.error(t),m())}(t),await Wr(i,t)}}(),d;function p(){return i.read().catch(t=>{if(f){if(!s)throw qr(t,zr);if(l!=r)throw qr(t,gr);return{done:!0}}throw Vr(t,o)})}function h(){if(!w&&u.desiredSize<=0)return new Promise(t=>c=t)}function m(){if(c){const t=c;c=U,t()}}}(E,a,p,s,t)):E=function(t,e){const r=t.getReader();return new ReadableStream({async pull(t){try{const{value:e,done:n}=await r.read();n?t.close():t.enqueue(e)}catch(t){throw await Wr(r,t),Vr(t,e)}},cancel:t=>r.cancel(t)})}(E,t)}i&&!y&&(h=new ie,E=Pr(E,h)),vr(this,E,()=>{if(h){const t=new DataView(h.value.buffer).getUint32(0,!1);if(s!=t)throw new Error(zr)}})}}const kr=new Map;function Cr(t,e){if(!t)return!1;let r=kr.get(t);r||(r=new Map,kr.set(t,r));let n=r.get(e);if(n===U){try{new t(e),n=!0}catch{n=!1}r.set(e,n)}return n}function Mr(t){return Cr(t,xr)}function vr(t,e,r){e=Pr(e,new TransformStream({flush:r})),Object.defineProperty(t,"readable",{get:()=>e})}function Nr(t,e,r){if(!t)throw new Error(fr);return new t(e,r)}function _r(t,e,r){return t&&e?e:r&&r.requiresModule?r:void 0}function jr(t,e,r,n,o,a){const i=e&&n?n:o||n,s=r.deflate64?Dr:xr;let c;try{c=new i(s,r)}catch(t){if(!e||!o||i==o)throw t;c=new o(s,r)}return Br(t,c,a)}function Pr(t,e){return ar(t).pipeThrough(e)}function Br(t,e,r){const n=e.writable.getWriter(),o=t.getReader();return async function(){try{for(;;){await n.ready;const t=await Zr(o,r);if(t.done){await n.close();break}await n.write(t.value)}}catch(t){await Lr(n,t),await Wr(o,t)}}(),e.readable}async function Lr(t,e){try{await t.abort(e)}catch{}}async function Wr(t,e){try{await t.cancel(e)}catch{}}function Zr(t,e){const r=t.read();return e?r.catch(t=>{throw e.add(t),t}):r}function Vr(t,e){return e.has(t)?t:qr(t,Gr(t)?Rr:Ar)}function Hr(t){return Gr(t)?qr(t,Rr):t}function Gr(t){return Kt(t)&&"Z_MEM_ERROR"==t.code}function qr(t,e){const r=new Error(e);return r.cause=t,r}const Yr="data",Kr="deflate",Xr="inflate";class $r extends TransformStream{constructor(t,e){super({});const r=this,{codecType:n}=t;let o;n.startsWith(Kr)?o=Ir:n.startsWith(Xr)&&(o=Tr),r.outputSize=0;let a=0;const i=new o(t,e),s=super.readable,c=new TransformStream({transform(t,e){t&&t.length&&(a+=t.length,e.enqueue(t))},flush(){Object.assign(r,{inputSize:a})}}),u=new TransformStream({transform(e,n){if(e&&e.length&&(n.enqueue(e),r.outputSize+=e.length,t.outputSize!==U&&r.outputSize>t.outputSize))throw new Error(gr)},flush(){const{crc32:t}=i;Object.assign(r,{crc32:t,inputSize:a})}});Object.defineProperty(r,"readable",{get:()=>s.pipeThrough(c).pipeThrough(i).pipeThrough(u)})}}class Jr extends TransformStream{constructor(t){const e=[];let r=0,n=0;function o(){const n=new Uint8Array(t);let o=0;for(;o<t;){const r=e[0],a=t-o;r.length<=a?(n.set(r,o),o+=r.length,e.shift()):(n.set(r.subarray(0,a),o),e[0]=r.subarray(a),o+=a)}return r-=t,n}(!Number.isFinite(t)||t<1)&&(t=262144),super({transform(a,i){for(e.push(a),r+=a.length;r>t;)n+=t,i.enqueue(o())},flush(t){r&&(n+=r,t.enqueue(function(t,e){const r=new Uint8Array(e);let n=0;for(const e of t)r.set(e,n),n+=e.length;return r}(e,r)))}}),Object.defineProperty(this,"outputSize",{get:()=>n})}}const Qr="Worker startup timeout";let tn,en,rn,nn=()=>{};async function on(t){const{CompressionStream:e,CompressionStreamFallback:r}=t;return!(!r||r.requiresModule)||!(!Mr(e)&&(n=e,!Cr(n,Fr)))||!!r&&await an(t);var n}async function an(t){if(nn)try{return await nn(t),!0}catch{}return!1}function sn(t){t.createWorker?en=!0:tn=!1}class cn{constructor(t,{readable:e,writable:r},n,o){const{options:a,config:i,F:s,useWebWorkers:c,workerURI:u}=n;let{createWorker:l}=n;const{signal:f}=s;return en&&(l=U),Object.assign(t,{O:!0,I:(t.I||0)+1,readable:e.pipeThrough(new Jr(jt(i))).pipeThrough(new un(s),{signal:f}),writable:r,options:Object.assign({},a),U:n,workerURI:u,createWorker:l,terminate:()=>new Promise(e=>{const{T:r,O:n}=t;n?(t.C=t.C||[],t.C.push(e)):(r&&(r.terminate(),t.T=null),e()),t.M=null}),v(){if(t.O){const{C:e,T:r}=t;e&&(t.C=null,r&&(t.N=!0,r.terminate())),t.O=!1;const n=o(t);e&&e.forEach(t=>t(n))}}}),tn===U&&(tn=typeof Worker!=v),(c&&rn&&(tn&&u||l)?rn:fn)(t,i)}}class un extends TransformStream{constructor({onstart:t,onprogress:e,size:r,onend:n}){let o=0;super({async start(){t&&await ln(t,r)},async transform(t,n){o+=t.length,e&&await ln(e,o,r),n.enqueue(t)},async flush(){n&&await ln(n,o)}})}}async function ln(t,...e){try{await t(...e)}catch{}}function fn(t,e){return{run:()=>wn(t,e)}}async function wn({options:t,readable:e,writable:r,v:n,U:o},a){let i,s,c;try{if(t.compressed&&!t.format){const e=t.codecType.startsWith(Kr),r=e?a.CompressionStreamFallback:a.DecompressionStreamFallback,n=e?a.CompressionStream:a.DecompressionStream;t.useCompressionStream?r&&r.requiresModule&&!Mr(n)&&await u():await u()||r&&!r.requiresModule||(t.useCompressionStream=!0)}t.encrypted&&!t.zipCrypto&&await u(),i=new $r(t,a),s=new Jr(jt(a));const{signal:n}=o.F;await e.pipeThrough(i).pipeThrough(s).pipeTo(r,{preventClose:!0,preventAbort:!0,signal:n});const{crc32:c,inputSize:l,outputSize:f}=i;return{crc32:c,inputSize:l,outputSize:f}}catch(t){if(i){const e=s?s.outputSize:0;if(o.outputSize=e,Kt(t))try{t.outputSize=e}catch{}}throw t}finally{n()}function u(){return c||(c=an(a)),c}}const dn={type:"module"},pn="error",hn="abort";let mn,yn,En;var bn;function Sn(t){const{reader:e}=t;e&&e.releaseLock(),t.reader=null,t.writer=null}function gn(t){const{T:e}=t;if(e)try{e.terminate()}catch{}t.M=null}function An(t,e,r,n,o=!0){const{createWorker:a}=r;let i,s,c;if(a)i=a();else if(yn===U||mn!==t){const a=typeof t==N;s=a?t(o):t;const u=s.startsWith("data:"),l=s.startsWith("blob:");if(u||l){n===U&&(n=!1),n&&(c=dn);try{i=new Worker(s,c)}catch(o){if(l)try{URL.revokeObjectURL(s)}catch{}if(a&&l)return An(t,e,r,n,!1);if(n)throw o;return An(t,e,r,!0,!1)}}else{n===U&&(n=!0),n&&(c=dn);try{s=new URL(s,e)}catch{}try{i=new Worker(s,c)}catch(a){if(n)return An(t,e,r,!1,o);throw a}}mn=t,yn=s,En=c}else i=new Worker(yn,En);return i.addEventListener("message",t=>{r._=!0,Rn(r),async function({data:t},e){const{type:r,value:n,messageId:o,result:a,error:i,errorValue:s}=t,{reader:c,writer:u,j:l,P:f,v:w,I:d}=e,p=()=>e.I!=d;try{if(i)h(function(t,e){const{message:r,stack:n,code:o,name:a,outputSize:i,cause:s,codecImportFailed:c}=t;let u;if(u=e?e.value:Object.assign(new Error(r),{stack:n,code:o,name:a}),Kt(u))try{i!==U&&(u.outputSize=i),c&&(u.codecImportFailed=!0),s&&(Kt(u.cause)||(u.cause=Object.assign(new Error(s.message),{name:s.name})),s.code!==U&&u.cause.code!==s.code&&(u.cause.code=s.code)),e&&(u.name!==a&&(u.name=a),u.code!==o&&(u.code=o))}catch{}return u}(i,s));else{if("pull"==r){const{value:t,done:r}=await c.read();p()||xn({type:Yr,value:t,done:r,messageId:o},e)}if(r==Yr){const t=new Uint8Array(n);await u.ready,await u.write(t),p()||xn({type:"ack",messageId:o},e)}"close"==r&&function(t){p()||(l(t),m(),w())}(a)}}catch(i){p()||(gn(e),h(i))}function h(t){p()||(f(t),m(),Kt(t)&&t.codecImportFailed||w())}function m(){u&&u.releaseLock()}}(t,r)}),i.addEventListener(pn,t=>zn(t,r)),i.addEventListener("messageerror",t=>zn(t,r)),i}function Rn(t){const{B:e}=t;e&&(clearTimeout(e),t.B=null)}function zn(t,e){t.preventDefault&&t.preventDefault(),Rn(e);const{_:r,P:n,writer:o,v:a}=e;gn(e),r||(e.T=null);let i=t.error||new Error(t.message||pn);r||(i=Object.assign(new Error(i.message||pn),{L:!0}),e.W=i),n&&(n(i),o&&o.releaseLock(),r&&a())}function xn(t,{T:e,writer:r}){try{const{value:r}=t;if(r){t.value=qt(r);try{e.postMessage(t,[t.value.buffer])}catch{e.postMessage(t)}}else e.postMessage(t)}catch(t){throw r&&r.releaseLock(),t}}bn=function(t,e){const{baseURI:r,chunkSize:n,workerStartupTimeout:o}=e;let{wasmURI:a}=e;if(!t.M){let i;typeof a==N&&(a=a());try{i=An(t.workerURI,r,t)}catch{return sn(t),fn(t,e)}Object.assign(t,{T:i,_:!1,N:!1,W:null,M:{run:async()=>{try{return await async function(t,e){if(!t.T){const{W:e}=t;t.W=null;const r=e||new Error(Qr);throw r.L=!0,r}let r,n;const o=new Promise((e,o)=>{r=e,n=e=>{const{outputSize:r,U:n}=t;if(n.outputSize=r,Kt(e))try{e.outputSize=r}catch{}o(e)}});Object.assign(t,{reader:null,writer:null,outputSize:0,Z:!1,V:null,j:r,P:n,result:o});const{readable:a,options:i}=t,{writable:s,closed:c,H:u}=function(t,e){const r=new AbortController;let n;const{writable:o,readable:a}=new TransformStream({transform(t,r){e.outputSize+=t.length,r.enqueue(t)}}),i=a.pipeTo(t,{preventClose:!0,preventAbort:!0,signal:r.signal});i.catch(t=>{n||Object.assign(e,{Z:!0,V:t})});const{signal:s}=e.U.F;if(s){const t=()=>r.abort(s.reason),e=()=>s.removeEventListener(hn,t);s.addEventListener(hn,t),i.then(e,e)}return{writable:o,closed:i,H:()=>{n=!0,r.abort()}}}(t.writable,t);try{xn({type:"start",options:i,config:e},t)}catch(e){u();try{await c}catch{}throw t.v(),e}Object.assign(t,{reader:a.getReader(),writer:s.getWriter()});const{workerStartupTimeout:l}=e;!t._&&Number.isFinite(l)&&l>=0&&(t.B=setTimeout(()=>function(t){if(t.B=null,t._)return;const{P:e,writer:r}=t;if(gn(t),t.T=null,e){const t=new Error(Qr);t.L=!0,e(t),r&&r.releaseLock()}}(t),l));try{const t=await o;return await f(),await c,t}catch(e){await f(),u();try{await c}catch{}const{outputSize:r,U:n,Z:o,V:a}=t;n.outputSize=r;const i=Kt(e)&&(e.codecImportFailed||e.L),s=o&&!i?a:e;if(Kt(s))try{s.outputSize=r}catch{}throw s}async function f(){if(!s.locked)try{await s.getWriter().close()}catch{}}}(t,{chunkSize:n,wasmURI:a,baseURI:r,workerStartupTimeout:o})}catch(r){if(r&&r.L)return sn(t),Sn(t),wn(t,e);if(r&&r.codecImportFailed){if(t.reader)return Sn(t),wn(t,e);t.v()}throw r}}}})}return t.M},rn=bn;let Dn=[];const Fn=[];let On,In,Un=0;async function Tn(t,e){const{options:r,config:n}=e,{useWebWorkers:o,useCompressionStream:a,compressed:i,checkCrc32:s,computeCrc32:c,encrypted:u,format:l,codecURI:f}=r,{workerURI:w,createWorker:d,maxWorkers:p}=n;l&&(f&&(r.codecURI=function(t,e){try{return new URL(t,e).toString()}catch{return t}}(f,n.baseURI)),await async function(t,e){!pr.has(t)&&e&&Sr(t,await(import(/* webpackIgnore: true */ /* @vite-ignore */e)))}(l,r.codecURI));const h=!(i||s||c||u),m=l===U||Boolean(r.codecURI);return e.useWebWorkers=!h&&m&&(o||o===U&&n.useWebWorkers),e.workerURI=e.useWebWorkers&&w?w:U,e.createWorker=e.useWebWorkers&&d?d:U,r.useCompressionStream=a||a===U&&n.useCompressionStream,(await async function(){const r=Dn.find(t=>!t.O);if(r)return jn(r),new cn(r,t,e,y);if(Dn.length<p){const r={G:Un};return Un++,Dn.push(r),new cn(r,t,e,y)}return new Promise(r=>{Fn.push({resolve:r,stream:t,U:e}),In=n.workerStarvationTimeout,kn()})}()).run();function y(t){if(Cn(),t.N)return t.N=!1,vn();if(Fn.length){const[{resolve:e,stream:r,U:n}]=Fn.splice(0,1);e(new cn(t,r,n,y)),kn()}else t.T?(jn(t),function(t,e){const{config:r}=e,{terminateWorkerTimeout:n}=r;Number.isFinite(n)&&n>=0&&(t.Y=setTimeout(async()=>{Dn=Dn.filter(e=>e!=t);try{await t.terminate()}catch{}},n))}(t,e)):Dn=Dn.filter(e=>e!=t)}}function kn(){!On&&Fn.length&&Number.isFinite(In)&&In>=0&&(On=setTimeout(Mn,In))}function Cn(){On&&(clearTimeout(On),On=null)}function Mn(){if(On=null,Fn.length){const[{resolve:t,stream:e,U:r}]=Fn.splice(0,1);t(new cn({},e,Nn(r),_n)),kn()}}function vn(){const t=Fn.splice(0).map(({resolve:t,stream:e,U:r})=>new Promise(n=>{t(new cn({},e,Nn(r),()=>{_n(),n()}))}));return Cn(),Promise.all(t)}function Nn(t){return Object.assign({},t,{useWebWorkers:!1,workerURI:U,createWorker:U})}function _n(){Cn(),kn()}function jn(t){const{Y:e}=t;e&&(clearTimeout(e),t.Y=null)}const Pn="\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 Bn(t,e){return Wn(t,e,!0)}function Ln(t){if(!t.some(t=>t>127))return!1;try{return new TextDecoder("utf-8",{fatal:!0}).decode(t),!0}catch{return!1}}function Wn(t,e,r){return e&&"cp437"==e.trim().toLowerCase()?function(t){let e="";for(let r=0;r<t.length;r++)e+=Pn[t[r]];return e}(t):new TextDecoder(e,{ignoreBOM:r}).decode(t)}const Zn="HTTP error ",Vn="HTTP Range not supported",Hn="HTTP resource changed",Gn="Writer iterator completed too soon",qn="Writer not initialized",Yn="Invalid writer (size must be writable)",Kn="Content-Range",Xn="Range",$n="GET",Jn="bytes",Qn=16777216,to="writable",eo=Symbol();class ro{constructor(){this.size=0}init(){this.initialized=!0}}class no extends ro{get readable(){return this.createReadable()}createReadable({offset:t=0,size:e,chunkSize:r=jt(_t())}={}){const n=this;let o=0;return r=Pt(r),new ReadableStream({async pull(a){const i=e===U?r:Math.min(r,e-o),s=await Vo(n,t+o,i);s.length&&(a.enqueue(s),o+=s.length),(e!==U&&o>=e||!s.length&&i)&&a.close()}})}}class oo extends ro{constructor(){super();const t=this,e=new WritableStream({write(e){if(!t.initialized)throw new Error(qn);return t.writeUint8Array(qt(e))}});Object.defineProperty(t,to,{get:()=>e})}writeUint8Array(){}}class ao extends no{constructor(t){super();let e=t.length;for(;"="==t.charAt(e-1);)e--;const r=t.indexOf(",")+1;Object.assign(this,{K:t,X:r,size:Math.floor(.75*(e-r))})}readUint8Array(t,e){const{X:r,K:n}=this,o=new Uint8Array(e),a=4*Math.floor(t/3),i=atob(n.substring(a+r,4*Math.ceil((t+e)/3)+r)),s=t-3*Math.floor(a/4);let c=0;for(let t=s;t<s+e&&t<i.length;t++)o[t-s]=i.charCodeAt(t),c++;return c<o.length?o.subarray(0,c):o}}class io extends oo{constructor(t){super(),Object.assign(this,{contentType:t,data:"data:"+(t||"")+";base64,",$:""})}writeUint8Array(t){const e=this;let r,n=e.$;const o=e.$.length;for(e.$="",r=0;r<3*Math.floor((o+t.length)/3)-o;r++)n+=String.fromCharCode(t[r]);for(;r<t.length;r++)e.$+=String.fromCharCode(t[r]);n.length>2?e.data+=btoa(n):e.$=n+e.$}getData(){return this.data+btoa(this.$)}}let so,co;class uo extends no{constructor(t){super(),Object.assign(this,{J:t,size:t.size}),co||(co=(async()=>{try{const t=new Blob([new Uint8Array(3)]).slice(1,2).stream().getReader();let e=0,r=await t.read();for(;!r.done;)e+=r.value.length,r=await t.read();so=1==e}catch{so=!1}})())}createReadable(t){const{J:e,size:r}=this,{offset:n=0,size:o=r-n}=t||{};if(typeof e.stream==N){if(!n&&o>=r)return ar(e.stream());if(so)return ar(e.slice(n,n+o).stream())}return super.createReadable(t)}async readUint8Array(t,e){const r=this,n=t+e,o=!t&&n>=r.size?r.J:r.J.slice(t,n);let a=await o.arrayBuffer();return a.byteLength>e&&(a=a.slice(t,n)),new Uint8Array(a)}}class lo extends ro{constructor(t){super();const e=this,r=new TransformStream;Object.defineProperty(e,to,{get:()=>r.writable}),e.contentType=t,e.et=ir(r.readable,t),e.et.catch(()=>{})}getData(){return this.et}}class fo extends uo{constructor(t){super(new Blob([t],{type:"text/plain"}))}}function wo(t){let e=0;for(let r=0;r<t.length;r++){const n=t.charCodeAt(r);n<128?e+=1:n<2048?e+=2:n<55296||n>=57344?e+=3:n<56320&&56320==(64512&t.charCodeAt(r+1))?(e+=4,r++):e+=3}return e}class po extends lo{constructor(t){super(),Object.assign(this,{encoding:t,nt:!t||"utf-8"==t.toLowerCase()})}async getData(){const{encoding:t,nt:e}=this,r=await super.getData();return r.text&&e?r.text():function(t,e){return Wn(t,e,!1)}(new Uint8Array(await r.arrayBuffer()),t)}}class ho extends no{constructor(t,e){super(),yo(this,t,e)}async init(){await Eo(this,To,Fo),super.init()}createReadable(t){const e=this,{useRangeHeader:r,forceRangeRequests:n,size:o,ot:a}=e;if((r||n)&&o!==U){const{offset:r=0,size:n=o-r}=t||{},i=a&&r>=o-a.length;if(n>0&&r<o&&!i)return function(t,e,r){let n,o=e,a=0,i=r;return new ReadableStream({start:()=>s(),async pull(t){n||await s();const{value:e,done:r}=await n.read();if(r)throw new Error(Vn);const o=e.length>a?e.subarray(0,a):e;a-=o.length,i-=o.length,o.length&&t.enqueue(o),a||(await async function(){const t=n;n=U,await t.cancel()}(),i||t.close())},cancel:t=>n&&n.cancel(t)});async function s(){const e=Math.min(t.maximumRangeSize,i),r=await To($n,t,xo(t,o,e));if(206!=r.status)throw new Error(Vn);const s=So(r);if(s!==U&&s!=o)throw new Error(Vn);zo(t,r),Ro(t,r),o+=e,a=e,n=r.body.getReader()}}(e,r,Math.min(n,o-r))}return super.createReadable(t)}readUint8Array(t,e){return bo(this,t,e,To,Fo)}}class mo extends no{constructor(t,e){super(),yo(this,t,e)}async init(){await Eo(this,ko,Oo),super.init()}readUint8Array(t,e){return bo(this,t,e,ko,Oo)}}function yo(t,e,r){const{preventHeadRequest:n,useRangeHeader:o,forceRangeRequests:a,combineSizeEocd:i,checkResourceChanges:s=!0,maximumRangeSize:c=Qn,fetch:u}=r;delete(r=Object.assign({},r)).preventHeadRequest,delete r.useRangeHeader,delete r.forceRangeRequests,delete r.combineSizeEocd,delete r.checkResourceChanges,delete r.maximumRangeSize,delete r.useXHR,delete r.fetch,Object.assign(t,{url:e,options:r,preventHeadRequest:n,useRangeHeader:o,forceRangeRequests:a,combineSizeEocd:i,checkResourceChanges:s,maximumRangeSize:c,fetch:u})}async function Eo(t,e,r){const{url:n,preventHeadRequest:o,useRangeHeader:a,forceRangeRequests:i,combineSizeEocd:s}=t;if(function(t){const{baseURI:e}=_t(),{protocol:r}=new URL(t,e);return"http:"==r||"https:"==r}(n)&&(a||i)&&(typeof o==v||o)){const n=await e($n,t,xo(t,s?-65557:void 0)),o=n.headers.get("Accept-Ranges");if(!(i||o&&o.toLowerCase()==Jn))throw new Error(Vn);{let o;s&&206==n.status&&(o=new Uint8Array(await n.arrayBuffer())),Ro(t,n);const a=go(n);a===U?await Uo(t,e,r):t.size=a,o&&o.length&&So(n)===t.size-o.length&&(t.ot=o)}}else await Uo(t,e,r)}async function bo(t,e,r,n,o){const{useRangeHeader:a,forceRangeRequests:i,ot:s,size:c,options:u}=t;if(a||i){if(e>=c||0===r)return B;{if(e+r>c&&(r=c-e),s&&e>=c-s.length){const t=e-(c-s.length);return s.slice(t,t+r)}const o=await n($n,t,xo(t,e,r));if(206!=o.status)throw new Error(Vn);const a=So(o);if(a!==U&&a!=e)throw new Error(Vn);zo(t,o),Ro(t,o);const i=new Uint8Array(await o.arrayBuffer());if(i.length!=r)throw new Error(Vn);return i}}{const{data:n}=t;return n||await o(t,u),t.data.subarray(e,e+r)}}function So(t){const e=t.headers.get(Kn);if(e){const t=Number(e.trim().split(/[\s-]+/)[1]);if(!Number.isNaN(t))return t}}function go(t){const e=t.headers.get(Kn);if(e){const t=e.trim().split(/\s*\/\s*/)[1];if(t&&"*"!=t){const e=Number(t);if(!Number.isNaN(e))return e}}}function Ao({headers:t}){return{it:t.get("Etag")||U,lastModified:t.get("Last-Modified")||U}}function Ro(t,e){const{checkResourceChanges:r,st:n}=t;r&&!n&&206==e.status&&(t.st=Ao(e))}function zo(t,e){const{checkResourceChanges:r,st:n,size:o}=t;if(r){const t=go(e);if(t!==U&&o!==U&&t!=o)throw new Error(Hn);if(n){const t=Ao(e);if(Object.entries(n).some(([e,r])=>r!==U&&t[e]!==U&&r!=t[e]))throw new Error(Hn)}}}function xo(t,e=0,r=1){return Object.assign({},Do(t),{[Xn]:Jn+"="+(e<0?e:e+"-"+(e+r-1))})}function Do({options:t}){const{headers:e}=t;if(e)return Symbol.iterator in e?Object.fromEntries(e):e}async function Fo(t){await Io(t,To)}async function Oo(t){await Io(t,ko)}async function Io(t,e){const r=await e($n,t,Do(t));t.data=new Uint8Array(await r.arrayBuffer()),t.size=t.data.length}async function Uo(t,e,r){if(t.preventHeadRequest)await r(t,t.options);else{const n=await e("HEAD",t,Do(t)),o=n.headers.get("Content-Length");o&&!n.headers.get("Content-Encoding")?t.size=Number(o):await r(t,t.options)}}async function To(t,{fetch:e=fetch,options:r,url:n},o){const a=await e(n,Object.assign({},r,{method:t,headers:o}));if(a.status>=200&&a.status<=299)return a;throw 416==a.status?new Error(Vn):new Error(Zn+(a.statusText||a.status))}function ko(t,{url:e},r){return new Promise((n,o)=>{const a=new XMLHttpRequest;if(a.addEventListener("load",()=>{if(a.status>=200&&a.status<=299){const t=[];a.getAllResponseHeaders().trim().split(/[\r\n]+/).forEach(e=>{const r=e.trim().split(/\s*:\s*/);r[0]=r[0].trim().replace(/^[a-z]|-[a-z]/g,t=>t.toUpperCase()),t.push(r)}),n({status:a.status,arrayBuffer:()=>a.response,headers:new Map(t)})}else o(416==a.status?new Error(Vn):new Error(Zn+(a.statusText||a.status)))},!1),a.addEventListener("error",t=>o(t.detail?t.detail.error:new Error("Network error")),!1),a.open(t,e),r)for(const t of Object.entries(r))a.setRequestHeader(t[0],t[1]);a.responseType="arraybuffer",a.send()})}class Co extends no{constructor(t,e={}){super(),Object.assign(this,{url:t,reader:e.useXHR&&!e.fetch?new mo(t,e):new ho(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 Mo extends Co{constructor(t,e={}){super(t,Object.assign({},e,{useRangeHeader:!0}))}}class vo extends no{constructor(t){super(),t=new Uint8Array(t.buffer,t.byteOffset,t.byteLength),Object.assign(this,{ct:t,size:t.length})}readUint8Array(t,e){return this.ct.slice(t,t+e)}}class No extends oo{constructor(t){super(),this.ut=t||262144}init(t=0){Object.assign(this,{offset:0,ct:new Uint8Array(t>0?t:this.ut)}),super.init()}writeUint8Array(t){const e=this,r=e.offset+t.length;if(r>e.ct.length){let t=e.ct.length?2*e.ct.length:e.ut;for(;t<r;)t*=2;const n=e.ct;e.ct=new Uint8Array(t),e.ct.set(n)}e.ct.set(t,e.offset),e.offset+=t.length}getData(){return this.offset===this.ct.length?this.ct:this.ct.slice(0,this.offset)}}class _o extends no{constructor(t){super(),this.lt=t}async init(){const t=this;t.ft=0;const e=t.lt=await Promise.all(t.lt.map(Zo));t.wt=e.map(e=>{const r=t.size;return t.size+=e.size,r}),super.init()}ht(t){const{wt:e,size:r}=this,n=e[t];return n===U?r:n}async readUint8Array(t,e){const r=this,{lt:n}=this;let o,a=0,i=t;for(;n[a]&&i>=n[a].size;)i-=n[a].size,a++;const s=n[a];if(s){const n=s.size;if(i+e<=n)o=await Vo(s,i,e);else{const a=n-i;o=Gt(await Vo(s,i,a),await r.readUint8Array(t+a,e-a))}}else o=B;return r.ft=Math.max(a,r.ft),o}}class jo extends ro{constructor(t,e=4294967295){super();const r=this;let n,o,a;Object.assign(r,{diskNumber:0,diskOffset:0,size:0,maxSize:e,availableSize:e});const i=new WritableStream({async write(e){if(e===eo)return void(a&&await c());const{availableSize:i}=r;if(a)e.length>=i?(await s(e.subarray(0,i)),await c(),e.length>i&&await this.write(e.subarray(i))):await s(e);else{const{value:i,done:s}=await t.next();if(s&&!i)throw new Error(Gn);n=i,n.size=0,n.maxSize&&(r.maxSize=n.maxSize),r.availableSize=r.maxSize,await Wo(n),o=i.writable,a=o.getWriter(),await this.write(e)}},async close(){a&&(await a.ready,await u())},async abort(t){a&&await a.abort(t)}});async function s(t){const e=t.length;e&&(await a.ready,await a.write(t),n.size+=e,r.availableSize-=e)}async function c(){await u(),r.diskOffset+=n.size,r.diskNumber++,a=null,r.availableSize=r.maxSize}async function u(){await a.close()}Object.defineProperty(r,to,{get:()=>i})}async closeDisk(){const t=this.writable.getWriter();try{await t.ready,await t.write(eo)}finally{t.releaseLock()}}}class Po{constructor(t){return Array.isArray(t)&&(t=new _o(t)),(t instanceof ReadableStream||typeof t.getReader==N)&&(t={readable:ar(t)}),t}}class Bo{constructor(t){t.writable===U&&typeof t.next==N&&(t=new jo(t)),(t instanceof WritableStream||typeof t.getWriter==N)&&(t={writable:sr(t)});try{t.size=t.size===U?0:t.size}catch{throw new Error(Yn)}return t}}function Lo(t){return Boolean(t&&t.getData)}async function Wo(t,e){if(!t.init||t.initialized)return Promise.resolve();await t.init(e)}async function Zo(t){return t=new Po(t),await Wo(t),t.size!==U&&t.readUint8Array||(t=new uo(await ir(t.readable)),await Wo(t)),t}function Vo(t,e,r){return t.readUint8Array(e,r)}function Ho(t,e){return t.createReadable?t.createReadable(e):t.readUint8Array?no.prototype.createReadable.call(t,e):t.readable}function Go(t,e,r){if(!t.some(t=>t.reason==e)){const n={reason:e};r!==U&&(n.filename=r),t.push(n)}}const qo="filename",Yo="rawFilename",Ko="comment",Xo="rawComment",$o="uncompressedSize",Jo="compressedSize",Qo="offset",ta="diskNumberStart",ea="lastModDate",ra="rawLastModDate",na="lastAccessDate",oa="rawLastAccessDate",aa="creationDate",ia="rawCreationDate",sa="internalFileAttributes",ca="externalFileAttributes",ua="msdosAttributesRaw",la="msdosAttributes",fa="msDosCompatible",wa="zip64",da="encrypted",pa="version",ha="versionMadeBy",ma="zipCrypto",ya="directory",Ea="executable",ba="compressionMethod",Sa="signature",ga="extraField",Aa="unixMode",Ra="setuid",za="setgid",xa="sticky",Da=[qo,Yo,$o,Jo,ea,ra,Ko,Xo,na,oa,aa,ia,Qo,ta,sa,ca,ua,la,fa,wa,da,pa,ha,ma,ya,Ea,"symlink",ba,Sa,"crc32",ga,"extraFieldUnix","extraFieldInfoZip","extraFieldUnixType1","extraFieldPkwareUnix","uid","gid",Aa,"unixExternalUpper",Ra,za,xa,"bitFlag","rawBitFlag","filenameLength","extraFieldLength","filenameUTF8","commentUTF8","rawExtraField","extraFieldZip64","extraFieldUnicodePath","extraFieldUnicodeComment","extraFieldAES","extraFieldNTFS","extraFieldExtendedTimestamp","extraFieldUSDZ"];class Fa{constructor(t){Da.forEach(e=>this[e]=t[e])}}const Oa=new Set([1,h,10,m,28789,25461,y,E,b,22613,13]);function Ia(t,e,r){return t?e?12:16+4*r:0}const Ua="File format is not recognized",Ta="End of central directory not found",ka="End of Zip64 central directory locator not found",Ca="Central directory header not found",Ma="File contains encrypted entry",va="Encryption method not supported",Na="Split zip file",_a="Entry data out of bounds",ja="Ambiguous archive",Pa="Encrypted central directory is not supported",Ba="Unsafe filename",La="Invalid strictness (must be 'strict', 'balanced' or 'tolerant')",Wa="Invalid filenameValidation (must be 'strict', 'balanced' or 'tolerant')",Za="Invalid maxAppendedDataSize (must be a number greater than or equal to 0)",Va="64-bit value exceeds Number.MAX_SAFE_INTEGER",Ha="unsorted central directory",Ga="unknown version needed to extract",qa="compressed patched data",Ya="malformed extra field",Ka="unknown zip64 extensible data",Xa="wrapped entries count",$a="appended data",Ja="prepended data",Qa="prepended central directory",ti="trailing central directory data",ei="mismatched central directory offset",ri="missing zip64 extra field",ni="duplicate filename",oi="mismatched zip64 end of central directory record",ai="multiple end of central directory records",ii="mismatched local file header (filename)",si="mismatched local file header (general purpose bit flag)",ci="mismatched local file header (compression method)",ui="mismatched local file header (crc32 or sizes)",li=/^[a-zA-Z]:/,fi=/(^|[\\/])\.\.([\\/]|$)/,wi="utf-8",di="cp437",pi=[[$o,t],[Jo,t],[Qo,t],[ta,e]],hi={[e]:{yt:rs,bytes:4},[t]:{yt:ns,bytes:8}},mi=BigInt(Number.MAX_SAFE_INTEGER);class yi{constructor(t,e={}){Object.assign(this,{reader:new Po(t),options:e,Et:{bt:new Set,St:[],gt:[]},At:new WeakSet})}async*getEntriesGenerator(a={}){const c=this;let{reader:h}=c;if(await Wo(h),h.size!==U&&h.readUint8Array||(h=new uo(await ir(h.readable)),await Wo(h)),h.size<w)throw new Error(Ua);const m=c.warnings=[],y=Pi(a,c.options),E=y==st,b=y!=ut,S=Wi(Xi(c,a,rt),y),g=function(t,e){if(t===U)return e;if(!ji(t))throw new Error(Wa);return t}(Xi(c,a,"filenameValidation"),y),F=Xi(c,a,"normalizeFilename"),{Rt:O,zt:I}=await Zi(h,b,S);if(!O)throw await async function(t){return await _i(t)==o}(h)?new Error(Na):new Error(Ta);b&&I>1&&Ki(ai);const T=Yt(O);let k=rs(T,12),C=rs(T,16);const v=O.offset,N=es(T,20),_=v+w+N,j=h.size-_;j>S&&Ki($a),j>0&&Go(m,$a);let P=es(T,4);const L=h.ft||0;let W,Z,V,H,q,Y=es(T,6),K=es(T,10),X=0,$=p;const J=C==t||k==t||K==e||Y==e;if(C!=t&&Y!=e&&(C+=Ni(h,Y)),J){const r=O.offset>=d?await Vo(h,O.offset-d,d):B,n=Yt(r);if(r.length==d&&rs(n,0)==l){C=Ni(h,rs(n,4))+ns(n,8);let r=await Vo(h,C,p),o=Yt(r);if(r.length<p||rs(o,0)!=u){const t=O.offset-d;let e=t-p;if(await zi(h,e,u)||(e=await async function(t,e){const r=Math.max(0,e-65591),n=await Vo(t,r,e-r),o=Yt(n);for(let t=n.length-p;t>=0;t--)if(rs(o,t)==u&&t+12+Number(o.getBigUint64(t+4,!0))==n.length)return r+t}(h,t)),e!==U&&e>=0&&C!=e){const t=C;C=e,C>t&&(X=C-t),r=await Vo(h,C,p),o=Yt(r)}}if(r.length<p||rs(o,0)!=u)throw new Error(ka);if(V=!0,H=ns(o,4)>44,H){const t=Math.min(ns(o,4)-44,h.size-C-p);t>0&&($+=t,q=function(t){const e={rawExtensibleData:t};if(t.length>=28){const r=Yt(t),n=es(r,26);Object.assign(e,{compressionMethod:es(r,0),compressedSize:ns(r,2),uncompressedSize:ns(r,10),encryptionAlgorithm:es(r,18),bitLength:es(r,20),flags:es(r,22),hashAlgorithm:es(r,24),hashData:t.subarray(28,28+n)})}return e}(await Vo(h,C+p,t)))}P==e?P=rs(o,16):P!=rs(o,16)&&Yi(E,m,oi),Y==e?Y=rs(o,20):Y!=rs(o,20)&&Yi(E,m,oi),K==e?K=ns(o,32):K!=ns(o,32)&&Yi(E,m,oi),k==t?k=ns(o,40):k!=ns(o,40)&&Yi(E,m,oi),C=Ni(h,Y)+ns(o,48)+X}else if(C==t||k==t||Y==e)throw new Error(ka)}let Q=k;const tt=O.offset-(V?$+d:0);if(L!=P)throw new Error(Na);if(C<0)throw new Error(Ua);let nt=0,ot=C<h.size?await Vo(h,C,k):B,ct=Yt(ot);if(k){let e=tt-k;if(C!=e&&Y==P){const r=ot.length>=4&&(rs(ct,nt)==s||Boolean(q&&q.compressedSize)||gi(ct));if(!r&&e<0)throw new Error(Ua);let o=!r;if(e>=0&&e+4<=h.size){let t=await Ri(h,e);if(!t){const r=await async function(t,e){const r=Math.max(0,e-65541),n=await Vo(t,r,e-r),o=Yt(n);for(let t=n.length-6;t>=0;t--)if(rs(o,t)==i&&t+6+es(o,t+4)==n.length)return r+t}(h,tt),n=r-k;r!==U&&n>=0&&await Ri(h,n)&&(e=n,t=!0)}r&&(o=t)}if(o&&e!=C){const o=C;C=e,ot=await Vo(h,C,k),ct=Yt(ot);const a=C-o,i=function(e,r){if(e.length<f)return U;const n=rs(r,42);if(n!=t)return n;let o=f+es(r,28);const a=Math.min(o+es(r,30),e.length);for(;o+4<=a;){const e=es(r,o),n=es(r,o+2);if(1==e){let e=o+4;return rs(r,24)==t&&(e+=8),rs(r,20)==t&&(e+=8),e+8<=a?ns(r,e):U}o+=4+n}return U}(ot,ct),s=i!==U&&await zi(h,i,n),c=i!==U&&await zi(h,i+a,n);a>0&&(!s||c)?(X+=a,W=r):(Yi(E,m,ei),a<0&&!s&&c&&(X+=a))}}if(ot.length<4)throw new Error(Ua)}else!K&&C<tt&&Y==P&&(X+=tt-C,C=tt);const lt=tt-C;if(k!=lt&<>=0&&Y==P&&(k=lt,ot=await Vo(h,C,k),ct=Yt(ot)),C<0||C>=h.size)throw new Error(Ua);c.directoryOffset=C,c.directoryLength=Q;const ft=$i(c,a,"decryptCentralDirectory");let wt,dt;if(ft&&K&&ot.length>=4&&rs(ct,0)!=s&&(H||gi(ct))){const t=function(t,e,r){const n=t&&t.compressedSize?t.compressedSize:e;return n>0&&n<=r?n:r}(q,Q,ot.length);dt=ot.subarray(t),ot=await ft(ot.subarray(0,t),q),ct=Yt(ot),Q=ot.length,wt=!0}q&&!wt&&(ot.length<4||rs(ct,0)==s)&&Go(m,Ka),Z=C;const pt=Xi(c,a,"filenameEncoding"),ht=Xi(c,a,"commentEncoding"),mt=new Set;let yt,Et=-1;const bt=!E&&!V;!K&&bt&&(K=Ai(ct,ot,nt),K&&Go(m,Xa));const St=Object.assign({},c.options,a,{[et]:y});delete St[G];for(let n=0;n<K;n++){const o=new Si(h,St);if(nt+f>ot.length||rs(ct,nt)!=s){if(0==n&&!wt&&(H||gi(ct)))throw new Error(Pa);throw new Error(Ca)}Di(o,ct,nt+6);const i=Boolean(o.bitFlag.languageEncodingFlag),u=nt+f,l=u+o.filenameLength+o.extraFieldLength,w=es(ct,nt+4),d=!(w>>8),p=w>>8==3,y=es(ct,nt+32),b=l+y,S=new Uint8Array(ot.subarray(u,b)),O=S.subarray(0,o.filenameLength),I=S.subarray(o.filenameLength+o.extraFieldLength),T=i||!pt&&Ln(O),k=i||!ht&&Ln(I),C=rs(ct,nt+38),v=C&r,N={readOnly:Boolean(1&v),hidden:Boolean(2&v),system:Boolean(4&v),directory:Boolean(16&v),archive:Boolean(32&v)},_=rs(ct,nt+42),j=$i(c,a,"decodeText")||Bn,P=T?wi:pt||di,B=k?wi:ht||di;let L=j(O,P,at);L===U&&(L=Bn(O,P));let W,V=j(I,B,it);V===U&&(V=Bn(I,B)),Object.assign(o,{index:n,xt:wt,versionMadeBy:w,msDosCompatible:d,zip64:!1,compressedSize:0,uncompressedSize:0,Dt:y,offset:_,diskNumberStart:es(ct,nt+34),internalFileAttributes:es(ct,nt+36),externalFileAttributes:C,msdosAttributesRaw:v,msdosAttributes:N,rawFilename:O,filenameUTF8:T,commentUTF8:k,rawExtraField:S.subarray(o.filenameLength,o.filenameLength+o.extraFieldLength),rawComment:I,filename:L,comment:V});try{W=Fi(o,o,ct,nt+6)}catch(t){if(E||t.message!=M)throw t;o.Ft=!0,Go(m,ri,o.filename)}if(L=o.filename,F){const t=F(L);t!==U&&(L=o.filename=t)}if(Li(L,g)){const t=new Error(Ba);throw t.filename=L,t}if(W&&Go(m,Ya,L),o.Ft&&o.offset==t)Z=0;else{o.offset+=X;const t=Ni(h,o.diskNumberStart)+o.offset;Z=Math.min(t,Z),t<Et&&Go(m,Ha,L),Et=t}(o.version&r)>63&&Go(m,Ga,L),32&~o.rawBitFlag||Go(m,qa,L),mt.has(o.filename)&&(yt=!0),mt.add(o.filename);const G=o.externalFileAttributes>>16&e;o.unixMode===U&&16877&G&&(o.unixMode=G);const q=Boolean(o.unixMode&z),Y=Boolean(o.unixMode&x),$=Boolean(512&o.unixMode),J=40960==((o.unixMode===U?G:o.unixMode)&A),Q=o.unixMode!==U&&(o.unixMode&A)==R||(G&A)==R||d&&N.directory||o.filename.endsWith(D),tt=!J&&!Q&&(o.unixMode!==U?!!(73&o.unixMode):p&&!!(73&G));Object.assign(o,{setuid:q,setgid:Y,sticky:$,symlink:J,unixExternalUpper:G,executable:tt,directory:Q,zipCrypto:o.encrypted&&!o.extraFieldAES});const et=new Fa(o);if(o.Ft&&c.At.add(et),et.getData=(t,e)=>o.getData(t,et,c,e),et.arrayBuffer=async t=>{const e=new TransformStream,r=ir(e.readable).then(t=>t.arrayBuffer());return r.catch(()=>{}),await o.getData(e,et,c,Object.assign({},t,{preventClose:!1})),r},nt=b,n==K-1&&bt){const t=Ai(ct,ot,nt);t&&(K+=t,Go(m,Xa))}const{onprogress:rt}=a;if(rt)try{await rt(n+1,K,new Fa(o))}catch{}yield et}let gt=nt,At=xi(ot.subarray(nt))||(wt?xi(dt):U);if(!At&&!wt){const t=C+nt,e=Math.min(tt-t,65541);e>=6&&(At=xi(await Vo(h,t,e)))}At&&(c.digitalSignature=At,gt=nt+6+At.length),(nt!=Q&>!=Q||!wt&&nt!=k&>!=k)&&Yi(E,m,ti),yt&&Yi(E,m,ni);const Rt=Xi(c,a,"extractPrependedData"),zt=Xi(c,a,"extractAppendedData"),xt=(E||Rt)&&K&&4==Z&&await async function(t){const e=await _i(t);return e==o||808471376==e}(h)?4:0;return E&&(X>0||K&&Z>xt)&&Ki(Ja),(X>0||K&&Z>4)&&Go(m,Ja),W&&Go(m,Qa),Rt&&(c.prependedData=Z>xt?await Vo(h,xt,Z-xt):B),c.comment=N?await Vo(h,v+w,N):B,zt&&(c.appendedData=_<h.size?await Vo(h,_,h.size-_):B),!0}async getEntries(t={}){const e=[];for await(const r of this.getEntriesGenerator(t))e.push(r);return e}async close(){const{reader:t}=this;t.readUint8Array||!t.readable||t.readable.locked||await t.readable.cancel()}[L](){return this.close()}}class Ei{constructor(t={}){let e;const{readable:r,writable:n}=new TransformStream({start(t){e=t}}),o=new yi(r,t),a=o.getEntriesGenerator(),i=new Set;this.readable=new ReadableStream({async pull(t){const{done:e,value:r}=await a.next();if(e)return t.close();const n=function(t,e){const{readable:r,writable:n}=new TransformStream;let o;const a={cancel:async t=>{e.delete(a),await(o?o.cancel(t):r.cancel(t))}};return a.readable=new ReadableStream({async pull(i){o||(o=r.getReader(),e.add(a),async function(){try{await t.getData(n,{preventClose:!1})}catch(t){try{await n.abort(t)}catch{}}finally{e.delete(a)}}());const{done:s,value:c}=await o.read();s?i.close():i.enqueue(c)},cancel:t=>a.cancel(t)},{highWaterMark:0}),a}(r,i),o={...r,readable:n.readable};delete o.getData,Object.defineProperties(o,{localDirectory:{get:()=>r.localDirectory,enumerable:!0},warnings:{get:()=>r.warnings,enumerable:!0}}),t.enqueue(o)},async cancel(t){const r=Array.from(i);i.clear(),e.error(t),await Promise.allSettled(r.map(e=>e.cancel(t))),await Promise.allSettled([a.return(),o.close()])}}),this.writable=n}}async function bi(t,e={}){if(t=new Po(t),await Wo(t),t.size!==U&&t.readUint8Array||(t=new uo(await ir(t.readable)),await Wo(t)),t.size<w)return!1;const r=Pi(e,{}),n=r!=ut,o=Wi(e[rt],r),{Rt:a,zt:i}=await Zi(t,n,o);if(!a||r==st&&i>1)return!1;const s=es(Yt(a),20),c=a.offset+w+s;return t.size-c<=o}let Si=class{constructor(t,e){Object.assign(this,{reader:t,options:e})}async getData(t,e,o,a={}){const i=this,{Et:s,directoryOffset:c}=o;if(i.Ft)throw new Error(M);const u=_t(),{reader:l,index:f,offset:w,diskNumberStart:d,extraFieldAES:p,extraFieldZip64:h,compressionMethod:m,bitFlag:y,rawBitFlag:E,crc32:b,rawLastModDate:S,uncompressedSize:A,compressedSize:R}=i,{dataDescriptor:z}=y,x=e.localDirectory={},D=e.warnings=[],O=Ni(l,d)+w,I=await Vo(l,O,F),T=Yt(I);let v=Xi(i,a,W),N=Xi(i,a,Z);const _=St(Xi(i,a,V)),j=Boolean(_),P=!0===_;if(bt(v,N),v=v&&v.length?v:U,N=N&&N.length?N:U,p&&99!=p.originalCompressionMethod)throw new Error(fr);if(I.length<F||rs(T,0)!=n)throw new Error(k);Di(x,T,4);const{extraFieldLength:L,filenameLength:G}=x,X=x.dataOffset=O+F+G+L,$=Xi(i,a,"checkLocalDirectory"),J=Pi(a,i.options),Q=function(t,e){return t===U?e!=ut:Boolean(t)}($,J),tt=Xi(i,a,"checkLocalFilename"),et=function(t,e){return t===U?e==st:Boolean(t)}(tt===U?$:tt,J);let rt=B;if(et&&(G||L)){const t=await Vo(l,O+F,G+L);rt=t.subarray(0,G),x.rawExtraField=t.subarray(G)}else x.rawExtraField=L?await Vo(l,O+F+G,L):B;et&&(x.rawFilename=rt),Fi(i,x,T,4,!0)&&Go(D,Ya),function(t,e,r,n,o){const{rawFilename:a}=t,i=!o,s=t.xt&&(e.rawBitFlag&g)==g;!n||s||r.length==a.length&&!r.some((t,e)=>t!=a[e])||Yi(i,o,ii),(2121&e.rawBitFlag)!=(2121&t.rawBitFlag)&&Yi(i,o,si),e.compressionMethod!=t.compressionMethod&&Yi(i,o,ci),e.bitFlag.dataDescriptor||s||!(e.crc32||e.compressedSize||e.uncompressedSize)||e.crc32==t.crc32&&e.compressedSize==t.compressedSize&&e.uncompressedSize==t.uncompressedSize||Yi(i,o,ui)}(i,x,rt,et,Q?U:D);const{lastAccessDate:nt,creationDate:ot,uid:at,gid:it}=x;nt&&e.lastAccessDate===U&&(e.lastAccessDate=nt),ot&&e.creationDate===U&&(e.creationDate=ot),at!==U&&e.uid===U&&(e.uid=at),it!==U&&e.gid===U&&(e.gid=it);const ct=Xi(i,a,"checkPasswordOnly"),lt=i.encrypted&&(!P||ct),ft=lt&&!p;if(P||(e.zipCrypto=ft),lt&&!(64&~i.rawBitFlag))throw new Error(va);const wt=j?U:yr(m);if(0!=m&&8!=m&&9!=m&&!wt&&!j)throw new Error(fr);if(lt){if(!ft&&(p.strength<1||p.strength>3))throw new Error(va);if(!v&&!N)throw new Error(Ma)}if(X+R>Math.min(l.size,c))throw new Error(_a);const dt=R,pt=yt(Xi(i,a,H));Et(pt);let ht=Xi(i,a,"checkOverlappingEntry");const mt=Xi(i,a,"checkOverlappingEntryOnly");mt&&(ht=!0);const{onstart:gt,onprogress:At,onend:Rt}=a,zt=0!=m&&!j,xt=j?R-Ia(lt,ft,p&&p.strength):A,Dt=9==m;let Ft=Xi(i,a,Y);Dt&&(Ft=!1);const Ot=Xi(i,a,"checkCrc32"),It=(Ot===U?Xi(i,a,"checkSignature"):Ot)&&!j&&(!lt||ft||p&&1==p.vendorVersion),Ut={options:{codecType:Xr,password:v,rawPassword:N,zipCrypto:ft,encryptionStrength:p&&p.strength,checkCrc32:It,checkAuthenticationCode:Xi(i,a,"checkAuthenticationCode"),passwordVerification:ft&&(z?S>>>8&r:b>>>24&r),outputSize:xt,crc32:b,compressed:zt,encrypted:lt,useWebWorkers:Xi(i,a,q),useCompressionStream:Ft,deflate64:Dt,format:wt?wt.format:U,codecURI:wt?wt.codecURI:U,compressionMethod:m,rawBitFlag:E,checkPasswordOnly:ct},config:u,F:{signal:pt,size:dt,onstart:gt,onprogress:At,onend:Rt}};let Tt,kt,Ct;ht&&(await async function({reader:t,Ot:e,index:r,offset:n,crc32:o,compressedSize:a,uncompressedSize:i,dataOffset:s,dataDescriptor:c,extraFieldZip64:u,Et:l}){let f=0;if(c){const r=Boolean(u),n=await Ci(t,s+a,{crc32:o,compressedSize:a,uncompressedSize:i,zip64:r});n?(e.localDirectory.dataDescriptor=n,f=vi(n.zip64,n.signature)):f=vi(r,!1)}const w={start:n,end:s+a+f,Ot:e},{bt:d,St:p,gt:h}=l;if(!d.has(r)){const t=function(t,e){let r=0,n=t.length;for(;r<n;){const o=r+n>>>1;t[o].start<e.start?r=o+1:n=o}const o=t[r-1],a=t[r];return o&&ki(e,o)?o:a&&ki(e,a)?a:void 0}(p,w)||h.find(t=>ki(w,t));if(t){const e=new Error(C);throw e.overlappingEntry=t.Ot,e}d.add(r),h.push(w),h.length*h.length>p.length&&(h.sort((t,e)=>t.start-e.start),l.St=function(t,e){const r=[];let n=0,o=0;for(;n<t.length||o<e.length;)o==e.length||n<t.length&&t[n].start<e[o].start?r.push(t[n++]):r.push(e[o++]);return r}(p,h),h.length=0)}}({reader:l,Ot:e,index:f,offset:O,crc32:b,compressedSize:R,uncompressedSize:A,dataOffset:X,dataDescriptor:z||x.bitFlag.dataDescriptor,extraFieldZip64:h||x.extraFieldZip64,Et:s}),function(t,e,r){const{dataDescriptor:n}=e,o=t.xt&&(e.rawBitFlag&g)==g;n&&!o&&(t.crc32!==U&&n.crc32!=t.crc32||n.compressedSize!=t.compressedSize||n.uncompressedSize!=t.uncompressedSize)&&Yi(!r,r,ui)}(i,x,Q?U:D));try{if(!mt){ct&&(t=new WritableStream),t=new Bo(t),await Wo(t,function(t,e,r){return Math.min(t,r?1032*e:e)}(xt,R,zt)),({writable:Tt}=t);const e=ar(l.createReadable({offset:X,size:dt})),{outputSize:r}=await Tn({readable:e,writable:Tt},Ut);if(Et(pt),r!=xt)throw Object.assign(new Error(gr),{outputSize:r});t.size+=r}}catch(e){if(Kt(e)&&e.outputSize!==U&&(t.size+=e.outputSize),!ct||!Kt(e)||e.message!=Fe)throw kt=e,Ct=!0,e}finally{if((Lo(t)||!Xi(i,a,K))&&Tt&&!Tt.locked){const t=Tt.getWriter();if(Ct)try{await t.abort(kt)}catch{}else await t.close()}}return ct||mt?U:t.getData?t.getData():Tt}};function gi(t){return t.byteLength>=4&&134630224==rs(t,0)}function Ai(t,e,r){let n=0;for(;r+f<=e.length&&rs(t,r)==s;)r+=f+es(t,r+28)+es(t,r+30)+es(t,r+32),n++;return n%65536?0:n}function Ri(t,e){return zi(t,e,s)}async function zi(t,e,r){return!(e<0||e+4>t.size)&&rs(Yt(await Vo(t,e,4)),0)==r}function xi(t){if(t.length>=6){const e=Yt(t);if(rs(e,0)==i){const r=es(e,4);if(6+r<=t.length)return new Uint8Array(t.subarray(6,6+r))}}}function Di(t,e,r){const n=t.rawBitFlag=es(e,r+2),o=!(1&~n),a=rs(e,r+6);Object.assign(t,{encrypted:o,version:es(e,r),bitFlag:{level:(6&n)>>1,dataDescriptor:!(8&~n),languageEncodingFlag:(n&S)==S},rawLastModDate:a,lastModDate:Ji(a),filenameLength:es(e,r+22),extraFieldLength:es(e,r+24)})}function Fi(t,e,r,n,o){const{rawExtraField:a}=e,i=e.extraField=new Map,s=Yt(a);let c=0,u=!1;try{for(;c<a.length;){const t=es(s,c),e=es(s,c+2);i.set(t,{type:t,data:a.slice(c+4,c+4+e)}),c+=4+e}}catch{u=!0}c>a.length&&(u=!0);const l=es(r,n+4);Object.assign(e,{signature:rs(r,n+10),crc32:rs(r,n+10),compressedSize:rs(r,n+14),uncompressedSize:rs(r,n+18)});const f=i.get(1);let w;f?(function(t,e,r){e.zip64=!0;const n=Yt(t.data),o=pi.filter(([t,r])=>e[t]==r),a=o.reduce((t,[,e])=>t+hi[e].bytes,0);if(t.data.length<a){if(r)return!1;throw new Error(M)}const i=[];try{for(let t=0,e=0;t<o.length;t++){const[,r]=o[t],a=hi[r];i.push(a.yt(n,e)),e+=a.bytes}}catch(t){if(r)return!1;throw t}return o.forEach(([r],n)=>{e[r]=t[r]=i[n]}),!0}(f,e,o)||(u=!0),e.extraFieldZip64=f):pi.some(([t,r])=>e[t]==r)&&(o?u=!0:w=!0);const d=i.get(28789);d&&(Oi(d,qo,Yo,e,t),e.extraFieldUnicodePath=d);const p=i.get(25461);p&&(Oi(p,Ko,Xo,e,t),e.extraFieldUnicodeComment=p);const S=i.get(h);S&&(99==l||e.encrypted)&&S.data.length>=7?(function(t,e,r){const n=Yt(t.data),o=ts(n,4);Object.assign(t,{vendorVersion:ts(n,0),vendorId:ts(n,2),strength:o,originalCompressionMethod:r,compressionMethod:es(n,5)}),e.compressionMethod=t.compressionMethod,1!=t.vendorVersion&&(e.crc32=U)}(S,e,l),e.extraFieldAES=S):(S&&(u=!0),e.compressionMethod=l);const g=i.get(13);g&&(Ii(g,e),e.extraFieldPkwareUnix=g);const A=i.get(22613);A&&(Ii(A,e),e.extraFieldUnixType1=A);const R=i.get(m);R&&(function(t,e,r){if(!t.data.length)return;const n=Yt(t.data),o=ts(n,0),a=[],i=[];r?(1&~o||(a.push(ea),i.push(ra)),2&~o||(a.push(na),i.push(oa)),4&~o||(a.push(aa),i.push(ia))):t.data.length>=5&&(a.push(ea),i.push(ra));let s=1;a.forEach((r,o)=>{if(t.data.length>=s+4){const a=rs(n,s);e[r]=t[r]=new Date(1e3*(0|a));const c=i[o];t[c]=a}s+=4})}(R,e,o),e.extraFieldExtendedTimestamp=R);const z=i.get(10);z&&(function(t,e){const r=Yt(t.data);let n,o=4;try{for(;o<t.data.length&&!n;){const e=es(r,o),a=es(r,o+2);1==e&&(n=t.data.slice(o+4,o+4+a)),o+=4+a}}catch{}if(n&&24==n.length){const r=Yt(n),o=r.getBigUint64(0,!0),a=r.getBigUint64(8,!0),i=r.getBigUint64(16,!0);Object.assign(t,{rawLastModDate:o,rawLastAccessDate:a,rawCreationDate:i});const s={lastModDate:Qi(o),lastAccessDate:Qi(a),creationDate:Qi(i)};Object.assign(t,s),Object.assign(e,s,{rawLastAccessDate:a,rawCreationDate:i})}}(z,e),e.extraFieldNTFS=z);const x=i.get(E);let D;x&&(D=Ui(x,e,!0),e.extraFieldInfoZip=x);const F=i.get(b);F&&(Ui(F,D?{}:e,!1),e.extraFieldUnix=F);const O=i.get(y);if(O&&(e.extraFieldUSDZ=O),w)throw new Error(M);return u}function Oi(t,e,r,n,o){if(t.data.length<5)return void(t.valid=!1);const a=Yt(t.data),i=new ae;i.append(o[r]);const s=Yt(new Uint8Array(4));s.setUint32(0,i.get(),!0);const c=rs(a,1),u=ts(a,0);Object.assign(t,{version:u,[e]:Bn(t.data.subarray(5)),valid:1==u&&!o.bitFlag.languageEncodingFlag&&c==rs(s,0)}),t.valid&&(n[e]=t[e],n[e+"UTF8"]=!0)}function Ii(t,e){if(t.data.length<8)return;const r=Yt(t.data),n={lastAccessDate:new Date(1e3*(0|rs(r,0))),lastModDate:new Date(1e3*(0|rs(r,4)))};t.data.length>=12&&(n.uid=es(r,8),n.gid=es(r,10)),Object.assign(t,n),Object.assign(e,n)}function Ui(t,e,r){try{const n=Yt(t.data);let o,a;if(r){let e=0;const r=ts(n,e++),i=ts(n,e++);o=Ti(t.data.subarray(e,e+i)),e+=i;const s=ts(n,e++);a=Ti(t.data.subarray(e,e+s)),Object.assign(t,{version:r,uid:o,gid:a})}else t.data.length>=4&&(o=es(n,0),a=es(n,2),Object.assign(t,{uid:o,gid:a}));return o!==U&&(e.uid=o),a!==U&&(e.gid=a),o!==U||a!==U}catch{}}function Ti(t){const e=new Uint8Array(4);return e.set(t,0),new DataView(e.buffer,e.byteOffset,4).getUint32(0,!0)}function ki(t,e){return t.start<e.end&&e.start<t.end}async function Ci(t,e,{crc32:r,compressedSize:n,uncompressedSize:o,zip64:a}){const i=Math.min(24,Math.max(0,t.size-e)),s=Yt(i?await Vo(t,e,i):B),c=[[a,!0],[a,!1],[!a,!0],[!a,!1]].map(([t,e])=>Mi(s,t,e)).filter(t=>t&&t.compressedSize==n&&t.uncompressedSize==o);return c.find(t=>t.crc32==r)||c[0]||Mi(s,a,!0)||Mi(s,a,!1)}function Mi(t,e,r){const n=r?4:0;if(t.byteLength<vi(e,r)||r&&rs(t,0)!=a)return U;const o=rs(t,n);let i,s;try{e?(i=ns(t,n+4),s=ns(t,n+12)):(i=rs(t,n+4),s=rs(t,n+8))}catch{return U}return{signature:r,zip64:e,crc32:o,compressedSize:i,uncompressedSize:s}}function vi(t,e){return(t?20:12)+(e?4:0)}function Ni(t,e){return t.ht?t.ht(e):0}async function _i(t){return rs(Yt(await Vo(t,0,4)))}function ji(t){return t===st||t===ct||t===ut}function Pi(t,e){return Bi(t,Bi(e,ct))}function Bi(t,e){const r=t[et];if(r!==U){if(!ji(r))throw new Error(La);return r}const n=t[G];return n===U?e:n?st:e==ut?ut:ct}function Li(t,e){if(e==ut)return!1;const r=t.split("/");return r.length>1&&""===r[r.length-1]&&r.pop(),!!(fi.test(t)||t.startsWith("/")||t.startsWith("\\")||li.test(t))||e==st&&(r.includes(".")||r.includes("")||t.includes("\0"))}function Wi(t,r){if(t!==U){const e=Rt(t);if("number"!=typeof e||Number.isNaN(e)||e<0)throw new Error(Za);return e}return r==st?0:r==ut?1/0:e}async function Zi(t,e,r){const{size:n}=t,o=Math.min(n,65557),a={It:64};let i,s,c=0;for await(const[r,u,l,f,d]of Vi(t,o)){const o=es(r,f+20);if(d+w+o==n){const o=await Gi(t,r,u,f,d,n,a);if(2==o){if(i||(i=Hi(l,f,d)),c++,!e||c>1)break}else 1!=o||s||(s=Hi(l,f,d))}}return i||(i=s),i||(i=await async function(t,e,r){const{size:n}=t,o=Math.min(n,e==1/0?n:65557+e);let a,i;for await(const[e,s,c,u,l]of Vi(t,o)){const o=Hi(c,u,l);a||(a=o);const f=await Gi(t,e,s,u,l,n,r);if(2==f)return o;1!=f||i||(i=o)}return i||a}(t,r,a)),{Rt:i,zt:c}}async function*Vi(t,e){const r=t.size-e,n=await Vo(t,r,e),o=Yt(n);for(let t=n.length-w;t>=0;t--)rs(o,t)==c&&(yield[o,r,n,t,r+t])}function Hi(t,e,r){return{offset:r,buffer:new Uint8Array(t.subarray(e,e+w)).buffer}}async function Gi(r,n,o,a,i,c,u){const f=es(n,a+10),w=rs(n,a+12),p=rs(n,a+16);if(f==e||w==t||p==t)return await qi(r,n,o,i-d,c,u)==l?2:0;if(!f&&!w)return 1;const h=es(n,a+6);for(const t of[i-w,Ni(r,h)+p])if(await qi(r,n,o,t,c,u)==s)return 2;return 0}async function qi(t,e,r,n,o,a){return n<0||n+4>o?U:n>=r?rs(e,n-r):a.It>0?(a.It--,rs(Yt(await Vo(t,n,4)),0)):U}function Yi(t,e,r){t?Ki(r):Go(e,r)}function Ki(t){const e=new Error(ja);throw e.reason=t,e}function Xi(t,e,r){return e[r]===U?t.options[r]:e[r]}function $i(t,e,r){return mt(Xi(t,e,r))}function Ji(t){const r=(4294901760&t)>>16,n=t&e,o=new Date(1980+((65024&r)>>9),((480&r)>>5)-1,31&r,(63488&n)>>11,(2016&n)>>5,2*(31&n),0);return o<I?I:o}function Qi(t){return new Date(Number(t/BigInt(1e4)-BigInt(116444736e5)))}function ts(t,e){return t.getUint8(e)}function es(t,e){return t.getUint16(e,!0)}function rs(t,e){return t.getUint32(e,!0)}function ns(t,e){const r=t.getBigUint64(e,!0);if(r>mi)throw new Error(Va);return Number(r)}var os=Object.freeze({__proto__:null,ERR_AMBIGUOUS_ARCHIVE:ja,ERR_BAD_FORMAT:Ua,ERR_CENTRAL_DIRECTORY_NOT_FOUND:Ca,ERR_CODEC_OUT_OF_MEMORY:Rr,ERR_ENCRYPTED:Ma,ERR_ENCRYPTED_CENTRAL_DIRECTORY:Pa,ERR_ENTRY_DATA_OUT_OF_BOUNDS:_a,ERR_EOCDR_LOCATOR_ZIP64_NOT_FOUND:ka,ERR_EOCDR_NOT_FOUND:Ta,ERR_EXTRAFIELD_ZIP64_NOT_FOUND:M,ERR_INVALID_AUTHENTICATION_CODE:De,ERR_INVALID_COMPRESSED_DATA:Ar,ERR_INVALID_CRC32:zr,ERR_INVALID_FILENAME_VALIDATION:Wa,ERR_INVALID_MAX_APPENDED_DATA_SIZE:Za,ERR_INVALID_PASSWORD:xe,ERR_INVALID_STRICTNESS:La,ERR_INVALID_UNCOMPRESSED_SIZE:gr,ERR_LOCAL_FILE_HEADER_NOT_FOUND:k,ERR_OVERLAPPING_ENTRY:C,ERR_SPLIT_ZIP_FILE:Na,ERR_UNSAFE_FILENAME:Ba,ERR_UNSUPPORTED_COMPRESSION:fr,ERR_UNSUPPORTED_ENCRYPTION:va,ERR_UNSUPPORTED_UINT64:Va,ERR_WORKER_STARTUP_TIMEOUT:Qr,WARNING_APPENDED_DATA:$a,WARNING_COMPRESSED_PATCHED_DATA:qa,WARNING_DUPLICATE_FILENAME:ni,WARNING_MALFORMED_EXTRA_FIELD:Ya,WARNING_MISMATCHED_CENTRAL_DIRECTORY_OFFSET:ei,WARNING_MISMATCHED_LOCAL_FILE_HEADER_BIT_FLAG:si,WARNING_MISMATCHED_LOCAL_FILE_HEADER_COMPRESSION_METHOD:ci,WARNING_MISMATCHED_LOCAL_FILE_HEADER_CRC32_OR_SIZES:ui,WARNING_MISMATCHED_LOCAL_FILE_HEADER_FILENAME:ii,WARNING_MISMATCHED_ZIP64_END_OF_CENTRAL_DIRECTORY:oi,WARNING_MISSING_ZIP64_EXTRA_FIELD:ri,WARNING_MULTIPLE_END_OF_CENTRAL_DIRECTORY:ai,WARNING_PREPENDED_CENTRAL_DIRECTORY:Qa,WARNING_PREPENDED_DATA:Ja,WARNING_TRAILING_CENTRAL_DIRECTORY_DATA:ti,WARNING_UNKNOWN_VERSION:Ga,WARNING_UNKNOWN_ZIP64_EXTENSIBLE_DATA:Ka,WARNING_UNSORTED_CENTRAL_DIRECTORY:Ha,WARNING_WRAPPED_ENTRIES_COUNT:Xa,ZipReader:yi,ZipReaderStream:Ei,Ut:async function(t,e,{crc32:r,compressedSize:n,uncompressedSize:o,extraFieldZip64:a}){const i=await Ci(t,e,{crc32:r,compressedSize:n,uncompressedSize:o,zip64:Boolean(a)});if(i&&i.compressedSize==n&&i.uncompressedSize==o)return vi(i.zip64,i.signature)},isZipFile:bi});const as="File already exists",is="Zip file comment exceeds 64KB",ss="Invalid zip file comment (must be a Uint8Array)",cs="File entry comment exceeds 64KB",us="Invalid file entry comment (must be a string)",ls="Invalid date (must be a valid Date instance)",fs="File entry name exceeds 64KB",ws="Version exceeds 65535",ds="The strength must equal 1, 2, or 3",ps="Encryption is not supported in USDZ files",hs="Split zip files are not supported in USDZ files",ms="Encryption is not supported when the 'passThrough' option is set to true (use 'compressed' instead)",ys="Invalid extra field (must be a Map)",Es="Invalid extra field type (must be integer 0..65535)",bs="Invalid extra field data (must be a Uint8Array)",Ss="Extra field data exceeds 64KB",gs=-2147483648,As=2147483647,Rs=BigInt(0),zs=BigInt("0x7fffffffffffffff"),xs="Zip64 is not supported (set the 'zip64' option to 'true')",Ds="Undefined uncompressed size",Fs="Undefined compression method",Os="Undefined CRC32",Is="Undetermined size",Us="Undefined reader",Ts="Invalid reader (must be a Reader instance, a ReadableStream instance, or an object with a 'readable' property)",ks="Zip file not empty",Cs="Invalid uid (must be integer 0..2^32-1)",Ms="Invalid gid (must be integer 0..2^32-1)",vs="Invalid UNIX mode (must be integer 0..65535)",Ns="Invalid unixExtraFieldType (must be 'infozip' or 'unix')",_s="uid/gid must be 0..65535 for unixExtraFieldType 'unix' (use 'infozip' for larger ids)",js="Invalid msdosAttributesRaw (must be integer 0..255)",Ps="Invalid msdosAttributes (must be an object with boolean flags)",Bs="Invalid level (must be integer 0..9)",Ls="Signature data exceeds 64KB",Ws="Invalid entry option (must be an entry returned by ZipReader#getEntries())",Zs="The last modification date of an entry encrypted with ZipCrypto cannot be changed when passThrough is set",Vs="compression unavailable",Hs="clamped last modification date",Gs=new Uint8Array([7,0,2,0,65,69,3,0,0]),qs="infozip",Ys="unix",Ks=[8,9,5,3];let Xs=0;const $s=[];class Js{constructor(t,e={}){t=new Bo(t);const{availableSize:r=T,maxSize:n=T}=t,o=r>0&&r!==T&&n>0&&n!==T;if(o&&e[tt])throw new Error(hs);Object.assign(this,{writer:t,Tt:o,options:e,kt:new Map,Ct:new Set,offset:e[Q]===U?t.size||t.writable.size||0:e[Q],Mt:e[Q]===U?0:e[Q]-(t.size||t.writable.size||0),vt:new Set,Nt:[],warnings:[],_t:0,jt:0,Pt:U,Bt:!1})}prependZip(t){return rc(this,async function(t,e){if(t.Ct.size)throw new Error(ks);await nc(t,e)}(this,t))}appendZip(t,e={}){return rc(this,nc(this,t,e))}add(e="",n,o={}){const a=this,{vt:i}=a,s=async function(e,n,o,a){const i=(a=Object.assign({},a))[ot];if(i!==U){const{Lt:t,Wt:r}=ic(i,St(Cc(e,a,V)),Cc(e,a,ea));delete a[ot],a=Object.assign(t,r,a)}if(Cc(e,a,ya)&&!n.endsWith(D)&&(n+=D),e.Ct.has(n))throw new Error(as);e.Ct.add(n),Xs<_t().maxWorkers?Xs++:await new Promise(t=>$s.push(t));try{return await async function(e,n,o,a){const i=sc(e,n,a);({name:n}=i);const s=cc(e,n,a),{comment:c}=s,u=a[ga];e.kt.set(n,U);const l=e.Pt,f={};let w,d;s.Zt.keepOrder&&(f.Vt=new Promise(t=>w=t)),e.Pt=f;try{const{Zt:c}=s;0==c.level||c.compressionMethod!==U||c.Ht||await on(_t())||(c.level=0,Go(e.warnings,Vs,n));const u=await async function(t,e,{Zt:r},n){if(r.Ht&&!e&&!Cc(t,n,ya))throw new Error(Us);let o;if(e){if(e=new Po(e),await Wo(e),!e.readUint8Array&&!e.readable)throw new Error(Ts);({size:o}=e)}return Object.assign({reader:e},lc(t,Boolean(e),o,r,n))}(e,o,s,a);({reader:o}=u);const p=bc(e.writer),h=Ec(e.writer);let m=a.crc32===U?a[Sa]:a.crc32;const y=u.Zt.encrypted&&!c.zipCrypto;if(c.Ht&&!c.Gt&&y&&(m=U),c.Ht&&o&&!y&&m===U)throw new Error(Os);const E=wc(a=Object.assign({},a,i.Zt,s.Zt,u.Zt,{signature:a[Sa],crc32:m,offset:e.offset-p,diskNumberStart:h,[tt]:e.options[tt]}));E.qt&&Go(e.warnings,Hs,n);const b=hc(a),S=Hc(E.Yt,b.Kt);d=await async function(e,n,o,a,i){const{kt:s,writer:c}=e,{keepOrder:u,dataDescriptor:l,Xt:f,signal:w}=i,{$t:d,Ot:p,Jt:h,Qt:m}=a,y=e.options[tt];let E,b,S,g,A,R,z,x=p,D=0;const O=u&&h?h.Vt:U;s.set(n,x);try{i.bufferedWrite||!u||e.te||e._t||e.jt||!l&&!f?(E=!0,e._t++,z=i.createTempStream?await i.createTempStream():new TransformStream(U,U,{highWaterMark:T}),z.size=0,await Wo(c)):(b=!0,e.jt++,z=c,await O,await I()),await Wo(z);const p=bc(c);e.Tt&&!E&&await Fc(e,c),y&&!E&&dc(a,e.offset-p);const{Yt:h}=d;E||await k();const m=Ec(c),S=gc(e,c);if(x.diskNumberStart=m,E||(A=!0,R=c.size,await Oc(z,h)),x=await async function(e,n,{diskNumberStart:o,Vt:a},i,s,c){const{$t:u,ee:l,re:f}=i,{ne:w,oe:d,lastModDate:p,rawLastModDate:h,encrypted:m,compressed:y,version:E,compressionMethod:b,ae:S,ie:g,se:A,ce:R,ue:z,le:x,fe:D,we:F,de:O}=u,{Kt:I}=l,{rawFilename:T,lastAccessDate:k,creationDate:C,password:M,rawPassword:v,level:N,useUnicodeFileNames:_,zip64:j,pe:P,he:B,me:L,zipCrypto:W,dataDescriptor:Z,directory:V,executable:H,versionMadeBy:G,rawComment:q,rawExtraField:Y,ye:K,useWebWorkers:X,onstart:$,onprogress:J,onend:Q,signal:tt,encryptionStrength:et,extendedTimestamp:rt,msDosCompatible:nt,internalFileAttributes:ot,externalFileAttributes:at,uid:it,gid:st,unixMode:ct,symlink:ut,setuid:lt,setgid:ft,sticky:wt,unixExternalUpper:dt,msdosAttributesRaw:pt,msdosAttributes:ht,useCompressionStream:mt,Ht:yt,Gt:bt,format:St,codecURI:gt}=c,At={Vt:a,versionMadeBy:G,zip64:j,pe:P,directory:Boolean(V),executable:Boolean(H),filenameUTF8:Boolean(_),rawFilename:T,commentUTF8:Boolean(_),rawComment:q,ae:S,ie:g,se:A,le:x,fe:D,we:F,de:O,rawExtraField:Y,ye:K,extendedTimestamp:rt,msDosCompatible:nt,internalFileAttributes:ot,externalFileAttributes:at,diskNumberStart:o,uid:it,gid:st,unixMode:ct,symlink:Boolean(ut),setuid:lt,setgid:ft,sticky:wt,unixExternalUpper:dt,msdosAttributesRaw:pt,msdosAttributes:ht};let{crc32:Rt,uncompressedSize:zt}=c,xt=0;yt||(zt=0);const{writable:Dt}=n;if(e){const o=e.size,a=ar(Ho(e,{size:o})),i={options:{codecType:Kr,inputSize:o,level:N,rawPassword:v,password:M,encryptionStrength:et,zipCrypto:m&&W,passwordVerification:m&&W&&h>>8&r,computeCrc32:!yt,compressed:y&&!yt,encrypted:m&&!bt,useWebWorkers:X,useCompressionStream:mt,format:St,codecURI:gt,compressionMethod:b},config:s,F:{signal:tt,size:o,onstart:$,onprogress:J,onend:Q}};try{const e=await Tn({readable:a,writable:Dt},i);if(xt=e.outputSize,n.size+=xt,Et(tt),yt||(zt=e.inputSize,m&&!W||(Rt=e.crc32)),!L&&xt>=t||!B&&zt>=t)throw new Error(xs)}catch(t){const{outputSize:e}=i;throw e!==U?n.size+=e:Kt(t)&&t.outputSize!==U&&(n.size+=t.outputSize),t}}return function({crc32:t,compressedSize:e,uncompressedSize:r,$t:n,ee:o},{zip64:a,zipCrypto:i,Ht:s,dataDescriptor:c}){const{oe:u,encrypted:l}=n,{Ee:f,be:w}=o;l&&!i&&!s||t===U||(Wc(u,10,t),c&&Wc(f,w,t)),a?c&&(Zc(f,w+4,BigInt(e)),Zc(f,w+12,BigInt(r))):(Wc(u,14,e),Wc(u,18,r),c&&(Wc(f,w+4,e),Wc(f,w+8,r)))}({crc32:Rt,compressedSize:xt,uncompressedSize:zt,$t:u,ee:l},c),Z&&await Oc(n,I),Object.assign(At,{uncompressedSize:zt,compressedSize:xt,lastModDate:p,rawLastModDate:h,creationDate:C,lastAccessDate:k,encrypted:Boolean(m),zipCrypto:Boolean(W),size:f+xt,compressionMethod:b,version:E,ne:w,oe:d,signature:Rt,crc32:!m||W||yt?Rt:U,ce:R,ue:z,he:B,me:L}),At}(o,z,x,a,_t(),i),E||(A=!1),s.set(n,x),x.filename=n,E){if(await Promise.all([z.writable.getWriter().close(),O]),await I(),e.Tt&&await Fc(e,c),g=!0,R=c.size,await k(),x.diskNumberStart=Ec(c),x.offset=gc(e,c),y){const t=a.re;dc(a,e.offset-bc(c)),x.size+=a.re-t}!function({rawFilename:t,encrypted:e,zip64:r,ie:n,crc32:o,compressedSize:a,uncompressedSize:i,he:s,me:c},u,{dataDescriptor:l,Ht:f}){if(l||((!e||f&&o!==U)&&Wc(u,14,o),c||Wc(u,18,a),s||Wc(u,22,i)),r&&n){const e=F+Hc(t)+4;Zc(u,e,BigInt(i)),Zc(u,e+8,BigInt(a))}}(x,d.Se,i),await Oc(c,d.Yt),await Ic(z.readable,c,w,t=>D+=t),c.size+=z.size,g=!1}else x.diskNumberStart=m,x.offset=S;return e.offset+=x.size,x}catch(t){if(g||A){if(e.hasCorruptedEntries=!0,t)try{t.corruptedEntry=!0}catch{}e.offset+=c.size-R,E&&(e.offset+=D)}throw s.delete(n),t}finally{if(E&&e._t--,b&&e.jt--,m&&m(O),S&&S(),E&&z&&z.dispose)try{await z.dispose()}catch{}}async function I(){e.te=!0;const{ge:t}=e;e.ge=new Promise(t=>S=()=>{e.te=!1,t()}),await t}async function k(){Sc(c,Hc(d.Yt))&&await c.closeDisk()}}(e,n,o,{$t:E,ee:b,re:S,Ot:f,Jt:l,Qt:w},a)}catch(t){throw e.kt.delete(n),t}finally{w&&w(l&&l.Vt)}return Object.assign(d,{name:n,comment:c,extraField:u}),new Fa(d)}(e,n,o,a)}catch(t){throw e.Ct.delete(n),t}finally{const t=$s.shift();t?t():Xs--}}(a,e,n,o);i.add(s);const c=()=>i.delete(s);return Promise.prototype.then.call(s,c,c),rc(a,s)}remove(t){const{Ct:e,kt:r}=this;if(typeof t==j&&(t=r.get(t)),t&&t.filename!==U){const{filename:n}=t;if(e.has(n)&&r.has(n))return e.delete(n),r.delete(n),!0}return!1}async close(r=B,n={}){const o=this,{vt:a,writer:d}=this,{writable:p}=d;if(o.Bt)return ec(d);if(!(r instanceof Uint8Array))throw new Error(ss);if(Hc(r)>e)throw new Error(is);for(;a.size;)await Promise.allSettled(Array.from(a));await Promise.allSettled(o.Nt.map(t=>t.Ae));const h=o.Nt.filter(t=>t.Re&&!t.ze);if(h.length){const t=h.map(t=>t.error);h.forEach(t=>t.ze=!0);const[e]=t;try{e.entryErrors=t}catch{}throw e}return await async function(r,n,o){const{xe:a,De:d}=mc(r.kt),{Fe:p,Oe:h,Ie:m}=await async function(r,n,o){const{kt:a,writer:i}=r,c=new Uint8Array(n);await Wo(i);let u=0,l=0,w=Ec(i),d=bc(i),p=0;for(const[r,n]of Array.from(a.values()).entries()){const{offset:h,rawFilename:m,ae:y,de:E,se:b,le:S,we:g,rawExtraField:A,ye:R,rawComment:z,versionMadeBy:x,ne:D,oe:F,he:O,me:I,Ue:U,Te:T,internalFileAttributes:k,externalFileAttributes:C,diskNumberStart:M,uncompressedSize:v,compressedSize:N}=n,_=Hc(y,E,b,S,g,A,R),j=f+Hc(m,z)+_;Sc(i,u+j-l)&&(await Oc(i,c.slice(l,u)),l=u,p=0,await i.closeDisk()),0==r&&(w=Ec(i),d=bc(i)),O||Wc(F,18,v),I||Wc(F,14,N),(T||U)&&n.version<45&&Lc(F,0,45);const P=yc(j);if(P.ke(s),P.Ce(x),P.Me(D.subarray(0,24)),P.Ce(_),P.Ce(Hc(z)),P.Ce(U?e:M),P.Ce(k),P.ke(C),P.ke(T?t:h),P.Me(m),P.Me(y),P.Me(E),P.Me(b),P.Me(S),P.Me(g),P.Me(A),P.Me(R),P.Me(z),Vc(c,P.ct,u),u+=j,p++,o.onprogress)try{await o.onprogress(r+1,a.size,new Fa(n))}catch{}}return await Oc(i,l?c.slice(l):c),{Fe:{diskNumber:w,diskOffset:d},Oe:{diskNumber:Ec(i),ve:p},Ie:c}}(r,a,o),y=await async function(t,r,n){const o=vc(t,n,nt);if(o){const n=await o(r),a=Hc(n);if(a>e)throw new Error(Ls);const s=yc(6+a);s.ke(i),s.Ce(a),s.Me(n);const{writer:c}=t;return Sc(c,Hc(s.ct))&&await c.closeDisk(),await Oc(c,s.ct),6+a}return 0}(r,m,o);await async function(r,n,o,a){const{writer:i}=r,{Fe:s,Oe:f,Ne:d,De:p}=a;let{xe:h}=a,m=r.kt.size,y=s.diskNumber,E=gc(r,s);const b=Hc(n);if(b>e)throw new Error(is);let S=Cc(r,o,wa),g=Ec(i);if(Sc(i,(S?98:w)+b)&&g++,E>=t||h>=t||m>=e||g>=e){if(!1===S)throw new Error(xs);S=!0}else S===U&&p&&(S=!0);const A=yc(S?98:w);Sc(i,Hc(A.ct)+b)&&await i.closeDisk(),g=Ec(i);let R=g==f.diskNumber?f.ve:0;S&&(A.ke(u),A._e(44),A.Ce(45),A.Ce(45),A.ke(g),A.ke(y),A._e(R),A._e(m),A._e(h),A._e(E),A.ke(l),A.ke(g),A._e(BigInt(gc(r,i))+BigInt(h)+BigInt(d)),A.ke(g+1),Cc(r,o,"supportZip64SplitFile",!0)&&(g=e,y=e),R=e,m=e,E=t,h=t),A.ke(c),A.Ce(g),A.Ce(y),A.Ce(R),A.Ce(m),A.ke(h),A.ke(E),A.Ce(b),await Oc(i,A.ct),b&&await Oc(i,n)}(r,n,o,{Fe:p,Oe:h,xe:a,Ne:y,De:d})}(o,r,n),o.Bt=!0,!Lo(d)&&Cc(o,n,K)||await p.getWriter().close(),ec(d)}[L](){return this.close()}}class Qs{constructor(t={}){const{readable:e,writable:r}=new TransformStream;this.readable=e,this.zipWriter=new Js(r,t),this.vt=new Set}transform(t){const e=this.zipWriter;let r;const{readable:n,writable:o}=new TransformStream({start(t){r=t},flush:()=>{!async function(){try{await e.close()}catch(t){await oc(e,t)}}()}});return ac(this,this.zipWriter.add(t,n),t=>r.error(t)),{readable:this.readable,writable:o}}writable(t){let e;const{readable:r,writable:n}=new TransformStream({start(t){e=t}});return ac(this,this.zipWriter.add(t,r),t=>e.error(t)),n}async close(t,e={}){const{zipWriter:r}=this,n=(await Promise.allSettled(Array.from(this.vt))).filter(t=>"rejected"==t.status).map(t=>t.reason);if(n.length){const[t]=n;try{t.entryErrors=n}catch{}throw await oc(r,t),t}try{return await r.close(t,e)}catch(t){throw await oc(r,t),t}}}class tc extends Promise{then(t,e){const{je:r}=this;return r&&(r.ze=!0),super.then(t,e)}}function ec(t){return t.getData?t.getData():t.writable}function rc(t,e){const r=new tc((t,r)=>Promise.prototype.then.call(e,t,r)),n={};return r.je=n,n.Ae=Promise.prototype.then.call(r,U,t=>Object.assign(n,{Re:!0,error:t})),t.Nt.push(n),r}async function nc(t,e,r={}){const{vt:n,Ct:a,kt:i}=t,s=mt(r.filter);for(;n.size;)await Promise.allSettled(Array.from(n));let c;const u=new Promise(t=>c=t);n.add(u);const l=[];let f;try{e=new Po(e),await Wo(e),e.size!==U&&e.readUint8Array||(e=new uo(await ir(e.readable)),await Wo(e));const{ZipReader:r,Ut:n}=await Promise.resolve().then(function(){return os}),c=new r(e),u=await c.getEntries(),w=[];for(const t of u)s&&!await s(t)||w.push(t);await c.close(),await Wo(t.writer);const{directoryOffset:d,At:p}=c;w.forEach(t=>{const{filename:e}=t;if(p.has(t))throw new Error(M);if(a.has(e))throw new Error(as);a.add(e),l.push(e)}),t.te=!0;const{ge:h}=t;t.ge=new Promise(e=>f=()=>{t.te=!1,e()}),await h,t.Tt&&(delete t.Tt,!s&&await async function(t){return Bc(Yt(await Vo(t,0,4)),0)==o}(e)||(await Oc(t.writer,Dc()),t.offset+=4));const m=await async function(t,e,r,n,o,a,i){const{writer:s}=t,c=new Map;if(s.closeDisk||a){const u=Array.from(r).sort((t,r)=>xc(e,t)-xc(e,r)),l=function(t,e,r){const n=new Array(e.length);let o=r;for(let a=e.length-1;a>=0;a--){const i=xc(t,e[a]),s=e[a+1];s&&xc(t,s)>i&&(o=Math.min(xc(t,s),r)),n[a]=o}return n}(e,u,o),f=new Set(n),w=new Map;for(let t=0;t<u.length;t++){const r=u[t];if(f.has(r)){const n=xc(e,r),o=await zc(e,n);if(o===U)throw new Error(k);let a=n+o+r.compressedSize;if(r.bitFlag.dataDescriptor){const n=await i(e,a,r);a=n===U?Math.max(a,l[t]):a+n}if(a>l[t])throw new Error(C);l[t]=a,w.set(r,o)}}let d,p=0;for(let r=0;r<u.length;r++){const n=u[r];if(f.has(n)){const o=xc(e,n);o<p?c.set(n,d):(a||await Rc(t,e,p,o-p),s.closeDisk&&Sc(s,w.get(n))&&await s.closeDisk(),d={offset:gc(t,s),diskNumberStart:Ec(s)},c.set(n,d),await Rc(t,e,o,l[r]-o),p=l[r])}}a||await Rc(t,e,p,o-p)}else{const n=t.offset;await Rc(t,e,0,o),r.forEach(t=>c.set(t,{offset:n+xc(e,t),diskNumberStart:0}))}return c}(t,e,u,w,d,Boolean(s),n);w.forEach(t=>{const{version:e,rawLastModDate:r,rawFilename:n,rawBitFlag:o,uncompressedSize:a,compressedSize:s,extraFieldZip64:c}=t;let{compressionMethod:u,rawExtraField:l}=t;l=Ac(l||B),t.extraFieldAES&&(u=99);const f=Hc(l),w=Boolean(c)&&c.uncompressedSize!==U,d=Boolean(c)&&c.compressedSize!==U,{ne:p,oe:h}=Gc({version:e,bitFlag:o,compressionMethod:u,uncompressedSize:a,compressedSize:s,rawLastModDate:r,rawFilename:n,me:d,he:w,extraFieldLength:f}),{crc32:y}=t;y!==U&&Wc(h,10,y);const{offset:E,diskNumberStart:b}=m.get(t);Object.assign(t,{pe:!0,he:w,me:d,offset:E,diskNumberStart:b,Ue:!1,ae:B,de:B,se:B,le:B,fe:B,we:B,rawExtraField:l,ye:B,ne:p,oe:h}),i.set(t.filename,t)})}catch(t){throw l.forEach(t=>a.delete(t)),t}finally{c(),n.delete(u),f&&f()}}async function oc(t,e){try{await t.writer.writable.abort(e)}catch{}}function ac(t,e,r){t.vt.add(e),e.catch(t=>{try{r(t)}catch{}})}function ic(t,e,n){if(null===t||typeof t!=_||Array.isArray(t))throw new Error(Ws);const{externalFileAttributes:o,versionMadeBy:a,comment:i,lastModDate:s,rawLastModDate:c,creationDate:u,lastAccessDate:l,uncompressedSize:f,encrypted:w,zipCrypto:d,crc32:p,compressionMethod:h,extraFieldAES:m,extraFieldUnix:y,internalFileAttributes:E,extraField:b,bitFlag:S,directory:g,uid:A,gid:R}=t,z={externalFileAttributes:o,versionMadeBy:a,comment:i,lastModDate:s,creationDate:u,lastAccessDate:l,internalFileAttributes:E,directory:g};S&&S.languageEncodingFlag&&(z[$]=!0);const x=function(t){if(t){const e=new Map;if(t.forEach((t,r)=>{Oa.has(r)||e.set(r,t.data)}),e.size)return e}}(b);x&&(z[ga]=x),A===U&&R===U||Object.assign(z,{uid:A,gid:R,unixExtraFieldType:y?Ys:qs});const D={};if(e&&!g)if(Object.assign(D,{uncompressedSize:f,crc32:p,compressionMethod:h}),e!==lt&&Object.assign(D,{encrypted:w,zipCrypto:d,encryptionStrength:m?m.strength:U}),S&&(D.dataDescriptor=S.dataDescriptor,D[X]=Ks[S.level]),n===U)D.rawLastModDate=c;else if(e!==lt&&d&&(!S||S.dataDescriptor)&&n instanceof Date&&function(t){let e=new Date(2e3*Math.ceil(Math.floor(t.getTime()/1e3)/2));return e<I?e=I:e>O&&(e=O),(e.getHours()<<3|e.getMinutes()>>3)&r}(n)!=(c>>>8&r))throw new Error(Zs);return{Lt:z,Wt:D}}function sc(n,o,a){let i=Cc(n,a,fa),s=Cc(n,a,ha,i?20:768);const c=Cc(n,a,Ea),u=Nc(n,a,"uid"),l=Nc(n,a,"gid");let f=Nc(n,a,Aa),w=Cc(n,a,"unixExtraFieldType"),d=Cc(n,a,Ra),p=Cc(n,a,za),h=Cc(n,a,xa);if(At(u,t,Cs),At(l,t,Ms),At(f,e,vs),w!==U&&w!==qs&&w!==Ys)throw new Error(Ns);if(w===Ys&&(u!==U&&u>e||l!==U&&l>e))throw new Error(_s);w!==U||u===U&&l===U||(w=qs);let m=Nc(n,a,ua),y=Cc(n,a,la);const E=m!==U||y!==U;if(u!==U||l!==U||f!==U||w||c?(i=!1,s=s&r|768):E&&(i=!0,s&=r),At(m,r,js),y&&(typeof y!==_||Array.isArray(y)))throw new Error(Ps);if(s>e)throw new Error(ws);let b=Cc(n,a,ca);const S=b!==U;S||(b=0),!a[ya]&&o.endsWith(D)&&(a[ya]=!0);const g=Cc(n,a,ya);if(g?(o.endsWith(D)||(o+=D),S||(b=16,i||(b|=16877<<16))):i||S||(b=c?493<<16:27525120),!i){const t=f!==U||Boolean(d||p||h);f=f===U?b>>16&e:f&e,d?f|=z:d=Boolean(f&z),p?f|=x:p=Boolean(f&x),h?f|=512:h=Boolean(512&f),S&&!t||(g?f=-61441&f|R:f&A||(f|=32768),b=(f&e)<<16|b&e)}({msdosAttributesRaw:m,msdosAttributes:y}=function(t,e){if(t!==U)t&=r;else if(e!==U){const{readOnly:n,hidden:o,system:a,directory:i,archive:s}=e;let c=0;n&&(c|=1),o&&(c|=2),a&&(c|=4),i&&(c|=16),s&&(c|=32),t=c&r}return e===U&&(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}}(m,y)),E&&(b=b&t|m&r);const F=b>>16&e,O=f!==U&&40960==(f&A);return{name:o,Zt:{versionMadeBy:s,msDosCompatible:Boolean(i),externalFileAttributes:b,unixExternalUpper:F,uid:u,gid:l,unixMode:f,unixExtraFieldType:w,symlink:O,setuid:d,setgid:p,sticky:h,msdosAttributesRaw:m,msdosAttributes:y}}}function cc(t,r,n){const o=vc(t,n,"encodeText")||se;let a=o(r,at);if(a===U&&(a=se(r)),Hc(a)>e)throw new Error(fs);const i=n[Ko]||"";if(typeof i!=j)throw new Error(us);let s=o(i,it);if(s===U&&(s=se(i)),Hc(s)>e)throw new Error(cs);const c=Cc(t,n,pa);if(c!==U&&c>e)throw new Error(ws);const u=Mc(t,n,ea,new Date),l=Cc(t,n,ra),f=Mc(t,n,na),w=Mc(t,n,aa),d=Cc(t,n,sa,0),p=St(Cc(t,n,V)),h=Boolean(p),m=!0===p;let y=Cc(t,n,W),E=Cc(t,n,Z);bt(y,E),y=y&&y.length?y:U,E=E&&E.length?E:U;const b=Nc(t,n,"encryptionStrength",3),S=Cc(t,n,ma),g=Cc(t,n,"extendedTimestamp",!0),A=Cc(t,n,"ntfsTimestamp"),R=Cc(t,n,"keepOrder",!0),z=Cc(t,n,q),x=Cc(t,n,"bufferedWrite"),D=vc(t,n,"createTempStream"),F=Cc(t,n,"dataDescriptorSignature",!0),O=yt(Cc(t,n,H));Et(O);const I=Cc(t,n,$,!qc(a)||!qc(s)),T=Cc(t,n,ba),k=h||T===U?U:yr(T);if(!h&&T!==U&&0!==T&&8!==T&&!k)throw new Error(fr);let C=Nc(t,n,X);if(At(C,9,Bs),t.options[tt]){if(y!==U||E!==U)throw new Error(ps);C===U&&T===U&&(C=0)}h&&(C=Rt(n[X]));let M=Cc(t,n,Y),v=Cc(t,n,J);x&&v===U&&(v=!1),(v===U||S&&!m)&&(v=!0),C!==U&&6!=C&&(M=!1);const N=Cc(t,n,wa);if(!(S||y===U&&E===U||Number.isInteger(b)&&b>=1&&b<=3))throw new Error(ds);const _=uc(n[ga]),P=uc(n.localExtraField),B=uc(n.centralExtraField);return{comment:i,Zt:{rawFilename:a,rawComment:s,version:c,lastModDate:u,rawLastModDate:l,lastAccessDate:f,creationDate:w,internalFileAttributes:d,Ht:h,Gt:m,password:y,rawPassword:E,encryptionStrength:b,zipCrypto:S,extendedTimestamp:g,ntfsTimestamp:A,keepOrder:R,useWebWorkers:z,bufferedWrite:x,createTempStream:D,dataDescriptorSignature:F,signal:O,useUnicodeFileNames:I,compressionMethod:T,format:k?k.format:U,codecURI:k?k.codecURI:U,Pe:k?k.versionNeeded:U,level:C,useCompressionStream:M,dataDescriptor:v,zip64:N,rawExtraField:_,Be:P,ye:B}}}function uc(t){if(!t)return B;if(!(t instanceof Map))throw new Error(ys);let r=0,n=0;t.forEach((t,n)=>{if(gt(n,e,Es),!(t instanceof Uint8Array))throw new Error(bs);if(Hc(t)>e)throw new Error(Ss);r+=4+Hc(t)});const o=new Uint8Array(r),a=Yt(o);return t.forEach((t,e)=>{Lc(a,n,e),Lc(a,n+2,Hc(t)),Vc(o,t,n+4),n+=4+Hc(t)}),o}function lc(e,r,n,o,a){const{Ht:i,Gt:s,zipCrypto:c,password:u,rawPassword:l,encryptionStrength:f}=o;let{dataDescriptor:w,zip64:d,level:p,compressionMethod:h}=o,m=0,y=0,E=!1;if(i&&r){if(y=a[$o],y===U)throw new Error(Ds);if(h===U)throw new Error(Fs)}const b=!0===d,S=Cc(e,a,da);if(r&&s&&!S&&Hc(u,l))throw new Error(ms);const g=r&&(Boolean(u&&Hc(u)||l&&Hc(l))||s&&S);r||(p=0,h=0);const A=Ia(g,c,f);r&&(i?(a.uncompressedSize=y,m=n===U?_c(y)+A:n+(s?0:A)):n===U?(w=!0,(d||d===U)&&(d=E=!0,m=4294967296)):(a.uncompressedSize=y=n,m=(jc(h,p)?_c(y):y)+A));const R=!(g||r&&(0!==n||i)||jc(h,p));R&&Cc(e,a,J)===U&&(w=!1);const z=b||E||y>=t,x=b||m>=t;if(z||x){if(!1===d)throw new Error(xs);d=!0}return d=d||!1,{Le:m,Zt:{dataDescriptor:w,Xt:R,zip64:d,pe:b,We:E,he:z,me:x,uncompressedSize:y,level:p,compressionMethod:h,encrypted:g}}}function fc(e,r,n){const o=e.slice().sort((t,e)=>n?e-t:t-e);let a=r,i=0;for(const e of o){if(a>=t)break;a+=e,i++}return i}function wc(t){const{rawFilename:r,lastModDate:o,rawLastModDate:a,lastAccessDate:i,creationDate:s,level:c,zip64:u,zipCrypto:l,useUnicodeFileNames:f,dataDescriptor:w,directory:d,rawExtraField:p,Be:y,encryptionStrength:S,extendedTimestamp:g,ntfsTimestamp:A,Ht:R,encrypted:z,he:x,me:D,uncompressedSize:T,We:k,crc32:C}=t;let{version:M,compressionMethod:v}=t;const N=!d&&jc(v,c);let _;const j=R||!N,P=u&&(t.bufferedWrite||!w||!x&&!D||j&&!k),L=P||u&&w&&(x||D);if(u&&(x||D)){const t=20,e=yc(t);if(e.Ce(1),e.Ce(t-4),_=e.ct,P&&(e._e(T),j)){const t=Ia(z,l,S);e._e(R?0:T+t)}}else _=B;let W,Z,V,H,G;if(z&&!l){const t=yc(Hc(Gs)+2);t.Ce(h),t.Me(Gs),W=t.ct,W[8]=S}else W=B;if(g){const t=Tc(o),e=(q=t)>=gs&&q<=As;if(e){const e=9+(i?4:0)+(s?4:0),r=yc(e);H=1+(i?2:0)+(s?4:0),G=t,r.Ce(m),r.Ce(e-4),r.Ze(H),r.ke(t),i&&r.ke(kc(Tc(i))),s&&r.ke(kc(Tc(s))),V=r.ct}else V=B;if(A===U?!e||Boolean(i||s):A)try{const t=Uc(o),e=yc(36);e.Ce(10),e.Ce(32),e.Ve(4),e.Ce(1),e.Ce(24),e._e(t),e._e(i?Uc(i):t),e._e(s?Uc(s):t),Z=e.ct}catch{Z=B}else Z=B}else Z=V=B;var q;let Y,K;try{const{uid:r,gid:n,unixExtraFieldType:o}=t;if(o!=qs||r===U&&n===U)if(o!=Ys||r===U&&n===U)Y=K=B;else{const t=yc(8);t.Ce(b),t.Ce(4),t.Ce((r===U?0:r)&e),t.Ce((n===U?0:n)&e),Y=t.ct;const o=yc(4);o.Ce(b),o.Ce(0),K=o.ct}else{const t=pc(r===U?0:r),e=pc(n===U?0:n),o=3+t.length+e.length,a=yc(4+o);a.Ce(E),a.Ce(o),a.Ze(1),a.Ze(t.length),a.Me(t),a.Ze(e.length),a.Me(e),Y=K=a.ct}}catch{Y=K=B}v===U&&(v=N?8:0),M===U&&(M=0!=v||d||z?20:10);const{Pe:X}=t;N&&X!==U&&(M=M>X?M:X),u&&(M=M>45?M:45),z&&!l&&(M=M>51?M:51,R&&C!==U&&(W[4]=1),Lc(Yt(W),9,v),v=99);const $=L?Hc(_):0,J=$+Hc(W,V,Z,Y,p,y);if(J+(t[tt]?67:0)>e)throw new Error(Ss);const Q=new Date(2e3*Math.ceil(Math.floor(o.getTime()/1e3)/2)),et=Q<I?I:Q>O?O:Q,rt=Hc(V)?new Date(1e3*Tc(o)):Hc(Z)?o:et,{ne:nt,oe:ot,rawLastModDate:at}=Gc({version:M,bitFlag:Yc(c,f,w,z,v),compressionMethod:v,uncompressedSize:T,lastModDate:et,rawLastModDate:a,rawFilename:r,me:D,he:x,extraFieldLength:J}),it=yc(F+Hc(r)+J),st=it.ct,ct=Yt(st);return it.ke(n),it.Me(nt),it.Me(r),L&&it.Me(_),it.Me(W),it.Me(V),it.Me(Z),it.Me(Y),it.Me(p),it.Me(y),w&&(D||Wc(ct,18,0),x||Wc(ct,22,0)),{Yt:st,Se:ct,ne:nt,oe:ot,lastModDate:rt,qt:rt===et&&Q.getTime()!=et.getTime(),rawLastModDate:at,encrypted:z,compressed:N,version:M,compressionMethod:v,ce:H,ue:G,ae:B,ie:$,se:V,le:Z,fe:Y,we:K,de:W,extraFieldLength:J}}function dc(t,e){const{$t:r}=t;let{Yt:n,extraFieldLength:o}=r,a=64-(e+Hc(n))%64;a<4&&(a+=64);const i=new Uint8Array(a),s=Yt(i);Lc(s,0,y),Lc(s,2,a-4);const c=n;r.Yt=n=new Uint8Array(Hc(c)+a),Vc(n,c),Vc(n,i,Hc(c));const u=Yt(n);Lc(u,28,o+a),r.Se=u,t.re+=a}function pc(t){const e=new Uint8Array(4);Yt(e).setUint32(0,t,!0);let r=4;for(;r>1&&0===e[r-1];)r--;return e.subarray(0,r)}function hc({zip64:t,dataDescriptor:e,dataDescriptorSignature:r}){let n,o=B,i=0,s=t?20:12;return r&&(s+=4),e&&(o=new Uint8Array(s),n=Yt(o),r&&(i=4,Wc(n,0,a))),{Kt:o,Ee:n,be:i}}function mc(r){let n=0,o=!1;for(const[,a]of r){const{rawFilename:r,de:i,rawComment:s,le:c,we:u,rawExtraField:l,ye:w,ce:d,ue:p,pe:h,uncompressedSize:y,compressedSize:E}=a;let{he:b,me:S}=a;h||(b&&y<t&&(b=a.he=!1),S&&E<t&&(S=a.me=!1)),o=o||b||S;const g=a.offset>=t,A=a.diskNumberStart>=e;let R,z;if(g||A||b||S){const t=4+(b?8:0)+(S?8:0)+(g?8:0)+(A?4:0),e=yc(t);e.Ce(1),e.Ce(t-4),b&&e._e(y),S&&e._e(E),g&&e._e(a.offset),A&&e.ke(a.diskNumberStart),R=e.ct}else R=B;if(a.ae=R,a.Te=g,a.Ue=A,p===U)z=B;else{const t=yc(9);t.Ce(m),t.Ce(5),t.Ze(d),t.ke(p),z=t.ct}a.se=z;const x=Hc(R,i,c,u,z,l,w);if(x>e)throw new Error(Ss);n+=f+Hc(r,s)+x}return{xe:n,De:o}}function yc(t){const e=new Uint8Array(t),r=Yt(e);let n=0;return{ct:e,Ze:t=>{!function(t,e,r){t.setUint8(e,r)}(r,n,t),n+=1},Ce:t=>{Lc(r,n,t),n+=2},ke:t=>{Wc(r,n,t),n+=4},_e:t=>{Zc(r,n,BigInt(t)),n+=8},Me:t=>{Vc(e,t,n),n+=Hc(t)},Ve:t=>n+=t}}function Ec(t){const{diskNumber:e=0}=t;return e}function bc(t){const{diskOffset:e=0}=t;return e}function Sc(t,e){const{availableSize:r=T}=t;return e>r}function gc(t,{diskNumber:e=0,diskOffset:r=0}){return t.offset-r-(e?t.Mt:0)}function Ac(t){const e=Yt(t);let r=0;for(;r+4<=Hc(t);){const n=4+Pc(e,r+2);if(1==Pc(e,r))return Ac(Gt(t.subarray(0,r),t.subarray(Math.min(r+n,Hc(t)))));r+=n}return t}async function Rc(t,e,r,n){if(n>0){const{writer:o}=t;let a=0;try{await Ic(Ho(e,{offset:r,size:n}),o,U,t=>a+=t)}catch(e){if(a){t.hasCorruptedEntries=!0;try{e.corruptedEntry=!0}catch{}}throw e}finally{o.size+=a,t.offset+=a}}}async function zc(t,e){const r=e>=0&&e+F<=t.size?await Vo(t,e,F):B;if(Hc(r)<F)return U;const o=Yt(r);return Bc(o,0)!=n?U:F+Pc(o,26)+Pc(o,28)}function xc(t,{offset:e,diskNumberStart:r}){return e+(t.ht?t.ht(r):0)}function Dc(){const t=new Uint8Array(4);return Wc(Yt(t),0,o),t}async function Fc(t,e){delete t.Tt,await Oc(e,Dc()),t.offset+=4}async function Oc(t,e){const{writable:r}=t,n=r.getWriter();try{await n.ready,t.size+=Hc(e),await n.write(e)}finally{n.releaseLock()}}async function Ic(t,e,r,n){const o=e.writable.getWriter();try{await t.pipeTo(new WritableStream({async write(t){await o.ready,await o.write(t),n(Hc(t))}}),{preventClose:!0,preventAbort:!0,signal:r})}finally{o.releaseLock()}}function Uc(t){if(t){const e=(BigInt(t.getTime())+BigInt(116444736e5))*BigInt(1e4);return e<Rs?Rs:e>zs?zs:e}}function Tc(t){return Math.floor(t.getTime()/1e3)}function kc(t){return Math.min(As,Math.max(gs,t))}function Cc(t,e,r,n){const o=e[r]===U?t.options[r]:e[r];return o===U?n:o}function Mc(t,e,r,n){const o=Cc(t,e,r,n);if(null===o)return n;if(o!==U&&(typeof o.getTime!=N||Number.isNaN(o.getTime())))throw new Error(ls);return o}function vc(t,e,r){return mt(Cc(t,e,r))}function Nc(t,e,r,n){return Rt(Cc(t,e,r,n))}function _c(t){return t+5*(Math.floor(t/16383)+1)}function jc(t,e){return t===U?e===U||e>0:0!==t}function Pc(t,e){return t.getUint16(e,!0)}function Bc(t,e){return t.getUint32(e,!0)}function Lc(t,e,r){t.setUint16(e,r,!0)}function Wc(t,e,r){t.setUint32(e,r,!0)}function Zc(t,e,r){t.setBigUint64(e,r,!0)}function Vc(t,e,r){t.set(e,r)}function Hc(...t){let e=0;return t.forEach(t=>t&&(e+=t.length)),e}function Gc({version:e,bitFlag:r,compressionMethod:n,uncompressedSize:o,compressedSize:a,lastModDate:i,rawLastModDate:s,rawFilename:c,me:u,he:l,extraFieldLength:f}){const w=yc(26),d=w.ct,p=Yt(d);if(w.Ce(e),w.Ce(r),w.Ce(n),s===U){const t=new Uint32Array(1),e=Yt(t);Lc(e,0,(i.getHours()<<6|i.getMinutes())<<5|i.getSeconds()/2),Lc(e,2,(i.getFullYear()-1980<<4|i.getMonth()+1)<<5|i.getDate()),s=t[0]}return w.ke(s),w.Ve(4),u||a!==U?w.ke(u?t:a):w.Ve(4),l||o!==U?w.ke(l?t:o):w.Ve(4),w.Ce(Hc(c)),w.Ce(f),{ne:d,oe:p,rawLastModDate:s}}function qc(t){return t.every(t=>t>=32&&t<=126)}function Yc(t,e,r,n,o){let a=0;return e&&(a|=S),r&&(a|=8),8!=o&&9!=o||(t>=0&&t<=3&&(a|=6),t>3&&t<=5&&(a|=4),9==t&&(a|=2)),n&&(a|=1),a}function Kc(){return"application/octet-stream"}function Xc(){const{CompressionStream:t,DecompressionStream:e,CompressionStreamFallback:r,DecompressionStreamFallback:n}=_t(),o=[{compressionMethod:0,compression:!0,decompression:!0,registered:!1},{compressionMethod:8,compression:$c(r,xr)||$c(t,xr)||$c(t,Fr),decompression:$c(n,xr)||$c(e,xr)||$c(e,Fr),registered:!1},{compressionMethod:9,compression:!1,decompression:$c(n,Dr)||$c(e,Dr),registered:!1}];for(const t of Er()){const e=br(t.format);o.push({compressionMethod:t.compressionMethod,compression:e?typeof e.CompressionStream==N:U,decompression:e?typeof e.DecompressionStream==N:U,registered:!0})}return o}function $c(t,e){if(!t)return!1;const{supportedFormats:r}=t;return r?r.includes(e):Cr(t,e)}const Jc="2.21.0",Qc=1048576,tu=".zip.js-temp";function eu(t={}){const{thresholdBytes:e=Qc,directoryName:r=tu,getDirectory:n=()=>navigator.storage.getDirectory()}=t;let o;function a(){return o||(o=Promise.resolve(n()).then(t=>t.getDirectoryHandle(r,{create:!0}))),o}return function(){const t=[];let r,n,o,i,s=0,c=!1;const u=new WritableStream({async write(i){c?await o.write(i):(t.push(i),s+=i.length,s>e&&await async function(){const e=await a();r=crypto.randomUUID?crypto.randomUUID():Array.from(crypto.getRandomValues(new Uint8Array(16)),t=>t.toString(16).padStart(2,"0")).join(""),n=await e.getFileHandle(r,{create:!0}),o=(await n.createWritable()).getWriter(),c=!0;for(const e of t)await o.write(e);t.length=0}())},async close(){o&&(await o.close(),o=null)}});let l=0;return{writable:u,readable:new ReadableStream({async pull(e){if(c){if(!i){const t=await n.getFile();i=t.stream().getReader()}const{value:t,done:r}=await i.read();r?e.close():e.enqueue(t)}else l<t.length?e.enqueue(t[l++]):e.close()},async cancel(t){i&&await i.cancel(t)}},{highWaterMark:0}),dispose:async function(){if(o){try{await o.close()}catch{}o=null}if(r){try{const t=await a();await t.removeEntry(r)}catch{}n=r=null}t.length=0}}}}const ru=1048576;function nu(t={}){const{thresholdBytes:e=ru}=t;return function(){const t=[];let r,n,o,a=0,i=!1;const s=new WritableStream({async write(o){i?await r.write(o):(t.push(o),a+=o.length,a>e&&await async function(){const e=new TransformStream;n=ir(e.readable),r=e.writable.getWriter(),i=!0;for(const e of t)await r.write(e);t.length=0}())},async close(){r&&(await r.close(),r=null)}});let c=0;return{writable:s,readable:new ReadableStream({async pull(e){if(i){if(!o){const t=await n;o=t.stream().getReader()}const{value:t,done:r}=await o.read();r?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(r){try{await r.abort()}catch{}r=null}n&&(n.catch(()=>{}),n=null),t.length=0}}}}const ou=1048576,au=".zip.js-temp",iu="createSyncAccessHandle is only available in dedicated workers";function su(t={}){const{thresholdBytes:e=ou,directoryName:r=au,getDirectory:n}=t;if(!(n||"undefined"!=typeof FileSystemFileHandle&&FileSystemFileHandle.prototype.createSyncAccessHandle))throw new Error(iu);const o=n||(()=>navigator.storage.getDirectory());let a;function i(){return a||(a=Promise.resolve(o()).then(t=>t.getDirectoryHandle(r,{create:!0}))),a}return function(){const t=[];let r,n,o=0,a=!1,s=0,c=0;const u=new WritableStream({async write(c){a?(n.write(c,{at:s}),s+=c.length):(t.push(c),o+=c.length,o>e&&await async function(){const e=await i();r=crypto.randomUUID?crypto.randomUUID():Array.from(crypto.getRandomValues(new Uint8Array(16)),t=>t.toString(16).padStart(2,"0")).join("");const o=await e.getFileHandle(r,{create:!0});n=await o.createSyncAccessHandle(),a=!0;for(const e of t)n.write(e,{at:s}),s+=e.length;t.length=0}())},close(){n&&n.flush()}});let l=0;const f=new ReadableStream({pull(e){if(a){const t=s-c;if(t<=0)return void e.close();const r=new Uint8Array(Math.min(524288,t)),o=n.read(r,{at:c});o?(c+=o,e.enqueue(r.subarray(0,o))):e.close()}else l<t.length?e.enqueue(t[l++]):e.close()}},{highWaterMark:0});return{writable:u,readable:f,dispose:async function(){if(n){try{n.close()}catch{}n=null}if(r){try{const t=await i();await t.removeEntry(r)}catch{}r=null}t.length=0}}}}try{Vt({baseURI:import.meta.url})}catch{}const cu="deflate",uu="deflate-raw",lu="deflate64-raw",fu="gzip",wu=[cu,uu,fu],du=[cu,uu,fu,lu];let pu,hu,mu,yu,Eu;function bu(t,e){return-4===e&&(t.code="Z_MEM_ERROR"),t}function Su(t,e,r={}){if(!(t?wu:du).includes(e))throw new TypeError("Unsupported format: "+e);if(!pu){const t=new Error("WASM module not loaded");throw t.cause=Eu,t}const n="number"==typeof r.level?r.level:-1,o="number"==typeof r.outBuffer?r.outBuffer:65536,a="number"==typeof r.inBufferSize?r.inBufferSize:65536,i={He:0,in:0,inBufferSize:0,Ge:0,qe:!1};let s,c,u,l,f=!0,w=!1;return function(){try{let r;if(i.He=hu(o),i.in=hu(a),i.inBufferSize=a,!i.He||!i.in)throw bu(new Error("allocation failed"),-4);if(t?(i.Ye=pu.deflate_process,i.Ke=pu.deflate_last_consumed,i.Xe=pu.deflate_end,i.Ge=pu.deflate_new(),r=e===fu?pu.deflate_init_gzip(i.Ge,n):e===uu?pu.deflate_init_raw(i.Ge,n):pu.deflate_init(i.Ge,n)):e===lu?(i.Ye=pu.inflate9_process,i.Ke=pu.inflate9_last_consumed,i.Xe=pu.inflate9_end,i.Ge=pu.inflate9_new(),r=pu.inflate9_init_raw(i.Ge)):(i.Ye=pu.inflate_process,i.Ke=pu.inflate_last_consumed,i.Xe=pu.inflate_end,i.Ge=pu.inflate_new(),r=e===uu?pu.inflate_init_raw(i.Ge):e===fu?pu.inflate_init_gzip(i.Ge):pu.inflate_init(i.Ge)),0!==r)throw bu(new Error("init failed:"+r),r)}catch(t){throw h(i),t}}(),{readable:new ReadableStream({start(t){s=t},pull(){f=!1,p()},cancel(t){w=!0,l=t,h(i),c.error(t),p()}},{highWaterMark:0}),writable:new WritableStream({start(t){c=t},async write(t){if(f&&await new Promise(t=>u=t),w)throw l;try{!function(t){const e=new Uint8Array(yu.buffer),r=i.Ye,n=i.Ke,a=i.He;let s=0;for(;s<t.length;){if(i.qe)throw new Error("trailing data after the end of the stream");const c=Math.min(t.length-s,32768);if((!i.in||i.inBufferSize<c)&&(i.in&&mu&&(mu(i.in),i.in=0),i.in=hu(c),i.inBufferSize=c,!i.in))throw bu(new Error("allocation failed"),-4);e.set(t.subarray(s,s+c),i.in);const u=r(i.Ge,i.in,c,a,o,0),l=u>>24&255,f=128&l?l-256:l;if(f<0)throw bu(new Error("process error:"+f),f);const w=16777215&u;w&&d(e.slice(a,a+w));const p=n(i.Ge);if(1===l)i.qe=!0;else if(0===p&&0===w)break;s+=p}}(t)}catch(t){throw h(i),s.error(t),t}},close(){if(w)return;try{!function(){const t=new Uint8Array(yu.buffer),e=i.Ye,r=i.He;for(;;){const n=e(i.Ge,0,0,r,o,4),a=n>>24&255,s=128&a?a-256:a;if(s<0)throw bu(new Error("process error:"+s),s);const c=16777215&n;if(c&&d(t.slice(r,r+c)),1===a||0===c)break}}()}catch(t){throw h(i),s.error(t),t}const t=h(i);if(0!==t){const e=bu(new Error("end error:"+t),t);throw s.error(e),e}s.close()},abort(t){h(i),s.error(t)}},{highWaterMark:1})};function d(t){f=!0,s.enqueue(t)}function p(){if(u){const t=u;u=null,t()}}function h(t){let e=0;return t.Ge&&t.Xe&&(e=t.Xe(t.Ge)),t.Ge=0,t.in&&mu&&mu(t.in),t.in=0,t.He&&mu&&mu(t.He),t.He=0,e}}class gu{constructor(t=cu,e){return Su(!0,t,e)}}class Au{constructor(t=cu,e){return Su(!1,t,e)}}gu.requiresModule=!0,Au.requiresModule=!0,gu.supportedFormats=wu,Au.supportedFormats=du;const Ru=65536;let zu,xu;function Du(t){return new Uint8Array(t.memory.buffer)}let Fu,Ou=!1;var Iu;async function Uu(){await async function(){await Promise.allSettled([vn(),...Dn.map(t=>(jn(t),t.terminate()))]),tn=U,en=!1}(),Fu=null,Ou=!1,pu=hu=mu=yu=Eu=null,zu=null,xu=0}Iu=function(t,e){const r=zu;let n=r?function(t,e,r){xu||(xu=t.malloc(Ru));const n=xu?t.aes_hmac_new():0;if(n){const o=Du(t);if(o.set(e,xu),o.set(r,xu+e.length),t.aes_hmac_init(n,xu,e.length,xu+e.length,r.length))return t.aes_hmac_end(n,0),0}return n}(r,t,e):0;if(!n)return be(t,e);const o=xu;return{process(t,e){for(let a=0;a<t.length;a+=Ru){const i=t.subarray(a,a+Ru),s=Du(r);s.set(i,o),r.aes_hmac_process(n,o,i.length,e?1:0),i.set(s.subarray(o,o+i.length))}},digest:()=>(r.aes_hmac_end(n,o),n=0,Du(r).slice(o,o+20)),dispose(){n&&(r.aes_hmac_end(n,0),n=0)}}},Be=Iu||be,function({$e:t}){nn=t}({$e:t=>{if(!Fu){let{wasmURI:e}=t;typeof e==N&&(e=e()),Fu=async function(t,{baseURI:e}){if(!Ou)try{await async function(t,e){let r,n;try{try{n=new URL(t,e)}catch{}const o=await fetch(n);r=await o.arrayBuffer()}catch(e){if(!t.startsWith("data:application/wasm;base64,"))throw e;r=function(t){const e=t.split(",")[1],r=atob(e),n=r.length,o=new Uint8Array(n);for(let t=0;t<n;++t)o[t]=r.charCodeAt(t);return o.buffer}(t)}const o=await WebAssembly.instantiate(r);var a;(function(t){if(pu=t,({malloc:hu,free:mu,memory:yu}=pu),"function"!=typeof hu||"function"!=typeof mu||!yu)throw pu=hu=mu=yu=null,new Error("Invalid WASM module")})(o.instance.exports),typeof(a=o.instance.exports).aes_hmac_new==N&&(zu=a,xu=0)}(t,e),Ou=!0}catch(t){throw function(t){Eu=t}(t),t}}(e,t).catch(t=>{throw Fu=null,t})}return Fu}}),Vt({CompressionStreamFallback:gu,DecompressionStreamFallback:Au}),Vt({workerURI:new URL("./zip-web-worker.js",import.meta.url).href,wasmURI:new URL("./zip-module.wasm",import.meta.url).href});const Tu="Entry filename already exists",ku="Duplicate entry filename in the imported zip file",Cu='Invalid duplicates option (must be "throw", "keep-first" or "keep-last")',Mu="Entry is an ancestor of target entry",vu="Root directory cannot be moved",Nu="Target entry is not a directory",_u="Parent entry is not a directory",ju="Readable stream already consumed",Pu="throw",Bu="keep-first",Lu="keep-last",Wu=new Set([Pu,Bu,Lu]),Zu="Invalid passThrough option (use readerOptions.passThrough or set uncompressedSize for each entry)",Vu="Invalid readerOptions (must be an object)",Hu="The 'compressed' passThrough option is only supported by Entry#getData() and ZipWriter#add()",Gu="Invalid passwords option (must be an array of strings)",qu="Invalid requestPassword option (must be a function returning a string or undefined)",Yu="zipjs-abort-export",Ku=new Uint8Array(0),Xu=new Set([zr,gr,Ar]);class $u{constructor(t,e,r,n){const o=this;if(t.root&&n&&n.getChildByName(e))throw new Error(Tu);r||(r={}),Object.assign(o,{fs:t,name:e,data:r.data,options:r.options&&Object.assign({},r.options),id:t.Je++,parent:n,children:[],uncompressedSize:r.uncompressedSize||0,Qe:r.Qe||r.uncompressedSize===U,passThrough:r.passThrough,er:r.er||new Date}),!n&&t.root||(t.entries[o.id]=o),n&&o.parent.children.push(o)}getFullname(){return this.getRelativeName()}getRelativeName(t=this.fs.root){let e=this.name,r=this.parent;for(;r&&r!=t;)e=(r.name?r.name+"/":"")+e,r=r.parent;return e}isDescendantOf(t){let e=this.parent;for(;e&&e.id!=t.id;)e=e.parent;return Boolean(e)}rename(t){const e=this;let r=e.parent;if(r){const n=Il(t);n&&(t=n.pop(),r=Ul(r,n,e));const o=r.getChildByName(t);if(o&&o!=e)throw new Error(Tu);r!=e.parent&&(ul(e),e.parent=r,r.children.push(e),Fl(e.fs,e))}e.name=t}setOptions(t){const e=Object.assign({},this.options,t);this.options=Object.fromEntries(Object.entries(e).filter(([,t])=>t!==U))}}class Ju extends $u{constructor(t,e,r,n){super(t,e,r,n);const o=this;o.Reader=r.Reader,o.Writer=r.Writer,r.getData&&(o.getData=r.getData)}clone(){return new Ju(this.fs,this.name,this)}async getData(t,e={}){const r=this;if(!t||t.constructor==r.Writer&&r.data&&function(t,e){const{contentType:r}=t;return r===U||(t.constructor==lo?e.type==r:t.constructor!=io||e.startsWith("data:"+(r||"")+";base64,"))}(t,r.data))return r.data;{const n=r.reader=sl(r.Reader,r.data,e),o=r.uncompressedSize||n.size;await Promise.all([Wo(n),Wo(t,o)]);const a=yt(e.signal),i=function(t,e,r,n){const{onstart:o,onprogress:a,onend:i}=r,{readable:s}=e;return t.data instanceof Fa||!o&&!a&&!i?s:ar(s).pipeThrough(new un({onstart:o,onprogress:a,onend:i,size:e.size}),{signal:n})}(r,n,e,a),s=!Lo(t)&&Boolean(e.preventClose);return r.uncompressedSize=n.size,await ar(i).pipeTo(sr(t.writable),{signal:a,preventClose:s,preventAbort:s}),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,Object.assign({},e,{password:t,checkPasswordOnly:!0})),!0}catch(t){if(Kt(t)&&t.message==xe)return!1;throw t}}getText(t,e){return this.getData(new po(t),e)}getBlob(t,e){return this.getData(new lo(t),e)}getData64URI(t,e){return this.getData(new io(t),e)}getUint8Array(t){return this.getData(new No,t)}getWritable(t=new WritableStream,e){return this.getData({writable:t},e)}async getArrayBuffer(t){return qt(await this.getUint8Array(t)).buffer}replaceBlob(t){bl(this,{data:t,Reader:uo,Writer:lo,uncompressedSize:t.size})}replaceText(t){bl(this,{data:t,Reader:fo,Writer:po,uncompressedSize:wo(t)})}replaceData64URI(t){bl(this,{data:t,Reader:ao,Writer:io,uncompressedSize:Sl(t)})}replaceUint8Array(t){bl(this,{data:t,Reader:vo,Writer:No,uncompressedSize:t.length})}replaceReadable(t){bl(this,{data:null,Reader:al(t),Writer:null,uncompressedSize:U})}}class Qu extends $u{constructor(t,e,r,n){super(t,e,r,n),this.directory=!0}clone(t){const e=this,r=new Qu(e.fs,e.name,e);return t&&(r.children=e.children.map(e=>{const n=e.clone(t);return n.parent=r,n})),r}addDirectory(t,e){return Ol(this,t,{options:e},!0)}addText(t,e,r={}){return Ol(this,t,{data:e,Reader:fo,Writer:po,options:r,uncompressedSize:wo(e)})}addBlob(t,e,r={}){return Ol(this,t,{data:e,Reader:uo,Writer:lo,options:r,uncompressedSize:e.size})}addData64URI(t,e,r={}){return Ol(this,t,{data:e,Reader:ao,Writer:io,options:r,uncompressedSize:Sl(e)})}addUint8Array(t,e,r={}){return Ol(this,t,{data:e,Reader:vo,Writer:No,options:r,uncompressedSize:e.length})}addHttpContent(t,e,r={}){return Ol(this,t,{data:e,Reader:class extends Co{constructor(t){super(t,r)}},options:r})}addReadable(t,e,r={}){return Ol(this,t,{Reader:al(e),options:r})}addFileSystemEntry(t,e={}){return Rl(this,t,e)}addFileSystemHandle(t,e={}){return Rl(this,t,e)}addFile(t,e={}){return(e=Object.assign({},e)).lastModDate||(e.lastModDate=new Date(t.lastModified)),Ol(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 uo(t),e)}importData64URI(t,e){return this.importZip(new ao(t),e)}importUint8Array(t,e){return this.importZip(new vo(t),e)}importHttpContent(t,e){return this.importZip(new Co(t,e),e)}importReadable(t,e){return this.importZip({readable:t},e)}exportBlob(t={}){return this.exportZip(new lo(t.mimeType||"application/zip"),t)}exportData64URI(t={}){return this.exportZip(new io(t.mimeType||"application/zip"),t)}exportUint8Array(t={}){return this.exportZip(new No,t)}async exportWritable(t=new WritableStream,e={}){return await this.exportZip({writable:t},e),t}exportFileSystemHandle(t,e={}){return async function(t,e,r){const{onstart:n,onprogress:o,onend:a}=r;El(r.passThrough),pl(r);const i=dl(r.readerOptions),s=new AbortController,{signal:c}=s,u=function(t,e){if(!yt(t))return()=>{};if(t.aborted)return e.abort(t.reason),()=>{};const r=()=>e.abort(t.reason);return t.addEventListener("abort",r,{once:!0}),()=>t.removeEventListener("abort",r)}(r.signal,s),l=Object.assign({},r,i,{signal:c,onstart:U,onprogress:U,onend:U,preventClose:!1}),f=rl([t],t=>ol(t,l.passThrough)),w=[];let d=!1,p=0;try{n&&await ln(n,f),await m(t,e),a&&await ln(a,p)}catch(t){try{t.exportedEntryNames=w}catch{}throw t}finally{u()}return e;function h(t){const e=t.getWriter();return new WritableStream({async write(t){await e.write(t),p+=t.length,o&&await ln(o,p,f)},close:()=>e.close(),abort:t=>e.abort(t)})}async function m(t,e){if(r.concurrent){const r=(await Promise.allSettled(t.children.map(t=>y(t,e)))).filter(t=>"rejected"==t.status);if(r.length){const t=r.filter(t=>!ll(t.reason));throw function(t){const[e]=t,r=t.slice(1).flatMap(t=>[t,...t&&t.entryErrors||[]]).filter(t=>t!==e);if(r.length)try{e.entryErrors=[...e.entryErrors||[],...r]}catch{}return e}((t.length?t:r).map(t=>t.reason))}}else for(const r of t.children)await y(r,e)}async function y(e,r){if(c.aborted){if(d||ll(c.reason))return;Et(c)}try{if(e.directory){const t=await r.getDirectoryHandle(e.name,{create:!0});await m(e,t)}else{const n=await r.getFileHandle(e.name,{create:!0}),o=await n.createWritable();try{await e.getData({writable:h(o)},l)}catch(t){throw d?new Error(Yu):t}w.push(e.getRelativeName(t))}}catch(r){d=!0,s.abort(new Error(Yu));try{r.entryName===U&&(r.entryName=e.getRelativeName(t),r.entryId=e.id)}catch{}throw r}}}(this,t,e)}async importZip(t,e={}){let r;t&&typeof t.getEntries==N?(r=t,e=Object.assign({},r.options,e)):(await Wo(t),r=new yi(t,e)),El(e.passThrough),pl(e);const n=function(t){if(t===U)return Pu;if(Wu.has(t))return t;throw new Error(Cu)}(e.duplicates),o=[],a={rr:[]},i=await r.getEntries(e);for(const t of i){let r=this;try{const i=t.filename.split("/").filter(t=>""!=t&&"."!=t),s=i.pop();let c=!1;for(const t of i){const e=r;if(r=r.getChildByName(t),r){if(!r.directory){if(n==Bu){c=!0;break}if(n!=Lu)throw new Error(ku);this.fs.remove(r),r=new Qu(this.fs,t,{data:null},e),o.push(r)}}else r=new Qu(this.fs,t,{data:null},e),o.push(r)}if(c)continue;if(t.directory){let e=r;if(s){if(e=r.getChildByName(s),e&&(!e.directory||e.data)){if(n==Bu)continue;if(n!=Lu)throw new Error(ku);e.directory?e.data=t:(this.fs.remove(e),e=U)}e||(e=new Qu(this.fs,s,{data:null},r),o.push(e))}e==this||e.data||(e.data=t)}else{const i=r.getChildByName(s);if(i){if(n==Bu)continue;if(n!=Lu)throw new Error(ku);this.fs.remove(i)}o.push(Ol(r,s,{data:t,Reader:il(Object.assign({},e),a),uncompressedSize:e.passThrough?t.compressedSize:t.uncompressedSize,passThrough:e.passThrough}))}}catch(e){o.reverse().forEach(t=>this.fs.remove(t));try{e.cause={entry:t}}catch{}throw e}}return o}async exportZip(t,e={}){const r=this,n=Boolean(t)&&typeof t.add==N;e=Object.assign({},e),n||e.bufferedWrite!==U||(e.bufferedWrite=!0);const[o]=await Promise.all([cl(r,dl(e.readerOptions)),n?U:Wo(t)]),a=n?t:new Js(t,e);return await async function(t,e,r,n,o){const{onstart:a,onprogress:i,onend:s,onentryprogress:c}=n,u=e,l=rl(e.children,t=>Al(t)?0:1);let f=0,w=0;if(a&&await ln(a,r),n.bufferedWrite)await async function t(e){const r=(await Promise.allSettled(e.children.map(async e=>{await d(e),await t(e)}))).find(t=>"rejected"==t.status);if(r)throw r.reason}(e);else for(const t of e.getChildren({recursive:!0}))await d(t);async function d(e){if(Al(e))return;const{name:a,Lt:s}=fl(e,u,n);let d=0;const p=await t.add(a,o.get(e),Object.assign(s,{onstart:U,onend:U,onprogress:async t=>{f+=t-d,d=t,i&&await ln(i,f,r)}}));w++,c&&await ln(c,w,l,p)}s&&await ln(s,f)}(a,r,rl([r],nl),e,o),n?a:(await a.close(e.globalComment),t.getData?t.getData():t.writable)}async getExportedSize(r={}){const n=this;dl((r=Object.assign({},r)).readerOptions),r.bufferedWrite===U&&(r.bufferedWrite=!0);const o=n.getChildren({recursive:!0}),a=o.filter(t=>!Al(t)).map(t=>{const{name:e,Lt:o}=fl(t,n,r);return{name:e,size:t.directory?0:wl(t,gl(t,r)),options:o}}),i=!r.bufferedWrite||a.every(t=>!1!==t.options.keepOrder)&&o.every(t=>Al(t)||!t.children.length);return await async function(r,n,o,a){const i={options:r};if(mt(r[nt]))throw new Error(Is);if(a!==U&&!(a instanceof Uint8Array))throw new Error(ss);const s=Hc(a);if(s>e)throw new Error(is);const c=r[tt],u=new Map,l=r[Q]===U?0:r[Q];let f=l,d=T;const p=[],h=new Set;for(const e of n){let{name:r}=e;const{size:n}=e,o=Object.assign({},e.options);Cc(i,o,ya)&&!r.endsWith(D)&&(r+=D);const a=sc(i,r,o);({name:r}=a);const{Zt:s}=cc(i,r,o);0==s.level||s.compressionMethod!==U||s.Ht||await on(_t())||(s.level=0);const l=!Cc(i,o,ya);if(l&&n===U)throw new Error(Is);const{Le:w,Zt:m}=lc(i,l,n,s,o);if(l&&!s.Ht&&jc(m.compressionMethod,m.level))throw new Error(Is);const y=Object.assign({},o,a.Zt,s,m,{[tt]:c}),E=wc(y),b=hc(y),S={$t:E,re:Hc(E.Yt,b.Kt)};c&&dc(S,f);const g=l?w:0;u.set(r,Object.assign({},y,E,{offset:f,diskNumberStart:0,compressedSize:g}));const A=S.re+g;p.push(A),h.add(Boolean(y.pe||y.uncompressedSize>=t||g>=t)),d=Math.min(d,A),f+=A}if(u.size>1&&(c||f-d>=t&&(h.size>1||fc(p,l,!0)!=fc(p,l,!1)))&&!o)throw new Error(Is);const{xe:m,De:y}=mc(u);let E=Cc(i,r,wa);if(f>=t||m>=t||u.size>=e){if(!1===E)throw new Error(xs);E=!0}else E===U&&y&&(E=!0);return f-l+m+s+(E?98:w)}(r,a,i,r.globalComment)}getChildByName(t){const e=this.children;for(let r=0;r<e.length;r++){const n=e[r];if(n.name==t)return n}}getChildren(t={}){return function(t,e){const r=[],n=[t];let o=0;for(;o<n.length;)for(const t of n[o++].children)r.push(t),e&&n.push(t);return r}(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 r=this.children;return!(await Promise.all(r.map(r=>r.checkPassword(t,e)))).includes(!1)}}class tl{constructor(){xl(this)}get children(){return this.root.children}remove(t){ul(t);const e=[t];for(;e.length;){const t=e.pop();this.entries[t.id]=null;for(const r of t.children)e.push(r)}t.parent=U}move(t,e){if(t==this.root)throw new Error(vu);if(!e.directory)throw new Error(Nu);if(e.isDescendantOf(t))throw new Error(Mu);if(t!=e){const r=e.getChildByName(t.name);if(r){if(r!=t)throw new Error(Tu)}else ul(t),t.parent=e,e.children.push(t),Fl(this,t)}}find(t){const e=t.split("/");let r=this.root;for(let t=0;r&&t<e.length;t++)r=r.directory?r.getChildByName(e[t]):U;return r||(r=this.entries.find(e=>e&&(e==this.root||e.isDescendantOf(this.root))&&e.getRelativeName()==t)),r}getById(t){return this.entries[t]}getChildByName(t){return this.root.getChildByName(t)}getChildren(t){return this.root.getChildren(t)}addDirectory(t,e){return this.root.addDirectory(t,e)}addText(t,e,r){return this.root.addText(t,e,r)}addBlob(t,e,r){return this.root.addBlob(t,e,r)}addData64URI(t,e,r){return this.root.addData64URI(t,e,r)}addUint8Array(t,e,r){return this.root.addUint8Array(t,e,r)}addHttpContent(t,e,r){return this.root.addHttpContent(t,e,r)}addReadable(t,e,r){return this.root.addReadable(t,e,r)}addFileSystemEntry(t,e){return this.root.addFileSystemEntry(t,e)}addFileSystemHandle(t,e){return this.root.addFileSystemHandle(t,e)}addFile(t,e){return this.root.addFile(t,e)}importBlob(t,e){return Dl(this,r=>r.importBlob(t,e))}importData64URI(t,e){return Dl(this,r=>r.importData64URI(t,e))}importUint8Array(t,e){return Dl(this,r=>r.importUint8Array(t,e))}importHttpContent(t,e){return Dl(this,r=>r.importHttpContent(t,e))}importReadable(t,e){return Dl(this,r=>r.importReadable(t,e))}importZip(t,e){return Dl(this,r=>r.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 el={FS:tl,ZipDirectoryEntry:Qu,ZipFileEntry:Ju};function rl(t,e){let r=0;const n=Array.from(t);for(;n.length;){const t=n.pop();r+=e(t)||0;for(const e of t.children)n.push(e)}return r}function nl(t){return t.uncompressedSize}function ol(t,e){const{data:r}=t;return e&&r instanceof Fa?r.compressedSize:t.uncompressedSize}function al(t){let e;return function(){if(e)throw new Error(ju);return e=!0,{readable:t}}}function il(t,e){return class extends no{constructor(t,e={}){super(),this.entry=t,this.options=e}async init(){const r=this,n=Object.assign({},t,r.options),{checkOverlappingEntry:o,checkOverlappingEntryOnly:a}=n,i=await async function(t,e,r){pl(e);const{passwords:n,requestPassword:o,signal:a}=e;if(delete(e=Object.assign({},e)).passwords,delete e.requestPassword,!t.encrypted||e.passThrough||!n&&!o)return t.getData(new lo,e);const i=new Set;let s;for(;;){for(const t of ml(e,r,n))if(!i.has(t.key)){const e=await u(t);if(e.done)return e.data;s=e.error}if(!o)break;if(r.nr){await r.nr;continue}let a;r.nr=new Promise(t=>a=t);try{const e=await o(t,s);if(e===U||null===e)break;if(typeof e!=j)throw new Error(qu);const r=await u(yl(e));if(r.done)return r.data;s=r.error}finally{r.nr=U,a()}}if(!i.size)throw new Error(Ma);const c=new Error(xe);throw c.cause=s,c;async function u(n){i.add(n.key);const o=Object.assign({},e,n.options);if(t.zipCrypto){o.checkCrc32=!0;try{await t.getData(null,Object.assign({},o,{checkPasswordOnly:!0}))}catch(t){if(hl(t))return{done:!1,error:t};throw t}}try{const e=await t.getData(new lo,o);return function(t,e){const{rr:r}=t,n=r.findIndex(t=>t.key===e.key);-1!=n&&r.splice(n,1),r.unshift(e)}(r,n),{done:!0,data:e}}catch(e){if(function(t,e){return Boolean(e&&e.aborted)||Kt(t)&&"AbortError"==t.name}(e,a)||!function(t,e){return hl(t)||e.zipCrypto&&Kt(t)&&Xu.has(t.message)}(e,t))throw e;return{done:!1,error:e}}}}(r.entry,Object.assign(n,{checkPasswordOnly:!1,checkOverlappingEntry:a||o,checkOverlappingEntryOnly:!1,preventClose:!1}),e);r.data=i,r.ar=new uo(i),r.size=i.size,super.init()}readUint8Array(t,e){return this.ar.readUint8Array(t,e)}}}function sl(t,e,r){return t.prototype?new t(e,r):t(e,r)}async function cl(t,e){const r=[],n=[t],o=new Map;for(;n.length;){const t=n.pop();for(const e of t.children)e.directory?n.push(e):r.push(e)}return await Promise.all(r.map(async r=>{const n=r.reader=sl(r.Reader,r.data,e);o.set(r,n);try{await Wo(n)}catch(e){try{e.entry=r,e.entryId=r.id,e.entryName=r.getRelativeName(t)}catch{}throw e}n.size!==U&&(r.uncompressedSize=n.size,r.Qe=!1)})),o}function ul(t){if(t.parent){const e=t.parent.children;e.forEach((r,n)=>{r.id==t.id&&e.splice(n,1)})}}function ll(t){return Boolean(t)&&t.message==Yu}function fl(t,e,r){const n=r.relativePath?t.getRelativeName(e):t.getFullname(),o=t.options||{};let a={},i={};if(t.data instanceof Fa){const e=gl(t,r),n=o.lastModDate===U?r.lastModDate:o.lastModDate;({Lt:a,Wt:i}=ic(t.data,e,n)),e&&(i.passThrough=!0)}const s=Object.assign({lastModDate:t.er},a,r,o,i,{directory:t.directory});if(!t.directory&&s.passThrough&&s.uncompressedSize===U)throw new Error(Zu);return{name:n,Lt:s}}function wl(t,e){const{reader:r}=t;return r&&r.size!==U?r.size:t.Qe?U:ol(t,e)}function dl(t){if(t&&(typeof t!=_||Array.isArray(t)))throw new Error(Vu);return t&&(El(t.passThrough),pl(t)),t}function pl(t){const{passwords:e,requestPassword:r}=t;if(e&&(!Array.isArray(e)||e.some(t=>typeof t!=j)))throw new Error(Gu);if(r&&typeof r!=N)throw new Error(qu)}function hl(t){return Kt(t)&&t.message==xe}function ml(t,e,r){const n=[],{password:o,rawPassword:a}=t;return a&&a.length&&n.push({key:a,options:{password:"",rawPassword:a}}),o&&n.push(yl(o)),n.push(...e.rr),r&&n.push(...r.filter(t=>t).map(yl)),n}function yl(t){return{key:t,options:{password:t,rawPassword:Ku}}}function El(t){if(St(t)===lt)throw new Error(Hu)}function bl(t,e){const{uncompressedSize:r}=e;Object.assign(t,e,{reader:null,passThrough:U,uncompressedSize:r===U?0:r,Qe:r===U})}function Sl(t){let e=t.length;for(;"="==t.charAt(e-1);)e--;const r=t.indexOf(",")+1;return Math.floor(.75*(e-r))}function gl(t,e){const{readerOptions:r}=e;return Boolean(!t.directory&&(t.passThrough||r&&r.passThrough))}function Al(t){return t.directory&&null===t.data}function Rl(t,e,r){return async function t(e,n,o,a=""){if(n){const i=a?a+"/"+n.name:n.name;try{if((n.isFile||n.isDirectory)&&(n=await zl(n)),"file"==n.kind){const t=await n.getFile();o.push(Ol(e,t.name,{Reader:function(){return{readable:t.stream(),size:t.size}},options:Object.assign({},{lastModDate:new Date(t.lastModified)},r),uncompressedSize:t.size}))}else if("directory"==n.kind){const a=e.addDirectory(n.name,r);o.push(a);for await(const e of n.values())await t(a,e,o,i)}}catch(t){try{t.entryName===U&&(t.entryName=i)}catch{}throw t}}return o}(t,e,[])}async function zl(t){const e={name:t.name};if(t.isFile&&(e.kind="file",e.getFile=()=>new Promise((e,r)=>t.file(e,r))),t.isDirectory){e.kind="directory";const r=await async function(t){const e=[];function r(t,n,o){t.readEntries(async a=>{if(a.length){for(const t of a)e.push(await zl(t));r(t,n,o)}else n(e)},o)}return await new Promise((e,n)=>r(t.createReader(),e,n)),{[Symbol.iterator](){let t=0;return{next(){const r={value:e[t],done:t==e.length};return t++,r}}}}}(t);e.values=()=>r}return e}function xl(t){t.entries=[],t.Je=0,t.root=new Qu(t)}function Dl(t,e){const{entries:r,Je:n,root:o}=t;return xl(t),e(t.root).catch(e=>{throw Object.assign(t,{entries:r,Je:n,root:o}),e})}function Fl(t,e){const r=[e];for(;r.length;){const e=r.pop();t.entries[e.id]=e;for(const t of e.children)r.push(t)}}function Ol(t,e,r,n){if(t.directory){const o=Il(e);return o&&(e=o.pop(),t=Ul(t,o)),n?new Qu(t.fs,e,r,t):new Ju(t.fs,e,r,t)}throw new Error(_u)}function Il(t){if(t.includes("/")){const e=t.split("/").filter(t=>""!=t&&"."!=t);if(e.length)return e}}function Ul(t,e,r){return e.forEach(e=>{const n=t;if(t=t.getChildByName(e)){if(!t.directory)throw new Error(Tu);if(r&&(t==r||t.isDescendantOf(r)))throw new Error(Mu)}else t=new Qu(n.fs,e,{data:null},n)}),t}export{uo as BlobReader,lo as BlobWriter,ao as Data64URIReader,io as Data64URIWriter,ht as ERR_ABORTED,ja as ERR_AMBIGUOUS_ARCHIVE,Mu as ERR_ANCESTOR_ENTRY,Ua as ERR_BAD_FORMAT,Ca as ERR_CENTRAL_DIRECTORY_NOT_FOUND,Rr as ERR_CODEC_OUT_OF_MEMORY,as as ERR_DUPLICATED_NAME,ku as ERR_DUPLICATE_IMPORTED_ENTRY,Ma as ERR_ENCRYPTED,Pa as ERR_ENCRYPTED_CENTRAL_DIRECTORY,_a as ERR_ENTRY_DATA_OUT_OF_BOUNDS,Tu as ERR_ENTRY_EXISTS,ka as ERR_EOCDR_LOCATOR_ZIP64_NOT_FOUND,Ta as ERR_EOCDR_NOT_FOUND,M as ERR_EXTRAFIELD_ZIP64_NOT_FOUND,Vn as ERR_HTTP_RANGE,Hn as ERR_HTTP_RESOURCE_CHANGED,Zn as ERR_HTTP_STATUS,De as ERR_INVALID_AUTHENTICATION_CODE,Dt as ERR_INVALID_BASE_URI,cr as ERR_INVALID_CODEC_DEFINITION,lr as ERR_INVALID_CODEC_MODULE,is as ERR_INVALID_COMMENT,ss as ERR_INVALID_COMMENT_TYPE,Ar as ERR_INVALID_COMPRESSED_DATA,zr as ERR_INVALID_CRC32,ls as ERR_INVALID_DATE,Cu as ERR_INVALID_DUPLICATES,ds as ERR_INVALID_ENCRYPTION_STRENGTH,Ws as ERR_INVALID_ENTRY,cs as ERR_INVALID_ENTRY_COMMENT,us as ERR_INVALID_ENTRY_COMMENT_TYPE,fs as ERR_INVALID_ENTRY_NAME,ys as ERR_INVALID_EXTRAFIELD,Ss as ERR_INVALID_EXTRAFIELD_DATA,bs as ERR_INVALID_EXTRAFIELD_DATA_TYPE,Es as ERR_INVALID_EXTRAFIELD_TYPE,Wa as ERR_INVALID_FILENAME_VALIDATION,ft as ERR_INVALID_FUNCTION_OPTION,Ms as ERR_INVALID_GID,Bs as ERR_INVALID_LEVEL,Za as ERR_INVALID_MAX_APPENDED_DATA_SIZE,xt as ERR_INVALID_MAX_WORKERS,js as ERR_INVALID_MSDOS_ATTRIBUTES,Ps as ERR_INVALID_MSDOS_DATA,xe as ERR_INVALID_PASSWORD,Gu as ERR_INVALID_PASSWORDS,dt as ERR_INVALID_PASSWORD_TYPE,Zu as ERR_INVALID_PASS_THROUGH,pt as ERR_INVALID_PASS_THROUGH_VALUE,Ts as ERR_INVALID_READER,Vu as ERR_INVALID_READER_OPTIONS,qu as ERR_INVALID_REQUEST_PASSWORD,wt as ERR_INVALID_SIGNAL,Ls as ERR_INVALID_SIGNATURE_DATA,La as ERR_INVALID_STRICTNESS,Cs as ERR_INVALID_UID,gr as ERR_INVALID_UNCOMPRESSED_SIZE,Ns as ERR_INVALID_UNIX_EXTRA_FIELD_TYPE,_s as ERR_INVALID_UNIX_ID_SIZE,vs as ERR_INVALID_UNIX_MODE,Ft as ERR_INVALID_URI,ws as ERR_INVALID_VERSION,Gn as ERR_ITERATOR_COMPLETED_TOO_SOON,k as ERR_LOCAL_FILE_HEADER_NOT_FOUND,C as ERR_OVERLAPPING_ENTRY,_u as ERR_PARENT_NOT_DIRECTORY,ju as ERR_READABLE_CONSUMED,ur as ERR_RESERVED_COMPRESSION_METHOD,vu as ERR_ROOT_DIRECTORY_NOT_MOVABLE,Na as ERR_SPLIT_ZIP_FILE,Nu as ERR_TARGET_NOT_DIRECTORY,Fs as ERR_UNDEFINED_COMPRESSION_METHOD,Os as ERR_UNDEFINED_CRC32,Us as ERR_UNDEFINED_READER,Ds as ERR_UNDEFINED_UNCOMPRESSED_SIZE,Is as ERR_UNDETERMINED_SIZE,Ba as ERR_UNSAFE_FILENAME,fr as ERR_UNSUPPORTED_COMPRESSION,iu as ERR_UNSUPPORTED_CONTEXT,Oe as ERR_UNSUPPORTED_CRYPTO_API,va as ERR_UNSUPPORTED_ENCRYPTION,ms as ERR_UNSUPPORTED_ENCRYPTION_PASS_THROUGH,ps as ERR_UNSUPPORTED_ENCRYPTION_USDZ,xs as ERR_UNSUPPORTED_FORMAT,Hu as ERR_UNSUPPORTED_PASS_THROUGH_VALUE,hs as ERR_UNSUPPORTED_SPLIT_USDZ,Va as ERR_UNSUPPORTED_UINT64,Qr as ERR_WORKER_STARTUP_TIMEOUT,qn as ERR_WRITER_NOT_INITIALIZED,Yn as ERR_WRITER_SIZE_NOT_WRITABLE,Zs as ERR_ZIP_CRYPTO_LAST_MOD_DATE,ks as ERR_ZIP_NOT_EMPTY,Mo as HttpRangeReader,Co as HttpReader,no as Reader,_o as SplitDataReader,jo as SplitDataWriter,fo as TextReader,po as TextWriter,vo as Uint8ArrayReader,No as Uint8ArrayWriter,Jc as VERSION,$a as WARNING_APPENDED_DATA,Hs as WARNING_CLAMPED_LAST_MODIFICATION_DATE,qa as WARNING_COMPRESSED_PATCHED_DATA,Vs as WARNING_COMPRESSION_UNAVAILABLE,ni as WARNING_DUPLICATE_FILENAME,Ya as WARNING_MALFORMED_EXTRA_FIELD,ei as WARNING_MISMATCHED_CENTRAL_DIRECTORY_OFFSET,si as WARNING_MISMATCHED_LOCAL_FILE_HEADER_BIT_FLAG,ci as WARNING_MISMATCHED_LOCAL_FILE_HEADER_COMPRESSION_METHOD,ui as WARNING_MISMATCHED_LOCAL_FILE_HEADER_CRC32_OR_SIZES,ii as WARNING_MISMATCHED_LOCAL_FILE_HEADER_FILENAME,oi as WARNING_MISMATCHED_ZIP64_END_OF_CENTRAL_DIRECTORY,ri as WARNING_MISSING_ZIP64_EXTRA_FIELD,ai as WARNING_MULTIPLE_END_OF_CENTRAL_DIRECTORY,Qa as WARNING_PREPENDED_CENTRAL_DIRECTORY,Ja as WARNING_PREPENDED_DATA,ti as WARNING_TRAILING_CENTRAL_DIRECTORY_DATA,Ga as WARNING_UNKNOWN_VERSION,Ka as WARNING_UNKNOWN_ZIP64_EXTENSIBLE_DATA,Ha as WARNING_UNSORTED_CENTRAL_DIRECTORY,Xa as WARNING_WRAPPED_ENTRIES_COUNT,oo as Writer,Qu as ZipDirectoryEntry,$u as ZipEntry,tl as ZipFS,Ju as ZipFileEntry,yi as ZipReader,Ei as ZipReaderStream,Js as ZipWriter,Qs as ZipWriterStream,Bt as configure,nu as createBlobTempStream,eu as createOPFSTempStream,su as createSyncAccessHandleTempStream,el as fs,Kc as getMimeType,Er as getRegisteredCodecs,Xc as getSupportedCompressionMethods,bi as isZipFile,hr as registerCodec,Ht as resetConfiguration,Uu as terminateWorkers,mr as unregisterCodec};
|