@zip.js/zip.js 2.8.52 → 2.8.53

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