documonster 0.13.0 → 0.13.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/README_zh.md +1 -1
- package/dist/esm/modules/archive/compression/compress.base.js +37 -6
- package/dist/iife/documonster.archive.iife.min.js +2 -2
- package/dist/iife/documonster.csv.iife.min.js +1 -1
- package/dist/iife/documonster.draw.iife.min.js +1 -1
- package/dist/iife/documonster.excel.iife.min.js +2 -2
- package/dist/iife/documonster.formula.iife.min.js +1 -1
- package/dist/iife/documonster.markdown.iife.min.js +1 -1
- package/dist/iife/documonster.mermaid.iife.min.js +1 -1
- package/dist/iife/documonster.pdf.iife.min.js +1 -1
- package/dist/iife/documonster.stream.iife.min.js +1 -1
- package/dist/iife/documonster.word.iife.min.js +2 -2
- package/dist/iife/documonster.xml.iife.min.js +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -211,7 +211,7 @@ const buffer = await Workbook.toBuffer(wb);
|
|
|
211
211
|
|
|
212
212
|
```html
|
|
213
213
|
<!-- Script tag (no bundler) — one IIFE per module, each under the shared `Documonster` global -->
|
|
214
|
-
<script src="https://unpkg.com/documonster@0.13.
|
|
214
|
+
<script src="https://unpkg.com/documonster@0.13.1/dist/iife/documonster.excel.iife.min.js"></script>
|
|
215
215
|
<script>
|
|
216
216
|
const { Workbook, Cell } = Documonster.Excel;
|
|
217
217
|
const wb = Workbook.create();
|
package/README_zh.md
CHANGED
|
@@ -198,7 +198,7 @@ const buffer = await Workbook.toBuffer(wb);
|
|
|
198
198
|
|
|
199
199
|
```html
|
|
200
200
|
<!-- Script 标签(无需打包工具)— 每个模块一个 IIFE,共享同一个 `Documonster` 全局 -->
|
|
201
|
-
<script src="https://unpkg.com/documonster@0.13.
|
|
201
|
+
<script src="https://unpkg.com/documonster@0.13.1/dist/iife/documonster.excel.iife.min.js"></script>
|
|
202
202
|
<script>
|
|
203
203
|
const { Workbook, Cell } = Documonster.Excel;
|
|
204
204
|
const wb = Workbook.create();
|
|
@@ -120,13 +120,44 @@ export async function streamToUint8Array(reader) {
|
|
|
120
120
|
export async function transformWithStream(data, stream) {
|
|
121
121
|
const writer = stream.writable.getWriter();
|
|
122
122
|
const reader = stream.readable.getReader();
|
|
123
|
+
// Start reading immediately to avoid potential backpressure deadlocks
|
|
124
|
+
// (writer.write/close may wait for the readable side to be consumed).
|
|
125
|
+
//
|
|
126
|
+
// The read side is folded into a *result value* rather than kept as a bare
|
|
127
|
+
// promise. When the transform errors — a genuinely corrupt deflate payload,
|
|
128
|
+
// or Chromium spuriously rejecting a valid one under concurrent stream
|
|
129
|
+
// creation — the write side and the read side both reject with that error.
|
|
130
|
+
// Awaiting the write first therefore threw and abandoned the read promise
|
|
131
|
+
// with nobody observing it, which surfaced as an unhandled rejection even
|
|
132
|
+
// though the caller had caught the failure and recovered via the pure-JS
|
|
133
|
+
// fallback. A promise with both handlers already attached can never become
|
|
134
|
+
// one, so abandoning it is safe on every path below.
|
|
135
|
+
const read = streamToUint8Array(reader).then(value => ({ ok: true, value }), (error) => ({ ok: false, error }));
|
|
123
136
|
try {
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
137
|
+
let writeError;
|
|
138
|
+
try {
|
|
139
|
+
await writer.write(data);
|
|
140
|
+
await writer.close();
|
|
141
|
+
}
|
|
142
|
+
catch (error) {
|
|
143
|
+
writeError = { error };
|
|
144
|
+
// Terminate the read loop so `read` settles even in the case where the
|
|
145
|
+
// write failed without erroring the readable side. Cancelling an already
|
|
146
|
+
// errored stream rejects with its stored error, which is not news here.
|
|
147
|
+
await reader.cancel().catch(() => {
|
|
148
|
+
// ignore
|
|
149
|
+
});
|
|
150
|
+
}
|
|
151
|
+
const result = await read;
|
|
152
|
+
// Prefer the read side's error: for a corrupt payload it is the one that
|
|
153
|
+
// names the defect, and when both sides fail they carry the same error.
|
|
154
|
+
if (!result.ok) {
|
|
155
|
+
throw result.error;
|
|
156
|
+
}
|
|
157
|
+
if (writeError) {
|
|
158
|
+
throw writeError.error;
|
|
159
|
+
}
|
|
160
|
+
return result.value;
|
|
130
161
|
}
|
|
131
162
|
finally {
|
|
132
163
|
try {
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* documonster v0.13.
|
|
2
|
+
* documonster v0.13.1
|
|
3
3
|
* Zero-dependency TypeScript toolkit for Excel, Word, PDF, CSV, Markdown, XML & ZIP — one API across Node.js, Bun & browsers.
|
|
4
4
|
* (c) 2025 cjnoname
|
|
5
5
|
* Released under the Apache-2.0 License
|
|
6
6
|
*/
|
|
7
|
-
(function(){this.Documonster=this.Documonster||{},(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:`Module`});var t=Object.defineProperty,n=(e,n)=>{let r={};for(var i in e)t(r,i,{get:e[i],enumerable:!0});return n||t(r,Symbol.toStringTag,{value:`Module`}),r};let r=new Uint8Array;function i(e,t,n=0){let r=e.length,i=t.length;if(i===0)return 0;if(i>r)return-1;let a=n|0;if(a<0&&(a=0),a>r-i)return-1;if(i===1)return e.indexOf(t[0],a);if(i===2){let n=t[0],i=t[1],o=r-2,s=e.indexOf(n,a);for(;s!==-1&&s<=o;){if(e[s+1]===i)return s;s=e.indexOf(n,s+1)}return-1}if(i===3){let n=t[0],i=t[1],o=t[2],s=r-3,c=e.indexOf(n,a);for(;c!==-1&&c<=s;){if(e[c+1]===i&&e[c+2]===o)return c;c=e.indexOf(n,c+1)}return-1}if(i===4){let n=t[0],i=t[1],o=t[2],s=t[3],c=r-4,l=e.indexOf(n,a);for(;l!==-1&&l<=c;){if(e[l+1]===i&&e[l+2]===o&&e[l+3]===s)return l;l=e.indexOf(n,l+1)}return-1}for(let n=a;n<=r-i;n++){let r=!0;for(let a=0;a<i;a++)if(e[n+a]!==t[a]){r=!1;break}if(r)return n}return-1}var a=class extends Error{constructor(e,t){super(e,t),this.name=`BaseError`,Object.setPrototypeOf(this,new.target.prototype),Error.captureStackTrace&&Error.captureStackTrace(this,this.constructor)}toJSON(){return{name:this.name,message:this.message,stack:this.stack,cause:this.cause instanceof Error?p(this.cause):this.cause}}},o=class extends a{constructor(e){super(`The operation was aborted`,e===void 0?void 0:{cause:e}),this.name=`AbortError`,this.code=`ABORT_ERR`}};function s(e){return e instanceof o?e:new o(e)}function c(e){return!!e&&typeof e==`object`&&e.name===`AbortError`}function l(e,t){if(e&&e.aborted)throw s(t??e.reason)}function u(e){let t=new AbortController;if(!e)return{controller:t,cleanup:()=>{}};if(e.aborted)return t.abort(e.reason),{controller:t,cleanup:()=>{}};let n=()=>{try{t.abort(e.reason)}catch{t.abort()}};return e.addEventListener(`abort`,n,{once:!0}),{controller:t,cleanup:()=>{try{e.removeEventListener(`abort`,n)}catch{}}}}function d(e){return e instanceof Error?e:Error(String(e))}function f(e){e.catch(()=>{})}function p(e){return e instanceof a?e.toJSON():{name:e.name,message:e.message,stack:e.stack,cause:e.cause instanceof Error?p(e.cause):e.cause}}var m=class extends a{constructor(e,t){super(e,t),this.name=`ArchiveError`}},h=class extends m{constructor(...e){super(...e),this.name=`ZipParseError`}},g=class extends h{constructor(e,t,n,r){let i=n?`Invalid ${n}: expected ${e}, got 0x${t.toString(16).padStart(8,`0`)}`:`Invalid signature: expected ${e}, got 0x${t.toString(16).padStart(8,`0`)}`;super(i,r),this.name=`InvalidZipSignatureError`}},_=class extends h{constructor(e){super(`Invalid ZIP file: End of Central Directory not found`,e),this.name=`EocdNotFoundError`}},v=class extends m{constructor(e,t,n,r){super(`CRC32 mismatch for "${e}": expected 0x${t.toString(16).padStart(8,`0`)}, got 0x${n.toString(16).padStart(8,`0`)}`,r),this.path=e,this.expected=t,this.actual=n,this.name=`Crc32MismatchError`}},y=class extends m{constructor(e,t,n,r,i){let a=r===`too-many-bytes`?`Entry "${e}" produced more bytes than declared: expected ${t}, got at least ${n}`:`Entry "${e}" produced fewer bytes than declared: expected ${t}, got ${n}`;super(a,i),this.path=e,this.expected=t,this.actual=n,this.reason=r,this.name=`EntrySizeMismatchError`}isZipBomb(){return this.reason===`too-many-bytes`}isCorruption(){return this.reason===`too-few-bytes`}},b=class extends m{constructor(e,t,n){super(t?`Failed to decrypt "${e}": ${t}`:`Failed to decrypt "${e}": incorrect password or corrupted data`,n),this.name=`DecryptionError`}},x=class extends m{constructor(e,t){super(`File "${e}" is encrypted. Please provide a password to extract.`,t),this.name=`PasswordRequiredError`}},S=class extends m{constructor(e,t){super(`Server does not support Range requests for: ${e}`,t),this.name=`RangeNotSupportedError`}},C=class extends m{constructor(e,t,n,r){super(`HTTP ${t} ${n} for: ${e}`,r),this.url=e,this.status=t,this.statusText=n,this.name=`HttpRangeError`}},w=class extends m{constructor(e,t,n){super(`File "${e}" is too large to extract into memory (${t})`,n),this.name=`FileTooLargeError`}},ee=class extends m{constructor(e,t){super(`Unsupported compression method: ${e}`,t),this.name=`UnsupportedCompressionError`}};function te(e){return!!e&&typeof e==`object`&&typeof e.getReader==`function`}function ne(e){return!!e&&typeof e==`object`&&typeof e.getWriter==`function`}function re(e){return!!e&&(typeof e==`object`||typeof e==`function`)&&typeof e[Symbol.asyncIterator]==`function`}function ie(e){if(!e||typeof e!=`object`)return!1;let t=e;return!!t.readable&&!!t.writable&&te(t.readable)&&ne(t.writable)}let T=new TextEncoder,E=new TextDecoder(`utf-8`,{ignoreBOM:!0}),ae=new Map;function oe(e){let t=(e??`utf-8`).trim().toLowerCase();return t===``||t===`utf8`||t===`utf-8`?`utf-8`:t===`utf16le`||t===`utf-16le`||t===`ucs2`||t===`ucs-2`?`utf-16le`:t===`binary`?`latin1`:t}function se(e){let t=oe(e);if(t===`utf-8`)return E;let n=ae.get(t);return n||(n=ce(t),ae.set(t,n)),n}function ce(e,t){try{return new TextDecoder(e,t)}catch(t){throw TypeError(`Unsupported text encoding: ${e}`,{cause:t})}}function le(e){let t=oe(e);switch(t){case`hex`:return{decode:de};case`base64`:return new me(!1);case`base64url`:return new me(!0);case`ascii`:return{decode:he};default:return ce(t,{ignoreBOM:!0})}}let ue=(()=>{let e=Array(256);for(let t=0;t<256;t++)e[t]=t.toString(16).padStart(2,`0`);return e})();function de(e){let t=``;for(let n=0;n<e.length;n++)t+=ue[e[n]];return t}let fe=`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/`,pe=`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_`;var me=class{constructor(e){this._remainder=null,this._chars=e?pe:fe}decode(e,t){let n;if(this._remainder){let t=new Uint8Array(this._remainder.length+e.length);t.set(this._remainder),t.set(e,this._remainder.length),n=t}else n=e;if(t?.stream??!1){let e=n.length%3,t=n.length-e;return this._remainder=e>0?n.slice(t):null,t>0?this._encodeBytes(n,t):``}return this._remainder=null,n.length>0?this._encodeBytes(n,n.length):``}_encodeBytes(e,t){let n=this._chars,r=n===pe,i=``,a=0;for(;a+2<t;a+=3){let t=e[a],r=e[a+1],o=e[a+2];i+=n[t>>>2]+n[(t&3)<<4|r>>>4]+n[(r&15)<<2|o>>>6]+n[o&63]}let o=t-a;if(o===1){let t=e[a];i+=n[t>>>2]+n[(t&3)<<4],r||(i+=`==`)}else if(o===2){let t=e[a],o=e[a+1];i+=n[t>>>2]+n[(t&3)<<4|o>>>4]+n[(o&15)<<2],r||(i+=`=`)}return i}};function he(e){let t=``;for(let n=0;n<e.length;n++)t+=String.fromCharCode(e[n]&127);return t}function ge(e){let t=``;for(let n=0;n<e.length;n++)t+=ue[e[n]];return t}function _e(e,t){let n=t?pe:fe,r=``,i=0;for(;i+2<e.length;i+=3){let t=e[i],a=e[i+1],o=e[i+2];r+=n[t>>>2]+n[(t&3)<<4|a>>>4]+n[(a&15)<<2|o>>>6]+n[o&63]}let a=e.length-i;if(a===1){let a=e[i];r+=n[a>>>2]+n[(a&3)<<4],t||(r+=`==`)}else if(a===2){let a=e[i],o=e[i+1];r+=n[a>>>2]+n[(a&3)<<4|o>>>4]+n[(o&15)<<2],t||(r+=`=`)}return r}function ve(e){let t=``;for(let n=0;n<e.length;n++)t+=String.fromCharCode(e[n]&127);return t}function ye(e,t){let n=oe(t);switch(n){case`hex`:return ge(e);case`base64`:return _e(e,!1);case`base64url`:return _e(e,!0);case`ascii`:return ve(e);default:return se(n).decode(e)}}function D(e){return T.encode(e)}function be(e,t){return se(t).decode(e)}function O(e,t){let n=e.length;if(n===0)return new Uint8Array;if(n===1){let t=e[0];return t.constructor===Uint8Array?t:new Uint8Array(t.buffer,t.byteOffset,t.byteLength)}if(t===void 0){let r=0;for(let t=0;t<n;t++)r+=e[t].length;t=r}let r=new Uint8Array(t),i=0;for(let t=0;t<n;t++){let n=e[t];r.set(n,i),i+=n.length}return r}function xe(e,t,n){if(!Number.isInteger(t)||t<0||t+n>e.length)throw RangeError(`cannot read ${n} byte(s) at offset ${t}: length is ${e.length}`)}function Se(e,t){return xe(e,t,2),(e[t]|e[t+1]<<8)>>>0}function k(e,t){return xe(e,t,4),(e[t]|e[t+1]<<8|e[t+2]<<16|e[t+3]<<24)>>>0}function Ce(e){let t=new Uint8Array(4);return t[0]=e&255,t[1]=e>>>8&255,t[2]=e>>>16&255,t[3]=e>>>24&255,t}var we=class{constructor(e,t=0,n=`binary stream`){this.data=e,this.view=new DataView(e.buffer,e.byteOffset,e.byteLength),this.label=n,this.offset=0,this.position=t}get position(){return this.offset}set position(e){if(!Number.isInteger(e)||e<0||e>this.data.length)throw RangeError(`${this.label}: cannot seek to ${e} — length is ${this.data.length}`);this.offset=e}get remaining(){return this.data.length-this.offset}get bytes(){return this.data}require(e){if(!Number.isInteger(e)||e<0||e>this.remaining)throw RangeError(`${this.label}: truncated at byte ${this.offset} — need ${e} byte(s), ${this.remaining} remain`)}readUint8(){this.require(1);let e=this.view.getUint8(this.offset);return this.offset+=1,e}readInt8(){this.require(1);let e=this.view.getInt8(this.offset);return this.offset+=1,e}readUint16(){this.require(2);let e=this.view.getUint16(this.offset,!0);return this.offset+=2,e}readInt16(){this.require(2);let e=this.view.getInt16(this.offset,!0);return this.offset+=2,e}readUint32(){this.require(4);let e=this.view.getUint32(this.offset,!0);return this.offset+=4,e}readInt32(){this.require(4);let e=this.view.getInt32(this.offset,!0);return this.offset+=4,e}readFloat64(){this.require(8);let e=this.view.getFloat64(this.offset,!0);return this.offset+=8,e}readBigUint64(){this.require(8);let e=this.view.getBigUint64(this.offset,!0);return this.offset+=8,e}readBytes(e){this.require(e);let t=this.data.subarray(this.offset,this.offset+e);return this.offset+=e,t}skip(e){this.require(e),this.offset+=e}slice(e,t){return this.data.subarray(e,t)}peekUint32(e){if(!Number.isInteger(e)||e<0||e+4>this.data.length)throw RangeError(`${this.label}: cannot peek 4 byte(s) at ${e} — length is ${this.data.length}`);return this.view.getUint32(e,!0)}};function Te(e,t={}){let n=j(e,t)[Symbol.asyncIterator]();return new ReadableStream({async pull(e){let{value:t,done:r}=await n.next();if(r){e.close();return}e.enqueue(t)},async cancel(){try{await n.return?.()}catch{}}})}function A(e){return e instanceof Uint8Array||e instanceof ArrayBuffer||typeof e==`string`||typeof Blob<`u`&&e instanceof Blob}function Ee(e){if(!e)return null;if(e instanceof Uint8Array)return e.length?e:null;if(typeof e==`string`){let t=D(e);return t.length?t:null}if(e instanceof ArrayBuffer)return e.byteLength?new Uint8Array(e):null;if(ArrayBuffer.isView(e))return e.byteLength?new Uint8Array(e.buffer,e.byteOffset,e.byteLength):null;throw TypeError(`Unsupported archive source chunk type: ${Object.prototype.toString.call(e)}`)}function De(e){return e instanceof Uint8Array?e:typeof e==`string`?D(e):new Uint8Array(e)}function Oe(e){return e instanceof Uint8Array||e instanceof ArrayBuffer||typeof e==`string`}async function ke(e){if(e instanceof Uint8Array)return e;if(typeof e==`string`)return D(e);if(e instanceof ArrayBuffer)return new Uint8Array(e);let t=await e.arrayBuffer();return new Uint8Array(t)}async function Ae(e,t={}){if(A(e))return ke(e);let n=[],i=0;for await(let r of j(e,t))n.push(r),i+=r.length;return n.length===0?r:n.length===1?n[0]:O(n,i)}async function je(e,t={}){return Ae(e,t)}async function*j(e,t={}){let{signal:n,onChunk:r}=t,i=()=>{if(n?.aborted)throw s(n?.reason)};if(i(),e instanceof Uint8Array){r&&r(e),yield e;return}if(typeof e==`string`){let t=D(e);r&&r(t),yield t;return}if(e instanceof ArrayBuffer){let t=new Uint8Array(e);r&&r(t),yield t;return}if(typeof Blob<`u`&&e instanceof Blob){if(typeof e.stream==`function`){yield*j(e.stream(),t);return}let n=await ke(e);i(),r&&r(n),yield n;return}if(te(e)){let t=e.getReader(),a=!1,o=()=>{a=!0;try{t.cancel()}catch{}};n&&(n.aborted?o():n.addEventListener(`abort`,o,{once:!0}));try{for(;;){if(a)throw s(n?.reason);i();let{done:e,value:o}=await t.read();if(e)return;let c=Ee(o);if(c){if(a)throw s(n?.reason);i(),r&&r(c),yield c}}}finally{if(n)try{n.removeEventListener(`abort`,o)}catch{}try{t.releaseLock()}catch{}}}if(re(e)){for await(let t of e){i();let e=Ee(t);e&&(r&&r(e),yield e)}return}throw new m(`Unsupported archive source`)}function Me(e){if(!e)return null;let t=e.lastIndexOf(`/`);if(t===-1)return null;let n=e.slice(t+1).trim();if(!n||n===`*`)return null;let r=parseInt(n,10);return Number.isFinite(r)&&r>=0?r:null}var Ne=class e{constructor(e,t,n={}){this._requestCount=0,this._bytesDownloaded=0,this.url=e,this._size=t,this.headers=n.headers??{},this.fetchFn=n.fetch??globalThis.fetch,this.signal=n.signal,this.credentials=n.credentials??`same-origin`}get size(){return this._size}static async open(t,n={}){let r=n.fetch??globalThis.fetch,i=n.headers??{},a=n.credentials??`same-origin`,o=n.validateRangeSupport??!0,s=0,c=0,l=async e=>{let n=await r(t,e);return s++,n};if(n.size!==void 0){if(o){let e=await l({method:`GET`,headers:{...i,Range:`bytes=0-0`},signal:n.signal,credentials:a});if(e.status!==206&&e.status!==200)throw new S(t)}let r=new e(t,n.size,n);return r._requestCount=s,r._bytesDownloaded=c,r}let u=await l({method:`HEAD`,headers:i,signal:n.signal,credentials:a});if(!u.ok)throw new C(t,u.status,u.statusText);let d=u.headers.get(`Accept-Ranges`);if(o&&d!==`bytes`){let e=await l({method:`GET`,headers:{...i,Range:`bytes=0-0`},signal:n.signal,credentials:a});if(e.status!==206&&e.status!==200)throw new S(t)}let f=u.headers.get(`Content-Length`),p=f?parseInt(f,10):NaN;if(!Number.isFinite(p)||p<0){let r=await l({method:`GET`,headers:{...i,Range:`bytes=0-0`},signal:n.signal,credentials:a}),o=Me(r.headers.get(`Content-Range`));if(o!==null)p=o;else if(r.status===200)try{let i=new Uint8Array(await r.arrayBuffer());c+=i.length,p=i.length;let a=new e(t,p,n);return a._fullData=i,a._requestCount=s,a._bytesDownloaded=c,a}catch{let r=await l({method:`GET`,headers:i,signal:n.signal,credentials:a});if(!r.ok)throw new C(t,r.status,r.statusText);let o=new Uint8Array(await r.arrayBuffer());c+=o.length,p=o.length;let u=new e(t,p,n);return u._fullData=o,u._requestCount=s,u._bytesDownloaded=c,u}else throw new m(f?`Invalid Content-Length "${f}" for: ${t}`:`Server did not provide Content-Length for: ${t}`)}let h=new e(t,p,n);return h._requestCount=s,h._bytesDownloaded=c,h}async read(e,t){if(e<0||t>this._size||e>=t)throw RangeError(`Invalid range [${e}, ${t}) for file of size ${this._size}`);if(this._fullData)return this._fullData.subarray(e,t);let n=`bytes=${e}-${t-1}`,r=await this.fetchFn(this.url,{method:`GET`,headers:{...this.headers,Range:n},signal:this.signal,credentials:this.credentials});if(r.status===200){let n=new Uint8Array(await r.arrayBuffer());return this._fullData=n,this._size=n.length,this._requestCount++,this._bytesDownloaded+=n.length,n.subarray(e,t)}if(r.status!==206)throw new C(this.url,r.status,r.statusText);let i=new Uint8Array(await r.arrayBuffer());this._requestCount++,this._bytesDownloaded+=i.length;let a=t-e;return i.length===a?i:i.subarray(0,a)}getStats(){return{requestCount:this._requestCount,bytesDownloaded:this._bytesDownloaded,totalSize:this._size,downloadedPercent:this._size>0?Math.round(this._bytesDownloaded/this._size*1e4)/100:0}}async close(){}};function Pe(e){let t=e instanceof ArrayBuffer?new Uint8Array(e):e;return{get size(){return t.length},async read(e,n){if(e<0||n>t.length||e>=n)throw RangeError(`Invalid range [${e}, ${n}) for buffer of size ${t.length}`);return t.subarray(e,n)},async close(){}}}let Fe=null;function Ie(){if(Fe)return Fe;let e=new Uint32Array(256);for(let t=0;t<256;t++){let n=t;for(let e=0;e<8;e++)n=n&1?3988292384^n>>>1:n>>>1;e[t]=n}return Fe=e,e}function M(e,t){let n=Ie();for(let r=0;r<t.length;r++)e=n[(e^t[r])&255]^e>>>8;return e}function Le(e){return(e^4294967295)>>>0}function N(e){return Le(M(4294967295,e))}function Re(e,t){return(Ie()[(e^t)&255]^e>>>8)>>>0}let ze=`ÇüéâäàåçêëèïîìÄÅÉæÆôöòûùÿÖÜ¢£¥₧ƒáíóúñѪº¿⌐¬½¼¡«»░▒▓│┤╡╢╖╕╣║╗╝╜╛┐└┴┬├─┼╞╟╚╔╩╦╠═╬╧╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀αßΓπΣσµτΦΘΩδ∞φε∩≡±≥≤⌠⌡÷≈°∙·√ⁿ²■\xA0`;function Be(e){let t=!1;for(let n=0;n<e.length;n++)if(e[n]>=128){t=!0;break}if(!t)return Je(e);let n=Array(e.length);for(let t=0;t<e.length;t++){let r=e[t];r<128?n[t]=String.fromCharCode(r):n[t]=ze[r-128]}return n.join(``)}function Ve(e){if(e.length===0)return r;let t=new Uint8Array(e.length),n=0;for(let r=0;r<e.length;r++){let i=e.charCodeAt(r),a=i;if(i>=55296&&i<=56319&&r+1<e.length){let t=e.charCodeAt(r+1);t>=56320&&t<=57343&&(a=(i-55296<<10)+(t-56320)+65536,r++)}if(a<128){t[n++]=a;continue}if(a>65535){t[n++]=63;continue}let o=He.get(String.fromCharCode(a));t[n++]=o??63}return n===t.length?t:t.subarray(0,n)}let He=(()=>{let e=new Map;for(let t=0;t<128;t++)e.set(ze[t],128+t);return e})(),Ue={name:`utf-8`,encode:D,decode:be,useUtf8Flag:!0,useUnicodeExtraFields:!1},We={name:`cp437`,encode:Ve,decode:Be,useUtf8Flag:!1,useUnicodeExtraFields:!0},Ge=new WeakMap;function P(e){if(!e||e===`utf-8`)return Ue;if(e===`cp437`)return We;let t=e,n=Ge.get(t);if(n)return n;let r=t.useUtf8Flag??t.name===`utf-8`,i={...t,useUtf8Flag:r,useUnicodeExtraFields:t.useUnicodeExtraFields??!r};return Ge.set(t,i),i}function Ke(e,t){return qe(e,P(t))}function qe(e,t){return e?t.encode(e):r}function Je(e){let t=``,n=32768;for(let r=0;r<e.length;r+=n){let i=e.subarray(r,Math.min(r+n,e.length));t+=String.fromCharCode(...i)}return t}function Ye(e,t,n,r){return e.length===0?``:(t??0)&2048?be(e):n&&n.version===1&&n.originalCrc32===N(e)?n.unicodeValue:r?r.decode(e):Be(e)}function Xe(e,t,n,r){return Ye(e,t,n?.unicodePath,r)}function Ze(e,t,n,r){return Ye(e,t,n?.unicodeComment,r)}function F(e){return e.byteOffset===0&&e.byteLength===e.buffer.byteLength&&e.buffer.constructor===ArrayBuffer?e.buffer:e.slice().buffer}function Qe(e){let t={key0:305419896,key1:591751049,key2:878082192},n=typeof e==`string`?D(e):e;for(let e=0;e<n.length;e++)$e(t,n[e]);return t}function $e(e,t){e.key0=Re(e.key0,t),e.key1=e.key1+(e.key0&255)>>>0,e.key1=(Math.imul(e.key1,134775813)>>>0)+1>>>0,e.key2=Re(e.key2,e.key1>>>24&255)}function et(e){let t=(e.key2|2)>>>0;return Math.imul(t,t^1)>>>8&255}function tt(e,t){let n=(t^et(e))&255;return $e(e,n),n}function nt(e,t){let n=(t^et(e))&255;return $e(e,t),n}function rt(e,t,n,r){if(t.length!==12)return!1;let i=new Uint8Array(12);for(let n=0;n<12;n++)i[n]=tt(e,t[n]);let a=i[11];return a===(n>>>24&255)||r!==void 0&&a===(r>>>8&255)}function it(e,t,n){let r=new Uint8Array(12),i=n(11);for(let t=0;t<11;t++)r[t]=nt(e,i[t]);return r[11]=nt(e,t>>>24&255),r}function at(e,t,n,r){if(e.length<12)return null;let i=Qe(t);if(!rt(i,e.subarray(0,12),n,r))return null;let a=e.length-12,o=new Uint8Array(a);for(let t=0;t<a;t++)o[t]=tt(i,e[12+t]);return o}function ot(e,t,n,r){let i=Qe(t),a=new Uint8Array(12+e.length),o=r(11);for(let e=0;e<11;e++)a[e]=nt(i,o[e]);a[11]=nt(i,n>>>24&255);for(let t=0;t<e.length;t++)a[12+t]=nt(i,e[t]);return a}function st(e,t,n,r){return e.length<12?!1:rt(Qe(t),e.subarray(0,12),n,r)}new Uint8Array([99,124,119,123,242,107,111,197,48,1,103,43,254,215,171,118,202,130,201,125,250,89,71,240,173,212,162,175,156,164,114,192,183,253,147,38,54,63,247,204,52,165,229,241,113,216,49,21,4,199,35,195,24,150,5,154,7,18,128,226,235,39,178,117,9,131,44,26,27,110,90,160,82,59,214,179,41,227,47,132,83,209,0,237,32,252,177,91,106,203,190,57,74,76,88,207,208,239,170,251,67,77,51,133,69,249,2,127,80,60,159,168,81,163,64,143,146,157,56,245,188,182,218,33,16,255,243,210,205,12,19,236,95,151,68,23,196,167,126,61,100,93,25,115,96,129,79,220,34,42,144,136,70,238,184,20,222,94,11,219,224,50,58,10,73,6,36,92,194,211,172,98,145,149,228,121,231,200,55,109,141,213,78,169,108,86,244,234,101,122,174,8,186,120,37,46,28,166,180,198,232,221,116,31,75,189,139,138,112,62,181,102,72,3,246,14,97,53,87,185,134,193,29,158,225,248,152,17,105,217,142,148,155,30,135,233,206,85,40,223,140,161,137,13,191,230,66,104,65,153,45,15,176,84,187,22]),new Uint32Array([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]),new Uint32Array([1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298]),new Uint32Array([3614090360,3905402710,606105819,3250441966,4118548399,1200080426,2821735955,4249261313,1770035416,2336552879,4294925233,2304563134,1804603682,4254626195,2792965006,1236535329,4129170786,3225465664,643717713,3921069994,3593408605,38016083,3634488961,3889429448,568446438,3275163606,4107603335,1163531501,2850285829,4243563512,1735328473,2368359562,4294588738,2272392833,1839030562,4259657740,2763975236,1272893353,4139469664,3200236656,681279174,3936430074,3572445317,76029189,3654602809,3873151461,530742520,3299628645,4096336452,1126891415,2878612391,4237533241,1700485571,2399980690,4293915773,2240044497,1873313359,4264355552,2734768916,1309151649,4149444226,3174756917,718787259,3951481745]);function ct(e){let t=new Uint8Array(e);return globalThis.crypto.getRandomValues(t),t}let lt=17729,ut=39169,dt={128:8,192:12,256:16},ft={128:16,192:24,256:32},pt={128:1,192:2,256:3},mt={1:128,2:192,3:256};function ht(){if(globalThis.crypto?.subtle!==void 0)return globalThis.crypto.subtle;throw new m(`Web Crypto API not available`)}async function gt(e,t,n){let r=ht(),i=typeof e==`string`?D(e):e,a=ft[n],o=a+a+2,s=await r.importKey(`raw`,F(i),`PBKDF2`,!1,[`deriveBits`]),c=await r.deriveBits({name:`PBKDF2`,salt:F(t),iterations:1e3,hash:`SHA-1`},s,o*8),l=new Uint8Array(c);return{encryptionKey:l.subarray(0,a),hmacKey:l.subarray(a,a+a),passwordVerify:l.subarray(a+a,a+a+2)}}async function _t(e,t){let n=ht(),r=await n.importKey(`raw`,F(e),{name:`HMAC`,hash:`SHA-1`},!1,[`sign`]),i=await n.sign(`HMAC`,r,F(t));return new Uint8Array(i,0,10)}function vt(e){let t=new Uint8Array(16);return new DataView(t.buffer).setUint32(0,e,!0),t}async function yt(e,t,n=!0){let r=ht(),i=await r.importKey(`raw`,F(e),{name:`AES-CTR`},!1,[`encrypt`]),a=new Uint8Array(t.length),o=new Uint8Array(16),s=Math.ceil(t.length/16);for(let e=0;e<s;e++){let n=vt(e+1),s=await r.encrypt({name:`AES-CTR`,counter:F(n),length:128},i,F(o)),c=new Uint8Array(s),l=e*16,u=Math.min(l+16,t.length);for(let e=l;e<u;e++)a[e]=t[e]^c[e-l]}return a}function bt(e,t,n){let r=new Uint8Array(11),i=new DataView(r.buffer);return i.setUint16(0,ut,!0),i.setUint16(2,7,!0),i.setUint16(4,e,!0),i.setUint16(6,lt,!0),r[8]=pt[t],i.setUint16(9,n,!0),r}function xt(e,t){let n=dt[t],r=n+2+10;return e.length<r?null:{salt:e.subarray(0,n),storedVerify:e.subarray(n,n+2),ciphertext:e.subarray(n+2,e.length-10),storedHmac:e.subarray(e.length-10)}}function St(e,t){return e[0]===t[0]&&e[1]===t[1]}function Ct(e,t){if(e.length!==t.length)return!1;let n=0;for(let r=0;r<e.length;r++)n|=e[r]^t[r];return n===0}async function wt(e,t,n){let r=xt(e,n);if(!r)throw new m(`Encrypted data too short`);let{salt:i,storedVerify:a,ciphertext:o,storedHmac:s}=r,c=await gt(t,i,n);if(!St(c.passwordVerify,a))throw new m(`Password verification failed`);if(!Ct(await _t(c.hmacKey,o),s))throw new m(`HMAC verification failed`);return yt(c.encryptionKey,o,!1)}async function Tt(e,t,n){let r=dt[n],i=ct(r),a=await gt(t,i,n),o=await yt(a.encryptionKey,e,!0),s=await _t(a.hmacKey,o),c=new Uint8Array(r+2+o.length+10),l=0;return c.set(i,l),l+=r,c.set(a.passwordVerify,l),l+=2,c.set(o,l),l+=o.length,c.set(s,l),c}function Et(e,t){return dt[t]+2+e+10}async function Dt(e,t,n){let r=dt[n],i=r+2;if(e.length<i)return!1;let a=e.subarray(0,r),o=e.subarray(r,r+2);return St((await gt(t,a,n)).passwordVerify,o)}let Ot={none:`None`,zipcrypto:`ZipCrypto (Traditional PKWARE)`,"aes-128":`AES-128`,"aes-192":`AES-192`,"aes-256":`AES-256`},kt={"aes-128":128,"aes-192":192,"aes-256":256},At={128:`aes-128`,192:`aes-192`,256:`aes-256`};function jt(e){return Ot[e]}function Mt(e){return e in kt}function Nt(e){return kt[e]}function Pt(e){return At[e]}function Ft(e,t,n){typeof e.off==`function`?e.off(t,n):typeof e.removeListener==`function`&&e.removeListener(t,n)}function It(e,t,n={}){let r=!1,i=!1,a=null,o,s,c=new Promise((e,t)=>{o=e,s=t}),l=()=>{Ft(e,`error`,d);for(let n of t)Ft(e,n,f)},u=()=>{for(let n of t)Ft(e,n,f)},d=e=>{i||(a=e instanceof Error?e:Error(String(e)),l(),r||(r=!0,s(a)))},f=()=>{i||r||(r=!0,n.keepErrorUntilCancel?u():l(),o())},p=()=>{i||(i=!0,l(),r||(r=!0,o()))};if(typeof e.once==`function`){e.once(`error`,d);for(let n of t)e.once(n,f)}else{e.on?.(`error`,d);for(let n of t)e.on?.(n,f)}return c.catch(()=>{}),{promise:c,cancel:p,error:()=>a}}async function Lt(e,t){if(ne(t)){let n=t.getWriter();try{for await(let t of e)await n.write(t);await n.close()}finally{try{n.releaseLock()}catch{}}return}for await(let n of e){let e=typeof t.once==`function`||typeof t.on==`function`?It(t,[`drain`],{keepErrorUntilCancel:!0}):null,r;try{r=await t.write(n)}catch(t){throw e?.cancel(),t}if(e?.error())throw e.error();r===!1&&e?(await e.promise,e.cancel()):e?.cancel()}if(typeof t.end==`function`){if(typeof t.once==`function`||typeof t.on==`function`){let e=It(t,[`finish`,`close`]);try{await t.end(),await e.promise}catch(t){throw e.cancel(),t}}else await t.end()}}async function Rt(e){let t=[],n=0;for await(let r of e)t.push(r),n+=r.length;return O(t,n)}var zt=class{_activeChunkCount(){return this._chunks.length-this._chunkHead}_headChunk(){return this._chunks[this._chunkHead]}_compactConsumedChunks(){if(this._chunkHead!==0){if(this._chunkHead>=this._chunks.length){this._chunks=[],this._chunkHead=0;return}this._chunkHead>32&&this._chunkHead*2>=this._chunks.length&&(this._chunks=this._chunks.slice(this._chunkHead),this._chunkHead=0)}}_dropHeadChunk(){this._chunkHead++,this._headOffset=0,this._compactConsumedChunks()}constructor(e){this._chunks=[],this._chunkHead=0,this._headOffset=0,this._length=0,this._cachedView=null,this._cachedLength=0,e&&e.length>0&&this.reset(e)}get length(){return this._length}isEmpty(){return this.length===0}view(){if(this._length===0)return r;if(this._activeChunkCount()===1)return this._headChunk().subarray(this._headOffset,this._headOffset+this._length);if(this._cachedView&&this._cachedLength===this._length)return this._cachedView;let e=new Uint8Array(this._length),t=0;for(let n=this._chunkHead;n<this._chunks.length;n++){let r=this._chunks[n],i=n===this._chunkHead?this._headOffset:0,a=n===this._chunks.length-1?i+(this._length-t):r.length;if(e.set(r.subarray(i,a),t),t+=a-i,t>=e.length)break}return this._cachedView=e,this._cachedLength=this._length,e}reset(e){if(this._cachedView=null,this._cachedLength=0,this._chunks=[],this._chunkHead=0,this._headOffset=0,this._length=0,!e||e.length===0)return;let t=new Uint8Array(e.length);t.set(e),this._chunks=[t],this._chunkHead=0,this._headOffset=0,this._length=t.length}append(e){e.length!==0&&(this._cachedView=null,this._cachedLength=0,this._chunks.push(e),this._length+=e.length)}read(e){if(e<=0)return r;if(e>this._length)throw RangeError(`ByteQueue: read beyond available data`);if(this._cachedView=null,this._cachedLength=0,this._activeChunkCount()===1){let t=this._headChunk(),n=this._headOffset,r=n+e,i=t.subarray(n,r);return this._headOffset=r,this._length-=e,this._length===0?(this._chunks=[],this._chunkHead=0,this._headOffset=0):this._headOffset>=t.length&&this._dropHeadChunk(),i}let t=new Uint8Array(e),n=0,i=e;for(;i>0;){let e=this._headChunk(),r=this._headOffset,a=e.length-r,o=Math.min(a,i);t.set(e.subarray(r,r+o),n),n+=o,i-=o,this._headOffset+=o,this._length-=o,this._headOffset>=e.length&&this._dropHeadChunk()}return this._length===0&&(this._chunks=[],this._chunkHead=0,this._headOffset=0),t}peekChunks(e){if(e<=0)return[];if(e>this._length)throw RangeError(`ByteQueue: peek beyond available data`);if(this._activeChunkCount()===1){let t=this._headChunk(),n=this._headOffset;return[t.subarray(n,n+e)]}let t=[],n=e;for(let e=this._chunkHead;e<this._chunks.length&&n>0;e++){let r=this._chunks[e],i=e===this._chunkHead?this._headOffset:0,a=r.length-i;if(a<=0)continue;let o=Math.min(a,n);t.push(r.subarray(i,i+o)),n-=o}return t}discard(e){if(e<=0)return;if(e>=this._length){this._chunks=[],this._chunkHead=0,this._headOffset=0,this._length=0,this._cachedView=null,this._cachedLength=0;return}this._cachedView=null,this._cachedLength=0;let t=e;for(;t>0;){let e=this._headChunk(),n=this._headOffset,r=e.length-n,i=Math.min(r,t);this._headOffset+=i,this._length-=i,t-=i,this._headOffset>=e.length&&this._dropHeadChunk()}this._length===0&&(this._chunks=[],this._chunkHead=0,this._headOffset=0)}indexOfPattern(e,t=0){let n=e.length;if(n===0)return 0;let r=this._length;if(n>r)return-1;let a=t|0;if(a<0&&(a=0),a>r-n)return-1;if(this._activeChunkCount()===1){let t=this._headChunk(),o=this._headOffset,s=t.subarray(o,o+r);return n===1?s.indexOf(e[0],a):i(s,e,a)}if(n>4)return i(this.view(),e,a);let o=e[0],s=n>=2?e[1]:0,c=n>=3?e[2]:0,l=n>=4?e[3]:0,u=this._chunks,d=this._chunkHead,f=(e,t)=>{let n=e,r=t;for(;n<u.length;){let e=u[n];if(r<e.length)return e[r]|0;r-=e.length,n++}return null},p=0;for(let e=d;e<u.length;e++){let t=u[e],i=e===d?this._headOffset:0,m=t.length-i;if(m<=0)continue;let h=p,g=h+m,_=a<=h?i:a>=g?t.length:i+(a-h);if(_>t.length-1){p+=m;continue}let v=t.length-1,y=t.indexOf(o,_);for(;y!==-1&&y<=v;){let a=h+(y-i);if(a>r-n)return-1;if(n===1)return a;if(y+n<=t.length){if(t[y+1]!==s){y=t.indexOf(o,y+1);continue}if(n===2)return a;if(t[y+2]!==c){y=t.indexOf(o,y+1);continue}if(n===3)return a;if(t[y+3]!==l){y=t.indexOf(o,y+1);continue}return a}let u=f(e,y+1);if(u===null||u!==s){y=t.indexOf(o,y+1);continue}if(n===2)return a;let d=f(e,y+2);if(d===null||d!==c){y=t.indexOf(o,y+1);continue}if(n===3)return a;let p=f(e,y+3);if(p===null||p!==l){y=t.indexOf(o,y+1);continue}return a}p+=m}return-1}peekUint32LE(e){let t=e|0;if(t<0||t+4>this._length)return null;let n=this._chunks,r=t;for(let e=this._chunkHead;e<n.length;e++){let t=n[e],i=e===this._chunkHead?this._headOffset:0,a=t.length-i;if(r<a){let a=i+r;if(a+4<=t.length){let e=t[a]|0,n=t[a+1]|0,r=t[a+2]|0,i=t[a+3]|0;return(e|n<<8|r<<16|i<<24)>>>0}let o=t[a]|0,s=0,c=0,l=0,u=e,d=a+1;for(let e=1;e<4;e++)for(;u<n.length;){let t=n[u];if(d<t.length){let n=t[d]|0;e===1?s=n:e===2?c=n:l=n,d++;break}u++,d=0}return(o|s<<8|c<<16|l<<24)>>>0}r-=a}return null}peekByte(e){let t=e|0;if(t<0||t>=this._length)throw RangeError(`ByteQueue: peek beyond available data`);let n=t;for(let e=this._chunkHead;e<this._chunks.length;e++){let t=this._chunks[e],r=e===this._chunkHead?this._headOffset:0,i=t.length-r;if(n<i)return t[r+n]|0;n-=i}throw RangeError(`ByteQueue: peek beyond available data`)}};function Bt(){return typeof CompressionStream<`u`}function Vt(){try{return typeof CompressionStream>`u`?!1:(new CompressionStream(`deflate-raw`),!0)}catch{return!1}}function Ht(){try{return typeof DecompressionStream>`u`?!1:(new DecompressionStream(`deflate-raw`),!0)}catch{return!1}}let Ut=null,Wt=null;function Gt(){return typeof CompressionStream>`u`?!1:(Ut===null&&(Ut=Vt()),Ut)}function Kt(){return typeof DecompressionStream>`u`?!1:(Wt===null&&(Wt=Ht()),Wt)}function qt(){return Gt()&&Kt()}async function Jt(e){let t=new zt;for(;;){let{done:n,value:r}=await e.read();if(n)break;t.append(r)}return t.read(t.length)}async function Yt(e,t){let n=t.writable.getWriter(),r=t.readable.getReader();try{let t=Jt(r);return await n.write(e),await n.close(),await t}finally{try{n.releaseLock()}catch{}try{r.releaseLock()}catch{}}}async function Xt(e){return Yt(e,new CompressionStream(`deflate-raw`))}async function Zt(e){return Yt(e,new DecompressionStream(`deflate-raw`))}let Qt=65521;function $t(e){let t=1,n=0;for(let r=0;r<e.length;){let i=Math.min(r+5552,e.length);for(;r<i;)t+=e[r++],n+=t;t%=Qt,n%=Qt}return n<<16|t}function en(e){return e.length>=2&&e[0]===31&&e[1]===139}let tn={};function nn(e,t){let n=`${e}:${t}`;return()=>{let r=e===`compression`?typeof CompressionStream<`u`?CompressionStream:void 0:typeof DecompressionStream<`u`?DecompressionStream:void 0;if(!r)return!1;let i=tn[n];if(i!=null)return i;try{new r(t),tn[n]=!0}catch{tn[n]=!1}return tn[n]}}let rn=nn(`compression`,`gzip`),an=nn(`decompression`,`gzip`),on=nn(`compression`,`deflate`),sn=nn(`decompression`,`deflate`);function cn(e){if(e.length<2)return!1;let t=e[0],n=e[1];return(t&15)!=8||t>>4>7?!1:(t<<8|n)%31==0}function ln(e){return en(e)?`gzip`:cn(e)?`zlib`:`deflate-raw`}let un={0:new Uint8Array([120,1]),1:new Uint8Array([120,1]),2:new Uint8Array([120,94]),3:new Uint8Array([120,94]),4:new Uint8Array([120,94]),5:new Uint8Array([120,94]),6:new Uint8Array([120,156]),7:new Uint8Array([120,218]),8:new Uint8Array([120,218]),9:new Uint8Array([120,218])};function dn(e){return un[Math.max(0,Math.min(9,e))]??un[6]}function fn(e){let t=new Uint8Array(4);return t[0]=e>>>24&255,t[1]=e>>>16&255,t[2]=e>>>8&255,t[3]=e&255,t}function pn(e){if(e.length<6)throw new m(`Invalid zlib data (too small)`);let t=e[0],n=e[1];if((t&15)!=8)throw new m(`Invalid zlib compression method`);if(t>>4>7)throw new m(`Invalid zlib CINFO value`);if((t<<8|n)%31!=0)throw new m(`Invalid zlib header checksum`);if(n&32)throw new m(`Zlib preset dictionary not supported`);return 2}function mn(e){let t=e.length-4;return(e[t]<<24|e[t+1]<<16|e[t+2]<<8|e[t+3])>>>0}function hn(e,t){if($t(e)>>>0!=t>>>0)throw new m(`Invalid zlib data (Adler-32 mismatch)`)}let gn=(()=>{let e=new Uint8Array(288);for(let t=0;t<=143;t++)e[t]=8;for(let t=144;t<=255;t++)e[t]=9;for(let t=256;t<=279;t++)e[t]=7;for(let t=280;t<=287;t++)e[t]=8;return e})(),_n=new Uint8Array(32).fill(5),vn=[3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258],yn=[0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0],bn=[1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577],xn=[0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13],Sn=[[1,0,0],[2,1,0],[3,2,0],[4,3,0],[6,4,1],[8,5,1],[12,6,2],[16,7,2],[24,8,3],[32,9,3],[48,10,4],[64,11,4],[96,12,5],[128,13,5],[192,14,6],[256,15,6],[384,16,7],[512,17,7],[768,18,8],[1024,19,8],[1536,20,9],[2048,21,9],[3072,22,10],[4096,23,10],[6144,24,11],[8192,25,11],[12288,26,12],[16384,27,12],[24576,28,13],[32768,29,13]],Cn=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15];function wn(e,t){let n=new Uint16Array(16);for(let r=0;r<t;r++)e[r]>0&&n[e[r]]++;let r=new Uint16Array(16),i=0;for(let e=1;e<=15;e++)i=i+n[e-1]<<1,r[e]=i;let a={};for(let n=0;n<t;n++){let t=e[n];if(t===0)continue;i=r[t]++;let o=a;for(let e=t-1;e>=0;e--)i>>e&1?(o.right||(o.right={}),o=o.right):(o.left||(o.left={}),o=o.left);o.symbol=n}return a}var Tn=class{constructor(e){this.data=e,this.pos=0,this.bitBuf=0,this.bitCount=0}readBits(e){for(;this.bitCount<e;){if(this.pos>=this.data.length)throw new m(`Unexpected end of DEFLATE data`);this.bitBuf|=this.data[this.pos++]<<this.bitCount,this.bitCount+=8}let t=this.bitBuf&(1<<e)-1;return this.bitBuf>>=e,this.bitCount-=e,t}decodeSymbol(e){let t=e;for(;t.symbol===void 0;)if(t=this.readBits(1)===0?t.left:t.right,!t)throw new m(`Invalid Huffman code`);return t.symbol}alignToByte(){this.bitBuf=0,this.bitCount=0}readByte(){if(this.pos>=this.data.length)throw new m(`Unexpected end of data`);return this.data[this.pos++]}readUint16(){return this.readByte()|this.readByte()<<8}};function En(e){let t=new Tn(e),n=new Uint8Array(Math.max(64,e.length*4)),r=0,i=e=>{let t=r+e;if(t<=n.length)return;let i=n.length;for(;i<t;)i*=2;let a=new Uint8Array(i);a.set(n.subarray(0,r)),n=a},a=!1;for(;!a;){a=t.readBits(1)===1;let e=t.readBits(2);if(e===0){t.alignToByte();let e=t.readUint16();if((e^t.readUint16())!==65535)throw new m(`Invalid stored block length`);i(e);for(let i=0;i<e;i++)n[r++]=t.readByte()}else if(e===1||e===2){let a,o;if(e===1)a=wn(gn,288),o=wn(_n,32);else{let e=t.readBits(5)+257,n=t.readBits(5)+1,r=t.readBits(4)+4,i=new Uint8Array(19);for(let e=0;e<r;e++)i[Cn[e]]=t.readBits(3);let s=wn(i,19),c=new Uint8Array(e+n),l=0;for(;l<e+n;){let e=t.decodeSymbol(s);if(e<16)c[l++]=e;else if(e===16){let e=t.readBits(2)+3,n=c[l-1];for(let t=0;t<e;t++)c[l++]=n}else if(e===17){let e=t.readBits(3)+3;for(let t=0;t<e;t++)c[l++]=0}else if(e===18){let e=t.readBits(7)+11;for(let t=0;t<e;t++)c[l++]=0}}a=wn(c.subarray(0,e),e),o=wn(c.subarray(e),n)}for(;;){let e=t.decodeSymbol(a);if(e<256)i(1),n[r++]=e;else if(e===256)break;else{let a=e-257,s=vn[a]+t.readBits(yn[a]),c=t.decodeSymbol(o),l=bn[c]+t.readBits(xn[c]);i(s);let u=r-l;for(let e=0;e<s;e++)n[r++]=n[u+e]}}}else throw new m(`Invalid DEFLATE block type: `+e)}return n.slice(0,r)}function Dn(e){let t=65535,n=Math.ceil(e.length/t)||1,r=n*5+e.length,i=new Uint8Array(r),a=0,o=0;for(let r=0;r<n;r++){let s=r===n-1,c=Math.min(t,e.length-o);i[a++]=+!!s,i[a++]=c&255,i[a++]=c>>8&255,i[a++]=~c&255,i[a++]=~c>>8&255,i.set(e.subarray(o,o+c),a),a+=c,o+=c}return i.subarray(0,a)}let On=32768,kn=32768;function An(e){return e<=1?{maxChainLen:4,goodLen:4,niceLen:8,lazy:!1}:e<=3?{maxChainLen:8,goodLen:8,niceLen:32,lazy:!0}:e<=5?{maxChainLen:32,goodLen:16,niceLen:128,lazy:!0}:e<=7?{maxChainLen:64,goodLen:32,niceLen:258,lazy:!0}:{maxChainLen:128,goodLen:64,niceLen:258,lazy:!0}}function jn(e,t,n){return(e<<16|t<<8|n)*506832829>>>17&32767}function Mn(e,t=6){if(e.length===0)return new Uint8Array([3,0]);if(e.length<100)return Dn(e);let n=An(t),r=Vn(e,0,e.length,n,null),i=new Nn;return Bn(i,r,!0),i.finish()}var Nn=class e{constructor(){this.chunks=[],this.buffer=new Uint8Array(e.CHUNK_SIZE),this.bufLen=0,this.bitBuf=0,this.bitCount=0}static{this.CHUNK_SIZE=65536}alignToByte(){this.bitCount>0&&this.writeBits(0,8-this.bitCount)}pushByte(t){this.buffer[this.bufLen++]=t,this.bufLen>=e.CHUNK_SIZE&&(this.chunks.push(this.buffer),this.buffer=new Uint8Array(e.CHUNK_SIZE),this.bufLen=0)}writeBits(e,t){for(this.bitBuf|=e<<this.bitCount,this.bitCount+=t;this.bitCount>=8;)this.pushByte(this.bitBuf&255),this.bitBuf>>=8,this.bitCount-=8}writeBitsReverse(e,t){let n=0;for(let r=0;r<t;r++)n=n<<1|e>>r&1;this.writeBits(n,t)}finish(){return this.bitCount>0&&(this.pushByte(this.bitBuf&255),this.bitBuf=0,this.bitCount=0),this.chunks.length===0?this.buffer.slice(0,this.bufLen):(this.chunks.push(this.buffer.subarray(0,this.bufLen)),O(this.chunks))}flushBytes(){if(this.chunks.length===0&&this.bufLen===0)return new Uint8Array;let t;return this.chunks.length===0?t=this.buffer.slice(0,this.bufLen):(this.chunks.push(this.buffer.subarray(0,this.bufLen)),t=O(this.chunks),this.chunks=[]),this.buffer=new Uint8Array(e.CHUNK_SIZE),this.bufLen=0,t}};let Pn=(()=>{let e=[];for(let t=0;t<=287;t++){let n,r;t<=143?(n=48+t,r=8):t<=255?(n=400+(t-144),r=9):t<=279?(n=t-256,r=7):(n=192+(t-280),r=8),e[t]=[n,r]}return e})();function Fn(e,t){let[n,r]=Pn[t];e.writeBitsReverse(n,r)}function In(e){for(let t=0;t<vn.length;t++)if(t===vn.length-1||e<vn[t+1])return{code:257+t,extra:e-vn[t],extraBits:yn[t]};return{code:285,extra:0,extraBits:0}}function Ln(e){for(let t=0;t<Sn.length;t++){let[n,r,i]=Sn[t];if(e<=n)return{code:r,extra:e-(t===0?1:Sn[t-1][0]+1),extraBits:i}}return{code:29,extra:0,extraBits:13}}function Rn(e,t){let n=e.length,r=new Uint8Array(n),i=[];for(let t=0;t<n;t++)e[t]>0&&i.push({sym:t,freq:e[t]});if(i.length===0)return r;if(i.length===1)return r[i[0].sym]=1,r;i.sort((e,t)=>e.freq-t.freq||e.sym-t.sym);let a=i.map(e=>({freq:e.freq,sym:e.sym,left:null,right:null})),o=0,s=0,c=[];function l(){let e=o<a.length,t=s<c.length;return e&&t?a[o].freq<=c[s].freq?a[o++]:c[s++]:e?a[o++]:c[s++]}let u=i.length;for(let e=0;e<u-1;e++){let e=l(),t=l(),n={freq:e.freq+t.freq,sym:-1,left:e,right:t};c.push(n)}let d=c[c.length-1];function f(e,t){if(e.sym>=0){r[e.sym]=t;return}e.left&&f(e.left,t+1),e.right&&f(e.right,t+1)}f(d,0);let p=new Uint16Array(t+1);for(let e=0;e<n;e++)r[e]>0&&(r[e]>t?(p[t]++,r[e]=t):p[r[e]]++);let m=0;for(let e=1;e<=t;e++)m+=p[e]<<t-e;let h=1<<t;if(m===h)return r;for(;m>h;){let e=t-1;for(;e>0&&p[e]===0;)e--;if(e===0)break;p[e]--,p[t]++,m-=(1<<t-e)-1}for(;m<h;)p[t]++,m++;let g=[];for(let t=0;t<n;t++)r[t]>0&&g.push({sym:t,origLen:r[t],freq:e[t]});g.sort((e,t)=>t.origLen-e.origLen||e.freq-t.freq),r.fill(0);let _=0;for(let e=t;e>=1;e--)for(let t=p[e];t>0;t--)_<g.length&&(r[g[_].sym]=e,_++);return r}function zn(e){let t=e.length,n=Array(t),r=new Uint16Array(16);for(let n=0;n<t;n++)e[n]>0&&r[e[n]]++;let i=new Uint16Array(16),a=0;for(let e=1;e<=15;e++)a=a+r[e-1]<<1,i[e]=a;for(let r=0;r<t;r++){let t=e[r];t>0?n[r]=[i[t]++,t]:n[r]=[0,0]}return n}function Bn(e,t,n){let r=new Uint32Array(286),i=new Uint32Array(30);r[256]=1;for(let e of t)if(e.dist===0)r[e.litOrLen]++;else{let t=In(e.litOrLen);r[t.code]++;let n=Ln(e.dist);i[n.code]++}let a=Rn(r,15),o=Rn(i,15),s=!1;for(let e=0;e<o.length;e++)if(o[e]>0){s=!0;break}s||(o=new Uint8Array(30),o[0]=1,o[1]=1);let c=zn(a),l=zn(o),u=286;for(;u>257&&a[u-1]===0;)u--;let d=30;for(;d>1&&o[d-1]===0;)d--;let f=new Uint8Array(u+d);f.set(a.subarray(0,u)),f.set(o.subarray(0,d),u);let p=[],m=new Uint32Array(19);for(let e=0;e<f.length;){let t=f[e];if(t===0){let t=1;for(;e+t<f.length&&f[e+t]===0;)t++;for(;t>0;)if(t>=11){let n=Math.min(t,138);p.push({sym:18,extra:n-11,extraBits:7}),m[18]++,t-=n,e+=n}else if(t>=3){let n=Math.min(t,10);p.push({sym:17,extra:n-3,extraBits:3}),m[17]++,t-=n,e+=n}else p.push({sym:0,extra:0,extraBits:0}),m[0]++,t--,e++}else{p.push({sym:t,extra:0,extraBits:0}),m[t]++,e++;let n=0;for(;e+n<f.length&&f[e+n]===t;)n++;for(;n>=3;){let t=Math.min(n,6);p.push({sym:16,extra:t-3,extraBits:2}),m[16]++,n-=t,e+=t}for(;n>0;)p.push({sym:t,extra:0,extraBits:0}),m[t]++,n--,e++}}let h=Rn(m,7),g=zn(h),_=19;for(;_>4&&h[Cn[_-1]]===0;)_--;e.writeBits(+!!n,1),e.writeBits(2,2),e.writeBits(u-257,5),e.writeBits(d-1,5),e.writeBits(_-4,4);for(let t=0;t<_;t++)e.writeBits(h[Cn[t]],3);for(let t of p){let[n,r]=g[t.sym];e.writeBitsReverse(n,r),t.extraBits>0&&e.writeBits(t.extra,t.extraBits)}for(let n of t)if(n.dist===0){let[t,r]=c[n.litOrLen];e.writeBitsReverse(t,r)}else{let t=In(n.litOrLen),[r,i]=c[t.code];e.writeBitsReverse(r,i),t.extraBits>0&&e.writeBits(t.extra,t.extraBits);let a=Ln(n.dist),[o,s]=l[a.code];e.writeBitsReverse(o,s),a.extraBits>0&&e.writeBits(a.extra,a.extraBits)}let[v,y]=c[256];e.writeBitsReverse(v,y)}function Vn(e,t,n,r,i){let a=[],o=r.maxChainLen,s=r.goodLen,c=r.niceLen,l=r.lazy,u,d,f,p,m,h,g,_,v;i?(u=i.head,d=i.prev,f=i.window,p=i.windowLen,m=i.totalIn,h=i.hasPrevMatch,g=i.prevMatchLen,_=i.prevMatchDist,v=i.prevLiteral):(u=new Int32Array(On),d=new Int32Array(kn),f=null,p=0,m=0,h=!1,g=0,_=0,v=0);let y=i?r=>{let i=r-m;return i>=t&&i<n?e[i]:f[r&32767]}:t=>e[t],b=i?t=>{if(t+2>=n)return;let r=jn(e[t],e[t+1],e[t+2]),i=m+t;d[i&32767]=u[r],u[r]=i+1}:t=>{if(t+2>=n)return;let r=jn(e[t],e[t+1],e[t+2]);d[t&32767]=u[r],u[r]=t+1},x=i?(t,n)=>{for(let r=0;r<n;r++)f[p+r&32767]=e[t+r];p+=n}:(e,t)=>{},S=t;for(;S<n;){let t=0,r=0;if(S+2<n){let a=jn(e[S],e[S+1],e[S+2]),f=i?m+S:S,p=l&&h&&g>=s?o>>2:o,_=u[a];for(;_>0&&p-->0;){let i=_-1,a=f-i;if(a>kn||a<=0)break;if(t>=3&&y(i+t)!==e[S+t]){_=d[i&32767];continue}let o=Math.min(258,n-S),s=0;for(;s<o&&y(i+s)===e[S+s];)s++;if(s>t&&(t=s,r=a,s>=c))break;_=d[i&32767]}i?(d[f&32767]=u[a],u[a]=f+1):(d[S&32767]=u[a],u[a]=S+1)}if(l&&h){if(t>g)a.push({litOrLen:v,dist:0}),g=t,_=r,v=e[S],x(S,1),S++;else{a.push({litOrLen:g,dist:_});let e=Math.min(S-1+g,n);for(let t=S;t<e;t++)b(t);x(S,e-S),S=e,h=!1,g=0}}else if(t>=3){if(l)h=!0,g=t,_=r,v=e[S],x(S,1),S++;else{a.push({litOrLen:t,dist:r});let e=Math.min(S+t,n);for(let t=S+1;t<e;t++)b(t);x(S,e-S),S=e}}else h&&(a.push({litOrLen:g,dist:_}),h=!1,g=0),a.push({litOrLen:e[S],dist:0}),x(S,1),S++}if(h){a.push({litOrLen:g,dist:_});let e=Math.min(S-1+g,n);for(let t=S;t<e;t++)b(t);x(S,e-S),h=!1,g=0}return i&&(i.windowLen=p,i.totalIn=m+(n-t),i.hasPrevMatch=h,i.prevMatchLen=g,i.prevMatchDist=_,i.prevLiteral=v),a}var Hn=class{constructor(e=6){this._output=new Nn,this._state={head:new Int32Array(On),prev:new Int32Array(kn),window:new Uint8Array(kn),windowLen:0,totalIn:0,hasPrevMatch:!1,prevMatchLen:0,prevMatchDist:0,prevLiteral:0},this._level=Math.max(0,Math.min(9,e)),this._config=An(this._level)}write(e){if(e.length===0)return new Uint8Array;let t=this._output;return this._level===0?(this._writeStore(e),t.flushBytes()):(Bn(t,Vn(e,0,e.length,this._config,this._state),!1),t.flushBytes())}finish(){let e=this._output;return e.writeBits(1,1),e.writeBits(1,2),Fn(e,256),e.finish()}_writeStore(e){let t=this._output,n=0;for(;n<e.length;){let r=e.length-n,i=Math.min(65535,r);t.alignToByte(),t.writeBits(0,1),t.writeBits(0,2),t.alignToByte(),t.writeBits(i&255,8),t.writeBits(i>>8&255,8),t.writeBits(~i&255,8),t.writeBits(~i>>8&255,8);for(let r=0;r<i;r++)t.writeBits(e[n+r],8);n+=i}}};let Un={maxWorkers:typeof navigator<`u`&&navigator.hardwareConcurrency||4,minWorkers:0,idleTimeout:3e4,useTransferables:!0,workerUrl:void 0};function Wn(e){let t=e?.maxWorkers??Un.maxWorkers,n=e?.minWorkers??Un.minWorkers;return{maxWorkers:Math.max(1,t),minWorkers:Math.max(0,Math.min(n,t)),idleTimeout:Math.max(0,e?.idleTimeout??Un.idleTimeout),useTransferables:e?.useTransferables??Un.useTransferables,workerUrl:e?.workerUrl}}let Gn={high:3,normal:2,low:1};function Kn(e){return e?Gn[e]??Gn.normal:Gn.normal}function qn(){return typeof Worker<`u`&&typeof Blob<`u`}function Jn(){return`
|
|
7
|
+
(function(){this.Documonster=this.Documonster||{},(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:`Module`});var t=Object.defineProperty,n=(e,n)=>{let r={};for(var i in e)t(r,i,{get:e[i],enumerable:!0});return n||t(r,Symbol.toStringTag,{value:`Module`}),r};let r=new Uint8Array;function i(e,t,n=0){let r=e.length,i=t.length;if(i===0)return 0;if(i>r)return-1;let a=n|0;if(a<0&&(a=0),a>r-i)return-1;if(i===1)return e.indexOf(t[0],a);if(i===2){let n=t[0],i=t[1],o=r-2,s=e.indexOf(n,a);for(;s!==-1&&s<=o;){if(e[s+1]===i)return s;s=e.indexOf(n,s+1)}return-1}if(i===3){let n=t[0],i=t[1],o=t[2],s=r-3,c=e.indexOf(n,a);for(;c!==-1&&c<=s;){if(e[c+1]===i&&e[c+2]===o)return c;c=e.indexOf(n,c+1)}return-1}if(i===4){let n=t[0],i=t[1],o=t[2],s=t[3],c=r-4,l=e.indexOf(n,a);for(;l!==-1&&l<=c;){if(e[l+1]===i&&e[l+2]===o&&e[l+3]===s)return l;l=e.indexOf(n,l+1)}return-1}for(let n=a;n<=r-i;n++){let r=!0;for(let a=0;a<i;a++)if(e[n+a]!==t[a]){r=!1;break}if(r)return n}return-1}var a=class extends Error{constructor(e,t){super(e,t),this.name=`BaseError`,Object.setPrototypeOf(this,new.target.prototype),Error.captureStackTrace&&Error.captureStackTrace(this,this.constructor)}toJSON(){return{name:this.name,message:this.message,stack:this.stack,cause:this.cause instanceof Error?p(this.cause):this.cause}}},o=class extends a{constructor(e){super(`The operation was aborted`,e===void 0?void 0:{cause:e}),this.name=`AbortError`,this.code=`ABORT_ERR`}};function s(e){return e instanceof o?e:new o(e)}function c(e){return!!e&&typeof e==`object`&&e.name===`AbortError`}function l(e,t){if(e&&e.aborted)throw s(t??e.reason)}function u(e){let t=new AbortController;if(!e)return{controller:t,cleanup:()=>{}};if(e.aborted)return t.abort(e.reason),{controller:t,cleanup:()=>{}};let n=()=>{try{t.abort(e.reason)}catch{t.abort()}};return e.addEventListener(`abort`,n,{once:!0}),{controller:t,cleanup:()=>{try{e.removeEventListener(`abort`,n)}catch{}}}}function d(e){return e instanceof Error?e:Error(String(e))}function f(e){e.catch(()=>{})}function p(e){return e instanceof a?e.toJSON():{name:e.name,message:e.message,stack:e.stack,cause:e.cause instanceof Error?p(e.cause):e.cause}}var m=class extends a{constructor(e,t){super(e,t),this.name=`ArchiveError`}},h=class extends m{constructor(...e){super(...e),this.name=`ZipParseError`}},g=class extends h{constructor(e,t,n,r){let i=n?`Invalid ${n}: expected ${e}, got 0x${t.toString(16).padStart(8,`0`)}`:`Invalid signature: expected ${e}, got 0x${t.toString(16).padStart(8,`0`)}`;super(i,r),this.name=`InvalidZipSignatureError`}},_=class extends h{constructor(e){super(`Invalid ZIP file: End of Central Directory not found`,e),this.name=`EocdNotFoundError`}},v=class extends m{constructor(e,t,n,r){super(`CRC32 mismatch for "${e}": expected 0x${t.toString(16).padStart(8,`0`)}, got 0x${n.toString(16).padStart(8,`0`)}`,r),this.path=e,this.expected=t,this.actual=n,this.name=`Crc32MismatchError`}},y=class extends m{constructor(e,t,n,r,i){let a=r===`too-many-bytes`?`Entry "${e}" produced more bytes than declared: expected ${t}, got at least ${n}`:`Entry "${e}" produced fewer bytes than declared: expected ${t}, got ${n}`;super(a,i),this.path=e,this.expected=t,this.actual=n,this.reason=r,this.name=`EntrySizeMismatchError`}isZipBomb(){return this.reason===`too-many-bytes`}isCorruption(){return this.reason===`too-few-bytes`}},b=class extends m{constructor(e,t,n){super(t?`Failed to decrypt "${e}": ${t}`:`Failed to decrypt "${e}": incorrect password or corrupted data`,n),this.name=`DecryptionError`}},x=class extends m{constructor(e,t){super(`File "${e}" is encrypted. Please provide a password to extract.`,t),this.name=`PasswordRequiredError`}},S=class extends m{constructor(e,t){super(`Server does not support Range requests for: ${e}`,t),this.name=`RangeNotSupportedError`}},C=class extends m{constructor(e,t,n,r){super(`HTTP ${t} ${n} for: ${e}`,r),this.url=e,this.status=t,this.statusText=n,this.name=`HttpRangeError`}},w=class extends m{constructor(e,t,n){super(`File "${e}" is too large to extract into memory (${t})`,n),this.name=`FileTooLargeError`}},ee=class extends m{constructor(e,t){super(`Unsupported compression method: ${e}`,t),this.name=`UnsupportedCompressionError`}};function te(e){return!!e&&typeof e==`object`&&typeof e.getReader==`function`}function ne(e){return!!e&&typeof e==`object`&&typeof e.getWriter==`function`}function re(e){return!!e&&(typeof e==`object`||typeof e==`function`)&&typeof e[Symbol.asyncIterator]==`function`}function ie(e){if(!e||typeof e!=`object`)return!1;let t=e;return!!t.readable&&!!t.writable&&te(t.readable)&&ne(t.writable)}let T=new TextEncoder,E=new TextDecoder(`utf-8`,{ignoreBOM:!0}),ae=new Map;function oe(e){let t=(e??`utf-8`).trim().toLowerCase();return t===``||t===`utf8`||t===`utf-8`?`utf-8`:t===`utf16le`||t===`utf-16le`||t===`ucs2`||t===`ucs-2`?`utf-16le`:t===`binary`?`latin1`:t}function se(e){let t=oe(e);if(t===`utf-8`)return E;let n=ae.get(t);return n||(n=ce(t),ae.set(t,n)),n}function ce(e,t){try{return new TextDecoder(e,t)}catch(t){throw TypeError(`Unsupported text encoding: ${e}`,{cause:t})}}function le(e){let t=oe(e);switch(t){case`hex`:return{decode:de};case`base64`:return new me(!1);case`base64url`:return new me(!0);case`ascii`:return{decode:he};default:return ce(t,{ignoreBOM:!0})}}let ue=(()=>{let e=Array(256);for(let t=0;t<256;t++)e[t]=t.toString(16).padStart(2,`0`);return e})();function de(e){let t=``;for(let n=0;n<e.length;n++)t+=ue[e[n]];return t}let fe=`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/`,pe=`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_`;var me=class{constructor(e){this._remainder=null,this._chars=e?pe:fe}decode(e,t){let n;if(this._remainder){let t=new Uint8Array(this._remainder.length+e.length);t.set(this._remainder),t.set(e,this._remainder.length),n=t}else n=e;if(t?.stream??!1){let e=n.length%3,t=n.length-e;return this._remainder=e>0?n.slice(t):null,t>0?this._encodeBytes(n,t):``}return this._remainder=null,n.length>0?this._encodeBytes(n,n.length):``}_encodeBytes(e,t){let n=this._chars,r=n===pe,i=``,a=0;for(;a+2<t;a+=3){let t=e[a],r=e[a+1],o=e[a+2];i+=n[t>>>2]+n[(t&3)<<4|r>>>4]+n[(r&15)<<2|o>>>6]+n[o&63]}let o=t-a;if(o===1){let t=e[a];i+=n[t>>>2]+n[(t&3)<<4],r||(i+=`==`)}else if(o===2){let t=e[a],o=e[a+1];i+=n[t>>>2]+n[(t&3)<<4|o>>>4]+n[(o&15)<<2],r||(i+=`=`)}return i}};function he(e){let t=``;for(let n=0;n<e.length;n++)t+=String.fromCharCode(e[n]&127);return t}function ge(e){let t=``;for(let n=0;n<e.length;n++)t+=ue[e[n]];return t}function _e(e,t){let n=t?pe:fe,r=``,i=0;for(;i+2<e.length;i+=3){let t=e[i],a=e[i+1],o=e[i+2];r+=n[t>>>2]+n[(t&3)<<4|a>>>4]+n[(a&15)<<2|o>>>6]+n[o&63]}let a=e.length-i;if(a===1){let a=e[i];r+=n[a>>>2]+n[(a&3)<<4],t||(r+=`==`)}else if(a===2){let a=e[i],o=e[i+1];r+=n[a>>>2]+n[(a&3)<<4|o>>>4]+n[(o&15)<<2],t||(r+=`=`)}return r}function ve(e){let t=``;for(let n=0;n<e.length;n++)t+=String.fromCharCode(e[n]&127);return t}function ye(e,t){let n=oe(t);switch(n){case`hex`:return ge(e);case`base64`:return _e(e,!1);case`base64url`:return _e(e,!0);case`ascii`:return ve(e);default:return se(n).decode(e)}}function D(e){return T.encode(e)}function be(e,t){return se(t).decode(e)}function O(e,t){let n=e.length;if(n===0)return new Uint8Array;if(n===1){let t=e[0];return t.constructor===Uint8Array?t:new Uint8Array(t.buffer,t.byteOffset,t.byteLength)}if(t===void 0){let r=0;for(let t=0;t<n;t++)r+=e[t].length;t=r}let r=new Uint8Array(t),i=0;for(let t=0;t<n;t++){let n=e[t];r.set(n,i),i+=n.length}return r}function xe(e,t,n){if(!Number.isInteger(t)||t<0||t+n>e.length)throw RangeError(`cannot read ${n} byte(s) at offset ${t}: length is ${e.length}`)}function Se(e,t){return xe(e,t,2),(e[t]|e[t+1]<<8)>>>0}function k(e,t){return xe(e,t,4),(e[t]|e[t+1]<<8|e[t+2]<<16|e[t+3]<<24)>>>0}function Ce(e){let t=new Uint8Array(4);return t[0]=e&255,t[1]=e>>>8&255,t[2]=e>>>16&255,t[3]=e>>>24&255,t}var we=class{constructor(e,t=0,n=`binary stream`){this.data=e,this.view=new DataView(e.buffer,e.byteOffset,e.byteLength),this.label=n,this.offset=0,this.position=t}get position(){return this.offset}set position(e){if(!Number.isInteger(e)||e<0||e>this.data.length)throw RangeError(`${this.label}: cannot seek to ${e} — length is ${this.data.length}`);this.offset=e}get remaining(){return this.data.length-this.offset}get bytes(){return this.data}require(e){if(!Number.isInteger(e)||e<0||e>this.remaining)throw RangeError(`${this.label}: truncated at byte ${this.offset} — need ${e} byte(s), ${this.remaining} remain`)}readUint8(){this.require(1);let e=this.view.getUint8(this.offset);return this.offset+=1,e}readInt8(){this.require(1);let e=this.view.getInt8(this.offset);return this.offset+=1,e}readUint16(){this.require(2);let e=this.view.getUint16(this.offset,!0);return this.offset+=2,e}readInt16(){this.require(2);let e=this.view.getInt16(this.offset,!0);return this.offset+=2,e}readUint32(){this.require(4);let e=this.view.getUint32(this.offset,!0);return this.offset+=4,e}readInt32(){this.require(4);let e=this.view.getInt32(this.offset,!0);return this.offset+=4,e}readFloat64(){this.require(8);let e=this.view.getFloat64(this.offset,!0);return this.offset+=8,e}readBigUint64(){this.require(8);let e=this.view.getBigUint64(this.offset,!0);return this.offset+=8,e}readBytes(e){this.require(e);let t=this.data.subarray(this.offset,this.offset+e);return this.offset+=e,t}skip(e){this.require(e),this.offset+=e}slice(e,t){return this.data.subarray(e,t)}peekUint32(e){if(!Number.isInteger(e)||e<0||e+4>this.data.length)throw RangeError(`${this.label}: cannot peek 4 byte(s) at ${e} — length is ${this.data.length}`);return this.view.getUint32(e,!0)}};function Te(e,t={}){let n=j(e,t)[Symbol.asyncIterator]();return new ReadableStream({async pull(e){let{value:t,done:r}=await n.next();if(r){e.close();return}e.enqueue(t)},async cancel(){try{await n.return?.()}catch{}}})}function A(e){return e instanceof Uint8Array||e instanceof ArrayBuffer||typeof e==`string`||typeof Blob<`u`&&e instanceof Blob}function Ee(e){if(!e)return null;if(e instanceof Uint8Array)return e.length?e:null;if(typeof e==`string`){let t=D(e);return t.length?t:null}if(e instanceof ArrayBuffer)return e.byteLength?new Uint8Array(e):null;if(ArrayBuffer.isView(e))return e.byteLength?new Uint8Array(e.buffer,e.byteOffset,e.byteLength):null;throw TypeError(`Unsupported archive source chunk type: ${Object.prototype.toString.call(e)}`)}function De(e){return e instanceof Uint8Array?e:typeof e==`string`?D(e):new Uint8Array(e)}function Oe(e){return e instanceof Uint8Array||e instanceof ArrayBuffer||typeof e==`string`}async function ke(e){if(e instanceof Uint8Array)return e;if(typeof e==`string`)return D(e);if(e instanceof ArrayBuffer)return new Uint8Array(e);let t=await e.arrayBuffer();return new Uint8Array(t)}async function Ae(e,t={}){if(A(e))return ke(e);let n=[],i=0;for await(let r of j(e,t))n.push(r),i+=r.length;return n.length===0?r:n.length===1?n[0]:O(n,i)}async function je(e,t={}){return Ae(e,t)}async function*j(e,t={}){let{signal:n,onChunk:r}=t,i=()=>{if(n?.aborted)throw s(n?.reason)};if(i(),e instanceof Uint8Array){r&&r(e),yield e;return}if(typeof e==`string`){let t=D(e);r&&r(t),yield t;return}if(e instanceof ArrayBuffer){let t=new Uint8Array(e);r&&r(t),yield t;return}if(typeof Blob<`u`&&e instanceof Blob){if(typeof e.stream==`function`){yield*j(e.stream(),t);return}let n=await ke(e);i(),r&&r(n),yield n;return}if(te(e)){let t=e.getReader(),a=!1,o=()=>{a=!0;try{t.cancel()}catch{}};n&&(n.aborted?o():n.addEventListener(`abort`,o,{once:!0}));try{for(;;){if(a)throw s(n?.reason);i();let{done:e,value:o}=await t.read();if(e)return;let c=Ee(o);if(c){if(a)throw s(n?.reason);i(),r&&r(c),yield c}}}finally{if(n)try{n.removeEventListener(`abort`,o)}catch{}try{t.releaseLock()}catch{}}}if(re(e)){for await(let t of e){i();let e=Ee(t);e&&(r&&r(e),yield e)}return}throw new m(`Unsupported archive source`)}function Me(e){if(!e)return null;let t=e.lastIndexOf(`/`);if(t===-1)return null;let n=e.slice(t+1).trim();if(!n||n===`*`)return null;let r=parseInt(n,10);return Number.isFinite(r)&&r>=0?r:null}var Ne=class e{constructor(e,t,n={}){this._requestCount=0,this._bytesDownloaded=0,this.url=e,this._size=t,this.headers=n.headers??{},this.fetchFn=n.fetch??globalThis.fetch,this.signal=n.signal,this.credentials=n.credentials??`same-origin`}get size(){return this._size}static async open(t,n={}){let r=n.fetch??globalThis.fetch,i=n.headers??{},a=n.credentials??`same-origin`,o=n.validateRangeSupport??!0,s=0,c=0,l=async e=>{let n=await r(t,e);return s++,n};if(n.size!==void 0){if(o){let e=await l({method:`GET`,headers:{...i,Range:`bytes=0-0`},signal:n.signal,credentials:a});if(e.status!==206&&e.status!==200)throw new S(t)}let r=new e(t,n.size,n);return r._requestCount=s,r._bytesDownloaded=c,r}let u=await l({method:`HEAD`,headers:i,signal:n.signal,credentials:a});if(!u.ok)throw new C(t,u.status,u.statusText);let d=u.headers.get(`Accept-Ranges`);if(o&&d!==`bytes`){let e=await l({method:`GET`,headers:{...i,Range:`bytes=0-0`},signal:n.signal,credentials:a});if(e.status!==206&&e.status!==200)throw new S(t)}let f=u.headers.get(`Content-Length`),p=f?parseInt(f,10):NaN;if(!Number.isFinite(p)||p<0){let r=await l({method:`GET`,headers:{...i,Range:`bytes=0-0`},signal:n.signal,credentials:a}),o=Me(r.headers.get(`Content-Range`));if(o!==null)p=o;else if(r.status===200)try{let i=new Uint8Array(await r.arrayBuffer());c+=i.length,p=i.length;let a=new e(t,p,n);return a._fullData=i,a._requestCount=s,a._bytesDownloaded=c,a}catch{let r=await l({method:`GET`,headers:i,signal:n.signal,credentials:a});if(!r.ok)throw new C(t,r.status,r.statusText);let o=new Uint8Array(await r.arrayBuffer());c+=o.length,p=o.length;let u=new e(t,p,n);return u._fullData=o,u._requestCount=s,u._bytesDownloaded=c,u}else throw new m(f?`Invalid Content-Length "${f}" for: ${t}`:`Server did not provide Content-Length for: ${t}`)}let h=new e(t,p,n);return h._requestCount=s,h._bytesDownloaded=c,h}async read(e,t){if(e<0||t>this._size||e>=t)throw RangeError(`Invalid range [${e}, ${t}) for file of size ${this._size}`);if(this._fullData)return this._fullData.subarray(e,t);let n=`bytes=${e}-${t-1}`,r=await this.fetchFn(this.url,{method:`GET`,headers:{...this.headers,Range:n},signal:this.signal,credentials:this.credentials});if(r.status===200){let n=new Uint8Array(await r.arrayBuffer());return this._fullData=n,this._size=n.length,this._requestCount++,this._bytesDownloaded+=n.length,n.subarray(e,t)}if(r.status!==206)throw new C(this.url,r.status,r.statusText);let i=new Uint8Array(await r.arrayBuffer());this._requestCount++,this._bytesDownloaded+=i.length;let a=t-e;return i.length===a?i:i.subarray(0,a)}getStats(){return{requestCount:this._requestCount,bytesDownloaded:this._bytesDownloaded,totalSize:this._size,downloadedPercent:this._size>0?Math.round(this._bytesDownloaded/this._size*1e4)/100:0}}async close(){}};function Pe(e){let t=e instanceof ArrayBuffer?new Uint8Array(e):e;return{get size(){return t.length},async read(e,n){if(e<0||n>t.length||e>=n)throw RangeError(`Invalid range [${e}, ${n}) for buffer of size ${t.length}`);return t.subarray(e,n)},async close(){}}}let Fe=null;function Ie(){if(Fe)return Fe;let e=new Uint32Array(256);for(let t=0;t<256;t++){let n=t;for(let e=0;e<8;e++)n=n&1?3988292384^n>>>1:n>>>1;e[t]=n}return Fe=e,e}function M(e,t){let n=Ie();for(let r=0;r<t.length;r++)e=n[(e^t[r])&255]^e>>>8;return e}function Le(e){return(e^4294967295)>>>0}function N(e){return Le(M(4294967295,e))}function Re(e,t){return(Ie()[(e^t)&255]^e>>>8)>>>0}let ze=`ÇüéâäàåçêëèïîìÄÅÉæÆôöòûùÿÖÜ¢£¥₧ƒáíóúñѪº¿⌐¬½¼¡«»░▒▓│┤╡╢╖╕╣║╗╝╜╛┐└┴┬├─┼╞╟╚╔╩╦╠═╬╧╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀αßΓπΣσµτΦΘΩδ∞φε∩≡±≥≤⌠⌡÷≈°∙·√ⁿ²■\xA0`;function Be(e){let t=!1;for(let n=0;n<e.length;n++)if(e[n]>=128){t=!0;break}if(!t)return Je(e);let n=Array(e.length);for(let t=0;t<e.length;t++){let r=e[t];r<128?n[t]=String.fromCharCode(r):n[t]=ze[r-128]}return n.join(``)}function Ve(e){if(e.length===0)return r;let t=new Uint8Array(e.length),n=0;for(let r=0;r<e.length;r++){let i=e.charCodeAt(r),a=i;if(i>=55296&&i<=56319&&r+1<e.length){let t=e.charCodeAt(r+1);t>=56320&&t<=57343&&(a=(i-55296<<10)+(t-56320)+65536,r++)}if(a<128){t[n++]=a;continue}if(a>65535){t[n++]=63;continue}let o=He.get(String.fromCharCode(a));t[n++]=o??63}return n===t.length?t:t.subarray(0,n)}let He=(()=>{let e=new Map;for(let t=0;t<128;t++)e.set(ze[t],128+t);return e})(),Ue={name:`utf-8`,encode:D,decode:be,useUtf8Flag:!0,useUnicodeExtraFields:!1},We={name:`cp437`,encode:Ve,decode:Be,useUtf8Flag:!1,useUnicodeExtraFields:!0},Ge=new WeakMap;function P(e){if(!e||e===`utf-8`)return Ue;if(e===`cp437`)return We;let t=e,n=Ge.get(t);if(n)return n;let r=t.useUtf8Flag??t.name===`utf-8`,i={...t,useUtf8Flag:r,useUnicodeExtraFields:t.useUnicodeExtraFields??!r};return Ge.set(t,i),i}function Ke(e,t){return qe(e,P(t))}function qe(e,t){return e?t.encode(e):r}function Je(e){let t=``,n=32768;for(let r=0;r<e.length;r+=n){let i=e.subarray(r,Math.min(r+n,e.length));t+=String.fromCharCode(...i)}return t}function Ye(e,t,n,r){return e.length===0?``:(t??0)&2048?be(e):n&&n.version===1&&n.originalCrc32===N(e)?n.unicodeValue:r?r.decode(e):Be(e)}function Xe(e,t,n,r){return Ye(e,t,n?.unicodePath,r)}function Ze(e,t,n,r){return Ye(e,t,n?.unicodeComment,r)}function F(e){return e.byteOffset===0&&e.byteLength===e.buffer.byteLength&&e.buffer.constructor===ArrayBuffer?e.buffer:e.slice().buffer}function Qe(e){let t={key0:305419896,key1:591751049,key2:878082192},n=typeof e==`string`?D(e):e;for(let e=0;e<n.length;e++)$e(t,n[e]);return t}function $e(e,t){e.key0=Re(e.key0,t),e.key1=e.key1+(e.key0&255)>>>0,e.key1=(Math.imul(e.key1,134775813)>>>0)+1>>>0,e.key2=Re(e.key2,e.key1>>>24&255)}function et(e){let t=(e.key2|2)>>>0;return Math.imul(t,t^1)>>>8&255}function tt(e,t){let n=(t^et(e))&255;return $e(e,n),n}function nt(e,t){let n=(t^et(e))&255;return $e(e,t),n}function rt(e,t,n,r){if(t.length!==12)return!1;let i=new Uint8Array(12);for(let n=0;n<12;n++)i[n]=tt(e,t[n]);let a=i[11];return a===(n>>>24&255)||r!==void 0&&a===(r>>>8&255)}function it(e,t,n){let r=new Uint8Array(12),i=n(11);for(let t=0;t<11;t++)r[t]=nt(e,i[t]);return r[11]=nt(e,t>>>24&255),r}function at(e,t,n,r){if(e.length<12)return null;let i=Qe(t);if(!rt(i,e.subarray(0,12),n,r))return null;let a=e.length-12,o=new Uint8Array(a);for(let t=0;t<a;t++)o[t]=tt(i,e[12+t]);return o}function ot(e,t,n,r){let i=Qe(t),a=new Uint8Array(12+e.length),o=r(11);for(let e=0;e<11;e++)a[e]=nt(i,o[e]);a[11]=nt(i,n>>>24&255);for(let t=0;t<e.length;t++)a[12+t]=nt(i,e[t]);return a}function st(e,t,n,r){return e.length<12?!1:rt(Qe(t),e.subarray(0,12),n,r)}new Uint8Array([99,124,119,123,242,107,111,197,48,1,103,43,254,215,171,118,202,130,201,125,250,89,71,240,173,212,162,175,156,164,114,192,183,253,147,38,54,63,247,204,52,165,229,241,113,216,49,21,4,199,35,195,24,150,5,154,7,18,128,226,235,39,178,117,9,131,44,26,27,110,90,160,82,59,214,179,41,227,47,132,83,209,0,237,32,252,177,91,106,203,190,57,74,76,88,207,208,239,170,251,67,77,51,133,69,249,2,127,80,60,159,168,81,163,64,143,146,157,56,245,188,182,218,33,16,255,243,210,205,12,19,236,95,151,68,23,196,167,126,61,100,93,25,115,96,129,79,220,34,42,144,136,70,238,184,20,222,94,11,219,224,50,58,10,73,6,36,92,194,211,172,98,145,149,228,121,231,200,55,109,141,213,78,169,108,86,244,234,101,122,174,8,186,120,37,46,28,166,180,198,232,221,116,31,75,189,139,138,112,62,181,102,72,3,246,14,97,53,87,185,134,193,29,158,225,248,152,17,105,217,142,148,155,30,135,233,206,85,40,223,140,161,137,13,191,230,66,104,65,153,45,15,176,84,187,22]),new Uint32Array([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]),new Uint32Array([1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298]),new Uint32Array([3614090360,3905402710,606105819,3250441966,4118548399,1200080426,2821735955,4249261313,1770035416,2336552879,4294925233,2304563134,1804603682,4254626195,2792965006,1236535329,4129170786,3225465664,643717713,3921069994,3593408605,38016083,3634488961,3889429448,568446438,3275163606,4107603335,1163531501,2850285829,4243563512,1735328473,2368359562,4294588738,2272392833,1839030562,4259657740,2763975236,1272893353,4139469664,3200236656,681279174,3936430074,3572445317,76029189,3654602809,3873151461,530742520,3299628645,4096336452,1126891415,2878612391,4237533241,1700485571,2399980690,4293915773,2240044497,1873313359,4264355552,2734768916,1309151649,4149444226,3174756917,718787259,3951481745]);function ct(e){let t=new Uint8Array(e);return globalThis.crypto.getRandomValues(t),t}let lt=17729,ut=39169,dt={128:8,192:12,256:16},ft={128:16,192:24,256:32},pt={128:1,192:2,256:3},mt={1:128,2:192,3:256};function ht(){if(globalThis.crypto?.subtle!==void 0)return globalThis.crypto.subtle;throw new m(`Web Crypto API not available`)}async function gt(e,t,n){let r=ht(),i=typeof e==`string`?D(e):e,a=ft[n],o=a+a+2,s=await r.importKey(`raw`,F(i),`PBKDF2`,!1,[`deriveBits`]),c=await r.deriveBits({name:`PBKDF2`,salt:F(t),iterations:1e3,hash:`SHA-1`},s,o*8),l=new Uint8Array(c);return{encryptionKey:l.subarray(0,a),hmacKey:l.subarray(a,a+a),passwordVerify:l.subarray(a+a,a+a+2)}}async function _t(e,t){let n=ht(),r=await n.importKey(`raw`,F(e),{name:`HMAC`,hash:`SHA-1`},!1,[`sign`]),i=await n.sign(`HMAC`,r,F(t));return new Uint8Array(i,0,10)}function vt(e){let t=new Uint8Array(16);return new DataView(t.buffer).setUint32(0,e,!0),t}async function yt(e,t,n=!0){let r=ht(),i=await r.importKey(`raw`,F(e),{name:`AES-CTR`},!1,[`encrypt`]),a=new Uint8Array(t.length),o=new Uint8Array(16),s=Math.ceil(t.length/16);for(let e=0;e<s;e++){let n=vt(e+1),s=await r.encrypt({name:`AES-CTR`,counter:F(n),length:128},i,F(o)),c=new Uint8Array(s),l=e*16,u=Math.min(l+16,t.length);for(let e=l;e<u;e++)a[e]=t[e]^c[e-l]}return a}function bt(e,t,n){let r=new Uint8Array(11),i=new DataView(r.buffer);return i.setUint16(0,ut,!0),i.setUint16(2,7,!0),i.setUint16(4,e,!0),i.setUint16(6,lt,!0),r[8]=pt[t],i.setUint16(9,n,!0),r}function xt(e,t){let n=dt[t],r=n+2+10;return e.length<r?null:{salt:e.subarray(0,n),storedVerify:e.subarray(n,n+2),ciphertext:e.subarray(n+2,e.length-10),storedHmac:e.subarray(e.length-10)}}function St(e,t){return e[0]===t[0]&&e[1]===t[1]}function Ct(e,t){if(e.length!==t.length)return!1;let n=0;for(let r=0;r<e.length;r++)n|=e[r]^t[r];return n===0}async function wt(e,t,n){let r=xt(e,n);if(!r)throw new m(`Encrypted data too short`);let{salt:i,storedVerify:a,ciphertext:o,storedHmac:s}=r,c=await gt(t,i,n);if(!St(c.passwordVerify,a))throw new m(`Password verification failed`);if(!Ct(await _t(c.hmacKey,o),s))throw new m(`HMAC verification failed`);return yt(c.encryptionKey,o,!1)}async function Tt(e,t,n){let r=dt[n],i=ct(r),a=await gt(t,i,n),o=await yt(a.encryptionKey,e,!0),s=await _t(a.hmacKey,o),c=new Uint8Array(r+2+o.length+10),l=0;return c.set(i,l),l+=r,c.set(a.passwordVerify,l),l+=2,c.set(o,l),l+=o.length,c.set(s,l),c}function Et(e,t){return dt[t]+2+e+10}async function Dt(e,t,n){let r=dt[n],i=r+2;if(e.length<i)return!1;let a=e.subarray(0,r),o=e.subarray(r,r+2);return St((await gt(t,a,n)).passwordVerify,o)}let Ot={none:`None`,zipcrypto:`ZipCrypto (Traditional PKWARE)`,"aes-128":`AES-128`,"aes-192":`AES-192`,"aes-256":`AES-256`},kt={"aes-128":128,"aes-192":192,"aes-256":256},At={128:`aes-128`,192:`aes-192`,256:`aes-256`};function jt(e){return Ot[e]}function Mt(e){return e in kt}function Nt(e){return kt[e]}function Pt(e){return At[e]}function Ft(e,t,n){typeof e.off==`function`?e.off(t,n):typeof e.removeListener==`function`&&e.removeListener(t,n)}function It(e,t,n={}){let r=!1,i=!1,a=null,o,s,c=new Promise((e,t)=>{o=e,s=t}),l=()=>{Ft(e,`error`,d);for(let n of t)Ft(e,n,f)},u=()=>{for(let n of t)Ft(e,n,f)},d=e=>{i||(a=e instanceof Error?e:Error(String(e)),l(),r||(r=!0,s(a)))},f=()=>{i||r||(r=!0,n.keepErrorUntilCancel?u():l(),o())},p=()=>{i||(i=!0,l(),r||(r=!0,o()))};if(typeof e.once==`function`){e.once(`error`,d);for(let n of t)e.once(n,f)}else{e.on?.(`error`,d);for(let n of t)e.on?.(n,f)}return c.catch(()=>{}),{promise:c,cancel:p,error:()=>a}}async function Lt(e,t){if(ne(t)){let n=t.getWriter();try{for await(let t of e)await n.write(t);await n.close()}finally{try{n.releaseLock()}catch{}}return}for await(let n of e){let e=typeof t.once==`function`||typeof t.on==`function`?It(t,[`drain`],{keepErrorUntilCancel:!0}):null,r;try{r=await t.write(n)}catch(t){throw e?.cancel(),t}if(e?.error())throw e.error();r===!1&&e?(await e.promise,e.cancel()):e?.cancel()}if(typeof t.end==`function`){if(typeof t.once==`function`||typeof t.on==`function`){let e=It(t,[`finish`,`close`]);try{await t.end(),await e.promise}catch(t){throw e.cancel(),t}}else await t.end()}}async function Rt(e){let t=[],n=0;for await(let r of e)t.push(r),n+=r.length;return O(t,n)}var zt=class{_activeChunkCount(){return this._chunks.length-this._chunkHead}_headChunk(){return this._chunks[this._chunkHead]}_compactConsumedChunks(){if(this._chunkHead!==0){if(this._chunkHead>=this._chunks.length){this._chunks=[],this._chunkHead=0;return}this._chunkHead>32&&this._chunkHead*2>=this._chunks.length&&(this._chunks=this._chunks.slice(this._chunkHead),this._chunkHead=0)}}_dropHeadChunk(){this._chunkHead++,this._headOffset=0,this._compactConsumedChunks()}constructor(e){this._chunks=[],this._chunkHead=0,this._headOffset=0,this._length=0,this._cachedView=null,this._cachedLength=0,e&&e.length>0&&this.reset(e)}get length(){return this._length}isEmpty(){return this.length===0}view(){if(this._length===0)return r;if(this._activeChunkCount()===1)return this._headChunk().subarray(this._headOffset,this._headOffset+this._length);if(this._cachedView&&this._cachedLength===this._length)return this._cachedView;let e=new Uint8Array(this._length),t=0;for(let n=this._chunkHead;n<this._chunks.length;n++){let r=this._chunks[n],i=n===this._chunkHead?this._headOffset:0,a=n===this._chunks.length-1?i+(this._length-t):r.length;if(e.set(r.subarray(i,a),t),t+=a-i,t>=e.length)break}return this._cachedView=e,this._cachedLength=this._length,e}reset(e){if(this._cachedView=null,this._cachedLength=0,this._chunks=[],this._chunkHead=0,this._headOffset=0,this._length=0,!e||e.length===0)return;let t=new Uint8Array(e.length);t.set(e),this._chunks=[t],this._chunkHead=0,this._headOffset=0,this._length=t.length}append(e){e.length!==0&&(this._cachedView=null,this._cachedLength=0,this._chunks.push(e),this._length+=e.length)}read(e){if(e<=0)return r;if(e>this._length)throw RangeError(`ByteQueue: read beyond available data`);if(this._cachedView=null,this._cachedLength=0,this._activeChunkCount()===1){let t=this._headChunk(),n=this._headOffset,r=n+e,i=t.subarray(n,r);return this._headOffset=r,this._length-=e,this._length===0?(this._chunks=[],this._chunkHead=0,this._headOffset=0):this._headOffset>=t.length&&this._dropHeadChunk(),i}let t=new Uint8Array(e),n=0,i=e;for(;i>0;){let e=this._headChunk(),r=this._headOffset,a=e.length-r,o=Math.min(a,i);t.set(e.subarray(r,r+o),n),n+=o,i-=o,this._headOffset+=o,this._length-=o,this._headOffset>=e.length&&this._dropHeadChunk()}return this._length===0&&(this._chunks=[],this._chunkHead=0,this._headOffset=0),t}peekChunks(e){if(e<=0)return[];if(e>this._length)throw RangeError(`ByteQueue: peek beyond available data`);if(this._activeChunkCount()===1){let t=this._headChunk(),n=this._headOffset;return[t.subarray(n,n+e)]}let t=[],n=e;for(let e=this._chunkHead;e<this._chunks.length&&n>0;e++){let r=this._chunks[e],i=e===this._chunkHead?this._headOffset:0,a=r.length-i;if(a<=0)continue;let o=Math.min(a,n);t.push(r.subarray(i,i+o)),n-=o}return t}discard(e){if(e<=0)return;if(e>=this._length){this._chunks=[],this._chunkHead=0,this._headOffset=0,this._length=0,this._cachedView=null,this._cachedLength=0;return}this._cachedView=null,this._cachedLength=0;let t=e;for(;t>0;){let e=this._headChunk(),n=this._headOffset,r=e.length-n,i=Math.min(r,t);this._headOffset+=i,this._length-=i,t-=i,this._headOffset>=e.length&&this._dropHeadChunk()}this._length===0&&(this._chunks=[],this._chunkHead=0,this._headOffset=0)}indexOfPattern(e,t=0){let n=e.length;if(n===0)return 0;let r=this._length;if(n>r)return-1;let a=t|0;if(a<0&&(a=0),a>r-n)return-1;if(this._activeChunkCount()===1){let t=this._headChunk(),o=this._headOffset,s=t.subarray(o,o+r);return n===1?s.indexOf(e[0],a):i(s,e,a)}if(n>4)return i(this.view(),e,a);let o=e[0],s=n>=2?e[1]:0,c=n>=3?e[2]:0,l=n>=4?e[3]:0,u=this._chunks,d=this._chunkHead,f=(e,t)=>{let n=e,r=t;for(;n<u.length;){let e=u[n];if(r<e.length)return e[r]|0;r-=e.length,n++}return null},p=0;for(let e=d;e<u.length;e++){let t=u[e],i=e===d?this._headOffset:0,m=t.length-i;if(m<=0)continue;let h=p,g=h+m,_=a<=h?i:a>=g?t.length:i+(a-h);if(_>t.length-1){p+=m;continue}let v=t.length-1,y=t.indexOf(o,_);for(;y!==-1&&y<=v;){let a=h+(y-i);if(a>r-n)return-1;if(n===1)return a;if(y+n<=t.length){if(t[y+1]!==s){y=t.indexOf(o,y+1);continue}if(n===2)return a;if(t[y+2]!==c){y=t.indexOf(o,y+1);continue}if(n===3)return a;if(t[y+3]!==l){y=t.indexOf(o,y+1);continue}return a}let u=f(e,y+1);if(u===null||u!==s){y=t.indexOf(o,y+1);continue}if(n===2)return a;let d=f(e,y+2);if(d===null||d!==c){y=t.indexOf(o,y+1);continue}if(n===3)return a;let p=f(e,y+3);if(p===null||p!==l){y=t.indexOf(o,y+1);continue}return a}p+=m}return-1}peekUint32LE(e){let t=e|0;if(t<0||t+4>this._length)return null;let n=this._chunks,r=t;for(let e=this._chunkHead;e<n.length;e++){let t=n[e],i=e===this._chunkHead?this._headOffset:0,a=t.length-i;if(r<a){let a=i+r;if(a+4<=t.length){let e=t[a]|0,n=t[a+1]|0,r=t[a+2]|0,i=t[a+3]|0;return(e|n<<8|r<<16|i<<24)>>>0}let o=t[a]|0,s=0,c=0,l=0,u=e,d=a+1;for(let e=1;e<4;e++)for(;u<n.length;){let t=n[u];if(d<t.length){let n=t[d]|0;e===1?s=n:e===2?c=n:l=n,d++;break}u++,d=0}return(o|s<<8|c<<16|l<<24)>>>0}r-=a}return null}peekByte(e){let t=e|0;if(t<0||t>=this._length)throw RangeError(`ByteQueue: peek beyond available data`);let n=t;for(let e=this._chunkHead;e<this._chunks.length;e++){let t=this._chunks[e],r=e===this._chunkHead?this._headOffset:0,i=t.length-r;if(n<i)return t[r+n]|0;n-=i}throw RangeError(`ByteQueue: peek beyond available data`)}};function Bt(){return typeof CompressionStream<`u`}function Vt(){try{return typeof CompressionStream>`u`?!1:(new CompressionStream(`deflate-raw`),!0)}catch{return!1}}function Ht(){try{return typeof DecompressionStream>`u`?!1:(new DecompressionStream(`deflate-raw`),!0)}catch{return!1}}let Ut=null,Wt=null;function Gt(){return typeof CompressionStream>`u`?!1:(Ut===null&&(Ut=Vt()),Ut)}function Kt(){return typeof DecompressionStream>`u`?!1:(Wt===null&&(Wt=Ht()),Wt)}function qt(){return Gt()&&Kt()}async function Jt(e){let t=new zt;for(;;){let{done:n,value:r}=await e.read();if(n)break;t.append(r)}return t.read(t.length)}async function Yt(e,t){let n=t.writable.getWriter(),r=t.readable.getReader(),i=Jt(r).then(e=>({ok:!0,value:e}),e=>({ok:!1,error:e}));try{let t;try{await n.write(e),await n.close()}catch(e){t={error:e},await r.cancel().catch(()=>{})}let a=await i;if(!a.ok)throw a.error;if(t)throw t.error;return a.value}finally{try{n.releaseLock()}catch{}try{r.releaseLock()}catch{}}}async function Xt(e){return Yt(e,new CompressionStream(`deflate-raw`))}async function Zt(e){return Yt(e,new DecompressionStream(`deflate-raw`))}let Qt=65521;function $t(e){let t=1,n=0;for(let r=0;r<e.length;){let i=Math.min(r+5552,e.length);for(;r<i;)t+=e[r++],n+=t;t%=Qt,n%=Qt}return n<<16|t}function en(e){return e.length>=2&&e[0]===31&&e[1]===139}let tn={};function nn(e,t){let n=`${e}:${t}`;return()=>{let r=e===`compression`?typeof CompressionStream<`u`?CompressionStream:void 0:typeof DecompressionStream<`u`?DecompressionStream:void 0;if(!r)return!1;let i=tn[n];if(i!=null)return i;try{new r(t),tn[n]=!0}catch{tn[n]=!1}return tn[n]}}let rn=nn(`compression`,`gzip`),an=nn(`decompression`,`gzip`),on=nn(`compression`,`deflate`),sn=nn(`decompression`,`deflate`);function cn(e){if(e.length<2)return!1;let t=e[0],n=e[1];return(t&15)!=8||t>>4>7?!1:(t<<8|n)%31==0}function ln(e){return en(e)?`gzip`:cn(e)?`zlib`:`deflate-raw`}let un={0:new Uint8Array([120,1]),1:new Uint8Array([120,1]),2:new Uint8Array([120,94]),3:new Uint8Array([120,94]),4:new Uint8Array([120,94]),5:new Uint8Array([120,94]),6:new Uint8Array([120,156]),7:new Uint8Array([120,218]),8:new Uint8Array([120,218]),9:new Uint8Array([120,218])};function dn(e){return un[Math.max(0,Math.min(9,e))]??un[6]}function fn(e){let t=new Uint8Array(4);return t[0]=e>>>24&255,t[1]=e>>>16&255,t[2]=e>>>8&255,t[3]=e&255,t}function pn(e){if(e.length<6)throw new m(`Invalid zlib data (too small)`);let t=e[0],n=e[1];if((t&15)!=8)throw new m(`Invalid zlib compression method`);if(t>>4>7)throw new m(`Invalid zlib CINFO value`);if((t<<8|n)%31!=0)throw new m(`Invalid zlib header checksum`);if(n&32)throw new m(`Zlib preset dictionary not supported`);return 2}function mn(e){let t=e.length-4;return(e[t]<<24|e[t+1]<<16|e[t+2]<<8|e[t+3])>>>0}function hn(e,t){if($t(e)>>>0!=t>>>0)throw new m(`Invalid zlib data (Adler-32 mismatch)`)}let gn=(()=>{let e=new Uint8Array(288);for(let t=0;t<=143;t++)e[t]=8;for(let t=144;t<=255;t++)e[t]=9;for(let t=256;t<=279;t++)e[t]=7;for(let t=280;t<=287;t++)e[t]=8;return e})(),_n=new Uint8Array(32).fill(5),vn=[3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258],yn=[0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0],bn=[1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577],xn=[0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13],Sn=[[1,0,0],[2,1,0],[3,2,0],[4,3,0],[6,4,1],[8,5,1],[12,6,2],[16,7,2],[24,8,3],[32,9,3],[48,10,4],[64,11,4],[96,12,5],[128,13,5],[192,14,6],[256,15,6],[384,16,7],[512,17,7],[768,18,8],[1024,19,8],[1536,20,9],[2048,21,9],[3072,22,10],[4096,23,10],[6144,24,11],[8192,25,11],[12288,26,12],[16384,27,12],[24576,28,13],[32768,29,13]],Cn=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15];function wn(e,t){let n=new Uint16Array(16);for(let r=0;r<t;r++)e[r]>0&&n[e[r]]++;let r=new Uint16Array(16),i=0;for(let e=1;e<=15;e++)i=i+n[e-1]<<1,r[e]=i;let a={};for(let n=0;n<t;n++){let t=e[n];if(t===0)continue;i=r[t]++;let o=a;for(let e=t-1;e>=0;e--)i>>e&1?(o.right||(o.right={}),o=o.right):(o.left||(o.left={}),o=o.left);o.symbol=n}return a}var Tn=class{constructor(e){this.data=e,this.pos=0,this.bitBuf=0,this.bitCount=0}readBits(e){for(;this.bitCount<e;){if(this.pos>=this.data.length)throw new m(`Unexpected end of DEFLATE data`);this.bitBuf|=this.data[this.pos++]<<this.bitCount,this.bitCount+=8}let t=this.bitBuf&(1<<e)-1;return this.bitBuf>>=e,this.bitCount-=e,t}decodeSymbol(e){let t=e;for(;t.symbol===void 0;)if(t=this.readBits(1)===0?t.left:t.right,!t)throw new m(`Invalid Huffman code`);return t.symbol}alignToByte(){this.bitBuf=0,this.bitCount=0}readByte(){if(this.pos>=this.data.length)throw new m(`Unexpected end of data`);return this.data[this.pos++]}readUint16(){return this.readByte()|this.readByte()<<8}};function En(e){let t=new Tn(e),n=new Uint8Array(Math.max(64,e.length*4)),r=0,i=e=>{let t=r+e;if(t<=n.length)return;let i=n.length;for(;i<t;)i*=2;let a=new Uint8Array(i);a.set(n.subarray(0,r)),n=a},a=!1;for(;!a;){a=t.readBits(1)===1;let e=t.readBits(2);if(e===0){t.alignToByte();let e=t.readUint16();if((e^t.readUint16())!==65535)throw new m(`Invalid stored block length`);i(e);for(let i=0;i<e;i++)n[r++]=t.readByte()}else if(e===1||e===2){let a,o;if(e===1)a=wn(gn,288),o=wn(_n,32);else{let e=t.readBits(5)+257,n=t.readBits(5)+1,r=t.readBits(4)+4,i=new Uint8Array(19);for(let e=0;e<r;e++)i[Cn[e]]=t.readBits(3);let s=wn(i,19),c=new Uint8Array(e+n),l=0;for(;l<e+n;){let e=t.decodeSymbol(s);if(e<16)c[l++]=e;else if(e===16){let e=t.readBits(2)+3,n=c[l-1];for(let t=0;t<e;t++)c[l++]=n}else if(e===17){let e=t.readBits(3)+3;for(let t=0;t<e;t++)c[l++]=0}else if(e===18){let e=t.readBits(7)+11;for(let t=0;t<e;t++)c[l++]=0}}a=wn(c.subarray(0,e),e),o=wn(c.subarray(e),n)}for(;;){let e=t.decodeSymbol(a);if(e<256)i(1),n[r++]=e;else if(e===256)break;else{let a=e-257,s=vn[a]+t.readBits(yn[a]),c=t.decodeSymbol(o),l=bn[c]+t.readBits(xn[c]);i(s);let u=r-l;for(let e=0;e<s;e++)n[r++]=n[u+e]}}}else throw new m(`Invalid DEFLATE block type: `+e)}return n.slice(0,r)}function Dn(e){let t=65535,n=Math.ceil(e.length/t)||1,r=n*5+e.length,i=new Uint8Array(r),a=0,o=0;for(let r=0;r<n;r++){let s=r===n-1,c=Math.min(t,e.length-o);i[a++]=+!!s,i[a++]=c&255,i[a++]=c>>8&255,i[a++]=~c&255,i[a++]=~c>>8&255,i.set(e.subarray(o,o+c),a),a+=c,o+=c}return i.subarray(0,a)}let On=32768,kn=32768;function An(e){return e<=1?{maxChainLen:4,goodLen:4,niceLen:8,lazy:!1}:e<=3?{maxChainLen:8,goodLen:8,niceLen:32,lazy:!0}:e<=5?{maxChainLen:32,goodLen:16,niceLen:128,lazy:!0}:e<=7?{maxChainLen:64,goodLen:32,niceLen:258,lazy:!0}:{maxChainLen:128,goodLen:64,niceLen:258,lazy:!0}}function jn(e,t,n){return(e<<16|t<<8|n)*506832829>>>17&32767}function Mn(e,t=6){if(e.length===0)return new Uint8Array([3,0]);if(e.length<100)return Dn(e);let n=An(t),r=Vn(e,0,e.length,n,null),i=new Nn;return Bn(i,r,!0),i.finish()}var Nn=class e{constructor(){this.chunks=[],this.buffer=new Uint8Array(e.CHUNK_SIZE),this.bufLen=0,this.bitBuf=0,this.bitCount=0}static{this.CHUNK_SIZE=65536}alignToByte(){this.bitCount>0&&this.writeBits(0,8-this.bitCount)}pushByte(t){this.buffer[this.bufLen++]=t,this.bufLen>=e.CHUNK_SIZE&&(this.chunks.push(this.buffer),this.buffer=new Uint8Array(e.CHUNK_SIZE),this.bufLen=0)}writeBits(e,t){for(this.bitBuf|=e<<this.bitCount,this.bitCount+=t;this.bitCount>=8;)this.pushByte(this.bitBuf&255),this.bitBuf>>=8,this.bitCount-=8}writeBitsReverse(e,t){let n=0;for(let r=0;r<t;r++)n=n<<1|e>>r&1;this.writeBits(n,t)}finish(){return this.bitCount>0&&(this.pushByte(this.bitBuf&255),this.bitBuf=0,this.bitCount=0),this.chunks.length===0?this.buffer.slice(0,this.bufLen):(this.chunks.push(this.buffer.subarray(0,this.bufLen)),O(this.chunks))}flushBytes(){if(this.chunks.length===0&&this.bufLen===0)return new Uint8Array;let t;return this.chunks.length===0?t=this.buffer.slice(0,this.bufLen):(this.chunks.push(this.buffer.subarray(0,this.bufLen)),t=O(this.chunks),this.chunks=[]),this.buffer=new Uint8Array(e.CHUNK_SIZE),this.bufLen=0,t}};let Pn=(()=>{let e=[];for(let t=0;t<=287;t++){let n,r;t<=143?(n=48+t,r=8):t<=255?(n=400+(t-144),r=9):t<=279?(n=t-256,r=7):(n=192+(t-280),r=8),e[t]=[n,r]}return e})();function Fn(e,t){let[n,r]=Pn[t];e.writeBitsReverse(n,r)}function In(e){for(let t=0;t<vn.length;t++)if(t===vn.length-1||e<vn[t+1])return{code:257+t,extra:e-vn[t],extraBits:yn[t]};return{code:285,extra:0,extraBits:0}}function Ln(e){for(let t=0;t<Sn.length;t++){let[n,r,i]=Sn[t];if(e<=n)return{code:r,extra:e-(t===0?1:Sn[t-1][0]+1),extraBits:i}}return{code:29,extra:0,extraBits:13}}function Rn(e,t){let n=e.length,r=new Uint8Array(n),i=[];for(let t=0;t<n;t++)e[t]>0&&i.push({sym:t,freq:e[t]});if(i.length===0)return r;if(i.length===1)return r[i[0].sym]=1,r;i.sort((e,t)=>e.freq-t.freq||e.sym-t.sym);let a=i.map(e=>({freq:e.freq,sym:e.sym,left:null,right:null})),o=0,s=0,c=[];function l(){let e=o<a.length,t=s<c.length;return e&&t?a[o].freq<=c[s].freq?a[o++]:c[s++]:e?a[o++]:c[s++]}let u=i.length;for(let e=0;e<u-1;e++){let e=l(),t=l(),n={freq:e.freq+t.freq,sym:-1,left:e,right:t};c.push(n)}let d=c[c.length-1];function f(e,t){if(e.sym>=0){r[e.sym]=t;return}e.left&&f(e.left,t+1),e.right&&f(e.right,t+1)}f(d,0);let p=new Uint16Array(t+1);for(let e=0;e<n;e++)r[e]>0&&(r[e]>t?(p[t]++,r[e]=t):p[r[e]]++);let m=0;for(let e=1;e<=t;e++)m+=p[e]<<t-e;let h=1<<t;if(m===h)return r;for(;m>h;){let e=t-1;for(;e>0&&p[e]===0;)e--;if(e===0)break;p[e]--,p[t]++,m-=(1<<t-e)-1}for(;m<h;)p[t]++,m++;let g=[];for(let t=0;t<n;t++)r[t]>0&&g.push({sym:t,origLen:r[t],freq:e[t]});g.sort((e,t)=>t.origLen-e.origLen||e.freq-t.freq),r.fill(0);let _=0;for(let e=t;e>=1;e--)for(let t=p[e];t>0;t--)_<g.length&&(r[g[_].sym]=e,_++);return r}function zn(e){let t=e.length,n=Array(t),r=new Uint16Array(16);for(let n=0;n<t;n++)e[n]>0&&r[e[n]]++;let i=new Uint16Array(16),a=0;for(let e=1;e<=15;e++)a=a+r[e-1]<<1,i[e]=a;for(let r=0;r<t;r++){let t=e[r];t>0?n[r]=[i[t]++,t]:n[r]=[0,0]}return n}function Bn(e,t,n){let r=new Uint32Array(286),i=new Uint32Array(30);r[256]=1;for(let e of t)if(e.dist===0)r[e.litOrLen]++;else{let t=In(e.litOrLen);r[t.code]++;let n=Ln(e.dist);i[n.code]++}let a=Rn(r,15),o=Rn(i,15),s=!1;for(let e=0;e<o.length;e++)if(o[e]>0){s=!0;break}s||(o=new Uint8Array(30),o[0]=1,o[1]=1);let c=zn(a),l=zn(o),u=286;for(;u>257&&a[u-1]===0;)u--;let d=30;for(;d>1&&o[d-1]===0;)d--;let f=new Uint8Array(u+d);f.set(a.subarray(0,u)),f.set(o.subarray(0,d),u);let p=[],m=new Uint32Array(19);for(let e=0;e<f.length;){let t=f[e];if(t===0){let t=1;for(;e+t<f.length&&f[e+t]===0;)t++;for(;t>0;)if(t>=11){let n=Math.min(t,138);p.push({sym:18,extra:n-11,extraBits:7}),m[18]++,t-=n,e+=n}else if(t>=3){let n=Math.min(t,10);p.push({sym:17,extra:n-3,extraBits:3}),m[17]++,t-=n,e+=n}else p.push({sym:0,extra:0,extraBits:0}),m[0]++,t--,e++}else{p.push({sym:t,extra:0,extraBits:0}),m[t]++,e++;let n=0;for(;e+n<f.length&&f[e+n]===t;)n++;for(;n>=3;){let t=Math.min(n,6);p.push({sym:16,extra:t-3,extraBits:2}),m[16]++,n-=t,e+=t}for(;n>0;)p.push({sym:t,extra:0,extraBits:0}),m[t]++,n--,e++}}let h=Rn(m,7),g=zn(h),_=19;for(;_>4&&h[Cn[_-1]]===0;)_--;e.writeBits(+!!n,1),e.writeBits(2,2),e.writeBits(u-257,5),e.writeBits(d-1,5),e.writeBits(_-4,4);for(let t=0;t<_;t++)e.writeBits(h[Cn[t]],3);for(let t of p){let[n,r]=g[t.sym];e.writeBitsReverse(n,r),t.extraBits>0&&e.writeBits(t.extra,t.extraBits)}for(let n of t)if(n.dist===0){let[t,r]=c[n.litOrLen];e.writeBitsReverse(t,r)}else{let t=In(n.litOrLen),[r,i]=c[t.code];e.writeBitsReverse(r,i),t.extraBits>0&&e.writeBits(t.extra,t.extraBits);let a=Ln(n.dist),[o,s]=l[a.code];e.writeBitsReverse(o,s),a.extraBits>0&&e.writeBits(a.extra,a.extraBits)}let[v,y]=c[256];e.writeBitsReverse(v,y)}function Vn(e,t,n,r,i){let a=[],o=r.maxChainLen,s=r.goodLen,c=r.niceLen,l=r.lazy,u,d,f,p,m,h,g,_,v;i?(u=i.head,d=i.prev,f=i.window,p=i.windowLen,m=i.totalIn,h=i.hasPrevMatch,g=i.prevMatchLen,_=i.prevMatchDist,v=i.prevLiteral):(u=new Int32Array(On),d=new Int32Array(kn),f=null,p=0,m=0,h=!1,g=0,_=0,v=0);let y=i?r=>{let i=r-m;return i>=t&&i<n?e[i]:f[r&32767]}:t=>e[t],b=i?t=>{if(t+2>=n)return;let r=jn(e[t],e[t+1],e[t+2]),i=m+t;d[i&32767]=u[r],u[r]=i+1}:t=>{if(t+2>=n)return;let r=jn(e[t],e[t+1],e[t+2]);d[t&32767]=u[r],u[r]=t+1},x=i?(t,n)=>{for(let r=0;r<n;r++)f[p+r&32767]=e[t+r];p+=n}:(e,t)=>{},S=t;for(;S<n;){let t=0,r=0;if(S+2<n){let a=jn(e[S],e[S+1],e[S+2]),f=i?m+S:S,p=l&&h&&g>=s?o>>2:o,_=u[a];for(;_>0&&p-->0;){let i=_-1,a=f-i;if(a>kn||a<=0)break;if(t>=3&&y(i+t)!==e[S+t]){_=d[i&32767];continue}let o=Math.min(258,n-S),s=0;for(;s<o&&y(i+s)===e[S+s];)s++;if(s>t&&(t=s,r=a,s>=c))break;_=d[i&32767]}i?(d[f&32767]=u[a],u[a]=f+1):(d[S&32767]=u[a],u[a]=S+1)}if(l&&h){if(t>g)a.push({litOrLen:v,dist:0}),g=t,_=r,v=e[S],x(S,1),S++;else{a.push({litOrLen:g,dist:_});let e=Math.min(S-1+g,n);for(let t=S;t<e;t++)b(t);x(S,e-S),S=e,h=!1,g=0}}else if(t>=3){if(l)h=!0,g=t,_=r,v=e[S],x(S,1),S++;else{a.push({litOrLen:t,dist:r});let e=Math.min(S+t,n);for(let t=S+1;t<e;t++)b(t);x(S,e-S),S=e}}else h&&(a.push({litOrLen:g,dist:_}),h=!1,g=0),a.push({litOrLen:e[S],dist:0}),x(S,1),S++}if(h){a.push({litOrLen:g,dist:_});let e=Math.min(S-1+g,n);for(let t=S;t<e;t++)b(t);x(S,e-S),h=!1,g=0}return i&&(i.windowLen=p,i.totalIn=m+(n-t),i.hasPrevMatch=h,i.prevMatchLen=g,i.prevMatchDist=_,i.prevLiteral=v),a}var Hn=class{constructor(e=6){this._output=new Nn,this._state={head:new Int32Array(On),prev:new Int32Array(kn),window:new Uint8Array(kn),windowLen:0,totalIn:0,hasPrevMatch:!1,prevMatchLen:0,prevMatchDist:0,prevLiteral:0},this._level=Math.max(0,Math.min(9,e)),this._config=An(this._level)}write(e){if(e.length===0)return new Uint8Array;let t=this._output;return this._level===0?(this._writeStore(e),t.flushBytes()):(Bn(t,Vn(e,0,e.length,this._config,this._state),!1),t.flushBytes())}finish(){let e=this._output;return e.writeBits(1,1),e.writeBits(1,2),Fn(e,256),e.finish()}_writeStore(e){let t=this._output,n=0;for(;n<e.length;){let r=e.length-n,i=Math.min(65535,r);t.alignToByte(),t.writeBits(0,1),t.writeBits(0,2),t.alignToByte(),t.writeBits(i&255,8),t.writeBits(i>>8&255,8),t.writeBits(~i&255,8),t.writeBits(~i>>8&255,8);for(let r=0;r<i;r++)t.writeBits(e[n+r],8);n+=i}}};let Un={maxWorkers:typeof navigator<`u`&&navigator.hardwareConcurrency||4,minWorkers:0,idleTimeout:3e4,useTransferables:!0,workerUrl:void 0};function Wn(e){let t=e?.maxWorkers??Un.maxWorkers,n=e?.minWorkers??Un.minWorkers;return{maxWorkers:Math.max(1,t),minWorkers:Math.max(0,Math.min(n,t)),idleTimeout:Math.max(0,e?.idleTimeout??Un.idleTimeout),useTransferables:e?.useTransferables??Un.useTransferables,workerUrl:e?.workerUrl}}let Gn={high:3,normal:2,low:1};function Kn(e){return e?Gn[e]??Gn.normal:Gn.normal}function qn(){return typeof Worker<`u`&&typeof Blob<`u`}function Jn(){return`
|
|
8
8
|
'use strict';
|
|
9
9
|
|
|
10
10
|
// Check deflate-raw support once at startup
|